PageSourceSearch

https://app.napkin.ai/bundle/text-web-lib/tiptap/bundle.js?t=1790233294

js napkin.ai collected 2026-09-24 09:24:34 UTC 1,005,650 bytes, 2 lines download raw bytes

1var tiptap;(()=>{"use strict";var t={9320(t,e,n){n.r(e),n.d(e,{BubbleMenuOptions:()=>aD,ContentOptions:()=>sD,LineInViewport:()=>cD,PositionFromHook:()=>lD,PositionRange:()=>dD,TipTap:()=>uD,TipTapLabel:()=>DO,YJSProvider:()=>KT,mergeYjsUpdates:()=>OO});var r=n.cw(function(t,e){var n=[];function r(t){for(var e=-1,r=0;r<n.length;r++)if(n[r].identifier===t){e=r;break}return e}function o(t,e){for(var o={},s=[],a=0;a<t.length;a++){var l=t[a],c=e.base?l[0]+e.base:l[0],d=o[c]||0,u="".concat(c," ").concat(d);o[c]=d+1;var h=r(u),p={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==h)n[h].references++,n[h].updater(p);else{var f=i(p,e);e.byIndex=a,n.splice(a,0,{identifier:u,updater:f,references:1})}s.push(u)}return s}function i(t,e){var n=e.domAPI(e);return n.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,e){var i=o(t=t||[],e=e||{});return function(t){t=t||[];for(var s=0;s<i.length;s++){var a=r(i[s]);n[a].references--}for(var l=o(t,e),c=0;c<i.length;c++){var d=r(i[c]);0===n[d].references&&(n[d].updater(),n.splice(d,1))}i=l}}}),o=n.cw(function(t,e){var n={};t.exports=function(t,e){var r=function(t){if(void 0===n[t]){var e=document.querySelector(t);if(window.HTMLIFrameElement&&e instanceof window.HTMLIFrameElement)try{e=e.contentDocument.head}catch(t){e=null}n[t]=e}return n[t]}(t);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(e)}}),i=n.cw(function(t,e){t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}}),s=n.cw(function(t,e){t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}}),a=n.cw(function(t,e){t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleTagTransform(r,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}}),l=n.cw(function(t,e){t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}}),c=()=>n(4644),d=()=>n(9039),u=()=>n(9565),h=()=>n(4576),p=n.cw(function(t,e){var r=n(6518),o=n(9617).m,i=d(),s=n(6469),a=i(function(){return!Array(1).includes()}),l=i(function(){return[,1].includes(void 0,1)});r({target:"Array",proto:!0,forced:a||l},{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),s("includes")}),f=n.cw(function(t,e){var r=c(),o=n(4373),i=n(5854),s=n(6955),a=u(),l=n(9504),h=d(),p=r.aTypedArray,f=r.exportTypedArrayMethod,g=l("".slice);f("fill",function(t){var e=arguments.length;p(this);var n="Big"===g(s(this),0,3)?i(t):+t;return a(o,this,n,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)},h(function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),1!==t}))}),g=n.cw(function(t,e){var r=h(),o=u(),i=c(),s=n(6198),a=n(8229),l=n(8981),p=d(),f=r.RangeError,g=r.Int8Array,m=g&&g.prototype,A=m&&m.set,y=i.aTypedArray,b=i.exportTypedArrayMethod,v=!p(function(){var t=new Uint8ClampedArray(2);return o(A,t,{length:1,0:3},1),3!==t[1]}),w=v&&i.NATIVE_ARRAY_BUFFER_VIEWS&&p(function(){var t=new g(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]});b("set",function(t){y(this);var e=a(arguments.length>1?arguments[1]:void 0,1),n=l(t);if(v)return o(A,this,n,e);var r=this.length,i=s(n),c=0;if(i+e>r)throw new f("Wrong length");for(;c<i;)this[e+c]=n[c++]},!v||w)}),m=n.cw(function(t,e){var r=h(),o=n(7476),i=d(),s=n(9306),a=n(4488),l=c(),u=n(3709),p=n(3763),f=n(9519),g=n(3607),m=l.aTypedArray,A=l.exp
1ortTypedArrayMethod,y=r.Uint16Array,b=y&&o(y.prototype.sort),v=!(!b||i(function(){b(new y(2),null)})&&i(function(){b(new y(2),{})})),w=!!b&&!i(function(){if(f)return f<74;if(u)return u<67;if(p)return!0;if(g)return g<602;var t,e,n=new y(516),r=Array(516);for(t=0;t<516;t++)e=t%4,n[t]=515-t,r[t]=t-2*e+3;for(b(n,function(t,e){return(t/4|0)-(e/4|0)}),t=0;t<516;t++)if(n[t]!==r[t])return!0});A("sort",function(t){return void 0!==t&&s(t),w?b(this,t):a(m(this),function(t){return function(e,n){return void 0!==t?+t(e,n)||0:n!=n?e!=e?0:-1:e!=e?1:0===e&&0===n?1/e>0?1/n>0?0:1:1/n>0?-1:0:e>n?1:e<n?-1:0}}(t))},!w||v)}),A={};n.r(A),n.d(A,{decode:()=>IA,encode:()=>BA,format:()=>$A,parse:()=>KA});var y={};n.r(y),n.d(y,{Any:()=>ZA,Cc:()=>XA,Cf:()=>ty,P:()=>YA,S:()=>QA,Z:()=>ey});var b={};n.r(b),n.d(b,{arrayReplaceAt:()=>ky,asciiTrim:()=>Vy,assign:()=>wy,escapeHtml:()=>Ly,escapeRE:()=>$y,fromCodePoint:()=>xy,has:()=>vy,isMdAsciiPunct:()=>Hy,isPunctChar:()=>Fy,isPunctCharCode:()=>zy,isSpace:()=>Ry,isString:()=>yy,isValidEntityCode:()=>Cy,isWhiteSpace:()=>Py,lib:()=>qy,normalizeReference:()=>jy,unescapeAll:()=>_y,unescapeMd:()=>Ty});var v={};function w(t){this.content=t}n.r(v),n.d(v,{parseLinkDestination:()=>Jy,parseLinkLabel:()=>Wy,parseLinkTitle:()=>Gy}),p(),w.prototype={constructor:w,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return-1==e?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return-1==o?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new w(i)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new w(n)},addToStart:function(t,e){return new w([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new w(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(-1==i?o.length:i,0,e,n),new w(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=w.from(t)).size?new w(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=w.from(t)).size?new w(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=w.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},w.from=function(t){if(t instanceof w)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new w(e)};const k=w;function C(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){let t=o.text,e=i.text,r=0;for(;t[r]==e[r];r++)n++;return r&&r<t.length&&r<e.length&&E(t.charCodeAt(r-1))&&S(t.charCodeAt(r))&&n--,n}if(o.content.size||i.content.size){let t=C(o.content,i.content,n+1);if(null!=t)return t}n+=o.nodeSize}else n+=o.nodeSize}}function x(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let t=s.text,e=a.text,o=t.length,i=e.length;for(;o>0&&i>0&&t[o-1]==e[i-1];)o--,i--,n--,r--;return o&&i&&o<t.length&&E(t.charCodeAt(o-1))&&S(t.charCodeAt(o))&&(n++,r++),{a:n,b:r}}if(s.content.size||a.content.size){let t=x(s.content,a.content,n-1,r-1);if(t)return t}n-=l,r-=l}else n-=l,r-=l}}function S(t){return t>=56320&&t<57344}function E(t){return t>=55296&&t<56320}class M{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let e=0;e<t.length;e++)this.size+=t[e].nodeSize}nodesBetween(t,e,n,r=0,o){for(let i=0,s=0;s<e;i++){let a=this.content[i],l=s+a.nodeSize;if(l>t&&!1!==n(a,r+s,o||null,i)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,t-o),Math.min(a.content.size,e-o),n,r+o)}s=l}}descendants(t){this.nodesBetween(0,this.size,t)}
vendor: 4,134 bytes, line 1
1textBetween(t,e,n,r){let o="",i=!0;return this.nodesBetween(t,e,(s,a)=>{let l=s.isText?s.text.slice(Math.max(t,a)-a,e-a):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&l||s.isTextblock)&&n&&(i?i=!1:o+=n),o+=l},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);o<t.content.length;o++)r.push(t.content[o]);return new M(r,this.size+t.size)}cut(t,e=this.size){if(0==t&&e==this.size)return this;let n=[],r=0;if(e>t)for(let o=0,i=0;i<e;o++){let s=this.content[o],a=i+s.nodeSize;a>t&&((i<t||a>e)&&(s=s.isText?s.cut(Math.max(0,t-i),Math.min(s.text.length,e-i)):s.cut(Math.max(0,t-i-1),Math.min(s.content.size,e-i-1))),n.push(s),r+=s.nodeSize),i=a}return new M(n,r)}cutByIndex(t,e){return t==e?M.empty:0==t&&e==this.content.length?this:new M(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new M(r,o)}addToStart(t){return new M([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new M(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))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(t){let e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,n=0;e<this.content.length;e++){let r=this.content[e];t(r,n,e),n+=r.nodeSize}}findDiffStart(t,e=0){return C(this,t,e)}findDiffEnd(t,e=this.size,n=t.size){return x(this,t,e,n)}findIndex(t){if(0==t)return _(0,t);if(t==this.size)return _(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let e=0,n=0;;e++){let r=n+this.child(e).nodeSize;if(r>=t)return r==t?_(e+1,r):_(e,n);n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,e){if(!e)return M.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return M.fromArray(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return M.empty;let e,n=0;for(let r=0;r<t.length;r++){let o=t[r];n+=o.nodeSize,r&&o.isText&&t[r-1].sameMarkup(o)?(e||(e=t.slice(0,r)),e[e.length-1]=o.withText(e[e.length-1].text+o.text)):e&&e.push(o)}return new M(e||t,n)}static from(t){if(!t)return M.empty;if(t instanceof M)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new M([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}M.empty=new M([],0);const T={index:0,offset:0};function _(t,e){return T.index=t,T.offset=e,T}function D(t,e){if(t===e)return!0;if(!t||"object"!=typeof t||!e||"object"!=typeof e)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 n=0;n<t.length;n++)if(!D(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!D(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}class O{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,n=!1;for(let r=0;r<t.length;r++){let o=t[r];if(this.eq(o))return t;if(this.type.excludes(o.type))e||(e=t.slice(0,r));else{if(o.type.excludes(this.type))return t;!n&&o.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(o)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&D(this.attrs,t.attrs)}
1toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");let n=t.marks[e.type];if(!n)throw new RangeError(`There is no mark type ${e.type} in this schema`);let r=n.create(e.attrs);return n.checkAttrs(r.attrs),r}static sameSet(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&0==t.length)return O.none;if(t instanceof O)return[t];let e=t.slice();return e.sort((t,e)=>t.type.rank-e.type.rank),e}}O.none=[];class I extends Error{}class N{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=B(this.content,t+this.openStart,e,this.openStart+1,this.openEnd+1);return n&&new N(n,this.openStart,this.openEnd)}removeBetween(t,e){return new N(L(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return N.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new N(M.fromJSON(t,e.content),n,r)}static maxOpen(t,e=!0){let n=0,r=0;for(let r=t.firstChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=t.lastChild;n&&!n.isLeaf&&(e||!n.type.spec.isolating);n=n.lastChild)r++;return new N(t,n,r)}}function L(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(L(i.content,e-o-1,n-o-1)))}function B(t,e,n,r,o,i){let{index:s,offset:a}=t.findIndex(e),l=t.maybeChild(s);if(a==e||l.isText)return i&&r<=0&&o<=0&&!i.canReplace(s,s,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=B(l.content,e-a-1,n,0==s?r-1:0,s==t.childCount-1?o-1:0,l);return c&&t.replaceChild(s,l.copy(c))}function $(t,e,n){if(n.openStart>t.depth)throw new I("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new I("Inconsistent open depths");return R(t,e,n,0)}function R(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=R(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=r||e.depth!=r){let{start:o,end:s}=function(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let t=n-1;t>=0;t--)r=e.node(t).copy(M.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return j(i,U(t,o,s,e,r))}{let r=t.parent,o=r.content;return j(r,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}}return j(i,V(t,e,r))}function P(t,e){if(!e.type.compatibleContent(t.type))throw new I("Cannot join "+e.type.name+" onto "+t.type.name)}function F(t,e,n){let r=t.node(n);return P(r,e.node(n)),r}function z(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function H(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(z(t.nodeAfter,r),i++));for(let t=i;t<s;t++)z(o.child(t),r);e&&e.depth==n&&e.textOffset&&z(e.nodeBefore,r)}function j(t,e){if(!t.type.validContent(e))throw new I("Invalid content for node "+t.type.name);return t.copy(e)}function U(t,e,n,r,o){let i=t.depth>o&&F(t,e,o+1),s=r.depth>o&&F(n,r,o+1),a=[];return H(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(P(i,s),z(j(i,U(t,e,n,r,o+1)),a)):(i&&z(j(i,V(t,e,o+1)),a),H(e,n,o,a),s&&z(j(s,V(n,r,o+1)),a)),H(r,null,o,a),new M(a)}function V(t,e,n){let r=[];return H(null,t,n,r),t.depth>n&&z(j(F(t,e,n+1),V(t,e,n+1)),r),H(e,null,n,r),new M(r)}N.empty=new N(M.empty,0,0);class q{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let e=0;e<t;e++)r+=n.child(e).nodeSize;return r}marks(){let t=this.parent,e=this.index();if(0==t.content.size)return O.none;if(this.textOffset)return t.child(e).marks;let n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){let t=n;n=r,r=t}let o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}marksAcross(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let n=e.marks,r=t.parent.maybeChild(t.index());for(var o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n}sharedDepth(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos<this.pos)return t.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new K(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let n=[],r=0,o=e;for(let e=t;;){let{index:t,offset:i}=e.content.findIndex(o),s=o-i;if(n.push(e,t,r+i),!s)break;if(e=e.child(t),e.isText)break;o=s-1,r+=i+1}return new q(e,n,o)}
vendor: 4,349 bytes, line 1
1static resolveCached(t,e){let n=G.get(t);if(n)for(let t=0;t<n.elts.length;t++){let r=n.elts[t];if(r.pos==e)return r}else G.set(t,n=new W);let r=n.elts[n.i]=q.resolve(t,e);return n.i=(n.i+1)%J,r}}class W{constructor(){this.elts=[],this.i=0}}const J=12,G=new WeakMap;class K{constructor(t,e,n){this.$from=t,this.$to=e,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Y=Object.create(null);class Q{constructor(t,e,n,r=O.none){this.type=t,this.attrs=e,this.marks=r,this.content=n||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(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,e,n,r=0){this.content.nodesBetween(t,e,n,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,e,n,r){return this.content.textBetween(t,e,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,e,n){return this.type==t&&D(this.attrs,e||t.defaultAttrs||Y)&&O.sameSet(this.marks,n||O.none)}copy(t=null){return t==this.content?this:new Q(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new Q(this.type,this.attrs,this.content,t)}cut(t,e=this.content.size){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t,e=this.content.size,n=!1){if(t==e)return N.empty;let r=this.resolve(t),o=this.resolve(e),i=n?0:r.sharedDepth(e),s=r.start(i),a=r.node(i).content.cut(r.pos-s,o.pos-s);return new N(a,r.depth-i,o.depth-i)}replace(t,e,n){return $(this.resolve(t),this.resolve(e),n)}nodeAt(t){for(let e=this;;){let{index:n,offset:r}=e.content.findIndex(t);if(e=e.maybeChild(n),!e)return null;if(r==t||e.isText)return e;t-=r+1}}childAfter(t){let{index:e,offset:n}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:n}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:e,offset:n}=this.content.findIndex(t);if(n<t)return{node:this.content.child(e),index:e,offset:n};let r=this.content.child(e-1);return{node:r,index:e-1,offset:n-r.nodeSize}}resolve(t){return q.resolveCached(this,t)}resolveNoCache(t){return q.resolve(this,t)}rangeHasMark(t,e,n){let r=!1;return e>t&&this.nodesBetween(t,e,t=>(n.isInSet(t.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),X(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=M.empty,r=0,o=n.childCount){let i=this.contentMatchAt(t).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(let t=r;t<o;t++)if(!this.type.allowsMarks(n.child(t).marks))return!1;return!0}canReplaceWith(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(t).matchType(n),i=o&&o.matchFragment(this.content,e);return!!i&&i.validEnd}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=O.none;for(let e=0;e<this.marks.length;e++){let n=this.marks[e];n.type.checkAttrs(n.attrs),t=n.addToSet(t)}if(!O.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}
1`);this.content.forEach(t=>t.check())}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(t=>t.toJSON())),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=M.fromJSON(t,e.content),o=t.nodeType(e.type).create(e.attrs,r,n);return o.type.checkAttrs(o.attrs),o}}Q.prototype.text=void 0;class Z extends Q{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):X(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Z(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Z(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function X(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class tt{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new et(t,e);if(null==n.next)return tt.empty;let r=nt(n);n.next&&n.err("Unexpected trailing text");let o=function(t){let e=Object.create(null);return function n(r){let o=[];r.forEach(e=>{t[e].forEach(({term:e,to:n})=>{if(!e)return;let r;for(let t=0;t<o.length;t++)o[t][0]==e&&(r=o[t][1]);lt(t,n).forEach(t=>{r||o.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)})})});let i=e[r.join(",")]=new tt(r.indexOf(t.length-1)>-1);for(let t=0;t<o.length;t++){let r=o[t][1].sort(at);i.next.push({type:o[t][0],next:e[r.join(",")]||n(r)})}return i}(lt(t,0))}(function(t){let e=[[]];return o(function t(e,i){if("choice"==e.type)return e.exprs.reduce((e,n)=>e.concat(t(n,i)),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(i,s),o(t(e.expr,s),s),[r(s)]}if("plus"==e.type){let s=n();return o(t(e.expr,i),s),o(t(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(i)].concat(t(e.expr,i));if("range"==e.type){let s=i;for(let r=0;r<e.min;r++){let r=n();o(t(e.expr,s),r),s=r}if(-1==e.max)o(t(e.expr,s),s);else for(let i=e.min;i<e.max;i++){let i=n();r(s,i),o(t(e.expr,s),i),s=i}return[r(s)]}if("name"==e.type)return[r(i,void 0,e.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=t(e.exprs[r],i);if(r==e.exprs.length-1)return s;o(s,i=n())}}(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){let o={term:r,to:n};return e[t].push(o),o}function o(t,e){t.forEach(t=>t.to=e)}}(r));return function(t,e){for(let n=0,r=[t];n<r.length;n++){let t=r[n],o=!t.validEnd,i=[];for(let e=0;e<t.next.length;e++){let{type:n,next:s}=t.next[e];i.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==r.indexOf(s)&&r.push(s)}o&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t,e=0,n=t.childCount){let r=this;for(let o=e;r&&o<n;o++)r=r.matchType(t.child(o).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!e.isText&&!e.hasRequiredAttrs())return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}fillBefore(t,e=!1,n=0){let r=[this];return function o(i,s){let a=i.matchFragment(t,n);if(a&&(!e||a.validEnd))return M.from(s.map(t=>t.createAndFill()));for(let t=0;t<i.next.length;t++){let{type:e,next:n}=i.next[t];if(!e.isText&&!e.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let t=o(n,s.concat(e));if(t)return t}}return null}(this,[])}findWrapping(t){for(let e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),o=r.match;if(o.matchType(t)){let t=[];for(let e=r;e.type;e=e.via)t.push(e.type);return t.reverse()}for(let t=0;t<o.next.length;t++){let{type:i,next:s}=o.next[t];i.isLeaf||i.hasRequiredAttrs()||i.name in e||r.type&&!s.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),e[i.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return function e(n){t.push(n);for(let r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)}(this),t.map((e,n)=>{let r=n+(e.validEnd?"*":" ")+" ";for(let n=0;n<e.next.length;n++)r+=(n?", ":"")+e.next[n].type.name+"->"+t.indexOf(e.next[n].next);return r}).join("\n")}}tt.empty=new tt(!0);class et{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?
1=\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(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function nt(t){let e=[];do{e.push(rt(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function rt(t){let e=[];do{e.push(ot(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function ot(t){let e=function(t){if(t.eat("(")){let e=nt(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){let e=function(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let t in n){let r=n[t];r.isInGroup(e)&&o.push(r)}return 0==o.length&&t.err("No node type or group '"+e+"' found"),o}(t,t.next).map(e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}t.err("Unexpected token '"+t.next+"'")}(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("{"))break;e=st(t,e)}return e}function it(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function st(t,e){let n=it(t),r=n;return t.eat(",")&&(r="}"!=t.next?it(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function at(t,e){return e-t}function lt(t,e){let n=[];return function e(r){let o=t[r];if(1==o.length&&!o[0].term)return e(o[0].to);n.push(r);for(let t=0;t<o.length;t++){let{term:r,to:i}=o[t];r||-1!=n.indexOf(i)||e(i)}}(e),n.sort(at)}function ct(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function dt(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(void 0===o){let e=t[r];if(!e.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=e.default}n[r]=o}return n}function ut(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${r}`);for(let n in t)t[n].validate&&t[n].validate(e[n])}function ht(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new ft(t,r,e[r]);return n}class pt{constructor(t,e,n){this.name=t,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=ht(t,n.attrs),this.defaultAttrs=ct(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==tt.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:dt(this.attrs,t)}create(t=null,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Q(this,this.computeAttrs(t),M.from(e),O.setFrom(n))}createChecked(t=null,e,n){return e=M.from(e),this.checkContent(e),new Q(this,this.computeAttrs(t),e,O.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),(e=M.from(e)).size){let t=this.contentMatch.fillBefore(e);if(!t)return null;e=t.append(e)}let r=this.contentMatch.matchFragment(e),o=r&&r.fillBefore(M.empty,!0);return o?new Q(this,t,e.append(o),O.setFrom(n)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let e=0;e<t.childCount;e++)if(!this.allowsMarks(t.child(e).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){ut(this.attrs,t,"node",this.name)}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){if(null==this.markSet)return t;let e;for(let n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:O.none:t}static compile(t,e){let n=Object.create(null);t.forEach((t,r)=>n[t]=new pt(t,e,r));let r=e.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");
1if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let t in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class ft{constructor(t,e,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(t,e,n){let r=n.split("|");return n=>{let o=null===n?"null":typeof n;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`)}}(t,e,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class gt{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=ht(t,r.attrs),this.excluded=null;let o=ct(this.attrs);this.instance=o?new O(this,o):null}create(t=null){return!t&&this.instance?this.instance:new O(this,dt(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach((t,o)=>n[t]=new gt(t,r++,e,o)),n}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}checkAttrs(t){ut(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class mt{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let e=this.spec={};for(let n in t)e[n]=t[n];e.nodes=k.from(t.nodes),e.marks=k.from(t.marks||{}),this.nodes=pt.compile(this.spec.nodes,this),this.marks=gt.compile(this.spec.marks,this);let n=Object.create(null);for(let t in this.nodes){if(t in this.marks)throw new RangeError(t+" can not be both a node and a mark");let e=this.nodes[t],r=e.spec.content||"",o=e.spec.marks;if(e.contentMatch=n[r]||(n[r]=tt.parse(r,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!e.isInline||!e.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=e}e.markSet="_"==o?null:o?At(this,o.split(" ")):""!=o&&e.inlineContent?null:[]}for(let t in this.marks){let e=this.marks[t],n=e.spec.excludes;e.excluded=null==n?[e]:""==n?[]:At(this,n.split(" "))}this.nodeFromJSON=t=>Q.fromJSON(this,t),this.markFromJSON=t=>O.fromJSON(this,t),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof pt))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new Z(n,n.defaultAttrs,t,O.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function At(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(let e in t.marks){let r=t.marks[e];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class yt{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[];let n=this.matchedStyles=[];e.forEach(t=>{if(function(t){return null!=t.tag}(t))this.tags.push(t);else if(function(t){return null!=t.style}(t)){let e=/[^=]*/.exec(t.style)[0];n.indexOf(e)<0&&n.push(e),this.styles.push(t)}}),this.normalizeLists=!this.tags.some(e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)})}parse(t,e={}){let n=new xt(this,e,!1);return n.addAll(t,O.none,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new xt(this,e,!0);return n.addAll(t,O.none,e.from,e.to),N.maxOpen(n.finish())}matchTag(t,e,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(St(t,n.tag)&&(void 0===n.namespace||t.namespaceURI==n.namespace)&&(!n.context||e.matchesContext(n.context))){if(n.getAttrs){let e=n.getAttrs(t);if(!1===e)continue;n.attrs=e||void 0}return n}}}matchStyle(t,e,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(!(0!=i.indexOf(t)||r.context&&!n.matchesContext(r.context)||i.length>t.length&&(61!=i.charCodeAt(t.length)||i.slice(t.length+1)!=e))){if(r.getAttrs
1){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r<e.length;r++){let t=e[r];if((null==t.priority?50:t.priority)<n)break}e.splice(r,0,t)}for(let e in t.marks){let r=t.marks[e].spec.parseDOM;r&&r.forEach(t=>{n(t=Et(t)),t.mark||t.ignore||t.clearMark||(t.mark=e)})}for(let e in t.nodes){let r=t.nodes[e].spec.parseDOM;r&&r.forEach(t=>{n(t=Et(t)),t.node||t.ignore||t.mark||(t.node=e)})}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new yt(t,yt.schemaRules(t)))}}const bt={address:!0,article:!0,aside:!0,blockquote:!0,body:!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},vt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},wt={ol:!0,ul:!0};function kt(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class Ct{constructor(t,e,n,r,o,i){this.type=t,this.attrs=e,this.marks=n,this.solid=r,this.options=i,this.content=[],this.activeMarks=O.none,this.match=o||(4&i?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(M.from(t));if(!e){let e,n=this.type.contentMatch;return(e=n.findWrapping(t.type))?(this.match=n,e):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t,e=this.content[this.content.length-1];if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let e=M.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(M.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!bt.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class xt{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r,o=e.topNode,i=kt(null,e.preserveWhitespace,0)|(n?4:0);r=o?new Ct(o.type,o.attrs,O.none,!0,e.topMatch||o.type.contentMatch,i):new Ct(n?null:t.schema.topNodeType,null,O.none,!0,null,i),this.nodes=[r],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,e){3==t.nodeType?this.addTextNode(t,e):1==t.nodeType&&this.addElement(t,e)}addTextNode(t,e){let n=t.nodeValue,r=this.top,o=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:i}=this.parser;if("full"===o||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(o)if("full"===o)n=n.replace(/\r\n?/g,"\n");else if(i.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(i.linebreakReplacement.create())){let t=n.split(/\r?\n|\r/);for(let n=0;n<t.length;n++)n&&this.insertNode(i.linebreakReplacement.create(),e,!0),t[n]&&this.insertNode(i.text(t[n]),e,!/\S/.test(t[n]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let e=r.content[r.content.length-1],o=t.previousSibling;
1(!e||o&&"BR"==o.nodeName||e.isText&&/[ \t\r\n\u000c]$/.test(e.text))&&(n=n.slice(1))}n&&this.insertNode(i.text(n),e,!/\S/.test(n)),this.findInText(t)}else this.findInside(t)}addElement(t,e,n){let r=this.localPreserveWS,o=this.top;("PRE"==t.tagName||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let i,s=t.nodeName.toLowerCase();wt.hasOwnProperty(s)&&this.parser.normalizeLists&&function(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let t=1==e.nodeType?e.nodeName.toLowerCase():null;t&&wt.hasOwnProperty(t)&&n?(n.appendChild(e),e=n):"li"==t?n=e:t&&(n=null)}}(t);let a=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,n));t:if(a?a.ignore:vt.hasOwnProperty(s))this.findInside(t),this.ignoreFallback(t,e);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(t=a.skip);let n,r=this.needsBlock;if(bt.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),n=!0,o.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,e);break t}let i=a&&a.skip?e:this.readStyles(t,e);i&&this.addAll(t,i),n&&this.sync(o),this.needsBlock=r}else{let n=this.readStyles(t,e);n&&this.addElementByRule(t,a,n,!1===a.consuming?i:void 0)}this.localPreserveWS=r}leafFallback(t,e){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"),e)}ignoreFallback(t,e){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),e,!0)}readStyles(t,e){let n=t.style;if(n&&n.length)for(let t=0;t<this.parser.matchedStyles.length;t++){let r=this.parser.matchedStyles[t],o=n.getPropertyValue(r);if(o)for(let t;;){let n=this.parser.matchStyle(r,o,this,t);if(!n)break;if(n.ignore)return null;if(e=n.clearMark?e.filter(t=>!n.clearMark(t)):e.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1!==n.consuming)break;t=n}}return e}addElementByRule(t,e,n,r){let o,i;if(e.node)if(i=this.parser.schema.nodes[e.node],i.isLeaf)this.insertNode(i.create(e.attrs),n,"BR"==t.nodeName)||this.leafFallback(t,n);else{let t=this.enter(i,e.attrs||null,n,e.preserveWhitespace);t&&(o=!0,n=t)}else{let t=this.parser.schema.marks[e.mark];n=n.concat(t.create(e.attrs))}let s=this.top;if(i&&i.isLeaf)this.findInside(t);else if(r)this.addElement(t,n,r);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach(t=>this.insertNode(t,n,!1));else{let r=t;"string"==typeof e.contentElement?r=t.querySelector(e.contentElement):"function"==typeof e.contentElement?r=e.contentElement(t):e.contentElement&&(r=e.contentElement),this.findAround(t,r,!0),this.addAll(r,n),this.findAround(t,r,!1)}o&&this.sync(s)&&this.open--}addAll(t,e,n,r){let o=n||0;for(let i=n?t.childNodes[n]:t.firstChild,s=null==r?null:t.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(i,e);this.findAtPoint(t,o)}findPlace(t,e,n){let r,o;for(let e=this.open,i=0;e>=0;e--){let s=this.nodes[e],a=s.findWrapping(t);if(a&&(!r||r.length>a.length+i)&&(r=a,o=s,!a.length))break;if(s.solid){if(n)break;i+=2}}if(!r)return null;this.sync(o);for(let t=0;t<r.length;t++)e=this.enterInner(r[t],null,e,!1);return e}insertNode(t,e,n){if(t.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&(e=this.enterInner(t,null,e))}let r=this.findPlace(t,e,n);if(r){this.closeExtra();let e=this.top;e.match&&(e.match=e.match.matchType(t.type));let n=O.none;for(let o of r.concat(t.marks))(e.type?e.type.allowsMarkType(o.type):Mt(o.type,t.type))&&(n=o.addToSet(n));return e.content.push(t.mark(n)),!0}return!1}enter(t,e,n,r){let o=this.findPlace(t.create(e),n,!1);return o&&(o=this.enterInner(t,e,n,!0,r)),o}enterInner(t,e,n,r=!1,o){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(t);let s=kt(t,o,i.options);4&i.options&&0==i.content.length&&(s|=4);let a=O.none;return n=n.filter(e=>!(i.type?i.type.allowsMarkType(e.type):Mt(e.type,t))||(a=e.addToSet(a),!1)),this.nodes.push(new Ct(t,e,a,r,null,s)),this.open++,n}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));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(t){for(let e=this.open;e>=0;e--){if(this.nodes[e]==t)return this.open=e,!0;this.localPreserveWS&&(this.nodes[e].options|=1)}return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,n){if(t!=e&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)&&e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),o=-(n?n.depth+1:0)+(r?0:1),i=(t,s)=>{for(;t>=0;t--){let a=e[t];
1if(""==a){if(t==e.length-1||0==t)continue;for(;s>=o;s--)if(i(t-1,s))return!0;return!1}{let t=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!t||t.name!=a&&!t.isInGroup(a))return!1;s--}}return!0};return i(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}}function St(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Et(t){let e={};for(let n in t)e[n]=t[n];return e}function Mt(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=t=>{i.push(t);for(let n=0;n<t.edgeCount;n++){let{type:r,next:o}=t.edge(n);if(r==e)return!0;if(i.indexOf(o)<0&&s(o))return!0}};if(s(o.contentMatch))return!0}}class Tt{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},n){n||(n=Dt(e).createDocumentFragment());let r=n,o=[];return t.forEach(t=>{if(o.length||t.marks.length){let n=0,i=0;for(;n<o.length&&i<t.marks.length;){let e=t.marks[i];if(this.marks[e.type.name]){if(!e.eq(o[n][0])||!1===e.type.spec.spanning)break;n++,i++}else i++}for(;n<o.length;)r=o.pop()[1];for(;i<t.marks.length;){let n=t.marks[i++],s=this.serializeMark(n,t.isInline,e);s&&(o.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(t,e))}),n}serializeNodeInner(t,e){if(t.isText)return Dt(e).createTextNode(t.text);let{dom:n,contentDOM:r}=It(Dt(e),this.nodes[t.type.name](t),null,t.attrs);if(r){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,r)}return n}serializeNode(t,e={}){let n=this.serializeNodeInner(t,e);for(let r=t.marks.length-1;r>=0;r--){let o=this.serializeMark(t.marks[r],t.isInline,e);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&It(Dt(n),r(t,e),null,t.attrs)}static renderSpec(t,e,n=null,r){return"string"==typeof e?{dom:t.createTextNode(e)}:It(t,e,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Tt(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=_t(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return _t(t.marks)}}function _t(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Dt(t){return t.document||window.document}const Ot=new WeakMap;function It(t,e,n,r){if(1==e.nodeType)return{dom:e};if(e.dom&&1==e.dom.nodeType)return e;let o,i=e[0];if("string"!=typeof i)throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=function(t){let e=Ot.get(t);return void 0===e&&Ot.set(t,e=function(t){let e=null;return function t(n){if(n&&"object"==typeof n)if(Array.isArray(n))if("string"==typeof n[0])e||(e=[]),e.push(n);else for(let e=0;e<n.length;e++)t(n[e]);else for(let e in n)t(n[e])}(t),e}(t)),e}(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,a=i.indexOf(" ");a>0&&(n=i.slice(0,a),i=i.slice(a+1));let l=n?t.createElementNS(n,i):t.createElement(i),c=e[1],d=1;if(c&&"object"==typeof c&&null==c.nodeType&&!Array.isArray(c)){d=2;for(let t in c)if(null!=c[t]){let e=t.indexOf(" ");e>0?l.setAttributeNS(t.slice(0,e),t.slice(e+1),c[t]):"style"==t&&l.style?l.style.cssText=c[t]:l.setAttribute(t,c[t])}}for(let o=d;o<e.length;o++){let i=e[o];if(0===i){if(o<e.length-1||o>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}if("string"==typeof i)l.appendChild(t.createTextNode(i));else{let{dom:e,contentDOM:o}=It(t,i,n,r);if(l.appendChild(e),o){if(s)throw new RangeError("Multiple content holes");s=o}}}return{dom:l,contentDOM:s}}const Nt=Math.pow(2,16);function Lt(t,e){return t+e*Nt}function Bt(t){return 65535&t}class $t{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class Rt{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&Rt.empty)return Rt.empty}recover(t){let e=0,n=Bt(t);if(!this.inverted)for(let t=0;t<n;t++)e+=this.ranges[3*t+2]-this.ranges[3*t+1];return this.ranges[3*n]+e+function(t){return(t-(65535&t))/Nt}(t)}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,n){let r=0,o=this.inverted?2:1,i=this.inverted?1:2;
1for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>t)break;let l=this.ranges[s+o],c=this.ranges[s+i],d=a+l;if(t<=d){let o=a+r+((l?t==a?-1:t==d?1:e:e)<0?0:c);if(n)return o;let i=t==(e<0?a:d)?null:Lt(s/3,t-a),u=t==a?2:t==d?1:4;return(e<0?t!=a:t!=d)&&(u|=8),new $t(o,u,i)}r+=c-l}return n?t+r:new $t(t+r,0,null)}touches(t,e){let n=0,r=Bt(e),o=this.inverted?2:1,i=this.inverted?1:2;for(let e=0;e<this.ranges.length;e+=3){let s=this.ranges[e]-(this.inverted?n:0);if(s>t)break;let a=this.ranges[e+o];if(t<=s+a&&e==3*r)return!0;n+=this.ranges[e+i]-a}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),l=this.ranges[r+e],c=this.ranges[r+n];t(s,s+l,a,a+c),o+=c-l}}invert(){return new Rt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?Rt.empty:new Rt(t<0?[0,-t,0]:[0,0,t])}}Rt.empty=new Rt([]);class Pt{constructor(t,e,n=0,r=(t?t.length:0)){this.mirror=e,this.from=n,this.to=r,this._maps=t||[],this.ownData=!(t||e)}get maps(){return this._maps}slice(t=0,e=this.maps.length){return new Pt(this._maps,this.mirror,t,e)}appendMap(t,e){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),null!=e&&this.setMirror(this._maps.length-1,e)}appendMapping(t){for(let e=0,n=this._maps.length;e<t._maps.length;e++){let r=t.getMirror(e);this.appendMap(t._maps[e],null!=r&&r<e?n+r:void 0)}}getMirror(t){if(this.mirror)for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}setMirror(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}appendMappingInverted(t){for(let e=t.maps.length-1,n=this._maps.length+t._maps.length;e>=0;e--){let r=t.getMirror(e);this.appendMap(t._maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}invert(){let t=new Pt;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;n<this.to;n++)t=this._maps[n].map(t,e);return t}mapResult(t,e=1){return this._map(t,e,!1)}_map(t,e,n){let r=0;for(let n=this.from;n<this.to;n++){let o=this._maps[n].mapResult(t,e);if(null!=o.recover){let e=this.getMirror(n);if(null!=e&&e>n&&e<this.to){n=e,t=this._maps[e].recover(o.recover);continue}}
vendor: 4,234 bytes, line 1
1r|=o.delInfo,t=o.pos}return n?t:new $t(t,r,null)}}const Ft=Object.create(null);class zt{getMap(){return Rt.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Ft[e.stepType];if(!n)throw new RangeError(`No step type ${e.stepType} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in Ft)throw new RangeError("Duplicate use of step JSON ID "+t);return Ft[t]=e,e.prototype.jsonID=t,e}}class Ht{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new Ht(t,null)}static fail(t){return new Ht(null,t)}static fromReplace(t,e,n,r){try{return Ht.ok(t.replace(e,n,r))}catch(t){if(t instanceof I)return Ht.fail(t.message);throw t}}}function jt(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(jt(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return M.fromArray(r)}class Ut extends zt{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=t.resolve(this.from),r=n.node(n.sharedDepth(this.to)),o=new N(jt(e.content,(t,e)=>t.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t,r),e.openStart,e.openEnd);return Ht.fromReplace(t,this.from,this.to,o)}invert(){return new Vt(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new Ut(e.pos,n.pos,this.mark)}merge(t){return t instanceof Ut&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ut(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ut(e.from,e.to,t.markFromJSON(e.mark))}}zt.jsonID("addMark",Ut);class Vt extends zt{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new N(jt(e.content,t=>t.mark(this.mark.removeFromSet(t.marks)),t),e.openStart,e.openEnd);return Ht.fromReplace(t,this.from,this.to,n)}invert(){return new Ut(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new Vt(e.pos,n.pos,this.mark)}merge(t){return t instanceof Vt&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Vt(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Vt(e.from,e.to,t.markFromJSON(e.mark))}}zt.jsonID("removeMark",Vt);class qt extends zt{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return Ht.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return Ht.fromReplace(t,this.pos,this.pos+1,new N(M.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;n<e.marks.length;n++)if(!e.marks[n].isInSet(t))return new qt(this.pos,e.marks[n]);return new qt(this.pos,this.mark)}}return new Wt(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new qt(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new qt(e.pos,t.markFromJSON(e.mark))}}zt.jsonID("addNodeMark",qt);class Wt extends zt{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return Ht.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return Ht.fromReplace(t,this.pos,this.pos+1,new N(M.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new qt(this.pos,this.mark):this}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new Wt(e.pos,this.mark)}
1toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Wt(e.pos,t.markFromJSON(e.mark))}}zt.jsonID("removeNodeMark",Wt);class Jt extends zt{constructor(t,e,n,r=!1){super(),this.from=t,this.to=e,this.slice=n,this.structure=r}apply(t){return this.structure&&Kt(t,this.from,this.to)?Ht.fail("Structure replace would overwrite content"):Ht.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Rt([this.from,this.to-this.from,this.slice.size])}invert(t){return new Jt(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.to,-1),n=this.from==this.to&&Jt.MAP_BIAS<0?e:t.mapResult(this.from,1);return n.deletedAcross&&e.deletedAcross?null:new Jt(n.pos,Math.max(n.pos,e.pos),this.slice,this.structure)}merge(t){if(!(t instanceof Jt)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let e=this.slice.size+t.slice.size==0?N.empty:new N(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Jt(t.from,this.to,e,this.structure)}}{let e=this.slice.size+t.slice.size==0?N.empty:new N(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Jt(this.from,this.to+(t.to-t.from),e,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Jt(e.from,e.to,N.fromJSON(t,e.slice),!!e.structure)}}Jt.MAP_BIAS=1,zt.jsonID("replace",Jt);class Gt extends zt{constructor(t,e,n,r,o,i,s=!1){super(),this.from=t,this.to=e,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(t){if(this.structure&&(Kt(t,this.from,this.gapFrom)||Kt(t,this.gapTo,this.to)))return Ht.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return Ht.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,e.content);return n?Ht.fromReplace(t,this.from,this.to,n):Ht.fail("Content does not fit in gap")}getMap(){return new Rt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new Gt(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1),r=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?n.pos:t.map(this.gapTo,1);return e.deletedAcross&&n.deletedAcross||r<e.pos||o>n.pos?null:new Gt(e.pos,n.pos,r,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Gt(e.from,e.to,e.gapFrom,e.gapTo,N.fromJSON(t,e.slice),e.insert,!!e.structure)}}function Kt(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let t=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,o--}}return!1}function Yt(t,e,n,r=n.contentMatch,o=!0){let i=t.doc.nodeAt(e),s=[],a=e+1;for(let e=0;e<i.childCount;e++){let l=i.child(e),c=a+l.nodeSize,d=r.matchType(l.type);if(d){r=d;for(let e=0;e<l.marks.length;e++)n.allowsMarkType(l.marks[e].type)||t.step(new Vt(a,c,l.marks[e]));if(o&&l.isText&&"pre"!=n.whitespace){let t,e,r=/\r?\n|\r/g;
1for(;t=r.exec(l.text);)e||(e=new N(M.from(n.schema.text(" ",n.allowedMarks(l.marks))),0,0)),s.push(new Jt(a+t.index,a+t.index+t[0].length,e))}}else s.push(new Jt(a,c,N.empty));a=c}if(!r.validEnd){let e=r.fillBefore(M.empty,!0);t.replace(a,a,new N(e,0,0))}for(let e=s.length-1;e>=0;e--)t.step(s[e])}function Qt(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Zt(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth,r=0,o=0;;--n){let i=t.$from.node(n),s=t.$from.index(n)+r,a=t.$to.indexAfter(n)-o;if(n<t.depth&&i.canReplace(s,a,e))return n;if(0==n||i.type.spec.isolating||!Qt(i,s,a))break;s&&(r=1),a<i.childCount&&(o=1)}return null}function Xt(t,e,n=null,r=t){let o=function(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}(t,e),i=o&&function(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let t=r;a&&t<o;t++)a=a.matchType(n.child(t).type);return a&&a.validEnd?s:null}(r,e);return i?o.map(te).concat({type:e,attrs:n}).concat(i.map(te)):null}function te(t){return{type:t,attrs:null}}function ee(t,e,n,r){e.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let o=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(o,o+1,e.type.schema.linebreakReplacement.create())}}})}function ne(t,e,n,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+i);t.replaceWith(o,o+1,e.type.schema.text("\n"))}})}function re(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let t=o.depth-1,e=n-2;t>i;t--,e--){let n=o.node(t),i=o.index(t);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(i,n.childCount),a=r&&r[e+1];a&&(s=s.replaceChild(0,a.type.create(a.attrs)));let l=r&&r[e]||n;if(!n.canReplace(i+1,n.childCount)||!l.type.validContent(s))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function oe(t,e){let n=t.resolve(e),r=n.index();return ie(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function ie(t,e){return!(!t||!e||t.isLeaf||!function(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let i=e.child(o),s=i.type==r?t.type.schema.nodes.text:i.type;if(n=n.matchType(s),!n)return!1;if(!t.type.allowsMarks(i.marks))return!1}return n.validEnd}(t,e))}function se(t,e,n=-1){let r=t.resolve(e);for(let t=r.depth;;t--){let o,i,s=r.index(t);if(t==r.depth?(o=r.nodeBefore,i=r.nodeAfter):n>0?(o=r.node(t+1),s++,i=r.node(t).maybeChild(s)):(o=r.node(t).maybeChild(s-1),i=r.node(t+1)),o&&!o.isTextblock&&ie(o,i)&&r.node(t).canReplace(s,s+1))return e;if(0==t)break;e=n<0?r.before(t):r.after(t)}}function ae(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let t=0;t<n.openStart;t++)o=o.firstChild.content;for(let t=1;t<=(0==n.openStart&&n.size?2:1);t++)for(let e=r.depth;e>=0;e--){let n=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,i=r.index(e)+(n>0?1:0),s=r.node(e),a=!1;if(1==t)a=s.canReplace(i,i,o);else{let t=s.contentMatchAt(i).findWrapping(o.firstChild.type);a=t&&s.canReplaceWith(i,i,t[0])}if(a)return 0==n?r.pos:n<0?r.before(e+1):r.after(e+1)}return null}function le(t,e,n=e,r=N.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return ce(o,i,r)?new Jt(e,n,r):new de(o,i,r).fit()}function ce(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}zt.jsonID("replaceAround",Gt);class de{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=M.empty;for(let e=0;e<=t.depth;e++){let n=t.node(e);this.frontier.push({type:n.type,match:n.contentMatchAt(t.indexAfter(e))})}for(let e=t.depth;e>0;e--)this.placed=M.from(t.node(e).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(t<0?this.$to:n.doc.resolve(t));if(!r)return null;let o=this.placed,i=n.depth,s=r.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let a=new N(o,i,s);return t>-1?new Gt(n.pos,t,this.$to.pos,this.$to.end(),a,e):a.size||n.pos!=this.$to.pos?new Jt(n.pos,r.pos,a):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<t;n++){let o=e.firstChild;if(e.childCount>1&&(r=0),o.type.spec.isolating&&r<=n){t=n;break}e=o.content}for(let e=1;e<=2;e++)for(let n=1==e?t:this.unplaced.openStart;n>=0;n--){let t,r=null;n?(r=pe(this.unplaced.content,n-1).firstChild,t=r.content):t=this.unplaced.content;let o=t.firstChild;for(let t=this.depth;t>=0;t--){let i,{type:s,match:a}=this.frontier[t],l=null;if(1==e&&(o?a.matchType(o.type)||(l=a.fillBefore(M.from(o),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:t,parent:r,inject:l};if(2==e&&o&&(i=a.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:t,parent:r,wrap:i};if(r&&a.matchType(r.type))break}}}
1openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced;return!(Ae(t,-1)<=e||(this.unplaced.size>1&&Ae(t,1)>n&&n++,this.unplaced=new N(t,e+1,n),0))}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=pe(t,e);if(r.childCount<=1&&e>0){let o=t.size-e<=e+r.size;this.unplaced=new N(ue(t,e-1,1),e-1,o?e-1:n)}else this.unplaced=new N(ue(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:r,wrap:o}){for(;this.depth>e;)this.closeFrontierNode();if(o)for(let t=0;t<o.length;t++)this.openFrontierNode(o[t]);let i=this.unplaced,s=n?n.content:i.content,a=i.openStart-t,l=0,c=[],{match:d,type:u}=this.frontier[e];if(r){for(let t=0;t<r.childCount;t++)c.push(r.child(t));d=d.matchFragment(r)}let h=s.size+t-(i.content.size-i.openEnd);for(;l<s.childCount;){let t=s.child(l),e=d.matchType(t.type);if(!e)break;l++,(l>1||0==a||t.content.size)&&(d=e,c.push(fe(t.mark(u.allowedMarks(t.marks)),1==l?a:0,l==s.childCount?h:-1)))}let p=l==s.childCount;p||(h=-1),this.placed=he(this.placed,e,M.from(c)),this.frontier[e].match=d,p&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let t=0,e=s;t<h;t++){let t=e.lastChild;this.frontier.push({type:t.type,match:t.contentMatchAt(t.childCount)}),e=t.content}this.unplaced=p?0==t?N.empty:new N(ue(i.content,t-1,1),t-1,h<0?i.openEnd:t-1):new N(ue(i.content,t,l),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t,e=this.frontier[this.depth];if(!e.type.isTextblock||!ge(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],o=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),i=ge(t,e,r,n,o);if(i){for(let n=e-1;n>=0;n--){let{match:e,type:r}=this.frontier[n],o=ge(t,n,r,e,!0);if(!o||o.childCount)continue t}return{depth:e,fit:i,move:o?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=he(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),r=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,r)}return t}openFrontierNode(t,e=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=he(this.placed,this.depth,M.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(M.empty,!0);t.childCount&&(this.placed=he(this.placed,this.frontier.length,t))}}function ue(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(ue(t.firstChild.content,e-1,n)))}function he(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(he(t.lastChild.content,e-1,n)))}function pe(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function fe(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,fe(r.firstChild,e-1,1==r.childCount?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)}function ge(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!function(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,i.content,s)?a:null}function me(t){return t.spec.defining||t.spec.definingForContent}function Ae(t,e){for(let n=0;;n++){let r=e<0?t.firstChild:t.lastChild;if(!r||r.isAtom)return n;t=r.content}}function ye(t,e,n,r,o){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(ye(o.content,e+1,n,r,o)))}if(e>r){let e=o.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(M.empty,!0))}return t}function be(t,e){let n=[];for(let r=Math.min(t.depth,e.depth);r>=0;r--){let o=t.start(r);if(o<t.pos-(t.depth-r)||e.end(r)>e.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(o==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==o-1)&&n.push(r)}return n}class ve extends zt{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return Ht.fail("No node at attribute step's position");let n=Object.create(null);for(let t in e.attrs)n[t]=e.attrs[t];n[this.attr]=this.value;let r=e.type.create(n,null,e.marks);return Ht.fromReplace(t,this.pos,this.pos+1,new N(M.from(r),0,e.isLeaf?0:1))}getMap(){return Rt.empty}invert(t){return new ve(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new ve(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new ve(e.pos,e.attr,e.value)}}zt.jsonID("attr",ve);class we extends zt{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let n in t.attrs)e[n]=t.attrs[n];e[this.attr]=this.value;let n=t.type.create(e,t.content,t.marks);return Ht.ok(n)}getMap(){return Rt.empty}invert(t){return new we(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,e){if("string"!=typeof e.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new we(e.attr,e.value)}}zt.jsonID("docAttr",we);
1let ke=class extends Error{};ke=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(ke.prototype=Object.create(Error.prototype)).constructor=ke,ke.prototype.name="TransformError";class Ce{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Pt}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new ke(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,e=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(t=r.map(t,1),e=r.map(e,-1)),r.forEach((n,r,o,i)=>{t=Math.min(t,o),e=Math.max(e,i)})}return 1e9==t?null:{from:t,to:e}}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=N.empty){let r=le(this.doc,t,e,n);return r&&this.step(r),this}replaceWith(t,e,n){return this.replace(t,e,new N(M.from(n),0,0))}delete(t,e){return this.replace(t,e,N.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return function(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),i=t.doc.resolve(n);if(ce(o,i,r))return t.step(new Jt(e,n,r));let s=be(o,i);0==s[s.length-1]&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let t=o.depth,e=o.pos-1;t>0;t--,e--){let n=o.node(t).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(t)>-1?a=t:o.before(t)==e&&s.splice(1,0,-t)}let l=s.indexOf(a),c=[],d=r.openStart;for(let t=r.content,e=0;;e++){let n=t.firstChild;if(c.push(n),e==r.openStart)break;t=n.content}for(let t=d-1;t>=0;t--){let e=c[t],n=me(e.type);if(n&&!e.sameMarkup(o.node(Math.abs(a)-1)))d=t;else if(n||!e.type.isTextblock)break}for(let e=r.openStart;e>=0;e--){let a=(e+d+1)%(r.openStart+1),u=c[a];if(u)for(let e=0;e<s.length;e++){let c=s[(e+l)%s.length],d=!0;c<0&&(d=!1,c=-c);let h=o.node(c-1),p=o.index(c-1);if(h.canReplaceWith(p,p,u.type,u.marks))return t.replace(o.before(c),d?i.after(c):n,new N(ye(r.content,0,r.openStart,a),a,r.openEnd))}}let u=t.steps.length;for(let a=s.length-1;a>=0&&(t.replace(e,n,r),!(t.steps.length>u));a--){let t=s[a];t<0||(e=o.before(t),n=i.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){return function(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=function(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(let t=r.depth-1;t>=0;t--){let e=r.index(t);if(r.node(t).canReplaceWith(e,e,n))return r.before(t+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let t=r.depth-1;t>=0;t--){let e=r.indexAfter(t);if(r.node(t).canReplaceWith(e,e,n))return r.after(t+1);if(e<r.node(t).childCount)return null}return null}(t.doc,e,r.type);null!=o&&(e=n=o)}t.replaceRange(e,n,new N(M.from(r),0,0))}(this,t,e,n),this}deleteRange(t,e){return function(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n);if(r.parent.isTextblock&&o.parent.isTextblock&&r.start()!=o.start()&&0==r.parentOffset&&0==o.parentOffset){let i=r.sharedDepth(n),s=!1;for(let t=r.depth;t>i;t--)r.node(t).type.spec.isolating&&(s=!0);for(let t=o.depth;t>i;t--)o.node(t).type.spec.isolating&&(s=!0);if(!s){for(let t=r.depth;t>0&&e==r.start(t);t--)e=r.before(t);for(let t=o.depth;t>0&&n==o.start(t);t--)n=o.before(t);r=t.doc.resolve(e),o=t.doc.resolve(n)}}let i=be(r,o);for(let e=0;e<i.length;e++){let n=i[e],s=e==i.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return t.delete(r.start(n),o.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),o.indexAfter(n-1))))return t.delete(r.before(n),o.after(n))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(e-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i&&r.start(i-1)==o.start(i-1)&&r.node(i-1).canReplace(r.index(i-1),o.index(i-1)))return t.delete(r.before(i),n);t.delete(e,n)}(this,t,e),this}lift(t,e){return function(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),l=s,c=a,d=M.empty,u=0;for(let t=i,e=!1;t>n;t--)e||r.index(t)>0?(e=!0,d=M.from(r.node(t).copy(d)),u++):l--;let h=M.empty,p=0;for(let t=i,e=!1;t>n;t--)e||o.after(t+1)<o.end(t)?(e=!0,h=M.from(o.node(t).copy(h)),p++):c++;t.step(new Gt(l,c,s,a,new N(d.append(h),u,p),d.size-u,!0))}(this,t,e),this}join(t,e=1){return function(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,i=t.doc.resolve(e-n),s=i.node().type;if(o&&s.inlineContent){let t="pre"==s.whitespace,e=!!s.contentMatch.matchType(o);t&&!e?r=!1:!t&&e&&(r=!0)}let a=t.steps.length;if(!1===r){let r=t.doc.resolve(e+n);ne(t,r.node(),r.before(),a)}s.inlineContent&&Yt(t,e+n-1,s,i.node().contentMatchAt(i.index()),null==r);let l=t.mapping.slice(a),c=l.map(e-n);if(t.step(new Jt(c,l.map(e+n,-1),N.empty,!0)),!0===r){let e=t.doc.resolve(c);ee(t,e.node(),e.before(),t.steps.length)}}(this,t,e),this}wrap(t,e){return function(t,e,n){let r=M.empty;for(let t=n.length-1;t>=0;t--){if(r.size){let e=n[t].type.contentMatch.matchFragment(r);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}
1r=M.from(n[t].type.create(n[t].attrs,r))}let o=e.start,i=e.end;t.step(new Gt(o,i,o,i,new N(r,0,0),n.length,!0))}(this,t,e),this}setBlockType(t,e=t,n,r=null){return function(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(e,n)=>{let s="function"==typeof o?o(e):o;if(e.isTextblock&&!e.hasMarkup(r,s)&&function(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(t.doc,t.mapping.slice(i).map(n),r)){let o=null;if(r.schema.linebreakReplacement){let t="pre"==r.whitespace,e=!!r.contentMatch.matchType(r.schema.linebreakReplacement);t&&!e?o=!1:!t&&e&&(o=!0)}!1===o&&ne(t,e,n,i),Yt(t,t.mapping.slice(i).map(n,1),r,void 0,null===o);let a=t.mapping.slice(i),l=a.map(n,1),c=a.map(n+e.nodeSize,1);return t.step(new Gt(l,c,l+1,c-1,new N(M.from(r.create(s,null,e.marks)),0,0),1,!0)),!0===o&&ee(t,e,n,i),!1}})}(this,t,e,n,r),this}setNodeMarkup(t,e,n=null,r){return function(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Gt(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new N(M.from(s),0,0),1,!0))}(this,t,e,n,r),this}setNodeAttribute(t,e,n){return this.step(new ve(t,e,n)),this}setDocAttribute(t,e){return this.step(new we(t,e)),this}addNodeMark(t,e){return this.step(new qt(t,e)),this}removeNodeMark(t,e){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(e instanceof O)e.isInSet(n.marks)&&this.step(new Wt(t,e));else{let r,o=n.marks,i=[];for(;r=e.isInSet(o);)i.push(new Wt(t,r)),o=r.removeFromSet(o);for(let t=i.length-1;t>=0;t--)this.step(i[t])}return this}split(t,e=1,n){return function(t,e,n=1,r){let o=t.doc.resolve(e),i=M.empty,s=M.empty;for(let t=o.depth,e=o.depth-n,a=n-1;t>e;t--,a--){i=M.from(o.node(t).copy(i));let e=r&&r[a];s=M.from(e?e.type.create(e.attrs,s):o.node(t).copy(s))}t.step(new Jt(e,e,new N(i.append(s),n,n),!0))}(this,t,e,n),this}addMark(t,e,n){return function(t,e,n,r){let o,i,s=[],a=[];t.doc.nodesBetween(e,n,(t,l,c)=>{if(!t.isInline)return;let d=t.marks;if(!r.isInSet(d)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,e),u=Math.min(l+t.nodeSize,n),h=r.addToSet(d);for(let t=0;t<d.length;t++)d[t].isInSet(h)||(o&&o.to==c&&o.mark.eq(d[t])?o.to=u:s.push(o=new Vt(c,u,d[t])));i&&i.to==c?i.to=u:a.push(i=new Ut(c,u,r))}}),s.forEach(e=>t.step(e)),a.forEach(e=>t.step(e))}(this,t,e,n),this}removeMark(t,e,n){return function(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,(t,s)=>{if(!t.isInline)return;i++;let a=null;if(r instanceof gt){let e,n=t.marks;for(;e=r.isInSet(n);)(a||(a=[])).push(e),n=e.removeFromSet(n)}else r?r.isInSet(t.marks)&&(a=[r]):a=t.marks;if(a&&a.length){let r=Math.min(s+t.nodeSize,n);for(let t=0;t<a.length;t++){let n,l=a[t];for(let t=0;t<o.length;t++){let e=o[t];e.step==i-1&&l.eq(o[t].style)&&(n=e)}n?(n.to=r,n.step=i):o.push({style:l,from:Math.max(s,e),to:r,step:i})}}}),o.forEach(e=>t.step(new Vt(e.from,e.to,e.style)))}(this,t,e,n),this}clearIncompatible(t,e,n){return Yt(this,t,e,n),this}}const xe=Object.create(null);class Se{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new Ee(t.min(e),t.max(e))]}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 t=this.ranges;for(let e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,e=N.empty){let n=e.content.lastChild,r=null;for(let t=0;t<e.openEnd;t++)r=n,n=n.lastChild;let o=t.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:l}=i[s],c=t.mapping.slice(o);t.replaceRange(c.map(a.pos),c.map(l.pos),s?N.empty:e),0==s&&$e(t,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(t,e){let n=t.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],a=t.mapping.slice(n),l=a.map(i.pos),c=a.map(s.pos);o?t.deleteRange(l,c):(t.replaceRangeWith(l,c,e),$e(t,n,e.isInline?-1:1))}}static findFrom(t,e,n=!1){let r=t.parent.inlineContent?new _e(t):Be(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(let r=t.depth-1;r>=0;r--){let o=e<0?Be(t.node(0),t.node(r),t.before(r+1),t.index(r),e,n):Be(t.node(0),t.node(r),t.after(r+1),t.index(r)+1,e,n);if(o)return o}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new Ne(t.node(0))}static atStart(t){return Be(t,t,0,0,1)||new Ne(t)}static atEnd(t){return Be(t,t,t.content.size,t.childCount,-1)||new Ne(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=xe[e.type];if(!n)throw new RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in xe)throw new RangeError("Duplicate use of selection JSON ID "+t);return xe[t]=e,e.prototype.jsonID=t,e}getBookmark(){return _e.between(this.$anchor,this.$head).getBookmark()}}Se.prototype.visible=!0;class Ee{constructor(t,e){this.$from=t,this.$to=e}}let Me=!1;function Te(t){Me||t.parent.inlineContent||(Me=!0,console.warn("TextSelection endpoint not pointing into a 
1node with inline content ("+t.parent.type.name+")"))}class _e extends Se{constructor(t,e=t){Te(t),Te(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return Se.near(n);let r=t.resolve(e.map(this.anchor));return new _e(r.parent.inlineContent?r:n,n)}replace(t,e=N.empty){if(super.replace(t,e),e==N.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof _e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new De(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new _e(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}static between(t,e,n){let r=t.pos-e.pos;if(n&&!r||(n=r>=0?1:-1),!e.parent.inlineContent){let t=Se.findFrom(e,n,!0)||Se.findFrom(e,-n,!0);if(!t)return Se.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r||(t=(Se.findFrom(t,-n,!0)||Se.findFrom(t,n,!0)).$anchor).pos<e.pos!=r<0)&&(t=e),new _e(t,e)}}Se.jsonID("text",_e);class De{constructor(t,e){this.anchor=t,this.head=e}map(t){return new De(t.map(this.anchor),t.map(this.head))}resolve(t){return _e.between(t.resolve(this.anchor),t.resolve(this.head))}}class Oe extends Se{constructor(t){let e=t.nodeAfter,n=t.node(0).resolve(t.pos+e.nodeSize);super(t,n),this.node=e}map(t,e){let{deleted:n,pos:r}=e.mapResult(this.anchor),o=t.resolve(r);return n?Se.near(o):new Oe(o)}content(){return new N(M.from(this.node),0,0)}eq(t){return t instanceof Oe&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Ie(this.anchor)}static fromJSON(t,e){if("number"!=typeof e.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Oe(t.resolve(e.anchor))}static create(t,e){return new Oe(t.resolve(e))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}Oe.prototype.visible=!1,Se.jsonID("node",Oe);class Ie{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:n}=t.mapResult(this.anchor);return e?new De(n,n):new Ie(n)}resolve(t){let e=t.resolve(this.anchor),n=e.nodeAfter;return n&&Oe.isSelectable(n)?new Oe(e):Se.near(e)}}class Ne extends Se{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=N.empty){if(e==N.empty){t.delete(0,t.doc.content.size);let e=Se.atStart(t.doc);e.eq(t.selection)||t.setSelection(e)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new Ne(t)}map(t){return new Ne(t)}eq(t){return t instanceof Ne}getBookmark(){return Le}}Se.jsonID("all",Ne);const Le={map(){return this},resolve:t=>new Ne(t)};function Be(t,e,n,r,o,i=!1){if(e.inlineContent)return _e.create(t,n);for(let s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let r=e.child(s);if(r.isAtom){if(!i&&Oe.isSelectable(r))return Oe.create(t,n-(o<0?r.nodeSize:0))}else{let e=Be(t,r,n+o,o<0?r.childCount:0,o,i);if(e)return e}n+=r.nodeSize*o}return null}function $e(t,e,n){let r=t.steps.length-1;if(r<e)return;let o,i=t.steps[r];(i instanceof Jt||i instanceof Gt)&&(t.mapping.maps[r].forEach((t,e,n,r)=>{null==o&&(o=r)}),t.setSelection(Se.near(t.doc.resolve(o),n)))}class Re extends Ce{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.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(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return O.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(t,e){super.addStep(t,e),this.updated=-3&this.updated,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||O.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,n){let r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();{if(null==n&&(n=e),!t)return this.deleteRange(e,n);let o=this.storedMarks;if(!o){let t=this.doc.resolve(e);o=n==e?t.marks():t.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,o)),this.selection.empty||this.selection.to!=e+t.length||this.setSelection(Se.near(this.selection.$to)),this}}setMeta(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function Pe(t,e){return e&&t?t.bind(e):t}class Fe{constructor(t,e,n){this.name=t,this.init=Pe(e.init,n),this.apply=Pe(e.apply,n)}}const ze=[new Fe("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new Fe("selection",{init:(t,e)=>t.selection||Se.atStart(e.doc),apply:t=>t.selection}),new Fe("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new Fe("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})];class He{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=ze.slice(),e&&e.forEach(t=>{if(this.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new Fe(t.key,t.spec.state,t))})}}class je{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}
1apply(t){return this.applyTransaction(t).state}filterTransaction(t,e=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=e){let e=this.config.plugins[n];if(e.spec.filterTransaction&&!e.spec.filterTransaction.call(e,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let e=[t],n=this.applyInner(t),r=null;for(;;){let o=!1;for(let i=0;i<this.config.plugins.length;i++){let s=this.config.plugins[i];if(s.spec.appendTransaction){let a=r?r[i].n:0,l=r?r[i].state:this,c=a<e.length&&s.spec.appendTransaction.call(s,a?e.slice(a):e,l,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",t),!r){r=[];for(let t=0;t<this.config.plugins.length;t++)r.push(t<i?{state:n,n:e.length}:{state:this,n:0})}e.push(c),n=n.applyInner(c),o=!0}r&&(r[i]={state:n,n:e.length})}}if(!o)return{state:n,transactions:e}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let e=new je(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let o=n[r];e[o.name]=o.apply(t,this[o.name],this,e)}return e}get tr(){return new Re(this)}static create(t){let e=new He(t.doc?t.doc.type.schema:t.schema,t.plugins),n=new je(e);for(let r=0;r<e.fields.length;r++)n[e.fields[r].name]=e.fields[r].init(t,n);return n}reconfigure(t){let e=new He(this.schema,t.plugins),n=e.fields,r=new je(e);for(let e=0;e<n.length;e++){let o=n[e].name;r[o]=this.hasOwnProperty(o)?this[o]:n[e].init(t,r)}return r}toJSON(t){let e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map(t=>t.toJSON())),t&&"object"==typeof t)for(let n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=t[n],o=r.spec.state;o&&o.toJSON&&(e[n]=o.toJSON.call(r,this[r.key]))}return e}static fromJSON(t,e,n){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let r=new He(t.schema,t.plugins),o=new je(r);return r.fields.forEach(r=>{if("doc"==r.name)o.doc=Q.fromJSON(t.schema,e.doc);else if("selection"==r.name)o.selection=Se.fromJSON(o.doc,e.selection);else if("storedMarks"==r.name)e.storedMarks&&(o.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let i in n){let s=n[i],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(e,i))return void(o[r.name]=a.fromJSON.call(s,t,e[i],o))}o[r.name]=r.init(t,o)}}),o}}function Ue(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):"handleDOMEvents"==r&&(o=Ue(o,e,{})),n[r]=o}return n}class Ve{constructor(t){this.spec=t,this.props={},t.props&&Ue(t.props,this,this.props),this.key=t.key?t.key.key:We("plugin")}getState(t){return t[this.key]}}const qe=Object.create(null);function We(t){return t in qe?t+"$"+ ++qe[t]:(qe[t]=0,t+"$")}class Je{constructor(t="key"){this.key=We(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Ge=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Ke(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const Ye=(t,e,n)=>{let r=Ke(t,n);if(!r)return!1;let o=tn(r);if(!o){let n=r.blockRange(),o=n&&Zt(n);return null!=o&&(e&&e(t.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(hn(t,o,e,-1))return!0;if(0==r.parent.content.size&&(Ze(i,"end")||Oe.isSelectable(i)))for(let n=r.depth;;n--){let s=le(t.doc,r.before(n),r.after(n),N.empty);if(s&&s.slice.size<s.to-s.from){if(e){let n=t.tr.step(s);n.setSelection(Ze(i,"end")?Se.findFrom(n.doc.resolve(n.mapping.map(o.pos,-1)),-1):Oe.create(n.doc,o.pos-i.nodeSize)),e(n.scrollIntoView())}return!0}if(1==n||r.node(n-1).childCount>1)break}return!(!i.isAtom||o.depth!=r.depth-1||(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),0))};function Qe(t,e,n){let r=e.nodeBefore,o=e.pos-1;for(;!r.isTextblock;o--){if(r.type.spec.isolating)return!1;let t=r.lastChild;if(!t)return!1;r=t}let i=e.nodeAfter,s=e.pos+1;for(;!i.isTextblock;s++){if(i.type.spec.isolating)return!1;let t=i.firstChild;if(!t)return!1;i=t}let a=le(t.doc,o,s,N.empty);if(!a||a.from!=o||a instanceof Jt&&a.slice.size>=s-o)return!1;if(n){let e=t.tr.step(a);e.setSelection(_e.create(e.doc,o)),n(e.scrollIntoView())}return!0}function Ze(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;
1if(n&&1!=r.childCount)return!1}return!1}const Xe=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=tn(r)}let s=i&&i.nodeBefore;return!(!s||!Oe.isSelectable(s)||(e&&e(t.tr.setSelection(Oe.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),0))};function tn(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function en(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const nn=(t,e,n)=>{let r=en(t,n);if(!r)return!1;let o=on(r);if(!o)return!1;let i=o.nodeAfter;if(hn(t,o,e,1))return!0;if(0==r.parent.content.size&&(Ze(i,"start")||Oe.isSelectable(i))){let n=le(t.doc,r.before(),r.after(),N.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(Ze(i,"start")?Se.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):Oe.create(r.doc,r.mapping.map(o.pos))),e(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),0))},rn=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=on(r)}let s=i&&i.nodeAfter;return!(!s||!Oe.isSelectable(s)||(e&&e(t.tr.setSelection(Oe.create(t.doc,i.pos)).scrollIntoView()),0))};function on(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const sn=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(e&&e(t.tr.insertText("\n").scrollIntoView()),0))};function an(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const ln=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=an(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let r=n.after(),o=t.tr.replaceWith(r,r,s.createAndFill());o.setSelection(Se.near(o.doc.resolve(r),1)),e(o.scrollIntoView())}return!0},cn=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof Ne||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=an(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=t.tr.insert(n,i.createAndFill());s.setSelection(_e.create(s.doc,n+1)),e(s.scrollIntoView())}return!0},dn=(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 r=n.before();if(re(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Zt(r);return null!=o&&(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};var un;function hn(t,e,n,r){let o,i,s=e.nodeBefore,a=e.nodeAfter,l=s.type.spec.isolating||a.type.spec.isolating;if(!l&&function(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(i,i+1)||!o.isTextblock&&!oe(t.doc,e.pos)||(n&&n(t.tr.join(e.pos).scrollIntoView()),0)))}(t,e,n))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(o=(i=s.contentMatchAt(s.childCount)).findWrapping(a.type))&&i.matchType(o[0]||a.type).validEnd){if(n){let r=e.pos+a.nodeSize,i=M.empty;for(let t=o.length-1;t>=0;t--)i=M.from(o[t].create(null,i));i=M.from(s.copy(i));let l=t.tr.step(new Gt(e.pos-1,r,e.pos,r,new N(i,1,0),o.length,!0)),c=l.doc.resolve(r+2*o.length);c.nodeAfter&&c.nodeAfter.type==s.type&&oe(l.doc,c.pos)&&l.join(c.pos),n(l.scrollIntoView())}return!0}let d=a.type.spec.isolating||r>0&&l?null:Se.findFrom(e,1),u=d&&d.$from.blockRange(d.$to),h=u&&Zt(u);if(null!=h&&h>=e.depth)return n&&n(t.tr.lift(u,h).scrollIntoView()),!0;if(c&&Ze(a,"start",!0)&&Ze(s,"end")){let r=s,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let i=a,l=1;for(;!i.isTextblock;
1i=i.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,i.content)){if(n){let r=M.empty;for(let t=o.length-1;t>=0;t--)r=M.from(o[t].copy(r));n(t.tr.step(new Gt(e.pos-o.length,e.pos+a.nodeSize,e.pos+l,e.pos+a.nodeSize-l,new N(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function pn(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(e.tr.setSelection(_e.create(e.doc,t<0?o.start(i):o.end(i)))),!0)}}const fn=pn(-1),gn=pn(1);function mn(t,e=null){return function(n,r){let o=!1;for(let r=0;r<n.selection.ranges.length&&!o;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(i,s,(r,i)=>{if(o)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)o=!0;else{let e=n.doc.resolve(i),r=e.index();o=e.parent.canReplaceWith(r,r+1,t)}})}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];o.setBlockType(i,s,t,e)}r(o.scrollIntoView())}return!0}}function An(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}let yn=An(Ge,Ye,Xe),bn=An(Ge,nn,rn);const vn={Enter:An(sn,cn,dn,(t,e)=>{if(t.selection instanceof Oe&&t.selection.node.isBlock){let{$from:n}=t.selection;return!(!n.parentOffset||!re(t.doc,n.pos)||(e&&e(t.tr.split(n.pos).scrollIntoView()),0))}if(!t.selection.$from.depth)return!1;let n=t.tr;!t.selection.empty&&(t.selection instanceof _e||t.selection instanceof Ne)&&n.deleteSelection();let r,o,{$from:i}=n.selection,s=n.steps.length,a=[],l=!1,c=!1;for(let t=i.depth;;t--){if(i.node(t).isBlock){l=i.end(t)==i.pos+(i.depth-t),c=i.start(t)==i.pos-(i.depth-t),o=an(i.node(t-1).contentMatchAt(i.indexAfter(t-1)));let e=un;a.unshift(e||(l&&o?{type:o}:null)),r=t;break}if(1==t)return!1;a.unshift(null)}let d=i.pos,u=re(n.doc,d,a.length,a);if(u||(a[0]=o?{type:o}:null,u=re(n.doc,d,a.length,a)),!u)return!1;if(n.split(d,a.length,a),!l&&c&&i.node(r).type!=o){let t=n.mapping.slice(s),e=t.map(i.before(r)),a=n.doc.resolve(e);o&&i.node(r-1).canReplaceWith(a.index(),a.index()+1,o)&&n.setNodeMarkup(t.map(i.before(r)),o)}return e&&e(n.scrollIntoView()),!0}),"Mod-Enter":ln,Backspace:yn,"Mod-Backspace":yn,"Shift-Backspace":yn,Delete:bn,"Mod-Delete":bn,"Mod-a":(t,e)=>(e&&e(t.tr.setSelection(new Ne(t.doc))),!0)},wn={"Ctrl-h":vn.Backspace,"Alt-Backspace":vn["Mod-Backspace"],"Ctrl-d":vn.Delete,"Ctrl-Alt-Backspace":vn["Mod-Delete"],"Alt-Delete":vn["Mod-Delete"],"Alt-d":vn["Mod-Delete"],"Ctrl-a":fn,"Ctrl-e":gn};for(let t in vn)wn[t]=vn[t];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();const kn=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},Cn=function(t){let e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e};let xn=null;const Sn=function(t,e,n){let r=xn||(xn=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},En=function(t,e,n,r){return n&&(Tn(t,e,n,r,-1)||Tn(t,e,n,r,1))},Mn=/^(img|br|input|textarea|hr)$/i;function Tn(t,e,n,r,o){for(var i;;){if(t==n&&e==r)return!0;if(e==(o<0?0:_n(t))){let n=t.parentNode;if(!n||1!=n.nodeType||Dn(t)||Mn.test(t.nodeName)||"false"==t.contentEditable)return!1;e=kn(t)+(o<0?0:1),t=n}else{if(1!=t.nodeType)return!1;{let n=t.childNodes[e+(o<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable){if(!(null===(i=n.pmViewDesc)||void 0===i?void 0:i.ignoreForSelection))return!1;e+=o}else t=n,e=o<0?_n(t):0}}}}function _n(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Dn(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const On=function(t){return t.focusNode&&En(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function In(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}const Nn="undefined"!=typeof navigator?navigator:null,Ln="undefined"!=typeof document?document:null,Bn=Nn&&Nn.userAgent||"",$n=/Edge\/(\d+)/.exec(Bn),Rn=/MSIE \d/.exec(Bn),Pn=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Bn),Fn=!!(Rn||Pn||$n),zn=Rn?document.documentMode:Pn?+Pn[1]:$n?+$n[1]:0,Hn=!Fn&&/gecko\/(\d+)/i.test(Bn);Hn&&(/Firefox\/(\d+)/.exec(Bn)||[0,0])[1];const jn=!Fn&&/Chrome\/(\d+)/.exec(Bn),Un=!!jn,Vn=jn?+jn[1]:0,qn=!Fn&&!!Nn&&/Apple Computer/.test(Nn.vendor),Wn=qn&&(
1/Mobile\/\w+/.test(Bn)||!!Nn&&Nn.maxTouchPoints>2),Jn=Wn||!!Nn&&/Mac/.test(Nn.platform),Gn=!!Nn&&/Win/.test(Nn.platform),Kn=/Android \d/.test(Bn),Yn=!!Ln&&"webkitFontSmoothing"in Ln.documentElement.style,Qn=Yn?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Zn(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Xn(t,e){return"number"==typeof t?t:t[e]}function tr(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function er(t,e,n){if(!cr(e)&&0==e.left)return;let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=n||t.dom;s;){if(1!=s.nodeType){s=Cn(s);continue}let t=s,n=t==i.body,a=n?Zn(i):tr(t),l=0,c=0;if(e.top<a.top+Xn(r,"top")?c=-(a.top-e.top+Xn(o,"top")):e.bottom>a.bottom-Xn(r,"bottom")&&(c=e.bottom-e.top>a.bottom-a.top?e.top+Xn(o,"top")-a.top:e.bottom-a.bottom+Xn(o,"bottom")),e.left<a.left+Xn(r,"left")?l=-(a.left-e.left+Xn(o,"left")):e.right>a.right-Xn(r,"right")&&(l=e.right-a.right+Xn(o,"right")),l||c)if(n)i.defaultView.scrollBy(l,c);else{let n=t.scrollLeft,r=t.scrollTop;c&&(t.scrollTop+=c),l&&(t.scrollLeft+=l);let o=t.scrollLeft-n,i=t.scrollTop-r;e={left:e.left-o,top:e.top-i,right:e.right-o,bottom:e.bottom-i}}let d=n?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(d))break;s="absolute"==d?s.offsetParent:Cn(s)}}function nr(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Cn(r));return e}function rr(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:i}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let or=null;function ir(t,e){let n,r,o,i,s=2e8,a=0,l=e.top,c=e.top;for(let d=t.firstChild,u=0;d;d=d.nextSibling,u++){let t;if(1==d.nodeType)t=d.getClientRects();else{if(3!=d.nodeType)continue;t=Sn(d).getClientRects()}for(let h=0;h<t.length;h++){let p=t[h];if(p.top<=l&&p.bottom>=c){l=Math.max(p.bottom,l),c=Math.min(p.top,c);let t=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(t<s){n=d,s=t,r=t&&3==n.nodeType?{left:p.right<e.left?p.right:p.left,top:e.top}:e,1==d.nodeType&&t&&(a=u+(e.left>=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!o&&p.left<=e.left&&p.right>=e.left&&(o=d,i={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(a=u+1)}}return!n&&o&&(n=o,r=i,s=0),n&&3==n.nodeType?function(t,e){let n,r=t.nodeValue.length,o=document.createRange();for(let i=0;i<r;i++){o.setEnd(t,i+1),o.setStart(t,i);let r=dr(o,1);if(r.top!=r.bottom&&sr(e,r)){n={node:t,offset:i+(e.left>=(r.left+r.right)/2?1:0)};break}}return o.detach(),n||{node:t,offset:0}}(n,r):!n||s&&1==n.nodeType?{node:t,offset:a}:ir(n,r)}function sr(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function ar(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let n=t.childNodes[i];if(1==n.nodeType){let t=n.getClientRects();for(let r=0;r<t.length;r++){let o=t[r];if(sr(e,o))return ar(n,e,o)}}if((i=(i+1)%r)==o)break}return t}function lr(t,e){let n,r=t.dom.ownerDocument,o=0,i=function(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(_n(r.offsetNode),r.offset)}}catch(t){}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(_n(r.startContainer),r.startOffset)}}}(r,e.left,e.top);i&&({node:n,offset:o}=i);let s,a=(t.root.elementFromPoint?t.root:r).elementFromPoint(e.left,e.top);if(!a||!t.dom.contains(1!=a.nodeType?a.parentNode:a)){let n=t.dom.getBoundingClientRect();if(!sr(e,n))return null;if(a=ar(t.dom,e,n),!a)return null}if(qn)for(let t=a;n&&t;t=Cn(t))t.draggable&&(n=void 0);if(a=function(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}
1(a,e),n){if(Hn&&1==n.nodeType&&(o=Math.min(o,n.childNodes.length),o<n.childNodes.length)){let t,r=n.childNodes[o];"IMG"==r.nodeName&&(t=r.getBoundingClientRect()).right<=e.left&&t.bottom>e.top&&o++}let r;Yn&&o&&1==n.nodeType&&1==(r=n.childNodes[o-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=e.top&&o--,n==t.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&e.top>n.lastChild.getBoundingClientRect().bottom?s=t.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(s=function(t,e,n,r){let o=-1;for(let n=e,i=!1;n!=t.dom;){let e,s=t.docView.nearestDesc(n,!0);if(!s)return null;if(1==s.dom.nodeType&&(s.node.isBlock&&s.parent||!s.contentDOM)&&((e=s.dom.getBoundingClientRect()).width||e.height)&&(s.node.isBlock&&s.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(s.dom.nodeName)&&(!i&&e.left>r.left||e.top>r.top?o=s.posBefore:(!i&&e.right<r.left||e.bottom<r.top)&&(o=s.posAfter),i=!0),!s.contentDOM&&o<0&&!s.node.isText))return(s.node.isBlock?r.top<(e.top+e.bottom)/2:r.left<(e.left+e.right)/2)?s.posBefore:s.posAfter;n=s.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}(t,n,o,e))}null==s&&(s=function(t,e,n){let{node:r,offset:o}=ir(e,n),i=-1;if(1==r.nodeType&&!r.firstChild){let t=r.getBoundingClientRect();i=t.left!=t.right&&n.left>(t.left+t.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}(t,a,e));let l=t.docView.nearestDesc(a,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function cr(t){return t.top<t.bottom||t.left<t.right}function dr(t,e){let n=t.getClientRects();if(n.length){let t=n[e<0?0:n.length-1];if(cr(t))return t}return Array.prototype.find.call(n,cr)||t.getBoundingClientRect()}const ur=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function hr(t,e,n){let{node:r,offset:o,atom:i}=t.docView.domFromPos(e,n<0?-1:1),s=Yn||Hn;if(3==r.nodeType){if(!s||!ur.test(r.nodeValue)&&(n<0?o:o!=r.nodeValue.length)){let t=o,e=o,i=n<0?1:-1;return n<0&&!o?(e++,i=-1):n>=0&&o==r.nodeValue.length?(t--,i=1):n<0?t--:e++,pr(dr(Sn(r,t,e),i),i<0)}{let t=dr(Sn(r,o,o),n);if(Hn&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let e=dr(Sn(r,o-1,o-1),-1);if(e.top==t.top){let n=dr(Sn(r,o,o+1),-1);if(n.top!=t.top)return pr(n,n.left<e.left)}}return t}}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(null==i&&o&&(n<0||o==_n(r))){let t=r.childNodes[o-1];if(1==t.nodeType)return fr(t.getBoundingClientRect(),!1)}if(null==i&&o<_n(r)){let t=r.childNodes[o];if(1==t.nodeType)return fr(t.getBoundingClientRect(),!0)}return fr(r.getBoundingClientRect(),n>=0)}if(null==i&&o&&(n<0||o==_n(r))){let t=r.childNodes[o-1],e=3==t.nodeType?Sn(t,_n(t)-(s?0:1)):1!=t.nodeType||"BR"==t.nodeName&&t.nextSibling?null:t;if(e)return pr(dr(e,1),!1)}if(null==i&&o<_n(r)){let t=r.childNodes[o];for(;t.pmViewDesc&&t.pmViewDesc.ignoreForCoords;)t=t.nextSibling;let e=t?3==t.nodeType?Sn(t,0,s?0:1):1==t.nodeType?t:null:null;if(e)return pr(dr(e,-1),!0)}return pr(dr(3==r.nodeType?Sn(r):r,-n),n>=0)}function pr(t,e){if(0==t.width)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function fr(t,e){if(0==t.height)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function gr(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}const mr=/[\u0590-\u08ac]/;let Ar=null,yr=null,br=!1;class vr{constructor(t,e,n,r){this.parent=t,this.children=e,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,e,n){return!1}matchesHack(t){return!1}parseRule(t){return null}stopEvent(t){return!1}get size(){let t=0;for(let e=0;e<this.children.length;e++)t+=this.children[e].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let e=0,n=this.posAtStart;;e++){let r=this.children[e];if(r==t)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,e,n){if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(n<0){let n,r;if(t==this.contentDOM)n=t.childNodes[e-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;n=t.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(t==this.contentDOM)n=t.childNodes[e];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;n=t.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(t==this.dom&&this.contentDOM)r=e>kn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!1;break}if(e.previousSibling)break}if(null==r&&e==t.childNodes.length)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!0;break}if(e.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(t,e=!1){for(let n=!0,r=t;r;r=r.parentNode){let o,i=this.getDesc(r);if(i&&(!e||i.node)){if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==t.nodeType?t:t.parentNode):o==t))return i;n=!1}}}getDesc(t){let e=t.pmViewDesc;for(let t=e;t;t=t.parent)if(t==this)return e}
1posFromDOM(t,e,n){for(let r=t;r;r=r.parentNode){let o=this.getDesc(r);if(o)return o.localPosFromDOM(t,e,n)}return-1}descAt(t){for(let e=0,n=0;e<this.children.length;e++){let r=this.children[e],o=n+r.size;if(n==t&&o!=n){for(;!r.border&&r.children.length;)for(let t=0;t<r.children.length;t++){let e=r.children[t];if(e.size){r=e;break}}return r}if(t<o)return r.descAt(t-n-r.border);n=o}}domFromPos(t,e){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let n=0,r=0;for(let e=0;n<this.children.length;n++){let o=this.children[n],i=e+o.size;if(i>t||o instanceof Mr){r=t-e;break}e=i}if(r)return this.children[n].domFromPos(r-this.children[n].border,e);for(let t;n&&!(t=this.children[n-1]).size&&t instanceof wr&&t.side>=0;n--);if(e<=0){let t,r=!0;for(;t=n?this.children[n-1]:null,t&&t.dom.parentNode!=this.contentDOM;n--,r=!1);return t&&e&&r&&!t.border&&!t.domAtom?t.domFromPos(t.size,e):{node:this.contentDOM,offset:t?kn(t.dom)+1:0}}{let t,r=!0;for(;t=n<this.children.length?this.children[n]:null,t&&t.dom.parentNode!=this.contentDOM;n++,r=!1);return t&&r&&!t.border&&!t.domAtom?t.domFromPos(0,e):{node:this.contentDOM,offset:t?kn(t.dom):this.contentDOM.childNodes.length}}}parseRange(t,e,n=0){if(0==this.children.length)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,o=-1;for(let i=n,s=0;;s++){let n=this.children[s],a=i+n.size;if(-1==r&&t<=a){let o=i+n.border;if(t>=o&&e<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(t,e,o);t=i;for(let e=s;e>0;e--){let n=this.children[e-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=kn(n.dom)+1;break}t-=n.size}-1==r&&(r=0)}if(r>-1&&(a>e||s==this.children.length-1)){e=a;for(let t=s+1;t<this.children.length;t++){let n=this.children[t];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){o=kn(n.dom);break}e+=n.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=a}return{node:this.contentDOM,from:t,to:e,fromOffset:r,toOffset:o}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let e=this.children[t<0?0:this.children.length-1];return 0==e.size||e.emptyChildAt(t)}domAfterPos(t){let{node:e,offset:n}=this.domFromPos(t,0);if(1!=e.nodeType||n==e.childNodes.length)throw new RangeError("No node after pos "+t);return e.childNodes[n]}setSelection(t,e,n,r=!1){let o=Math.min(t,e),i=Math.max(t,e);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],c=a+l.size;if(o>a&&i<c)return l.setSelection(t-a-l.border,e-a-l.border,n,r);a=c}let s=this.domFromPos(t,t?-1:1),a=e==t?s:this.domFromPos(e,e?-1:1),l=n.root.getSelection(),c=n.domSelectionRange(),d=!1;if((Hn||qn)&&t==e){let{node:t,offset:e}=s;if(3==t.nodeType){if(d=!(!e||"\n"!=t.nodeValue[e-1]),d&&e==t.nodeValue.length)for(let e,n=t;n;n=n.parentNode){if(e=n.nextSibling){"BR"==e.nodeName&&(s=a={node:e.parentNode,offset:kn(e)+1});break}let t=n.pmViewDesc;if(t&&t.node&&t.node.isBlock)break}}else{let n=t.childNodes[e-1];d=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(Hn&&c.focusNode&&c.focusNode!=a.node&&1==c.focusNode.nodeType){let t=c.focusNode.childNodes[c.focusOffset];t&&"false"==t.contentEditable&&(r=!0)}if(!(r||d&&qn)&&En(s.node,s.offset,c.anchorNode,c.anchorOffset)&&En(a.node,a.offset,c.focusNode,c.focusOffset))return;let u=!1;if((l.extend||t==e)&&(!d||!Hn)){l.collapse(s.node,s.offset);try{t!=e&&l.extend(a.node,a.offset),u=!0}catch(t){}}if(!u){if(t>e){let t=s;s=a,a=t}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,e){for(let n=0,r=0;r<this.children.length;r++){let o=this.children[r],i=n+o.size;if(n==i?t<=i&&e>=n:t<i&&e>n){let r=n+o.border,s=i-o.border;if(t>=r&&e<=s)return this.dirty=t==n||e==i?2:1,void(t!=r||e!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(t-r,e-r):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}markParentsDirty(){let t=1;for(let e=this.parent;e;e=e.parent,t++){let n=1==t?2:1;e.dirty<n&&(e.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class wr extends vr{constructor(t,e,n,r){let o,i=e.type.toDOM;if("function"==typeof i&&(i=i(n,()=>o?o.parent?o.parent.posBeforeChild(o):void 0:r)),!e.type.spec.raw){if(1!=i.nodeType){let t=document.createElement("span");t.appendChild(i),i=t}i.hasAttribute("contenteditable")||(i.contentEditable="false"),i.classList.add("ProseMirror-widget")}super(t,[],i,null),this.widget=e,this.widget=e,o=this}matchesWidget(t){return 0==this.dirty&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let e=this.widget.spec.stopEvent;return!!e&&e(t)}ignoreMutation(t){return"selection"!=t.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class kr extends vr{constructor(t,e,n,r){super(t,[],e,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue}}class Cr extends vr{constructor(t,e,n,r,o){super(t,[],n,r),this.mark=e,this.spec=o}static create(t,e,n,r){let o=r.nodeViews[e.type.name],i=o&&o(e,r,n);return i&&i.dom||(i=Tt.renderSpec(document,e.type.spec.toDOM(e,n),null,e.attrs)),new Cr(t,e,i.dom,i.contentDOM||i.dom,i)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return 3!=this.dirty&&this.mark.eq(t)}markDirty(t,e){if(super.markDirty(t,e),0!=this.dirty){let t=this.parent;for(;!t.node;)t=t.parent;t.dirty<this.dirty&&(t.dirty=this.dirty),this.dirty=0}}slice(t,e,n){let r=Cr.create(this.parent,this.mark,!0,n),o=this.children,i=this.size;e<i&&(o=zr(o,e,i,n)),t>0&&(o=zr(o,0,t,n));for(let t=0;t<o.length;t++)o[t].parent=r;return r.children=o,r}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class xr extends vr{constructor(t,e,n,r,o,i,s){super(t,[],o,i),this.node=e,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s}static create(t,e,n,r,o,i){let s,a=o.nodeViews[e.type.name],l=a&&a(e,o,()=>s?s.parent?s.parent.posBeforeChild(s):void 0:i,n,r),c=l&&l.dom,d=l&&l.contentDOM;if(e.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(e.text);else if(!c){let t=Tt.renderSpec(document,e.type.spec.toDOM(e),null,e.attrs);({dom:c,contentDOM:d}=t)}d||e.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),e.type.spec.draggable&&(c.draggable=!0));let u=c;return c=Br(c,n,e),l?s=new Tr(t,e,n,r,c,d||null,u,l):e.isText?new Er(t,e,n,r,c,u):new xr(t,e,n,r,c,d||null,u)}parseRule(t){if(this.node.type.spec.reparseInView)return null;
1let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}if(!e.contentElement){let n=t&&t.find(e=>1==e.nodeType&&t.indexOf(e.parentNode)<0&&this.dom.contains(e));n?e.contentElement=n:e.getContent=()=>M.empty}}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(t,e,n){return 0==this.dirty&&t.eq(this.node)&&$r(e,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,e){let n=this.node.inlineContent,r=e,o=t.composing?this.localCompositionInfo(t,e):null,i=o&&o.pos>-1?o:null,s=o&&o.pos<0,a=new Pr(this,i&&i.node,t);!function(t,e,n,r){let o=e.locals(t),i=0;if(0==o.length){for(let n=0;n<t.childCount;n++){let s=t.child(n);r(s,o,e.forChild(i,s),n),i+=s.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let d,u,h,p;for(;s<o.length&&o[s].to==i;){let t=o[s++];t.widget&&(d?(u||(u=[d])).push(t):d=t)}if(d)if(u){u.sort(Fr);for(let t=0;t<u.length;t++)n(u[t],c,!!l)}else n(d,c,!!l);if(l)p=-1,h=l,l=null;else{if(!(c<t.childCount))break;p=c,h=t.child(c++)}for(let t=0;t<a.length;t++)a[t].to<=i&&a.splice(t--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let f=i+h.nodeSize;if(h.isText){let t=f;s<o.length&&o[s].from<t&&(t=o[s].from);for(let e=0;e<a.length;e++)a[e].to<t&&(t=a[e].to);t<f&&(l=h.cut(t-i),h=h.cut(0,t-i),f=t,p=-1)}else for(;s<o.length&&o[s].to<f;)s++;r(h,h.isInline&&!h.isLeaf?a.filter(t=>!t.inline):a.slice(),e.forChild(i,h),p),i=f}}(this.node,this.innerDeco,(e,o,i)=>{e.spec.marks?a.syncToMarks(e.spec.marks,n,t,o):e.type.side>=0&&!i&&a.syncToMarks(o==this.node.childCount?O.none:this.node.child(o).marks,n,t,o),a.placeWidget(e,t,r)},(e,i,l,c)=>{let d;a.syncToMarks(e.marks,n,t,c),a.findNodeMatch(e,i,l,c)||s&&t.state.selection.from>r&&t.state.selection.to<r+e.nodeSize&&(d=a.findIndexWithChild(o.node))>-1&&a.updateNodeAt(e,i,l,d,t)||a.updateNextNode(e,i,l,t,c,r)||a.addNode(e,i,l,t,r),r+=e.nodeSize}),a.syncToMarks([],n,t,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(i&&this.protectLocalComposition(t,i),_r(this.contentDOM,this.children,t),Wn&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))}localCompositionInfo(t,e){let{from:n,to:r}=t.state.selection;if(!(t.state.selection instanceof _e)||n<e||r>e+this.node.content.size)return null;let o=t.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let t=o.nodeValue,i=function(t,e,n,r){for(let o=0,i=0;o<t.childCount&&i<=r;){let s=t.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<t.childCount;){let e=t.child(o++);if(i+=e.nodeSize,!e.isText)break;l+=e.text}if(i>=n){if(i>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let t=a<r?l.lastIndexOf(e,r-a-1):-1;if(t>=0&&t+e.length+a>=n)return a+t;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}(this.node.content,t,n-e,r-e);return i<0?null:{node:o,pos:i,text:t}}return{node:o,pos:-1,text:""}}protectLocalComposition(t,{node:e,pos:n,text:r}){if(this.getDesc(e))return;let o=e;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 i=new kr(this,o,e,r);t.input.compositionNodes.push(i),this.children=zr(this.children,n,n+r.length,t,i)}update(t,e,n,r){return!(3==this.dirty||!t.sameMarkup(this.node)||(this.updateInner(t,e,n,r),0))}updateInner(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(t){if($r(t,this.outerDeco))return;let e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Nr(this.dom,this.nodeDOM,Ir(this.outerDeco,this.node,e),Ir(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Sr(t,e,n,r,o){Br(r,e,t);let i=new xr(void 0,t,e,n,r,r,r);return i.contentDOM&&i.updateChildren(o,0),i}class Er extends xr{constructor(t,e,n,r,o,i){super(t,e,n,r,o,null,i)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,e,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node)||(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=0,0))}inParent(){let t=this.parent.contentDOM;for(let e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,e,n){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):super.localPosFromDOM(t,e,n)}ignoreMutation(t){return"characterData"!=t.type&&"selection"!=t.type}slice(t,e,n){let r=this.node.cut(t,e),o=document.createTextNode(r.text);return new Er(this.parent,r,this.outerDeco,this.innerDeco,o,o)}markDirty(t,e){super.markDirty(t,e),this.dom==this.nodeDOM||0!=t&&e!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}isText(t){return this.node.text==t}}class Mr extends vr{parseRule(){return{ignore:!0}}matchesHack(t){return 0==this.dirty&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class Tr extends xr{constructor(t,e,n,r,o,i,s,a){super(t,e,n,r,o,i,s),this.spec=a}update(t,e,n,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let o=this.spec.update(t,e,n);return o&&this.updateInner(t,e,n,r),o}return!(!this.contentDOM&&!t.isLeaf)&&super.update(t,e,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,e,n,r){this.spec.setSelection?this.spec.setSelection(t,e,n.root):super.setSelection(t,e,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function _r(t,e,n){let r=t.firstChild,o=!1;for(let i=0;i<e.length;i++){let s=e[i],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=Rr(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(a,r);if(s instanceof Cr){let e=r?r.previousSibling:t.lastChild;_r(s.contentDOM,s.children,n),r=e?e.nextSibling:t.firstChild}}for(;r;)r=Rr(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const Dr=function(t){t&&(this.nodeName=t)};Dr.prototype=Object.create(null);const Or=[new Dr];function Ir(t,e,n){if(0==t.length)return Or;let r=n?Or[0]:new Dr,o=[r];for(let i=0;i<t.length;i++){let s=t[i].type.attrs;if(s){s.nodeName&&o.push(r=new Dr(s.nodeName));for(let t in s){let i=s[t];null!=i&&(n&&1==o.length&&o.push(r=new Dr(e.isInline?"span":"div")),"class"==t?r.class=(r.class?r.class+" ":"")+i:"style"==t?r.style=(r.style?r.style+";":"")+i:"nodeName"!=t&&(r[t]=i))}}}return o}function Nr(t,e,n,r){if(n==Or&&r==Or)return e;let o=e;for(let e=0;e<r.length;e++){let i=r[e],s=n[e];if(e){let e;s&&s.nodeName==i.nodeName&&o!=t&&(e=o.parentNode)&&e.nodeName.toLowerCase()==i.nodeName||(e=document.createElement(i.nodeName),e.pmIsDeco=!0,e.appendChild(o),s=Or[0]),o=e}Lr(o,s||Or[0],i)}return o}function Lr(t,e,n){for(let r in e)"class"==r||"style"==r||"nodeName"==r||r in n||t.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=e[r]&&t.setAttribute(r,n[r]);
1if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let e=0;e<r.length;e++)-1==o.indexOf(r[e])&&t.classList.remove(r[e]);for(let e=0;e<o.length;e++)-1==r.indexOf(o[e])&&t.classList.add(o[e]);0==t.classList.length&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(e.style);)t.style.removeProperty(n[1])}n.style&&(t.style.cssText+=n.style)}}function Br(t,e,n){return Nr(t,t,Or,Ir(e,n,1!=t.nodeType))}function $r(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function Rr(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Pr{constructor(t,e,n){this.lock=e,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=function(t,e){let n=e,r=n.children.length,o=t.childCount,i=new Map,s=[];t:for(;o>0;){let a;for(;;)if(r){let t=n.children[r-1];if(!(t instanceof Cr)){a=t,r--;break}n=t,r=t.children.length}else{if(n==e)break t;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}(t.node.content,t)}destroyBetween(t,e){if(t!=e){for(let n=t;n<e;n++)this.top.children[n].destroy();this.top.children.splice(t,e-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,e,n,r){let o=0,i=this.stack.length>>1,s=Math.min(i,t.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(t[o])&&!1!==t[o].type.spec.spanning;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<t.length;){this.stack.push(this.top,this.index+1);let o=-1,s=this.top.children.length;r<this.preMatch.index&&(s=Math.min(this.index+3,s));for(let e=this.index;e<s;e++){let n=this.top.children[e];if(n.matchesMark(t[i])&&!this.isLocked(n.dom)){o=e;break}}if(o<0&&this.index<this.top.children.length){let e=this.top.children[this.index];e instanceof Cr&&3!=e.dirty&&e.mark.type==t[i].type&&e.spec.update&&!this.isLocked(e.dom)&&e.spec.update(t[i])&&(e.mark=t[i],o=this.index,this.changed=!0)}if(o>-1)o>this.index&&(this.changed=!0,this.destroyBetween(this.index,o)),this.top=this.top.children[this.index];else{let r=Cr.create(this.top,t[i],e,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(t,e,n,r){let o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(t,e,n))i=this.top.children.indexOf(o,this.index);else for(let r=this.index,o=Math.min(this.top.children.length,r+5);r<o;r++){let o=this.top.children[r];if(o.matchesNode(t,e,n)&&!this.preMatch.matched.has(o)){i=r;break}}return!(i<0||(this.destroyBetween(this.index,i),this.index++,0))}updateNodeAt(t,e,n,r,o){let i=this.top.children[r];return 3==i.dirty&&i.dom==i.contentDOM&&(i.dirty=2),!!i.update(t,e,n,o)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(t){for(;;){let e=t.parentNode;if(!e)return-1;if(e==this.top.contentDOM){let e=t.pmViewDesc;if(e)for(let t=this.index;t<this.top.children.length;t++)if(this.top.children[t]==e)return t;return-1}t=e}}updateNextNode(t,e,n,r,o,i){for(let s=this.index;s<this.top.children.length;s++){let a=this.top.children[s];if(a instanceof xr){let l=this.preMatch.matched.get(a);if(null!=l&&l!=o)return!1;let c,d=a.dom,u=this.isLocked(d)&&!(t.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==t.text&&3!=a.dirty&&$r(e,a.outerDeco));if(!u&&a.update(t,e,n,r))return this.destroyBetween(this.index,s),a.dom!=d&&(this.changed=!0),this.index++,!0;if(!u&&(c=this.recreateWrapper(a,t,e,n,r,i)))return this.destroyBetween(this.index,s),this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(r,i+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,e,n,r,o,i){if(t.dirty||e.isAtom||!t.children.length||!t.node.content.eq(e.content)||!$r(n,t.outerDeco)||!r.eq(t.innerDeco))return null;let s=xr.create(this.top,e,n,r,o,i);if(s.contentDOM){s.children=t.children,t.children=[];for(let t of s.children)t.parent=s}return t.destroy(),s}addNode(t,e,n,r,o){let i=xr.create(this.top,t,e,n,r,o);i.contentDOM&&i.updateChildren(r,o+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(t,e,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(t)||t!=r.widget&&r.widget.type.toDOM.parentNode){let r=new wr(this.top,t,e,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let t=this.top.children[this.index-1],e=this.top;for(;t instanceof Cr;)e=t,t=e.children[e.children.length-1];
1(!t||!(t instanceof Er)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((qn||Un)&&t&&"false"==t.dom.contentEditable&&this.addHackNode("IMG",e),this.addHackNode("BR",this.top))}addHackNode(t,e){if(e==this.top&&this.index<e.children.length&&e.children[this.index].matchesHack(t))this.index++;else{let n=document.createElement(t);"IMG"==t&&(n.className="ProseMirror-separator",n.alt=""),"BR"==t&&(n.className="ProseMirror-trailingBreak");let r=new Mr(this.top,[],n,null);e!=this.top?e.children.push(r):e.children.splice(this.index++,0,r),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||1==t.nodeType&&t.contains(this.lock.parentNode))}}function Fr(t,e){return t.type.side-e.type.side}function zr(t,e,n,r,o){let i=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],c=a,d=a+=l.size;c>=n||d<=e?i.push(l):(c<e&&i.push(l.slice(0,e-c,r)),o&&(i.push(o),o=void 0),d>n&&i.push(l.slice(n-c,l.size,r)))}return i}function Hr(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=r.resolve(s);if(On(n)){for(a=s;o&&!o.node;)o=o.parent;let t=o.node;if(o&&t.isAtom&&Oe.isSelectable(t)&&o.parent&&(!t.isInline||!function(t,e,n){for(let r=0==e,o=e==_n(t);r||o;){if(t==n)return!0;let e=kn(t);if(!(t=t.parentNode))return!1;r=r&&0==e,o=o&&e==_n(t)}}(n.focusNode,n.focusOffset,o.dom))){let t=o.posBefore;l=new Oe(s==t?c:r.resolve(t))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let e=s,o=s;for(let r=0;r<n.rangeCount;r++){let i=n.getRangeAt(r);e=Math.min(e,t.docView.posFromDOM(i.startContainer,i.startOffset,1)),o=Math.max(o,t.docView.posFromDOM(i.endContainer,i.endOffset,-1))}if(e<0)return null;[a,s]=o==t.state.selection.anchor?[o,e]:[e,o],c=r.resolve(s)}else a=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let d=r.resolve(a);return l||(l=Yr(t,d,c,"pointer"==e||t.state.selection.head<c.pos&&!i?1:-1)),l}function jr(t){return t.editable?t.hasFocus():Zr(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Ur(t,e=!1){let n=t.state.selection;if(Gr(t,n),!jr(t))return;let r=t.input.mouseDown;if(!e&&Un&&r){let e=t.domSelectionRange(),n=t.domObserver.currentSelection;if(e.anchorNode&&n.anchorNode&&En(e.anchorNode,e.anchorOffset,n.anchorNode,n.anchorOffset)&&r.delaySelUpdate())return void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)!function(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r="IMG"==n.nodeName;r?e.collapse(n.parentNode,kn(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&Fn&&zn<=11&&(n.disabled=!0,n.disabled=!1)}(t);else{let r,o,{anchor:i,head:s}=n;!Vr||n instanceof _e||(n.$from.parent.inlineContent||(r=qr(t,n.from)),n.empty||n.$from.parent.inlineContent||(o=qr(t,n.to))),t.docView.setSelection(i,s,t,e),Vr&&(r&&Jr(r),o&&Jr(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==o||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{jr(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")},20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}const Vr=qn||Un&&Vn<63;function qr(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(qn&&o&&"false"==o.contentEditable)return Wr(o);if(!(o&&"false"!=o.contentEditable||i&&"false"!=i.contentEditable)){if(o)return Wr(o);if(i)return Wr(i)}}function Wr(t){return t.contentEditable="true",qn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Jr(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Gr(t,e){if(e instanceof Oe){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Kr(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Kr(t)}
1function Kr(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Yr(t,e,n,r){return t.someProp("createSelectionBetween",r=>r(t,e,n))||_e.between(e,n,r)}function Qr(t){return!(t.editable&&!t.hasFocus())&&Zr(t)}function Zr(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(t){return!1}}function Xr(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&Se.findFrom(i,e)}function to(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function eo(t,e,n){let r=t.state.selection;if(!(r instanceof _e)){if(r instanceof Oe&&r.node.isInline)return to(t,new _e(e>0?r.$to:r.$from));{let n=Xr(t.state,e);return!!n&&to(t,n)}}if(n.indexOf("s")>-1){let{$head:n}=r,o=n.textOffset?null:e<0?n.nodeBefore:n.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let i=t.state.doc.resolve(n.pos+o.nodeSize*(e<0?-1:1));return to(t,new _e(r.$anchor,i))}if(!r.empty)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){let n=Xr(t.state,e);return!!(n&&n instanceof Oe)&&to(t,n)}if(!(Jn&&n.indexOf("m")>-1)){let n,o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText)return!1;let s=e<0?o.pos-i.nodeSize:o.pos;return!!(i.isAtom||(n=t.docView.descAt(s))&&!n.contentDOM)&&(Oe.isSelectable(i)?to(t,new Oe(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):!!Yn&&to(t,new _e(t.state.doc.resolve(e<0?s:s+i.nodeSize))))}}function no(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function ro(t,e){let n=t.pmViewDesc;return n&&0==n.size&&(e<0||t.nextSibling||"BR"!=t.nodeName)}function oo(t,e){return e<0?function(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(Hn&&1==n.nodeType&&r<no(n)&&ro(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let t=n.childNodes[r-1];if(ro(t,-1))o=n,i=--r;else{if(3!=t.nodeType)break;n=t,r=n.nodeValue.length}}}else{if(io(n))break;{let e=n.previousSibling;for(;e&&ro(e,-1);)o=n.parentNode,i=kn(e),e=e.previousSibling;if(e)n=e,r=no(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?so(t,n,r):o&&so(t,o,i)}(t):function(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=no(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!ro(n.childNodes[r],1))break;o=n,i=++r}else{if(io(n))break;{let e=n.nextSibling;for(;e&&ro(e,1);)o=e.parentNode,i=kn(e)+1,e=e.nextSibling;if(e)n=e,r=0,s=no(n);else{if(n=n.parentNode,n==t.dom)break;r=s=0}}}o&&so(t,o,i)}(t)}function io(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function so(t,e,n){if(3!=e.nodeType){let t,r;(r=function(t,e){for(;t&&e==t.childNodes.length&&!Dn(t);)e=kn(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=n,e=0}}(e,n))?(e=r,n=0):(t=function(t,e){for(;t&&!e&&!Dn(t);)e=kn(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=(t=n).childNodes.length}}(e,n))&&(e=t,n=t.nodeValue.length)}let r=t.domSelection();if(!r)return;if(On(r)){let t=document.createRange();t.setEnd(e,n),t.setStart(e,n),r.removeAllRanges(),r.addRange(t)}
1else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&Ur(t)},50)}function ao(t,e){let n=t.state.doc.resolve(e);if(!Un&&!Gn&&n.parent.inlineContent){let r=t.coordsAtPos(e);if(e>n.start()){let n=t.coordsAtPos(e-1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(e<n.end()){let n=t.coordsAtPos(e+1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(t.dom).direction?"rtl":"ltr"}function lo(t,e,n){let r=t.state.selection;if(r instanceof _e&&!r.empty||n.indexOf("s")>-1)return!1;if(Jn&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let n=Xr(t.state,e);if(n&&n instanceof Oe)return to(t,n)}if(!o.parent.inlineContent){let n=e<0?o:i,s=r instanceof Ne?Se.near(n,e):Se.findFrom(n,e);return!!s&&to(t,s)}return!1}function co(t,e){if(!(t.state.selection instanceof _e))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=t.state.tr;return e<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),t.dispatch(r),!0}return!1}function uo(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function ho(t,e){t.someProp("transformCopied",n=>{e=n(e,t)});let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;let t=r.firstChild;n.push(t.type.name,t.attrs!=t.type.defaultAttrs?t.attrs:null),r=t.content}let s=t.someProp("clipboardSerializer")||Tt.fromSchema(t.state.schema),a=wo(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c,d=l.firstChild,u=0;for(;d&&1==d.nodeType&&(c=vo[d.nodeName.toLowerCase()]);){for(let t=c.length-1;t>=0;t--){let e=a.createElement(c[t]);for(;l.firstChild;)e.appendChild(l.firstChild);l.appendChild(e),u++}d=l.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice",`${o} ${i}${u?` -${u}`:""} ${JSON.stringify(n)}`),{dom:l,text:t.someProp("clipboardTextSerializer",n=>n(e,t))||e.content.textBetween(0,e.content.size,"\n\n"),slice:e}}function po(t,e,n,r,o){let i,s,a=o.parent.type.spec.code;if(!n&&!e)return null;let l=!!e&&(r||a||!n);if(l){if(t.someProp("transformPastedText",n=>{e=n(e,a||r,t)}),a)return s=new N(M.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0),t.someProp("transformPasted",e=>{s=e(s,t,!0)}),s;let n=t.someProp("clipboardTextParser",n=>n(e,o,r,t));if(n)s=n;else{let n=o.marks(),{schema:r}=t.state,s=Tt.fromSchema(r);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(t=>{let e=i.appendChild(document.createElement("p"));t&&e.appendChild(s.serializeNode(r.text(t,n)))})}}else t.someProp("transformPastedHTML",e=>{n=e(n,t)}),i=function(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n,r=wo(),o=r.body,i=/<([a-z][^>\s]+)/i.exec(t);if((n=i&&vo[i[1].toLowerCase()])&&(t=n.map(t=>"<"+t+">").join("")+t+n.map(t=>"</"+t+">").reverse().join("")),o.innerHTML=function(t){let e=window.trustedTypes;if(!e)return t;if(!ko){if(ko=e.defaultPolicy)try{return ko.createHTML(t)}catch(t){}ko=e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})}return ko.createHTML(t)}(t),n)for(let t=0;t<n.length;t++)o=o.querySelector(n[t])||o;for(let t=0;t<r.styleSheets.length;t++){let e=r.styleSheets[t];for(let t=0;t<e.rules.length;t++){let n=e.rules[t];if(n instanceof CSSStyleRule){let t=o.querySelectorAll(n.selectorText);for(let e=0;e<t.length;e++)t[e].style.cssText+=n.style.cssText}}}return o}(n),Yn&&function(t){let e=t.querySelectorAll(Un?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}(i);let c=i&&i.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let t=+d[3];t>0;t--){let t=i.firstChild;for(;t&&1!=t.nodeType;)t=t.nextSibling;if(!t)break;
1i=t}if(!s){let e=t.someProp("clipboardParser")||t.someProp("domParser")||yt.fromSchema(t.state.schema);s=e.parseSlice(i,{preserveWhitespace:!(!l&&!d),context:o,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||fo.test(t.parentNode.nodeName)?null:{ignore:!0}})}if(d)s=function(t,e){if(!t.size)return t;let n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(e){return t}let{content:o,openStart:i,openEnd:s}=t;for(let t=n.length-2;t>=0;t-=2){let e=r.nodes[n[t]];if(!e||e.hasRequiredAttrs())break;try{e.checkAttrs(n[t+1])}catch(t){break}o=M.from(e.create(n[t+1],o)),i++,s++}return new N(o,i,s)}(bo(s,+d[1],+d[2]),d[4]);else if(s=N.maxOpen(function(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r,o=e.node(n).contentMatchAt(e.index(n)),i=[];if(t.forEach(t=>{if(!i)return;let e,n=o.findWrapping(t.type);if(!n)return i=null;if(e=i.length&&r.length&&mo(n,r,t,i[i.length-1],0))i[i.length-1]=e;else{i.length&&(i[i.length-1]=Ao(i[i.length-1],r.length));let e=go(t,n);i.push(e),o=o.matchType(e.type),r=n}}),i)return M.from(i)}return t}(s.content,o),!0),s.openStart||s.openEnd){let t=0,e=0;for(let e=s.content.firstChild;t<s.openStart&&!e.type.spec.isolating;t++,e=e.firstChild);for(let t=s.content.lastChild;e<s.openEnd&&!t.type.spec.isolating;e++,t=t.lastChild);s=bo(s,t,e)}return t.someProp("transformPasted",e=>{s=e(s,t,l)}),s}const fo=/^(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 go(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,M.from(t));return t}function mo(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=mo(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(M.from(go(n,t,o+1))))}}function Ao(t,e){if(0==e)return t;let n=t.content.replaceChild(t.childCount-1,Ao(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(M.empty,!0);return t.copy(n.append(r))}function yo(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(i=0),o<r-1&&(a=yo(a,e,n,r,o+1,i)),o>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(M.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function bo(t,e,n){return e<t.openStart&&(t=new N(yo(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new N(yo(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const vo={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function wo(){return document.implementation.createHTMLDocument("title")}let ko=null;const Co={},xo={},So={touchstart:!0,touchmove:!0};class Eo{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Mo(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function To(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=e=>_o(t,e))})}function _o(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return!!r&&(r(t,e)||e.defaultPrevented)})}function Do(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||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function Oo(t){return{left:t.clientX,top:t.clientY}}function Io(t,e,n,r,o){if(-1==r)return!1;let i=t.state.doc.resolve(r);for(let r=i.depth+1;r>0;r--)if(t.someProp(e,e=>r>i.depth?e(t,n,i.nodeAfter,i.before(r),o,!0):e(t,n,i.node(r),i.before(r),o,!1)))return!0;return!1}
1function No(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function Lo(t,e,n,r){return Io(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",n=>n(t,e,r))}function Bo(t,e,n,r){return Io(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",n=>n(t,e,r))||function(t,e,n){if(0!=n.button)return!1;let r=$o(t,e,!0),o=t.state.doc;return!!r&&(No(t,r,"pointer"),r instanceof _e&&o.eq(t.state.doc)&&(t.input.mouseDown=new Ho(t,r)),!0)}(t,n,r)}function $o(t,e,n){let r=t.state.doc;if(-1==e)return r.inlineContent?_e.create(r,0,r.content.size):null;let o=r.resolve(e);for(let t=o.depth+1;t>0;t--){let e=t>o.depth?o.nodeAfter:o.node(t),i=o.before(t);if(e.inlineContent)return _e.create(r,i+1,i+1+e.content.size);if(n&&Oe.isSelectable(e))return Oe.create(r,i)}return null}function Ro(t){return Wo(t)}xo.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!jo(t)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!Kn||!Un||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!Wn||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",e=>e(t,n))||function(t,e){let n=e.keyCode,r=function(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);if(8==n||Jn&&72==n&&"c"==r)return co(t,-1)||oo(t,-1);if(46==n&&!e.shiftKey||Jn&&68==n&&"c"==r)return co(t,1)||oo(t,1);if(13==n||27==n)return!0;if(37==n||Jn&&66==n&&"c"==r){let e=37==n?"ltr"==ao(t,t.state.selection.from)?-1:1:-1;return eo(t,e,r)||oo(t,e)}if(39==n||Jn&&70==n&&"c"==r){let e=39==n?"ltr"==ao(t,t.state.selection.from)?1:-1:1;return eo(t,e,r)||oo(t,e)}return 38==n||Jn&&80==n&&"c"==r?lo(t,-1,r)||oo(t,-1):40==n||Jn&&78==n&&"c"==r?function(t){if(!qn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&1==e.nodeType&&0==n&&e.firstChild&&"false"==e.firstChild.contentEditable){let n=e.firstChild;uo(t,n,"true"),setTimeout(()=>uo(t,n,"false"),20)}return!1}(t)||lo(t,1,r)||oo(t,1):r==(Jn?"m":"c")&&(66==n||73==n||89==n||90==n)}(t,n)?n.preventDefault():Mo(t,"key");else{let e=Date.now();t.input.lastIOSEnter=e,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==e&&(t.someProp("handleKeyDown",e=>e(t,In(13,"Enter"))),t.input.lastIOSEnter=0)},200)}},xo.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},xo.keypress=(t,e)=>{let n=e;if(jo(t)||!n.charCode||n.ctrlKey&&!n.altKey||Jn&&n.metaKey)return;if(t.someProp("handleKeyPress",e=>e(t,n)))return void n.preventDefault();let r=t.state.selection;if(!(r instanceof _e&&r.$from.sameParent(r.$to))){let e=String.fromCharCode(n.charCode),o=()=>t.state.tr.insertText(e).scrollIntoView();/[\r\n]/.test(e)||t.someProp("handleTextInput",n=>n(t,r.$from.pos,r.$to.pos,e,o))||t.dispatch(o()),n.preventDefault()}};const Po=Jn?"metaKey":"ctrlKey";Co.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Ro(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&function(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(n,t.input.lastClick)&&!n[Po]&&t.input.lastClick.button==n.button&&("singleClick"==t.input.lastClick.type?i="doubleClick":"doubleClick"==t.input.lastClick.type&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i,button:n.button},t.input.mouseDown&&t.input.mouseDown.done();let s=t.posAtCoords(Oo(n));s&&("singleClick"==i?t.input.mouseDown=new zo(t,s,n,!!r):("doubleClick"==i?Lo:Bo)(t,s.pos,s.inside,n)?n.preventDefault():Mo(t,"pointer"))};class Fo{constructor(t){this.view=t,this.mightDrag=null,t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(t){this.done()}move(t){0==t.buttons&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class zo extends Fo{constructor(t,e,n,r){let o,i;if(super(t),this.pos=e,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=t.state.doc,this.selectNode=!!n[Po],this.allowDefault=n.shiftKey,e.inside>-1)o=t.state.doc.nodeAt(e.inside),i=e.inside;else{let n=t.state.doc.resolve(e.pos);o=n.parent,i=n.depth?n.before():0}const s=r?null:n.target,a=s?t.docView.nearestDesc(s,!0):null;this.target=a&&1==a.nodeDOM.nodeType?a.nodeDOM:null;let{selection:l}=t.state;0==n.button&&(o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof Oe&&l.from<=i&&l.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Hn||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()),Mo(t,"pointer")}done(){super.done(),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(()=>{this.view.isDestroyed||Ur(this.view)})}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(Oo(t))),this.updateAllowDefault(t),this.allowDefault||!e?Mo(this.view,"pointer"):function(t,e,n,r,o){return Io(t,"handleClickOn",e,n,r)||t.someProp("handleClick",n=>n(t,e,r))||(o?function(t,e){if(-1==e)return!1;let n,r,o=t.state.selection;o instanceof Oe&&(n=o.node);let i=t.state.doc.resolve(e);for(let t=i.depth+1;t>0;t--){let e=t>i.depth?i.nodeAfter:i.node(t);
1if(Oe.isSelectable(e)){r=n&&o.$from.depth>0&&t>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(t);break}}return null!=r&&(No(t,Oe.create(t.state.doc,r),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&Oe.isSelectable(r))&&(No(t,new Oe(n),"pointer"),!0)}(t,n))}(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||qn&&this.mightDrag&&!this.mightDrag.node.isAtom||Un&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(No(this.view,Se.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):Mo(this.view,"pointer")}move(t){this.updateAllowDefault(t),Mo(this.view,"pointer"),super.move(t)}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return!!this.allowDefault&&(this.delayedSelectionSync=!0,!0)}}class Ho extends Fo{constructor(t,e){super(t),this.startSelection=e,this.startDoc=t.state.doc}move(t){if(0==t.buttons||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc))return void this.done();t.preventDefault(),Mo(this.view,"pointer");let e=this.view.posAtCoords(Oo(t)),n=e&&$o(this.view,e.inside,!1);if(!n)return;let{doc:r}=this.view.state,o=this.startSelection,[i,s]=n.from<o.from?[o.to,n.from]:[o.from,n.to];No(this.view,_e.create(r,i,s),"pointer")}}function jo(t,e){return!!t.composing||!!(qn&&Math.abs(Date.now()-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}Co.touchstart=t=>{t.input.lastTouch=Date.now(),Ro(t),Mo(t,"pointer")},Co.touchmove=t=>{t.input.lastTouch=Date.now(),Mo(t,"pointer")},Co.contextmenu=t=>Ro(t);const Uo=Kn?5e3:-1;function Vo(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Wo(t),e))}function qo(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Wo(t,e=!1){if(!(Kn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),qo(t),e||t.docView&&t.docView.dirty){let n=Hr(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.updateState(t.state):t.dispatch(t.state.tr.deleteSelection()),!0}return!1}}xo.compositionstart=xo.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof _e&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(t=>!1===t.type.spec.inclusive)||Un&&Gn&&function(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||1!=e.nodeType||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return 1==r.nodeType&&"false"==r.contentEditable}(t)))t.markCursor=t.state.storedMarks||n.marks(),Wo(t,!0),t.markCursor=null;else if(Wo(t,!e.selection.empty),Hn&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let e=t.domSelectionRange();for(let n=e.focusNode,r=e.focusOffset;n&&1==n.nodeType&&0!=r;){let e=r<0?n.lastChild:n.childNodes[r-1];if(!e)break;if(3==e.nodeType){let n=t.domSelection();n&&n.collapse(e,e.nodeValue.length);break}n=e,r=-1}}t.input.composing=!0}Vo(t,Uo)},xo.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now(),t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Vo(t,20))};const Jo=Fn&&zn<15||Wn&&Qn<604;function Go(t,e,n,r,o){let i=po(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",e=>e(t,o,i||N.empty)))return!0;if(!i)return!1;let s=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(i),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(i);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Ko(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;
1let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Co.copy=xo.cut=(t,e)=>{let n=e,r=t.state.selection,o="cut"==n.type;if(r.empty)return;let i=Jo?null:n.clipboardData,s=r.content(),{dom:a,text:l}=ho(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):function(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},xo.paste=(t,e)=>{let n=e;if(t.composing&&!Kn)return;let r=Jo?null:n.clipboardData,o=t.input.shiftKey&&45!=t.input.lastKeyCode;r&&Go(t,Ko(r),r.getData("text/html"),o,n)?n.preventDefault():function(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=t.input.shiftKey&&45!=t.input.lastKeyCode;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Go(t,r.value,null,o,e):Go(t,r.textContent,r.innerHTML,o,e)},50)}(t,n)};class Yo{constructor(t,e,n){this.slice=t,this.move=e,this.node=n}}const Qo=Jn?"altKey":"ctrlKey";function Zo(t,e){let n;return t.someProp("dragCopies",t=>{n=n||t(e)}),null!=n?!n:!e[Qo]}Co.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o,i=t.state.selection,s=i.empty?null:t.posAtCoords(Oo(n));if(s&&s.pos>=i.from&&s.pos<=(i instanceof Oe?i.to-1:i.to));else if(r&&r.mightDrag)o=Oe.create(t.state.doc,r.mightDrag.pos);else if(n.target&&1==n.target.nodeType){let e=t.docView.nearestDesc(n.target,!0);e&&e.node.type.spec.draggable&&e!=t.docView&&(o=Oe.create(t.state.doc,e.posBefore))}let a=(o||t.state.selection).content(),{dom:l,text:c,slice:d}=ho(t,a);(!n.dataTransfer.files.length||!Un||Vn>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Jo?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Jo||n.dataTransfer.setData("text/plain",c),t.dragging=new Yo(d,Zo(t,n),o)},Co.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},xo.dragover=xo.dragenter=(t,e)=>e.preventDefault(),xo.drop=(t,e)=>{try{!function(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(Oo(e));if(!r)return;let o=t.state.doc.resolve(r.pos),i=n&&n.slice;i?t.someProp("transformPasted",e=>{i=e(i,t,!1)}):i=po(t,Ko(e.dataTransfer),Jo?null:e.dataTransfer.getData("text/html"),!1,o);let s=!(!n||!Zo(t,e));if(t.someProp("handleDrop",n=>n(t,e,i||N.empty,s)))return void e.preventDefault();if(!i)return;e.preventDefault();let a=i?ae(t.state.doc,o.pos,i):o.pos;null==a&&(a=o.pos);let l=t.state.tr;if(s){let{node:t}=n;t?t.replace(l):l.deleteSelection()}let c=l.mapping.map(a),d=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,u=l.doc;if(d?l.replaceRangeWith(c,c,i.content.firstChild):l.replaceRange(c,c,i),l.doc.eq(u))return;let h=l.doc.resolve(c);if(d&&Oe.isSelectable(i.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new Oe(h));else{let e=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((t,n,r,o)=>e=o),l.setSelection(Yr(t,h,l.doc.resolve(e)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))}(t,e,t.dragging)}finally{t.dragging=null}},Co.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())&&Ur(t)},20))},Co.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)},Co.beforeinput=(t,e)=>{if(Kn&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();let{domChangeCount:e}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=e)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",e=>e(t,In(8,"Backspace"))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let t in xo)Co[t]=xo[t];function Xo(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class ti{constructor(t,e){this.toDOM=t,this.spec=e||ii,this.side=this.spec.side||0}map(t,e,n,r){let{pos:o,deleted:i}=t.mapResult(e.from+r,this.side<0?-1:1);return i?null:new ri(o-n,o-n,this)}valid(){return!0}eq(t){return this==t||t instanceof ti&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Xo(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class ei{constructor(t,e){this.attrs=t,this.spec=e||ii}map(t,e,n,r){let o=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,i=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new ri(o,i,this)}valid(t,e){return e.from<e.to}eq(t){return this==t||t instanceof ei&&Xo(this.attrs,t.attrs)&&Xo(this.spec,t.spec)}static is(t){return t.type instanceof ei}destroy(){}}class ni{constructor(t,e){this.attrs=t,this.spec=e||ii}map(t,e,n,r){let o=t.mapResult(e.from+r,1);if(o.deleted)return null;let i=t.mapResult(e.to+r,-1);return i.deleted||i.pos<=o.pos?null:new ri(o.pos-n,i.pos-n,this)}valid(t,e){let n,{index:r,offset:o}=t.content.findIndex(e.from);return o==e.from&&!(n=t.child(r)).isText&&o+n.nodeSize==e.to}eq(t){return this==t||t instanceof ni&&Xo(this.attrs,t.attrs)&&Xo(this.spec,t.spec)}destroy(){}}class ri{constructor(t,e,n){this.from=t,this.to=e,this.type=n}copy(t,e){return new ri(t,e,this.type)}eq(t,e=0){return this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to}map(t,e,n){return this.type.map(t,this,e,n)}static widget(t,e,n){return new ri(t,t,new ti(e,n))}static inline(t,e,n,r){return new ri(t,e,new ei(n,r))}
vendor: 6,777 bytes, line 1
1static node(t,e,n,r){return new ri(t,e,new ni(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof ei}get widget(){return this.type instanceof ti}}const oi=[],ii={};class si{constructor(t,e){this.local=t.length?t:oi,this.children=e.length?e:oi}static create(t,e){return e.length?hi(e,t,0,ii):ai}find(t,e,n){let r=[];return this.findInner(t??0,e??1e9,r,0,n),r}findInner(t,e,n,r,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=e&&s.to>=t&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<e&&this.children[i+1]>t){let s=this.children[i]+1;this.children[i+2].findInner(t-s,e-s,n,r+s,o)}}map(t,e,n){return this==ai||0==t.maps.length?this:this.mapInner(t,e,0,0,n||ii)}mapInner(t,e,n,r,o){let i;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(t,n,r);a&&a.type.valid(e,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(t,e,n,r,o,i,s){let a=t.slice();for(let t=0,e=i;t<n.maps.length;t++){let r=0;n.maps[t].forEach((t,n,o,i)=>{let s=i-o-(n-t);for(let o=0;o<a.length;o+=3){let i=a[o+1];if(i<0||t>i+e-r)continue;let l=a[o]+e-r;n>=l?a[o+1]=t<=l?-2:-1:t>=e&&s&&(a[o]+=s,a[o+1]+=s)}r+=s}),e=n.maps[t].map(e,-1)}let l=!1;for(let e=0;e<a.length;e+=3)if(a[e+1]<0){if(-2==a[e+1]){l=!0,a[e+1]=-1;continue}let c=n.map(t[e]+i),d=c-o;if(d<0||d>=r.content.size){l=!0;continue}let u=n.map(t[e+1]+i,-1)-o,{index:h,offset:p}=r.content.findIndex(d),f=r.maybeChild(h);if(f&&p==d&&p+f.nodeSize==u){let r=a[e+2].mapInner(n,f,c+1,t[e]+i+1,s);r!=ai?(a[e]=d,a[e+1]=u,a[e+2]=r):(a[e+1]=-2,l=!0)}else l=!0}if(l){let l=function(t,e,n,r,o,i,s){function a(t,e){for(let i=0;i<t.local.length;i++){let a=t.local[i].map(r,o,e);a?n.push(a):s.onRemove&&s.onRemove(t.local[i].spec)}for(let n=0;n<t.children.length;n+=3)a(t.children[n+2],t.children[n]+e+1)}for(let n=0;n<t.length;n+=3)-1==t[n+1]&&a(t[n+2],e[n]+i+1);return n}(a,t,e,n,o,i,s),c=hi(l,r,0,s);e=c.local;for(let t=0;t<a.length;t+=3)a[t+1]<0&&(a.splice(t,3),t-=3);for(let t=0,e=0;t<c.children.length;t+=3){let n=c.children[t];for(;e<a.length&&a[e]<n;)e+=3;a.splice(e,0,c.children[t],c.children[t+1],c.children[t+2])}}return new si(e.sort(pi),a)}(this.children,i||[],t,e,n,r,o):i?new si(i.sort(pi),oi):ai}add(t,e){return e.length?this==ai?si.create(t,e):this.addInner(t,e,0):this}addInner(t,e,n){let r,o=0;t.forEach((t,i)=>{let s,a=i+n;if(s=di(e,t,a)){for(r||(r=this.children.slice());o<r.length&&r[o]<i;)o+=3;r[o]==i?r[o+2]=r[o+2].addInner(t,s,a+1):r.splice(o,0,i,i+t.nodeSize,hi(s,t,a+1,ii)),o+=3}});let i=ci(o?ui(e):e,-n);for(let e=0;e<i.length;e++)i[e].type.valid(t,i[e])||i.splice(e--,1);return new si(i.length?this.local.concat(i).sort(pi):this.local,r||this.children)}remove(t){return 0==t.length||this==ai?this:this.removeInner(t,0)}removeInner(t,e){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let o,i=n[r]+e,s=n[r+1]+e;for(let e,n=0;n<t.length;n++)(e=t[n])&&e.from>i&&e.to<s&&(t[n]=null,(o||(o=[])).push(e));if(!o)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(o,i+1);a!=ai?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,o=0;o<t.length;o++)if(n=t[o])for(let t=0;t<r.length;t++)r[t].eq(n,e)&&(r==this.local&&(r=this.local.slice()),r.splice(t--,1));return n==this.children&&r==this.local?this:r.length||n.length?new si(r,n):ai}forChild(t,e){if(this==ai)return this;if(e.isLeaf)return si.empty;let n,r;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(n=this.children[e+2]);break}let o=t+1,i=o+e.content.size;for(let t=0;t<this.local.length;t++){let e=this.local[t];if(e.from<i&&e.to>o&&e.type instanceof ei){let t=Math.max(o,e.from)-o,n=Math.min(i,e.to)-o;t<n&&(r||(r=[])).push(e.copy(t,n))}}if(r){let t=new si(r.sort(pi),oi);return n?new li([t,n]):t}return n||ai}eq(t){if(this==t)return!0;if(!(t instanceof si)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(t){return fi(this.localsInner(t))}localsInner(t){if(this==ai)return oi;if(t.inlineContent||!this.local.some(ei.is))return this.local;let e=[];for(let t=0;t<this.local.length;t++)this.local[t].type instanceof ei||e.push(this.local[t]);return e}forEachSet(t){t(this)}}si.empty=new si([],[]),si.removeOverlap=fi;const ai=si.empty;class li{constructor(t){this.members=t}map(t,e){const n=this.members.map(n=>n.map(t,e,ii));return li.from(n)}forChild(t,e){if(e.isLeaf)return si.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(t,e);o!=ai&&(o instanceof li?n=n.concat(o.members):n.push(o))}return li.from(n)}eq(t){if(!(t instanceof li)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(t){let e,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(t);if(o.length)if(e){n&&(e=e.slice(),n=!1);for(let t=0;t<o.length;t++)e.push(o[t])}else e=o}return e?fi(n?e:e.sort(pi)):oi}static from(t){switch(t.length){case 0:return ai;case 1:return t[0];default:return new li(t.every(t=>t instanceof si)?t:t.reduce((t,e)=>t.concat(e instanceof si?e:e.members),[]))}}forEachSet(t){for(let e=0;e<this.members.length;e++)this.members[e].forEachSet(t)}}function ci(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new ri(o.from+e,o.to+e,o.type))}return n}function di(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let e,i=0;i<t.length;i++)(e=t[i])&&e.from>n&&e.to<r&&((o||(o=[])).push(e),t[i]=null);return o}function ui(t){let e=[];for(let n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function hi(t,e,n,r){let o=[],i=!1;e.forEach((e,s)=>{let a=di(t,e,s+n);if(a){i=!0;let t=hi(a,e,n+s+1,r);t!=ai&&o.push(s,s+e.nodeSize,t)}});let s=ci(i?ui(t):t,-n).sort(pi);for(let t=0;t<s.length;t++)s[t].type.valid(e,s[t])||(r.onRemove&&r.onRemove(s[t].spec),s.splice(t--,1));return s.length||o.length?new si(s,o):ai}function pi(t,e){return t.from-e.from||t.to-e.to}function fi(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let i=e[o];if(i.from!=r.from){i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),gi(e,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),gi(e,o+1,i.copy(r.to,i.to)))}}return e}function gi(t,e,n){for(;e<t.length&&pi(n,t[e])>0;)e++;t.splice(e,0,n)}function mi(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=ai&&e.push(r)}
1),t.cursorWrapper&&e.push(si.create(t.state.doc,[t.cursorWrapper.deco])),li.from(e)}const Ai={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},yi=Fn&&zn<=11;class bi{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class vi{constructor(t,e){this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new bi,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);Fn&&zn<=11&&e.some(t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():qn&&t.composing&&e.some(t=>"childList"==t.type&&"TR"==t.target.nodeName)?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),yi&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.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,Ai)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let e=0;e<t.length;e++)this.queue.push(t[e]);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(Qr(this.view)){if(this.suppressingSelectionUpdates)return Ur(this.view);if(Fn&&zn<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&En(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let e,n=new Set;for(let e=t.focusNode;e;e=Cn(e))n.add(e);for(let r=t.anchorNode;r;r=Cn(r))if(n.has(r)){e=r;break}let r=e&&this.view.docView.nearestDesc(e);return r&&r.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let e=this.pendingRecords();e.length&&(this.queue=[]);let n=t.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Qr(t)&&!this.ignoreSelectionChange(n),o=-1,i=-1,s=!1,a=[];if(t.editable)for(let t=0;t<e.length;t++){let n=this.registerMutation(e[t],a);n&&(o=o<0?n.from:Math.min(n.from,o),i=i<0?n.to:Math.max(n.to,i),n.typeOver&&(s=!0))}if(a.some(t=>"BR"==t.nodeName)&&(8==t.input.lastKeyCode||46==t.input.lastKeyCode||Un&&(t.composing||t.input.compositionEndedAt>Date.now()-50)&&e.some(t=>"childList"==t.type&&t.removedNodes.length))){for(let t of a)if("BR"==t.nodeName&&t.parentNode){let e=t.nextSibling;for(;e&&1==e.nodeType;){if("false"==e.contentEditable){t.parentNode.removeChild(t);break}e=e.firstChild}}}else if(Hn&&a.length){let e=a.filter(t=>"BR"==t.nodeName);if(2==e.length){let[t,n]=e;t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of e){let e=r.parentNode;!e||"LI"!=e.nodeName||n&&xi(t,n)==e||r.remove()}}}let l=null;o<0&&r&&t.input.lastFocus>
1Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&On(n)&&(l=Hr(t))&&l.eq(Se.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,Ur(t),this.currentSelection.set(n),t.scrollToSelection()):(o>-1||r)&&(o>-1&&(t.docView.markDirty(o,i),function(t){if(!wi.has(t)&&(wi.set(t,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace))){if(t.requiresGeckoHackNode=Hn,ki)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."),ki=!0}}(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,function(t,e){var n;let{focusNode:r,focusOffset:o}=t.domSelectionRange();for(let i of e)if("TR"==(null===(n=i.parentNode)||void 0===n?void 0:n.nodeName)){let e=i.nextSibling;for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.nextSibling;if(e){let n=e;for(;;){let t=n.firstChild;if(!t||1!=t.nodeType||"false"==t.contentEditable||/^(BR|IMG)$/.test(t.nodeName))break;n=t}n.insertBefore(i,n.firstChild),r==i&&t.domSelection().collapse(i,o)}else i.parentNode.removeChild(i)}}(t,a)),this.handleDOMChange(o,i,s,a),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||Ur(t),this.currentSelection.set(n))}registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(let n=0;n<t.addedNodes.length;n++){let r=t.addedNodes[n];e.push(r),3==r.nodeType&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(t.target))return{from:n.posBefore,to:n.posAfter};let r=t.previousSibling,o=t.nextSibling;if(Fn&&zn<=11&&t.addedNodes.length)for(let e=0;e<t.addedNodes.length;e++){let{previousSibling:n,nextSibling:i}=t.addedNodes[e];(!n||Array.prototype.indexOf.call(t.addedNodes,n)<0)&&(r=n),(!i||Array.prototype.indexOf.call(t.addedNodes,i)<0)&&(o=i)}let i=r&&r.parentNode==t.target?kn(r)+1:0,s=n.localPosFromDOM(t.target,i,-1),a=o&&o.parentNode==t.target?kn(o):t.target.childNodes.length;return{from:s,to:n.localPosFromDOM(t.target,a,1)}}return"attributes"==t.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=t.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let wi=new WeakMap,ki=!1;function Ci(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,i=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return En(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function xi(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let e=t.docView.nearestDesc(n,!0);if(e&&e.node.isBlock)return n}return null}const Si=/^(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 Ei(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Yr(t,e.resolve(n.anchor),e.resolve(n.head))}function Mi(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let e=t.node(r).maybeChild(t.indexAfter(r));for(;e&&!e.isLeaf;)e=e.firstChild,o++}return o}class Ti{constructor(t,e){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 Eo,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(Ni),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Oi(this),Di(this),this.nodeViews=Ii(this),this.docView=Sr(this.state.doc,_i(this),mi(this),this.dom,this),this.domObserver=new vi(this,(t,e,n,r)=>function(t,e,n,r,o){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let e=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,n=Hr(t,e);
1if(n&&!t.state.selection.eq(n)){if(Un&&Kn&&13===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",e=>e(t,In(13,"Enter"))))return;let r=t.state.tr.setSelection(n);"pointer"==e?r.setMeta("pointer",!0):"key"==e&&r.scrollIntoView(),i&&r.setMeta("composition",i),t.dispatch(r)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l,c,d=t.state.selection,u=function(t,e,n,r){let o,{node:i,fromOffset:s,toOffset:a,from:l,to:c}=t.docView.parseRange(e,n),d=t.domSelectionRange(),u=d.anchorNode;if(u&&t.dom.contains(1==u.nodeType?u:u.parentNode)&&(o=[{node:u,offset:d.anchorOffset}],On(d)||o.push({node:d.focusNode,offset:d.focusOffset})),Un&&8===t.input.lastKeyCode)for(let t=a;t>s;t--){let e=i.childNodes[t-1],n=e.pmViewDesc;if("BR"==e.nodeName&&!n){a=t;break}if(!n||n.size)break}let h=t.state.doc,p=t.someProp("domParser")||yt.fromSchema(t.state.schema),f=h.resolve(l),g=null,m=p.parse(i,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:s,to:a,preserveWhitespace:"pre"!=f.parent.type.whitespace||"full",findPositions:o,ruleFromNode:(A=r,t=>{let e=t.pmViewDesc;if(e)return e.parseRule(A);if("BR"==t.nodeName&&t.parentNode){if(qn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}if(t.parentNode.lastChild==t||qn&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}),context:f});var A;if(o&&null!=o[0].pos){let t=o[0].pos,e=o[1]&&o[1].pos;null==e&&(e=t),g={anchor:t+l,head:e+l}}return{doc:m,sel:g,from:l,to:c}}(t,e,n,o),h=t.state.doc,p=h.slice(u.from,u.to);8===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime?(l=t.state.selection.to,c="end"):(l=t.state.selection.from,c="start"),t.input.lastKeyCode=null;let f=function(t,e,n,r,o){let i=t.findDiffStart(e,n),s=n+t.size,a=n+e.size;if(null==i)return null;let{a:l,b:c}=t.findDiffEnd(e,s,a);return"end"==o&&(r-=l+Math.max(0,i-Math.min(l,c))-i),l<i&&s<a?(i-=r<=i&&r>=l?i-r:0,c=i+(c-l),l=i):c<i&&(i-=r<=i&&r>=c?i-r:0,l=i+(l-c),c=i),{start:i,endA:l,endB:c}}(p.content,u.doc.content,u.from,l,c);if(f&&t.input.domChangeCount++,(Wn&&t.input.lastIOSEnter>Date.now()-225||Kn)&&o.some(t=>1==t.nodeType&&!Si.test(t.nodeName))&&(!f||f.endA>=f.endB)&&t.someProp("handleKeyDown",e=>e(t,In(13,"Enter"))))return void(t.input.lastIOSEnter=0);if(!f){if(!(r&&d instanceof _e&&!d.empty&&d.$head.sameParent(d.$anchor))||t.composing||u.sel&&u.sel.anchor!=u.sel.head){if(u.sel){let e=Ei(t,t.state.doc,u.sel);if(e&&!e.eq(t.state.selection)){let n=t.state.tr.setSelection(e);i&&n.setMeta("composition",i),t.dispatch(n)}}return}f={start:d.from,endA:d.to,endB:d.to}}t.state.selection.from<t.state.selection.to&&f.start==f.endB&&t.state.selection instanceof _e&&(f.start>t.state.selection.from&&f.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?f.start=t.state.selection.from:f.endA<t.state.selection.to&&f.endA>=t.state.selection.to-2&&t.state.selection.to<=u.to&&(f.endB+=t.state.selection.to-f.endA,f.endA=t.state.selection.to)),Fn&&zn<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>u.from&&"  "==u.doc.textBetween(f.start-u.from-1,f.start-u.from+1)&&(f.start--,f.endA--,f.endB--);let g=u.doc.resolveNoCache(f.start-u.from),m=u.doc.resolveNoCache(f.endB-u.from),A=h.resolve(f.start),y=g.sameParent(m)&&g.parent.inlineContent&&A.end()>=f.endA;if((Wn&&t.input.lastIOSEnter>Date.now()-225&&(!y||o.some(t=>"DIV"==t.nodeName||"P"==t.nodeName))||!y&&g.pos<u.doc.content.size&&(!g.sameParent(m)||!g.parent.inlineContent)&&g.pos<m.pos&&!/\S/.test(u.doc.textBetween(g.pos,m.pos,"","")))&&t.someProp("handleKeyDown",e=>e(t,In(13,"Enter"))))return void(t.input.lastIOSEnter=0);if(t.state.selection.anchor>f.start&&function(t,e,n,r,o){if(n-e<=o.pos-r.pos||Mi(r,!0,!1)<o.pos)return!1;let i=t.resolve(e);if(!r.parent.isTextblock){let t=i.nodeAfter;return null!=t&&n==e+t.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=t.resolve(Mi(i,!0,!0));return!(!s.parent.isTextblock||s.pos>n||Mi(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(h,f.start,f.endA,g,m)&&t.someProp("handleKeyDown",e=>e(t,In(8,"Backspace"))))return void(Kn&&Un&&t.domObserver.suppressSelectionUpdates());
1Un&&f.endB==f.start&&(t.input.lastChromeDelete=Date.now()),Kn&&!y&&g.start()!=m.start()&&0==m.parentOffset&&g.depth==m.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==f.endA&&(f.endB-=2,m=u.doc.resolveNoCache(f.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(e){return e(t,In(13,"Enter"))})},20));let b,v=f.start,w=f.endA,k=e=>{let n=e||t.state.tr.replace(v,w,u.doc.slice(f.start-u.from,f.endB-u.from));if(u.sel){let e=Ei(t,n.doc,u.sel);e&&!(Un&&t.composing&&e.empty&&(f.start!=f.endB||t.input.lastChromeDelete<Date.now()-100)&&(e.head==v||e.head==n.mapping.map(w)-1)||Fn&&e.empty&&e.head==v)&&n.setSelection(e)}return i&&n.setMeta("composition",i),n.scrollIntoView()};if(y)if(g.pos==m.pos){Fn&&zn<=11&&0==g.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ur(t),20));let e=k(t.state.tr.delete(v,w)),n=h.resolve(f.start).marksAcross(h.resolve(f.endA));n&&e.ensureMarks(n),t.dispatch(e)}else if(f.endA==f.endB&&(b=function(t,e){let n,r,o,i=t.firstChild.marks,s=e.firstChild.marks,a=i,l=s;for(let t=0;t<s.length;t++)a=s[t].removeFromSet(a);for(let t=0;t<i.length;t++)l=i[t].removeFromSet(l);if(1==a.length&&0==l.length)r=a[0],n="add",o=t=>t.mark(r.addToSet(t.marks));else{if(0!=a.length||1!=l.length)return null;r=l[0],n="remove",o=t=>t.mark(r.removeFromSet(t.marks))}let c=[];for(let t=0;t<e.childCount;t++)c.push(o(e.child(t)));if(M.from(c).eq(t))return{mark:r,type:n}}(g.parent.content.cut(g.parentOffset,m.parentOffset),A.parent.content.cut(A.parentOffset,f.endA-A.start())))){let e=k(t.state.tr);"add"==b.type?e.addMark(v,w,b.mark):e.removeMark(v,w,b.mark),t.dispatch(e)}else if(g.parent.child(g.index()).isText&&g.index()==m.index()-(m.textOffset?0:1)){let e=g.parent.textBetween(g.parentOffset,m.parentOffset),n=()=>k(t.state.tr.insertText(e,v,w));t.someProp("handleTextInput",r=>r(t,v,w,e,n))||t.dispatch(n())}else t.dispatch(k());else t.dispatch(k())}(this,t,e,n,r)),this.domObserver.start(),function(t){for(let e in Co){let n=Co[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=e=>{!Do(t,e)||_o(t,e)||!t.editable&&e.type in xo||n(t,e)},So[e]?{passive:!0}:void 0)}qn&&t.dom.addEventListener("input",()=>null),To(t)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let e in t)this._props[e]=t[e];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&To(this);let e=this._props;this._props=t,t.plugins&&(t.plugins.forEach(Ni),this.directPlugins=t.plugins),this.updateStateInner(t.state,e)}setProps(t){let e={};for(let t in this._props)e[t]=this._props[t];e.state=this.state;for(let n in t)e[n]=t[n];this.update(e)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,e){var n;let r=this.state,o=!1,i=!1;t.storedMarks&&this.composing&&(qo(this),i=!0),this.state=t;let s=r.plugins!=t.plugins||this._props.plugins!=e.plugins;if(s||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){let t=Ii(this);(function(t,e){let n=0,r=0;for(let r in t){if(t[r]!=e[r])return!0;n++}for(let t in e)r++;return n!=r})(t,this.nodeViews)&&(this.nodeViews=t,o=!0)}(s||e.handleDOMEvents!=this._props.handleDOMEvents)&&To(this),this.editable=Oi(this),Di(this);let a=mi(this),l=_i(this),c=r.plugins==t.plugins||r.doc.eq(t.doc)?t.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",d=o||!this.docView.matchesNode(t.doc,l,a);!d&&t.selection.eq(r.selection)||(i=!0);let u="preserve"==c&&i&&null==this.dom.style.overflowAnchor&&function(t){let e,n,r=t.dom.getBoundingClientRect(),o=Math.max(0,r.top);for(let i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=t.root.elementFromPoint(i,s);if(!r||r==t.dom||!t.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=o-20){e=r,n=a.top;break}}return{refDOM:e,refTop:n,stack:nr(t.dom)}}(this);if(i){this.domObserver.stop();let e=d&&(Fn||Un)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&function(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)}(r.selection,t.selection);if(d){let n=Un?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=function(t,e){for(;;){if(3==t.nodeType&&e)return t;if(1==t.nodeType&&e>0){if("false"==t.contentEditable)return null;e=_n(t=t.childNodes[e-1])}else{if(!t.parentNode||Dn(t))return null;e=kn(t),t=t.parentNode}}}(e.focusNode,e.focusOffset),r=function(t,e){for(;;){if(3==t.nodeType&&e<t.nodeValue.length)return t;if(1==t.nodeType&&e<t.childNodes.length){if("false"==t.contentEditable)return null;t=t.childNodes[e],e=0}else{if(!t.parentNode||Dn(t))return null;e=kn(t)+1,t=t.parentNode}}}(e.focusNode,e.focusOffset);
1if(n&&r&&n!=r){let e=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!e||!e.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let t=n.pmViewDesc;if(t&&t.isText(n.nodeValue))return r}}return n||r}(this)),!o&&this.docView.update(t.doc,l,a,this)||(this.docView.updateOuterDeco(l),this.docView.destroy(),this.docView=Sr(t.doc,l,a,this.dom,this)),!n||this.trackWrites&&this.dom.contains(this.trackWrites)||(e=!0)}let n=this.input.mouseDown;e||!(n&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return En(e.node,e.offset,n.anchorNode,n.anchorOffset)}(this)&&n.delaySelUpdate())?Ur(this,e):(Gr(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():u&&function({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;rr(n,0==r?0:r-e)}(u)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(t&&this.dom.contains(1==t.nodeType?t:t.parentNode))if(this.someProp("handleScrollToSelection",t=>t(this)));else if(this.state.selection instanceof Oe){let e=this.docView.domAfterPos(this.state.selection.from);1==e.nodeType&&er(this,e.getBoundingClientRect(),t)}else er(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let e=0;e<this.pluginViews.length;e++){let n=this.pluginViews[e];n.update&&n.update(this,t)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let e=this.directPlugins[t];e.spec.view&&this.pluginViews.push(e.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let e=this.state.plugins[t];e.spec.view&&this.pluginViews.push(e.spec.view(this))}}}updateDraggedNode(t,e){let n=t.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let t=n.from+(this.state.doc.content.size-e.doc.content.size);(t>0&&t<this.state.doc.content.size&&this.state.doc.nodeAt(t))==n.node&&(r=t)}this.dragging=new Yo(t.slice,t.move,r<0?void 0:Oe.create(this.state.doc,r))}someProp(t,e){let n,r=this._props&&this._props[t];if(null!=r&&(n=e?e(r):r))return n;for(let r=0;r<this.directPlugins.length;r++){let o=this.directPlugins[r].props[t];if(null!=o&&(n=e?e(o):o))return n}let o=this.state.plugins;if(o)for(let r=0;r<o.length;r++){let i=o[r].props[t];if(null!=i&&(n=e?e(i):i))return n}}hasFocus(){if(Fn){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if("false"==t.contentEditable)return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(t){if(t.setActive)return t.setActive();if(or)return t.focus(or);let e=nr(t);t.focus(null==or?{get preventScroll(){return or={preventScroll:!0},!0}}:void 0),or||(or=!1,rr(e,0))}(this.dom),Ur(this),this.domObserver.start()}get root(){let t=this._root;if(null==t)for(let t=this.dom.parentNode;t;t=t.parentNode)if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t;return t||document}updateRoot(){this._root=null}posAtCoords(t){return lr(this,t)}coordsAtPos(t,e=1){return hr(this,t,e)}domAtPos(t,e=0){return this.docView.domFromPos(t,e)}nodeDOM(t){let e=this.docView.descAt(t);return e?e.nodeDOM:null}posAtDOM(t,e,n=-1){let r=this.docView.posFromDOM(t,e,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(t,e){return function(t,e,n){return Ar==e&&yr==n?br:(Ar=e,yr=n,br="up"==n||"down"==n?function(t,e,n){let r=e.selection,o="up"==n?r.$from:r.$to;return gr(t,e,()=>{let{node:e}=t.docView.domFromPos(o.pos,"up"==n?-1:1);for(;;){let n=t.docView.nearestDesc(e,!0);if(!n)break;if(n.node.isBlock){e=n.contentDOM||n.dom;break}e=n.dom.parentNode}let r=hr(t,o.pos,1);for(let t=e.firstChild;t;t=t.nextSibling){let e;if(1==t.nodeType)e=t.getClientRects();else{if(3!=t.nodeType)continue;e=Sn(t,0,t.nodeValue.length).getClientRects()}for(let t=0;t<e.length;t++){let o=e[t];if(o.bottom>o.top+1&&("up"==n?r.top-o.top>2*(o.bottom-r.top):o.bottom-r.bottom>2*(r.bottom-o.top)))return!1}}return!0})}(t,e,n):function(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=t.domSelection();return a?mr.test(r.parent.textContent)&&a.modify?gr(t,e,()=>{let{focusNode:e,focusOffset:o,anchorNode:i,anchorOffset:s}=t.domSelectionRange(),l=a.caretBidiLevel;a.modify("move",n,"character");let c=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:d,focusOffset:u}=t.domSelectionRange(),h=d&&!c.contains(1==d.nodeType?d:d.parentNode)||e==d&&o==u;try{a.collapse(i,s),e&&(e!=i||o!=s)&&a.extend&&a.extend(e,o)}catch(t){}return null!=l&&(a.caretBidiLevel=l),h}):"left"==n||"backward"==n?i:s:r.pos==r.start()||r.pos==r.end()}(t,e,n))}(this,e||this.state,t)}pasteHTML(t,e){return Go(this,"",t,!1,e||new ClipboardEvent("paste"))}pasteText(t,e){return Go(this,t,null,!0,e||new ClipboardEvent("paste"))}serializeForClipboard(t){return ho(this,t)}destroy(){this.docView&&(function(t){t.input.mouseDown&&t.input.mouseDown.done(),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)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],mi(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,xn=null)}get isDestroyed(){return null==this.docView}dispatchEvent(t){return function(t,e){_o(t,e)||!Co[e.type]||!t.editable&&e.type in xo||Co[e.type](t,e)}(this,t)}domSelectionRange(){let t=this.domSelection();return t?qn&&11===this.root.nodeType&&function(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}(this.dom.ownerDocument)==this.dom&&function(t,e){if(e.getComposedRanges){let n=e.getComposedRanges(t.root)[0];if(n)return Ci(t,n)}let n;function r(t){t.preventDefault(),t.stopImmediatePropagation(),n=t.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?Ci(t,n):null}
1(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function _i(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if("function"==typeof n&&(n=n(t.state)),n)for(let t in n)"class"==t?e.class+=" "+n[t]:"style"==t?e.style=(e.style?e.style+";":"")+n[t]:e[t]||"contenteditable"==t||"nodeName"==t||(e[t]=String(n[t]))}),e.translate||(e.translate="no"),[ri.node(0,t.state.doc.content.size,e)]}function Di(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:ri.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Oi(t){return!t.someProp("editable",e=>!1===e(t.state))}function Ii(t){let e=Object.create(null);function n(t){for(let n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function Ni(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")}Ti.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};for(var Li={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:"'"},Bi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},$i="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Ri="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Pi=0;Pi<10;Pi++)Li[48+Pi]=Li[96+Pi]=String(Pi);for(Pi=1;Pi<=24;Pi++)Li[Pi+111]="F"+Pi;for(Pi=65;Pi<=90;Pi++)Li[Pi]=String.fromCharCode(Pi+32),Bi[Pi]=String.fromCharCode(Pi);for(var Fi in Li)Bi.hasOwnProperty(Fi)||(Bi[Fi]=Li[Fi]);const zi="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Hi="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function ji(t){let e,n,r,o,i=t.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let t=0;t<i.length-1;t++){let s=i[t];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);zi?o=!0:n=!0}}return e&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function Ui(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function Vi(t){let e=function(t){let e=Object.create(null);for(let n in t)e[ji(n)]=t[n];return e}(t);return function(t,n){let r,o=function(t){var e=!($i&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Ri&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?Bi:Li)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(n),i=e[Ui(o,n)];if(i&&i(t.state,t.dispatch,t))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){let r=e[Ui(o,n,!1)];if(r&&r(t.state,t.dispatch,t))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(Hi&&n.ctrlKey&&n.altKey)&&(r=Li[n.keyCode])&&r!=o){let o=e[Ui(r,n)];if(o&&o(t.state,t.dispatch,t))return!0}}return!1}}function qi(t,e){return Ki(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(t){c=!0,o=t}
1finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(t,e)||Ji(t,e)||Wi()}function Wi(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ji(t,e){if(t){if("string"==typeof t)return Gi(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gi(t,e):void 0}}function Gi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ki(t){if(Array.isArray(t))return t}var Yi=Object.defineProperty,Qi=(t,e)=>{for(var n in e)Yi(t,n,{get:e[n],enumerable:!0})};function Zi(t){const e=t.state,n=t.transaction;let r=n.selection,o=n.doc,i=n.storedMarks;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}var Xi=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){var t=this;const e=this.rawCommands,n=this.editor,r=this.state,o=n.view,i=r.tr,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(e=>{let n=qi(e,2),r=n[0],a=n[1];return[r,function(){const e=a(...arguments)(s);return i.getMeta("preventDispatch")||t.hasCustomState||o.dispatch(i),e}]}))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t){var e=this;let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=this.rawCommands,o=this.editor,i=this.state,s=o.view,a=[],l=!!t,c=t||i.tr,d={...Object.fromEntries(Object.entries(r).map(t=>{let r=qi(t,2),o=r[0],i=r[1];return[o,function(){const t=e.buildProps(c,n),r=i(...arguments)(t);return a.push(r),d}]})),run:()=>(l||!n||c.getMeta("preventDispatch")||this.hasCustomState||s.dispatch(c),a.every(t=>!0===t))};return d}createCan(t){const e=this.rawCommands,n=this.state,r=!1,o=t||n.tr,i=this.buildProps(o,r),s=Object.fromEntries(Object.entries(e).map(t=>{let e=qi(t,2),n=e[0],r=e[1];return[n,function(){return r(...arguments)({...i,dispatch:void 0})}]}));return{...s,chain:()=>this.createChain(o,r)}}buildProps(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.rawCommands,r=this.editor,o=this.state,i=r.view,s={tr:t,editor:r,view:i,state:Zi({state:o,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(t=>{let e=qi(t,2),n=e[0],r=e[1];return[n,function(){return r(...arguments)(s)}]}))}};return s}},ts={};Qi(ts,{blur:()=>es,clearContent:()=>ns,clearNodes:()=>rs,command:()=>is,createParagraphNear:()=>ss,cut:()=>as,deleteCurrentNode:()=>ls,deleteNode:()=>ds,deleteRange:()=>us,deleteSelection:()=>hs,enter:()=>ps,exitCode:()=>fs,extendMarkRange:()=>ws,first:()=>ks,focus:()=>Ts,forEach:()=>_s,insertContent:()=>Ds,insertContentAt:()=>Ls,joinBackward:()=>Rs,joinDown:()=>$s,joinForward:()=>Ps,joinItemBackward:()=>Fs,joinItemForward:()=>zs,joinTextblockBackward:()=>Hs,joinTextblockForward:()=>js,joinUp:()=>Bs,keyboardShortcut:()=>Vs,lift:()=>Ws,liftEmptyBlock:()=>Js,liftListItem:()=>Gs,newlineInCode:()=>Ks,resetAttributes:()=>Zs,scrollIntoView:()=>Xs,selectAll:()=>ta,selectNodeBackward:()=>ea,selectNodeForward:()=>na,selectParentNode:()=>ra,selectTextblockEnd:()=>oa,selectTextblockStart:()=>ia,setContent:()=>aa,setMark:()=>Ga,setMeta:()=>Ka,setNode:()=>Ya,setNodeSelection:()=>Qa,setTextDirection:()=>Za,setTextSelection:()=>Xa,sinkListItem:()=>tl,splitBlock:()=>nl,splitListItem:()=>rl,toggleList:()=>sl,toggleMark:()=>al,toggleNode:()=>ll,toggleWrap:()=>cl,undoInputRule:()=>dl,unsetAllMarks:()=>ul,unsetMark:()=>hl,unsetTextDirection:()=>pl,updateAttributes:()=>fl,wrapIn:()=>gl,wrapInList:()=>ml});var es=()=>t=>{let e=t.editor,n=t.view;return requestAnimationFrame(()=>{var t;e.isDestroyed||(n.dom.blur(),null==(t=null==window?void 0:window.getSelection())||t.removeAllRanges())}),!0},ns=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return e=>e.commands.setContent("",{emitUpdate:t})},rs=()=>t=>{let e=t.state,n=t.tr,r=t.dispatch;const o=n.selection.ranges;
1return!r||(o.forEach(t=>{let r=t.$from,o=t.$to;e.doc.nodesBetween(r.pos,o.pos,(t,e)=>{if(t.type.isText)return;const r=n.doc,o=n.mapping,i=r.resolve(o.map(e)),s=r.resolve(o.map(e+t.nodeSize)),a=i.blockRange(s);if(!a)return;const l=Zt(a);if(t.type.isTextblock){const t=i.parent.contentMatchAt(i.index()).defaultType;n.setNodeMarkup(a.start,t)}(l||0===l)&&n.lift(a,l)})}),!0)},is=t=>e=>t(e),ss=()=>t=>{let e=t.state,n=t.dispatch;return cn(e,n)},as=(t,e)=>n=>{let r=n.editor,o=n.tr;const i=r.state.doc.slice(t.from,t.to);o.deleteRange(t.from,t.to);const s=o.mapping.map(e);return o.insert(s,i.content),o.setSelection(new _e(o.doc.resolve(Math.max(s-1,0)))),!0},ls=()=>t=>{let e=t.tr,n=t.dispatch;const r=e.selection.$anchor.node();if(r.content.size>0)return!1;const o=e.selection.$anchor;for(let t=o.depth;t>0;t-=1)if(o.node(t).type===r.type){if(n){const n=o.before(t),r=o.after(t);e.delete(n,r).scrollIntoView()}return!0}return!1};function cs(t,e){if("string"==typeof t){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}var ds=t=>e=>{let n=e.tr,r=e.state,o=e.dispatch;const i=cs(t,r.schema),s=n.selection.$anchor;for(let t=s.depth;t>0;t-=1)if(s.node(t).type===i){if(o){const e=s.before(t),r=s.after(t);n.delete(e,r).scrollIntoView()}return!0}return!1},us=t=>e=>
1{let n=e.tr,r=e.dispatch;const o=t.from,i=t.to;return r&&n.delete(o,i),!0},hs=()=>t=>{let e=t.state,n=t.dispatch;return Ge(e,n)},ps=()=>t=>t.commands.keyboardShortcut("Enter"),fs=()=>t=>{let e=t.state,n=t.dispatch;return ln(e,n)};function gs(t){return"[object RegExp]"===Object.prototype.toString.call(t)}function ms(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{strict:!0};const r=Object.keys(e);return!r.length||r.every(r=>n.strict?e[r]===t[r]:gs(e[r])?e[r].test(t[r]):e[r]===t[r])}function As(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.find(t=>t.type===e&&ms(Object.fromEntries(Object.keys(n).map(e=>[e,t.attrs[e]])),n))}function ys(t,e){return!!As(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function bs(t,e,n){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(r.node&&r.node.marks.some(t=>t.type===e)||(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(t=>t.type===e))return;if(!n){const t=r.node.marks.find(t=>t.type===e);t&&(n=t.attrs)}if(!As([...r.node.marks],e,n))return;let o=r.index,i=t.start()+r.offset,s=o+1,a=i+r.node.nodeSize;for(;o>0&&ys([...t.parent.child(o-1).marks],e,n);)o-=1,i-=t.parent.child(o).nodeSize;for(;s<t.parent.childCount&&ys([...t.parent.child(s).marks],e,n);)a+=t.parent.child(s).nodeSize,s+=1;return{from:i,to:a}}function vs(t,e){if("string"==typeof t){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}var ws=(t,e)=>n=>{let r=n.tr,o=n.state,i=n.dispatch;const s=vs(t,o.schema),a=r.doc,l=r.selection,c=l.$from,d=l.from,u=l.to;if(i){const t=bs(c,s,e);if(t&&t.from<=d&&t.to>=u){const e=_e.create(a,t.from,t.to);r.setSelection(e)}}return!0},ks=t=>e=>{const n="function"==typeof t?t(e):t;for(let t=0;t<n.length;t+=1)if(n[t](e))return!0;return!1};function Cs(t){return t instanceof _e}function xs(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Math.min(Math.max(t,e),n)}function Ss(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return null;const n=Se.atStart(t),r=Se.atEnd(t);if("start"===e||!0===e)return n;if("end"===e)return r;const o=n.from,i=r.to;return"all"===e?_e.create(t,xs(0,o,i),xs(t.content.size,o,i)):_e.create(t,xs(e,o,i),xs(e,o,i))}function Es(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function Ms(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Ts=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let r=n.editor,o=n.view,i=n.tr,s=n.dispatch;e={scrollIntoView:!0,...e};const a=()=>{(Ms()||Es())&&o.dom.focus(),"undefined"==typeof navigator||!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||Ms()||Es()||o.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{r.isDestroyed||(o.focus(),(null==e?void 0:e.scrollIntoView)&&r.commands.scrollIntoView())})};try{if(o.hasFocus()&&null===t||!1===t)return!0}catch{return!1}if(s&&null===t&&!Cs(r.state.selection))return a(),!0;const l=Ss(i.doc,t)||r.state.selection,c=r.state.selection.eq(l);return s&&(c||i.setSelection(l),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0}},_s=(t,e)=>n=>t.every((t,r)=>e(t,{...n,index:r})),Ds=(t,e)=>n=>{let r=n.tr;return n.commands.insertContentAt({from:r.selection.from,to:r.selection.to},t,e)},Os=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):1===r.nodeType&&Os(r)}return t};function Is(t){if("undefined"==typeof window)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 Os(n)}function Ns(t,e,n){if(t instanceof Q||t instanceof M)return t;n={slice:!0,parseOptions:{},...n};const r="string"==typeof t;if("object"==typeof t&&null!==t)try{if(Array.isArray(t)&&t.length>0)return M.fromArray(t.map(t=>e.nodeFromJSON(t)));const r=e.nodeFromJSON(t);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),Ns("",e,n)}if(r){if(n.errorOnInvalidContent){let r=!1,o="";const i=new mt({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:t=>(r=!0,o="string"==typeof t?t:t.outerHTML,null)}]}})});if(n.slice?yt.fromSchema(i).parseSlice(Is(t),n.parseOptions):yt.fromSchema(i).parse(Is(t),n.parseOptions),n.errorOnInvalidContent&&r)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${o}`)})}const r=yt.fromSchema(e);return n.slice?r.parseSlice(Is(t),n.parseOptions).content:r.parse(Is(t),n.parseOptions)}return Ns("",e,n)}var Ls=(t,e,n)=>r=>{let o=r.tr,i=r.dispatch,s=r.editor;var a;if(i){let r;const i=t=>{s.emit("contentError",{editor:s,error:t,disableCollaboration:()=>{"collaboration"in s.storage&&"object"==typeof s.storage.collaboration&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},l={preserveWhitespace:"full",...(n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n}).parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{Ns(e,s.schema,{parseOptions:l,errorOnInvalidContent:!0})}catch(t){i(t)}try{r=Ns(e,s.schema,{parseOptions:l,errorOnInvalidContent:null!=(a=n.errorOnInvalidContent)?a:s.options.enableContentCheck})}catch(t){return i(t),!1}let c,d="number"==typeof t?{from:t,to:t}:{from:t.from,to:t.to},u=d.from,h=d.to,p=!0,f=!0;if(("type"in r?[r]:r).forEach(t=>{t.check(),p=!!p&&t.isText&&0===t.marks.length,f=!!f&&t.isBlock}),u===h&&f){const t=o.doc.resolve(u).parent;t.isTextblock&&!t.type.spec.code&&!t.childCount&&(u-=1,h+=1)}
1if(p){if(Array.isArray(e))c=e.map(t=>t.text||"").join("");else if(e instanceof M){let t="";e.forEach(e=>{e.text&&(t+=e.text)}),c=t}else c="object"==typeof e&&e&&e.text?e.text:e;o.insertText(c,u,h)}else{c=r;const t=o.doc.resolve(u),e=t.node(),n=0===t.parentOffset,i=e.isText||e.isTextblock,s=e.content.size>0;n&&i&&s&&f&&(u=Math.max(0,u-1)),o.replaceWith(u,h,c)}n.updateSelection&&function(t,e){const n=t.steps.length-1;if(n<e)return;const r=t.steps[n];if(!(r instanceof Jt||r instanceof Gt))return;const o=t.mapping.maps[n];let i=0;o.forEach((t,e,n,r)=>{0===i&&(i=r)}),t.setSelection(Se.near(t.doc.resolve(i),-1))}(o,o.steps.length-1),n.applyInputRules&&o.setMeta("applyInputRules",{from:u,text:c}),n.applyPasteRules&&o.setMeta("applyPasteRules",{from:u,text:c})}return!0},Bs=()=>t=>((t,e)=>{let n,r=t.selection,o=r instanceof Oe;if(o){if(r.node.isTextblock||!oe(t.doc,r.from))return!1;n=r.from}else if(n=se(t.doc,r.from,-1),null==n)return!1;if(e){let r=t.tr.join(n);o&&r.setSelection(Oe.create(r.doc,n-t.doc.resolve(n).nodeBefore.nodeSize)),e(r.scrollIntoView())}return!0})(t.state,t.dispatch),$s=()=>t=>((t,e)=>{let n,r=t.selection;if(r instanceof Oe){if(r.node.isTextblock||!oe(t.doc,r.to))return!1;n=r.to}else if(n=se(t.doc,r.to,1),null==n)return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0})(t.state,t.dispatch),Rs=()=>t=>{let e=t.state,n=t.dispatch;return Ye(e,n)},Ps=()=>t=>{let e=t.state,n=t.dispatch;return nn(e,n)},Fs=()=>t=>{let e=t.state,n=t.dispatch,r=t.tr;try{const t=se(e.doc,e.selection.$from.pos,-1);return null!=t&&(r.join(t,2),n&&n(r),!0)}catch{return!1}},zs=()=>t=>{let e=t.state,n=t.dispatch,r=t.tr;try{const t=se(e.doc,e.selection.$from.pos,1);return null!=t&&(r.join(t,2),n&&n(r),!0)}catch{return!1}},Hs=()=>t=>((t,e)=>{let n=Ke(t,void 0);if(!n)return!1;let r=tn(n);return!!r&&Qe(t,r,e)})(t.state,t.dispatch),js=()=>t=>((t,e)=>{let n=en(t,void 0);if(!n)return!1;let r=on(n);return!!r&&Qe(t,r,e)})(t.state,t.dispatch);function Us(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var Vs=t=>e=>{let n=e.editor,r=e.view,o=e.tr,i=e.dispatch;const s=function(t){const e=t.split(/-(?!$)/);let n,r,o,i,s=e[e.length-1];"Space"===s&&(s=" ");for(let t=0;t<e.length-1;t+=1){const s=e[t];
1if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))o=!0;else{if(!/^mod$/i.test(s))throw new Error(`Unrecognized modifier name: ${s}`);Ms()||Us()?i=!0:r=!0}}return n&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),o&&(s=`Shift-${s}`),s}(t).split(/-(?!$)/),a=s.find(t=>!["Alt","Ctrl","Meta","Shift"].includes(t)),l=new KeyboardEvent("keydown",{key:"Space"===a?" ":a,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),c=n.captureTransaction(()=>{r.someProp("handleKeyDown",t=>t(r,l))});return null==c||c.steps.forEach(t=>{const e=t.map(o.mapping);e&&i&&o.maybeStep(e)}),!0};function qs(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=t.selection,o=r.from,i=r.to,s=r.empty,a=e?cs(e,t.schema):null,l=[];t.doc.nodesBetween(o,i,(t,e)=>{if(t.isText)return;const n=Math.max(o,e),r=Math.min(i,e+t.nodeSize);l.push({node:t,from:n,to:r})});const c=i-o,d=l.filter(t=>!a||a.name===t.node.type.name).filter(t=>ms(t.node.attrs,n,{strict:!1}));return s?!!d.length:d.reduce((t,e)=>t+e.to-e.from,0)>=c}var Ws=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let r=n.state,o=n.dispatch;return!!qs(r,cs(t,r.schema),e)&&((t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),i=o&&Zt(o);return null!=i&&(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)})(r,o)}},Js=()=>t=>{let e=t.state,n=t.dispatch;return dn(e,n)},Gs=t=>e=>{let n=e.state,r=e.dispatch;return(o=cs(t,n.schema),function(t,e){let{$from:n,$to:r}=t.selection,i=n.blockRange(r,t=>t.childCount>0&&t.firstChild.type==o);return!!i&&(!e||(n.node(i.depth-1).type==o?function(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new Gt(i-1,s,i,s,new N(M.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new K(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const a=Zt(r);if(null==a)return!1;o.lift(r,a);let l=o.doc.resolve(o.mapping.map(i,-1)-1);return oe(o.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&o.join(l.pos),e(o.scrollIntoView()),!0}(t,e,o,i):function(t,e,n){let r=t.tr,o=n.parent;for(let t=n.end,e=n.endIndex-1,i=n.startIndex;e>i;e--)t-=o.child(e).nodeSize,r.delete(t-1,t+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==o.childCount,c=i.node(-1),d=i.index(-1);if(!c.canReplace(d+(a?0:1),d+1,s.content.append(l?M.empty:M.from(o))))return!1;let u=i.pos,h=u+s.nodeSize;return r.step(new Gt(u-(a?1:0),h+(l?1:0),u+1,h-1,new N((a?M.empty:M.from(o.copy(M.empty))).append(l?M.empty:M.from(o.copy(M.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}(t,e,i)))})(n,r);var o},Ks=()=>t=>{let e=t.state,n=t.dispatch;return sn(e,n)};function Ys(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Qs(t,e){const n="string"==typeof e?[e]:e;return Object.keys(t).reduce((e,r)=>(n.includes(r)||(e[r]=t[r]),e),{})}var Zs=(t,e)=>n=>{let r=n.tr,o=n.state,i=n.dispatch,s=null,a=null;const l=Ys("string"==typeof t?t:t.name,o.schema);if(!l)return!1;"node"===l&&(s=cs(t,o.schema)),"mark"===l&&(a=vs(t,o.schema));let c=!1;return r.selection.ranges.forEach(t=>{o.doc.nodesBetween(t.$from.pos,t.$to.pos,(t,n)=>{s&&s===t.type&&(c=!0,i&&r.setNodeMarkup(n,void 0,Qs(t.attrs,e))),a&&t.marks.length&&t.marks.forEach(o=>{a===o.type&&(c=!0,i&&r.addMark(n,n+t.nodeSize,a.create(Qs(o.attrs,e))))})})}),c},Xs=()=>t=>{let e=t.tr;return t.dispatch&&e.scrollIntoView(),!0},ta=()=>t=>{let e=t.tr;if(t.dispatch){const t=new Ne(e.doc);e.setSelection(t)}return!0},ea=()=>t=>{let e=t.state,n=t.dispatch;return Xe(e,n)},na=()=>t=>{let e=t.state,n=t.dispatch;return rn(e,n)},ra=()=>t=>((t,e)=>{let n,{$from:r,to:o}=t.selection,i=r.sharedDepth(o);return 0!=i&&(n=r.before(i),e&&e(t.tr.setSelection(Oe.create(t.doc,n))),!0)})(t.state,t.dispatch),oa=()=>t=>{let e=t.state,n=t.dispatch;return gn(e,n)},ia=()=>t=>{let e=t.state,n=t.dispatch;return fn(e,n)};function sa(t,e){return Ns(t,e,{slice:!1,parseOptions:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},errorOnInvalidContent:(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).errorOnInvalidContent})}var aa=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.errorOnInvalidContent,r=e.emitUpdate,o=void 0===r||r,i=e.parseOptions,s=void 0===i?{}:i;return e=>{let r=e.editor,i=e.tr,a=e.dispatch,l=e.commands;const c=i.doc;if("full"!==s.preserveWhitespace){const e=sa(t,r.schema,s,{errorOnInvalidContent:null!=n?n:r.options.enableContentCheck});return a&&i.replaceWith(0,c.content.size,e).setMeta("preventUpdate",!o),!0}
1return a&&i.setMeta("preventUpdate",!o),l.insertContentAt({from:0,to:c.content.size},t,{parseOptions:s,errorOnInvalidContent:null!=n?n:r.options.enableContentCheck})}};function la(t,e){const n=vs(e,t.schema),r=t.selection,o=r.from,i=r.to,s=r.empty,a=[];s?(t.storedMarks&&a.push(...t.storedMarks),a.push(...t.selection.$head.marks())):t.doc.nodesBetween(o,i,t=>{a.push(...t.marks)});const l=a.find(t=>t.type.name===n.name);return l?{...l.attrs}:{}}function ca(t,e){const n=new Ce(t);return e.forEach(t=>{t.steps.forEach(t=>{n.step(t)})}),n}function da(t,e){const n=[];return t.descendants((t,r)=>{e(t)&&n.push({node:t,pos:r})}),n}function ua(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(t,e)=>{n(t)&&r.push({node:t,pos:e})}),r}function ha(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function pa(t){return e=>ha(e.$from,t)}function fa(t,e,n){return void 0===t.config[e]&&t.parent?fa(t.parent,e,n):"function"==typeof t.config[e]?t.config[e].bind({...n,parent:t.parent?fa(t.parent,e,n):null}):t.config[e]}function ga(t){return t.map(t=>{const e=fa(t,"addExtensions",{name:t.name,options:t.options,storage:t.storage});return e?[t,...ga(e())]:t}).flat(10)}function ma(t,e){const n=Tt.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function Aa(t){return"function"==typeof t}function ya(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(Aa(t)){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return e?t.bind(e)(...r):t(...r)}return t}function ba(t){return{baseExtensions:t.filter(t=>"extension"===t.type),nodeExtensions:t.filter(t=>"node"===t.type),markExtensions:t.filter(t=>"mark"===t.type)}}function va(t){const e=[],n=ba(t),r=n.nodeExtensions,o=n.markExtensions,i=[...r,...o],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},a=r.filter(t=>"text"!==t.name).map(t=>t.name),l=o.map(t=>t.name),c=[...a,...l];return t.forEach(t=>{const n=fa(t,"addGlobalAttributes",{name:t.name,options:t.options,storage:t.storage,extensions:i});n&&n().forEach(t=>{let n;n=Array.isArray(t.types)?t.types:"*"===t.types?c:"nodes"===t.types?a:"marks"===t.types?l:[],n.forEach(n=>{Object.entries(t.attributes).forEach(t=>{let r=qi(t,2),o=r[0],i=r[1];e.push({type:n,name:o,attribute:{...s,...i}})})})})}
1),i.forEach(t=>{const n={name:t.name,options:t.options,storage:t.storage},r=fa(t,"addAttributes",n);if(!r)return;const o=r();Object.entries(o).forEach(n=>{let r=qi(n,2),o=r[0],i=r[1];const a={...s,...i};"function"==typeof(null==a?void 0:a.default)&&(a.default=a.default()),(null==a?void 0:a.isRequired)&&void 0===(null==a?void 0:a.default)&&delete a.default,e.push({type:t.name,name:o,attribute:a})})}),e}function wa(t){const e=[],n=function(t){const e=[];let n="",r=!1,o=!1,i=0;const s=t.length;for(let a=0;a<s;a+=1){const s=t[a];if("'"!==s||o)if('"'!==s||r){if(!r&&!o){if("("===s){i+=1,n+=s;continue}if(")"===s&&i>0){i-=1,n+=s;continue}if(";"===s&&0===i){e.push(n),n="";continue}}n+=s}else o=!o,n+=s;else r=!r,n+=s}return n&&e.push(n),e}(t||""),r=n.length;for(let t=0;t<r;t+=1){const r=n[t],o=r.indexOf(":");if(-1===o)continue;const i=r.slice(0,o).trim(),s=r.slice(o+1).trim();i&&s&&e.push([i,s])}return e}function ka(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.filter(t=>!!t).reduce((t,e)=>{const n={...t};return Object.entries(e).forEach(t=>{let e=qi(t,2),r=e[0],o=e[1];if(n[r])if("class"===r){const t=o?String(o).split(" "):[],e=n[r]?n[r].split(" "):[],i=t.filter(t=>!e.includes(t));n[r]=[...e,...i].join(" ")}else if("style"===r){const t=new Map([...wa(n[r]),...wa(o)]);n[r]=Array.from(t.entries()).map(t=>{let e=qi(t,2);return`${e[0]}: ${e[1]}`}).join("; ")}else n[r]=o;else n[r]=o}),n},{})}function Ca(t,e){return e.filter(e=>e.type===t.type.name).filter(t=>t.attribute.rendered).map(e=>e.attribute.renderHTML?e.attribute.renderHTML(t.attrs)||{}:{[e.name]:t.attrs[e.name]}).reduce((t,e)=>ka(t,e),{})}function xa(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(!1===r)return!1;const o=e.reduce((t,e)=>{const r=e.attribute.parseHTML?e.attribute.parseHTML(n):function(t){return"string"!=typeof t?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):"true"===t||"false"!==t&&t}(n.getAttribute(e.name));return null==r?t:{...t,[e.name]:r}},{});return{...r,...o}}}}function Sa(t){return Object.fromEntries(Object.entries(t).filter(t=>{let e=qi(t,2),n=e[0],r=e[1];return("attrs"!==n||!function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 0===Object.keys(t).length&&t.constructor===Object}(r))&&null!=r}))}function Ea(t){var e,n;const r={};return!(null==(e=null==t?void 0:t.attribute)?void 0:e.isRequired)&&"default"in((null==t?void 0:t.attribute)||{})&&(r.default=t.attribute.default),void 0!==(null==(n=null==t?void 0:t.attribute)?void 0:n.validate)&&(r.validate=t.attribute.validate),[t.name,r]}function Ma(t,e){var n;const r=va(t),o=ba(t),i=o.nodeExtensions,s=o.markExtensions,a=null==(n=i.find(t=>fa(t,"topNode")))?void 0:n.name,l=Object.fromEntries(i.map(n=>{const o=r.filter(t=>t.type===n.name),i={name:n.name,options:n.options,storage:n.storage,editor:e},s=Sa({...t.reduce((t,e)=>{const r=fa(e,"extendNodeSchema",i);return{...t,...r?r(n):{}}},{}),content:ya(fa(n,"content",i)),marks:ya(fa(n,"marks",i)),group:ya(fa(n,"group",i)),inline:ya(fa(n,"inline",i)),atom:ya(fa(n,"atom",i)),selectable:ya(fa(n,"selectable",i)),draggable:ya(fa(n,"draggable",i)),code:ya(fa(n,"code",i)),whitespace:ya(fa(n,"whitespace",i)),linebreakReplacement:ya(fa(n,"linebreakReplacement",i)),defining:ya(fa(n,"defining",i)),isolating:ya(fa(n,"isolating",i)),attrs:Object.fromEntries(o.map(Ea))}),a=ya(fa(n,"parseHTML",i));a&&(s.parseDOM=a.map(t=>xa(t,o)));const l=fa(n,"renderHTML",i);l&&(s.toDOM=t=>l({node:t,HTMLAttributes:Ca(t,o)}));const c=fa(n,"renderText",i);return c&&(s.toText=c),[n.name,s]})),c=Object.fromEntries(s.map(n=>{const o=r.filter(t=>t.type===n.name),i={name:n.name,options:n.options,storage:n.storage,editor:e},s=Sa({...t.reduce((t,e)=>{const r=fa(e,"extendMarkSchema",i);return{...t,...r?r(n):{}}},{}),inclusive:ya(fa(n,"inclusive",i)),excludes:ya(fa(n,"excludes",i)),group:ya(fa(n,"group",i)),spanning:ya(fa(n,"spanning",i)),code:ya(fa(n,"code",i)),attrs:Object.fromEntries(o.map(Ea))}),a=ya(fa(n,"parseHTML",i));a&&(s.parseDOM=a.map(t=>xa(t,o)));const l=fa(n,"renderHTML",i);return l&&(s.toDOM=t=>l({mark:t,HTMLAttributes:Ca(t,o)})),[n.name,s]}));return new mt({topNode:a,nodes:l,marks:c})}function Ta(t){return t.sort((t,e)=>{const n=fa(t,"priority")||100,r=fa(e,"priority")||100;return n>r?-1:n<r?1:0})}function _a(t){const e=Ta(ga(t)),n=function(t){const e=t.filter((e,n
1)=>t.indexOf(e)!==n);return Array.from(new Set(e))}(e.map(t=>t.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(t=>`'${t}'`).join(", ")}]. This can lead to issues.`),e}function Da(t,e){return Ma(_a(t),e)}function Oa(t,e,n){const r=e.from,o=e.to,i=n||{},s=i.blockSeparator,a=void 0===s?"\n\n":s,l=i.textSerializers,c=void 0===l?{}:l;let d="";return t.nodesBetween(r,o,(t,n,i,s)=>{var l;t.isBlock&&n>r&&(d+=a);const u=null==c?void 0:c[t.type.name];if(u)return i&&(d+=u({node:t,pos:n,parent:i,index:s,range:e})),!1;t.isText&&(d+=null==(l=null==t?void 0:t.text)?void 0:l.slice(Math.max(r,n)-n,o-n))}),d}function Ia(t,e){return Oa(t,{from:0,to:t.content.size},e)}function Na(t){return Object.fromEntries(Object.entries(t.nodes).filter(t=>qi(t,2)[1].spec.toText).map(t=>{let e=qi(t,2);return[e[0],e[1].spec.toText]}))}function La(t,e){const n=Ys("string"==typeof e?e:e.name,t.schema);return"node"===n?function(t,e){const n=cs(e,t.schema),r=t.selection,o=r.from,i=r.to,s=[];t.doc.nodesBetween(o,i,t=>{s.push(t)});const a=s.reverse().find(t=>t.type.name===n.name);return a?{...a.attrs}:{}}(t,e):"mark"===n?la(t,e):{}}function Ba(t){const e=t.mapping,n=t.steps,r=[];return e.maps.forEach((t,o)=>{const i=[];if(t.ranges.length)t.forEach((t,e)=>{i.push({from:t,to:e})});else{const t=n[o],e=t.from,r=t.to;if(void 0===e||void 0===r)return;i.push({from:e,to:r})}i.forEach(t=>{let n=t.from,i=t.to;const s=e.slice(o).map(n,-1),a=e.slice(o).map(i),l=e.invert().map(s,-1),c=e.invert().map(a);r.push({oldRange:{from:l,to:c},newRange:{from:s,to:a}})})}),function(t){const e=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:JSON.stringify;const n={};return t.filter(t=>{const r=e(t);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)})}(t);return 1===e.length?e:e.filter((t,n)=>!e.filter((t,e)=>e!==n).some(e=>t.oldRange.from>=e.oldRange.from&&t.oldRange.to<=e.oldRange.to&&t.newRange.from>=e.newRange.from&&t.newRange.to<=e.newRange.to))}(r)}function $a(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(e=>{const o=bs(n.resolve(t),e.type);o&&r.push({mark:e,...o})}):n.nodesBetween(t,e,(t,e)=>{t&&void 0!==(null==t?void 0:t.nodeSize)&&r.push(...t.marks.map(n=>({from:e,to:e+t.nodeSize,mark:n})))}),r}function Ra(t,e){return e.nodes[t]||e.marks[t]||null}function Pa(t,e,n){return Object.fromEntries(Object.entries(n).filter(n=>{let r=qi(n,1)[0];const o=t.find(t=>t.type===e&&t.name===r);return!!o&&o.attribute.keepOnSplit}))}function Fa(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=t.selection,o=r.empty,i=r.ranges,s=e?vs(e,t.schema):null;if(o)return!!(t.storedMarks||t.selection.$from.marks()).filter(t=>!s||s.name===t.type.name).find(t=>ms(t.attrs,n,{strict:!1}));let a=0;const l=[];if(i.forEach(e=>{let n=e.$from,r=e.$to;const o=n.pos,i=r.pos;t.doc.nodesBetween(o,i,(t,e)=>{if(s&&t.inlineContent&&!t.type.allowsMarkType(s))return!1;if(!t.isText&&!t.marks.length)return;const n=Math.max(o,e),r=Math.min(i,e+t.nodeSize);a+=r-n,l.push(...t.marks.map(t=>({mark:t,from:n,to:r})))})}),0===a)return!1;const c=l.filter(t=>!s||s.name===t.mark.type.name).filter(t=>ms(t.mark.attrs,n,{strict:!1})).reduce((t,e)=>t+e.to-e.from,0),d=l.filter(t=>!s||t.mark.type!==s&&t.mark.type.excludes(s)).reduce((t,e)=>t+e.to-e.from,0);return(c>0?c+d:c)>=a}function za(t,e){return Array.isArray(e)?e.some(e=>("string"==typeof e?e:e.name)===t.name):e}function Ha(t,e){const n=ba(e).nodeExtensions.find(e=>e.name===t);if(!n)return!1;const r=ya(fa(n,"group",{name:n.name,options:n.options,storage:n.storage}));return"string"==typeof r&&r.split(" ").includes("list")}function ja(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.checkChildren,r=void 0===n||n,o=e.ignoreWhitespace,i=void 0!==o&&o;var s;if(i){if("hardBreak"===t.type.name)return!0;if(t.isText)return!/\S/.test(null!=(s=t.text)?s:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(0===t.content.childCount)return!0;if(r){let e=!0;return t.content.forEach(t=>{!1!==e&&(ja(t,{ignoreWhitespace:i,checkChildren:r})||(e=!1))}),e}return!1}function Ua(t){return t instanceof Oe}var Va=class t{constructor(t){this.position=t}static fromJSON(e){return new t(e.position)}toJSON(){return{position:this.position}}};function qa(t,e){const n=e.mapping.mapResult(t.position);return{position:new Va(n.pos),mapResult:n}}function Wa(t){return new Va(t)}
1function Ja(t,e,n){const r=t.state.doc.content.size,o=xs(e,0,r),i=xs(n,0,r),s=t.coordsAtPos(o),a=t.coordsAtPos(i,-1),l=Math.min(s.top,a.top),c=Math.max(s.bottom,a.bottom),d=Math.min(s.left,a.left),u=Math.max(s.right,a.right),h={top:l,bottom:c,left:d,right:u,width:u-d,height:c-l,x:d,y:l};return{...h,toJSON:()=>h}}var Ga=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let r=n.tr,o=n.state,i=n.dispatch;const s=r.selection,a=s.empty,l=s.ranges,c=vs(t,o.schema);if(i)if(a){const t=la(o,c);r.addStoredMark(c.create({...t,...e}))}else l.forEach(t=>{const n=t.$from.pos,i=t.$to.pos;o.doc.nodesBetween(n,i,(t,o)=>{const s=Math.max(o,n),a=Math.min(o+t.nodeSize,i);t.marks.find(t=>t.type===c)?t.marks.forEach(t=>{c===t.type&&r.addMark(s,a,c.create({...t.attrs,...e}))}):r.addMark(s,a,c.create(e))})});return function(t,e,n){var r;const o=e.selection;let i=null;if(Cs(o)&&(i=o.$cursor),i){const e=null!=(r=t.storedMarks)?r:i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(e)||!e.some(t=>t.type.excludes(n)))}return o.ranges.some(e=>{let r=e.$from,o=e.$to,i=0===r.depth&&t.doc.inlineContent&&t.doc.type.allowsMarkType(n);return t.doc.nodesBetween(r.pos,o.pos,(t,e,r)=>{if(i)return!1;if(t.isInline){const e=!r||r.type.allowsMarkType(n),o=!!n.isInSet(t.marks)||!t.marks.some(t=>t.type.excludes(n));i=e&&o}return!i}),i})}(o,r,c)}},Ka=(t,e)=>n=>(n.tr.setMeta(t,e),!0),Ya=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let r=n.state,o=n.dispatch,i=n.chain;const s=cs(t,r.schema);let a;return r.selection.$anchor.sameParent(r.selection.$head)&&(a=r.selection.$anchor.parent.attrs),s.isTextblock?i().command(t=>{let n=t.commands;return!!mn(s,{...a,...e})(r)||n.clearNodes()}).command(t=>{let n=t.state;return mn(s,{...a,...e})(n,o)}).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)}},Qa=t=>e=>{let n=e.tr;if(e.dispatch){const e=n.doc,r=xs(t,0,e.content.size),o=Oe.create(e,r);n.setSelection(o)}return!0},Za=(t,e)=>n=>{let r=n.tr,o=n.state,i=n.dispatch;const s=o.selection;let a,l;return"number"==typeof e?(a=e,l=e):e&&"from"in e&&"to"in e?(a=e.from,l=e.to):(a=s.from,l=s.to),i&&r.doc.nodesBetween(a,l,(e,n)=>{e.isText||r.setNodeMarkup(n,void 0,{...e.attrs,dir:t})}),!0},Xa=t=>e=>{let n=e.tr;if(e.dispatch){const e=n.doc,r="number"==typeof t?{from:t,to:t}:t,o=r.from,i=r.to,s=_e.atStart(e).from,a=_e.atEnd(e).to,l=xs(o,s,a),c=xs(i,s,a),d=_e.create(e,l,c);n.setSelection(d)}return!0},tl=t=>e=>{let n=e.state,r=e.dispatch;const o=cs(t,n.schema);return(i=o,function(t,e){let{$from:n,$to:r}=t.selection,o=n.blockRange(r,t=>t.childCount>0&&t.firstChild.type==i);if(!o)return!1;let s=o.startIndex;if(0==s)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=i)return!1;if(e){let n=l.lastChild&&l.lastChild.type==a.type,r=M.from(n?i.create():null),s=new N(M.from(i.create(null,M.from(a.type.create(null,r)))),n?3:1,0),c=o.start,d=o.end;e(t.tr.step(new Gt(c-(n?3:1),d,c,d,s,1,!0)).scrollIntoView())}return!0})(n,r);var i};function el(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(t=>null==e?void 0:e.includes(t.type.name));t.tr.ensureMarks(r)}}var nl=function(){let t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).keepMarks,e=void 0===t||t;return t=>{let n=t.tr,r=t.state,o=t.dispatch,i=t.editor;const s=n.selection,a=n.doc,l=s.$from,c=s.$to,d=Pa(i.extensionManager.attributes,l.node().type.name,l.node().attrs);if(s instanceof Oe&&s.node.isBlock)return!(!l.parentOffset||!re(a,l.pos)||(o&&(e&&el(r,i.extensionManager.splittableMarks),n.split(l.pos).scrollIntoView()),0));if(!l.parent.isBlock)return!1;const u=c.parentOffset===c.parent.content.size,h=0===l.depth?void 0:function(t){for(let e=0;e<t.edgeCount;e+=1){const n=t.edge(e).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(l.node(-1).contentMatchAt(l.indexAfter(-1)));let p=u&&h?[{type:h,attrs:d}]:void 0,f=re(n.doc,n.mapping.map(l.pos),1,p);if(p||f||!re(n.doc,n.mapping.map(l.pos),1,h?[{type:h}]:void 0)||(f=!0,p=h?[{type:h,attrs:d}]:void 0),o){if(f&&(s instanceof _e&&n.deleteSelection(),n.split(n.mapping.map(l.pos),1,p),h&&!u&&!l.parentOffset&&l.parent.type!==h)){const t=n.mapping.map(l.before()),e=n.doc.resolve(t);l.node(-1).canReplaceWith(e.index(),e.index()+1,h)&&n.setNodeMarkup(n.mapping.map(l.before()),h)}e&&el(r,i.extensionManager.splittableMarks),n.scrollIntoView()}return f}},rl=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let r=n.tr,o=n.state,i=n.dispatch,s=n.editor;var a;const l=cs(t,o.schema),c=o.selection,d=c.$from,u=c.$to,h=o.selection.node;if(h&&h.isBlock||d.depth<2||!d.sameParent(u))return!1;const p=d.node(-1);if(p.type!==l)return!1;const f=s.extensionManager.attributes;if(0===d.parent.content.size&&d.node(-1).childCount===d.indexAfter(-1)){if
1(2===d.depth||d.node(-3).type!==l||d.index(-2)!==d.node(-2).childCount-1)return!1;if(i){let t=M.empty;const n=d.index(-1)?1:d.index(-2)?2:3;for(let e=d.depth-n;e>=d.depth-3;e-=1)t=M.from(d.node(e).copy(t));const o=d.indexAfter(-1)<d.node(-2).childCount?1:d.indexAfter(-2)<d.node(-3).childCount?2:3,i={...Pa(f,d.node().type.name,d.node().attrs),...e},s=(null==(a=l.contentMatch.defaultType)?void 0:a.createAndFill(i))||void 0;t=t.append(M.from(l.createAndFill(null,s)||void 0));const c=d.before(d.depth-(n-1));r.replace(c,d.after(-o),new N(t,4-n,0));let u=-1;r.doc.nodesBetween(c,r.doc.content.size,(t,e)=>{if(u>-1)return!1;t.isTextblock&&0===t.content.size&&(u=e+1)}),u>-1&&r.setSelection(_e.near(r.doc.resolve(u))),r.scrollIntoView()}return!0}const g=u.pos===d.end()?p.contentMatchAt(0).defaultType:null,m={...Pa(f,p.type.name,p.attrs),...e},A={...Pa(f,d.node().type.name,d.node().attrs),...e};r.delete(d.pos,u.pos);const y=g?[{type:l,attrs:m},{type:g,attrs:A}]:[{type:l,attrs:m}];if(!re(r.doc,d.pos,2))return!1;if(i){const t=o.selection,e=o.storedMarks,n=s.extensionManager.splittableMarks,a=e||t.$to.parentOffset&&t.$from.marks();if(r.split(d.pos,2,y).scrollIntoView(),!a||!i)return!0;const l=a.filter(t=>n.includes(t.type.name));r.ensureMarks(l)}return!0}},ol=(t,e)=>{const n=pa(t=>t.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const o=t.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!oe(t.doc,n.pos)||(t.join(n.pos),!0)},il=(t,e)=>{const n=pa(t=>t.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const o=t.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!oe(t.doc,r)||(t.join(r),!0)},sl=function(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return o=>{let i=o.editor,s=o.tr,a=o.state,l=o.dispatch,c=o.chain,d=o.commands,u=o.can;const h=i.extensionManager,p=h.extensions,f=h.splittableMarks,g=cs(t,a.schema),m=cs(e,a.schema),A=a.selection,y=a.storedMarks,b=A.$from,v=A.$to,w=b.blockRange(v),k=y||A.$to.parentOffset&&A.$from.marks();if(!w)return!1;const C=pa(t=>Ha(t.type.name,p))(A),x=0===A.from&&A.to===a.doc.content.size,S=a.doc.content.content,E=1===S.length?S[0]:null,M=x&&E&&Ha(E.type.name,p)?{node:E,pos:0,depth:0}:null,T=null!=C?C:M,_=!!M;if((C&&w.depth>=1&&w.depth-C.depth<=1||_)&&T){if(T.node.type===g)return x&&_?c().command(t=>{let e=t.tr,n=t.dispatch;const r=function(t){const e=t.doc,n=e.firstChild;if(!n)return null;const r=n.nodeSize-1;return _e.create(e,1,r)}(e);return!!r&&(e.setSelection(r),n&&n(e),!0)}).liftListItem(m).run():d.liftListItem(m);if(Ha(T.node.type.name,p)&&g.validContent(T.node.content))return c().command(()=>(s.setNodeMarkup(T.pos,g),!0)).command(()=>ol(s,g)).command(()=>il(s,g)).run()}return n&&k&&l?c().command(()=>{const t=u().wrapInList(g,r),e=k.filter(t=>f.includes(t.type.name));return s.ensureMarks(e),!!t||d.clearNodes()}).wrapInList(g,r).command(()=>ol(s,g)).command(()=>il(s,g)).run():c().command(()=>!!u().wrapInList(g,r)||d.clearNodes()).wrapInList(g,r).command(()=>ol(s,g)).command(()=>il(s,g)).run()}},al=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r=>{let o=r.state,i=r.commands;const s=n.extendEmptyMarkRange,a=void 0!==s&&s,l=vs(t,o.schema);return Fa(o,l,e)?i.unsetMark(l,{extendEmptyMarkRange:a}):i.setMark(l,e)}},ll=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r=>{let o=r.state,i=r.commands;const s=cs(t,o.schema),a=cs(e,o.schema),l=qs(o,s,n);let c;return o.selection.$anchor.sameParent(o.selection.$head)&&(c=o.selection.$anchor.parent.attrs),l?i.setNode(a,c):i.setNode(s,{...c,...n})}},cl=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let r=n.state,o=n.commands;const i=cs(t,r.schema);return qs(r,i,e)?o.lift(i):o.wrapIn(i,e)}},dl=()=>t=>{let e=t.state,n=t.dispatch;const r=e.plugins;for(let t=0;t<r.length;t+=1){const o=r[t];let i;if(o.spec.isInputRules&&(i=o.getState(e))){if(n){const t=e.tr,n=i.transform;
1for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(i.text){const n=t.doc.resolve(i.from).marks();t.replaceWith(i.from,i.to,e.schema.text(i.text,n))}else t.delete(i.from,i.to)}return!0}}return!1},ul=()=>t=>{let e=t.tr,n=t.dispatch;const r=e.selection,o=r.empty,i=r.ranges;return o||n&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0},hl=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let r=n.tr,o=n.state,i=n.dispatch;var s;const a=e.extendEmptyMarkRange,l=void 0!==a&&a,c=r.selection,d=vs(t,o.schema),u=c.$from,h=c.empty,p=c.ranges;if(!i)return!0;if(h&&l){let t=c.from,e=c.to;const n=null==(s=u.marks().find(t=>t.type===d))?void 0:s.attrs,o=bs(u,d,n);o&&(t=o.from,e=o.to),r.removeMark(t,e,d)}else p.forEach(t=>{r.removeMark(t.$from.pos,t.$to.pos,d)});return r.removeStoredMark(d),!0}},pl=t=>e=>{let n=e.tr,r=e.state,o=e.dispatch;const i=r.selection;let s,a;return"number"==typeof t?(s=t,a=t):t&&"from"in t&&"to"in t?(s=t.from,a=t.to):(s=i.from,a=i.to),o&&n.doc.nodesBetween(s,a,(t,e)=>{if(t.isText)return;const r={...t.attrs};delete r.dir,n.setNodeMarkup(e,void 0,r)}),!0},fl=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let r=n.tr,o=n.state,i=n.dispatch,s=null,a=null;const l=Ys("string"==typeof t?t:t.name,o.schema);if(!l)return!1;"node"===l&&(s=cs(t,o.schema)),"mark"===l&&(a=vs(t,o.schema));let c=!1;return r.selection.ranges.forEach(t=>{const n=t.$from.pos,l=t.$to.pos;let d,u,h,p;r.selection.empty?o.doc.nodesBetween(n,l,(t,e)=>{s&&s===t.type&&(c=!0,h=Math.max(e,n),p=Math.min(e+t.nodeSize,l),d=e,u=t)}):o.doc.nodesBetween(n,l,(t,o)=>{o<n&&s&&s===t.type&&(c=!0,h=Math.max(o,n),p=Math.min(o+t.nodeSize,l),d=o,u=t),o>=n&&o<=l&&(s&&s===t.type&&(c=!0,i&&r.setNodeMarkup(o,void 0,{...t.attrs,...e})),a&&t.marks.length&&t.marks.forEach(s=>{if(a===s.type&&(c=!0,i)){const i=Math.max(o,n),c=Math.min(o+t.nodeSize,l);r.addMark(i,c,a.create({...s.attrs,...e}))}}))}),u&&(void 0!==d&&i&&r.setNodeMarkup(d,void 0,{...u.attrs,...e}),a&&u.marks.length&&u.marks.forEach(t=>{a===t.type&&i&&r.addMark(h,p,a.create({...t.attrs,...e}))}))}),c}},gl=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let r=n.state,o=n.dispatch;return function(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=s&&Xt(s,t,e);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(cs(t,r.schema),e)(r,o)}},ml=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let r=n.state,o=n.dispatch;return function(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i);if(!s)return!1;let a=r?n.tr:null;return!!function(t,e,n,r=null){let o=!1,i=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&0==e.startIndex){if(0==e.$from.index(e.depth-1))return!1;let t=s.resolve(e.start-2);i=new K(t,t,e.depth),e.endIndex<e.parent.childCount&&(e=new K(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let a=Xt(i,n,r,e);return!!a&&(t&&function(t,e,n,r,o){let i=M.empty;for(let t=n.length-1;t>=0;t--)i=M.from(n[t].type.create(n[t].attrs,i));t.step(new Gt(e.start-(r?2:0),e.end,e.start,e.end,new N(i,0,0),n.length,!0));let s=0;for(let t=0;t<n.length;t++)n[t].type==o&&(s=t+1);let a=n.length-s,l=e.start+n.length-(r?2:0),c=e.parent;for(let n=e.startIndex,r=e.endIndex,o=!0;n<r;n++,o=!1)!o&&re(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(n).nodeSize}(t,e,a,o,n),!0)}(a,s,t,e)&&(r&&r(a.scrollIntoView()),!0)}}(cs(t,r.schema),e)(r,o)}},Al=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];const o=this.callbacks[t];return o&&o.forEach(t=>t.apply(this,n)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(t=>t!==e):delete this.callbacks[t]),this}once(t,e){var n=this;const r=function(){n.off(t,r);for(var o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];e.apply(n,i)};return this.on(t,r)}removeAllListeners(){this.callbacks={}}},yl=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=null==(e=t.undoable)||e}};function bl(t){var e;const n=t.editor,r=t.from,o=t.to,i=t.text,s=t.rules,a=t.plugin,l=n.view;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null==(e=c.nodeBefore||c.nodeAfter)?void 0:e.marks.find(t=>t.type.spec.code)))return!1;let d=!1;const u=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(t,e,o,i)=>{var s,a;const l=(null==(a=(s=t.type.spec).toText)?void 0:a.call(s,{node:t,pos:e,parent:o,index:i}))||t.textContent||"%leaf%";n+=t.isAtom&&!t.isText?l:l.slice(0,Math.max(0,r-e))}),n}(c)+i;
1return s.forEach(t=>{if(d)return;const e=((t,e)=>{if(gs(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})(u,t.find);if(!e)return;const s=l.state.tr,c=Zi({state:l.state,transaction:s}),h={from:r-(e[0].length-i.length),to:o},p=new Xi({editor:n,state:c}),f=p.commands,g=p.chain,m=p.can;null!==t.handler({state:c,range:h,match:e,commands:f,chain:g,can:m})&&s.steps.length&&(t.undoable&&s.setMeta(a,{transform:s,from:r,to:o,text:i}),l.dispatch(s),d=!0)}),d}function vl(t){return"Object"===function(t){return Object.prototype.toString.call(t).slice(8,-1)}(t)&&t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function wl(t,e){const n={...t};return vl(t)&&vl(e)&&Object.keys(e).forEach(r=>{vl(e[r])&&vl(t[r])?n[r]=wl(t[r],e[r]):n[r]=e[r]}),n}var kl=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...ya(fa(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...ya(fa(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this.extend({...this.config,addOptions:()=>wl(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},Cl=class t extends kl{constructor(){super(...arguments),this.type="mark"}static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n="function"==typeof e?e():e;return new t(n)}static handleExit(t){let e=t.editor,n=t.mark;const r=e.state.tr,o=e.state.selection.$from;if(o.pos===o.end()){const t=o.marks();if(!t.find(t=>(null==t?void 0:t.type.name)===n.name))return!1;const i=t.find(t=>(null==t?void 0:t.type.name)===n.name);return i&&r.removeStoredMark(i),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}configure(t){return super.configure(t)}extend(t){const e="function"==typeof t?t():t;return super.extend(e)}},xl=class{constructor(t){this.find=t.find,this.handler=t.handler}};var Sl=null;function El(t){const e=t.editor,n=t.rules;let r,o=null,i=!1,s=!1,a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}const l=t=>{let n=t.state,o=t.from,i=t.to,s=t.rule,l=t.pasteEvt;const c=n.tr,d=Zi({state:n,transaction:c});if(function(t){const e=t.editor,n=t.state,r=t.from,o=t.to,i=t.rule,s=t.pasteEvent,a=t.dropEvent,l=new Xi({editor:e,state:n}),c=l.commands,d=l.chain,u=l.can,h=[];return n.doc.nodesBetween(r,o,(t,e)=>{var l,p,f,g,m;if((null==(p=null==(l=t.type)?void 0:l.spec)?void 0:p.code)||!(t.isText||t.isTextblock||t.isInline))return;const A=null!=(m=null!=(g=null==(f=t.content)?void 0:f.size)?g:t.nodeSize)?m:0,y=Math.max(r,e),b=Math.min(o,e+A);y>=b||((t,e,n)=>{if(gs(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(e=>{const n=[e.text];return n.index=e.index,n.input=t,n.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(e.replaceWith)),n}):[]})(t.isText?t.text||"":t.textBetween(y-e,b-e,void 0,""),i.find,s).forEach(t=>{if(void 0===t.index)return;const e=y+t.index+1,r=e+t[0].length,o={from:n.tr.mapping.map(e),to:n.tr.mapping.map(r)},l=i.handler({state:n,range:o,match:t,commands:c,chain:d,can:u,pasteEvent:s,dropEvent:a});h.push(l)})}),h.every(t=>null!==t)}({editor:e,state:d,from:Math.max(o-1,0),to:i.b-1,rule:s,pasteEvent:l,dropEvent:r})&&c.steps.length){try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}return a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,c}},c=n.map(t=>new Ve({view(t){const n=n=>{var r;o=(null==(r=t.dom.parentElement)?void 0:r.contains(n.target))?t.dom.parentElement:null,o&&(Sl=e)},r=()=>{Sl&&(Sl=null)};return window.addEventListener("dragstart",n),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",n),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(t,e)=>{if(s=o===t.dom.parentElement,r=e,!s){const t=Sl;(null==t?void 0:t.isEditable)&&setTimeout(()=>{const e=t.state.selection;e&&t.commands.deleteRange({from:e.from,to:e.to})},10)}return!1},paste:(t,e)=>{var n;const r=null==(n=e.clipboardData)?void 0:n.getData("text/html");return a=e,i=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(e,n,r)=>{const o=e[0],c="paste"===o.getMeta("uiEvent")&&!i,d="drop"===o.getMeta("uiEvent")&&!s,u=o.getMeta("applyPasteRules"),h=!!u;if(!c&&!d&&!h)return;if(h){let e=u.text;"string"==typeof e||(e=ma(M.from(e),r.schema));const n=u.from,o=n+e.length,i=(t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(e=n.clipboardData)||e.setData("text/html",t),n})(e);return l({rule:t,state:r,from:n,to:{b:o},pasteEvt:i})}
1const p=n.doc.content.findDiffStart(r.doc.content),f=n.doc.content.findDiffEnd(r.doc.content);return"number"==typeof p&&f&&p!==f.b?l({rule:t,state:r,from:p,to:f,pasteEvt:a}):void 0}}));return c}var Ml=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=_a(t),this.schema=Ma(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n=fa(e,"addCommands",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Ra(e.name,this.schema)});return n?{...t,...n()}:t},{})}get plugins(){const t=this.editor,e=Ta([...this.extensions].reverse()).flatMap(e=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:Ra(e.name,this.schema)},r=[],o=fa(e,"addKeyboardShortcuts",n);let i={};if("mark"===e.type&&fa(e,"exitable",n)&&(i.ArrowRight=()=>Cl.handleExit({editor:t,mark:e})),o){const e=Object.fromEntries(Object.entries(o()).map(e=>{let n=qi(e,2),r=n[0],o=n[1];return[r,()=>o({editor:t})]}));i={...i,...e}}const s=new Ve({props:{handleKeyDown:Vi(i)}});r.push(s);const a=fa(e,"addInputRules",n);if(za(e,t.options.enableInputRules)&&a){const e=a();if(e&&e.length){const n=function(t){const e=t.editor,n=t.rules,r=new Ve({state:{init:()=>null,apply(t,o,i){const s=t.getMeta(r);if(s)return s;const a=t.getMeta("applyInputRules");return!!a&&setTimeout(()=>{let t=a.text;"string"==typeof t||(t=ma(M.from(t),i.schema));const o=a.from,s=o+t.length;bl({editor:e,from:o,to:s,text:t,rules:n,plugin:r})}),t.selectionSet||t.docChanged?null:o}},props:{handleTextInput:(t,o,i,s)=>bl({editor:e,from:o,to:i,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:t=>(setTimeout(()=>{const o=t.state.selection.$cursor;o&&bl({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(t,o){if("Enter"!==o.key)return!1;const i=t.state.selection.$cursor;return!!i&&bl({editor:e,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:t,rules:e}),o=Array.isArray(n)?n:[n];r.push(...o)}}const l=fa(e,"addPasteRules",n);if(za(e,t.options.enablePasteRules)&&l){const e=l();if(e&&e.length){const n=El({editor:t,rules:e});r.push(...n)}}const c=fa(e,"addProseMirrorPlugins",n);if(c){const t=c();r.push(...t)}return r});return e}get attributes(){return va(this.extensions)}get nodeViews(){const t=this.editor,e=ba(this.extensions).nodeExtensions;return Object.fromEntries(e.filter(t=>!!fa(t,"addNodeView")).map(e=>{const n=this.attributes.filter(t=>t.type===e.name),r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:cs(e.name,this.schema)},o=fa(e,"addNodeView",r);if(!o)return[];const i=o();return i?[e.name,(r,o,s,a,l)=>{const c=Ca(r,n);return i({node:r,view:o,getPos:s,decorations:a,innerDecorations:l,editor:t,extension:e,HTMLAttributes:c})}]:[]}))}dispatchTransaction(t){const e=this.editor;return Ta([...this.extensions].reverse()).reduceRight((t,n)=>{const r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:Ra(n.name,this.schema)},o=fa(n,"dispatchTransaction",r);return o?e=>{o.call(r,{transaction:e,next:t})}:t},t)}transformPastedHTML(t){const e=this.editor;return Ta([...this.extensions]).reduce((t,n)=>{const r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:Ra(n.name,this.schema)},o=fa(n,"transformPastedHTML",r);return o?(e,n)=>{const i=t(e,n);return o.call(r,i)}:t},t||(t=>t))}get markViews(){const t=this.editor,e=ba(this.extensions).markExtensions;return Object.fromEntries(e.filter(t=>!!fa(t,"addMarkView")).map(e=>{const n=this.attributes.filter(t=>t.type===e.name),r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:vs(e.name,this.schema)},o=fa(e,"addMarkView",r);return o?[e.name,(r,i,s)=>{const a=Ca(r,n);return o()({mark:r,view:i,inline:s,editor:t,extension:e,HTMLAttributes:a,updateAttributes:e=>{!function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=e.state,o=r.doc,i=r.tr,s=t;o.descendants((e,r)=>{const o=i.mapping.map(r),a=i.mapping.map(r)+e.nodeSize;let l=null;if(e.marks.forEach(t=>{if(t!==s)return!1;l=t}),!l)return;let c=!1;
1if(Object.keys(n).forEach(t=>{n[t]!==l.attrs[t]&&(c=!0)}),c){const e=t.type.create({...t.attrs,...n});i.removeMark(o,a,t.type),i.addMark(o,a,e)}}),i.docChanged&&e.view.dispatch(i)}(r,t,e)}})}]:[]}))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(t=>[t.name,t.storage])),t.forEach(t=>{var e;const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Ra(t.name,this.schema)};"mark"===t.type&&(null==(e=ya(fa(t,"keepOnSplit",n)))||e)&&this.splittableMarks.push(t.name);const r=fa(t,"onBeforeCreate",n),o=fa(t,"onCreate",n),i=fa(t,"onUpdate",n),s=fa(t,"onSelectionUpdate",n),a=fa(t,"onTransaction",n),l=fa(t,"onFocus",n),c=fa(t,"onBlur",n),d=fa(t,"onDestroy",n);r&&this.editor.on("beforeCreate",r),o&&this.editor.on("create",o),i&&this.editor.on("update",i),s&&this.editor.on("selectionUpdate",s),a&&this.editor.on("transaction",a),l&&this.editor.on("focus",l),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)})}};Ml.resolve=_a,Ml.sort=Ta,Ml.flatten=ga,Qi({},{ClipboardTextSerializer:()=>_l,Commands:()=>Dl,Delete:()=>Ol,Drop:()=>Il,Editable:()=>Nl,FocusEvents:()=>Bl,Keymap:()=>$l,Paste:()=>Rl,Tabindex:()=>Pl,TextDirection:()=>Fl,focusEventsPluginKey:()=>Ll});var Tl=class t extends kl{constructor(){super(...arguments),this.type="extension"}static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n="function"==typeof e?e():e;return new t(n)}configure(t){return super.configure(t)}extend(t){const e="function"==typeof t?t():t;return super.extend(e)}},_l=Tl.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new Ve({key:new Je("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const t=this.editor,e=t.state,n=t.schema,r=e.doc,o=e.selection.ranges,i=Math.min(...o.map(t=>t.$from.pos)),s=Math.max(...o.map(t=>t.$to.pos)),a=Na(n);return Oa(r,{from:i,to:s},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),Dl=Tl.create({name:"commands",addCommands:()=>({...ts})}),Ol=Tl.create({name:"delete",onUpdate(t){let e=t.transaction,n=t.appendedTransactions;var r,o,i;const s=()=>{var t,r,o,i;if(null!=(i=null==(o=null==(r=null==(t=this.editor.options.coreExtensionOptions)?void 0:t.delete)?void 0:r.filterTransaction)?void 0:o.call(r,e))?i:e.getMeta("y-sync$"))return;const s=ca(e.before,[e,...n]);Ba(s).forEach(t=>{s.mapping.mapResult(t.oldRange.from).deletedAfter&&s.mapping.mapResult(t.oldRange.to).deletedBefore&&s.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{const o=r+n.nodeSize-2,i=t.oldRange.from<=r&&o<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:o,newFrom:s.mapping.map(r),newTo:s.mapping.map(o),deletedRange:t.oldRange,newRange:t.newRange,partial:!i,editor:this.editor,transaction:e,combinedTransform:s})})});const a=s.mapping;s.steps.forEach((t,n)=>{var r,o;if(t instanceof Vt){const i=a.slice(n).map(t.from,-1),l=a.slice(n).map(t.to),c=a.invert().map(i,-1),d=a.invert().map(l),u=i>0&&(null==(r=s.doc.nodeAt(i-1))?void 0:r.marks.some(e=>e.eq(t.mark))),h=null==(o=s.doc.nodeAt(l))?void 0:o.marks.some(e=>e.eq(t.mark));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:c,to:d},newRange:{from:i,to:l},partial:Boolean(h||u),editor:this.editor,transaction:e,combinedTransform:s})}})};null==(i=null==(o=null==(r=this.editor.options.coreExtensionOptions)?void 0:r.delete)?void 0:o.async)||i?setTimeout(s,0):s()}}),Il=Tl.create({name:"drop",addProseMirrorPlugins(){return[new Ve({key:new Je("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),Nl=Tl.create({name:"editable",addProseMirrorPlugins(){return[new Ve({key:new Je("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Ll=new Je("focusEvents"),Bl=Tl.create({name:"focusEvents",addProseMirrorPlugins(){const t=this.editor;return[new Ve({key:Ll,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),$l=Tl.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(t=>{let e=t.commands;return[()=>e.undoInputRule(),()=>e.command(t=>{let n=t.tr;const r=n.selection,o=n.doc,i=r.empty,s=r.$anchor,a=s.pos,l=s.parent,c=s.parent.isTextblock&&a>0?n.doc.resolve(a-1):s,d=c.parent.type.spec.isolating,u=s.pos-s.parentOffset,h=d&&1===c.parent.childCount?u===s.pos:Se.atStart(o).from===a;return!(!i||!l.type.isTextblock||l.textContent.length||!h||h&&"paragraph"===s.parent.type.name)&&e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]}),e=()=>this.editor.commands.first(t=>{let e=t.commands;return[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]}),n={Enter:()=>this.editor.commands.first(t=>{let e=t.commands;return[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]}),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Ms()||Us()?o:r},addProseMirrorPlugins(){return[new Ve({key:new Je("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(t=>t.getMeta("composition")))return;const r=t.some(t=>t.docChanged)&&!e.doc.eq(n.doc),o=t.some(t=>t.getMeta("preventClearDocument"));if(!r||o)return;const i=e.selection,s=i.empty,a=i.from,l=i.to,c=Se.atStart(e.doc).from,d=Se.atEnd(e.doc).to;
1if(s||a!==c||l!==d)return;if(!ja(n.doc))return;const u=n.tr,h=Zi({state:n,transaction:u});return new Xi({editor:this.editor,state:h}).commands.clearNodes(),u.steps.length?u:void 0}})]}}),Rl=Tl.create({name:"paste",addProseMirrorPlugins(){return[new Ve({key:new Je("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),Pl=Tl.create({name:"tabindex",addProseMirrorPlugins(){return[new Ve({key:new Je("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Fl=Tl.create({name:"textDirection",addOptions:()=>({direction:void 0}),addGlobalAttributes(){return this.options.direction?[{types:ba(this.extensions).nodeExtensions.filter(t=>"text"!==t.name).map(t=>t.name),attributes:{dir:{default:this.options.direction,parseHTML:t=>{const e=t.getAttribute("dir");return!e||"ltr"!==e&&"rtl"!==e&&"auto"!==e?this.options.direction:e},renderHTML:t=>t.dir?{dir:t.dir}:{}}}}]:[]},addProseMirrorPlugins(){return[new Ve({key:new Je("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),zl=class t{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=t,this.editor=e,this.currentNode=r}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 t;return null!=(t=this.actualDepth)?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let e=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return void console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);e=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:e,to:n},t)}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(0===this.depth)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new t(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 t(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 t(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,s=n.isInline,a=this.pos+r+(i?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(a);if(!o&&!s&&l.depth<=this.depth)return;const c=new t(l,this.editor,o,o||s?n:null);o&&(c.actualDepth=this.depth+1),e.push(c)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===t)if(Object.keys(e).length>0){const t=r.node.attrs,n=Object.keys(e);for(let r=0;r<n.length;r+=1){const o=n[r];if(t[o]!==e[o])break}}else n=r;r=r.parent}return n}querySelector(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.querySelectorAll(t,e,!0)[0]||null}querySelectorAll(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[];if(!this.children||0===this.children.length)return r;const o=Object.keys(e);return this.children.forEach(i=>{n&&r.length>0||(i.node.type.name===t&&o.every(t=>e[t]===i.node.attrs[t])&&r.push(i),n&&r.length>0||(r=r.concat(i.querySelectorAll(t,e,n))))}),r}setAttribute(t){const e=this.editor.state.tr;e.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(e)}},Hl=class extends Al{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};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:"undefined"!=typeof document?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:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:t=>{throw t.error},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:qa,createMappablePosition:Wa},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit
1("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",t=>{let e=t.event,n=t.slice,r=t.moved;return this.options.onDrop(e,n,r)}),this.on("paste",t=>{let e=t.event,n=t.slice;return this.options.onPaste(e,n)}),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=Ss(e,this.options.autofocus);this.editorState=je.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if("undefined"==typeof document)throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(!1!==this.options.autofocus&&null!==this.options.autofocus&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;(null==t?void 0:t.editor)&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{"function"==typeof this.css.remove?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}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&&"undefined"!=typeof document&&(this.css=function(t,e){const n=document.querySelector("style[data-tiptap-style]");if(null!==n)return n;const r=document.createElement("style");return e&&r.setAttribute("nonce",e),r.setAttribute("data-tiptap-style",""),r.innerHTML='.ProseMirror {\n  position: relative;\n}\n\n.ProseMirror {\n  word-wrap: break-word;\n  white-space: pre-wrap;\n  white-space: break-spaces;\n  -webkit-font-variant-ligatures: none;\n  font-variant-ligatures: none;\n  font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n  white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n  white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n  white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n  display: inline !important;\n  border: none !important;\n  margin: 0 !important;\n  width: 0 !important;\n  height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n  display: none;\n  pointer-events: none;\n  position: absolute;\n  margin: 0;\n}
1\n\n.ProseMirror-gapcursor:after {\n  content: "";\n  display: block;\n  position: absolute;\n  top: -2px;\n  width: 20px;\n  border-top: 1px solid black;\n  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n  to {\n    visibility: hidden;\n  }\n}\n\n.ProseMirror-hideselection *::selection {\n  background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n  background: transparent;\n}\n\n.ProseMirror-hideselection * {\n  caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n  display: block;\n}',document.getElementsByTagName("head")[0].appendChild(r),r}(0,this.options.injectNonce))}setOptions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options={...this.options,...t},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.setOptions({editable:t}),e&&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:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if("state"===e)return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=Aa(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(t=>{const e="string"==typeof t?`${t}$`:t.key;n=n.filter(t=>!t.key.startsWith(e))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e;const n=[...this.options.enableCoreExtensions?[Nl,_l.configure({blockSeparator:null==(e=null==(t=this.options.coreExtensionOptions)?void 0:t.clipboardTextSerializer)?void 0:e.blockSeparator}),Dl,Bl,$l,Pl,Il,Rl,Ol,Fl.configure({direction:this.options.textDirection})].filter(t=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[t.name]):[],...this.options.extensions].filter(t=>["extension","node","mark"].includes(null==t?void 0:t.type));this.extensionManager=new Ml(n,this)}createCommandManager(){this.commandManager=new Xi({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=sa(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error&&["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message)))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&"object"==typeof this.storage.collaboration&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(t=>"collaboration"!==t.name),this.createExtensionManager()}}),t=sa(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){const e=this.options,n=e.editorProps,r=e.enableExtensionDispatchTransaction,o=n.dispatchTransaction||this.dispatchTransaction.bind(this),i=r?this.extensionManager.dispatchTransaction(o):o,s=n.transformPastedHTML,a=this.extensionManager.transformPastedHTML(s);this.editorView=new Ti(t,{...n,attributes:{role:"textbox",...null==n?void 0:n.attributes},dispatchTransaction:i,transformPastedHTML:a,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const l=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(l),this.prependClass(),this.injectCSS(),this.view.dom.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(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void t.steps.forEach(t=>{var e;return null==(e=this.capturedTransaction)?void 0:e.step(t)}):void(this.capturedTransaction=t);const e=this.state.applyTransaction(t),n=e.state,r=e.transactions,o=!this.state.selection.eq(n.selection),i=r.includes(t),s=this.state;
1if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:n}),!i)return;this.view.updateState(n),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:r.slice(1)}),o&&this.emit("selectionUpdate",{editor:this,transaction:t});const a=r.findLast(t=>t.getMeta("focus")||t.getMeta("blur")),l=null==a?void 0:a.getMeta("focus"),c=null==a?void 0:a.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:a}),c&&this.emit("blur",{editor:this,event:c.event,transaction:a}),t.getMeta("preventUpdate")||!r.some(t=>t.docChanged)||s.doc.eq(n.doc)||this.emit("update",{editor:this,transaction:t,appendedTransactions:r.slice(1)})}getAttributes(t){return La(this.state,t)}isActive(t,e){const n="string"==typeof t?t:null,r="string"==typeof t?e:t;return function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return qs(t,null,n)||Fa(t,null,n);const r=Ys(e,t.schema);return"node"===r?qs(t,e,n):"mark"===r&&Fa(t,e,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ma(this.state.doc.content,this.schema)}getText(t){const e=t||{},n=e.blockSeparator,r=void 0===n?"\n\n":n,o=e.textSerializers,i=void 0===o?{}:o;return Ia(this.state.doc,{blockSeparator:r,textSerializers:{...Na(this.schema),...i}})}get isEmpty(){return ja(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var t,e;return null==(e=null==(t=this.editorView)?void 0:t.isDestroyed)||e}$node(t,e){var n;return(null==(n=this.$doc)?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return(null==(n=this.$doc)?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new zl(e,this)}get $doc(){return this.$pos(0)}};function jl(t){return new yl({find:t.find,handler:e=>{let n=e.state,r=e.range,o=e.match;const i=ya(t.getAttributes,void 0,o);if(!1===i||null===i)return null;const s=n.tr,a=o[o.length-1],l=o[0];if(a){const e=l.search(/\S/),o=r.from+l.indexOf(a),c=o+a.length;if($a(r.from,r.to,n.doc).filter(e=>e.mark.type.excluded.find(n=>n===t.type&&n!==e.mark.type)).filter(t=>t.to>o).length)return null;c<r.to&&s.delete(c,r.to),o>r.from&&s.delete(r.from+e,o);const d=r.from+e+a.length;s.addMark(r.from+e,d,t.type.create(i||{})),s.removeStoredMark(t.type)}},undoable:t.undoable})}function Ul(t){return new yl({find:t.find,handler:e=>{let n=e.state,r=e.range,o=e.match;const i=ya(t.getAttributes,void 0,o)||{},s=n.tr,a=r.from;let l=r.to;const c=t.type.create(i);if(o[1]){let t=a+o[0].lastIndexOf(o[1]);t>l?t=l:l=t+o[1].length;const e=o[0][o[0].length-1];s.insertText(e,a+o[0].length-1),s.replaceWith(t,l,c)}else if(o[0]){const e=t.type.isInline?a:a-1;s.insert(e,t.type.create(i)).delete(s.mapping.map(a),s.mapping.map(l))}s.scrollIntoView()},undoable:t.undoable})}function Vl(t){return new yl({find:t.find,handler:e=>{let n=e.state,r=e.range,o=e.match;const i=n.doc.resolve(r.from),s=ya(t.getAttributes,void 0,o)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;n.tr.delete(r.from,r.to).setBlockType(r.from,r.from,t.type,s)},undoable:t.undoable})}function ql(t){return new yl({find:t.find,handler:e=>{let n=e.state,r=e.range,o=e.match,i=t.replace,s=r.from;const a=r.to;if(o[1]){const t=o[0].lastIndexOf(o[1]);i+=o[0].slice(t+o[1].length),s+=t;const e=s-a;e>0&&(i=o[0].slice(t-e,t)+i,s=a)}n.tr.insertText(i,s,a)},undoable:t.undoable})}function Wl(t){return new yl({find:t.find,handler:e=>{let n=e.state,r=e.range,o=e.match,i=e.chain;const s=ya(t.getAttributes,void 0,o)||{},a=n.tr.delete(r.from,r.to),l=a.doc.resolve(r.from).blockRange(),c=l&&Xt(l,t.type,s);if(!c)return null;if(a.wrap(l,c),t.keepMarks&&t.editor){const e=n.selection,r=n.storedMarks,o=t.editor.extensionManager.splittableMarks,i=r||e.$to.parentOffset&&e.$from.marks();if(i){const t=i.filter(t=>o.includes(t.type.name));a.ensureMarks(t)}}if(t.keepAttributes){const e="bulletList"===t.type.name||"orderedList"===t.type.name?"listItem":"taskList";i().updateAttributes(e,s).run()}const d=a.doc.resolve(r.from-1).nodeBefore;d&&d.type===t.type&&oe(a.doc,r.from-1)&&(!t.joinPredicate||t.joinPredicate(o,d))&&a.join(r.from-1)},undoable:t.undoable})}var Jl=class{constructor(t){var e,n,r,o,i,s;this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=t=>{if(!this.isResizing||!this.activeHandle)return;const e=t.clientX-this.startX,n=t.clientY-this.startY;this.handleResize(e,n)},this.handleTouchMove=t=>{if(!this.isResizing||!this.activeHandle)return;const e=t.touches[0];if(!e)return;const n=e.clientX-this.startX,r=e.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>
1{if(!this.isResizing)return;const t=this.element.offsetWidth,e=this.element.offsetHeight;this.onCommit(t,e),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=t=>{"Shift"===t.key&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=t=>{"Shift"===t.key&&(this.isShiftKeyPressed=!1)},this.node=t.node,this.editor=t.editor,this.element=t.element,this.contentElement=t.contentElement,this.getPos=t.getPos,this.onResize=t.onResize,this.onCommit=t.onCommit,this.onUpdate=t.onUpdate,(null==(e=t.options)?void 0:e.min)&&(this.minSize={...this.minSize,...t.options.min}),(null==(n=t.options)?void 0:n.max)&&(this.maxSize=t.options.max),(null==(r=null==t?void 0:t.options)?void 0:r.directions)&&(this.directions=t.options.directions),(null==(o=t.options)?void 0:o.preserveAspectRatio)&&(this.preserveAspectRatio=t.options.preserveAspectRatio),(null==(i=t.options)?void 0:i.className)&&(this.classNames={container:t.options.className.container||"",wrapper:t.options.className.wrapper||"",handle:t.options.className.handle||"",resizing:t.options.className.resizing||""}),(null==(s=t.options)?void 0:s.createCustomHandle)&&(this.createCustomHandle=t.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var t;return null!=(t=this.contentElement)?t:null}handleEditorUpdate(){const t=this.editor.isEditable;t!==this.lastEditableState&&(this.lastEditableState=t,t?t&&0===this.handleMap.size&&this.attachHandles():this.removeHandles())}update(t,e,n){return t.type===this.node.type&&(this.node=t,!this.onUpdate||this.onUpdate(t,e,n))}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const t=document.createElement("div");return t.dataset.resizeContainer="",t.dataset.node=this.node.type.name,t.style.display=this.node.type.isInline?"inline-flex":"flex",this.classNames.container&&(t.className=this.classNames.container),t.appendChild(this.wrapper),t}createWrapper(){const t=document.createElement("div");return t.style.position="relative",t.style.display="block",t.dataset.resizeWrapper="",this.classNames.wrapper&&(t.className=this.classNames.wrapper),t.appendChild(this.element),t}createHandle(t){const e=document.createElement("div");return e.dataset.resizeHandle=t,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}positionHandle(t,e){const n=e.includes("top"),r=e.includes("bottom"),o=e.includes("left"),i=e.includes("right");n&&(t.style.top="0"),r&&(t.style.bottom="0"),o&&(t.style.left="0"),i&&(t.style.right="0"),"top"!==e&&"bottom"!==e||(t.style.left="0",t.style.right="0"),"left"!==e&&"right"!==e||(t.style.top="0",t.style.bottom="0")}attachHandles(){this.directions.forEach(t=>{let e;e=this.createCustomHandle?this.createCustomHandle(t):this.createHandle(t),e instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${t}") did not return an HTMLElement. Falling back to default handle.`),e=this.createHandle(t)),this.createCustomHandle||this.positionHandle(e,t),e.addEventListener("mousedown",e=>this.handleResizeStart(e,t)),e.addEventListener("touchstart",e=>this.handleResizeStart(e,t)),this.handleMap.set(t,e),this.wrapper.appendChild(e)})}
1removeHandles(){this.handleMap.forEach(t=>t.remove()),this.handleMap.clear()}applyInitialSize(){const t=this.node.attrs.width,e=this.node.attrs.height;t?(this.element.style.width=`${t}px`,this.initialWidth=t):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height=`${e}px`,this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(t,e){t.preventDefault(),t.stopPropagation(),this.isResizing=!0,this.activeHandle=e,"touches"in t?(this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY):(this.startX=t.clientX,this.startY=t.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(t,e){if(!this.activeHandle)return;const n=this.preserveAspectRatio||this.isShiftKeyPressed,r=this.calculateNewDimensions(this.activeHandle,t,e),o=r.width,i=r.height,s=this.applyConstraints(o,i,n);this.element.style.width=`${s.width}px`,this.element.style.height=`${s.height}px`,this.onResize&&this.onResize(s.width,s.height)}calculateNewDimensions(t,e,n){let r=this.startWidth,o=this.startHeight;const i=t.includes("right"),s=t.includes("left"),a=t.includes("bottom"),l=t.includes("top");return i?r=this.startWidth+e:s&&(r=this.startWidth-e),a?o=this.startHeight+n:l&&(o=this.startHeight-n),"right"!==t&&"left"!==t||(r=this.startWidth+(i?e:-e)),"top"!==t&&"bottom"!==t||(o=this.startHeight+(a?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,o,t):{width:r,height:o}}applyConstraints(t,e,n){var r,o,i,s;if(!n){let n=Math.max(this.minSize.width,t),i=Math.max(this.minSize.height,e);return(null==(r=this.maxSize)?void 0:r.width)&&(n=Math.min(this.maxSize.width,n)),(null==(o=this.maxSize)?void 0:o.height)&&(i=Math.min(this.maxSize.height,i)),{width:n,height:i}}let a=t,l=e;return a<this.minSize.width&&(a=this.minSize.width,l=a/this.aspectRatio),l<this.minSize.height&&(l=this.minSize.height,a=l*this.aspectRatio),(null==(i=this.maxSize)?void 0:i.width)&&a>this.maxSize.width&&(a=this.maxSize.width,l=a/this.aspectRatio),(null==(s=this.maxSize)?void 0:s.height)&&l>this.maxSize.height&&(l=this.maxSize.height,a=l*this.aspectRatio),{width:a,height:l}}applyAspectRatio(t,e,n){const r="top"===n||"bottom"===n;return"left"===n||"right"===n?{width:t,height:t/this.aspectRatio}:r?{width:e*this.aspectRatio,height:e}:{width:t,height:t/this.aspectRatio}}};function Gl(t){if(!(null==t?void 0:t.trim()))return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,t=>(n.push(t),`__QUOTED_${n.length-1}__`)),o=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(o){const t=o.map(t=>t.trim().slice(1));e.class=t.join(" ")}const i=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);i&&(e.id=i[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(t=>{let r=qi(t,3),o=r[1],i=r[2];var s;const a=parseInt((null==(s=i.match(/__QUOTED_(\d+)__/))?void 0:s[1])||"0",10),l=n[a];l&&(e[o]=l.slice(1,-1))});const s=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 s&&s.split(/\s+/).filter(Boolean).forEach(t=>
1{t.match(/^[a-zA-Z][\w-]*$/)&&(e[t]=!0)}),e}function Kl(t){if(!t||0===Object.keys(t).length)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(t=>e.push(`.${t}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(t=>{let n=qi(t,2),r=n[0],o=n[1];"class"!==r&&"id"!==r&&(!0===o?e.push(r):!1!==o&&null!=o&&e.push(`${r}="${String(o)}"`))}),e.join(" ")}function Yl(t){const e=t.nodeName,n=t.name,r=t.parseAttributes,o=void 0===r?Gl:r,i=t.serializeAttributes,s=void 0===i?Kl:i,a=t.defaultAttributes,l=void 0===a?{}:a,c=t.requiredAttributes,d=void 0===c?[]:c,u=t.allowedAttributes,h=n||e;return{parseMarkdown:(t,n)=>{const r={...l,...t.attributes};return n.createNode(e,r,[])},markdownTokenizer:{name:e,level:"block",start(t){var e;const n=new RegExp(`^:::${h}(?:\\s|$)`,"m"),r=null==(e=t.match(n))?void 0:e.index;return void 0!==r?r:-1},tokenize(t,n,r){const i=new RegExp(`^:::${h}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),s=t.match(i);if(!s)return;const a=s[1]||"",l=o(a);return d.find(t=>!(t in l))?void 0:{type:e,raw:s[0],attributes:l}}},renderMarkdown:t=>{const e=(t=>{if(!u)return t;const e={};return u.forEach(n=>{n in t&&(e[n]=t[n])}),e})(t.attrs||{}),n=s(e);return`:::${h}${n?` {${n}}`:""} :::`}}}function Ql(t){const e=t.nodeName,n=t.name,r=t.getContent,o=t.parseAttributes,i=void 0===o?Gl:o,s=t.serializeAttributes,a=void 0===s?Kl:s,l=t.defaultAttributes,c=void 0===l?{}:l,d=t.content,u=void 0===d?"block":d,h=t.allowedAttributes,p=n||e;return{parseMarkdown:(t,n)=>{let o;if(r){const e=r(t);o="string"==typeof e?[{type:"text",text:e}]:e}else o="block"===u?n.parseChildren(t.tokens||[]):n.parseInline(t.tokens||[]);const i={...c,...t.attributes};return n.createNode(e,i,o)},markdownTokenizer:{name:e,level:"block",start(t){var e;const n=new RegExp(`^:::${p}`,"m"),r=null==(e=t.match(n))?void 0:e.index;return void 0!==r?r:-1},tokenize(t,n,r){var o;const s=new RegExp(`^:::${p}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),a=t.match(s);if(!a)return;const l=qi(a,2),c=l[0],d=l[1],h=i(void 0===d?"":d);let f=1;const g=c.length;let m="";const A=/^:::([\w-]*)(\s.*)?/gm,y=t.slice(g);for(A.lastIndex=0;;){const n=A.exec(y);if(null===n)break;const i=n.index,s=n[1];if(!(null==(o=n[2])?void 0:o.endsWith(":::")))if(s)f+=1;else if(f-=1,0===f){const o=y.slice(0,i);m=o.trim();const s=t.slice(0,g+i+n[0].length);let a=[];if(m)if("block"===u)for(a=r.blockTokens(o),a.forEach(t=>{!t.text||t.tokens&&0!==t.tokens.length||(t.tokens=r.inlineTokens(t.text))});a.length>0;){const t=a[a.length-1];if("paragraph"!==t.type||t.text&&""!==t.text.trim())break;a.pop()}else a=r.inlineTokens(m);return{type:e,raw:s,attributes:h,content:m,tokens:a}}}}},renderMarkdown:(t,e)=>{const n=(t=>{if(!h)return t;const e={};return h.forEach(n=>{n in t&&(e[n]=t[n])}),e})(t.attrs||{}),r=a(n),o=r?` {${r}}`:"",i=e.renderChildren(t.content||[],"\n\n");return`:::${p}${o}\n\n${i}\n\n:::`}}}function Zl(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;null!==r;){const o=qi(r,4),i=o[1],s=o[2],a=o[3];e[i]=s||a,r=n.exec(t)}return e}function Xl(t){return Object.entries(t).filter(t=>null!=qi(t,2)[1]).map(t=>{let e=qi(t,2);return`${e[0]}="${e[1]}"`}).join(" ")}function tc(t){const e=t.nodeName,n=t.name,r=t.getContent,o=t.parseAttributes,i=void 0===o?Zl:o,s=t.serializeAttributes,a=void 0===s?Xl:s,l=t.defaultAttributes,c=void 0===l?{}:l,d=t.selfClosing,u=void 0!==d&&d,h=t.allowedAttributes,p=n||e,f=p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(t,n)=>{const o={...c,...t.attributes};if(u)return n.createNode(e,o);const i=r?r(t):t.content||"";return i?n.createNode(e,o,[n.createTextNode(i)]):n.createNode(e,o,[])},markdownTokenizer:{name:e,level:"inline",start(t){const e=u?new RegExp(`\\[${f}\\s*[^\\]]*\\]`):new RegExp(`\\[${f}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${f}\\]`),n=t.match(e),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize(t,n,r){const o=u?new RegExp(`^\\[${f}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${f}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${f}\\]`),s=t.match(o);if(!s)return;let a="",l="";if(u)l=qi(s,2)[1];else{const t=qi(s,3);l=t[1],a=t[2]||""}const c=i(l.trim());return{type:e,raw:s[0],content:a.trim(),attributes:c}}},renderMarkdown:t=>{let e="";r?e=r(t):t.content&&t.content.length>0&&(e=t.content.filter(t=>"text"===t.type).map(t=>t.text).join(""));const n=(t=>
1{if(!h)return t;const e={};return h.forEach(n=>{const r="string"==typeof n?n:n.name,o="string"==typeof n?void 0:n.skipIfDefault;if(r in t){const n=t[r];if(void 0!==o&&n===o)return;e[r]=n}}),e})(t.attrs||{}),o=a(n),i=o?` ${o}`:"";return u?`[${p}${i}]`:`[${p}${i}]${e}[/${p}]`}}}function ec(t,e,n){var r,o,i,s;const a=t.split("\n"),l=[];let c="",d=0;const u=e.baseIndentSize||2;for(;d<a.length;){const t=a[d],h=t.match(e.itemPattern);if(!h){if(l.length>0)break;if(""===t.trim()){d+=1,c=`${c}${t}\n`;continue}return}const p=e.extractItemData(h),f=p.indentLevel;c=`${c}${t}\n`;const g=[p.mainContent];for(d+=1;d<a.length;){const t=a[d];if(""===t.trim()){const e=a.slice(d+1).findIndex(t=>""!==t.trim());if(-1===e)break;if(((null==(o=null==(r=a[d+1+e].match(/^(\s*)/))?void 0:r[1])?void 0:o.length)||0)>f){g.push(t),c=`${c}${t}\n`,d+=1;continue}break}if(!(((null==(s=null==(i=t.match(/^(\s*)/))?void 0:i[1])?void 0:s.length)||0)>f))break;g.push(t),c=`${c}${t}\n`,d+=1}let m;const A=g.slice(1);if(A.length>0){const t=A.map(t=>t.slice(f+u)).join("\n");t.trim()&&(m=e.customNestedParser?e.customNestedParser(t):n.blockTokens(t))}const y=e.createToken(p,m);l.push(y)}if(0!==l.length)return{items:l,raw:c}}function nc(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const o="function"==typeof n?n(r):n,i=Ki(l=t.content)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(l)||Ji(l)||Wi(),s=i[0],a=Gi(i).slice(1);var l;let c=`${o}${e.renderChildren([s])}`;return a&&a.length>0&&a.forEach((t,n)=>{var r,o;const i=null!=(o=null==(r=e.renderChild)?void 0:r.call(e,t,n+1))?o:e.renderChildren([t]);if(null!=i){const n=i.split("\n").map(t=>t?e.indent(t):e.indent("")).join("\n");c+="paragraph"===t.type?`\n\n${n}`:`\n${n}`}}),c}Qi({},{createAtomBlockMarkdownSpec:()=>Yl,createBlockMarkdownSpec:()=>Ql,createInlineMarkdownSpec:()=>tc,parseAttributes:()=>Gl,parseIndentedBlocks:()=>ec,renderNestedMarkdownContent:()=>nc,serializeAttributes:()=>Kl});var rc=class t extends kl{constructor(){super(...arguments),this.type="node"}static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n="function"==typeof e?e():e;return new t(n)}configure(t){return super.configure(t)}extend(t){const e="function"==typeof t?t():t;return super.extend(e)}};function oc(t){return new xl({find:t.find,handler:e=>{let n=e.state,r=e.range,o=e.match,i=e.pasteEvent;const s=ya(t.getAttributes,void 0,o,i);if(!1===s||null===s)return null;const a=n.tr,l=o[o.length-1],c=o[0];let d=r.to;if(l){const e=c.search(/\S/),i=r.from+c.indexOf(l),u=i+l.length;if($a(r.from,r.to,n.doc).filter(e=>e.mark.type.excluded.find(n=>n===t.type&&n!==e.mark.type)).filter(t=>t.to>i).length)return null;u<r.to&&a.delete(u,r.to),i>r.from&&a.delete(r.from+e,i),d=r.from+e+l.length,a.addMark(r.from+e,d,t.type.create(s||{})),void 0!==o.index&&void 0!==o.input&&o.index+o[0].length>=o.input.length||a.removeStoredMark(t.type)}}})}function ic(t={}){return new Ve({view:e=>new sc(e,t)})}class sc{constructor(t,e){var n;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=null!==(n=e.width)&&void 0!==n?n:1,this.color=!1===e.color?void 0:e.color||"black",this.class=e.class,this.handlers=["dragover","dragend","drop","dragleave"].map(e=>{let n=t=>{this[e](t)};return t.dom.addEventListener(e,n),{name:e,handler:n}})}destroy(){this.handlers.forEach(({name:t,handler:e})=>this.editorView.dom.removeEventListener(t,e))}update(t,e){if(null!=this.cursorPos&&e.doc!=t.state.doc)if(this.lastDragEvent){let t=this.computeTarget(this.lastDragEvent);t==this.cursorPos?this.updateOverlay():this.setCursor(t)}else this.updateOverlay()}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t,e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r=this.editorView.dom,o=r.getBoundingClientRect(),i=o.width/r.offsetWidth,s=o.height/r.offsetHeight;if(n){let n=e.nodeBefore,r=e.nodeAfter;if(n||r){let e=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(e){let o=e.getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let a=this.width/2*s;t={left:o.left,right:o.right,top:i-a,bottom:i+a}}}}if(!t){let e=this.editorView.coordsAtPos(this.cursorPos),n=this.width/2*i;t={left:e.left-n,right:e.left+n,top:e.top,bottom:e.bottom}}let a,l,c=this.editorView.dom.offsetParent;if(this.element||(this.element=c.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),!c||c==document.body&&"static"==getComputedStyle(c).position)a=-pageXOffset,l=-pageYOffset;else{let t=c.getBoundingClientRect(),e=t.width/c.offsetWidth,n=t.height/c.offsetHeight;a=t.left-c.scrollLeft*e,l=t.top-c.scrollTop*n}this.element.style.left=(t.left-a)/i+"px",this.element.style.top=(t.top-l)/s+"px",this.element.style.width=(t.right-t.left)/i+"px",this.element.style.height=(t.bottom-t.top)/s+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}computeTarget(t){let e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),n=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,e,t):r;if(!e||o)return null;let i=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=ae(this.editorView.state.doc,i,this.editorView.dragging.slice);null!=t&&(i=t)}return i}dragover(t){if(!this.editorView.editable)return;this.lastDragEvent=t;let e=this.computeTarget(t);null!=e&&(this.setCursor(e),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}class ac extends Se{constructor(t){super(t,t)}map(t,e){let n=t.resolve(e.map(this.head));return ac.valid(n)?new ac(n):Se.near(n)}content(){return N.empty}eq(t){return t instanceof ac&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new ac(t.resolve(e.pos))}getBookmark(){return new lc(this.anchor)}static valid(t){let e=t.parent;if(e.inlineContent||!function(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(0!=n)for(let t=r.child(n-1);;t=t.lastChild){if(0==t.childCount&&!t.inlineContent||cc(t.type))return!0;
1if(t.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(t)||!function(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n!=r.childCount)for(let t=r.child(n);;t=t.firstChild){if(0==t.childCount&&!t.inlineContent||cc(t.type))return!0;if(t.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(t))return!1;let n=e.type.spec.allowGapCursor;if(null!=n)return n;let r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,e,n=!1){t:for(;;){if(!n&&ac.valid(t))return t;let r=t.pos,o=null;for(let n=t.depth;;n--){let i=t.node(n);if(e>0?t.indexAfter(n)<i.childCount:t.index(n)>0){o=i.child(e>0?t.indexAfter(n):t.index(n)-1);break}if(0==n)return null;r+=e;let s=t.doc.resolve(r);if(ac.valid(s))return s}for(;;){let i=e>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!Oe.isSelectable(o)){t=t.doc.resolve(r+o.nodeSize*e),n=!1;continue t}break}o=i,r+=e;let s=t.doc.resolve(r);if(ac.valid(s))return s}return null}}}ac.prototype.visible=!1,ac.findFrom=ac.findGapCursorFrom,Se.jsonID("gapcursor",ac);class lc{constructor(t){this.pos=t}map(t){return new lc(t.map(this.pos))}resolve(t){let e=t.resolve(this.pos);return ac.valid(e)?new ac(e):Se.near(e)}}function cc(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}const dc=Vi({ArrowLeft:uc("horiz",-1),ArrowRight:uc("horiz",1),ArrowUp:uc("vert",-1),ArrowDown:uc("vert",1)});function uc(t,e){const n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,r,o){let i=t.selection,s=e>0?i.$to:i.$from,a=i.empty;if(i instanceof _e){if(!o.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=t.doc.resolve(e>0?s.after():s.before())}let l=ac.findGapCursorFrom(s,e,a);return!!l&&(r&&r(t.tr.setSelection(new ac(l))),!0)}}function hc(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!ac.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&Oe.isSelectable(t.state.doc.nodeAt(o.inside))||(t.dispatch(t.state.tr.setSelection(new ac(r))),0))}function pc(t,e){if("insertCompositionText"!=e.inputType||!(t.state.selection instanceof ac))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=M.empty;for(let t=r.length-1;t>=0;t--)o=M.from(r[t].createAndFill(null,o));let i=t.state.tr.replace(n.pos,n.pos,new N(o,0,0));return i.setSelection(_e.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function fc(t){if(!(t.selection instanceof ac))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",si.create(t.doc,[ri.widget(t.selection.head,e,{key:"gapcursor"})])}var gc=200,mc=function(){};mc.prototype.append=function(t){return t.length?(t=mc.from(t),!this.length&&t||t.length<gc&&this.leafAppend(t)||this.length<gc&&t.leafPrepend(this)||this.appendInner(t)):this},mc.prototype.prepend=function(t){return t.length?mc.from(t).append(this):this},mc.prototype.appendInner=function(t){return new yc(this,t)},mc.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?mc.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},mc.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},mc.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},mc.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(e,n){return r.push(t(e,n))},e,n),r},mc.from=function(t){return t instanceof mc?t:t&&t.length?new Ac(t):mc.empty};var Ac=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var o=e;o<n;o++)if(!1===t(this.values[o],r+o))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var o=e-1;o>=n;o--)if(!1===t(this.values[o],r+o))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=gc)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=gc)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(mc);mc.empty=new Ac([]);var yc=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var o=this.left.length;return!(e<o&&!1===this.left.forEachInner(t,e,Math.min(n,o),r))&&!(n>o&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,n)-o,r+o))&&void 0},e.prototype.forEachInvertedInner=function(t,e,n,r){var o=this.left.length;return!(e>
1o&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(n,o)-o,r+o))&&!(n<o&&!1===this.left.forEachInvertedInner(t,Math.min(e,o),n,r))&&void 0},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(mc);const bc=mc;class vc{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--)if(this.items.get(o-1).selection){--o;break}e&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,a=t.tr,l=[],c=[];return this.items.forEach((t,e)=>{if(!t.step)return n||(n=this.remapping(o,e+1),r=n.maps.length),r--,void c.push(t);if(n){c.push(new wc(t.map));let e,o=t.step.map(n.slice(r));o&&a.maybeStep(o).doc&&(e=a.mapping.maps[a.mapping.maps.length-1],l.push(new wc(e,void 0,void 0,l.length+c.length))),r--,e&&n.appendMap(e,r)}else a.maybeStep(t.step);return t.selection?(i=n?t.selection.map(n.slice(r)):t.selection,s=new vc(this.items.slice(0,o).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0},this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(t,e,n,r){let o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<t.steps.length;n++){let l,c=t.steps[n].invert(t.docs[n]),d=new wc(t.mapping.maps[n],c,e);(l=a&&a.merge(d))&&(d=l,n?o.pop():s=s.slice(0,s.length-1)),o.push(d),e&&(i++,e=void 0),r||(a=d)}let l=i-n.depth;return l>Cc&&(s=function(t,e){let n;return t.forEach((t,r)=>{if(t.selection&&0==e--)return n=r,!1}),t.slice(n)}(s,l),i-=l),new vc(s.append(o),i)}remapping(t,e){let n=new Pt;return this.items.forEach((e,r)=>{let o=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,o)},t,e),n}addMaps(t){return 0==this.eventCount?this:new vc(this.items.append(t.map(t=>new wc(t))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),o=t.mapping,i=t.steps.length,s=this.eventCount;this.items.forEach(t=>{t.selection&&s--},r);let a=e;this.items.forEach(e=>{let r=o.getMirror(--a);if(null==r)return;i=Math.min(i,r);let l=o.maps[r];if(e.step){let i=t.steps[r].invert(t.docs[r]),c=e.selection&&e.selection.map(o.slice(a+1,r));c&&s++,n.push(new wc(l,i,c))}else n.push(new wc(l))},r);let l=[];for(let t=e;t<i;t++)l.push(new wc(o.maps[t]));let c=this.items.slice(0,r).append(l).append(n),d=new vc(c,s);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let t=0;return this.items.forEach(e=>{e.step||t++}),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,r=[],o=0;return this.items.forEach((i,s)=>{if(s>=t)r.push(i),i.selection&&o++;else if(i.step){let t=i.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let a=i.selection&&i.selection.map(e.slice(n));a&&o++;let l,c=new wc(s.invert(),t,a),d=r.length-1;(l=r.length&&r[d].merge(c))?r[d]=l:r.push(c)}}else i.map&&n--},this.items.length,0),new vc(bc.from(r.reverse()),o)}}vc.empty=new vc(bc.empty,0);class wc{constructor(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new wc(e.getMap().invert(),e,this.selection)}}}class kc{constructor(t,e,n,r,o){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}}const Cc=20;function xc(t){let e=[];for(let n=t.length-1;n>=0&&0==e.length;n--)t[n].forEach((t,n,r,o)=>e.push(r,o));return e}function Sc(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}let Ec=!1,Mc=null;function Tc(t){let e=t.plugins;if(Mc!=e){Ec=!1,Mc=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Ec=!0;break}}return Ec}const _c=new Je("history"),Dc=new Je("closeHistory");function Oc(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ve({key:_c,state:{init:()=>new kc(vc.empty,vc.empty,null,0,-1),apply:(e,n,r)=>function(t,e,n,r){let o,i=n.getMeta(_c);if(i)return i.historyState;n.getMeta(Dc)&&(t=new kc(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(_c))return s.getMeta(_c).redo?new kc(t.done.addTransform(n,void 0,r,Tc(e)),t.undone,xc(n.mapping.maps),t.prevTime,t.prevComposition):new kc(t.done,t.undone.addTransform(n,void 0,r,Tc(e)),null,t.prevTime,t.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new kc(t.done.rebased(n,o),t.undone.rebased(n,o),Sc(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new kc(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Sc(t.prevRanges,n.mapping),t.prevTime,t.prevComposition);{let o=n.getMeta("composition"),i=0==t.prevTime||!s&&t.prevComposition!=o&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;
1return t.mapping.maps[0].forEach((t,r)=>{for(let o=0;o<e.length;o+=2)t<=e[o+1]&&r>=e[o]&&(n=!0)}),n}(n,t.prevRanges)),a=s?Sc(t.prevRanges,n.mapping):xc(n.mapping.maps);return new kc(t.done.addTransform(n,i?e.selection.getBookmark():void 0,r,Tc(e)),vc.empty,a,n.time,o??t.prevComposition)}}(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?Nc:"historyRedo"==n?Lc:null;return!(!r||!t.editable)&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}function Ic(t,e){return(n,r)=>{let o=_c.getState(n);if(!o||0==(t?o.undone:o.done).eventCount)return!1;if(r){let i=function(t,e,n){let r=Tc(e),o=_c.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),a=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),o,r),l=new kc(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(_c,{redo:n,historyState:l})}(o,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}const Nc=Ic(!1,!0),Lc=Ic(!0,!0);function Bc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}Ic(!1,!1),Ic(!0,!1),Tl.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(t=>""!==t).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=t=>{const e=(null==t?void 0:t.node)||this.editor.state.doc;if("textSize"===((null==t?void 0:t.mode)||this.options.mode)){const t=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(t)}return e.nodeSize},this.storage.words=t=>{const e=(null==t?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new Ve({key:new Je("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const o=this.options.limit;if(null==o||0===o)return void(t=!0);const i=this.storage.characters({node:r.doc});if(i>o){const e=0,n=i-o;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const s=r.tr.deleteRange(e,n);return t=!0,s}t=!0},filterTransaction:(t,e)=>{const n=this.options.limit;if(!t.docChanged||0===n||null==n)return!0;const r=this.storage.characters({node:e.doc}),o=this.storage.characters({node:t.doc});if(o<=n)return!0;if(r>n&&o>n&&o<=r)return!0;if(r>n&&o>n&&o>r)return!1;if(!t.getMeta("paste"))return!1;const i=t.selection.$head.pos,s=i-(o-n),a=i;return t.deleteRange(s,a),!(this.storage.characters({node:t.doc})>n)}})]}});var $c=Tl.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[ic(this.options)]}}),Rc=Tl.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new Ve({key:new Je("focus"),props:{decorations:t=>{let e=t.doc,n=t.selection;const r=this.editor,o=r.isEditable,i=r.isFocused,s=n.anchor,a=[];if(!o||!i)return si.create(e,[]);let l=0;"deepest"===this.options.mode&&e.descendants((t,e)=>{if(!t.isText)return s>=e&&s<=e+t.nodeSize-1&&void(l+=1)});let c=0;return e.descendants((t,e)=>!t.isText&&(s>=e&&s<=e+t.nodeSize-1&&(c+=1,"deepest"===this.options.mode&&l-c>0||"shallowest"===this.options.mode&&c>1?"deepest"===this.options.mode:void a.push(ri.node(e,e+t.nodeSize,{class:this.options.className}))))),si.create(e,a)}}})]}}),Pc=Tl.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Ve({props:{decorations:fc,createSelectionBetween:(t,e,n)=>e.pos==n.pos&&ac.valid(n)?new ac(n):null,handleClick:hc,handleKeyDown:dc,handleDOMEvents:{beforeinput
1:pc}}})],extendNodeSchema(t){var e;return{allowGapCursor:null!=(e=ya(fa(t,"allowGapCursor",{name:t.name,options:t.options,storage:t.storage})))?e:null}}}),Fc="placeholder";function zc(t){let e=t.types,n=t.node;return n&&Array.isArray(e)&&e.includes(n.type)||(null==n?void 0:n.type)===e}Tl.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:Fc,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){const t=this.options.dataAttribute?`data-${e=this.options.dataAttribute,e.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}`:`data-${Fc}`;var e;return[new Ve({key:new Je("placeholder"),props:{decorations:e=>{let n=e.doc,r=e.selection;const o=this.editor.isEditable||!this.options.showOnlyWhenEditable,i=r.anchor,s=[];if(!o)return null;const a=this.editor.isEmpty;return n.descendants((e,n)=>{const r=i>=n&&i<=n+e.nodeSize,o=!e.isLeaf&&ja(e);if(!e.type.isTextblock)return this.options.includeChildren;if((r||!this.options.showOnlyCurrent)&&o){const o=[this.options.emptyNodeClass];a&&o.push(this.options.emptyEditorClass);const i=ri.node(n,n+e.nodeSize,{class:o.join(" "),[t]:"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:e,pos:n,hasAnchor:r}):this.options.placeholder});s.push(i)}return this.options.includeChildren}),si.create(n,s)}}})]}}),Tl.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){const t=this.editor,e=this.options;return[new Ve({key:new Je("selection"),props:{decorations:n=>n.selection.empty||t.isFocused||!t.isEditable||Ua(n.selection)||t.view.dragging?null:si.create(n.doc,[ri.inline(n.selection.from,n.selection.to,{class:e.className})])}})]}}),Tl.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var t;const e=new Je(this.name),n=this.options.node||(null==(t=this.editor.schema.topNodeType.contentMatch.defaultType)?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(t=>{return(e=t,n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,n)||function(t,e){if(t){if("string"==typeof t)return Bc(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Bc(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1];var e,n}).filter(t=>(this.options.notAfter||[]).concat(n).includes(t.name));return[new Ve({key:e,appendTransaction:(t,r,o)=>{const i=o.doc,s=o.tr,a=o.schema,l=e.getState(o),c=i.content.size,d=a.nodes[n];if(!t.some(t=>t.getMeta("skipTrailingNode"))&&l)return s.insert(c,d.create())},state:{init:(t,e)=>!zc({node:e.tr.doc.lastChild,types:r}),apply:(t,e)=>t.docChanged?t.getMeta("__uniqueIDTransaction")?e:!zc({node:t.doc.lastChild,types:r}):e}})]}}),Tl.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>t=>{let e=t.state,n=t.dispatch;return Nc(e,n)},redo:()=>t=>{let e=t.state,n=t.dispatch;return Lc(e,n)}}),addProseMirrorPlugins(){return[Oc(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}});const Hc=new Je("y-sync"),jc=new Je("y-undo");new Je("yjs-cursor"),f(),g(),m();const Uc=Math.floor,Vc=(Math.ceil,Math.abs),qc=(Math.imul,Math.round,Math.log10,Math.log2,Math.log,Math.sqrt,(t,e)=>t<e?t:e),Wc=(t,e)=>t>e?t:e,Jc=(Number.isNaN,Math.pow,Math.sign,t=>0!==t?t<0:1/t<0),Gc=Symbol("Equality"),Kc=(t,e)=>{var n;return t===e||!(null==t||null===(n=t[Gc])||void 0===n||!n.call(t,e))||!1},Yc=Object.assign,Qc=Object.keys,Zc=(Object.values,t=>Qc(t).length),Xc=(t,e)=>{for(const n in t)if(!e(t[n],n))return!1;return!0},td=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),ed=Object.freeze,nd=t=>{for(const e in t){const n=t[e];"object"!=typeof n&&"function"!=typeof n||nd(t[e])}return ed(t)},rd=()=>new Set,od=/[\uD800-\uDBFF]/,id=/[\uDC00-\uDFFF]/,sd=t=>new Error(t),ad=()=>{throw sd("Method unimplemented")},ld=()=>{throw sd("Unexpected case")};function cd(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(t){c=!0,o=t}
1finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return dd(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dd(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dd(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}const ud=()=>new Map,hd=t=>{const e=ud();return t.forEach((t,n)=>{e.set(n,t)}),e},pd=(t,e,n)=>{let r=t.get(e);return void 0===r&&t.set(e,r=n()),r},fd=t=>t[t.length-1],gd=(t,e)=>{for(let n=0;n<e.length;n++)t.push(e[n])},md=Array.from,Ad=(t,e)=>{for(let n=0;n<t.length;n++)if(!e(t[n],n,t))return!1;return!0},yd=(t,e)=>{for(let n=0;n<t.length;n++)if(e(t[n],n,t))return!0;return!1},bd=Array.isArray;class vd{constructor(){this._observers=ud()}on(t,e){return pd(this._observers,t,rd).add(e),e}once(t,e){var n=this;const r=function(){n.off(t,r),e(...arguments)};this.on(t,r)}off(t,e){const n=this._observers.get(t);void 0!==n&&(n.delete(e),0===n.size&&this._observers.delete(t))}emit(t,e){return md((this._observers.get(t)||ud()).values()).forEach(t=>t(...e))}destroy(){this._observers=ud()}}class wd{constructor(){this._observers=ud()}on(t,e){pd(this._observers,t,rd).add(e)}once(t,e){var n=this;const r=function(){n.off(t,r),e(...arguments)};this.on(t,r)}off(t,e){const n=this._observers.get(t);void 0!==n&&(n.delete(e),0===n.size&&this._observers.delete(t))}emit(t,e){return md((this._observers.get(t)||ud()).values()).forEach(t=>t(...e))}destroy(){this._observers=ud()}}const kd=Number.MAX_SAFE_INTEGER,Cd=Number.MIN_SAFE_INTEGER,xd=Number.isInteger||(t=>"number"==typeof t&&isFinite(t)&&Uc(t)===t),Sd=(Number.isNaN,Number.parseInt,String.fromCharCode),Ed=(String.fromCodePoint,Sd(65535),/^\s*/g),Md=/([A-Z])/g,Td=(t,e)=>(t=>t.replace(Ed,""))(t.replace(Md,t=>`${e}${(t=>t.toLowerCase())(t)}`)),_d="undefined"!=typeof TextEncoder?new TextEncoder:null,Dd=_d?t=>_d.encode(t):t=>{const e=unescape(encodeURIComponent(t)),n=e.length,r=new Uint8Array(n);for(let t=0;t<n;t++)r[t]=e.codePointAt(t);return r};let Od="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Od&&1===Od.decode(new Uint8Array).length&&(Od=null);const Id=(t,e)=>((t,e)=>{const n=new Array(t);for(let r=0;r<t;r++)n[r]=e();return n})(e,()=>t).join("");class Nd{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const Ld=()=>new Nd,Bd=t=>{const e=new Uint8Array((t=>{let e=t.cpos;for(let n=0;n<t.bufs.length;n++)e+=t.bufs[n].length;return e})(t));let n=0;for(let r=0;r<t.bufs.length;r++){const o=t.bufs[r];e.set(o,n),n+=o.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),n),e},$d=(t,e)=>{const n=t.cbuf.length;t.cpos===n&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(2*n),t.cpos=0),t.cbuf[t.cpos++]=e},Rd=$d,Pd=(t,e)=>{for(;e>127;)$d(t,128|127&e),e=Uc(e/128);$d(t,127&e)},Fd=(t,e)=>{const n=Jc(e);for(n&&(e=-e),$d(t,(e>63?128:0)|(n?64:0)|63&e),e=Uc(e/64);e>0;)$d(t,(e>127?128:0)|127&e),e=Uc(e/128)},zd=new Uint8Array(3e4),Hd=zd.length/3,jd=_d&&_d.encodeInto?(t,e)=>{if(e.length<Hd){const n=_d.encodeInto(e,zd).written||0;Pd(t,n);for(let e=0;e<n;e++)$d(t,zd[e])}else Vd(t,Dd(e))}:(t,e)=>{const n=unescape(encodeURIComponent(e)),r=n.length;Pd(t,r);for(let e=0;e<r;e++)$d(t,n.codePointAt(e))},Ud=(t,e)=>{const n=t.cbuf.length,r=t.cpos,o=qc(n-r,e.length),i=e.length-o;t.cbuf.set(e.subarray(0,o),r),t.cpos+=o,i>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(Wc(2*n,i)),t.cbuf.set(e.subarray(o)),t.cpos=i)},Vd=(t,e)=>{Pd(t,e.byteLength),Ud(t,e)},qd=(t,e)=>{((t,e)=>{const n=t.cbuf.length;n-t.cpos<e&&(t.bufs.push(new Uint8Array(t.cbuf.buffer,0,t.cpos)),t.cbuf=new Uint8Array(2*Wc(n,e)),t.cpos=0)})(t,e);const n=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,n},Wd=new DataView(new ArrayBuffer(4)),Jd=(t,e)=>{switch(typeof e){case"string":$d(t,119),jd(t,e);break;case"number":xd(e)&&Vc(e)<=2147483647?($d(t,125),Fd(t,e)):(n=e,Wd.setFloat32(0,n),Wd.getFloat32(0)===n?($d(t,124),((t,e)=>{qd(t,4).setFloat32(0,e,!1)})(t,e)):($d(t,123),((t,e)=>{qd(t,8).setFloat64(0,e,!1)})(t,e)));break;case"bigint":$d(t,122),((t,e)=>{qd(t,8).setBigInt64(0,e,!1)})(t,e);break;case"object":if(null===e)$d(t,126);else if(bd(e)){$d(t,117),Pd(t,e.length);for(let n=0;n<e.length;n++)Jd(t,e[n])}else if(e instanceof Uint8Array)$d(t,116),Vd(t,e);else{$d(t,118);const n=Object.keys(e);Pd(t,n.length);for(let r=0;r<n.length;r++){const o=n[r];jd(t,o),Jd(t,e[o])}}break;case"boolean":$d(t,e?120:121);break;default:$d(t,127)}var n};class Gd extends Nd{constructor(t){super(),this.w=t,this.s=null,this.count=0}write(t){this.s===t?this.count++:(this.count>0&&Pd(this,this.count-1),this.count=1,this.w(this,t),this.s=t)}}const Kd=t=>{t.count>0&&(Fd(t.encoder,1===t.count?t.s:-t.s),t.count>1&&Pd(t.encoder,t.count-2))};class Yd{constructor(){this.encoder=new Nd,this.s=0,this.count=0}write(t){this.s===t?this.count++:(Kd(this),this.count=1,this.s=t)}toUint8Array(){return Kd(this),Bd(this.encoder)}}const Qd=t=>{if(t.count>0){const e=2*t.diff+(1===t.count?0:1);Fd(t.encoder,e),t.count>1&&Pd(t.encoder,t.count-2)}};class Zd{constructor(){this.encoder=new Nd,this.s=0,this.count=0,this.diff=0}write(t){this.diff===t-this.s?(this.s=t,this.count++):(Qd(this),this.count=1,this.diff=t-this.s,this.s=t)}toUint8Array(){return Qd(this),Bd(this.encoder)}}class Xd{constructor(){this.sarr=[],this.s="",this.lensE=new Yd}write(t){this.s+=t,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(t.length)}toUint8Array(){const t=new Nd;return this.sarr.push(this.s),this.s="",jd(t,this.sarr.join("")),Ud(t,this.lensE.toUint8Array()),Bd(t)}}const tu=sd("Unexpected end of array"),eu=sd("Integer out of Range");class nu{constructor(t){this.arr=t,this.pos=0}}const ru=t=>new nu(t),ou=t=>((t,e)=>{const n=new Uint8Array(t.arr.buffer,t.pos+t.arr.byteOffset,e);return t.pos+=e,n})(t,su(t)),iu=t=>t.arr[t.pos++],su=t=>{let e=0,n=1;const r=t.arr.length;for(;t.pos<r;){const r=t.arr[t.pos++];if(e+=(127&r)*n,n*=128,r<128)return e;if(e>kd)throw eu}throw tu},au=t=>{let e=t.arr[t.pos++],n=63&e,r=64;const o=(64&e)>0?-1:1;if(!(128&e))return o*n;const i=t.arr.length;for(;t.pos<i;){if(e=t.arr[t.pos++],n+=(127&e)*r,r*=128,e<128)return o*n;
1if(n>kd)throw eu}throw tu},lu=Od?t=>Od.decode(ou(t)):t=>{let e=su(t);if(0===e)return"";{let n=String.fromCodePoint(iu(t));if(--e<100)for(;e--;)n+=String.fromCodePoint(iu(t));else for(;e>0;){const r=e<1e4?e:1e4,o=t.arr.subarray(t.pos,t.pos+r);t.pos+=r,n+=String.fromCodePoint.apply(null,o),e-=r}return decodeURIComponent(escape(n))}},cu=(t,e)=>{const n=new DataView(t.arr.buffer,t.arr.byteOffset+t.pos,e);return t.pos+=e,n},du=[t=>{},t=>null,au,t=>cu(t,4).getFloat32(0,!1),t=>cu(t,8).getFloat64(0,!1),t=>cu(t,8).getBigInt64(0,!1),t=>!1,t=>!0,lu,t=>{const e=su(t),n={};for(let r=0;r<e;r++)n[lu(t)]=uu(t);return n},t=>{const e=su(t),n=[];for(let r=0;r<e;r++)n.push(uu(t));return n},ou],uu=t=>du[127-iu(t)](t);class hu extends nu{constructor(t,e){super(t),this.reader=e,this.s=null,this.count=0}read(){return 0===this.count&&(this.s=this.reader(this),(t=this).pos!==t.arr.length?this.count=su(this)+1:this.count=-1),this.count--,this.s;var t}}class pu extends nu{constructor(t){super(t),this.s=0,this.count=0}read(){if(0===this.count){this.s=au(this);const t=Jc(this.s);this.count=1,t&&(this.s=-this.s,this.count=su(this)+2)}return this.count--,this.s}}class fu extends nu{constructor(t){super(t),this.s=0,this.count=0,this.diff=0}read(){if(0===this.count){const t=au(this),e=1&t;this.diff=Uc(t/2),this.count=1,e&&(this.count=su(this)+2)}return this.s+=this.diff,this.count--,this.s}}class gu{constructor(t){this.decoder=new pu(t),this.str=lu(this.decoder),this.spos=0}read(){const t=this.spos+this.decoder.read(),e=this.str.slice(this.spos,t);return this.spos=t,e}}crypto.subtle;const mu=crypto.getRandomValues.bind(crypto),Au=Math.random,yu=()=>mu(new Uint32Array(1))[0],bu=[1e7]+-1e3+-4e3+-8e3+-1e11,vu=()=>bu.replace(/[018]/g,t=>(t^yu()&15>>t/4).toString(16)),wu=t=>new Promise(t),ku=(Promise.all.bind(Promise),t=>void 0===t?null:t);let Cu=new class{constructor(){this.map=new Map}setItem(t,e){this.map.set(t,e)}getItem(t){return this.map.get(t)}},xu=!0;try{"undefined"!=typeof localStorage&&localStorage&&(Cu=localStorage,xu=!1)}catch(t){}const Su=Cu,Eu=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;try{for(;n<t.length;n++)t[n](...e)}finally{n<t.length&&Eu(t,e,n+1)}},Mu=t=>t,Tu=(t,e)=>{if(t===e)return!0;if(null==t||null==e||t.constructor!==e.constructor&&(t.constructor||Object)!==(e.constructor||Object))return!1;if(null!=t[Gc])return t[Gc](e);switch(t.constructor){case ArrayBuffer:t=new Uint8Array(t),e=new Uint8Array(e);case Uint8Array:if(t.byteLength!==e.byteLength)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;break;case Set:if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;break;case Map:if(t.size!==e.size)return!1;for(const n of t.keys())if(!e.has(n)||!Tu(t.get(n),e.get(n)))return!1;break;case void 0:case Object:if(Zc(t)!==Zc(e))return!1;for(const n in t)if(!td(t,n)||!Tu(t[n],e[n]))return!1;break;case Array:if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!Tu(t[n],e[n]))return!1;break;default:return!1}return!0};function _u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}const Du="undefined"!=typeof process&&process.release&&/node|io\.js/.test(process.release.name)&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),Ou="undefined"!=typeof window&&"undefined"!=typeof document&&!Du;let Iu;"undefined"!=typeof navigator&&/Mac/.test(navigator.platform);const Nu=[],Lu=()=>{if(void 0===Iu)if(Du){Iu=ud();const t=process.argv;let e=null;for(let n=0;n<t.length;n++){const r=t[n];"-"===r[0]?(null!==e&&Iu.set(e,""),e=r):null!==e?(Iu.set(e,r),e=null):Nu.push(r)}null!==e&&Iu.set(e,"")}else"object"==typeof location?(Iu=ud(),(location.search||"?").slice(1).split("&").forEach(t=>{if(0!==t.length){const r=(e=t.split("="),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(t){c=!0,o=t}
1finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,n)||function(t,e){if(t){if("string"==typeof t)return _u(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_u(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=r[0],i=r[1];Iu.set(`--${Td(o,"-")}`,i),Iu.set(`-${Td(o,"-")}`,i)}var e,n})):Iu=ud();return Iu},Bu=t=>Lu().has(t),$u=t=>ku(Du?process.env[t.toUpperCase().replaceAll("-","_")]:Su.getItem(t)),Ru=t=>Bu("--"+t)||null!==$u(t),Pu=Ru("production");var Fu;const zu=Du&&(Fu=process.env.FORCE_COLOR,["true","1","2"].includes(Fu))||!Bu("--no-colors")&&!Ru("no-color")&&(!Du||process.stdout.isTTY)&&(!Du||Bu("--color")||null!==$u("COLORTERM")||($u("TERM")||"").includes("color")),Hu=Ou?t=>{let e="";for(let n=0;n<t.byteLength;n++)e+=Sd(t[n]);return btoa(e)}:t=>Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("base64"),ju=t=>(()=>{const e=Ld();return(e=>{Jd(e,t)})(e),Bd(e)})();class Uu{constructor(t,e){this.left=t,this.right=e}}const Vu=(t,e)=>new Uu(t,e),qu=t=>t.next()>=.5,Wu=(t,e,n)=>Uc(t.next()*(n+1-e)+e),Ju=(t,e,n)=>Uc(t.next()*(n+1-e)+e),Gu=(t,e,n)=>Ju(t,e,n),Ku=t=>Sd(Gu(t,97,122)),Yu=(t,e)=>e[Gu(t,0,e.length-1)];let Qu;function Zu(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Xu=Symbol("0schema");class th{constructor(){this._rerrs=[]}extend(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this._rerrs.push({path:t,expected:e,has:n,message:r})}toString(){const t=[];for(let e=this._rerrs.length-1;e>0;e--){const n=this._rerrs[e];t.push(Id(" ",2*(this._rerrs.length-e))+`${null!=n.path?`[${n.path}] `:""}${n.has} doesn't match ${n.expected}. ${n.message}`)}return t.join("\n")}}const eh=(t,e)=>t===e||null!=t&&null!=e&&t.constructor===e.constructor&&(t[Gc]?Kc(t,e):bd(t)?Ad(t,t=>yd(e,e=>eh(t,e))):"object"==typeof t&&Xc(t,(t,n)=>eh(t,e[n])));Qu=Gc;class nh{extends(t){let e=[this.shape,t.shape],n=e[0],r=e[1];if(this.constructor._dilutes){var o=[n,r];r=o[0],n=o[1]}return eh(n,r)}equals(t){return this.constructor===t.constructor&&Tu(this.shape,t.shape)}[Xu](){return!0}[Qu](t){return this.equals(t)}validate(t){return this.check(t)}check(t,e){ad()}get nullable(){return Ih(this,Jh)}get optional(){return new ph(this)}cast(t){return Qh(t,this),t}expect(t){return Qh(t,this),t}}Zu(nh,"_dilutes",!1);class rh extends nh{constructor(t,e){super(),this.shape=t,this._c=e}check(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;const n=(null==t?void 0:t.constructor)===this.shape&&(null==this._c||this._c(t));return!n&&(null==e||e.extend(null,this.shape.name,null==t?void 0:t.constructor.name,(null==t?void 0:t.constructor)!==this.shape?"Constructor match failed":"Check failed")),n}}const oh=function(t){return new rh(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)};oh(rh);class ih extends nh{constructor(t){super(),this.shape=t}check(t,e){const n=this.shape(t);return!n&&(null==e||e.extend(null,"custom prop",null==t?void 0:t.constructor.name,"failed to check custom prop")),n}}const sh=t=>new ih(t);oh(ih);class ah extends nh{constructor(t){super(),this.shape=t}check(t,e){const n=this.shape.some(e=>e===t);return!n&&(null==e||e.extend(null,this.shape.join(" | "),t.toString())),n}}const lh=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new ah(e)},ch=oh(ah),dh=RegExp.escape||(t=>t.replace(/[().|&,$^[\]]/g,t=>"\\"+t)),uh=t=>jh.check(t)?[dh(t)]:ch.check(t)?t.shape.map(t=>t+""):Hh.check(t)?["[+-]?\\d+.?\\d*"]:Uh.check(t)?[".*"]:Nh.check(t)?t.shape.map(uh).flat(1):void ld();oh(class extends nh{constructor(t){super(),this.shape=t,this._r=new RegExp("^"+t.map(uh).map(t=>`(${t.join("|")})`).join("")+"$")}check(t,e){const n=null!=this._r.exec(t);return!n&&(null==e||e.extend(null,this._r.toString(),t.toString(),"String doesn't match string template.")),n}});const hh=Symbol("optional");class ph extends nh{constructor(t){super(),this.shape=t}check(t,e){const n=void 0===t||this.shape.check(t);return!n&&(null==e||e.extend(null,"undefined (optional)","()")),n}get[hh](){return!0}}const fh=oh(ph);class gh extends nh{check(t,e){return null==e||e.extend(null,"never",typeof t),!1}}new gh,oh(gh);class mh extends nh{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super(),this.shape=t,this._isPartial=e}get partial(){return new mh(this.shape,!0)}check(t,e){return null==t?(null==e||e.extend(null,"object","null"),!1):Xc(this.shape,(n,r)=>{const o=this._isPartial&&!td(t,r)||n.check(t[r],e);return!o&&(null==e||e.extend(r.toString(),n.toString(),typeof t[r],"Object property does not match")),o})}}Zu(mh,"_dilutes",!0);const Ah=oh(mh),yh=sh(t=>null!=t&&(t.constructor===Object||null==t.constructor));class bh extends nh{constructor(t,e){super(),this.shape={keys:t,values:e}}check(t,e){return null!=t&&Xc(t,(n,r)=>{const o=this.shape.keys.check(r,e);return!o&&(null==e||e.extend(r+"","Record",typeof t,o?"Key doesn't match sc
1hema":"Value doesn't match value")),o&&this.shape.values.check(n,e)})}}const vh=(t,e)=>new bh(t,e),wh=oh(bh);class kh extends nh{constructor(t){super(),this.shape=t}check(t,e){return null!=t&&Xc(this.shape,(n,r)=>{const o=n.check(t[r],e);return!o&&(null==e||e.extend(r.toString(),"Tuple",typeof n)),o})}}oh(kh);class Ch extends nh{constructor(t){super(),this.shape=1===t.length?t[0]:new Oh(t)}check(t,e){const n=bd(t)&&Ad(t,t=>this.shape.check(t));return!n&&(null==e||e.extend(null,"Array","")),n}}const xh=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Ch(e)},Sh=oh(Ch),Eh=sh(t=>bd(t));class Mh extends nh{constructor(t,e){super(),this.shape=t,this._c=e}check(t,e){const n=t instanceof this.shape&&(null==this._c||this._c(t));return!n&&(null==e||e.extend(null,this.shape.name,null==t?void 0:t.constructor.name)),n}}oh(Mh);const Th=function(t){return new Mh(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)}(nh);const _h=oh(class extends nh{constructor(t){super(),this.len=t.length-1,this.args=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new kh(e)}(...t.slice(-1)),this.res=t[this.len]}check(t,e){const n=t.constructor===Function&&t.length<=this.len;return!n&&(null==e||e.extend(null,"function",typeof t)),n}}),Dh=sh(t=>"function"==typeof t);oh(class extends nh{constructor(t){super(),this.shape=t}check(t,e){const n=Ad(this.shape,n=>n.check(t,e));return!n&&(null==e||e.extend(null,"Intersectinon",typeof t)),n}},t=>t.shape.length>0);class Oh extends nh{constructor(t){super(),this.shape=t}check(t,e){const n=yd(this.shape,n=>n.check(t,e));return null==e||e.extend(null,"Union",typeof t),n}}Zu(Oh,"_dilutes",!0);const Ih=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.findIndex(t=>Nh.check(t))>=0?Ih(...e.map(t=>Yh(t)).map(t=>Nh.check(t)?t.shape:[t]).flat(1)):1===e.length?e[0]:new Oh(e)},Nh=oh(Oh),Lh=()=>!0,Bh=sh(Lh),$h=oh(ih,t=>t.shape===Lh),Rh=sh(t=>"bigint"==typeof t),Ph=sh(t=>t===Rh),Fh=sh(t=>"symbol"==typeof t),zh=(sh(t=>t===Fh),sh(t=>"number"==typeof t)),Hh=sh(t=>t===zh),jh=sh(t=>"string"==typeof t),Uh=sh(t=>t===jh),Vh=sh(t=>"boolean"==typeof t),qh=sh(t=>t===Vh),Wh=lh(void 0),Jh=(oh(ah,t=>1===t.shape.length&&void 0===t.shape[0]),lh(void 0),lh(null)),Gh=oh(ah,t=>1===t.shape.length&&null===t.shape[0]),Kh=(oh(Uint8Array),oh(rh,t=>t.shape===Uint8Array),Ih(zh,jh,Jh,Wh,Rh,Vh,Fh)),Yh=((()=>{const t=xh(Bh),e=vh(jh,Bh),n=Ih(zh,jh,Jh,Vh,t,e);t.shape=n,e.shape.values=n})(),t=>{if(Th.check(t))return t;if(yh.check(t)){const e={};for(const n in t)e[n]=Yh(t[n]);return new mh(e)}return Eh.check(t)?Ih(...t.map(Yh)):Kh.check(t)?lh(t):Dh.check(t)?oh(t):void ld()}),Qh=Pu?()=>{}:(t,e)=>{const n=new th;if(!e.check(t,n))throw sd(`Expected value to be of type ${e.constructor.name}.\n${n.toString()}`)};const Zh=(Xh=Bh,new class{constructor(t){this.patterns=[],this.$state=t}if(t,e){return this.patterns.push({if:Yh(t),h:e}),this}else(t){return this.if(Bh,t)}done(){return(t,e)=>{for(let n=0;n<this.patterns.length;n++){const r=this.patterns[n];if(r.if.check(t))return r.h(t,e)}throw sd("Unhandled pattern")}}}(Xh)).if(Hh,(t,e)=>Wu(e,Cd,kd)).if(Uh,(t,e)=>function(t){const e=Gu(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:20);let n="";for(let r=0;r<e;r++)n+=Ku(t);return n}(e)).if(qh,(t,e)=>qu(e)).if(Ph,(t,e)=>BigInt(Wu(e,Cd,kd))).if(Nh,(t,e)=>tp(e,Yu(e,t.shape))).if(Ah,(t,e)=>{const n={};for(const r in t.shape){let o=t.shape[r];
1if(fh.check(o)){if(qu(e))continue;o=o.shape}n[r]=Zh(o,e)}return n}).if(Sh,(t,e)=>{const n=[],r=Ju(e,0,42);for(let o=0;o<r;o++)n.push(tp(e,t.shape));return n}).if(ch,(t,e)=>Yu(e,t.shape)).if(Gh,(t,e)=>null).if(_h,(t,e)=>{const n=tp(e,t.res);return()=>n}).if($h,(t,e)=>tp(e,Yu(e,[zh,jh,Jh,Wh,Rh,Vh,xh(zh),vh(Ih("a","b","c"),zh)]))).if(wh,(t,e)=>{const n={},r=Wu(e,0,3);for(let o=0;o<r;o++){const r=tp(e,t.shape.keys),o=tp(e,t.shape.values);n[r]=o}return n}).done();var Xh;const tp=(t,e)=>Zh(Yh(e),t),ep="undefined"!=typeof document?document:{},np=(sh(t=>t.nodeType===sp),"undefined"!=typeof DOMParser&&new DOMParser,sh(t=>t.nodeType===rp),sh(t=>t.nodeType===op),t=>((t,e)=>{const n=[];for(const o of t){var r=cd(o,2);const t=r[0],i=r[1];n.push(e(i,t))}return n})(t,(t,e)=>`${e}:${t};`).join("")),rp=ep.ELEMENT_NODE,op=ep.TEXT_NODE,ip=(ep.CDATA_SECTION_NODE,ep.COMMENT_NODE,ep.DOCUMENT_NODE),sp=(ep.DOCUMENT_TYPE_NODE,ep.DOCUMENT_FRAGMENT_NODE),ap=(sh(t=>t.nodeType===ip),Symbol),lp=Date.now,cp=ap(),dp=ap(),up=ap(),hp=ap(),pp=ap(),fp=ap(),gp=ap(),mp=ap(),Ap=ap();lp();const yp={[cp]:Vu("font-weight","bold"),[dp]:Vu("font-weight","normal"),[up]:Vu("color","blue"),[pp]:Vu("color","green"),[hp]:Vu("color","grey"),[fp]:Vu("color","red"),[gp]:Vu("color","purple"),[mp]:Vu("color","orange"),[Ap]:Vu("color","black")},bp=zu?t=>{var e;1===t.length&&(null===(e=t[0])||void 0===e?void 0:e.constructor)===Function&&(t=t[0]());const n=[],r=[],o=ud();let i=[],s=0;for(;s<t.length;s++){const e=t[s],i=yp[e];if(void 0!==i)o.set(i.left,i.right);else{if(void 0===e)break;if(e.constructor!==String&&e.constructor!==Number)break;{const t=np(o);s>0||t.length>0?(n.push("%c"+e),r.push(t)):n.push(e)}}}for(s>0&&(i=r,i.unshift(n.join("")));s<t.length;s++){const e=t[s];e instanceof Symbol||i.push(e)}return i}:t=>{var e;1===t.length&&(null===(e=t[0])||void 0===e?void 0:e.constructor)===Function&&(t=t[0]());const n=[],r=[];let o=0;for(;o<t.length;o++){const e=t[o];if(void 0===e)break;if(e.constructor===String||e.constructor===Number)n.push(e);else if(e.constructor===Object)break}for(o>0&&r.push(n.join(""));o<t.length;o++){const e=t[o];e instanceof Symbol||r.push(e)}return r},vp=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];console.log(...bp(e)),kp.forEach(t=>t.print(e))},wp=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];console.warn(...bp(e)),e.unshift(mp),kp.forEach(t=>t.print(e))},kp=rd(),Cp=t=>({[Symbol.iterator](){return this},next:t}),xp=(t,e)=>Cp(()=>{const n=t.next(),r=n.done,o=n.value;return{done:r,value:r?void 0:e(o)}});class Sp{constructor(t,e){this.clock=t,this.len=e}}class Ep{constructor(){this.clients=new Map}}const Mp=(t,e,n)=>e.clients.forEach((e,r)=>{const o=t.doc.store.clients.get(r);if(null!=o){const r=o[o.length-1],i=r.id.clock+r.length;for(let r=0,s=e[r];r<e.length&&s.clock<i;s=e[++r])Ef(t,o,s.clock,s.len,n)}}),Tp=(t,e)=>{const n=t.clients.get(e.client);return void 0!==n&&null!==((t,e)=>{let n=0,r=t.length-1;for(;n<=r;){const o=Uc((n+r)/2),i=t[o],s=i.clock;if(s<=e){if(e<s+i.len)return o;n=o+1}else r=o-1}return null})(n,e.clock)},_p=t=>{t.clients.forEach(t=>{let e,n;for(t.sort((t,e)=>t.clock-e.clock),e=1,n=1;e<t.length;e++){const r=t[n-1],o=t[e];r.clock+r.len>=o.clock?t[n-1]=new Sp(r.clock,Wc(r.len,o.clock+o.len-r.clock)):(n<e&&(t[n]=o),n++)}t.length=n})},Dp=t=>{const e=new Ep;for(let n=0;n<t.length;n++)t[n].clients.forEach((r,o)=>{if(!e.clients.has(o)){const i=r.slice();for(let e=n+1;e<t.length;e++)gd(i,t[e].clients.get(o)||[]);e.clients.set(o,i)}});return _p(e),e},Op=(t,e,n,r)=>{pd(t.clients,e,()=>[]).push(new Sp(n,r))},Ip=()=>new Ep,Np=t=>{const e=Ip();return t.clients.forEach((t,n)=>{const r=[];for(let e=0;e<t.length;e++){const n=t[e];if(n.deleted){const o=n.id.clock;let i=n.length;if(e+1<t.length)for(let n=t[e+1];e+1<t.length&&n.deleted;n=t[1+ ++e])i+=n.length;r.push(new Sp(o,i))}}r.length>0&&e.clients.set(n,r)}),e},Lp=(t,e)=>{Pd(t.restEncoder,e.clients.size),md(e.clients.entries()).sort((t,e)=>e[0]-t[0]).forEach(([e,n])=>{t.resetDsCurVal(),Pd(t.restEncoder,e);const r=n.length;Pd(t.restEncoder,r);for(let e=0;e<r;e++){const r=n[e];t.writeDsClock(r.clock),t.writeDsLen(r.len)}})},Bp=t=>{const e=new Ep,n=su(t.restDecoder);for(let r=0;r<n;r++){t.resetDsCurVal();const n=su(t.restDecoder),r=su(t.restDecoder);if(r>0){const o=pd(e.clients,n,()=>[]);for(let e=0;e<r;e++)o.push(new Sp(t.readDsClock(),t.readDsLen()))}}return e},$p=(t,e,n)=>{const r=new Ep,o=su(t.restDecoder);for(let i=0;i<o;i++){t.resetDsCurVal();const o=su(t.restDecoder),i=su(t.restDecoder),s=n.clients.get(o)||[],a=bf(n,o);for(let n=0;n<i;n++){const n=t.readDsClock(),i=n+t.readDsLen();if(n<a){a<i&&Op(r,o,a,i-a);let t=wf(s,n),l=s[t];for(!l.deleted&&l.id.clock<n&&(s.splice(t+1,0,ym(e,l,n-l.id.clock)),t++);t<s.length&&(l=s[t++],l.id.clock<i);)l.deleted||(i<l.id.clock+l.length&&s.splice(t,0,ym(e,l,i-l.id.clock)),l.delete(e))}else Op(r,o,n,i-n)}}if(r.clients.size>0){const t=new Wp;return Pd(t.restEncoder,0),Lp(t,r),t.toUint8Array()}return null},Rp=yu;class Pp extends vd{constructor({guid:t=vu(),collectionid:e=null,gc:n=!0,gcFilter:r=()=>!0,meta:o=null,autoLoad:i=!1,shouldLoad:s=!0}={}){super(),this.gc=n,this.gcFilter=r,this.clientID=Rp(),this.guid=t,this.collectionid=e,this.share=new Map,this.store=new Af,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=s,this.autoLoad=i,this.meta=o,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=wu(t=>{this.on("load",()=>{this.isLoaded=!0,t(this)})});const a=()=>wu(t=>{const e=n=>{void 0!==n&&!0!==n||(this.off("sync",e),t())};this.on("sync",e)});this.on("sync",t=>{!1===t&&this.isSynced&&(this.whenSynced=a()),this.isSynced=void 0===t||!0===t,this.isSynced&&!this.isLoaded&&this.emit
1("load",[this])}),this.whenSynced=a()}load(){const t=this._item;null===t||this.shouldLoad||If(t.parent.doc,t=>{t.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(md(this.subdocs).map(t=>t.guid))}transact(t,e=null){return If(this,t,e)}get(t,e=ig){const n=pd(this.share,t,()=>{const t=new e;return t._integrate(this,null),t}),r=n.constructor;if(e!==ig&&r!==e){if(r===ig){const r=new e;r._map=n._map,n._map.forEach(t=>{for(;null!==t;t=t.left)t.parent=r}),r._start=n._start;for(let t=r._start;null!==t;t=t.right)t.parent=r;return r._length=n._length,this.share.set(t,r),r._integrate(this,null),r}throw new Error(`Type with the name ${t} has already been defined with a different constructor`)}return n}getArray(t=""){return this.get(t,xg)}getText(t=""){return this.get(t,jg)}getMap(t=""){return this.get(t,Eg)}getXmlElement(t=""){return this.get(t,qg)}getXmlFragment(t=""){return this.get(t,Vg)}toJSON(){const t={};return this.share.forEach((e,n)=>{t[n]=e.toJSON()}),t}destroy(){this.isDestroyed=!0,md(this.subdocs).forEach(t=>t.destroy());const t=this._item;if(null!==t){this._item=null;const e=t.content;e.doc=new Pp({guid:this.guid,...e.opts,shouldLoad:!1}),e.doc._item=t,If(t.parent.doc,n=>{const r=e.doc;t.deleted||n.subdocsAdded.add(r),n.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class Fp{constructor(t){this.restDecoder=t}resetDsCurVal(){}readDsClock(){return su(this.restDecoder)}readDsLen(){return su(this.restDecoder)}}class zp extends Fp{readLeftID(){return of(su(this.restDecoder),su(this.restDecoder))}readRightID(){return of(su(this.restDecoder),su(this.restDecoder))}readClient(){return su(this.restDecoder)}readInfo(){return iu(this.restDecoder)}readString(){return lu(this.restDecoder)}readParentInfo(){return 1===su(this.restDecoder)}readTypeRef(){return su(this.restDecoder)}readLen(){return su(this.restDecoder)}readAny(){return uu(this.restDecoder)}readBuf(){return(t=>{const e=(n=t.byteLength,new Uint8Array(n));var n;return e.set(t),e})(ou(this.restDecoder))}readJSON(){return JSON.parse(lu(this.restDecoder))}readKey(){return lu(this.restDecoder)}}class Hp{constructor(t){this.dsCurrVal=0,this.restDecoder=t}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=su(this.restDecoder),this.dsCurrVal}readDsLen(){const t=su(this.restDecoder)+1;return this.dsCurrVal+=t,t}}class jp extends Hp{constructor(t){super(t),this.keys=[],su(t),this.keyClockDecoder=new fu(ou(t)),this.clientDecoder=new pu(ou(t)),this.leftClockDecoder=new fu(ou(t)),this.rightClockDecoder=new fu(ou(t)),this.infoDecoder=new hu(ou(t),iu),this.stringDecoder=new gu(ou(t)),this.parentInfoDecoder=new hu(ou(t),iu),this.typeRefDecoder=new pu(ou(t)),this.lenDecoder=new pu(ou(t))}readLeftID(){return new nf(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new nf(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return 1===this.parentInfoDecoder.read()}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return uu(this.restDecoder)}readBuf(){return ou(this.restDecoder)}readJSON(){return uu(this.restDecoder)}readKey(){const t=this.keyClockDecoder.read();if(t<this.keys.length)return this.keys[t];{const t=this.stringDecoder.read();return this.keys.push(t),t}}}class Up{constructor(){this.restEncoder=Ld()}toUint8Array(){return Bd(this.restEncoder)}resetDsCurVal(){}writeDsClock(t){Pd(this.restEncoder,t)}writeDsLen(t){Pd(this.restEncoder,t)}}class Vp extends Up{writeLeftID(t){Pd(this.restEncoder,t.client),Pd(this.restEncoder,t.clock)}writeRightID(t){Pd(this.restEncoder,t.client),Pd(this.restEncoder,t.clock)}writeClient(t){Pd(this.restEncoder,t)}writeInfo(t){Rd(this.restEncoder,t)}writeString(t){jd(this.restEncoder,t)}writeParentInfo(t){Pd(this.restEncoder,t?1:0)}writeTypeRef(t){Pd(this.restEncoder,t)}writeLen(t){Pd(this.restEncoder,t)}writeAny(t){Jd(this.restEncoder,t)}writeBuf(t){Vd(this.restEncoder,t)}writeJSON(t){jd(this.restEncoder,JSON.stringify(t))}writeKey(t){jd(this.restEncoder,t)}}class qp{constructor(){this.restEncoder=Ld(),this.dsCurrVal=0}toUint8Array(){return Bd(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(t){const e=t-this.dsCurrVal;this.dsCurrVal=t,Pd(this.restEncoder,e)}writeDsLen(t){0===t&&ld(),Pd(this.restEncoder,t-1),this.dsCurrVal+=t}}class Wp extends qp{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Zd,this.clientEncoder=new Yd,this.leftClockEncoder=new Zd,this.rightClockEncoder=new Zd,this.infoEncoder=new Gd(Rd),this.stringEncoder=new Xd,this.parentInfoEncoder=new Gd(Rd),this.typeRefEncoder=new Yd,this.lenEncoder=new Yd}toUint8Array(){const t=Ld();return Pd(t,0),Vd(t,this.keyClockEncoder.toUint8Array()),Vd(t,this.clientEncoder.toUint8Array()),Vd(t,this.leftClockEncoder.toUint8Array()),Vd(t,this.rightClockEncoder.toUint8Array()),Vd(t,Bd(this.infoEncoder)),Vd(t,this.stringEncoder.toUint8Array()),Vd(t,Bd(this.parentInfoEncoder)),Vd(t,this.typeRefEncoder.toUint8Array()),Vd(t,this.lenEncoder.toUint8Array()),Ud(t,Bd(this.restEncoder)),Bd(t)}writeLeftID(t){this.clientEncoder.write(t.client),this.leftClockEncoder.write(t.clock)}writeRightID(t){this.clientEncoder.write(t.client),this.rightClockEncoder.write(t.clock)}writeClient(t){this.clientEncoder.write(t)}writeInfo(t){this.infoEncoder.write(t)}writeString(t){this.stringEncoder.write(t)}writeParentInfo(t){this.parentInfoEncoder.write(t?1:0)}writeTypeRef(t){this.typeRefEncoder.write(t)}writeLen(t){this.lenEncoder.write(t)}writeAny(t){Jd(this.restEncoder,t)}writeBuf(t){Vd(this.restEncoder,t)}writeJSON(t){Jd(this.restEncoder,t)}writeKey(t){const e=this.keyMap.get(t);void 0===e?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(t)):this.keyClockEncoder.write(e)}}const Jp=(t,e,n)=>{const r=new Map;
1n.forEach((t,n)=>{bf(e,n)>t&&r.set(n,t)}),yf(e).forEach((t,e)=>{n.has(e)||r.set(e,0)}),Pd(t.restEncoder,r.size),md(r.entries()).sort((t,e)=>e[0]-t[0]).forEach(([n,r])=>{((t,e,n,r)=>{r=Wc(r,e[0].id.clock);const o=wf(e,r);Pd(t.restEncoder,e.length-o),t.writeClient(n),Pd(t.restEncoder,r);const i=e[o];i.write(t,r-i.id.clock);for(let n=o+1;n<e.length;n++)e[n].write(t,0)})(t,e.clients.get(n),n,r)})},Gp=(t,e,n,r=jp)=>{const o=ru(e);((t,e,n,r=new jp(t))=>{If(e,t=>{t.local=!1;let e=!1;const n=t.doc,o=n.store,i=((t,e)=>{const n=ud(),r=su(t.restDecoder);for(let o=0;o<r;o++){const r=su(t.restDecoder),o=new Array(r),i=t.readClient();let s=su(t.restDecoder);n.set(i,{i:0,refs:o});for(let n=0;n<r;n++){const r=t.readInfo();switch(31&r){case 0:{const e=t.readLen();o[n]=new Yg(of(i,s),e),s+=e;break}case 10:{const e=su(t.restDecoder);o[n]=new xm(of(i,s),e),s+=e;break}default:{const a=!(192&r),l=new wm(of(i,s),null,128&~r?null:t.readLeftID(),null,64&~r?null:t.readRightID(),a?t.readParentInfo()?e.get(t.readString()):t.readLeftID():null,!a||32&~r?null:t.readString(),km(t,r));o[n]=l,s+=l.length}}}}return n})(r,n),s=((t,e,n)=>{const r=[];let o=md(n.keys()).sort((t,e)=>t-e);if(0===o.length)return null;const i=()=>{if(0===o.length)return null;let t=n.get(o[o.length-1]);for(;t.refs.length===t.i;){if(o.pop(),!(o.length>0))return null;t=n.get(o[o.length-1])}return t};let s=i();if(null===s)return null;const a=new Af,l=new Map,c=(t,e)=>{const n=l.get(t);(null==n||n>e)&&l.set(t,e)};let d=s.refs[s.i++];const u=new Map,h=()=>{for(const t of r){const e=t.id.client,r=n.get(e);r?(r.i--,a.clients.set(e,r.refs.slice(r.i)),n.delete(e),r.i=0,r.refs=[]):a.clients.set(e,[t]),o=o.filter(t=>t!==e)}r.length=0};for(;;){if(d.constructor!==xm){const o=pd(u,d.id.client,()=>bf(e,d.id.client))-d.id.clock;if(o<0)r.push(d),c(d.id.client,d.id.clock-1),h();else{const i=d.getMissing(t,e);if(null!==i){r.push(d);const t=n.get(i)||{refs:[],i:0};if(t.refs.length!==t.i){d=t.refs[t.i++];continue}c(i,bf(e,i)),h()}else(0===o||o<d.length)&&(d.integrate(t,o),u.set(d.id.client,d.id.clock+d.length))}}if(r.length>0)d=r.pop();else if(null!==s&&s.i<s.refs.length)d=s.refs[s.i++];else{if(s=i(),null===s)break;d=s.refs[s.i++]}}if(a.clients.size>0){const t=new Wp;return Jp(t,a,new Map),Pd(t.restEncoder,0),{missing:l,update:t.toUint8Array()}}return null})(t,o,i),a=o.pendingStructs;if(a){for(const[t,n]of a.missing)if(n<bf(o,t)){e=!0;break}if(s){for(const[t,e]of s.missing){const n=a.missing.get(t);(null==n||n>e)&&a.missing.set(t,e)}a.update=Uf([a.update,s.update])}}else o.pendingStructs=s;const l=$p(r,t,o);if(o.pendingDs){const e=new jp(ru(o.pendingDs));su(e.restDecoder);const n=$p(e,t,o);o.pendingDs=l&&n?Uf([l,n]):l||n}else o.pendingDs=l;if(e){const e=o.pendingStructs.update;o.pendingStructs=null,Gp(t.doc,e)}},n,!1)})(o,t,n,new r(o))},Kp=(t,e,n)=>Gp(t,e,n,zp),Yp=t=>(t=>{const e=new Map,n=su(t.restDecoder);for(let r=0;r<n;r++){const n=su(t.restDecoder),r=su(t.restDecoder);e.set(n,r)}return e})(new Fp(ru(t)));class Qp{constructor(){this.l=[]}}const Zp=()=>new Qp,Xp=(t,e)=>t.l.push(e),tf=(t,e)=>{const n=t.l,r=n.length;t.l=n.filter(t=>e!==t),r===t.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},ef=(t,e,n)=>Eu(t.l,[e,n]);class nf{constructor(t,e){this.client=t,this.clock=e}}const rf=(t,e)=>t===e||null!==t&&null!==e&&t.client===e.client&&t.clock===e.clock,of=(t,e)=>new nf(t,e),sf=t=>{for(const[e,n]of t.doc.share.entries())if(n===t)return e;throw ld()},af=(t,e)=>{for(;null!==e;){if(e.parent===t)return!0;e=e.parent._item}return!1};class lf{constructor(t,e,n,r=0){this.type=t,this.tname=e,this.item=n,this.assoc=r}}class cf{constructor(t,e,n=0){this.type=t,this.index=e,this.assoc=n}}const df=(t,e,n)=>{let r=null,o=null;return null===t._item?o=sf(t):r=of(t._item.id.client,t._item.id.clock),new lf(r,o,e,n)},uf=(t,e,n=0)=>{let r=t._start;if(n<0){if(0===e)return df(t,null,n);e--}for(;null!==r;){if(!r.deleted&&r.countable){if(r.length>e)return df(t,of(r.id.client,r.id.clock+e),n);e-=r.length}if(null===r.right&&n<0)return df(t,r.lastId,n);r=r.right}return df(t,null,n)};class hf{constructor(t,e){this.ds=t,this.sv=e}}const pf=(t,e)=>new hf(t,e),ff=(pf(Ip(),new Map),t=>pf(Np(t.store),yf(t.store))),gf=(t,e)=>void 0===e?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!Tp(e.ds,t.id),mf=(t,e)=>{const n=pd(t.meta,mf,rd),r=t.doc.store;n.has(e)||(e.sv.forEach((e,n)=>{e<bf(r,n)&&xf(t,of(n,e))}),Mp(t,e.ds,t=>{}),n.add(e))};class Af{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const yf=t=>{const e=new Map;
1return t.clients.forEach((t,n)=>{const r=t[t.length-1];e.set(n,r.id.clock+r.length)}),e},bf=(t,e)=>{const n=t.clients.get(e);if(void 0===n)return 0;const r=n[n.length-1];return r.id.clock+r.length},vf=(t,e)=>{let n=t.clients.get(e.id.client);if(void 0===n)n=[],t.clients.set(e.id.client,n);else{const t=n[n.length-1];if(t.id.clock+t.length!==e.id.clock)throw ld()}n.push(e)},wf=(t,e)=>{let n=0,r=t.length-1,o=t[r],i=o.id.clock;if(i===e)return r;let s=Uc(e/(i+o.length-1)*r);for(;n<=r;){if(o=t[s],i=o.id.clock,i<=e){if(e<i+o.length)return s;n=s+1}else r=s-1;s=Uc((n+r)/2)}throw ld()},kf=(t,e)=>{const n=t.clients.get(e.client);return n[wf(n,e.clock)]},Cf=(t,e,n)=>{const r=wf(e,n),o=e[r];return o.id.clock<n&&o instanceof wm?(e.splice(r+1,0,ym(t,o,n-o.id.clock)),r+1):r},xf=(t,e)=>{const n=t.doc.store.clients.get(e.client);return n[Cf(t,n,e.clock)]},Sf=(t,e,n)=>{const r=e.clients.get(n.client),o=wf(r,n.clock),i=r[o];return n.clock!==i.id.clock+i.length-1&&i.constructor!==Yg&&r.splice(o+1,0,ym(t,i,n.clock-i.id.clock+1)),i},Ef=(t,e,n,r,o)=>{if(0===r)return;const i=n+r;let s,a=Cf(t,e,n);do{s=e[a++],i<s.id.clock+s.length&&Cf(t,e,i),o(s)}while(a<e.length&&e[a].id.clock<i)};class Mf{constructor(t,e,n){this.doc=t,this.deleteSet=new Ep,this.beforeState=yf(t.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=e,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const Tf=(t,e)=>!(0===e.deleteSet.clients.size&&!((t,e)=>{for(const r of t){var n=cd(r,2);const t=n[0];if(e(n[1],t))return!0}return!1})(e.afterState,(t,n)=>e.beforeState.get(n)!==t)||(_p(e.deleteSet),((t,e)=>{Jp(t,e.doc.store,e.beforeState)})(t,e),Lp(t,e.deleteSet),0)),_f=(t,e,n)=>{const r=e._item;(null===r||r.id.clock<(t.beforeState.get(r.id.client)||0)&&!r.deleted)&&pd(t.changed,e,rd).add(n)},Df=(t,e)=>{let n=t[e],r=t[e-1],o=e;for(;o>0&&r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n);n=r,r=t[--o-1])n instanceof wm&&null!==n.parentSub&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);const i=e-o;return i&&t.splice(e+1-i,i),i},Of=(t,e)=>{if(e<t.length){const n=t[e],r=n.doc,o=r.store,i=n.deleteSet,s=n._mergeStructs;try{_p(i),n.afterState=yf(n.doc.store),r.emit("beforeObserverCalls",[n,r]);const t=[];n.changed.forEach((e,r)=>t.push(()=>{null!==r._item&&r._item.deleted||r._callObserver(n,e)})),t.push(()=>{n.changedParentTypes.forEach((e,r)=>{r._dEH.l.length>0&&(null===r._item||!r._item.deleted)&&((e=e.filter(t=>null===t.target._item||!t.target._item.deleted)).forEach(t=>{t.currentTarget=r,t._path=null}),e.sort((t,e)=>t.path.length-e.path.length),t.push(()=>{ef(r._dEH,e,n)}))}),t.push(()=>r.emit("afterTransaction",[n,r])),t.push(()=>{n._needFormattingCleanup&&Fg(n)})}),Eu(t,[])}finally{r.gc&&((t,e,n)=>{for(const[r,o]of t.clients.entries()){const t=e.clients.get(r);for(let r=o.length-1;r>=0;r--){const i=o[r],s=i.clock+i.len;for(let r=wf(t,i.clock),o=t[r];r<t.length&&o.id.clock<s;o=t[++r]){const o=t[r];if(i.clock+i.len<=o.id.clock)break;o instanceof wm&&o.deleted&&!o.keep&&n(o)&&o.gc(e,!1)}}}})(i,o,r.gcFilter),((t,e)=>{t.clients.forEach((t,n)=>{const r=e.clients.get(n);for(let e=t.length-1;e>=0;e--){const n=t[e];for(let t=qc(r.length-1,1+wf(r,n.clock+n.len-1)),e=r[t];t>0&&e.id.clock>=n.clock;e=r[t])t-=1+Df(r,t)}})})(i,o),n.afterState.forEach((t,e)=>{const r=n.beforeState.get(e)||0;if(r!==t){const t=o.clients.get(e),n=Wc(wf(t,r),1);for(let e=t.length-1;e>=n;)e-=1+Df(t,e)}});for(let t=s.length-1;t>=0;t--){const{client:e,clock:n}=s[t].id,r=o.clients.get(e),i=wf(r,n);i+1<r.length&&Df(r,i+1)>1||i>0&&Df(r,i)}if(n.local||n.afterState.get(r.clientID)===n.beforeState.get(r.clientID)||(vp(mp,cp,"[yjs] ",dp,fp,"Changed the client-id because another client seems to be using it."),r.clientID=Rp()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const t=new Vp;Tf(t,n)&&r.emit("update",[t.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const t=new Wp;Tf(t,n)&&r.emit("updateV2",[t.toUint8Array(),n.origin,r,n])}const{subdocsAdded:a,subdocsLoaded:l,subdocsRemoved:c}=n;(a.size>0||c.size>0||l.size>
10)&&(a.forEach(t=>{t.clientID=r.clientID,null==t.collectionid&&(t.collectionid=r.collectionid),r.subdocs.add(t)}),c.forEach(t=>r.subdocs.delete(t)),r.emit("subdocs",[{loaded:l,added:a,removed:c},r,n]),c.forEach(t=>t.destroy())),t.length<=e+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,t])):Of(t,e+1)}}},If=(t,e,n=null,r=!0)=>{const o=t._transactionCleanups;let i=!1,s=null;null===t._transaction&&(i=!0,t._transaction=new Mf(t,n,r),o.push(t._transaction),1===o.length&&t.emit("beforeAllTransactions",[t]),t.emit("beforeTransaction",[t._transaction,t]));try{s=e(t._transaction)}finally{if(i){const e=t._transaction===o[0];t._transaction=null,e&&Of(o,0)}}return s};class Nf{constructor(t,e){this.insertions=e,this.deletions=t,this.meta=new Map}}const Lf=(t,e,n)=>{Mp(t,n.deletions,n=>{n instanceof wm&&e.scope.some(e=>e===t.doc||af(e,n))&&Am(n,!1)})},Bf=(t,e,n)=>{let r=null;const o=t.doc,i=t.scope;If(o,n=>{for(;e.length>0&&null===t.currStackItem;){const r=o.store,s=e.pop(),a=new Set,l=[];let c=!1;Mp(n,s.insertions,t=>{if(t instanceof wm){if(null!==t.redone){let{item:e,diff:o}=mm(r,t.id);o>0&&(e=xf(n,of(e.id.client,e.id.clock+o))),t=e}!t.deleted&&i.some(e=>e===n.doc||af(e,t))&&l.push(t)}}),Mp(n,s.deletions,t=>{t instanceof wm&&i.some(e=>e===n.doc||af(e,t))&&!Tp(s.insertions,t.id)&&a.add(t)}),a.forEach(e=>{c=null!==vm(n,e,a,s.insertions,t.ignoreRemoteMapChanges,t)||c});for(let e=l.length-1;e>=0;e--){const r=l[e];t.deleteFilter(r)&&(r.delete(n),c=!0)}t.currStackItem=c?s:null}n.changed.forEach((t,e)=>{t.has(null)&&e._searchMarker&&(e._searchMarker.length=0)}),r=n},t);const s=t.currStackItem;if(null!=s){const e=r.changedParentTypes;t.emit("stack-item-popped",[{stackItem:s,type:n,changedParentTypes:e,origin:t},t]),t.currStackItem=null}return s};class $f extends vd{constructor(t,{captureTimeout:e=500,captureTransaction:n=t=>!0,deleteFilter:r=()=>!0,trackedOrigins:o=new Set([null]),ignoreRemoteMapChanges:i=!1,doc:s=(bd(t)?t[0].doc:t instanceof Pp?t:t.doc)}={}){super(),this.scope=[],this.doc=s,this.addToScope(t),this.deleteFilter=r,o.add(this),this.trackedOrigins=o,this.captureTransaction=n,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=i,this.captureTimeout=e,this.afterTransactionHandler=t=>{if(!(this.captureTransaction(t)&&this.scope.some(e=>t.changedParentTypes.has(e)||e===this.doc)&&(this.trackedOrigins.has(t.origin)||t.origin&&this.trackedOrigins.has(t.origin.constructor))))return;const e=this.undoing,n=this.redoing,r=e?this.redoStack:this.undoStack;e?this.stopCapturing():n||this.clear(!1,!0);const o=new Ep;t.afterState.forEach((e,n)=>{const r=t.beforeState.get(n)||0,i=e-r;i>0&&Op(o,n,r,i)});const i=lp();let s=!1;if(this.lastChange>0&&i-this.lastChange<this.captureTimeout&&r.length>0&&!e&&!n){const e=r[r.length-1];e.deletions=Dp([e.deletions,t.deleteSet]),e.insertions=Dp([e.insertions,o])}else r.push(new Nf(t.deleteSet,o)),s=!0;e||n||(this.lastChange=i),Mp(t,t.deleteSet,e=>{e instanceof wm&&this.scope.some(n=>n===t.doc||af(n,e))&&Am(e,!0)});const a=[{stackItem:r[r.length-1],origin:t.origin,type:e?"redo":"undo",changedParentTypes:t.changedParentTypes},this];s?this.emit("stack-item-added",a):this.emit("stack-item-updated",a)},this.destroy=this.destroy.bind(this),this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",this.destroy)}addToScope(t){const e=new Set(this.scope);(t=bd(t)?t:[t]).forEach(t=>{e.has(t)||(e.add(t),(t instanceof ig?t.doc!==this.doc:t!==this.doc)&&wp("[yjs#509] Not same Y.Doc"),this.scope.push(t))})}addTrackedOrigin(t){this.trackedOrigins.add(t)}removeTrackedOrigin(t){this.trackedOrigins.delete(t)}clear(t=!0,e=!0){(t&&this.canUndo()||e&&this.canRedo())&&this.doc.transact(n=>{t&&(this.undoStack.forEach(t=>Lf(n,this,t)),this.undoStack=[]),e&&(this.redoStack.forEach(t=>Lf(n,this,t)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:t,redoStackCleared:e}])})}stopCapturing(){this.lastChange=0}undo(){let t;this.undoing=!0;try{t=Bf(this,this.undoStack,"undo")}finally{this.undoing=!1}return t}redo(){let t;this.redoing=!0;try{t=Bf(this,this.redoStack,"redo")}finally{this.redoing=!1}return t}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),this.doc.off("destroy",this.destroy),super.destroy()}}class Rf{constructor(t,e){this.gen=function*(t){const e=su(t.restDecoder);for(let n=0;n<e;n++){const e=su(t.restDecoder),n=t.readClient();let r=su(t.restDecoder);for(let o=0;o<e;o++){const e=t.readInfo();if(10===e){const e=su(t.restDecoder);yield new xm(of(n,r),e),r+=e}else if(31&e){const o=!(192&e),i=new wm(of(n,r),null,128&~e?null:t.readLeftID(),null,64&~e?null:t.readRightID(),o?t.readParentInfo()?t.readString():t.readLeftID():null,!o||32&~e?null:t.readString(),km(t,e));yield i,r+=i.length}else{const e=t.readLen();yield new Yg(of(n,r),e),r+=e}}}}(t),this.curr=null,this.done=!1,this.filterSkips=e,this.next()}next(){do{this.curr=this.gen.next().value||null}while(this.filterSkips&&null!==this.curr&&this.curr.constructor===xm);return this.curr}}const Pf=t=>Ff(t,zp),Ff=(t,e=jp)=>{const n=[],r=new e(ru(t)),o=new Rf(r,!1);for(let t=o.curr;null!==t;t=o.next())n.push(t);return{structs:n,ds:Bp(r)}};class zf{constructor(t){this.currClient=0,this.startClock=0,this.written=0,this.encoder=t,this.clientStructs=[]}}const Hf=t=>Uf(t,zp,Vp),jf=(t,e)=>{if(t.constructor===Yg){const{client:n,clock:r}=t.id;return new Yg(of(n,r+e),t.length-e)}if(t.constructor===xm){const{client:n,clock:r}=t.id;return new xm(of(n,r+e),t.length-e)}{const n=t,{client:r,clock:o}=n.id;return new wm(of(r,o+e),null,of(r,o+e-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(e))}},Uf=(t,e=jp,n=Wp)=>{if(1===t.length)return t[0];const r=t.map(t=>new e(ru(t)));let o=r.map(t=>new Rf(t,!0)),i=null;const s=new n,a=new zf(s);for(;o=o.filter(t=>null!==t.curr),o.sort((t,e)=>{if(t.curr.id.client===e.curr.id.client){const n=t.curr.id.clock-e.curr.id.clock;return 0===n?t.curr.constructor===e.curr.constructor?0:t.curr.constructor===xm?1:-1:n}return e.curr.id.client-t.curr.id.client}),0!==o.length;){const t=o[0],e=t.curr.id.client;if(null!==i){let n=t.curr,r=!1;for(;null!==n&&n.id.clock+n.length<=i.struct.id.clock+i.struct.length&&n.id.client>=i.struct.id.client;)n=t.next(),r=!0;if(null===n||n.id.client!==e||r&&n.id.clock>i.struct.id.clock+i.struct.length)continue;if(e!==i.struct.id.client)Wf(a,i.struct,i.offset),i={struct:n,offset:0},t.next();else if(i.struct.id.clock+i.struct.length<n.id.clock)if(i.struct.constructor===xm)i.struct.length=n.id.clock+n.length-i.struct.id.clock;else{Wf(a,i.struct,i.offset);const t=n.id.clock-i.struct.id.clock-i.struct.length;i={struct:new xm(of(e,i.struct.id.clock+i.struct.length),t),offset:0}}else{const e=i.struct.id.clock+i.struct.length-n.id.clock;e>0&&(i.struct.constructor===xm?i.struct.length-=e:n=jf(n,e)),i.struct.mergeWith(n)||(Wf(a,i.struct,i.offset),i={struct:n,offset:0},t.next())}}else i={struct:t.curr,offset:0},t.next();for(let n=t.curr;null!==n&&n.id.client===e&&n.id.clock===i.struct.id.clock+i.struct.length&&n.constructor!==xm;n=t.next())Wf(a,i.struct,i.offset),i={struct:n,offset:0}}null!==i&&(Wf(a,i.struct,i.offset),i=null),Jf(a);const l=r.map(t=>Bp(t)),c=Dp(l);return Lp(s,c),s.toUint8Array()},Vf=(t,e,n=jp,r=Wp)=>{const o=Yp(e),i=new r,s=new zf(i),a=new n(ru(t)),l=new Rf(a,!1);for(;l.curr;){const t=l.curr,e=t.id.client,n=o.get(e)||0;if(l.curr.constructor!==xm)if(t.id.clock+t.length>n)for(Wf(s,t,Wc(n-t.id.clock,0)),l.next();l.curr&&l.curr.id.client===e;)Wf(s,l.curr,0),l.next();else for(;l.curr&&l.curr.id.client===e&&l.curr.id.clock+l.curr.length<=n;)l.next();else l.next()}Jf(s);const c=Bp(a);return Lp(i,c),i.toUint8Array()},qf=t=>{t.written>0&&(t.clientStructs.push({written:t.written,restEncoder:Bd(t.encoder.restEncoder)}),t.encoder.restEncoder=Ld(),t.written=0)},Wf=(t,e,n)=>{t.written>0&&t.currClient!==e.id.client&&qf(t),0===t.written&&(t.currClient=e.id.client,t.encoder.writeClient(e.id.client),Pd(t.encoder.restEncoder,e.id.clock+n)),e.write(t.encoder,n),t.written++}
1,Jf=t=>{qf(t);const e=t.encoder.restEncoder;Pd(e,t.clientStructs.length);for(let n=0;n<t.clientStructs.length;n++){const r=t.clientStructs[n];Pd(e,r.written),Ud(e,r.restEncoder)}},Gf=t=>((t,e,n,r)=>{const o=new n(ru(t)),i=new Rf(o,!1),s=new r,a=new zf(s);for(let t=i.curr;null!==t;t=i.next())Wf(a,e(t),0);Jf(a);const l=Bp(o);return Lp(s,l),s.toUint8Array()})(t,Mu,jp,Vp),Kf="You must not compute changes after the event-handler fired.";class Yf{constructor(t,e){this.target=t,this.currentTarget=t,this.transaction=e,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=Qf(this.currentTarget,this.target))}deletes(t){return Tp(this.transaction.deleteSet,t.id)}get keys(){if(null===this._keys){if(0===this.transaction.doc._transactionCleanups.length)throw sd(Kf);const t=new Map,e=this.target;this.transaction.changed.get(e).forEach(n=>{if(null!==n){const r=e._map.get(n);let o,i;if(this.adds(r)){let t=r.left;for(;null!==t&&this.adds(t);)t=t.left;if(this.deletes(r)){if(null===t||!this.deletes(t))return;o="delete",i=fd(t.content.getContent())}else null!==t&&this.deletes(t)?(o="update",i=fd(t.content.getContent())):(o="add",i=void 0)}else{if(!this.deletes(r))return;o="delete",i=fd(r.content.getContent())}t.set(n,{action:o,oldValue:i})}}),this._keys=t}return this._keys}get delta(){return this.changes.delta}adds(t){return t.id.clock>=(this.transaction.beforeState.get(t.id.client)||0)}get changes(){let t=this._changes;if(null===t){if(0===this.transaction.doc._transactionCleanups.length)throw sd(Kf);const e=this.target,n=rd(),r=rd(),o=[];if(t={added:n,deleted:r,delta:o,keys:this.keys},this.transaction.changed.get(e).has(null)){let t=null;const i=()=>{t&&o.push(t)};for(let o=e._start;null!==o;o=o.right)o.deleted?this.deletes(o)&&!this.adds(o)&&(null!==t&&void 0!==t.delete||(i(),t={delete:0}),t.delete+=o.length,r.add(o)):this.adds(o)?(null!==t&&void 0!==t.insert||(i(),t={insert:[]}),t.insert=t.insert.concat(o.content.getContent()),n.add(o)):(null!==t&&void 0!==t.retain||(i(),t={retain:0}),t.retain+=o.length);null!==t&&void 0===t.retain&&i()}this._changes=t}return t}}const Qf=(t,e)=>{const n=[];for(;null!==e._item&&e!==t;){if(null!==e._item.parentSub)n.unshift(e._item.parentSub);else{let t=0,r=e._item.parent._start;for(;r!==e._item&&null!==r;)!r.deleted&&r.countable&&(t+=r.length),r=r.right;n.unshift(t)}e=e._item.parent}return n},Zf=()=>{wp("Invalid access: Add Yjs type to a document before reading data.")};let Xf=0;class tg{constructor(t,e){t.marker=!0,this.p=t,this.index=e,this.timestamp=Xf++}}const eg=(t,e,n)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=n,t.timestamp=Xf++},ng=(t,e)=>{if(null===t._start||0===e||null===t._searchMarker)return null;const n=0===t._searchMarker.length?null:t._searchMarker.reduce((t,n)=>Vc(e-t.index)<Vc(e-n.index)?t:n);let r=t._start,o=0;for(null!==n&&(r=n.p,o=n.index,(t=>{t.timestamp=Xf++})(n));null!==r.right&&o<e;){if(!r.deleted&&r.countable){if(e<o+r.length)break;o+=r.length}r=r.right}for(;null!==r.left&&o>e;)r=r.left,!r.deleted&&r.countable&&(o-=r.length);for(;null!==r.left&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(o-=r.length);return null!==n&&Vc(n.index-o)<r.parent.length/80?(eg(n,r,o),n):((t,e,n)=>{if(t.length>=80){const r=t.reduce((t,e)=>t.timestamp<e.timestamp?t:e);return eg(r,e,n),r}{const r=new tg(e,n);return t.push(r),r}})(t._searchMarker,r,o)},rg=(t,e,n)=>{for(let r=t.length-1;r>=0;r--){const o=t[r];if(n>0){let e=o.p;for(e.marker=!1;e&&(e.deleted||!e.countable);)e=e.left,e&&!e.deleted&&e.countable&&(o.index-=e.length);if(null===e||!0===e.marker){t.splice(r,1);continue}o.p=e,e.marker=!0}(e<o.index||n>0&&e===o.index)&&(o.index=Wc(e,o.index+n))}},og=(t,e,n)=>{const r=t,o=e.changedParentTypes;for(;pd(o,t,()=>[]).push(n),null!==t._item;)t=t._item.parent;ef(r._eH,n,e)};class ig{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=Zp(),this._dEH=Zp(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(t,e){this.doc=t,this._item=e}_copy(){throw ad()}clone(){throw ad()}_write(t){}get _first(){let t=this._start;for(;null!==t&&t.deleted;)t=t.right;return t}_callObserver(t,e){!t.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(t){Xp(this._eH,t)}observeDeep(t){Xp(this._dEH,t)}unobserve(t){tf(this._eH,t)}unobserveDeep(t){tf(this._dEH,t)}toJSON(){}}const sg=(t,e,n)=>{t.doc??Zf(),e<0&&(e=t._length+e),n<0&&(n=t._length+n);let r=n-e;const o=[];let i=t._start;for(;null!==i&&r>0;){if(i.countable&&!i.deleted){const t=i.content.getContent();if(t.length<=e)e-=t.length;else{for(let n=e;n<t.length&&r>0;n++)o.push(t[n]),r--;e=0}}i=i.right}return o},ag=t=>{t.doc??Zf();const e=[];let n=t._start;for(;null!==n;){if(n.countable&&!n.deleted){const t=n.content.getContent();for(let n=0;n<t.length;n++)e.push(t[n])}n=n.right}return e},lg=(t,e)=>{const n=[];let r=t._start;for(;null!==r;){if(r.countable&&gf(r,e)){const t=r.content.getContent();for(let e=0;e<t.length;e++)n.push(t[e])}r=r.right}return n},cg=(t,e)=>{let n=0,r=t._start;for(t.doc??Zf();null!==r;){if(r.countable&&!r.deleted){const o=r.content.getContent();for(let r=0;r<o.length;r++)e(o[r],n++,t)}r=r.right}},dg=(t,e)=>{const n=[];return cg(t,(r,o)=>{n.push(e(r,o,t))}),n},ug=t=>{let e=t._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(null===n){for(;null!==e&&e.deleted;)e=e.right;if(null===e)return{done:!0,value:void 0};n=e.content.getContent(),r=0,e=e.right}const t=n[r++];return n.length<=r&&(n=null),{done:!1,value:t}}}},hg=(t,e)=>{t.doc??Zf();const n=ng(t,e);let r=t._start;for(null!==n&&(r=n.p,e-=n.index);null!==r;
1r=r.right)if(!r.deleted&&r.countable){if(e<r.length)return r.content.getContent()[e];e-=r.length}},pg=(t,e,n,r)=>{let o=n;const i=t.doc,s=i.clientID,a=i.store,l=null===n?e._start:n.right;let c=[];const d=()=>{c.length>0&&(o=new wm(of(s,bf(a,s)),o,o&&o.lastId,l,l&&l.id,e,null,new im(c)),o.integrate(t,0),c=[])};r.forEach(n=>{if(null===n)c.push(n);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(n);break;default:switch(d(),n.constructor){case Uint8Array:case ArrayBuffer:o=new wm(of(s,bf(a,s)),o,o&&o.lastId,l,l&&l.id,e,null,new Qg(new Uint8Array(n))),o.integrate(t,0);break;case Pp:o=new wm(of(s,bf(a,s)),o,o&&o.lastId,l,l&&l.id,e,null,new tm(n)),o.integrate(t,0);break;default:if(!(n instanceof ig))throw new Error("Unexpected content type in insert operation");o=new wm(of(s,bf(a,s)),o,o&&o.lastId,l,l&&l.id,e,null,new gm(n)),o.integrate(t,0)}}}),d()},fg=()=>sd("Length exceeded!"),gg=(t,e,n,r)=>{if(n>e._length)throw fg();if(0===n)return e._searchMarker&&rg(e._searchMarker,n,r.length),pg(t,e,null,r);const o=n,i=ng(e,n);let s=e._start;for(null!==i&&(s=i.p,0===(n-=i.index)&&(s=s.prev,n+=s&&s.countable&&!s.deleted?s.length:0));null!==s;s=s.right)if(!s.deleted&&s.countable){if(n<=s.length){n<s.length&&xf(t,of(s.id.client,s.id.clock+n));break}n-=s.length}return e._searchMarker&&rg(e._searchMarker,o,r.length),pg(t,e,s,r)},mg=(t,e,n,r)=>{if(0===r)return;const o=n,i=r,s=ng(e,n);let a=e._start;for(null!==s&&(a=s.p,n-=s.index);null!==a&&n>0;a=a.right)!a.deleted&&a.countable&&(n<a.length&&xf(t,of(a.id.client,a.id.clock+n)),n-=a.length);for(;r>0&&null!==a;)a.deleted||(r<a.length&&xf(t,of(a.id.client,a.id.clock+r)),a.delete(t),r-=a.length),a=a.right;if(r>0)throw fg();e._searchMarker&&rg(e._searchMarker,o,-i+r)},Ag=(t,e,n)=>{const r=e._map.get(n);void 0!==r&&r.delete(t)},yg=(t,e,n,r)=>{const o=e._map.get(n)||null,i=t.doc,s=i.clientID;let a;if(null==r)a=new im([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:a=new im([r]);break;case Uint8Array:a=new Qg(r);break;case Pp:a=new tm(r);break;default:if(!(r instanceof ig))throw new Error("Unexpected content type");a=new gm(r)}new wm(of(s,bf(i.store,s)),o,o&&o.lastId,null,null,e,n,a).integrate(t,0)},bg=(t,e)=>{t.doc??Zf();const n=t._map.get(e);return void 0===n||n.deleted?void 0:n.content.getContent()[n.length-1]},vg=t=>{const e={};return t.doc??Zf(),t._map.forEach((t,n)=>{t.deleted||(e[n]=t.content.getContent()[t.length-1])}),e},wg=(t,e)=>{t.doc??Zf();const n=t._map.get(e);return void 0!==n&&!n.deleted},kg=t=>{return t.doc??Zf(),e=t._map.entries(),n=t=>!t[1].deleted,Cp(()=>{let t;do{t=e.next()}while(!t.done&&!n(t.value));return t});var e,n};class Cg extends Yf{}class xg extends ig{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){const e=new xg;return e.push(t),e}_integrate(t,e){super._integrate(t,e),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new xg}clone(){const t=new xg;return t.insert(0,this.toArray().map(t=>t instanceof ig?t.clone():t)),t}get length(){return this.doc??Zf(),this._length}_callObserver(t,e){super._callObserver(t,e),og(this,t,new Cg(this,t))}insert(t,e){null!==this.doc?If(this.doc,n=>{gg(n,this,t,e)}):this._prelimContent.splice(t,0,...e)}push(t){null!==this.doc?If(this.doc,e=>{((t,e,n)=>{let r=(e._searchMarker||[]).reduce((t,e)=>e.index>t.index?e:t,{index:0,p:e._start}).p;if(r)for(;r.right;)r=r.right;pg(t,e,r,n)})(e,this,t)}):this._prelimContent.push(...t)}unshift(t){this.insert(0,t)}delete(t,e=1){null!==this.doc?If(this.doc,n=>{mg(n,this,t,e)}):this._prelimContent.splice(t,e)}get(t){return hg(this,t)}toArray(){return ag(this)}slice(t=0,e=this.length){return sg(this,t,e)}toJSON(){return this.map(t=>t instanceof ig?t.toJSON():t)}map(t){return dg(this,t)}forEach(t){cg(this,t)}[Symbol.iterator](){return ug(this)}_write(t){t.writeTypeRef(lm)}}class Sg extends Yf{constructor(t,e,n){super(t,e),this.keysChanged=n}}class Eg extends ig{constructor(t){super(),this._prelimContent=null,this._prelimContent=void 0===t?new Map:new Map(t)}_integrate(t,e){super._integrate(t,e),this._prelimContent.forEach((t,e)=>{this.set(e,t)}),this._prelimContent=null}_copy(){return new Eg}clone(){const t=new Eg;return this.forEach((e,n)=>{t.set(n,e instanceof ig?e.clone():e)}),t}_callObserver(t,e){og(this,t,new Sg(this,t,e))}toJSON(){this.doc??Zf();const t={};
1return this._map.forEach((e,n)=>{if(!e.deleted){const r=e.content.getContent()[e.length-1];t[n]=r instanceof ig?r.toJSON():r}}),t}get size(){return[...kg(this)].length}keys(){return xp(kg(this),t=>t[0])}values(){return xp(kg(this),t=>t[1].content.getContent()[t[1].length-1])}entries(){return xp(kg(this),t=>[t[0],t[1].content.getContent()[t[1].length-1]])}forEach(t){this.doc??Zf(),this._map.forEach((e,n)=>{e.deleted||t(e.content.getContent()[e.length-1],n,this)})}[Symbol.iterator](){return this.entries()}delete(t){null!==this.doc?If(this.doc,e=>{Ag(e,this,t)}):this._prelimContent.delete(t)}set(t,e){return null!==this.doc?If(this.doc,n=>{yg(n,this,t,e)}):this._prelimContent.set(t,e),e}get(t){return bg(this,t)}has(t){return wg(this,t)}clear(){null!==this.doc?If(this.doc,t=>{this.forEach(function(e,n,r){Ag(t,r,n)})}):this._prelimContent.clear()}_write(t){t.writeTypeRef(cm)}}const Mg=(t,e)=>t===e||"object"==typeof t&&"object"==typeof e&&t&&e&&((t,e)=>t===e||Zc(t)===Zc(e)&&Xc(t,(t,n)=>(void 0!==t||td(e,n))&&Kc(e[n],t)))(t,e);class Tg{constructor(t,e,n,r){this.left=t,this.right=e,this.index=n,this.currentAttributes=r}forward(){null===this.right&&ld(),this.right.content.constructor===nm?this.right.deleted||Ig(this.currentAttributes,this.right.content):this.right.deleted||(this.index+=this.right.length),this.left=this.right,this.right=this.right.right}}const _g=(t,e,n)=>{for(;null!==e.right&&n>0;)e.right.content.constructor===nm?e.right.deleted||Ig(e.currentAttributes,e.right.content):e.right.deleted||(n<e.right.length&&xf(t,of(e.right.id.client,e.right.id.clock+n)),e.index+=e.right.length,n-=e.right.length),e.left=e.right,e.right=e.right.right;return e},Dg=(t,e,n,r)=>{const o=new Map,i=r?ng(e,n):null;if(i){const e=new Tg(i.p.left,i.p,i.index,o);return _g(t,e,n-i.index)}{const r=new Tg(null,e._start,0,o);return _g(t,r,n)}},Og=(t,e,n,r)=>{for(;null!==n.right&&(!0===n.right.deleted||n.right.content.constructor===nm&&Mg(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();const o=t.doc,i=o.clientID;r.forEach((r,s)=>{const a=n.left,l=n.right,c=new wm(of(i,bf(o.store,i)),a,a&&a.lastId,l,l&&l.id,e,null,new nm(s,r));c.integrate(t,0),n.right=c,n.forward()})},Ig=(t,e)=>{const{key:n,value:r}=e;null===r?t.delete(n):t.set(n,r)},Ng=(t,e)=>{for(;null!==t.right&&(t.right.deleted||t.right.content.constructor===nm&&Mg(e[t.right.content.key]??null,t.right.content.value));)t.forward()},Lg=(t,e,n,r)=>{const o=t.doc,i=o.clientID,s=new Map;for(const a in r){const l=r[a],c=n.currentAttributes.get(a)??null;if(!Mg(c,l)){s.set(a,c);const{left:r,right:d}=n;n.right=new wm(of(i,bf(o.store,i)),r,r&&r.lastId,d,d&&d.id,e,null,new nm(a,l)),n.right.integrate(t,0),n.forward()}}return s},Bg=(t,e,n,r,o)=>{n.currentAttributes.forEach((t,e)=>{void 0===o[e]&&(o[e]=null)});const i=t.doc,s=i.clientID;Ng(n,o);const a=Lg(t,e,n,o),l=r.constructor===String?new sm(r):r instanceof ig?new gm(r):new em(r);let{left:c,right:d,index:u}=n;e._searchMarker&&rg(e._searchMarker,n.index,l.getLength()),d=new wm(of(s,bf(i.store,s)),c,c&&c.lastId,d,d&&d.id,e,null,l),d.integrate(t,0),n.right=d,n.index=u,n.forward(),Og(t,e,n,a)},$g=(t,e,n,r,o)=>{const i=t.doc,s=i.clientID;Ng(n,o);const a=Lg(t,e,n,o);t:for(;null!==n.right&&(r>0||a.size>0&&(n.right.deleted||n.right.content.constructor===nm));){if(!n.right.deleted)switch(n.right.content.constructor){case nm:{const{key:e,value:i}=n.right.content,s=o[e];if(void 0!==s){if(Mg(s,i))a.delete(e);else{if(0===r)break t;a.set(e,i)}n.right.delete(t)}else n.currentAttributes.set(e,i);break}default:r<n.right.length&&xf(t,of(n.right.id.client,n.right.id.clock+r)),r-=n.right.length}n.forward()}if(r>0){let o="";for(;r>0;r--)o+="\n";n.right=new wm(of(s,bf(i.store,s)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,e,null,new sm(o)),n.right.integrate(t,0),n.forward()}Og(t,e,n,a)},Rg=(t,e,n,r,o)=>{let i=e;const s=ud();for(;i&&(!i.countable||i.deleted);){if(!i.deleted&&i.content.constructor===nm){const t=i.content;s.set(t.key,t)}i=i.right}let a=0,l=!1;for(;e!==i;){if(n===e&&(l=!0),!e.deleted){const n=e.content;switch(n.constructor){case nm:{const{key:i,value:c}=n,d=r.get(i)??null;s.get(i)===n&&d!==c||(e.delete(t),a++,l||(o.get(i)??null)!==c||d===c||(null===d?o.delete(i):o.set(i,d))),l||e.deleted||Ig(o,n);break}}}e=e.right}return a},Pg=t=>{let e=0;return If(t.doc,n=>{let r=t._start,o=t._start,i=ud();const s=hd(i);for(;o;)!1===o.deleted&&(o.content.constructor===nm?Ig(s,o.content):(e+=Rg(n,r,o,i,s),i=hd(s),r=o)),o=o.right}),e},Fg=t=>{const e=new Set,n=t.doc;for(const[r,o]of t.afterState.entries()){const i=t.beforeState.get(r)||0;o!==i&&Ef(t,n.store.clients.get(r),i,o,t=>{t.deleted||t.content.constructor!==nm||t.constructor===Yg||e.add(t.parent)})}If(n,n=>{Mp(t,t.deleteSet,t=>{if(t instanceof Yg||!t.parent._hasFormatting||e.has(t.parent))return;const r=t.parent;t.content.constructor===nm?e.add(r):((t,e)=>{for(;e&&e.right&&(e.right.deleted||!e.right.countable);)e=e.right;const n=new Set;for(;e&&(e.deleted||!e.countable);){if(!e.deleted&&e.content.constructor===nm){const r=e.content.key;n.has(r)?e.delete(t):n.add(r)}e=e.left}})(n,t)});for(const t of e)Pg(t)})},zg=(t,e,n)=>{const r=n,o=hd(e.currentAttributes),i=e.right;for(;n>0&&null!==e.right;){if(!1===e.right.deleted)switch(e.right.content.constructor){case gm:case em:case sm:n<e.right.length&&xf(t,of(e.right.id.client,e.right.id.clock+n)),n-=e.right.length,e.right.delete(t)}e.forward()}i&&Rg(t,i,e.right,o,e.currentAttributes);const s=(e.left||e.right).parent;return s._searchMarker&&rg(s._searchMarker,e.index,-r+n),e};class Hg extends Yf{constructor(t,e,n){super(t,e),this.childListChanged=!1,this.keysChanged=new Set,n.forEac
1h(t=>{null===t?this.childListChanged=!0:this.keysChanged.add(t)})}get changes(){if(null===this._changes){const t={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=t}return this._changes}get delta(){if(null===this._delta){const t=this.target.doc,e=[];If(t,t=>{const n=new Map,r=new Map;let o=this.target._start,i=null;const s={};let a="",l=0,c=0;const d=()=>{if(null!==i){let t=null;switch(i){case"delete":c>0&&(t={delete:c}),c=0;break;case"insert":("object"==typeof a||a.length>0)&&(t={insert:a},n.size>0&&(t.attributes={},n.forEach((e,n)=>{null!==e&&(t.attributes[n]=e)}))),a="";break;case"retain":l>0&&(t={retain:l},(t=>{for(const e in t)return!1;return!0})(s)||(t.attributes=Yc({},s))),l=0}t&&e.push(t),i=null}};for(;null!==o;){switch(o.content.constructor){case gm:case em:this.adds(o)?this.deletes(o)||(d(),i="insert",a=o.content.getContent()[0],d()):this.deletes(o)?("delete"!==i&&(d(),i="delete"),c+=1):o.deleted||("retain"!==i&&(d(),i="retain"),l+=1);break;case sm:this.adds(o)?this.deletes(o)||("insert"!==i&&(d(),i="insert"),a+=o.content.str):this.deletes(o)?("delete"!==i&&(d(),i="delete"),c+=o.length):o.deleted||("retain"!==i&&(d(),i="retain"),l+=o.length);break;case nm:{const{key:e,value:a}=o.content;if(this.adds(o)){if(!this.deletes(o)){const l=n.get(e)??null;Mg(l,a)?null!==a&&o.delete(t):("retain"===i&&d(),Mg(a,r.get(e)??null)?delete s[e]:s[e]=a)}}else if(this.deletes(o)){r.set(e,a);const t=n.get(e)??null;Mg(t,a)||("retain"===i&&d(),s[e]=t)}else if(!o.deleted){r.set(e,a);const n=s[e];void 0!==n&&(Mg(n,a)?null!==n&&o.delete(t):("retain"===i&&d(),null===a?delete s[e]:s[e]=a))}o.deleted||("insert"===i&&d(),Ig(n,o.content));break}}o=o.right}for(d();e.length>0;){const t=e[e.length-1];if(void 0===t.retain||void 0!==t.attributes)break;e.pop()}}),this._delta=e}return this._delta}}class jg extends ig{constructor(t){super(),this._pending=void 0!==t?[()=>this.insert(0,t)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??Zf(),this._length}_integrate(t,e){super._integrate(t,e);try{this._pending.forEach(t=>t())}catch(t){console.error(t)}this._pending=null}_copy(){return new jg}clone(){const t=new jg;return t.applyDelta(this.toDelta()),t}_callObserver(t,e){super._callObserver(t,e);const n=new Hg(this,t,e);og(this,t,n),!t.local&&this._hasFormatting&&(t._needFormattingCleanup=!0)}toString(){this.doc??Zf();let t="",e=this._start;for(;null!==e;)!e.deleted&&e.countable&&e.content.constructor===sm&&(t+=e.content.str),e=e.right;return t}toJSON(){return this.toString()}applyDelta(t,{sanitize:e=!0}={}){null!==this.doc?If(this.doc,n=>{const r=new Tg(null,this._start,0,new Map);for(let o=0;o<t.length;o++){const i=t[o];if(void 0!==i.insert){const s=e||"string"!=typeof i.insert||o!==t.length-1||null!==r.right||"\n"!==i.insert.slice(-1)?i.insert:i.insert.slice(0,-1);("string"!=typeof s||s.length>0)&&Bg(n,this,r,s,i.attributes||{})}else void 0!==i.retain?$g(n,this,r,i.retain,i.attributes||{}):void 0!==i.delete&&zg(n,r,i.delete)}}):this._pending.push(()=>this.applyDelta(t))}toDelta(t,e,n){this.doc??Zf();const r=[],o=new Map,i=this.doc;let s="",a=this._start;function l(){if(s.length>0){const t={};let e=!1;o.forEach((n,r)=>{e=!0,t[r]=n});const n={insert:s};e&&(n.attributes=t),r.push(n),s=""}}const c=()=>{for(;null!==a;){if(gf(a,t)||void 0!==e&&gf(a,e))switch(a.content.constructor){case sm:{const r=o.get("ychange");void 0===t||gf(a,t)?void 0===e||gf(a,e)?void 0!==r&&(l(),o.delete("ychange")):void 0!==r&&r.user===a.id.client&&"added"===r.type||(l(),o.set("ychange",n?n("added",a.id):{type:"added"})):void 0!==r&&r.user===a.id.client&&"removed"===r.type||(l(),o.set("ychange",n?n("removed",a.id):{type:"removed"})),s+=a.content.str;break}case gm:case em:{l();const t={insert:a.content.getContent()[0]};if(o.size>0){const e={};t.attributes=e,o.forEach((t,n)=>{e[n]=t})}r.push(t);break}case nm:gf(a,t)&&(l(),Ig(o,a.content))}a=a.right}l()};return t||e?If(i,n=>{t&&mf(n,t),e&&mf(n,e),c()},"cleanup"):c(),r}insert(t,e,n){if(e.length<=0)return;const r=this.doc;null!==r?If(r,r=>{const o=Dg(r,this,t,!n);n||(n={}
1,o.currentAttributes.forEach((t,e)=>{n[e]=t})),Bg(r,this,o,e,n)}):this._pending.push(()=>this.insert(t,e,n))}insertEmbed(t,e,n){const r=this.doc;null!==r?If(r,r=>{const o=Dg(r,this,t,!n);Bg(r,this,o,e,n||{})}):this._pending.push(()=>this.insertEmbed(t,e,n||{}))}delete(t,e){if(0===e)return;const n=this.doc;null!==n?If(n,n=>{zg(n,Dg(n,this,t,!0),e)}):this._pending.push(()=>this.delete(t,e))}format(t,e,n){if(0===e)return;const r=this.doc;null!==r?If(r,r=>{const o=Dg(r,this,t,!1);null!==o.right&&$g(r,this,o,e,n)}):this._pending.push(()=>this.format(t,e,n))}removeAttribute(t){null!==this.doc?If(this.doc,e=>{Ag(e,this,t)}):this._pending.push(()=>this.removeAttribute(t))}setAttribute(t,e){null!==this.doc?If(this.doc,n=>{yg(n,this,t,e)}):this._pending.push(()=>this.setAttribute(t,e))}getAttribute(t){return bg(this,t)}getAttributes(){return vg(this)}_write(t){t.writeTypeRef(dm)}}class Ug{constructor(t,e=()=>!0){this._filter=e,this._root=t,this._currentNode=t._start,this._firstCall=!0,t.doc??Zf()}[Symbol.iterator](){return this}next(){let t=this._currentNode,e=t&&t.content&&t.content.type;if(null!==t&&(!this._firstCall||t.deleted||!this._filter(e)))do{if(e=t.content.type,t.deleted||e.constructor!==qg&&e.constructor!==Vg||null===e._start)for(;null!==t;){const e=t.next;if(null!==e){t=e;break}t=t.parent===this._root?null:t.parent._item}else t=e._start}while(null!==t&&(t.deleted||!this._filter(t.content.type)));return this._firstCall=!1,null===t?{value:void 0,done:!0}:(this._currentNode=t,{value:t.content.type,done:!1})}}class Vg extends ig{constructor(){super(),this._prelimContent=[]}get firstChild(){const t=this._first;return t?t.content.getContent()[0]:null}_integrate(t,e){super._integrate(t,e),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Vg}clone(){const t=new Vg;return t.insert(0,this.toArray().map(t=>t instanceof ig?t.clone():t)),t}get length(){return this.doc??Zf(),null===this._prelimContent?this._length:this._prelimContent.length}createTreeWalker(t){return new Ug(this,t)}querySelector(t){t=t.toUpperCase();const e=new Ug(this,e=>e.nodeName&&e.nodeName.toUpperCase()===t).next();return e.done?null:e.value}querySelectorAll(t){return t=t.toUpperCase(),md(new Ug(this,e=>e.nodeName&&e.nodeName.toUpperCase()===t))}_callObserver(t,e){og(this,t,new Wg(this,e,t))}toString(){return dg(this,t=>t.toString()).join("")}toJSON(){return this.toString()}toDOM(t=document,e={},n){const r=t.createDocumentFragment();return void 0!==n&&n._createAssociation(r,this),cg(this,o=>{r.insertBefore(o.toDOM(t,e,n),null)}),r}insert(t,e){null!==this.doc?If(this.doc,n=>{gg(n,this,t,e)}):this._prelimContent.splice(t,0,...e)}insertAfter(t,e){if(null!==this.doc)If(this.doc,n=>{const r=t&&t instanceof ig?t._item:t;pg(n,this,r,e)});else{const n=this._prelimContent,r=null===t?0:n.findIndex(e=>e===t)+1;if(0===r&&null!==t)throw sd("Reference item not found");n.splice(r,0,...e)}}delete(t,e=1){null!==this.doc?If(this.doc,n=>{mg(n,this,t,e)}):this._prelimContent.splice(t,e)}toArray(){return ag(this)}push(t){this.insert(this.length,t)}unshift(t){this.insert(0,t)}get(t){return hg(this,t)}slice(t=0,e=this.length){return sg(this,t,e)}forEach(t){cg(this,t)}_write(t){t.writeTypeRef(hm)}}class qg extends Vg{constructor(t="UNDEFINED"){super(),this.nodeName=t,this._prelimAttrs=new Map}get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_integrate(t,e){super._integrate(t,e),this._prelimAttrs.forEach((t,e)=>{this.setAttribute(e,t)}),this._prelimAttrs=null}_copy(){return new qg(this.nodeName)}clone(){const t=new qg(this.nodeName);return((t,e)=>{for(const n in t)e(t[n],n)})(this.getAttributes(),(e,n)=>{t.setAttribute(n,e)}),t.insert(0,this.toArray().map(t=>t instanceof ig?t.clone():t)),t}toString(){const t=this.getAttributes(),e=[],n=[];for(const e in t)n.push(e);n.sort();const r=n.length;for(let o=0;o<r;o++){const r=n[o];e.push(r+'="'+t[r]+'"')}const o=this.nodeName.toLocaleLowerCase();return`<${o}${e.length>0?" "+e.join(" "):""}>${super.toString()}</${o}>`}removeAttribute(t){null!==this.doc?If(this.doc,e=>{Ag(e,this,t)}):this._prelimAttrs.delete(t)}setAttribute(t,e){null!==this.doc?If(this.doc,n=>{yg(n,this,t,e)}):this._prelimAttrs.set(t,e)}getAttribute(t){return bg(this,t)}hasAttribute(t){return wg(this,t)}getAttributes(t){return t?((t,e)=>{const n={};
1return this._map.forEach((t,r)=>{let o=t;for(;null!==o&&(!e.sv.has(o.id.client)||o.id.clock>=(e.sv.get(o.id.client)||0));)o=o.left;null!==o&&gf(o,e)&&(n[r]=o.content.getContent()[o.length-1])}),n})(0,t):vg(this)}toDOM(t=document,e={},n){const r=t.createElement(this.nodeName),o=this.getAttributes();for(const t in o){const e=o[t];"string"==typeof e&&r.setAttribute(t,e)}return cg(this,o=>{r.appendChild(o.toDOM(t,e,n))}),void 0!==n&&n._createAssociation(r,this),r}_write(t){t.writeTypeRef(um),t.writeKey(this.nodeName)}}class Wg extends Yf{constructor(t,e,n){super(t,n),this.childListChanged=!1,this.attributesChanged=new Set,e.forEach(t=>{null===t?this.childListChanged=!0:this.attributesChanged.add(t)})}}class Jg extends Eg{constructor(t){super(),this.hookName=t}_copy(){return new Jg(this.hookName)}clone(){const t=new Jg(this.hookName);return this.forEach((e,n)=>{t.set(n,e)}),t}toDOM(t=document,e={},n){const r=e[this.hookName];let o;return o=void 0!==r?r.createDom(this):document.createElement(this.hookName),o.setAttribute("data-yjs-hook",this.hookName),void 0!==n&&n._createAssociation(o,this),o}_write(t){t.writeTypeRef(pm),t.writeKey(this.hookName)}}class Gg extends jg{get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_copy(){return new Gg}clone(){const t=new Gg;return t.applyDelta(this.toDelta()),t}toDOM(t=document,e,n){const r=t.createTextNode(this.toString());return void 0!==n&&n._createAssociation(r,this),r}toString(){return this.toDelta().map(t=>{const e=[];for(const n in t.attributes){const r=[];for(const e in t.attributes[n])r.push({key:e,value:t.attributes[n][e]});r.sort((t,e)=>t.key<e.key?-1:1),e.push({nodeName:n,attrs:r})}e.sort((t,e)=>t.nodeName<e.nodeName?-1:1);let n="";for(let t=0;t<e.length;t++){const r=e[t];n+=`<${r.nodeName}`;for(let t=0;t<r.attrs.length;t++){const e=r.attrs[t];n+=` ${e.key}="${e.value}"`}n+=">"}n+=t.insert;for(let t=e.length-1;t>=0;t--)n+=`</${e[t].nodeName}>`;return n}).join("")}toJSON(){return this.toString()}_write(t){t.writeTypeRef(fm)}}class Kg{constructor(t,e){this.id=t,this.length=e}get deleted(){throw ad()}mergeWith(t){return!1}write(t,e,n){throw ad()}integrate(t,e){throw ad()}}class Yg extends Kg{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor===t.constructor&&(this.length+=t.length,!0)}integrate(t,e){e>0&&(this.id.clock+=e,this.length-=e),vf(t.doc.store,this)}write(t,e){t.writeInfo(0),t.writeLen(this.length-e)}getMissing(t,e){return null}}class Qg{constructor(t){this.content=t}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Qg(this.content)}splice(t){throw ad()}mergeWith(t){return!1}integrate(t,e){}delete(t){}gc(t){}write(t,e){t.writeBuf(this.content)}getRef(){return 3}}class Zg{constructor(t){this.len=t}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new Zg(this.len)}splice(t){const e=new Zg(this.len-t);return this.len=t,e}mergeWith(t){return this.len+=t.len,!0}integrate(t,e){Op(t.deleteSet,e.id.client,e.id.clock,this.len),e.markDeleted()}delete(t){}gc(t){}write(t,e){t.writeLen(this.len-e)}getRef(){return 1}}const Xg=(t,e)=>new Pp({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class tm{constructor(t){t._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=t;const e={};this.opts=e,t.gc||(e.gc=!1),t.autoLoad&&(e.autoLoad=!0),null!==t.meta&&(e.meta=t.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new tm(Xg(this.doc.guid,this.opts))}splice(t){throw ad()}mergeWith(t){return!1}integrate(t,e){this.doc._item=e,t.subdocsAdded.add(this.doc),this.doc.shouldLoad&&t.subdocsLoaded.add(this.doc)}delete(t){t.subdocsAdded.has(this.doc)?t.subdocsAdded.delete(this.doc):t.subdocsRemoved.add(this.doc)}gc(t){}write(t,e){t.writeString(this.doc.guid),t.writeAny(this.opts)}getRef(){return 9}}class em{constructor(t){this.embed=t}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new em(this.embed)}splice(t){throw ad()}mergeWith(t){return!1}integrate(t,e){}delete(t){}gc(t){}write(t,e){t.writeJSON(this.embed)}getRef(){return 5}}class nm{constructor(t,e){this.key=t,this.value=e}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new nm(this.key,this.value)}splice(t){throw ad()}mergeWith(t){return!1}integrate(t,e){const n=e.parent;n._searchMarker=null,n._hasFormatting=!0}delete(t){}gc(t){}write(t,e){t.writeKey(this.key),t.writeJSON(this.value)}getRef(){return 6}}class rm{constructor(t){this.arr=t}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new rm(this.arr)}splice(t){const e=new rm(this.arr.slice(t));return this.arr=this.arr.slice(0,t),e}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,e){}delete(t){}gc(t){}write(t,e){const n=this.arr.length;t.writeLen(n-e);for(let r=e;r<n;r++){const e=this.arr[r];t.writeString(void 0===e?"undefined":JSON.stringify(e))}}getRef(){return 2}}const om="development"===$u("node_env");class im{constructor(t){this.arr=t,om&&nd(t)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new im(this.arr)}splice(t){const e=new im(this.arr.slice(t));return this.arr=this.arr.slice(0,t),e}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,e){}delete(t){}gc(t){}write(t,e){const n=this.arr.length;t.writeLen(n-e);for(let r=e;r<n;r++){const e=this.arr[r];t.writeAny(e)}}getRef(){return 8}}class sm{constructor(t){this.str=t}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new sm(this.str)}splice(t){const e=new sm(this.str.slice(t));this.str=this.str.slice(0,t);const n=this.str.charCodeAt(t-1);return n>=55296&&n<=56319&&(this.str=this.str.slice(0,t-1)+"�",e.str="�"+e.str.slice(1)),e}mergeWith(t){return this.str+=t.str,!0}integrate(t,e){}delete(t){}gc(t){}write(t,e){t.writeString(0===e?this.str:this.str.slice(e))}getRef(){return 4}}const am=[t=>new xg,t=>
1new Eg,t=>new jg,t=>new qg(t.readKey()),t=>new Vg,t=>new Jg(t.readKey()),t=>new Gg],lm=0,cm=1,dm=2,um=3,hm=4,pm=5,fm=6;class gm{constructor(t){this.type=t}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new gm(this.type._copy())}splice(t){throw ad()}mergeWith(t){return!1}integrate(t,e){this.type._integrate(t.doc,e)}delete(t){let e=this.type._start;for(;null!==e;)e.deleted?e.id.clock<(t.beforeState.get(e.id.client)||0)&&t._mergeStructs.push(e):e.delete(t),e=e.right;this.type._map.forEach(e=>{e.deleted?e.id.clock<(t.beforeState.get(e.id.client)||0)&&t._mergeStructs.push(e):e.delete(t)}),t.changed.delete(this.type)}gc(t){let e=this.type._start;for(;null!==e;)e.gc(t,!0),e=e.right;this.type._start=null,this.type._map.forEach(e=>{for(;null!==e;)e.gc(t,!0),e=e.left}),this.type._map=new Map}write(t,e){this.type._write(t)}getRef(){return 7}}const mm=(t,e)=>{let n,r=e,o=0;do{o>0&&(r=of(r.client,r.clock+o)),n=kf(t,r),o=r.clock-n.id.clock,r=n.redone}while(null!==r&&n instanceof wm);return{item:n,diff:o}},Am=(t,e)=>{for(;null!==t&&t.keep!==e;)t.keep=e,t=t.parent._item},ym=(t,e,n)=>{const{client:r,clock:o}=e.id,i=new wm(of(r,o+n),e,of(r,o+n-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(n));return e.deleted&&i.markDeleted(),e.keep&&(i.keep=!0),null!==e.redone&&(i.redone=of(e.redone.client,e.redone.clock+n)),e.right=i,null!==i.right&&(i.right.left=i),t._mergeStructs.push(i),null!==i.parentSub&&null===i.right&&i.parent._map.set(i.parentSub,i),e.length=n,i},bm=(t,e)=>yd(t,t=>Tp(t.deletions,e)),vm=(t,e,n,r,o,i)=>{const s=t.doc,a=s.store,l=s.clientID,c=e.redone;if(null!==c)return xf(t,c);let d,u=e.parent._item,h=null;if(null!==u&&!0===u.deleted){if(null===u.redone&&(!n.has(u)||null===vm(t,u,n,r,o,i)))return null;for(;null!==u.redone;)u=xf(t,u.redone)}const p=null===u?e.parent:u.content.type;if(null===e.parentSub){for(h=e.left,d=e;null!==h;){let e=h;for(;null!==e&&e.parent._item!==u;)e=null===e.redone?null:xf(t,e.redone);if(null!==e&&e.parent._item===u){h=e;break}h=h.left}for(;null!==d;){let e=d;for(;null!==e&&e.parent._item!==u;)e=null===e.redone?null:xf(t,e.redone);if(null!==e&&e.parent._item===u){d=e;break}d=d.right}}else{if(d=null,e.right&&!o){for(h=e;null!==h&&null!==h.right&&(h.right.redone||Tp(r,h.right.id)||bm(i.undoStack,h.right.id)||bm(i.redoStack,h.right.id));)for(h=h.right;h.redone;)h=xf(t,h.redone);if(h&&null!==h.right)return null}else h=p._map.get(e.parentSub)||null;null!==h&&h.parent._item!==u&&(h=p._map.get(e.parentSub)||null)}const f=bf(a,l),g=of(l,f),m=new wm(g,h,h&&h.lastId,d,d&&d.id,p,e.parentSub,e.content.copy());return e.redone=g,Am(m,!0),m.integrate(t,0),m};class wm extends Kg{constructor(t,e,n,r,o,i,s,a){super(t,a.getLength()),this.origin=n,this.left=e,this.right=r,this.rightOrigin=o,this.parent=i,this.parentSub=s,this.redone=null,this.content=a,this.info=this.content.isCountable()?2:0}set marker(t){(8&this.info)>0!==t&&(this.info^=8)}get marker(){return(8&this.info)>0}get keep(){return(1&this.info)>0}set keep(t){this.keep!==t&&(this.info^=1)}get countable(){return(2&this.info)>0}get deleted(){return(4&this.info)>0}set deleted(t){this.deleted!==t&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(t,e){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=bf(e,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=bf(e,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===nf&&this.id.client!==this.parent.client&&this.parent.clock>=bf(e,this.parent.client))return this.parent.client;if(this.origin&&(this.left=Sf(t,e,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=xf(t,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===Yg||this.right&&this.right.constructor===Yg)this.parent=null;else if(this.parent){if(this.parent.constructor===nf){const t=kf(e,this.parent);t.constructor===Yg?this.parent=null:this.parent=t.content.type}}else this.left&&this.left.constructor===wm?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===wm&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);return null}integrate(t,e){if(e>0&&(this.id.clock+=e,this.left=Sf(t,t.doc.store,of(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(e),this.length-=e),this.parent){if(!this.left&&(!this.right||null!==this.right.left)||this.left&&this.left.right!==this.right){let e,n=this.left;if(null!==n)e=n.right;else if(null!==this.parentSub)for(e=this.parent._map.get(this.parentSub)||null;null!==e&&null!==e.left;)e=e.left;else e=this.parent._start;const r=new Set,o=new Set;for(;null!==e&&e!==this.right;){if(o.add(e),r.add(e),rf(this.origin,e.origin)){if(e.id.client<this.id.client)n=e,r.clear();else if(rf(this.rightOrigin,e.rightOrigin))break}else{if(null===e.origin||!o.has(kf(t.doc.store,e.origin)))break;r.has(kf(t.doc.store,e.origin))||(n=e,r.clear())}e=e.right}this.left=n}if(null!==this.left){const t=this.left.right;this.right=t,this.left.right=this}else{let t;if(null!==this.parentSub)for(t=this.parent._map.get(this.parentSub)||null;null!==t&&null!==t.left;)t=t.left;else t=this.parent._start,this.parent._start=this;this.right=t}null!==this.right?this.right.left=this:null!==this.parentSub&&(this.parent._map.set(this.parentSub,this),null!==this.left&&this.left.delete(t)),null===this.parentSub&&this.countable&&!this.deleted&&(this.parent._length+=this.length),vf(t.doc.store,this),this.content.integrate(t,this),_f(t,this.parent,this.parentSub),(null!==this.parent._item&&this.parent._item.deleted||null!==this.parentSub&&null!==this.right)&&this.delete(t)}else new Yg(this.id,this.length).integrate(t,0)}get next(){let t=this.right;for(;null!==t&&t.deleted;)t=t.right;return t}get prev(){let t=this.left;for(;null!==t&&t.deleted;)t=t.left;return t}get lastId(){return 1===this.length?this.id:of(this.id.client,this.id.clock+this.length-1)}mergeWith(t){if(this.constructor===t.constructor&&rf(t.origin,this.lastId)&&this.right===t&&rf(this.rightOrigin,t.rightOrigin)&&this.id.client===t.id.client&&this.id.clock+this.length===t.id.clock&&this.deleted===t.deleted&&null===this.redone&&null===t.redone&&this.content.constructor===t.content.constructor&&this.content.mergeWith(t.content)){const e=this.parent._searchMarker;
1return e&&e.forEach(e=>{e.p===t&&(e.p=this,!this.deleted&&this.countable&&(e.index-=this.length))}),t.keep&&(this.keep=!0),this.right=t.right,null!==this.right&&(this.right.left=this),this.length+=t.length,!0}return!1}delete(t){if(!this.deleted){const e=this.parent;this.countable&&null===this.parentSub&&(e._length-=this.length),this.markDeleted(),Op(t.deleteSet,this.id.client,this.id.clock,this.length),_f(t,e,this.parentSub),this.content.delete(t)}}gc(t,e){if(!this.deleted)throw ld();this.content.gc(t),e?((t,e,n)=>{const r=t.clients.get(e.id.client);r[wf(r,e.id.clock)]=n})(t,this,new Yg(this.id,this.length)):this.content=new Zg(this.length)}write(t,e){const n=e>0?of(this.id.client,this.id.clock+e-1):this.origin,r=this.rightOrigin,o=this.parentSub,i=31&this.content.getRef()|(null===n?0:128)|(null===r?0:64)|(null===o?0:32);if(t.writeInfo(i),null!==n&&t.writeLeftID(n),null!==r&&t.writeRightID(r),null===n&&null===r){const e=this.parent;if(void 0!==e._item){const n=e._item;if(null===n){const n=sf(e);t.writeParentInfo(!0),t.writeString(n)}else t.writeParentInfo(!1),t.writeLeftID(n.id)}else e.constructor===String?(t.writeParentInfo(!0),t.writeString(e)):e.constructor===nf?(t.writeParentInfo(!1),t.writeLeftID(e)):ld();null!==o&&t.writeString(o)}this.content.write(t,e)}}const km=(t,e)=>Cm[31&e](t),Cm=[()=>{ld()},t=>new Zg(t.readLen()),t=>{const e=t.readLen(),n=[];for(let r=0;r<e;r++){const e=t.readString();"undefined"===e?n.push(void 0):n.push(JSON.parse(e))}return new rm(n)},t=>new Qg(t.readBuf()),t=>new sm(t.readString()),t=>new em(t.readJSON()),t=>new nm(t.readKey(),t.readJSON()),t=>new gm(am[t.readTypeRef()](t)),t=>{const e=t.readLen(),n=[];for(let r=0;r<e;r++)n.push(t.readAny());return new im(n)},t=>new tm(Xg(t.readString(),t.readAny())),()=>{ld()}];class xm extends Kg{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor===t.constructor&&(this.length+=t.length,!0)}integrate(t,e){ld()}write(t,e){t.writeInfo(10),Pd(t.restEncoder,this.length-e)}getMissing(t,e){return null}}const Sm="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:{},Em="__ $YJS$ __";!0===Sm[Em]&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"),Sm[Em]=!0;const Mm=(t,e,n)=>{if(0===t)return uf(e,0,0===e.length?-1:0);let r=null===e._first?null:e._first.content.type;for(;null!==r&&e!==r;){if(r instanceof Gg){if(r._length>=t)return uf(r,t,0===e.length?-1:0);if(t-=r._length,null!==r._item&&null!==r._item.next)r=r._item.next.content.type;else{do{r=null===r._item?null:r._item.parent,t--}while(r!==e&&null!==r&&null!==r._item&&null===r._item.next);null!==r&&r!==e&&(r=null===r._item?null:r._item.next.content.type)}}else{const o=(n.get(r)||{nodeSize:0}).nodeSize;if(null!==r._first&&t<o)r=r._first.content.type,t--;else{if(1===t&&0===r._length&&o>1)return new lf(null===r._item?null:r._item.id,null===r._item?sf(r):null,null);if(t-=o,null!==r._item&&null!==r._item.next)r=r._item.next.content.type;else{if(0===t)return r=null===r._item?r:r._item.parent,new lf(null===r._item?null:r._item.id,null===r._item?sf(r):null,null);do{r=r._item.parent,t--}while(r!==e&&null===r._item.next);r!==e&&(r=r._item.next.content.type)}}}if(null===r)throw ld();if(0===t&&r.constructor!==Gg&&r!==e)return Tm(r._item.parent,r._item)}return uf(e,e._length,0===e.length?-1:0)},Tm=(t,e)=>{let n=null,r=null;return null===t._item?r=sf(t):n=of(t._item.id.client,t._item.id.clock),new lf(n,r,e.id)},_m=(t,e,n,r)=>{const o=((t,e,n=!0)=>{const r=e.store,o=t.item,i=t.type,s=t.tname,a=t.assoc;let l=null,c=0;if(null!==o){if(bf(r,o.client)<=o.clock)return null;const t=n?mm(r,o):((t,e)=>{const n=kf(t,e);return{item:n,diff:e.clock-n.id.clock}})(r,o),e=t.item;if(!(e instanceof wm))return null;if(l=e.parent,null===l._item||!l._item.deleted){c=e.deleted||!e.countable?0:t.diff+(a>=0?0:1);let n=e.left;for(;null!==n;)!n.deleted&&n.countable&&(c+=n.length),n=n.left}}else{if(null!==s)l=e.get(s);else{if(null===i)throw ld();{if(bf(r,i.client)<=i.clock)return null;const{item:t}=n?mm(r,i):{item:kf(r,i)};if(!(t instanceof wm&&t.content instanceof gm))return null;l=t.content.type}}c=a>=0?l._length:0}return((t,e,n=0)=>new cf(t,e,n))(l,c,t.assoc)})(n,t);if(null===o||o.type!==e&&!af(e,o.type._item))return null;let i=o.type,s=0;if(i.constructor===Gg)s=o.index;else if(null===i._item||!i._item.deleted){let t=i._first,e=0;for(;e<i._length&&e<o.index&&null!==t;){if(!t.deleted){const n=t.content.type;e++,s+=n instanceof Gg?n._length:r.get(n).nodeSize}t=t.right}s+=1}for(;i!==e&&null!==i._item;){const t=i._item.parent;if(null===t._item||!t._item.deleted){s+=1;let e=t._first;for(;null!==e;){const t=e.content.type;if(t===i)break;e.deleted||(s+=t instanceof Gg?t._length:r.get(t).nodeSize),e=e.right}}i=t}return s-1},Dm=t=>class{constructor(t){this._=t}destroy(){t(this._)}},Om=Dm(clearTimeout),Im=(t,e)=>new Om(setTimeout(e,t)),Nm=(Dm(clearInterval),Dm(t=>"undefined"!=typeof requestAnimationFrame&&cancelAnimationFrame(t)),Dm(t=>"undefined"!=typeof cancelIdleCallback&&cancelIdleCallback(t)),(t,e)=>t>>>e|t<<32-e),Lm=t=>Nm(t,2)^Nm(t,13)^Nm(t,22),Bm=t=>Nm(t,6)^Nm(t,11)^Nm(t,25),$m=t=>Nm(t,7)^Nm(t,18)^t>>>3,Rm=t=>Nm(t,17)^Nm(t,19)^t>>>
110,Pm=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Fm=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);class zm{constructor(){const t=new ArrayBuffer(320);this._H=new Uint32Array(t,0,8),this._H.set(Fm),this._W=new Uint32Array(t,64,64)}_updateHash(){const t=this._H,e=this._W;for(let t=16;t<64;t++)e[t]=Rm(e[t-2])+e[t-7]+$m(e[t-15])+e[t-16];let n=t[0],r=t[1],o=t[2],i=t[3],s=t[4],a=t[5],l=t[6],c=t[7];for(let t,d,u=0;u<64;u++)t=c+Bm(s)+(s&a^~s&l)+Pm[u]+e[u]>>>0,d=Lm(n)+(n&r^n&o^r&o)>>>0,c=l,l=a,a=s,s=i+t>>>0,i=o,o=r,r=n,n=t+d>>>0;t[0]+=n,t[1]+=r,t[2]+=o,t[3]+=i,t[4]+=s,t[5]+=a,t[6]+=l,t[7]+=c}digest(t){let e=0;for(;e+56<=t.length;){let n=0;for(;n<16&&e+3<t.length;n++)this._W[n]=t[e++]<<24|t[e++]<<16|t[e++]<<8|t[e++];if(e%64!=0){for(this._W.fill(0,n,16);e<t.length;)this._W[n]|=t[e]<<8*(3-e%4),e++;this._W[n]|=128<<8*(3-e%4)}this._updateHash()}const n=e%64!=0;this._W.fill(0,0,16);let r=0;for(;e<t.length;r++)for(let n=3;n>=0&&e<t.length;n--)this._W[r]|=t[e++]<<8*n;n||(this._W[r-(e%4==0?0:1)]|=128<<8*(3-e%4)),this._W[14]=t.byteLength/536870912,this._W[15]=8*t.byteLength,this._updateHash();const o=new Uint8Array(32);for(let t=0;t<this._H.length;t++)for(let e=0;e<4;e++)o[4*t+e]=this._H[t]>>>8*(3-e);return o}}const Hm=(t,e)=>void 0===e?!t.deleted:e.sv.has(t.id.client)&&e.sv.get(t.id.client)>t.id.clock&&!Tp(e.ds,t.id),jm=[{light:"#ecd44433",dark:"#ecd444"}],Um=(t,e,n)=>{if(!t.has(n)){if(t.size<e.length){const n=rd();t.forEach(t=>n.add(t)),e=e.filter(t=>!n.has(t))}t.set(n,(r=e)[Uc(Au()*r.length)])}var r;return t.get(n)},Vm=(t,e)=>({type:e.selection.jsonID,anchor:Mm(e.selection.anchor,t.type,t.mapping),head:Mm(e.selection.head,t.type,t.mapping)});class qm{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Map;this.type=t,this.prosemirrorView=null,this.mux=(()=>{let t=!0;return(e,n)=>{if(t){t=!1;try{e()}finally{t=!0}}else void 0!==n&&n()}})(),this.mapping=e,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=t.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{null===this.beforeTransactionSelection&&null!=this.prosemirrorView&&(this.beforeTransactionSelection=Vm(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta("addToHistory",!1)}_isLocalCursorInView(){return!!this.prosemirrorView.hasFocus()&&(Ou&&null===this._domSelectionInView&&(Im(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView)}_isDomSelectionInView(){const t=this.prosemirrorView._root.getSelection();if(null==t||null==t.anchorNode)return!1;const e=this.prosemirrorView._root.createRange();e.setStart(t.anchorNode,t.anchorOffset),e.setEnd(t.focusNode,t.focusOffset),0===e.getClientRects().length&&e.startContainer&&e.collapsed&&e.selectNodeContents(e.startContainer);const n=e.getBoundingClientRect(),r=ep.documentElement;return n.bottom>=0&&n.right>=0&&n.left<=(window.innerWidth||r.clientWidth||0)&&n.top<=(window.innerHeight||r.clientHeight||0)}renderSnapshot(t,e){e||(e=pf(Ip(),new Map)),this.prosemirrorView.dispatch(this._tr.setMeta(Hc,{snapshot:t,prevSnapshot:e}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{const t=this.type.toArray().map(t=>Jm(t,this.prosemirrorView.state.schema,this)).filter(t=>
1null!==t),e=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new N(M.from(t),0,0));e.setMeta(Hc,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(e)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{const t=null!==this.beforeTransactionSelection?null:this.prosemirrorView.state.selection,e=this.type.toArray().map(t=>Jm(t,this.prosemirrorView.state.schema,this)).filter(t=>null!==t),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new N(M.from(e),0,0));if(t){const e=qc(Wc(t.anchor,0),n.doc.content.size),r=qc(Wc(t.head,0),n.doc.content.size);n.setSelection(_e.create(n.doc,e,r))}this.prosemirrorView.dispatch(n.setMeta(Hc,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(t,e,n){let r=this.doc,o=this.type;if(t||(t=ff(this.doc)),t instanceof Uint8Array||e instanceof Uint8Array)if(t instanceof Uint8Array&&e instanceof Uint8Array||ld(),r=new Pp({gc:!1}),Gp(r,e),e=ff(r),Gp(r,t),t=ff(r),null===o._item){const t=Array.from(this.doc.share.keys()).find(t=>this.doc.share.get(t)===this.type);o=r.getXmlFragment(t)}else{const t=r.store.clients.get(o._item.id.client)??[],e=t[wf(t,o._item.id.clock)].content;o=e.type}this.mapping.clear(),this.mux(()=>{r.transact(r=>{const i=n.permanentUserData;i&&i.dss.forEach(t=>{Mp(r,t,t=>{})});const s=(t,e)=>{const r="added"===t?i.getUserByClientId(e.client):i.getUserByDeletedId(e);return{user:r,type:t,color:Um(n.colorMapping,n.colors,r)}},a=lg(o,new hf(e.ds,t.sv)).map(n=>!n._item.deleted||Hm(n._item,t)||Hm(n._item,e)?Jm(n,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},t,e,s):null).filter(t=>null!==t),l=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new N(M.from(a),0,0));this.prosemirrorView.dispatch(l.setMeta(Hc,{isChangeOrigin:!0}))},Hc)})}_typeChanged(t,e){if(null==this.prosemirrorView)return;const n=Hc.getState(this.prosemirrorView.state);0!==t.length&&null==n.snapshot&&null==n.prevSnapshot?this.mux(()=>{const t=(t,e)=>this.mapping.delete(e);Mp(e,e.deleteSet,t=>{if(t.constructor===wm){const e=t.content.type;e&&this.mapping.delete(e)}}),e.changed.forEach(t),e.changedParentTypes.forEach(t);const n=this.type.toArray().map(t=>Wm(t,this.prosemirrorView.state.schema,this)).filter(t=>null!==t);let r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new N(M.from(n),0,0));try{((t,e,n)=>{if(null!==e&&null!==e.anchor&&null!==e.head&&null!==e.anchor.item&&null!==e.head.item)if("all"===e.type)t.setSelection(new Ne(t.doc));else if("node"===e.type){const r=_m(n.doc,n.type,e.anchor,n.mapping);t.setSelection(Oe.create(t.doc,r))}else{const r=_m(n.doc,n.type,e.anchor,n.mapping),o=_m(n.doc,n.type,e.head,n.mapping);if(null!==r&&null!==o){const e=_e.between(t.doc.resolve(r),t.doc.resolve(o));t.setSelection(e)}}else console.debug("[y-prosemirror] restoreRelativeSelection: skip",{relSel:e})})(r,this.beforeTransactionSelection,this),r=r.setMeta(Hc,{isChangeOrigin:!0,isUndoRedoOperation:e.origin instanceof $f}),this._isLocalCursorInView()&&null!==this.beforeTransactionSelection&&null!==this.beforeTransactionSelection.anchor&&null!==this.beforeTransactionSelection.anchor.item&&null!==this.beforeTransactionSelection.head&&null!==this.beforeTransactionSelection.head.item&&(console.debug("[y-prosemirror] _typeChanged: scrollIntoView"),r.scrollIntoView()),this.prosemirrorView.dispatch(r)}catch(t){console.error(t)}}):this.renderSnapshot(n.snapshot,n.prevSnapshot)}_prosemirrorChanged(t){this.doc.isSynced&&this.doc.transact(()=>{lA(this.doc,this.type,t,this),this.beforeTransactionSelection=Vm(this,this.prosemirrorView.state)},Hc)}initView(t){null!=this.prosemirrorView&&this.destroy(),this.prosemirrorView=t,this.doc.on("beforeAllTransactions",this.beforeAllTransactions),this.doc.on("afterAllTransactions",this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){null!=this.prosemirrorView&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off("beforeAllTransactions",this.beforeAllTransactions),this.doc.off("afterAllTransactions",this.afterAllTransactions))}}const Wm=(t,e,n,r,o,i)=>{const s=n.mapping.get(t);if(void 0===s){if(t instanceof qg)return Jm(t,e,n,r,o,i);throw ad()}return s},Jm=(t,e,n,r,o,i)=>{const s=[],a=t=>{if(t instanceof qg){const a=Wm(t,e,n,r,o,i);null!==a&&s.push(a)}else{var a;const l=null===(a=t._item.right)||void 0===a||null===(a=a.content)||void 0===a?void 0:a.type;l instanceof jg&&!l._item.deleted&&l._item.id.client===l.doc.clientID&&(t.applyDelta([{retain:t.length},...l.toDelta()]),l.doc.transact(t=>{l._item.delete(t)}));const c=Gm(t,e,n,r,o,i);
1null!==c&&c.forEach(t=>{null!==t&&s.push(t)})}};void 0===r||void 0===o?t.toArray().forEach(a):lg(t,new hf(o.ds,r.sv)).forEach(a);try{const a=t.getAttributes(r);void 0!==r&&(Hm(t._item,r)?Hm(t._item,o)||(a.ychange=i?i("added",t._item.id):{type:"added"}):a.ychange=i?i("removed",t._item.id):{type:"removed"});const l=e.node(t.nodeName,a,s);return n.mapping.set(t,l),l}catch(e){return t.doc.transact(e=>{t._item.delete(e)},Hc),n.mapping.delete(t),null}},Gm=(t,e,n,r,o,i)=>{const s=[],a=t.toDelta(r,o,i);try{for(let t=0;t<a.length;t++){const n=a[t];s.push(e.text(n.insert,sA(n.attributes,e)))}}catch(e){return t.doc.transact(e=>{t._item.delete(e)},Hc),null}return s},Km=(t,e)=>t instanceof Array?((t,e)=>{const n=new Gg,r=t.map(t=>({insert:t.text,attributes:aA(t.marks,e)}));return n.applyDelta(r),e.mapping.set(n,t),n})(t,e):((t,e)=>{const n=new qg(t.type.name);for(const e in t.attrs){const r=t.attrs[e];null!==r&&"ychange"!==e&&n.setAttribute(e,r)}return n.insert(0,Zm(t).map(t=>Km(t,e))),e.mapping.set(n,t),n})(t,e),Ym=t=>"object"==typeof t&&null!==t,Qm=(t,e)=>{const n=Object.keys(t).filter(e=>null!==t[e]);let r=0;if(null!==e)try{r=Object.keys(e).filter(t=>null!==e[t]).length}catch(t){console.error("[yProsemirror] equalAttrs error",t)}let o=n.length===r;for(let r=0;r<n.length&&o;r++){const i=n[r],s=t[i],a=e[i];o="ychange"===i||s===a||Ym(s)&&Ym(a)&&Qm(s,a)}return o},Zm=t=>{const e=t.content.content,n=[];for(let t=0;t<e.length;t++){const r=e[t];if(r.isText){const r=[];for(let n=e[t];t<e.length&&n.isText;n=e[++t])r.push(n);t--,n.push(r)}else n.push(r)}return n},Xm=(t,e)=>{const n=t.toDelta();return n.length===e.length&&n.every((t,n)=>t.insert===e[n].text&&Qc(t.attributes||{}).length===e[n].marks.length&&Xc(t.attributes,(t,r)=>{var o;const i=iA(r),s=e[n].marks;return Qm(t,null===(o=s.find(t=>t.type.name===i))||void 0===o?void 0:o.attrs)}))},tA=(t,e)=>{if(t instanceof qg&&!(e instanceof Array)&&cA(t,e)){const n=Zm(e);return t._length===n.length&&Qm(t.getAttributes(),e.attrs)&&t.toArray().every((t,e)=>tA(t,n[e]))}return t instanceof Gg&&e instanceof Array&&Xm(t,e)},eA=(t,e)=>t===e||t instanceof Array&&e instanceof Array&&t.length===e.length&&t.every((t,n)=>e[n]===t),nA=(t,e,n)=>{const r=t.toArray(),o=Zm(e),i=o.length,s=r.length,a=qc(s,i);let l=0,c=0,d=!1;for(;l<a;l++){const t=r[l],e=o[l];if(eA(n.mapping.get(t),e))d=!0;else if(!tA(t,e))break}for(;l+c<a;c++){const t=r[s-c-1],e=o[i-c-1];if(eA(n.mapping.get(t),e))d=!0;else if(!tA(t,e))break}return{equalityFactor:l+c,foundMappedChild:d}},rA=(t,e,n)=>{n.mapping.set(t,e);const r=(t=>{let e="",n=t._start;const r={};for(;null!==n;)n.deleted||(n.countable&&n.content instanceof sm?e+=n.content.str:n.content instanceof nm&&(r[n.content.key]=null)),n=n.right;return{str:e,nAttrs:r}})(t),o=r.nAttrs,i=r.str,s=e.map(t=>({insert:t.text,attributes:Object.assign({},o,aA(t.marks,n))})),a=((t,e)=>{let n=0,r=0;for(;n<t.length&&n<e.length&&t[n]===e[n];)n++;for(n>0&&od.test(t[n-1])&&n--;r+n<t.length&&r+n<e.length&&t[t.length-r-1]===e[e.length-r-1];)r++;return r>0&&id.test(t[t.length-r])&&r--,{index:n,remove:t.length-n-r,insert:e.slice(n,e.length-r)}})(i,s.map(t=>t.insert).join("")),l=a.insert,c=a.remove,d=a.index;t.delete(d,c),t.insert(d,l),t.applyDelta(s.map(t=>({retain:t.insert.length,attributes:t.attributes})))},oA=/(.*)(--[a-zA-Z0-9+/=]{8})$/,iA=t=>{var e;return(null===(e=oA.exec(t))||void 0===e?void 0:e[1])??t},sA=(t,e)=>{const n=[];for(const r in t)n.push(e.mark(iA(r),t[r]));return n},aA=(t,e)=>{const n={};return t.forEach(t=>{if("ychange"!==t.type.name){const i=pd(e.isOMark,t.type,()=>!t.type.excludes(t.type));n[i?`${t.type.name}--${r=t.toJSON(),Hu((t=>{for(let e=6;e<t.length;e++)t[e%6]=t[e%6]^t[e];return t.slice(0,6)})((o=ju(r),(new zm).digest(o))))}`:t.type.name]=t.attrs}var r,o}),n},lA=(t,e,n,r)=>{if(e instanceof qg&&e.nodeName!==n.type.name)throw new Error("node name mismatch!");if(r.mapping.set(e,n),e instanceof qg){const t=e.getAttributes(),r=n.attrs;for(const n in r)null!==r[n]?t[n]!==r[n]&&"ychange"!==n&&e.setAttribute(n,r[n]):e.removeAttribute(n);for(const n in t)void 0===r[n]&&e.removeAttribute(n)}const o=Zm(n),i=o.length,s=e.toArray(),a=s.length,l=qc(i,a);let c=0,d=0;for(;c<l;c++){const t=s[c],e=o[c];if(!eA(r.mapping.get(t),e)){if(!tA(t,e))break;r.mapping.set(t,e)}}for(;d+c+1<l;d++){const t=s[a-d-1],e=o[i-d-1];if(!eA(r.mapping.get(t),e)){if(!tA(t,e))break;r.mapping.set(t,e)}}t.transact(()=>{for(;a-c-d>0&&i-c-d>0;){const n=s[c],l=o[c],u=s[a-d-1],h=o[i-d-1];if(n instanceof Gg&&l instanceof Array)Xm(n,l)||rA(n,l,r),c+=1;else{let o=n instanceof qg&&cA(n,l),i=u instanceof qg&&cA(u,h);if(o&&i){const t=nA(n,l,r),e=nA(u,h,r);t.foundMappedChild&&!e.foundMappedChild?i=!1:!t.foundMappedChild&&e.foundMappedChild||t.equalityFactor<e.equalityFactor?o=!1:i=!1}
1o?(lA(t,n,l,r),c+=1):i?(lA(t,u,h,r),d+=1):(r.mapping.delete(e.get(c)),e.delete(c,1),e.insert(c,[Km(l,r)]),c+=1)}}const n=a-c-d;if(1===a&&0===i&&s[0]instanceof Gg?(r.mapping.delete(s[0]),s[0].delete(0,s[0].length)):n>0&&(e.slice(c,c+n).forEach(t=>r.mapping.delete(t)),e.delete(c,n)),c+d<i){const t=[];for(let e=c;e<i-d;e++)t.push(Km(o[e],r));e.insert(c,t)}},Hc)},cA=(t,e)=>!(e instanceof Array)&&t.nodeName===e.type.name,dA=new Set(["paragraph"]),uA=Tl.create({name:"collaboration",priority:1e3,addOptions:()=>({document:null,field:"default",fragment:null}),onCreate(){this.editor.extensionManager.extensions.find(t=>"history"===t.name||"undoRedo"===t.name)&&console.warn('[tiptap warn]: "@tiptap/extension-collaboration" comes with its own history support and is not compatible with "@tiptap/extension-history" or "@tiptap/extension-undo-redo".')},addCommands:()=>({undo:()=>({tr:t,state:e,dispatch:n})=>(t.setMeta("preventDispatch",!0),0!==jc.getState(e).undoManager.undoStack.length&&(!n||(t=>{var e;return null!=(null===(e=jc.getState(t))||void 0===e||null===(e=e.undoManager)||void 0===e?void 0:e.undo())})(e))),redo:()=>({tr:t,state:e,dispatch:n})=>(t.setMeta("preventDispatch",!0),0!==jc.getState(e).undoManager.redoStack.length&&(!n||(t=>{var e;return null!=(null===(e=jc.getState(t))||void 0===e||null===(e=e.undoManager)||void 0===e?void 0:e.redo())})(e)))}),addProseMirrorPlugins(){const t=this.options.fragment?this.options.fragment:this.options.document.getXmlFragment(this.options.field),e=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.protectedNodes,n=void 0===e?dA:e,r=t.trackedOrigins,o=void 0===r?[]:r,i=t.undoManager,s=void 0===i?null:i;return new Ve({key:jc,state:{init:(t,e)=>{const r=Hc.getState(e),i=s||new $f(r.type,{trackedOrigins:new Set([Hc].concat(o)),deleteFilter:t=>((t,e)=>!(t instanceof wm&&t.content instanceof gm&&(t.content.type instanceof jg||t.content.type instanceof qg&&e.has(t.content.type.nodeName))&&0!==t.content.type._length))(t,n),captureTransaction:t=>!1!==t.meta.get("addToHistory")});return{undoManager:i,prevSel:null,hasUndoOps:i.undoStack.length>0,hasRedoOps:i.redoStack.length>0}},apply:(t,e,n,r)=>{const o=Hc.getState(r).binding,i=e.undoManager,s=i.undoStack.length>0,a=i.redoStack.length>0;return o?{undoManager:i,prevSel:Vm(o,n),hasUndoOps:s,hasRedoOps:a}:s!==e.hasUndoOps||a!==e.hasRedoOps?Object.assign({},e,{hasUndoOps:i.undoStack.length>0,hasRedoOps:i.redoStack.length>0}):e}},view:t=>{const e=Hc.getState(t.state),n=jc.getState(t.state).undoManager;return n.on("stack-item-added",n=>{let r=n.stackItem;const o=e.binding;o&&r.meta.set(o,jc.getState(t.state).prevSel)}),n.on("stack-item-popped",t=>{let n=t.stackItem;const r=e.binding;r&&(r.beforeTransactionSelection=n.meta.get(r)||r.beforeTransactionSelection)}),{destroy:()=>{n.destroy()}}}})}(),n=e.spec.view;e.spec.view=t=>{const{undoManager:e}=jc.getState(t.state);e.restore&&(e.restore(),e.restore=()=>{});const r=n?n(t):void 0;return{destroy:()=>{const t=e.trackedOrigins.has(e),n=e._observers;e.restore=()=>{t&&e.trackedOrigins.add(e),e.doc.on("afterTransaction",e.afterTransactionHandler),e._observers=n},(null==r?void 0:r.destroy)&&r.destroy()}}};const r=this.options.onFirstRender,o=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.colors,r=void 0===n?jm:n,o=e.colorMapping,i=void 0===o?new Map:o,s=e.permanentUserData,a=void 0===s?null:s,l=e.onFirstRender,c=void 0===l?()=>{}:l,d=e.mapping,u=!1;const h=new qm(t,d),p=new Ve({props:{editable:t=>{const e=Hc.getState(t);return null==e.snapshot&&null==e.prevSnapshot}},key:Hc,state:{init:(e,n)=>({type:t,doc:t.doc,binding:h,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:r,colorMapping:i,permanentUserData:a}),apply:(t,e)=>{const n=t.getMeta(Hc);if(void 0!==n){e=Object.assign({},e);for(const t in n)e[t]=n[t]}const r=t.getMeta("appendedTransaction");return e.addToHistory=!1!==t.getMeta("addToHistory")&&!(r&&!1===r.getMeta("addToHistory")),e.isChangeOrigin=void 0!==n&&!!n.isChangeOrigin,e.isUndoRedoOperation=void 0!==n&&!!n.isChangeOrigin&&!!n.isUndoRedoOperation,null!==h.prosemirrorView&&(void 0===n||null==n.snapshot&&null==n.prevSnapshot||Im(0,()=>{null!=h.prosemirrorView&&(null==n.restore?h._renderSnapshot(n.snapshot,n.prevSnapshot,e):(h._renderSnapshot(n.snapshot,n.snapshot,e),delete e.restore,delete e.snapshot,delete e.prevSnapshot,h.mux(()=>{h._prosemirrorChanged(h.prosemirrorView.state.doc)})))})),e}},view:t=>(h.initView(t),null==d&&h._forceRerender(),c(),{update:()=>{const e=p.getState(t.state);if(null==e.snapshot&&null==e.prevSnapshot&&(u||null!==t.state.doc.
1content.findDiffStart(t.state.doc.type.createAndFill().content))){if(u=!0,!1===e.addToHistory&&!e.isChangeOrigin){const e=jc.getState(t.state),n=e&&e.undoManager;n&&n.stopCapturing()}h.mux(()=>{e.doc.transact(n=>{n.meta.set("addToHistory",e.addToHistory),h._prosemirrorChanged(t.state.doc)},Hc)})}},destroy:()=>{h.destroy()}})});return p}(t,r?{onFirstRender:r}:{});return[o,e]}});var hA=rc.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,"\n\n"):""}),pA=hA;let fA=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[t]];return e};function gA(t,e){return!e&&(t.preventDefault(),!0)}const mA=t=>{let e="h-"+fA();return"blockHook"===t?"b"+e:"inlineHook"===t?"i"+e:e},AA=(t,e)=>{const n=((t,e)=>{let n=null;return t.descendants((t,r,o)=>{if(t===e)return n=o,!1}),n})(t,e);return!n||0!==e.type.name.indexOf("table")||0!==n.type.name.indexOf("table")},yA=(t,e)=>t.some(t=>t.type===e.type.name),bA=t=>{try{return"string"==typeof t&&t.length>0&&/^[a-zA-Z0-9-_]+$/.test(t)}catch(e){return console.error("[isHookIdValid] Error validating id: ",t,e),!1}},vA=t=>{const e=[];return t.descendants((t,n)=>{e.push(...t.marks.map(t=>({mark:t,pos:n})))}),e};let wA=[],kA=[];const CA=Tl.create({name:"hook",priority:1e4,addOptions(){return{...this.options?.(),HTMLAttributes:{},targets:[],type:"",filterTransaction:null,canPasteGetter:null,canDropContentGetter:null}},addGlobalAttributes(){return[{types:this.options.targets.map(t=>t.type),attributes:{hookId:{default:null,defaultOnSplit:!0,parseHTML:t=>t.getAttribute("id"),renderHTML:t=>({id:t.hookId})},hookType:{default:this.options.type,parseHTML:t=>t.getAttribute("data-hook-type"),renderHTML:t=>({"data-hook-type":t.hookType})}}}]},extendNodeSchema:t=>({allowHooks:ya(fa(t,"allowHooks",{name:t.name,options:t.options}))}),onCreate(){const{view:t,state:e}=this.editor,{tr:n,doc:r}=e,{targets:o}=this.options;da(r,t=>yA(o,t)&&!AA(r,t)&&(!t.attrs.hookId||!bA(t.attrs.hookId))).forEach(({node:t,pos:e})=>{if(AA(r,t)){const r=n.storedMarks;n.setNodeMarkup(e,void 0,{...t.attrs,hookId:mA(this.options.type)}),r&&r.length>0&&n.setStoredMarks(r)}
1});const i=((t,e)=>{const n={},r=[];return da(t,t=>t&&t.type&&yA(e,t)&&t.attrs.hookId).forEach(t=>{const{node:e}=t;n[e.attrs.hookId]?r.push(t):n[e.attrs.hookId]=!0}),r})(r,o);i.forEach(({node:t,pos:e})=>{const r=n.storedMarks;n.setNodeMarkup(e,void 0,{...t.attrs,hookId:mA(this.options.type)}),r&&r.length>0&&n.setStoredMarks(r)}),t.dispatch(n)},onUpdate(){(()=>{if(kA.length>0){const t=new CustomEvent("napkinEventMarksDeleted",{detail:[...kA]});kA=[],document.dispatchEvent(t)}})(),(()=>{if(wA.length>0){const t=new CustomEvent("napkinEventMarksChanged",{detail:[...wA]});wA=[],document.dispatchEvent(t)}})()},addProseMirrorPlugins(){let t=null,e=!1;return[new Ve({key:new Je(this.options.type+"Plugin"),appendTransaction:(t,e,n)=>{const r=vA(e.doc),o=vA(n.doc);((t,e)=>{const n=new Set(t.map(t=>t.mark.attrs.hookId)),r=new Set(e.map(t=>t.mark.attrs.hookId));kA=[...n].filter(t=>!r.has(t))})(r,o),((t,e)=>{const n=[];if(t.forEach((t,r)=>{var o,i;i=e[r],!(o=t)&&!i||o&&i&&o.pos==i.pos||n.push(t)}),n.length>0){const t=n.filter(t=>null!==t.pos&&null!==t.mark.attrs.hookId&&"inlineHookMark"===t.mark.type.name).map(t=>t.mark.attrs.hookId);wA=[...t]}})(r,o);const i=t.some(t=>t.docChanged)&&!e.doc.eq(n.doc),s=this.options.filterTransaction&&t.some(t=>{var e,n;return!(null===(n=(e=this.options).filterTransaction)||void 0===n?void 0:n.call(e,t))});if(!i||s)return;const{tr:a}=n,l=this.options.targets,c=ca(e.doc,[...t]),{mapping:d}=c,u=Ba(c);var h=!1;return u.forEach(({newRange:t,oldRange:r})=>{const o=ua(n.doc,t,t=>yA(l,t)&&AA(n.doc,t)),i=ua(e.doc,r,t=>yA(l,t)&&AA(e.doc,t));1!=h&&(h=((t,e)=>{if(t.length!=e.length)return!1;let n=!1;for(let r=0;r<t.length;r++)if(null!=t[r].node.attrs.textAlign&&null!=e[r].node.attrs.textAlign&&t[r].node.attrs.textAlign!=e[r].node.attrs.textAlign){n=!0;break}return n})(i,o));const s=o.map(({node:t})=>t.attrs.hookId).filter(t=>null!==t),c=((t,e=JSON.stringify)=>{const n={};return t.filter(t=>{const r=e(t);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)})})((u=s).filter((t,e)=>u.indexOf(t)!==e));var u;o.forEach(({node:t,pos:e})=>{if(!AA(n.doc,t))return;var r;const o=null===(r=a.doc.nodeAt(e))||void 0===r?void 0:r.attrs.hookId;if(null===o){var s;i.forEach(({node:t,pos:n})=>{n==e&&"heading"==t.type.name&&(s=t.attrs.hookId)});const r=a.storedMarks||n.storedMarks;return a.setNodeMarkup(e,void 0,{...t.attrs,hookId:s&&bA(s)?s:mA(this.options.type)}),r&&r.length>0&&a.setStoredMarks(r),void(null!=s&&a.setMeta("headingToggled",s))}const{deleted:l}=d.invert().mapResult(e);if(l&&c.includes(o)){const n=a.storedMarks;a.setNodeMarkup(e,void 0,{...t.attrs,hookId:mA(this.options.type)}),n&&n.length>0&&a.setStoredMarks(n)}})}),h&&(t=>{const e=t.map(t=>t.mark.attrs.hookId);wA=[...e]})(o),a.steps.length?(this.options.onTransaction&&this.options.onTransaction(a),a):void 0},view(e){const n=n=>{var r;t=(null===(r=e.dom.parentElement)||void 0===r?void 0:r.contains(n.target))?e.dom.parentElement:null};return window.addEventListener("dragstart",n),{destroy(){window.removeEventListener("dragstart",n)}}},props:{handleDOMEvents:{drop:(n,r)=>{return gA(r,!this.options.canDropContentGetter||!0===this.options.canDropContentGetter())?(e=!1,!0):(t===n.dom.parentElement&&"copy"!==(null===(o=r.dataTransfer)||void 0===o?void 0:o.effectAllowed)||(t=null,e=!0),!1);var o},paste:(t,n)=>this.options.canPasteGetter&&!0!==this.options.canPasteGetter()?(e=!1,n.preventDefault(),n.stopPropagation(),!0):(e=!0,!1)},transformPasted:t=>{if(!e)return t;const{state:n}=this.editor,{doc:r}=n,o=this.options.targets,i=t=>{const e=[];return t.forEach(t=>{if(!t)return;if(t.isText){if(0==t.marks.length)e.push(t);else{const n=[];t.marks.forEach(t=>{"inlineHook"!=t.attrs.hookType&&n.push(t)}),e.push(t.mark(n))}return}if(!yA(o,t)||!AA(r,t))return void e.push(t.copy(i(t.content)));const n=t.type.create({...t.attrs,hookId:null},i(t.content),t.marks);e.push(n)}),M.fromArray(e)};return e=!1,new N(i(t.content),t.openStart,t.openEnd)}}})]}});function xA(t,e){return t.commands.first(({commands:t})=>e(t))}function SA(t,e,n){const r=Math.min(n,5e3),o=[];for(let t=0;t<r;t++)o.push({type:"paragraph",attrs:{hookId:mA("blockHook"),hookType:"blockHook"}});return t.insertContentAt(e,o,{updateSelection:!1}),!0}function EA(t){return t&&t.type&&"paragraph"===t.type.name&&""===t.textContent}function MA(t,e,n){let r=t.dom;if(!r||!r.getBoundingClientRect)return!1;let o=r.getBoundingClientRect().top+n,i=t.nodeDOM(e);return!(!i||!i.getBoundingClientRect)&&i.getBoundingClientRect().top>o}const TA=hA.extend({content:"title block*",addOptions(){return{...this.options?.(),lineHeight:25,lineHeightThreshold:25,lineHeightThresholdDeletion:250}},addCommands(){return{insertBlankLines:(t,e,n)=>({editor:r,tr:o,dispatch:i,commands:s,state:a,view:l,chain:c})=>(o.setMeta("addToHistory",n),SA(s,t,e)),deleteRangeWithHistory:(t,e,n)=>({editor:r,tr:o,dispatch:i,commands:s,state:a,view:l,chain:c})=>(o.setMeta("addToHistory",n),s.deleteRange({from:t,to:e}),!0),expandContent:t=>({editor:e,tr:n,dispatch:r,commands:o,state:i,view:s,chain:a})=>{let l=s.dom,c=l.lastElementChild;if(!l||!c)return!1;const d=this.options.domScaleGetter()||1;let u=l.getBoundingClientRect(),h=c.getBoundingClientRect(),p=Math.floor((h.bottom-u.top)/d),f=p-t;if(p<=0)return console.warn("[expandContent] currentHeight is 0: ",{currentHeight:p,height:t,deltaHeight:f}),!1;if(f>0&&f<this.options.lineHeightThreshold)return!1;if(f<0){if(f<-500&&console.debug("[expandContent] large delta detected (adding lines): ",{currentHeight:p,height:t,deltaHeight:f}),r){let t=Math.abs(f)+this.options.lineHeightThreshold,e=Math.ceil(t/this.options.lineHeight);n.setMeta("addToHistory",!1),SA(o,i.doc.content.size,e)}return!0}if(f>this.options.lineHeightThresholdDeletion){if(f>500&&console.debug("[expandContent] large delta detected (removing lines): ",{currentHeight:p,height:t,deltaHeight:f}),r){let e=t+this.options.lineHeightThresholdDeletion;n.setMeta("addToHistory",!1),function(t,e,n,r){if(!r||r<=0)return;if(!t.doc.content.lastChild)return;let o=t.doc.nodeSize-1-1,i=o,s=o;for(let e=t.doc.childCount-1;e>0;e--){let o=t.doc.child(e);if(!o||!EA(o))break;let i=s-o.nodeSize;if(!MA(n,i,r))break;s=i}s!==i&&e.deleteRange({from:s,to:i})}(i,o,s,e)}return!0}return!1},clearSlashCommand:t=>({tr:e,dispatch:n,commands:r,chain:o})=>(console.assert(t,"command must be valid"),"slash"!=t.name?(console.warn("clearCommand: command is not slash"),!1):n?(t.steps&&t.steps.forEach(t=>{e.step(t)}),r.blur()):(e.setMeta("addToHistory",!1),!0))}}}),_A=TA,DA={};function OA(t,e){"string"!=typeof e&&(e=OA.defaultChars);const n=function(t){let e=DA[t];if(e)return e;e=DA[t]=[];for(let t=0;t<128;t++){const n=String.fromCharCode(t);e.push(n)}for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return e}(e);return t.replace(/(%[a-f0-9]{2})+/gi,function(t){let e="";for(let r=0,o=t.length;r<o;r+=3){const i=parseInt(t.slice(r+1,r+3),16);if(i<128)e+=n[i];else{if(192==(224&i)&&r+3<o){const n=parseInt(t.slice(r+4,r+6),16);if(128==(192&n)){const t=i<<6&1984|63&n;e+=t<128?"��":String.fromCharCode(t),r+=3;continue}}if(224==(240&i)&&r+6<o){const n=parseInt(t.slice(r+4,r+6),16),o=parseInt(t.slice(r+7,r+9),16);if(128==(192&n)&&128==(192&o)){const t=i<<12&61440|n<<6&4032|63&o;e+=t<2048||t>=55296&&t<=57343?"���":String.fromCharCode(t),r+=6;continue}}if(240==(248&i)&&r+9<o){const n=parseInt(t.slice(r+4,r+6),16),o=parseInt(t.slice(r+7,r+9),16),s=parseInt(t.slice(r+10,r+12),16);if(128==(192&n)&&128==(192&o)&&128==(192&s)){let t=i<<18&1835008|n<<12&258048|o<<6&4032|63&s;t<65536||t>1114111?e+="����":(t-=65536,e+=String.fromCharCode(55296+(t>>10),56320+(1023&t))),r+=9;continue}}e+="�"}}return e})}OA.defaultChars=";/?:@&=+$,#",OA.componentChars="";const IA=OA,NA={};function LA(t,e,n){"string"!=typeof e&&(n=e,e=LA.defaultChars),void 0===n&&(n=!0);const r=function(t){let e=NA[t];if(e)return e;e=NA[t]=[];for(let t=0;t<128;t++){const n=String.fromCharCode(t);/^[0-9a-z]$/i.test(n)?e.push(n):e.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<t.length;n++)e[t.charCodeAt(n)]=t[n];return e}(e);let o="";for(let e=0,i=t.length;e<i;e++){const s=t.charCodeAt(e);if(n&&37===s&&e+2<i&&/^[0-9a-f]{2}$/i.test(t.slice(e+1,e+3)))o+=t.slice(e,e+3),e+=2;else if(s<128)o+=r[s];else if(s>=55296&&s<=57343){if(s>=55296&&s<=56319&&e+1<i){const n=t.charCodeAt(e+1);if(n>=56320&&n<=57343){o+=encodeURIComponent(t[e]+t[e+1]),e++;continue}}
1o+="%EF%BF%BD"}else o+=encodeURIComponent(t[e])}return o}LA.defaultChars=";/?:@&=+$,-_.!~*'()#",LA.componentChars="-_.!~*'()";const BA=LA;function $A(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&-1!==t.hostname.indexOf(":")?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}function RA(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const PA=/^([a-z0-9.+-]+:)/i,FA=/:[0-9]*$/,zA=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,HA=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),jA=["'"].concat(HA),UA=["%","/","?",";","#"].concat(jA),VA=["/","?","#"],qA=/^[+a-z0-9A-Z_-]{0,63}$/,WA=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,JA={javascript:!0,"javascript:":!0},GA={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};RA.prototype.parse=function(t,e){let n,r,o,i=t;if(i=i.trim(),!e&&1===t.split("#").length){const t=zA.exec(i);if(t)return this.pathname=t[1],t[2]&&(this.search=t[2]),this}let s=PA.exec(i);if(s&&(s=s[0],n=s.toLowerCase(),this.protocol=s,i=i.substr(s.length)),(e||s||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o="//"===i.substr(0,2),!o||s&&JA[s]||(i=i.substr(2),this.slashes=!0)),!JA[s]&&(o||s&&!GA[s])){let t,e,n=-1;for(let t=0;t<VA.length;t++)r=i.indexOf(VA[t]),-1!==r&&(-1===n||r<n)&&(n=r);e=-1===n?i.lastIndexOf("@"):i.lastIndexOf("@",n),-1!==e&&(t=i.slice(0,e),i=i.slice(e+1),this.auth=t),n=-1;for(let t=0;t<UA.length;t++)r=i.indexOf(UA[t]),-1!==r&&(-1===n||r<n)&&(n=r);-1===n&&(n=i.length),":"===i[n-1]&&n--;const o=i.slice(0,n);i=i.slice(n),this.parseHost(o),this.hostname=this.hostname||"";const s="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!s){const t=this.hostname.split(/\./);for(let e=0,n=t.length;e<n;e++){const n=t[e];if(n&&!n.match(qA)){let r="";for(let t=0,e=n.length;t<e;t++)n.charCodeAt(t)>127?r+="x":r+=n[t];if(!r.match(qA)){const r=t.slice(0,e),o=t.slice(e+1),s=n.match(WA);s&&(r.push(s[1]),o.unshift(s[2])),o.length&&(i=o.join(".")+i),this.hostname=r.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),s&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=i.indexOf("#");-1!==a&&(this.hash=i.substr(a),i=i.slice(0,a));const l=i.indexOf("?");return-1!==l&&(this.search=i.substr(l),i=i.slice(0,l)),i&&(this.pathname=i),GA[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this},RA.prototype.parseHost=function(t){let e=FA.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 KA=function(t,e){if(t&&t instanceof RA)return t;const n=new RA;return n.parse(t,e),n},YA=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,QA=/[\$\+<->
1\^`\|~\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]/,ZA=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,XA=/[\0-\x1F\x7F-\x9F]/,ty=/[\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]/,ey=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,ny
vendor: 26,667 bytes, line 1
1=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୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢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;怳Ādp໩໮uct;戏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ǣጓ\0጖y;䐎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Ā;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀ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Ā;e᜚᜜lƀ;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\0á«¢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩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ↄⅪ←ٖ↛ǰ↉\0↎proø₞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;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\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\0â¹»m;櫳;櫽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(
vendor: 5,854 bytes, line 1
1t=>t.charCodeAt(0))),ry=new Uint16Array("Ȁaglq\t���É­�\0\0�p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var oy;const iy=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]]),sy=null!==(oy=String.fromCodePoint)&&void 0!==oy?oy:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|1023&t),e+=String.fromCharCode(t),e};var ay,ly,cy,dy;function uy(t){return t>=ay.ZERO&&t<=ay.NINE}function hy(t){return t>=ay.UPPER_A&&t<=ay.UPPER_F||t>=ay.LOWER_A&&t<=ay.LOWER_F}function py(t){return t===ay.EQUALS||function(t){return t>=ay.UPPER_A&&t<=ay.UPPER_Z||t>=ay.LOWER_A&&t<=ay.LOWER_Z||uy(t)}(t)}!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"}(ay||(ay={})),function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"}(ly||(ly={})),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"}(cy||(cy={})),function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"}(dy||(dy={}));class fy{constructor(t,e,n){this.decodeTree=t,this.emitCodePoint=e,this.errors=n,this.state=cy.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=dy.Strict}startEntity(t){this.decodeMode=t,this.state=cy.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,e){switch(this.state){case cy.EntityStart:return t.charCodeAt(e)===ay.NUM?(this.state=cy.NumericStart,this.consumed+=1,this.stateNumericStart(t,e+1)):(this.state=cy.NamedEntity,this.stateNamedEntity(t,e));case cy.NumericStart:return this.stateNumericStart(t,e);case cy.NumericDecimal:return this.stateNumericDecimal(t,e);case cy.NumericHex:return this.stateNumericHex(t,e);case cy.NamedEntity:return this.stateNamedEntity(t,e)}}stateNumericStart(t,e){return e>=t.length?-1:(32|t.charCodeAt(e))===ay.LOWER_X?(this.state=cy.NumericHex,this.consumed+=1,this.stateNumericHex(t,e+1)):(this.state=cy.NumericDecimal,this.stateNumericDecimal(t,e))}addToNumericResult(t,e,n,r){if(e!==n){const o=n-e;this.result=this.result*Math.pow(r,o)+parseInt(t.substr(e,o),r),this.consumed+=o}}stateNumericHex(t,e){const n=e;for(;e<t.length;){const r=t.charCodeAt(e);if(!uy(r)&&!hy(r))return this.addToNumericResult(t,n,e,16),this.emitNumericEntity(r,3);e+=1}return this.addToNumericResult(t,n,e,16),-1}stateNumericDecimal(t,e){const n=e;for(;e<t.length;){const r=t.charCodeAt(e);if(!uy(r))return this.addToNumericResult(t,n,e,10),this.emitNumericEntity(r,2);e+=1}return this.addToNumericResult(t,n,e,10),-1}emitNumericEntity(t,e){var n;if(this.consumed<=e)return null===(n=this.errors)||void 0===n||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===ay.SEMI)this.consumed+=1;else if(this.decodeMode===dy.Strict)return 0;return this.emitCodePoint(function(t){var e;return t>=55296&&t<=57343||t>1114111?65533:null!==(e=iy.get(t))&&void 0!==e?e:t}(this.result),this.consumed),this.errors&&(t!==ay.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,e){const{decodeTree:n}=this;let r=n[this.treeIndex],o=(r&ly.VALUE_LENGTH)>>14;for(;e<t.length;e++,this.excess++){const i=t.charCodeAt(e);if(this.treeIndex=my(n,r,this.treeIndex+Math.max(1,o),i),this.treeIndex<0)return 0===this.result||this.decodeMode===dy.Attribute&&(0===o||py(i))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],o=(r&ly.VALUE_LENGTH)>>14,0!==o){if(i===ay.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==dy.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:e,decodeTree:n}=this,r=(n[e]&ly.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,r,this.consumed),null===(t=this.errors)||void 0===t||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,e,n){const{decodeTree:r}=this;return this.emitCodePoint(1===e?r[t]&~ly.VALUE_LENGTH:r[t+1],n),3===e&&this.emitCodePoint(r[t+2],n),n}end(){var t;switch(this.state){case cy.NamedEntity:return 0===this.result||this.decodeMode===dy.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case cy.NumericDecimal:return this.emitNumericEntity(0,2);case cy.NumericHex:return this.emitNumericEntity(0,3);case cy.NumericStart:return null===(t=this.errors)||void 0===t||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case cy.EntityStart:return 0}}}function gy(t){let e="";const n=new fy(t,t=>e+=sy(t));return function(t,r){let o=0,i=0;for(;(i=t.indexOf("&",i))>=0;){e+=t.slice(o,i),n.startEntity(r);const s=n.write(t,i+1);if(s<0){o=i+n.end();break}o=i+s,i=0===s?o+1:o}const s=e+t.slice(o);return e="",s}}function my(t,e,n,r){const o=(e&ly.BRANCH_LENGTH)>>7,i=e&ly.JUMP_TABLE;if(0===o)return 0!==i&&r===i?n:-1;if(i){const e=r-i;return e<0||e>=o?-1:t[n+e]-1}let s=n,a=s+o-1;for(;s<=a;){const e=s+a>>>1,n=t[e];if(n<r)s=e+1;else{if(!(n>r))return t[e+o];a=e-1}}return-1}const Ay=gy(ny);function yy(t){return"[object String]"===function(t){return Object.prototype.toString.call(t)}(t)}gy(ry);const by=Object.prototype.hasOwnProperty;function vy(t,e){return by.call(t,e)}
1function wy(t){return Array.prototype.slice.call(arguments,1).forEach(function(e){if(e){if("object"!=typeof e)throw new TypeError(e+"must be object");Object.keys(e).forEach(function(n){t[n]=e[n]})}}),t}function ky(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))}function Cy(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||!(65535&~t&&65534!=(65535&t))||t>=0&&t<=8||11===t||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}function xy(t){if(t>65535){const e=55296+((t-=65536)>>10),n=56320+(1023&t);return String.fromCharCode(e,n)}return String.fromCharCode(t)}const Sy=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Ey=new RegExp(Sy.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),My=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Ty(t){return t.indexOf("\\")<0?t:t.replace(Sy,"$1")}function _y(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(Ey,function(t,e,n){return e||function(t,e){if(35===e.charCodeAt(0)&&My.test(e)){const n="x"===e[1].toLowerCase()?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return Cy(n)?xy(n):t}const n=function(t,e=dy.Legacy){return Ay(t,e)}(t);return n!==t?n:t}(t,n)})}const Dy=/[&<>"]/,Oy=/[&<>"]/g,Iy={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function Ny(t){return Iy[t]}function Ly(t){return Dy.test(t)?t.replace(Oy,Ny):t}const By=/[.?*+^$[\]\\(){}|-]/g;function $y(t){return t.replace(By,"\\$&")}function Ry(t){switch(t){case 9:case 32:return!0}return!1}function Py(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}function Fy(t){return YA.test(t)||QA.test(t)}function zy(t){return Fy(xy(t))}function Hy(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}}function jy(t){return t=t.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}function Uy(t){return 32===t||9===t||10===t||13===t}function Vy(t){let e=0;for(;e<t.length&&Uy(t.charCodeAt(e));e++);let n=t.length-1;for(;n>=e&&Uy(t.charCodeAt(n));n--);return t.slice(e,n+1)}const qy={mdurl:A,ucmicro:y};function Wy(t,e,n){let r,o,i,s;const a=t.posMax,l=t.pos;for(t.pos=e+1,r=1;t.pos<a;){if(i=t.src.charCodeAt(t.pos),93===i&&(r--,0===r)){o=!0;break}if(s=t.pos,t.md.inline.skipToken(t),91===i)if(s===t.pos-1)r++;else if(n)return t.pos=l,-1}let c=-1;return o&&(c=t.pos),t.pos=l,c}function Jy(t,e,n){let r,o=e;const i={ok:!1,pos:0,str:""};if(60===t.charCodeAt(o)){for(o++;o<n;){if(r=t.charCodeAt(o),10===r)return i;if(60===r)return i;if(62===r)return i.pos=o+1,i.str=_y(t.slice(e+1,o)),i.ok=!0,i;92===r&&o+1<n?o+=2:o++}return i}let s=0;for(;o<n&&(r=t.charCodeAt(o),32!==r)&&!(r<32||127===r);)if(92===r&&o+1<n){if(32===t.charCodeAt(o+1)){o++;continue}o+=2}else{if(40===r&&(s++,s>32))return i;if(41===r){if(0===s)break;s--}o++}return e===o||0!==s||(i.str=_y(t.slice(e,o)),i.pos=o,i.ok=!0),i}function Gy(t,e,n,r){let o,i=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(i>=n)return s;let r=t.charCodeAt(i);if(34!==r&&39!==r&&40!==r)return s;e++,i++,40===r&&(r=41),s.marker=r}for(;i<n;){if(o=t.charCodeAt(i),o===s.marker)return s.pos=i+1,s.str+=_y(t.slice(e,i)),s.ok=!0,s;if(40===o&&41===s.marker)return s;92===o&&i+1<n&&i++,i++}return s.can_continue=!0,s.str+=_y(t.slice(e,i)),s}const Ky={};function Yy(){this.rules=wy({},Ky)}Ky.code_inline=function(t,e,n,r,o){const i=t[e];return"<code"+o.renderAttrs(i)+">"+Ly(i.content)+"</code>"},Ky.code_block=function(t,e,n,r,o){const i=t[e];return"<pre"+o.renderAttrs(i)+"><code>"+Ly(t[e].content)+"</code></pre>\n"},Ky.fence=function(t,e,n,r,o){const i=t[e],s=i.info?_y(i.info).trim():"";let a,l="",c="";if(s){const t=s.split(/(\s+)/g);l=t[0],c=t.slice(2).join("")}if(a=n.highlight&&n.highlight(i.content,l,c)||Ly(i.content),0===a.indexOf("<pre"))return a+"\n";if(s){const t=i.attrIndex("class"),e=i.attrs?i.attrs.slice():[];t<0?e.push(["class",n.langPrefix+l]):(e[t]=e[t].slice(),e[t][1]+=" "+n.langPrefix+l);const r={attrs:e};return`<pre><code${o.renderAttrs(r)}>${a}</code></pre>\n`}return`<pre><code${o.renderAttrs(i)}>${a}</code></pre>\n`},Ky.image=function(t,e,n,r,o){const i=t[e];return i.attrs[i.attrIndex("alt")][1]=o.renderInlineAsText(i.children,n,r),o.renderToken(t,e,n)},Ky.hardbreak=function(t,e,n){return n.xhtmlOut?"<br />\n":"<br>\n"},Ky.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},Ky.text=function(t,e){return Ly(t[e].content)},Ky.html_block=function(t,e){return t[e].content},Ky.html_inline=function(t,e){return t[e].content},Yy.prototype.renderAttrs=function(t){let e,n,r;if(!t.attrs)return"";for(r="",e=0,n=t.attrs.length;e<n;e++)r+=" "+Ly(t.attrs[e][0])+'="'+Ly(t.attrs[e][1])+'"';return r},Yy.prototype.renderToken=function(t,e,n){const r=t[e];let o="";if(r.hidden)return"";r.block&&-1!==r.nesting&&e&&t[e-1].hidden&&(o+="\n"),o+=(-1===r.nesting?"</":"<")+r.tag,o+=this.renderAttrs(r),0===r.nesting&&n.xhtmlOut&&(o+=" /");let i=!1;if(r.block&&(i=!0,1===r.nesting&&e+1<t.length)){const n=t[e+1];("inline"===n.type||n.hidden||-1===n.nesting&&n.tag===r.tag)&&(i=!1)}return o+=i?">\n":">",o},Yy.prototype.renderInline=function(t,e,n){let r="";
1const o=this.rules;for(let i=0,s=t.length;i<s;i++){const s=t[i].type;void 0!==o[s]?r+=o[s](t,i,e,n,this):r+=this.renderToken(t,i,e)}return r},Yy.prototype.renderInlineAsText=function(t,e,n){let r="";for(let o=0,i=t.length;o<i;o++)switch(t[o].type){case"text":case"html_inline":case"html_block":r+=t[o].content;break;case"image":r+=this.renderInlineAsText(t[o].children,e,n);break;case"softbreak":case"hardbreak":r+="\n"}return r},Yy.prototype.render=function(t,e,n){let r="";const o=this.rules;for(let i=0,s=t.length;i<s;i++){const s=t[i].type;"inline"===s?r+=this.renderInline(t[i].children,e,n):void 0!==o[s]?r+=o[s](t,i,e,n,this):r+=this.renderToken(t,i,e,n)}return r};const Qy=Yy;function Zy(){this.__rules__=[],this.__cache__=null}Zy.prototype.__find__=function(t){for(let e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1},Zy.prototype.__compile__=function(){const t=this,e=[""];t.__rules__.forEach(function(t){t.enabled&&t.alt.forEach(function(t){e.indexOf(t)<0&&e.push(t)})}),t.__cache__={},e.forEach(function(e){t.__cache__[e]=[],t.__rules__.forEach(function(n){n.enabled&&(e&&n.alt.indexOf(e)<0||t.__cache__[e].push(n.fn))})})},Zy.prototype.at=function(t,e,n){const r=this.__find__(t),o=n||{};if(-1===r)throw new Error("Parser rule not found: "+t);this.__rules__[r].fn=e,this.__rules__[r].alt=o.alt||[],this.__cache__=null},Zy.prototype.before=function(t,e,n,r){const o=this.__find__(t),i=r||{};if(-1===o)throw new Error("Parser rule not found: "+t);this.__rules__.splice(o,0,{name:e,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null},Zy.prototype.after=function(t,e,n,r){const o=this.__find__(t),i=r||{};if(-1===o)throw new Error("Parser rule not found: "+t);this.__rules__.splice(o+1,0,{name:e,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null},Zy.prototype.push=function(t,e,n){const r=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:r.alt||[]}),this.__cache__=null},Zy.prototype.enable=function(t,e){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(t){const r=this.__find__(t);if(r<0){if(e)return;throw new Error("Rules manager: invalid rule name "+t)}this.__rules__[r].enabled=!0,n.push(t)},this),this.__cache__=null,n},Zy.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(t){t.enabled=!1}),this.enable(t,e)},Zy.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(t){const r=this.__find__(t);if(r<0){if(e)return;throw new Error("Rules manager: invalid rule name "+t)}this.__rules__[r].enabled=!1,n.push(t)},this),this.__cache__=null,n},Zy.prototype.getRules=function(t){return null===this.__cache__&&this.__compile__(),this.__cache__[t]||[]};const Xy=Zy;function tb(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}tb.prototype.attrIndex=function(t){if(!this.attrs)return-1;const e=this.attrs;for(let n=0,r=e.length;n<r;n++)if(e[n][0]===t)return n;return-1},tb.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]},tb.prototype.attrSet=function(t,e){const n=this.attrIndex(t),r=[t,e];n<0?this.attrPush(r):this.attrs[n]=r},tb.prototype.attrGet=function(t){const e=this.attrIndex(t);let n=null;return e>=0&&(n=this.attrs[e][1]),n},tb.prototype.attrJoin=function(t,e){const n=this.attrIndex(t);n<0?this.attrPush([t,e]):this.attrs[n][1]=this.attrs[n][1]+" "+e};const eb=tb;function nb(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}nb.prototype.Token=eb;const rb=nb,ob=/\r\n?|\n/g,ib=/\0/g;function sb(t){return/^<a[>\s]/i.test(t)}function ab(t){return/^<\/a\s*>/i.test(t)}const lb=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,cb=/\((c|tm|r)\)/i,db=/\((c|tm|r)\)/gi,ub={c:"©",r:"®",tm:"™"};function hb(t,e){return ub[e.toLowerCase()]}function pb(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];"text"!==r.type||e||(r.content=r.content.replace(db,hb)),"link_open"===r.type&&"auto"===r.info&&e--,"link_close"===r.type&&"auto"===r.info&&e++}}function fb(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];"text"!==r.type||e||lb.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(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),"link_open"===r.type&&"auto"===r.info&&e--,"link_close"===r.type&&"auto"===r.info&&e++}}const gb=/['"]/,mb=/['"]/g;function Ab(t,e,n,r){t[e]||(t[e]=[]),t[e].push({pos:n,ch:r})}function yb(t,e){let n;const r=[],o={};for(let i=0;i<t.length;i++){const s=t[i],a=t[i].level;for(n=r.length-1;n>=0&&!(r[n].level<=a);n--);if(r.length=n+1,"text"!==s.type)continue;const l=s.content;let c=0;const d=l.length;t:for(;c<d;){mb.lastIndex=c;const s=mb.exec(l);if(!s)break;let u=!0,h=!0;c=s.index+1;const p="'"===s[0];let f=32;if(s.index-1>=0)f=l.charCodeAt(s.index-1);else for(n=i-1;n>=0&&"softbreak"!==t[n].type&&"hardbreak"!==t[n].type;n--)if(t[n].content){f=t[n].content.charCodeAt(t[n].content.length-1);break}let g=32;if(c<d)g=l.charCodeAt(c);else for(n=i+1;n<t.length&&"softbreak"!==t[n].type&&"hardbreak"!==t[n].type;n++)if(t[n].content){g=t[n].content.charCodeAt(0);break}const m=Hy(f)||zy(f),A=Hy(g)||zy(g),y=Py(f),b=Py(g);if(b?u=!1:A&&(y||m||(u=!1)),y?h=!1:m&&(b||A||(h=!1)),34===g&&'"'===s[0]&&f>=48&&f<=57&&(h=u=!1),u&&h&&(u=m,h=A),u||h){if(h)for(n=r.length-1;n>=0;n--){let t=r[n];if(r[n].level<a)break;if(t.single===p&&r[n].level===a){let a,l;t=r[n],p?(a=e.md.options.quotes[2],l=e.md.options.quotes[3]):(a=e.md.options.quotes[0],l=e.md.options.quotes[1]),Ab(o,i,s.index,l),Ab(o,t.token,t.pos,a),r.length=n;continue t}}u?r.push({token:i,pos:s.index,single:p,level:a}):h&&p&&Ab(o,i,s.index,"’")}else p&&Ab(o,i,s.index,"’")}}
1Object.keys(o).forEach(function(e){t[e].content=function(t,e){let n="",r=0;e.sort((t,e)=>t.pos-e.pos);for(let o=0;o<e.length;o++){const i=e[o];n+=t.slice(r,i.pos)+i.ch,r=i.pos+1}return n+t.slice(r)}(t[e].content,o[e])})}const bb=[["normalize",function(t){let e;e=t.src.replace(ob,"\n"),e=e.replace(ib,"�"),t.src=e}],["block",function(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)}],["inline",function(t){const e=t.tokens;for(let n=0,r=e.length;n<r;n++){const r=e[n];"inline"===r.type&&t.md.inline.parse(r.content,t.md,t.env,r.children)}}],["linkify",function(t){const e=t.tokens;if(t.md.options.linkify)for(let n=0,r=e.length;n<r;n++){if("inline"!==e[n].type||!t.md.linkify.pretest(e[n].content))continue;const r=e[n].children,o=[];let i=0;for(let e=r.length-1;e>=0;e--){const n=r[e];if("link_close"!==n.type){if("html_inline"===n.type&&(sb(n.content)&&i>0&&i--,ab(n.content)&&i++),!(i>0)&&"text"===n.type&&t.md.linkify.test(n.content)){const i=n.content;let s=t.md.linkify.match(i);const a=[];let l=n.level,c=0;s.length>0&&0===s[0].index&&e>0&&"text_special"===r[e-1].type&&(s=s.slice(1));for(let e=0;e<s.length;e++){const n=s[e].url,r=t.md.normalizeLink(n);if(!t.md.validateLink(r))continue;let o=s[e].text;o=s[e].schema?"mailto:"!==s[e].schema||/^mailto:/i.test(o)?t.md.normalizeLinkText(o):t.md.normalizeLinkText("mailto:"+o).replace(/^mailto:/,""):t.md.normalizeLinkText("http://"+o).replace(/^http:\/\//,"");const d=s[e].index;if(d>c){const e=new t.Token("text","",0);e.content=i.slice(c,d),e.level=l,a.push(e)}const u=new t.Token("link_open","a",1);u.attrs=[["href",r]],u.level=l++,u.markup="linkify",u.info="auto",a.push(u);const h=new t.Token("text","",0);h.content=o,h.level=l,a.push(h);const p=new t.Token("link_close","a",-1);p.level=--l,p.markup="linkify",p.info="auto",a.push(p),c=s[e].lastIndex}if(c<i.length){const e=new t.Token("text","",0);e.content=i.slice(c),e.level=l,a.push(e)}o.push({index:e,nodes:a})}}else for(e--;r[e].level!==n.level&&"link_open"!==r[e].type;)e--}if(o.length>0){let t=r.length;for(const e of o)t+=e.nodes.length-1;const i=new Array(t);let s=0,a=0;o.reverse();for(let t=0;t<r.length;t++){const e=o[s];if(e?.index===t){for(const t of e.nodes)i[a++]=t;s++}else i[a++]=r[t]}e[n].children=i}}}],["replacements",function(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)"inline"===t.tokens[e].type&&(cb.test(t.tokens[e].content)&&pb(t.tokens[e].children),lb.test(t.tokens[e].content)&&fb(t.tokens[e].children))}],["smartquotes",function(t){if(t.md.options.typographer)for(let e=t.tokens.length-1;e>=0;e--)"inline"===t.tokens[e].type&&gb.test(t.tokens[e].content)&&yb(t.tokens[e].children,t)}],["text_join",function(t){let e,n;const r=t.tokens,o=r.length;for(let t=0;t<o;t++){if("inline"!==r[t].type)continue;const o=r[t].children,i=o.length;for(e=0;e<i;e++)"text_special"===o[e].type&&(o[e].type="text");for(e=n=0;e<i;e++)"text"===o[e].type&&e+1<i&&"text"===o[e+1].type?o[e+1].content=o[e].content+o[e+1].content:(e!==n&&(o[n]=o[e]),n++);e!==n&&(o.length=n)}}]];function vb(){this.ruler=new Xy;for(let t=0;t<bb.length;t++)this.ruler.push(bb[t][0],bb[t][1])}vb.prototype.process=function(t){const e=this.ruler.getRules("");for(let n=0,r=e.length;n<r;n++)e[n](t)},vb.prototype.State=rb;const wb=vb;function kb(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 o=this.src;for(let t=0,e=0,n=0,r=0,i=o.length,s=!1;e<i;e++){const a=o.charCodeAt(e);if(!s){if(Ry(a)){n++,9===a?r+=4-r%4:r++;continue}s=!0}10!==a&&e!==i-1||(10!==a&&e++,this.bMarks.push(t),this.eMarks.push(e),this.tShift.push(n),this.sCount.push(r),this.bsCount.push(0),s=!1,n=0,r=0,t=e+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}kb.prototype.push=function(t,e,n){const r=new eb(t,e,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},kb.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},kb.prototype.skipEmptyLines=function(t){for(let e=this.lineMax;t<e&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t},kb.prototype.skipSpaces=function(t){for(let e=this.src.length;
1t<e&&Ry(this.src.charCodeAt(t));t++);return t},kb.prototype.skipSpacesBack=function(t,e){if(t<=e)return t;for(;t>e;)if(!Ry(this.src.charCodeAt(--t)))return t+1;return t},kb.prototype.skipChars=function(t,e){for(let n=this.src.length;t<n&&this.src.charCodeAt(t)===e;t++);return t},kb.prototype.skipCharsBack=function(t,e,n){if(t<=n)return t;for(;t>n;)if(e!==this.src.charCodeAt(--t))return t+1;return t},kb.prototype.getLines=function(t,e,n,r){if(t>=e)return"";const o=new Array(e-t);for(let i=0,s=t;s<e;s++,i++){let t=0;const a=this.bMarks[s];let l,c=a;for(l=s+1<e||r?this.eMarks[s]+1:this.eMarks[s];c<l&&t<n;){const e=this.src.charCodeAt(c);if(Ry(e))9===e?t+=4-(t+this.bsCount[s])%4:t++;else{if(!(c-a<this.tShift[s]))break;t++}c++}o[i]=t>n?new Array(t-n+1).join(" ")+this.src.slice(c,l):this.src.slice(c,l)}return o.join("")},kb.prototype.Token=eb;const Cb=kb;function xb(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];return t.src.slice(n,r)}function Sb(t){const e=[],n=t.length;let r=0,o=t.charCodeAt(r),i=!1,s=0,a="";for(;r<n;)124===o&&(i?(a+=t.substring(s,r-1),s=r):(e.push(a+t.substring(s,r)),a="",s=r+1)),i=92===o,r++,o=t.charCodeAt(r);return e.push(a+t.substring(s)),e}function Eb(t,e){const n=t.eMarks[e];let r=t.bMarks[e]+t.tShift[e];const o=t.src.charCodeAt(r++);return 42!==o&&45!==o&&43!==o||r<n&&!Ry(t.src.charCodeAt(r))?-1:r}function Mb(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];let o=n;if(o+1>=r)return-1;let i=t.src.charCodeAt(o++);if(i<48||i>57)return-1;for(;;){if(o>=r)return-1;if(i=t.src.charCodeAt(o++),!(i>=48&&i<=57)){if(41===i||46===i)break;return-1}if(o-n>=10)return-1}return o<r&&(i=t.src.charCodeAt(o),!Ry(i))?-1:o}const Tb="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",_b="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Db=new RegExp("^(?:"+Tb+"|"+_b+"|\x3c!---?>|\x3c!--(?:[^-]|-[^-]|--[^>])*--\x3e|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),Ob=new RegExp("^(?:"+Tb+"|"+_b+")"),Ib=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Za-z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+["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"].join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(Ob.source+"\\s*$"),/^$/,!1]],Nb=[["table",function(t,e,n,r){if(e+2>n)return!1;let o=e+1;if(t.sCount[o]<t.blkIndent)return!1;if(t.sCount[o]-t.blkIndent>=4)return!1;let i=t.bMarks[o]+t.tShift[o];if(i>=t.eMarks[o])return!1;const s=t.src.charCodeAt(i++);if(124!==s&&45!==s&&58!==s)return!1;if(i>=t.eMarks[o])return!1;const a=t.src.charCodeAt(i++);if(124!==a&&45!==a&&58!==a&&!Ry(a))return!1;if(45===s&&Ry(a))return!1;for(;i<t.eMarks[o];){const e=t.src.charCodeAt(i);if(124!==e&&45!==e&&58!==e&&!Ry(e))return!1;i++}let l=xb(t,e+1),c=l.split("|");const d=[];for(let t=0;t<c.length;t++){const e=c[t].trim();if(!e){if(0===t||t===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(e))return!1;58===e.charCodeAt(e.length-1)?d.push(58===e.charCodeAt(0)?"center":"right"):58===e.charCodeAt(0)?d.push("left"):d.push("")}if(l=xb(t,e).trim(),-1===l.indexOf("|"))return!1;if(t.sCount[e]-t.blkIndent>=4)return!1;c=Sb(l),c.length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop();const u=c.length;if(0===u||u!==d.length)return!1;if(r)return!0;const h=t.parentType;t.parentType="table";const p=t.md.block.ruler.getRules("blockquote"),f=[e,0];t.push("table_open","table",1).map=f,t.push("thead_open","thead",1).map=[e,e+1],t.push("tr_open","tr",1).map=[e,e+1];for(let e=0;e<c.length;e++){const n=t.push("th_open","th",1);d[e]&&(n.attrs=[["style","text-align:"+d[e]]]);const r=t.push("inline","",0);r.content=c[e].trim(),r.children=[],t.push("th_close","th",-1)}let g;t.push("tr_close","tr",-1),t.push("thead_close","thead",-1);let m=0;for(o=e+2;o<n&&!(t.sCount[o]<t.blkIndent);o++){let r=!1;for(let e=0,i=p.length;e<i;e++)if(p[e](t,o,n,!0)){r=!0;break}if(r)break;
1if(l=xb(t,o).trim(),!l)break;if(t.sCount[o]-t.blkIndent>=4)break;if(c=Sb(l),c.length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop(),m+=u-c.length,m>65536)break;o===e+2&&(t.push("tbody_open","tbody",1).map=g=[e+2,0]),t.push("tr_open","tr",1).map=[o,o+1];for(let e=0;e<u;e++){const n=t.push("td_open","td",1);d[e]&&(n.attrs=[["style","text-align:"+d[e]]]);const r=t.push("inline","",0);r.content=c[e]?c[e].trim():"",r.children=[],t.push("td_close","td",-1)}t.push("tr_close","tr",-1)}return g&&(t.push("tbody_close","tbody",-1),g[1]=o),t.push("table_close","table",-1),f[1]=o,t.parentType=h,t.line=o,!0},["paragraph","reference"]],["code",function(t,e,n){if(t.sCount[e]-t.blkIndent<4)return!1;let r=e+1,o=r;for(;r<n;)if(t.isEmpty(r))r++;else{if(!(t.sCount[r]-t.blkIndent>=4))break;r++,o=r}t.line=o;const i=t.push("code_block","code",0);return i.content=t.getLines(e,o,4+t.blkIndent,!1)+"\n",i.map=[e,t.line],!0}],["fence",function(t,e,n,r){let o=t.bMarks[e]+t.tShift[e],i=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(o+3>i)return!1;const s=t.src.charCodeAt(o);if(126!==s&&96!==s)return!1;let a=o;o=t.skipChars(o,s);let l=o-a;if(l<3)return!1;const c=t.src.slice(a,o),d=t.src.slice(o,i);if(96===s&&d.indexOf(String.fromCharCode(s))>=0)return!1;if(r)return!0;let u=e,h=!1;for(;!(u++,u>=n||(o=a=t.bMarks[u]+t.tShift[u],i=t.eMarks[u],o<i&&t.sCount[u]<t.blkIndent));)if(t.src.charCodeAt(o)===s&&!(t.sCount[u]-t.blkIndent>=4||(o=t.skipChars(o,s),o-a<l||(o=t.skipSpaces(o),o<i)))){h=!0;break}l=t.sCount[e],t.line=u+(h?1:0);const p=t.push("fence","code",0);return p.info=d,p.content=t.getLines(e+1,u,l,!0),p.markup=c,p.map=[e,t.line],!0},["paragraph","reference","blockquote","list"]],["blockquote",function(t,e,n,r){let o=t.bMarks[e]+t.tShift[e],i=t.eMarks[e];const s=t.lineMax;if(t.sCount[e]-t.blkIndent>=4)return!1;if(62!==t.src.charCodeAt(o))return!1;if(r)return!0;const a=[],l=[],c=[],d=[],u=t.md.block.ruler.getRules("blockquote"),h=t.parentType;t.parentType="blockquote";let p,f=!1;for(p=e;p<n;p++){const e=t.sCount[p]<t.blkIndent;if(o=t.bMarks[p]+t.tShift[p],i=t.eMarks[p],o>=i)break;if(62===t.src.charCodeAt(o++)&&!e){let e,n,r=t.sCount[p]+1;32===t.src.charCodeAt(o)?(o++,r++,n=!1,e=!0):9===t.src.charCodeAt(o)?(e=!0,(t.bsCount[p]+r)%4==3?(o++,r++,n=!1):n=!0):e=!1;let s=r;for(a.push(t.bMarks[p]),t.bMarks[p]=o;o<i;){const e=t.src.charCodeAt(o);if(!Ry(e))break;9===e?s+=4-(s+t.bsCount[p]+(n?1:0))%4:s++,o++}f=o>=i,l.push(t.bsCount[p]),t.bsCount[p]=t.sCount[p]+1+(e?1:0),c.push(t.sCount[p]),t.sCount[p]=s-r,d.push(t.tShift[p]),t.tShift[p]=o-t.bMarks[p];continue}if(f)break;let r=!1;for(let e=0,o=u.length;e<o;e++)if(u[e](t,p,n,!0)){r=!0;break}if(r){t.lineMax=p,0!==t.blkIndent&&(a.push(t.bMarks[p]),l.push(t.bsCount[p]),d.push(t.tShift[p]),c.push(t.sCount[p]),t.sCount[p]-=t.blkIndent);break}a.push(t.bMarks[p]),l.push(t.bsCount[p]),d.push(t.tShift[p]),c.push(t.sCount[p]),t.sCount[p]=-1}const g=t.blkIndent;t.blkIndent=0;const m=t.push("blockquote_open","blockquote",1);m.markup=">";const A=[e,0];m.map=A,t.md.block.tokenize(t,e,p),t.push("blockquote_close","blockquote",-1).markup=">",t.lineMax=s,t.parentType=h,A[1]=t.line;for(let n=0;n<d.length;n++)t.bMarks[n+e]=a[n],t.tShift[n+e]=d[n],t.sCount[n+e]=c[n],t.bsCount[n+e]=l[n];return t.blkIndent=g,!0},["paragraph","reference","blockquote","list"]],["hr",function(t,e,n,r){const o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let i=t.bMarks[e]+t.tShift[e];const s=t.src.charCodeAt(i++);if(42!==s&&45!==s&&95!==s)return!1;let a=1;for(;i<o;){const e=t.src.charCodeAt(i++);if(e!==s&&!Ry(e))return!1;e===s&&a++}if(a<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(a+1).join(String.fromCharCode(s)),!0},["paragraph","reference","blockquote","list"]],["list",function(t,e,n,r){let o,i,s,a,l=e,c=!0;if(t.sCount[l]-t.blkIndent>=4)return!1;if(t.listIndent>=0&&t.sCount[l]-t.listIndent>=4&&t.sCount[l]<t.blkIndent)return!1;let d,u,h,p=!1;if(r&&"paragraph"===t.parentType&&t.sCount[l]>=t.blkIndent&&(p=!0),(h=Mb(t,l))>=0){if(d=!0,s=t.bMarks[l]+t.tShift[l],u=Number(t.src.slice(s,h-1)),p&&1!==u)return!1}else{if(!((h=Eb(t,l))>=0))return!1;d=!1}if(p&&t.skipSpaces(h)>=t.eMarks[l])return!1;if(r)return!0;
1const f=t.src.charCodeAt(h-1),g=t.tokens.length;d?(a=t.push("ordered_list_open","ol",1),1!==u&&(a.attrs=[["start",u]])):a=t.push("bullet_list_open","ul",1);const m=[l,0];a.map=m,a.markup=String.fromCharCode(f);let A=!1;const y=t.md.block.ruler.getRules("list"),b=t.parentType;for(t.parentType="list";l<n;){i=h,o=t.eMarks[l];const e=t.sCount[l]+h-(t.bMarks[l]+t.tShift[l]);let r=e;for(;i<o;){const e=t.src.charCodeAt(i);if(9===e)r+=4-(r+t.bsCount[l])%4;else{if(32!==e)break;r++}i++}const u=i;let p;p=u>=o?1:r-e,p>4&&(p=1);const g=e+p;a=t.push("list_item_open","li",1),a.markup=String.fromCharCode(f);const m=[l,0];a.map=m,d&&(a.info=t.src.slice(s,h-1));const b=t.tight,v=t.tShift[l],w=t.sCount[l],k=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=g,t.tight=!0,t.tShift[l]=u-t.bMarks[l],t.sCount[l]=r,u>=o&&t.isEmpty(l+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,l,n,!0),t.tight&&!A||(c=!1),A=t.line-l>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=k,t.tShift[l]=v,t.sCount[l]=w,t.tight=b,a=t.push("list_item_close","li",-1),a.markup=String.fromCharCode(f),l=t.line,m[1]=l,l>=n)break;if(t.sCount[l]<t.blkIndent)break;if(t.sCount[l]-t.blkIndent>=4)break;let C=!1;for(let e=0,r=y.length;e<r;e++)if(y[e](t,l,n,!0)){C=!0;break}if(C)break;if(d){if(h=Mb(t,l),h<0)break;s=t.bMarks[l]+t.tShift[l]}else if(h=Eb(t,l),h<0)break;if(f!==t.src.charCodeAt(h-1))break}return a=d?t.push("ordered_list_close","ol",-1):t.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(f),m[1]=l,t.line=l,t.parentType=b,c&&function(t,e){const n=t.level
1+2;for(let r=e+2,o=t.tokens.length-2;r<o;r++)t.tokens[r].level===n&&"paragraph_open"===t.tokens[r].type&&(t.tokens[r+2].hidden=!0,t.tokens[r].hidden=!0,r+=2)}(t,g),!0},["paragraph","reference","blockquote"]],["reference",function(t,e,n,r){let o=t.bMarks[e]+t.tShift[e],i=t.eMarks[e],s=e+1;if(t.sCount[e]-t.blkIndent>=4)return!1;if(91!==t.src.charCodeAt(o))return!1;function a(e){const n=t.lineMax;if(e>=n||t.isEmpty(e))return null;let r=!1;if(t.sCount[e]-t.blkIndent>3&&(r=!0),t.sCount[e]<0&&(r=!0),!r){const r=t.md.block.ruler.getRules("reference"),o=t.parentType;t.parentType="reference";let i=!1;for(let o=0,s=r.length;o<s;o++)if(r[o](t,e,n,!0)){i=!0;break}if(t.parentType=o,i)return null}const o=t.bMarks[e]+t.tShift[e],i=t.eMarks[e];return t.src.slice(o,i+1)}let l=t.src.slice(o,i+1);i=l.length;let c=-1;for(o=1;o<i;o++){const t=l.charCodeAt(o);if(91===t)return!1;if(93===t){c=o;break}if(10===t){const t=a(s);null!==t&&(l+=t,i=l.length,s++)}else if(92===t&&(o++,o<i&&10===l.charCodeAt(o))){const t=a(s);null!==t&&(l+=t,i=l.length,s++)}}if(c<0||58!==l.charCodeAt(c+1))return!1;for(o=c+2;o<i;o++){const t=l.charCodeAt(o);if(10===t){const t=a(s);null!==t&&(l+=t,i=l.length,s++)}else if(!Ry(t))break}const d=t.md.helpers.parseLinkDestination(l,o,i);if(!d.ok)return!1;const u=t.md.normalizeLink(d.str);if(!t.md.validateLink(u))return!1;o=d.pos;const h=o,p=s,f=o;for(;o<i;o++){const t=l.charCodeAt(o);if(10===t){const t=a(s);null!==t&&(l+=t,i=l.length,s++)}else if(!Ry(t))break}let g,m=t.md.helpers.parseLinkTitle(l,o,i);for(;m.can_continue;){const e=a(s);if(null===e)break;l+=e,o=i,i=l.length,s++,m=t.md.helpers.parseLinkTitle(l,o,i,m)}for(o<i&&f!==o&&m.ok?(g=m.str,o=m.pos):(g="",o=h,s=p);o<i&&Ry(l.charCodeAt(o));)o++;if(o<i&&10!==l.charCodeAt(o)&&g)for(g="",o=h,s=p;o<i&&Ry(l.charCodeAt(o));)o++;if(o<i&&10!==l.charCodeAt(o))return!1;const A=jy(l.slice(1,c));return!!A&&(r||(void 0===t.env.references&&(t.env.references={}),void 0===t.env.references[A]&&(t.env.references[A]={title:g,href:u}),t.line=s),!0)}],["html_block",function(t,e,n,r){let o=t.bMarks[e]+t.tShift[e],i=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(!t.md.options.html)return!1;if(60!==t.src.charCodeAt(o))return!1;let s=t.src.slice(o,i),a=0;for(;a<Ib.length&&!Ib[a][0].test(s);a++);if(a===Ib.length)return!1;if(r)return Ib[a][2];let l=e+1;const c=Ib[a][1].test("");if(!Ib[a][1].test(s))for(;l<n&&(!(t.sCount[l]<t.blkIndent)||!c&&t.isEmpty(l));l++)if(o=t.bMarks[l]+t.tShift[l],i=t.eMarks[l],s=t.src.slice(o,i),Ib[a][1].test(s)){0!==s.length&&l++;break}t.line=l;const d=t.push("html_block","",0);return d.map=[e,l],d.content=t.getLines(e,l,t.blkIndent,!0),!0},["paragraph","reference","blockquote"]],["heading",function(t,e,n,r){let o=t.bMarks[e]+t.tShift[e],i=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let s=t.src.charCodeAt(o);if(35!==s||o>=i)return!1;let a=1;for(s=t.src.charCodeAt(++o);35===s&&o<i&&a<=6;)a++,s=t.src.charCodeAt(++o);if(a>6||o<i&&!Ry(s))return!1;if(r)return!0;i=t.skipSpacesBack(i,o);const l=t.skipCharsBack(i,35,o);l>o&&Ry(t.src.charCodeAt(l-1))&&(i=l),t.line=e+1;const c=t.push("heading_open","h"+String(a),1);c.markup="########".slice(0,a),c.map=[e,t.line];const d=t.push("inline","",0);return d.content=Vy(t.src.slice(o,i)),d.map=[e,t.line],d.children=[],t.push("heading_close","h"+String(a),-1).markup="########".slice(0,a),!0},["paragraph","reference","blockquote"]],["lheading",function(t,e,n){const r=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;const o=t.parentType;t.parentType="paragraph";let i,s=0,a=e+1;for(;a<n&&!t.isEmpty(a);a++){if(t.sCount[a]-t.blkIndent>3)continue;if(t.sCount[a]>=t.blkIndent){let e=t.bMarks[a]+t.tShift[a];const n=t.eMarks[a];if(e<n&&(i=t.src.charCodeAt(e),(45===i||61===i)&&(e=t.skipChars(e,i),e=t.skipSpaces(e),e>=n))){s=61===i?1:2;break}}if(t.sCount[a]<0)continue;let e=!1;for(let o=0,i=r.length;o<i;o++)if(r[o](t,a,n,!0)){e=!0;break}if(e)break}if(!s)return t.parentType=o,!1;const l=Vy(t.getLines(e,a,t.blkIndent,!1));t.line=a+1;const c=t.push("heading_open","h"+String(s),1);c.markup=String.fromCharCode(i),c.map=[e,t.line];const d=t.push("inline","",0);return d.content=l,d.map=[e,t.line-1],d.children=[],t.push("heading_close","h"+String(s),-1).markup=String.fromCharCode(i),t.parentType=
1o,!0}],["paragraph",function(t,e,n){const r=t.md.block.ruler.getRules("paragraph"),o=t.parentType;let i=e+1;for(t.parentType="paragraph";i<n&&!t.isEmpty(i);i++){if(t.sCount[i]-t.blkIndent>3)continue;if(t.sCount[i]<0)continue;let e=!1;for(let o=0,s=r.length;o<s;o++)if(r[o](t,i,n,!0)){e=!0;break}if(e)break}const s=Vy(t.getLines(e,i,t.blkIndent,!1));t.line=i,t.push("paragraph_open","p",1).map=[e,t.line];const a=t.push("inline","",0);return a.content=s,a.map=[e,t.line],a.children=[],t.push("paragraph_close","p",-1),t.parentType=o,!0}]];function Lb(){this.ruler=new Xy;for(let t=0;t<Nb.length;t++)this.ruler.push(Nb[t][0],Nb[t][1],{alt:(Nb[t][2]||[]).slice()})}Lb.prototype.tokenize=function(t,e,n){const r=this.ruler.getRules(""),o=r.length,i=t.md.options.maxNesting;let s=e,a=!1;for(;s<n&&(t.line=s=t.skipEmptyLines(s),!(s>=n))&&!(t.sCount[s]<t.blkIndent);){if(t.level>=i){t.line=n;break}const e=t.line;let l=!1;for(let i=0;i<o;i++)if(l=r[i](t,s,n,!1),l){if(e>=t.line)throw new Error("block rule didn't increment state.line");break}if(!l)throw new Error("none of the block rules matched");t.tight=!a,t.isEmpty(t.line-1)&&(a=!0),s=t.line,s<n&&t.isEmpty(s)&&(a=!0,s++,t.line=s)}},Lb.prototype.parse=function(t,e,n,r){if(!t)return;const o=new this.State(t,e,n,r);this.tokenize(o,o.line,o.lineMax)},Lb.prototype.State=Cb;const Bb=Lb;function $b(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}$b.prototype.pushPending=function(){const t=new eb("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t},$b.prototype.push=function(t,e,n){this.pending&&this.pushPending();const r=new eb(t,e,n);let o=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=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(o),r},$b.prototype.scanDelims=function(t,e){const n=this.posMax,r=this.src.charCodeAt(t);let o;if(0===t)o=32;else if(1===t)o=this.src.charCodeAt(0),55296==(63488&o)&&(o=65533);else if(o=this.src.charCodeAt(t-1),56320==(64512&o)){const e=this.src.charCodeAt(t-2);o=55296==(64512&e)?65536+(e-55296<<10)+(o-56320):65533}else 55296==(64512&o)&&(o=65533);let i=t;for(;i<n&&this.src.charCodeAt(i)===r;)i++;const s=i-t;let a=i<n?this.src.charCodeAt(i):32;if(55296==(64512&a)){const t=this.src.charCodeAt(i+1);a=56320==(64512&t)?65536+(a-55296<<10)+(t-56320):65533}else 56320==(64512&a)&&(a=65533);const l=Hy(o)||zy(o),c=Hy(a)||zy(a),d=Py(o),u=Py(a),h=!u&&(!c||d||l),p=!d&&(!l||u||c);return{can_open:h&&(e||!p||l),can_close:p&&(e||!h||c),length:s}},$b.prototype.Token=eb;const Rb=$b;function Pb(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}}function Fb(t){return t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||43===t||45===t||46===t}const zb=[];for(let t=0;t<256;t++)zb.push(0);function Hb(t,e){let n;const r=[],o=e.length;for(let i=0;i<o;i++){const o=e[i];if(126!==o.marker)continue;if(-1===o.end)continue;const s=e[o.end];n=t.tokens[o.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=t.tokens[s.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="","text"===t.tokens[s.token-1].type&&"~"===t.tokens[s.token-1].content&&r.push(s.token-1)}for(;r.length;){const e=r.pop();let o=e+1;for(;o<t.tokens.length&&"s_close"===t.tokens[o].type;)o++;o--,e!==o&&(n=t.tokens[o],t.tokens[o]=t.tokens[e],t.tokens[e]=n)}}"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(t){zb[t.charCodeAt(0)]=1});const jb={tokenize:function(t,e){const n=t.pos,r=t.src.charCodeAt(n);if(e)return!1;if(126!==r)return!1;const o=t.scanDelims(t.pos,!0);let i=o.length;const s=String.fromCharCode(r);if(i<2)return!1;let a;i%2&&(a=t.push("text","",0),a.content=s,i--);for(let e=0;e<i;e+=2)a=t.push("text","",0),a.content=s+s,t.delimiters.push({marker:r,length:0,token:t.tokens.length-1,end:-1,open:o.can_open,close:o.c
1an_close});return t.pos+=o.length,!0},postProcess:function(t){const e=t.tokens_meta,n=t.tokens_meta.length;Hb(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&Hb(t,e[r].delimiters)}};function Ub(t,e){for(let n=e.length-1;n>=0;n--){const r=e[n];if(95!==r.marker&&42!==r.marker)continue;if(-1===r.end)continue;const o=e[r.end],i=n>0&&e[n-1].end===r.end+1&&e[n-1].marker===r.marker&&e[n-1].token===r.token-1&&e[r.end+1].token===o.token+1,s=String.fromCharCode(r.marker),a=t.tokens[r.token];a.type=i?"strong_open":"em_open",a.tag=i?"strong":"em",a.nesting=1,a.markup=i?s+s:s,a.content="";const l=t.tokens[o.token];l.type=i?"strong_close":"em_close",l.tag=i?"strong":"em",l.nesting=-1,l.markup=i?s+s:s,l.content="",i&&(t.tokens[e[n-1].token].content="",t.tokens[e[r.end+1].token].content="",n--)}}const Vb={tokenize:function(t,e){const n=t.pos,r=t.src.charCodeAt(n);if(e)return!1;if(95!==r&&42!==r)return!1;const o=t.scanDelims(t.pos,42===r);for(let e=0;e<o.length;e++)t.push("text","",0).content=String.fromCharCode(r),t.delimiters.push({marker:r,length:o.length,token:t.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return t.pos+=o.length,!0},postProcess:function(t){const e=t.tokens_meta,n=t.tokens_meta.length;Ub(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&Ub(t,e[r].delimiters)}},qb=/^([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])?)*)$/,Wb=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/,Jb=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Gb=/^&([a-z][a-z0-9]{1,31});/i;function Kb(t){const e={},n=t.length;if(!n)return;let r=0,o=-2;const i=[];for(let s=0;s<n;s++){const n=t[s];if(i.push(0),t[r].marker===n.marker&&o===n.token-1||(r=s),o=n.token,n.length=n.length||0,!n.close)continue;e.hasOwnProperty(n.marker)||(e[n.marker]=[-1,-1,-1,-1,-1,-1]);const a=e[n.marker][(n.open?3:0)+n.length%3];let l=r-i[r]-1,c=l;for(;l>a;l-=i[l]+1){const e=t[l];if(e.marker===n.marker&&e.open&&e.end<0){let r=!1;if((e.close||n.open)&&(e.length+n.length)%3==0&&(e.length%3==0&&n.length%3==0||(r=!0)),!r){const r=l>0&&!t[l-1].open?i[l-1]+1:0;i[s]=s-l+r,i[l]=r,n.open=!1,e.end=s,e.close=!1,c=-1,o=-2;break}}}-1!==c&&(e[n.marker][(n.open?3:0)+(n.length||0)%3]=c)}}const Yb=[["text",function(t,e){let n=t.pos;for(;n<t.posMax&&!Pb(t.src.charCodeAt(n));)n++;
1return n!==t.pos&&(e||(t.pending+=t.src.slice(t.pos,n)),t.pos=n,!0)}],["linkify",function(t,e){if(!t.md.options.linkify)return!1;if(t.linkLevel>0)return!1;const n=t.pos;if(n+3>t.posMax)return!1;if(58!==t.src.charCodeAt(n))return!1;if(47!==t.src.charCodeAt(n+1))return!1;if(47!==t.src.charCodeAt(n+2))return!1;const r=n-Math.min(10,t.pending.length,n);let o=n;for(;o>r&&Fb(t.src.charCodeAt(o-1));)o--;if(o===n||!function(t){return t>=65&&t<=90||t>=97&&t<=122}(t.src.charCodeAt(o)))return!1;const i=n-o,s=t.md.linkify.matchAtStart(t.src.slice(o));if(!s)return!1;let a=s.url;if(a.length<=i)return!1;let l=a.length;for(;l>0&&42===a.charCodeAt(l-1);)l--;l!==a.length&&(a=a.slice(0,l));const c=t.md.normalizeLink(a);if(!t.md.validateLink(c))return!1;if(!e){t.pending=t.pending.slice(0,-i);const e=t.push("link_open","a",1);e.attrs=[["href",c]],e.markup="linkify",e.info="auto",t.push("text","",0).content=t.md.normalizeLinkText(a);const n=t.push("link_close","a",-1);n.markup="linkify",n.info="auto"}return t.pos+=a.length-i,!0}],["newline",function(t,e){let n=t.pos;if(10!==t.src.charCodeAt(n))return!1;const r=t.pending.length-1,o=t.posMax;if(!e)if(r>=0&&32===t.pending.charCodeAt(r))if(r>=1&&32===t.pending.charCodeAt(r-1)){let e=r-1;for(;e>=1&&32===t.pending.charCodeAt(e-1);)e--;t.pending=t.pending.slice(0,e),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<o&&Ry(t.src.charCodeAt(n));)n++;
1return t.pos=n,!0}],["escape",function(t,e){let n=t.pos;const r=t.posMax;if(92!==t.src.charCodeAt(n))return!1;if(n++,n>=r)return!1;let o=t.src.charCodeAt(n);if(10===o){for(e||t.push("hardbreak","br",0),n++;n<r&&(o=t.src.charCodeAt(n),Ry(o));)n++;return t.pos=n,!0}if(32===o){if(!e){const e=t.push("text_special","",0);e.content="\\",e.markup="\\",e.info="escape"}return t.pos=n,!0}let i=t.src[n];if(o>=55296&&o<=56319&&n+1<r){const e=t.src.charCodeAt(n+1);e>=56320&&e<=57343&&(i+=t.src[n+1],n++)}const s="\\"+i;if(!e){const e=t.push("text_special","",0);o<256&&0!==zb[o]?e.content=i:e.content=s,e.markup=s,e.info="escape"}return t.pos=n+1,!0}],["backticks",function(t,e){let n=t.pos;if(96!==t.src.charCodeAt(n))return!1;const r=n;n++;const o=t.posMax;for(;n<o&&96===t.src.charCodeAt(n);)n++;const i=t.src.slice(r,n),s=i.length;if(t.backticksScanned&&(t.backticks[s]||0)<=r)return e||(t.pending+=i),t.pos+=s,!0;let a,l=n;for(;-1!==(a=t.src.indexOf("`",l));){for(l=a+1;l<o&&96===t.src.charCodeAt(l);)l++;const r=l-a;if(r===s){if(!e){const e=t.push("code_inline","code",0);e.markup=i,e.content=t.src.slice(n,a).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return t.pos=l,!0}t.backticks[r]=a}return t.backticksScanned=!0,e||(t.pending+=i),t.pos+=s,!0}],["strikethrough",jb.tokenize],["emphasis",Vb.tokenize],["link",function(t,e){let n,r,o,i,s="",a="",l=t.pos,c=!0;if(91!==t.src.charCodeAt(t.pos))return!1;const d=t.pos,u=t.posMax,h=t.pos+1,p=t.md.helpers.parseLinkLabel(t,t.pos,!0);if(p<0)return!1;let f=p+1;if(f<u&&40===t.src.charCodeAt(f)){for(c=!1,f++;f<u&&(n=t.src.charCodeAt(f),Ry(n)||10===n);f++);if(f>=u)return!1;if(l=f,o=t.md.helpers.parseLinkDestination(t.src,f,t.posMax),o.ok){for(s=t.md.normalizeLink(o.str),t.md.validateLink(s)?f=o.pos:s="",l=f;f<u&&(n=t.src.charCodeAt(f),Ry(n)||10===n);f++);if(o=t.md.helpers.parseLinkTitle(t.src,f,t.posMax),f<u&&l!==f&&o.ok)for(a=o.str,f=o.pos;f<u&&(n=t.src.charCodeAt(f),Ry(n)||10===n);f++);}(f>=u||41!==t.src.charCodeAt(f))&&(c=!0),f++}if(c){if(void 0===t.env.references)return!1;if(f<u&&91===t.src.charCodeAt(f)?(l=f+1,f=t.md.helpers.parseLinkLabel(t,f),f>=0?r=t.src.slice(l,f++):f=p+1):f=p+1,r||(r=t.src.slice(h,p)),i=t.env.references[jy(r)],!i)return t.pos=d,!1;s=i.href,a=i.title}if(!e){t.pos=h,t.posMax=p;const e=[["href",s]];t.push("link_open","a",1).attrs=e,a&&e.push(["title",a]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=f,t.posMax=u,!0}],["image",function(t,e){let n,r,o,i,s,a,l,c,d="";const u=t.pos,h=t.posMax;if(33!==t.src.charCodeAt(t.pos))return!1;if(91!==t.src.charCodeAt(t.pos+1))return!1;const p=t.pos+2,f=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(f<0)return!1;if(i=f+1,i<h&&40===t.src.charCodeAt(i)){for(i++;i<h&&(n=t.src.charCodeAt(i),Ry(n)||10===n);i++);if(i>=h)return!1;for(c=i,a=t.md.helpers.parseLinkDestination(t.src,i,t.posMax),a.ok&&(d=t.md.normalizeLink(a.str),t.md.validateLink(d)?i=a.pos:d=""),c=i;i<h&&(n=t.src.charCodeAt(i),Ry(n)||10===n);i++);if(a=t.md.helpers.parseLinkTitle(t.src,i,t.posMax),i<h&&c!==i&&a.ok)for(l=a.str,i=a.pos;i<h&&(n=t.src.charCodeAt(i),Ry(n)||10===n);i++);else l="";if(i>=h||41!==t.src.charCodeAt(i))return t.pos=u,!1;i++}else{if(void 0===t.env.references)return!1;if(i<h&&91===t.src.charCodeAt(i)?(c=i+1,i=t.md.helpers.parseLinkLabel(t,i),i>=0?o=t.src.slice(c,i++):i=f+1):i=f+1,o||(o=t.src.slice(p,f)),s=t.env.references[jy(o)],!s)return t.pos=u,!1;d=s.href,l=s.title}if(!e){r=t.src.slice(p,f);const e=[];t.md.inline.parse(r,t.md,t.env,e);const n=t.push("image","img",0),o=[["src",d],["alt",""]];n.attrs=o,n.children=e,n.content=r,l&&o.push(["title",l])}return t.pos=i,t.posMax=h,!0}],["autolink",function(t,e){let n=t.pos;if(60!==t.src.charCodeAt(n))return!1;const r=t.pos,o=t.posMax;for(;;){if(++n>=o)return!1;const e=t.src.charCodeAt(n);if(60===e)return!1;if(62===e)break}const i=t.src.slice(r+1,n);if(Wb.test(i)){const n=t.md.normalizeLink(i);if(!t.md.validateLink(n))return!1;if(!e){const e=t.push("link_open","a",1);e.attrs=[["href",n]],e.markup="autolink",e.info="auto",t.push("text","",0).content=t.md.normalizeLinkText(i);const r=t.push("link_close","a",-1);r.markup="autolink",r.info="auto"}return t.pos+=i.length+2,!0}if(qb.test(i)){const n=t.md.normalizeLink("mailto:"+i);if(!t.md.validateLink(n))return!1;if(!e){const e=t.push("link_open","a",1);e.attrs=[["href",n]],e.markup="autolink",e.info="auto",t.push("text","",0).content=t.md.normalizeLinkText(i);const r=t.push("link_close","a",-1);r.markup="autolink",r.info="auto"}return t.pos+=i.length+2,!0}return!1}],["html_inline",function(t,e){if(!t.md.options.html)return!1;
1const n=t.posMax,r=t.pos;if(60!==t.src.charCodeAt(r)||r+2>=n)return!1;const o=t.src.charCodeAt(r+1);if(33!==o&&63!==o&&47!==o&&!function(t){const e=32|t;return e>=97&&e<=122}(o))return!1;const i=t.src.slice(r).match(Db);if(!i)return!1;if(!e){const e=t.push("html_inline","",0);e.content=i[0],s=e.content,/^<a[>\s]/i.test(s)&&t.linkLevel++,function(t){return/^<\/a\s*>/i.test(t)}(e.content)&&t.linkLevel--}var s;return t.pos+=i[0].length,!0}],["entity",function(t,e){const n=t.pos,r=t.posMax;if(38!==t.src.charCodeAt(n))return!1;if(n+1>=r)return!1;if(35===t.src.charCodeAt(n+1)){const r=t.src.slice(n).match(Jb);if(r){if(!e){const e="x"===r[1][0].toLowerCase()?parseInt(r[1].slice(1),16):parseInt(r[1],10),n=t.push("text_special","",0);n.content=Cy(e)?xy(e):xy(65533),n.markup=r[0],n.info="entity"}return t.pos+=r[0].length,!0}}else{const r=t.src.slice(n).match(Gb);if(r){const n=(o=r[0],Ay(o,dy.Strict));if(n!==r[0]){if(!e){const e=t.push("text_special","",0);e.content=n,e.markup=r[0],e.info="entity"}return t.pos+=r[0].length,!0}}}var o;return!1}]],Qb=[["balance_pairs",function(t){const e=t.tokens_meta,n=t.tokens_meta.length;Kb(t.delimiters);for(let t=0;t<n;t++)e[t]&&e[t].delimiters&&Kb(e[t].delimiters)}],["strikethrough",jb.postProcess],["emphasis",Vb.postProcess],["fragments_join",function(t){let e,n,r=0;const o=t.tokens,i=t.tokens.length;for(e=n=0;e<i;e++)o[e].nesting<0&&r--,o[e].level=r,o[e].nesting>0&&r++,"text"===o[e].type&&e+1<i&&"text"===o[e+1].type?o[e+1].content=o[e].content+o[e+1].content:(e!==n&&(o[n]=o[e]),n++);e!==n&&(o.length=n)}]];function Zb(){this.ruler=new Xy;for(let t=0;t<Yb.length;t++)this.ruler.push(Yb[t][0],Yb[t][1]);this.ruler2=new Xy;for(let t=0;t<Qb.length;t++)this.ruler2.push(Qb[t][0],Qb[t][1])}Zb.prototype.skipToken=function(t){const e=t.pos,n=this.ruler.getRules(""),r=n.length,o=t.md.options.maxNesting,i=t.cache;if(void 0!==i[e])return void(t.pos=i[e]);let s=!1;if(t.level<o){for(let o=0;o<r;
1o++)if(t.level++,s=n[o](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++,i[e]=t.pos},Zb.prototype.tokenize=function(t){const e=this.ruler.getRules(""),n=e.length,r=t.posMax,o=t.md.options.maxNesting;for(;t.pos<r;){const i=t.pos;let s=!1;if(t.level<o)for(let r=0;r<n;r++)if(s=e[r](t,!1),s){if(i>=t.pos)throw new Error("inline rule didn't increment state.pos");break}if(s){if(t.pos>=r)break}else t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()},Zb.prototype.parse=function(t,e,n,r){const o=new this.State(t,e,n,r);this.tokenize(o);const i=this.ruler2.getRules(""),s=i.length;for(let t=0;t<s;t++)i[t](o)},Zb.prototype.State=Rb;const Xb=Zb;function tv(t){const e={};t=t||{},e.src_Any=ZA.source,e.src_Cc=XA.source,e.src_Z=ey.source,e.src_P=YA.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}|[@/\\[\\]()]).){1,50}@)?`,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_]{0,63}',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}function ev(t){return Array.prototype.slice.call(arguments,1).forEach(function(e){e&&Object.keys(e).forEach(function(n){t[n]=e[n]})}),t}function nv(t){return Object.prototype.toString.call(t)}function rv(t){return"[object Function]"===nv(t)}function ov(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}n.dn(tv);const iv={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1},sv={"http:":{validate: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}},"https:":"http:","ftp:":"http:","//":{validate: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}},"mailto:":{validate: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}}},av="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function lv(t){const e=t.re=tv(t.__opts__),n=t.__tlds__.slice();function r(t){return t.replace("%TLDS%",e.src_tlds)}t.onCompile(),t.__tlds_replaced__||n.push("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]"),n.push(e.src_xn),e.src_tlds=n.join("|"),e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.email_fuzzy_global=RegExp(r(e.tpl_email_fuzzy),"ig"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_fuzzy_global=RegExp(r(e.tpl_link_fuzzy),"ig"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.link_no_ip_fuzzy_global=RegExp(r(e.tpl_link_no_ip_fuzzy),"ig"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");const o=[];function i(t,e){throw new Error(`(LinkifyIt) Invalid schema "${t}": ${e}`)}t.__compiled__={},Object.keys(t.__schemas__).forEach(function(e){const n=t.__schemas__[e];if(null===n)return;const r={validate:null,link:null};if(t.__compiled__[e]=r,"[object Object]"===nv(n))return"[object RegExp]"!==nv(n.validate)?rv(n.validate)?r.validate=n.validate:i(e,n):r.validate=function(t){return function(e,n){const r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}(n.validate),void(rv(n.normalize)?r.normalize=n.normalize:n.normalize?i(e,n
1):r.normalize=function(t,e){e.normalize(t)});!function(t){return"[object String]"===nv(t)}(n)?i(e,n):o.push(e)}),o.forEach(function(e){t.__compiled__[t.__schemas__[e]]&&(t.__compiled__[e].validate=t.__compiled__[t.__schemas__[e]].validate,t.__compiled__[e].normalize=t.__compiled__[t.__schemas__[e]].normalize)}),t.__compiled__[""]={validate:null,normalize:function(t,e){e.normalize(t)}};const s=Object.keys(t.__compiled__).filter(function(e){return e.length>0&&t.__compiled__[e]}).map(ov).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")}function cv(t,e,n,r){const o=t.slice(n,r);this.schema=e.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=o,this.text=o,this.url=o}function dv(t,e){if(!(this instanceof dv))return new dv(t,e);var n;e||(n=t,Object.keys(n||{}).reduce(function(t,e){return t||iv.hasOwnProperty(e)},!1)&&(e=t,t={})),this.__opts__=ev({},iv,e),this.__schemas__=ev({},sv,t),this.__compiled__={},this.__tlds__=av,this.__tlds_replaced__=!1,this.re={},lv(this)}dv.prototype.add=function(t,e){return this.__schemas__[t]=e,lv(this),this},dv.prototype.set=function(t){return this.__opts__=ev(this.__opts__,t),this},dv.prototype.test=function(t){if(!t.length)return!1;let e,n;if(this.re.schema_test.test(t))for(n=this.re.schema_search,n.lastIndex=0;null!==(e=n.exec(t));)if(this.testSchemaAt(t,e[2],n.lastIndex))return!0;return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&t.search(this.re.host_fuzzy_test)>=0&&null!==t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))||!!(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&null!==t.match(this.re.email_fuzzy))},dv.prototype.pretest=function(t){return this.re.pretest.test(t)},dv.prototype.testSchemaAt=function(t,e,n){return this.__compiled__[e.toLowerCase()]?this.__compiled__[e.toLowerCase()].validate(t,n,this):0},dv.prototype.match=function(t){const e=[],n=[],r=[],o=[];let i,s,a;function l(t,e){return t?e?t.index!==e.index?t.index<e.index?t:e:t.lastIndex>=e.lastIndex?t:e:t:e}if(!t.length)return null;if(this.re.schema_test.test(t))for(a=this.re.schema_search,a.lastIndex=0;null!==(i=a.exec(t));)s=this.testSchemaAt(t,i[2],a.lastIndex),s&&n.push({schema:i[2],index:i.index+i[1].length,lastIndex:i.index+i[0].length+s});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(a=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,a.lastIndex=0;null!==(i=a.exec(t));)r.push({schema:"",index:i.index+i[1].length,lastIndex:i.index+i[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(a=this.re.email_fuzzy_global,a.lastIndex=0;null!==(i=a.exec(t));)o.push({schema:"mailto:",index:i.index+i[1].length,lastIndex:i.index+i[0].length});const c=[0,0,0];let d=0;for(;;){const i=[n[c[0]],o[c[1]],r[c[2]]],s=l(l(i[0],i[1]),i[2]);if(!s)break;if(s===i[0]?c[0]++:s===i[1]?c[1]++:c[2]++,s.index<d)continue;const a=new cv(t,s.schema,s.index,s.lastIndex);this.__compiled__[a.schema].normalize(a,this),e.push(a),d=s.lastIndex}return e.length?e:null},dv.prototype.matchAtStart=function(t){if(!t.length)return null;const e=this.re.schema_at_start.exec(t);if(!e)return null;const n=this.testSchemaAt(t,e[2],e[0].length);if(!n)return null;const r=new cv(t,e[2],e.index+e[1].length,e.index+e[0].length+n);return this.__compiled__[r.schema].normalize(r,this),r},dv.prototype.tlds=function(t,e){return t=Array.isArray(t)?t:[t],e?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(t,e,n){return t!==n[e-1]}).reverse(),lv(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,lv(this),this)},dv.prototype.normalize=function(t){t.schema||(t.url=`http://${t.url}`),"mailto:"!==t.schema||/^mailto:/i.test(t.url)||(t.url=`mailto:${t.url}`)},dv.prototype.onCompile=function(){};const uv=dv,hv=2147483647,pv=36,fv=/^xn--/,gv=/[^\0-\x7F]/,mv=/[\x2E\u3002\uFF0E\uFF61]/g,Av={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >
1= 0x80 (not a basic code point)","invalid-input":"Invalid input"},yv=Math.floor,bv=String.fromCharCode;function vv(t){throw new RangeError(Av[t])}function wv(t,e){const n=t.split("@");let r="";n.length>1&&(r=n[0]+"@",t=n[1]);const o=function(t,e){const n=[];let r=t.length;for(;r--;)n[r]=e(t[r]);return n}((t=t.replace(mv,".")).split("."),e).join(".");return r+o}function kv(t){const e=[];let n=0;const r=t.length;for(;n<r;){const o=t.charCodeAt(n++);if(o>=55296&&o<=56319&&n<r){const r=t.charCodeAt(n++);56320==(64512&r)?e.push(((1023&o)<<10)+(1023&r)+65536):(e.push(o),n--)}else e.push(o)}return e}const Cv=function(t){return t>=48&&t<58?t-48+26:t>=65&&t<91?t-65:t>=97&&t<123?t-97:pv},xv=function(t,e){return t+22+75*(t<26)-((0!=e)<<5)},Sv=function(t,e,n){let r=0;for(t=n?yv(t/700):t>>1,t+=yv(t/e);t>455;r+=pv)t=yv(t/35);return yv(r+36*t/(t+38))},Ev=function(t){const e=[],n=t.length;let r=0,o=128,i=72,s=t.lastIndexOf("-");s<0&&(s=0);for(let n=0;n<s;++n)t.charCodeAt(n)>=128&&vv("not-basic"),e.push(t.charCodeAt(n));for(let a=s>0?s+1:0;a<n;){const s=r;for(let e=1,o=pv;;o+=pv){a>=n&&vv("invalid-input");const s=Cv(t.charCodeAt(a++));s>=pv&&vv("invalid-input"),s>yv((hv-r)/e)&&vv("overflow"),r+=s*e;const l=o<=i?1:o>=i+26?26:o-i;if(s<l)break;const c=pv-l;e>yv(hv/c)&&vv("overflow"),e*=c}const l=e.length+1;i=Sv(r-s,l,0==s),yv(r/l)>hv-o&&vv("overflow"),o+=yv(r/l),r%=l,e.splice(r++,0,o)}return String.fromCodePoint(...e)},Mv=function(t){const e=[],n=(t=kv(t)).length;let r=128,o=0,i=72;for(const n of t)n<128&&e.push(bv(n));const s=e.length;let a=s;for(s&&e.push("-");a<n;){let n=hv;for(const e of t)e>=r&&e<n&&(n=e);const l=a+1;n-r>yv((hv-o)/l)&&vv("overflow"),o+=(n-r)*l,r=n;for(const n of t)if(n<r&&++o>hv&&vv("overflow"),n===r){let t=o;for(let n=pv;;n+=pv){const r=n<=i?1:n>=i+26?26:n-i;if(t<r)break;const o=t-r,s=pv-r;e.push(bv(xv(r+o%s,0))),t=yv(o/s)}e.push(bv(xv(t,0))),i=Sv(o,l,a===s),o=0,++a}++o,++r}return e.join("")}
1,Tv={version:"2.3.1",ucs2:{decode:kv,encode:t=>String.fromCodePoint(...t)},decode:Ev,encode:Mv,toASCII:function(t){return wv(t,function(t){return gv.test(t)?"xn--"+Mv(t):t})},toUnicode:function(t){return wv(t,function(t){return fv.test(t)?Ev(t.slice(4).toLowerCase()):t})}},_v={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{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"]}}},commonmark:{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"]}}}},Dv=/^(vbscript|javascript|file|data):/,Ov=/^data:image\/(gif|png|jpeg|webp);/;function Iv(t){const e=t.trim().toLowerCase();return!Dv.test(e)||Ov.test(e)}const Nv=["http:","https:","mailto:"];function Lv(t){const e=KA(t,!0);if(e.hostname&&(!e.protocol||Nv.indexOf(e.protocol)>=0))try{e.hostname=Tv.toASCII(e.hostname)}catch(t){}return BA($A(e))}function Bv(t){const e=KA(t,!0);if(e.hostname&&(!e.protocol||Nv.indexOf(e.protocol)>=0))try{e.hostname=Tv.toUnicode(e.hostname)}catch(t){}return IA($A(e),IA.defaultChars+"%")}function $v(t,e){if(!(this instanceof $v))return new $v(t,e);e||yy(t)||(e=t||{},t="default"),this.inline=new Xb,this.block=new Bb,this.core=new wb,this.renderer=new Qy,this.linkify=new uv,this.validateLink=Iv,this.normalizeLink=Lv,this.normalizeLinkText=Bv,this.utils=b,this.helpers=wy({},v),this.options={},this.configure(t),e&&this.set(e)}$v.prototype.set=function(t){return wy(this.options,t),this},$v.prototype.configure=function(t){const e=this;if(yy(t)){const e=t;if(!(t=_v[e]))throw new Error('Wrong `markdown-it` preset "'+e+'", 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.enableO
1nly(t.components[n].rules2)}),this},$v.prototype.enable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(e){n=n.concat(this[e].ruler.enable(t,!0))},this),n=n.concat(this.inline.ruler2.enable(t,!0));const r=t.filter(function(t){return n.indexOf(t)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},$v.prototype.disable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(e){n=n.concat(this[e].ruler.disable(t,!0))},this),n=n.concat(this.inline.ruler2.disable(t,!0));const r=t.filter(function(t){return n.indexOf(t)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},$v.prototype.use=function(t){const e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this},$v.prototype.parse=function(t,e){if("string"!=typeof t)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},$v.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)},$v.prototype.parseInline=function(t,e){const n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens},$v.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const Rv=$v,Pv=["children"];var Fv=(t,e)=>{if("slot"===t)return 0;if(t instanceof Function)return t(e);const n=null!=e?e:{},r=n.children,o=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(n,Pv);if("svg"===t)throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,o,r]},zv=/^\s*>\s$/,Hv=rc.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML(t){let e=t.HTMLAttributes;return Fv("blockquote",{...ka(this.options.HTMLAttributes,e),children:Fv("slot",{})})},parseMarkdown:(t,e)=>{var n;const r=null!=(n=e.parseBlockChildren)?n:e.parseChildren;return e.createNode("blockquote",void 0,r(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const n=[];return t.content.forEach((t,r)=>{var o,i;const s=(null!=(i=null==(o=e.renderChild)?void 0:o.call(e,t,r))?i:e.renderChildren([t])).split("\n").map(t=>""===t.trim()?">":`> ${t}`);n.push(s.join("\n"))}),n.join("\n>\n")},addCommands(){return{setBlockquote:()=>t=>t.commands.wrapIn(this.name),toggleBlockquote:()=>t=>t.commands.toggleWrap(this.name),unsetBlockquote:()=>t=>t.commands.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Wl({find:zv,type:this.type})]}}),jv=Hv,Uv=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Vv=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,qv=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Wv=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Jv=Cl.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML(t){let e=t.HTMLAttributes;return Fv("strong",{...ka(this.options.HTMLAttributes,e),children:Fv("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>t=>t.commands.setMark(this.name),toggleBold:()=>t=>t.commands.toggleMark(this.name),unsetBold:()=>t=>t.commands.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}}
1,addInputRules(){return[jl({find:Uv,type:this.type}),jl({find:qv,type:this.type})]},addPasteRules(){return[oc({find:Vv,type:this.type}),oc({find:Wv,type:this.type})]}}),Gv=Jv,Kv=/(^|[^`])`([^`]+)`(?!`)$/,Yv=/(^|[^`])`([^`]+)`(?!`)/g,Qv=Cl.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML(t){let e=t.HTMLAttributes;return["code",ka(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>t=>t.commands.setMark(this.name),toggleCode:()=>t=>t.commands.toggleMark(this.name),unsetCode:()=>t=>t.commands.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[jl({find:Kv,type:this.type})]},addPasteRules(){return[oc({find:Yv,type:this.type})]}}),Zv=/^```([a-z]+)?[\s\n]$/,Xv=/^~~~([a-z]+)?[\s\n]$/,tw=rc.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const n=this.options.languageClassPrefix;if(!n)return null;return[...(null==(e=t.firstElementChild)?void 0:e.classList)||[]].filter(t=>t.startsWith(n)).map(t=>t.replace(n,""))[0]||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML(t){let e=t.node,n=t.HTMLAttributes;return["pre",ka(this.options.HTMLAttributes,n),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n,r;return!1===(null==(n=t.raw)?void 0:n.startsWith("```"))&&!1===(null==(r=t.raw)?void 0:r.startsWith("~~~"))&&"indented"!==t.codeBlockStyle?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let r="";const o=(null==(n=t.attrs)?void 0:n.language)||"";return r=t.content?[`\`\`\`${o}`,e.renderChildren(t.content),"```"].join("\n"):`\`\`\`${o}\n\n\`\`\``,r},addCommands(){return{setCodeBlock:t=>e=>e.commands.setNode(this.name,t),toggleCodeBlock:t=>e=>e.commands.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const t=this.editor.state.selection,e=t.empty,n=t.$anchor,r=1===n.pos;return!(!e||n.parent.type.name!==this.name)&&!(!r&&n.parent.textContent.length)&&this.editor.commands.clearNodes()},Tab:t=>{let e=t.editor;var n;if(!this.options.enableTabIndentation)return!1;const r=null!=(n=this.options.tabSize)?n:4,o=e.state,i=o.selection,s=i.$from,a=i.empty;if(s.parent.type!==this.type)return!1;const l=" ".repeat(r);return a?e.commands.insertContent(l):e.commands.command(t=>{let e=t.tr;const n=i.from,r=i.to,s=o.doc.textBetween(n,r,"\n","\n").split("\n").map(t=>l+t).join("\n");return e.replaceWith(n,r,o.schema.text(s)),!0})},"Shift-Tab":t=>{let e=t.editor;var n;if(!this.options.enableTabIndentation)return!1;const r=null!=(n=this.options.tabSize)?n:4,o=e.state,i=o.selection,s=i.$from,a=i.empty;return s.parent.type===this.type&&(a?e.commands.command(t=>{let e=t.tr;var n;const i=s.pos,a=s.start(),l=s.end(),c=o.doc.textBetween(a,l,"\n","\n").split("\n");let d=0,u=0;const h=i-a;for(let t=0;t<c.length;t+=1){if(u+c[t].length>=h){d=t;break}u+=c[t].length+1}const p=(null==(n=c[d].match(/^ */))?void 0:n[0])||"",f=Math.min(p.length,r);if(0===f)return!0;let g=a;for(let t=0;t<d;t+=1)g+=c[t].length+1;return e.delete(g,g+f),i-g<=f&&e.setSelection(_e.create(e.doc,g)),!0}):e.commands.command(t=>{let e=t.tr;const n=i.from,s=i.to,a=o.doc.textBetween(n,s,"\n","\n").split("\n").map(t=>{var e;const n=(null==(e=t.match(/^ */))?void 0:e[0])||"",o=Math.min(n.length,r);return t.slice(o)}).join("\n");return e.replaceWith(n,s,o.schema.text(a)),!0}))},Enter:t=>{let e=t.editor;if(!this.options.exitOnTripleEnter)return!1;const n=e.state.selection,r=n.$from;if(!n.empty||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,i=r.parent.textContent.endsWith("\n\n");return!(!o||!i)&&e.chain().command(t=>(t.tr.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:t=>{let e=t.editor;if(!this.options.exitOnArrowDown)return!1;const n=e.state,r=n.selection,o=n.doc,i=r.$from;if(!r.empty||i.parent.type!==this.type)return!1;if(i.parentOffset!==i.parent.nodeSize-2)return!1;const s=i.after();return void 0!==s&&(o.nodeAt(s)?e.commands.command(t=>(t.tr.setSelection(Se.near(o.resolve(s))),!0)):e.commands.exitCode())}}}
1,addInputRules(){return[Vl({find:Zv,type:this.type,getAttributes:t=>({language:t[1]})}),Vl({find:Xv,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Ve({key:new Je("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=null==o?void 0:o.mode;if(!n||!i)return!1;const s=t.state,a=s.tr,l=s.schema.text(n.replace(/\r\n?/g,"\n"));return a.replaceSelectionWith(this.type.create({language:i},l)),a.selection.$from.parent.type!==this.type&&a.setSelection(_e.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta("paste",!0),t.dispatch(a),!0}}})]}}),ew=tw,nw=rc.create({name:"hardBreak",markdownTokenName:"br",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML(t){let e=t.HTMLAttributes;return["br",ka(this.options.HTMLAttributes,e)]},renderText:()=>"\n",renderMarkdown:()=>"  \n",parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>t=>{let e=t.commands,n=t.chain,r=t.state,o=t.editor;return e.first([()=>e.exitCode(),()=>e.command(()=>{const t=r.selection,e=r.storedMarks;if(t.$from.parent.type.spec.isolating)return!1;const i=this.options.keepMarks,s=o.extensionManager.splittableMarks,a=e||t.$to.parentOffset&&t.$from.marks();return n().insertContent({type:this.name}).command(t=>{let e=t.tr;if(t.dispatch&&a&&i){const t=a.filter(t=>s.includes(t.type.name));e.ensureMarks(t)}return!0}).run()})])}}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),rw=nw,ow=rc.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML(t){let e=t.node,n=t.HTMLAttributes;return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,ka(this.options.HTMLAttributes,n),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const r=(null==(n=t.attrs)?void 0:n.level)?parseInt(t.attrs.level,10):1,o="#".repeat(r);return t.content?`${o} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>e=>{let n=e.commands;return!!this.options.levels.includes(t.level)&&n.setNode(this.name,t)},toggleHeading:t=>e=>{let n=e.commands;return!!this.options.levels.includes(t.level)&&n.toggleNode(this.name,"paragraph",t)}}},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=>Vl({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}}
1)\\s$`),type:this.type,getAttributes:{level:t}}))}}),iw=ow;function sw(t,e){let n=null,r=null,o=null;if(t.state.doc.descendants((t,i)=>{if(t.attrs.hookType&&t.attrs.hookId===e)return r=t,n=i,!1;const s=t.marks.find(t=>t&&t.attrs&&t.attrs.hookType&&t.attrs.hookId===e);return s?(o=s,n=i,!1):void 0}),null==n)return null;try{const e=Ja(t.view,n,n),i={left:e.left,top:e.top};return{position:n,block:r,inline:o,...i}}catch(t){return console.error("Error in getHookLocation: ",t),null}}function aw(t){if(!t||"string"!=typeof t)return null;const e=t.split("/");if(3!==e.length)return null;const[n,r,o]=e,i=parseInt(o,10);return n&&r&&!isNaN(i)?{parentId:n,type:r,index:i}:null}function lw(t,e,n,r){if(!t||!t.content)return null;if(n<0||n>=t.content.childCount)return console.log(`[${r}] Index ${n} out of bounds (childCount: ${t.content.childCount})`),null;const o=t.content.child(n);return"text"===e&&o.isText||"hardBreak"===e&&"hardBreak"===o.type.name?o:(console.log(`[${r}] Child at index ${n} is not of type ${e}. Found: ${o.isText?"text":o.type.name}`),null)}function cw(t,e){let n=null;return t.descendants((t,r)=>t.attrs.hookType&&t.attrs.hookId===e||t.marks.find(t=>t.attrs.hookType&&t.attrs.hookId===e)?(n=r,!1):void 0),n}function dw(t,e){if(t){for(let n=e=Math.min(Math.max(e,0),t.content.size);n>=0;n--){const e=uw(t,n);if(!1!==e)return e}for(let n=e;n<t.content.size;n++){const e=uw(t,n);if(!1!==e)return e}return null}}function uw(t,e){const n=t.nodeAt(e);return!!n&&(n.isBlock?n:!!n.isInline&&t.resolve(e).node())}const hw=CA.extend({name:"blockHook",addOptions(){return{...this.options?.(),...this.parent?.(),targets:[{type:"title"},{type:"blockquote"},{type:"codeBlock"},{type:"heading"},{type:"image"},{type:"paragraph"},{type:"listItem"},{type:"bulletList"},{type:"orderedList"},{type:"spacer"},{type:"themeFrame"},{type:"horizontalRule"},{type:"table"},{type:"tableCell"},{type:"tableRow"}],type:"blockHook"}}});function pw(t,e,n,r){if(!t)return;const o=t.state.doc.content.size;return e=Math.min(Math.max(e,0),o),r?fw(t,n,e,1)||fw(t,n,e,-1):fw(t,n,e,-1)||fw(t,n,e,1)}function fw(t,e,n,r){const{doc:o}=t.state,i=1===r?1:-1;for(let r=n;r>=0&&r<o.content.size;r+=i){const o=mw(t,e,r);if(!1!==o){const e=gw(o,t),r=gw(n,t);return Math.abs(e.top-r.top)>16?null:o}}return null}function gw(t,e){const n=e.view.coordsAtPos(function(t,e){return Math.min(Math.max(t,0),e.content.size-1)}(t,e.state.doc));return{left:n.left,top:n.top,right:n.right,bottom:n.bottom}}function mw(t,e,n){const r=t.state.doc;e&&(n=r.resolve(n).start());const o=r.nodeAt(n);return!(!o||!o.isText)&&n}rc.create({name:"blockHookNode",addOptions:()=>({}),group:"block",content:"block*",parseHTML:()=>[{tag:"div"}],renderHTML({HTMLAttributes:t}){return["div",ka(this.options.HTMLAttributes,t),0]}});const Aw=CA.extend({name:"inlineHook",addOptions(){return{...this.options?.(),...this.parent?.(),targets:[{type:"inlineHookMark"}],type:"inlineHook"}}}),yw=Cl.create({name:"inlineHookMark",addOptions:()=>({}),group:"inlineHook",inclusive:!1,spanning:!1,parseHTML:()=>[{tag:'span[data-name="inline-hook-mark"]'}],renderHTML({HTMLAttributes:t}){return["span",ka({"data-name":"inline-hook-mark"},this.options.HTMLAttributes,t),0]},addCommands:()=>({setInlineHookMark:({editor:t,position:e,id:n,nodeSearchForward:r})=>({state:o,tr:i,chain:s})=>{const a=pw(t,e,!1,r),l=n&&bA(n)?n:mA("inlineHook");if(null==a)return!1;const c=t.view.state.schema.marks.inlineHookMark.create({hookId:l}),d=new Ut(a,a+1,c);return s(o.tr.step(d))},unsetInlineHookMark:({editor:t,position:e,nodeSearchForward:n})=>({state:r,tr:o,chain:i})=>{const s=pw(t,e,!1,n);return null!=s&&i().setTextSelection({from:s,to:s+1}).unsetMark("inlineHookMark").setTextSelection({from:s}).run()}})}),bw=["top","right","bottom","left"],vw=["start","end"],ww=bw.reduce((t,e)=>t.concat(e,e+"-"+vw[0],e+"-"+vw[1]),[]),kw=Math.min,Cw=Math.max,xw=Math.round,Sw=Math.floor,Ew=t=>({x:t,y:t}),Mw={left:"right",right:"left",bottom:"top",top:"bottom"};function Tw(t,e,n){return Cw(t,kw(e,n))}function _w(t,e){return"function"==typeof t?t(e):t}function Dw(t){return t.split("-")[0]}function Ow(t){return t.split("-")[1]}function Iw(t){return"x"===t?"y":"x"}function Nw(t){return"y"===t?"height":"width"}function Lw(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function Bw(t){return Iw(Lw(t))}function $w(t,e,n){void 0===n&&(n=!1);const r=Ow(t),o=Bw(t),i=Nw(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=jw(s)),[s,jw(s)]}function Rw(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Pw=["left","right"],Fw=["right","left"],zw=["top","bottom"],Hw=["bottom","top"];function jw(t){const e=Dw(t);return Mw[e]+t.slice(e.length)}function Uw(t){return"number"!=typeof t?function(t){var e,n,r,o;return{top:null!=(e=t.top)?e:0,right:null!=(n=t.right)?n:0,bottom:null!=(r=t.bottom)?r:0,left:null!=(o=t.left)?o:0}}(t):{top:t,right:t,bottom:t,left:t}}function Vw(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function qw(t,e,n){let{reference:r,floating:o}=t;const i=Lw(e),s=Bw(e),a=Nw(s),l=Dw(e),c="y"===i,d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-o.width,y:u};break;default:p={x:r.x,y:r.y}}const f=Ow(e);return f&&(p[s]+=h*("end"===f?1:-1)*(n&&c?-1:1)),p}async function Ww(t,e){var n;void 0===e&&(e={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:p=0}=_w(e,t),f=Uw(p),g=a[h?"floating"===u?"reference":"floating":u],m=Vw(await i.getClippingRect
vendor: 3,925 bytes, line 1
1({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),A="floating"===u?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},v=Vw(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:A,offsetParent:y,strategy:l}):A);return{top:(m.top-v.top+f.top)/b.y,bottom:(v.bottom-m.bottom+f.bottom)/b.y,left:(m.left-v.left+f.left)/b.x,right:(v.right-m.right+f.right)/b.x}}function Jw(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Gw(t){return bw.some(e=>t[e]>=0)}function Kw(t){const e=kw(...t.map(t=>t.left)),n=kw(...t.map(t=>t.top));return{x:e,y:n,width:Cw(...t.map(t=>t.right))-e,height:Cw(...t.map(t=>t.bottom))-n}}const Yw=new Set(["left","top"]);function Qw(){return"undefined"!=typeof window}function Zw(t){return ek(t)?(t.nodeName||"").toLowerCase():"#document"}function Xw(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function tk(t){var e;return null==(e=(ek(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function ek(t){return!!Qw()&&(t instanceof Node||t instanceof Xw(t).Node)}function nk(t){return!!Qw()&&(t instanceof Element||t instanceof Xw(t).Element)}function rk(t){return!!Qw()&&(t instanceof HTMLElement||t instanceof Xw(t).HTMLElement)}function ok(t){return!(!Qw()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof Xw(t).ShadowRoot)}function ik(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=gk(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&"inline"!==o&&"contents"!==o}function sk(t){return/^(table|td|th)$/.test(Zw(t))}function ak(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const lk=/transform|translate|scale|rotate|perspective|filter/,ck=/paint|layout|strict|content/,dk=t=>!!t&&"none"!==t;let uk;function hk(t){const e=nk(t)?gk(t):t;return dk(e.transform)||dk(e.translate)||dk(e.scale)||dk(e.rotate)||dk(e.perspective)||!pk()&&(dk(e.backdropFilter)||dk(e.filter))||lk.test(e.willChange||"")||ck.test(e.contain||"")}function pk(){return null==uk&&(uk="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),uk}function fk(t){return/^(html|body|#document)$/.test(Zw(t))}function gk(t){return Xw(t).getComputedStyle(t)}function mk(t){return nk(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ak(t){if("html"===Zw(t))return t;const e=t.assignedSlot||t.parentNode||ok(t)&&t.host||tk(t);return ok(e)?e.host:e}function yk(t){const e=Ak(t);return fk(e)?(t.ownerDocument||t).body:rk(e)&&ik(e)?e:yk(e)}function bk(t,e,n){var r;void 0===e&&(e=[]),void 0===n&&(n=!0);const o=yk(t),i=o===(null==(r=t.ownerDocument)?void 0:r.body),s=Xw(o);if(i){const t=vk(s);return e.concat(s,s.visualViewport||[],ik(o)?o:[],t&&n?bk(t):[])}return e.concat(o,bk(o,[],n))}function vk(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function wk(t){const e=gk(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=rk(t),i=o?t.offsetWidth:n,s=o?t.offsetHeight:r,a=xw(n)!==i||xw(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function kk(t){return nk(t)?t:t.contextElement}function Ck(t){const e=kk(t);if(!rk(e))return Ew(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:i}=wk(e);let s=(i?xw(n.width):n.width)/r,a=(i?xw(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const xk=Ew(0);function Sk(t){const e=Xw(t);
vendor: 6,991 bytes, line 1
1return pk()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:xk}function Ek(t,e,n,r){void 0===e&&(e=!1),void 0===n&&(n=!1);const o=t.getBoundingClientRect(),i=kk(t);let s=Ew(1);e&&(r?nk(r)&&(s=Ck(r)):s=Ck(t));const a=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==Xw(t))&&e}(i,n,r)?Sk(i):Ew(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,u=o.height/s.y;if(i){const t=Xw(i),e=r&&nk(r)?Xw(r):r;let n=t,o=vk(n);for(;o&&r&&e!==n;){const t=Ck(o),e=o.getBoundingClientRect(),r=gk(o),i=e.left+(o.clientLeft+parseFloat(r.paddingLeft))*t.x,s=e.top+(o.clientTop+parseFloat(r.paddingTop))*t.y;l*=t.x,c*=t.y,d*=t.x,u*=t.y,l+=i,c+=s,n=Xw(o),o=vk(n)}}return Vw({width:d,height:u,x:l,y:c})}function Mk(t,e){const n=mk(t).scrollLeft;return e?e.left+n:Ek(tk(t)).left+n}function Tk(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-Mk(t,n),y:n.top+e.scrollTop}}function _k(t,e,n){let r;if("viewport"===e)r=function(t,e){const n=Xw(t),r=tk(t),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const t=pk();(!t||t&&"fixed"===e)&&(a=o.offsetLeft,l=o.offsetTop)}const c=Mk(r);if(c<=0){const t=r.ownerDocument,e=t.body,n=getComputedStyle(e),o="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,s=Math.abs(r.clientWidth-e.clientWidth-o);s<=25&&(i-=s)}else c<=25&&(i+=c);return{width:i,height:s,x:a,y:l}}(t,n);else if("document"===e)r=function(t){const e=tk(t),n=mk(t),r=t.ownerDocument.body,o=Cw(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=Cw(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Mk(t);const a=-n.scrollTop;return"rtl"===gk(r).direction&&(s+=Cw(e.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(tk(t));else if(nk(e))r=function(t,e){const n=Ek(t,!0,"fixed"===e),r=n.top+t.clientTop,o=n.left+t.clientLeft,i=rk(t)?Ck(t):Ew(1);return{width:t.clientWidth*i.x,height:t.clientHeight*i.y,x:o*i.x,y:r*i.y}}(e,n);else{const n=Sk(t);r={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return Vw(r)}function Dk(t,e){const n=Ak(t);return!(n===e||!nk(n)||fk(n))&&("fixed"===gk(n).position||Dk(n,e))}function Ok(t,e,n){const r=rk(e),o=tk(e),i="fixed"===n,s=Ek(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=Ew(0);function c(){l.x=Mk(o)}if(r||!r&&!i)if(("body"!==Zw(e)||ik(o))&&(a=mk(e)),r){const t=Ek(e,!0,i,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else o&&c();i&&!r&&o&&c();const d=!o||r||i?Ew(0):Tk(o,a);return{x:s.left+a.scrollLeft-l.x-d.x,y:s.top+a.scrollTop-l.y-d.y,width:s.width,height:s.height}}function Ik(t){return"static"===gk(t).position}function Nk(t,e){if(!rk(t)||"fixed"===gk(t).position)return null;if(e)return e(t);let n=t.offsetParent;return tk(t)===n&&(n=n.ownerDocument.body),n}function Lk(t,e){const n=Xw(t);if(ak(t))return n;if(!rk(t)){let e=Ak(t);for(;e&&!fk(e);){if(nk(e)&&!Ik(e))return e;e=Ak(e)}return n}let r=Nk(t,e);for(;r&&sk(r)&&Ik(r);)r=Nk(r,e);return r&&fk(r)&&Ik(r)&&!hk(r)?n:r||function(t){let e=Ak(t);for(;rk(e)&&!fk(e);){if(hk(e))return e;if(ak(e))return null;e=Ak(e)}return null}(t)||n}const Bk={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const i="fixed"===o,s=tk(r),a=!!e&&ak(e.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Ew(1);const d=Ew(0),u=rk(r);if((u||!u&&!i)&&(("body"!==Zw(r)||ik(s))&&(l=mk(r)),u)){const t=Ek(r);c=Ck(r),d.x=t.x+r.clientLeft,d.y=t.y+r.clientTop}const h=!s||u||i?Ew(0):Tk(s,l);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}},getDocumentElement:tk,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const i="clippingAncestors"===n?ak(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let r=bk(t,[],!1).filter(t=>nk(t)&&"body"!==Zw(t)),o=null;const i="fixed"===gk(t).position;let s=i?Ak(t):t;for(;nk(s)&&!fk(s);){const e=gk(s),n=hk(s);n||"fixed"!==e.position||(o=null),(i?!n&&!o:!n&&"static"===e.position&&o&&("absolute"===o.position||"fixed"===o.position)||ik(s)&&!n&&Dk(t,s))?r=r.filter(t=>t!==s):o=e,s=Ak(s)}return e.set(t,r),r}(e,this._c):[].concat(n),s=[...i,r],a=_k(e,s[0],o);let l=a.top,c=a.right,d=a.bottom,u=a.left;for(let t=1;t<s.length;t++){const n=_k(e,s[t],o);l=Cw(n.top,l),c=kw(n.right,c),d=kw(n.bottom,d),u=Cw(n.left,u)}return{width:c-u,height:d-l,x:u,y:l}},getOffsetParent:Lk,getElementRects:async function(t){const e=this.getOffsetParent||Lk,n=this.getDimensions,r=await n(t.floating);return{reference:Ok(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=wk(t);return{width:e,height:n}},getScale:Ck,isElement:nk,isRTL:function(t){return"rtl"===gk(t).direction}};function $k(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Rk(t,e,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=kk(t),d=o||i?[...c?bk(c):[],...e?bk(e):[]]:[];d.forEach(t=>{o&&t.addEventListener("scroll",n,{passive:!0}),i&&t.addEventListener("resize",n)});const u=c&&a?function(t,e){let n,r=null;const o=tk(t);function i(){var t;clearTimeout(n),null==(t=r)||t.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const c=t.getBoundingClientRect(),{left:d,top:u,width:h,height:p}=c;if(a||e(),!h||!p)return;const f={rootMargin:-Sw(u)+"px "+-Sw(o.clientWidth-(d+h))+"px "+-Sw(o.clientHeight-(u+p))+"px "+-Sw(d)+"px",threshold:Cw(0,kw(1,l))||1};let g=!0;function m(e){const r=e[0].intersectionRatio;if(r!==l){if(!g)return s();r?s(!1,r):n=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==r||$k(c,t.getBoundingClientRect())||s(),g=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(t){r=new IntersectionObserver(m,f)}r.observe(t)}(!0),i}(c,n):null;let h,p=-1,f=null;s&&(f=new ResizeObserver(t=>{let[r]=t;r&&r.target===c&&f&&e&&(f.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var t;null==(t=f)||t.observe(e)})),n()}),c&&!l&&f.observe(c),e&&f.observe(e));let g=l?Ek(t):null;return l&&function e(){const r=Ek(t);g&&!$k(g,r)&&n(),g=r,h=requestAnimationFrame(e)}(),n(),()=>{var t;d.forEach(t=>{o&&t.removeEventListener("scroll",n),i&&t.removeEventListener("resize",n)}),null==u||u(),null==(t=f)||t.disconnect(),f=null,l&&cancelAnimationFrame(h)}}const Pk=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=e,l=await async function(t,e){const{placement:n,platform:r,elements:o}=t,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=Dw(n),a=Ow(n),l="y"===Lw(n),c=Yw.has(s)?-1:1,d=i&&l?-1:1,u=_w(e,t);let{mainAxis:h,crossAxis:p,alignmentAxis:f}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}
vendor: 3,024 bytes, line 1
1:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&"number"==typeof f&&(p="end"===a?-1*f:f),l?{x:p*d,y:h*c}:{x:h*c,y:p*d}}(e,t);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Fk=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o,platform:i}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...c}=_w(t,e),d={x:n,y:r},u=await i.detectOverflow(e,c),h=Lw(o),p=Iw(h);let f=d[p],g=d[h];const m=(t,e)=>Tw(e+u["y"===t?"top":"left"],e,e-u["y"===t?"bottom":"right"]);s&&(f=m(p,f)),a&&(g=m(h,g));const A=l.fn({...e,[p]:f,[h]:g});return{...A,data:{x:A.x-n,y:A.y-r,enabled:{[p]:s,[h]:a}}}}}},zk=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...m}=_w(t,e);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const A=Dw(o),y=Lw(a),b=Dw(a)===a,v=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=h||(b||!g?[jw(a)]:function(t){const e=jw(t);return[Rw(t),e,Rw(e)]}(a)),k="none"!==f;!h&&k&&w.push(...function(t,e,n,r){const o=Ow(t);let i=function(t,e,n){switch(t){case"top":case"bottom":return n?e?Fw:Pw:e?Pw:Fw;case"left":case"right":return e?zw:Hw;default:return[]}}(Dw(t),"start"===n,r);return o&&(i=i.map(t=>t+"-"+o),e&&(i=i.concat(i.map(Rw)))),i}(a,g,f,v));const C=[a,...w],x=await l.detectOverflow(e,m),S=[];let E=(null==(r=i.flip)?void 0:r.overflows)||[];if(d&&S.push(x[A]),u){const t=$w(o,s,v);S.push(x[t[0]],x[t[1]])}if(E=[...E,{placement:o,overflows:S}],!S.every(t=>t<=0)){var M,T;const t=((null==(M=i.flip)?void 0:M.index)||0)+1,e=C[t];if(e&&("alignment"!==u||y===Lw(e)||E.every(t=>Lw(t.placement)!==y||t.overflows[0]>0)))return{data:{index:t,overflows:E},reset:{placement:e}};let n=null==(T=E.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:T.placement;if(!n)switch(p){case"bestFit":{var _;const t=null==(_=E.filter(t=>{if(k){const e=Lw(t.placement);return e===y||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:_[0];t&&(n=t);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},Hk=(t,e,n)=>{const r=new Map,o={platform:Bk,...n},i={...o.platform,_c:r};return(async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:Ww},l=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:d,y:u}=qw(c,r,l),h=r,p=0;const f={};for(let n=0;n<i.length;n++){const g=i[n];if(!g)continue;const{name:m,fn:A}=g,{x:y,y:b,data:v,reset:w}=await A({x:d,y:u,initialPlacement:r,placement:h,strategy:o,middlewareData:f,re
1cts:c,platform:a,elements:{reference:t,floating:e}});d=null!=y?y:d,u=null!=b?b:u,f[m]={...f[m],...v},w&&p<50&&(p++,"object"==typeof w&&(w.placement&&(h=w.placement),w.rects&&(c=!0===w.rects?await s.getElementRects({reference:t,floating:e,strategy:o}):w.rects),({x:d,y:u}=qw(c,h,l))),n=-1)}return{x:d,y:u,placement:h,strategy:o,middlewareData:f}})(t,e,{...o,platform:i})};function jk(t){const e=t&&t.closest&&t.closest(".app-root")||document.querySelector(".app-root");if(!e)return 64;const n=getComputedStyle(e),r=(t,e)=>{const r=parseFloat(n.getPropertyValue(t));return Number.isFinite(r)?r:e};return r("--app-bar-height",64)+r("--app-banner-height",0)}const Uk=new Map,Vk=new Set,qk=new Map;function Wk(t){return t?t.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<foreignObject[\s\S]*?<\/foreignObject>/gi,"").replace(/\s+on\w+\s*=\s*["'][^"']*["']/gi,"").replace(/\s+on\w+\s*=\s*[^\s>"']+/gi,"").replace(/\s+(xlink:)?href\s*=\s*["']\s*javascript:[^"']*["']/gi,"").replace(/\s+(xlink:)?href\s*=\s*["']\s*data:[^"']*["']/gi,"").replace(/<use[\s\S]*?\/?>|<use[\s\S]*?<\/use>/gi,"").replace(/<(animate|animateTransform|animateMotion|set)[\s\S]*?\/?>|<(animate|animateTransform|animateMotion|set)[\s\S]*?<\/\2>/gi,"").replace(/<defs>[\s\S]*?<\/defs>/gi,t=>{const e=t.replace(/<style[\s\S]*?<\/style>/gi,"");return/^\s*$/.test(e.replace(/<\/?defs>/gi,""))?"":e}).replace(/\s+stroke=["'](#000000|#000|black)["']/gi,"").replace(/stroke:\s*(#000000|#000|black)\s*;?/gi,""):t}function Jk(t,e){if(!t)return null;try{const n=t.querySelector(`#${CSS.escape(e)}`);return n?n.querySelector(".heading-icon"):null}catch(t){return console.debug("[getHeadingIconElement] Invalid selector for hookId:",e,t),null}}function Gk(t){Vk.delete(t)}function Kk(t,e){const n=document.createElement("span");n.className="heading-icon",n.setAttribute("tabindex","0");const r=t.attrs.hookId,o=t.attrs.iconId;if(r&&sC&&sC.headingId===r)if(o===sC.iconId)sC=null;else{if(iC)return n.innerHTML=sC.svg,n.classList.add("has-preview"),n.classList.remove("has-icon"),n;sC=null}if(o){const t=qk.get(o);t?(n.innerHTML=t,n.classList.add("has-icon")):e&&r&&e(r,o)}else{const t=Uk.get(r);t&&(n.innerHTML=t.svg,n.classList.add("has-preview"))}return n}function Yk(t,e){t.addEventListener("mouseenter",()=>{var t,n;if(null===(t=e.view)||void 0===t||!t.editable)return;const r=e.node.attrs.hookId,o=e.node.attrs.iconId;r&&!o&&null!==(n=e.options)&&void 0!==n&&n.onHeadingHover&&(Vk.has(r)||(Vk.add(r),e.options.onHeadingHover(r)))}),t.addEventListener("mouseleave",()=>{const t=e.node.attrs.hookId;t&&Vk.delete(t)})}function Qk(t,e){t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("click",n=>{var r,o;if(null===(r=e.view)||void 0===r||!r.editable)return;t.focus();const i=e.node.attrs.hookId;i&&null!==(o=e.options)&&void 0!==o&&o.onHeadingIconClick&&e.options.onHeadingIconClick(i)})}function Zk(t,e){t.addEventListener("keydown",t=>{if("Delete"===t.key||"Backspace"===t.key){var n;if(t.preventDefault(),t.stopPropagation(),null===(n=e.view)||void 0===n||!n.editable)return;const i=e.getPos(),s=e.view.state.tr.setNodeMarkup(i,void 0,{...e.node.attrs,iconId:null});e.view.dispatch(s);const a=e.node.attrs.hookId;var r,o;a&&(Vk.delete(a),null===(r=e.options)||void 0===r||null===(o=r.onHeadingIconDelete)||void 0===o||o.call(r,a))}})}function Xk(t,e,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;if(e&&n!==r&&Uk.delete(e),e&&sC&&sC.headingId===e){if(n!==sC.iconId||r===sC.iconId){if(r===sC.iconId){const n=sC.svg;sC=null;const i=r?qk.get(r)??n:null;return void(i?(t.innerHTML=i,t.classList.add("has-icon"),t.classList.remove("has-preview")):r&&o?(t.classList.remove("has-preview"),o(e,r)):t.classList.remove("has-preview"))}return t.innerHTML=sC.svg,t.classList.add("has-preview"),void t.classList.remove("has-icon")}sC=null}if(n!==r)if(r){const n=qk.get(r);n?(t.innerHTML=n,t.classList.add("has-icon"),t.classList.remove("has-preview")):o&&e&&o(e,r)}else!function(t,e){t&&(t.innerHTML="",t.classList.remove("has-icon"),t.classList.remove("has-preview"),e&&Uk.delete(e))}(t,e)}let tC=null,eC=null,nC=null,rC=null,oC=null,iC=null,sC=null,aC=null;function lC(){null!==aC&&(clearTimeout(aC),aC=null)}function cC(t,e,n,r){sC={headingId:e,iconId:n,svg:r};const o=Jk(t,e);o&&(o.innerHTML=r,o.classList.remove("has-icon"),o.classList.add("has-preview"))}function dC(){lC(),nC&&(document.removeEventListener("click",nC,{capture:!0}),nC=null),rC&&(document.removeEventListener("keydown",rC),rC=null),oC&&(oC(),oC=null),tC&&(tC.remove(),tC=null),eC&&(eC.remove(),eC=null),iC&&(sC=null,iC(),iC=null)}class uC{constructor(t,e,n,r){var o;this.node=t,this.view=e,this.getPos=n,this.options=r,this.iconElement=null;const i=t.attrs.level||1;this.dom=document.createElement(`h${i}`),this._applyAttributes(t.attrs),this.iconElement=Kk(t,null===(o=this.options)||void 0===o?void 0:o.onIconNeedsLoading),this.dom.appendChild(this.iconElement),Yk(this.dom,this),Qk(this.iconElement,this),Zk(this.iconElement,this),this.contentDOM=document.createElement("span"),this.contentDOM.className="heading-content",this.dom.appendChild(this.contentDOM)}_applyAttributes(t){t.hookId&&this.dom.setAttribute("id",t.hookId),t.hookType&&this.dom.setAttribute("data-hook-type",t.hookType),t.iconId?this.dom.setAttribute("data-icon-id",t.iconId):this.dom.removeAttribute("data-icon-id"),t.textAlign?this.dom.style.textAlign=t.textAlign:this.dom.style.removeProperty("text-align")}update(t){var e;if("heading"!==t.type.name)return!1;if(t.attrs.level!==this.node.attrs.level)return!1;const n=this.node.attrs.iconId,r=t.attrs.iconId;this.node=t,this._applyAttributes(t.attrs);const o=t.attrs.hookId;return Xk(this.iconElement,o,n,r,null===(e=this.options)||void 0===e?void 0:e.onIconNeedsLoading),!0}destroy(){var t;const e=null===(t=this.node)||void 0===t||null===(t=t.attrs)||void 0===t?void 0:t.hookId;e&&Gk(e),this.iconElement=null}}const hC=ow.extend({addOptions(){var t;return{...null===(t=this.parent)||void 0===t?void 0:t.call(this),onHeadingIconClick:null,onHeadingIconDelete:null,onHeadingHover:null,onIconNeedsLoading:null}},addAttributes(){var t;return{...null===(t=this.parent)||void 0===t?void 0:t.call(this),iconId:{default:null,parseHTML:t=>t.getAttribute("data-icon-id"),renderHTML:t=>t.iconId?{"data-icon-id":t.iconId}:{}}}},addCommands(){var t;return{...null===(t=this.parent)||void 0===t?void 0:t.call(this),updateHeadingIcon:(t,e)=>n=>{var r;let o=n.editor,i=n.tr;const s=sw(o,t);
1if(!s||null==s.position||!s.block)return!1;const a=null===(r=s.block.type)||void 0===r?void 0:r.name;return("heading"===a||"title"===a)&&(i.setNodeMarkup(s.position,void 0,{...s.block.attrs,iconId:e}),!0)}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t},contentElement:t=>t.querySelector(".heading-content")||t}))},addNodeView(){const t=this.options;return e=>{let n=e.node,r=e.view,o=e.getPos;return new uC(n,r,o,t)}}});var pC=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,fC=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,gC=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,mC=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,AC=Cl.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>"normal"!==t.style.fontStyle&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML(t){let e=t.HTMLAttributes;return["em",ka(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>t=>t.commands.setMark(this.name),toggleItalic:()=>t=>t.commands.toggleMark(this.name),unsetItalic:()=>t=>t.commands.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}}
1,addInputRules(){return[jl({find:pC,type:this.type}),jl({find:gC,type:this.type})]},addPasteRules(){return[oc({find:fC,type:this.type}),oc({find:mC,type:this.type})]}}),yC=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,bC=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,vC=Cl.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("line-through")&&{}}],renderHTML(t){let e=t.HTMLAttributes;return["s",ka(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>t=>t.commands.setMark(this.name),toggleStrike:()=>t=>t.commands.toggleMark(this.name),unsetStrike:()=>t=>t.commands.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[jl({find:yC,type:this.type})]},addPasteRules(){return[oc({find:bC,type:this.t
1ype})]}}),wC=Cl.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("underline")&&{}}],renderHTML(t){let e=t.HTMLAttributes;return["u",ka(this.options.HTMLAttributes,e),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown:(t,e)=>`++${e.renderChildren(t)}++`,markdownTokenizer:{name:"underline",level:"inline",start:t=>t.indexOf("++"),tokenize(t,e,n){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!r)return;const o=r[2].trim();return{type:"underline",raw:r[0],text:o,tokens:n.inlineTokens(o)}}},addCommands(){return{setUnderline:()=>t=>t.commands.setMark(this.name),toggleUnderline:()=>t=>t.commands.toggleMark(this.name),unsetUnderline:()=>t=>t.commands.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});const kC="numeric",CC="ascii",xC="alpha",SC="asciinumeric",EC="alphanumeric",MC="domain",TC="emoji",_C="scheme",DC="slashscheme",OC="whitespace";function IC(t,e){return t in e||(e[t]=[]),e[t]}function NC(t,e,n){e[kC]&&(e[SC]=!0,e[EC]=!0),e[CC]&&(e[SC]=!0,e[xC]=!0),e[SC]&&(e[EC]=!0),e[xC]&&(e[EC]=!0),e[EC]&&(e[MC]=!0),e[TC]&&(e[MC]=!0);for(const r in e){const e=IC(r,n);e.indexOf(t)<0&&e.push(t)}}function LC(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}LC.groups={},LC.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let n=0;n<e.jr.length;n++){const r=e.jr[n][0],o=e.jr[n][1];if(o&&r.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 o=0;o<t.length;o++)this.tt(t[o],e,n,r)},tr(t,e,n,r){let o;return r=r||LC.groups,e&&e.j?o=e:(o=new LC(e),n&&r&&NC(e,n,r)),this.jr.push([t,o]),o},ts(t,e,n,r){let o=this;const i=t.length;if(!i)return o;for(let e=0;e<i-1;e++)o=o.tt(t[e]);return o.tt(t[i-1],e,n,r)},tt(t,e,n,r){r=r||LC.groups;const o=this;if(e&&e.j)return o.j[t]=e,e;const i=e;let s,a=o.go(t);if(a?(s=new LC,Object.assign(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new LC,i){if(r)if(s.t&&"string"==typeof s.t){const t=Object.assign(function(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}(s.t,r),n);NC(i,t,r)}else n&&NC(i,n,r);s.t=i}return o.j[t]=s,s}};const BC=(t,e,n,r,o)=>t.ta(e,n,r,o),$C=(t,e,n,r,o)=>t.tr(e,n,r,o),RC=(t,e,n,r,o)=>t.ts(e,n,r,o),PC=(t,e,n,r,o)=>t.tt(e,n,r,o),FC="WORD",zC="UWORD",HC="ASCIINUMERICAL",jC="ALPHANUMERICAL",UC="LOCALHOST",VC="TLD",qC="UTLD",WC="SCHEME",JC="SLASH_SCHEME",GC="NUM",KC="WS",YC="NL",QC="OPENBRACE",ZC="CLOSEBRACE",XC="OPENBRACKET",tx="CLOSEBRACKET",ex="OPENPAREN",nx="CLOSEPAREN",rx="OPENANGLEBRACKET",ox="CLOSEANGLEBRACKET",ix="FULLWIDTHLEFTPAREN",sx="FULLWIDTHRIGHTPAREN",ax="LEFTCORNERBRACKET",lx="RIGHTCORNERBRACKET",cx="LEFTWHITECORNERBRACKET",dx="RIGHTWHITECORNERBRACKET",ux="FULLWIDTHLESSTHAN",hx="FULLWIDTHGREATERTHAN",px="AMPERSAND",fx="APOSTROPHE",gx="ASTERISK",mx="AT",Ax="BACKSLASH",yx="BACKTICK",bx="CARET",vx="COLON",wx="COMMA",kx="DOLLAR",Cx="DOT",xx="EQUALS",Sx="EXCLAMATION",Ex="HYPHEN",Mx="PERCENT",Tx="PIPE",_x="PLUS",Dx="POUND",Ox="QUERY",Ix="QUOTE",Nx="FULLWIDTHMIDDLEDOT",Lx="SEMI",Bx="SLASH",$x="TILDE",Rx="UNDERSCORE",Px="EMOJI",Fx="SYM";var zx=Object.freeze({__proto__:null,ALPHANUMERICAL:jC,AMPERSAND:px,APOSTROPHE:fx,ASCIINUMERICAL:HC,ASTERISK:gx,AT:mx,BACKSLASH:Ax,BACKTICK:yx,CARET:bx,CLOSEANGLEBRACKET:ox,CLOSEBRACE:ZC,CLOSEBRACKET:tx,CLOSEPAREN:nx,COLON:vx,COMMA:wx,DOLLAR:kx,DOT:Cx,EMOJI:Px,EQUALS:xx,EXCLAMATION:Sx,FULLWIDTHGREATERTHAN:hx,FULLWIDTHLEFTPAREN:ix,FULLWIDTHLESSTHAN:ux,FULLWIDTHMIDDLEDOT:Nx,FULLWIDTHRIGHTPAREN:sx,HYPHEN:Ex,LEFTCORNERBRACKET:ax,LEFTWHITECORNERBRACKET:cx,LOCALHOST:UC,NL:YC,NUM:GC,OPENANGLEBRACKET:rx,OPENBRACE:QC,OPENBRACKET:XC,OPENPAREN:ex,PERCENT:Mx,PIPE:Tx,PLUS:_x,POUND:Dx,QUERY:Ox,QUOTE:Ix,RIGHTCORNERBRACKET:lx,RIGHTWHITECORNERBRACKET:dx,SCHEME:WC,SEMI:Lx,SLASH:Bx,SLASH_SCHEME:JC,SYM:Fx,TILDE:$x,TLD:VC,UNDERSCORE:Rx,UTLD:qC,UWORD:zC,WORD:FC,WS:KC});const Hx=/[a-z]/,jx=/\p{L}/u,Ux=/\p{Emoji}/u,Vx=/\d/,qx=/\s/;let Wx=null,Jx=null;function Gx(t,e){const n=function(t){const e=[],n=t.length;let r=0;for(;r<n;){let o,i=t.charCodeAt(r),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}(e.replace(/[A-Z]/g,t=>t.toLowerCase())),r=n.length,o=[];let i=0,s=0;for(;s<r;){let a=t,l=null,c=0,d=null,u=-1,h=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(u=0,h=0,d=a):u>=0&&(u+=n[s].length,h++),c+=n[s].length,i+=n[s].length,s++;i-=u,s-=h,c-=u,o.push({t:d.t,v:e.slice(i-c,i),s:i-c,e:i})}return o}function Kx(t,e,n,r,o){let i;const s=e.length;for(let n=0;n<s-1;n++){const s=e[n];t.j[s]?i=t.j[s]:(i=new LC(r),i.jr=o.slice(),t.j[s]=i),t=i}return i=new LC(n),i.jr=o.slice(),t.j[e[s-1]]=i,i}function Yx(t){const e=[],n=[];let r=0;for(;r<t.length;){let o=0;for(;"0123456789".indexOf(t[r+o])>=0;)o++;if(o>0){e.push(n.join(""));for(let e=parseInt(t.substring(r,r+o),10);e>0;e--)n.pop();r+=o}else n.push(t[r]),r++}return e}const Qx={defaultProtocol:"http",events:null,format:Xx,formatHref:Xx,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Zx(t,e=null){let n=Object.assign({},Qx);t&&(n=Object.assign(n,t instanceof Zx?t.o:t));const r=n.ignoreTags,o=[];for(let t=0;t<r.length;t++)o.push(r[t].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}function Xx(t){return t}function tS(t,e){this.t="token",this.v=t,this.tk=e}
vendor: 6,195 bytes, line 1
1function eS(t,e){class n extends tS{constructor(e,n){super(e,n),this.t=t}}for(const t in e)n.prototype[t]=e[t];return n.t=t,n}Zx.prototype={o:Qx,ignoreTags:[],defaultRender:t=>t,check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=null!=e;let o=this.o[t];return o?("object"==typeof o?(o=n.t in o?o[n.t]:Qx[t],"function"==typeof o&&r&&(o=o(e,n))):"function"==typeof o&&r&&(o=o(e,n.t,n)),o):o},getObj(t,e,n){let r=this.o[t];return"function"==typeof r&&null!=e&&(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)}},tS.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=Qx.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),i=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),d=t.getObj("attributes",n,e),u=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),d&&Object.assign(s,d),{tagName:o,attributes:s,content:i,eventListeners:u}}};const nS=eS("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),rS=eS("text"),oS=eS("nl"),iS=eS("url",{isLink:!0,toHref(t=Qx.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==UC&&t[1].t===vx}}),sS=t=>new LC(t);function aS(t,e,n){const r=n[0].s,o=n[n.length-1].e;return new t(e.slice(r,o),n)}const lS="undefined"!=typeof console&&console&&console.warn||(()=>{}),cS={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function dS(t,e=!1){if(cS.initialized&&lS(`linkifyjs: already initialized - will not register custom scheme "${t}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error('linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or "-"\n2. Cannot start or end with "-"\n3. "-" cannot repeat');cS.customSchemes.push([t,e])}function uS(t){return cS.initialized||function(){cS.scanner=function(t=[]){const e={};LC.groups=e;const n=new LC;null==Wx&&(Wx=Yx("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2
1ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==Jx&&(Jx=Yx("ελ1υ2бг1ел3дети4ею2католик6ом3мÐ
1ºÐ´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")),PC(n,"'",fx),PC(n,"{",QC),PC(n,"}",ZC),PC(n,"[",XC),PC(n,"]",tx),PC(n,"(",ex),PC(n,")",nx),PC(n,"<",rx),PC(n,">",ox),PC(n,"(",ix),PC(n,")",sx),PC(n,"「",ax),PC(n,"」",lx),PC(n,"『",cx),PC(n,"』",dx),PC(n,"<",ux),PC(n,">",hx),PC(n,"&",px),PC(n,"*",gx),PC(n,"@",mx),PC(n,"`",yx),PC(n,"^",bx),PC(n,":",vx),PC(n,",",wx),PC(n,"$",kx),PC(n,".",Cx),PC(n,"=",xx),PC(n,"!",Sx),PC(n,"-",Ex),PC(n,"%",Mx),PC(n,"|",Tx),PC(n,"+",_x),PC(n,"#",Dx),PC(n,"?",Ox),PC(n,'"',Ix),PC(n,"/",Bx),PC(n,";",Lx),PC(n,"~",$x),PC(n,"_",Rx),PC(n,"\\",Ax),PC(n,"・",Nx);const r=$C(n,Vx,GC,{[kC]:!0});$C(r,Vx,r);const o=$C(r,Hx,HC,{[SC]:!0}),i=$C(r,jx,jC,{[EC]:!0}),s=$C(n,Hx,FC,{[CC]:!0});$C(s,Vx,o),$C(s,Hx,s),$C(o,Vx,o),$C(o,Hx,o);const a=$C(n,jx,zC,{[xC]:!0});$C(a,Hx),$C(a,Vx,i),$C(a,jx,a),$C(i,Vx,i),$C(i,Hx),$C(i,jx,i);const l=PC(n,"\n",YC,{[OC]:!0}),c=PC(n,"\r",KC,{[OC]:!0}),d=$C(n,qx,KC,{[OC]:!0});PC(n,"",d),PC(c,"\n",l),PC(c,"",d),$C(c,qx,d),PC(d,"\r"),PC(d,"\n"),$C(d,qx,d),PC(d,"",d);const u=$C(n,Ux,Px,{[TC]:!0});PC(u,"#"),$C(u,Ux,u),PC(u,"️",u);
vendor: 1,383 bytes, line 1
1const h=PC(u,"‍");PC(h,"#"),$C(h,Ux,u);const p=[[Hx,s],[Vx,o]],f=[[Hx,null],[jx,a],[Vx,i]];for(let t=0;t<Wx.length;t++)Kx(n,Wx[t],VC,FC,p);for(let t=0;t<Jx.length;t++)Kx(n,Jx[t],qC,zC,f);NC(VC,{tld:!0,ascii:!0},e),NC(qC,{utld:!0,alpha:!0},e),Kx(n,"file",WC,FC,p),Kx(n,"mailto",WC,FC,p),Kx(n,"http",JC,FC,p),Kx(n,"https",JC,FC,p),Kx(n,"ftp",JC,FC,p),Kx(n,"ftps",JC,FC,p),NC(WC,{scheme:!0,ascii:!0},e),NC(JC,{slashscheme:!0,ascii:!0},e),t=t.sort((t,e)=>t[0]>e[0]?1:-1);for(let e=0;e<t.length;e++){const r=t[e][0],o=t[e][1]?{[_C]:!0}:{[DC]:!0};r.indexOf("-")>=0?o[MC]=!0:Hx.test(r)?Vx.test(r)?o[SC]=!0:o[CC]=!0:o[kC]=!0,RC(n,r,r,o)}return RC(n,"localhost",UC,{ascii:!0}),n.jd=new LC(Fx),{start:n,tokens:Object.assign({groups:e},zx)}}(cS.customSchemes);for(let t=0;t<cS.tokenQueue.length;t++)cS.tokenQueue[t][1]({scanner:cS.scanner});cS.parser=function({groups:t}){const e=t.domain.concat([px,gx,mx,Ax,yx,bx,kx,xx,Ex,GC,Mx,Tx,_x,Dx,Bx,Fx,$x,Rx]),n=[fx,vx,wx,Cx,Sx,Mx,Ox,Ix,Lx,rx,ox,QC,ZC,tx,XC,ex,nx,ix,sx,ax,lx,cx,dx,ux,hx],r=[px,fx,gx,Ax,yx,bx,kx,xx,Ex,QC,ZC,Mx,Tx,_x,Dx,Ox,Bx,Fx,$x,Rx],o=sS(),i=PC(o,$x);BC(i,r,i),BC(i,t.domain,i);const s=sS(),a=sS(),l=sS();BC(o,t.domain,s),BC(o,t.scheme,a),BC(o,t.slashscheme,l),BC(s,r,i),BC(s,t.domain,s);const c=PC(s,mx);PC(i,mx,c),PC(a,mx,c),PC(l,mx,c);const d=PC(i,Cx);BC(d,r,i),BC(d,t.domain,i);const u=sS();BC(c,t.domain,u),BC(u,t.domain,u);
1const h=PC(u,Cx);BC(h,t.domain,u);const p=sS(nS);BC(h,t.tld,p),BC(h,t.utld,p),PC(c,UC,p);const f=PC(u,Ex);PC(f,Ex,f),BC(f,t.domain,u),BC(p,t.domain,u),PC(p,Cx,h),PC(p,Ex,f);const g=PC(s,Ex),m=PC(s,Cx);PC(g,Ex,g),BC(g,t.domain,s),BC(m,r,i),BC(m,t.domain,s);const A=sS(iS);BC(m,t.tld,A),BC(m,t.utld,A),BC(A,t.domain,s),BC(A,r,i),PC(A,Cx,m),PC(A,Ex,g),PC(A,mx,c);const y=PC(A,vx),b=sS(iS);BC(y,t.numeric,b);const v=sS(iS),w=sS();BC(v,e,v),BC(v,n,w),BC(w,e,v),BC(w,n,w),PC(A,Bx,v),PC(b,Bx,v);const k=PC(a,vx),C=PC(l,vx),x=PC(C,Bx),S=PC(x,Bx);BC(a,t.domain,s),PC(a,Cx,m),PC(a,Ex,g),BC(l,t.domain,s),PC(l,Cx,m),PC(l,Ex,g),BC(k,t.domain,v),PC(k,Bx,v),PC(k,Ox,v),BC(S,t.domain,v),BC(S,e,v),PC(S,Bx,v);const E=[[QC,ZC],[XC,tx],[ex,nx],[rx,ox],[ix,sx],[ax,lx],[cx,dx],[ux,hx]];for(let t=0;t<E.length;t++){const[r,o]=E[t],i=PC(v,r);PC(w,r,i);const s=sS(iS);BC(i,e,s);const a=sS();BC(i,n,a),PC(i,o,v),BC(s,e,s),BC(s,n,a),BC(a,e,s),BC(a,n,a),PC(s,o,v),PC(a,o,v)}return PC(o,UC,A),PC(o,YC,oS),{start:o,tokens:zx}}(cS.scanner.tokens);for(let t=0;t<cS.pluginQueue.length;t++)cS.pluginQueue[t][1]({scanner:cS.scanner,parser:cS.parser});cS.initialized=!0}(),function(t,e,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let a=t,l=null,c=null,d=0,u=null,h=-1;for(;o<r&&!(l=a.go(n[o].t));)s.push(n[o++]);for(;o<r&&(c=l||a.go(n[o].t));)l=null,a=c,a.accepts()?(h=0,u=a):h>=0&&h++,o++,d++;if(h<0)o-=d,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(aS(rS,e,s)),s=[]),o-=h,d-=h;const t=u.t,r=n.slice(o-d,o);i.push(aS(t,e,r))}}return s.length>0&&i.push(aS(rS,e,s)),i}(cS.parser.start,t,Gx(cS.scanner.start,t))}function hS(t,e=null,n=null){if(e&&"object"==typeof e){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new Zx(n),o=uS(t),i=[];for(let t=0;t<o.length;t++){const n=o[t];!n.isLink||e&&n.t!==e||!r.check(n)||i.push(n.toFormattedObject(r))}return i}uS.scan=Gx;var pS="[\0-   ᠎ -\u2029  ]",fS=new RegExp(pS),gS=new RegExp(`${pS}$`),mS=new RegExp(pS,"g");function AS(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(t=>{const e="string"==typeof t?t:t.scheme;e&&n.push(e)}),!t||t.replace(mS,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var yS=Cl.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=>{"string"!=typeof t?dS(t.scheme,t.optionalSlashes):dS(t)})},onDestroy(){LC.groups={},cS.scanner=null,cS.parser=null,cS.tokenQueue=[],cS.pluginQueue=[],cS.customSchemes=[],cS.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!AS(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||n&&!t.includes("@"))return!0;const r=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!/^\d{1,3}(\.\d{1,3}){3}$/.test(r)&&!!/\./.test(r)}}),addAttributes(){return{href:{default:null,parseHTML:t=>t.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!(!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!AS(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML(t){let e=t.HTMLAttributes;return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!AS(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ka(this.options.HTMLAttributes,e),0]:["a",ka(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>
1e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n,r,o,i;const s=null!=(r=null==(n=t.attrs)?void 0:n.href)?r:"",a=null!=(i=null==(o=t.attrs)?void 0:o.title)?i:"",l=e.renderChildren(t);return a?`[${l}](${s} "${a}")`:`[${l}](${s})`},addCommands(){return{setLink:t=>e=>{let n=e.chain;const r=t.href;return!!this.options.isAllowedUri(r,{defaultValidate:t=>!!AS(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&n().setMark(this.name,t).setMeta("preventAutolink",!0).run()},toggleLink:t=>e=>{let n=e.chain;const r=(t||{}).href;return!(r&&!this.options.isAllowedUri(r,{defaultValidate:t=>!!AS(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&n().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>t=>(0,t.chain)().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[oc({find:t=>{const e=[];if(t){const n=this.options,r=n.protocols,o=n.defaultProtocol,i=hS(t).filter(t=>t.isLink&&this.options.isAllowedUri(t.value,{defaultValidate:t=>!!AS(t,r),protocols:r,defaultProtocol:o}));i.length&&i.forEach(t=>{this.options.shouldAutoLink(t.value)&&e.push({text:t.value,data:{href:t.href},index:t.start})})}return e}
1,type:this.type,getAttributes:t=>{var e;return{href:null==(e=t.data)?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],e=this.options,n=e.protocols,r=e.defaultProtocol;return this.options.autolink&&t.push((o={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:t=>this.options.isAllowedUri(t,{defaultValidate:t=>!!AS(t,n),protocols:n,defaultProtocol:r}),shouldAutoLink:this.options.shouldAutoLink},new Ve({key:new Je("autolink"),appendTransaction:(t,e,n)=>{const r=t.some(t=>t.docChanged)&&!e.doc.eq(n.doc),i=t.some(t=>t.getMeta("preventAutolink"));if(!r||i)return;const s=n.tr;return Ba(ca(e.doc,[...t])).forEach(t=>{let e=t.newRange;const r=ua(n.doc,e,t=>t.isTextblock);let i,a;if(r.length>1)i=r[0],a=n.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0," ");else if(r.length){const t=n.doc.textBetween(e.from,e.to," "," ");if(!gS.test(t))return;i=r[0],a=n.doc.textBetween(i.pos,e.to,void 0," ")}if(i&&a){const t=a.split(fS).filter(Boolean);if(t.length<=0)return!1;const e=t[t.length-1],r=i.pos+a.lastIndexOf(e);if(!e)return!1;const c=uS(e).map(t=>t.toObject(o.defaultProtocol));if(!(1===(l=c).length?l[0].isLink:3===l.length&&l[1].isLink&&["()","[]"].includes(l[0].value+l[2].value)))return!1;c.filter(t=>t.isLink).map(t=>({...t,from:r+t.start+1,to:r+t.end+1})).filter(t=>!n.schema.marks.code||!n.doc.rangeHasMark(t.from,t.to,n.schema.marks.code)).filter(t=>o.validate(t.value)).filter(t=>o.shouldAutoLink(t.value)).forEach(t=>{$a(t.from,t.to,n.doc).some(t=>t.mark.type===o.type)||s.addMark(t.from,t.to,o.type.create({href:t.href}))})}var l}),s.steps.length?s:void 0}}))),t.push(function(t){return new Ve({key:new Je("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,i;if(0!==r.button)return!1;if(!e.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{const e=r.target;if(!e)return!1;const n=t.editor.view.dom;s=e.closest("a"),s&&!n.contains(s)&&(s=null)}if(!s)return!1;let a=!1;if(t.enableClickSelection&&(a=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){const n=La(e.state,t.type.name),r=null!=(o=s.href)?o:n.href,l=null!=(i=s.target)?i:n.target;r&&(window.open(r,l),a=!0)}return a}}})}({type:this.type,editor:this.editor,openOnClick:"whenNotEditable"===this.options.openOnClick||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(function(t){return new Ve({key:new Je("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const o=t.shouldAutoLink;if(e.state.selection.empty)return!1;let i="";r.content.forEach(t=>{i+=t.textContent});const s=hS(i,{defaultProtocol:t.defaultProtocol}).find(t=>t.isLink&&t.value===i);return!(!i||!s||void 0!==o&&!o(s.value))&&t.editor.commands.setMark(t.type,{href:s.href})}}})}({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t;var o}}),bS=yS;const vS=["start"];function wS(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return kS(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kS(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kS(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var CS=Object.defineProperty,xS="textStyle",SS=/^\s*([-+*])\s$/,ES=rc.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML(t){let e=t.HTMLAttributes;return["ul",ka(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>"list"!==t.type||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,"\n"):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>t=>{let e=t.commands,n=t.chain;return this.options.keepAttributes?n().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(xS)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}}}
1,addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Wl({find:SS,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Wl({find:SS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(xS),editor:this.editor})),[t]}}),MS=rc.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML(t){let e=t.HTMLAttributes;return["li",ka(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{var n;if("list_item"!==t.type)return[];const r=null!=(n=e.parseBlockChildren)?n:e.parseChildren;let o=[];if(t.tokens&&t.tokens.length>0)if(t.tokens.some(t=>"paragraph"===t.type))o=r(t.tokens);else{const n=t.tokens[0];if(n&&"text"===n.type&&n.tokens&&n.tokens.length>0){if(o=[{type:"paragraph",content:e.parseInline(n.tokens)}],t.tokens.length>1){const e=r(t.tokens.slice(1));o.push(...e)}}else o=r(t.tokens)}return 0===o.length&&(o=[{type:"paragraph",content:[]}]),{type:"listItem",content:o}},renderMarkdown:(t,e,n)=>nc(t,e,t=>{var e,n;return"bulletList"===t.parentType?"- ":"orderedList"===t.parentType?`${((null==(n=null==(e=t.meta)?void 0:e.parentAttrs)?void 0:n.start)||1)+t.index}. `:"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});((t,e)=>{for(var n in e)CS(t,n,{get:e[n],enumerable:!0})})({},{findListItemPos:()=>TS,getNextListDepth:()=>_S,handleBackspace:()=>NS,handleDelete:()=>$S,hasListBefore:()=>DS,hasListItemAfter:()=>RS,hasListItemBefore:()=>OS,listItemHasSubList:()=>IS,nextListIsDeeper:()=>LS,nextListIsHigher:()=>BS});var TS=(t,e)=>{const n=e.selection.$from,r=cs(t,e.schema);let o=null,i=n.depth,s=n.pos,a=null;for(;i>0&&null===a;)o=n.node(i),o.type===r?a=i:(i-=1,s-=1);return null===a?null:{$pos:e.doc.resolve(s),depth:a}},_S=(t,e)=>{const n=TS(t,e);if(!n)return!1;const r=function(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:20;const o=t.doc.resolve(n);let i=r,s=null;for(;i>0&&null===s;){const t=o.node(i);(null==t?void 0:t.type.name)===e?s=t:i-=1}return[s,i]}(e,t,n.$pos.pos+4);return wS(r,2)[1]},DS=(t,e,n)=>{const r=t.selection.$anchor,o=Math.max(0,r.pos-2),i=t.doc.resolve(o).node();return!(!i||!n.includes(i.type.name))},OS=(t,e)=>{var n;const r=e.selection.$anchor,o=e.doc.resolve(r.pos-2);return 0!==o.index()&&(null==(n=o.nodeBefore)?void 0:n.type.name)===t},IS=(t,e,n)=>{if(!n)return!1;const r=cs(t,e.schema);let o=!1;return n.descendants(t=>{t.type===r&&(o=!0)}),o},NS=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!qs(t.state,e)&&DS(t.state,e,n)){const n=t.state.selection.$anchor,r=t.state.doc.resolve(n.before()-1),o=[];r.node().descendants((t,n)=>{t.type.name===e&&o.push({node:t,pos:n})});const i=o.at(-1);if(!i)return!1;const s=t.state.doc.resolve(r.start()+i.pos+1);return t.chain().cut({from:n.start()-1,to:n.end()+1},s.end()).joinForward().run()}if(!qs(t.state,e))return!1;if(!(t=>{const e=t.selection,n=e.$from,r=e.$to;return!(n.parentOffset>0||n.pos!==r.pos)})(t.state))return!1;const r=TS(e,t.state);if(!r)return!1;const o=t.state.doc.resolve(r.$pos.pos-2).node(r.depth),i=IS(e,t.state,o);return OS(e,t.state)&&!i?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},LS=(t,e)=>{const n=_S(t,e),r=TS(t,e);return!(!r||!n)&&n>r.depth},BS=(t,e)=>{const n=_S(t,e),r=TS(t,e);return!(!r||!n)&&n<r.depth},$S=(t,e)=>{if(!qs(t.state,e))return!1;if(!((t,e)=>{const n=t.selection,r=n.$from,o=n.$to,i=n.$anchor;if(e){const n=pa(t=>t.type.name===e)(t.selection);if(!n)return!1;const r=t.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(o.parentOffset<o.parent.nodeSize-2||r.pos!==o.pos)})(t.state,e))return!1;const n=t.state.selection,r=n.$from,o=n.$to;return!(!n.empty&&r.sameParent(o))&&(LS(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():BS(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward())},RS=(t,e)=>{var n;const r=e.selection.$anchor,o=e.doc.resolve(r.pos-r.parentOffset-2);return o.index()!==o.parent.childCount-1&&(null==(n=o.nodeAfter)?void 0:n.type.name)===t},PS=Tl.create({name:"listKeymap",addOptions:()=>({listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}),addKeyboardShortcuts(){return{Delete:t=>{let e=t.editor,n=!1;
1return this.options.listTypes.forEach(t=>{let r=t.itemName;void 0!==e.state.schema.nodes[r]&&$S(e,r)&&(n=!0)}),n},"Mod-Delete":t=>{let e=t.editor,n=!1;return this.options.listTypes.forEach(t=>{let r=t.itemName;void 0!==e.state.schema.nodes[r]&&$S(e,r)&&(n=!0)}),n},Backspace:t=>{let e=t.editor,n=!1;return this.options.listTypes.forEach(t=>{let r=t.itemName,o=t.wrapperNames;void 0!==e.state.schema.nodes[r]&&NS(e,r,o)&&(n=!0)}),n},"Mod-Backspace":t=>{let e=t.editor,n=!1;return this.options.listTypes.forEach(t=>{let r=t.itemName,o=t.wrapperNames;void 0!==e.state.schema.nodes[r]&&NS(e,r,o)&&(n=!0)}),n}}}}),FS=/^(\s*)(\d+)\.\s+(.*)$/,zS=/^\s/;function HS(t,e,n){var r;const o=[];let i=0;for(;i<t.length;){const s=t[i];if(s.indent===e){const a=s.content.split("\n"),l=(null==(r=a[0])?void 0:r.trim())||"",c=[];l&&c.push({type:"paragraph",raw:l,tokens:n.inlineTokens(l)});const d=a.slice(1).join("\n").trim();if(d){const t=n.blockTokens(d);c.push(...t)}let u=i+1;const h=[];for(;u<t.length&&t[u].indent>e;)h.push(t[u]),u+=1;if(h.length>0){const t=Math.min(...h.map(t=>t.indent)),e=HS(h,t,n);c.push({type:"list",ordered:!0,start:h[0].number,items:e,raw:h.map(t=>t.raw).join("\n")})}o.push({type:"list_item",raw:s.raw,tokens:c}),i=u}else i+=1}return o}var jS,US="textStyle",VS=/^(\d+)\.\s$/,qS=rc.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML(t){let e=t.HTMLAttributes;const n=e.start,r=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(e,vS);return 1===n?["ol",ka(this.options.HTMLAttributes,r),0]:["ol",ka(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if("list"!==t.type||!t.ordered)return[];const n=t.start||1,r=t.items?function(t,e){return t.map(t=>{if("list_item"!==t.type)return e.parseChildren([t])[0];const n=[];return t.tokens&&t.tokens.length>0&&t.tokens.forEach(t=>{if("paragraph"===t.type||"list"===t.type||"blockquote"===t.type||"code"===t.type)n.push(...e.parseChildren([t]));else if("text"===t.type&&t.tokens){const r=e.parseChildren([t]);n.push({type:"paragraph",content:r})}else{const r=e.parseChildren([t]);r.length>0&&n.push(...r)}}),{type:"listItem",content:n}})}(t.items,e):[];return 1!==n?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,"\n"):"",markdownTokenizer:{name:"orderedList",level:"block",start:t=>{const e=t.match(/^(\s*)(\d+)\.\s+/),n=null==e?void 0:e.index;return void 0!==n?n:-1},tokenize:(t,e,n)=>{var r;const o=t.split("\n"),i=function(t){const e=[];let n=0,r=0;for(;n<t.length;){const o=t[n],i=o.match(FS);if(!i)break;const s=wS(i,4),a=s[1],l=s[2],c=s[3],d=a.length;let u=c,h=n+1;const p=[o];for(;h<t.length;){const e=t[h];if(e.match(FS))break;if(""===e.trim())p.push(e),u+="\n",h+=1;else{if(!e.match(zS))break;p.push(e),u+=`\n${e.slice(d+2)}`,h+=1}}e.push({indent:d,number:parseInt(l,10),content:u.trim(),raw:p.join("\n")}),r=h,n=h}return[e,r]}(o),s=wS(i,2),a=s[0],l=s[1];if(0===a.length)return;const c=HS(a,0,n);return 0!==c.length?{type:"list",ordered:!0,start:(null==(r=a[0])?void 0:r.number)||1,items:c,raw:o.slice(0,l).join("\n")}:void 0}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>t=>{let e=t.commands,n=t.chain;return this.options.keepAttributes?n().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(US)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}}}
1,addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Wl({find:VS,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Wl({find:VS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(US)}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1],editor:this.editor})),[t]}}),WS=/^\s*(\[([( |x])?\])\s$/,JS=rc.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return""===e||"true"===e},renderHTML:t=>({"data-checked":t.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML(t){let e=t.node,n=t.HTMLAttributes;return["li",ka(this.options.HTMLAttributes,n,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(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)},renderMarkdown:(t,e)=>{var n;return nc(t,e,`- [${(null==(n=t.attrs)?void 0:n.checked)?"x":" "}] `)},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return t=>{let e=t.node,n=t.HTMLAttributes,r=t.getPos,o=t.editor;const i=document.createElement("li"),s=document.createElement("label"),a=document.createElement("span"),l=document.createElement("input"),c=document.createElement("div"),d=t=>{var e,n;l.ariaLabel=(null==(n=null==(e=this.options.a11y)?void 0:e.checkboxLabel)?void 0:n.call(e,t,l.checked))||`Task item checkbox for ${t.textContent||"empty task item"}`};d(e),s.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",t=>t.preventDefault()),l.addEventListener("change",t=>{if(!o.isEditable&&!this.options.onReadOnlyChecked)return void(l.checked=!l.checked);const n=t.target.checked;o.isEditable&&"function"==typeof r&&o.chain().focus(void 0,{scrollIntoView:!1}).command(t=>{let e=t.tr;const o=r();if("number"!=typeof o)return!1;const i=e.doc.nodeAt(o);return e.setNodeMarkup(o,void 0,{...null==i?void 0:i.attrs,checked:n}),!0}).run(),!o.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,n)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(t=>{let e=wS(t,2),n=e[0],r=e[1];i.setAttribute(n,r)}),i.dataset.checked=e.attrs.checked,l.checked=e.attrs.checked,s.append(l,a),i.append(s,c),Object.entries(n).forEach(t=>{let e=wS(t,2),n=e[0],r=e[1];i.setAttribute(n,r)});let u=new Set(Object.keys(n));return{dom:i,contentDOM:c,update:t=>{if(t.type!==this.type)return!1;i.dataset.checked=t.attrs.checked,l.checked=t.attrs.checked,d(t);const e=Ca(t,o.extensionManager.attributes),n=new Set(Object.keys(e)),r=this.options.HTMLAttributes;return u.forEach(t=>{n.has(t)||(t in r?i.setAttribute(t,r[t]):i.removeAttribute(t))}),Object.entries(e).forEach(t=>{let e=wS(t,2),n=e[0],o=e[1];null==o?n in r?i.setAttribute(n,r[n]):i.removeAttribute(n):i.setAttribute(n,o)}),u=n,!0}}}}
1,addInputRules(){return[Wl({find:WS,type:this.type,getAttributes:t=>({checked:"x"===t[t.length-1]})})]}}),GS=rc.create({name:"taskList",addOptions:()=>({itemTypeName:"taskItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML(t){let e=t.HTMLAttributes;return["ul",ka(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,"\n"):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=null==(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))?void 0:e.index;return void 0!==n?n:-1},tokenize(t,e,n){const r=t=>{const e=ec(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:t=>({indentLevel:t[1].length,mainContent:t[4],checked:"x"===t[3].toLowerCase()}),createToken:(t,e)=>({type:"taskItem",raw:"",mainContent:t.mainContent,indentLevel:t.indentLevel,checked:t.checked,text:t.mainContent,tokens:n.inlineTokens(t.mainContent),nestedTokens:e}),customNestedParser:r},n);return e?[{type:"taskList",raw:e.raw,items:e.items}]:n.blockTokens(t)},o=ec(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:t=>({indentLevel:t[1].length,mainContent:t[4],checked:"x"===t[3].toLowerCase()}),createToken:(t,e)=>({type:"taskItem",raw:"",mainContent:t.mainContent,indentLevel:t.indentLevel,checked:t.checked,text:t.mainContent,tokens:n.inlineTokens(t.mainContent),nestedTokens:e}),customNestedParser:r},n);if(o)return{type:"taskList",raw:o.raw,items:o.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>t=>t.commands.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),KS=(Tl.create({name:"listKit",addExtensions(){const t=[];return!1!==this.options.bulletList&&t.push(ES.configure(this.options.bulletList)),!1!==this.options.listItem&&t.push(MS.configure(this.options.listItem)),!1!==this.options.listKeymap&&t.push(PS.configure(this.options.listKeymap)),!1!==this.options.orderedList&&t.push(qS.configure(this.options.orderedList)),!1!==this.options.taskItem&&t.push(JS.configure(this.options.taskItem)),!1!==this.options.taskList&&t.push(GS.configure(this.options.taskList)),t}}),"֑-߿יִ-﷽ﹰ-ﻼ"),YS="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",QS=new RegExp("^[^"+YS+"]*["+KS+"]"),ZS=new RegExp("^[^"+KS+"]*["+YS+"]"),XS=["ltr","rtl","auto"],tE=!1;function eE({types:t}){return new Ve({key:new Je("textDirection"),appendTransaction:(e,n,r)=>{if(tE)return null;if(!e.some(t=>t.docChanged))return;let o=!1;const i=r.tr;return r.doc.descendants((e,n)=>{if(t.includes(e.type.name)){if(null!==e.attrs.dir&&e.textContent.length>0)return;const t=i.storedMarks||[];i.setNodeAttribute(n,"dir",0==(r=e.textContent).length?null:QS.test(r)?"rtl":ZS.test(r)?"ltr":null);for(const e of t)i.addStoredMark(e);o=!0}var r}),o?i:null},props:{handleDOMEvents:{compositionstart:()=>(tE||(tE=!0,clearTimeout(jS),jS=setTimeout(()=>{tE=!1},2e3)),!1),compositionend:()=>(tE=!1,clearTimeout(jS),!1)}}})}var nE=Tl.create({name:"textDirection",addOptions:()=>({types:[],defaultDirection:null}),addGlobalAttributes(){return[{types:this.options.types,attributes:{dir:{default:null,parseHTML:t=>t.dir||this.options.defaultDirection,renderHTML:t=>t.dir===this.options.defaultDirection?{}:{dir:t.dir}}}}]},addCommands(){return{setTextDirection:t=>({commands:e})=>!!XS.includes(t)&&this.options.types.every(n=>e.updateAttributes(n,{dir:t})),unsetTextDirection:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"dir"))}},addKeyboardShortcuts(){return{"Mod-Alt-l":()=>this.editor.commands.setTextDirection("ltr"),"Mod-Alt-r":()=>this.editor.commands.setTextDirection("rtl")}},addProseMirrorPlugins(){return[eE({types:this.options.types})]}}),rE="&nbsp;",oE=rc.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML(t){let e=t.HTMLAttributes;return["p",ka(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(1===n.length&&"image"===n[0].type)return e.parseChildren([n[0]]);const r=e.parseInline(n);return 1!==n.length||"text"!==n[0].type||n[0].raw!==rE&&n[0].text!==rE&&" "!==n[0].raw&&" "!==n[0].text||1!==r.length||"text"!==r[0].type||r[0].text!==rE&&" "!==r[0].text?e.createNode("paragraph",void 0,r):e.createNode("paragraph",void 0,[])},renderMarkdown:(t,e,n)=>{var r,o;
1if(!t)return"";const i=Array.isArray(t.content)?t.content:[];if(0===i.length){const t=Array.isArray(null==(r=null==n?void 0:n.previousNode)?void 0:r.content)?n.previousNode.content:[];return"paragraph"===(null==(o=null==n?void 0:n.previousNode)?void 0:o.type)&&0===t.length?rE:""}return e.renderChildren(i)},addCommands(){return{setParagraph:()=>t=>t.commands.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),iE=oE;const sE=oE.extend({group:"block",content:"inline*",allowHooks:!0,addOptions(){return{...this.options?.(),emptyEditorClass:"is-editor-empty",hasPlaceholderClass:"has-placeholder",placeholder:"",showOnlyWhenEditable:!0}},renderHTML({HTMLAttributes:t}){return["p",ka(this.options.HTMLAttributes,t),0]},addProseMirrorPlugins(){const t=this.options;return[new Ve({props:{decorations:({doc:e})=>{try{const n=this.editor.isEditable||!t.showOnlyWhenEditable,r=[];if(!n)return;const o=this.editor.state.selection;if(!o.empty)return;const i=o.$anchor.parent;if(!i||i.type.name!==this.name)return;if(!i.textContent){const e=[t.hasPlaceholderClass];this.editor.isEmpty&&e.push(t.emptyEditorClass);const n=o.$anchor.before(),s=this.editor.view.coordsAtPos(n),a=ri.node(n,n+i.nodeSize,{class:e.join(" "),"data-placeholder":"function"==typeof t.placeholder?t.placeholder(s.left,s.top):t.placeholder});r.push(a)}if(r.length)return si.create(e,r)}catch(t){console.error("[TiptapExtensionParagraph] Error in decorations:",t)}return si.empty}}})]}}),aE=sE;var lE=rc.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),cE=lE;const dE=lE.extend({group:"inline"});var uE=t=>ql({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:null!=t?t:"“"}),hE=t=>ql({find:/"$/,replace:null!=t?t:"”"}),pE=t=>ql({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:null!=t?t:"‘"}),fE=t=>ql({find:/'$/,replace:null!=t?t:"’"}),gE=Tl.create({name:"typography",addOptions:()=>({closeDoubleQuote:"”",closeSingleQuote:"’",copyright:"©",ellipsis:"…",emDash:"—",laquo:"«",leftArrow:"←",multiplication:"×",notEqual:"≠",oneHalf:"½",oneQuarter:"¼",openDoubleQuote:"“",openSingleQuote:"‘",plusMinus:"±",raquo:"»",registeredTrademark:"®",rightArrow:"→",servicemark:"℠",superscriptThree:"³",superscriptTwo:"²",threeQuarters:"¾",trademark:"™"}),addInputRules(){var t,e;const n=[];var r;!1!==this.options.emDash&&n.push(ql({find:/--$/,replace:null!=(r=this.options.emDash)?r:"—"})),!1!==this.options.ellipsis&&n.push((t=>ql({find:/\.\.\.$/,replace:null!=t?t:"…"}))(this.options.ellipsis));const o="rtl"===this.editor.options.textDirection;if(null==(t=this.options.doubleQuotes)?void 0:t.rtl){const t=this.options.doubleQuotes.rtl,e=t.open,r=t.close;n.push(uE(e)),n.push(hE(r))}else o?(n.push(uE("”")),n.push(hE("“"))):(!1!==this.options.openDoubleQuote&&n.push(uE(this.options.openDoubleQuote)),!1!==this.options.closeDoubleQuote&&n.push(hE(this.options.closeDoubleQuote)));if(null==(e=this.options.singleQuotes)?void 0:e.rtl){const t=this.options.singleQuotes.rtl,e=t.open,r=t.close;n.push(pE(e)),n.push(fE(r))}else o?(n.push(pE("’")),n.push(fE("‘"))):(!1!==this.options.openSingleQuote&&n.push(pE(this.options.openSingleQuote)),!1!==this.options.closeSingleQuote&&n.push(fE(this.options.closeSingleQuote)));return!1!==this.options.leftArrow&&n.push((t=>ql({find:/<-$/,replace:null!=t?t:"←"}))(this.options.leftArrow)),!1!==this.options.rightArrow&&n.push((t=>ql({find:/->$/,replace:null!=t?t:"→"}))(this.options.rightArrow)),!1!==this.options.copyright&&n.push((t=>ql({find:/\(c\)$/,replace:null!=t?t:"©"}))(this.options.copyright)),!1!==this.options.trademark&&n.push((t=>ql({find:/\(tm\)$/,replace:null!=t?t:"™"}))(this.options.trademark)),!1!==this.options.servicemark&&n.push((t=>ql({find:/\(sm\)$/,replace:null!=t?t:"℠"}))(this.options.servicemark)),!1!==this.options.registeredTrademark&&n.push((t=>ql({find:/\(r\)$/,replace:null!=t?t:"®"}))(this.options.registeredTrademark)),!1!==this.options.oneHalf&&n.push((t=>ql({find:/(?:^|\s)(1\/2)\s$/,replace:null!=t?t:"½"}))(this.options.oneHalf)),!1!==this.options.plusMinus&&n.push((t=>ql({find:/\+\/-$/,replace:null!=t?t:"±"}))(this.options.plusMinus)),!1!==this.options.notEqual&&n.push((t=>ql({find:/!=$/,replace:null!=t?t:"≠"}))(this.options.notEqual)),!1!==this.options.laquo&&n.push((t=>ql({find:/<<$/,replace:null!=t?t:"«"}))(this.options.laquo)),!1!==this.options.raquo&&n.push((t=>ql({find:/>>$/,replace:null!=t?t:"»"}))(this.options.raquo)),!1!==this.options.multiplication&&n.push((t=>ql({find:/\d+\s?([*x])\s?\d+$/,replace:null!=t?t:"×"}))(this.options.multiplication)),!1!==this.options.superscriptTwo&&n.push((t=>ql({find:/\^2$/,replace:null!=t?t:"²"}))(this.options.superscriptTwo)),!1!==this.options.superscriptThree&&n.push((t=>ql({find:/\^3$/,replace:null!=t?t:"³"}))(this.options.superscriptThree)),!1!==this.options.oneQuarter&&n.push((t=>ql({find:/(?:^|\s)(1\/4)\s$/,replace:null!=t?t:"¼"}))(this.options.oneQuarter)),!1!==this.options.threeQuarters&&n.push((t=>ql({find:/(?:^|\s)(3\/4)\s$/,replace:null!=t?t:"¾"}))(this.options.threeQuarters)),n}}),mE=gE;function AE(t,e){return"string"==typeof t?e.nodes[t]:t}function yE(t,e,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{const r=t.find(t=>t.type===e&&t.name===n);return!!r&&r.attribute.keepOnSplit}).map(([n,r])=>{const o=t.find(t=>t.type===e&&t.name===n);return o&&o.attribute.defaultOnSplit&&(r=o.attribute.default),[n,r]}))}const bE=t=>({tr:e,state:n,dispatch:r,editor:o})=>{const i=AE(t,n.schema),{$from:s,$to:a}=n.selection,l=n.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(a))return!1;const c=o.extensionManager.attributes;let d=e.storedMarks||n.storedMarks||[];try{const t=s.node();if(t&&t.content&&Array.isArray(t.content.content)&&t.content.content.length>0){const e=t.content.content[t.content.content.length-1];d=[...d,...e.marks||[]]}}catch(t){console.error("[splitListItemImproved] Error while getting the source node marks",t)}if(0===s.parent.content.size&&s.node(-1).childCount===s.indexAfter(-1)){if
1(2===s.depth||s.node(-3).type!==i||s.index(-2)!==s.node(-2).childCount-1)return!1;if(r){let t=M.empty;const n=s.index(-1)?1:s.index(-2)?2:3;for(let e=s.depth-n;e>=s.depth-3;e-=1)t=M.from(s.node(e).copy(t));const r=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,o=yE(c,s.node().type.name,s.node().attrs),a=i.contentMatch.defaultType?.createAndFill(o)||void 0;t=t.append(M.from(i.createAndFill(null,a)||void 0));const l=s.before(s.depth-(n-1));e.replace(l,s.after(-r),new N(t,4-n,0));let d=-1;e.doc.nodesBetween(l,e.doc.content.size,(t,e)=>{if(d>-1)return!1;t.isTextblock&&0===t.content.size&&(d=e+1)}),d>-1&&e.setSelection(_e.near(e.doc.resolve(d))),e.scrollIntoView()}return!0}const u=s.node(-1);if(u.type!==i)return!1;const h=s.node(),p=yE(c,u.type.name,u.attrs),f=yE(c,h.type.name,h.attrs),g=a.pos===s.start(),m=a.pos===s.end(),A=g&&!m,y=u.contentMatchAt(0).defaultType,b=!A&&y?[{type:i,attrs:p},{type:y,attrs:f}]:[{type:i,attrs:p}];if(e.delete(s.pos,a.pos),!re(e.doc,s.pos,2))return!1;if(r){if(e.split(s.pos,2,b),y&&A&&(s.parent.type!=y||s.parent.attrs!=f)){const t=e.mapping.map(s.before()),n=e.doc.resolve(t);s.node(-1).canReplaceWith(n.index(),n.index()+1,y)&&e.setNodeMarkup(t,y,f)}if(d&&d.length>0){const t=o.extensionManager.splittableMarks,n=t?d.filter(e=>t.includes(e.type.name)):d;e.setStoredMarks(n)}e.scrollIntoView()}return!0},vE=t=>({tr:e,state:n,dispatch:r,editor:o,commands:i})=>{const s=AE(t,n.schema),{$from:a,$to:l}=n.selection,c=n.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;if(0!==a.parent.content.size||a.node(-1).childCount!==a.indexAfter(-1))return!1;const d=e.storedMarks||n.storedMarks;if(2!==a.depth&&a.node(-3).type===s&&a.index(-2)===a.node(-2).childCount-1)return!1;const u=i.liftListItem(s);if(u&&r){const t=a.node(-2),n=yE(o.extensionManager.attributes,t.type.name,t.attrs),r=e.mapping.map(a.after()),i=e.doc.resolve(r),s=i.nodeAfter;t&&s&&s.type===t.type&&s.attrs!=n&&(i.parent.canReplaceWith(i.index(),i.index()+1,t.type)&&(e.setNodeMarkup(r,t.type,n),d&&d.length>0&&e.setStoredMarks(d)),e.scrollIntoView())}return u},wE=MS.extend({addCommands:()=>({splitListItemImproved:bE,liftEmptyListItemImproved:vE}),addKeyboardShortcuts(){return{Enter:()=>xA(this.editor,t=>[()=>t.liftEmptyListItemImproved("listItem"),()=>t.splitListItemImproved("listItem")]),Tab:()=>this.editor.commands.sinkListItem("listItem"),"Shift-Tab":()=>this.editor.commands.liftListItem("listItem")}}});let kE,CE;if("undefined"!=typeof WeakMap){let t=new WeakMap;kE=e=>t.get(e),CE=(e,n)=>(t.set(e,n),n)}else{const t=[],e=10;let n=0;kE=e=>{for(let n=0;n<t.length;n+=2)if(t[n]==e)return t[n+1]},CE=(r,o)=>(n==e&&(n=0),t[n++]=r,t[n++]=o)}var xE=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,o=e/this.width|0;let i=r+1,s=o+1;for(let t=1;i<this.width&&this.map[e+t]==n;t++)i++;for(let t=1;s<this.height&&this.map[e+this.width*t]==n;t++)s++;return{left:r,top:o,right:i,bottom:s}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:o,top:i,bottom:s}=this.findCell(t);return"horiz"==e?(n<0?0==r:o==this.width)?null:this.map[i*this.width+(n<0?r-1:o)]:(n<0?0==i:s==this.height)?null:this.map[r+this.width*(n<0?i-1:s)]}rectBetween(t,e){const{left:n,right:r,top:o,bottom:i}=this.findCell(t),{left:s,right:a,top:l,bottom:c}=this.findCell(e);return{left:Math.min(n,s),top:Math.min(o,l),right:Math.max(r,a),bottom:Math.max(i,c)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let o=t.left;o<t.right;o++){const i=r*this.width+o,s=this.map[i];n[s]||(n[s]=!0,o==t.left&&o&&this.map[i-1]==s||r==t.top&&r&&this.map[i-this.width]==s||e.push(s))}return e}positionAt(t,e,n){for(let r=0,o=0;;r++){const i=o+n.child(r).nodeSize;if(r==t){let n=e+t*this.width;const r=(t+1)*this.width;for(;n<r&&this.map[n]<o;)n++;return n==r?i-1:this.map[n]}o=i}}static get(t){return kE(t)||CE(t,function(t){if("table"!=t.type.spec.tableRole)throw new RangeError("Not a table node: "+t.type.name);const e=function(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const o=t.child(r);let i=0;if(n)for(let e=0;e<r;e++){const n=t.child(e);for(let t=0;t<n.childCount;t++){const o=n.child(t);e+o.attrs.rowspan>r&&(i+=o.attrs.colspan)}}for(let t=0;t<o.childCount;t++){const e=o.child(t);i+=e.attrs.colspan,e.attrs.rowspan>1&&(n=!0)}-1==e?e=i:e!=i&&(e=Math.max(e,i))}return e}(t),n=t.childCount,r=[];let o=0,i=null;const s=[];for(let t=0,o=e*n;t<o;t++)r[t]=0;for(let a=0,l=0;a<n;a++){const c=t.child(a);l++;for(let t=0;;t++){for(;o<r.length&&0!=r[o];)o++;if(t==c.childCount)break;const d=c.child(t),{colspan:u,rowspan:h,colwidth:p}=d.attrs;for(let t=0;t<h;t++){if(t+a>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:l,n:h-t});break}const c=o+t*e;for(let t=0;t<u;t++){0==r[c+t]?r[c+t]=l:(i||(i=[])).push({type:"collision",row:a,pos:l,n:u-t});const n=p&&p[t];if(n){const r=(c+t)%e*2,o=s[r];null==o||o!=n&&1==s[r+1]?(s[r]=n,s[r+1]=1):o==n&&s[r+1]++}}}o+=u,l+=d.nodeSize}const d=(a+1)*e;let u=0;for(;o<d;)0==r[o++]&&u++;u&&(i||(i=[])).push({type:"missing",row:a,n:u}),l++}0!==e&&0!==n||(i||(i=[])).push({type:"zero_sized"});const a=new xE(e,n,r,i);let l=!1;for(let t=0;!l&&t<s.length;t+=2)null!=s[t]&&s[t+1]<n&&(l=!0);return l&&function(t,e,n){t.problems||(t.problems=[]);const r={};for(let o=0;o<t.map.length;o++){const i=t.map[o];if(r[i])continue;
1r[i]=!0;const s=n.nodeAt(i);if(!s)throw new RangeError(`No cell with offset ${i} found`);let a=null;const l=s.attrs;for(let n=0;n<l.colspan;n++){const r=e[(o+n)%t.width*2];null==r||l.colwidth&&l.colwidth[n]==r||((a||(a=SE(l)))[n]=r)}a&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a})}}(a,s,t),a}(t))}};function SE(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function EE(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],o=r.spec.tableRole;o&&(e[o]=r)}}return e}const ME=new Je("selectingCells");function TE(t){for(let e=t.depth-1;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return t.node(0).resolve(t.before(e+1));return null}function _E(t){const e=t.selection.$head;for(let t=e.depth;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return!0;return!1}function DE(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&&"cell"==e.node.type.spec.tableRole)return e.$anchor;const n=TE(e.$head)||function(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if("cell"==r||"header_cell"==r)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("cell"==r||"header_cell"==r)return t.doc.resolve(n-e.nodeSize)}}(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function OE(t){return"row"==t.parent.type.spec.tableRole&&!!t.nodeAfter}function IE(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function NE(t,e,n){const r=t.node(-1),o=xE.get(r),i=t.start(-1),s=o.nextCell(t.pos-i,e,n);return null==s?null:t.node(0).resolve(i+s)}function LE(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(t=>t>0)||(r.colwidth=null)),r}function BE(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let t=0;t<n;t++)r.colwidth.splice(e,0,0)}return r}var $E=class t extends Se{constructor(t,e=t){const n=t.node(-1),r=xE.get(n),o=t.start(-1),i=r.rectBetween(t.pos-o,e.pos-o),s=t.node(0),a=r.cellsInRect(i).filter(t=>t!=e.pos-o);a.unshift(e.pos-o);const l=a.map(t=>{const e=n.nodeAt(t);if(!e)throw new RangeError(`No cell with offset ${t} found`);const r=o+t+1;return new Ee(s.resolve(r),s.resolve(r+e.content.size))});super(l[0].$from,l[0].$to,l),this.$anchorCell=t,this.$headCell=e}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),o=e.resolve(n.map(this.$headCell.pos));if(OE(r)&&OE(o)&&IE(r,o)){const e=this.$anchorCell.node(-1)!=r.node(-1);return e&&this.isRowSelection()?t.rowSelection(r,o):e&&this.isColSelection()?t.colSelection(r,o):new t(r,o)}return _e.between(r,o)}content(){const t=this.$anchorCell.node(-1),e=xE.get(t),n=this.$anchorCell.start(-1),r=e.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},i=[];for(let n=r.top;n<r.bottom;n++){const s=[];for(let i=n*e.width+r.left,a=r.left;a<r.right;a++,i++){const n=e.map[i];if(o[n])continue;o[n]=!0;const a=e.findCell(n);let l=t.nodeAt(n);if(!l)throw new RangeError(`No cell with offset ${n} found`);const c=r.left-a.left,d=a.right-r.right;if(c>0||d>0){let t=l.attrs;if(c>0&&(t=LE(t,0,c)),d>0&&(t=LE(t,t.colspan-d,d)),a.left<r.left){if(l=l.type.createAndFill(t),!l)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(t)}`)}else l=l.type.create(t,l.content)}if(a.top<r.top||a.bottom>r.bottom){const t={...l.attrs,rowspan:Math.min(a.bottom,r.bottom)-Math.max(a.top,r.top)};l=a.top<r.top?l.type.createAndFill(t):l.type.create(t,l.content)}s.push(l)}i.push(t.child(n).copy(M.from(s)))}const s=this.isColSelection()&&this.isRowSelection()?t:i;return new N(M.from(s),1,1)}replace(t,e=N.empty){const n=t.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){const{$from:i,$to:s}=r[o],a=t.mapping.slice(n);t.replace(a.map(i.pos),a.map(s.pos),o?N.empty:e)}const o=Se.findFrom(t.doc.resolve(t.mapping.slice(n).map(this.to)),-1);o&&t.setSelection(o)}replaceWith(t,e){this.replace(t,new N(M.from(e),0,0))}forEachCell(t){const e=this.$anchorCell.node(-1),n=xE.get(e),r=this.$anchorCell.start(-1),o=n.cells
1InRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<o.length;n++)t(e.nodeAt(o[n]),r+o[n])}isColSelection(){const t=this.$anchorCell.index(-1),e=this.$headCell.index(-1);if(Math.min(t,e)>0)return!1;const n=t+this.$anchorCell.nodeAfter.attrs.rowspan,r=e+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),o=xE.get(r),i=e.start(-1),s=o.findCell(e.pos-i),a=o.findCell(n.pos-i),l=e.node(0);return s.top<=a.top?(s.top>0&&(e=l.resolve(i+o.map[s.left])),a.bottom<o.height&&(n=l.resolve(i+o.map[o.width*(o.height-1)+a.right-1]))):(a.top>0&&(n=l.resolve(i+o.map[a.left])),s.bottom<o.height&&(e=l.resolve(i+o.map[o.width*(o.height-1)+s.right-1]))),new t(e,n)}isRowSelection(){const t=this.$anchorCell.node(-1),e=xE.get(t),n=this.$anchorCell.start(-1),r=e.colCount(this.$anchorCell.pos-n),o=e.colCount(this.$headCell.pos-n);if(Math.min(r,o)>0)return!1;const i=r+this.$anchorCell.nodeAfter.attrs.colspan,s=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(i,s)==e.width}eq(e){return e instanceof t&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),o=xE.get(r),i=e.start(-1),s=o.findCell(e.pos-i),a=o.findCell(n.pos-i),l=e.node(0);return s.left<=a.left?(s.left>0&&(e=l.resolve(i+o.map[s.top*o.width])),a.right<o.width&&(n=l.resolve(i+o.map[o.width*(a.top+1)-1]))):(a.left>0&&(n=l.resolve(i+o.map[a.top*o.width])),s.right<o.width&&(e=l.resolve(i+o.map[o.width*(s.top+1)-1]))),new t(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new t(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new t(e.resolve(n),e.resolve(r))}getBookmark(){return new RE(this.$anchorCell.pos,this.$headCell.pos)}};$E.prototype.visible=!1,Se.jsonID("cell",$E);var RE=class t{constructor(t,e){this.anchor=t,this.head=e}map(e){return new t(e.map(this.anchor),e.map(this.head))}resolve(t){const e=t.resolve(this.anchor),n=t.resolve(this.head);return"row"==e.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&e.index()<e.parent.childCount&&n.index()<n.parent.childCount&&IE(e,n)?new $E(e,n):Se.near(n,1)}};function PE(t){if(!(t.selection instanceof $E))return null;const e=[];return t.selection.forEachCell((t,n)=>{e.push(ri.node(n,n+t.nodeSize,{class:"selectedCell"}))}),si.create(t.doc,e)}const FE=new Je("fix-tables");function zE(t,e,n,r){const o=t.childCount,i=e.childCount;t:for(let s=0,a=0;s<i;s++){const i=e.child(s);for(let e=a,r=Math.min(o,s+3);e<r;e++)if(t.child(e)==i){a=e+1,n+=i.nodeSize;continue t}r(i,n),a<o&&t.child(a).sameMarkup(i)?zE(t.child(a),i,n+1,r):i.nodesBetween(0,i.content.size,r,n+1),n+=i.nodeSize}}function HE(t,e){let n;const r=(e,r)=>{"table"==e.type.spec.tableRole&&(n=function(t,e,n,r){const o=xE.get(e);if(!o.problems)return r;r||(r=t.tr);const i=[];for(let t=0;t<o.height;t++)i.push(0);for(let t=0;t<o.problems.length;t++){const s=o.problems[t];if("collision"==s.type){const t=e.nodeAt(s.pos);if(!t)continue;const o=t.attrs;for(let t=0;t<o.rowspan;t++)i[s.row+t]+=s.n;r.setNodeMarkup(r.mapping.map(n+1+s.pos),null,LE(o,o.colspan-s.n,s.n))}else if("missing"==s.type)i[s.row]+=s.n;else if("overlong_rowspan"==s.type){const t=e.nodeAt(s.pos);if(!t)continue;r.setNodeMarkup(r.mapping.map(n+1+s.pos),null,{...t.attrs,rowspan:t.attrs.rowspan-s.n})}else if("colwidth mismatch"==s.type){const t=e.nodeAt(s.pos);if(!t)continue;r.setNodeMarkup(r.mapping.map(n+1+s.pos),null,{...t.attrs,colwidth:s.colwidth})}else if("zero_sized"==s.type){const t=r.mapping.map(n);r.delete(t,t+e.nodeSize)}}let s,a;for(let t=0;t<i.length;t++)i[t]&&(null==s&&(s=t),a=t);for(let l=0,c=n+1;l<o.height;l++){const n=e.child(l),o=c+n.nodeSize,d=i[l];if(d>0){let e="cell";n.firstChild&&(e=n.firstChild.type.spec.tableRole);const i=[];for(let n=0;n<d;n++){const n=EE(t.schema)[e].createAndFill();n&&i.push(n)}const u=0!=l&&s!=l-1||a!=l?o-1:c+1;r.insert(r.mapping.map(u),i)}c=o}return r.setMeta(FE,{fixTables:!0})}(t,e,r,n))};return e?e.doc!=t.doc&&zE(e.doc,t.doc,0,r):t.doc.descendants(r),n}function jE(t){const e=t.selection,n=DE(t),r=n.node(-1),o=n.start(-1),i=xE.get(r);return{...e instanceof $E?i.rectBetween(e.$anchorCell.pos-o,e.$headCell.pos-o):i.findCell(n.pos-o),tableStart:o,map:i,table:r}}function UE(t,{map:e,tableStart:n,table:r},o){let i=o>0?-1:0;(function(t,e,n){const r=EE(e.type.schema).header_cell;for(let o=0;o<t.height;o++)if(e.nodeAt(t.map[n+o*t.width]).type!=r)return!1;return!0})(e,r,o+i)&&(i=0==o||o==e.width?null:0);for(let s=0;s<e.height;s++){const a=s*e.width+o;if(o>0&&o<e.width&&e.map[a-1]==e.map[a]){const i=e.map[a],l=r.nodeAt(i);t.setNodeMarkup(t.mapping.map(n+i),null,BE(l.attrs,o-e.colCount(i))),s+=l.attrs.rowspan-1}else{const l=null==i?EE(r.type.schema).cell:r.nodeAt(e.map[a+i]).type,c=e.positionAt(s,o,r);t.insert(t.mapping.map(n+c),l.createAndFill())}}return t}function VE(t,{map:e,table:n,tableStart:r},o){const i=t.mapping.maps.length;for(let s=0;s<e.height;){const a=s*e.width+o,l=e.map[a],c=n.nodeAt(l),d=c.attrs;if(o>0&&e.map[a-1]==l||o<e.width-1&&e.map[a+1]==l)t.setNodeMarkup(t.mapping.slice(i).map(r+l),null,LE(d,o-e.colCount(l)));else{const e=t.mapping.slice(i).map(r+l);t.delete(e,e+c.nodeSize)}s+=d.rowspan}
1}function qE(t,{map:e,tableStart:n,table:r},o){let i=n;for(let t=0;t<o;t++)i+=r.child(t).nodeSize;const s=[];let a=o>0?-1:0;(function(t,e,n){var r;const o=EE(e.type.schema).header_cell;for(let i=0;i<t.width;i++)if((null===(r=e.nodeAt(t.map[i+n*t.width]))||void 0===r?void 0:r.type)!=o)return!1;return!0})(e,r,o+a)&&(a=0==o||o==e.height?null:0);for(let i=0,c=e.width*o;i<e.width;i++,c++)if(o>0&&o<e.height&&e.map[c]==e.map[c-e.width]){const o=e.map[c],s=r.nodeAt(o).attrs;t.setNodeMarkup(n+o,null,{...s,rowspan:s.rowspan+1}),i+=s.colspan-1}else{var l;const t=null==a?EE(r.type.schema).cell:null===(l=r.nodeAt(e.map[c+a*e.width]))||void 0===l?void 0:l.type,n=null==t?void 0:t.createAndFill();n&&s.push(n)}return t.insert(i,EE(r.type.schema).row.create(null,s)),t}function WE(t,{map:e,table:n,tableStart:r},o){let i=0;for(let t=0;t<o;t++)i+=n.child(t).nodeSize;const s=i+n.child(o).nodeSize,a=t.mapping.maps.length;t.delete(i+r,s+r);const l=new Set;for(let i=0,s=o*e.width;i<e.width;i++,s++){const c=e.map[s];if(!l.has(c))if(l.add(c),o>0&&c==e.map[s-e.width]){const e=n.nodeAt(c).attrs;t.setNodeMarkup(t.mapping.slice(a).map(c+r),null,{...e,rowspan:e.rowspan-1}),i+=e.colspan-1}else if(o<e.height&&c==e.map[s+e.width]){const s=n.nodeAt(c),l=s.attrs,d=s.type.create({...l,rowspan:s.attrs.rowspan-1},s.content),u=e.positionAt(o+1,i,n);t.insert(t.mapping.slice(a).map(r+u),d),i+=l.colspan-1}}}function JE(t){const e=t.content;return 1==e.childCount&&e.child(0).isTextblock&&0==e.child(0).childCount}function GE(t,e){const n=t.selection;if(!(n instanceof $E)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=jE(t),{map:o}=r;if(function({width:t,height:e,map:n},r){let o=r.top*t+r.left,i=o,s=(r.bottom-1)*t+r.left,a=o+(r.right-r.left-1);for(let e=r.top;e<r.bottom;e++){if(r.left>0&&n[i]==n[i-1]||r.right<t&&n[a]==n[a+1])return!0;i+=t,a+=t}for(let i=r.left;i<r.right;i++){if(r.top>0&&n[o]==n[o-t]||r.bottom<e&&n[s]==n[s+t])return!0;o++,s++}return!1}(o,r))return!1;if(e){const n=t.tr,i={};let s,a,l=M.empty;for(let t=r.top;t<r.bottom;t++)for(let e=r.left;e<r.right;e++){const c=o.map[t*o.width+e],d=r.table.nodeAt(c);if(!i[c]&&d)if(i[c]=!0,null==s)s=c,a=d;else{JE(d)||(l=l.append(d.content));const t=n.mapping.map(c+r.tableStart);n.delete(t,t+d.nodeSize)}}if(null==s||null==a)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...BE(a.attrs,a.attrs.colspan,r.right-r.left-a.attrs.colspan),rowspan:r.bottom-r.top}),l.size>0){const t=s+1+a.content.size,e=JE(a)?s+1:t;n.replaceWith(e+r.tableStart,t+r.tableStart,l)}n.setSelection(new $E(n.doc.resolve(s+r.tableStart))),e(n)}return!0}function KE(t,e){const n=EE(t.schema);return(r=({node:t})=>n[t.type.spec.tableRole],(t,e)=>{const n=t.selection;let o,i;if(n instanceof $E){if(n.$anchorCell.pos!=n.$headCell.pos)return!1;o=n.$anchorCell.nodeAfter,i=n.$anchorCell.pos}else{var s;if(o=function(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if("cell"===n||"header_cell"===n)return t.node(e)}return null}(n.$from),!o)return!1;i=null===(s=TE(n.$from))||void 0===s?void 0:s.pos}if(null==o||null==i)return!1;if(1==o.attrs.colspan&&1==o.attrs.rowspan)return!1;if(e){let s=o.attrs;const a=[],l=s.colwidth;s.rowspan>1&&(s={...s,rowspan:1}),s.colspan>1&&(s={...s,colspan:1});const c=jE(t),d=t.tr;for(let t=0;t<c.right-c.left;t++)a.push(l?{...s,colwidth:l&&l[t]?[l[t]]:null}:s);let u;for(let t=c.top;t<c.bottom;t++){let e=c.map.positionAt(t,c.left,c.table);t==c.top&&(e+=o.nodeSize);for(let n=c.left,i=0;n<c.right;n++,i++)n==c.left&&t==c.top||d.insert(u=d.mapping.map(e+c.tableStart,1),r({node:o,row:t,col:n}).createAndFill(a[i]))}d.setNodeMarkup(i,r({node:o,row:c.top,col:c.left}),a[0]),n instanceof $E&&d.setSelection(new $E(d.doc.resolve(n.$anchorCell.pos),u?d.doc.resolve(u):void 0)),e(d)}return!0})(t,e);var r}function YE(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:"row"==t?e.map.width:1,bottom:"column"==t?e.map.height:1});for(let t=0;t<r.length;t++){const o=e.table.nodeAt(r[t]);if(o&&o.type!==n.header_cell)return!1}return!0}function QE(t,e){return(e=e||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(t){return function(e,n){if(!_E(e))return!1;
1if(n){const r=EE(e.schema),o=jE(e),i=e.tr,s=o.map.cellsInRect("column"==t?{left:o.left,top:0,right:o.right,bottom:o.map.height}:"row"==t?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),a=s.map(t=>o.table.nodeAt(t));for(let t=0;t<s.length;t++)a[t].type==r.header_cell&&i.setNodeMarkup(o.tableStart+s[t],r.cell,a[t].attrs);if(0===i.steps.length)for(let t=0;t<s.length;t++)i.setNodeMarkup(o.tableStart+s[t],r.header_cell,a[t].attrs);n(i)}return!0}}(t):function(e,n){if(!_E(e))return!1;if(n){const r=EE(e.schema),o=jE(e),i=e.tr,s=YE("row",o,r),a=YE("column",o,r),l=("column"===t?s:"row"===t&&a)?1:0,c="column"==t?{left:0,top:l,right:1,bottom:o.map.height}:"row"==t?{left:l,top:0,right:o.map.width,bottom:1}:o,d="column"==t?a?r.cell:r.header_cell:"row"==t?s?r.cell:r.header_cell:r.cell;o.map.cellsInRect(c).forEach(t=>{const e=t+o.tableStart,n=i.doc.nodeAt(e);n&&i.setNodeMarkup(e,d,n.attrs)}),n(i)}return!0}}QE("row",{useDeprecatedLogic:!0}),QE("column",{useDeprecatedLogic:!0});const ZE=QE("cell",{useDeprecatedLogic:!0});function XE(t){return function(e,n){if(!_E(e))return!1;const r=function(t,e){if(e<0){const e=t.nodeBefore;if(e)return t.pos-e.nodeSize;for(let e=t.index(-1)-1,n=t.before();e>=0;e--){const r=t.node(-1).child(e),o=r.lastChild;if(o)return n-1-o.nodeSize;n-=r.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const e=t.node(-1);for(let n=t.indexAfter(-1),r=t.after();n<e.childCount;n++){const t=e.child(n);if(t.childCount)return r+1;r+=t.nodeSize}}return null}(DE(e),t);if(null==r)return!1;if(n){const t=e.doc.resolve(r);n(e.tr.setSelection(_e.between(t,(o=t,o.node(0).resolve(o.pos+o.nodeAfter.nodeSize)))).scrollIntoView())}var o;return!0}}function tM(t,e){const n=t.selection;if(!(n instanceof $E))return!1;if(e){const r=t.tr,o=EE(t.schema).cell.createAndFill().content;n.forEachCell((t,e)=>{t.content.eq(o)||r.replace(r.mapping.map(e+1),r.mapping.map(e+t.nodeSize-1),new N(o,0,0))}),r.docChanged&&e(r)}return!0}function eM(t,e){const n=t.createAndFill();return new Ce(n).replace(0,n.content.size,e).doc}function nM(t,e,n,r,o,i,s,a){if(0==s||s==e.height)return!1;let l=!1;for(let c=o;c<i;c++){const o=s*e.width+c,i=e.map[o];if(e.map[o-e.width]==i){l=!0;const o=n.nodeAt(i),{top:d,left:u}=e.findCell(i);t.setNodeMarkup(t.mapping.slice(a).map(i+r),null,{...o.attrs,rowspan:s-d}),t.insert(t.mapping.slice(a).map(e.positionAt(s,u,n)),o.type.createAndFill({...o.attrs,rowspan:d+o.attrs.rowspan-s})),c+=o.attrs.colspan-1}}return l}function rM(t,e,n,r,o,i,s,a){if(0==s||s==e.width)return!1;let l=!1;for(let c=o;c<i;c++){const o=c*e.width+s,i=e.map[o];if(e.map[o-1]==i){l=!0;const o=n.nodeAt(i),d=e.colCount(i),u=t.mapping.slice(a).map(i+r);t.setNodeMarkup(u,null,LE(o.attrs,s-d,o.attrs.colspan-(s-d))),t.insert(u+o.nodeSize,o.type.createAndFill(LE(o.attrs,0,s-d))),c+=o.attrs.rowspan-1}}return l}function oM(t,e,n,r,o){let i=n?t.doc.nodeAt(n-1):t.doc;if(!i)throw new Error("No table found");let s=xE.get(i);const{top:a,left:l}=r,c=l+o.width,d=a+o.height,u=t.tr;let h=0;function p(){if(i=n?u.doc.nodeAt(n-1):u.doc,!i)throw new Error("No table found");s=xE.get(i),h=u.mapping.maps.length}(function(t,e,n,r,o,i,s){const a=EE(t.doc.type.schema);let l,c;if(o>e.width)for(let i=0,d=0;i<e.height;i++){const u=n.child(i);d+=u.nodeSize;const h=[];let p;p=null==u.lastChild||u.lastChild.type==a.cell?l||(l=a.cell.createAndFill()):c||(c=a.header_cell.createAndFill());for(let t=e.width;t<o;t++)h.push(p);t.insert(t.mapping.slice(s).map(d-1+r),h)}if(i>e.height){const d=[];for(let t=0,r=(e.height-1)*e.width;t<Math.max(e.width,o);t++){const o=!(t>=e.width)&&n.nodeAt(e.map[r+t]).type==a.header_cell;d.push(o?c||(c=a.header_cell.createAndFill()):l||(l=a.cell.createAndFill()))}const u=a.row.create(null,M.from(d)),h=[];for(let t=e.height;t<i;t++)h.push(u);t.insert(t.mapping.slice(s).map(r+n.nodeSize-2),h)}return!(!l&&!c)})(u,s,i,n,c,d,h)&&p(),nM(u,s,i,n,l,c,a,h)&&p(),nM(u,s,i,n,l,c,d,h)&&p(),rM(u,s,i,n,a,d,l,h)&&p(),rM(u,s,i,n,a,d,c,h)&&p();for(let t=a;t<d;t++){const e=s.positionAt(t,l,i),r=s.positionAt(t,c,i);u.replace(u.mapping.slice(h).map(e+n),u.mapping.slice(h).map(r+n),new N(o.rows[t-a],0,0))}p(),u.setSelection(new $E(u.doc.resolve(n+s.positionAt(a,l,i)),u.doc.resolve(n+s.positionAt(d-1,c-1,i)))),e(u)}const iM=Vi({ArrowLeft:aM("horiz",-1),ArrowRight:aM("horiz",1),ArrowUp:aM("vert",-1),ArrowDown:aM("vert",1),"Shift-ArrowLeft":lM("horiz",-1),"Shift-ArrowRight":lM("horiz",1),"Shift-ArrowUp":lM("vert",-1),"Shift-ArrowDown":lM("vert",1),Backspace:tM,"Mod-Backspace":tM,Delete:tM,"Mod-Delete":tM});function sM(t,e,n){return!n.eq(t.selection)&&(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function aM(t,e){return(n,r,o)=>{if(!o)return!1;const i=n.selection;if(i instanceof $E)return sM(n,r,Se.near(i.$headCell,e));if("horiz"!=t&&!i.empty)return!1;const s=hM(o,t,e);if(null==s)return!1;if("horiz"==t)return sM(n,r,Se.near(n.doc.resolve(i.head+e),e));{const o=n.doc.resolve(s),i=NE(o,t,e);let a;return a=i?Se.near(i,1):e<0?Se.near(n.doc.resolve(o.before(-1)),-1):Se.near(n.doc.resolve(o.after(-1)),1),sM(n,r,a)}}}function lM(t,e){return(n,r,o)=>{if(!o)return!1;const i=n.selection;let s;if(i instanceof $E)s=i;else{const r=hM(o,t,e);if(null==r)return!1;s=new $E(n.doc.resolve(r))}const a=NE(s.$headCell,t,e);return!!a&&sM(n,r,new $E(s.$anchorCell,a))}}function cM(t,e){const n=TE(t.state.doc.resolve(e));return!!n&&(t.dispatch(t.state.tr.setSelection(new $E(n))),!0)}function dM(t,e,n){if(!_E(t.state))return!1;let r=function(t){if(0===t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;1==e.childCount&&(n>0&&r>0||"table"==e.child(0).type.spec.tableRole);)n--,r--,e=e.child(0).content;const o=e.child(0),i=o.type.spec.tableRole,s=o.type.schema,a=[];if("row"==i)for(let t=0;t<e.childCount;t++){let o=e.child(t).content;const i=t?0:Math.max(0,n-1),l=t<e.childCount-1?0:Math.max(0,r-1);(i||l)&&(o=eM(EE(s).row,new N(o,i,l)).content),a.push(o)}else{if("cell"!=i&&"header_cell"!=i)return null;a.push(n||r?eM(EE(s).row,new N(e,n,r)).content:e)}return function(t,e){const n=[];for(let t=0;t<e.length;t++){const r=e[t];for(let e=r.childCount-1;e>=0;e--){const{rowspan:o,colspan:i}=r.child(e).attrs;for(let e=t;e<t+o;e++)n[e]=(n[e]||0)+i}}let r=0;for(let t=0;t<n.length;t++)r=Math.max(r,n[t]);for(let o=0;o<n.length;o++)if(o>=e.length&&e.push(M.empty),n[o]<r){const i=EE(t).cell.createAndFill(),s=[];for(let t=n[o];t<r;t++)s.push(i);e[o]=e[o].append(M.from(s))}return{height:e.length,width:r,rows:e}}(s,a)}(n);const o=t.state.selection;if(o instanceof $E){r||(r={width:1,height:1,rows:[M.from(eM(EE(t.state.schema).cell,n))]});const e=o.$anchorCell.node(-1),i=o.$anchorCell.start(-1),s=xE.get(e).rectBetween(o.$anchorCell.pos-i,o.$headCell.pos-i);return r=function({width:t,height:e,rows:n},r,o){if(t!=r){const e=[],o=[];for(let t=0;t<n.length;t++){const i=n[t],s=[];for(let n=e[t]||0,o=0;n<r;o++){let a=i.child(o%i.childCount);n+a.attrs.colspan>r&&(a=a.type.createChecked(LE(a.attrs,a.attrs.colspan,n+a.attrs.colspan-r),a.content)),s.push(a),n+=a.attrs.colspan;for(let n=1;n<a.attrs.rowspan;n++)e[t+n]=(e[t+n]||0)+a.attrs.colspan}o.push(M.from(s))}n=o,t=r}if(e!=o){const t=[];for(let r=0,i=0;r<o;r++,i++){const s=[],a=n[i%e];for(let t=0;t<a.childCount;t++){let e=a.child(t);r+e.attrs.rowspan>o&&(e=e.type.create({...e.attrs,rowspan:Math.max(1,o-e.attrs.rowspan)},e.content)),s.push(e)}t.push(M.from(s))}n=t,e=o}return{width:t,height:e,rows:n}}(r,s.right-s.left,s.bottom-s.top),oM(t.state,t.dispatch,i,s,r),!0}if(r){const e=DE(t.state),n=e.start(-1);return oM(t.state,t.dispatch,n,xE.get(e.node(-1)).findCell(e.pos-n),r),!0}return!1}function uM(t,e){var n;if(0!=e.button)return;if(e.ctrlKey||e.metaKey)return;const r=pM(t,e.target);let o;if(e.shiftKey&&t.state.selection instanceof $E)i(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&null!=(o=TE(t.state.selection.$anchor))&&(null===(n=fM(t,e))||void 0===n?void 0:n.pos)!=o.pos)i(o,e),e.preventDefault();else if(!r)return;function i(e,n){let r=fM(t,n);const o=null==ME.getState(t.state);if(!r||!IE(e,r)){if(!o)return;r=e}const i=new $E(e,r);if(o||!t.state.selection.eq(i)){const n=t.state.tr.setSelection(i);o&&n.setMeta(ME,e.pos),t.dispatch(n)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",a),null!=ME.getState(t.state)&&t.dispatch(t.state.tr.setMeta(ME,-1))}function a(n){const o=n,a=ME.getState(t.state);let l;if(null!=a)l=t.state.doc.resolve(a);else if(pM(t,o.target)!=r&&(l=fM(t,e),!l))return s();l&&i(l,o)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",a)}function hM(t,e,n){if(!(t.state.selection instanceof _e))return null;const{$head:r}=t.state.selection;for(let o=r.depth-1;o>=0;o--){const i=r.node(o);
1if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:i.childCount))return null;if("cell"==i.type.spec.tableRole||"header_cell"==i.type.spec.tableRole){const i=r.before(o),s="vert"==e?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(s)?i:null}}return null}function pM(t,e){for(;e&&e!=t.dom;e=e.parentNode)if("TD"==e.nodeName||"TH"==e.nodeName)return e;return null}function fM(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});if(!n)return null;let{inside:r,pos:o}=n;return r>=0&&TE(t.state.doc.resolve(r))||TE(t.state.doc.resolve(o))}var gM=class{constructor(t,e){this.node=t,this.defaultCellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${e}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),mM(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type==this.node.type&&(this.node=t,mM(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return"attributes"==t.type&&(t.target==this.table||this.colgroup.contains(t.target))}};function mM(t,e,n,r,o,i){let s=0,a=!0,l=e.firstChild;const c=t.firstChild;if(c){for(let t=0,n=0;t<c.childCount;t++){const{colspan:d,colwidth:u}=c.child(t).attrs;for(let t=0;t<d;t++,n++){const c=o==n?i:u&&u[t],d=c?c+"px":"";if(s+=c||r,c||(a=!1),l)l.style.width!=d&&(l.style.width=d),l=l.nextSibling;else{const t=document.createElement("col");t.style.width=d,e.appendChild(t)}}}for(;l;){var d;const t=l.nextSibling;null===(d=l.parentNode)||void 0===d||d.removeChild(l),l=t}a?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}}const AM=new Je("tableColumnResizing");var yM=class t{constructor(t,e){this.activeHandle=t,this.dragging=e}apply(e){const n=this,r=e.getMeta(AM);if(r&&null!=r.setHandle)return new t(r.setHandle,!1);if(r&&void 0!==r.setDragging)return new t(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let r=e.mapping.map(n.activeHandle,-1);return OE(e.doc.resolve(r))||(r=-1),new t(r,n.dragging)}return n}};function bM(t,e,n,r){const o="right"==n?-r:r,i=t.posAtCoords({left:e.clientX+o,top:e.clientY});if(!i)return-1;const{pos:s}=i,a=TE(t.state.doc.resolve(s));if(!a)return-1;if("right"==n)return a.pos;const l=xE.get(a.node(-1)),c=a.start(-1),d=l.map.indexOf(a.pos-c);return d%l.width==0?-1:c+l.map[d-1]}function vM(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function wM(t,e){t.dispatch(t.state.tr.setMeta(AM,{setHandle:e}))}function kM(t,e,n,r){const o=t.state.doc.resolve(e),i=o.node(-1),s=o.start(-1),a=xE.get(i).colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;let l=t.domAtPos(o.start(-1)).node;for(;l&&"TABLE"!=l.nodeName;)l=l.parentNode;l&&mM(i,l.firstChild,l,r,a,n)}function CM(t){return Array(t).fill(0)}function xM({allowTableNodeSelection:t=!1}={}){return new Ve({key:ME,state:{init:()=>null,apply(t,e){const n=t.getMeta(ME);if(null!=n)return-1==n?null:n;if(null==e||!t.docChanged)return e;const{deleted:r,pos:o}=t.mapping.mapResult(e);return r?null:o}},props:{decorations:PE,handleDOMEvents:{mousedown:uM},createSelectionBetween:t=>null!=ME.getState(t.state)?t.state.selection:null,handleTripleClick:cM,handleKeyDown:iM,handlePaste:dM},appendTransaction:(e,n,r)=>function(t,e,n){const r=(e||t).selection,o=(e||t).doc;let i,s;if(r instanceof Oe&&(s=r.node.type.spec.tableRole)){if("cell"==s||"header_cell"==s)i=$E.create(o,r.from);else if("row"==s){const t=o.resolve(r.from+1);i=$E.rowSelection(t,t)}else if(!n){const t=xE.get(r.node),e=r.from+1,n=e+t.map[t.width*t.height-1];i=$E.create(o,e+1,n)}}else r instanceof _e&&function({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,o=t.depth;for(;o>=0&&!(t.after(o+1)<t.end(o));o--,n++);for(let t=e.depth;t>=0&&!(e.before(t+1)>e.start(t));t--,r--);return n==r&&/row|table/.test(t.node(o).type.spec.tableRole)}(r)?i=_e.create(o,r.from):r instanceof _e&&function({$from:t,$to:e}){let n,r;for(let e=t.depth;e>0;
1e--){const r=t.node(e);if("cell"===r.type.spec.tableRole||"header_cell"===r.type.spec.tableRole){n=r;break}}for(let t=e.depth;t>0;t--){const n=e.node(t);if("cell"===n.type.spec.tableRole||"header_cell"===n.type.spec.tableRole){r=n;break}}return n!==r&&0===e.parentOffset}(r)&&(i=_e.create(o,r.$from.start(),r.$from.end()));return i&&(e||(e=t.tr)).setSelection(i),e}(r,HE(r,n),t)})}var SM=rc.create({name:"tableCell",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth"),n=e?e.split(",").map(t=>parseInt(t,10)):null;if(!n){const e=t.closest("table")?.querySelectorAll("colgroup > col"),n=Array.from(t.parentElement?.children||[]).indexOf(t);if(n&&n>-1&&e&&e[n]){const t=e[n].getAttribute("width");return t?[parseInt(t,10)]:null}}return n}}}),tableRole:"cell",isolating:!0,parseHTML:()=>[{tag:"td"}],renderHTML({HTMLAttributes:t}){return["td",ka(this.options.HTMLAttributes,t),0]}}),EM=rc.create({name:"tableHeader",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(t=>parseInt(t,10)):null}}}),tableRole:"header_cell",isolating:!0,parseHTML:()=>[{tag:"th"}],renderHTML({HTMLAttributes:t}){return["th",ka(this.options.HTMLAttributes,t),0]}}),MM=rc.create({name:"tableRow",addOptions:()=>({HTMLAttributes:{}}),content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML:()=>[{tag:"tr"}],renderHTML({HTMLAttributes:t}){return["tr",ka(this.options.HTMLAttributes,t),0]}});function TM(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function _M(t,e,n,r,o,i){let s=0,a=!0,l=e.firstChild;const c=t.firstChild;if(null!==c)for(let t=0,n=0;t<c.childCount;t+=1){const{colspan:d,colwidth:u}=c.child(t).attrs;for(let t=0;t<d;t+=1,n+=1){const c=o===n?i:u&&u[t],d=c?`${c}px`:"";if(s+=c||r,c||(a=!1),l){if(l.style.width!==d){const[t,e]=TM(r,c);l.style.setProperty(t,e)}l=l.nextSibling}else{const t=document.createElement("col"),[n,o]=TM(r,c);t.style.setProperty(n,o),e.appendChild(t)}}}for(;l;){const t=l.nextSibling;l.parentNode?.removeChild(l),l=t}a?(n.style.width=`${s}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${s}px`)}var DM=class{constructor(t,e=25,n,r,o=!1){this.isDragging=!1,this.dragStartX=0,this.dragStartScrollLeft=0,this.rafId=null,this.node=t,this.cellMinWidth=e||25,this.view=n,this.getPos=r,this.customScrollbar=o,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.customScrollbar?this.setupCustomScrollbar():(this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),_M(t,this.colgroup,this.table,this.cellMinWidth),this.contentDOM=this.table.appendChild(document.createElement("tbody"))),this.captureColumnWidths()}setupCustomScrollbar(){this.scrollContainer=document.createElement("div"),this.scrollContainer.className="tableScrollContainer";const t=document.createElement("style");this.dom.appendChild(t),this.table=this.scrollContainer.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),_M(this.node,this.colgroup,this.table,this.cellMinWidth),this.contentDOM=this.table.appendChild(document.createElement("tbody")),this.dom.appendChild(this.scrollContainer),this.scrollbarTrack=document.createElement("div"),this.scrollbarTrack.className="customScrollbarTrack",this.scrollbarThumb=document.createElement("div"),this.scrollbarThumb.className="customScrollbarThumb",this.scrollbarThumb.addEventListener("mouseenter",()=>{!this.isDragging&&this.scrollbarThumb&&(this.scrollbarThumb.style.background="rgba(0, 0, 0, 0.5)")}),this.scrollbarThumb.addEventListener("mouseleave",()=>{!this.isDragging&&this.scrollbarThumb&&(this.scrollbarThumb.style.background="rgba(0, 0, 0, 0.3)")}),this.scrollbarTrack.appendChild(this.scrollbarThumb),this.dom.appendChild(this.scrollbarTrack),this.setupScrollbarEvents(),this.setupObservers(),this.updateScrollbar()}setupScrollbarEvents(){if(!this.scrollContainer||!this.scrollbarThumb||!this.scrollbarTrack)return;this.scrollContainer.addEventListener("wheel",t=>{if(!this.scrollContainer)return;if(this.table.scrollWidth<=this.scrollContainer.clientWidth)return;const e=Math.abs(t.deltaX),n=Math.abs(t.deltaY);
1if(!(e>n||t.shiftKey&&n>0))return;const r=this.scrollContainer.scrollLeft,o=this.scrollContainer.scrollWidth-this.scrollContainer.clientWidth;let i=t.deltaX;0===i&&t.shiftKey&&(i=t.deltaY),(i<0&&r>0||i>0&&r<o)&&(t.preventDefault(),null===this.rafId&&(this.rafId=requestAnimationFrame(()=>{if(!this.scrollContainer)return void(this.rafId=null);const t=Math.max(0,Math.min(o,r+i));this.scrollContainer.scrollLeft=t,this.updateScrollbarPosition(),this.rafId=null})))},{passive:!1});const t=t=>{if(!this.isDragging||!this.scrollContainer||!this.scrollbarTrack)return;t.preventDefault();const e=t.clientX-this.dragStartX,n=this.scrollbarTrack.clientWidth,r=this.scrollContainer.scrollWidth,o=this.scrollContainer.clientWidth,i=e*(r/n);this.scrollContainer.scrollLeft=Math.max(0,Math.min(r-o,this.dragStartScrollLeft+i)),this.updateScrollbarPosition()},e=()=>{this.isDragging=!1,this.scrollbarThumb&&(this.scrollbarThumb.style.cursor="grab",this.scrollbarThumb.style.background="rgba(0, 0, 0, 0.3)"),document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",e)};this.scrollbarThumb.addEventListener("mousedown",n=>{this.scrollContainer&&(n.preventDefault(),this.isDragging=!0,this.dragStartX=n.clientX,this.dragStartScrollLeft=this.scrollContainer.scrollLeft,this.scrollbarThumb&&(this.scrollbarThumb.style.cursor="grabbing",this.scrollbarThumb.style.background="rgba(0, 0, 0, 0.5)"),document.addEventListener("mousemove",t),document.addEventListener("mouseup",e))}),this.scrollbarTrack.addEventListener("click",t=>{if(!this.scrollContainer||!this.scrollbarTrack||!this.scrollbarThumb||t.target===this.scrollbarThumb)return;const e=this.scrollbarTrack.getBoundingClientRect(),n=t.clientX-e.left,r=this.scrollbarTrack.clientWidth,o=this.scrollbarThumb.clientWidth,i=Math.max(0,Math.min(r-o,n-o/2)),s=(this.scrollContainer.scrollWidth-this.scrollContainer.clientWidth)/(r-o);this.scrollContainer.scrollLeft=i*s,this.updateScrollbarPosition()})}setupObservers(){this.scrollContainer&&(this.resizeObserver=new ResizeObserver(()=>{this.updateScrollbar()}),this.resizeObserver.observe(this.scrollContainer),this.resizeObserver.observe(this.table),this.mutationObserver=new MutationObserver(()=>{null!==this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{this.updateScrollbar(),this.rafId=null})}),this.mutationObserver.observe(this.table,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]}))}updateScrollbar(){if(!this.scrollContainer||!this.scrollbarTrack||!this.scrollbarThumb)return;const t=this.scrollContainer.scrollWidth,e=this.scrollContainer.clientWidth;if(t>e){this.scrollbarTrack.style.display="block";const n=Math.max(30,e/t*this.scrollbarTrack.clientWidth);this.scrollbarThumb.style.width=`${n}px`,this.updateScrollbarPosition()}else this.scrollbarTrack.style.display="none",this.scrollContainer.scrollLeft=0}updateScrollbarPosition(){if(!this.scrollContainer||!this.scrollbarTrack||!this.scrollbarThumb)return;const t=this.scrollContainer.scrollLeft,e=this.scrollContainer.scrollWidth,n=this.scrollContainer.clientWidth,r=this.scrollbarTrack.clientWidth,o=this.scrollbarThumb.clientWidth,i=e-n,s=i>0?t/i*(r-o):0;this.scrollbarThumb.style.left=`${s}px`}captureColumnWidths(){this.view&&this.getPos&&requestAnimationFrame(()=>{if(!this.view||!this.getPos)return;if(void 0===this.getPos())return;const t=this.colgroup.querySelectorAll("col");t.forEach(t=>{t.style.width="",t.style.minWidth=""}),requestAnimationFrame(()=>{if(!this.view||!this.getPos)return;const e=this.getPos();if(void 0===e)return;const n=[];if(t.forEach(t=>{n.push(t.offsetWidth)}),0===n.length)return;const r=this.view.state.doc.nodeAt(e);if(!r||!r.firstChild)return;const o=[];r.forEach(t=>{const e=[];let r=0;t.forEach(t=>{const{colspan:o}=t.attrs,i=[];for(let t=0;t<o;t+=1)r+t<n.length&&i.push(n[r+t]);const s={...t.attrs,colwidth:i.length>0?i:t.attrs.colwidth},a=t.type.create(s,t.content,t.marks);e.push(a),r+=o});const i=t.type.create(t.attrs,e,t.marks);o.push(i)});const i=r.type.create(r.attrs,o,r.marks),s=this.view.state.tr.replaceWith(e,e+r.nodeSize,i);s.docChanged&&(this.view.dispatch(s),setTimeout(()=>{if(!this.view||!this.getPos)return;const t=this.getPos();if(void 0===t)return;const e=this.view.state.doc.nodeAt(t);e&&(this.node=e,_M(e,this.colgroup,this.table,this.cellMinWidth),this.customScrollbar&&this.updateScrollbar())},100))})})}update(t){return t.type===this.node.type&&(this.node=t,_M(t,this.colgroup,this.table,this.cellMinWidth),this.customScrollbar&&this.updateScrollbar(),!0)}ignoreMutation(t){const e=t.target,n=this.dom.contains(e),r=this.contentDOM.contains(e);return!(!n||r||"attributes"!==t.type&&"childList"!==t.type&&"characterData"!==t.type)}destroy(){null!==this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=void 0),this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=void 0),this.scrollContainer=void 0,this.scrollbarTrack=void 0,this.scrollbarThumb=void 0}};function OM(t,e){return e?t.createChecked(null,e):t.createAndFill()}var IM=({editor:t})=>{const{selection:e}=t.state;if(!function(t){return t instanceof $E}(e))return!1;let n=0;const r=ha(e.ranges[0].$from,t=>"table"===t.type.name);return r?.node.descendants(t=>{if("table"===t.type.name)return!1;["tableCell","tableHeader"].includes(t.type.name)&&(n+=1)}),n===e.ranges.length&&(t.commands.deleteTable(),!0)},NM=rc.create({name:"table",addOptions:()=>({HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:function(t,e,n,r){return new DM(t,e,n,r,!1)},lastColumnResizable:!0,allowTableNodeSelection:!1,customScrollbar:!1}),content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML:()=>[{tag:"table"}],renderHTML({node:t,HTMLAttributes:e}){const{colgroup:n,tableWidth:r,tableMinWidth:o}=function(t,e){let n=0,r=!0;const o=[],i=t.firstChild;if(!i)return{};for(let t=0,s=0;t<i.childCount;t+=1){const{colspan:a,colwidth:l}=i.child(t).attrs;for(let t=0;t<a;t+=1,s+=1){const i=void 0===s?void 0:l&&l[t];n+=i||e,i||(r=!1);const[a,c]=TM(e,i);o.push(["col",{style:`${a}: ${c}`}])}}const s=r?`${n}px`:"",a=r?"":`${n}px`;return{colgroup:["colgroup",{},...o],tableWidth:s,tableMinWidth:a}}(t,this.options.cellMinWidth);return["table",ka(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${o}`}),n,["tbody",0]]},parseMarkdown:(t,e)=>{const n=[];if(t.header){const r=[];t.header.forEach(t=>{r.push(e.createNode("tableHeader",{},[{type:"paragraph",content:e.parseInline(t.tokens)}
1]))}),n.push(e.createNode("tableRow",{},r))}return t.rows&&t.rows.forEach(t=>{const r=[];t.forEach(t=>{r.push(e.createNode("tableCell",{},[{type:"paragraph",content:e.parseInline(t.tokens)}]))}),n.push(e.createNode("tableRow",{},r))}),e.createNode("table",void 0,n)},renderMarkdown:(t,e)=>function(t,e,n={}){const r=n.cellLineSeparator??"�";if(!t||!t.content||0===t.content.length)return"";const o=[];t.content.forEach(t=>{const n=[];t.content&&t.content.forEach(t=>{let o="";o=t.content&&Array.isArray(t.content)&&t.content.length>1?t.content.map(t=>e.renderChildren(t)).join(r):t.content?e.renderChildren(t.content):"";const i=(o||"").replace(/\s+/g," ").trim(),s="tableHeader"===t.type;n.push({text:i,isHeader:s})}),o.push(n)});const i=o.reduce((t,e)=>Math.max(t,e.length),0);if(0===i)return"";const s=new Array(i).fill(0);o.forEach(t=>{for(let e=0;e<i;e+=1){const n=(t[e]?.text||"").length;n>s[e]&&(s[e]=n),s[e]<3&&(s[e]=3)}});const a=(t,e)=>t+" ".repeat(Math.max(0,e-t.length)),l=o[0],c=l.some(t=>t.isHeader);let d="\n";const u=new Array(i).fill(0).map((t,e)=>c&&l[e]&&l[e].text||"");return d+=`| ${u.map((t,e)=>a(t,s[e])).join(" | ")} |\n`,d+=`| ${s.map(t=>"-".repeat(Math.max(3,t))).join(" | ")} |\n`,(c?o.slice(1):o).forEach(t=>{d+=`| ${new Array(i).fill(0).map((e,n)=>a(t[n]&&t[n].text||"",s[n])).join(" | ")} |\n`}),d}(t,e),addCommands:()=>({insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:o,editor:i})=>{const s=function(t,e,n,r,o){const i=function(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}(t),s=[],a=[];for(let t=0;t<n;t+=1){const t=OM(i.cell,o);if(t&&a.push(t),r){const t=OM(i.header_cell,o);t&&s.push(t)}}const l=[];for(let t=0;t<e;t+=1)l.push(i.row.createChecked(null,r&&0===t?s:a));return i.table.createChecked(null,l)}(i.schema,t,e,n);if(o){const t=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(_e.near(r.doc.resolve(t)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>function(t,e){if(!_E(t))return!1;if(e){const n=jE(t);e(UE(t.tr,n,n.left))}return!0}(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>function(t,e){if(!_E(t))return!1;if(e){const n=jE(t);e(UE(t.tr,n,n.right))}return!0}(t,e),deleteColumn:()=>({state:t,dispatch:e})=>function(t,e){if(!_E(t))return!1;if(e){const n=jE(t),r=t.tr;if(0==n.left&&n.right==n.map.width)return!1;for(let t=n.right-1;VE(r,n,t),t!=n.left;t--){const t=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!t)throw new RangeError("No table found");n.table=t,n.map=xE.get(t)}e(r)}return!0}(t,e),addRowBefore:()=>({state:t,dispatch:e})=>function(t,e){if(!_E(t))return!1;if(e){const n=jE(t);e(qE(t.tr,n,n.top))}return!0}(t,e),addRowAfter:()=>({state:t,dispatch:e})=>function(t,e){if(!_E(t))return!1;if(e){const n=jE(t);e(qE(t.tr,n,n.bottom))}return!0}(t,e),deleteRow:()=>({state:t,dispatch:e})=>function(t,e){if(!_E(t))return!1;if(e){const n=jE(t),r=t.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(let t=n.bottom-1;WE(r,n,t),t!=n.top;t--){const t=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!t)throw new RangeError("No table found");n.table=t,n.map=xE.get(n.table)}e(r)}return!0}(t,e),deleteTable:()=>({state:t,dispatch:e})=>function(t,e){const n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if("table"==n.node(r).type.spec.tableRole)return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}(t,e),mergeCells:()=>({state:t,dispatch:e})=>GE(t,e),splitCell:()=>({state:t,dispatch:e})=>KE(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>QE("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>QE("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>ZE(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>!!GE(t,e)||KE(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>function(t,e){return function(n,r){if(!_E(n))return!1;const o=DE(n);if(o.nodeAfter.attrs[t]===e)return!1;if(r){const i=n.tr;n.selection instanceof $E?n.selection.forEachCell((n,r)=>{n.attrs[t]!==e&&i.setNodeMarkup(r,null,{...n.attrs,[t]:e})}):i.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[t]:e}),r(i)}return!0}}(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>XE(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>XE(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&HE(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const n=$E.create(e.doc,t.anchorCell,t.headCell);e.setSelection(n)}return!0}}),addKeyboardShortcuts(){return{Tab:()=>!!this.editor.commands.goToNextCell()||!!this.editor.can().addRowAfter()&&this.editor.chain().addRowAfter().goToNextCell().run(),"
1Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:IM,"Mod-Backspace":IM,Delete:IM,"Mod-Delete":IM}},addNodeView(){const t=this.options.customScrollbar,e=this.options.cellMinWidth;if(!this.options.resizable||!this.editor.isEditable)return({node:n,view:r,getPos:o})=>new DM(n,e,r,"function"==typeof o?o:void 0,t)},addProseMirrorPlugins(){const t=this.options.resizable&&this.editor.isEditable,e=this.options.customScrollbar,n=this.options.cellMinWidth,r=class extends DM{constructor(t,r,o,i){super(t,n,o,i,e)}};t&&(this.options.View=r);const o=t?function({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=gM,lastColumnResizable:o=!0}={}){const i=new Ve({key:AM,state:{init(t,e){var o;const s=null===(o=i.spec)||void 0===o||null===(o=o.props)||void 0===o?void 0:o.nodeViews,a=EE(e.schema).table.name;return r&&s&&(s[a]=(t,e)=>new r(t,n,e)),new yM(-1,!1)},apply:(t,e)=>e.apply(t)},props:{attributes:t=>{const e=AM.getState(t);return e&&e.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(e,n)=>{!function(t,e,n,r){if(!t.editable)return;const o=AM.getState(t.state);if(o&&!o.dragging){const i=function(t){for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}(e.target);let s=-1;if(i){const{left:r,right:o}=i.getBoundingClientRect();e.clientX-r<=n?s=bM(t,e,"left",n):o-e.clientX<=n&&(s=bM(t,e,"right",n))}if(s!=o.activeHandle){if(!r&&-1!==s){const e=t.state.doc.resolve(s),n=e.node(-1),r=xE.get(n),o=e.start(-1);if(r.colCount(e.pos-o)+e.nodeAfter.attrs.colspan-1==r.width-1)return}wM(t,s)}}}(e,n,t,o)},mouseleave:t=>{!function(t){if(!t.editable)return;const e=AM.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&wM(t,-1)}(t)},mousedown:(t,r)=>{!function(t,e,n,r){var o;if(!t.editable)return!1;const i=null!==(o=t.dom.ownerDocument.defaultView)&&void 0!==o?o:window,s=AM.getState(t.state);if(!s||-1==s.activeHandle||s.dragging)return!1;const a=t.state.doc.nodeAt(s.activeHandle),l=function(t,e,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const i=t.domAtPos(e);let s=i.node.childNodes[i.offset].offsetWidth,a=n;if(r)for(let t=0;t<n;t++)r[t]&&(s-=r[t],a--);return s/a}(t,s.activeHandle,a.attrs);function c(e){i.removeEventListener("mouseup",c),i.removeEventListener("mousemove",d);const r=AM.getState(t.state);(null==r?void 0:r.dragging)&&(function(t,e,n){const r=t.state.doc.resolve(e),o=r.node(-1),i=xE.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let t=0;t<i.height;t++){const e=t*i.width+a;if(t&&i.map[e]==i.map[e-i.width])continue;const r=i.map[e],c=o.nodeAt(r).attrs,d=1==c.colspan?0:a-i.colCount(r);if(c.colwidth&&c.colwidth[d]==n)continue;const u=c.colwidth?c.colwidth.slice():CM(c.colspan);u[d]=n,l.setNodeMarkup(s+r,null,{...c,colwidth:u})}l.docChanged&&t.dispatch(l)}(t,r.activeHandle,vM(r.dragging,e,n)),t.dispatch(t.state.tr.setMeta(AM,{setDragging:null})))}function d(e){if(!e.which)return c(e);const o=AM.getState(t.state);if(o&&o.dragging){const i=vM(o.dragging,e,n);kM(t,o.activeHandle,i,r)}}t.dispatch(t.state.tr.setMeta(AM,{setDragging:{startX:e.clientX,startWidth:l}})),kM(t,s.activeHandle,l,r),i.addEventListener("mouseup",c),i.addEventListener("mousemove",d),e.preventDefault()}(t,r,e,n)}},decorations:t=>{const e=AM.getState(t);if(e&&e.activeHandle>-1)return function(t,e){const n=[],r=t.doc.resolve(e),o=r.node(-1);if(!o)return si.empty;const i=xE.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1;for(let e=0;e<i.height;e++){const r=a+e*i.width;if(!(a!=i.width-1&&i.map[r]==i.map[r+1]||0!=e&&i.map[r]==i.map[r-i.width])){var l;const e=i.map[r],a=s+e+o.nodeAt(e).nodeSize-1,c=document.createElement("div");c.className="column-resize-handle",(null===(l=AM.getState(t))||void 0===l?void 0:l.dragging)&&n.push(ri.node(s+e,s+e+o.nodeAt(e).nodeSize,{class:"column-resize-dragging"})),n.push(ri.widget(a,c))}}return si.create(t.doc,n)}(t,e.activeHandle)},nodeViews:{}}});return i}({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:r,lastColumnResizable:this.options.lastColumnResizable}):null;return[...t&&o?[o]:[],xM({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema:t=>({tableRole:ya(fa(t,"tableRole",{name:t.name,options:t.options,storage:t.storage}))})});Tl.create({name:"tableKit",addExtensions(){const t=[];return!1!==this.options.table&&t.push(NM.configure(this.options.table)),!1!==this.options.tableCell&&t.push(SM.configure(this.options.tableCell)),!1!==this.options.tableHeader&&t.push(EM.configure(this.options.tableHeader)),!1!==this.options.tableRow&&t.push(MM.configure(this.options.tableRow)),t}});const LM=new Je("tableCellIndex"),BM=new Je("tableRowIndex"),$M=SM.extend({addAttributes(){return{...this.parent?.(),cellIndex:{default:null,parseHTML:t=>t.getAttribute("data-cell-index"),renderHTML:t=>null==t.cellIndex?{}:{"data-cell-index":t.cellIndex}}}},addProseMirrorPlugins:()=>[new Ve({key:LM,appendTransaction:(t,e,n)=>{const r=n.tr;let o=!1;try{n.doc.descendants((t,e)=>{if("tableCell"===t.type.name||"tableHeader"===t.type.name){const i=function(t,e){const n=e.doc.resolve(t);let r=0;for(let e=n.depth;e>0;e--)if("tableRow"===n.node(e).type.name){const o=n.node(e);let i=n.start(e)+1;o.forEach((e,n)=>
1{i+n<t&&("tableCell"!==e.type.name&&"tableHeader"!==e.type.name||r++)});break}return r}(e,n);t.attrs.cellIndex!==i&&(r.setNodeMarkup(e,null,{...t.attrs,cellIndex:i}),o=!0)}})}catch(t){console.error("[tableCellIndexPlugin] Error:",t)}return o?r:null}})]}),RM=EM.extend({addAttributes(){return{...this.parent?.(),cellIndex:{default:null,parseHTML:t=>t.getAttribute("data-cell-index"),renderHTML:t=>null==t.cellIndex?{}:{"data-cell-index":t.cellIndex}}}}}),PM=MM.extend({addAttributes(){return{...this.parent?.(),rowIndex:{default:null,parseHTML:t=>t.getAttribute("data-row-index"),renderHTML:t=>null==t.rowIndex?{}:{"data-row-index":t.rowIndex}}}},addProseMirrorPlugins:()=>[new Ve({key:BM,appendTransaction:(t,e,n)=>{const r=n.tr;let o=!1;try{n.doc.descendants((t,e)=>{if("tableRow"===t.type.name){const i=function(t,e){const n=e.doc.resolve(t);let r=0;for(let e=n.depth;e>0;e--)if("table"===n.node(e).type.name){const o=n.node(e);let i=n.start(e)+1;o.forEach((e,n)=>{i+n<t&&"tableRow"===e.type.name&&r++});break}return r}(e,n);t.attrs.rowIndex!==i&&(r.setNodeMarkup(e,null,{...t.attrs,rowIndex:i}),o=!0)}})}catch(t){console.error("[tableRowIndexPlugin] Error:",t)}return o?r:null}})]});class FM extends DM{constructor(t,e,n,r,o){super(t,e,n,r,o),this.applyAttributes(t.attrs)}applyAttributes(t){if(t)for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&null!=t[e]&&("hookId"===e?this.table.setAttribute("id",t[e]):this.table.setAttribute(e,t[e]))}update(t){const e=super.update(t);return e&&this.applyAttributes(t.attrs),e}}const zM=NM.extend({addNodeView(){const t=this.options.customScrollbar;return({node:e,cellMinWidth:n,view:r,getPos:o})=>new FM(e,n,r,o,t)}});function HM(t,e,n,r,o){const i=r.appendIfNotEmpty&&!function(t){for(var e=0;e<t.content.childCount;e++)if(t.content.child(e).textContent.length>0)return!1;return!0}(t.state.doc),s=r.fromImport||!1,a=Da([hA,...i?[rT]:[],...jM(o)]),l=UM(function({text:t,type:e,options:n,contentOptions:r,schema:o,titleType:i,isSchemaWithTitle:s=!1,fromContentImport:a=!1}){let l=function(t,e,n=!1){if("text/html"===e)return t;if(n){const e=Rv({html:!0,breaks:!0,linkify:!0}).render(t);if(e!==t)return e}return t.split("\n").map(t=>`<p>${t}</p>`).join("")}(t,e,n.parseMarkdown||!1);(l.match(/<\/[^>]*>/g)||[]).length>1&&(l+="<p><br></p>");const c=Is(function(t,e={},n=!1){const r=e.enableTables?{}:{table:"div",tr:"div",td:"span",th:"span",tbody:"div",thead:"div",tfoot:"div"};return Object.keys(r).forEach(e=>{const n=r[e];"td"===e&&(t=(t=t.replace(new RegExp(`<${e}([^<]*)>(s)*</${e}>`,"gi"),"")).replace(new RegExp(`<${e}([^<]*)</${e}>( *)<${e}`,"gi"),`<${e}$1</${e}><${n}> | </${n}><${e}`)),t=function(t,e,n){return(t=t.replace(new RegExp(`<${e}`,"g"),`<${n}`)).replace(new RegExp(`</${e}>`,"g"),`</${n}>`)}(t,e,n)}),n&&(t=t.replace(/<p>(\s*)<strong>/gi,(e,n,r)=>{const o=t.substring(0,r).trim();return""===o||/<p>\s*<\/p>\s*$/.test(o)?e:"<p></p><p><strong>"})),t}(l,r,a));let d=n.forceUpgradeToTitle||!1;c.firstChild&&"function"==typeof c.firstChild.getAttribute&&"title"===c.firstChild.getAttribute("name")&&(d=!0);const u=yt.fromSchema(o).parse(c),h=u.content.firstChild;n.downgradeFromHeading&&function(t,e){return!(!t||"heading"!==t.type.name||1!==e.content.childCount&&function(t){let e=!1;return t.content.forEach(t=>{e=e||"paragraph"===t.type.name&&""!==t.textContent}),e}(e))}(h,u)&&(h.attrs={},h.type=o.nodes.paragraph);(n.upgradeToTitle||d)&&function(t,e,n=!1){try{if(!t)return!1;if(["table","codeBlock","blockquote","bulletList","orderedList"].includes(t.type.name))return!1;if(!n){if("heading"!==t.type.name)return!1;if(function(t,e){let n=!1;return t.content.forEach(t=>{n=n||t!==e&&"heading"===t.type.name&&t.attrs.level<=e.attrs.level}),n}(e,t))return!1;if(!function(t,e){let n=!1;return t.content.forEach(t=>{n=n||t!==e&&"heading"!==t.type.name&&Boolean(t.textContent)}),n}(e,t))return!1}const r=t.textContent;return!(r.length>100||r.includes("\n"))}catch(t){return console.error("[canUpgradeToTitle] Error while checking if can upgrade to title",t),!1}}(h,u,d)&&(h.attrs={},h.type=i);return!s||h&&"title"===h.type.name||(u.content=u.content.addToStart(i.create())),u.toJSON()}({text:e,type:n,titleType:t.schema.nodes.title,options:r,contentOptions:o,schema:a,isSchemaWithTitle:i,fromContentImport:s}),r);i?t.chain().insertContent(l).run():t.chain().setContent(l).run()}function jM(t={},e={}
1){const n=[aE.configure({placeholder:""}),dE,jv,ES,Qv,ew,hC.configure({onHeadingIconClick:e.onHeadingIconClick||null,onHeadingIconDelete:e.onHeadingIconDelete||null,onHeadingHover:e.onHeadingHover||null,onIconNeedsLoading:e.onIconNeedsLoading||null}),rw.extend({addKeyboardShortcuts:()=>({})}),Gv,AC,wE,qS,vC,wC,bS.configure({defaultProtocol:"https",openOnClick:!1,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow"}}),mE.configure({oneHalf:!1,oneQuarter:!1,threeQuarters:!1,servicemark:!1,plusMinus:!1,notEqual:!1}),nE.configure({types:!0===t.enableRightToLeft?["blockquote","bulletList","codeBlock","heading","orderedList","paragraph","title"]:[]})];return!0===t.enableTables&&(n.push(zM.configure({resizable:!0,customScrollbar:!0})),n.push(PM),n.push(RM),n.push($M)),n}function UM(t,e={}){const n=e.disableLinks||!1;if(t.marks&&(t.marks=t.marks.filter(t=>{if("link"===t.type){const e=t.attrs?.href;if(n)return console.debug("[normalizeJsonContent] Removing link mark:",e),!1;if("string"!=typeof e)return console.debug("[normalizeJsonContent] Removing link mark with invalid href:",e),!1}return!0})),"title"===t.type)try{t.content=(t.content??[]).filter(t=>"text"===t.type)}catch(t){console.error("[normalizeJsonContent] Error while normalizing title",t)}if(t.content)for(let n=0;n<t.content.length;n++)t.content[n]=UM(t.content[n],e);return t}function VM(t=""){try{for(const e of qM.rules)for(const n of e.conversion)t=t.replaceAll(n.source,n.target)}catch(e){console.error("Error in normalizeText: ",e,t)}return t}const qM={rules:[{conversion:[{target:"a",source:"𝐚"},{target:"b",source:"𝐛"},{target:"c",source:"𝐜"},{target:"d",source:"𝐝"},{target:"e",source:"𝐞"},{target:"f",source:"𝐟"},{target:"g",source:"𝐠"},{target:"h",source:"𝐡"},{target:"i",source:"𝐢"},{target:"j",source:"𝐣"},{target:"k",source:"𝐤"},{target:"l",source:"𝐥"},{target:"m",source:"𝐦"},{target:"n",source:"𝐧"},{target:"o",source:"𝐨"},{target:"p",source:"𝐩"},{target:"q",source:"𝐪"},{target:"r",source:"𝐫"},{target:"s",source:"𝐬"},{target:"t",source:"𝐭"},{target:"u",source:"𝐮"},{target:"v",source:"𝐯"},{target:"w",source:"𝐰"},{target:"x",source:"𝐱"},{target:"y",source:"𝐲"},{target:"z",source:"𝐳"},{target:"A",source:"𝐀"},{target:"B",source:"𝐁"},{target:"C",source:"𝐂"},{target:"D",source:"𝐃"},{target:"E",source:"𝐄"},{target:"F",source:"𝐅"},{target:"G",source:"𝐆"},{target:"H",source:"𝐇"},{target:"I",source:"𝐈"},{target:"J",source:"𝐉"},{target:"K",source:"𝐊"},{target:"L",source:"𝐋"},{target:"M",source:"𝐌"},{target:"N",source:"𝐍"},{target:"O",source:"𝐎"},{target:"P",source:"𝐏"},{target:"Q",source:"𝐐"},{target:"R",source:"𝐑"},{target:"S",source:"𝐒"},{target:"T",source:"𝐓"},{target:"U",source:"𝐔"},{target:"V",source:"𝐕"},{target:"W",source:"𝐖"},{target:"X",source:"𝐗"},{target:"Y",source:"𝐘"},{target:"Z",source:"𝐙"},{target:"0",source:"𝟎"},{target:"1",source:"𝟏"},{target:"2",source:"𝟐"},{target:"3",source:"𝟑"},{target:"4",source:"𝟒"},{target:"5",source:"𝟓"},{target:"6",source:"𝟔"},{target:"7",source:"𝟕"},{target:"8",source:"𝟖"},{target:"9",source:"𝟗"},{target:"!",source:"❗"},{target:"?",source:"❓"},{target:".",source:"."},{target:",",source:","},{target:'"',source:'"'},{target:"'",source:"'"}],_name:"serif-bold"},{conversion:[{target:"a",source:"𝑎"},{target:"b",source:"𝑏"},{target:"c",source:"𝑐"},{target:"d",source:"𝑑"},{target:"e",source:"𝑒"},{target:"f",source:"𝑓"},{target:"g",source:"𝑔"},{target:"h",source:"ℎ"},{target:"i",source:"𝑖"},{target:"j",source:"𝑗"},{target:"k",source:"𝑘"},{target:"l",source:"𝑙"},{target:"m",source:"𝑚"},{target:"n",source:"𝑛"},{target:"o",source:"𝑜"},{target:"p",source:"𝑝"},{target:"q",source:"𝑞"},{target:"r",source:"𝑟"},{target:"s",source:"𝑠"},{target:"t",source:"𝑡"},{target:"u",source:"𝑢"},{target:"v",source:"𝑣"},{target:"w",source:"𝑤"},{target:"x",source:"𝑥"},{target:"y",source:"𝑦"},{target:"z",source:"𝑧"},{target:"A",source:"𝐴"},{target:"B",source:"𝐵"},{target:"C",source:"𝐶"},{target:"D",source:"𝐷"},{target:"E",source:"𝐸"},{target:"F",source:"𝐹"},{target:"G",source:"𝐺"},{target:"H",source:"𝐻"},{target:"I",source:"𝐼"},{target:"J",source:"𝐽"},{target:"K",source:"𝐾"},{target:"L",source:"𝐿"},{target:"M",source:"𝑀"},{target:"N",source:"𝑁"},{target:"O",source:"𝑂"},{target:"P",source:"𝑃"},{target:"Q",source:"𝑄"},{target:"R",source:"𝑅"},{target:"S",source:"𝑆"},{target:"T",source:"𝑇"},{target:"U",source:"𝑈"},{target:"V",source:"𝑉"},{target:"W",source:"𝑊"},{target:"X",source:"𝑋"},{target:"Y",source:"𝑌"},{target:"Z",source:"𝑍"},{target:"0",source:"0"},{target:"1",source:"1"},{target:"2",source:"2"},{target:"3",source:"3"},{target:"4",source:"4"},{target:"5",source:"5"},{target:"6",source:"6"},{target:"7",source:"7"},{target:"8",source:"8"},{target:"9",source:"9"},{target:"!",source:"!"},{target:"?",source:"?"},{target:".",source:"."},{target:",",source:","},{target:'"',source:'"'},{target:"'",source:"'"}],_name:"serif-italic"},{conversion:[{target:"a",source:"𝒂"},{target:"b",source:"𝒃"},{target:"c",source:"𝒄"},{target:"d",source:"𝒅"},{target:"e",source:"𝒆"},{target:"f",source:"𝒇"},{target:"g",source:"𝒈"},{target:"h",source:"𝒉"},{target:"i",source:"𝒊"},{target:"j",source:"𝒋"},{target:"k",source:"𝒌"},{target:"l",source:"𝒍"},{target:"m",source:"𝒎"},{target:"n",source:"𝒏"},{target:"o",source:"𝒐"},{target:"p",source:"𝒑"},{target:"q",source:"𝒒"},{target:"r",source:"𝒓"},{target:"s",source:"𝒔"},{target:"t",source:"𝒕"},{target:"u",source:"𝒖"},{target:"v",source:"𝒗"},{target:"w",source:"𝒘"},{target:"x",source:"𝒙"},{target:"y",source:"𝒚"},{target:"z",source:"𝒛"},{target:"A",source:"𝑨"},{target:"B",source:"𝑩"},{target:"C",source:"𝑪"},{target:"D",source:"𝑫"},{target:"E",source:"𝑬"},{target:"F",source:"𝑭"},{target:"G",source:"𝑮"},{target:"H",source:"𝑯"},{target:"I",source:"𝑰"},{target:"J",source:"𝑱"},{target:"K",source:"𝑲"},{target:"L",source:"𝑳"},{target:"M",source:"𝑴"},{target:"N",source:"𝑵"},{target:"O",source:"𝑶"},{target:"P",source:"𝑷"},{target:"Q",source:"𝑸"},{target:"R",source:"𝑹"},{target:"S",source:"𝑺"},{target:"T",source:"𝑻"},{target:"U",source:"𝑼"},{target:"V",source:"𝑽"},{target:"W",source:"𝑾"},{target:"X",source:"𝑿"},{target:"Y",source:"𝒀"},{target:"Z",source:"𝒁"},{target:"0",source:"𝟎"},{target:"1",source:"𝟏"},{target:"2",source:"𝟐"},{target:"3",source:"𝟑"},{target:"4",source:"𝟒"},{target:"5",source:"𝟓"},{target:"6",source:"𝟔"},{target:"7",source:"𝟕"},{target:"8",source:"𝟖"},{target:"9",source:"𝟗"},{target:"!",source:"❗"},{target:"?",source:"❓"},{target:".",source:"."},{target:",",source:","},{target:'"',source:'"'},{target:"'",source:"'"}],_name:"serif-bold-italic"},{conversion:[{target:"a",source:"𝖺"},{target:"b",source:"𝖻"},{target:"c",source:"𝖼"},{target:"d",source:"𝖽"},{target:"e",source:"𝖾"},{target:"f",source:"𝖿"},{target:"g",source:"𝗀"},{target:"h",source:"𝗁"},{target:"i",source:"𝗂"},{target:"j",source:"𝗃"},{target:"k",source:"𝗄"},{target:"l",source:"𝗅"},{target:"m",source:"𝗆"},{target:"n",source:"𝗇"},{target:"o",source:"𝗈"},{target:"p",source:"𝗉"},{target:"q",source:"𝗊"},{target:"r",source:"𝗋"},{target:"s",source:"𝗌"},{target:"t",source:"𝗍"},{target:"u",source:"𝗎"},{target:"v",source:"𝗏"},{target:"w",source:"𝗐"},{target:"x",source:"𝗑"},{target:"y",source:"𝗒"},{target:"z",source:"𝗓"},{target:"A",source:"𝖠"},{target:"B",source:"𝖡"},{target:"C",source:"𝖢"},{target:"D",source:"𝖣"},{target:"E",source:"𝖤"},{target:"F",source:"𝖥"},{target:"G",source:"𝖦"},{target:"H",source:"𝖧"},{target:"I",source:"𝖨"},{target:"J",source:"𝖩"},{target:"K",source:"𝖪"},{target:"L",source:"𝖫"},{target:"M",source:"𝖬"},{target:"N",source:"𝖭"},{target:"O",source:"𝖮"},{target:"P",source:"𝖯"},{target:"Q",source:"𝖰"},{target:"R",source:"𝖱"},{target:"S",source:"𝖲"},{target:"T",source:"𝖳"},{target:"U",source:"𝖴"},{target:"V",source:"𝖵"},{target:"W",source:"𝖶"},{target:"X",source:"𝖷"},{target:"Y",source:"𝖸"},{target:"Z",source:"𝖹"},{target:"0",source:"𝟢"},{target:"1",source:"𝟣"},{target:"2",source:"𝟤"},{target:"3",source:"𝟥"},{target:"4",source:"𝟦"},{target:"5",source:"𝟧"},{target:"6",source:"𝟨"},{target:"7",source:"𝟩"},{target:"8",source:"𝟪"},{target:"9",source:"𝟫"},{target:"!",source:"!"},{target:"?",source:"?"},{target:".",source:"."},{target:",",source:","},{target:'"',source:'"'},{target:"'",source:"'"}],_name:"sans"},{conversion:[{target:"a",source:"𝗮"},{target:"b",source:"𝗯"},{target:"c",source:"𝗰"},{target:"d",source:"𝗱"},{target:"e",source:"𝗲"},{target:"f",source:"𝗳"},{target:"g",source:"𝗴"},{target:"h",source:"𝗵"},{target:"i",source:"𝗶"},{target:"j",source:"𝗷"},{target:"k",source:"𝗸"},{target:"l",source:"𝗹"},{target:"m",source:"𝗺"},{target:"n",source:"𝗻"},{target:"o",source:"𝗼"},{target:"p",source:"𝗽"},{target:"q",source:"𝗾"},{target:"r",source:"𝗿"},{target:"s",source:"𝘀"},{target:"t",source:"𝘁"},{target:"u",source:"𝘂"},{target:"v",source:"𝘃"},{target:"w",source:"𝘄"},{target:"x",source:"𝘅"},{target:"y",source:"𝘆"},{target:"z",source:"𝘇"},{target:"A",source:"𝗔"},{target:"B",source:"𝗕"},{target:"C",source:"𝗖"},{target:"D",source:"𝗗"},{target:"E",source:"𝗘"},{target:"F",source:"𝗙"},{target:"G",source:"𝗚"},{target:"H",source:"𝗛"},{target:"I",source:"𝗜"},{target:"J",source:"𝗝"},{target:"K",source:"𝗞"},{target:"L",source:"𝗟"},{target:"M",source:"𝗠"},{target:"N",source:"𝗡"},{target:"O",source:"𝗢"},{target:"P",source:"𝗣"},{target:"Q",source:"𝗤"},{target:"R",source:"𝗥"},{target:"S",source:"𝗦"},{target:"T",source:"𝗧"},{target:"U",source:"𝗨"},{target:"V",source:"𝗩"},{target:"W",source:"𝗪"},{target:"X",source:"𝗫"},{target:"Y",source:"𝗬"},{target:"Z",source:"𝗭"},{target:"0",source:"𝟬"},{target:"1",source:"𝟭"},{target:"2",source:"𝟮"},{target:"3",source:"𝟯"},{target:"4",source:"𝟰"},{target:"5",source:"𝟱"},{target:"6",source:"𝟲"},{target:"7",source:"𝟳"},{target:"8",source:"𝟴"},{target:"9",source:"𝟵"},{target:"!",source:"❗"},{target:"?",source:"❓"},{target:".",source:"."},{target:",",source:","},{target:'"',source:'"'},{target:"'",source:"'"}],_name:"sans-bold"},{conversion:[{target:"a",source:"𝘢"},{target:"b",source:"𝘣"},{target:"c",source:"𝘤"},{target:"d",source:"𝘥"},{target:"e",source:"𝘦"},{target:"f",source:"𝘧"},{target:"g",source:"𝘨"},{target:"h",source:"𝘩"},{target:"i",source:"𝘪"},{target:"j",source:"𝘫"},{target:"k",source:"𝘬"},{target:"l",source:"𝘭"},{target:"m",source:"𝘮"},{target:"n",source:"𝘯"},{target:"o",source:"𝘰"},{target:"p",source:"𝘱"},{target:"q",source:"𝘲"},{target:"r",source:"𝘳"},{target:"s",source:"𝘴"},{target:"t",source:"𝘵"},{target:"u",source:"𝘶"},{target:"v",source:"𝘷"},{target:"w",source:"𝘸"},{target:"x",source:"𝘹"},{target:"y",source:"𝘺"},{target:"z",source:"𝘻"},{target:"A",source:"𝘈"},{target:"B",source:"𝘉"},{target:"C",source:"𝘊"},{target:"D",source:"𝘋"},{target:"E",source:"𝘌"},{target:"F",source:"𝘍"},{target:"G",source:"𝘎"},{target:"H",source:"𝘏"},{target:"I",source:"𝘐"},{target:"J",source:"𝘑"},{target:"K",source:"𝘒"},{target:"L",source:"𝘓"},{target:"M",source:"𝘔"},{target:"N",source:"𝘕"},{target:"O",source:"𝘖"},{target:"P",source:"𝘗"},{target:"Q",source:"𝘘"},{target:"R",source:"𝘙"},{target:"S",source:"𝘚"},{target:"T",source:"𝘛"},{target:"U",source:"𝘜"},{target:"V",source:"𝘝"},{target:"W",source:"𝘞"},{target:"X",source:"𝘟"},{target:"Y",source:"𝘠"},{target:"Z",source:"𝘡"},{target:"0",source:"0"},{target:"1",source:"1"},{target:"2",source:"2"},{target:"3",source:"3"},{target:"4",source:"4"},{target:"5",source:"5"},{target:"6",source:"6"},{target:"7",source:"7"},{target:"8",source:"8"},{target:"9",source:"9"},{target:"!",source:"!"},{target:"?",source:"?"},{target:".",source:"."},{target:",",source:","},{target:'"',source:'"'},{target:"'",source:"'"}],_name:"sans-italic"},{conversion:[{target:"a",source:"𝙖"},{target:"b",source:"𝙗"},{target:"c",source:"𝙘"},{target:"d",source:"𝙙"},{target:"e",source:"𝙚"},{target:"f",source:"𝙛"},{target:"g",source:"𝙜"},{target:"h",source:"𝙝"},{target:"i",source:"𝙞"},{target:"j",source:"𝙟"},{target:"k",source:"𝙠"},{target:"l",source:"𝙡"},{target:"m",source:"𝙢"},{target:"n",source:"𝙣"},{target:"o",source:"𝙤"},{target:"p",source:"𝙥"},{target:"q",source:"𝙦"},{target:"r",source:"𝙧"},{target:"s",source:"𝙨"},{target:"t",source:"𝙩"},{target:"u",source:"𝙪"},{target:"v",source:"𝙫"},{target:"w",source:"𝙬"},{target:"x",source:"𝙭"},{target:"y",source:"𝙮"},{target:"z",source:"𝙯"},{target:"A",source:"𝘼"},{target:"B",source:"𝘽"},{target:"C",source:"𝘾"},{target:"D",source:"𝘿"},{target:"E",source:"𝙀"},{target:"F",source:"𝙁"},{target:"G",source:"𝙂"},{target:"H",source:"𝙃"},{target:"I",source:"𝙄"},{target:"J",source:"𝙅"},{target:"K",source:"𝙆"},{target:"L",source:"𝙇"},{target:"M",source:"𝙈"},{target:"N",source:"𝙉"},{target:"O",source:"𝙊"},{target:"P",source:"𝙋"},{target:"Q",source:"𝙌"},{target:"R",source:"𝙍"},{target:"S",source:"𝙎"},{target:"T",source:"𝙏"},{target:"U",source:"𝙐"},{target:"V",source:"𝙑"},{target:"W",source:"𝙒"},{target:"X",source:"𝙓"},{target:"Y",source:"𝙔"},{target:"Z",source:"𝙕"},{target:"0",source:"𝟎"},{target:"1",source:"𝟏"},{target:"2",source:"𝟐"},{target:"3",source:"𝟑"},{target:"4",source:"𝟒"},{target:"5",source:"𝟓"},{target:"6",source:"𝟔"},{target:"7",source:"𝟕"},{target:"8",source:"𝟖"},{target:"9",source:"𝟗"},{target:"!",source:"❗"},{target:"?",source:"❓"},{target:".",source:"."},{target:",",source:","},{target:'"',source:'"'},{target:"'",source:"'"}],_name:"sans-bold-italic"},{conversion:[{target:"a",source:"𝒶"},{target:"b",source:"𝒷"},{target:"c",source:"𝒸"},{target:"d",source:"𝒹"},{target:"e",source:"ℯ"},{target:"f",source:"𝒻"},{target:"g",source:"ℊ"},{target:"h",source:"𝒽"},{target:"i",source:"𝒾"},{target:"j",source:"𝒿"},{target:"k",source:"𝓀"},{target:"l",source:"𝓁"},{target:"m",source:"𝓂"},{target:"n",source:"𝓃"},{target:"o",source:"ℴ"},{target:"p",source:"𝓅"},{target:"q",source:"𝓆"},{target:"r",source:"𝓇"},{target:"s",source:"𝓈"},{target:"t",source:"𝓉"},{target:"u",source:"𝓊"},{target:"v",source:"𝓋"},{target:"w",source:"𝓌"},{target:"x",source:"𝓍"},{target:"y",source:"𝓎"},{target:"z",source:"𝓏"},{target:"A",source:"𝒜"},{target:"B",source:"ℬ"},{target:"C",source:"𝒞"},{target:"D",source:"𝒟"},{target:"E",source:"ℰ"},{target:"F",source:"ℱ"},{target:"G",source:"𝒢"},{target:"H",source:"ℋ"},{target:"I",source:"ℐ"},{target:"J",source:"𝒥"},{target:"K",source:"𝒦"},{target:"L",source:"ℒ"},{target:"M",source:"ℳ"},{target:"N",source:"𝒩"},{target:"O",source:"𝒪"},{target:"P",source:"𝒫"},{target:"Q",source:"𝒬"},{target:"R",source:"ℛ"},{target:"S",source:"𝒮"},{target:"T",source:"𝒯"},{target:"U",source:"𝒰"},{target:"V",source:"𝒱"},{target:"W",source:"𝒲"},{target:"X",source:"𝒳"},{target:"Y",source:"𝒴"},{target:"Z",source:"𝒵"},{target:"0",source:"0"},{target:"1",source:"1"},{target:"2",source:"2"},{target:"3",source:"3"},{target:"4",source:"4"},{target:"5",source:"5"},{target:"6",source:"6"},{target:"7",source:"7"},{target:"8",source:"8"},{target:"9",source:"9"},{target:"!",source:"!"},{target:"?",source:"?"},{target:".",source:"."},{target:",",source:","},{target:'"',source:'"'},{target:"'",source:"'"}],_name:"script"},{conversion:[{target:"a",source:"𝓪"},{target:"b",source:"𝓫"},{target:"c",source:"𝓬"},{tar
1get:"d",source:"𝓭"},{target:"e",source:"𝓮"},{target:"f",source:"𝓯"},{target:"g",source:"𝓰"},{target:"h",source:"𝓱"},{target:"i",source:"𝓲"},{target:"j",source:"𝓳"},{target:"k",source:"𝓴"},{target:"l",source:"𝓵"},{target:"m",source:"𝓶"},{target:"n",source:"𝓷"},{target:"o",source:"𝓸"},{target:"p",source:"𝓹"},{target:"q",source:"𝓺"},{target:"r",source:"𝓻"},{target:"s",source:"𝓼"},{target:"t",source:"𝓽"},{target:"u",source:"𝓾"},{target:"v",source:"𝓿"},{target:"w",source:"𝔀"},{target:"x",source:"𝔁"},{target:"y",source:"𝔂"},{target:"z",source:"𝔃"},{target:"A",source:"𝓐"},{target:"B",source:"𝓑"},{target:"C",source:"𝓒"},{target:"D",source:"𝓓"},{target:"E",source:"𝓔"},{target:"F",source:"𝓕"},{target:"G",source:"𝓖"},{target:"H",source:"𝓗"},{target:"I",source:"𝓘"},{target:"J",source:"𝓙"},{target:"K",source:"𝓚"},{target:"L",source:"𝓛"},{target:"M",source:"𝓜"},{target:"N",source:"𝓝"},{target:"O",source:"𝓞"},{target:"P",source:"𝓟"},{target:"Q",source:"𝓠"},{target:"R",source:"𝓡"},{target:"S",source:"𝓢"},{target:"T",source:"𝓣"},{target:"U",source:"𝓤"},{target:"V",source:"𝓥"},{target:"W",source:"𝓦"},{target:"X",source:"𝓧"},{target:"Y",source:"𝓨"},{target:"Z",source:"𝓩"},{target:"0",source:"𝟎"},{target:"1",source:"𝟏"},{target:"2",source:"𝟐"},{target:"3",source:"𝟑"},{target:"4",source:"𝟒"},{target:"5",source:"𝟓"},{target:"6",source:"𝟔"},{target:"7",source:"𝟕"},{target:"8",source:"𝟖"},{target:"9",source:"𝟗"},{target:"!",source:"❗"},{target:"?",source:"❓"},{target:".",source:"."},{target:",",source:","},{target:'"',source:'"'},{target:"'",source:"'"}],_name:"script-bold"},{conversion:[{target:"a",source:"𝔞"},{target:"b",source:"𝔟"},{target:"c",source:"𝔠"},{target:"d",source:"𝔡"},{target:"e",source:"𝔢"},{target:"f",source:"𝔣"},{target:"g",source:"𝔤"},{target:"h",source:"𝔥"},{target:"i",source:"𝔦"},{target:"j",source:"𝔧"},{target:"k",source:"𝔨"},{target:"l",source:"𝔩"},{target:"m",source:"𝔪"},{target:"n",source:"𝔫"},{target:"o",source:"𝔬"},{target:"p",source:"𝔭"},{target:"q",source:"𝔮"},{target:"r",source:"𝔯"},{target:"s",source:"𝔰"},{target:"t",source:"𝔱"},{target:"u",source:"𝔲"},{target:"v",source:"𝔳"},{target:"w",source:"𝔴"},{target:"x",source:"𝔵"},{target:"y",source:"𝔶"},{target:"z",source:"𝔷"},{target:"A",source:"𝔄"},{target:"B",source:"𝔅"},{target:"C",source:"ℭ"},{target:"D",source:"𝔇"},{target:"E",source:"𝔈"},{target:"F",source:"𝔉"},{target:"G",source:"𝔊"},{target:"H",source:"ℌ"},{target:"I",source:"ℑ"},{target:"J",source:"𝔍"},{target:"K",source:"𝔎"},{target:"L",source:"𝔏"},{target:"M",source:"𝔐"},{target:"N",source:"𝔑"},{target:"O",source:"𝔒"},{target:"P",source:"𝔓"},{target:"Q",source:"𝔔"},{target:"R",source:"ℜ"},{target:"S",source:"𝔖"},{target:"T",source:"𝔗"},{target:"U",source:"𝔘"},{target:"V",source:"𝔙"},{target:"W",source:"𝔚"},{target:"X",source:"𝔛"},{target:"Y",source:"𝔜"},{target:"Z",source:"ℨ"},{target:"0",source:"0"},{target:"1",source:"1"},{target:"2",source:"2"},{target:"3",source:"3"},{target:"4",source:"4"},{target:"5",source:"5"},{target:"6",source:"6"},{target:"7",source:"7"},{target:"8",source:"8"},{target:"9",source:"9"},{target:"!",source:"!"},{target:"?",source:"?"},{target:".",source:"."},{target:",",source:","},{target:'"',source:'"'},{target:"'",source:"'"}],_name:"fraktur"},{conversion:[{target:"a",source:"𝖆"},{target:"b",source:"𝖇"},{target:"c",source:"𝖈"},{target:"d",source:"𝖉"},{target:"e",source:"𝖊"},{target:"f",source:"𝖋"},{target:"g",source:"𝖌"},{target:"h",source:"𝖍"},{target:"i",source:"𝖎"},{target:"j",source:"𝖏"},{target:"k",source:"𝖐"},{target:"l",source:"𝖑"},{target:"m",source:"𝖒"},{target:"n",source:"𝖓"},{target:"o",source:"𝖔"},{target:"p",source:"𝖕"},{target:"q",source:"𝖖"},{target:"r",source:"𝖗"},{target:"s",source:"𝖘"},{target:"t",source:"𝖙"},{target:"u",source:"𝖚"},{target:"v",source:"𝖛"},{target:"w",source:"𝖜"},{target:"x",source:"𝖝"},{target:"y",source:"𝖞"},{target:"z",source:"𝖟"},{target:"A",source:"𝕬"},{target:"B",source:"𝕭"},{target:"C",source:"𝕮"},{target:"D",source:"𝕯"},{target:"E",source:"𝕰"},{target:"F",source:"𝕱"},{target:"G",source:"𝕲"},{target:"H",source:"𝕳"},{target:"I",source:"𝕴"},{target:"J",source:"𝕵"},{target:"K",source:"𝕶"},{target:"L",source:"𝕷"},{target:"M",source:"𝕸"},{target:"N",source:"𝕹"},{target:"O",source:"𝕺"},{target:"P",source:"𝕻"},{target:"Q",source:"𝕼"},{target:"R",source:"𝕽"},{target:"S",source:"𝕾"},{target:"T",source:"𝕿"},{target:"U",source:"𝖀"},{target:"V",source:"𝖁"},{target:"W",source:"𝖂"},{target:"X",source:"𝖃"},{target:"Y",source:"𝖄"},{target:"Z",source:"𝖅"},{target:"0",source:"𝟎"},{target:"1",source:"𝟏"},{target:"2",source:"𝟐"},{target:"3",source:"𝟑"},{target:"4",source:"𝟒"},{target:"5",source:"𝟓"},{target:"6",source:"𝟔"},{target:"7",source:"𝟕"},{target:"8",source:"𝟖"},{target:"9",source:"𝟗"},{target:"!",source:"❗"},{target:"?",source:"❓"},{target:".",source:"."},{target:",",source:","},{target:'"',source:'"'},{target:"'",source:"'"}],_name:"fraktur-bold"},{conversion:[{target:"a",source:"𝚊"},{target:"b",source:"𝚋"},{target:"c",source:"𝚌"},{target:"d",source:"𝚍"},{target:"e",source:"𝚎"},{target:"f",source:"𝚏"},{target:"g",source:"𝚐"},{target:"h",source:"𝚑"},{target:"i",source:"𝚒"},{target:"j",source:"𝚓"},{target:"k",source:"𝚔"},{target:"l",source:"𝚕"},{target:"m",source:"𝚖"},{target:"n",source:"𝚗"},{target:"o",source:"𝚘"},{target:"p",source:"𝚙"},{target:"q",source:"𝚚"},{target:"r",source:"𝚛"},{target:"s",source:"𝚜"},{target:"t",source:"𝚝"},{target:"u",source:"𝚞"},{target:"v",source:"𝚟"},{target:"w",source:"𝚠"},{target:"x",source:"𝚡"},{target:"y",source:"𝚢"},{target:"z",source:"𝚣"},{target:"A",source:"𝙰"},{target:"B",source:"𝙱"},{target:"C",source:"𝙲"},{target:"D",source:"𝙳"},{target:"E",source:"𝙴"},{target:"F",source:"𝙵"},{target:"G",source:"𝙶"},{target:"H",source:"𝙷"},{target:"I",source:"𝙸"},{target:"J",source:"𝙹"},{target:"K",source:"𝙺"},{target:"L",source:"𝙻"},{target:"M",source:"𝙼"},{target:"N",source:"𝙽"},{target:"O",source:"𝙾"},{target:"P",source:"𝙿"},{target:"Q",source:"𝚀"},{target:"R",source:"𝚁"},{target:"S",source:"𝚂"},{target:"T",source:"𝚃"},{target:"U",source:"𝚄"},{target:"V",source:"𝚅"},{target:"W",source:"𝚆"},{target:"X",source:"𝚇"},{target:"Y",source:"𝚈"},{target:"Z",source:"𝚉"},{target:"0",source:"𝟶"},{target:"1",source:"𝟷"},{target:"2",source:"𝟸"},{target:"3",source:"𝟹"},{target:"4",source:"𝟺"},{target:"5",source:"𝟻"},{target:"6",source:"𝟼"},{target:"7",source:"𝟽"},{target:"8",source:"𝟾"},{target:"9",source:"𝟿"},{target:"!",source:"!"},{target:"?",source:"?"},{target:".",source:"."},{target:",",source:","},{target:'"',source:"""},{target:"'",source:"'"}],_name:"monospace"},{conversion:[{target:"a",source:"a"},{target:"b",source:"b"},{target:"c",source:"c"},{target:"d",source:"d"},{target:"e",source:"e"},{target:"f",source:"f"},{target:"g",source:"g"},{target:"h",source:"h"},{target:"i",source:"i"},{target:"j",source:"j"},{target:"k",source:"k"},{target:"l",source:"l"},{target:"m",source:"m"},{target:"n",source:"n"},{target:"o",source:"o"},{target:"p",source:"p"},{target:"q",source:"q"},{target:"r",source:"r"},{target:"s",source:"s"},{target:"t",source:"t"},{target:"u",source:"u"},{target:"v",source:"v"},{target:"w",source:"w"},{target:"x",source:"x"},{target:"y",source:"y"},{target:"z",source:"z"},{target:"A",source:"A"},{target:"B",source:"B"},{target:"C",source:"C"},{target:"D",source:"D"},{target:"E",source:"E"},{target:"F",source:"F"},{target:"G",source:"G"},{target:"H",source:"H"},{target:"I",source:"I"},{target:"J",source:"J"},{target:"K",source:"K"},{target:"L",source:"L"},{target:"M",source:"M"},{target:"N",source:"N"},{target:"O",source:"O"},{target:"P",source:"P"},{target:"Q",source:"Q"},{target:"R",source:"R"},{target:"S",source:"S"},{target:"T",source:"T"},{target:"U",source:"U"},{target:"V",source:"V"},{target:"W",source:"W"},{target:"X",source:"X"},{target:"Y",source:"Y"},{target:"Z",source:"Z"},{target:"0",source:"0"},{target:"1",source:"1"},{target:"2",source:"2"},{target:"3",source:"3"},{target:"4",source:"4"},{target:"5",source:"5"},{target:"6",source:"6"},{target:"7",source:"7"},{target:"8",source:"8"},{target:"9",source:"9"},{target:"!",source:"!"},{target:"?",source:"?"},{target:".",source:"."},{target:",",source:","},{target:'"',source:"""},{target:"'",source:"'"}],_name:"fullwidth"},{conversion:[{target:"a",source:"𝕒"},{target:"b",source:"𝕓"},{target:"c",source:"𝕔"},{target:"d",source:"𝕕"},{target:"e",source:"𝕖"},{target:"f",source:"𝕗"},{target:"g",source:"𝕘"},{target:"h",source:"𝕙"},{target:"i",source:"𝕚"},{target:"j",source:"𝕛"},{target:"k",source:"𝕜"},{target:"l",source:"𝕝"},{target:"m",source:"𝕞"},{target:"n",source:"𝕟"},{target:"o",source:"𝕠"},{target:"p",source:"𝕡"},{target:"q",source:"𝕢"},{target:"r",source:"𝕣"},{target:"s",source:"𝕤"},{target:"t",source:"𝕥"},{target:"u",source:"𝕦"},{target:"v",source:"𝕧"},{target:"w",source:"𝕨"},{target:"x",source:"𝕩"},{target:"y",source:"𝕪"},{target:"z",source:"𝕫"},{target:"A",source:"𝔸"},{target:"B",source:"𝔹"},{target:"C",source:"ℂ"},{target:"D",source:"𝔻"},{target:"E",source:"𝔼"},{target:"F",source:"𝔽"},{target:"G",source:"𝔾"},{target:"H",source:"ℍ"},{target:"I",source:"𝕀"},{target:"J",source:"𝕁"},{target:"K",source:"𝕂"},{target:"L",source:"𝕃"},{target:"M",source:"𝕄"},{target:"N",source:"ℕ"},{target:"O",source:"𝕆"},{target:"P",source:"ℙ"},{target:"Q",source:"ℚ"},{target:"R",source:"ℝ"},{target:"S",source:"𝕊"},{target:"T",source:"𝕋"},{target:"U",source:"𝕌"},{target:"V",source:"𝕍"},{target:"W",source:"𝕎"},{target:"X",source:"𝕏"},{target:"Y",source:"𝕐"},{target:"Z",source:"ℤ"},{target:"0",source:"𝟘"},{target:"1",source:"𝟙"},{target:"2",source:"𝟚"},{target:"3",source:"𝟛"},{target:"4",source:"𝟜"},{target:"5",source:"𝟝"},{target:"6",source:"𝟞"},{target:"7",source:"𝟟"},{target:"8",source:"𝟠"},{target:"9",source:"𝟡"},{target:"!",source:"❕"},{target:"?",source:"❔"},{target:".",source:"."},{target:",",source:","},{target:'"',source:'"'},{target:"'",source:"'"}],_name:"doublestruck"},{conversion:[{target:"a",source:"ᴀ"},{target:"b",source:"ʙ"},{target:"c",source:"ᴄ"},{target:"d",source:"ᴅ"},{target:"e",source:"ᴇ"},{target:"f",source:"ꜰ"},{target:"g",source:"ɢ"},{target:"h",source:"ʜ"},{target:"i",source:"ɪ"},{target:"j",source:"ᴊ"},{target:"k",source:"ᴋ"},{target:"l",source:"ʟ"},{target:"m",source:"ᴍ"},{target:"n",source:"ɴ"},{target:"o",source:"ᴏ"},{target:"p",source:"ᴘ"},{target:"q",source:"q"},{target:"r",source:"ʀ"},{target:"s",source:"ꜱ"},{target:"t",source:"ᴛ"},{target:"u",source:"ᴜ"},{target:"v",source:"ᴠ"},{target:"w",source:"ᴡ"},{target:"x",source:"x"},{target:"y",source:"ʏ"},{target:"z",source:"ᴢ"},{target:"A",source:"A"},{target:"B",source:"B"},{target:"C",source:"C"},{target:"D",source:"D"},{target:"E",source:"E"},{target:"F",source:"F"},{target:"G",source:"G"},{target:"H",source:"H"},{target:"I",source:"I"},{target:"J",source:"J"},{target:"K",source:"K"},{target:"L",source:"L"},{target:"M",source:"M"},{target:"N",source:"N"},{target:"O",source:"O"},{target:"P",source:"P"},{target:"Q",source:"Q"},{target:"R",source:"R"},{target:"S",source:"S"},{target:"T",source:"T"},{target:"U",source:"U"},{target:"V",source:"V"},{target:"W",source:"W"},{target:"X",source:"X"},{target:"Y",source:"Y"},{target:"Z",source:"Z"},{target:"0",source:"0"},{target:"1",source:"1"},{target:"2",source:"2"},{target:"3",source:"3"},{target:"4",source:"4"},{target:"5",source:"5"},{target:"6",source:"6"},{target:"7",source:"7"},{target:"8",source:"8"},{target:"9",source:"9"},{target:"!",source:"﹗"},{target:"?",source:"﹖"},{target:".",source:"﹒"},{target:",",source:"﹐"},{target:'"',source:'"'},{target:"'",source:"'"}],_name:"capitalized"},{conversion:[{target:"a",source:"ⓐ"},{target:"b",source:"ⓑ"},{target:"c",source:"ⓒ"},{target:"d",source:"ⓓ"},{target:"e",source:"ⓔ"},{target:"f",source:"ⓕ"},{target:"g",source:"ⓖ"},{target:"h",source:"ⓗ"},{target:"i",source:"ⓘ"},{target:"j",source:"ⓙ"},{target:"k",source:"ⓚ"},{target:"l",source:"ⓛ"},{target:"m",source:"ⓜ"},{target:"n",source:"ⓝ"},{target:"o",source:"ⓞ"},{target:"p",source:"ⓟ"},{target:"q",source:"ⓠ"},{target:"r",source:"ⓡ"},{target:"s",source:"ⓢ"},{target:"t",source:"ⓣ"},{target:"u",source:"ⓤ"},{target:"v",source:"ⓥ"},{target:"w",source:"ⓦ"},{target:"x",source:"ⓧ"},{target:"y",source:"ⓨ"},{target:"z",source:"ⓩ"},{target:"A",source:"Ⓐ"},{target:"B",source:"Ⓑ"},{target:"C",source:"Ⓒ"},{target:"D",source:"Ⓓ"},{target:"E",source:"Ⓔ"},{target:"F",source:"Ⓕ"},{target:"G",source:"Ⓖ"},{target:"H",source:"Ⓗ"},{target:"I",source:"Ⓘ"},{target:"J",source:"Ⓙ"},{target:"K",source:"Ⓚ"},{target:"L",source:"Ⓛ"},{target:"M",source:"Ⓜ"},{target:"N",source:"Ⓝ"},{target:"O",source:"Ⓞ"},{target:"P",source:"Ⓟ"},{target:"Q",source:"Ⓠ"},{target:"R",source:"Ⓡ"},{target:"S",source:"Ⓢ"},{target:"T",source:"Ⓣ"},{target:"U",source:"Ⓤ"},{target:"V",source:"Ⓥ"},{target:"W",source:"Ⓦ"},{target:"X",source:"Ⓧ"},{target:"Y",source:"Ⓨ"},{target:"Z",source:"Ⓩ"},{target:"0",source:"⓪"},{target:"1",source:"①"},{target:"2",source:"②"},{target:"3",source:"③"},{target:"4",source:"④"},{target:"5",source:"⑤"},{target:"6",source:"⑥"},{target:"7",source:"⑦"},{target:"8",source:"⑧"},{target:"9",source:"⑨"},{target:"!",source:"!"},{target:"?",source:"?"},{target:".",source:"."},{target:",",source:","},{target:'"',source:'"'},{target:"'",source:"'"}],_name:"circled"},{conversion:[{target:"a",source:"⒜"},{target:"b",source:"⒝"},{target:"c",source:"⒞"},{target:"d",source:"⒟"},{target:"e",source:"⒠"},{target:"f",source:"⒡"},{target:"g",source:"⒢"},{target:"h",source:"⒣"},{target:"i",source:"⒤"},{target:"j",source:"⒥"},{target:"k",source:"⒦"},{target:"l",source:"⒧"},{target:"m",source:"⒨"},{target:"n",source:"⒩"},{target:"o",source:"⒪"},{target:"p",source:"⒫"},{target:"q",source:"⒬"},{target:"r",source:"⒭"},{target:"s",source:"⒮"},{target:"t",source:"⒯"},{target:"u",source:"⒰"},{target:"v",source:"⒱"},{target:"w",source:"⒲"},{target:"x",source:"⒳"},{target:"y",source:"⒴"},{target:"z",source:"⒵"},{target:"A",source:"🄐"},{target:"B",source:"🄑"},{target:"C",source:"🄒"},{target:"D",source:"🄓"},{target:"E",source:"🄔"},{target:"F",source:"🄕"},{target:"G",source:"🄖"},{target:"H",source:"🄗"},{target:"I",source:"🄘"},{target:"J",source:"🄙"},{target:"K",source:"🄚"},{target:"L",source:"🄛"},{target:"M",source:"🄜"},{target:"N",source:"🄝"},{target:"O",source:"🄞"},{target:"P",source:"🄟"},{target:"Q",source:"🄠"},{target:"R",source:"🄡"},{target:"S",source:"🄢"},{target:"T",source:"🄣"},{target:"U",source:"🄤"},{target:"V",source:"🄥"},{target:"W",source:"🄦"},{target:"X",source:"🄧"},{target:"Y",source:"🄨"},{target:"Z",source:"🄩"},{target:"0",source:"⓿"},{target:"1",source:"⑴"},{target:"2",source:"⑵"},{target:"3",source:"⑶"},{target:"4",source:"⑷"},{target:"5",source:"⑸"},{target:"6",source:"⑹"},{target:"7",source:"⑺"},{target:"8",source:"⑻"},{target:"9",source:"⑼"},{target:"!",source:"!"},{target:"?",source:"?"},{target:".",source:"."},{target:",",source:","},{target:'"',source:'"'},{target:"'",source:"'"}],_name:"parenthesized"},{conversion:[{target:"a",source:"a"},{target:"b",source:"b"},{target:"c",source:"c"},{target:"d",source:"d"},{target:
1"e",source:"e"},{target:"f",source:"f"},{target:"g",source:"g"},{target:"h",source:"h"},{target:"i",source:"i"},{target:"j",source:"j"},{target:"k",source:"k"},{target:"l",source:"l"},{target:"m",source:"m"},{target:"n",source:"n"},{target:"o",source:"o"},{target:"p",source:"p"},{target:"q",source:"q"},{target:"r",source:"r"},{target:"s",source:"s"},{target:"t",source:"t"},{target:"u",source:"u"},{target:"v",source:"v"},{target:"w",source:"w"},{target:"x",source:"x"},{target:"y",source:"y"},{target:"z",source:"z"},{target:"A",source:"A"},{target:"B",source:"B"},{target:"C",source:"C"},{target:"D",source:"D"},{target:"E",source:"E"},{target:"F",source:"F"},{target:"G",source:"G"},{target:"H",source:"H"},{target:"I",source:"I"},{target:"J",source:"J"},{target:"K",source:"K"},{target:"L",source:"L"},{target:"M",source:"M"},{target:"N",source:"N"},{target:"O",source:"O"},{target:"P",source:"P"},{target:"Q",source:"Q"},{target:"R",source:"R"},{target:"S",source:"S"},{target:"T",source:"T"},{target:"U",source:"U"},{target:"V",source:"V"},{target:"W",source:"W"},{target:"X",source:"X"},{target:"Y",source:"Y"},{target:"Z",source:"Z"},{target:"0",source:"0"},{target:"1",source:"1"},{target:"2",source:"2"},{target:"3",source:"3"},{target:"4",source:"4"},{target:"5",source:"5"},{target:"6",source:"6"},{target:"7",source:"7"},{target:"8",source:"8"},{target:"9",source:"9"},{target:"!",source:"!"},{target:"?",source:"?"},{target:".",source:"."},{target:",",source:","},{target:'"',source:'"'},{target:"'",source:"'"}],_name:"underlined-single"},{conversion:[{target:"a",source:"a"},{target:"b",source:"b"},{target:"c",source:"c"},{target:"d",source:"d"},{target:"e",source:"e"},{target:"f",source:"f"},{target:"g",source:"g"},{target:"h",source:"h"},{target:"i",source:"i"},{target:"j",source:"j"},{target:"k",source:"k"},{target:"l",source:"l"},{target:"m",source:"m"},{target:"n",source:"n"},{target:"o",source:"o"},{target:"p",source:"p"},{target:"q",source:"q"},{target:"r",source:"r"},{target:"s",source:"s"},{target:"t",source:"t"},{target:"u",source:"u"},{target:"v",source:"v"},{target:"w",source:"w"},{target:"x",source:"x"},{target:"y",source:"y"},{target:"z",source:"z"},{target:"A",source:"A"},{target:"B",source:"B"},{target:"C",source:"C"},{target:"D",source:"D"},{target:"E",source:"E"},{target:"F",source:"F"},{target:"G",source:"G"},{target:"H",source:"H"},{target:"I",source:"I"},{target:"J",source:"J"},{target:"K",source:"K"},{target:"L",source:"L"},{target:"M",source:"M"},{target:"N",source:"N"},{target:"O",source:"O"},{target:"P",source:"P"},{target:"Q",source:"Q"},{target:"R",source:"R"},{target:"S",source:"S"},{target:"T",source:"T"},{target:"U",source:"U"},{target:"V",source:"V"},{target:"W",source:"W"},{target:"X",source:"X"},{target:"Y",source:"Y"},{target:"Z",source:"Z"},{target:"0",source:"0"},{target:"1",source:"1"},{target:"2",source:"2"},{target:"3",source:"3"},{target:"4",source:"4"},{target:"5",source:"5"},{target:"6",source:"6"},{target:"7",source:"7"},{target:"8",source:"8"},{target:"9",source:"9"},{target:"!",source:"!"},{target:"?",source:"?"},{target:".",source:"."},{target:",",source:","},{target:'"',source:'"'},{target:"'",source:"'"}],_name:"underlined-double"},{conversion:[{target:"a",source:"a"},{target:"b",source:"b"},{target:"c",source:"c"},{target:"d",source:"d"},{target:"e",source:"e"},{target:"f",source:"f"},{target:"g",source:"g"},{target:"h",source:"h"},{target:"i",source:"i"},{target:"j",source:"j"},{target:"k",source:"k"},{target:"l",source:"l"},{target:"m",source:"m"},{target:"n",source:"n"},{target:"o",source:"o"},{target:"p",source:"p"},{target:"q",source:"q"},{target:"r",source:"r"},{target:"s",source:"s"},{target:"t",source:"t"},{target:"u",source:"u"},{target:"v",source:"v"},{target:"w",source:"w"},{target:"x",source:"x"},{target:"y",source:"y"},{target:"z",source:"z"},{target:"A",source:"A"},{target:"B",source:"B"},{target:"C",source:"C"},{target:"D",source:"D"},{target:"E",source:"E"},{target:"F",source:"F"},{target:"G",source:"G"},{target:"H",source:"H"},{target:"I",source:"I"},{target:"J",source:"J"},{target:"K",source:"K"},{target:"L",source:"L"},{target:"M",source:"M"},{target:"N",source:"N"},{target:"O",source:"O"},{target:"P",source:"P"},{target:"Q",source:"Q"},{target:"R",source:"R"},{target:"S",source:"S"},{target:"T",source:"T"},{target:"U",source:"U"},{target:"V",source:"V"},{target:"W",source:"W"},{target:"X",source:"X"},{target:"Y",source:"Y"},{target:"Z",source:"Z"},{target:"0",source:"0"},{target:"1",source:"1"},{target:"2",source:"2"},{target:"3",source:"3"},{target:"4",source:"4"},{target:"5",source:"5"},{target:"6",source:"6"},{target:"7",source:"7"},{target:"8",source:"8"},{target:"9",source:"9"},{target:"!",source:"!"},{target:"?",source:"?"},{target:".",source:"."},{target:",",source:","},{target:'"',source:'"'},{target:"'",source:"'"}],_name:"strikethrough-single"},{conversion:[{target:"a",source:"a"},{target:"b",source:"b"},{target:"c",source:"c"},{target:"d",source:"d"},{target:"e",source:"e"},{target:"f",source:"f"},{target:"g",source:"g"},{target:"h",source:"h"},{target:"i",source:"i"},{target:"j",source:"j"},{target:"k",source:"k"},{target:"l",source:"l"},{target:"m",source:"m"},{target:"n",source:"n"},{target:"o",source:"o"},{target:"p",source:"p"},{target:"q",source:"q"},{target:"r",source:"r"},{target:"s",source:"s"},{target:"t",source:"t"},{target:"u",source:"u"},{target:"v",source:"v"},{target:"w",source:"w"},{target:"x",source:"x"},{target:"y",source:"y"},{target:"z",source:"z"},{target:"A",source:"A"},{target:"B",source:"B"},{target:"C",source:"C"},{target:"D",source:"D"},{target:"E",source:"E"},{target:"F",source:"F"},{target:"G",source:"G"},{target:"H",source:"H"},{target:"I",source:"I"},{target:"J",source:"J"},{target:"K",source:"K"},{target:"L",source:"L"},{target:"M",source:"M"},{target:"N",source:"N"},{target:"O",source:"O"},{target:"P",source:"P"},{target:"Q",source:"Q"},{target:"R",source:"R"},{target:"S",source:"S"},{target:"T",source:"T"},{target:"U",source:"U"},{target:"V",source:"V"},{target:"W",source:"W"},{target:"X",source:"X"},{target:"Y",source:"Y"},{target:"Z",source:"Z"},{target:"0",source:"0"},{target:"1",source:"1"},{target:"2",source:"2"},{target:"3",source:"3"},{target:"4",source:"4"},{target:"5",source:"5"},{target:"6",source:"6"},{target:"7",source:"7"},{target:"8",source:"8"},{target:"9",source:"9"},{target:"!",source:"!"},{target:"?",source:"?"},{target:".",source:"."},{target:",",source:","},{target:'"',source:'"'},{target:"'",source:"'"}],_name:"crosshatch"}]};function WM(t){return VM(t)}function JM(t){return VM(t)}const GM={kind:"string",type:"application/json+napkin.ai/text-web-lib",key:"ignoreClipboardData",value:!0};
1function KM(t){return!!(t&&t.type&&t.type.name)&&("image"===t.type.name?(console.debug("[shouldIgnorePasteFromNode] ignoring paste: image found"),!0):!(!t.attrs||!t.attrs.src)&&(0===t.attrs.src.indexOf("data:image/png;base64")?(console.debug("[shouldIgnorePasteFromNode] ignoring paste: graph item found"),!0):0===t.attrs.indexOf("data:image/svg+xml")&&(console.debug("[shouldIgnorePasteFromNode] ignoring paste: svg found"),!0)))}function YM(t){if(!t||!t.items)return!1;if(t.types.includes("application/napkin+json"))return console.log("[shouldIgnorePasteFromEvent] skip paste: application/napkin+json found"),!0;let e=!1;for(let n=0;n<t.items.length;n++){const r=t.items[n];if(r&&r.type)if("image/png"!==r.type)if("image/svg+xml"!==r.type){if("text/plain"===r.type&&"string"===r.kind){const e=t.getData("text/plain");if(e&&0===e.indexOf("<svg")){console.log("[shouldIgnorePasteFromEvent] ignoring paste: svg tag found in text/plain");continue}if(e&&e.indexOf('<?xml version="1.0" encoding="UTF-8"?><svg')>0){console.log("[shouldIgnorePasteFromEvent] ignoring paste: svg as xml found in text/plain");continue}}0===r.type.indexOf("text/")&&(e=!0)}else console.log("[shouldIgnorePasteFromEvent] ignoring paste: image/svg+xml found");else console.log("[shouldIgnorePasteFromEvent] ignoring paste: image/png found")}return!1===e}const QM=new Je("clipboard"),ZM=t=>{const e=t.onPasteHandler,n=t.onTablePasteHandler,r=t.canPasteGetter;return new Ve({key:QM,props:{handlePaste(t,o,i){const s=((t,o,i)=>{console.debug("[handlePasteEvent] event",o);try{if(r&&!0!==r())return o.preventDefault(),o.stopPropagation(),!0;if(!o.clipboardData)return console.debug("[handlePasteEvent] ignoring paste: no clipboard data"),!0;if(YM(o.clipboardData))return console.debug("[handlePasteEvent] ignoring paste: clipboard data should be ignored"),!0;const t=i.content;if(!t||0===t.size||0===t.content.length)return console.debug("[handlePasteEvent] ignoring paste: no content"),!0;e&&e(o);const s=function(t,e){let n=!1,r=0,o=0,i=[];if(t.clipboardData){const e=t.clipboardData.getData("text/html");e&&/<table/i.test(e)&&(n=!0)}if(e&&e.content)try{e.content.descendants(t=>{if(t.type&&"table"===t.type.name){n=!0,r=t.content.childCount;for(let e=0;e<t.content.childCount;e++){const n=t.content.child(e),r=[];if(n&&n.content){0===e&&(o=n.content.childCount);for(let t=0;t<n.content.childCount;t++){const e=n.content.child(t),o=e&&e.textContent?e.textContent:"";r.push(o.length)}}i.push(r)}return!1}return!0})}catch(t){console.error("[detectTableInPaste] Error while checking for table",t)}return{hasTable:n,rows:r,cols:o,cellSizes:i}}(o,i);if(s.hasTable&&n)try{n(o,i,s)}catch(t){console.error("[handlePasteEvent] Error in table paste handler:",t)}const a=[];t.nodesBetween(0,t.size,t=>{try{t&&t.type&&t.type.name&&a.push(t.type.name)}catch(t){console.error("handlePasteEvent - nodesBetween",t)}return!0}),console.debug("handlePasteEvent",a,t&&t.content?t.content:void 0);for(let e=0;e<t.content.length;e++)if(KM(t.content[e]))return!0}catch(t){console.error("handlePasteEvent",t)}return!1})(0,o,i);return 0==s&&o.stopPropagation(),s}}})},XM=Tl.create({name:"clipboard",addOptions:()=>({excludeRules:GM}),onBeforeCreate(){},onCreate(){},onUpdate(){},addProseMirrorPlugins(){return[ZM({...this.options||{},excludeRules:this.options.excludeRules})]}});class tT{constructor(t,e,n,r){this.node=t,this.view=e,this.getPos=n,this.options=r,this.iconElement=null,this.dom=document.createElement("p"),this.dom.className="title",this._applyAttributes(t.attrs),this.iconElement=Kk(t,this.options?.onIconNeedsLoading),this.dom.appendChild(this.iconElement),Yk(this.dom,this),Qk(this.iconElement,this),Zk(this.iconElement,this),this.contentDOM=document.createElement("span"),this.contentDOM.className="heading-content",this.dom.appendChild(this.contentDOM)}_applyAttributes(t){t.hookId&&this.dom.setAttribute("id",t.hookId),t.hookType&&this.dom.setAttribute("data-hook-type",t.hookType),this.dom.setAttribute("data-name","title"),t.iconId?this.dom.setAttribute("data-icon-id",t.iconId):this.dom.removeAttribute("data-icon-id")}update(t){if("title"!==t.type.name)return!1;const e=this.node.attrs.iconId,n=t.attrs.iconId;this.node=t,this._applyAttributes(t.attrs);const r=t.attrs.hookId;return this.iconElement&&Xk(this.iconElement,r,e,n,this.options?.onIconNeedsLoading),!0}destroy(){const t=this.node?.attrs?.hookId;t&&Gk(t),this.iconElement=null}}function eT(t){try{if(!t)return null;if(t.marks&&Array.isArray(t.marks)&&(t.marks=t.marks.filter(t=>"link"!=t.type.name)),t.content&&Array.isArray(t.content))for(let e=0;e<t.content.length;e++)t.content[e]=eT(t.content[e]);else t.content&&(t.content=eT(t.content));return t}catch(e){return console.error("normalizeTitleNode",e),t}}const nT=rc.create({name:"title",addOptions:()=>({HTMLAttributes:{},position:0,emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Title",showOnlyWhenEditable:!1,showOnlyCurrent:!0,
1contentOptions:{},onHeadingHover:null,onHeadingIconClick:null,onHeadingIconDelete:null,onIconNeedsLoading:null,onTitleDefocus:null,canPasteGetter:null}),priority:9e3,content:"text*",group:"title",defining:!0,addAttributes(){return{...this.parent?.(),name:{default:"title"},class:{default:"title"},iconId:{default:null,parseHTML:t=>t.getAttribute("data-icon-id"),renderHTML:t=>t.iconId?{"data-icon-id":t.iconId}:{}}}},addCommands(){return{setTitle:t=>({editor:e,tr:n,dispatch:r,commands:o,state:i,view:s,chain:a})=>{if(r){const e=n.doc.nodeAt(this.options.position);if(!e)return!0;const r={from:this.options.position,to:this.options.position+e.nodeSize};t?o.insertContentAt(r,{type:"title",content:[{type:"text",text:t}],attrs:e.attrs}):o.deleteRange(r),function(t,e){const n=t.steps.length-1;if(n<e)return;const r=t.steps[n];if(!(r instanceof Jt||r instanceof Gt))return;const o=t.mapping.maps[n];let i=0;o.forEach((t,e,n,r)=>{0===i&&(i=r)}),t.setSelection(Se.near(t.doc.resolve(i),1))}(n,n.steps.length-1)}return!0}}},parseHTML:()=>[{tag:'p[data-name="title"]',contentElement:t=>t.querySelector(".heading-content")||t}],renderHTML({HTMLAttributes:t}){return["p",ka(this.options.HTMLAttributes,t),0]},addNodeView(){const t=this.options;return({node:e,view:n,getPos:r})=>new tT(e,n,r,t)},addProseMirrorPlugins(){return[new Ve({appendTransaction:(t,e,n)=>{const r=e.selection,o=n.selection,i=t=>"title"===t.$anchor.parent.type.name;if(!r.eq(o)&&i(r)&&!i(o)){const t=n.doc.firstChild,e=t?.attrs?.hookId;
1e&&this.options.onTitleDefocus&&this.options.onTitleDefocus(e)}},props:{decorations:({doc:t})=>{const e=[];if(!this.editor.isEditable&&this.options.showOnlyWhenEditable)return;const n=this.options.position,r=eT(t.nodeAt(n));if(r){if(!r.textContent.trim()){const t=[this.options.emptyNodeClass];this.editor.isEmpty&&t.push(this.options.emptyEditorClass);const o=ri.node(n,n+r.nodeSize,{class:t.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,title:r}):this.options.placeholder});e.push(o)}return si.create(t,e)}},handlePaste:(t,e,n)=>{if(this.options.canPasteGetter&&!0!==this.options.canPasteGetter())return e.preventDefault(),e.stopPropagation(),!0;if(!this.editor.isActive("title"))return!1;if(YM(e.clipboardData))return console.debug("[handlePasteEvent] ignoring paste: clipboard data should be ignored"),!1;e.stopPropagation();const r=e.clipboardData||window.clipboardData;if(r){let t=null,e=null;const n=["text/html","text/plain"];for(let o=0;o<n.length;o++){const i=n[o];if(r.types.includes(i)){const n=r.getData(i);switch(i){case"text/plain":t=WM(n);break;case"text/html":t=JM(n)}e=i;break}}try{if(!t||0==t.length)return console.debug("Ignoring paste of plain text: no text",t,e),!1;if(!e)return!1;console.debug("[handlePaste] Pasting text",t,e),HM(this.editor,t,e,{parseMarkdown:!0,downgradeFromHeading:!0,forceUpgradeToTitle:!0,appendIfNotEmpty:!0,disableLinks:!0},this.options.contentOptions)}catch(e){return console.error("Error while pasting plain text",t,e),!1}}return!0}}})]}}),rT=nT;const oT=Tl.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:e})=>Nc(t,e),redo:()=>({state:t,dispatch:e})=>Lc(t,e)}),addProseMirrorPlugins(){return[Oc(this.options)]}}),iT=oT,sT=XM,aT=new Je("dragdrop"),lT=t=>{let e=null,n=!1;const r=()=>t.enableDragReorder&&(!t.canDragReorderGetter||!0===t.canDragReorderGetter()),o=e=>{n!==e&&(n=e,t.onDragActiveChanged?.(e))};return new Ve({key:aT,props:{handleDOMEvents:{dragstart:(t,n)=>r()&&!0===t.editable?(e=t.dom.parentElement,o(!0),!1):(e=null,o(!1),!1),drop(t,n){if(!r()||!0!==t.editable)return n.preventDefault(),o(!1),!1;const i=e===t.dom.parentElement;return e=null,o(!1),!i&&(n.preventDefault(),!0)},dragend:()=>(e=null,o(!1),!1)}}})},cT=Tl.create({name:"dragdrop",addOptions:()=>({enableDragReorder:!1,canDragReorderGetter:null,onDragActiveChanged:null}),addProseMirrorPlugins(){const{enableDragReorder:t,canDragReorderGetter:e,onDragActiveChanged:n}=this.options;return[lT({enableDragReorder:t,canDragReorderGetter:e,onDragActiveChanged:n})]}}),dT=Tl.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:null}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>e=>{let n=e.commands;return!!this.options.alignments.includes(t)&&this.options.types.map(e=>n.updateAttributes(e,{textAlign:t})).some(t=>t)},unsetTextAlign:()=>t=>{let e=t.commands;return this.options.types.map(t=>e.resetAttributes(t,"textAlign")).some(t=>t)},toggleTextAlign:t=>e=>{let n=e.editor,r=e.commands;return!!this.options.alignments.includes(t)&&(n.isActive({textAlign:t})?r.unsetTextAlign():r.setTextAlign(t))}}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}).extend({addKeyboardShortcuts:()=>({})}).configure({types:["heading","paragraph","bulletList","orderedList"]});function uT(t){if("string"!=typeof t)return!1;try{const e=new URL(t.trim());return"https:"===e.protocol||"http:"===e.protocol}catch{return!1}}const hT=Tl.create({name:"linkInterceptor",addOptions:()=>({onLinkClick:null}),addProseMirrorPlugins(){return[new Ve({props:{handleDOMEvents:{click:(t,e)=>{const n=e.target,r=n&&n.closest&&n.closest("a");if(!r)return!1;if(!t.dom.contains(r))return!1;const o=r.getAttribute("href")||"";if(!o||!uT(o))return!1;const i=this.options.onLinkClick;if("function"!=typeof i)return!1;e.preventDefault(),e.stopPropagation();try{i(o,r)}catch(t){console.error("[LinkInterceptor] Error calling onLinkClick",t)}return!0}}}})]}});function pT(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(t){c=!0,o=t}
1finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return fT(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fT(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fT(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var gT=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,mT=rc.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML(t){let e=t.HTMLAttributes;return["img",ka(this.options.HTMLAttributes,e)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,n,r,o,i,s;const a=null!=(n=null==(e=t.attrs)?void 0:e.src)?n:"",l=null!=(o=null==(r=t.attrs)?void 0:r.alt)?o:"",c=null!=(s=null==(i=t.attrs)?void 0:i.title)?s:"";return c?`![${l}](${a} "${c}")`:`![${l}](${a})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||"undefined"==typeof document)return null;const t=this.options.resize,e=t.directions,n=t.minWidth,r=t.minHeight,o=t.alwaysPreserveAspectRatio;return t=>{let i=t.node,s=t.getPos,a=t.HTMLAttributes,l=t.editor;const c=document.createElement("img");Object.entries(a).forEach(t=>{let e=pT(t,2),n=e[0],r=e[1];if(null!=r)switch(n){case"width":case"height":break;default:c.setAttribute(n,r)}}),c.src=a.src;const d=new Jl({element:c,editor:l,node:i,getPos:s,onResize:(t,e)=>{c.style.width=`${t}px`,c.style.height=`${e}px`},onCommit:(t,e)=>{const n=s();void 0!==n&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:t,height:e}).run()},onUpdate:(t,e,n)=>t.type===i.type,options:{directions:e,min:{width:n,height:r},preserveAspectRatio:!0===o}}),u=d.dom;return u.style.visibility="hidden",u.style.pointerEvents="none",c.onload=()=>{u.style.visibility="",u.style.pointerEvents=""},d}},addCommands(){return{setImage:t=>e=>e.commands.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Ul({find:gT,type:this.type,getAttributes:t=>{const e=pT(t,5),n=e[2];return{src:e[3],alt:n,title:e[4]}}})]}});const AT=mT;class yT{constructor(t){this._node=t,this._nodeId=!1}hasCoreNode(){return!(!this._node||!this._node.type)}getCoreNode(){return this._node}getId(){return!1!==this._nodeId&&""!==this._nodeId&&this._nodeId||(this._nodeId=this.parseId()),this._nodeId||""}parseId(){if(this.hasCoreNode()){if(this._node.attrs.hookType&&this._node.attrs.hookId)return this._node.attrs.hookId||"";if(this._node.marks&&this._node.marks.length>0){const t=this._node.marks.find(t=>t&&t.attrs&&t.attrs.hookType&&t.attrs.hookId?.length>0);if(t)return t.attrs.hookId||"";const e=this._node.marks.find(t=>t.attrs.hookType);if(e)return e.attrs.hookId||""}}return""}getAttributes(){return this.hasCoreNode()?this._normalizeAttributes(this._node.attrs):{}}_normalizeAttributes(t){const e={...t},n=this.getType();return n!==$M.name&&n!==RM.name||!Array.isArray(e.colwidth)||(e.colwidth=e.colwidth.reduce((t,e)=>t+(e||0),0)),e}getType(){return this.hasCoreNode()?this._node.type.name:""}getText(){if(this.hasCoreNode()){const t=this._node.isText?this._node.nodeSize:this._node.nodeSize-2;return this._node.textBetween(0,t,"\n")}return""}isBlock(){return this.hasCoreNode()&&this._node.isBlock}isTextBlock(){return this.hasCoreNode()&&this._node.isTextblock}isText(){return this.hasCoreNode()&&this._node.isText}isHardBreak(){return this.getType()==rw.name}isParagraph(){return this.getType()==aE.name}isImage(){return this.getType()==AT.name}isSpacer(){return this.getType()==wT.name}isCodeBlock(){return this.getType()==ew.name}isBlockquote(){return this.getType()==jv.name}isBulletList(){return this.getType()===ES.name}isOrderedList(){return this.getType()===qS.name}isTitle(){return this.getType()===rT.name}isHeading(){return this.getType()===hC.name}isTable(){return this.getType()===zM.name}isTableCell(){return this.getType()===$M.name}isTableRow(){return this.getType()===PM.name}isTableHeader(){return this.getType()===RM.name}getSize(){if(this.hasCoreNode())return this._node.content.size}getDescendants(){const t=[];return this.hasCoreNode()&&this._node.content.descendants(e=>(t.push(new yT(e)),!0)),t}toJson(){return this.hasCoreNode()?{id:this.getId(),type:this.getType(),content:this.getText()}:{}}asHeading(){return this.isHeading()?new bT(this._node):null}toString(){return JSON.stringify(this.toJson())}}class bT extends yT{constructor(t){super(t)}getLevel(){return this.hasCoreNode()&&this._node.attrs.level||1}}const vT=yT,wT=rc.create({name:"spacer",group:"block",inline:!1,defining:!0,leaf:!0,atom:!0,isolating:!0,addOptions:()=>({HTMLAttributes:{}}),addAttributes:()=>({name:{default:"spacer"},class:{default:"spacer"},height:{default:0,parseHTML:t=>t.getAttribute("data-height"),renderHTML:t=>({"data-height":t.height,style:`height: ${t.height}px;`})}}),parseHTML:()=>[{tag:'p[name="spacer"]'}],renderHTML({HTMLAttributes:t}){return["p",ka(this.options.HTMLAttributes,t),0]},addCommands:()=>({getAllSpacers:()=>({editor:t})=>{const e=[];return t.state.doc.descendants(t=>{"spacer"===t.attrs.class&&e.push(new vT(t))}),e},insertSpacerAt:(t,e,n=!1)=>({commands:r,tr:o})=>{const i=mA("blockHook");return o.setMeta("addToHistory",n),r.insertContentAt(t,{type:"spacer",attrs:{height:e,hookId:i,hookType:"blockHook"}})?i:null},removeSpacer:(t,e=!1)=>({editor:n,commands:r,tr:o})=>{let i=sw(n,t);if(null!=i&&null!=i.position&&null!=i.block&&null!=i.block.type&&"spacer"==i.block.type.name){let t=i.position,n={from:t,to:t+i.block.nodeSize};return o.setMeta("addToHistory",e),r.deleteRange(n)}return!1},updateSpacer:(t,e,n=!1,r=null,o=!1)=>({editor:i,commands:s,tr:a})=>{let l=sw(i,t);if(null!=l&&null!=l.position&&null!=l.block&&null!=l.block.type&&"spacer"==l.block.type.name){if(n){const n=document.querySelector(`p[name="spacer"]#${t}`);if(null===n)return!1;const o=()=>{try{n.removeEventListener("transitionend",o),r&&r()}catch(e){console.warn(`[updateSpacer] cannot set height to spacer ${t}`,e)}};return n.addEventListener("transitionend",o),n.style.height=`${e}px`,!0}a.setMeta("addToHistory",o),s.updateAttributes("spacer",{height:e}),window.requestAnimationFrame(()=>{const n=document.querySelector(`p[name="spacer"]#${t}`);null!==n&&(n.style.height=`${e}px`)})}return!1},syncSpacerHeight:(t,e=!1)=>({editor:n,commands:r,tr:o})=>{let i=sw(n,t);if(null!=i&&null!=i.position&&null!=i.block&&null!=i.block.type&&"spacer"==i.block.type.name){const n=document.querySelector(`p[name="spacer"]#${t}`);if(null==n)return!1;o.setMeta("addToHistory",e);const i=n.offsetHeight;return r.updateAttributes("spacer",{height:i}),!0}return!1}})}),kT=wT,CT=new Je("previewThemeFrame");function xT(t,e){t.setMeta(CT,e)}const ST=()=>({position:null,hookId:null,height:0,visualId:null}),ET=new Map;function MT(t){const e=ET.get(t);null!=e&&(null!=e.parentNode&&e.parentNode.removeChild(e),ET.delete(t))}function TT(){return new Ve({key:CT,state:{init:ST,apply(t,e){const n=t.getMeta(CT);if(null!=n){if("show"===n.action)return bA(n.hookId)?(null!=e.hookId&&e.hookId!==n.hookId&&MT(e.hookId),{position:n.position,hookId:n.hookId,height:n.height,visualId:n.visualId}):e;if("hide"===n.action){const t=e.hookId;return null!=t&&queueMicrotask(()=>MT(t)),{position:null,hookId:null,height:0,visualId:null}}if("setVisualId"===n.action)return null==e.hookId?e:{...e,visualId:n.visualId}}if(null==e.position)return e;if(t.docChanged){const n=t.mapping.mapResult(e.position);return n.deleted?(null!=e.hookId&&MT(e.hookId),{position:null,hookId:null,height:0,visualId:null}):{...e,position:n.pos}}return e}},props:{decorations(t){const e=this.getState(t);if(null==e||null==e.position||null==e.hookId)return si.empty;
1const n=t.doc.content.size,r=Math.min(Math.max(e.position,0),n),o=function(t){let e=ET.get(t);return null==e&&(e=function(t){const e=document.createElement("div");e.setAttribute("id",t),e.setAttribute("name",_T),e.className=DT,e.setAttribute("data-state",$T),e.setAttribute("data-hook-type",NT),e.setAttribute("data-expanded","true"),e.setAttribute("contenteditable","false");const n=document.createElement("span");return n.className=OT,n.setAttribute("contenteditable","false"),e.appendChild(n),e}(t),ET.set(t,e)),e}(e.hookId);!function(t,e){Number.isFinite(e.height)&&e.height>0?(t.setAttribute("data-height",String(e.height)),t.style.height=`${e.height}px`):(t.removeAttribute("data-height"),t.style.height=""),"string"==typeof e.visualId&&e.visualId.length>0?t.setAttribute("data-visual-id",e.visualId):t.removeAttribute("data-visual-id")}(o,e);const i=ri.widget(r,o,{key:e.hookId,side:1,ignoreSelection:!0,stopEvent:()=>!0});return si.create(t.doc,[i])}},view:t=>({destroy(){const e=CT.getState(t.state);null!=e?.hookId&&MT(e.hookId)}})})}const _T="themeFrame",DT="theme-frame",OT="theme-frame-caption",IT="theme-frame-drag-handle",NT="blockHook",LT="visual",BT="placeholder",$T="preview-autographics",RT=[LT,BT,$T],PT=t=>"string"==typeof t&&RT.includes(t),FT=t=>"string"==typeof t&&bA(t)?t:null;function zT(t){const e=new Map;t.descendants((t,n)=>{if(t.type.name!==_T)return;const r=FT(t.attrs.hookId);if(null==r)return;const o=e.get(r)??[];o.push({pos:n,size:t.nodeSize,isVisual:t.attrs.state===LT}),e.set(r,o)});const n=[];for(const t of e.values()){if(t.length<2)continue;const e=t.find(t=>t.isVisual)??t[0];for(const r of t)r!==e&&n.push({from:r.pos,to:r.pos+r.size})}return n}function HT(t,e){if(0===e.length)return null;e.sort((t,e)=>e.from-t.from);const n=t.tr;n.setMeta("addToHistory",!1);for(const t of e)n.delete(t.from,t.to);return n}function jT(t){if(t instanceof ve)return"hookId"===t.attr;if(!(t instanceof Jt||t instanceof Gt))return!1;if(0===t.slice.content.size)return!1;let e=!1;return t.slice.content.descendants(t=>(t.type.name===_T&&(e=!0),!e)),e}const UT=(t,e)=>{if(!bA(e))return null;const n=sw(t,e);return null==n||null==n.position||null==n.block||null==n.block.type||n.block.type.name!==_T?null:n},VT="theme-frame-menus";class qT{constructor(t,e,n,r,o,i){this._topHandle=null,this._bottomHandle=null,this._dragGhost=null,this.node=t,this._enableDragReorder=r,this._canDragReorderGetter=o,this._view=e,this._getPos=n,this._onPlaceholderClick=i;const s="string"==typeof(a=t.attrs.hookId)&&bA(a)?function(t){const e=ET.get(t);return null==e?null:(ET.delete(t),null!=e.parentNode&&e.parentNode.removeChild(e),e)}(a):null;var a;null!=s?(this.dom=s,s.querySelectorAll(`.${OT}, .${IT}`).forEach(t=>t.remove())):this.dom=document.createElement("div"),this._captionSpan=document.createElement("span"),this._captionSpan.className=OT,this._captionSpan.setAttribute("contenteditable","false"),this.dom.appendChild(this._captionSpan),r&&(this.dom.draggable=!1,this.dom.addEventListener("dragstart",t=>{const e=t.target;e?.classList.contains(IT)&&this._canDragReorder()||t.preventDefault()}),this._topHandle=this._createDragHandle("top"),this._bottomHandle=this._createDragHandle("bottom"),this.dom.appendChild(this._topHandle),this.dom.appendChild(this._bottomHandle)),this.dom.addEventListener("click",t=>this._handlePlaceholderClick(t)),this._applyAttributes(t.attrs),this._adoptExistingChildren(t.attrs.hookId),this._syncDragHandleState()}_hasMountedContent(){for(const t of Array.from(this.dom.children))if(!t.classList.contains(OT)&&!t.classList.contains(IT)&&!t.classList.contains(VT))return!0;return!1}_handlePlaceholderClick(t){if(null==this._onPlaceholderClick)return;if((PT(this.node.attrs.state)?this.node.attrs.state:LT)!==BT)return;if(this._hasMountedContent())return;const e=t.target,n=e instanceof Element?e:e instanceof Node?e.parentElement:null;if(null!=n?.closest(`.${IT}`))return;if(null!=n?.closest(`.${VT}`))return;const r=FT(this.node.attrs.hookId);null!=r&&this._onPlaceholderClick(r)}_createDragHandle(t){const e=document.createElement("div");return e.className="top"===t?`${IT} theme-frame-drag-handle--top dom_capture_mouse`:`${IT} theme-frame-drag-handle--bottom dom_capture_mouse`,e.contentEditable="false",e.setAttribute("draggable","true"),e.addEventListener("mousedown",()=>{if(!this._canDragReorder())return;const t=this._getPos();if(null==t)return;const e=this._view.state.tr.setSelection(Oe.create(this._view.state.doc,t));this._view.dispatch(e)}),e.addEventListener("dragstart",t=>{if(!this._canDragReorder())return void t.preventDefault();const n=this._getPos();if(null==n)return void t.preventDefault();const r=this._view.state.selection;if(!(r instanceof Oe)||r.from!==n)return void t.preventDefault();const o=this.dom.getBoundingClientRect(),i=function(t,e){const n=e?"200, 200, 200":"72, 72, 72",r=document.createElement("div");return r.style.position="fixed",r.style.top="-10000px",r.style.left="-10000px",r.style.width=`${Math.max(t.width,1)}px`,r.style.height=`${Math.max(t.height,1)}px`,r.style.boxSizing="border-box",r.style.borderRadius="8px",r.style.border=`1px solid rgba(${n}, ${e?.5:.4})`,r.style.background=`rgba(${n}, ${e?.1:.08})`,r.style.pointerEvents="none",document.body.appendChild(r),r}
1(o,null!=this.dom.closest(".night"));this._dragGhost=i;const s=Math.min(Math.max(0,t.clientX-o.left),o.width),a=Math.min(Math.max(0,t.clientY-o.top),o.height);t.dataTransfer?.setDragImage(i,s,a),e.addEventListener("dragend",()=>{i.remove(),this._dragGhost=null},{once:!0});const l=r.content(),{dom:c,text:d}=this._view.serializeForClipboard(l);t.dataTransfer?.clearData(),t.dataTransfer?.setData("text/html",c.innerHTML),t.dataTransfer?.setData("text/plain",d),t.dataTransfer&&(t.dataTransfer.effectAllowed="move"),this._view.dragging={slice:l,move:!0}}),e}_canDragReorder(){const t=!this._canDragReorderGetter||!0===this._canDragReorderGetter();return this._enableDragReorder&&t&&!0===this._view.editable}_syncDragHandleState(){const t=this._canDragReorder();this._topHandle?.setAttribute("draggable",t?"true":"false"),this._bottomHandle?.setAttribute("draggable",t?"true":"false"),null!=this._topHandle&&(this._topHandle.style.pointerEvents=t?"auto":"none"),null!=this._bottomHandle&&(this._bottomHandle.style.pointerEvents=t?"auto":"none")}stopEvent(t){return function(t){const e=t.target,n=e instanceof Element?e:e instanceof Node?e.parentElement:null;return null!=n?.closest(`.${VT}`)}(t)}update(t){if(t.type.name!==_T)return!1;const e=FT(this.node.attrs.hookId),n=FT(t.attrs.hookId);return e!==n?(console.warn(`[ThemeFrame] hookId changed from "${e}" to "${n}" — this should never happen`),!1):(this.node=t,this._applyAttributes(t.attrs),this._syncDragHandleState(),!0)}_applyAttributes(t){const e=FT(t.hookId),n=PT(t.state)?t.state:LT,r=n===BT;this.dom.setAttribute("name",_T),this.dom.className=t.class||DT,!r&&this._canDragReorder()&&this.dom.classList.add("theme-frame--drag-reorder"),r&&this.dom.classList.add("dom_capture_mouse"),this.dom.setAttribute("data-state",n),null!=e?this.dom.setAttribute("id",e):this.dom.removeAttribute("id"),null!=t.height?this.dom.setAttribute("data-height",String(t.height)):this.dom.removeAttribute("data-height"),null!=t.hookType?this.dom.setAttribute("data-hook-type",t.hookType):this.dom.removeAttribute("data-hook-type"),"string"==typeof t.visualId&&t.visualId.length>0?this.dom.setAttribute("data-visual-id",t.visualId):this.dom.removeAttribute("data-visual-id");const o=!1!==t.expanded;this.dom.setAttribute("data-expanded",o?"true":"false");const i="number"==typeof t.width?t.width:Number(t.width);Number.isFinite(i)&&i>0?this.dom.setAttribute("data-width",String(i)):this.dom.removeAttribute("data-width");const s="number"==typeof t.height?t.height:Number(t.height);this.dom.style.width=r&&Number.isFinite(i)&&i>0?`${i}px`:"",this.dom.style.height=r&&Number.isFinite(s)&&s>0?`${s}px`:"";const a="string"==typeof t.text?t.text:"";this._captionSpan.textContent!==a&&(this._captionSpan.textContent=a)}_adoptExistingChildren(t){const e=FT(t);if(null==e)return;const n=document.getElementById(e);this._adoptChildrenFrom(n)}_adoptChildrenFrom(t){if(t&&t!==this.dom){for(;t.firstChild;)this.dom.appendChild(t.firstChild);this.dom.querySelectorAll(`.${IT}`).forEach(t=>{t!==this._topHandle&&t!==this._bottomHandle&&t.remove()}),this.dom.querySelectorAll(`.${OT}`).forEach(t=>{t!==this._captionSpan&&t.remove()})}}destroy(){this._topHandle?.remove(),this._bottomHandle?.remove(),this._dragGhost?.remove(),this._dragGhost=null}}const WT=rc.create({name:_T,priority:50,group:"block",inline:!1,defining:!0,atom:!0,addOptions:()=>({HTMLAttributes:{},enableDragReorder:!1,canDragReorderGetter:null,onPlaceholderClick:null}),addAttributes:()=>({name:{default:_T},class:{default:DT},state:{default:LT,parseHTML:t=>{const e=t.getAttribute("data-state");return PT(e)?e:LT},renderHTML:t=>({"data-state":PT(t.state)?t.state:LT})},height:{default:0,parseHTML:t=>{const e=t.getAttribute("data-height");return null!=e?Number(e):0},renderHTML:t=>({"data-height":t.height})},expanded:{default:!0,parseHTML:t=>"false"!==t.getAttribute("data-expanded"),renderHTML:t=>({"data-expanded":!1===t.expanded?"false":"true"})},width:{default:0,parseHTML:t=>{const e=t.getAttribute("data-width");return null!=e?Number(e):0},renderHTML:t=>"number"!=typeof t.width||t.width<=0?{}:{"data-width":t.width}},text:{default:null,parseHTML:t=>t.getAttribute("data-text"),renderHTML:t=>"string"!=typeof t.text||0===t.text.length?{}:{"data-text":t.text}},hookId:{default:null},hookType:{default:NT},visualId:{default:null,parseHTML:t=>t.getAttribute("data-visual-id"),renderHTML:t=>"string"!=typeof t.visualId||0===t.visualId.length?{}:{"data-visual-id":t.visualId}}}),parseHTML:()=>[{tag:'div[name="themeFrame"]'}],renderHTML({HTMLAttributes:t}){return["div",ka(this.options.HTMLAttributes,t)]},addNodeView(){const t=this.options.enableDragReorder,e=this.options.canDragReorderGetter,n=this.options.onPlaceholderClick;return({node:r,view:o,getPos:i})=>new qT(r,o,i,t,e,n)},addProseMirrorPlugins:()=>
1[TT(),new Ve({appendTransaction(t,e,n){const r=t.some(t=>{const e=t.getMeta("uiEvent");return"paste"===e||"drop"===e});if(!r)return null;const o=new Set;e.doc.descendants(t=>{t.type.name===_T&&"string"==typeof t.attrs.hookId&&o.add(t.attrs.hookId)});const i=new Pt;for(const e of t)for(const t of e.mapping.maps)i.appendMap(t);const s=i.invert(),a=new Map;n.doc.descendants((t,e)=>{if(t.type.name!==_T||"string"!=typeof t.attrs.hookId)return;const n=a.get(t.attrs.hookId)??[];n.push({pos:e,size:t.nodeSize,isNew:s.mapResult(e).deletedAfter}),a.set(t.attrs.hookId,n)});const l=[];for(const[t,e]of a.entries()){if(!o.has(t)){for(const t of e)l.push({from:t.pos,to:t.pos+t.size});continue}if(e.length<2)continue;const n=e.find(t=>!t.isNew)??e[0];for(const t of e)t!==n&&l.push({from:t.pos,to:t.pos+t.size})}return HT(n,l)}}),new Ve({view(t){const e=HT(t.state,zT(t.state.doc));return null!=e&&t.dispatch(e),{}},appendTransaction:(t,e,n)=>t.some(t=>t.docChanged&&t.steps.some(jT))?HT(n,zT(n.doc)):null})],addCommands:()=>({insertThemeFrameAt:(t,e={})=>({commands:n,tr:r})=>{const{state:o=LT,height:i=null,expanded:s=!0,width:a=0,text:l=null,hookId:c=null,visualId:d=null,addToHistory:u=!1}=e,h=FT(c)??mA(NT);return r.setMeta("addToHistory",u),!0===n.insertContentAt(t,{type:_T,attrs:{state:o,height:i,expanded:s,width:a,text:l,hookId:h,hookType:NT,visualId:d}})?h:null},removeThemeFrame:(t,e=!1)=>({editor:n,tr:r})=>{const o=UT(n,t);if(null!=o){const t=o.position,n=t+o.block.nodeSize;return r.setMeta("addToHistory",e),r.delete(t,n),!0}return!1},moveThemeFrame:(t,e={})=>({editor:n,tr:r})=>{const{targetHookId:o=null,toEnd:i=!1,addToHistory:s=!1}=e,a=UT(n,t);if(null==a)return!1;const l=a.position,c=l+a.block.nodeSize,d=a.block;let u;if(i)u=n.state.doc.content.size;else{const e=FT(o);if(null==e||e===t)return!1;const r=UT(n,e);if(null==r)return!1;u=r.position}return!(u>=l&&u<=c||(r.setMeta("addToHistory",s),r.delete(l,c),r.insert(r.mapping.map(u),d),0))},updateThemeFrameHeight:(t,e,n=!1)=>({editor:r,tr:o})=>{const i=UT(r,t);return null!=i&&(o.setMeta("addToHistory",n),o.setNodeMarkup(i.position,void 0,{...i.block.attrs,height:e}),!0)},updateThemeFrame:(t,e={},n=!1)=>({editor:r,tr:o})=>{const i=UT(r,t);if(null==i)return!1;const s={...i.block.attrs};return void 0!==e.state&&(s.state=e.state),void 0!==e.height&&(s.height=e.height),void 0!==e.expanded&&(s.expanded=e.expanded),void 0!==e.width&&(s.width=e.width),void 0!==e.text&&(s.text=e.text),void 0!==e.visualId&&(s.visualId=e.visualId),o.setMeta("addToHistory",n),o.setNodeMarkup(i.position,void 0,s),!0},setThemeFrameState:(t,e,n=!1)=>({commands:r})=>!0===r.updateThemeFrame(t,{state:e},n),getAllThemeFrames:()=>({editor:t})=>{const e=[];return t.state.doc.descendants(t=>{t.type.name===_T&&e.push(new vT(t))}),e}})}),JT=WT;function GT(t){const e=atob(t);return Uint8Array.from(e,t=>t.codePointAt(0))}const KT=class extends wd{constructor(t){super(),this._onDocumentLoad=(t=!1)=>{console.debug("YJSProvider: onDocumentLoad"),this._documentLoadCallback?this._documentLoadCallback(t):console.warn("YJSProvider: No document load callback")},this._onUpdate=(t,e)=>{(null!==e||this._updateCallbackIncludeLocalUpdates)&&this._updateCallback&&this._updateCallback(t)},this._synced=!1,this._updateCallback=null,this._updateCallbackIncludeLocalUpdates=!1,this._documentLoadCallback=null,this._documentId=t,this.document=new Pp,this.document.on("update",this._onUpdate),this._allUpdates=[],window.injectJson=t=>{const e=[];for(const n of t.updates)e.push(GT(n));console.debug("YJSProvider: injectJson",{json:t,updates:e}),this.loadDocument(GT(t.document),e),this._checkForMissingUpdates()},window.injectJsonFromRefreshData=t=>{let e=null;const n=[];for(const r of t){const{key:t,value:o}=r;t.includes("document")?e=o.update:n.push(GT(o.update))}const r=this.document.store.pendingStructs?.missing;console.debug("YJSProvider: injectJsonFromRefreshData",{documentUpdate:e,updates:n,missingUpdates:r}),this.loadDocument(GT(e),n)},window.prepareJsonFromRefreshData=t=>{const e=Object.entries(t);e.sort((t,e)=>(console.log(t[1].hlc,e[1].hlc),t[1].hlc>e[1].hlc?1:-1));const n=[];e.forEach(t=>{n.push({key:t[0],value:t[1].value,hlc:t[1].hlc})}),console.log(n)},window.decodeBase64Update=t=>((t,e=jp)=>{const n=[],r=new e(ru(t)),o=new Rf(r,!1);for(let t=o.curr;null!==t;t=o.next())n.push(t);vp("Structs: ",n);const i=Bp(r);vp("DeleteSet: ",i)})(GT(t),zp),window.debugUpdates=t=>{const e=new Pp,n=[];for(const r of t){const{key:t,value:o}=r;Kp(e,GT(o.update));const i=Pf(GT(o.update));
1n.push({key:t,pendingDs:e.store.pendingDs,pendingStructs:e.store.pendingStructs?.missing,...i.structs.map(t=>({...t.id}))})}return n}}setupDocument(t=!0){this._synced||(console.debug("YJSProvider: setupDocument"),this._synced=t,this.document.isSynced=t)}loadDocument(t,e=[]){console.debug("YJSProvider: loadDocument",{documentState:t?.length,updates:e?.length}),this._storeUpdates([t,...e]);const n=!this._synced;this.setupDocument(),this.applyUpdates([t,...e]),this._onDocumentLoad(n),this._checkForMissingUpdates()}saveDocument(t=!1){if(console.debug("YJSProvider: saveDocument",{synced:this._synced,force:t}),!this._synced||t)return this._synced||(this.setupDocument(),this._onDocumentLoad(!0)),(()=>((t,e=new Uint8Array([0]),n=new Wp)=>{((t,e,n=new Map)=>{Jp(t,e.store,n),Lp(t,Np(e.store))})(n,t,Yp(e));const r=[n.toUint8Array()];if(t.store.pendingDs&&r.push(t.store.pendingDs),t.store.pendingStructs&&r.push(Vf(t.store.pendingStructs.update,e)),r.length>1){if(n.constructor===Vp)return Hf(r.map((t,e)=>0===e?t:Gf(t)));if(n.constructor===Wp)return Uf(r)}return r[0]})(this.document,void 0,new Vp))();console.warn("YJSProvider: Document already exists, skipping save")}onUpdate(t,e=!1){this._updateCallbackIncludeLocalUpdates=e,this._updateCallback=t}onLoad(t){this._documentLoadCallback=t}applyUpdates(t,e=!1){if(console.debug("YJSProvider: applyUpdates",t.length,{updates:t.length,force:e}),this._synced||e)try{this.document.transact(()=>{t.forEach(t=>Kp(this.document,t,this))})}catch(t){console.error("YJSProvider: Error while applying updates",t)}else console.warn("YJSProvider: Document not synced yet")}destroy(){this.document.off("update",this._onUpdate),this._indexedDBProvider?.destroy(),super.destroy()}_storeUpdates(t){const e=t.filter(t=>!this._allUpdates.includes(t));return this._allUpdates=[...this._allUpdates,...e],e}_refreshDocument(){this.applyUpdates(this._allUpdates,!0)}_checkForMissingUpdates(){try{this.document.store.pendingStructs?.missing&&console.error("YJSProvider: Missing updates detected",JSON.stringify(this.document.store.pendingStructs?.missing))}catch(t){console.error("YJSProvider: Error while checking for missing updates",t)}}};function YT(t,e,n){const r=t.split(/(?:\r\n?|\n)/),o=[];r.forEach(t=>{const n={type:"paragraph"};t.length>0&&(n.content=[{type:"text",text:t}]);const r=Q.fromJSON(e.doc.type.schema,n);o.push(r)});const i=M.fromArray(o);return N.maxOpen(i)}const QT=Tl.create({name:"comment"}),ZT=new Je("anchorMarkHighlight");function XT({marks:t,mark:e,from:n,to:r}){return!e&&t&&t.length>0&&(e=t[0]),e?{id:e.attrs["data-anchor-id"],type:e.attrs["data-anchor-type"],entityIds:JSON.parse(e.attrs["data-anchor-entities"]||"[]"),startPosition:n,endPosition:r}:null}const t_=new Je("anchorMarkChange");const e_=(t,e="hookId")=>{const n=[];return t.descendants((t,r)=>{t.isText&&t.marks?.length&&t.marks.forEach(o=>{if(!o.attrs[e])return;const i=t.text??"",s=n.find(t=>t.mark.attrs[e]===o.attrs[e]);s?(s.to=r+i.length,s.text+=i):n.push({mark:o,from:r,to:r+i.length,text:i})})}),n},n_=(t,e,n="data-anchor-id")=>{const r=[];return t.forEach(t=>{const o=e.find(e=>e.mark.attrs[n]===t.mark.attrs[n]);i_(t,o,n)?o_(t,o,n)||r.push({oldMark:t,newMark:o}):r.push({oldMark:t,newMark:o,isInnerEdit:!0})}),r},r_=(t,e,n="data-anchor-id")=>{const r=new Map(e.map(t=>[t.mark.attrs[n],t])),o=[];return t.forEach(t=>{const e=t.mark.attrs[n];r.has(e)||o.push({oldMark:t,newMark:null})}),o},o_=(t,e,n="data-anchor-id")=>!(!t||!e)&&t.mark.attrs[n]===e.mark.attrs[n]&&t.from===e.from&&t.to===e.to,i_=(t,e,n="data-anchor-id")=>!(!t||!e)&&t.mark.attrs[n]===e.mark.attrs[n]&&t.text===e.text,s_=new Je("anchorMarkInteraction");function a_(t={}){const{onMouseEnter:e,onMouseLeave:n,onSelectionEnter:r,onSelectionLeave:o}=t;let i=new Map,s=new Map;return new Ve({key:s_,state:{init:()=>({lastSelection:null}),apply:(t,e)=>({lastSelection:t.selection})},props:{handleDOMEvents:{mouseover(t,r){try{const o=t.posAtCoords({left:r.clientX,top:r.clientY});if(!o||void 0===o.pos)return!1;const{doc:s}=t.state,a=t.state.schema.marks.anchorMark,l=s.nodeAt(o.pos);if(!l)return!1;const c=l.marks.filter(t=>t.type===a);if(!c.length)return i.size>0&&(i.forEach(t=>{n&&n(t.id,t.type)}),i.clear()),!1;const d=new Map;
1c.forEach(t=>{const e=t.attrs["data-anchor-id"],n=t.attrs["data-anchor-type"];d.set(e,{id:e,type:n})});for(const[t,n]of d.entries())i.has(t)||e&&e(n.id,n.type);for(const[t,e]of i.entries())d.has(t)||n&&n(e.id,e.type);return i=d,!1}catch(t){return console.error("[AnchorMarkInteraction.mouseover] Error handling mouse events",t),!1}},mouseout(t,e){try{const r=t.dom.getBoundingClientRect();return(e.clientX<r.left||e.clientX>r.right||e.clientY<r.top||e.clientY>r.bottom)&&i.size>0&&(i.forEach(t=>{n&&n(t.id,t.type)}),i.clear()),!1}catch(t){return console.error("[AnchorMarkInteraction.mouseout] Error handling mouse events",t),!1}}},decorations(t){try{const{doc:e,selection:n}=t,i=t.schema.marks.anchorMark,a=new Map;e.nodesBetween(n.from,n.to,(t,e)=>{if(t.isText&&t.marks){const e=t.marks.filter(t=>t.type===i);for(const t of e){const e=t.attrs["data-anchor-id"],n=t.attrs["data-anchor-type"];a.set(e,{id:e,type:n})}}return!0});for(const[t,e]of a.entries())s.has(t)||r&&r(e.id,e.type);for(const[t,e]of s.entries())a.has(t)||o&&o(e.id,e.type);return s=a,null}catch(t){console.error("[AnchorMarkInteraction.decorations] Error handling selection events",t)}}}})}const l_=new Je("anchorMarkPaste");function c_(t,e){return t.some(t=>function(t,e){if(t.type!==e.type)return!1;const n=null==t.attrs?{}:t.attrs||{},r=null==e.attrs?{}:e.attrs||{},o=new Set([...Object.keys(n),...Object.keys(r)]);for(const t of o)if(n[t]!==r[t])return!1;return!0}(t,e))}function d_(t,e){if(t.isText){const n=[...t.marks];for(const t of e)c_(n,t)||n.push(t);return t.mark(n)}if(!t.inlineContent||t.isLeaf)return t;const n=[];return t.content.forEach(t=>{n.push(d_(t,e))}),t.copy(M.fromArray(n))}function u_(t,e){const n=[];return t.content.forEach(t=>{n.push(d_(t,e))}),new N(M.fromArray(n),t.openStart,t.openEnd)}const h_=Cl.create({name:"anchorMark",excludes:"",inclusive:!0,addOptions:()=>({HTMLAttributes:{"data-name":"anchor-mark"},onMarkUpdate:null,onMarkDeletion:null}),addAttributes:()=>({"data-anchor-id":{default:null,parseHTML:t=>t.getAttribute("data-anchor-id"),renderHTML:t=>t["data-anchor-id"]?{"data-anchor-id":t["data-anchor-id"]}:{}},"data-anchor-type":{default:null,parseHTML:t=>t.getAttribute("data-anchor-type"),renderHTML:t=>t["data-anchor-type"]?{"data-anchor-type":t["data-anchor-type"]}:{}},"data-anchor-entities":{default:null,parseHTML:t=>t.getAttribute("data-anchor-entities"),renderHTML:t=>t["data-anchor-entities"]?{"data-anchor-entities":t["data-anchor-entities"]}:{}}}),parseHTML:()=>[],renderHTML({HTMLAttributes:t}){return["span",ka(this.options.HTMLAttributes,t),0]},addCommands(){const t=this.editor;return{addAnchorMark:({startPosition:t,endPosition:e,type:n,entityId:r,onCreate:o})=>({state:i,tr:s,chain:a})=>{try{if(t>=e)return!1;const l="am-"+fA(),c=i.schema.marks.anchorMark,d=JSON.stringify([r]),u=c.create({"data-anchor-id":l,"data-anchor-type":n,"data-anchor-entities":d});return s.addMark(t,e,u),a?.(s),o?.(l),!0}catch(t){console.error("setAnchorMark failed",t)}return!1},removeAnchorMark:({id:e})=>({state:n,tr:r,chain:o})=>{const i=n.schema.marks.anchorMark;let s=!1;return n.doc.descendants((t,n)=>{if(!t.isText||!t.marks?.length)return!0;const o=t.marks.find(t=>t.type===i&&t.attrs["data-anchor-id"]===e);return o&&(r.removeMark(n,n+t.nodeSize,o),s=!0),!0}),s&&(o?o(r):t.view.dispatch(r)),s},addAnchorMarkHighlight:({id:e})=>({state:n,tr:r,chain:o})=>(r.setMeta(ZT,{action:"addHighlight",id:e}),o?o(r):t.view.dispatch(r),!0),removeAnchorMarkHighlight:({id:e})=>({state:n,tr:r,chain:o})=>(r.setMeta(ZT,{action:"removeHighlight",id:e}),o?o(r):t.view.dispatch(r),!0),removeAllAnchorMarkHighlights:()=>({state:e,tr:n,chain:r})=>(n.setMeta(ZT,{action:"clearHighlights"}),r?r(n):t.view.dispatch(n),!0)}},addProseMirrorPlugins(){return[(t=this.options,new Ve({key:t_,appendTransaction:(e,n,r)=>{try{const e=e_(n.doc,"data-anchor-id"),o=e_(r.doc,"data-anchor-id"),i=r_(e,o),s=n_(e,o);s&&Array.isArray(s)&&s.length>0&&t.onMarkUpdate&&t.onMarkUpdate(s.filter(t=>null!=t.newMark).map(({newMark:t,isInnerEdit:e})=>function(t,e){return t?{mark:XT(t),isInnerEdit:1==e}:null}(t,e??!1)).filter(t=>null!=t)),i&&Array.isArray(i)&&i.length>0&&t.onMarkDeletion&&t.onMarkDeletion(i.map(({oldMark:t})=>XT(t)).filter(t=>null!=t))}catch(t){console.error("[anchorMark] Error in appendTransaction",t)}}})),a_(this.options),new Ve({key:ZT,state:{init:()=>({highlightedIds:new Set}),apply:(t,e,n,r)=>{try{const n=t.getMeta(ZT);if(n){const t=new Set(e.highlightedIds);return"addHighlight"===n.action&&n.id?t.add(n.id):"removeHighlight"===n.action&&n.id?t.delete(n.id):"clearHighlights"===n.action&&t.clear(),{highlightedIds:t}}}catch(t){console.error("[AnchorMarkHighlightPlugin.state.apply] Error applying plugin state",t)}return e}},props:{decorations(t){try{const{doc:e}=t,n=this.getState(t),r=n?.highlightedIds??new Set;
1if(0===r.size)return si.empty;const o=[],i=t.schema.marks.anchorMark;return i?(e.descendants((t,e)=>{t.isText&&t.marks&&0!==t.marks.length&&t.marks.forEach(n=>{if(n.type===i&&n.attrs["data-anchor-id"]){const i=n.attrs["data-anchor-id"];if(r.has(i)){const r=n.attrs["data-anchor-type"];o.push(ri.inline(e,e+t.nodeSize,{class:["anchor-highlighted","anchor-highlighted-"+r].join(" ")}))}}})}),si.create(e,o)):si.empty}catch(t){return console.error("[AnchorMarkHighlightPlugin.decorations] Error creating decorations",t),si.empty}}}}),(e=this.editor.schema.marks.anchorMark,new Ve({key:l_,props:{handlePaste(t,n,r){if(!0!==t.editable)return!0;try{const{state:n}=t,{from:o,$from:i}=n.selection,s=(n.storedMarks||i.marks()).filter(t=>t.type===e);if(!s.length)return!1;const a=u_(r,s),l=n.tr.replaceSelection(a);return t.dispatch(l),!0}catch(t){return console.error("[AnchorMarkPaste.handlePaste] Error applying marks",t),!1}}}}))];var t,e}}),p_=h_,f_=new Je("scanner"),g_=Tl.create({name:"scanner",addCommands:()=>({startScannerEffects:t=>({tr:e,dispatch:n})=>!(!t||0===t.length||(n&&(e.setMeta(f_,{action:"start",nodeIds:t}),n(e)),0)),stopScannerEffects:()=>({tr:t,dispatch:e})=>(e&&(t.setMeta(f_,{action:"stop"}),e(t)),!0)}),addProseMirrorPlugins:()=>[new Ve({key:f_,state:{init:()=>({activeNodeIds:new Set}),apply:(t,e)=>{const n=t.getMeta(f_);if(!n)return e;if("start"===n.action&&n.nodeIds){const e=new Set;t.doc.descendants(t=>{const n=t.attrs?.hookId;n&&e.add(n)});const r=new Set;return n.nodeIds.forEach(t=>{e.has(t)&&r.add(t)}),{activeNodeIds:r}}return"stop"===n.action?{activeNodeIds:new Set}:e}},props:{decorations(t){const{doc:e}=t,n=f_.getState(t);if(!n||0===n.activeNodeIds.size)return si.empty;const r=new Set;e.descendants(t=>{const e=t.attrs?.hookId;if(!e||!n.activeNodeIds.has(e))return!0;let o=!1;return t.descendants(t=>{if(o)return!1;const r=t.attrs?.hookId;return!r||r===e||!n.activeNodeIds.has(r)||(o=!0,!1)}),o&&r.add(e),!0});const o=[];return e.descendants((t,e)=>{const i=t.attrs?.hookId;i&&n.activeNodeIds.has(i)&&!r.has(i)&&o.push(ri.node(e,e+t.nodeSize,{class:"scanner-effect"}))}),si.create(e,o)}}})]}),m_=g_;class A_{constructor({editor:t,element:e,view:n,floatingOptions:r,shouldShow:o,domScaleGetter:i,canShowGetter:s}){this.floatingOptions={},this.getReferenceClientRect=null,this.stopAutoUpdate=null,this.shouldShow=({editor:t,state:e,from:n,to:r})=>{const{doc:o,selection:i}=e,{empty:s}=i;if(!1===t.isEditable)return!1;const a=!o.textBetween(n,r).length&&Cs(e.selection);if(s||a)return!1;let l=!1;return Ua(i)?l=i.node:Cs(i)&&(l=i.$anchor.parent),!(!l||!l.attrs.bubbleMenu)},this.mousedownHandler=t=>{t.preventDefault()},this.mouseupHandler=()=>{window.setTimeout(()=>this.update(this.editor.view,void 0))},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{window.setTimeout(()=>this.update(this.editor.view,void 0))},this.blurHandler=({event:t})=>{this.preventHide?this.preventHide=!1:t?.relatedTarget&&this.element.parentNode?.contains(t.relatedTarget)||this.hide()},this.preventHide=!1,this.editor=t,this.element=e,this.view=n,this.domScaleGetter=i??null,this.canShowGetter=s??null,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.element.addEventListener("mouseup",this.mouseupHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.element.style.visibility="visible",requestAnimationFrame(()=>{this.createTooltip(r)})}createTooltip(t={}){this.floatingOptions={placement:"top",...t},this.element.style.position="fixed",this.element.style.width="max-content",this.hide()}update(t,e){try{const{state:n,composing:r}=t,{doc:o,selection:i}=n,s=e&&e.doc.eq(o)&&e.selection.eq(i);if(r||s)return;const{ranges:a}=i,l=Math.min(...a.map(t=>t.$from.pos)),c=Math.max(...a.map(t=>t.$to.pos));if(!this.shouldShow({editor:this.editor,view:t,state:n,oldState:e,from:l,to:c})||!1===this.canShowGetter?.())return void this.hide();this.getReferenceClientRect=()=>{if(Ua(n.selection))try{const e=t.nodeDOM(l);if(e instanceof Element)return e.getBoundingClientRect()}catch(t){return console.error(`BubbleMenuView: Error getting node selection rect at position ${l}`,{selection:n.selection.toJSON(),error:t}),new DOMRect(0,0,0,0)}try{return Ja(t,l,c)}catch(t){return console.error(`BubbleMenuView: Error getting text selection rect from ${l} to ${c}`,{selection:n.selection.toJSON(),error:t}),new DOMRect(0,0,0,0)}},this.show()}catch(t){console.error("BubbleMenuView: Error updating bubble menu:",t),this.hide()}}async position(t){const e=[Pk(6),zk(),Fk({padding:8})];try{const{x:n,y:r,placement:o}=await Hk(t,this.element,{placement:this.floatingOptions.placement||"top",middleware:e,strategy:"fixed"});Object.assign(this.element.style,{left:`${n}px`,top:`${r}px`}),this.element.classList.toggle("arrow-top",o.startsWith("bottom"))}catch(t){console.error("Error positioning bubble menu:",t)}}show(){const t=this.getReferenceClientRect;if(!t)return;this.element.style.display="block";const e={getBoundingClientRect:t,contextElement:this.view.dom};this.stopAutoUpdate?.(),this.stopAutoUpdate=Rk(e,this.element,()=>{this.position(e)}),window.setTimeout(()=>this.element.classList.add("active"))}hide(){this.stopAutoUpdate?.(),this.stopAutoUpdate=null,this.element.style.display="none",this.element.classList.remove("active"),this.element.classList.remove("arrow-top")}destroy(){this.stopAutoUpdate?.(),this.stopAutoUpdate=null,this.element.removeEventListener("mousedown",this.mousedownHandler),this.element.removeEventListener("mouseup",this.mouseupHandler),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.domScaleGetter=null,this.canShowGetter=null,this.getReferenceClientRect=null}}const y_=["blockquote","bulletList","codeBlock","heading","orderedList","paragraph","title"],b_=Tl.create({name:"bubbleMenu",addOptions:()=>({element:null,targets:y_,floatingOptions:{placement:"top"},pluginKey:"bubbleMenu",shouldShow:null,domScaleGetter:null,canShowGetter:null}),addGlobalAttributes(){return[{types:this.options.targets,attributes:{bubbleMenu:{default:!0,keepOnSplit:!1,parseHTML:t=>t.getAttribute("data-bubble-menu"),renderHTML:t=>t.bubbleMenu?{"data-bubble-menu":!0}:{}}}}]},addProseMirrorPlugins(){return this.options.element?[(t={pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,floatingOptions:this.options.floatingOptions,shouldShow:this.options.shouldShow,domScaleGetter:this.options.domScaleGetter,canShowGetter:this.options.canShowGetter},new Ve({key:"string"==typeof t.pluginKey?new Je(t.pluginKey):t.pluginKey,view:e=>
1new A_({view:e,...t})}))]:[];var t}});var v_=class{constructor(t){let e=t.editor,n=t.element,r=t.view,o=t.pluginKey,i=void 0===o?"floatingMenu":o,s=t.updateDelay,a=void 0===s?250:s,l=t.resizeDelay,c=void 0===l?60:l,d=t.options,u=t.appendTo,h=t.shouldShow;var p;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=t=>{let e=t.view;const n=t.state.selection,r=n.$anchor,o=n.empty,i=1===r.depth,s=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent&&0===r.parent.childCount&&!this.getTextContent(r.parent);return!!(e.hasFocus()&&o&&i&&s&&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=(t,e,n,r)=>{t.composing||!e&&!n||(this.getShouldShow(r)?(this.updatePosition(),this.show()):this.hide())},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=t=>{let e=t.event;var n;this.preventHide?this.preventHide=!1:(null==e?void 0:e.relatedTarget)&&(null==(n=this.element.parentNode)?void 0:n.contains(e.relatedTarget))||(null==e?void 0:e.relatedTarget)!==this.editor.view.dom&&this.hide()},this.transactionHandler=t=>{const e=t.transaction.getMeta(this.pluginKey);"updatePosition"===e?this.updatePosition():e&&"object"==typeof e&&"updateOptions"===e.type?this.updateOptions(e.options):"hide"===e?this.hide():"show"===e&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=n,this.view=r,this.pluginKey=i,this.updateDelay=a,this.resizeDelay=c,this.appendTo=u,this.scrollTarget=null!=(p=null==d?void 0:d.scrollTarget)?p:window,this.floatingUIOptions={...this.floatingUIOptions,...d},this.element.tabIndex=0,h&&(this.shouldShow=h),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),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())}getTextContent(t){return Ia(t,{textSerializers:Na(this.editor.schema)})}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(zk("boolean"!=typeof this.floatingUIOptions.flip?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(Fk("boolean"!=typeof this.floatingUIOptions.shift?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(Pk("boolean"!=typeof this.floatingUIOptions.offset?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push({name:"arrow",options:e=this.floatingUIOptions.arrow,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=_w(e,t)||{};if(null==c)return{};const u=Uw(d),h={x:n,y:r},p=Bw(o),f=Nw(p),g=await s.getDimensions(c),m="y"===p,A=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",v=i.reference[f]+i.reference[p]-h[p]-i.floating[f],w=h[p]-i.reference[p],k=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let C=k?k[b]:0;C&&await(null==s.isElement?void 0:s.isElement(k))||(C=a.floating[b]||i.floating[f]);const x=v/2-w/2,S=C/2-g[f]/2-1,E=kw(u[A],S),M=kw(u[y],S),T=C-g[f]-M,_=C/2-g[f]/2+x,D=Tw(E,_,T),O=!l.arrow&&null!=Ow(o)&&_!==D&&i.reference[f]/2-(_<E?E:M)-g[f]/2<0,I=O?_<E?_-E:_-T:0;return{[p]:h[p]+I,data:{[p]:D,centerOffset:_-D-I,...O&&{alignmentOffset:I}},reset:O}}}),this.floatingUIOptions.size&&t.push(function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:o,elements:i}=e,{apply:s=()=>{},...a}=_w(t,e),l=await o.detectOverflow(e,a),c=Dw(n),d=Ow(n),u="y"===Lw(n),{width:h,height:p}=r.floating;let f,g;"top"===c||"bottom"===c?(f=c,g=d===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(g=c,f="end"===d?"top":"bottom");const m=p-l.top-l.bottom,A=h-l.left-l.right,y=kw(p-l[f],m),b=kw(h-l[g],A),v=e.middlewareData.shift,w=!v;let k=y,C=b;null!=v&&v.enabled.x&&(C=A),null!=v&&v.enabled.y&&(k=m),w&&!d&&(u?C=h-2*Cw(l.left,l.right):k=p-2*Cw(l.top,l.bottom)),await s({...e,availableWidth:C,availableHeight:k});const x=await o.getDimensions(i.floating);return h!==x.width||p!==x.height?{reset:{rects:!0}}:{}}}}("boolean"!=typeof this.floatingUIOptions.size?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,r,o;const{rects:i,middlewareData:s,placement:a,platform:l,elements:c}=e,{crossAxis:d=!1,alignment:u,allowedPlacements:h=ww,autoAlignment:p=!0,...f}=_w(t,e),g=void 0!==u||h===ww?function(t,e,n){return(t?[...n.filter(e=>Ow(e)===t),...n.filter(e=>Ow(e)!==t)]:n.filter(t=>Dw(t)===t)).filter(n=>!t||Ow(n)===t||!!e&&Rw(n)!==n)}(u||null,p,h):h,m=(null==(n=s.autoPlacement)?void 0:n.index)||0,A=g[m];
1if(null==A)return{};if(a!==A)return{reset:{placement:g[0]}};const y=await l.detectOverflow(e,f),b=$w(A,i,await(null==l.isRTL?void 0:l.isRTL(c.floating))),v=[y[Dw(A)],y[b[0]],y[b[1]]],w=[...(null==(r=s.autoPlacement)?void 0:r.overflows)||[],{placement:A,overflows:v}],k=g[m+1];if(k)return{data:{index:m+1,overflows:w},reset:{placement:k}};const C=w.map(t=>{const e=Ow(t.placement);return[t.placement,e&&d?t.overflows.slice(0,2).reduce((t,e)=>t+e,0):t.overflows[0],t.overflows]}).sort((t,e)=>t[1]-e[1]),x=(null==(o=C.filter(t=>t[2].slice(0,Ow(t[0])?2:3).every(t=>t<=0))[0])?void 0:o[0])||C[0][0];return x!==a?{data:{index:m+1,overflows:w},reset:{placement:x}}:{}}}}("boolean"!=typeof this.floatingUIOptions.autoPlacement?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:o="referenceHidden",...i}=_w(t,e);switch(o){case"referenceHidden":{const t=Jw(await r.detectOverflow(e,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:Gw(t)}}}case"escaped":{const t=Jw(await r.detectOverflow(e,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:t,escaped:Gw(t)}}}default:return{}}}}}("boolean"!=typeof this.floatingUIOptions.hide?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:r,rects:o,platform:i,strategy:s}=e,{padding:a=2,x:l,y:c}=_w(t,e),d=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(r.reference))||[]);if(!d.length)return{};const u=function(t){const e=t.slice().sort((t,e)=>t.y-e.y),n=[];let r=null;for(let t=0;t<e.length;t++){const o=e[t];!r||o.y-r.y>r.height/2?n.push([o]):n[n.length-1].push(o),r=o}return n.map(t=>Vw(Kw(t)))}(d),h=Vw(Kw(d)),p=Uw(a),f=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&(u[0].left>u[1].right||u[1].left>u[0].right)&&null!=l&&null!=c)return u.find(t=>l>t.left-p.left&&l<t.right+p.right&&c>t.top-p.top&&c<t.bottom+p.bottom)||h;if(u.length>=2){if("y"===Lw(n)){const t=u[0],e=u[u.length-1],r="top"===Dw(n),o=t.top,i=e.bottom,s=r?t.left:e.left;return Vw({x:s,y:o,width:(r?t.right:e.right)-s,height:i-o})}const t="left"===Dw(n),e=Cw(...u.map(t=>t.right)),r=kw(...u.map(t=>t.left)),o=u.filter(n=>t?n.left===r:n.right===e),i=o[0].top,s=o[o.length-1].bottom;return Vw({x:r,y:i,width:e-r,height:s-i})}return h}},floating:r.floating,strategy:s});return o.reference.x!==f.reference.x||o.reference.y!==f.reference.y||o.reference.width!==f.reference.width||o.reference.height!==f.reference.height?{reset:{rects:f}}:{}}}}("boolean"!=typeof this.floatingUIOptions.inline?this.floatingUIOptions.inline:void 0)),t;var e}getShouldShow(t){var e;const n=this.view.state,r=n.selection.ranges,o=Math.min(...r.map(t=>t.$from.pos)),i=Math.max(...r.map(t=>t.$to.pos));return null==(e=this.shouldShow)?void 0:e.call(this,{editor:this.editor,view:this.view,state:n,oldState:t,from:o,to:i})}updateOptions(t){var e;if(void 0!==t.updateDelay&&(this.updateDelay=t.updateDelay),void 0!==t.resizeDelay&&(this.resizeDelay=t.resizeDelay),void 0!==t.appendTo&&(this.appendTo=t.appendTo),void 0!==t.shouldShow&&t.shouldShow&&(this.shouldShow=t.shouldShow),void 0!==t.options){const n=null!=(e=t.options.scrollTarget)?e:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...t.options}}}updatePosition(){const t=this.editor.state.selection,e=Ja(this.view,t.from,t.to);Hk({getBoundingClientRect:()=>e,getClientRects:()=>[e]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(t=>{let e=t.x,n=t.y,r=t.strategy,o=t.middlewareData;var i,s;(null==(i=o.hide)?void 0:i.referenceHidden)||(null==(s=o.hide)?void 0:s.escaped)?this.element.style.visibility="hidden":(this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=r,this.element.style.left=`${e}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate())})}update(t,e){const n=!(null==e?void 0:e.selection.eq(t.state.selection)),r
1=!(null==e?void 0:e.doc.eq(t.state.doc));this.updateHandler(t,n,r,e)}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e="function"==typeof this.appendTo?this.appendTo():this.appendTo;null==(t=null!=e?e:this.view.dom.parentElement)||t.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}),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()}},w_=Tl.create({name:"floatingMenu",addOptions:()=>({element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}),addCommands(){return{updateFloatingMenuPosition:()=>t=>{let e=t.tr;return t.dispatch&&e.setMeta(this.options.pluginKey,"updatePosition"),!0}}},addProseMirrorPlugins(){return this.options.element?[(t={pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow},new Ve({key:"string"==typeof t.pluginKey?new Je(t.pluginKey):t.pluginKey,view:e=>new v_({view:e,...t})}))]:[];var t}});function k_(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(t=>e?.includes(t.type.name));t.tr.ensureMarks(r)}}w_.extend({});const C_=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:a,$to:l}=i,c=yE(o.extensionManager.attributes,a.node().type.name,a.node().attrs);if(i instanceof Oe&&i.node.isBlock)return!(!a.parentOffset||!re(s,a.pos)||(r&&(t&&k_(n,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),0));if(!a.parent.isBlock)return!1;if(r){const r=0===a.parentOffset,s=l.parentOffset===l.parent.content.size,d=r&&!s;i instanceof _e&&e.deleteSelection();const u=0===a.depth?void 0:function(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.node(-1).contentMatchAt(a.indexAfter(-1)));let h=!d&&u?[{type:u,attrs:c}]:void 0,p=re(e.doc,e.mapping.map(a.pos),1,h);if(h||p||!re(e.doc,e.mapping.map(a.pos),1,u?[{type:u}]:void 0)||(p=!0,h=u?[{type:u,attrs:c}]:void 0),p){try{e.split(e.mapping.map(a.pos),1,h)}catch(t){console.error("Error splitting block",t,h,a.pos),console.log("tr.mapping",e.mapping)}if(u&&d&&(a.parent.type!==u||a.parent.attrs!==c)){const t=e.mapping.map(a.before()),n=e.doc.resolve(t);a.node(-1).canReplaceWith(n.index(),n.index()+1,u)&&e.setNodeMarkup(t,u,c)}}t&&k_(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return!0},x_=Tl.create({name:"keymapEnter",addCommands:()=>({splitBlockImproved:C_}),addKeyboardShortcuts(){const t=()=>xA(this.editor,t=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlockImproved()]);return{Enter:t,"Shift-Enter":t}}}),S_=Tl.create({name:"KeymapTab",addCommands:()=>({splitBlockImproved:C_}),addKeyboardShortcuts(){return{Tab:()=>xA(this.editor,t=>[()=>t.insertContent("\t")])}}});function E_(){return E_.c||(E_.c=n.n(r()))}function M_(){return M_.c||(M_.c=n.n(a()))}function T_(){return T_.c||(T_.c=n.n(o()))}function __(){return __.c||(__.c=n.n(s()))}function D_(){return D_.c||(D_.c=n.n(i()))}function O_(){return O_.c||(O_.c=n.n(l()))}r(),a(),o(),s(),i(),l();var I_=n(6287),N_={};N_.styleTagTransform=O_()(),N_.setAttributes=__()(),N_.insert=T_()().bind(null,"head"),N_.domAPI=M_()(),N_.insertStyleElement=D_()(),E_()()(I_.A,N_),I_.A&&I_.A.locals&&I_.A.locals;class L_{constructor(t){this._state=t}hasCoreState(){return!!this._state}hasCoreDoc(){return!(!this._state||!this._state.doc)}getCoreDoc(){return this._state&&this._state.doc}getDoc(){return this.hasCoreDoc()?new vT(this.getCoreDoc()):null}getSelection(){return this._state&&this._state.selection?new R_(this._state.selection):null}}
1class B_{constructor(t,e,n,r,o){this._additions=t,this._deletions=e,this._updates=n,this._nodesWithDescendantAdditions=r,this._nodesWithDescendantDeletions=o}getAdditions(){return this._additions}getDeletions(){return this._deletions}getUpdates(){return this._updates}getDescendantAdditions(){return this._nodesWithDescendantAdditions}getDescendantDeletions(){return this._nodesWithDescendantDeletions}toString(){return JSON.stringify({additions:this._additions.map(t=>t.toJson()),deletions:this._deletions.map(t=>t.toJson()),updates:this._updates.map(t=>t.toJson()),nodesWithDescendantAdditions:this._nodesWithDescendantAdditions.map(t=>t.toJson()),nodesWithDescendantDeletions:this._nodesWithDescendantDeletions.map(t=>t.toJson())},null,2)}}class $_{constructor(t){this._tr=t}isFromServer(){return!0===this._tr?.getMeta("y-sync$")?.isChangeOrigin&&!1===this._tr?.getMeta("y-sync$")?.isUndoRedoOperation}isValid(){return!!this._tr}hasChanges(){return!(!this._tr||!this._tr.docChanged)}_removeDuplicates(t){const e=[],n={};return t.forEach(t=>{n[t.getId()]||(n[t.getId()]=!0,e.push(t))}),e}getChanges(t=!1){if(!this.isValid()||!this.hasChanges())return new B_([],[],[],[],[]);const e=[],n={},r=[],o={};Ba(this._tr).forEach(({oldRange:t,newRange:i})=>{this._tr.before.nodesBetween(t.from,t.to,(t,r,o,i)=>{let s=new vT(t),a=s.getId();return a&&!n[a]&&(n[a]={node:s,position:r,descendantsCount:s.getDescendants().length},e.push(a)),!0}),this._tr.doc.nodesBetween(i.from,i.to,(t,e,n,i)=>{const s=new vT(t),a=s.getId();return a&&!o[a]&&(o[a]={node:s,position:e,descendantsCount:s.getDescendants().length},r.push(a)),!0})});let i=[],s=[],a=[],l=[],c=[];if(e.forEach(t=>{o[t]||i.push(n[t].node)}),r.forEach(t=>{const e=o[t].node;n[t]?(a.push(e),n[t].descendantsCount>o[t].descendantsCount?l.push(e):n[t].descendantsCount<o[t].descendantsCount&&c.push(e)):s.push(e)}),t)try{i.forEach(t=>{const e=n[t.getId()].position;if(e<this._tr.doc.content.size){const t=this._tr.doc.nodeAt(e);t&&a.push(new vT(t))}else{const t=this._tr.doc.lastChild;t&&a.push(new vT(t))}})}catch(t){console.error("[ERROR] Failed to include the node before the deleted node:",t)}return i=this._removeDuplicates(i),s=this._removeDuplicates(s),a=this._removeDuplicates(a),l=this._removeDuplicates(l),c=this._removeDuplicates(c),new B_(s,i,a,c,l)}getSlashCommand(){if(!this.isValid())return null;if(!this._tr.docChanged||!this._tr.selection.empty)return null;const t=this._tr.selection.$from,e=t.nodeBefore;if(!e||!e.isText)return null;if("/"===e.text.trim()){const n=[];return this._tr.steps.forEach(t=>{n.push(t.invert(this._tr.before))}),{name:"slash",node:e,position:t.pos,steps:n}}return null}getMeta(t){return this.isValid()?this._tr.getMeta(t):null}getStepsLength(){return this._tr.steps.length||0}toString(){return this.isValid()?this._tr.toString():""}}class R_{constructor(t){this._selection=t}isValid(){return!!this._selection}isEmpty(){return!(!this._selection||!this._selection.empty)}getNode(){if(!this.isValid())return null;if(!Cs(this._selection))return null;const t=this._selection.$cursor;if(!t)return null;const e=t.parent;return e?new vT(e):null}getPosition(){if(!this.isValid())return null;if(!Cs(this._selection))return null;const t=this._selection.$cursor;return t?t.pos:null}toString(){return this.isValid()?this._selection.toString():""}}class P_{constructor(t,e,n){this._position=t,this._coreNode=e,this._coreDom=n}getPosition(){return this._position||console.warn("EditorViewNode.getPosition() called without position"),this._position||0}getFirstTextCharacterPosition(){try{if(this._coreNode&&this._coreNode.content.content){let t=this._position||0;for(let e=0;e<this._coreNode.content.content.length;e++){const n=this._coreNode.content.content[e];if(n&&n.isText&&(n.text?.length??0)>0)return t+1;n&&(t+=n.nodeSize)}}}catch(t){console.error("Error while getting first text character position",t)}return this.getPosition()}getSize(){return this._coreNode?this._coreNode.nodeSize:0}hasCoreNode(){return!!this._coreNode}getCoreNode(){return this._coreNode}getNode(){return new vT(this._coreNode)}hasCoreDom(){return!!this._coreDom}getDom(){return this._coreDom}}const F_=class{constructor(t){this._coreView=t}hasCoreView(){return!!this._coreView}hasCoreState(){return!(!this._coreView||!this._coreView.state)}getCoreState(){return this._coreView&&this._coreView.state}getDOM(){return this._coreView&&this._coreView.dom}getState(){return this.hasCoreState()?new L_(this.getCoreState()):null}getRoot(){return this.hasCoreState()&&this._coreView.dom?new P_(0,this._coreView.state.doc,this._coreView.dom):null}getChildren(t){const e=[];
1if(this.hasCoreState()){let n=0,r=this._coreView.state.doc;t&&t.hasCoreNode()&&(n=t.getPosition(),r=t.getCoreNode()),r.content.forEach((t,r)=>{const o=n+r+1,i=this._coreView.nodeDOM(o);e.push(new P_(o,t,i))})}return e}getDescendants(t){const e=[];if(this.hasCoreState()){let n=this._coreView.state.doc;t&&t.hasCoreNode()&&(n=t.getCoreNode()),n.content.descendants((t,n)=>{const r=this._coreView.nodeDOM(n);return e.push(new P_(n,t,r)),!0})}return e}walk(t){this.hasCoreState()&&this._coreView.state.doc.content.descendants((e,n,r,o)=>{const i=this._coreView.nodeDOM(n);return t(new P_(n,e,i),null!=r?new vT(r):null,o),!0})}domElementAtPos(t,e=[]){if(this.hasCoreView()){let n=this._coreView.domAtPos(t).node;if(!n)return null;const r=e.map(t=>t.toUpperCase());if(r.length&&!r.includes(n.nodeName))for(;n&&!r.includes(n.nodeName);)n=n.parentNode;return n}return null}};function z_(t,e){return new H_(V_,J_,{maxSize:e}).serialize(t)}class H_{constructor(t,e,n){this.nodes=t,this.marks=e,this.options=n}serialize(t,e={}){e=Object.assign({},this.options,e);const n=new U_(this.nodes,this.marks,e);return n.renderContent(t),null!=e.maxSize?j_(n.out,e.maxSize):n.out}serializeBefore(t,e={}){e=Object.assign({},this.options,e);const n={};t.descendants(t=>("heading"===t.type.name&&(n[t.attrs.level]=t),!0)),e.headings=n;const r=new U_(this.nodes,this.marks,e);return r.renderContent(t),null!=e.maxSize?j_(r.out,e.maxSize):r.out}serializeAfter(t,e={}){e=Object.assign({},this.options,e);const n=new U_(this.nodes,this.marks,e);return n.renderContent(t),null!=e.maxSize?j_(n.out,e.maxSize):n.out}}function j_(t,e){if(t.length<=e)return t;let n=t.slice(0,e),r=n.lastIndexOf("\n");return-1!==r?n.slice(0,r):n}class U_{constructor(t,e,n){this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,this.nodes=t,this.marks=e,this.options=n,void 0===this.options.tightLists&&(this.options.tightLists=!1),void 0===this.options.hardBreakNodeName&&(this.options.hardBreakNodeName="hard_break"),void 0===this.options.skipEmptyBlocks&&(this.options.skipEmptyBlocks=!1)}flushClose(t=2){if(this.closed){if(this.atBlank()||(this.out+="\n"),t>1){let e=this.delim,n=/\s+$/.exec(e);n&&(e=e.slice(0,e.length-n[0].length));for(let n=1;n<t;n++)this.out+=e}this.closed=null}}wrapBlock(t,e,n,r){let o=this.delim;this.write(null!=e?e:t),this.delim+=t,r(),this.delim=o,this.closeBlock(n)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+="\n")}write(t){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),t&&(this.out+=t)}closeBlock(t){this.closed=t}text(t,e=!0){let n=t.split("\n");for(let t=0;t<n.length;t++)this.write(),!e&&"["==n[t][0]&&/(^|[^\\])\!$/.test(this.out)&&(this.out=this.out.slice(0,this.out.length-1)+"\\!"),this.out+=e?this.esc(n[t],this.atBlockStart):n[t],t!=n.length-1&&(this.out+="\n")}render(t,e,n){if(!this.nodes[t.type.name])throw new Error("Token type `"+t.type.name+"` not supported by Markdown renderer");this.nodes[t.type.name](this,t,e,n)}renderContent(t){t.forEach((e,n,r)=>{this.render(e,t,r)})}renderInline(t){this.atBlockStart=!0;let e=[],n="";const r=(r,o,i)=>{let s=r?[...r.marks]:[];r&&r.type.name===this.options.hardBreakNodeName&&(s=s.filter(e=>{if(i+1==t.childCount)return!1;let n=t.child(i+1);return e.isInSet(n.marks)&&(!n.isText||/\S/.test(n.text??""))}));let a=n;if(n="",r&&r.isText&&s.some(t=>{let n=this.marks[t.type.name];return n&&n.expelEnclosingWhitespace&&!t.isInSet(e)})){const t=/^(\s*)(.*)$/m.exec(r.text??"");if(t){const[,n,o]=t;n&&(a+=n,(r=o?r.withText(o):null)||(s=e))}}if(r&&r.isText&&s.some(e=>{let n=this.marks[e.type.name];return n&&n.expelEnclosingWhitespace&&(i==t.childCount-1||!e.isInSet(t.child(i+1).marks))})){const t=/^(.*?)(\s*)$/m.exec(r.text??"");if(t){const[,o,i]=t;i&&(n=i,(r=o?r.withText(o):null)||(s=e))}}let l=s.length?s[s.length-1]:null,c=null!=l&&!1===this.marks[l.type.name].escape,d=s.length-(c?1:0);t:for(let t=0;t<d;t++){let n=s[t];if(!this.marks[n.type.name].mixable)break;for(let r=0;r<e.length;r++){let o=e[r];if(!this.marks[o.type.name].mixable)break;
1if(n.eq(o)){t>r?s=s.slice(0,r).concat(n).concat(s.slice(r,t)).concat(s.slice(t+1,d)):r>t&&(s=s.slice(0,t).concat(s.slice(t+1,r)).concat(n).concat(s.slice(r,d)));continue t}}}let u=0;for(;u<Math.min(e.length,d)&&s[u].eq(e[u]);)++u;for(;u<e.length;){const n=e.pop();n&&this.text(this.markString(n,!1,t,i),!1)}if(a&&this.text(a),r){for(;e.length<d;){let n=s[e.length];e.push(n),this.text(this.markString(n,!0,t,i),!1),this.atBlockStart=!1}c&&r.isText&&null!=l?this.text(this.markString(l,!0,t,i)+r.text+this.markString(l,!1,t,i+1),!1):this.render(r,t,i),this.atBlockStart=!1}r&&r.isText&&r.nodeSize>0&&(this.atBlockStart=!1)};t.forEach(r),r(null,0,t.childCount),this.atBlockStart=!1}renderList(t,e,n){this.closed&&this.closed.type==t.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let r=void 0!==t.attrs.tight?t.attrs.tight:this.options.tightLists,o=this.inTightList;this.inTightList=r,t.forEach((o,i,s)=>{s&&r&&this.flushClose(1),this.wrapBlock(e,n(s),t,()=>this.render(o,t,s))}),this.inTightList=o}esc(t,e=!1){return t=t.replace(/[`*\\~\[\]_]/g,(e,n)=>"_"==e&&n>0&&n+1<t.length&&t[n-1].match(/\w/)&&t[n+1].match(/\w/)?e:"\\"+e),e&&(t=t.replace(/^[\-*+>]/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(t=t.replace(this.options.escapeExtraCharacters,"\\$&")),t}quote(t){let e=-1==t.indexOf('"')?'""':-1==t.indexOf("'")?"''":"()";return e[0]+t+e[1]}repeat(t,e){let n="";for(let r=0;r<e;r++)n+=t;return n}markString(t,e,n,r){let o=this.marks[t.type.name],i=e?o.open:o.close;return"string"==typeof i?i:i(this,t,n,r)}getEnclosingWhitespace(t){return{leading:(t.match(/^(\s+)/)||[void 0])[0],trailing:(t.match(/(\s+)$/)||[void 0])[0]}}containsTextNode(t){let e=!1;return t.descendants(t=>(e=e||t.isText,!e)),e}}const V_={title(t,e){t.write("# "),t.renderInline(e),t.closeBlock(e)},heading(t,e){t.write(t.repeat("#",e.attrs.level+1)+" "),t.renderInline(e),t.closeBlock(e)},blockquote(t,e){t.wrapBlock("> ",null,e,()=>t.renderContent(e))},codeBlock(t,e){if(t.options.skipEmptyBlocks&&!t.containsTextNode(e))return;const n=e.textContent.match(/`{3,}/gm),r=n?n.sort().slice(-1)[0]+"`":"```";t.write(r+(e.attrs.params||"")+"\n"),t.text(e.textContent,!1),t.write("\n"),t.write(r),t.closeBlock(e)},bulletList(t,e){t.options.skipEmptyBlocks&&!t.containsTextNode(e)||t.renderList(e,"  ",()=>(e.attrs.bullet||"*")+" ")},orderedList(t,e){if(t.options.skipEmptyBlocks&&!t.containsTextNode(e))return;let n=e.attrs.order||1,r=String(n+e.childCount-1).length,o=t.repeat(" ",r+2);t.renderList(e,o,e=>{let o=String(n+e);return t.repeat(" ",r-o.length)+o+". "})},listItem(t,e){t.renderContent(e)},paragraph(t,e){t.renderInline(e),t.closeBlock(e)},hardBreak(t,e,n,r){if(null!=n&&null!=r)for(let o=r+1;o<n.childCount;o++)if(n.child(o).type!=e.type)return void t.write("\n")},text(t,e){t.text(e.text??"",!t.inAutolink)},spacer(t,e){t.write("\n\n")},themeFrame(t,e){if("placeholder"===e.attrs?.state){const n="string"==typeof e.attrs?.text?e.attrs.text:"";n&&t.text(n,!0),t.closeBlock(e)}},table(t,e){if(t.options.skipEmptyBlocks&&!t.containsTextNode(e))return;let n="tableHeader"===e.firstChild?.child?.(0)?.type?.name;const r=e.content.content;for(let e=0;e<r.length;e++){let o=r[e];t.write("|"),t.render(o),t.write("\n"),0===e&&n&&t.write(`|${Array(o.childCount).fill(" --- ").join("|")}|\n`)}t.write("\n")},tableRow(t,e){t.renderInline(e)},tableHeader(t,e){const n=e.textContent?.replace(/\n/g," ").trim();null!=n&&t.write(` ${n}`),t.write(" |")},tableCell(t,e){const n=e.textContent?.replace(/\n/g," ").trim();null!=n&&t.write(` ${n}`),t.write(" |")}},q_={...V_,title(){},heading(t,e){null!=t.options.headingLevel&&e.attrs.level>t.options.headingLevel||(V_.heading(t,e),t.options.headingLevel=e.attrs.level)},blockquote(){},codeBlock(){},bulletList(){},orderedList(){},paragraph(){},hardBreak(){},spacer(){},themeFrame(){},table(){},tableRow(){},tableHeader(){},tableCell(){}},W_={...V_,title(){},heading(t,e){const n=t.options.headings??{};n[e.attrs.level]===e&&(n[e.attrs.level]=null,t.options.headings=n),null==n[e.attrs.level-1]&&V_.heading(t,e)},blockquote(){},codeBlock(){},bulletList(){},orderedList(){},paragraph(){},hardBreak(){},spacer(){},themeFrame(){},table(){},tableRow(){},tableHeader(){},tableCell(){}},J_={em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},italic:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},bold:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},anchorMark:{open:()=>"",close:()=>"",mixable:!0,expelEnclosingWhitespace:!1},strike:{open:"",close:"",mixable:!0,expelEnclosingWhitespace:!1},underline:{open:"",close:"",mixable:!0,expelEnclosingWhitespace:!1},inlineHookMark:{open:"",close:"",mixable:!0,expelEnclosingWhitespace:!1},link:{open:(t,e,n,r)=>(t.inAutolink=function(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||n!=e.childCount-1&&t.isInSet(e.child(n+1).marks))}(e,n,r),t.inAutolink?"<":"["),close(t,e,n,r){let{inAutolink:o}=t;if(t.inAutolink=void 0,o)return">";let i=e.attrs.href?String(e.attrs.href):"",s=e.attrs.title?String(e.attrs.title):"",a="](";return i&&(a+=i.replace(/[\(\)"]/g,"\\$&")),s&&(a+=' "'+s.replace(/"/g,'\\"')+'"'),a+=")",a},mixable:!0},code:{open:(t,e,n,r)=>Y_(n.child(r),-1),close:(t,e,n,r)=>Y_(n.child(r-1),1),escape:!1}},G_={...J_,strike:{open:"<s>",close:"</s>",mixable:!0,expelEnclosingWhitespace:!0},underline:{open:"<u>",close:"</u>",mixable:!0,expelEnclosingWhitespace:!0}};function K_(t,e){return new H_(V_,G_,{maxSize:e}).serialize(t)}function Y_(t,e){let n,r=/`+/g,o=0;if(t.isText)for(;n=r.exec(t.text??"");)o=Math.max(o,n[0].length);let i=o>0&&e>0?" `":"`";for(let t=0;t<o;t++)i+="`";return o>0&&e<0&&(i+=" "),i}const Q_=t=>t.type.name===_T&&t.attrs?.state===BT,Z_=Rv({html:!0,breaks:!0,linkify:!0}),X_=new Set(["P","BR","SPAN","A","CODE","STRONG","B","EM","I","S","DEL","STRIKE","U","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","LI","PRE","TABLE","THEAD","TBODY","TR","TH","TD"]),tD=new Set(["HR","IMG","META","LINK","BASE","INPUT","AREA"]),eD={A:new Set(["href","target","rel","title"])},nD=/^(https?:|mailto:|tel:|#|\/(?!\/)|\.)/i;function rD(t){const e=(new DOMParser).parseFromString(`<body>${t}</body>`,"text/html"),n=t=>{const e=Array.from(t.children);for(const r of e)if(n(r),X_.has(r.tagName))oD(r);else if(tD.has(r.tagName))r.remove();else{for(;r.firstChild;)t.insertBefore(r.firstChild,r);r.remove()}};return n(e.body),e.body.innerHTML}function oD(t){const e=eD[t.tagName]??new Set;for(const n of Array.from(t.attributes))e.has(n.name)||t.removeAttribute(n.name);if("A"===t.tagName){const e=t.getAttribute("href");null==e||nD.test(e.trim())||t.removeAttribute("href"),"_blank"===t.getAttribute("target")&&t.setAttribute("rel","noopener noreferrer")}}const iD=[_T];class sD{constructor(t,e,n,r,o,i,s,a=!1,l=!1){this.element=t,this.editable=n,this.titlePlaceholder=r,this.domScaleGetter=o,this.enableRightToLeft=i,this.enableTables=s,this.enableDragReorder=a,this.enableHeadingIcons=l,this.content="string"==typeof e?e?JSON.parse(e):null:e||null}}class aD{constructor(t,e){this.element=t,this.canShowGetter=e}}class lD{constructor(t,e){this.hookId=t,this.offset=e}getHookId(){return this.hookId||console.warn("[getHookId] hookId is not set"),this.hookId||""}getOffset(){return null==this.offset&&console.warn("[getOffset] offset is not set"),this.offset||0}}class cD{constructor(t,e,n,r=0){this.from=t,this.to=e,this.lineHeight=n,this.yoffset=r}getFrom(){return this.from}getTo(){return this.to}getLineHeight(){return this.lineHeight}getYOffset(){return this.yoffset}}class dD{constructor(t,e){this.from=t,this.to=e}setEmpty(){return this.to=this.from,this.isEmpty()}getFrom(){return null==this.from&&console.warn("[getFrom] from is not set"),this.from}getTo(){return null==this.to&&console.warn("[getTo] to is not set"),this.to}isEmpty(){return this.from==this.to}}class uD{constructor(t,e,n=null,r){this.contentOptions=t,this.bubbleMenuOptions=e,this._renderCheckErrorLogged=!1,this._selectable=!0,this._dragReorderEnabled=!0===this.contentOptions.enableDragReorder&&!0===this.contentOptions.editable,this._pasteEnabled=!0===this.contentOptions.editable,this._dropContentEnabled=!0===this.contentOptions.editable,this.yjsProvider=n,this._createEditor(r),window.isEditable=()=>this.editor.isEditable,window.napkinThemeFrameInsert=(t=BT,e=null,n=!0,r=0,o=0)=>{const i=this.editor.state.selection.anchor;return this.insertThemeFrameAt(i,t,o,n,r,e)},this.contentOptions.enableHeadingIcons&&this.enableHeadingIcons(),this._applyDragReorderDomState()}_createEditor(t){const e=e=>t[e]?(...n)=>t[e](...n):null,n={onHeadingIconClick:e("onHeadingIconClick"),onHeadingIconDelete:e("onHeadingIconDelete"),onHeadingHover:e("onHeadingHover"),onIconNeedsLoading:e("onIconNeedsLoading")},r={element:this.contentOptions.element,enableCoreExtensions:{textDirection:!1},extensions:[x_,S_,_A.configure({domScaleGetter:this.contentOptions.domScaleGetter}),rT.configure({placeholder:this.contentOptions.titlePlaceholder,contentOptions:this.contentOptions,canPasteGetter:()=>this._pasteEnabled&&!0===this.editor?.isEditable,...n,onTitleDefocus:e("onTitleDefocus")}),...jM(this.contentOptions,n),Pc,kT,JT.configure({enableDragReorder:!0===this.contentOptions.enableDragReorder,canDragReorderGetter:()=>this._dragReorderEnabled,onPlaceholderClick:e=>{t.onThemeFramePlaceholderClick&&t.onThemeFramePlaceholderClick(e)}}),sT.configure({onlyOnShiftKey:!0,canPasteGetter:()=>this._pasteEnabled&&!0===this.editor?.isEditable,onPasteHandler:e=>{t.onPaste&&t.onPaste(e)},onTablePasteHandler:(e,n,r)=>{t.onTablePaste&&t.onTablePaste({hasTableNodes:r.hasTable,tablesSupported:!0===this.contentOptions.enableTables,rows:r.rows,cols:r.cols,cellSizes:r.cellSizes})}}),hT.configure({onLinkClick:e=>{t.onLinkClick&&t.onLinkClick(e)}}),cT.configure({enableDragReorder:!0===this.contentOptions.enableDragReorder,canDragReorderGetter:()=>this._dragReorderEnabled,onDragActiveChanged:e=>{t.onDragActiveChanged&&t.onDragActiveChanged(e)}}),...this.contentOptions.enableDragReorder?[$c.configure({color:"#7c3aed",width:2})]:[],Rc.configure({className:"has-focus"}),b_.configure({element:this.bubbleMenuOptions.element,domScaleGetter:this.contentOptions.domScaleGetter,canShowGetter:this.bubbleMenuOptions.canShowGetter}),p_.configure({onMarkUpdate:e=>{t.onAnchorMarkUpdate&&t.onAnchorMarkUpdate(e)},onMarkDeletion:e=>{t.onAnchorMarkDeletion&&t.onAnchorMarkDeletion(e)},onMouseEnter:(e,n)=>{t.onAnchorMarkMouseEnter&&t.onAnchorMarkMouseEnter(e,n)},onMouseLeave:(e,n)=>{t.onAnchorMarkMouseLeave&&t.onAnchorMarkMouseLeave(e,n)},onSelectionEnter:(e,n)=>{t.onAnchorMarkSelectionEnter&&t.onAnchorMarkSelectionEnter(e,n)},onSelectionLeave:(e,n)=>{t.onAnchorMarkSelectionLeave&&t.onAnchorMarkSelectionLeave(e,n)}}),hw.configure({canPasteGetter:()=>this._pasteEnabled&&!0===this.editor?.isEditable,canDropContentGetter:()=>this._dropContentEnabled&&!0===this.editor?.isEditable,onTransaction:e=>{t.onTransaction&&t.onTransaction(new $_(e))}}),Aw.configure({canPasteGetter:()=>this._pasteEnabled&&!0===this.editor?.isEditable,canDropContentGetter:()=>this._dropContentEnabled&&!0===this.editor?.isEditable,onTransaction:e=>{t.onTransaction&&t.onTransaction(new $_(e))}}),yw,QT,dT,m_],content:this.yjsProvider?"":this.contentOptions.content||"",editable:!1!==this.contentOptions.editable,autofocus:!1,editorProps:{clipboardTextParser:YT,transformPastedText:WM,transformPastedHTML:JM,handleDOMEvents:{paste:(t,e)=>this._handlePasteGuard(e),drop:(t,e)=>this._handleDropGuard(e)},attributes:{class:"text-editor-content-inner"}},onCreate:e=>{const n=t.onCreate;this.editor.view?(console.debug("TipTap : [onCreate] editor is already created"),n()):(console.debug("TipTap : [onCreate] waiting for editor to be created"),this.editor.on("create",({editor:t})=>{console.debug("TipTap : [onCreate] editor is created"),n()}))},onFocus:e=>{t.onFocus()},onBlur:e=>{t.onBlur()},onUpdate:({transaction:e})=>{t.onUpdate(new $_(e))},onSelectionUpdate:({editor:e,transaction:n})=>{const r=this.getSelectionCoordinatePairs();if(r&&r.length>0){const t=new CustomEvent("selectionUpdated",{detail:r});document.dispatchEvent(t)}t.onSelectionUpdate(new $_(n))},onTransaction:({editor:e,transaction:n})=>{t.onTransaction(new $_(n))}};this.yjsProvider?r.extensions.push(uA.configure({document:this.yjsProvider.document})):r.extensions.push(iT),this.editor=new Hl(r)}destroy(){this.editor?.destroy?.(),this.editor=null,this.bubbleMenuOptions=null,lC(),Uk.clear(),Vk.clear(),qk.clear(),sC=null,iC=null}getDom(){return this.editor.view.dom}getTitle(){return function(t){if(!t)return"";const e=t.state.doc.nodeAt(0);return e&&e.type.name==nT.name?e.textContent:""}(this.editor)}setTitle(t,e){this.editor.chain().setMeta("addToHistory",e).setTitle(t).run()}
1getTitleHookId(){return this.editor.state.doc.content.content[0].attrs.hookId}hasFocus(){return this.editor.isFocused}getContent(){return JSON.stringify(this.editor.getJSON())}initWithText(t,e,n={}){HM(this.editor,t,e,{...n,fromImport:!0},this.contentOptions)}setContent(t){if(this.yjsProvider)return;let e={};if(t)try{e=JSON.parse(t)}catch(t){console.error("[setContent] Error while parsing content",t)}this.editor.chain().command(({tr:t})=>{const e=t.curSelection,n=this.positionToRelative(e.$anchor.pos,t.doc),r=this.positionToRelative(e.$head.pos,t.doc);return t.setMeta("anchor",n),t.setMeta("head",r),!0}).setContent(e).command(({tr:t})=>{const e=t.getMeta("anchor"),n=t.getMeta("head"),r=this.relativeToPosition(e.hookId,e.offset,t.doc)||0,o=this.relativeToPosition(n.hookId,n.offset,t.doc)||0;return t.setSelection(new _e(t.doc.resolve(r),t.doc.resolve(o))),!0}).run()}isEmptyAfterTitle(){return function(t){try{for(const e of t.content.content)if((!e||"title"!=e.type.name)&&e&&e.content&&e.content.size>0&&e.content.content)for(const t of e.content.content)if(t&&t.type&&(t.type.isText&&t.text&&t.text.length>0||t.type.isBlock&&t.content.size>0))return!1}catch(t){console.error("[isEmptyAfterTitleFromDoc] Error while checking if content is empty",t)}return!0}(this.editor.state.doc)}getText(){return this.editor.state.doc.textContent}isSelectable(){return this._selectable}setSelectable(t){this._selectable=t;const e=this.contentOptions.element;t?e?.classList.remove("selection-disabled"):(this.clearSelection(),e?.classList.add("selection-disabled"))}isEditable(){return this.editor.isEditable}setEditable(t){this.editor.setEditable(t),t&&this.setSelectable(!0),this.editor.extensionManager.extensions.forEach(e=>{"title"===e.name&&(e.options.placeholder=t?this.contentOptions.titlePlaceholder:"")}),this._applyDragReorderDomState()}setDragReorderEnabled(t){this._dragReorderEnabled=!0===t,this._applyDragReorderDomState()}setPasteEnabled(t){this._pasteEnabled=!0===t}setDropContentEnabled(t){this._dropContentEnabled=!0===t}_handlePasteGuard(t){return!(this._pasteEnabled&&!0===this.editor?.isEditable||(t.preventDefault(),t.stopPropagation(),0))}_handleDropGuard(t){return gA(t,this._dropContentEnabled&&!0===this.editor?.isEditable)}_applyDragReorderDomState(){const t=this._dragReorderEnabled&&!0===this.editor?.isEditable,e=this.contentOptions.element;e?.classList.toggle("drag-reorder-enabled",t),e?.querySelectorAll('div[name="themeFrame"]:not([data-state="placeholder"])').forEach(e=>{e instanceof HTMLElement&&(e.classList.toggle("theme-frame--drag-reorder",t),e.querySelectorAll(".theme-frame-drag-handle").forEach(e=>{e instanceof HTMLElement&&(e.style.pointerEvents=t?"auto":"none",e.setAttribute("draggable",t?"true":"false"))}))})}isEmpty(){return this.editor.isEmpty}focusStart(){return this.editor.commands.focus("start")}focusEnd(){return this.editor.commands.focus("end")}focusAt(t,e=!0,n=!0){if(!this.isEditable())return this._focusEditor(null,e,n);switch(t){case"start":case"end":case Number.isInteger(t)&&t:return this._focusEditor(t,e,n);case"firstLine":return void function(t,e,n){if(!t)return!1;const r=t.state.doc.nodeAt(0);if(!r||r.type.name!=nT.name)return!1;const o=t.state.doc.resolve(0+r.content.size),i=Math.min(o.after(1)+1,t.state.doc.content.size-1);t.chain().setMeta("addToHistory",n).focus(i,{scrollIntoView:e}).run()}(this.editor,e,n);default:return this._focusEditor(null,e,n)}}_focusEditor(t,e,n){return this.editor.chain().setMeta("addToHistory",n).focus(t,{scrollIntoView:e}).run()}focus(){return this.editor.chain().focus().run()}blur(){return this.editor.chain().blur().run()}undo(){return this.editor.commands.undo()}canUndo(){return this.editor.can().undo()}
1getUndoDepth(){return this.yjsProvider?(t=this.editor,jc.getState(t.state).undoManager.undoStack.length||0):function(t){return function(t){let e=_c.getState(t);return e?e.done.eventCount:0}(t.state)}(this.editor)||0;var t}redo(){return this.editor.commands.redo()}canRedo(){return this.editor.can().redo()}getRedoDepth(){return this.yjsProvider?(t=this.editor,jc.getState(t.state).undoManager.redoStack.length||0):function(t){return function(t){let e=_c.getState(t);return e?e.undone.eventCount:0}(t.state)}(this.editor)||0;var t}bold(){this.editor.chain().focus().toggleBold().run()}isBold(){return this.editor.isActive("bold")}italic(){this.editor.chain().focus().toggleItalic().run()}isItalic(){return this.editor.isActive("italic")}strike(){this.editor.chain().focus().toggleStrike().run()}isStrike(){return this.editor.isActive("strike")}underline(){this.editor.chain().focus().toggleUnderline().run()}isUnderline(){return this.editor.isActive("underline")}heading1(){this.isCode()&&this.editor.chain().focus().toggleCode().run(),this.editor.chain().focus().toggleHeading({level:1}).run()}isHeading1(){return this.editor.isActive("heading",{level:1})}heading2(){this.isCode()&&this.editor.chain().focus().toggleCode().run(),this.editor.chain().focus().toggleHeading({level:2}).run()}isHeading2(){return this.editor.isActive("heading",{level:2})}heading3(){this.editor.chain().focus().toggleHeading({level:3}).run()}isHeading3(){return this.editor.isActive("heading",{level:3})}headingNone(){this.editor.isActive("heading")&&this.editor.chain().focus().setParagraph().run()}isHeadingNone(){return!this.editor.isActive("heading")}bulletList(){this.editor.chain().focus().toggleBulletList().run()}isBulletList(){return this.editor.isActive("bulletList")}orderedList(){this.editor.chain().focus().toggleOrderedList().run()}isOrderedList(){return this.editor.isActive("orderedList")}taskList(){this.editor.chain().focus().toggleTaskList().run()}isTaskList(){return this.editor.isActive("taskList")}code(){this.editor.chain().focus().toggleCode().run()}isCode(){return this.editor.isActive("code")}codeBlock(){this.editor.chain().focus().toggleCodeBlock().run()}isCodeBlock(){return this.editor.isActive("codeBlock")}isEntirelyRendered(t){try{if(this.yjsProvider&&!this.yjsProvider._synced)return!1;const e=this.editor.view,n=e.dom;if(!n||n.clientWidth<1)return!1;const r=this.editor.state.doc;let o=0;for(let n=0;n<r.childCount;n++){const i=r.child(n);if(i.attrs?.hookId){if(t&&!iD.includes(i.type.name)){o+=i.nodeSize;continue}const n=e.nodeDOM(o);if(i.type.name===_T){if(!n)return!1}else if(!n||!n.offsetHeight)return!1}o+=i.nodeSize}return!0}catch(t){return this._renderCheckErrorLogged||(this._renderCheckErrorLogged=!0,console.error("[isEntirelyRendered] unexpected error, assuming rendered:",t)),!0}}setAlignment(t){"justify"!==t&&"left"!==t&&"center"!==t&&"right"!==t||this.editor.chain().focus().setTextAlign(t).run()}getAlignment(){return this.isAlignment("justify")?"justify":this.isAlignment("left")?"left":this.isAlignment("center")?"center":this.isAlignment("right")?"right":void 0}isAlignment(t){return("justify"===t||"left"===t||"center"===t||"right"===t)&&this.editor.isActive({textAlign:t})}blockquote(){this.editor.chain().focus().toggleBlockquote().run()}isBlockquote(){return this.editor.isActive("blockquote")}isTitle(){return this.editor.isActive("title")}addImage(t){}isImage(){return!1}addLink(t){t&&this.editor.chain().focus().setLink({href:t}).run()}removeLink(){this.editor.chain().focus().unsetLink().run()}isLink(){return this.editor.isActive("link")}getPosition(){return this.editor.state.selection.anchor}getPositionAt(t,e){try{const n=this.editor.view.posAtCoords({left:t,top:e});return n?n.pos:null}catch(t){return console.error("[getPositionAt] Error while getting position at viewport coordinates",t),null}}getBlockPositionAt(t,e){try{const n=this.editor.view.posAtCoords({left:t,top:e});return n?-1!=n.inside?n.inside:n.pos:null}catch(t){return console.error("[getBlockPositionAt] Error while getting block position at viewport coordinates",t),null}}hasSelection(){return this.editor.state.selection.$anchor.pos!=this.editor.state.selection.$head.pos}getSelectionCoords(){return this.getViewportCoordsAt(this.getPosition())}getSelectionStartCoords(){const t=this.editor.state.selection;return null==t?null:this.getViewportCoordsAt(t.$from.pos)}getSelectionEndCoords(){const t=this.editor.state.selection;return null==t?null:this.getViewportCoordsAt(t.$to.pos)}isCharacterBlankAtPosition(t){try{return""===this.editor.state.doc.textBetween(t,t+1).trim()}catch(e){return console.warn(`[isCharacterBlankAtPosition] Error while checking if character is blank at position ${t}
1 (doc size=${this.editor.state.doc.content.size})`,e),!1}}getTopOffset(t){const e=t.bottom-t.top;return e<20?0:e<26||e<36?2:e<96?6:0}getYOffsetForHookCreation(t){const e=t.bottom-t.top;return e<20?10:e<26?8:e<36?12:e<50?18:e<96?24:0}generateCoordinatePairs(t,e){const n=[];let r=this.getViewportCoordsAt(t),o=!this.isCharacterBlankAtPosition(t);for(let i=t+1;i<e;i++){let t=this.getViewportCoordsAt(i);o||(o=!this.isCharacterBlankAtPosition(i));const e=t.top-r.top;if(Math.abs(e)>8){if(o){let t=this.getViewportCoordsAt(i-1,-1),e=0,o=this.getYOffsetForHookCreation(r),s=r.bottom-r.top>0?r.bottom-r.top:18;r.top=r.top+e,t.top=t.top+e,n.push(new cD(r,t,s,o))}o=!1,r=t}}let i=0;for(let t=e;t<e+200;t++){const e=this.getViewportCoordsAt(t).top-r.top;if(Math.abs(e)>8){i=e;break}}let s=this.getViewportCoordsAt(e,-1);i=r.bottom-r.top>0?r.bottom-r.top:18;let a=this.getYOffsetForHookCreation(r);return r.top=r.top+0,s.top=s.top+0,n.push(new cD(r,s,i,a)),n}getSelectionCoordinatePairs(){try{const t=this.editor.state.selection;return t?this.generateCoordinatePairs(t.$from.pos,t.$to.pos):null}catch(t){return console.error(t),null}}generateCoordinatePairsFromHooks(t,e){if(null==t||null==e)return[];const n=this.editor.state.doc,r=cw(n,t),o=cw(n,e);if(null===r||null===o)return console.error("Invalid hookIds provided."),[];const i=Math.min(r,o),s=Math.max(r,o);return this.generateCoordinatePairs(i,s+1)}getRangeText(t,e="\n"){return t.from==t.to?"":this.editor.state.doc.textBetween(Math.min(t.from,t.to),Math.max(t.from,t.to),e)||""}_getParentNodeForSubNodeId(t,e){const n=this.editor.state.doc,r=cw(n,t.parentId);if(null==r)return console.warn(`[${e}] Parent node not found for subNode ID:`,t.parentId),null;const o=n.nodeAt(r);return o?{parentNode:o,parentPos:r}:(console.warn(`[${e}] Parent node is null for subNode ID:`,t.parentId),null)}getNodeSize(t){const e=aw(t);if(e){const n=this._getParentNodeForSubNodeId(e,"getNodeSize");if(!n)return 0;const r=function(t,e,n){const r=lw(t,e,n,"getChildSizeByIndex");return r?r.nodeSize:0}(n.parentNode,e.type,e.index);return 0===r&&console.warn("[getNodeSize] Child not found for subNode ID:",t,"type:",e.type,"index:",e.index),r}const n=sw(this.editor,t);if(!n)return console.warn("[getNodeSize] Cannot find hookId: hookLocation is not found",t),0;if(!n.block||!n.block.nodeSize)return console.warn("[getNodeSize] Cannot find hookId: block or nodeSize is not found",t,n),0;const r=n.block.nodeSize||null;return null==r&&console.warn("[getNodeSize] Cannot find hookId",t),r||0}getTextByHookId(t){if(null==t)return"";const e=sw(this.editor,t);if(!e)return"";if(e.block)return e.block.textContent||"";if(e.inline&&null!=e.position){const t=this.editor.state.doc.nodeAt(e.position);if(t&&t.isText)return t.text||""}return""}getRangeMarkdown(t,e,n){const r=this._clampPosition(Math.min(t.from,t.to)),o=this._clampPosition(Math.max(t.from,t.to));if(r==o)return"";const i=this.editor.state.doc.slice(r,o,!0).content;let s="";switch(e){case 1:s=function(t,e){return new H_(W_,J_,{skipEmptyBlocks:!0,maxSize:e}).serializeBefore(t)}(i,n);break;case 2:s=function(t,e){return new H_(q_,J_,{skipEmptyBlocks:!0,maxSize:e}).serializeAfter(t)}(i,n);break;default:s=z_(i,n)}return s||""}getSelectionText(t="\n"){const e=this.editor.state.selection;return null==e?"":this.editor.state.doc.textBetween(e.$from.pos,e.$to.pos,t)||""}getViewportCoordsAt(t,e=1){const n=this.editor.view.coordsAtPos(this._clampPosition(t),e);return{left:n.left,top:n.top,right:n.right,bottom:n.bottom}}positionToRelative(t,e=this.editor.state.doc){const n=dw(e,t);if(null==n)return new lD("",t);if(null==n.attrs.hookId)return new lD("",t);const r=this.relativeToPosition(n.attrs.hookId,0,e);return null==r?new lD("",t):new lD(n.attrs.hookId,t-r)}relativeToPosition(t,e,n=this.editor.state.doc){if(null==t||""==t)return this._clampPosition(e,n);const r=aw(t);if(r){const o=this._getParentNodeForSubNodeId(r,"relativeToPosition");if(!o)return null;const i=function(t,e,n,r){if(!lw(t,n,r,"getChildPositionByIndex"))return null;let o=e+1;for(let e=0;e<r;e++)o+=t.content.child(e).nodeSize;return o}(o.parentNode,o.parentPos,r.type,r.index);return null==i?(console.warn("[relativeToPosition] Child not found for subNode ID:",t,"type:",r.type,"index:",r.index),null):this._clampPosition(i+e,n)}const o=cw(n,t);return null==o?null:this._clampPosition(o+e,n)}getSelectionRange(){const t=this.editor.state.selection;return new dD(t.$anchor.pos,t.$head.pos)}setSelectionRange(t){this.editor.commands.setTextSelection({from:t.from,to:t.to})}getNodeRange(t,e){const n=function(t,e,n,r){try{if(t.content.size<=1)return console.warn("[getNodeRange] Document is empty or too small, size:",t.content.size),null;const o=r(e,t),i=t.resolve(o);return-1===n&&(n=i.depth),n>i.depth?null:(n=Math.max(n,0),{from:i.start(n),to:i.end(n)})}catch(t){return console.error("[getNodeRange] Error while getting node range at position",e,"depth",n,t),null}}(this.editor.state.doc,t,e,this._clampPosition.bind(this));return n?new dD(n.from,n.to):null}isBlockHook(){return this.editor.isActive("blockHook")}isInlineHook(){return this.editor.isActive("inlineHook")}addInlineHookMark(t,e,n){t=this._clampPosition(t),this.editor.chain().setInlineHookMark({editor:this.editor,position:t,i
1d:e,nodeSearchForward:n}).run()}removeInlineHookMark(t){const e=this.getHookCoords(t);if(null==e)return null;const n=this._clampPosition(e.position);this.editor.chain().unsetInlineHookMark({position:n,nodeSearchForward:!0}).run()}isHookIdValid(t){return null!=t&&null!=sw(this.editor,t)}isHookIdHeading(t){if(null==t)return!1;const e=sw(this.editor,t);return null!=e&&null!=e.block&&"heading"===e.block.type.name}isInlineHookMark(){return this.editor.isActive("inlineHookMark")}getHookCoords(t){const e=sw(this.editor,t);return null==e?null:{...e}}getHookPosition(t){const e=sw(this.editor,t);return null==e?null:e.position}getInlineHookIdAtPosition(t,e){return function(t,e,n){if(null==e)return null;try{const r=t.state.doc,o=pw(t,e,!1,n);if(null==o||o<0)return console.warn("getInlineHookIdAtPosition: nodePos is "+(null==o?"null":"negative"),{nodePos:o,position:e,nodeSearchForward:n}),null;const i=r.nodeAt(o);if(i&&i.marks.length){let t=i.marks.find(t=>"inlineHook"===t.attrs.hookType);if(t)return t.attrs.hookId}}catch(t){console.error("getInlineHookIdAtPosition: try/catch error",t,{position:e,nodeSearchForward:n})}return null}(this.editor,this._clampPosition(t),e)}hasInlineHookWithId(t){return function(t,e){if(!t||!e)return!1;const n=[];
1t.descendants(t=>{n.push(...t.marks)});for(const t of n)if(t&&t.type&&"inlineHookMark"===t.type.name&&t.attrs.hookId===e)return!0;return!1}(this.editor.state.doc,t)}hasBlockHookWithId(t){return function(t,e){let n=!1;return t.descendants(t=>{t.attrs.hookId===e&&(n=!0)}),n}(this.editor.state.doc,t)}getBlockHookIdAtPosition(t){return function(t,e){if(null==e)return null;const n=dw(t.state.doc,e);return console.assert(!!n,"node must exist"),n&&"blockHook"===n.attrs.hookType?n.attrs.hookId:null}(this.editor,this._clampPosition(t))}getAllSpacers(){return this.editor.commands.getAllSpacers()}insertSpacerAt(t,e){return this.editor.commands.insertSpacerAt(this._clampPosition(t),e)}removeSpacer(t){return this.editor.commands.removeSpacer(t)}updateSpacer(t,e,n,r){return this.editor.commands.updateSpacer(t,e,n,r)}syncSpacerHeight(t){return this.editor.commands.syncSpacerHeight(t)}insertThemeFrameAt(t,e=null,n=null,r=null,o=null,i=null,s=null,a=null,l=!1){const c=this.editor.state.doc.content.size,d=Math.min(Math.max(t,0),c);if(e===$T){const t=null!=s&&s.length>0?s:mA("blockHook"),e=this.editor.state.doc.resolve(d),r=e.depth>0?e.after(1):d,o=this.editor.state.tr;return xT(o,{action:"show",position:r,hookId:t,height:"number"==typeof n&&Number.isFinite(n)&&n>0?n:0,visualId:a}),o.setMeta("addToHistory",!1),this.editor.view.dispatch(o),t}const u={...null!==e?{state:e}:{},height:n,...null!==r?{expanded:r}:{},...null!==o?{width:o}:{},text:i,hookId:s,visualId:a,addToHistory:l};return this.editor.commands.insertThemeFrameAt(d,u)}removeThemeFrame(t,e=!1){if(this._matchesActivePreview(t)){const t=this.editor.state.tr;return xT(t,{action:"hide"}),t.setMeta("addToHistory",!1),this.editor.view.dispatch(t),!0}return!0===this.editor.commands.removeThemeFrame(t,e)}moveThemeFrame(t,e,n,r){return!0===this.editor.commands.moveThemeFrame(t,{targetHookId:e,toEnd:n,addToHistory:r})}updateThemeFrameHeight(t,e){return this.editor.commands.updateThemeFrameHeight(t,e)}updateThemeFrame(t,e=null,n=null,r=null,o=null,i=null,s=null,a=!1){if(this._matchesActivePreview(t)){if(null!=e&&e!==$T)return this._promotePreviewToState(e,{visualId:s,height:o,width:r,expanded:n,text:i});if(null!==o||null!==r||null!==n||null!==i)return!1;if(null!==s){const t=this.editor.state.tr;xT(t,{action:"setVisualId",visualId:s}),t.setMeta("addToHistory",!1),this.editor.view.dispatch(t)}return!0}const l={...null!==e?{state:e}:{},...null!==n?{expanded:n}:{},...null!==r?{width:r}:{},...null!==o?{height:o}:{},...null!==i?{text:i}:{},...null!==s?{visualId:s}:{}};return!0===this.editor.commands.updateThemeFrame(t,l,a)}setThemeFrameState(t,e,n=!1){return this._matchesActivePreview(t)&&e!==$T?this._promotePreviewToState(e,{visualId:null,height:null,width:null,expanded:null,text:null}):!0===this.editor.commands.setThemeFrameState(t,e,n)}_matchesActivePreview(t){const e=CT.getState(this.editor.state);return null!=e&&e.hookId===t}isActivePreviewThemeFrame(t){return this._matchesActivePreview(t)}_promotePreviewToState(t,e){const n=CT.getState(this.editor.state);if(null==n||null==n.position||null==n.hookId)return!1;const r=this.editor.state.schema.nodes[_T];if(null==r)return!1;const o=n.height>0?n.height:null,i=r.create({state:t,height:e.height??o,expanded:e.expanded??!0,width:e.width??0,text:e.text??null,hookId:n.hookId,hookType:"blockHook",visualId:e.visualId??n.visualId}),s=this.editor.state.doc.resolve(n.position),a=s.depth>0?s.after(1):n.position,l=this.editor.state.tr;l.insert(a,i),xT(l,{action:"hide"}),l.setMeta("addToHistory",!1);const c=this.editor.state.doc;return this.editor.view.dispatch(l),this.editor.state.doc!==c}getAllThemeFrames(t=null){const e=this.editor.commands.getAllThemeFrames();return null==t?e:e.filter(e=>e.getAttributes().state===t)}enableHeadingIcons(){const t=this.contentOptions?.element;t&&t.classList.add("heading-icons-enabled")}disableHeadingIcons(){const t=this.contentOptions?.element;t&&t.classList.remove("heading-icons-enabled"),this.hideHeadingIconMenu()}updateHeadingIcon(t,e){return this.editor.commands.updateHeadingIcon(t,e)}setHeadingPreviewIcon(t,e,n){const r=Jk(this.contentOptions?.element,t);if(!r)return!1;const o=r.classList.contains("has-icon");return function(t,e,n,r,o){if(!t||!r)return;if(o)return;const i=Wk(r);e&&Uk.set(e,{iconId:n,svg:i}),t.innerHTML=i,t.classList.add("has-preview")}(r,t,e,n,o),!o}getHeadingPreviewIconId(t){return e=t,sC&&sC.headingId===e?sC.iconId:(null===(n=Uk.get(e))||void 0===n?void 0:n.iconId)??null;var e,n}loadHeadingIconSvg(t,e,n){const r=Jk(this.contentOptions?.element,t);return!!r&&(function(t,e,n){if(!t||!n)return;const r=Wk(n);e&&qk.set(e,r),t.innerHTML=r,t.classList.add("has-icon"),t.classList.remove("has-preview")}(r,e,n),!0)}showHeadingIconMenu(t,e,n){const r=this.contentOptions?.element;return!!r&&function(t,e,n,r){if(dC(),!e||0===e.length)return!1;const o=Jk(r,t);if(!o)return!1;const i=document.createElement("div");i.className="heading-icon-menu";const s=document.createElement("div");s.className="border";const a=document.createElement("div");a.className="items-holder";const l=o.innerHTML,c=o.classList.contains("has-icon");iC=()=>{const e=Jk(r,t);e&&(e.innerHTML=l,e.classList.remove("has-preview"),c?e.classList.add("has-icon"):e.classList.remove("has-icon"))};const d=e.slice(0,6);for(const e of d){const o=document.createElement("div");o.className="icon-entry";const i=e.svgContent?Wk(e.svgContent):"";i&&(o.innerHTML=i,qk.set(e.id,i)),o.dataset.iconId=e.id,o.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),o.addEventListener("mouseenter",()=>{i&&(lC(),aC=setTimeout(()=>{aC=null,cC(r,t,e.id,i)},200))}),o.addEventListener("mouseleave",lC),o.addEventListener("click",o=>
1{o.preventDefault(),o.stopPropagation();const s=iC;if(iC=null,lC(),i&&cC(r,t,e.id,i),dC(),n)try{n(t,e.id)}catch(t){throw sC=null,s&&s(),t}}),a.appendChild(o)}s.appendChild(a),i.appendChild(s),i.style.position="fixed",i.style.width="max-content",(r||document.body).appendChild(i),tC=i,eC=document.createElement("style");const u=CSS.escape(t);eC.textContent=`\n    #${u} .heading-icon.has-preview { opacity: 0.8 !important; }\n    #${u} .heading-icon svg { filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.3)); }\n    .night #${u} .heading-icon svg { filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.4)); }\n  `,document.head.appendChild(eC);let h=o,p=o.getBoundingClientRect();const f=()=>(h=o.isConnected?o:Jk(r,t),h),g={getBoundingClientRect:()=>f()?(p=h.getBoundingClientRect(),p):p,get contextElement(){return h}},m=async()=>{if(f())try{const t=await Hk(g,i,{placement:"left",middleware:[Pk(12),zk(),Fk({padding:{top:jk(h)+8,right:8,bottom:8,left:8}})],strategy:"fixed"}),e=t.x,n=t.y,r=t.placement;Object.assign(i.style,{left:`${e}px`,top:`${n}px`});const o=r.split("-")[0];i.classList.remove("placement-top","placement-bottom","placement-left","placement-right"),i.classList.add(`placement-${o}`),i.classList.add("active")}catch(t){console.error("[HeadingIcon] positionMenu error:",t)}else dC()};return requestAnimationFrame(()=>{m(),oC=Rk(g,i,m)}),setTimeout(()=>{tC&&(nC=e=>{var n;!tC||tC.contains(e.target)||null!==(n=Jk(r,t))&&void 0!==n&&n.contains(e.target)||dC()},document.addEventListener("click",nC,{capture:!0}))},10),rC=t=>{"Escape"===t.key&&dC()},document.addEventListener("keydown",rC),!0}(t,e,n,r)}hideHeadingIconMenu(){dC()}getState(){return new L_(this.editor.state)}getView(){return new F_(this.editor.view)}expandContentToHeight(t){return this.editor.commands.expandContent(t)}replaceRangeContent(t,e,n){this.editor.chain().setMeta("addToHistory",n).insertContentAt(t,e).run()}insertBlankLines(t,e,n){const r=this.editor.state.doc.content.size,o=this.editor.state.doc.resolve(this._clampPosition(t)),i=Math.min(o.pos,this.editor.state.doc.content.size-1);return this.editor.commands.insertBlankLines(i,e,n),new dD(i,i+this.editor.state.doc.content.size-r)}deleteRange(t,e,n){return this.editor.commands.deleteRangeWithHistory(this._clampPosition(t),this._clampPosition(e),n)}getNodesBetween(t,e){const n=[];return this.editor.view.state.doc.nodesBetween(this._clampPosition(t),this._clampPosition(e),t=>{n.push(t)}),n.map(t=>new vT(t))}getBlockHookPosition(t){try{const e=sw(this.editor,t);if(!e)return null;const{position:n}=e;return null==n?null:this._clampPosition(n)}catch(t){return console.error("[getBlockHookPosition] Error while getting block hook position",t),null}}clearSlashCommand(t){return this.editor.commands.clearSlashCommand(t)}clearSelection(){const t=this.editor.state.selection.toJSON();if(null==t||t.head==t.anchor)return!1;const e=t.head;return!!e&&this.editor.commands.setTextSelection(e)}clearContent(t){this.editor.chain().setMeta("addToHistory",!1).clearContent(t).run()}positionAtEnd(){return Se.atEnd(this.editor.state.doc).$from.pos}_clampPosition(t,e=this.editor.state.doc){const n=e.content.size;return n<=1?0:Math.min(Math.max(t,0),n-1)}redrawCommentHighlights(){let t=[];if(this.editor.state.doc.descendants(e=>{e.marks.some(t=>"inlineHookMark"===t.type.name)&&(t=[...t,...e.marks.map(t=>t.attrs.hookId)])}),t.length>0){const e=new CustomEvent("napkinEventMarksChanged",{detail:[...t]});t=[],document.dispatchEvent(e)}}addAnchorMark(t,e,n,r){let o=null;return this.editor.chain().addAnchorMark({startPosition:t,endPosition:e,type:n,entityId:r,onCreate:t=>{o=t}}).run(),o}removeAnchorMark(t){return this.editor.chain().removeAnchorMark({id:t}).run()}addAnchorMarkHighlight(t){this.editor.chain().addAnchorMarkHighlight({id:t}).run()}removeAnchorMarkHighlight(t){this.editor.chain().removeAnchorMarkHighlight({id:t}).run()}removeAllAnchorMarkHighlights(){this.editor.chain().removeAllAnchorMarkHighlights().run()}getAnchorMarkById(t){return function(t,e){const{state:n}=t,{doc:r}=n,o=n.schema.marks.anchorMark;let i=[],s=null,a=null;return r.descendants((t,n)=>{if(!t.isText||!t.marks)return!0;for(const r of t.marks)if(r.type===o&&r.attrs["data-anchor-id"]===e)return i.push(r),(null==s||n<s)&&(s=n),(null==a||n>a)&&(a=n+t.nodeSize),!1;return!0}),i.length>0&&null!=s&&null!=a?XT({marks:i,from:s,to:a}):null}(this.editor,t)}getNodesAsMarkdownForSegmentation(t){return function(t,e={}){const n=!0===e.includeThemeFrames,r=t.state.doc,o=[],i=t.state.schema,s=(t,e)=>{const n=t.attrs?.hookId||null;
1if(n&&t.type.name===_T)if(Q_(t)){const r="string"==typeof t.attrs?.text?t.attrs.text.trim():"";o.push({hookId:n,mdContent:r,blockType:"visual-placeholder",start:e,end:e+t.nodeSize})}else o.push({hookId:n,mdContent:"",blockType:"visual",start:e,end:e+t.nodeSize})},a=(t,e,r=0)=>{const l="orderedList"===t.type.name,c=t.attrs.order||1,d="  ".repeat(r);let u=e+1;t.forEach((t,e,h)=>{const p=t.attrs?.hookId||null;if(p){const e=l?`${d}${c+h}. `:`${d}* `,f=[],g=[];t.forEach((t,e)=>{const r=u+1+e;if(t.type.name!==_T)if("bulletList"===t.type.name||"orderedList"===t.type.name)g.push({kind:"list",node:t,offset:r});else{const e=z_(i.nodes.doc.create(null,t).content);e&&e.trim()&&f.push(e.trim())}else n&&g.push({kind:"frame",node:t,offset:r})});const m=f.length>0?e+f.join(" "):e.trimEnd();o.push({hookId:p,mdContent:m,start:u,end:u+t.nodeSize});for(const t of g)"frame"===t.kind?s(t.node,t.offset):a(t.node,t.offset,r+1)}u+=t.nodeSize})};return r.forEach((t,e)=>{const r=t.attrs?.hookId||null,l=t.type.name;if(l!==_T){if("bulletList"===l||"orderedList"===l)a(t,e,0);else if(r){const n=z_(i.nodes.doc.create(null,t).content);o.push({hookId:r,mdContent:n||"",start:e,end:e+t.nodeSize})}}else n&&s(t,e)}),o}(this.editor,{includeThemeFrames:t})}getNodesAsMarkdownForAgent(){return function(t){const e=t.state.doc,n=[],r=t.state.schema,o=(t,e,i=0)=>{const s="orderedList"===t.type.name,a=t.attrs.order||1,l="  ".repeat(i);let c=e+1;t.forEach((t,e,d)=>{const u=t.attrs?.hookId||null;if(u){const e=s?`${l}${a+d}. `:`${l}* `,h=[],p=[];t.forEach((t,e)=>{if("bulletList"===t.type.name||"orderedList"===t.type.name)p.push({node:t,offset:c+1+e});else{const e=K_(r.nodes.doc.create(null,t).content);e&&e.trim()&&h.push(e.trim())}});const f=h.length>0?e+h.join(" "):e.trimEnd();n.push({hookId:u,mdContent:f,start:c,end:c+t.nodeSize});for(const t of p)o(t.node,t.offset,i+1)}c+=t.nodeSize})};return e.forEach((t,e)=>{const i=t.attrs?.hookId||null,s=t.type.name;if("title"!==s)if(s===_T){if(i)if(Q_(t)){const r="string"==typeof t.attrs?.text?t.attrs.text.trim():"";n.push({hookId:i,mdContent:r,blockType:"visual-placeholder",start:e,end:e+t.nodeSize})}else n.push({hookId:i,mdContent:"",blockType:"visual",start:e,end:e+t.nodeSize})}else if("bulletList"===s||"orderedList"===s)o(t,e,0);else if(i){const o=K_(r.nodes.doc.create(null,t).content);n.push({hookId:i,mdContent:o||"",start:e,end:e+t.nodeSize})}}),n}(this.editor)}replaceBlockByHookId(t,e,n){return function(t,e,n,r){const o=t.state.doc,i=cw(o,e);if(null==i)return!1;const s=o.nodeAt(i);if(!s)return!1;if(s.type.name===_T&&s.attrs.state===BT)return function(t,e,n,r,o){const i=rD(Z_.renderInline(r)),s=document.createElement("div");s.innerHTML=i;const a=(s.textContent??"").trim();return!!a&&(t.view.dispatch(t.state.tr.setMeta("addToHistory",o).setNodeMarkup(e,void 0,{...n,text:a})),!0)}(t,i,s.attrs,n,r);if(s.isAtom||s.isLeaf)return!1;if("title"===s.type.name)return!1;const a=!!s.type.spec.isolating;let l=rD(s.inlineContent&&a?Z_.renderInline(n):Z_.render(n));if("listItem"===s.type.name&&(l=function(t){const e=(new DOMParser).parseFromString(`<body>${t}</body>`,"text/html").body;if(1!==e.children.length)return t;const n=e.children[0];if("UL"!==n.tagName&&"OL"!==n.tagName)return t;if(1!==n.children.length)return t;const r=n.children[0];if("LI"!==r.tagName)return t;const o=new Set(["P","UL","OL","BLOCKQUOTE","PRE"]);return Array.from(r.children).some(t=>o.has(t.tagName))?r.innerHTML:`<p>${r.innerHTML}</p>`}(l)),!l.trim())return!1;const c=s.inlineContent&&!a?{from:i,to:i+s.nodeSize}:{from:i+1,to:i+s.nodeSize-1};return t.chain().setMeta("addToHistory",r).insertContentAt(c,l).run(),!0}(this.editor,t,e,n)}insertBlockAfterHookId(t,e,n){return function(t,e,n,r){const o=t.state.doc,i=cw(o,e);if(null==i)return!1;const s=o.nodeAt(i);if(!s)return!1;const a=i+s.nodeSize,l=rD(Z_.render(n));return!!l.trim()&&(t.chain().setMeta("addToHistory",r).insertContentAt(a,l).run(),!0)}(this.editor,t,e,n)}insertPlaceholderAfterHookId(t,e,n){const r=this.editor.state.doc,o=cw(r,t);if(null==o)return null;const i=r.nodeAt(o);if(!i)return null;if("title"===i.type.name)return null;
1const s=o+i.nodeSize,a=this.editor.state.doc.content.size,l=Math.min(Math.max(s,0),a),c=this.editor.commands.insertThemeFrameAt(l,{state:BT,text:e,addToHistory:n});return"string"==typeof c?c:null}deleteBlockByHookId(t,e){const n=this.editor.state.doc,r=cw(n,t);if(null==r)return!1;const o=n.nodeAt(r);if(!o)return!1;if("title"===o.type.name)return!1;let i=r,s=r+o.nodeSize;if("listItem"===o.type.name){const t=n.resolve(r),e=t.parent;"bulletList"!==e.type.name&&"orderedList"!==e.type.name||1!==e.childCount||(i=t.before(),s=t.after())}return this.editor.chain().setMeta("addToHistory",e).deleteRange({from:i,to:s}).run(),!0}startScannerEffects(t){return this.editor.commands.startScannerEffects(t)}stopScannerEffects(){return this.editor.commands.stopScannerEffects()}}var hD=n(543),pD={};pD.styleTagTransform=O_()(),pD.setAttributes=__()(),pD.insert=T_()().bind(null,"head"),pD.domAPI=M_()(),pD.insertStyleElement=D_()(),E_()()(hD.A,pD),hD.A&&hD.A.locals&&hD.A.locals;var fD=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=[];return!t.children.length||e>20||Array.from(t.children).forEach(t=>{"SPAN"===t.tagName?n.push(t):t.children.length&&n.push(...fD(t,e+1))}),n},gD=Cl.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{},mergeNestedSpanStyles:!0}),parseHTML(){return[{tag:"span",consuming:!1,getAttrs:t=>!!t.hasAttribute("style")&&(this.options.mergeNestedSpanStyles&&(t=>{if(!t.children.length)return;const e=fD(t);e&&e.forEach(t=>{var e,n;const r=t.getAttribute("style"),o=null==(n=null==(e=t.parentElement)?void 0:e.closest("span"))?void 0:n.getAttribute("style");t.setAttribute("style",`${o};${r}`)})})(t),{})}]},renderHTML(t){let e=t.HTMLAttributes;return["span",ka(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleTextStyle:t=>e=>e.commands.toggleMark(this.name,t),removeEmptyTextStyle:()=>t=>{let e=t.tr;const n=e.selection;return e.doc.nodesBetween(n.from,n.to,(t,n)=>{if(t.isTextblock)return!0;t.marks.filter(t=>t.type===this.type).some(t=>Object.values(t.attrs).some(t=>!!t))||e.removeMark(n,n+t.nodeSize,this.type)}),!0}}}}),mD=Tl.create({name:"backgroundColor",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:t=>{var e;const n=t.getAttribute("style");if(n){const t=n.split(";").map(t=>t.trim()).filter(Boolean);for(let e=t.length-1;e>=0;e-=1){const n=t[e].split(":");if(n.length>=2){const t=n[0].trim().toLowerCase(),e=n.slice(1).join(":").trim();if("background-color"===t)return e.replace(/['"]+/g,"")}}}return null==(e=t.style.backgroundColor)?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.backgroundColor?{style:`background-color: ${t.backgroundColor}`}:{}}}}]},addCommands:()=>({setBackgroundColor:t=>e=>(0,e.chain)().setMark("textStyle",{backgroundColor:t}).run(),unsetBackgroundColor:()=>t=>(0,t.chain)().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()})}),AD=Tl.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;const n=t.getAttribute("style");if(n){const t=n.split(";").map(t=>t.trim()).filter(Boolean);for(let e=t.length-1;e>=0;e-=1){const n=t[e].split(":");if(n.length>=2){const t=n[0].trim().toLowerCase(),e=n.slice(1).join(":").trim();if("color"===t)return e.replace(/['"]+/g,"")}}}return null==(e=t.style.color)?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands:()=>({setColor:t=>e=>(0,e.chain)().setMark("textStyle",{color:t}).run(),unsetColor:()=>t=>(0,t.chain)().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})}),yD=Tl.create({name:"fontFamily",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily,renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands:()=>({setFontFamily:t=>e=>(0,e.chain)().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>t=>(0,t.chain)().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()})}),bD=Tl.create({name:"fontSize",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:t=>t.style.fontSize,renderHTML:t=>t.fontSize?{style:`font-size: ${t.fontSize}`}:{}}}}]},addCommands:()=>({setFontSize:t=>e=>(0,e.chain)().setMark("textStyle",{fontSize:t}).run(),unsetFontSize:()=>t=>(0,t.chain)().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()})}),vD=Tl.create({name:"lineHeight",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:t=>t.style.lineHeight,renderHTML:t=>t.lineHeight?{style:`line-height: ${t.lineHeight}`}:{}}}}]},addCommands:()=>({setLineHeight:t=>e=>(0,e.chain)().setMark("textStyle",{lineHeight:t}).run(),unsetLineHeight:()=>t=>(0,t.chain)().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()})});Tl.create({name:"textStyleKit",addExtensions(){const t=[];return!1!==this.options.backgroundColor&&t.push(mD.configure(this.options.backgroundColor)),!1!==this.options.color&&t.push(AD.configure(this.options.color)),!1!==this.options.fontFamily&&t.pu
1sh(yD.configure(this.options.fontFamily)),!1!==this.options.fontSize&&t.push(bD.configure(this.options.fontSize)),!1!==this.options.lineHeight&&t.push(vD.configure(this.options.lineHeight)),!1!==this.options.textStyle&&t.push(gD.configure(this.options.textStyle)),t}});const wD="runSvg",kD="data-run-svg";function CD(t){return`display:inline-block;width:${t.w}px;height:${t.h}px;vertical-align:${-t.dy}px`}function xD(t){const e="number"==typeof t?t:Number.parseFloat(String(t??""));return Number.isFinite(e)?e:0}const SD=rc.create({name:wD,inline:!0,group:"inline",atom:!0,selectable:!0,addAttributes:()=>({id:{default:""},tex:{default:""},w:{default:0},h:{default:0},dy:{default:0}}),parseHTML:()=>[{tag:`span[${kD}]`,getAttrs:t=>{const e=t,n=e.getAttribute(kD)??"",r=e.getAttribute("data-tex")??"";return 0!==n.length&&0!==r.length&&{id:n,tex:r,...MD(e)}}}],renderHTML({node:t}){const e={w:xD(t.attrs.w),h:xD(t.attrs.h),dy:xD(t.attrs.dy)};return["span",{[kD]:String(t.attrs.id??""),"data-tex":String(t.attrs.tex??""),"data-w":String(e.w),"data-h":String(e.h),"data-dy":String(e.dy),style:CD(e)}]},renderText:({node:t})=>String(t.attrs.tex??""),addProseMirrorPlugins:()=>[ED()]});function ED(){let t=null;return new Ve({key:new Je("labelRunSvgSelection"),props:{handleDOMEvents:{mousedown:(e,n)=>{const r=n.target?.closest?.(`[${kD}]`);if(0!==n.button||!(r instanceof HTMLElement))return!1;const o=function(t,e){if(0===e.length)return-1;let n=-1;return t.state.doc.descendants((t,r)=>(n<0&&t.type.name===wD&&String(t.attrs.id??"")===e&&(n=r),n<0)),n}(e,r.getAttribute(kD)??"");if(o<0)return!1;n.preventDefault(),e.focus(),e.dispatch(e.state.tr.setSelection(Oe.create(e.state.doc,o)));const i=e.dom.ownerDocument,s=t=>function(t,e,n){const r=t.posAtCoords({left:n.clientX,top:n.clientY});if(!r)return;const o=t.state.doc,i=r.pos,s=i>e&&i<e+2?Oe.create(o,e):_e.between(o.resolve(i>e?e:e+1),o.resolve(i));t.dispatch(t.state.tr.setSelection(s))}(e,o,t),a=()=>{i.removeEventListener("mousemove",s,!0),i.removeEventListener("mouseup",a,!0),t===a&&(t=null)};return t=a,i.addEventListener("mousemove",s,!0),i.addEventListener("mouseup",a,!0),!0}},decorations:t=>function(t){const{from:e,to:n,empty:r}=t.selection;if(r)return null;const o=[];return t.doc.nodesBetween(e,n,(t,e)=>(t.type.name===wD&&o.push(ri.node(e,e+t.nodeSize,{class:"label-run-svg-selected"})),!0)),0===o.length?null:si.create(t.doc,o)}(t)},view:()=>({destroy:()=>t?.()})})}function MD(t){return{w:xD(t.getAttribute("data-w")),h:xD(t.getAttribute("data-h")),dy:xD(t.getAttribute("data-dy"))}}function TD(t){if("string"!=typeof t)return!1;const e=t.trim().toLowerCase();return"normal"===e||"400"===e||"lighter"===e||"300"===e}function _D(t){if("string"!=typeof t)return;const e=t.trim().toLowerCase();if(0===e.length||"transparent"===e)return;const n=function(t){const e=t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/);if(e)return`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`;if(/^#[0-9a-f]{6}$/.test(t))return t;const n=t.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);if(n){const t=t=>Math.min(255,parseInt(t,10)).toString(16).padStart(2,"0");return`#${t(n[1])}${t(n[2])}${t(n[3])}`}return"black"===t?"#000000":void 0}(e);return n??e}function DD(t){if("string"!=typeof t)return;const e=t.trim();return uT(e)?e:void 0}function OD(t){const e=_D(t);return"#000000"===e?void 0:e}function ID(t){const e={b:null,i:!1,u:!1,s:!1};let n=!1;for(const r of t)switch(r.type.name){case"bold":n=!0;break;case"italic":e.i=!0;break;case"underline":e.u=!0;break;case"strike":e.s=!0;break;case"link":{const t=DD(r.attrs?.href);void 0!==t&&(e.a=t);break}case"textStyle":{const t=_D(r.attrs?.color);void 0!==t&&(e.c=t),TD(r.attrs?.fontWeight)&&(e.b=!1);break}}return n&&(e.b=!0),e}function ND(t,e){return t.b===e.b&&t.i===e.i&&t.u===e.u&&t.s===e.s&&t.c===e.c&&t.a===e.a&&t.m===e.m}function LD(t,e){const n={n:t};return null!==e.b&&(n.b=e.b),e.i&&(n.i=!0),e.u&&(n.u=!0),e.s&&(n.s=!0),e.c&&(n.c=e.c),e.a&&(n.a=e.a),e.m&&(n.m=e.m),n}function BD(t){const e=[];!0!==t.b&&1!==t.b||e.push({type:"bold"}),t.i&&e.push({type:"italic"}),t.u&&e.push({type:"underline"}),t.s&&e.push({type:"strike"});const n=DD(t.a);void 0!==n&&e.push({type:"link",attrs:{href:n}});const r=!1===t.b||0===t.b;if(t.c||r){const n={};t.c&&(n.color=t.c),r&&(n.fontWeight="normal"),e.push({type:"textStyle",attrs:n})}return e}function $D(t,e,n){const r=BD(n),o=e.split("\n");o.forEach((e,n)=>{e.length>0&&t.push(r.length?{type:"text",text:e,marks:r}:{type:"text",text:e}),n<o.length-1&&t.push({type:"hardBreak"})})}function RD(t,e,n){const r=[],o=e.length>0?e:[{n:t.length}];let i=0;for(const e of o){if(i>=t.length)break;if(!Number.isFinite(e.n)||e.n<=0)continue;const o=Math.min(i+e.n,t.length),s=t.slice(i,o),a=void 0===e.m?void 0:n?.(e.m);if(void 0!==e.m&&void 0!==a){const t=BD({n:e.n,c:e.c}),n={type:"runSvg",attrs:{id:e.m,tex:s,w:a.w,h:a.h,dy:a.dy}};t.length>0&&(n.marks=t),r.push(n)}else $D(r,s,e);i=o}return i<t.length&&$D(r,t.slice(i),{n:t.length-i}),r}const PD=JSON.parse('{"Lm":{"0":"⁰","1":"¹","2":"²","3":"³","4":"⁴","5":"⁵","6":"⁶","7":"⁷","8":"⁸","9":"⁹","n":"ⁿ","i":"ⁱ","+":"⁺","-":"⁻","=":"⁼","(":"⁽",")":"⁾"},"iH":{"0":"₀","1":"₁","2":"₂","3":"₃","4":"₄","5":"₅","6":"₆","7":"₇","8":"₈","9":"₉","a":"ₐ","e":"ₑ","h":"ₕ","i":"ᵢ","j":"ⱼ","k":"ₖ","l":"ₗ","m":"ₘ","n":"ₙ","o":"ₒ","p":"ₚ","r":"ᵣ","s":"ₛ","t":"ₜ","u":"ᵤ","v":"ᵥ","x":"ₓ","+":"₊","-":"₋","=":"₌","(":"₍",")":"₎"},"II":[["+/-","±"],["<=","≤"],[">=","≥"],["!=","≠"],["+-","±"],["->
1","→"]],"aL":{"sqrt":"√","pi":"π","infinity":"∞"},"Hn":"×","Rd":"−"}'),FD=new Set(["(",")"]),zD=/[\p{L}\p{N})]/u,HD=/[\p{L}\p{N}(]/u,jD=/[\p{L}\p{N}]/u,UD=/\p{N}/u;function VD(t,e,n){const r=t[e];if("^"!==r&&"_"!==r)return null;const o="^"===r?PD.Lm:PD.iH;return"("===t[e+1]?function(t,e,n){const r=function(t,e){let n=0;for(let r=e;r<t.length;r+=1)if("("===t[r]&&(n+=1),")"===t[r]&&(n-=1),0===n)return r;return-1}(t,e+1);if(r<0||r===e+2)return null;const o=[...t.slice(e+1,r+1)];return o.some(t=>void 0===n[t])?null:{text:o.map(t=>n[t]).join(""),end:r+1,charSources:qD(e+1,r+1)}}(t,e,o):function(t,e,n,r){let o=e+1;const i=t=>FD.has(t)||"="===t||("+"===t||"-"===t)&&o>e+1;let s="";for(;o<t.length&&void 0!==n[t[o]]&&!i(t[o]);)s+=n[t[o]],o+=1;const a=o<t.length?t[o]:r?.next;if(0===s.length)return null;if(void 0!==a&&jD.test(a)){const n=[...t.slice(e+1,o)];if(!n.some(t=>UD.test(t))||!n.every((t,e)=>UD.test(t)||0===e&&("+"===t||"-"===t))||UD.test(a))return null}return{text:s,end:o,charSources:qD(e+1,o)}}(t,e,o,n)}function qD(t,e){return Array.from({length:e-t},(e,n)=>t+n)}function WD(t,e){for(const[n,r]of PD.II)if(t.startsWith(n,e))return{text:r,length:n.length};return null}function JD(t,e,n){const r=e>0?t[e-1]:n?.prev;if(void 0!==r&&jD.test(r))return null;for(const[r,o]of Object.entries(PD.aL)){if(!t.startsWith(r,e))continue;const i=e+r.length<t.length?t[e+r.length]:n?.next;if(void 0===i||!jD.test(i))return{text:o,length:r.length}}return null}function GD(t,e){if("*"!==t[e])return!1;const n=" "===t[e-1]?t[e-2]:t[e-1],r=" "===t[e+1]?t[e+2]:t[e+1];return void 0!==n&&void 0!==r&&zD.test(n)&&HD.test(r)}function KD(t,e){return"-"===t[e]&&" "===t[e-1]&&" "===t[e+1]}const YD=tO(PD.Lm),QD=tO(PD.iH),ZD={"÷":"\\div","·":"\\cdot","∓":"\\mp","°":"^{\\circ}","∑":"\\sum","∏":"\\prod","∫":"\\int","∂":"\\partial","≈":"\\approx","≡":"\\equiv","∈":"\\in","∅":"\\emptyset","…":"\\dots","⇒":"\\Rightarrow","←":"\\gets",...Object.fromEntries(PD.II.map(([,t])=>{return[t,(e=t,{"±":"\\pm","≤":"\\le","≥":"\\ge","≠":"\\ne","→":"\\to"}[e]??e)];var e})),...Object.fromEntries(Object.entries(PD.aL).map(([t,e])=>[e,`\\${"infinity"===t?"infty":t}`])),[PD.Hn]:"\\times",[PD.Rd]:"-"},XD=/[\p{L}\p{N}]/u;function tO(t){return Object.fromEntries(Object.entries(t).map(([t,e])=>[e,t]))}function eO(t){let e="",n=0;for(;n<t.length;){if("\\"===t[n]){const r=nO(t,n);e+=r.tex,n=r.end;continue}const r=oO(t,n);if(r){e+=r.tex,n=r.end;continue}const o=t[n];if("√"===o){const r=iO(t,n+1);e+=r.tex,n=r.end;continue}const i=ZD[o];e+=void 0!==i?`${i} `:sO(o,t,n),n+=1}return e}function nO(t,e){let n=e+1;for(;n<t.length&&/[a-zA-Z]/.test(t[n]);)n+=1;for((n===e+1&&n<t.length||"*"===t[n])&&(n+=1);;){let r=n;for(;" "===t[r];)r+=1;const o=t[r];if("{"!==o&&"["!==o)break;const i=rO(t,r,o,"{"===o?"}":"]");if(i<0)return{tex:t.slice(e),end:t.length};n=i+1}const r=/^\\begin\s*\{([^{}]*)\}/.exec(t.slice(e,n));if(null!==r){const e=function(t,e,n){const r=`\\begin{${n}}`,o=`\\end{${n}}`;let i=1,s=e;for(;s<t.length;){const e=t.indexOf(o,s);if(e<0)return-1;const n=t.indexOf(r,s);if(n>=0&&n<e)i+=1,s=n+r.length;else if(i-=1,s=e+o.length,0===i)return s}return-1}(t,n,r[1]);n=e<0?t.length:e}return{tex:t.slice(e,n),end:n}}function rO(t,e,n,r){let o=0;for(let i=e;i<t.length;i+=1)if(t[i]===n&&(o+=1),t[i]===r&&(o-=1),0===o)return i;return-1}function oO(t,e){const n=void 0!==YD[t[e]],r=n?YD:QD;if(void 0===r[t[e]])return null;let o=e,i="";for(;o<t.length&&void 0!==r[t[o]];)i+=r[t[o]],o+=1;return{tex:`${0===e?"{}":""}${n?"^":"_"}{${i}}`,end:o}}function iO(t,e){if("("===t[e]){const n=t.indexOf(")",e+1);if(n>e+1)return{tex:`\\sqrt{${eO(t.slice(e+1,n))}}`,end:n+1}}const n=/^[0-9.]+/.exec(t.slice(e));return null!==n?{tex:`\\sqrt{${n[0]}}`,end:e+n[0].length}:void 0!==t[e]&&/\p{L}/u.test(t[e])?{tex:`\\sqrt{${t[e]}}`,end:e+1}:{tex:"\\surd ",end:e}}function sO(t,e,n){return"%&#{}".includes(t)?`\\${t}`:"~"===t?"\\textasciitilde{}":"_"===t&&XD.test(e[n-1]??"")&&/\p{L}/u.test(e[n+1]??"")?"\\_":t}const aO="• ",lO=/^(\d{1,3})\. /;function cO(t){return`${Math.min(t+1,999)}. `}function dO(t,e,n){return function(t){const e=t.firstChild;if(!e)return[];const n=[];let r=1,o=r,i="";return e.forEach(t=>{if("hardBreak"===t.type.name)return n.push({start:o,end:r,text:i}),r+=t.nodeSize,o=r,void(i="");t.isText&&(i+=t.text??""),r+=t.nodeSize}),n.push({start:o,end:r,text:i}),n}(t).filter(t=>t.start<=n&&t.end>=e)}function uO(t){return t.startsWith(aO)?"bullet":lO.test(t)?"ordered":"none"}function hO(t){return t.startsWith(aO)?2:lO.exec(t)?.[0].length??0}function pO(t){const{from:e,to:n}
1=t.state.selection,r=dO(t.state.doc,e,n);if(0===r.length)return{bullet:!1,numbered:!1,listMixed:!1};const o=new Set(r.map(t=>uO(t.text)));return{bullet:1===o.size&&o.has("bullet"),numbered:1===o.size&&o.has("ordered"),listMixed:o.size>1}}let fO=null;function gO(t,e){const n=[];for(const r of t){const t=r.type.name;if("bold"===t||"italic"===t||"underline"===t||"strike"===t){const r=e.marks[t];r&&n.push(r.create())}else if("textStyle"===t){const t=e.marks.textStyle;if(!t)continue;const o=OD(r.attrs?.color);void 0!==o&&n.push(t.create({color:o}))}else if("link"===t){const t=e.marks.link;if(!t)continue;const o=DD(r.attrs?.href);void 0!==o&&n.push(t.create({href:o}))}}return n}function mO(t,e){const n=(new window.DOMParser).parseFromString(t,"text/html"),r={inline:[],labelSchema:e,firstBlock:!0,marker:null};return AO(yt.fromSchema((fO||(fO=Da([pA,iE,cE,rw,iw,ES,qS,MS,Gv,AC,wC,vC,gD,AD,bS,SD])),fO)).parse(n.body),r),r.inline}function AO(t,e){if(t.isTextblock)return void function(t,e){const{inline:n,labelSchema:r}=e;e.firstBlock||n.push(r.nodes.hardBreak.create()),e.firstBlock=!1,null!==e.marker&&(n.push(r.text(e.marker)),e.marker=null),t.forEach(t=>{if(t.isText&&t.text)n.push(r.text(t.text,gO(t.marks,r)));else if("hardBreak"===t.type.name)n.push(r.nodes.hardBreak.create());else if("runSvg"===t.type.name){const e=String(t.attrs.tex??"");e.length>0&&n.push(r.text(e,gO(t.marks,r)))}})}(t,e);const n="orderedList"===t.type.name,r=n||"bulletList"===t.type.name,o=n?Number(t.attrs.start??1):1;t.forEach((t,i,s)=>{r&&(e.marker=n?cO(s+o-1):"• "),AO(t,e)})}function yO(t,e){if(0===e.length)return;const{state:n}=t,r=[],o=e.replace(/\r\n?/g,"\n").split("\n");o.forEach((t,e)=>{t.length>0&&r.push(n.schema.text(t)),e<o.length-1&&r.push(n.schema.nodes.hardBreak.create())});const i=new N(M.fromArray(r),0,0);t.dispatch(n.tr.replaceSelection(i))}const bO=hA.extend({content:"paragraph"}),vO=Tl.create({name:"labelHistoryKeymap",addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo()}}}),wO=gD.extend({addAttributes(){return{...this.parent?.(),fontWeight:{default:null,parseHTML:t=>TD(t.style.fontWeight)?"normal":null,renderHTML:t=>t.fontWeight?{style:`font-weight: ${t.fontWeight}`}:{}}}}});function kO(t,e){return e.target instanceof Element&&null!==e.target.closest("a")&&(e.preventDefault(),!1)}const CO=bS.extend({addProseMirrorPlugins(){return[...this.parent?.()??[],new Ve({props:{handleDOMEvents:{click:kO,auxclick:kO}}})]}}).configure({openOnClick:!1,autolink:!1,linkOnPaste:!1,defaultProtocol:"https",protocols:["http","https"],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow"}});function xO(t){const e=[],n=t.replace(/\r\n?/g,"\n").split("\n");return n.forEach((t,r)=>{t.length>0&&e.push({type:"text",text:t}),r<n.length-1&&e.push({type:"hardBreak"})}),e}function SO(t){return{type:"doc",content:[t.length>0?{type:"paragraph",content:t}:{type:"paragraph"}]}}function EO(t){return SO(xO(t))}function MO(t){return"hardBreak"===t.type.name?"\n":"runSvg"===t.type.name?String(t.attrs.tex??""):""}function TO(t){if(!t)return{};try{const e=JSON.parse(t);if("object"!=typeof e||null===e)return{};const n={};for(const[t,r]of Object.entries(e)){const e={w:Number(r?.w),h:Number(r?.h),dy:Number(r?.dy)};Number.isFinite(e.w)&&Number.isFinite(e.h)&&Number.isFinite(e.dy)&&e.w>0&&e.h>0&&(n[t]=e)}return n}catch{return{}}}function _O(t){if(!t)return[];try{const e=JSON.parse(t);if(!Array.isArray(e))return[];for(const t of e){if("object"!=typeof t||null===t)return[];const e=t.n;if(!Number.isInteger(e)||e<=0)return[]}return e}catch{return[]}}class DO{constructor(t,e,n,r){this._resolveRunSvg=t=>this.runSvgs[t],this.richText=r?.richText??!1,this.runSvgs=TO(r?.initialRunSvgsJson);const o=[bO,iE,cE,(i=this.richText,rw.extend({priority:1001,addKeyboardShortcuts(){const t=()=>i&&function(t){const{from:e,to:n,empty:r}=t.state.selection,o=dO(t.state.doc,e,n)[0];if(void 0===o)return!1;const i=uO(o.text);if("none"===i)return!1;const s=hO(o.text);if(r&&o.text.length===s)return t.view.dispatch(t.state.tr.delete(o.start,o.start+s)),!0;if(r&&e<o.start+s)return t.view.dispatch(t.state.tr.insert(o.start,t.schema.nodes.hardBreak.create())),!0;const a="bullet"===i?aO:(l=o.text,cO(Number.parseInt(lO.exec(l)?.[1]??"0",10)));var l;return t.chain().setHardBreak().command(({tr:e,dispatch:n})=>(n&&e.insert(e.selection.from,t.schema.text(a)),!0)).run()}(this.editor)||this.editor.commands.setHardBreak();return{Enter:t,"Shift-Enter":t,"Mod-Enter":t}}})),iT,vO];var i;this.richText&&o.push(Gv,AC,wC,vC,wO,AD,CO,SD);const s=this.richText&&r?.initialRunsJson?SO(RD(e,_O(r.initialRunsJson),this._resolveRunSvg)):EO(e);this.editor=new Hl({element:t,extensions:o,content:s,autofocus:!1,enableInputRules:!1,enablePasteRules:!1,editorProps:{attributes:{class:"label-editor-inner"},handlePaste:(t,e)=>this._handlePaste(t,e),handleDrop:()=>!0},onUpdate:()=>{n.onUpdate?.()},onSelectionUpdate:()=>{n.onSelectionUpdate?.()},onBlur:()=>{n.onBlur?.()}})}getText(){const t=this.editor.state.doc;return t.textBetween(0,t.content.size,"\n",MO)}getRunsJson(){return JSON.stringify(function(t){const e=[],n=[];
1t.descendants(t=>{if("hardBreak"===t.type.name)e.push({b:null,i:!1,u:!1,s:!1}),n.push(1);else if("runSvg"===t.type.name){const r=String(t.attrs.tex??""),o={b:null,i:!1,u:!1,s:!1,m:String(t.attrs.id??"")},i=ID(t.marks).c;void 0!==i&&(o.c=i),e.push(o),n.push(r.length)}else t.isText&&(e.push(ID(t.marks)),n.push(t.text?.length??0));return!0});const r=[];let o=null,i=0;for(let t=0;t<e.length;t++)0!==n[t]&&(o&&ND(o,e[t])?i+=n[t]:(o&&r.push(LD(i,o)),o=e[t],i=n[t]));return o&&r.push(LD(i,o)),0===r.length||1===r.length&&function(t){return!(void 0!==t.b||t.i||t.u||t.s||t.c||t.a||t.m)}(r[0])?[]:r}(this.editor.state.doc))}setText(t){this.editor.commands.setContent(EO(t),{emitUpdate:!1})}setContent(t,e,n){void 0!==n&&(this.runSvgs=TO(n));const r=this.richText?RD(t,_O(e),this._resolveRunSvg):xO(t);this.editor.commands.setContent(SO(r),{emitUpdate:!1})}setRunBold(){this.editor.schema.marks.bold&&this.editor.chain().focus().setMark("bold").setMark("textStyle",{fontWeight:null}).run()}setRunNotBold(){this.editor.schema.marks.textStyle&&this.editor.chain().focus().unsetMark("bold").setMark("textStyle",{fontWeight:"normal"}).run()}clearRunBold(){this.editor.schema.marks.textStyle&&this.editor.chain().focus().unsetMark("bold").setMark("textStyle",{fontWeight:null}).run()}toggleItalic(){this._toggleMark("italic")}toggleUnderline(){this._toggleMark("underline")}toggleStrike(){this._toggleMark("strike")}setColor(t){if(!this.editor.schema.marks.textStyle)return;const e=_D(t);void 0!==e?this.editor.chain().focus().setColor(e).run():this.unsetColor()}unsetColor(){this.editor.schema.marks.textStyle&&this.editor.chain().focus().unsetColor().run()}setLink(t){if(!this.editor.schema.marks.link)return;const e=DD(t);void 0!==e&&this.editor.chain().focus().extendMarkRange("link").setLink({href:e}).run()}unsetLink(){this.editor.schema.marks.link&&this.editor.chain().focus().extendMarkRange("link").unsetLink().run()}cycleListMarkers(){this.richText&&(this.editor.commands.focus(),function(t){const{from:e,to:n}=t.state.selection,r=dO(t.state.doc,e,n);if(0===r.length)return;const o=function(t){return t.every(t=>"bullet"===uO(t.text))?"ordered":t.every(t=>"ordered"===uO(t.text))?"none":"bullet"}(r),i=t.state.tr;for(let e=r.length-1;e>=0;e--){const n=r[e],s=hO(n.text);if(s>0&&i.delete(n.start,n.start+s),"none"===o)continue;const a="bullet"===o?aO:cO(e);i.insert(n.start,t.schema.text(a))}t.view.dispatch(i)}(this.editor))}formatSelectionAsMath(){const{from:t,to:e,empty:n}=this.editor.state.selection;if(n)return!1;if(this._selectionHasFormula())return!1;const r=this.editor.state.doc,o=this._selectedChars(t,e),i=o.map(t=>t.text).join(""),s=function(t,e){if(t.includes("\\"))return 0===t.length?[]:[{text:t,sourceStart:0,sourceEnd:t.length}];const n=[];let r=0,o=0;const i=(e,i,s)=>{r<o&&n.push({text:t.slice(r,o),sourceStart:r,sourceEnd:o}),n.push({text:i,sourceStart:o,sourceEnd:e,...s?{charSources:s}:{}}),o=e,r=e};for(;o<t.length;){const n=VD(t,o,e);if(n){i(n.end,n.text,n.charSources);continue}const r=WD(t,o);if(r){i(o+r.length,r.text);continue}const s=JD(t,o,e);s?i(o+s.length,s.text):GD(t,o)?i(o+1,PD.Hn):KD(t,o)?i(o+1,PD.Rd):o+=1}return r<t.length&&n.push({text:t.slice(r),sourceStart:r,sourceEnd:t.length}),n}(i,{prev:r.textBetween(Math.max(0,t-1),t)||void 0,next:r.textBetween(e,Math.min(r.content.size,e+1))||void 0}),a=s.filter(t=>t.text!==i.slice(t.sourceStart,t.sourceEnd));if(0===a.length)return!1;const l=o[0].pos,c=s.reduce((t,e)=>t+e.text.length,0);return this.editor.chain().focus().command(({tr:t,state:e})=>{for(let n=a.length-1;n>=0;n-=1){const r=a[n];t.replaceWith(o[r.sourceStart].pos,o[r.sourceEnd-1].pos+1,this._styledSegmentNodes(r,o,e.schema))}return t.setSelection(_e.create(t.doc,l,l+c)),!0}).run(),!0}_styledSegmentNodes(t,e,n){const r=n=>e[t.charSources?.[n]??t.sourceStart].marks,o=[];let i=0;for(let e=1;e<=t.text.length;e+=1)e<t.text.length&&O.sameSet(r(e),r(i))||(o.push(n.text(t.text.slice(i,e),r(i))),i=e);return o}_selectedChars(t,e){const n=[];return this.editor.state.doc.nodesBetween(t,e,(r,o)=>{if(r.isText){const i=r.text??"";for(let s=0;s<i.length;s+=1)o+s>=t&&o+s<e&&n.push({text:i[s],pos:o+s,marks:[...r.marks]})}else"hardBreak"===r.type.name&&o>=t&&o<e&&n.push({text:"\n",pos:o,marks:[]});return!0}),n}insertFormula(t,e,n,r,o){const i=e.replace(/(^|[^\\])%[^\n]*/g,"$1").replace(/\n/g," ").trim();if(!this.editor.schema.nodes.runSvg||0===i.length)return!1;const s={w:n,h:r,dy:o};this.runSvgs={...this.runSvgs,[t]:s};const a=this.editor.schema.nodes.runSvg.create({id:t,tex:i,w:s.w,h:s.h,dy:s.dy},null,this._replacedContentMarks()),l=this._selectionInsideBoundaryWhitespace();return this.editor.chain().focus().command(({tr:t})=>(null!==l&&t.setSelection(_e.create(t.doc,l.from,l.to)),!0)).insertContent(a.toJSON()).run(),!0}_replacedContentMarks(){const{selection:t}=this.editor.state;if(t instanceof Oe)return[...t.node.marks];let e=null;return this.editor.state.doc.nodesBetween(t.from,t.to,t=>("runSvg"===t.type.name&&null===e&&(e=[...t.marks]),null===e)),e??this._selectedChars(t.from,t.to)[0]?.marks??[]}_selectionInsideBoundaryWhitespace(){const{selection:t}=this.editor.state;if(!(t instanceof _e)||t.empty)return null;const e=this.editor.state.doc,n=t=>/^\s$/.test(e.textBetween(t,t+1));let r=t.from,o=t.to;for(;r<o&&n(r);)r+=1;for(;o>r&&n(o-1);)o-=1;return r===t.from&&o===t.to||r>=o?null:{from:r,to:o}}removeFormula(){const{from:t,to:e}=this.editor.state.selection;let n=null,r=-1;if(this.editor.state.doc.nodesBetween(t,e,(t,e)=>("runSvg"===t.type.name&&r<0&&(n=t,r=e),!0)),null===n)return!1;const o=String(n.attrs.tex??""),i=r+n.nodeSize;return 0!==o.length&&(this.editor.chain().focus().command(({tr:t,state:e})=>(t.replaceWith(r,i,e.schema.text(o,n.marks)),t.setSelection(_e.create(t.doc,r,r+o.length)),!0)).run(),!0)}getSelectionTexSource(){const{from:t,to:e,empty:n}=this.editor.state.selection;if(n)return"";let r="";return this.editor.state.doc.nodesBetween(t,e,(n,o)=>
1{if("runSvg"===n.type.name)r+=String(n.attrs.tex??"");else if(n.isText){const i=n.text??"";r+=i.slice(Math.max(0,t-o),Math.max(0,Math.min(i.length,e-o)))}else n.isLeaf&&o>=t&&o<e&&(r+=" ");return!0}),eO(r)}_selectionHasFormula(){const{from:t,to:e}=this.editor.state.selection;let n=!1;return this.editor.state.doc.nodesBetween(t,e,t=>("runSvg"===t.type.name&&(n=!0),!n)),n}getSelectionStateJson(){const t=this.editor.state.selection;return JSON.stringify({empty:t.empty,bold:this.editor.isActive("bold"),notBold:TD(this.editor.getAttributes("textStyle").fontWeight),italic:this.editor.isActive("italic"),underline:this.editor.isActive("underline"),strike:this.editor.isActive("strike"),...pO(this.editor),...this._selectionAttrs(),...this._formulaState()})}refocus(){this.editor.view.focus()}focusEnd(){this.editor.isFocused||this.editor.chain().focus("end",{scrollIntoView:!1}).run()}focusAtCoords(t,e){const n=this.editor.view.posAtCoords({left:t,top:e});this.editor.chain().focus(n?n.pos:"end",{scrollIntoView:!1}).run()}getDom(){return this.editor.view.dom}getEditor(){return this.editor}destroy(){this.editor.destroy()}_toggleMark(t){this.editor.schema.marks[t]&&this.editor.chain().focus().toggleMark(t).run()}_formulaState(){const{from:t,to:e}=this.editor.state.selection;let n=null,r=0,o=!1;if(this.editor.state.doc.nodesBetween(t,e,(i,s)=>("runSvg"===i.type.name?(n=i,r+=1):i.isText?Math.min(s+(i.text??"").length,e)-Math.max(s,t)>0&&(o=!0):i.isLeaf&&s>=t&&s<e&&(o=!0),!0)),null===n||1!==r)return{svgId:null,formulaTex:null,formulaOnly:!1};const i=n.attrs;return{svgId:String(i.id??""),formulaTex:String(i.tex??""),formulaOnly:!o}}_selectionAttrs(){const{from:t,to:e,empty:n}=this.editor.state.selection;if(n)return{color:this.editor.getAttributes("textStyle").color??null,colorMixed:!1,href:DD(this.editor.getAttributes("link").href)??null,hrefMixed:!1};const r=new Set,o=new Set;return this.editor.state.doc.nodesBetween(t,e,t=>{if(!t.isText&&"runSvg"!==t.type.name)return!0;let e,n;for(const r of t.marks)"textStyle"===r.type.name&&(e=r.attrs.color??void 0),"link"===r.type.name&&(n=DD(r.attrs.href));return r.add(e),o.add(n),!0}),{color:1===r.size?[...r][0]??null:null,colorMixed:r.size>1,href:1===o.size?[...o][0]??null:null,hrefMixed:o.size>1}}_handlePaste(t,e){return this.richText?function(t,e){e.preventDefault();const n=e.clipboardData;if(!n)return!0;if(YM(n))return!0;const r=n.getData("text/html")??"",o=n.getData("text/plain")??"";if(function(t,e,n){const{state:r}=t,o=r.schema.marks.link;if(void 0===o||r.selection.empty)return!1;const i=n.trim(),s=DD(i)??(/^www\.\S+$/.test(i)?DD(`https://${i}`):void 0);if(void 0===s||!function(t,e){return 0===t.trim().length||((new window.DOMParser).parseFromString(t,"text/html").body.textContent??"").trim()===e}(e,i))return!1;const{from:a,to:l}=r.selection;return t.dispatch(r.tr.addMark(a,l,o.create({href:s}))),!0}(t,r,o))return!0;if(r.trim().length>0){const e=mO(r,t.state.schema);if(e.length>0){const n=new N(M.fromArray(e),0,0);return t.dispatch(t.state.tr.replaceSelection(n)),!0}}return yO(t,o),!0}(t,e):(e.preventDefault(),yO(t,e.clipboardData?.getData("text/plain")??""),!0)}}function OO(t){return Hf(t)}},6287(t,e,n){var r=n(1354),o=n.n(r),i=n(6314),s=n.n(i),a=n(4417),l=n.n(a),c=new URL(n(5188),n.b),d=new URL(n(4340),n.b),u=new URL(n(8507),n.b),h=new URL(n(1443),n.b),p=new URL(n(2404),n.b),f=new URL(n(1204),n.b),g=new URL(n(3523),n.b),m=new URL(n(443),n.b),A=new URL(n(3556),n.b),y=new URL(n(5492),n.b),b=new URL(n(8881),n.b),v=new URL(n(7693),n.b),w=new URL(n(3229),n.b),k=new URL(n(3758),n.b),C=new URL(n(3859),n.b),x=new URL(n(7963),n.b),S=new URL(n(1261),n.b),E=new URL(n(5973),n.b),M=new URL(n(798),n.b),T=new URL(n(1890),n.b),_=new URL(n(7589),n.b),D=new URL(n(8145),n.b),O=new URL(n(6241),n.b),I=new URL(n(8157),n.b),N=new URL(n(850),n.b),L=new URL(n(4029),n.b),B=new URL(n(644),n.b),$=new URL(n(8019),n.b),R=new URL(n(3115),n.b),P=new URL(n(6941),n.b),F=new URL(n(6745),n.b),z=new URL(n(8138),n.b),H=new URL(n(4654),n.b),j=new URL(n(2274),n.b),U=new URL(n(8502),n.b),V=new URL(n(8504),n.b),q=new URL(n(1142),n.b),W=s()(o());W.push([t.id,"@import url(https://fonts.googleapis.com/css2?family=Inconsolata:wght@400&display=swap);"]);var J=l()(c),G=l()(d),K=l()(u),Y=l()(h),Q=l()(p),Z=l()(f),X=l()(g),tt=l()(m),et=l()(A),nt=l()(y),rt=l()(b),ot=l()(v),it=l()(w),st=l()(k),at=l()(C),lt=l()(x),ct=l()(S),dt=l()(E),ut=l()(M),ht=l()(T),pt=l()(_),ft=l()(D),gt=l()(O),mt=l()(I),At=l()(N),yt=l()(L),bt=l()(B),vt=l()($),wt=l()(R),kt=l()(P),Ct=l()(F),xt=l()(z),St=l()(H),Et=l()(j),Mt=l()(U),Tt=l()(V),_t=l()(q);W.push([t.id,`span[data-name=anchor-mark] .anchor-highlighted-syncWithText{background-color:rgba(26,198,255,.2)}@keyframes heading-icon-intro{from{opacity:0;transform:translateX(8px)}to{opacity:1;transform:translateX(0)}}@keyframes heading-icon-exit{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(8px)}}.text-editor-content-inner h1,.text-editor-content-inner h2,.text-editor-content-inner h3,.text-editor-content-inner h4,.text-editor-content-inner h5,.text-editor-content-inner h6,.text-editor-content-inner p.title{position:relative}.text-editor-content-inner .heading-icon{display:none;position:absolute;
1left:0;align-items:center;justify-content:center;user-select:none;cursor:pointer;transition:transform .15s ease-out,opacity .15s ease-out}.text-editor-content-inner .heading-icon svg{display:block;width:100%;height:100%}.text-editor-content-inner .heading-icon svg path,.text-editor-content-inner .heading-icon svg rect,.text-editor-content-inner .heading-icon svg circle,.text-editor-content-inner .heading-icon svg ellipse,.text-editor-content-inner .heading-icon svg line,.text-editor-content-inner .heading-icon svg polyline,.text-editor-content-inner .heading-icon svg polygon{fill:none;stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.heading-icons-enabled .text-editor-content-inner .heading-icon.has-icon{display:inline-flex;opacity:1;animation:heading-icon-intro .4s ease-out}.heading-icons-enabled .text-editor-content-inner .heading-icon.has-icon svg path,.heading-icons-enabled .text-editor-content-inner .heading-icon.has-icon svg rect,.heading-icons-enabled .text-editor-content-inner .heading-icon.has-icon svg circle,.heading-icons-enabled .text-editor-content-inner .heading-icon.has-icon svg ellipse,.heading-icons-enabled .text-editor-content-inner .heading-icon.has-icon svg line,.heading-icons-enabled .text-editor-content-inner .heading-icon.has-icon svg polyline,.heading-icons-enabled .text-editor-content-inner .heading-icon.has-icon svg polygon{stroke:#484848}.night .heading-icons-enabled .text-editor-content-inner .heading-icon.has-icon svg path,.night .heading-icons-enabled .text-editor-content-inner .heading-icon.has-icon svg rect,.night .heading-icons-enabled .text-editor-content-inner .heading-icon.has-icon svg circle,.night .heading-icons-enabled .text-editor-content-inner .heading-icon.has-icon svg ellipse,.night .heading-icons-enabled .text-editor-content-inner .heading-icon.has-icon svg line,.night .heading-icons-enabled .text-editor-content-inner .heading-icon.has-icon svg polyline,.night .heading-icons-enabled .text-editor-content-inner .heading-icon.has-icon svg polygon{stroke:#e0e0e0}.heading-icons-enabled .text-editor-content-inner .heading-icon.has-preview{display:inline-flex;opacity:0}.heading-icons-enabled .text-editor-content-inner .heading-icon.has-preview svg path,.heading-icons-enabled .text-editor-content-inner .heading-icon.has-preview svg rect,.heading-icons-enabled .text-editor-content-inner .heading-icon.has-preview svg circle,.heading-icons-enabled .text-editor-content-inner .heading-icon.has-preview svg ellipse,.heading-icons-enabled .text-editor-content-inner .heading-icon.has-preview svg line,.heading-icons-enabled .text-editor-content-inner .heading-icon.has-preview svg polyline,.heading-icons-enabled .text-editor-content-inner .heading-icon.has-preview svg polygon{stroke:#1ac6ff}.text-editor-content-inner h1.has-focus:hover .heading-icon.has-preview,.text-editor-content-inner h2.has-focus:hover .heading-icon.has-preview,.text-editor-content-inner h3.has-focus:hover .heading-icon.has-preview,.text-editor-content-inner h4.has-focus:hover .heading-icon.has-preview,.text-editor-content-inner h5.has-focus:hover .heading-icon.has-preview,.text-editor-content-inner h6.has-focus:hover .heading-icon.has-preview,.text-editor-content-inner p.title.has-focus:hover .heading-icon.has-preview{opacity:.6;transition-delay:.12s}.text-editor-content-inner h1.has-focus:hover .heading-icon.has-preview:hover,.text-editor-content-inner h2.has-focus:hover .heading-icon.has-preview:hover,.text-editor-content-inner h3.has-focus:hover .heading-icon.has-preview:hover,.text-editor-content-inner h4.has-focus:hover .heading-icon.has-preview:hover,.text-editor-content-inner h5.has-focus:hover .heading-icon.has-preview:hover,.text-editor-content-inner h6.has-focus:hover .heading-icon.has-preview:hover,.text-editor-content-inner p.title.has-focus:hover .heading-icon.has-preview:hover{opacity:.8}.text-editor-content-inner h1:focus-within .heading-icon.has-preview,.text-editor-content-inner h2:focus-within .heading-icon.has-preview,.text-editor-content-inner h3:focus-within .heading-icon.has-preview,.text-editor-content-inner h4:focus-within .heading-icon.has-preview,.text-editor-content-inner h5:focus-within .heading-icon.has-preview,.text-editor-content-inner h6:focus-within .heading-icon.has-preview,.text-editor-content-inner p.title:focus-within .heading-icon.has-preview{opacity:.6}.autographics-active .text-editor-content-inner h1.has-focus:hover .heading-icon.has-preview,.autographics-active .text-editor-content-inner h2.has-focus:hover .heading-icon.has-preview,.autographics-active .text-editor-content-inner h3.has-focus:hover .heading-icon.has-preview,.autographics-active .text-editor-content-inner h4.has-focus:hover .heading-icon.has-preview,.autographics-active .text-editor-content-inner h5.has-focus:hover .heading-icon.has-preview,.autographics-active .text-editor-content-inner h6.has-focus:hover .heading-icon.has-preview,.autographics-active .text-editor-content-inner p.title.has-focus:hover .heading-icon.has-preview,.autographics-active .text-editor-content-inner h1:focus-within .heading-icon.has-preview,.autographics-active .text-editor-content-inner h2:focus-within .heading-icon.has-preview,.autographics-active .text-editor-content-inner h3:focus-within .heading-icon.has-preview,.autographics-active .text-editor-content-inner h4:focus-within .heading-icon.has-preview,.autographics-active .text-editor-content-inner h5:focus-within .heading-icon.has-preview,.autographics-active .text-editor-content-inner h6:focus-within .heading-icon.has-preview,.autographics-active .text-editor-content-inner p.title:focus-within .heading-icon.has-preview{opacity:0 !important;pointer-events:none}.text-editor-content-inner p.title .heading-icon{width:36px;height:36px;left:-48px;top:30px}.text-editor-content-inner p.title .heading-icon svg{width:36px;height:36px}.text-editor-content-inner h1 .heading-icon{width:32px;height:32px;left:-44px;top:32px}.text-editor-content-inner h1 .heading-icon svg{width:32px;height:32px}.text-editor-content-inner h2 .heading-icon{width:28px;height:28px;left:-40px;top:16px}.text-editor-content-inner h2 .heading-icon svg{width:28px;height:28px}.text-editor-content-inner h3 .heading-icon,.text-editor-content-inner h4 .heading-icon,.text-editor-content-inner h5 .heading-icon,.text-editor-content-inner h6 .heading-icon{width:24px;height:24px;left:-36px;top:0px}.text-editor-content-inner h3 .heading-icon svg,.text-editor-content-inner h4 .heading-icon svg,.text-editor-content-inner h5 .heading-icon svg,.text-editor-content-inner h6 .heading-icon svg{width:24px;height:24px}.text-editor-content-inner .heading-icon:focus-visible{outline:none}.text-editor-content-inner .heading-icon:hover{transform:scale(1.25)}.text-editor-content-inner .heading-icon--exiting{animation:heading-icon-exit .3s ease-out forwards}.text-editor-content-inner .heading-icon--empty{opacity:.3}.text-editor-content-inner .heading-icon--empty:hover{opacity:.6}.heading-icon-menu{display:flex;visibility:hidden;position:fixed;z-index:1000;pointer-events:none}.heading-icon-menu .items-holder{display:grid;grid-template-columns:repeat(2, 36px);grid-template-rows:auto;gap:0px;margin:6px}.heading-icon-menu .border{position:relative;border:1px solid;border-radius:16px;padding:4px;backdrop-filter:blur(4px);box-sizing:border-box;background-color:rgba(255,255,255,.8);border-color:#1ac6ff;box-shadow:0px 4px 4px 0px rgba(0,0,0,.1),0px 0px 8px 0px rgba(0,0,0,.05)}.night .heading-icon-menu .border{background-color:rgba(65,87,104,.8);border-color:#1ac6ff;box-shadow:0px 4px 4px 0px rgba(255,255,255,.1),0px 0px 8px 0px rgba(255,255,255,.05);backdrop-filter:blur(7.5px)}.heading-icon-menu .border::after{content:"";display:block;position:absolute;border:1px solid;border-width:0 1px 1px 0;border-top-left-radius:10px;border-color:#1ac6ff;background-color:rgba(255,255,255,.8);width:8px;height:8px;right:0;top:50%;transform:translate(5px, -4.25px) rotate(315deg)}.night .heading-icon-menu .border::after{border-color:#1ac6ff;background-color:rgba(65,87,104,.8)}.heading-icon-menu.placement-right .border::after{right:auto;left:0;transform:translate(-5px, -4.25px) rotate(135deg)}.heading-icon-menu{opacity:0;transform-origin:right center;transform:scale(0.5);transition:opacity .2s ease-out,transform .2s ease-out,visibility 0s}.heading-icon-menu.placement-right{transform-origin:left center}.heading-icon-menu.active{visibility:visible;opacity:1;transform:scale(1);pointer-events:all}.heading-icon-menu.active .icon-entry{opacity:1}.heading-icon-menu .icon-entry{width:24px;height:24px;padding:6px;cursor:pointer;box-sizing:content-box;opacity:0}
1.heading-icon-menu .icon-entry svg{display:block;width:24px;height:24px}.heading-icon-menu .icon-entry svg path,.heading-icon-menu .icon-entry svg rect,.heading-icon-menu .icon-entry svg circle,.heading-icon-menu .icon-entry svg ellipse,.heading-icon-menu .icon-entry svg line,.heading-icon-menu .icon-entry svg polyline,.heading-icon-menu .icon-entry svg polygon{stroke:#1ac6ff;fill:none;stroke-linecap:round;stroke-linejoin:round}.heading-icon-menu .icon-entry{transition:transform .2s ease-in,opacity .25s .09s ease-out}.heading-icon-menu .icon-entry:nth-child(2){transition:transform .2s ease-in,opacity .25s .12s ease-out}.heading-icon-menu .icon-entry:nth-child(3){transition:transform .2s ease-in,opacity .25s .15s ease-out}.heading-icon-menu .icon-entry:nth-child(4){transition:transform .2s ease-in,opacity .25s .18s ease-out}.heading-icon-menu .icon-entry:nth-child(5){transition:transform .2s ease-in,opacity .25s .21s ease-out}.heading-icon-menu .icon-entry:nth-child(6){transition:transform .2s ease-in,opacity .25s .24s ease-out}.heading-icon-menu .icon-entry:hover{transform:scale(1.25);transition:transform .2s ease-out}.rich-content-heading-icon{position:relative}.text-editor-menu{height:32px;box-sizing:border-box;border-radius:16px;position:relative;box-shadow:0px 0px 8px 0px rgba(0,0,0,.25);border:1px solid;z-index:15;background-color:#484848;border-color:#555}.night .text-editor-menu{background-color:#e6e6e6;border-color:#c8c8c8}.text-editor-menu{opacity:0;transform-origin:center bottom;transform:scale(0.25);transition:opacity .25s,transform .25s ease-out,background-color .5s,border-color .5s}.text-editor-menu.active{opacity:1;transform:scale(1)}.text-editor-menu.active .border .items_holder>div{opacity:1}.text-editor-menu:before{content:"";display:block;position:absolute;border:1px solid;border-width:0 1px 1px 0;background-color:inherit;border-color:inherit;width:8px;height:8px;left:50%;bottom:0;border-top-left-radius:10px;transform:translate(-4px, 5px) rotate(45deg)}.text-editor-menu.arrow-top{transform-origin:center top}.text-editor-menu.arrow-top:before{bottom:auto;top:0;border-width:1px 0 0 1px;border-top-left-radius:0;border-bottom-right-radius:10px;transform:translate(-4px, -5px) rotate(45deg)}.text-editor-menu .menu-section{margin:-1px;padding:0 3px;height:inherit;display:flex;align-items:center;cursor:pointer}.text-editor-menu .menu-section .menu-item{position:relative}.text-editor-menu .menu-section .menu-item button:first-child{margin-left:0px}.text-editor-menu .menu-section .menu-item .sub-menu-holder{position:absolute;top:-60px;left:-54px;display:block;height:calc(100% + 36px);opacity:0;pointer-events:none;transform-origin:center bottom;transform:scale(0.5);transition:opacity .2s ease-out,transform .2s ease-out}.text-editor-menu .menu-section .menu-item .sub-menu-holder.active{opacity:1;pointer-events:all;transform:scale(1)}.text-editor-menu .menu-section .menu-item .sub-menu-holder .sub-menu-container{display:flex;padding:12px;gap:10px;border-radius:16px;background-color:#484848;border-color:#555;color:#fff}.night .text-editor-menu .menu-section .menu-item .sub-menu-holder .sub-menu-container{background-color:#e6e6e6;border-color:#c8c8c8;color:#000}.text-editor-menu .menu-section .menu-item .sub-menu-holder .sub-menu-container::before{content:"";display:block;position:absolute;border:1px solid;border-width:0 1px 1px 0;background-color:inherit;border-color:inherit;width:8px;height:8px;left:50%;bottom:13px;border-top-left-radius:10px;transform:translate(-4px, 5px) rotate(45deg)}.text-editor-menu .menu-section .menu-item .sub-menu-holder .sub-menu-container .text-align-option{height:20px;width:20px;opacity:.42;transform:scale(1);transition:opacity .2s,transform .2s ease-in}.text-editor-menu .menu-section .menu-item .sub-menu-holder .sub-menu-container .text-align-option:hover{opacity:.6;transform:scale(1.25);transition:opacity .2s,transform .2s ease-out}.text-editor-menu .menu-section .menu-item .sub-menu-holder .sub-menu-container .text-align-option.selected{opacity:1;cursor:default;transform:none}.text-editor-menu button{width:28px;height:20px;padding:0px 8px;cursor:pointer;background:none;display:block;opacity:.42;transform:scale(1);transition:opacity .2s,transform .2s ease-in}.text-editor-menu button:hover{opacity:.6;transform:scale(1.25);transition:opacity .2s,transform .2s ease-out}.text-editor-menu button.active,.text-editor-menu button.active:hover{opacity:1}.text-editor-menu button.disabled{opacity:.15}.text-editor-menu button.hidden{display:none}.text-editor-menu button:first-child{margin-left:9px}.text-editor-menu button:last-child{margin-right:9px}.text-editor-menu button.circle{width:26px;height:26px}.text-editor-menu button.circle:first-child{margin-left:0px}.text-editor-menu button.circle{margin-right:-2px}.text-editor-menu button.circle:last-child{margin-right:0px}.text-editor-menu button.circle{border-radius:13px}.text-editor-menu .icon.format_bold{background:center center no-repeat url(${J})}.night .text-editor-menu .icon.format_bold{background:center center no-repeat url(${G})}.text-editor-menu .icon.format_italic{background:center center no-repeat url(${K})}.night .text-editor-menu .icon.format_italic{background:center center no-repeat url(${Y})}.text-editor-menu .icon.format_strikethrough{background:center center no-repeat url(${Q})}.night .text-editor-menu .icon.format_strikethrough{background:center center no-repeat url(${Z})}.text-editor-menu .icon.format_underlined{background:center center no-repeat url(${X})}.night .text-editor-menu .icon.format_underlined{background:center center no-repeat url(${tt})}.text-editor-menu .icon.format_heading_1{background:center center no-repeat url(${et})}.night .text-editor-menu .icon.format_heading_1{background:center center no-repeat url(${nt})}.text-editor-menu .icon.format_heading_2{background:center center no-repeat url(${rt})}.night .text-editor-menu .icon.format_heading_2{background:center center no-repeat url(${ot})}.text-editor-menu .icon.format_list_bulleted{background:center center no-repeat url(${it})}.night .text-editor-menu .icon.format_list_bulleted{background:center center no-repeat url(${st})}.text-editor-menu .icon.format_list_numbered{background:center center no-repeat url(${at})}.night .text-editor-menu .icon.format_list_numbered{background:center center no-repeat url(${lt})}.text-editor-menu .icon.format_quote{background:center center no-repeat url(${ct})}.night .text-editor-menu .icon.format_quote{background:center center no-repeat url(${dt})}.text-editor-menu .icon.format_code{background:center center no-repeat url(${ut})}.night .text-editor-menu .icon.format_code{background:center center no-repeat url(${ht})}.text-editor-menu .icon.format_codeblock{background:center center no-repeat url(${pt})}.night .text-editor-menu .icon.format_codeblock{background:center center no-repeat url(${ft})}.text-editor-menu .icon.insert_link{background:center center no-repeat url(${gt})}.night .text-editor-menu .icon.insert_link{background:center center no-repeat url(${mt})}.text-editor-menu .icon.add_comment{background:center center no-repeat url(${At})}.night .text-editor-menu .icon.add_comment{background-image:url(${yt})}.text-editor-menu .icon.spark{background:center center no-repeat url(${bt})}.text-editor-menu .icon.justify{background:center center no-repeat url(${vt})}.night .text-editor-menu .icon.justify{background:center center no-repeat url(${wt})}.text-editor-menu .icon.right{background:center center no-repeat url(${kt})}.night .text-editor-menu .icon.right{background:center center no-repeat url(${Ct})}.text-editor-menu .icon.center{background:center center no-repeat url(${xt})}.night .text-editor-menu .icon.center{background:center center no-repeat url(${St})}.text-editor-menu .icon.left{background:center center no-repeat url(${Et})}.night .text-editor-menu .icon.left{background:center center no-repeat url(${Mt})}.text-editor-link-url{border:1px solid #555}.night .text-editor-link-url{border:1px solid #c8c8c8}.text-editor-link-url{transition:background-color .5s,border-color .5s;width:300px;border-radius:8px;padding:4px 8px;font-size:14px;line-height:20px}.text-editor-content-inner p.title{font-size:34px;line-height:48px;font-weight:500;padding:24px 0}.text-editor-content-inner p.title.is-empty::before{content:attr(data-placeholder);float:left;color:#ced4da;pointer-events:none;height:0;opacity:0;animation-name:fadeIn;animation-duration:1s;animation-iteration-count:1;animation-fill-mode:forwards}@keyframes fadeIn{from{opacity:0;transform:translate(-4px, 0)}to{opacity:1;transform:translate(0, 0)}}.heading-icons-enabled .text-editor-content-inner p.title.is-empty .heading-icon.has-icon,.heading-icons-enabled .text-editor-content-inner p.title.is-empty .heading-icon.has-preview{display:none}.text-editor-content-inner p.has-placeholder::before{content:attr(data-placeholder);float:left;color:#ddd;pointer-events:none;height:0;margin-left:2px;opacity:0;animation-name:fadeIn;animation-delay:.5s;animation-duration:1s;animation-iteration-count:1;animation-fill-mode:forwards}@keyframes fadeIn{from{opacity:0;transform:translate(-4px, 0)}to{opacity:1;transform:translate(0, 0)}}.text-editor-content-inner p.spacer{display:block;width:100%;height:200px;transition:height .2s}.text-editor-content-inner .tableWrapper{position:relative;overflow:hidden}.page-inner-layout-v2 .text-editor-content-inner .tableWrapper{width:calc(100% + var(--line-height)*210/24 - 24px)}.text-editor-content-inner .tableWrapper .tableScrollContainer{position:relative;overflow-x:auto;overflow-y:visible;scrollbar-width:none;-ms-overflow-style:none}.text-editor-content-inner .tableWrapper .tableScrollContainer::-webkit-scrollbar{display:none}.text-editor-content-inner .tableWrapper .customScrollbarTrack{position:absolute;bottom:0px;left:0px;right:0px;height:12px;display:block;background:rgba(0,0,0,.05);border-radius:6px;cursor:pointer}.text-editor-content-inner .tableWrapper .customScrollbarTrack .customScrollbarThumb{position:absolute;top:2px;left:0px;width:753.909px;height:8px;background:rgba(0,0,0,.3);border-radius:4px;transition:background .2s;cursor:grab}.text-editor-content-inner table{border-collapse:collapse;margin:0;overflow:hidden;background:#fff}.night .text-editor-content-inner table{background:#2c2c2c}.text-editor-content-inner table td,.text-editor-content-inner table th{border:1px solid #aaa;box-sizing:border-box;min-width:1em;padding:12px 8px 11px 8px;position:relative;vertical-align:top}.text-editor-content-inner table td>*,.text-editor-content-inner table th>*{margin-bottom:0}.night .text-editor-content-inner table td,.text-editor-content-inner table th{border-color:#666}.text-editor-content-inner table th{font-weight:bold;text-align:left}.text-editor-content-inner table .selectedCell:after{background-color:rgba(0,190,255,.0509803922);border:1px solid rgba(0,190,255,.3137254902);content:"";left:0;right:0;top:0;bottom:0;pointer-events:none;position:absolute;z-index:2}.night .text-editor-content-inner table .selectedCell:after{background-color:rgba(0,190,255,.0509803922);border:1px solid rgba(0,190,255,.3137254902)}.text-editor-content-inner table .column-resize-handle{background-color:rgba(0,0,0,.1215686275);bottom:-1px;pointer-events:none;position:absolute;right:-2px;top:0;width:4px}.night .text-editor-content-inner table .column-resize-handle{background-color:rgba(255,255,255,.1215686275)}.text-editor-content-inner .tableWrapper{margin:1.5rem 0;overflow-x:auto}.text-editor-content-inner.resize-cursor{cursor:ew-resize;cursor:col-resize}
1.scanner-effect{--scanner-line-duration: 2s;--scanner-second-line-delay: 0.6s;pointer-events:none;--y: 0;--height: 0}.scanner-effect:before,.scanner-effect:after{content:"";display:block;position:absolute;pointer-events:none;background-repeat:repeat-y;background-size:50%;background-image:linear-gradient(75deg, #000 15%, #0091d9 35%, #1ac6ff 45%, #1ac6ff 55%, #0091d9 65%, #000 85%);mix-blend-mode:lighten}.night .scanner-effect:before,.night .scanner-effect:after{background-image:linear-gradient(75deg, #fff 15%, #9bebff 35%, #1ac6ff 45%, #1ac6ff 55%, #9bebff 65%, #fff 85%);mix-blend-mode:darken}.scanner-effect:before{animation:scanner-gradient1 var(--scanner-line-duration) cubic-bezier(0.3, 0, 0.7, 1) 1 both}.scanner-effect:after{animation:scanner-gradient2 var(--scanner-line-duration) cubic-bezier(0.3, 0, 0.7, 1) 1 both;animation-delay:var(--scanner-second-line-delay)}@keyframes scanner-gradient1{0%{background-position:-100% 50%}90%{background-position:200% 50%}100%{background-position:200% 50%}}@keyframes scanner-gradient2{0%{background-position:-100% 50%}60%{background-position:200% 50%}100%{background-position:200% 50%}}.text-editor-content .scanner-effect{position:relative}.text-editor-content .scanner-effect:before,.text-editor-content .scanner-effect:after{inset:0}[page-layout=v2] .text-editor-content .scanner-effect:before{display:none}[page-layout=v2] .text-editor-content .scanner-effect:after{background-image:none;mix-blend-mode:normal;animation:none}[page-layout=v2] .text-editor-content .scanner-effect{background-image:linear-gradient(to right, #222 15%, #0091d9 35%, #1ac6ff 45%, #1ac6ff 55%, #0091d9 65%, #222 85%);background-size:300% 100%;-webkit-background-clip:text;background-clip:text;color:rgba(0,0,0,0)}[page-layout=v2] .text-editor-content .scanner-effect p,[page-layout=v2] .text-editor-content .scanner-effect span,[page-layout=v2] .text-editor-content .scanner-effect strong,[page-layout=v2] .text-editor-content .scanner-effect em,[page-layout=v2] .text-editor-content .scanner-effect a,[page-layout=v2] .text-editor-content .scanner-effect b,[page-layout=v2] .text-editor-content .scanner-effect i,[page-layout=v2] .text-editor-content .scanner-effect u,[page-layout=v2] .text-editor-content .scanner-effect s,[page-layout=v2] .text-editor-content .scanner-effect sub,[page-layout=v2] .text-editor-content .scanner-effect sup,[page-layout=v2] .text-editor-content .scanner-effect mark,[page-layout=v2] .text-editor-content .scanner-effect code,[page-layout=v2] .text-editor-content .scanner-effect ul,[page-layout=v2] .text-editor-content .scanner-effect ol,[page-layout=v2] .text-editor-content .scanner-effect li{background:inherit;-webkit-background-clip:text;background-clip:text;color:inherit}[page-layout=v2] .text-editor-content .scanner-effect li::marker{color:#222}[page-layout=v2] .text-editor-content .scanner-effect{animation:scanner-text-sweep var(--scanner-line-duration) cubic-bezier(0.3, 0, 0.7, 1) 1 both;animation-delay:var(--scanner-second-line-delay)}.night [page-layout=v2] .text-editor-content .scanner-effect{background-image:linear-gradient(to right, #ccc 15%, #9bebff 35%, #1ac6ff 45%, #1ac6ff 55%, #9bebff 65%, #ccc 85%)}.night [page-layout=v2] .text-editor-content .scanner-effect li::marker{color:#ccc}@keyframes scanner-text-sweep{0%{color:rgba(0,0,0,0);background-position:100% 50%}90%{color:rgba(0,0,0,0);background-position:0% 50%}100%{color:inherit;background-position:0% 50%}}.text-editor-content-inner div.theme-frame{width:fit-content;margin-left:auto;margin-right:auto;overflow:visible;position:relative}.text-editor-content-inner div.theme-frame-inner{overflow:auto}.text-editor-content-inner div.theme-frame-inner>*{overflow:hidden}.text-editor-content-inner div.theme-frame-menus{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:visible;z-index:1}.text-editor-content-inner div.theme-frame .svg_item_parent{overflow:hidden}.text-editor-content-inner div.theme-frame .theme-frame-caption{display:none}.text-editor-content-inner div.theme-frame[data-state=placeholder]{display:flex;flex-direction:column;align-items:center;align-self:stretch;justify-content:center;width:auto;padding:0 10px;line-height:22px;border-radius:6px;border:1px dashed rgba(72,72,72,.2);font-family:Geomanist;font-size:14px;font-style:normal;font-weight:500;color:rgba(72,72,72,.5);box-sizing:border-box;
1cursor:pointer}.night .text-editor-content-inner div.theme-frame[data-state=placeholder]{border-color:rgba(255,255,255,.2);color:rgba(255,255,255,.5)}.text-editor-content-inner div.theme-frame[data-state=placeholder][data-expanded=true]{flex-shrink:0;text-align:center}.text-editor-content-inner div.theme-frame[data-state=placeholder]+div.theme-frame[data-state=placeholder]{margin-top:24px}.text-editor-content-inner div.theme-frame[data-state=placeholder] .theme-frame-caption{display:block}.text-editor-content-inner div.theme-frame[data-state=placeholder] .theme-frame-drag-handle,.text-editor-content-inner div.theme-frame[data-state=placeholder] .theme-frame-menus{display:none}.text-editor-content-inner div.theme-frame[data-state=placeholder]:has(>:not(.theme-frame-caption):not(.theme-frame-drag-handle):not(.theme-frame-menus)){border:none;padding:0;color:inherit;cursor:default}.text-editor-content-inner div.theme-frame[data-state=placeholder]:has(>:not(.theme-frame-caption):not(.theme-frame-drag-handle):not(.theme-frame-menus)) .theme-frame-caption{display:none}.text-editor-content{min-height:inherit;min-width:inherit;--line-height: 24px}.text-editor-content .text-editor-content-inner{min-height:inherit;min-width:inherit;padding:calc(var(--line-height)*60/24) calc(var(--line-height)*150/24) calc(var(--line-height)*256/24) calc(var(--line-height)*234/24)}.page-inner-layout-v2 .text-editor-content .text-editor-content-inner{padding:calc(var(--line-height)*60/24) calc(var(--line-height)*210/24) calc(var(--line-height)*256/24) calc(var(--line-height)*210/24)}.text-editor-content .text-editor-content-inner{box-sizing:border-box;color:#222}.night .text-editor-content .text-editor-content-inner{color:#ccc}.text-editor-content .text-editor-content-inner{transition:color .5s;font-size:calc(var(--line-height)*2/3);font-weight:400;font-family:geomanist;letter-spacing:.02em;line-height:var(--line-height)}.text-editor-content .text-editor-content-inner p,.text-editor-content .text-editor-content-inner h1,.text-editor-content .text-editor-content-inner h2,.text-editor-content .text-editor-content-inner h3,.text-editor-content .text-editor-content-inner h4,.text-editor-content .text-editor-content-inner h5,.text-editor-content .text-editor-content-inner h6,.text-editor-content .text-editor-content-inner code,.text-editor-content .text-editor-content-inner pre,.text-editor-content .text-editor-content-inner img{min-width:1px}.text-editor-content .text-editor-content-inner b,.text-editor-content .text-editor-content-inner strong{font-weight:600;line-height:1em}.text-editor-content .text-editor-content-inner p{margin-top:0}.text-editor-content .text-editor-content-inner h1,.text-editor-content .text-editor-content-inner h2,.text-editor-content .text-editor-content-inner h3,.text-editor-content .text-editor-content-inner h4,.text-editor-content .text-editor-content-inner h5,.text-editor-content .text-editor-content-inner h6{font-weight:500;margin-top:0;color:#000;transition:color .5s}.night .text-editor-content .text-editor-content-inner h1,.night .text-editor-content .text-editor-content-inner h2,.night .text-editor-content .text-editor-content-inner h3,.night .text-editor-content .text-editor-content-inner h4,.night .text-editor-content .text-editor-content-inner h5,.night .text-editor-content .text-editor-content-inner h6{color:#fff}.text-editor-content .text-editor-content-inner h1{font-size:calc(var(--line-height)*28/24);line-height:var(--line-height);padding:calc(var(--line-height)*3/2) 0 calc(var(--line-height)/2)}.text-editor-content .text-editor-content-inner h2{font-size:1.375em;line-height:var(--line-height);padding:calc(var(--line-height)*18/24) 0 calc(var(--line-height)/4)}.text-editor-content .text-editor-content-inner h3{font-size:1.25em;line-height:var(--line-height)}.text-editor-content .text-editor-content-inner h4,.text-editor-content .text-editor-content-inner h5,.text-editor-content .text-editor-content-inner h6{font-size:1em;line-height:var(--line-height);font-weight:500}.text-editor-content .text-editor-content-inner dl,.text-editor-content .text-editor-content-inner ol,.text-editor-content .text-editor-content-inner ul{list-style:none;margin-top:0;padding-left:0}.text-editor-content .text-editor-content-inner dl,.text-editor-content .text-editor-content-inner ol,.text-editor-content .text-editor-content-inner ul{margin-left:calc(var(--line-height)*2)}.text-editor-content .text-editor-content-inner dl[dir=rtl],.text-editor-content .text-editor-content-inner ol[dir=rtl],.text-editor-content .text-editor-content-inner ul[dir=rtl]{margin-left:0;margin-right:calc(var(--line-height)*2)}.text-editor-content .text-editor-content-inner ol{list-style:decimal}.text-editor-content .text-editor-content-inner ul{list-style:initial}.text-editor-content .text-editor-content-inner blockquote{padding:calc(var(--line-height)/6) 0}.text-editor-content .text-editor-content-inner blockquote>*{border-left:calc(var(--line-height)/6) solid;border-left-color:hsla(0,0%,40%,.2509803922)}.night .text-editor-content .text-editor-content-inner blockquote>*{border-left-color:#666}.text-editor-content .text-editor-content-inner blockquote>*{transition:border-left-color .5s;padding:0 var(--line-height)}.text-editor-content .text-editor-content-inner blockquote>*:first-child{padding-top:calc(var(--line-height)/3)}.text-editor-content .text-editor-content-inner blockquote>*:last-child{padding-bottom:calc(var(--line-height)/3)}.text-editor-content .text-editor-content-inner blockquote>*[dir=rtl]{border-left:0;border-right:calc(var(--line-height)/6) solid;border-right-color:hsla(0,0%,40%,.2509803922)}.night .text-editor-content .text-editor-content-inner blockquote>*[dir=rtl]{border-right-color:#666}.text-editor-content .text-editor-content-inner blockquote>*[dir=rtl]{transition:border-right-color .5s}.text-editor-content .text-editor-content-inner code{background-color:rgba(209,217,225,.2509803922)}.night .text-editor-content .text-editor-content-inner code{background-color:#272727}.text-editor-content .text-editor-content-inner code{transition:background-color .5s;border-radius:calc(var(--line-height)/6);font-family:"Inconsolata",monospace;font-size:calc(var(--line-height)/3*2);margin:0 calc(var(--line-height)/6);padding:calc(var(--line-height)/12) calc(var(--line-height)/3);vertical-align:bottom;letter-spacing:normal;white-space:pre-wrap}.text-editor-content .text-editor-content-inner pre{overflow-y:hidden;padding:calc(var(--line-height)/2) 0}.text-editor-content .text-editor-content-inner pre>code{display:block;background:unset;border-radius:0;margin:0;background-color:rgba(209,217,225,.2509803922)}.night .text-editor-content .text-editor-content-inner pre>code{background-color:#272727}.text-editor-content .text-editor-content-inner pre>code{border-left:calc(var(--line-height)/6) solid;border-left-color:#5e00a2}.night .text-editor-content .text-editor-content-inner pre>code{border-left-color:#cd6afb}.text-editor-content .text-editor-content-inner pre>code{transition:border-left-color .5s,background-color .5s;padding:calc(var(--line-height)/2) calc(var(--line-height)*5/6);height:initial;line-height:var(--line-height);min-width:fit-content;letter-spacing:normal;white-space:pre-wrap}.text-editor-content .text-editor-content-inner pre[dir=rtl]>code{border-left:0;border-right:calc(var(--line-height)/6) solid;border-right-color:#5e00a2}.night .text-editor-content .text-editor-content-inner pre[dir=rtl]>code{border-right-color:#cd6afb}.text-editor-content .text-editor-content-inner pre[dir=rtl]>code{transition:border-right-color .5s}.text-editor-content .text-editor-content-inner img{max-width:100%}.text-editor-content .text-editor-content-inner a{color:#5e00a2}.night .text-editor-content .text-editor-content-inner a{color:#cd6afb}.text-editor-content .text-editor-content-inner a{transition:color .5s;text-decoration:none;height:initial;line-height:1em}.text-editor-content .text-editor-content-inner a:focus,.text-editor-content .text-editor-content-inner a:hover{color:#4e2f64;transition:color .5s;cursor:pointer}.night .text-editor-content .text-editor-content-inner a:focus,.night .text-editor-content .text-editor-content-inner a:hover{color:#b192bf}@media print{.text-editor-content .text-editor-content-inner .is-empty{visibility:hidden !important}}.text-editor-content .text-editor-content-inner>p.title{color:#000}.night .text-editor-content .text-editor-content-inner>p.title{color:#fff}.text-editor-content .text-editor-content-inner>p.title{transition:color .5s}.text-editor-content .ProseMirror-dropcursor{transition:opacity .15s ease;background-color:#7c3aed !important}.night .text-editor-content .ProseMirror-dropcursor{background-color:#a78bfa !important}.text-editor-content .theme-frame--drag-reorder{position:relative;overflow:visible;margin-top:var(--line-height);margin-bottom:var(--line-height)}.text-editor-content .theme-frame--drag-reorder:hover .theme-frame-drag-handle{opacity:1}.text-editor-content .theme-frame-drag-handle{position:absolute;
1left:0}[page-layout=v2] .text-editor-content .theme-frame-drag-handle{left:max(0px,50% - var(--text-area-width)/2)}.text-editor-content .theme-frame-drag-handle{display:flex;align-items:center;justify-content:center;width:22px;height:16px;cursor:grab;opacity:0;transition:opacity .15s;z-index:10;pointer-events:auto;border-radius:4px;background-color:rgba(72,72,72,.08);background-image:url(${Tt});background-repeat:no-repeat;background-position:center}.night .text-editor-content .theme-frame-drag-handle{background-color:rgba(200,200,200,.12);background-image:url(${_t})}.text-editor-content .theme-frame-drag-handle--top{top:-22px}.text-editor-content .theme-frame-drag-handle--bottom{bottom:-22px}.text-editor-content.text-as-lines p:not(.title){font-family:"Flow Rounded";letter-spacing:-0.045em;color:#aaa}.night .text-editor-content.text-as-lines p:not(.title){color:#666}.text-editor-content.text-as-lines p:not(.title){transition:color .5s}.text-editor-content.selection-disabled,.text-editor-content.selection-disabled *{-webkit-user-select:none;user-select:none}[page-layout=v1] .text-editor-content .text-editor-content-inner *,[page-layout=v1] .text-editor-content .text-editor-content-inner *:after,[page-layout=v1] .text-editor-content .text-editor-content-inner *:before{box-sizing:inherit}`,"",{version:3,sources:["webpack://./lib/src/tiptap-extension-anchor-mark/anchorMark.scss","webpack://./lib/src/tiptap-extension-heading/heading.scss","webpack://./lib/src/tiptap-extension-menu/menu.scss","webpack://./lib/src/tiptap-extension-title/title.scss","webpack://./lib/src/tiptap-extension-paragraph/paragraph.scss","webpack://./lib/src/tiptap-extension-spacer/spacer.scss","webpack://./lib/src/tiptap-extension-table/table.scss","webpack://./lib/src/tiptap-extension-scanner/scanner.scss","webpack://./lib/src/tiptap-extension-theme-frame/themeFrame.scss","webpack://./lib/src/tiptap/tiptap.scss"],names:[],mappings:"AACE,6DACE,oCAAA,CCSJ,8BACE,KACE,SAAA,CACA,yBAAA,CAEF,GACE,SAAA,CACA,uBAAA,CAAA,CAIJ,6BACE,KACE,SAAA,CACA,uBAAA,CAEF,GACE,SAAA,CACA,yBAAA,CAAA,CAKF,uNAOE,iBAAA,CAGF,yCACE,YAAA,CACA,iBAAA,CACA,MAAA,CACA,kBAAA,CACA,sBAAA,CACA,gBAAA,CACA,cAAA,CACA,wDACE,CAMF,6CACE,aAAA,CACA,UAAA,CACA,WAAA,CAEA,0WAOE,SAAA,CACA,kBAAA,CACA,oBAAA,CACA,qBAAA,CAIJ,yEACE,mBAAA,CACA,SAAA,CACA,yCAAA,CAEA,0kBAOE,cApFgB,CAwFhB,2nBAOE,cA9FgB,CAmGtB,4EACE,mBAAA,CACA,SAAA,CAEA,+lBAOE,cAhHM,CAsHZ,6fAOE,UAAA,CACA,qBAAA,CAEA,uiBACE,UAAA,CAKJ,weAOE,UAAA,CAKA,2wCAcE,oBAAA,CACA,mBAAA,CASJ,iDACE,UAAA,CACA,WAAA,CACA,UAAA,CACA,QAAA,CAEA,qDACE,UAAA,CACA,WAAA,CAMJ,4CACE,UAAA,CACA,WAAA,CACA,UAAA,CACA,QAAA,CAEA,gDACE,UAAA,CACA,WAAA,CAMJ,4CACE,UAAA,CACA,WAAA,CACA,UAAA,CACA,QAAA,CAEA,gDACE,UAAA,CACA,WAAA,CAMJ,gLAIE,UAAA,CACA,WAAA,CACA,UAAA,CACA,OAAA,CAEA,gMACE,UAAA,CACA,WAAA,CAIJ,uDACE,YAAA,CAGF,+CACE,qBAAA,CAGF,kDACE,iDAAA,CAGF,gDACE,UAAA,CAEA,sDACE,UAAA,CAKN,mBAEE,YAAA,CACA,iBAAA,CACA,cAAA,CACA,YAAA,CACA,mBAAA,CAEA,iCACE,YAAA,CACA,qCAAA,CACA,uBAAA,CACA,OAAA,CACA,UAAA,CAGF,2BACE,iBAAA,CACA,gBAAA,CACA,kBAAA,CACA,WAAA,CACA,yBAAA,CACA,qBAAA,CACA,qCAAA,CACA,oBAhRU,CAiRV,yEACE,CAGO,kCACP,mCAAA,CACA,oBAvRQ,CAwRR,qFACE,CAEF,2BAAA,CAIF,kCACE,UAAA,CACA,aAAA,CACA,iBAAA,CACA,gBAAA,CACA,wBAAA,CACA,2BAAA,CACA,oBAtSQ,CAuSR,qCAAA,CACA,SAAA,CACA,UAAA,CACA,OAAA,CACA,OAAA,CACA,gDAAA,CAGO,yCACP,oBAhTQ,CAiTR,mCAAA,CAIJ,kDACE,UAAA,CACA,MAAA,CACA,iDAAA,CAhEJ,mBAoEE,SAAA,CACA,6BAAA,CACA,oBAAA,CACA,oEACE,CAIF,mCACE,4BAAA,CAGF,0BACE,kBAAA,CACA,SAAA,CACA,kBAAA,CACA,kBAAA,CAEA,sCACE,SAAA,CAIJ,+BACE,UAAA,CACA,WAAA,CACA,WAAA,CACA,cAAA,CACA,sBAAA,CACA,SAAA,CAGA,mCACE,aAAA,CACA,UAAA,CACA,WAAA,CAEA,oSAOE,cAxWM,CAyWN,SAAA,CACA,oBAAA,CACA,qBAAA,CAxBN,+BA4BE,2DACE,CAEF,4CACE,2DACE,CAGJ,4CACE,2DACE,CAGJ,4CACE,2DACE,CAGJ,4CACE,2DACE,CAGJ,4CACE,2DACE,CAIJ,qCACE,qBAAA,CACA,iCAAA,CAKN,2BACE,iBAAA,CC3WF,kBACE,WAfY,CAgBZ,qBAAA,CACA,kBAAA,CACA,iBAAA,CACA,0CAdgB,CAehB,gBAAA,CACA,UAAA,CAGA,wBAhB0B,CAiB1B,iBAhBsB,CAmBb,yBACP,wBAlB0B,CAmB1B,oBAlBsB,CAE1B,kBAoBE,SAAA,CACA,8BAAA,CACA,qBAAA,CACA,qFACE,CAMF,yBACE,SAAA,CACA,kBAAA,CAGI,mDACE,SAAA,CAMR,yBACE,UAAA,CACA,aAAA,CACA,iBAAA,CACA,gBAAA,CACA,wBAAA,CACA,wBAAA,CACA,oBAAA,CACA,SAAA,CACA,UAAA,CACA,QAAA,CACA,QAAA,CACA,2BAAA,CACA,4CAAA,CAIF,4BACE,2BAAA,CAEA,mCACE,WAAA,CACA,KAAA,CACA,wBAAA,CACA,wBAAA,CACA,+BAAA,CACA,6CAAA,CAIJ,gCACE,WAAA,CACA,aAAA,CACA,cAAA,CACA,YAAA,CACA,kBAAA,CACA,cAAA,CAEA,2CACE,iBAAA,CAEE,8DACE,eAAA,CAGJ,4DACE,iBAAA,CACA,SAAA,CACA,UAAA,CACA,aAAA,CACA,wBAAA,CAEA,SAAA,CACA,mBAAA,CACA,8BAAA,CACA,oBAAA,CACA,sDACE,CAEF,mEACE,SAAA,CACA,kBAAA,CACA,kBAAA,CAGF,gFACE,YAAA,CACA,YAAA,CACA,QAAA,CACA,kBAAA,CAGA,wBAxHkB,CAyHlB,iBAxHc,CAyHd,UAAA,CAGS,uFACP,wBA3HkB,CA4HlB,oBA3Hc,CA4Hd,UAAA,CAGF,wFACE,UAAA,CACA,aAAA,CACA,iBAAA,CACA,gBAAA,CACA,wBAAA,CACA,wBAAA,CACA,oBAAA,CACA,SAAA,CACA,UAAA,CACA,QAAA,CACA,WAAA,CACA,2BAAA,CACA,4CAAA,CAGF,mGACE,WAAA,CACA,UAAA,CACA,WAnKW,CAoKX,kBAAA,CACA,4CACE,CAGF,yGACE,UAzKO,CA0KP,qBAAA,CACA,6CACE,CAGJ,4GACE,SA/KW,CAgLX,cAAA,CACA,cAAA,CAOZ,yBACE,UAAA,CACA,WAAA,CACA,eAAA,CACA,cAAA,CAEA,eAAA,CACA,aAAA,CAEA,WAnMmB,CAoMnB,kBAAA,CACA,4CACE,CAGF,+BACE,UAzMe,CA0Mf,qBAAA,CACA,6CACE,CAIJ,sEAEE,SAjNmB,CAmNrB,kCACE,WAvNkB,CAyNpB,gCACE,YAAA,CAGF,qCACE,eAAA,CAEF,oCACE,gBAAA,CAGF,gCACE,UAAA,CACA,WAAA,CAEA,4CACE,eAAA,CALJ,gCAOE,iBAAA,CACA,2CACE,gBAAA,CATJ,gCAYE,
1kBAAA,CAKF,oCACE,0EAAA,CAGS,2CACP,0EAAA,CAKJ,sCACE,0EAAA,CAGS,6CACP,0EAAA,CAKJ,6CACE,0EAAA,CAGS,oDACP,0EAAA,CAKJ,0CACE,0EAAA,CAGS,iDACP,0EAAA,CAKJ,yCACE,0EAAA,CAGS,gDACP,0EAAA,CAKJ,yCACE,2EAAA,CAGS,gDACP,2EAAA,CAKJ,6CACE,2EAAA,CAGS,oDACP,2EAAA,CAKJ,6CACE,2EAAA,CAGS,oDACP,2EAAA,CAKJ,qCACE,2EAAA,CAGS,4CACP,2EAAA,CAKJ,oCACE,2EAAA,CAGS,2CACP,2EAAA,CAKJ,yCACE,2EAAA,CAGS,gDACP,2EAAA,CAKJ,oCACE,2EAAA,CAGS,2CACP,2EAAA,CAKJ,oCACE,2EAAA,CAGS,2CACP,yDAAA,CAIJ,8BACE,2EAAA,CAKF,gCACE,2EAAA,CAGS,uCACP,2EAAA,CAKJ,8BACE,2EAAA,CAGS,qCACP,2EAAA,CAKJ,+BACE,2EAAA,CAGS,sCACP,2EAAA,CAKJ,6BACE,2EAAA,CAGS,oCACP,2EAAA,CAOR,sBAEE,qBAAA,CAGS,6BACP,wBAAA,CANJ,sBASE,gDACE,CAGF,WAAA,CACA,iBAAA,CACA,eAAA,CACA,cAAA,CACA,gBAAA,CC9cA,mCACE,cAAA,CACA,gBAAA,CACA,eAAA,CACA,cAAA,CAEA,oDACE,8BAAA,CACA,UAAA,CACA,aAAA,CACA,mBAAA,CACA,QAAA,CACA,SAAA,CACA,qBAAA,CACA,qBAAA,CACA,2BAAA,CACA,4BAAA,CAGF,kBACE,KACE,SAAA,CACA,4BAAA,CAEF,GACE,SAAA,CACA,yBAAA,CAAA,CAMR,uLAEE,YAAA,CCjCE,qDACE,8BAAA,CACA,UAAA,CACA,UAAA,CACA,mBAAA,CACA,QAAA,CACA,eAAA,CACA,SAAA,CACA,qBAAA,CACA,mBAAA,CACA,qBAAA,CACA,2BAAA,CACA,4BAAA,CAGF,kBACE,KACE,SAAA,CACA,4BAAA,CAEF,GACE,SAAA,CACA,yBAAA,CAAA,CCzBN,oCACE,aAAA,CACA,UAAA,CACA,YAAA,CACA,qBAAA,CCWF,yCACE,iBAAA,CACA,eAAA,CAES,+DACP,mDAAA,CAGF,+DACE,iBAAA,CACA,eAAA,CACA,kBAAA,CACA,oBAAA,CACA,uBAAA,CAEA,kFACE,YAAA,CAIJ,+DACE,iBAAA,CACA,UAAA,CACA,QAAA,CACA,SAAA,CACA,WAAA,CACA,aAAA,CACA,0BAAA,CACA,iBAAA,CACA,cAAA,CAEA,qFACE,iBAAA,CACA,OAAA,CACA,QAAA,CACA,eAAA,CACA,UAAA,CACA,yBAAA,CACA,iBAAA,CACA,yBAAA,CACA,WAAA,CAKN,iCACE,wBAAA,CACA,QAAA,CACA,eAAA,CACA,eA9DmB,CAgEV,wCACP,kBA3DmB,CA8DrB,wEAEE,qBAAA,CACA,qBAAA,CACA,aAAA,CACA,yBAAA,CACA,iBAAA,CACA,kBAAA,CAEA,4EACE,eAAA,CAGO,+EACP,iBA3EW,CA+Ef,oCAEE,gBAAA,CACA,eAAA,CAGF,qDACE,4CAzFoB,CA0FpB,4CAAA,CACA,UAAA,CACA,MAAA,CACA,OAAA,CACA,KAAA,CACA,QAAA,CACA,mBAAA,CACA,iBAAA,CACA,SAAA,CAIA,4DACE,4CAjGoB,CAkGpB,4CAAA,CAIJ,uDACE,wCA/GkB,CAgHlB,WAAA,CACA,mBAAA,CACA,iBAAA,CACA,UAAA,CACA,KAAA,CACA,SAAA,CAES,8DACP,8CAlHkB,CAuHxB,yCACE,eAAA,CACA,eAAA,CAGF,yCACE,gBAAA,CACA,iBAAA,CCnGJ,gBACE,2BAAA,CACA,iCAAA,CAEA,mBAAA,CAEA,MAAA,CACA,WAAA,CAEA,6CAEE,UAAA,CACA,aAAA,CACA,iBAAA,CACA,mBAAA,CAEA,0BAAA,CACA,mBAAA,CACA,+GAxDmB,CAyDnB,sBAAA,CAIA,2DAEE,+GAtDmB,CAuDnB,qBAAA,CAIJ,uBACE,4FAAA,CAIF,sBACE,4FAAA,CAEA,gDAAA,CAGF,6BACE,GACE,6BAAA,CAEF,IACE,4BAAA,CAEF,KACE,4BAAA,CAAA,CAIJ,6BACE,GACE,6BAAA,CAEF,IACE,4BAAA,CAEF,KACE,4BAAA,CAAA,CAMN,qCACE,iBAAA,CAEA,uFAEE,OAAA,CAMF,6DACE,YAAA,CAGF,4DACE,qBAAA,CACA,qBAAA,CACA,cAAA,CARJ,sDAWE,kHA3G0B,CA4G1B,yBAAA,CACA,4BAAA,CACA,oBAAA,CACA,mBAAA,CAEA,s5BACE,kBAAA,CACA,4BAAA,CACA,oBAAA,CACA,aAAA,CAKF,iEACE,UAAA,CA3BJ,sDA8BE,6FAAA,CAEA,gDAAA,CAES,6DACP,kHA1H0B,CA4H1B,wEACE,UAAA,CAKN,8BACE,GACE,mBAAA,CACA,4BAAA,CAEF,IACE,mBAAA,CACA,0BAAA,CAEF,KACE,aAAA,CACA,0BAAA,CAAA,CCnKF,2CACE,iBAAA,CACA,gBAAA,CACA,iBAAA,CACA,gBAAA,CACA,iBAAA,CAEA,iDACE,aAAA,CAEA,mDACE,eAAA,CAIJ,iDACE,iBAAA,CACA,KAAA,CACA,MAAA,CACA,UAAA,CACA,WAAA,CACA,mBAAA,CACA,gBAAA,CACA,SAAA,CAGF,4DACE,eAAA,CAGF,gEACE,YAAA,CAIJ,mEACE,YAAA,CACA,qBAAA,CACA,kBAAA,CACA,kBAAA,CACA,sBAAA,CACA,UAAA,CACA,cAAA,CACA,gBAAA,CACA,iBAAA,CACA,mCAAA,CACA,qBAAA,CACA,cAAA,CACA,iBAAA,CACA,eAAA,CACA,uBAtDqC,CAuDrC,qBAAA,CAEA,cAAA,CAES,0EACP,iCA7DuC,CA8DvC,0BA5DqC,CA+DvC,uFACE,aAAA,CACA,iBAAA,CAGF,2GACE,eAAA,CAGF,wFACE,aAAA,CAGF,kLAEE,YAAA,CAKJ,0JAKE,WAAA,CACA,SAAA,CACA,aAAA,CACA,cAAA,CAEA,+KACE,YAAA,CCrFN,qBACE,kBAAA,CACA,iBAAA,CACA,mBAAA,CAmCA,gDAEE,kBAAA,CACA,iBAAA,CACA,sIAAA,CAIS,sEACP,sIAAA,CATJ,gDAiBE,qBAAA,CAGA,UA1CkB,CA2CT,uDACP,UApCkB,CActB,gDAwBE,oBAAA,CAEA,sCAAA,CAGA,eAAA,CACA,qBAAA,CACA,oBAAA,CACA,8BAAA,CAKA,igBAUE,aAAA,CAGF,yGAEE,eAAA,CACA,eAAA,CAGF,kDACE,YAAA,CAGF,kTAME,eAAA,CACA,YAAA,CACA,UA3FgB,CA4FhB,oBAAA,CAGA,4VAME,UA7FgB,CAiGpB,mDACE,wCAAA,CACA,8BAAA,CACA,iEAAA,CAGF,mDACE,iBAAA,CACA,8BAAA,CACA,mEAAA,CAGF,mDACE,gBAAA,CACA,8BAAA,CAGF,yJAGE,aAAA,CACA,8BAAA,CACA,eAAA,CAKF,yJAGE,eAAA,CACA,YAAA,CACA,cAAA,CAGF,yJAGE,sCAAA,CAEA,oLACE,aAAA,CACA,uCAAA,CAIJ,mDACE,kBAAA,CAGF,mDACE,kBAAA,CAMF,2DACE,oCAAA,CAEA,6DACE,4CAAA,CACA,4CAlKiB,CAmKR,oEACP,sBA5JiB,CAwJrB,6DAME,gCAAA,CAEA,4BAAA,CAEA,yEACE,sCAAA,CAGF,wEACE,yCAAA,CAGF,sEACE,aAAA,CACA,6CAAA,CACA,6CArLe,CAsLN,6EACP,uBA/Ke,CA0KnB,sEAOE,iCAAA,CAQN,qDACE,8CAnMiB,CAoMR,4DACP,wBA7LiB,CA0LrB,qDAKE,+BAAA,CAEA,wCAAA,CACA,mCAAA,CACA,sCAAA,CACA,mCAAA,CACA,8DAAA,CACA,qBAAA,CACA,qBAAA,CACA,oBAAA,CAGF,oDACE,iBAAA,CACA,oCAAA,CAEA,yDACE,aAAA,CACA,gBAAA,CACA,eAAA,CACA,QAAA,CAEA,8CA7Ne,CA8NN,gEACP,wBAvNe,CA+MnB,yDAWE,4CAAA,CACA,yBArOc,CAsOL,gEACP,yBA/Nc,CAiNlB,yDAgBE,qDACE,CAGF,+DAAA,CACA,cAAA,CACA,8BAAA,CACA,qBAAA,CACA,qBAAA,CACA,oBAAA,CAIA,kEACE,aAAA,CACA,6CAAA,CACA,0BAzPY,CA0PH,yEACP,0BAnPY,CA8OhB,kEAOE,iCAAA,CAON,oDACE,cAAA,CAKF,kDACE,aA3QgB,CA4QP,yDACP,aArQgB,CAkQpB,kDAKE,oBAAA,CAEA,oBAAA,CACA,cAAA,CACA,eAAA,CAEA,gHAEE,aAtRgB,CAuRhB,oBAAA,CACA,cAAA,CAGA,8HAEE,aArRgB,CA6RtB,aACE,0DACE,4BAAA,CAAA,CAIJ,wDACE,UA/SgB,CAgTP,+DACP,UAzSgB,CAsSpB,wDAKE,oBAAA,CAIJ,6CACE,4BAAA,CACA,mCAAA,CACS,oDACP,mCAAA,CAIJ,gDACE,iBAAA,CACA,gBAAA,CACA,6BAAA,CACA,gCAAA,CAEA,+EACE,SAAA,CAIJ,8CACE,iBAAA,CACA,MAAA,CAGS,+DACP,4CAAA,CANJ,8CAQE,YAAA,CACA,kBAAA,CACA,sBAAA,CACA,UAAA,CACA,WAAA,CACA,WAAA,CACA,SAAA,CACA,uBAAA,CACA,UAAA,CACA,mBAAA,CACA,iBAAA,CACA,mCA7UmB,CA8UnB,yDAAA,CACA,2BAAA,CACA,0BAAA,CACS,qDACP,sCAhVmB,CAiVnB,yDAAA,CAGF,mDACE,SAAA,CAGF,sDACE,YAAA,CAKF,iDACE,0BAAA,CACA,uBAAA,CACA,UA7Wa,CA8WJ,wDACP,UAvWa,CAkWjB,iDAOE,oBAAA,CAKN,kFAEE,wBAAA,CACA,gBAAA,CAUI,sNAGE,kBAAA",sourcesContent:["span[data-name='anchor-mark'] {\n  .anchor-highlighted-syncWithText {\n    background-color: rgba(26, 198, 255, 0.2);\n  }\n}\n","/**\n * Heading Icon Styles\n * Sizing: FR-005/FR-006 | Animations: FR-006a\n */\n\n$spark-color: #1ac6ff;\n$day-icon-stroke-color: #484848;
1\n$night-icon-stroke-color: #e0e0e0;\n$day-menu-background-color: #ffffff;\n$night-menu-background-color: #415768;\n\n@keyframes heading-icon-intro {\n  from {\n    opacity: 0;\n    transform: translateX(8px);\n  }\n  to {\n    opacity: 1;\n    transform: translateX(0);\n  }\n}\n\n@keyframes heading-icon-exit {\n  from {\n    opacity: 1;\n    transform: translateX(0);\n  }\n  to {\n    opacity: 0;\n    transform: translateX(8px);\n  }\n}\n\n.text-editor-content-inner {\n  h1,\n  h2,\n  h3,\n  h4,\n  h5,\n  h6,\n  p.title {\n    position: relative;\n  }\n\n  .heading-icon {\n    display: none;\n    position: absolute;\n    left: 0;\n    align-items: center;\n    justify-content: center;\n    user-select: none;\n    cursor: pointer;\n    transition:\n      transform 0.15s ease-out,\n      opacity 0.15s ease-out;\n\n    // We strip embedded <style> tags from SVGs, so we set stroke directly here.\n    // stroke-width is required because sanitization removes the <defs><style> block\n    // that originally defined it (e.g. `.a { stroke-width: 1.5px }`).\n    svg {\n      display: block;\n      width: 100%;\n      height: 100%;\n\n      path,\n      rect,\n      circle,\n      ellipse,\n      line,\n      polyline,\n      polygon {\n        fill: none;\n        stroke-width: 1.5px;\n        stroke-linecap: round;\n        stroke-linejoin: round;\n      }\n    }\n\n    .heading-icons-enabled &.has-icon {\n      display: inline-flex;\n      opacity: 1;\n      animation: heading-icon-intro 0.4s ease-out;\n\n      svg path,\n      svg rect,\n      svg circle,\n      svg ellipse,\n      svg line,\n      svg polyline,\n      svg polygon {\n        stroke: $day-icon-stroke-color;\n      }\n\n      @at-root .night #{&} svg {\n        path,\n        rect,\n        circle,\n        ellipse,\n        line,\n        polyline,\n        polygon {\n          stroke: $night-icon-stroke-color;\n        }\n      }\n    }\n\n    .heading-icons-enabled &.has-preview {\n      display: inline-flex;\n      opacity: 0;\n\n      svg path,\n      svg rect,\n      svg circle,\n      svg ellipse,\n      svg line,\n      svg polyline,\n      svg polygon {\n        stroke: $spark-color;\n      }\n    }\n  }\n\n  // .has-focus (Focus ext) = editing; :focus-within can't detect caret — DOM focus stays on editor root.\n  h1.has-focus:hover .heading-icon.has-preview,\n  h2.has-focus:hover .heading-icon.has-preview,\n  h3.has-focus:hover .heading-icon.has-preview,\n  h4.has-focus:hover .heading-icon.has-preview,\n  h5.has-focus:hover .heading-icon.has-preview,\n  h6.has-focus:hover .heading-icon.has-preview,\n  p.title.has-focus:hover .heading-icon.has-preview {\n    opacity: 0.6;\n    transition-delay: 0.12s;\n\n    &:hover {\n      opacity: 0.8;\n    }\n  }\n\n  // Icon is tabindex=0: without this rule keyboard-focused icon hides when hover ends.\n  h1:focus-within .heading-icon.has-preview,\n  h2:focus-within .heading-icon.has-preview,\n  h3:focus-within .heading-icon.has-preview,\n  h4:focus-within .heading-icon.has-preview,\n  h5:focus-within .heading-icon.has-preview,\n  h6:focus-within .heading-icon.has-preview,\n  p.title:focus-within .heading-icon.has-preview {\n    opacity: 0.6;\n  }\n\n  // Hide preview icons when autographics button is visible (prevents both showing simultaneously).\n  @at-root .autographics-active #{&} {\n    h1.has-focus:hover .heading-icon.has-preview,\n    h2.has-focus:hover .heading-icon.has-preview,\n    h3.has-focus:hover .heading-icon.has-preview,\n    h4.has-focus:hover .heading-icon.has-preview,\n    h5.has-focus:hover .heading-icon.has-preview,\n    h6.has-focus:hover .heading-icon.has-preview,\n    p.title.has-focus:hover .heading-icon.has-preview,\n    h1:focus-within .heading-icon.has-preview,\n    h2:focus-within .heading-icon.has-preview,\n    h3:focus-within .heading-icon.has-preview,\n    h4:focus-within .heading-icon.has-preview,\n    h5:focus-within .heading-icon.has-preview,\n    h6:focus-within .heading-icon.has-preview,\n    p.title:focus-within .heading-icon.has-preview {\n      opacity: 0 !important;\n      pointer-events: none;\n    }\n  }\n\n  // Note: Preview visibility while menu is open is handled by dynamic style injection\n  // in nodeViewIconHelper.js (because ProseMirror recreates the icon element)\n\n  // Title icon size (36px) - positioned in left margin\n  // top = padding-top (24px) + (line-height 48 - icon 36) / 2 = 30px\n  p.title .heading-icon {\n    width: 36px;\n    height: 36px;\n    left: -48px; // 36px icon + 12px gap\n    top: 30px;\n\n    svg {\n      width: 36px;\n      height: 36px;\n    }\n  }\n\n  // H1 icon size (32px)\n  // top = padding-top (36px) + (line-height 24 - icon 32) / 2 = 32px\n  h1 .heading-icon {\n    width: 32px;\n    height: 32px;\n    left: -44px; // 32px icon + 12px gap\n    top: 32px;\n\n    svg {\n      width: 32px;\n      height: 32px;\n    }\n  }\n\n  // H2 icon size (28px)\n  // top = padding-top (18px) + (line-height 24 - icon 28) / 2 = 16px\n  h2 .heading-icon {\n    width: 28px;\n    height: 28px;\n    left: -40px; // 28px icon + 12px gap\n    top: 16px;\n\n    svg {\n      width: 28px;\n      height: 28px;\n    }\n  }\n\n  // H3-H6 icon size (24px)\n  // top = padding-top (0px) + (line-height 24 - icon 24) / 2 = 0px\n  h3 .heading-icon,\n  h4 .heading-icon,\n  h5 .heading-icon,\n  h6 .heading-icon {\n    width: 24px;\n    height: 24px;\n    left: -36px; // 24px icon + 12px gap\n    top: 0px;\n\n    svg {\n      width: 24px;\n      height: 24px;\n    }\n  }\n\n  .heading-icon:focus-visible {\n    outline: none;\n  }\n\n  .heading-icon:hover {\n    transform: scale(1.25);\n  }\n\n  .heading-icon--exiting {\n    animation: heading-icon-exit 0.3s ease-out forwards;\n  }
1\n\n  .heading-icon--empty {\n    opacity: 0.3;\n\n    &:hover {\n      opacity: 0.6;\n    }\n  }\n}\n\n.heading-icon-menu {\n  // Use visibility instead of display:none so Floating UI can measure dimensions\n  display: flex;\n  visibility: hidden;\n  position: fixed;\n  z-index: 1000;\n  pointer-events: none;\n\n  .items-holder {\n    display: grid;\n    grid-template-columns: repeat(2, 36px);\n    grid-template-rows: auto;\n    gap: 0px;\n    margin: 6px;\n  }\n\n  .border {\n    position: relative;\n    border: 1px solid;\n    border-radius: 16px;\n    padding: 4px;\n    backdrop-filter: blur(4px);\n    box-sizing: border-box;\n    background-color: rgba($day-menu-background-color, 0.8);\n    border-color: $spark-color;\n    box-shadow:\n      0px 4px 4px 0px rgba(0, 0, 0, 0.1),\n      0px 0px 8px 0px rgba(0, 0, 0, 0.05);\n\n    @at-root .night #{&} {\n      background-color: rgba($night-menu-background-color, 0.8);\n      border-color: $spark-color;\n      box-shadow:\n        0px 4px 4px 0px rgba(255, 255, 255, 0.1),\n        0px 0px 8px 0px rgba(255, 255, 255, 0.05);\n      backdrop-filter: blur(7.5px);\n    }\n\n    // Arrow for placement-left\n    &::after {\n      content: '';\n      display: block;\n      position: absolute;\n      border: 1px solid;\n      border-width: 0 1px 1px 0;\n      border-top-left-radius: 10px; // to not cover the content inside\n      border-color: $spark-color;\n      background-color: rgba($day-menu-background-color, 0.8);\n      width: 8px;\n      height: 8px;\n      right: 0;\n      top: 50%;\n      transform: translate(5px, -4.25px) rotate(315deg);\n    }\n\n    @at-root .night #{&}::after {\n      border-color: $spark-color;\n      background-color: rgba($night-menu-background-color, 0.8);\n    }\n  }\n\n  &.placement-right .border::after {\n    right: auto;\n    left: 0;\n    transform: translate(-5px, -4.25px) rotate(135deg);\n  }\n\n  // Animation on open (Floating UI handles positioning, we just animate scale/opacity)\n  opacity: 0;\n  transform-origin: right center; // Scale from right (menu on left of icon)\n  transform: scale(0.5);\n  transition:\n    opacity 0.2s ease-out,\n    transform 0.2s ease-out,\n    visibility 0s;\n\n  &.placement-right {\n    transform-origin: left center;\n  }\n\n  &.active {\n    visibility: visible;\n    opacity: 1;\n    transform: scale(1);\n    pointer-events: all;\n\n    .icon-entry {\n      opacity: 1;\n    }\n  }\n\n  .icon-entry {\n    width: 24px;\n    height: 24px;\n    padding: 6px;\n    cursor: pointer;\n    box-sizing: content-box;\n    opacity: 0;\n\n    // We strip embedded <style> tags from SVGs, so we set stroke directly here\n    svg {\n      display: block;\n      width: 24px;\n      height: 24px;\n\n      path,\n      rect,\n      circle,\n      ellipse,\n      line,\n      polyline,\n      polygon {\n        stroke: $spark-color;\n        fill: none;\n        stroke-linecap: round;\n        stroke-linejoin: round;\n      }\n    }\n\n    transition:\n      transform 0.2s ease-in,\n      opacity 0.25s 0.09s ease-out;\n    &:nth-child(2) {\n      transition:\n        transform 0.2s ease-in,\n        opacity 0.25s 0.12s ease-out;\n    }\n    &:nth-child(3) {\n      transition:\n        transform 0.2s ease-in,\n        opacity 0.25s 0.15s ease-out;\n    }\n    &:nth-child(4) {\n      transition:\n        transform 0.2s ease-in,\n        opacity 0.25s 0.18s ease-out;\n    }\n    &:nth-child(5) {\n      transition:\n        transform 0.2s ease-in,\n        opacity 0.25s 0.21s ease-out;\n    }\n    &:nth-child(6) {\n      transition:\n        transform 0.2s ease-in,\n        opacity 0.25s 0.24s ease-out;\n    }\n\n    &:hover {\n      transform: scale(1.25);\n      transition: transform 0.2s ease-out;\n    }\n  }\n}\n\n.rich-content-heading-icon {\n  position: relative;\n}\n","$extension-menu-path: '../tiptap-extension-menu';\n\n// UI 2022\n\n$base-color: #666666;\n$background-color: #f7f7f7;\n$page-color: #fff;\n$border-color: #eee;\n$comment-focus-background-color: rgb(244, 224, 0, 0.1);\n$pause-color: #34b8ea;\n$play-color: #34b8ea;\n$stop-color: #ae0056;\n$new-color: #f13f3f;\n$comment-unread-color: #f13f3fbf;\n$recording-color: #cd6afb;\n$recording-background-color: #cd6afb1a;\n$editing-color: #808080;\n\n// UI 2023\n\n$comment-color: #fadd00;\n$spark-color: #1ac6ff;\n\n$theme-transition-duration: 0.5s;\n\n// Bubble menu\n$menu-disabled-opacity: 0.15;\n$menu-enabled-opacity: 0.42;\n$menu-hover-opacity: 0.6;\n$menu-activated-opacity: 1;\n$menu-hover-scale: 1.25;\n$menu-hover-transition-duration: 0.2s;\n$menu-height: 32px;\n$menu-side-padding: 12px;\n$menu-gap: 8px;\n$menu-inner-gap: 4px;\n$menu-group-gap: 12px;\n$menu-box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.25);\n$menu-circle-size: 26px;\n\n$day-menu-background-color: #484848;\n$day-menu-border-color: #555;\n\n$night-menu-background-color: #e6e6e6;\n$night-menu-border-color: #c8c8c8;\n\n.text-editor-menu {\n  height: $menu-height;\n  box-sizing: border-box;\n  border-radius: calc($menu-height / 2);\n  position: relative;\n  box-shadow: $menu-box-shadow;\n  border: 1px solid;\n  z-index: 15; // Above graph layers (6-10) and theme frame menus (12-13)\n\n  // Day Mode\n  background-color: $day-menu-background-color;\n  border-color: $day-menu-border-color;\n\n  // Night Mode\n  @at-root .night #{&} {\n    background-color: $night-menu-background-color;\n    border-color: $night-menu-border-color;\n  }\n\n  // intro animation\n  opacity: 0;\n  transform-origin: center bottom;\n  transform: scale(0.25);\n  transition: // intro animation\n    opacity 0.25s,\n    transform 0.25s ease-out,\n    // light/Night Mode\n    background-color $theme-transition-duration,\n    border-color $theme-transition-duration;\n\n  &.active {\n    opacity: 1;\n    transform: scale(1);\n    & .border {\n      & .items_holder {\n        & > div {\n          opacity: 1;\n        }\n      }\n    }\n  }\n\n  &:before {\n    content: '';\n    display: block;\n    position: absolute;\n    border: 1px solid;\n    border-width: 0 1px 1px 0;\n    background-color: inherit; // follow parent transition\n    border-color: inherit; // follow parent transition\n    width: 8px;\n    height: 8px;\n    left: 50%;\n    bottom: 0;\n    border-top-left-radius: 10px; // to not covert the content inside\n    transform: translate(-4px, 5px) rotate(45deg);\n  }\n\n  // When placed below the text, flip the arrow to point upward\n  &.arrow-top {\n    transform-origin: center top;\n\n    &:before {\n      bottom: auto;\n      top: 0;\n      border-width: 1px 0 0 1px;\n      border-top-left-radius: 0;\n      border-bottom-right-radius: 10px; // to not cover the content inside\n      transform: translate(-4px, -5px) rotate(45deg);\n    }\n  }\n\n  .menu-section {\n    margin: -1px; // to counteract the border\n    padding: 0 3px;\n    height: inherit;\n    display: flex;
1\n    align-items: center;\n    cursor: pointer;\n\n    & .menu-item {\n      position: relative;\n      button {\n        &:first-child {\n          margin-left: 0px;\n        }\n      }\n      & .sub-menu-holder {\n        position: absolute;\n        top: -60px;\n        left: -54px;\n        display: block;\n        height: calc(100% + 36px);\n        // inactive\n        opacity: 0;\n        pointer-events: none;\n        transform-origin: center bottom;\n        transform: scale(0.5);\n        transition:\n          opacity 0.2s ease-out,\n          transform 0.2s ease-out; // delay\n        &.active {\n          opacity: 1;\n          pointer-events: all;\n          transform: scale(1);\n        }\n\n        & .sub-menu-container {\n          display: flex;\n          padding: 12px;\n          gap: 10px;\n          border-radius: 16px;\n\n          // Day Mode\n          background-color: $day-menu-background-color;\n          border-color: $day-menu-border-color;\n          color: white;\n\n          // Night Mode\n          @at-root .night #{&} {\n            background-color: $night-menu-background-color;\n            border-color: $night-menu-border-color;\n            color: black;\n          }\n\n          &::before {\n            content: '';\n            display: block;\n            position: absolute;\n            border: 1px solid;\n            border-width: 0 1px 1px 0;\n            background-color: inherit; // follow parent transition\n            border-color: inherit; // follow parent transition\n            width: 8px;\n            height: 8px;\n            left: 50%;\n            bottom: 13px;\n            border-top-left-radius: 10px; // to not covert the content inside\n            transform: translate(-4px, 5px) rotate(45deg);\n          }\n\n          & .text-align-option {\n            height: 20px;\n            width: 20px;\n            opacity: $menu-enabled-opacity;\n            transform: scale(1);\n            transition:\n              opacity $menu-hover-transition-duration,\n              transform $menu-hover-transition-duration ease-in;\n\n            &:hover {\n              opacity: $menu-hover-opacity;\n              transform: scale($menu-hover-scale);\n              transition:\n                opacity $menu-hover-transition-duration,\n                transform $menu-hover-transition-duration ease-out;\n            }\n            &.selected {\n              opacity: $menu-activated-opacity;\n              cursor: default;\n              transform: none;\n            }\n          }\n        }\n      }\n    }\n  }\n  button {\n    width: 28px;\n    height: 20px;\n    padding: 0px 8px;\n    cursor: pointer;\n\n    background: none;\n    display: block;\n\n    opacity: $menu-enabled-opacity;\n    transform: scale(1);\n    transition:\n      opacity $menu-hover-transition-duration,\n      transform $menu-hover-transition-duration ease-in;\n\n    &:hover {\n      opacity: $menu-hover-opacity;\n      transform: scale($menu-hover-scale);\n      transition:\n        opacity $menu-hover-transition-duration,\n        transform $menu-hover-transition-duration ease-out;\n    }\n\n    &.active,\n    &.active:hover {\n      opacity: $menu-activated-opacity;\n    }\n    &.disabled {\n      opacity: $menu-disabled-opacity;\n    }\n    &.hidden {\n      display: none;\n    }\n\n    &:first-child {\n      margin-left: 9px;\n    }\n    &:last-child {\n      margin-right: 9px;\n    }\n\n    &.circle {\n      width: 26px;\n      height: 26px;\n\n      &:first-child {\n        margin-left: 0px;\n      }\n      margin-right: -2px; // to artificially reduce the gap between the circles\n      &:last-child {\n        margin-right: 0px;\n      }\n\n      border-radius: calc($menu-circle-size / 2);\n    }\n  }\n\n  .icon {\n    &.format_bold {\n      background: center center no-repeat\n        url(#{$extension-menu-path}/icons/bold-20px-w.svg);\n\n      @at-root .night #{&} {\n        background: center center no-repeat\n          url(#{$extension-menu-path}/icons/bold-20px.svg);\n      }\n    }\n\n    &.format_italic {\n      background: center center no-repeat\n        url(#{$extension-menu-path}/icons/italic-20px-w.svg);\n\n      @at-root .night #{&} {\n        background: center center no-repeat\n          url(#{$extension-menu-path}/icons/italic-20px.svg);\n      }\n    }\n\n    &.format_strikethrough {\n      background: center center no-repeat\n        url(#{$extension-menu-path}/icons/strikethrough-20px-w.svg);\n\n      @at-root .night #{&} {\n        background: center center no-repeat\n          url(#{$extension-menu-path}/icons/strikethrough-20px.svg);\n      }\n    }\n\n    &.format_underlined {\n      background: center center no-repeat\n        url(#{$extension-menu-path}/icons/underlined-20px-w.svg);\n\n      @at-root .night #{&} {\n        background: center center no-repeat\n          url(#{$extension-menu-path}/icons/underlined-20px.svg);\n      }\n    }\n\n    &.format_heading_1 {\n      background: center center no-repeat\n        url(#{$extension-menu-path}/icons/h1-20px-w.svg);\n\n      @at-root .night #{&} {\n        background: center center no-repeat\n          url(#{$extension-menu-path}/icons/h1-20px.svg);\n      }\n    }\n\n    &.format_heading_2 {\n      background: center center no-repeat\n        url(#{$extension-menu-path}/icons/h2-20px-w.svg);\n\n      @at-root .night #{&} {\n        background: center center no-repeat\n          url(#{$extension-menu-path}/icons/h2-20px.svg);\n      }\n    }\n\n    &.format_list_bulleted {\n      background: center center no-repeat\n        url(#{$extension-menu-path}/icons/bulleted-20px-w.svg);\n\n      @at-root .night #{&} {\n        background: center center no-repeat\n          url(#{$extension-menu-path}/icons/bulleted-20px.svg);\n      }\n    }\n\n    &.format_list_numbered {\n      background: center center no-repeat\n        url(#{$extension-menu-path}/icons/numbered-20px-w.svg);\n\n      @at-root .night #{&} {\n        background: center center no-repeat\n          url(#{$extension-menu-path}/icons/numbered-20px.svg);\n      }\n    }\n\n    &.format_quote {\n      background: center center no-repeat\n        url(#{$extension-menu-path}/icons/quote-20px-w.svg?v=2);\n\n      @at-root .night #{&} {\n        background: center center no-repeat\n          url(#{$extension-menu-path}/icons/quote-20px.svg?v=2);\n      }\n    }\n\n    &.format_code {\n      background: center center no-repeat\n        url(#{$extension-menu-path}/icons/code-20px-w.svg);\n\n      @at-root .night #{&} {\n        background: center center no-repeat\n          url(#{$extension-menu-path}/icons/code-20px.svg);\n      }\n    }\n\n    &.format_codeblock {\n      background: center center no-repeat\n        url(#{$extension-menu-path}/icons/codeblock-20px-w.svg);\n\n      @at-root .night #{&} {\n        background: center center no-repeat\n          url(#{$extension-menu-path}/icons/codeblock-20px.svg);\n      }\n    }\n\n    &.insert_link {\n      background: center center no-repeat\n        url(#{$extension-menu-path}/icons/link2-20px-w.svg);\n\n      @at-root .night #{&} {\n        background: center center no-repeat\n          url(#{$extension-menu-path}/icons/link2-20px.svg);\n      }\n    }\n\n    &.add_comment {\n      background: center center no-repeat\n        url(#{$extension-menu-path}/icons/add-comment-button-20px-nb.svg);\n\n      @at-root .night #{&} {\n        background-image: url(#{$extension-menu-path}/icons/add-comment-button-20px-nb-d.svg);\n      }\n    }\n\n    &.spark {\n      background: center center no-repeat\n        url(#{$extension-menu-path}/icons/spark-26px.svg);\n    }\n\n    // Text-align\n    &.justify {\n      background: center center no-repeat\n        url(#{$extension-menu-path}/icons/align-justify-20px-w.svg);\n\n      @at-root .night #{&} {\n        background: center center no-repeat\n          url(#{$extension-menu-path}/icons/align-justify-20px.svg);\n      }\n    }\n\n    &.right {\n      background: center center no-repeat\n        url(#{$extension-menu-path}/icons/align-right-20px-w.svg);\n\n      @at-root .night #{&} {\n        background: center center no-repeat\n          url(#{$extension-menu-path}/icons/align-right-20px.svg);\n      }\n    }\n\n    &.center {\n      background: center center no-repeat\n        url(#{$extension-menu-path}/icons/align-center-20px-w.svg);\n\n      @at-root .night #{&} {\n        background: center center no-repeat\n          url(#{$extension-menu-path}/icons/align-center-20px.svg);\n      }\n    }\n\n    &.left {\n      background: center center no-repeat\n        url(#{$extension-menu-path}/icons/align-left-20px-w.svg);\n\n      @at-root .night #{&} {\n        background: center center no-repeat\n          url(#{$extension-menu-path}/icons/align-left-20px.svg);\n      }\n    }\n  }\n}\n\n.text-editor-link-url {\n  // Day Mode\n  border: 1px solid $day-menu-border-color;\n\n  // Night Mode\n  @at-root .night #{&} {\n    border: 1px solid $night-menu-border-color;\n  }\n\n  transition:\n    background-color $theme-transition-duration,\n    border-color $theme-transition-duration;\n\n  width: 300px;\n  border-radius: 8px;\n  padding: 4px 8px;\n  font-size: 14px;\n  line-height: 20px;\n}\n",".text-editor-content-inner {\n  // title\n\n  p.title {\n    font-size: 34px;\n    line-height: 48px;\n    font-weight: 500;\n    padding: 24px 0;\n\n    &.is-empty::before {\n      content: attr(data-placeholder);\n      float: left;\n      color: #ced4da;\n      pointer-events: none;\n      height: 0;\n      opacity: 0;\n      animation-name: fadeIn;\n      animation-duration: 1s;\n      animation-iteration-count: 1;\n      animation-fill-mode: forwards;\n    }\n\n    @keyframes fadeIn {\n      from {\n        opacity: 0;\n        transform: translate(-4px, 0);\n      }\n      to {\n        opacity: 1;\n        transform: translate(0, 0);\n      }\n    }\n  }\n}\n\n.heading-icons-enabled .text-editor-content-inner p.title.is-empty .heading-icon.has-icon,\n.heading-icons-enabled .text-editor-content-inner p.title.is-empty .heading-icon.has-preview {\n  display: none;\n}\n",".text-editor-content-inner {\n  // paragraph\n\n  p {\n    &.has-placeholder::before {\n      content: attr(data-placeholder);\n      float: left;\n      color: #ddd;\n      pointer-events: none;\n      height: 0;\n      margin-left: 2px;\n      opacity: 0;\n      animation-name: fadeIn;\n      animation-delay: 0.5s;\n      animation-duration: 1s;\n      animation-iteration-count: 1;\n      animation-fill-mode: forwards;\n    }\n\n    @keyframes fadeIn {\n      from {\n        opacity: 0;\n        transform: translate(-4px, 0);\n      }\n      to {\n        opacity: 1;\n        transform: translate(0, 0);\n      }\n    }\n  }\n}\n",".text-editor-content-inner {\n  p.spacer {\n    display: block;\n    width: 100%;\n    height: 200px;\n    transition: height 0.2s;\n  }\n}\n","// Color\n// ––––––––––––––––––––––––––––––––––––––––––––––––––\n// day\n$day-color-background: #ffffff;\n$day-color-line: #aaaaaa;\n$day-color-line-resize: #0000001f;\n$day-color-selected-cell-border: #00beff50;\n$day-color-selected-cell: #00beff0d;\n// night\n$night-color-background: #2c2c2c;\n$night-color-line: #666666;\n$night-color-line-resize: #ffffff1f;\n$night-color-selected-cell-border: #00beff50;\n$night-color-selected-cell: #00beff0d;\n\n.text-editor-content-inner {\n  .tableWrapper {\n    position: relative;\n    overflow: hidden;\n\n    @at-root .page-inner-layout-v2 #{&} {\n      width: calc(100% + calc(var(--line-height) * 210 / 24) - 24px);\n    }\n\n    .tableScrollContainer {\n      position: relative;\n      overflow-x: auto;\n      overflow-y: visible;\n      scrollbar-width: none;\n      -ms-overflow-style: none;\n\n      &::-webkit-scrollbar {\n        display: none;\n      }\n    }\n\n    .customScrollbarTrack {\n      position: absolute;\n      bottom: 0px;\n      left: 0px;\n      right: 0px;\n      height: 12px;\n      display: block;\n      background: rgba(0, 0, 0, 0.05);\n      border-radius: 6px;\n      cursor: pointer;\n\n      .customScrollbarThumb {\n        position: absolute;\n        top: 2px;\n        left: 0px;\n        width: 753.909px;\n        height: 8px;\n        background: rgba(0, 0, 0, 0.3);\n        border-radius: 4px;\n        transition: background 0.2s;\n        cursor: grab;\n      }\n    }\n  }\n\n  table {\n    border-collapse: collapse;\n    margin: 0;\n    overflow: hidden;\n    background: $day-color-background;\n\n    @at-root .night #{&} {\n      background: $night-color-background;\n    }\n\n    td,\n    th {\n      border: 1px solid $day-color-line;\n      box-sizing: border-box;\n      min-width: 1em;\n      padding: 12px 8px 11px 8px;\n      position: relative;\n      vertical-align: top;\n\n      > * {\n        margin-bottom: 0;\n      }\n\n      @at-root .night #{&} {\n        border-color: $night-color-line;\n      }\n    }\n\n    th {\n      // background-color: #3d25140d;\n      font-weight: bold;\n      text-align: left;\n    }\n\n    .selectedCell:after {\n      background-color: $day-color-selected-cell;\n      border: 1px solid $day-color-selected-cell-border;\n      content: '';\n      left: 0;\n      right: 0;\n      top: 0;\n      bottom: 0;\n      pointer-events: none;\n      position: absolute;\n      z-index: 2;\n    }\n\n    @at-root .night #{&} {\n      .selectedCell:after {\n        background-color: $night-color-selected-cell;\n        border: 1px solid $night-color-selected-cell-border;\n      }\n    }\n\n    .column-resize-handle {\n      background-color: $day-color-line-resize;\n      bottom: -1px;\n      pointer-events: none;\n      position: absolute;\n      right: -2px;\n      top: 0;\n      width: 4px;\n\n      @at-root .night #{&} {\n        background-color: $night-color-line-resize;\n      }\n    }\n  }\n\n  .tableWrapper {\n    margin: 1.5rem 0;\n    overflow-x: auto;\n  }\n\n  &.resize-cursor {\n    cursor: ew-resize;\n    cursor: col-resize;\n  }\n}\n","$scanner-gradient-day: linear-gradient(\n  75deg,\n  #000 15%,\n  #0091d9 35%,\n  #1ac6ff 45%,\n  #1ac6ff 55%,\n  #0091d9 65%,\n  #000 85%\n);\n$scanner-gradient-night: linear-gradient(\n  75deg,\n  #fff 15%,\n  #9bebff 35%,\n  #1ac6ff 45%,\n  #1ac6ff 55%,\n  #9bebff 65%,\n  #fff 85%\n);\n\n$scanner-gradient-text-day: linear-gradient(\n  to right,\n  #222 15%,\n  #0091d9 35%,\n  #1ac6ff 45%,\n  #1ac6ff 55%,\n  #0091d9 65%,\n  #222 85%\n);\n$scanner-gradient-text-night: linear-gradient(\n  to right,\n  #ccc 15%,\n  #9bebff 35%,\n  #1ac6ff 45%,\n  #1ac6ff 55%,\n  #9bebff 65%,\n  #ccc 85%\n);
1\n\n.scanner-effect {\n  --scanner-line-duration: 2s;\n  --scanner-second-line-delay: 0.6s;\n\n  pointer-events: none;\n\n  --y: 0;\n  --height: 0;\n\n  &:before,\n  &:after {\n    content: '';\n    display: block;\n    position: absolute;\n    pointer-events: none;\n\n    background-repeat: repeat-y;\n    background-size: 50%;\n    background-image: $scanner-gradient-day;\n    mix-blend-mode: lighten;\n  }\n\n  @at-root .night #{&} {\n    &:before,\n    &:after {\n      background-image: $scanner-gradient-night;\n      mix-blend-mode: darken;\n    }\n  }\n\n  &:before {\n    animation: scanner-gradient1 var(--scanner-line-duration)\n      cubic-bezier(0.3, 0, 0.7, 1) 1 both;\n  }\n\n  &:after {\n    animation: scanner-gradient2 var(--scanner-line-duration)\n      cubic-bezier(0.3, 0, 0.7, 1) 1 both;\n    animation-delay: var(--scanner-second-line-delay);\n  }\n\n  @keyframes scanner-gradient1 {\n    0% {\n      background-position: -100% 50%;\n    }\n    90% {\n      background-position: 200% 50%;\n    }\n    100% {\n      background-position: 200% 50%;\n    }\n  }\n\n  @keyframes scanner-gradient2 {\n    0% {\n      background-position: -100% 50%;\n    }\n    60% {\n      background-position: 200% 50%;\n    }\n    100% {\n      background-position: 200% 50%;\n    }\n  }\n}\n\n// V1 — overlay pseudo-elements\n.text-editor-content .scanner-effect {\n  position: relative;\n\n  &:before,\n  &:after {\n    inset: 0;\n  }\n}\n\n// V2 — background-clip:text gradient sweep\n[page-layout='v2'] .text-editor-content .scanner-effect {\n  &:before {\n    display: none;\n  }\n\n  &:after {\n    background-image: none;\n    mix-blend-mode: normal;\n    animation: none;\n  }\n\n  background-image: $scanner-gradient-text-day;\n  background-size: 300% 100%;\n  -webkit-background-clip: text;\n  background-clip: text;\n  color: transparent;\n\n  p, span, strong, em, a, b, i, u, s, sub, sup, mark, code, ul, ol, li {\n    background: inherit;\n    -webkit-background-clip: text;\n    background-clip: text;\n    color: inherit;\n  }\n\n  // ::marker (bullets, ordered-list numbers) doesn't honor background-clip: text,\n  // so without an explicit color it inherits `transparent` from the parent and disappears.\n  li::marker {\n    color: #222;\n  }\n\n  animation: scanner-text-sweep var(--scanner-line-duration)\n    cubic-bezier(0.3, 0, 0.7, 1) 1 both;\n  animation-delay: var(--scanner-second-line-delay);\n\n  @at-root .night [page-layout='v2'] .text-editor-content .scanner-effect {\n    background-image: $scanner-gradient-text-night;\n\n    li::marker {\n      color: #ccc;\n    }\n  }\n}\n\n@keyframes scanner-text-sweep {\n  0% {\n    color: transparent;\n    background-position: 100% 50%;\n  }\n  90% {\n    color: transparent;\n    background-position: 0% 50%;\n  }\n  100% {\n    color: inherit;\n    background-position: 0% 50%;\n  }\n}\n\n","$day-theme-frame-placeholder-border-color: rgba(72, 72, 72, 0.2);\n$night-theme-frame-placeholder-border-color: rgba(255, 255, 255, 0.2);\n$day-theme-frame-placeholder-text-color: rgba(72, 72, 72, 0.5);\n$night-theme-frame-placeholder-text-color: rgba(255, 255, 255, 0.5);\n\n.text-editor-content-inner {\n  div.theme-frame {\n    width: fit-content;\n    margin-left: auto;\n    margin-right: auto;\n    overflow: visible;\n    position: relative;\n\n    &-inner {\n      overflow: auto;\n\n      > * {\n        overflow: hidden;\n      }\n    }\n\n    &-menus {\n      position: absolute;\n      top: 0;\n      left: 0;\n      width: 100%;\n      height: 100%;\n      pointer-events: none;\n      overflow: visible;\n      z-index: 1;\n    }\n\n    .svg_item_parent {\n      overflow: hidden;\n    }\n\n    .theme-frame-caption {\n      display: none;\n    }\n  }\n\n  div.theme-frame[data-state='placeholder'] {\n    display: flex;\n    flex-direction: column;\n    align-items: center;
1\n    align-self: stretch;\n    justify-content: center;\n    width: auto;\n    padding: 0 10px;\n    line-height: 22px;\n    border-radius: 6px;\n    border: 1px dashed $day-theme-frame-placeholder-border-color;\n    font-family: Geomanist;\n    font-size: 14px;\n    font-style: normal;\n    font-weight: 500;\n    color: $day-theme-frame-placeholder-text-color;\n    box-sizing: border-box;\n    // Idle placeholder is click-to-generate; preview-content variant resets this below.\n    cursor: pointer;\n\n    @at-root .night #{&} {\n      border-color: $night-theme-frame-placeholder-border-color;\n      color: $night-theme-frame-placeholder-text-color;\n    }\n\n    &[data-expanded='true'] {\n      flex-shrink: 0;\n      text-align: center;\n    }\n\n    & + div.theme-frame[data-state='placeholder'] {\n      margin-top: 24px;\n    }\n\n    .theme-frame-caption {\n      display: block;\n    }\n\n    .theme-frame-drag-handle,\n    .theme-frame-menus {\n      display: none;\n    }\n  }\n\n  // Placeholder with mounted preview content: drop dashed skin + caption; restored when content cleared.\n  div.theme-frame[data-state='placeholder']:has(\n      > :not(.theme-frame-caption):not(.theme-frame-drag-handle):not(\n          .theme-frame-menus\n        )\n    ) {\n    border: none;\n    padding: 0;\n    color: inherit;\n    cursor: default;\n\n    .theme-frame-caption {\n      display: none;\n    }\n  }\n}\n","@use '../tiptap-extension-anchor-mark/anchorMark';\n@use '../tiptap-extension-heading/heading';\n@use '../tiptap-extension-menu/menu';\n@use '../tiptap-extension-title/title';\n@use '../tiptap-extension-paragraph/paragraph';\n@use '../tiptap-extension-spacer/spacer';\n@use '../tiptap-extension-table/table';\n@use '../tiptap-extension-scanner/scanner';\n@use '../tiptap-extension-theme-frame/themeFrame';\n\n@import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@400&display=swap');\n\n.text-editor-content {\n  min-height: inherit;\n  min-width: inherit;\n  --line-height: 24px;\n\n  // This is removed because it creates a regression in read-only mode, it becomes impossible to select tiptap text\n  // Prevent annoying text selection on safari\n  // -webkit-user-select: none;\n  // user-select: none;\n\n  // Inspired by https://milligram.io\n\n  // Color\n  // ––––––––––––––––––––––––––––––––––––––––––––––––––\n  // day\n  $day-color-heading: #000000 !default;\n  $day-color-initial: #222222 !default;\n  $day-color-primary: #5e00a2 !default;\n  $day-color-secondary: #4e2f64 !default;\n  $day-color-tertiary: #d1d9e140 !default;\n  $day-color-quaternary: #66666640 !default;\n  $day-color-line: #aaaaaa !default;\n  // night\n  $night-color-heading: #ffffff !default;\n  $night-color-initial: #cccccc !default;\n  $night-color-primary: #cd6afb !default;\n  $night-color-secondary: #b192bf !default;\n  $night-color-tertiary: #272727 !default;\n  $night-color-quaternary: #666666 !default;\n  $night-color-line: #666666 !default;\n  // drag handle\n  $day-drag-handle-bg: rgba(72, 72, 72, 0.08) !default;\n  $day-dropcursor-color: #7c3aed !default;\n  $night-drag-handle-bg: rgba(200, 200, 200, 0.12) !default;\n  $night-dropcursor-color: #a78bfa !default;\n\n  $theme-transition-duration: 0.5s;\n\n  .text-editor-content-inner {\n    // migrated from \"web/scss/components/_block.scss\"\n    min-height: inherit;\n    min-width: inherit;\n    padding: calc(var(--line-height) * 60 / 24)\n      calc(var(--line-height) * 150 / 24) calc(var(--line-height) * 256 / 24)\n      calc(var(--line-height) * 234 / 24); // carefully chosen to align to the 12x12 grid\n\n    @at-root .page-inner-layout-v2 #{&} {\n      padding: calc(var(--line-height) * 60 / 24)\n        calc(var(--line-height) * 210 / 24) calc(var(--line-height) * 256 / 24)\n        calc(var(--line-height) * 210 / 24); // carefully chosen to align to the 12x12 grid\n    }\n\n    // The base font-size is set at 62.5% for having the convenience\n    // of sizing rems in a way that is similar to using px: 1.6rem = 16px\n\n    box-sizing: border-box;\n\n    // Default body styles\n    color: $day-color-initial;\n    @at-root .night #{&}
1 {\n      color: $night-color-initial;\n    }\n    transition: color $theme-transition-duration;\n\n    font-size: calc(\n      var(--line-height) * 2 / 3\n    ); // Currently ems cause chrome bug misinterpreting rems on body element\n    font-weight: 400;\n    font-family: geomanist;\n    letter-spacing: 0.02em;\n    line-height: var(--line-height);\n\n    // Typography\n    // ––––––––––––––––––––––––––––––––––––––––––––––––––\n\n    p,\n    h1,\n    h2,\n    h3,\n    h4,\n    h5,\n    h6,\n    code,\n    pre,\n    img {\n      min-width: 1px;\n    }\n\n    b,\n    strong {\n      font-weight: 600;\n      line-height: 1em;\n    }\n\n    p {\n      margin-top: 0;\n    }\n\n    h1,\n    h2,\n    h3,\n    h4,\n    h5,\n    h6 {\n      font-weight: 500;\n      margin-top: 0;\n      color: $day-color-heading;\n      transition: color $theme-transition-duration;\n    }\n    @at-root .night #{&} {\n      h1,\n      h2,\n      h3,\n      h4,\n      h5,\n      h6 {\n        color: $
1night-color-heading;\n      }\n    }\n\n    h1 {\n      font-size: calc(var(--line-height) * 28 / 24);\n      line-height: var(--line-height);\n      padding: calc(var(--line-height) * 3 / 2) 0 calc(var(--line-height) / 2);\n    }\n\n    h2 {\n      font-size: 1.375em;\n      line-height: var(--line-height);\n      padding: calc(var(--line-height) * 18 / 24) 0 calc(var(--line-height) / 4);\n    }\n\n    h3 {\n      font-size: 1.25em;\n      line-height: var(--line-height);\n    }\n\n    h4,\n    h5,\n    h6 {\n      font-size: 1em;\n      line-height: var(--line-height);\n      font-weight: 500;\n    }\n\n    // List\n    // ––––––––––––––––––––––––––––––––––––––––––––––––––\n    dl,\n    ol,\n    ul {\n      list-style: none;\n      margin-top: 0;\n      padding-left: 0;\n    }\n\n    dl,\n    ol,\n    ul {\n      margin-left: calc(var(--line-height) * 2);\n\n      &[dir='rtl'] {\n        margin-left: 0;\n        margin-right: calc(var(--line-height) * 2);\n      }\n    }\n\n    ol {\n      list-style: decimal;\n    }\n\n    ul {\n      list-style: initial;\n    }\n\n    // Blockquote\n    // ––––––––––––––––––––––––––––––––––––––––––––––––––\n    // /!\\ Do not use margin in this file, it will break the line multiple because of margin collapsing\n    blockquote {\n      padding: calc(var(--line-height) / 6) 0;\n\n      & > * {\n        border-left: calc(var(--line-height) / 6) solid;\n        border-left-color: $day-color-quaternary;\n        @at-root .night #{&} {\n          border-left-color: $night-color-quaternary;\n        }\n        transition: border-left-color $theme-transition-duration;\n\n        padding: 0 var(--line-height);\n\n        &:first-child {\n          padding-top: calc(var(--line-height) / 3);\n        }\n\n        &:last-child {\n          padding-bottom: calc(var(--line-height) / 3);\n        }\n\n        &[dir='rtl'] {\n          border-left: 0;\n          border-right: calc(var(--line-height) / 6) solid;\n          border-right-color: $day-color-quaternary;\n          @at-root .night #{&} {\n            border-right-color: $night-color-quaternary;\n          }\n          transition: border-right-color $theme-transition-duration;\n        }\n      }\n    }\n\n    // Code\n    // ––––––––––––––––––––––––––––––––––––––––––––––––––\n    // /!\\ Do not use margin in this file, it will break the line multiple because of margin collapsing\n    code {\n      background-color: $day-color-tertiary;\n      @at-root .night #{&} {\n        background-color: $night-color-tertiary;\n      }\n      transition: background-color $theme-transition-duration;\n\n      border-radius: calc(var(--line-height) / 6);\n      font-family: 'Inconsolata', monospace;\n      font-size: calc(var(--line-height) / 3 * 2); // 16px\n      margin: 0 calc(var(--line-height) / 6);\n      padding: calc(var(--line-height) / 12) calc(var(--line-height) / 3);\n      vertical-align: bottom;\n      letter-spacing: normal;\n      white-space: pre-wrap; // wrapping long lines\n    }\n\n    pre {\n      overflow-y: hidden;\n      padding: calc(var(--line-height) / 2) 0;\n\n      & > code {\n        display: block;\n        background: unset;\n        border-radius: 0;\n        margin: 0;\n\n        background-color: $day-color-tertiary;\n        @at-root .night #{&} {\n          background-color: $night-color-tertiary;\n        }\n\n        border-left: calc(var(--line-height) / 6) solid;\n        border-left-color: $day-color-primary;\n        @at-root .night #{&} {\n          border-left-color: $night-color-primary;\n        }\n        transition:\n          border-left-color $theme-transition-duration,\n          background-color $theme-transition-duration;\n\n        padding: calc(var(--line-height) / 2) calc(var(--line-height) * 5 / 6);\n        height: initial;\n        line-height: var(--line-height);\n        min-width: fit-content;\n        letter-spacing: normal;\n        white-space: pre-wrap; // wrapping long lines\n      }\n\n      &[dir='rtl'] {\n        & > code {\n          border-left: 0;\n          border-right: calc(var(--line-height) / 6) solid;\n          border-right-color: $day-color-primary;\n          @at-root .night #{&} {\n            border-right-color: $night-color-primary;\n          }\n          transition: border-right-color $theme-transition-duration;\n        }\n      }\n    }\n\n    // Image\n    // ––––––––––––––––––––––––––––––––––––––––––––––––––\n    img {\n      max-width: 100%;\n    }\n\n    // Link\n    // ––––––––––––––––––––––––––––––––––––––––––––––––––\n    a {\n      color: $day-color-primary;\n      @at-root .night #{&}
1 {\n        color: $night-color-primary;\n      }\n      transition: color $theme-transition-duration;\n\n      text-decoration: none;\n      height: initial;\n      line-height: 1em;\n\n      &:focus,\n      &:hover {\n        color: $day-color-secondary;\n        transition: color $theme-transition-duration;\n        cursor: pointer;\n      }\n      @at-root .night #{&} {\n        &:focus,\n        &:hover {\n          color: $night-color-secondary;\n        }\n      }\n    }\n\n    // Spacing\n    // ––––––––––––––––––––––––––––––––––––––––––––––––––\n\n    @media print {\n      & .is-empty {\n        visibility: hidden !important;\n      }\n    }\n\n    > p.title {\n      color: $day-color-heading;\n      @at-root .night #{&} {\n        color: $night-color-heading;\n      }\n      transition: color $theme-transition-duration;\n    }\n  }\n\n  .ProseMirror-dropcursor {\n    transition: opacity 0.15s ease;\n    background-color: $day-dropcursor-color !important;\n    @at-root .night #{&} {\n      background-color: $night-dropcursor-color !important;\n    }\n  }\n\n  .theme-frame--drag-reorder {\n    position: relative;\n    overflow: visible;\n    margin-top: var(--line-height);\n    margin-bottom: var(--line-height);\n\n    &:hover .theme-frame-drag-handle {\n      opacity: 1;\n    }\n  }\n\n  .theme-frame-drag-handle {\n    position: absolute;\n    left: 0;\n\n    // In v2, keep handle at text area left edge when frame is wider than text area\n    @at-root [page-layout='v2'] #{&} {\n      left: max(0px, calc(50% - var(--text-area-width) / 2));\n    }\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    width: 22px;\n    height: 16px;\n    cursor: grab;\n    opacity: 0;\n    transition: opacity 0.15s;\n    z-index: 10;\n    pointer-events: auto;\n    border-radius: 4px;\n    background-color: $day-drag-handle-bg;\n    background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' fill='rgba(72,72,72,0.4)'%3E%3Ccircle cx='2' cy='2' r='1.5'/%3E%3Ccircle cx='7' cy='2' r='1.5'/%3E%3Ccircle cx='12' cy='2' r='1.5'/%3E%3Ccircle cx='2' cy='7' r='1.5'/%3E%3Ccircle cx='7' cy='7' r='1.5'/%3E%3Ccircle cx='12' cy='7' r='1.5'/%3E%3C/svg%3E\");\n    background-repeat: no-repeat;\n    background-position: center;\n    @at-root .night #{&} {\n      background-color: $night-drag-handle-bg;\n      background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' fill='rgba(200,200,200,0.5)'%3E%3Ccircle cx='2' cy='2' r='1.5'/%3E%3Ccircle cx='7' cy='2' r='1.5'/%3E%3Ccircle cx='12' cy='2' r='1.5'/%3E%3Ccircle cx='2' cy='7' r='1.5'/%3E%3Ccircle cx='7' cy='7' r='1.5'/%3E%3Ccircle cx='12' cy='7' r='1.5'/%3E%3C/svg%3E\");\n    }\n\n    &--top {\n      top: -22px;\n    }\n\n    &--bottom {\n      bottom: -22px;\n    }\n  }\n\n  &.text-as-lines {\n    p:not(.title) {\n      font-family: 'Flow Rounded';\n      letter-spacing: -0.045em;\n      color: $day-color-line;\n      @at-root .night #{&}
1 {\n        color: $night-color-line;\n      }\n      transition: color $theme-transition-duration;\n    }\n  }\n}\n\n.text-editor-content.selection-disabled,\n.text-editor-content.selection-disabled * {\n  -webkit-user-select: none;\n  user-select: none;\n}\n\n[page-layout='v1'] {\n  .text-editor-content {\n    .text-editor-content-inner {\n      // Base\n      // ––––––––––––––––––––––––––––––––––––––––––––––––––\n      // Set box-sizing globally to handle padding and border widths\n\n      *,\n      *:after,\n      *:before {\n        box-sizing: inherit;\n      }\n    }\n  }\n}\n"],sourceRoot:""}]);const Dt=W;n.d(e,["A",0,Dt])},543(t,e,n){var r=n(1354),o=n.n(r),i=n(6314),s=n.n(i)()(o());s.push([t.id,".label-editor-overlay{position:absolute;z-index:1;left:var(--label-editor-left, 0);top:var(--label-editor-top, 0);width:var(--label-editor-width, 0);height:var(--label-editor-height, 0);margin:0;padding:0;border:none;outline:none;overflow:hidden;box-sizing:content-box;white-space:pre-wrap;overflow-wrap:break-word;background:rgba(0,0,0,0);pointer-events:auto;text-align:var(--label-editor-text-align, start);font:var(--label-editor-font);line-height:var(--label-editor-line-height);color:rgba(0,0,0,0);caret-color:var(--label-editor-caret-color)}.label-editor-overlay *{color:rgba(0,0,0,0) !important}.label-editor-overlay ::selection{background-color:rgba(51,144,255,.4)}.label-editor-overlay [data-run-svg]{outline:none}.label-editor-overlay [data-run-svg].label-run-svg-selected{background-color:rgba(51,144,255,.4)}.label-editor-inner{white-space:pre-wrap;overflow-wrap:break-word;outline:none;min-height:100%}.label-editor-inner p{margin:0;padding:0}","",{version:3,sources:["webpack://./lib/src/tiptap-label/tiptap_label.scss"],names:[],mappings:"AAIA,sBACE,iBAAA,CACA,SAAA,CACA,gCAAA,CACA,8BAAA,CACA,kCAAA,CACA,oCAAA,CACA,QAAA,CACA,SAAA,CACA,WAAA,CACA,YAAA,CACA,eAAA,CACA,sBAAA,CACA,oBAAA,CACA,wBAAA,CACA,wBAAA,CACA,mBAAA,CACA,gDAAA,CAEA,6BAAA,CACA,2CAAA,CAEA,mBAAA,CACA,2CAAA,CAEA,wBACE,8BAAA,CAIF,kCACE,oCAlCc,CAsChB,qCACE,YAAA,CAGF,4DACE,oCA3Cc,CAgDlB,oBACE,oBAAA,CACA,wBAAA,CACA,YAAA,CAEA,eAAA,CAEA,sBACE,QAAA,CACA,SAAA",sourcesContent:["// Native selection blue, spelled out here because a drawing has to match it without a browser to ask.\n$selection-color: rgba(51, 144, 255, 0.4);\n\n// Invisible in-place label editor; class and custom properties set by TipTapLabelOverlay.\n.label-editor-overlay {\n  position: absolute;\n  z-index: 1;\n  left: var(--label-editor-left, 0);\n  top: var(--label-editor-top, 0);\n  width: var(--label-editor-width, 0);\n  height: var(--label-editor-height, 0);\n  margin: 0;\n  padding: 0;\n  border: none;\n  outline: none;\n  overflow: hidden;\n  box-sizing: content-box;\n  white-space: pre-wrap;\n  overflow-wrap: break-word;\n  background: transparent;\n  pointer-events: auto;\n  text-align: var(--label-editor-text-align, start);\n  // `font` must precede `line-height` — the shorthand resets it.\n  font: var(--label-editor-font);\n  line-height: var(--label-editor-line-height);\n  // Glyphs come from the SVG below; only the native caret and selection show.\n  color: transparent;\n  caret-color: var(--label-editor-caret-color);\n\n  * {\n    color: transparent !important;\n  }\n\n  // Both sides of one highlight: the text draws its own, an empty spacer has to be painted.\n  ::selection {\n    background-color: $selection-color;\n  }\n\n  // A drawing is painted by the canvas below; the editor only reserves its room and shows it selected.\n  [data-run-svg] {\n    outline: none;\n  }\n\n  [data-run-svg].label-run-svg-selected {\n    background-color: $selection-color;\n  }\n}\n\n// Scoped so the page editor's .text-editor-content-inner rules never apply.\n.label-editor-inner {\n  white-space: pre-wrap;\n  overflow-wrap: break-word;\n  outline: none;\n  // Fill the wrapper so clicks below the last line still land on the contenteditable.\n  min-height: 100%;\n\n  p {\n    margin: 0;\n    padding: 0;\n  }\n}\n"],sourceRoot:""}]);const a=s;
1n.d(e,["A",0,a])},6314(t){t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n}).join("")},e.i=function(t,n,r,o,i){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(r)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var c=0;c<t.length;c++){var d=[].concat(t[c]);r&&s[d[0]]||(void 0!==i&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=i),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),o&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=o):d[4]="".concat(o)),e.push(d))}},e}},4417(t){t.exports=function(t,e){return e||(e={}),t?(t=String(t.__esModule?t.default:t),/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),e.hash&&(t+=e.hash),/["'() \t\n]|(%20)/.test(t)||e.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t):t}},1354(t){t.exports=function(t){var e=t[1],n=t[3];if(!n)return e;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),i="/*# ".concat(o," */");return[e].concat([i]).join("\n")}return[e].join("\n")}},1142(t){t.exports="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2714%27 height=%279%27 fill=%27rgba%28200,200,200,0.5%29%27%3E%3Ccircle cx=%272%27 cy=%272%27 r=%271.5%27/%3E%3Ccircle cx=%277%27 cy=%272%27 r=%271.5%27/%3E%3Ccircle cx=%2712%27 cy=%272%27 r=%271.5%27/%3E%3Ccircle cx=%272%27 cy=%277%27 r=%271.5%27/%3E%3Ccircle cx=%277%27 cy=%277%27 r=%271.5%27/%3E%3Ccircle cx=%2712%27 cy=%277%27 r=%271.5%27/%3E%3C/svg%3E"},8504(t){t.exports="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2714%27 height=%279%27 fill=%27rgba%2872,72,72,0.4%29%27%3E%3Ccircle cx=%272%27 cy=%272%27 r=%271.5%27/%3E%3Ccircle cx=%277%27 cy=%272%27 r=%271.5%27/%3E%3Ccircle cx=%2712%27 cy=%272%27 r=%271.5%27/%3E%3Ccircle cx=%272%27 cy=%277%27 r=%271.5%27/%3E%3Ccircle cx=%277%27 cy=%277%27 r=%271.5%27/%3E%3Ccircle cx=%2712%27 cy=%277%27 r=%271.5%27/%3E%3C/svg%3E"},4029(t,e,n){t.exports=n.p+"272617badc36844781e7.svg"},850(t,e,n){t.exports=n.p+"efdfa4de9ade8fcc8df0.svg"},8138(t,e,n){t.exports=n.p+"1aae246c0a027c4ee763.svg"},4654(t,e,n){t.exports=n.p+"730311866417c9366545.svg"},8019(t,e,n){t.exports=n.p+"829edbd55f1a81efd8c1.svg"},3115(t,e,n){t.exports=n.p+"5b1fcc6bbb5be79f0e4e.svg"},2274(t,e,n){t.exports=n.p+"81e9f14d41c4cf6eef89.svg"},8502(t,e,n){t.exports=n.p+"fc631ecd368d550a0637.svg"},6941(t,e,n){t.exports=n.p+"31e74ca2ec883b7ea1f0.svg"},6745(t,e,n){t.exports=n.p+"9f813345d7f51dc3d55a.svg"},5188(t,e,n){t.exports=n.p+"1a24fa9ae96a03e26599.svg"},4340(t,e,n){t.exports=n.p+"57f04f940ee61b2c2136.svg"},3229(t,e,n){t.exports=n.p+"92cdc8ad5bde6a65254d.svg"},3758(t,e,n){t.exports=n.p+"c0c74e099a5e96aa094e.svg"},798(t,e,n){t.exports=n.p+"268b90ef8a4aa4c82dd5.svg"},1890(t,e,n){t.exports=n.p+"c208b2dfd06ac336917f.svg"},7589(t,e,n){t.exports=n.p+"66787406989292dbd39c.svg"},8145(t,e,n){t.exports=n.p+"2ba179eedac67a08fdf1.svg"},3556(t,e,n){t.exports=n.p+"6d2563de53ef8e01d6ec.svg"},5492(t,e,n){t.exports=n.p+"06eb96cda71f52bec39a.svg"},8881(t,e,n){t.exports=n.p+"d2005c90b9aa808d0e78.svg"},7693(t,e,n){t.exports=n.p+"d46386eff5ea0bf3d5a4.svg"},8507(t,e,n){t.exports=n.p+"a2607123a62f53c8bd0c.svg"},1443(t,e,n){t.exports=n.p+"204d4fc46f96fd2e8d5e.svg"},6241(t,e,n){t.exports=n.p+"f1a1a0dacd463952e219.svg"},8157(t,e,n){t.exports=n.p+"0a294d9700f975b70816.svg"},3859(t,e,n){t.exports=n.p+"d67c1ea41b16dabd9d81.svg"},7963(t,e,n){t.exports=n.p+"d3301dfbb4b45107348b.svg"},1261(t,e,n){t.exports=n.p+"f12af1a71710af9814c4.svg?v=2"},5973(t,e,n){t.exports=n.p+"9b8c9adfbc2cc3dee4c3.svg?v=2"},644(t,e,n){t.exports=n.p+"9f274cfaf4f7d8550cea.svg"},2404(t,e,n){t.exports=n.p+"37836eb665bd8a5adccb.svg"},1204(t,e,n){t.exports=n.p+"6dd943ba8b7cc44dc901.svg"},3523(t,e,n){t.exports=n.p+"414df491e025330a0518.svg"},443(t,e,n){t.exports=n.p+"b0b3fdd6eb66e1fc160a.svg"},5339(t,e,n){var r=n(4496);t.exports=r},5947(t,e,n){n(7978);var r=n(7506);t.exports=r},1478(t,e,n){n(5115);var r=n(4899);t.exports=r},7086(t,e,n){var r=n(6501);t.exports=r},4881(t,e,n){var r=n(6258);t.exports=r},8217(t,e,n){var r=n(4170);t.exports=r},4909(t,e,n){var r=n(1436);t.exports=r},4212(t,e,n){var r=n(1015);t.exports=r},9497(t,e,n){n(8107);var r=n(7015);t.exports=r("Array","at")},1949(t,e,n){n(3451);var r=n(7015);t.exports=r("Array","findLastIndex")},3836(t,e,n){n(838);var r=n(7015);t.exports=r("Array","findLast")},4552(t,e,n){n(8350),n(237);var r=n(7015);t.exports=r("Array","flatMap")},2323(t,e,n){n(6449),n(3514);var r=n(7015);t.exports=r("Array","flat")},9951(t,e,n){n(8347);var r=n(9167);t.exports=r.Object.hasOwn},4295(t,e,n){n(7357);var r=n(7015);t.exports=r("String","at")},5818(t,e,n){n(7495),n(5440),n(9978);var r=n(7015);t.exports=r("String","replaceAll")},9306(t,e,n){var r=n(4901),o=n(6823),i=TypeError;t.exports=function(t){if(r(t))return t;throw new i(o(t)+" is not a function")}},3506(t,e,n){var r=n(3925),o=String,i=TypeError;t.exports=function(t){if(r(t))return t;throw new i("Can't set "+o(t)+" as a prototype")}},6469(t,e,n){var r=n(8227),o=n(2360),i=n(4913).f,s=r("unscopables"),a=Array.prototype;void 0===a[s]&&i(a,s,{configurable:!0,value:o(null)}),t.exports=function(t){a[s][t]=!0}},7829(t,e,n){var r=n(8183).o;t.exports=function(t,e,n){return e+(n&&r(t,e).length||1)}},8551(t,e,n){var r=n(34),o=String,i=TypeError;t.exports=function(t){if(r(t))return t;throw new i(o(t)+" is not an object")}},7811(t){t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},4644(t,e,n){var r,o,i,s=n(7811),a=n(3724),l=n(4576),c=n(4901),d=n(34),u=n(9297),h=n(6955),p=n(6823),f=n(6699),g=n(6840),m=n(2106),A=n(1625),y=n(2787),b=n(2967),v=n(8227),w=n(3392),k=n(1181),C=k.enforce,x=k.get,S=l.Int8Array,E=S&&S.prototype,M=l.Uint8ClampedArray,T=M&&M.prototype,_=S&&y(S),D=E&&y(E),O=Object.prototype,I=l.TypeError,N=v("toStringTag"),L=w("TYPED_ARRAY_TAG"),B="TypedArrayConstructor",$=s&&!!b&&"Opera"!==h(l.opera),R=!1,P={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},F={BigInt64Array:8,BigUint64Array:8},z=function(t){var e=y(t);if(d(e)){var n=x(e);return n&&u(n,B)?n[B]:z(e)}},H=function(t){if(!d(t))return!1;var e=h(t);return u(P,e)||u(F,e)};for(r in P)(i=(o=l[r])&&o.prototype)?C(i)[B]=o:$=!1;for(r in F)(i=(o=l[r])&&o.prototype)&&(C(i)[B]=o);if((!$||!c(_)||_===Function.prototype)&&(_=function(){throw new I("Incorrect invocation")},$))for(r in P)l[r]&&b(l[r],_);if((!$||!D||D===O)&&(D=_.prototype,$))for(r in P)l[r]&&b(l[r].prototype,D);if($&&y(T)!==D&&b(T,D),a&&!u(D,N))for(r in R=!0,m(D,N,{configurable:!0,get:function(){return d(this)?this[L]:void 0}}),P)l[r]&&f(l[r].prototype,L,r);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:$,TYPED_ARRAY_TAG:R&&L,aTypedArray:function(t){if(H(t))return t;throw new I("Target is not a typed array")},aTypedArrayConstructor:function(t){if(c(t)&&(!b||A(_,t)))return t;throw new I(p(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,n,r){if(a){if(n)for(var o in P){var i=l[o];if(i&&u(i.prototype,t))try{delete i.prototype[t]}catch(n){try{i.prototype[t]=e}catch(t){}}}D[t]&&!n||g(D,t,n?e:$&&E[t]||e,r)}},exportTypedArrayStaticMethod:function(t,e,n){var r,o;
1if(a){if(b){if(n)for(r in P)if((o=l[r])&&u(o,t))try{delete o[t]}catch(t){}if(_[t]&&!n)return;try{return g(_,t,n?e:$&&_[t]||e)}catch(t){}}for(r in P)!(o=l[r])||o[t]&&!n||g(o,t,e)}},getTypedArrayConstructor:z,isView:function(t){if(!d(t))return!1;var e=h(t);return"DataView"===e||u(P,e)||u(F,e)},isTypedArray:H,TypedArray:_,TypedArrayPrototype:D}},4373(t,e,n){var r=n(8981),o=n(5610),i=n(6198);t.exports=[].fill||function(t){for(var e=r(this),n=i(e),s=arguments.length,a=o(s>1?arguments[1]:void 0,n),l=s>2?arguments[2]:void 0,c=void 0===l?n:o(l,n);c>a;)e[a++]=t;return e}},9617(t,e,n){var r=n(5397),o=n(5610),i=n(6198),s=function(t){return function(e,n,s){var a=r(e),l=i(a);if(0===l)return!t&&-1;var c,d=o(s,l);if(t&&n!=n){for(;l>d;)if((c=a[d++])!=c)return!0}else for(;l>d;d++)if((t||d in a)&&a[d]===n)return t||d||0;return!t&&-1}};t.exports={m:s(!0),q:s(!1)}},3839(t,e,n){var r=n(6080),o=n(7055),i=n(8981),s=n(6198),a=function(t){var e=1===t;return function(n,a,l){for(var c,d=i(n),u=o(d),h=s(u),p=r(a,l);h-- >0;)if(p(c=u[h],h,d))switch(t){case 0:return c;case 1:return h}return e?-1:void 0}};t.exports={U:a(0),K:a(1)}},7680(t,e,n){var r=n(9504);t.exports=r([].slice)},4488(t,e,n){var r=n(7680),o=Math.floor,i=function(t,e){var n=t.length;if(n<8)for(var s,a,l=1;l<n;){for(a=l,s=t[l];a&&e(t[a-1],s)>0;)t[a]=t[--a];a!==l++&&(t[a]=s)}else for(var c=o(n/2),d=i(r(t,0,c),e),u=i(r(t,c),e),h=d.length,p=u.length,f=0,g=0;f<h||g<p;)t[f+g]=f<h&&g<p?e(d[f],u[g])<=0?d[f++]:u[g++]:f<h?d[f++]:u[g++];return t};t.exports=i},7433(t,e,n){var r=n(4376),o=n(3517),i=n(34),s=n(8227)("species"),a=Array;t.exports=function(t){var e;return r(t)&&(e=t.constructor,(o(e)&&(e===a||r(e.prototype))||i(e)&&null===(e=e[s]))&&(e=void 0)),void 0===e?a:e}},1469(t,e,n){var r=n(7433);t.exports=function(t,e){return new(r(t))(0===e?0:e)}},2195(t,e,n){var r=n(9504),o=r({}.toString),i=r("".slice);t.exports=function(t){return i(o(t),8,-1)}},6955(t,e,n){var r=n(2140),o=n(4901),i=n(2195),s=n(8227)("toStringTag"),a=Object,l="Arguments"===i(function(){return arguments}());t.exports=r?i:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=a(t),s))?n:l?i(e):"Object"===(r=i(e))&&o(e.callee)?"Arguments":r}},7740(t,e,n){var r=n(9297),o=n(5031),i=n(7347),s=n(4913);t.exports=function(t,e,n){for(var a=o(e),l=s.f,c=i.f,d=0;d<a.length;d++){var u=a[d];r(t,u)||n&&r(n,u)||l(t,u,c(e,u))}}},2211(t,e,n){var r=n(9039);t.exports=!r(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},6699(t,e,n){var r=n(3724),o=n(4913),i=n(6980);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},6980(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},4659(t,e,n){var r=n(3724),o=n(4913),i=n(6980);t.exports=function(t,e,n){r?o.f(t,e,i(0,n)):t[e]=n}},2106(t,e,n){var r=n(283),o=n(4913);t.exports=function(t,e,n){return n.get&&r(n.get,e,{getter:!0}),n.set&&r(n.set,e,{setter:!0}),o.f(t,e,n)}},6840(t,e,n){var r=n(4901),o=n(4913),i=n(283),s=n(9433);t.exports=function(t,e,n,a){a||(a={});var l=a.enumerable,c=void 0!==a.name?a.name:e;if(r(n)&&i(n,c,a),a.global)l?t[e]=n:s(e,n);else{try{a.unsafe?t[e]&&(l=!0):delete t[e]}catch(t){}l?t[e]=n:o.f(t,e,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},9433(t,e,n){var r=n(4576),o=Object.defineProperty;t.exports=function(t,e){try{o(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},3724(t,e,n){var r=n(9039);t.exports=!r(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},4055(t,e,n){var r=n(4576),o=n(34),i=r.document,s=o(i)&&o(i.createElement);t.exports=function(t){return s?i.createElement(t):{}}},6837(t){var e=TypeError;t.exports=function(t){if(t>9007199254740991)throw new e("Maximum allowed index exceeded");return t}},7015(t,e,n){var r=n(4576),o=n(9504);t.exports=function(t,e){return o(r[t].prototype[e])}},8727(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleStr
1ing","toString","valueOf"]},3709(t,e,n){var r=n(2839).match(/firefox\/(\d+)/i);t.exports=!!r&&+r[1]},3763(t,e,n){var r=n(2839);t.exports=/MSIE|Trident/.test(r)},2839(t,e,n){var r=n(4576).navigator,o=r&&r.userAgent;t.exports=o?String(o):""},9519(t,e,n){var r,o,i=n(4576),s=n(2839),a=i.process,l=i.Deno,c=a&&a.versions||l&&l.version,d=c&&c.v8;d&&(o=(r=d.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&s&&(!(r=s.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/))&&(o=+r[1]),t.exports=o},3607(t,e,n){var r=n(2839).match(/AppleWebKit\/(\d+)\./);t.exports=!!r&&+r[1]},6518(t,e,n){var r=n(4576),o=n(7347).f,i=n(6699),s=n(6840),a=n(9433),l=n(7740),c=n(2796);t.exports=function(t,e){var n,d,u,h,p,f=t.target,g=t.global,m=t.stat;if(n=g?r:m?r[f]||a(f,{}):r[f]&&r[f].prototype)for(d in e){if(h=e[d],u=t.dontCallGetSet?(p=o(n,d))&&p.value:n[d],!c(g?d:f+(m?".":"#")+d,t.forced)&&void 0!==u){if(typeof h==typeof u)continue;l(h,u)}(t.sham||u&&u.sham)&&i(h,"sham",!0),s(n,d,h,t)}}},9039(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},9228(t,e,n){n(7495);var r=n(9565),o=n(6840),i=n(7323),s=n(9039),a=n(8227),l=n(6699),c=a("species"),d=RegExp.prototype;t.exports=function(t,e,n,u){var h=a(t),p=!s(function(){var e={};return e[h]=function(){return 7},7!==""[t](e)}),f=p&&!s(function(){var e=!1,n=/a/;if("split"===t){var r={};r[c]=function(){return n},(n={constructor:r,flags:""})[h]=/./[h]}return n.exec=function(){return e=!0,null},n[h](""),!e});if(!p||!f||n){var g=/./[h],m=e(h,""[t],function(t,e,n,o,s){var a=e.exec;return a===i||a===d.exec?p&&!s?{done:!0,value:r(g,e,n,o)}:{done:!0,value:r(t,n,e,o)}:{done:!1}});o(String.prototype,t,m[0]),o(d,h,m[1])}u&&l(d[h],"sham",!0)}},259(t,e,n){var r=n(4376),o=n(6198),i=n(6837),s=n(6080),a=n(4659),l=function(t,e,n,c,d,u,h,p){for(var f,g,m=d,A=0,y=!!h&&s(h,p);A<c;)A in n&&(f=y?y(n[A],A,e):n[A],u>0&&r(f)?(g=o(f),m=l(t,e,f,g,m,u-1)-1):(i(m+1),a(t,m,f)),m++),A++;return m};t.exports=l},8745(t,e,n){var r=n(616),o=Function.prototype,i=o.apply,s=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?s.bind(i):function(){return s.apply(i,arguments)})},6080(t,e,n){var r=n(7476),o=n(9306),i=n(616),s=r(r.bind);t.exports=function(t,e){return o(t),void 0===e?t:i?s(t,e):function(){return t.apply(e,arguments)}}},616(t,e,n){var r=n(9039);t.exports=!r(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})},9565(t,e,n){var r=n(616),o=Function.prototype.call;t.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},350(t,e,n){var r=n(3724),o=n(9297),i=Function.prototype,s=r&&Object.getOwnPropertyDescriptor,a=o(i,"name")&&(!r||r&&s(i,"name").configurable);t.exports={i2:a}},6706(t,e,n){var r=n(9504),o=n(9306);t.exports=function(t,e,n){try{return r(o(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(t){}}},7476(t,e,n){var r=n(2195),o=n(9504);t.exports=function(t){if("Function"===r(t))return o(t)}},9504(t,e,n){var r=n(616),o=Function.prototype,i=o.call,s=r&&o.bind.bind(i,i);t.exports=r?s:function(t){return function(){return i.apply(t,arguments)}}},7751(t,e,n){var r=n(4576),o=n(4901);t.exports=function(t,e){return arguments.length<2?(n=r[t],o(n)?n:void 0):r[t]&&r[t][e];var n}},5966(t,e,n){var r=n(9306),o=n(4117);t.exports=function(t,e){var n=t[e];return o(n)?void 0:r(n)}},2478(t,e,n){var r=n(9504),o=n(8981),i=Math.floor,s=r("".charAt),a=r("".replace),l=r("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,d=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,n,r,u,h){var p=n+t.length,f=r.length,g=d;return void 0!==u&&(u=o(u),g=c),a(h,g,function(o,a){var c;switch(s(a,0)){case"$":return"$";case"&":return t;case"`":return l(e,0,n);case"'":return l(e,p);case"<":c=u[l(a,1,-1)];break;default:var d=+a;if(0===d)return o;if(d>f){var h=i(d/10);return 0===h?o:h<=f?void 0===r[h-1]?s(a,1):r[h-1]+s(a,1):o}c=r[d-1]}return void 0===c?"":c})}},4576(t){var e=function(t){return t&&t.Math===Math&&t};t.exports=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof globalThis&&globalThis)||e("object"==typeof this&&this)||function(){return this}()||Function("return this")()},9297(t,e,n){var r=n(9504),o=n(8981),i=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},421(t){t.exports={}},397(t,e,n){var r=n(7751);t.exports=r("document","documentElement")},5917(t,e,n){var r=n(3724),o=n(9039),i=n(4055);t.exports=!r&&!o(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})},7055(t,e,n){var r=n(9504),o=n(9039),i=n(2195),s=Object,a=r("".split);t.exports=o(function(){return!s("z").propertyIsEnumerable(0)})?function(t){return"String"===i(t)?a(t,""):s(t)}:s},3706(t,e,n){var r=n(9504),o=n(4901),i=n(7629),s=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return s(t)}),t.exports=i.inspectSource},1181(t,e,n){var r,o,i,s=n(8622),a=n(4576),l=n(34),c=n(6699),d=n(9297),u=n(7629),h=n(6119),p=n(421),f="Object already initialized",g
vendor: 6,078 bytes, line 1
1=a.TypeError,m=a.WeakMap;if(s||u.state){var A=u.state||(u.state=new m);A.get=A.get,A.has=A.has,A.set=A.set,r=function(t,e){if(A.has(t))throw new g(f);return e.facade=t,A.set(t,e),e},o=function(t){return A.get(t)||{}},i=function(t){return A.has(t)}}else{var y=h("state");p[y]=!0,r=function(t,e){if(d(t,y))throw new g(f);return e.facade=t,c(t,y,e),e},o=function(t){return d(t,y)?t[y]:{}},i=function(t){return d(t,y)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!l(e)||(n=o(e)).type!==t)throw new g("Incompatible receiver, "+t+" required");return n}}}},4376(t,e,n){var r=n(2195);t.exports=Array.isArray||function(t){return"Array"===r(t)}},4901(t){var e="object"==typeof document&&document.all;t.exports=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(t){return"function"==typeof t}},3517(t,e,n){var r=n(9504),o=n(9039),i=n(4901),s=n(6955),a=n(7751),l=n(3706),c=function(){},d=a("Reflect","construct"),u=/^\s*(?:class|function)\b/,h=r(u.exec),p=!u.test(c),f=function(t){if(!i(t))return!1;try{return d(c,[],t),!0}catch(t){return!1}},g=function(t){if(!i(t))return!1;switch(s(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!h(u,l(t))}catch(t){return!0}};g.sham=!0,t.exports=!d||o(function(){var t;return f(f.call)||!f(Object)||!f(function(){t=!0})||t})?g:f},2796(t,e,n){var r=n(9039),o=n(4901),i=/#|\.prototype\./,s=function(t,e){var n=l[a(t)];return n===d||n!==c&&(o(e)?r(e):!!e)},a=s.normalize=function(t){return String(t).replace(i,".").toLowerCase()},l=s.data={},c=s.NATIVE="N",d=s.POLYFILL="P";t.exports=s},4117(t){t.exports=function(t){return null==t}},34(t,e,n){var r=n(4901);t.exports=function(t){return"object"==typeof t?null!==t:r(t)}},3925(t,e,n){var r=n(34);t.exports=function(t){return r(t)||null===t}},6395(t){t.exports=!1},788(t,e,n){var r=n(34),o=n(2195),i=n(8227)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[i])?!!e:"RegExp"===o(t))}},757(t,e,n){var r=n(7751),o=n(4901),i=n(1625),s=n(7040),a=Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return o(e)&&i(e.prototype,a(t))}},6198(t,e,n){var r=n(8014);t.exports=function(t){return r(t.length)}},283(t,e,n){var r=n(9504),o=n(9039),i=n(4901),s=n(9297),a=n(3724),l=n(350).i2,c=n(3706),d=n(1181),u=d.enforce,h=d.get,p=String,f=Object.defineProperty,g=r("".slice),m=r("".replace),A=r([].join),y=a&&!o(function(){return 8!==f(function(){},"length",{value:8}).length}),b=String(String).split("String"),v=t.exports=function(t,e,n){"Symbol("===g(p(e),0,7)&&(e="["+m(p(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!s(t,"name")||l&&t.name!==e)&&(a?f(t,"name",{value:e,configurable:!0}):t.name=e),y&&n&&s(n,"arity")&&t.length!==n.arity&&f(t,"length",{value:n.arity});try{n&&s(n,"constructor")&&n.constructor?a&&f(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=u(t);return s(r,"source")||(r.source=A(b,"string"==typeof e?e:"")),t};Function.prototype.toString=v(function(){return i(this)&&h(this).source||c(this)},"toString")},741(t){var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var r=+t;return(r>0?n:e)(r)}},2360(t,e,n){var r,o=n(8551),i=n(6801),s=n(8727),a=n(421),l=n(397),c=n(4055),d=n(6119),u="prototype",h="script",p=d("IE_PROTO"),f=function(){},g=function(t){return"<"+h+">"+t+"</"+h+">"},m=function(t){t.write(g("")),t.close();var e=t.parentWindow.Object;return t=null,e},A=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}var t,e,n;A="undefined"!=typeof document?document.domain&&r?m(r):(e=c("iframe"),n="java"+h+":",e.style.display="none",l.appendChild(e),e.src=String(n),(t=e.contentWindow.document).open(),t.write(g("document.F=Object")),t.close(),t.F):m(r);for(var o=s.length;o--;)delete A[u][s[o]];return A()};a[p]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(f[u]=o(t),n=new f,f[u]=null,n[p]=t):n=A(),void 0===e?n:i.f(n,e)}},6801(t,e,n){var r=n(3724),o=n(8686),i=n(4913),s=n(8551),a=n(5397),l=n(1072);e.f=r&&!o?Object.defineProperties:function(t,e){s(t);for(var n,r=a(e),o=l(e),c=o.length,d=0;c>d;)i.f(t,n=o[d++],r[n]);return t}},4913(t,e,n){var r=n(3724),o=n(5917),i=n(8686),s=n(8551),a=n(6969),l=TypeError,c=Object.defineProperty,d=Object.getOwnPropertyDescriptor,u="enumerable",h="configurable",p="writable";e.f=r?i?function(t,e,n){if(s(t),e=a(e),s(n),"function"==typeof t&&"prototype"===e&&"value"in n&&p in n&&!n[p]){var r=d(t,e);r&&r[p]&&(t[e]=n.value,n={configurable:h in n?n[h]:r[h],enumerable:u in n?n[u]:r[u],writable:!1})}return c(t,e,n)}:c:function(t,e,n){if(s(t),e=a(e),s(n),o)try{return c(t,e,n)}catch(t){}if("get"in n||"set"in n)throw new l("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},7347(t,e,n){var r=n(3724),o=n(9565),i=n(8773),s=n(6980),a=n(5397),l=n(6969),c=n(9297),d=n(5917),u=Object.getOwnPropertyDescriptor;e.f=r?u:function(t,e){if(t=a(t),e=l(e),d)try{return u(t,e)}catch(t){}if(c(t,e))return s(!o(i.f,t,e),t[e])}},8480(t,e,n){var r=n(1828),o=n(8727).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},3717(t,e){e.f=Object.getOwnPropertySymbols},2787(t,e,n){var r=n(9297),o=n(4901),i=n(8981),s=n(6119),a=n(2211),l=s("IE_PROTO"),c=Object,d=c.prototype;t.exports=a?c.getPrototypeOf:function(t){var e=i(t);if(r(e,l))return e[l];var n=e.constructor;return o(n)&&e instanceof n?n.prototype:e instanceof c?d:null}},1625(t,e,n){var r=n(9504);t.exports=r({}.isPrototypeOf)},1828(t,e,n){var r=n(9504),o=n(9297),i=n(5397),s=n(9617).q,a=n(421),l=r([].push);t.exports=function(t,e){var n,r=i(t),c=0,d=[];for(n in r)!o(a,n)&&o(r,n)&&l(d,n);for(;e.length>c;)o(r,n=e[c++])&&(~s(d,n)||l(d,n));return d}},1072(t,e,n){var r=n(1828),o=n(8727);t.exports=Object.keys||function(t){return r(t,o)}},8773(t,e){var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);e.f=o?function(t){var e=r(this,t);return!!e&&e.enumerable}:n},2967(t,e,n){var r=n(6706),o=n(34),i=n(7750),s=n(3506);
1t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=r(Object.prototype,"__proto__","set"))(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return i(n),s(r),o(n)?(e?t(n,r):n.__proto__=r,n):n}}():void 0)},4270(t,e,n){var r=n(9565),o=n(4901),i=n(34),s=TypeError;t.exports=function(t,e){var n,a;if("string"===e&&o(n=t.toString)&&!i(a=r(n,t)))return a;if(o(n=t.valueOf)&&!i(a=r(n,t)))return a;if("string"!==e&&o(n=t.toString)&&!i(a=r(n,t)))return a;throw new s("Can't convert object to primitive value")}},5031(t,e,n){var r=n(7751),o=n(9504),i=n(8480),s=n(3717),a=n(8551),l=o([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(a(t)),n=s.f;return n?l(e,n(t)):e}},9167(t,e,n){var r=n(4576);t.exports=r},6682(t,e,n){var r=n(9565),o=n(8551),i=n(4901),s=n(2195),a=n(7323),l=TypeError;t.exports=function(t,e){var n=t.exec;if(i(n)){var c=r(n,t,e);return null!==c&&o(c),c}if("RegExp"===s(t))return r(a,t,e);throw new l("RegExp#exec called on incompatible receiver")}},7323(t,e,n){var r,o,i=n(9565),s=n(9504),a=n(655),l=n(7979),c=n(8429),d=n(5745),u=n(2360),h=n(1181).get,p=n(3635),f=n(8814),g=d("native-string-replace",String.prototype.replace),m=RegExp.prototype.exec,A=m,y=s("".charAt),b=s("".indexOf),v=s("".replace),w=s("".slice),k=(o=/b*/g,i(m,r=/a/,"a"),i(m,o,"a"),0!==r.lastIndex||0!==o.lastIndex),C=c.BROKEN_CARET,x=void 0!==/()??/.exec("")[1],S=function(t,e){for(var n=t.groups=u(null),r=0;r<e.length;r++){var o=e[r];n[o[0]]=t[o[1]]}};(k||x||C||p||f)&&(A=function(t){var e,n,r,o=this,s=h(o),c=a(t),d=s.raw;if(d)return d.lastIndex=o.lastIndex,e=i(A,d,c),o.lastIndex=d.lastIndex,e&&s.groups&&S(e,s.groups),e;var u=s.groups,p=C&&o.sticky,f=i(l,o),E=o.source,M=0,T=c;if(p){f=v(f,"y",""),-1===b(f,"g")&&(f+="g"),T=w(c,o.lastIndex);var _=o.lastIndex>0&&y(c,o.lastIndex-1);o.lastIndex>0&&(!o.multiline||o.multiline&&"\n"!==_&&"\r"!==_&&"\u2028"!==_&&"\u2029"!==_)&&(E="(?: (?:"+E+"))",T=" "+T,M++),n=new RegExp("^(?:"+E+")",f)}x&&(n=new RegExp("^"+E+"$(?!\\s)",f)),k&&(r=o.lastIndex);var D=i(m,p?n:o,T);return p?D?(D.input=c,D[0]=w(D[0],M),D.index=o.lastIndex,o.lastIndex+=D[0].length):o.lastIndex=0:k&&D&&(o.lastIndex=o.global?D.index+D[0].length:r),x&&D&&D.length>1&&i(g,D[0],n,function(){for(var t=1;t<arguments.length-2;t++)void 0===arguments[t]&&(D[t]=void 0)}),D&&u&&S(D,u),D}),t.exports=A},5213(t,e,n){var r=n(4576),o=n(9039),i=r.RegExp,s=!o(function(){var t=!0;try{i(".","d")}catch(e){t=!1}var e={},n="",r=t?"dgimsy":"gimsy",o=function(t,r){Object.defineProperty(e,t,{get:function(){return n+=r,!0}})},s={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var a in t&&(s.hasIndices="d"),s)o(a,s[a]);return Object.getOwnPropertyDescriptor(i.prototype,"flags").get.call(e)!==r||n!==r});t.exports={correct:s}},7979(t,e,n){var r=n(8551);t.exports=function(){var t=r(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},1034(t,e,n){var r=n(9565),o=n(9297),i=n(1625),s=n(5213),a=n(7979),l=RegExp.prototype;t.exports=s.correct?function(t){return t.flags}:function(t){return s.correct||!i(l,t)||o(t,"flags")?t.flags:r(a,t)}},8429(t,e,n){var r=n(9039),o=n(4576).RegExp,i=r(function(){var t=o("a","y");return t.lastIndex=2,null!==t.exec("abcd")}),s=i||r(function(){return!o("a","y").sticky}),a=i||r(function(){var t=o("^r","gy");return t.lastIndex=2,null!==t.exec("str")});t.exports={BROKEN_CARET:a,MISSED_STICKY:s,UNSUPPORTED_Y:i}},3635(t,e,n){var r=n(9039),o=n(4576).RegExp;t.exports=r(function(){var t=o(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)})},8814(t,e,n){var r=n(9039),o=n(4576).RegExp;t.exports=r(function(){var t=o("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")})},7750(t,e,n){var r=n(4117),o=TypeError;t.exports=function(t){if(r(t))throw new o("Can't call method on "+t);return t}},6119(t,e,n){var r=n(5745),o=n(3392),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},7629(t,e,n){var r=n(6395),o=n(4576),i=n(9433),s="__core-js_shared__",a=t.exports=o[s]||i(s,{});(a.versions||(a.versions=[])).push({version:"3.50.0",mode:r?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.50.0/LICENSE",source:"https://github.com/zloirock/core-js"})},5745(t,e,n){var r=n(7629),o=Object.create||Object;t.exports=function(t,e){return r[t]||(r[t]=e||o(null))}},8183(t,e,n){var r=n(9504),o=n(1291),i=n(655),s=n(7750),a=r("".charAt),l=r("".charCodeAt),c=r("".slice),d=function(t){return function(e,n){var r,d,u=i(s(e)),h=o(n),p=u.length;return h<0||h>=p?t?"":void 0:(r=l(u,h))<55296||r>56319||h+1===p||(d=l(u,h+1))<56320||d>57343?t?a(u,h):r:t?c(u,h,h+2):d-56320+(r-55296<<10)+65536}};t.exports={...void d(!1),o:d(!0)}},4495(t,e,n){var r=n(9519),o=n(9039),i=n(4576).String;t.exports=!!Object.getOwnPropertySymbols&&!o(function(){var t=Symbol("symbol detection");return!i(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41})},5610(t,e,n){var r=n(1291),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},5854(t,e,n){var r=n(2777),o=TypeError;t.exports=function(t){var e=r(t,"number");if("number"==typeof e)throw new o("Can't convert number to bigint");return BigInt(e)}},5397(t,e,n){var r=n(7055),o=n(7750);t.exports=function(t){return r(o(t))}},1291(t,e,n){var r=n(741);t.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}},8014(t,e,n){var r=n(1291),o=Math.min;t.exports=function(t){var e=r(t);return e>0?o(e,9007199254740991):0}},8981(t,e,n){var r=n(7750),o=Object;t.exports=function(t){return o(r(t))}},8229(t,e,n){var r=n(9590),o=RangeError;t.exports=function(t,e){var n=r(t);if(n%e)throw new o("Wrong offset");return n}},9590(t,e,n){var r=n(1291),o=RangeError;t.exports=function(t){var e=r(t);if(e<0)throw new o("The argument can't be less than 0");return e}},2777(t,e,n){var r=n(9565),o=n(34),i=n(757),s=n(5966),a=n(4270),l=n(8227),c=TypeError,d=l("toPrimitive");t.exports=function(t,e){if(!o(t)||i(t))return t;var n,l=s(t,d);if(l){if(void 0===e&&(e="default"),n=r(l,t,e),!o(n)||i(n))return n;throw new c("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},6969(t,e,n){var r=n(2777),o=n(757);t.exports=function(t){var e=r(t,"string");return o(e)?e:e+""}},2140(t,e,n){var r={};r[n(8227)("toStringTag")]="z",t.exports="[object z]"===String(r)},655(t,e,n){var r=n(6955),o=String;t.exports=function(t){if("Symbol"===r(t))throw new TypeError("Cannot convert a Symbol value to a string");return o(t)}},6823(t){var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},3392(t,e,n){var r=n(9504),o=0,i=Math.random(),s=r(1.1.toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++o+i,36)}},7040(t,e,n){var r=n(4495);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},8686(t,e,n){var r=n(3724),o=n(9039);t.exports=r&&o(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},8622(t,e,n){var r=n(4576),o=n(4901),i=r.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},8227(t,e,n){var r=n(4576),o=n(5745),i=n(9297),s=n(3392),a=n(4495),l=n(7040),c=r.Symbol,d=o("wks"),u=l?c.for||c:c&&c.withoutSetter||s;t.exports=function(t){return i(d,t)||(d[t]=a&&i(c,t)?c[t]:u("Symbol."+t)),d[t]}}
1,8107(t,e,n){var r=n(6518),o=n(8981),i=n(6198),s=n(1291),a=n(6469);r({target:"Array",proto:!0},{at:function(t){var e=o(this),n=i(e),r=s(t),a=r>=0?r:n+r;return a<0||a>=n?void 0:e[a]}}),a("at")},3451(t,e,n){var r=n(6518),o=n(3839).K,i=n(6469);r({target:"Array",proto:!0},{findLastIndex:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),i("findLastIndex")},838(t,e,n){var r=n(6518),o=n(3839).U,i=n(6469);r({target:"Array",proto:!0},{findLast:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),i("findLast")},8350(t,e,n){var r=n(6518),o=n(259),i=n(9306),s=n(8981),a=n(6198),l=n(1469);r({target:"Array",proto:!0},{flatMap:function(t){var e,n=s(this),r=a(n);return i(t),e=l(n,0),o(e,n,n,r,0,1,t,arguments.length>1?arguments[1]:void 0),e}})},6449(t,e,n){var r=n(6518),o=n(259),i=n(8981),s=n(6198),a=n(1291),l=n(1469);r({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=i(this),n=s(e),r=void 0===t?1:a(t),c=l(e,0);return o(c,e,e,n,0,r),c}})},237(t,e,n){n(6469)("flatMap")},3514(t,e,n){n(6469)("flat")},8347(t,e,n){n(6518)({target:"Object",stat:!0},{hasOwn:n(9297)})},7495(t,e,n){var r=n(6518),o=n(7323);r({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},7357(t,e,n){var r=n(6518),o=n(9504),i=n(7750),s=n(1291),a=n(655),l=n(9039),c=o("".charAt);r({target:"String",proto:!0,forced:l(function(){return"\ud842"!=="ð ®·".at(-2)})},{at:function(t){var e=a(i(this)),n=e.length,r=s(t),o=r>=0?r:n+r;return o<0||o>=n?void 0:c(e,o)}})},9978(t,e,n){var r=n(6518),o=n(9565),i=n(9504),s=n(7750),a=n(4901),l=n(34),c=n(788),d=n(655),u=n(5966),h=n(1034),p=n(2478),f=n(8227),g=n(6395),m=f("replace"),A=TypeError,y=i("".indexOf),b=i("".replace),v=i("".slice),w=Math.max;r({target:"String",proto:!0},{replaceAll:function(t,e){var n,r,i,f,k,C,x,S,E,M,T=s(this),_=0,D="";if(l(t)){if((n=c(t))&&(r=d(s(h(t))),!~y(r,"g")))throw new A("`.replaceAll` does not allow non-global regexes");if(i=u(t,m))return o(i,t,T,e);if(g&&n)return b(d(T),t,e)}for(f=d(T),k=d(t),(C=a(e))||(e=d(e)),x=k.length,S=w(1,x),E=y(f,k);-1!==E;)M=C?d(e(k,E,f)):p(k,f,E,[],void 0,e),D+=v(f,_,E)+M,_=E+x,E=E+S>f.length?-1:y(f,k,E+S);return _<f.length&&(D+=v(f,_)),D}})},5440(t,e,n){var r=n(8745),o=n(9565),i=n(9504),s=n(9228),a=n(9039),l=n(8551),c=n(4901),d=n(34),u=n(1291),h=n(8014),p=n(655),f=n(7750),g=n(7829),m=n(5966),A=n(2478),y=n(1034),b=n(6682),v=n(8227)("replace"),w=Math.max,k=Math.min,C=i([].concat),x=i([].push),S=i("".indexOf),E=i("".slice),M=function(t){return void 0===t?t:String(t)},T="$0"==="a".replace(/./,"$0"),_=!!/./[v]&&""===/./[v]("a","$0");s("replace",function(t,e,n){var i=_?"$":"$0";return[function(t,n){var r=f(this),i=d(t)?m(t,v):void 0;return i?o(i,t,r,n):o(e,p(r),t,n)},function(t,o){var s=l(this),a=p(t),d=c(o);d||(o=p(o));var f=p(y(s));if("string"==typeof o&&!~S(o,i)&&!~S(o,"$<")&&!~S(f,"y")){var m=n(e,s,a,o);if(m.done)return m.value}var v,T=!!~S(f,"g");T&&(v=!!~S(f,"u")||!!~S(f,"v"),s.lastIndex=0);for(var _,D=[];null!==(_=b(s,a))&&(x(D,_),T);)""===p(_[0])&&(s.lastIndex=g(a,h(s.lastIndex),v));for(var O="",I=0,N=0;N<D.length;N++){for(var L,B=p((_=D[N])[0]),$=w(k(u(_.index),a.length),0),R=[],P=1;P<_.length;P++)x(R,M(_[P]));var F=_.groups;if(d){var z=C([B],R,$,a);void 0!==F&&x(z,F),L=p(r(o,void 0,z))}else L=A(B,a,$,R,F,o);$>=I&&(O+=E(a,I,$)+L,I=$+B.length)}return O+E(a,I)}]},!!a(function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})||!T||_)},7978(t,e,n){n(3451)},5115(t,e,n){n(838)},4496(t,e,n){var r=n(9497);t.exports=r},7506(t,e,n){t.exports=n(1949)},4899(t,e,n){t.exports=n(3836)},6501(t,e,n){var r=n(4552);t.exports=r},6258(t,e,n){var r=n(2323);t.exports=r},4170(t,e,n){var r=n(9951);t.exports=r},1436(t,e,n){var r=n(4295);t.exports=r},1015(t,e,n){var r=n(5818);t.exports=r}};const e={};function n(r){const o=e[r];if(void 0!==o)return o.exports;const i=e[r]={id:r,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.n=t=>{const e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.cw=t=>{var e;return()=>{if(t){var n=t;t=0,e={exports:{}},n.call(e.exports,e,e.exports)}return e.exports}},n.d=(t,e)=>{if(Array.isArray(e))for(var r=0;r<e.length;){var o=e[r++],i=e[r++],s=0===i?{enumerable:!0,value:e[r++]}:{enumerable:!0,get:i};n.o(t,o)||Object.defineProperty(t,o,s)}else for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}
1),Object.defineProperty(t,"__esModule",{value:!0})},n.dn=t=>{var e=Object.getOwnPropertyDescriptor(t,"name");(!e||!e.writable&&e.configurable)&&Object.defineProperty(t,"name",{value:"default",configurable:!0})},(()=>{let t;globalThis.importScripts&&(t=globalThis.location+"");const e=globalThis.document;if(!t&&e&&("SCRIPT"===e.currentScript?.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){const n=e.getElementsByTagName("script");if(n.length){let e=n.length-1;for(;e>-1&&(!t||!/^https?:/.test(t));)t=n[e--].src}}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),n.p=t+"../"})(),n.b="undefined"!=typeof document&&document.baseURI||self.location.href,n.nc=void 0,n(1478),n(5947),n(5339),n(4909),n(4212),n(8217),n(4881),n(7086);let r=n(9320);tiptap=r})();
2//# sourceMappingURL=tiptap.bundle.js.map?t=a10cff039

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.