1/*! For license information please see 5959.2e60e9c5e3ae0e6fc428.js.LICENSE.txt */ 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"5ca8a1b1efcc5b3a726c344b106a830e13abf521"},e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(null!=n)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:ifixitFirstParty":!0});var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="007f2e3a-6a2b-442b-86d3-99f90ba573f0",e._sentryDebugIdIdentifier="sentry-dbid-007f2e3a-6a2b-442b-86d3-99f90ba573f0")}catch(e){}}(),(globalThis.webpackChunkcarpenter_frontend=globalThis.webpackChunkcarpenter_frontend||[]).push([[5959],{3554(e,t,n){"use strict";n.d(t,{$t:()=>S,LN:()=>s,U3:()=>h,hs:()=>E,i5:()=>f,k_:()=>O,nh:()=>u,yn:()=>l});var r=n(6113),i=n(83279);const o=Object.create(null);class s{get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=r.Ji.empty){let n=t.content.lastChild,i=null;for(let e=0;e<t.openEnd;e++)i=n,n=n.lastChild;let o=e.steps.length,s=this.ranges;for(let l=0;l<s.length;l++){let{$from:a,$to:c}=s[l],h=e.mapping.slice(o);e.replaceRange(h.map(a.pos),h.map(c.pos),l?r.Ji.empty:t),0==l&&y(e,o,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],l=e.mapping.slice(n),a=l.map(o.pos),c=l.map(s.pos);i?e.deleteRange(a,c):(e.replaceRangeWith(a,c,t),y(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new h(e):g(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?g(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):g(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}
2static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new f(e.node(0))}static atStart(e){return g(e,e,0,0,1)||new f(e)}static atEnd(e){return g(e,e,e.content.size,e.childCount,-1)||new f(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=o[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in o)throw new RangeError("Duplicate use of selection JSON ID "+e);return o[e]=t,t.prototype.jsonID=e,t}getBookmark(){return h.between(this.$anchor,this.$head).getBookmark()}constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new l(e.min(t),e.max(t))]}}s.prototype.visible=!0;class l{constructor(e,t){this.$from=e,this.$to=t}}let a=!1;function c(e){a||e.parent.inlineContent||(a=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class h extends s{get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return s.near(n);let r=e.resolve(t.map(this.anchor));return new h(r.parent.inlineContent?r:n,n)}replace(e,t=r.Ji.empty){if(super.replace(e,t),t==r.Ji.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof h&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new d(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new h(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=s.findFrom(t,n,!0)||s.findFrom(t,-n,!0);if(!e)return s.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(s.findFrom(e,-n,!0)||s.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new h(e,t)}constructor(e,t=e){c(e),c(t),super(e,t)}}s.jsonID("text",h);class d{map(e){return new d(e.map(this.anchor),e.map(this.head))}resolve(e){return h.between(e.resolve(this.anchor),e.resolve(this.head))}constructor(e,t){this.anchor=e,this.head=t}}class u extends s{map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?s.near(i):new u(i)}content(){return new r.Ji(r.FK.from(this.node),0,0)}eq(e){return e instanceof u&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new p(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new u(e.resolve(t.anchor))}static create(e,t){return new u(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}}u.prototype.visible=!1,s.jsonID("node",u);class p{map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new d(n,n):new p(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&u.isSelectable(n)?new u(t):s.near(t)}constructor(e){this.anchor=e}}class f extends s{replace(e,t=r.Ji.empty){if(t==r.Ji.empty){e.delete(0,e.doc.content.size);let t=s.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new f(e)}map(e){return new f(e)}eq(e){return e instanceof f}getBookmark(){return m}constructor(e){super(e.resolve(0),e.resolve(e.content.size))}}s.jsonID("all",f);const m={map(){return this},resolve:e=>new f(e)};function g(e,t,n,r,i,o=!1){if(t.inlineContent)return h.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&u.isSelectable(r))return u.create(e,n-(i<0?r.nodeSize:0))}else{let t=g(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function y(e,t,n){let r=e.steps.length-1;if(r<t)return;let o,l=e.steps[r];(l instanceof i.Ln||l instanceof i.Wg)&&(e.mapping.maps[r].forEach(((e,t,n,r)=>{null==o&&(o=r)})),e.setSelection(s.near(e.doc.resolve(o),n)))}class w extends i.dL{get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return r.CU.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.CU.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(s.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}}function b(e,t){return t&&e?e.bind(t):e}
2class v{constructor(e,t,n){this.name=e,this.init=b(t.init,n),this.apply=b(t.apply,n)}}const k=[new v("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new v("selection",{init:(e,t)=>e.selection||s.atStart(t.doc),apply:e=>e.selection}),new v("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new v("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class x{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=k.slice(),t&&t.forEach((e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new v(e.key,e.spec.state,e))}))}}class S{get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let l=r?r[o].n:0,a=r?r[o].state:this,c=l<t.length&&s.spec.appendTransaction.call(s,l?t.slice(l):t,a,n);if(c&&n.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<o?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),i=!0}r&&(r[o]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new S(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new w(this)}static create(e){let t=new x(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new S(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new x(this.schema,e.plugins),n=t.fields,r=new S(t);for(let t=0;t<n.length;t++){let i=n[t].name;r[i]=this.hasOwnProperty(i)?this[i]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((e=>e.toJSON()))),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new x(e.schema,e.plugins),o=new S(i);return i.fields.forEach((i=>{if("doc"==i.name)o.doc=r.bP.fromJSON(e.schema,t.doc);else if("selection"==i.name)o.selection=s.fromJSON(o.doc,t.selection);else if("storedMarks"==i.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let r in n){let s=n[r],l=s.spec.state;if(s.key==i.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(t,r))return void(o[i.name]=l.fromJSON.call(s,e,t[r],o))}o[i.name]=i.init(e,o)}})),o}constructor(e){this.config=e}}function C(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):"handleDOMEvents"==r&&(i=C(i,t,{})),n[r]=i}return n}class O{getState(e){return e[this.key]}constructor(e){this.spec=e,this.props={},e.props&&C(e.props,this,this.props),this.key=e.key?e.key.key:M("plugin")}}const N=Object.create(null);function M(e){return e in N?e+"$"+ ++N[e]:(N[e]=0,e+"$")}class E{get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}constructor(e="key"){this.key=M(e)}}},3643(e,t,n){"use strict";var r=n(97145),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=r.useState,s=r.useEffect,l=r.useLayoutEffect,a=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(e){return!0}}var h="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=o({inst:{value:n,getSnapshot:t}}),i=r[0].inst,h=r[1];return l((function(){i.value=n,i.getSnapshot=t,c(i)&&h({inst:i})}),[e,n,t]),s((function(){return c(i)&&h({inst:i}),e((function(){c(i)&&h({inst:i})}))}),[e]),a(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:h},6113(e,t,n){"use strict";function r(e){this.content=e}n.d(t,{S4:()=>ee,ZF:()=>he,FK:()=>c,CU:()=>p,sX:()=>X,bP:()=>R,u$:()=>D,vI:()=>f,Sj:()=>Z,Ji:()=>m}),r.prototype={constructor:r,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var i=n&&n!=e?this.remove(n):this,o=i.find(e),s=i.content.slice();return-1==o?s.push(n||e,t):(s[o+1]=t,n&&(s[o]=n)),new r(s)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new r(n)},addToStart:function(e,t){return new r([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new r(n)},addBefore:function(e,t,n){var i=this.remove(t),o=i.content.slice(),s=i.find(e);return o.splice(-1==s?o.length:s,0,t,n),new r(o)}
2,forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=r.from(e)).size?new r(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=r.from(e)).size?new r(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=r.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach((function(t,n){e[t]=n})),e},get size(){return this.content.length>>1}},r.from=function(e){if(e instanceof r)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new r(t)};const i=r;function o(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),s=t.child(r);if(i!=s){if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){let e=i.text,t=s.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&a(e.charCodeAt(r-1))&&l(e.charCodeAt(r))&&n--,n}if(i.content.size||s.content.size){let e=o(i.content,s.content,n+1);if(null!=e)return e}n+=i.nodeSize}else n+=i.nodeSize}}function s(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};let c=e.child(--i),h=t.child(--o),d=c.nodeSize;if(c!=h){if(!c.sameMarkup(h))return{a:n,b:r};if(c.isText&&c.text!=h.text){let e=c.text,t=h.text,i=e.length,o=t.length;for(;i>0&&o>0&&e[i-1]==t[o-1];)i--,o--,n--,r--;return i&&o&&i<e.length&&a(e.charCodeAt(i-1))&&l(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(c.content.size||h.content.size){let e=s(c.content,h.content,n-1,r-1);if(e)return e}n-=d,r-=d}else n-=d,r-=d}}function l(e){return e>=56320&&e<57344}function a(e){return e>=55296&&e<56320}class c{nodesBetween(e,t,n,r=0,i){for(let o=0,s=0;s<t;o++){let l=this.content[o],a=s+l.nodeSize;if(a>e&&!1!==n(l,r+s,i||null,o)&&l.content.size){let i=s+1;l.nodesBetween(Math.max(0,e-i),Math.min(l.content.size,t-i),n,r+i)}s=a}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,((s,l)=>{let a=s.isText?s.text.slice(Math.max(e,l)-l,t-l):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&a||s.isTextblock)&&n&&(o?o=!1:i+=n),i+=a}),0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new c(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,o=0;o<t;i++){let s=this.content[i],l=o+s.nodeSize;l>e&&((o<e||l>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),r+=s.nodeSize),o=l}return new c(n,r)}cutByIndex(e,t){return e==t?c.empty:0==e&&t==this.content.length?this:new c(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new c(r,i)}addToStart(e){return new c([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new c(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return o(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return s(this,e,t,n)}findIndex(e){if(0==e)return d(0,e);if(e==this.size)return d(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=n+this.child(t).nodeSize;if(r>=e)return r==e?d(t+1,r):d(t,n);n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((e=>e.toJSON())):null}static fromJSON(e,t){if(!t)return c.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return c.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return c.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new c(t||e,n)}static from(e){if(!e)return c.empty;if(e instanceof c)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new c([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}}c.empty=new c([],0);const h={index:0,offset:0};function d(e,t){return h.index=e,h.offset=t,h}function u(e,t){if(e===t)return!0;
2if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!u(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!u(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class p{addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&u(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return p.none;if(e instanceof p)return[e];let t=e.slice();return t.sort(((e,t)=>e.type.rank-t.type.rank)),t}constructor(e,t){this.type=e,this.attrs=t}}p.none=[];class f extends Error{}class m{get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=y(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return n&&new m(n,this.openStart,this.openEnd)}removeBetween(e,t){return new m(g(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return m.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new m(c.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new m(e,n,r)}constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}}function g(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:l}=e.findIndex(n);if(i==t||o.isText){if(l!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(g(o.content,t-i-1,n-i-1)))}function y(e,t,n,r,i,o){let{index:s,offset:l}=e.findIndex(t),a=e.maybeChild(s);if(l==t||a.isText)return o&&r<=0&&i<=0&&!o.canReplace(s,s,n)?null:e.cut(0,t).append(n).append(e.cut(t));let c=y(a.content,t-l-1,n,0==s?r-1:0,s==e.childCount-1?i-1:0,a);return c&&e.replaceChild(s,a.copy(c))}function w(e,t,n){if(n.openStart>e.depth)throw new f("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new f("Inconsistent open depths");return b(e,t,n,0)}function b(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let s=b(e,t,n,r+1);return o.copy(o.content.replaceChild(i,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:i,end:s}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(c.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return C(o,O(e,i,s,t,r))}{let r=e.parent,i=r.content;
2return C(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}}return C(o,N(e,t,r))}function v(e,t){if(!t.type.compatibleContent(e.type))throw new f("Cannot join "+t.type.name+" onto "+e.type.name)}function k(e,t,n){let r=e.node(n);return v(r,t.node(n)),r}function x(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function S(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(x(e.nodeAfter,r),o++));for(let e=o;e<s;e++)x(i.child(e),r);t&&t.depth==n&&t.textOffset&&x(t.nodeBefore,r)}function C(e,t){if(!e.type.validContent(t))throw new f("Invalid content for node "+e.type.name);return e.copy(t)}function O(e,t,n,r,i){let o=e.depth>i&&k(e,t,i+1),s=r.depth>i&&k(n,r,i+1),l=[];return S(null,e,i,l),o&&s&&t.index(i)==n.index(i)?(v(o,s),x(C(o,O(e,t,n,r,i+1)),l)):(o&&x(C(o,N(e,t,i+1)),l),S(t,n,i,l),s&&x(C(s,N(n,r,i+1)),l)),S(r,null,i,l),new c(l)}function N(e,t,n){let r=[];return S(null,e,n,r),e.depth>n&&x(C(k(e,t,n+1),N(e,t,n+1)),r),S(t,null,n,r),new c(r)}m.empty=new m(c.empty,0,0);class M{resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return p.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new D(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let t=e;;){let{index:e,offset:o}=t.content.findIndex(i),s=i-o;if(n.push(t,e,r+o),!s)break;if(t=t.child(e),t.isText)break;i=s-1,r+=o+1}return new M(t,n,i)}static resolveCached(e,t){let n=A.get(e);if(n)for(let e=0;e<n.elts.length;e++){let r=n.elts[e];if(r.pos==t)return r}else A.set(e,n=new E);let r=n.elts[n.i]=M.resolve(e,t);return n.i=(n.i+1)%T,r}constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}}class E{constructor(){this.elts=[],this.i=0}}const T=12,A=new WeakMap;class D{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)}constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}}const I=Object.create(null);class R{get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}
2textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&u(this.attrs,t||e.defaultAttrs||I)&&p.sameSet(this.marks,n||p.none)}copy(e=null){return e==this.content?this:new R(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new R(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return m.empty;let r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o),l=r.node(o).content.cut(r.pos-s,i.pos-s);return new m(l,r.depth-o,i.depth-o)}replace(e,t,n){return w(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return M.resolveCached(this,e)}resolveNoCache(e){return M.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,(e=>(n.isInSet(e.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 e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),P(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=c.empty,r=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=p.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!p.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((e=>e.type.name))}`);this.content.forEach((e=>e.check()))}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((e=>e.toJSON()))),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=c.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}constructor(e,t,n,r=p.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||c.empty}}R.prototype.text=void 0;class z extends R{toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):P(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new z(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new z(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}}function P(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class L{static parse(e,t){let n=new $(e,t);if(null==n.next)return L.empty;let r=F(n);n.next&&n.err("Unexpected trailing text");let i=function(e){let t=Object.create(null);return function n(r){let i=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);
2q(e,n).forEach((e=>{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let o=t[r.join(",")]=new L(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(J);o.next.push({type:i[e][0],next:t[r.join(",")]||n(r)})}return o}(q(e,0))}(function(e){let t=[[]];return i(function e(t,o){if("choice"==t.type)return t.exprs.reduce(((t,n)=>t.concat(e(n,o))),[]);if("seq"!=t.type){if("star"==t.type){let s=n();return r(o,s),i(e(t.expr,s),s),[r(s)]}if("plus"==t.type){let s=n();return i(e(t.expr,o),s),i(e(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(o)].concat(e(t.expr,o));if("range"==t.type){let s=o;for(let r=0;r<t.min;r++){let r=n();i(e(t.expr,s),r),s=r}if(-1==t.max)i(e(t.expr,s),s);else for(let o=t.min;o<t.max;o++){let o=n();r(s,o),i(e(t.expr,s),o),s=o}return[r(s)]}if("name"==t.type)return[r(o,void 0,t.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=e(t.exprs[r],o);if(r==t.exprs.length-1)return s;i(s,o=n())}}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach((e=>e.to=t))}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];o.push(n.name),!i||n.isText||n.hasRequiredAttrs()||(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,n),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function i(o,s){let l=o.matchFragment(e,n);if(l&&(!t||l.validEnd))return c.from(s.map((e=>e.createAndFill())));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=i(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:o,next:s}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map(((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r})).join("\n")}constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}}L.empty=new L(!0);class ${get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}}function F(e){let t=[];do{t.push(j(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function j(e){let t=[];do{t.push(B(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function B(e){let t=function(e){if(e.eat("(")){let t=F(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return 0==i.length&&e.err("No node type or group '"+t+"' found"),i}(e,e.next).map((t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t})));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=_(e,t)}return t}function V(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function _(e,t){let n=V(e),r=n;return e.eat(",")&&(r="}"!=e.next?V(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function J(e,t){return t-e}function q(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:o}=i[e];r||-1!=n.indexOf(o)||t(o)}}(t),n.sort(J)}function K(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function U(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=t.default}n[r]=i}return n}function W(e,t,n,r){for(let i in t)if(!(i in e))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}function H(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Y(e,r,t[r]);return n}class G{get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==L.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:U(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new R(this,this.computeAttrs(e),c.from(t),p.setFrom(n))}createChecked(e=null,t,n){return t=c.from(t),this.checkContent(t),new R(this,this.computeAttrs(e),t,p.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=c.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(c.empty,!0);return i?new R(this,e,t.append(i),p.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);
2if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){W(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:p.none:e}static compile(e,t){let n=Object.create(null);e.forEach(((e,r)=>n[e]=new G(e,t,r)));let r=t.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=H(e,n.attrs),this.defaultAttrs=K(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}}class Y{get isRequired(){return!this.hasDefault}constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let r=n.split("|");return n=>{let i=null===n?"null":typeof n;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}(e,t,n.validate):n.validate}}class X{create(e=null){return!e&&this.instance?this.instance:new p(this,U(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,i)=>n[e]=new X(e,r++,t,i))),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){W(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=H(e,r.attrs),this.excluded=null;let i=K(this.attrs);this.instance=i?new p(this,i):null}}class Z{node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof G))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new z(n,n.defaultAttrs,e,p.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=i.from(e.nodes),t.marks=i.from(e.marks||{}),this.nodes=G.compile(this.spec.nodes,this),this.marks=X.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw new RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],r=t.spec.content||"",i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=L.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t}t.markSet="_"==i?null:i?Q(this,i.split(" ")):""!=i&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:Q(this,n.split(" "))}this.nodeFromJSON=e=>R.fromJSON(this,e),this.markFromJSON=e=>p.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}}function Q(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class ee{parse(e,t={}){let n=new se(this,t,!1);return n.addAll(e,p.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new se(this,t,!0);return n.addAll(e,p.none,t.from,t.to),m.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(le(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs
2){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(!(0!=o.indexOf(e)||r.context&&!n.matchesContext(r.context)||o.length>e.length&&(61!=o.charCodeAt(e.length)||o.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach((e=>{n(e=ae(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)}))}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach((e=>{n(e=ae(e)),e.node||e.ignore||e.mark||(e.node=t)}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new ee(e,ee.schemaRules(e)))}constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach((e=>{if(function(e){return null!=e.tag}(e))this.tags.push(e);else if(function(e){return null!=e.style}(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}})),this.normalizeLists=!this.tags.some((t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}}const te={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},ne={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},re={ol:!0,ul:!0};function ie(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class oe{findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(c.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=c.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(c.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!te.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}constructor(e,t,n,r,i,o){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=o,this.content=[],this.activeMarks=p.none,this.match=i||(4&o?null:e.contentMatch)}}class se{get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:o}=this.parser;if("full"===i||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(i)if("full"===i)n=n.replace(/\r\n?/g,"\n");else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(o.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(o.text(e[n]),t,!/\S/.test(e[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 t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&"BR"==i.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(o.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o,s=e.nodeName.toLowerCase();re.hasOwnProperty(s)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&re.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));e:if(l?l.ignore:ne.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,t);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let n,r=this.needsBlock;if(te.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let o=l&&l.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,l,n,!1===l.consuming?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter((e=>!n.clearMark(e))):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1!==n.consuming)break;e=n}}return t}addElementByRule(e,t,n,r){let i,o;
2if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(o,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((e=>this.insertNode(e,n,!1)));else{let r=e;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(s)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=null==r?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,o=0;t>=0;t--){let s=this.nodes[t],l=s.findWrapping(e);if(l&&(!r||r.length>l.length+o)&&(r=l,i=s,!l.length))break;if(s.solid){if(n)break;o+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let n=p.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):ce(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&(i=this.enterInner(e,t,n,!0,r)),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let s=ie(e,i,o.options);4&o.options&&0==o.content.length&&(s|=4);let l=p.none;return n=n.filter((t=>!(o.type?o.type.allowsMarkType(t.type):ce(t.type,e))||(l=t.addToSet(l),!1))),this.nodes.push(new oe(e,t,l,r,null,s)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!(!this.isOpen&&!this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=1)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(e,s)=>{for(;e>=0;e--){let l=t[e];if(""==l){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=l&&!e.isInGroup(l))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];
2if(t.isTextblock&&t.defaultAttrs)return t}}constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r,i=t.topNode,o=ie(null,t.preserveWhitespace,0)|(n?4:0);r=i?new oe(i.type,i.attrs,p.none,!0,t.topMatch||i.type.contentMatch,o):new oe(n?null:e.schema.topNodeType,null,p.none,!0,null,o),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}}function le(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ae(e){let t={};for(let n in e)t[n]=e[n];return t}function ce(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t)return!0;if(o.indexOf(i)<0&&s(i))return!0}};if(s(i.contentMatch))return!0}}class he{serializeFragment(e,t={},n){n||(n=ue(t).createDocumentFragment());let r=n,i=[];return e.forEach((e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n<i.length&&o<e.marks.length;){let t=e.marks[o];if(this.marks[t.type.name]){if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,o++}else o++}for(;n<i.length;)r=i.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],s=this.serializeMark(n,e.isInline,t);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))})),n}serializeNodeInner(e,t){if(e.isText)return ue(t).createTextNode(e.text);let{dom:n,contentDOM:r}=fe(ue(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&fe(ue(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return"string"==typeof t?{dom:e.createTextNode(t)}:fe(e,t,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new he(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=de(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return de(e.marks)}constructor(e,t){this.nodes=e,this.marks=t}}function de(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function ue(e){return e.document||window.document}const pe=new WeakMap;function fe(e,t,n,r){if(1==t.nodeType)return{dom:t};if(t.dom&&1==t.dom.nodeType)return t;let i,o=t[0];if("string"!=typeof o)throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=function(e){let t=pe.get(e);return void 0===t&&pe.set(e,t=function(e){let t=null;return function e(n){if(n&&"object"==typeof n)if(Array.isArray(n))if("string"==typeof n[0])t||(t=[]),t.push(n);else for(let t=0;t<n.length;t++)e(n[t]);else for(let t in n)e(n[t])}(e),t}(e)),t}(r))&&i.indexOf(t)>-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,l=o.indexOf(" ");l>0&&(n=o.slice(0,l),o=o.slice(l+1));let a=n?e.createElementNS(n,o):e.createElement(o),c=t[1],h=1;if(c&&"object"==typeof c&&null==c.nodeType&&!Array.isArray(c)){h=2;for(let e in c)if(null!=c[e]){let t=e.indexOf(" ");t>0?a.setAttributeNS(e.slice(0,t),e.slice(t+1),c[e]):"style"==e&&a.style?a.style.cssText=c[e]:a.setAttribute(e,c[e])}}for(let i=h;i<t.length;i++){let o=t[i];if(0===o){if(i<t.length-1||i>h)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}if("string"==typeof o)a.appendChild(e.createTextNode(o));else{let{dom:t,contentDOM:i}=fe(e,o,n,r);if(a.appendChild(t),i){if(s)throw new RangeError("Multiple content holes");s=i}}}return{dom:a,contentDOM:s}}},6208(e,t,n){"use strict";var r=n(97145),i=n(75118),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=i.useSyncExternalStore,l=r.useRef,a=r.useEffect,c=r.useMemo,h=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=l(null);if(null===d.current){var u={hasValue:!1,value:null};d.current=u}else u=d.current;d=c((function(){function e(e){if(!a){if(a=!0,s=e,e=r(e),void 0!==i&&u.hasValue){var t=u.value;if(i(t,e))return l=t}return l=e}if(t=l,o(s,e))return t;var n=r(e);return void 0!==i&&i(t,n)?(s=e,t):(s=e,l=n)}var s,l,a=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,r,i]);var p=s(e,d[0],d[1]);return a((function(){u.hasValue=!0,u.value=p}),[p]),h(p),p}},11139(e,t,n){"use strict";n.d(t,{Lz:()=>un,NZ:()=>Bt,zF:()=>Jt});var r=n(3554),i=n(6113),o=n(83279);const s=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},l=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let a=null;const c=function(e,t,n){let r=a||(a=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},h=function(e,t,n,r){return n&&(u(e,t,n,r,-1)||u(e,t,n,r,1))},d=/^(img|br|input|textarea|hr)$/i;function u(e,t,n,r,i){for(var o;;){if(e==n&&t==r)return!0;
2if(t==(i<0?0:p(e))){let n=e.parentNode;if(!n||1!=n.nodeType||f(e)||d.test(e.nodeName)||"false"==e.contentEditable)return!1;t=s(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;{let n=e.childNodes[t+(i<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable){if(!(null===(o=n.pmViewDesc)||void 0===o?void 0:o.ignoreForSelection))return!1;t+=i}else e=n,t=i<0?p(e):0}}}}function p(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function f(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const m=function(e){return e.focusNode&&h(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function g(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const y="undefined"!=typeof navigator?navigator:null,w="undefined"!=typeof document?document:null,b=y&&y.userAgent||"",v=/Edge\/(\d+)/.exec(b),k=/MSIE \d/.exec(b),x=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(b),S=!!(k||x||v),C=k?document.documentMode:x?+x[1]:v?+v[1]:0,O=!S&&/gecko\/(\d+)/i.test(b);O&&(/Firefox\/(\d+)/.exec(b)||[0,0])[1];const N=!S&&/Chrome\/(\d+)/.exec(b),M=!!N,E=N?+N[1]:0,T=!S&&!!y&&/Apple Computer/.test(y.vendor),A=T&&(/Mobile\/\w+/.test(b)||!!y&&y.maxTouchPoints>2),D=A||!!y&&/Mac/.test(y.platform),I=!!y&&/Win/.test(y.platform),R=/Android \d/.test(b),z=!!w&&"webkitFontSmoothing"in w.documentElement.style,P=z?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function L(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function $(e,t){return"number"==typeof e?e:e[t]}function F(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function j(e,t,n){if(!W(t)&&0==t.left)return;let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(1!=s.nodeType){s=l(s);continue}let e=s,n=e==o.body,a=n?L(o):F(e),c=0,h=0;if(t.top<a.top+$(r,"top")?h=-(a.top-t.top+$(i,"top")):t.bottom>a.bottom-$(r,"bottom")&&(h=t.bottom-t.top>a.bottom-a.top?t.top+$(i,"top")-a.top:t.bottom-a.bottom+$(i,"bottom")),t.left<a.left+$(r,"left")?c=-(a.left-t.left+$(i,"left")):t.right>a.right-$(r,"right")&&(c=t.right-a.right+$(i,"right")),c||h)if(n)o.defaultView.scrollBy(c,h);else{let n=e.scrollLeft,r=e.scrollTop;h&&(e.scrollTop+=h),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,o=e.scrollTop-r;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}let d=n?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(d))break;s="absolute"==d?s.offsetParent:l(s)}}function B(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=l(r));return t}function V(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let _=null;function J(e,t){let n,r,i,o,s=2e8,l=0,a=t.top,h=t.top;for(let d=e.firstChild,u=0;d;d=d.nextSibling,u++){let e;if(1==d.nodeType)e=d.getClientRects();else{if(3!=d.nodeType)continue;e=c(d).getClientRects()}for(let c=0;c<e.length;c++){let p=e[c];if(p.top<=a&&p.bottom>=h){a=Math.max(p.bottom,a),h=Math.min(p.top,h);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<s){n=d,s=e,r=e&&3==n.nodeType?{left:p.right<t.left?p.right:p.left,top:t.top}:t,1==d.nodeType&&e&&(l=u+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!i&&p.left<=t.left&&p.right>=t.left&&(i=d,o={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(l=u+1)}}return!n&&i&&(n=i,r=o,s=0),n&&3==n.nodeType?function(e,t){let n,r=e.nodeValue.length,i=document.createRange();for(let o=0;o<r;o++){i.setEnd(e,o+1),i.setStart(e,o);let r=H(i,1);if(r.top!=r.bottom&&q(t,r)){n={node:e,offset:o+(t.left>=(r.left+r.right)/2?1:0)};break}}return i.detach(),n||{node:e,offset:0}}(n,r):!n||s&&1==n.nodeType?{node:e,offset:l}:J(n,r)}function q(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>
2=t.top-1&&e.top<=t.bottom+1}function K(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let n=e.childNodes[o];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(q(t,i))return K(n,t,i)}}if((o=(o+1)%r)==i)break}return e}function U(e,t){let n,r=e.dom.ownerDocument,i=0,o=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(p(r.offsetNode),r.offset)}}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(p(r.startContainer),r.startOffset)}}}(r,t.left,t.top);o&&({node:n,offset:i}=o);let s,a=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!a||!e.dom.contains(1!=a.nodeType?a.parentNode:a)){let n=e.dom.getBoundingClientRect();if(!q(t,n))return null;if(a=K(e.dom,t,n),!a)return null}if(T)for(let e=a;n&&e;e=l(e))e.draggable&&(n=void 0);if(a=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(a,t),n){if(O&&1==n.nodeType&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let e,r=n.childNodes[i];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&i++}let r;z&&i&&1==n.nodeType&&1==(r=n.childNodes[i-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=t.top&&i--,n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(s=function(e,t,n,r){let i=-1;for(let n=t,o=!1;n!=e.dom;){let t,s=e.docView.nearestDesc(n,!0);if(!s)return null;if(1==s.dom.nodeType&&(s.node.isBlock&&s.parent||!s.contentDOM)&&((t=s.dom.getBoundingClientRect()).width||t.height)&&(s.node.isBlock&&s.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(s.dom.nodeName)&&(!o&&t.left>r.left||t.top>r.top?i=s.posBefore:(!o&&t.right<r.left||t.bottom<r.top)&&(i=s.posAfter),o=!0),!s.contentDOM&&i<0&&!s.node.isText))return(s.node.isBlock?r.top<(t.top+t.bottom)/2:r.left<(t.left+t.right)/2)?s.posBefore:s.posAfter;n=s.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}(e,n,i,t))}null==s&&(s=function(e,t,n){let{node:r,offset:i}=J(t,n),o=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}(e,a,t));let c=e.docView.nearestDesc(a,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function W(e){return e.top<e.bottom||e.left<e.right}function H(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(W(e))return e}return Array.prototype.find.call(n,W)||e.getBoundingClientRect()}const G=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Y(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=z||O;if(3==r.nodeType){if(!s||!G.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,X(H(c(r,e,t),o),o<0)}{let e=H(c(r,i,i),n);if(O&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=H(c(r,i-1,i-1),-1);if(t.top==e.top){let n=H(c(r,i,i+1),-1);if(n.top!=e.top)return X(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(null==o&&i&&(n<0||i==p(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return Z(e.getBoundingClientRect(),!1)}if(null==o&&i<p(r)){let e=r.childNodes[i];if(1==e.nodeType)return Z(e.getBoundingClientRect(),!0)}return Z(r.getBoundingClientRect(),n>=0)}if(null==o&&i&&(n<0||i==p(r))){let e=r.childNodes[i-1],t=3==e.nodeType?c(e,p(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return X(H(t,1),!1)}if(null==o&&i<p(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?c(e,0,s?0:1):1==e.nodeType?e:null:null;if(t)return X(H(t,-1),!0)}return X(H(3==r.nodeType?c(r):r,-n),n>=0)}function X(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Z(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Q(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}const ee=/[\u0590-\u08ac]/;let te=null,ne=null,re=!1;class ie{matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)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(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.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(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>s(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i,o=this.getDesc(r);if(o&&(!t||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],o=t+i.size;if(o>e||i instanceof de){r=e-t;break}t=o}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof oe&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?s(e.dom)+1:0}}{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?s(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let o=n,l=0;;l++){let n=this.children[l],a=o+n.size;if(-1==r&&e<=a){let i=o+n.border;if(e>=i&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=l;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=s(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(a>t||l==this.children.length-1)){t=a;for(let e=l+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=s(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=a}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),o=Math.max(e,t);for(let s=0,l=0;s<this.children.length;s++){let a=this.children[s],c=l+a.size;if(i>l&&o<c)return a.setSelection(e-l-a.border,t-l-a.border,n,r);l=c}let l=this.domFromPos(e,e?-1:1),a=t==e?l:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),d=n.domSelectionRange(),u=!1;if((O||T)&&e==t){let{node:e,offset:t}=l;if(3==e.nodeType){if(u=!(!t||"\n"!=e.nodeValue[t-1]),u&&t==e.nodeValue.length)for(let t,n=e;n;n=n.parentNode){if(t=n.nextSibling){"BR"==t.nodeName&&(l=a={node:t.parentNode,offset:s(t)+1}
2);break}let e=n.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(O&&d.focusNode&&d.focusNode!=a.node&&1==d.focusNode.nodeType){let e=d.focusNode.childNodes[d.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||u&&T)&&h(l.node,l.offset,d.anchorNode,d.anchorOffset)&&h(a.node,a.offset,d.focusNode,d.focusOffset))return;let p=!1;if((c.extend||e==t)&&(!u||!O)){c.collapse(l.node,l.offset);try{e!=t&&c.extend(a.node,a.offset),p=!0}catch(e){}}if(!p){if(e>t){let e=l;l=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s)return this.dirty=e==n||t==o?2:1,void(e!=r||t!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-r,t-r):i.dirty=3);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}}class oe extends ie{matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.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}constructor(e,t,n,r){let i,o=t.type.toDOM;if("function"==typeof o&&(o=o(n,(()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r))),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.hasAttribute("contenteditable")||(o.contentEditable="false"),o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}}class se extends ie{get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}}class le extends ie{static create(e,t,n,r){let o=r.nodeViews[t.type.name],s=o&&o(t,r,n);return s&&s.dom||(s=i.ZF.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new le(e,t,s.dom,s.contentDOM||s.dom,s)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let r=le.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;t<o&&(i=Ce(i,t,o,n)),e>0&&(i=Ce(i,0,e,n));for(let e=0;e<i.length;e++)i[e].parent=r;return r.children=i,r}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}}class ae extends ie{static create(e,t,n,r,o,s){let l,a=o.nodeViews[t.type.name],c=a&&a(t,o,(()=>l?l.parent?l.parent.posBeforeChild(l):void 0:s),n,r),h=c&&c.dom,d=c&&c.contentDOM;if(t.isText)if(h){if(3!=h.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else h=document.createTextNode(t.text);else if(!h){let e=i.ZF.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:h,contentDOM:d}=e)}d||t.isText||"BR"==h.nodeName||(h.hasAttribute("contenteditable")||(h.contentEditable="false"),t.type.spec.draggable&&(h.draggable=!0));let u=h;return h=be(h,n,t),c?l=new ue(e,t,n,r,h,d||null,u,c):t.isText?new he(e,t,n,r,h,u):new ae(e,t,n,r,h,d||null,u)}parseRule(e){if(this.node.type.spec.reparseInView)return null;
2let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}if(!t.contentElement){let n=e&&e.find((t=>1==t.nodeType&&e.indexOf(t.parentNode)<0&&this.dom.contains(t)));n?t.contentElement=n:t.getContent=()=>i.FK.empty}}else t.contentElement=this.contentDOM;else t.getContent=()=>this.node.content;return t}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&ve(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,o=e.composing?this.localCompositionInfo(e,t):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,a=new xe(this,s&&s.node,e);!function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,i,t.forChild(o,s),n),o+=s.nodeSize}return}let s=0,l=[],a=null;for(let c=0;;){let h,d,u,p;for(;s<i.length&&i[s].to==o;){let e=i[s++];e.widget&&(h?(d||(d=[h])).push(e):h=e)}if(h)if(d){d.sort(Se);for(let e=0;e<d.length;e++)n(d[e],c,!!a)}else n(h,c,!!a);if(a)p=-1,u=a,a=null;else{if(!(c<e.childCount))break;p=c,u=e.child(c++)}for(let e=0;e<l.length;e++)l[e].to<=o&&l.splice(e--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)l.push(i[s++]);let f=o+u.nodeSize;if(u.isText){let e=f;s<i.length&&i[s].from<e&&(e=i[s].from);for(let t=0;t<l.length;t++)l[t].to<e&&(e=l[t].to);e<f&&(a=u.cut(e-o),u=u.cut(0,e-o),f=e,p=-1)}else for(;s<i.length&&i[s].to<f;)s++;r(u,u.isInline&&!u.isLeaf?l.filter((e=>!e.inline)):l.slice(),t.forChild(o,u),p),o=f}}(this.node,this.innerDeco,((t,o,s)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e,o):t.type.side>=0&&!s&&a.syncToMarks(o==this.node.childCount?i.CU.none:this.node.child(o).marks,n,e,o),a.placeWidget(t,e,r)}),((t,i,s,c)=>{let h;a.syncToMarks(t.marks,n,e,c),a.findNodeMatch(t,i,s,c)||l&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(h=a.findIndexWithChild(o.node))>-1&&a.updateNodeAt(t,i,s,h,e)||a.updateNextNode(t,i,s,e,c,r)||a.addNode(t,i,s,e,r),r+=t.nodeSize})),a.syncToMarks([],n,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(s&&this.protectLocalComposition(e,s),pe(this.contentDOM,this.children,e),A&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof r.U3)||n<t||i>t+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let e=o.nodeValue,r=function(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),l=o;if(o+=s.nodeSize,!s.isText)continue;let a=s.text;for(;i<e.childCount;){let t=e.child(i++);if(o+=t.nodeSize,!t.isText)break;a+=t.text}if(o>=n){if(o>=r&&a.slice(r-t.length-l,r-l)==t)return r-t.length;let e=l<r?a.lastIndexOf(t,r-l-1):-1;if(e>=0&&e+t.length+l>=n)return l+e;if(n==r&&a.length>=r+t.length-l&&a.slice(r-l,r-l+t.length)==t)return r}}return-1}(this.node.content,e,n-t,i-t);return r<0?null:{node:o,pos:r,text:e}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new se(this,i,t,r);e.input.compositionNodes.push(o),this.children=Ce(this.children,n,n+r.length,e,o)}update(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node)||(this.updateInner(e,t,n,r),0))}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(ve(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=ye(this.dom,this.nodeDOM,ge(this.outerDeco,this.node,t),ge(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}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}constructor(e,t,n,r,i,o,s){super(e,[],i,o),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s}}function ce(e,t,n,r,i){be(r,t,e);let o=new ae(void 0,e,t,n,r,r,r);return o.contentDOM&&o.updateChildren(i,0),o}class he extends ae{parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node)||(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,0))}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new he(this.parent,r,this.outerDeco,this.innerDeco,i,i)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}constructor(e,t,n,r,i,o){super(e,t,n,r,i,null,o)}}class de extends ie{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class ue extends ae{update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}constructor(e,t,n,r,i,o,s,l){super(e,t,n,r,i,o,s),this.spec=l}}function pe(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let s=t[o],l=s.dom;if(l.parentNode==e){for(;l!=r;)r=ke(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(l,r);if(s instanceof le){let t=r?r.previousSibling:e.lastChild;pe(s.contentDOM,s.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=ke(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const fe=function(e){e&&(this.nodeName=e)};fe.prototype=Object.create(null);const me=[new fe];function ge(e,t,n){if(0==e.length)return me;let r=n?me[0]:new fe,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&i.push(r=new fe(s.nodeName));for(let e in s){let o=s[e];null!=o&&(n&&1==i.length&&i.push(r=new fe(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+o:"style"==e?r.style=(r.style?r.style+";":"")+o:"nodeName"!=e&&(r[e]=o))}}}return i}function ye(e,t,n,r){if(n==me&&r==me)return t;let i=t;for(let t=0;t<r.length;t++){let o=r[t],s=n[t];if(t){let t;s&&s.nodeName==o.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==o.nodeName||(t=document.createElement(o.nodeName),t.pmIsDeco=!0,t.appendChild(i),s=me[0]),i=t}we(i,s||me[0],o)}return i}function we(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);
2if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function be(e,t,n){return ye(e,e,me,ge(t,n,1!=e.nodeType))}function ve(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function ke(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class xe{destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&!1!==e[i].type.spec.spanning;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let i=-1,s=this.top.children.length;r<this.preMatch.index&&(s=Math.min(this.index+3,s));for(let t=this.index;t<s;t++){let n=this.top.children[t];if(n.matchesMark(e[o])&&!this.isLocked(n.dom)){i=t;break}}if(i<0&&this.index<this.top.children.length){let t=this.top.children[this.index];t instanceof le&&3!=t.dirty&&t.mark.type==e[o].type&&t.spec.update&&!this.isLocked(t.dom)&&t.spec.update(e[o])&&(t.mark=e[o],i=this.index,this.changed=!0)}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=le.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,r){let i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))o=this.top.children.indexOf(i,this.index);else for(let r=this.index,i=Math.min(this.top.children.length,r+5);r<i;r++){let i=this.top.children[r];if(i.matchesNode(e,t,n)&&!this.preMatch.matched.has(i)){o=r;break}}return!(o<0||(this.destroyBetween(this.index,o),this.index++,0))}updateNodeAt(e,t,n,r,i){let o=this.top.children[r];return 3==o.dirty&&o.dom==o.contentDOM&&(o.dirty=2),!!o.update(e,t,n,i)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,r,i,o){for(let s=this.index;s<this.top.children.length;s++){let l=this.top.children[s];if(l instanceof ae){let a=this.preMatch.matched.get(l);if(null!=a&&a!=i)return!1;let c,h=l.dom,d=this.isLocked(h)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&3!=l.dirty&&ve(t,l.outerDeco));if(!d&&l.update(e,t,n,r))return this.destroyBetween(this.index,s),l.dom!=h&&(this.changed=!0),this.index++,!0;if(!d&&(c=this.recreateWrapper(l,e,t,n,r,o)))return this.destroyBetween(this.index,s),this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(r,o+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!ve(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let s=ae.create(this.top,t,n,r,i,o);if(s.contentDOM){s.children=e.children,e.children=[];for(let e of s.children)e.parent=s}return e.destroy(),s}addNode(e,t,n,r,i){let o=ae.create(this.top,e,t,n,r,i);o.contentDOM&&o.updateChildren(r,i+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){let r=new oe(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof le;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof he)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((T||M)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new de(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}
2isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];e:for(;i>0;){let l;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof le)){l=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=e.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}(e.node.content,e)}}function Se(e,t){return e.type.side-t.type.side}function Ce(e,t,n,r,i){let o=[];for(let s=0,l=0;s<e.length;s++){let a=e[s],c=l,h=l+=a.size;c>=n||h<=t?o.push(a):(c<t&&o.push(a.slice(0,t-c,r)),i&&(o.push(i),i=void 0),h>n&&o.push(a.slice(n-c,a.size,r)))}return o}function Oe(e,t=null){let n=e.domSelectionRange(),i=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),l=o&&0==o.size,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let c,h,d=i.resolve(a);if(m(n)){for(c=a;o&&!o.node;)o=o.parent;let e=o.node;if(o&&e.isAtom&&r.nh.isSelectable(e)&&o.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==p(e);r||i;){if(e==n)return!0;let t=s(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==p(e)}}(n.focusNode,n.focusOffset,o.dom))){let e=o.posBefore;h=new r.nh(a==e?d:i.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=a,r=a;for(let i=0;i<n.rangeCount;i++){let o=n.getRangeAt(i);t=Math.min(t,e.docView.posFromDOM(o.startContainer,o.startOffset,1)),r=Math.max(r,e.docView.posFromDOM(o.endContainer,o.endOffset,-1))}if(t<0)return null;[c,a]=r==e.state.selection.anchor?[r,t]:[t,r],d=i.resolve(a)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=i.resolve(c);return h||(h=ze(e,u,d,"pointer"==t||e.state.selection.head<d.pos&&!l?1:-1)),h}function Ne(e){return e.editable?e.hasFocus():Le(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Me(e,t=!1){let n=e.state.selection;if(Ie(e,n),!Ne(e))return;let i=e.input.mouseDown;if(!t&&M&&i){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&h(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&i.delaySelUpdate())return void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r="IMG"==n.nodeName;r?t.collapse(n.parentNode,s(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&S&&C<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{let i,o,{anchor:s,head:l}=n;!Ee||n instanceof r.U3||(n.$from.parent.inlineContent||(i=Te(e,n.from)),n.empty||n.$from.parent.inlineContent||(o=Te(e,n.to))),e.docView.setSelection(s,l,e,t),Ee&&(i&&De(i),o&&De(o)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{Ne(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}const Ee=T||M&&E<63;function Te(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(T&&i&&"false"==i.contentEditable)return Ae(i);if(!(i&&"false"!=i.contentEditable||o&&"false"!=o.contentEditable)){if(i)return Ae(i);if(o)return Ae(o)}}function Ae(e){return e.contentEditable="true",T&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function De(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Ie(e,t){if(t instanceof r.nh){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Re(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Re(e)}function Re(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function ze(e,t,n,i){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||r.U3.between(t,n,i)}function Pe(e){return!(e.editable&&!e.hasFocus())&&Le(e)}function Le(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focu
2sNode.parentNode:t.focusNode))}catch(e){return!1}}function $e(e,t){let{$anchor:n,$head:i}=e.selection,o=t>0?n.max(i):n.min(i),s=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return s&&r.LN.findFrom(s,t)}function Fe(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function je(e,t,n){let i=e.state.selection;if(!(i instanceof r.U3)){if(i instanceof r.nh&&i.node.isInline)return Fe(e,new r.U3(t>0?i.$to:i.$from));{let n=$e(e.state,t);return!!n&&Fe(e,n)}}if(n.indexOf("s")>-1){let{$head:n}=i,o=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=e.state.doc.resolve(n.pos+o.nodeSize*(t<0?-1:1));return Fe(e,new r.U3(i.$anchor,s))}if(!i.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=$e(e.state,t);return!!(n&&n instanceof r.nh)&&Fe(e,n)}if(!(D&&n.indexOf("m")>-1)){let n,o=i.$head,s=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!s||s.isText)return!1;let l=t<0?o.pos-s.nodeSize:o.pos;return!!(s.isAtom||(n=e.docView.descAt(l))&&!n.contentDOM)&&(r.nh.isSelectable(s)?Fe(e,new r.nh(t<0?e.state.doc.resolve(o.pos-s.nodeSize):o)):!!z&&Fe(e,new r.U3(e.state.doc.resolve(t<0?l:l+s.nodeSize))))}}function Be(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Ve(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function _e(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,l=!1;for(O&&1==n.nodeType&&r<Be(n)&&Ve(n.childNodes[r],-1)&&(l=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(Ve(e,-1))i=n,o=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(Je(n))break;{let t=n.previousSibling;for(;t&&Ve(t,-1);)i=n.parentNode,o=s(t),t=t.previousSibling;if(t)n=t,r=Be(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}l?qe(e,n,r):i&&qe(e,i,o)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,l=Be(n);for(;;)if(r<l){if(1!=n.nodeType)break;if(!Ve(n.childNodes[r],1))break;i=n,o=++r}else{if(Je(n))break;{let t=n.nextSibling;for(;t&&Ve(t,1);)i=t.parentNode,o=s(t)+1,t=t.nextSibling;if(t)n=t,r=0,l=Be(n);else{if(n=n.parentNode,n==e.dom)break;r=l=0}}}i&&qe(e,i,o)}(e)}function Je(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function qe(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!f(e);)t=s(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!f(e);)t=s(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(m(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout((()=>{e.state==i&&Me(e)}),50)}function Ke(e,t){let n=e.state.doc.resolve(t);if(!M&&!I&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function Ue(e,t,n){let i=e.state.selection;if(i instanceof r.U3&&!i.empty||n.indexOf("s")>-1)return!1;if(D&&n.indexOf("m")>-1)return!1;let{$from:o,$to:s}=i;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=$e(e.state,t);if(n&&n instanceof r.nh)return Fe(e,n)}if(!o.parent.inlineContent){let n=t<0?o:s,l=i instanceof r.i5?r.LN.near(n,t):r.LN.findFrom(n,t);return!!l&&Fe(e,l)}return!1}function We(e,t){if(!(e.state.selection instanceof r.U3))return!0;let{$head:n,$anchor:i,empty:o}=e.state.selection;if(!n.sameParent(i))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let s=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let r=e.state.tr;return t<0?r.delete(n.pos-s.nodeSize,n.pos):r.delete(n.pos,n.pos+s.nodeSize),e.dispatch(r),!0}return!1}function He(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Ge(e,t){e.someProp("transformCopied",(n=>{t=n(t,e)}));let n=[],{content:r,openStart:o,openEnd:s}=t;
2for(;o>1&&s>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,s--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let l=e.someProp("clipboardSerializer")||i.ZF.fromSchema(e.state.schema),a=it(),c=a.createElement("div");c.appendChild(l.serializeFragment(r,{document:a}));let h,d=c.firstChild,u=0;for(;d&&1==d.nodeType&&(h=rt[d.nodeName.toLowerCase()]);){for(let e=h.length-1;e>=0;e--){let t=a.createElement(h[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),u++}d=c.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice",`${o} ${s}${u?` -${u}`:""} ${JSON.stringify(n)}`),{dom:c,text:e.someProp("clipboardTextSerializer",(n=>n(t,e)))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function Ye(e,t,n,r,o){let s,l,a=o.parent.type.spec.code;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp("transformPastedText",(n=>{t=n(t,a||r,e)})),a)return l=new i.Ji(i.FK.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",(t=>{l=t(l,e,!0)})),l;let n=e.someProp("clipboardTextParser",(n=>n(t,o,r,e)));if(n)l=n;else{let n=o.marks(),{schema:r}=e.state,l=i.ZF.fromSchema(r);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=s.appendChild(document.createElement("p"));e&&t.appendChild(l.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(t=>{n=t(n,e)})),s=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=it(),i=r.body,o=/<([a-z][^>\s]+)/i.exec(e);if((n=o&&rt[o[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join("")),i.innerHTML=function(e){let t=window.trustedTypes;if(!t)return e;if(!ot){if(ot=t.defaultPolicy)try{return ot.createHTML(e)}catch(e){}ot=t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})}return ot.createHTML(e)}(e),n)for(let e=0;e<n.length;e++)i=i.querySelector(n[e])||i;for(let e=0;e<r.styleSheets.length;e++){let t=r.styleSheets[e];for(let e=0;e<t.rules.length;e++){let n=t.rules[e];if(n instanceof CSSStyleRule){let e=i.querySelectorAll(n.selectorText);for(let t=0;t<e.length;t++)e[t].style.cssText+=n.style.cssText}}}return i}(n),z&&function(e){let t=e.querySelectorAll(M?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&"Â "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(s);let h=s&&s.querySelector("[data-pm-slice]"),d=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let e=+d[3];e>0;e--){let e=s.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;s=e}if(!l){let t=e.someProp("clipboardParser")||e.someProp("domParser")||i.S4.fromSchema(e.state.schema);l=t.parseSlice(s,{preserveWhitespace:!(!c&&!d),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Xe.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(d)l=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:o,openStart:s,openEnd:l}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;try{t.checkAttrs(n[e+1])}catch(e){break}o=i.FK.from(t.create(n[e+1],o)),s++,l++}return new i.Ji(o,s,l)}(nt(l,+d[1],+d[2]),d[4]);else if(l=i.Ji.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,o=t.node(n).contentMatchAt(t.index(n)),s=[];if(e.forEach((e=>{if(!s)return;let t,n=o.findWrapping(e.type);if(!n)return s=null;if(t=s.length&&r.length&&Qe(n,r,e,s[s.length-1],0))s[s.length-1]=t;else{s.length&&(s[s.length-1]=et(s[s.length-1],r.length));let t=Ze(e,n);s.push(t),o=o.matchType(t.type),r=n}})),s)return i.FK.from(s)}return e}(l.content,o),!0),l.openStart||l.openEnd){let e=0,t=0;for(let t=l.content.firstChild;e<l.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=l.content.lastChild;t<l.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);l=nt(l,e,t)}return e.someProp("transformPasted",(t=>{l=t(l,e,c)})),l}const Xe=/^(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 Ze(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,i.FK.from(e));return e}function Qe(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let s=Qe(e,t,n,r.last
2Child,o+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(i.FK.from(Ze(n,e,o+1))))}}function et(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,et(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(i.FK.empty,!0);return e.copy(n.append(r))}function tt(e,t,n,r,o,s){let l=t<0?e.firstChild:e.lastChild,a=l.content;return e.childCount>1&&(s=0),o<r-1&&(a=tt(a,t,n,r,o+1,s)),o>=n&&(a=t<0?l.contentMatchAt(0).fillBefore(a,s<=o).append(a):a.append(l.contentMatchAt(l.childCount).fillBefore(i.FK.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,l.copy(a))}function nt(e,t,n){return t<e.openStart&&(e=new i.Ji(tt(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new i.Ji(tt(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const rt={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 it(){return document.implementation.createHTMLDocument("title")}let ot=null;const st={},lt={},at={touchstart:!0,touchmove:!0};class ct{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 ht(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function dt(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>ut(e,t))}))}function ut(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function pt(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function ft(e){return{left:e.clientX,top:e.clientY}}function mt(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let r=o.depth+1;r>0;r--)if(e.someProp(t,(t=>r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1))))return!0;return!1}function gt(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function yt(e,t,n,r){return mt(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function wt(e,t,n,i){return mt(e,"handleTripleClickOn",t,n,i)||e.someProp("handleTripleClick",(n=>n(e,t,i)))||function(e,t,n){if(0!=n.button)return!1;let i=bt(e,t,!0),o=e.state.doc;return!!i&&(gt(e,i,"pointer"),i instanceof r.U3&&o.eq(e.state.doc)&&(e.input.mouseDown=new Ct(e,i)),!0)}(e,n,i)}function bt(e,t,n){let i=e.state.doc;if(-1==t)return i.inlineContent?r.U3.create(i,0,i.content.size):null;let o=i.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e),s=o.before(e);if(t.inlineContent)return r.U3.create(i,s+1,s+1+t.content.size);if(n&&r.nh.isSelectable(t))return r.nh.create(i,s)}return null}function vt(e){return Tt(e)}lt.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Ot(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!R||!M||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!A||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||function(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);if(8==n||D&&72==n&&"c"==r)return We(e,-1)||_e(e,-1);if(46==n&&!t.shiftKey||D&&68==n&&"c"==r)return We(e,1)||_e(e,1);if(13==n||27==n)return!0;
2if(37==n||D&&66==n&&"c"==r){let t=37==n?"ltr"==Ke(e,e.state.selection.from)?-1:1:-1;return je(e,t,r)||_e(e,t)}if(39==n||D&&70==n&&"c"==r){let t=39==n?"ltr"==Ke(e,e.state.selection.from)?1:-1:1;return je(e,t,r)||_e(e,t)}return 38==n||D&&80==n&&"c"==r?Ue(e,-1,r)||_e(e,-1):40==n||D&&78==n&&"c"==r?function(e){if(!T||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;He(e,n,"true"),setTimeout((()=>He(e,n,"false")),20)}return!1}(e)||Ue(e,1,r)||_e(e,1):r==(D?"m":"c")&&(66==n||73==n||89==n||90==n)}(e,n)?n.preventDefault():ht(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,g(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},lt.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},lt.keypress=(e,t)=>{let n=t;if(Ot(e)||!n.charCode||n.ctrlKey&&!n.altKey||D&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let i=e.state.selection;if(!(i instanceof r.U3&&i.$from.sameParent(i.$to))){let t=String.fromCharCode(n.charCode),r=()=>e.state.tr.insertText(t).scrollIntoView();/[\r\n]/.test(t)||e.someProp("handleTextInput",(n=>n(e,i.$from.pos,i.$to.pos,t,r)))||e.dispatch(r()),n.preventDefault()}};const kt=D?"metaKey":"ctrlKey";st.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=vt(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[kt]&&e.input.lastClick.button==n.button&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let s=e.posAtCoords(ft(n));s&&("singleClick"==o?e.input.mouseDown=new St(e,s,n,!!r):("doubleClick"==o?yt:wt)(e,s.pos,s.inside,n)?n.preventDefault():ht(e,"pointer"))};class xt{up(e){this.done()}move(e){0==e.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}constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}}class St extends xt{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||Me(this.view)}))}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(ft(e))),this.updateAllowDefault(e),this.allowDefault||!t?ht(this.view,"pointer"):function(e,t,n,i,o){return mt(e,"handleClickOn",t,n,i)||e.someProp("handleClick",(n=>n(e,t,i)))||(o?function(e,t){if(-1==t)return!1;let n,i,o=e.state.selection;o instanceof r.nh&&(n=o.node);let s=e.state.doc.resolve(t);for(let e=s.depth+1;e>0;e--){let t=e>s.depth?s.nodeAfter:s.node(e);if(r.nh.isSelectable(t)){i=n&&o.$from.depth>0&&e>=o.$from.depth&&s.before(o.$from.depth+1)==o.$from.pos?s.before(o.$from.depth):s.before(e);break}}return null!=i&&(gt(e,r.nh.create(e.state.doc,i),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),i=n.nodeAfter;return!!(i&&i.isAtom&&r.nh.isSelectable(i))&&(gt(e,new r.nh(n),"pointer"),!0)}(e,n))}(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||T&&this.mightDrag&&!this.mightDrag.node.isAtom||M&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(gt(this.view,r.LN.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):ht(this.view,"pointer")}move(e){this.updateAllowDefault(e),ht(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return!!this.allowDefault&&(this.delayedSelectionSync=!0,!0)}constructor(e,t,n,i){let o,s;if(super(e),this.pos=t,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[kt],this.allowDefault=n.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),s=t.inside;else{let n=e.state.doc.resolve(t.pos);o=n.parent,s=n.depth?n.before():0}const l=i?null:n.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&1==a.nodeDOM.nodeType?a.nodeDOM:null;let{selection:c}=e.state;0==n.button&&(o.type.spec.draggable&&!1!==o.type.spec.selectable||c instanceof r.nh&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!O||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()),ht(e,"pointer")}}class Ct extends xt{move(e){if(0==e.buttons||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc))return void this.done();e.preventDefault(),ht(this.view,"pointer");let t=this.view.posAtCoords(ft(e)),n=t&&bt(this.view,t.inside,!1);if(!n)return;let{doc:i}=this.view.state,o=this.startSelection,[s,l]=n.from<o.from?[o.to,n.from]:[o.from,n.to];gt(this.view,r.U3.create(i,s,l),"pointer")}constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}}function Ot(e,t){return!!e.composing||!!(T&&Math.abs(Date.now()-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}st.touchstart=e=>{e.input.lastTouch=Date.now(),vt(e),ht(e,"pointer")},st.touchmove=e=>{e.input.lastTouch=Date.now(),ht(e,"pointer")},st.contextmenu=e=>vt(e);const Nt=R?5e3:-1;function Mt(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>Tt(e)),t))}function Et(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Tt(e,t=!1){if(!(R&&e.domObserver.flushingSoon>
2=0)){if(e.domObserver.forceFlush(),Et(e),t||e.docView&&e.docView.dirty){let n=Oe(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):!e.markCursor&&!t||r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.updateState(e.state):e.dispatch(e.state.tr.deleteSelection()),!0}return!1}}lt.compositionstart=lt.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof r.U3&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))||M&&I&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||1!=t.nodeType||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return 1==r.nodeType&&"false"==r.contentEditable}(e)))e.markCursor=e.state.storedMarks||n.marks(),Tt(e,!0),e.markCursor=null;else if(Tt(e,!t.selection.empty),O&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}Mt(e,Nt)},lt.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then((()=>e.domObserver.flush())),e.input.compositionID++,Mt(e,20))};const At=S&&C<15||A&&P<604;function Dt(e,t,n,r,o){let s=Ye(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,o,s||i.Ji.empty))))return!0;if(!s)return!1;let l=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(s),a=l?e.state.tr.replaceSelectionWith(l,r):e.state.tr.replaceSelection(s);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function It(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}st.copy=lt.cut=(e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let o=At?null:n.clipboardData,s=r.content(),{dom:l,text:a}=Ge(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",a)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,l),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},lt.paste=(e,t)=>{let n=t;if(e.composing&&!R)return;let r=At?null:n.clipboardData,i=e.input.shiftKey&&45!=e.input.lastKeyCode;r&&Dt(e,It(r),r.getData("text/html"),i,n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Dt(e,r.value,null,i,t):Dt(e,r.textContent,r.innerHTML,i,t)}),50)}(e,n)};class Rt{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const zt=D?"altKey":"ctrlKey";function Pt(e,t){let n;return e.someProp("dragCopies",(e=>{n=n||e(t)})),null!=n?!n:!t[zt]}st.dragstart=(e,t)=>{let n=t,i=e.input.mouseDown;if(i&&i.done(),!n.dataTransfer)return;let o,s=e.state.selection,l=s.empty?null:e.posAtCoords(ft(n));if(l&&l.pos>=s.from&&l.pos<=(s instanceof r.nh?s.to-1:s.to));else if(i&&i.mightDrag)o=r.nh.create(e.state.doc,i.mightDrag.pos);else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=r.nh.create(e.state.doc,t.posBefore))}let a=(o||e.state.selection).content(),{dom:c,text:h,slice:d}=Ge(e,a);(!n.dataTransfer.files.length||!M||E>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(At?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",At||n.dataTransfer.setData("text/plain",h),e.dragging=new Rt(d,Pt(e,n),o)},st.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},lt.dragover=lt.dragenter=(e,t)=>t.preventDefault(),lt.drop=(e,t)=>{try{!function(e,t,n){if(!t.dataTransfer)return;let s=e.posAtCoords(ft(t));if(!s)return;let l=e.state.doc.resolve(s.pos),a=n&&n.slice;a?e.someProp("transformPasted",(t=>{a=t(a,e,!1)})):a=Ye(e,It(t.dataTransfer),At?null:t.dataTransfer.getData("text/html"),!1,l);let c=!(!n||!Pt(e,t));if(e.someProp("handleDrop",(n=>n(e,t,a||i.Ji.empty,c))))return void t.preventDefault();if(!a)return;t.preventDefault();let h=a?(0,o.Um)(e.state.doc,l.pos,a):l.pos;null==h&&(h=l.pos);let d=e.state.tr;if(c){let{node:e}=n;e?e.replace(d):d.deleteSelection()}let u=d.mapping.map(h),p=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,f=d.doc;
2if(p?d.replaceRangeWith(u,u,a.content.firstChild):d.replaceRange(u,u,a),d.doc.eq(f))return;let m=d.doc.resolve(u);if(p&&r.nh.isSelectable(a.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(a.content.firstChild))d.setSelection(new r.nh(m));else{let t=d.mapping.map(h);d.mapping.maps[d.mapping.maps.length-1].forEach(((e,n,r,i)=>t=i)),d.setSelection(ze(e,m,d.doc.resolve(t)))}e.focus(),e.dispatch(d.setMeta("uiEvent","drop"))}(e,t,e.dragging)}finally{e.dragging=null}},st.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Me(e)}),20))},st.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},st.beforeinput=(e,t)=>{if(R&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,g(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let e in lt)st[e]=lt[e];function Lt(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class $t{map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new Bt(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof $t&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Lt(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}constructor(e,t){this.toDOM=e,this.spec=t||_t,this.side=this.spec.side||0}}class Ft{map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new Bt(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Ft&&Lt(this.attrs,e.attrs)&&Lt(this.spec,e.spec)}static is(e){return e.type instanceof Ft}destroy(){}constructor(e,t){this.attrs=e,this.spec=t||_t}}class jt{map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new Bt(i.pos-n,o.pos-n,this)}valid(e,t){let n,{index:r,offset:i}=e.content.findIndex(t.from);return i==t.from&&!(n=e.child(r)).isText&&i+n.nodeSize==t.to}eq(e){return this==e||e instanceof jt&&Lt(this.attrs,e.attrs)&&Lt(this.spec,e.spec)}destroy(){}constructor(e,t){this.attrs=e,this.spec=t||_t}}class Bt{copy(e,t){return new Bt(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new Bt(e,e,new $t(t,n))}static inline(e,t,n,r){return new Bt(e,t,new Ft(n,r))}static node(e,t,n,r){return new Bt(e,t,new jt(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ft}get widget(){return this.type instanceof $t}constructor(e,t,n){this.from=e,this.to=t,this.type=n}}const Vt=[],_t={};class Jt{static create(e,t){return t.length?Gt(t,e,0,_t):qt}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==qt||0==e.maps.length?this:this.mapInner(e,t,0,0,n||_t)}mapInner(e,t,n,r,i){let o;for(let s=0;s<this.local.length;s++){let l=this.local[s].map(e,n,r);l&&l.type.valid(t,l)?(o||(o=[])).push(l):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,i,o,s){let l=e.slice();for(let e=0,t=o;e<n.maps.length;e++){let r=0;n.maps[e].forEach(((e,n,i,o)=>{let s=o-i-(n-e);for(let i=0;i<l.length;i+=3){let o=l[i+1];if(o<0||e>o+t-r)continue;let a=l[i]+t-r;n>=a?l[i+1]=e<=a?-2:-1:e>=t&&s&&(l[i]+=s,l[i+1]+=s)}
2r+=s})),t=n.maps[e].map(t,-1)}let a=!1;for(let t=0;t<l.length;t+=3)if(l[t+1]<0){if(-2==l[t+1]){a=!0,l[t+1]=-1;continue}let c=n.map(e[t]+o),h=c-i;if(h<0||h>=r.content.size){a=!0;continue}let d=n.map(e[t+1]+o,-1)-i,{index:u,offset:p}=r.content.findIndex(h),f=r.maybeChild(u);if(f&&p==h&&p+f.nodeSize==d){let r=l[t+2].mapInner(n,f,c+1,e[t]+o+1,s);r!=qt?(l[t]=h,l[t+1]=d,l[t+2]=r):(l[t+1]=-2,a=!0)}else a=!0}if(a){let a=function(e,t,n,r,i,o,s){function l(e,t){for(let o=0;o<e.local.length;o++){let l=e.local[o].map(r,i,t);l?n.push(l):s.onRemove&&s.onRemove(e.local[o].spec)}for(let n=0;n<e.children.length;n+=3)l(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)-1==e[n+1]&&l(e[n+2],t[n]+o+1);return n}(l,e,t,n,i,o,s),c=Gt(a,r,0,s);t=c.local;for(let e=0;e<l.length;e+=3)l[e+1]<0&&(l.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<l.length&&l[t]<n;)t+=3;l.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new Jt(t.sort(Yt),l)}(this.children,o||[],e,t,n,r,i):o?new Jt(o.sort(Yt),Vt):qt}add(e,t){return t.length?this==qt?Jt.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach(((e,o)=>{let s,l=o+n;if(s=Wt(t,e,l)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,s,l+1):r.splice(i,0,o,o+e.nodeSize,Gt(s,e,l+1,_t)),i+=3}}));let o=Ut(i?Ht(t):t,-n);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new Jt(o.length?this.local.concat(o).sort(Yt):this.local,r||this.children)}remove(e){return 0==e.length||this==qt?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let i,o=n[r]+t,s=n[r+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>o&&t.to<s&&(e[n]=null,(i||(i=[])).push(t));if(!i)continue;n==this.children&&(n=this.children.slice());let l=n[r+2].removeInner(i,o+1);l!=qt?n[r+2]=l:(n.splice(r,3),r-=3)}if(r.length)for(let n,i=0;i<e.length;i++)if(n=e[i])for(let e=0;e<r.length;e++)r[e].eq(n,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new Jt(r,n):qt}forChild(e,t){if(this==qt)return this;if(t.isLeaf)return Jt.empty;let n,r;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let i=e+1,o=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>i&&t.type instanceof Ft){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new Jt(r.sort(Yt),Vt);return n?new Kt([e,n]):e}return n||qt}eq(e){if(this==e)return!0;if(!(e instanceof Jt)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Xt(this.localsInner(e))}localsInner(e){if(this==qt)return Vt;if(e.inlineContent||!this.local.some(Ft.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof Ft||t.push(this.local[e]);return t}forEachSet(e){e(this)}constructor(e,t){this.local=e.length?e:Vt,this.children=t.length?t:Vt}}Jt.empty=new Jt([],[]),Jt.removeOverlap=Xt;const qt=Jt.empty;class Kt{map(e,t){const n=this.members.map((n=>n.map(e,t,_t)));return Kt.from(n)}forChild(e,t){if(t.isLeaf)return Jt.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=qt&&(i instanceof Kt?n=n.concat(i.members):n.push(i))}return Kt.from(n)}eq(e){if(!(e instanceof Kt)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?Xt(n?t:t.sort(Yt)):Vt}static from(e){switch(e.length){case 0:return qt;case 1:return e[0];default:return new Kt(e.every((e=>e instanceof Jt))?e:e.reduce(((e,t)=>e.concat(t instanceof Jt?t:t.members)),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}constructor(e){this.members=e}}function Ut(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new Bt(i.from+t,i.to+t,i.type))}return n}function Wt(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t,o=0;o<e.length;o++)(t=e[o])&&t.from>n&&t.to<r&&((i||(i=[])).push(t),e[o]=null);return i}function Ht(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Gt(e,t,n,r){let i=[],o=!1;t.forEach(((t,s)=>{let l=Wt(e,t,s+n);if(l){o=!0;let e=Gt(l,t,n+s+1,r);e!=qt&&i.push(s,s+t.nodeSize,e)}}));let s=Ut(o?Ht(e):e,-n).sort(Yt);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||i.length?new Jt(s,i):qt}function Yt(e,t){return e.from-t.from||e.to-t.to}function Xt(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from!=r.from){o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),Zt(t,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),Zt(t,i+1,o.copy(r.to,o.to)))}}return t}function Zt(e,t,n){for(;t<e.length&&Yt(n,e[t])>0;)t++;e.splice(t,0,n)}function Qt(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=qt&&t.push(r)})),e.cursorWrapper&&t.push(Jt.create(e.state.doc,[e.cursorWrapper.deco])),Kt.from(t)}const en={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},tn=S&&C<=11;class nn{set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}}class rn{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,en)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout((()=>this.flush()),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout((()=>this.suppressingSelectionUpdates=!1),50)}onSelectionChange(){if(Pe(this.view)){if(this.suppressingSelectionUpdates)return Me(this.view);if(S&&C<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&h(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t,n=new Set;for(let t=e.focusNode;t;t=l(t))n.add(t);for(let r=e.anchorNode;r;r=l(r))if(n.has(r)){t=r;break}let r=t&&this.view.docView.nearestDesc(t);return r&&r.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Pe(e)&&!this.ignoreSelectionChange(n),o=-1,s=-1,l=!1,a=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],a);n&&(o=o<0?n.from:Math.min(n.from,o),s=s<0?n.to:Math.max(n.to,s),n.typeOver&&(l=!0))}if(a.some((e=>"BR"==e.nodeName))&&(8==e.input.lastKeyCode||46==e.input.lastKeyCode||M&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some((e=>"childList"==e.type&&e.removedNodes.length)))){for(let e of a)if("BR"==e.nodeName&&e.parentNode){let t=e.nextSibling;for(;t&&1==t.nodeType;){if("false"==t.contentEditable){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(O&&a.length){let t=a.filter((e=>"BR"==e.nodeName));if(2==t.length){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;!t||"LI"!=t.nodeName||n&&an(e,n)==t||r.remove()}}}let c=null;o<0&&i&&e.input.lastFocus>
2Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&m(n)&&(c=Oe(e))&&c.eq(r.LN.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Me(e),this.currentSelection.set(n),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),function(e){if(!on.has(e)&&(on.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))){if(e.requiresGeckoHackNode=O,sn)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."),sn=!0}}(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,function(e,t){var n;let{focusNode:r,focusOffset:i}=e.domSelectionRange();for(let o of t)if("TR"==(null===(n=o.parentNode)||void 0===n?void 0:n.nodeName)){let t=o.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||1!=e.nodeType||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e}n.insertBefore(o,n.firstChild),r==o&&e.domSelection().collapse(o,i)}else o.parentNode.removeChild(o)}}(e,a)),this.handleDOMChange(o,s,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Me(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),3==r.nodeType&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(S&&C<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!o||Array.prototype.indexOf.call(e.addedNodes,o)<0)&&(i=o)}let o=r&&r.parentNode==e.target?s(r)+1:0,l=n.localPosFromDOM(e.target,o,-1),a=i&&i.parentNode==e.target?s(i):e.target.childNodes.length;return{from:l,to:n.localPosFromDOM(e.target,a,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new nn,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver((t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);S&&C<=11&&t.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():T&&e.composing&&t.some((e=>"childList"==e.type&&"TR"==e.target.nodeName))?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()})),tn&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}}let on=new WeakMap,sn=!1;function ln(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return h(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function an(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}const cn=/^(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 hn(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:ze(e,t.resolve(n.anchor),t.resolve(n.head))}function dn(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}class un{get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&dt(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(yn),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let r=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(Et(this),o=!0),this.state=e;let l=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=gn(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,i=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&dt(this),this.editable=mn(this),fn(this);let a=Qt(this),c=pn(this),d=r.plugins==e.plugins||r.doc.eq(e.doc)?e.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",u=i||!this.docView.matchesNode(e.doc,c,a);!u&&e.selection.eq(r.selection)||(o=!0);let m="preserve"==d&&o&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(o,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let l=r.getBoundingClientRect();if(l.top>=i-20){t=r,n=l.top;break}}return{refDOM:t,refTop:n,stack:B(e.dom)}}(this);if(o){this.domObserver.stop();let t=u&&(S||M)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(r.selection,e.selection);if(u){let n=M?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=p(e=e.childNodes[t-1])}else{if(!e.parentNode||f(e))return null;t=s(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||f(e))return null;t=s(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);
2if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(e&&e.isText(n.nodeValue))return r}}return n||r}(this)),!i&&this.docView.update(e.doc,c,a,this)||(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=ce(e.doc,c,a,this.dom,this)),!n||this.trackWrites&&this.dom.contains(this.trackWrites)||(t=!0)}let n=this.input.mouseDown;t||!(n&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return h(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this)&&n.delaySelUpdate())?Me(this,t):(Ie(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==d?this.dom.scrollTop=0:"to selection"==d?this.scrollToSelection():m&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;V(n,0==r?0:r-t)}(m)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode))if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(this.state.selection instanceof r.nh){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&j(this,t.getBoundingClientRect(),e)}else j(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(e,t){let n=e.node,i=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)i=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(i=e)}this.dragging=new Rt(e.slice,e.move,i<0?void 0:r.nh.create(this.state.doc,i))}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let r=0;r<this.directPlugins.length;r++){let i=this.directPlugins[r].props[e];if(null!=i&&(n=t?t(i):i))return n}let i=this.state.plugins;if(i)for(let r=0;r<i.length;r++){let o=i[r].props[e];if(null!=o&&(n=t?t(o):o))return n}}hasFocus(){if(S){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(_)return e.focus(_);let t=B(e);e.focus(null==_?{get preventScroll(){return _={preventScroll:!0},!0}}:void 0),_||(_=!1,V(t,0))}(this.dom),Me(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e;return e||document}updateRoot(){this._root=null}posAtCoords(e){return U(this,e)}coordsAtPos(e,t=1){return Y(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return function(e,t,n){return te==t&&ne==n?re:(te=t,ne=n,re="up"==n||"down"==n?function(e,t,n){let r=t.selection,i="up"==n?r.$from:r.$to;return Q(e,t,(()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=Y(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=c(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0}))}
2(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=e.domSelection();return l?ee.test(r.parent.textContent)&&l.modify?Q(e,t,(()=>{let{focusNode:t,focusOffset:i,anchorNode:o,anchorOffset:s}=e.domSelectionRange(),a=l.caretBidiLevel;l.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:h,focusOffset:d}=e.domSelectionRange(),u=h&&!c.contains(1==h.nodeType?h:h.parentNode)||t==h&&i==d;try{l.collapse(o,s),t&&(t!=o||i!=s)&&l.extend&&l.extend(t,i)}catch(e){}return null!=a&&(l.caretBidiLevel=a),u})):"left"==n||"backward"==n?o:s:r.pos==r.start()||r.pos==r.end()}(e,t,n))}(this,t||this.state,e)}pasteHTML(e,t){return Dt(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return Dt(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return Ge(this,e)}destroy(){this.docView&&(function(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Qt(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,a=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){ut(e,t)||!st[t.type]||!e.editable&&t.type in lt||st[t.type](e,t)}(this,e)}domSelectionRange(){let e=this.domSelection();return e?T&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return ln(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?ln(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new ct,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(yn),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=mn(this),fn(this),this.nodeViews=gn(this),this.docView=ce(this.state.doc,pn(this),Qt(this),this.dom,this),this.domObserver=new rn(this,((e,t,n,o)=>function(e,t,n,o,s){let l=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Oe(e,t);
2if(n&&!e.state.selection.eq(n)){if(M&&R&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",(t=>t(e,g(13,"Enter")))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),l&&r.setMeta("composition",l),e.dispatch(r)}return}let a=e.state.doc.resolve(t),c=a.sharedDepth(n);t=a.before(c+1),n=e.state.doc.resolve(n).after(c+1);let h,d,u=e.state.selection,p=function(e,t,n,r){let o,{node:s,fromOffset:l,toOffset:a,from:c,to:h}=e.docView.parseRange(t,n),d=e.domSelectionRange(),u=d.anchorNode;if(u&&e.dom.contains(1==u.nodeType?u:u.parentNode)&&(o=[{node:u,offset:d.anchorOffset}],m(d)||o.push({node:d.focusNode,offset:d.focusOffset})),M&&8===e.input.lastKeyCode)for(let e=a;e>l;e--){let t=s.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){a=e;break}if(!n||n.size)break}let p=e.state.doc,f=e.someProp("domParser")||i.S4.fromSchema(e.state.schema),g=p.resolve(c),y=null,w=f.parse(s,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:l,to:a,preserveWhitespace:"pre"!=g.parent.type.whitespace||"full",findPositions:o,ruleFromNode:(b=r,e=>{let t=e.pmViewDesc;if(t)return t.parseRule(b);if("BR"==e.nodeName&&e.parentNode){if(T&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||T&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}),context:g});var b;if(o&&null!=o[0].pos){let e=o[0].pos,t=o[1]&&o[1].pos;null==t&&(t=e),y={anchor:e+c,head:t+c}}return{doc:w,sel:y,from:c,to:h}}(e,t,n,s),f=e.state.doc,y=f.slice(p.from,p.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(h=e.state.selection.to,d="end"):(h=e.state.selection.from,d="start"),e.input.lastKeyCode=null;let w=function(e,t,n,r,i){let o=e.findDiffStart(t,n),s=n+e.size,l=n+t.size;if(null==o)return null;let{a,b:c}=e.findDiffEnd(t,s,l);return"end"==i&&(r-=a+Math.max(0,o-Math.min(a,c))-o),a<o&&s<l?(o-=r<=o&&r>=a?o-r:0,c=o+(c-a),a=o):c<o&&(o-=r<=o&&r>=c?o-r:0,a=o+(a-c),c=o),{start:o,endA:a,endB:c}}(y.content,p.doc.content,p.from,h,d);if(w&&e.input.domChangeCount++,(A&&e.input.lastIOSEnter>Date.now()-225||R)&&s.some((e=>1==e.nodeType&&!cn.test(e.nodeName)))&&(!w||w.endA>=w.endB)&&e.someProp("handleKeyDown",(t=>t(e,g(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!w){if(!(o&&u instanceof r.U3&&!u.empty&&u.$head.sameParent(u.$anchor))||e.composing||p.sel&&p.sel.anchor!=p.sel.head){if(p.sel){let t=hn(e,e.state.doc,p.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);l&&n.setMeta("composition",l),e.dispatch(n)}}return}w={start:u.from,endA:u.to,endB:u.to}}e.state.selection.from<e.state.selection.to&&w.start==w.endB&&e.state.selection instanceof r.U3&&(w.start>e.state.selection.from&&w.start<=e.state.selection.from+2&&e.state.selection.from>=p.from?w.start=e.state.selection.from:w.endA<e.state.selection.to&&w.endA>=e.state.selection.to-2&&e.state.selection.to<=p.to&&(w.endB+=e.state.selection.to-w.endA,w.endA=e.state.selection.to)),S&&C<=11&&w.endB==w.start+1&&w.endA==w.start&&w.start>p.from&&" Â "==p.doc.textBetween(w.start-p.from-1,w.start-p.from+1)&&(w.start--,w.endA--,w.endB--);let b=p.doc.resolveNoCache(w.start-p.from),v=p.doc.resolveNoCache(w.endB-p.from),k=f.resolve(w.start),x=b.sameParent(v)&&b.parent.inlineContent&&k.end()>=w.endA;if((A&&e.input.lastIOSEnter>Date.now()-225&&(!x||s.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!x&&b.pos<p.doc.content.size&&(!b.sameParent(v)||!b.parent.inlineContent)&&b.pos<v.pos&&!/\S/.test(p.doc.textBetween(b.pos,v.pos,"","")))&&e.someProp("handleKeyDown",(t=>t(e,g(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>w.start&&function(e,t,n,r,i){if(n-t<=i.pos-r.pos||dn(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(!r.parent.isTextblock){let e=o.nodeAfter;return null!=e&&n==t+e.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(dn(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||dn(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(f,w.start,w.endA,b,v)&&e.someProp("handleKeyDown",(t=>t(e,g(8,"Backspace")))))return void(R&&M&&e.domObserver.suppressSelectionUpdates());
2M&&w.endB==w.start&&(e.input.lastChromeDelete=Date.now()),R&&!x&&b.start()!=v.start()&&0==v.parentOffset&&b.depth==v.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==w.endA&&(w.endB-=2,v=p.doc.resolveNoCache(w.endB-p.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,g(13,"Enter"))}))}),20));let O,N=w.start,E=w.endA,D=t=>{let n=t||e.state.tr.replace(N,E,p.doc.slice(w.start-p.from,w.endB-p.from));if(p.sel){let t=hn(e,n.doc,p.sel);t&&!(M&&e.composing&&t.empty&&(w.start!=w.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==N||t.head==n.mapping.map(E)-1)||S&&t.empty&&t.head==N)&&n.setSelection(t)}return l&&n.setMeta("composition",l),n.scrollIntoView()};if(x)if(b.pos==v.pos){S&&C<=11&&0==b.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>Me(e)),20));let t=D(e.state.tr.delete(N,E)),n=f.resolve(w.start).marksAcross(f.resolve(w.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(w.endA==w.endB&&(O=function(e,t){let n,r,o,s=e.firstChild.marks,l=t.firstChild.marks,a=s,c=l;for(let e=0;e<l.length;e++)a=l[e].removeFromSet(a);for(let e=0;e<s.length;e++)c=s[e].removeFromSet(c);if(1==a.length&&0==c.length)r=a[0],n="add",o=e=>e.mark(r.addToSet(e.marks));else{if(0!=a.length||1!=c.length)return null;r=c[0],n="remove",o=e=>e.mark(r.removeFromSet(e.marks))}let h=[];for(let e=0;e<t.childCount;e++)h.push(o(t.child(e)));if(i.FK.from(h).eq(e))return{mark:r,type:n}}(b.parent.content.cut(b.parentOffset,v.parentOffset),k.parent.content.cut(k.parentOffset,w.endA-k.start())))){let t=D(e.state.tr);"add"==O.type?t.addMark(N,E,O.mark):t.removeMark(N,E,O.mark),e.dispatch(t)}else if(b.parent.child(b.index()).isText&&b.index()==v.index()-(v.textOffset?0:1)){let t=b.parent.textBetween(b.parentOffset,v.parentOffset),n=()=>D(e.state.tr.insertText(t,N,E));e.someProp("handleTextInput",(r=>r(e,N,E,t,n)))||e.dispatch(n())}else e.dispatch(D());else e.dispatch(D())}(this,e,t,n,o))),this.domObserver.start(),function(e){for(let t in st){let n=st[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!pt(e,t)||ut(e,t)||!e.editable&&t.type in lt||n(e,t)},at[t]?{passive:!0}:void 0)}T&&e.dom.addEventListener("input",(()=>null)),dt(e)}(this),this.updatePluginViews()}}function pn(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))})),t.translate||(t.translate="no"),[Bt.node(0,e.state.doc.content.size,t)]}function fn(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Bt.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function mn(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function gn(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function yn(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}un.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}},12211(e,t,n){"use strict";n.d(t,{b6:()=>k,ZS:()=>C,tN:()=>S});var r=200,i=function(){};i.prototype.append=function(e){return e.length?(e=i.from(e),!this.length&&e||e.length<r&&this.leafAppend(e)||this.length<r&&e.leafPrepend(this)||this.appendInner(e)):this},i.prototype.prepend=function(e){return e.length?i.from(e).append(this):this},i.prototype.appendInner=function(e){return new s(this,e)},i.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?i.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},i.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},i.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},i.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},i.from=function(e){return e instanceof i?e:e&&e.length?new o(e):i.empty};var o=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=r)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=r)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(i);i.empty=new o([]);var s=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;return!(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r))&&!(n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))&&void 0},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;return!(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i))&&!(n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))&&void 0},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(i);const l=i;var a=n(83279),c=n(3554);class h{popEvent(e,t){if(0==this.eventCount)return null;let n,r,i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}t&&(n=this.remapping(i,this.items.length),r=n.maps.length);let o,s,l=e.tr,a=[],c=[];
2return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(i,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new d(e.map));let t,i=e.step.map(n.slice(r));i&&l.maybeStep(i).doc&&(t=l.mapping.maps[l.mapping.maps.length-1],a.push(new d(t,void 0,void 0,a.length+c.length))),r--,t&&n.appendMap(t,r)}else l.maybeStep(e.step);return e.selection?(o=n?e.selection.map(n.slice(r)):e.selection,s=new h(this.items.slice(0,i).append(c.reverse().concat(a)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:l,selection:o}}addTransform(e,t,n,r){let i=[],o=this.eventCount,s=this.items,l=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<e.steps.length;n++){let a,c=e.steps[n].invert(e.docs[n]),h=new d(e.mapping.maps[n],c,t);(a=l&&l.merge(h))&&(h=a,n?i.pop():s=s.slice(0,s.length-1)),i.push(h),t&&(o++,t=void 0),r||(l=h)}let a=o-n.depth;return a>p&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,a),o-=a),new h(s.append(i),o)}remapping(e,t){let n=new a.X9;return this.items.forEach(((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new h(this.items.append(e.map((e=>new d(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let l=t;this.items.forEach((t=>{let r=i.getMirror(--l);if(null==r)return;o=Math.min(o,r);let a=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(i.slice(l+1,r));c&&s++,n.push(new d(a,o,c))}else n.push(new d(a))}),r);let a=[];for(let e=t;e<o;e++)a.push(new d(i.maps[e]));let c=this.items.slice(0,r).append(a).append(n),u=new h(c,s);return u.emptyItemCount()>500&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach(((o,s)=>{if(s>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let l=o.selection&&o.selection.map(t.slice(n));l&&i++;let a,c=new d(s.invert(),e,l),h=r.length-1;(a=r.length&&r[h].merge(c))?r[h]=a:r.push(c)}}else o.map&&n--}),this.items.length,0),new h(l.from(r.reverse()),i)}constructor(e,t){this.items=e,this.eventCount=t}}h.empty=new h(l.empty,0);class d{merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new d(t.getMap().invert(),t,this.selection)}}constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}}class u{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}const p=20;function f(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach(((e,n,r,i)=>t.push(r,i)));return t}function m(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}let g=!1,y=null;function w(e){let t=e.plugins;if(y!=t){g=!1,y=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){g=!0;break}}return g}const b=new c.hs("history"),v=new c.hs("closeHistory");function k(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new c.k_({key:b,state:{init:()=>new u(h.empty,h.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let i,o=n.getMeta(b);if(o)return o.historyState;n.getMeta(v)&&(e=new u(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(b))return s.getMeta(b).redo?new u(e.done.addTransform(n,void 0,r,w(t)),e.undone,f(n.mapping.maps),e.prevTime,e.prevComposition):new u(e.done,e.undone.addTransform(n,void 0,r,w(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new u(e.done.rebased(n,i),e.undone.rebased(n,i),m(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new u(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),m(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let i=n.getMeta("composition"),o=0==e.prevTime||!s&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;
2return e.mapping.maps[0].forEach(((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)})),n}(n,e.prevRanges)),l=s?m(e.prevRanges,n.mapping):f(n.mapping.maps);return new u(e.done.addTransform(n,o?t.selection.getBookmark():void 0,r,w(t)),h.empty,l,n.time,null==i?e.prevComposition:i)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?S:"historyRedo"==n?C:null;return!(!r||!e.editable)&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function x(e,t){return(n,r)=>{let i=b.getState(n);if(!i||0==(e?i.undone:i.done).eventCount)return!1;if(r){let o=function(e,t,n){let r=w(t),i=b.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),l=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),a=new u(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(s).setMeta(b,{redo:n,historyState:a})}(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}const S=x(!1,!0),C=x(!0,!0);x(!1,!1),x(!0,!1)},24380(e,t,n){"use strict";n.d(t,{bD:()=>D});const{getOwnPropertyNames:r,getOwnPropertySymbols:i}=Object,{hasOwnProperty:o}=Object.prototype;function s(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function l(e){return function(t,n,r){if(!t||!n||"object"!=typeof t||"object"!=typeof n)return e(t,n,r);const{cache:i}=r,o=i.get(t),s=i.get(n);if(o&&s)return o===n&&s===t;i.set(t,n),i.set(n,t);const l=e(t,n,r);return i.delete(t),i.delete(n),l}}function a(e){return r(e).concat(i(e))}const c=Object.hasOwn||((e,t)=>o.call(e,t));function h(e,t){return e===t||!e&&!t&&e!=e&&t!=t}const{getOwnPropertyDescriptor:d,keys:u}=Object;function p(e,t){return e.byteLength===t.byteLength&&N(new Uint8Array(e),new Uint8Array(t))}function f(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function m(e,t){return e.byteLength===t.byteLength&&N(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function g(e,t){return h(e.getTime(),t.getTime())}function y(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function w(e,t){return e===t}function b(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),o=e.entries();let s,l,a=0;for(;(s=o.next())&&!s.done;){const r=t.entries();let o=!1,c=0;for(;(l=r.next())&&!l.done;){if(i[c]){c++;continue}const r=s.value,h=l.value;if(n.equals(r[0],h[0],a,c,e,t,n)&&n.equals(r[1],h[1],r[0],h[0],e,t,n)){o=i[c]=!0;break}c++}if(!o)return!1;a++}return!0}const v=h;function k(e,t,n){const r=u(e);let i=r.length;if(u(t).length!==i)return!1;for(;i-- >0;)if(!E(e,t,n,r[i]))return!1;return!0}function x(e,t,n){const r=a(e);let i,o,s,l=r.length;if(a(t).length!==l)return!1;for(;l-- >0;){if(i=r[l],!E(e,t,n,i))return!1;if(o=d(e,i),s=d(t,i),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable))return!1}return!0}function S(e,t){return h(e.valueOf(),t.valueOf())}function C(e,t){return e.source===t.source&&e.flags===t.flags}function O(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),o=e.values();let s,l;for(;(s=o.next())&&!s.done;){const r=t.values();let o=!1,a=0;for(;(l=r.next())&&!l.done;){if(!i[a]&&n.equals(s.value,l.value,s.value,l.value,e,t,n)){o=i[a]=!0;break}a++}if(!o)return!1}return!0}function N(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function M(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function E(e,t,n,r){return!("_owner"!==r&&"__o"!==r&&"__v"!==r||!e.$$typeof&&!t.$$typeof)||c(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const T={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array
2]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},A=Object.prototype.toString;const D=I();function I(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,o=function({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:p,areArraysEqual:n?x:f,areDataViewsEqual:m,areDatesEqual:g,areErrorsEqual:y,areFunctionsEqual:w,areMapsEqual:n?s(b,x):b,areNumbersEqual:v,areObjectsEqual:n?x:k,arePrimitiveWrappersEqual:S,areRegExpsEqual:C,areSetsEqual:n?s(O,x):O,areTypedArraysEqual:n?s(N,x):N,areUrlsEqual:M,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const e=l(r.areArraysEqual),t=l(r.areMapsEqual),n=l(r.areObjectsEqual),i=l(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}(e),a=function({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:s,areNumbersEqual:l,areObjectsEqual:a,arePrimitiveWrappersEqual:c,areRegExpsEqual:h,areSetsEqual:d,areTypedArraysEqual:u,areUrlsEqual:p,unknownTagComparators:f}){return function(m,g,y){if(m===g)return!0;if(null==m||null==g)return!1;const w=typeof m;if(w!==typeof g)return!1;if("object"!==w)return"number"===w?l(m,g,y):"function"===w&&o(m,g,y);const b=m.constructor;if(b!==g.constructor)return!1;if(b===Object)return a(m,g,y);if(Array.isArray(m))return t(m,g,y);if(b===Date)return r(m,g,y);if(b===RegExp)return h(m,g,y);if(b===Map)return s(m,g,y);if(b===Set)return d(m,g,y);const v=A.call(m);if("[object Date]"===v)return r(m,g,y);if("[object RegExp]"===v)return h(m,g,y);if("[object Map]"===v)return s(m,g,y);if("[object Set]"===v)return d(m,g,y);if("[object Object]"===v)return"function"!=typeof m.then&&"function"!=typeof g.then&&a(m,g,y);if("[object URL]"===v)return p(m,g,y);if("[object Error]"===v)return i(m,g,y);if("[object Arguments]"===v)return a(m,g,y);if(T[v])return u(m,g,y);if("[object ArrayBuffer]"===v)return e(m,g,y);if("[object DataView]"===v)return n(m,g,y);if("[object Boolean]"===v||"[object Number]"===v||"[object String]"===v)return c(m,g,y);if(f){let e=f[v];if(!e){const t=null!=(k=m)?k[Symbol.toStringTag]:void 0;t&&(e=f[t])}if(e)return e(m,g,y)}var k;return!1}}(o);var c;return function({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(o,s){const{cache:l=(e?new WeakMap:void 0),meta:a}=n();return t(o,s,{cache:l,equals:r,meta:a,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const o={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,o)}}({circular:t,comparator:a,createState:r,equals:n?n(a):(c=a,function(e,t,n,r,i,o,s){return c(e,t,s)}),strict:i})}I({strict:!0}),I({circular:!0}),I({circular:!0,strict:!0}),I({createInternalComparator:()=>h}),I({strict:!0,createInternalComparator:()=>h}),I({circular:!0,createInternalComparator:()=>h}),I({circular:!0,createInternalComparator:()=>h,strict:!0})},26597(e,t,n){"use strict";n.d(t,{$f:()=>D,G2:()=>b,I$:()=>C,Im:()=>R,Qv:()=>a,Sd:()=>y,Z1:()=>O,_G:()=>h,_e:()=>p,bh:()=>v,eB:()=>c,eT:()=>g,ec:()=>I,hy:()=>E,iz:()=>N,pC:()=>x,yY:()=>k,y_:()=>z});var r=n(83279),i=n(6113),o=n(3554);const s=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function l(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const a=(e,t,n)=>{let s=l(e,n);if(!s)return!1;let a=f(s);if(!a){let n=s.blockRange(),i=n&&(0,r.jP)(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let c=a.nodeBefore;if(T(e,a,t,-1))return!0;if(0==s.parent.content.size&&(u(c,"end")||o.nh.isSelectable(c)))for(let n=s.depth;;n--){let l=(0,r.$L)(e.doc,s.before(n),s.after(n),i.Ji.empty);if(l&&l.slice.size<l.to-l.from){if(t){let n=e.tr.step(l);n.setSelection(u(c,"end")?o.LN.findFrom(n.doc.resolve(n.mapping.map(a.pos,-1)),-1):o.nh.create(n.doc,a.pos-c.nodeSize)),t(n.scrollIntoView())}return!0}if(1==n||s.node(n-1).childCount>1)break}return!(!c.isAtom||a.depth!=s.depth-1||(t&&t(e.tr.delete(a.pos-c.nodeSize,a.pos).scrollIntoView()),0))},c=(e,t,n)=>{let r=l(e,n);if(!r)return!1;let i=f(r);return!!i&&d(e,i,t)},h=(e,t,n)=>{let r=m(e,n);if(!r)return!1;let i=w(r);return!!i&&d(e,i,t)};function d(e,t,n){let s=t.nodeBefore,l=t.pos-1;for(;!s.isTextblock;l--){if(s.type.spec.isolating)return!1;let e=s.lastChild;if(!e)return!1;s=e}let a=t.nodeAfter,c=t.pos+1;for(;!a.isTextblock;c++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let h=(0,r.$L)(e.doc,l,c,i.Ji.empty);if(!h||h.from!=l||h instanceof r.Ln&&h.slice.size>=c-l)return!1;if(n){let t=e.tr.step(h);t.setSelection(o.U3.create(t.doc,l)),n(t.scrollIntoView())}return!0}function u(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;
2if(n&&1!=r.childCount)return!1}return!1}const p=(e,t,n)=>{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;s=f(r)}let l=s&&s.nodeBefore;return!(!l||!o.nh.isSelectable(l)||(t&&t(e.tr.setSelection(o.nh.create(e.doc,s.pos-l.nodeSize)).scrollIntoView()),0))};function f(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function m(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const g=(e,t,n)=>{let s=m(e,n);if(!s)return!1;let l=w(s);if(!l)return!1;let a=l.nodeAfter;if(T(e,l,t,1))return!0;if(0==s.parent.content.size&&(u(a,"start")||o.nh.isSelectable(a))){let n=(0,r.$L)(e.doc,s.before(),s.after(),i.Ji.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(u(a,"start")?o.LN.findFrom(r.doc.resolve(r.mapping.map(l.pos)),1):o.nh.create(r.doc,r.mapping.map(l.pos))),t(r.scrollIntoView())}return!0}}return!(!a.isAtom||l.depth!=s.depth-1||(t&&t(e.tr.delete(l.pos,l.pos+a.nodeSize).scrollIntoView()),0))},y=(e,t,n)=>{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;s=w(r)}let l=s&&s.nodeAfter;return!(!l||!o.nh.isSelectable(l)||(t&&t(e.tr.setSelection(o.nh.create(e.doc,s.pos)).scrollIntoView()),0))};function w(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const b=(e,t)=>{let n,i=e.selection,s=i instanceof o.nh;if(s){if(i.node.isTextblock||!(0,r.n9)(e.doc,i.from))return!1;n=i.from}else if(n=(0,r.N0)(e.doc,i.from,-1),null==n)return!1;if(t){let r=e.tr.join(n);s&&r.setSelection(o.nh.create(r.doc,n-e.doc.resolve(n).nodeBefore.nodeSize)),t(r.scrollIntoView())}return!0},v=(e,t)=>
2{let n,i=e.selection;if(i instanceof o.nh){if(i.node.isTextblock||!(0,r.n9)(e.doc,i.to))return!1;n=i.to}else if(n=(0,r.N0)(e.doc,i.to,1),null==n)return!1;return t&&t(e.tr.join(n).scrollIntoView()),!0},k=(e,t)=>{let{$from:n,$to:i}=e.selection,o=n.blockRange(i),s=o&&(0,r.jP)(o);return null!=s&&(t&&t(e.tr.lift(o,s).scrollIntoView()),!0)},x=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))};function S(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const C=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),l=S(i.contentMatchAt(s));if(!l||!i.canReplaceWith(s,s,l))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,l.createAndFill());i.setSelection(o.LN.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},O=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof o.i5||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=S(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,l=e.tr.insert(n,s.createAndFill());l.setSelection(o.U3.create(l.doc,n+1)),t(l.scrollIntoView())}return!0},N=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if((0,r.zy)(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let i=n.blockRange(),o=i&&(0,r.jP)(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)};var M;const E=(e,t)=>{let n,{$from:r,to:i}=e.selection,s=r.sharedDepth(i);return 0!=s&&(n=r.before(s),t&&t(e.tr.setSelection(o.nh.create(e.doc,n))),!0)};function T(e,t,n,s){let l,a,c=t.nodeBefore,h=t.nodeAfter,d=c.type.spec.isolating||h.type.spec.isolating;if(!d&&function(e,t,n){let i=t.nodeBefore,o=t.nodeAfter,s=t.index();return!(!(i&&o&&i.type.compatibleContent(o.type))||(!i.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(s,s+1)||!o.isTextblock&&!(0,r.n9)(e.doc,t.pos)||(n&&n(e.tr.join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let p=!d&&t.parent.canReplace(t.index(),t.index()+1);if(p&&(l=(a=c.contentMatchAt(c.childCount)).findWrapping(h.type))&&a.matchType(l[0]||h.type).validEnd){if(n){let o=t.pos+h.nodeSize,s=i.FK.empty;for(let e=l.length-1;e>=0;e--)s=i.FK.from(l[e].create(null,s));s=i.FK.from(c.copy(s));let a=e.tr.step(new r.Wg(t.pos-1,o,t.pos,o,new i.Ji(s,1,0),l.length,!0)),d=a.doc.resolve(o+2*l.length);d.nodeAfter&&d.nodeAfter.type==c.type&&(0,r.n9)(a.doc,d.pos)&&a.join(d.pos),n(a.scrollIntoView())}return!0}let f=h.type.spec.isolating||s>0&&d?null:o.LN.findFrom(t,1),m=f&&f.$from.blockRange(f.$to),g=m&&(0,r.jP)(m);if(null!=g&&g>=t.depth)return n&&n(e.tr.lift(m,g).scrollIntoView()),!0;if(p&&u(h,"start",!0)&&u(c,"end")){let o=c,s=[];for(;s.push(o),!o.isTextblock;)o=o.lastChild;let l=h,a=1;for(;!l.isTextblock;l=l.firstChild)a++;
2if(o.canReplace(o.childCount,o.childCount,l.content)){if(n){let o=i.FK.empty;for(let e=s.length-1;e>=0;e--)o=i.FK.from(s[e].copy(o));n(e.tr.step(new r.Wg(t.pos-s.length,t.pos+h.nodeSize,t.pos+a,t.pos+h.nodeSize-a,new i.Ji(o,s.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function A(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return!!i.node(s).isTextblock&&(n&&n(t.tr.setSelection(o.U3.create(t.doc,e<0?i.start(s):i.end(s)))),!0)}}const D=A(-1),I=A(1);function R(e,t=null){return function(n,i){let{$from:o,$to:s}=n.selection,l=o.blockRange(s),a=l&&(0,r.oM)(l,e,t);return!!a&&(i&&i(n.tr.wrap(l,a).scrollIntoView()),!0)}}function z(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(o,s,((r,o)=>{if(i)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)i=!0;else{let t=n.doc.resolve(o),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}}))}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];i.setBlockType(o,s,e,t)}r(i.scrollIntoView())}return!0}}function P(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}let L=P(s,a,p),$=P(s,g,y);const F={Enter:P(x,O,N,((e,t)=>{if(e.selection instanceof o.nh&&e.selection.node.isBlock){let{$from:n}=e.selection;return!(!n.parentOffset||!(0,r.zy)(e.doc,n.pos)||(t&&t(e.tr.split(n.pos).scrollIntoView()),0))}if(!e.selection.$from.depth)return!1;let n=e.tr;!e.selection.empty&&(e.selection instanceof o.U3||e.selection instanceof o.i5)&&n.deleteSelection();let i,s,{$from:l}=n.selection,a=n.steps.length,c=[],h=!1,d=!1;for(let e=l.depth;;e--){if(l.node(e).isBlock){h=l.end(e)==l.pos+(l.depth-e),d=l.start(e)==l.pos-(l.depth-e),s=S(l.node(e-1).contentMatchAt(l.indexAfter(e-1)));let t=M;c.unshift(t||(h&&s?{type:s}:null)),i=e;break}if(1==e)return!1;c.unshift(null)}let u=l.pos,p=(0,r.zy)(n.doc,u,c.length,c);if(p||(c[0]=s?{type:s}:null,p=(0,r.zy)(n.doc,u,c.length,c)),!p)return!1;if(n.split(u,c.length,c),!h&&d&&l.node(i).type!=s){let e=n.mapping.slice(a),t=e.map(l.before(i)),r=n.doc.resolve(t);s&&l.node(i-1).canReplaceWith(r.index(),r.index()+1,s)&&n.setNodeMarkup(e.map(l.before(i)),s)}return t&&t(n.scrollIntoView()),!0})),"Mod-Enter":C,Backspace:L,"Mod-Backspace":L,"Shift-Backspace":L,Delete:$,"Mod-Delete":$,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new o.i5(e.doc))),!0)},j={"Ctrl-h":F.Backspace,"Alt-Backspace":F["Mod-Backspace"],"Ctrl-d":F.Delete,"Ctrl-Alt-Backspace":F["Mod-Delete"],"Alt-Delete":F["Mod-Delete"],"Alt-d":F["Mod-Delete"],"Ctrl-a":D,"Ctrl-e":I};for(let e in F)j[e]=F[e];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform()},27629(e,t,n){"use strict";n.d(t,{D6:()=>y,ET:()=>b,Kk:()=>l,L$:()=>m,LZ:()=>g,M8:()=>a,T4:()=>d,Xq:()=>f,ad:()=>s,f7:()=>w,q4:()=>u,s5:()=>v,sC:()=>h,u9:()=>p});var r=n(40367),i=n(82919);const o=e=>Boolean(e?.legacy),s=(e,t)=>{r.A.set(e,t)},l=e=>{r.A.delete(e)},a=e=>{const t=r.A.get(e);return o(t)?null:t},c=e=>r.A.get(e),h=e=>{const t=c(e);if(o(t))return t.text;const n=t?.state?.doc;return n?i.du.serialize(n):""},d=e=>Boolean(c(e)),u=e=>{const t=c(e);return o(t)?t.text:t?.getText()??""},p=e=>{const t=a(e);t?.commands?.focus()},f=e=>{const t=a(e);t?.commands?.clearContent(!1),t?.commands?.updateSavedContent()},m=e=>{const t=a(e),n=t?.storage?.originalState?.savedContent;n&&t.commands?.setContent(n.toJSON(),{emitUpdate:!1})},g=e=>{const t=a(e);t?.commands?.updateSavedContent()},y=e=>{const t=a(e);t?.commands?.clearSessionStorage()},w=e=>{const t=a(e);return t?.storage?.characterCount?.characters()},b=e=>{const t=a(e);t?.commands?.clearError()},v=e=>{const t=a(e);return t?.storage?.originalState?.hasUnsavedChanges}},28598(e,t,n){"use strict";n.d(t,{I6:()=>He,ZV:()=>Ue,cL:()=>Ke,qw:()=>We});const r="numeric",i="ascii",o="alpha",s="asciinumeric",l="alphanumeric",a="domain",c="emoji",h="scheme",d="slashscheme",u="whitespace";function p(e,t){return e in t||(t[e]=[]),t[e]}function f(e,t,n){t[r]&&(t[s]=!0,t[l]=!0),t[i]&&(t[s]=!0,t[o]=!0),t[s]&&(t[l]=!0),t[o]&&
vendor: 10,558 bytes, line 2
2(t[l]=!0),t[l]&&(t[a]=!0),t[c]&&(t[a]=!0);for(const r in t){const t=p(r,n);t.indexOf(e)<0&&t.push(e)}}function m(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}m.groups={},m.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){const r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){let i;return r=r||m.groups,t&&t.j?i=t:(i=new m(t),n&&r&&f(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this;const o=e.length;if(!o)return i;for(let t=0;t<o-1;t++)i=i.tt(e[t]);return i.tt(e[o-1],t,n,r)},tt(e,t,n,r){r=r||m.groups;const i=this;if(t&&t.j)return i.j[e]=t,t;const o=t;let s,l=i.go(e);if(l?(s=new m,Object.assign(s.j,l.j),s.jr.push.apply(s.jr,l.jr),s.jd=l.jd,s.t=l.t):s=new m,o){if(r)if(s.t&&"string"==typeof s.t){const e=Object.assign(function(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}(s.t,r),n);f(o,e,r)}else n&&f(o,n,r);s.t=o}return i.j[e]=s,s}};const g=(e,t,n,r,i)=>e.ta(t,n,r,i),y=(e,t,n,r,i)=>e.tr(t,n,r,i),w=(e,t,n,r,i)=>e.ts(t,n,r,i),b=(e,t,n,r,i)=>e.tt(t,n,r,i),v="WORD",k="UWORD",x="ASCIINUMERICAL",S="ALPHANUMERICAL",C="LOCALHOST",O="TLD",N="UTLD",M="SCHEME",E="SLASH_SCHEME",T="NUM",A="WS",D="NL",I="OPENBRACE",R="CLOSEBRACE",z="OPENBRACKET",P="CLOSEBRACKET",L="OPENPAREN",$="CLOSEPAREN",F="OPENANGLEBRACKET",j="CLOSEANGLEBRACKET",B="FULLWIDTHLEFTPAREN",V="FULLWIDTHRIGHTPAREN",_="LEFTCORNERBRACKET",J="RIGHTCORNERBRACKET",q="LEFTWHITECORNERBRACKET",K="RIGHTWHITECORNERBRACKET",U="FULLWIDTHLESSTHAN",W="FULLWIDTHGREATERTHAN",H="AMPERSAND",G="APOSTROPHE",Y="ASTERISK",X="AT",Z="BACKSLASH",Q="BACKTICK",ee="CARET",te="COLON",ne="COMMA",re="DOLLAR",ie="DOT",oe="EQUALS",se="EXCLAMATION",le="HYPHEN",ae="PERCENT",ce="PIPE",he="PLUS",de="POUND",ue="QUERY",pe="QUOTE",fe="FULLWIDTHMIDDLEDOT",me="SEMI",ge="SLASH",ye="TILDE",we="UNDERSCORE",be="EMOJI",ve="SYM";var ke=Object.freeze({__proto__:null,ALPHANUMERICAL:S,AMPERSAND:H,APOSTROPHE:G,ASCIINUMERICAL:x,ASTERISK:Y,AT:X,BACKSLASH:Z,BACKTICK:Q,CARET:ee,CLOSEANGLEBRACKET:j,CLOSEBRACE:R,CLOSEBRACKET:P,CLOSEPAREN:$,COLON:te,COMMA:ne,DOLLAR:re,DOT:ie,EMOJI:be,EQUALS:oe,EXCLAMATION:se,FULLWIDTHGREATERTHAN:W,FULLWIDTHLEFTPAREN:B,FULLWIDTHLESSTHAN:U,FULLWIDTHMIDDLEDOT:fe,FULLWIDTHRIGHTPAREN:V,HYPHEN:le,LEFTCORNERBRACKET:_,LEFTWHITECORNERBRACKET:q,LOCALHOST:C,NL:D,NUM:T,OPENANGLEBRACKET:F,OPENBRACE:I,OPENBRACKET:z,OPENPAREN:L,PERCENT:ae,PIPE:ce,PLUS:he,POUND:de,QUERY:ue,QUOTE:pe,RIGHTCORNERBRACKET:J,RIGHTWHITECORNERBRACKET:K,SCHEME:M,SEMI:me,SLASH:ge,SLASH_SCHEME:E,SYM:ve,TILDE:ye,TLD:O,UNDERSCORE:we,UTLD:N,UWORD:k,WORD:v,WS:A});const xe=/[a-z]/,Se=/\p{L}/u,Ce=/\p{Emoji}/u,Oe=/\d/,Ne=/\s/;let Me=null,Ee=null;function Te(e,t){const n=function(e){const t=[],n=e.length;let r=0;for(;r<n;){let i,o=e.charCodeAt(r),s=o<55296||o>56319||r+1===n||(i=e.charCodeAt(r+1))<56320||i>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,(e=>e.toLowerCase()))),r=n.length,i=[];let o=0,s=0;for(;s<r;){let l=e,a=null,c=0,h=null,d=-1,u=-1;for(;s<r&&(a=l.go(n[s]));)l=a,l.accepts()?(d=0,u=0,h=l):d>=0&&(d+=n[s].length,u++),c+=n[s].length,o+=n[s].length,s++;o-=d,s-=u,c-=d,i.push({t:h.t,v:t.slice(o-c,o),s:o-c,e:o})}return i}function Ae(e,t,n,r,i){let o;const s=t.length;for(let n=0;n<s-1;n++){const s=t[n];e.j[s]?o=e.j[s]:(o=new m(r),o.jr=i.slice(),e.j[s]=o),e=o}return o=new m(n),o.jr=i.slice(),e.j[t[s-1]]=o,o}function De(e){const t=[],n=[];let r=0;for(;r<e.length;){let i=0;for(;"0123456789".indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(""));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}const Ie={defaultProtocol:"http",events:null,format:ze,formatHref:ze,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Re(e,t=null){let n=Object.assign({},Ie);e&&(n=Object.assign(n,e instanceof Re?e.o:e));const r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}function ze(e){return e}function Pe(e,t){this.t="token",this.v=e,this.tk=t}function Le(e,t){class n extends Pe{constructor(t,n){super(t,n),this.t=e}}for(const e in t)n.prototype[e]=t[e];return n.t=e,n}Re.prototype={o:Ie,ignoreTags:[],defaultRender:e=>e,check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=null!=t;let i=this.o[e];return i?("object"==typeof i?(i=n.t in i?i[n.t]:Ie[e],"function"==typeof i&&r&&(i=i(t,n))):"function"==typeof i&&r&&(i=i(t,n.t,n)),i):i},getObj(e,t,n){let r=this.o[e];return"function"==typeof r&&null!=t&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}},Pe.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"â¦":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Ie.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),i=e.get("tagName",n,t),o=this.toFormattedString(e),s={},l=e.get("className",n,t),a=e.get("target",n,t),c=e.get("rel",n,t),h=e.getObj("attributes",n,t),d=e.getObj("events",n,t);return s.href=r,l&&(s.class=l),a&&(s.target=a),c&&(s.rel=c),h&&Object.assign(s,h),{tagName:i,attributes:s,content:o,eventListeners:d}}};const $e=Le("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Fe=Le("text"),je=Le("nl"),Be=Le("url",{isLink:!0,toHref(e=Ie.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==C&&e[1].t===te}}),Ve=e=>new m(e);function _e(e,t,n){const r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}const Je="undefined"!=typeof console&&console&&console.warn||(()=>{}),qe={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Ke(){return m.groups={},qe.scanner=null,qe.parser=null,qe.tokenQueue=[],qe.pluginQueue=[],qe.customSchemes=[],qe.initialized=!1,qe}function Ue(e,t=!1){if(qe.initialized&&Je(`linkifyjs: already initialized - will not register custom scheme "${e}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))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');qe.customSchemes.push([e,t])}function We(e){return qe.initialized||function(){qe.scanner=function(e=[]){const t={};m.groups=t;const n=new m;null==Me&&(Me=De("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2
2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==Ee&&(Ee=De("ελ1Ï
2бг1ел3деÑи4еÑ2каÑолик6ом3мÐ
2ºÐ´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")),b(n,"'",G),b(n,"{",I),b(n,"}",R),b(n,"[",z),b(n,"]",P),b(n,"(",L),b(n,")",$),b(n,"<",F),b(n,">",j),b(n,"ï¼",B),b(n,"ï¼",V),b(n,"ã",_),b(n,"ã",J),b(n,"ã",q),b(n,"ã",K),b(n,"ï¼",U),b(n,"ï¼",W),b(n,"&",H),b(n,"*",Y),b(n,"@",X),b(n,"`",Q),b(n,"^",ee),b(n,":",te),b(n,",",ne),b(n,"$",re),b(n,".",ie),b(n,"=",oe),b(n,"!",se),b(n,"-",le),b(n,"%",ae),b(n,"|",ce),b(n,"+",he),b(n,"#",de),b(n,"?",ue),b(n,'"',pe),b(n,"/",ge),b(n,";",me),b(n,"~",ye),b(n,"_",we),b(n,"\\",Z),b(n,"ã»",fe);const p=y(n,Oe,T,{[r]:!0});y(p,Oe,p);const g=y(p,xe,x,{[s]:!0}),Te=y(p,Se,S,{[l]:!0}),Ie=y(n,xe,v,{[i]:!0});y(Ie,Oe,g),y(Ie,xe,Ie),y(g,Oe,g),y(g,xe,g);const Re=y(n,Se,k,{[o]:!0});y(Re,xe),y(Re,Oe,Te),y(Re,Se,Re),y(Te,Oe,Te),y(Te,xe),y(Te,Se,Te);const ze=b(n,"\n",D,{[u]:!0}),Pe=b(n,"\r",A,{[u]:!0}),Le=y(n,Ne,A,{[u]:!0});b(n,"",Le),b(Pe,"\n",ze),b(Pe,"",Le),y(Pe,Ne,Le),b(Le,"\r"),b(Le,"\n"),y(Le,Ne,Le),b(Le,"",Le);const $e=y(n,Ce,be,{[c]:!0});b($e,"#"),y($e,Ce,$e),b($e,"ï¸",$e);const Fe=b($e,"â");b(Fe,"#"),y(Fe,Ce,$e);const je=[[xe,Ie],[Oe,g]],Be=[[xe,null],[Se,Re],[Oe,Te]];for(let e=0;e<Me.length;e++)Ae(n,Me[e],O,v,je);for(let e=0;e<Ee.length;e++)Ae(n,Ee[e],N,k,Be);f(O,{tld:!0,ascii:!0},t),f(N,{utld:!0,alpha:!0},t),Ae(n,"file",M,v,je),Ae(n,"mailto",M,v,je),Ae(n,"http",E,v,je),Ae(n,"https",E,v,je),Ae(n,"ftp",E,v,je),Ae(n,"ftps",E,v,je),f(M,{scheme:!0,ascii:!0},t),f(E,{slashscheme:!0,ascii:!0},t),e=e.sort(((e,t)=>e[0]>t[0]?1:-1));for(let t=0;t<e.length;t++){const o=e[t][0],l=e[t][1]?{[h]:!0}:{[d]:!0};o.indexOf("-")>=0?l[a]=!0:xe.test(o)?Oe.test(o)?l[s]=!0:l[i]=!0:l[r]=!0,w(n,o,o,l)}return w(n,"localhost",C,{ascii:!0}),n.jd=new m(ve),{start:n,tokens:Object.assign({groups:t},ke)}}(qe.customSchemes);for(let e=0;e<qe.tokenQueue.length;e++)qe.tokenQueue[e][1]({scanner:qe.scanner});qe.parser=function({groups:e}){const t=e.domain.concat([H,Y,X,Z,Q,ee,re,oe,le,T,ae,ce,he,de,ge,ve,ye,we]),n=[G,te,ne,ie,se,ae,ue,pe,me,F,j,I,R,P,z,L,$,B,V,_,J,q,K,U,W],r=[H,G,Y,Z,Q,ee,re,oe,le,I,R,ae,ce,he,de,ue,ge,ve,ye,we],i=Ve(),o=b(i,ye);g(o,r,o),g(o,e.domain,o);const s=Ve(),l=Ve(),a=Ve();g(i,e.domain,s),g(i,e.scheme,l),g(i,e.slashscheme,a),g(s,r,o),g(s,e.domain,s);const c=b(s,X);b(o,X,c),b(l,X,c),b(a,X,c);const h=b(o,ie);g(h,r,o),g(h,e.domain,o);const d=Ve();g(c,e.domain,d),g(d,e.domain,d);const u=b(d,ie);g(u,e.domain,d);const p=Ve($e);g(u,e.tld,p),g(u,e.utld,p),b(c,C,p);const f=b(d,le);b(f,le,f),g(f,e.domain,d),g(p,e.domain,d),b(p,ie,u),b(p,le,f);const m=b(s,le),y=b(s,ie);b(m,le,m),g(m,e.domain,s),g(y,r,o),g(y,e.domain,s);const w=Ve(Be);g(y,e.tld,w),g(y,e.utld,w),g(w,e.domain,s),g(w,r,o),b(w,ie,y),b(w,le,m),b(w,X,c);const v=b(w,te),k=Ve(Be);g(v,e.numeric,k);const x=Ve(Be),S=Ve();g(x,t,x),g(x,n,S),g(S,t,x),g(S,n,S),b(w,ge,x),b(k,ge,x);const O=b(l,te),N=b(a,te),M=b(N,ge),E=b(M,ge);g(l,e.domain,s),b(l,ie,y),b(l,le,m),g(a,e.domain,s),b(a,ie,y),b(a,le,m),g(O,e.domain,x),b(O,ge,x),b(O,ue,x),g(E,e.domain,x),g(E,t,x),b(E,ge,x);const A=[[I,R],[z,P],[L,$],[F,j],[B,V],[_,J],[q,K],[U,W]];for(let e=0;e<A.length;e++){const[r,i]=A[e],o=b(x,r);b(S,r,o);const s=Ve(Be);g(o,t,s);const l=Ve();g(o,n,l),b(o,i,x),g(s,t,s),g(s,n,l),g(l,t,s),g(l,n,l),b(s,i,x),b(l,i,x)}return b(i,C,w),b(i,D,je),{start:i,tokens:ke}}(qe.scanner.tokens);for(let e=0;e<qe.pluginQueue.length;e++)qe.pluginQueue[e][1]({scanner:qe.scanner,parser:qe.parser});qe.initialized=!0}(),function(e,t,n){let r=n.length,i=0,o=[],s=[];for(;i<r;){let l=e,a=null,c=null,h=0,d=null,u=-1;for(;i<r&&!(a=l.go(n[i].t));)s.push(n[i++]);for(;i<r&&(c=a||l.go(n[i].t));)a=null,l=c,l.accepts()?(u=0,d=l):u>=0&&u++,i++,h++;if(u<0)i-=h,i<r&&(s.push(n[i]),i++);else{s.length>0&&(o.push(_e(Fe,t,s)),s=[]),i-=u,h-=u;const e=d.t,r=n.slice(i-h,i);o.push(_e(e,t,r))}}return s.length>0&&o.push(_e(Fe,t,s)),o}(qe.parser.start,e,Te(qe.scanner.start,e))}function He(e,t=null,n=null){if(t&&"object"==typeof t){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new Re(n),i=We(e),o=[];for(let e=0;e<i.length;e++){const n=i[e];!n.isLink||t&&n.t!==t||!r.check(n)||o.push(n.toFormattedObject(r))}return o}We.scan=Te},30628(e,t,n){"use strict";n.d(t,{Z:()=>o});var r=n(44465),i=n(95366);const o=e=>new Promise((t=>{const n=new r.t({customAttach:(e,n)=>{e&&t(e),n(null,!0)},accepts:e});i.g.browse(n)}))},33083(e,t,n){"use strict";n.d(t,{A:()=>
2o});var r=n(3554),i=n(83279);function o(e={}){return new r.k_({view:t=>new s(t,e)})}class s{destroy(){this.handlers.forEach((({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t)))}update(e,t){if(null!=this.cursorPos&&t.doc!=e.state.doc)if(this.lastDragEvent){let e=this.computeTarget(this.lastDragEvent);e==this.cursorPos?this.updateOverlay():this.setCursor(e)}else this.updateOverlay()}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r=this.editorView.dom,i=r.getBoundingClientRect(),o=i.width/r.offsetWidth,s=i.height/r.offsetHeight;if(n){let n=t.nodeBefore,r=t.nodeAfter;if(n||r){let t=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(t){let i=t.getBoundingClientRect(),o=n?i.bottom:i.top;n&&r&&(o=(o+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let l=this.width/2*s;e={left:i.left,right:i.right,top:o-l,bottom:o+l}}}}if(!e){let t=this.editorView.coordsAtPos(this.cursorPos),n=this.width/2*o;e={left:t.left-n,right:t.left+n,top:t.top,bottom:t.bottom}}let l,a,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)l=-pageXOffset,a=-pageYOffset;else{let e=c.getBoundingClientRect(),t=e.width/c.offsetWidth,n=e.height/c.offsetHeight;l=e.left-c.scrollLeft*t,a=e.top-c.scrollTop*n}this.element.style.left=(e.left-l)/o+"px",this.element.style.top=(e.top-a)/s+"px",this.element.style.width=(e.right-e.left)/o+"px",this.element.style.height=(e.bottom-e.top)/s+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout((()=>this.setCursor(null)),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,t,e):r;if(!t||o)return null;let s=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=(0,i.Um)(this.editorView.state.doc,s,this.editorView.dragging.slice);null!=e&&(s=e)}return s}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);null!=t&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=null!==(n=t.width)&&void 0!==n?n:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map((t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}}))}}},38852(e,t,n){"use strict";n.d(t,{X:()=>s});var r=n(52276),i=n(88724),o=n(3554);const s=i.NG.extend({name:"table",content:"inline*",marks:"_",addInputRules(){return[(e={find:/^{table$/,type:this.t
2ype},new r.fV({find:e.find,handler:({state:t,range:n,match:i})=>{const s=(0,r.gk)(e.getAttributes,void 0,i)||{},{tr:l,schema:a}=t,c=n.from,h=n.to;i[0]&&(l.replaceWith(c-1,h,e.type.create(s,a.text("{table"))),l.setSelection(o.U3.near(l.doc.resolve(c+6))))}}))];var e},addCommands(){return{setTable:e=>({commands:t})=>t.setNode(this.name,e),toggleTable:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&!(!n&&t.parent.textContent.length)&&this.editor.commands.clearNodes()},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!(!o||!s)&&e.chain().command((({tr:e})=>(e.delete(r.pos-2,r.pos),!0))).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type)return!1;if(i.parentOffset!==i.parent.nodeSize-2)return!1;const s=i.after();return void 0!==s&&(!r.nodeAt(s)&&e.commands.exitCode())}}}})},40276(e,t,n){var r=n(40330),i=n(84598),o=n(53778),s=n(95222),l=n(63170),a=n(42118);e.exports=function(e,t,n){var c=-1,h=i,d=e.length,u=!0,p=[],f=p;if(n)u=!1,h=o;else if(d>=200){var m=t?null:l(e);if(m)return a(m);u=!1,h=s,f=new r}else f=t?[]:p;e:for(;++c<d;){var g=e[c],y=t?t(g):g;if(g=n||0!==g?g:0,u&&y==y){for(var w=f.length;w--;)if(f[w]===y)continue e;t&&f.push(y),p.push(g)}else h(f,y,n)||(f!==p&&f.push(y),p.push(g))}return p}},40367(e,t,n){"use strict";n.d(t,{A:()=>o});const r={},i={get:e=>r[e],set:(e,t)=>(r[e]=t,t),getOrCreate:(e,t)=>i.get(e)?i.get(e):i.set(e,t()),delete:e=>{delete r[e]}},o=i},44465(e,t,n){"use strict";n.d(t,{t:()=>i});var r=n(4079);const i=new Class({name:"MinimalMediaTarget",Implements:[Events],options:{},initialize:function(e){if(Object.append(this.options,e),!this.options.accepts)throw new r.Uj("Must provide an 'accepts' option")},attachItem:function(e,t){let n=this;function r(r,i,o){i&&n.fireEvent("itemChanged",[e]),t&&t.apply(n,Array.convert(arguments))}if(!e.isReady())return void r(null,!1,"Can't be placed until processing is finished");if(!1===e.data.filter_state())return void r(null,!1,"Can't place media of this type.");let i=this.options.customAttach;i?i(e,r):r(null,!0)},getMediaFilterName:function(){return this.options.accepts},isBrowseOnly:function(){return!!this.options.browseOnly}})},48881(e,t,n){"use strict";n.d(t,{m:()=>l});var r=n(82306),i=n(95366),o=n(18891),s=n(76051);const l=new Class({Implements:[Options,Events],options:{getErrorMessage:function(){return(0,r.N)("Can't place this item here.")}},element:null,mediaid:null,_isDirty:!1,initialize:function(e,t){this.element=$(e);let n=this,r=this.options;r.accepts=e.get("data-accepts"),r.displaySize=e.get("data-displaySize"),r.formField=$(e.get("data-formField")),r.menuHide=e.get("data-menuHide"),Object.append(r,t),e.contains(r.formField)&&(this._formFieldIsInside=!0),e.store("mediaTarget",this),this._content=e.getElement(".carpenter-contents");let i=this._updateFormField.bind(this);this._mediaItemEventHandlers={dataChanged:i,deleted:function(){n.attachItem(null)}},this.addEvent("itemChanged",i),e.addClass("mediaTarget");let o=e.get("data-itemData");if(o){let e=s.MediaItem.createFromData(JSON.parse(o));this._immediatelyAttach(e),this._isDirty=!1}else this._displayItem();this._onclick=function(){this.hasClass("js-no-browse")||n.fireEvent("browse")},this._enableUI()},_enableUI:function(){this.element.removeEvents("click"),this.element.addEvent("click",this._onclick),this.element.removeClass("disabled"),this._disabledOverlay&&this._disabledOverlay.dispose();let e=this.element.getElement(".alterTarget");e&&e.removeClass("disabled")},enable:function(){this._enableUI()},_disableUI:function(){this.element.removeEvents("click"),this.element.addClass("disabled"),this._disabledOverlay=this._disabledOverlay||new Element("div.disabledOverlay"),this.element.grab(this._disabledOverlay),when(this.element.getElement(".alterTarget"),(e=>{e.addClass("disabled")}))},disable:function(){this._disableUI()},getErrorMessage:function(e){return this.options.getErrorMessage(e)},clear:function(){this._displayItem(null)},_displayItem:function(e){let t=this;if(!e){t._empty();let e=new Element("div.carpenter-contents"),n=this.options.displaySize,r=t.options.iconClass||"addImage";return e.addClass(n),e.grab(l.createModifyableIndicator(r,n)),void t.element.grab(e)}t._displayLoading(!0),e.createRepresentationFor(t,(e=>{t._itemDisplay=e;let n=e.getElement();
2n.addClass("carpenter-contents"),t._content=n,t._empty(),n.grab(l.createModifyableIndicator("replaceImage",t.options.displaySize)),t.element.grab(n),t._displayLoading(!1)}))},_empty:function(){this.element.empty(),this._formFieldIsInside&&this.element.grab(this.options.formField)},_displayLoading:function(e){let t=this.element,n=this;if(e){t.pinDimensions(),this.element.toggleClass("mediaItemProcessing",e);let n=this._overlay();this.element.grab(n)}else{const r=function(){n._overlay().dispose(),t.unpinDimensions(),n.element.toggleClass("mediaItemProcessing",e)};let i=this._itemDisplay;i&&i.whenReady?i.whenReady(r):r()}},_overlay:function(){return this._overlayEl=this._overlayEl||new Element("div.loadingOverlay"),this._overlayEl},_updateFormField:function(){if(this.options.formField){let e=this.mediaItem?this.mediaItem.getID():"";this.options.formField.set("value",e),this.options.formField.fireEvent("input"),this.fireEvent("fieldUpdated")}},attachItem:function(e,t){t=t||function(){};let n=this.options.customAttach;if(n)Reflect.apply(n,this,[e,t]);else{if(e&&!1===e.data.filter_state())return t(e,!1,this.getErrorMessage(e));let n=this._immediatelyAttach(e);t&&t(n,!0)}},_immediatelyAttach:function(e){let t=this._setItem(e);return this._isDirty=!0,this._displayItem(e),t},getFormField:function(){return this.options.formField},isDirty:function(){return this._isDirty},getMenuItems:function(e){let t={detach:o.Auth.isLoggedIn()};return this.options.menuHide.split(" ").each((e=>{t[e]=!1})),t},getMediaFilterName:function(){return this.options.accepts},_setItem:function(e){let t=null;return this.mediaItem&&(this.mediaItem.removeEvents(this._mediaItemEventHandlers),this.mediaItem.setContext(),t=this.mediaItem),e&&(e.addEvents(this._mediaItemEventHandlers),e.setContext(this)),this.mediaItem=e,this.fireEvent("itemChanged",[e,t]),t},destroy:function(){this.element.destroy()},getMediaItem:function(){return this.mediaItem}});Object.append(l,{registerAllTargets:function(){return $$(".mediaTarget").filter((e=>!e.hasClass("customSetup"))).map((e=>l.createFromElement(e)))},createFromElement:function(e,t){let n=new l(e,t);return n.addEvent("browse",l._initiateBrowsing),n},createModifyableIndicator:function(e,t){let n=new Element("div",{class:"alterTarget "+t+" "+e}),r=new Element("div.icon");return n.grab(r),n},_initiateBrowsing:function(){i.g.browse(this)}})},51653(e,t,n){var r=n(65294);e.exports=function(e){return r(e)?void 0:e}},57643(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(82306),i=n(7045),o=n(68198);const s=new Class({Implements:[Options,Events],options:{tooltip:{zIndex:1000100}},initialize:function(){this.sides={},this.items={},this.isOpen=!1,this.menuItems=new Events,this.menu=new Element("div.mediaItemMenu",{events:{mousedown:function(e){e.stop()}}}).adopt(this.sides.left=new Element("ul.left"),this.sides.right=new Element("ul.right"),this.sides.bottom=new Element("div.bottom.clearer")),this.addMenuItems()},addMenuItems:function(){let e={fullsize:{side:"left",text:(0,r.N)("Full Size"),icon:"iconFullsize"},deleted:{side:"right",text:(0,r.N)("Delete"),icon:"iconDelete"},copy:{side:"right",text:(0,r.N)("Copy"),icon:"iconCopy",hoverText:(0,r.N)("Copy to Media Manager")}};(0,i.t)()||(0,i.d)()||(e.markers={side:"left",text:(0,r.N)("Markers..."),icon:"iconMarkers"},e.crop={side:"left",text:(0,r.N)("Crop..."),icon:"iconCrop"}),Object.each(e,(function(e,t){this.addItem(t,e)}),this)},addItem:function(e,t){let n,r=this,i=new Element("li",{events:{mouseenter:this.hoverItem.bind(this,e),mouseleave:this.blurItem.bind(this,e),click:function(n){n.stop(),this.hasClass("inactive")||(r.menuItems.fireEvent(e,[r.mediaItem]),t.onSelect&&t.onSelect(),r._close())}}}).adopt(new Element("div.icon."+t.icon),n=new Element("a",{text:t.text,events:{click:function(e){e.preventDefault()}}}));return t.hoverText&&(i.tooltip=(0,o.default)(i,{content:t.hoverText,delay:0,placement:"bottom",zIndex:this.options.tooltip.zIndex+1})),i.inject(this.sides[t.side]),i.store("link",n),this.items[e]=i,this},disableItem:function(e){return this.items[e].addClass("inactive"),this},enableItem:function(e){return this.items[e].removeClass("inactive"),this},toggleForMediaItem:function(e,t){if(this.tooltip&&this.tooltip.state.isVisible&&e==this.mediaItem)this._close();else{this.tooltip&&this.tooltip.state.isVisible&&this.tooltip.hide(),this.mediaItem=e;let n=e.collectMenuOptions();Object.each(this.items,((e,t)=>{let r=n[t],i="string"==typeOf(r),o=e.retrieve("link");e.toggle(r),e.toggleClass("inactive",i),o.set("title",i?r:"")})),this._openAtAnchor(t)}},_close:function(){return this.tooltip.destroy(),this},_openAtAnchor:function(e){return e?(this.tooltip&&this.tooltip.destroy(),this.tooltip=(0,o.default)(e,{zIndex:this.options.tooltip.zIndex,appendTo:document.body,interactive:!0,allowHTML:!0,theme:"globalTippyStyles light",trigger:"manual",content:this.menu}),this.tooltip.show()):this.tooltip.setContent(this.menu).show(),this},_hideItem:function(e){return this.items[e].hide(),this},_showItem:function(e){return this.items[e].show(),this},hoverItem:function(e){let t=this.items[e];t.hasClass("inactive")||t.addClass("active")},blurItem:function(e){this.items[e].removeClass("active")},selectItem:function(e,t){this.items[e].hasClass("inactive")||!1!==t()&&this.close()}})},58e3(e,t,n){"use strict";e.exports=n(6208)},63170(e,t,n){var r=n(56970),i=n(48469),o=n(42118),s=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i;e.exports=s},63844(e,t,n){var r=n(76313),i=n(61816),o=n(47640),s=n(91912),l=n(27554),a=n(51653),c=n(68117),h=n(10052),d=c((function(e,t){var n={};if(null==e)return n;var c=!1;t=r(t,(function(t){return t=s(t,e),c||(c=t.length>1),t})),l(e,h(e),n),c&&(n=i(n,7,a));for(var d=t.length;d--;)o(n,t[d]);return n}));e.exports=d},65902(e,t,n){"use strict";n.d(t,{C$:()=>a,CJ:()=>c,L7:()=>u});var r=n(50061),i=n(52276),o=n(77780),s=n(82306),l=n(78967);
2const a=["note","tip","important","warning","caution"],c={note:(0,s.N)("Note"),tip:(0,s.N)("Tip"),important:(0,s.N)("Important"),warning:(0,s.N)("Warning"),caution:(0,s.N)("Caution")},h={note:"circle-info",tip:"lightbulb",important:"message-exclamation",warning:"message-exclamation",caution:"octagon-exclamation"};function d(e){const t="string"==typeof e?e.trim():"";return a.includes(t)?t:"note"}const u=i.bP.create({name:"note",content:"block*",group:"block",renderHTML:({HTMLAttributes:e})=>["div",(0,i.KV)(e,{class:"wiki-note"}),0],addNodeView:()=>(0,o.gu3)(p),addAttributes:()=>({type:{default:null,renderHTML:e=>({"data-note-type":d(e.type)})}}),addCommands(){return{toggleNote:e=>({chain:t})=>t().toggleWrap(this.name).updateAttributes(this.name,{type:e}).run(),setNoteType:e=>({chain:t})=>t().updateAttributes(this.name,{type:e}).run()}}}),p=e=>{const t=d(e.node.attrs.type);return(0,r.jsx)(o.VRb,{children:(0,r.jsxs)("div",{className:"wiki-note","data-note-type":t,children:[(0,r.jsxs)("div",{className:"wiki-note-label",contentEditable:!1,children:[(0,r.jsx)(l.hw,{name:h[t],family:"duotone",className:"size-4"}),c[t]]}),(0,r.jsx)(o.$p7,{className:"wiki-note-body"})]})})}},67672(e,t,n){"use strict";n.d(t,{g:()=>b});var r=n(31819),i=n(79322),o=n.n(i),s=n(97145);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p(e){return t=e,(t-=0)==t?e:(e=e.replace(/[\-_\s]+(.)?/g,(function(e,t){return t?t.toUpperCase():""}))).substr(0,1).toLowerCase()+e.substr(1);var t}var f=["style"],m=!1;try{m=!0}catch(e){}function g(e){return e&&"object"===c(e)&&e.prefix&&e.iconName&&e.icon?e:r.qg.icon?r.qg.icon(e):null===e?null:e&&"object"===c(e)&&e.prefix&&e.iconName?e:Array.isArray(e)&&2===e.length?{prefix:e[0],iconName:e[1]}:"string"==typeof e?{prefix:"fas",iconName:e}:void 0}function y(e,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?h({},e,t):{}}var w={border:!1,className:"",mask:null,maskId:null,fixedWidth:!1,inverse:!1,flip:!1,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:"",titleId:null,transform:null,swapOpacity:!1},b=s.forwardRef((function(e,t){var n=a(a({},w),e),i=n.icon,o=n.mask,s=n.symbol,l=n.className,c=n.title,u=n.titleId,p=n.maskId,f=g(i),b=y("classes",[].concat(d(function(e){var t,n=e.beat,r=e.fade,i=e.beatFade,o=e.bounce,s=e.shake,l=e.flash,a=e.spin,c=e.spinPulse,d=e.spinReverse,u=e.pulse,p=e.fixedWidth,f=e.inverse,m=e.border,g=e.listItem,y=e.flip,w=e.size,b=e.rotation,v=e.pull,k=(h(t={"fa-beat":n,"fa-fade":r,"fa-beat-fade":i,"fa-bounce":o,"fa-shake":s,"fa-flash":l,"fa-spin":a,"fa-spin-reverse":d,"fa-spin-pulse":c,"fa-pulse":u,"fa-fw":p,"fa-inverse":f,"fa-border":m,"fa-li":g,"fa-flip":!0===y,"fa-flip-horizontal":"horizontal"===y||"both"===y,"fa-flip-vert
2ical":"vertical"===y||"both"===y},"fa-".concat(w),null!=w),h(t,"fa-rotate-".concat(b),null!=b&&0!==b),h(t,"fa-pull-".concat(v),null!=v),h(t,"fa-swap-opacity",e.swapOpacity),t);return Object.keys(k).map((function(e){return k[e]?e:null})).filter((function(e){return e}))}(n)),d((l||"").split(" ")))),k=y("transform","string"==typeof n.transform?r.qg.transform(n.transform):n.transform),x=y("mask",g(o)),S=(0,r.Kk)(f,a(a(a(a({},b),k),x),{},{symbol:s,title:c,titleId:u,maskId:p}));if(!S)return function(){var e;!m&&console&&"function"==typeof console.error&&(e=console).error.apply(e,arguments)}("Could not find icon",f),null;var C=S.abstract,O={ref:t};return Object.keys(n).forEach((function(e){w.hasOwnProperty(e)||(O[e]=n[e])})),v(C[0],O)}));b.displayName="FontAwesomeIcon",b.propTypes={beat:o().bool,border:o().bool,beatFade:o().bool,bounce:o().bool,className:o().string,fade:o().bool,flash:o().bool,mask:o().oneOfType([o().object,o().array,o().string]),maskId:o().string,fixedWidth:o().bool,inverse:o().bool,flip:o().oneOf([!0,!1,"horizontal","vertical","both"]),icon:o().oneOfType([o().object,o().array,o().string]),listItem:o().bool,pull:o().oneOf(["right","left"]),pulse:o().bool,rotation:o().oneOf([0,90,180,270]),shake:o().bool,size:o().oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:o().bool,spinPulse:o().bool,spinReverse:o().bool,symbol:o().oneOfType([o().bool,o().string]),title:o().string,titleId:o().string,transform:o().oneOfType([o().string,o().object]),swapOpacity:o().bool};var v=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof n)return n;var i=(n.children||[]).map((function(n){return e(t,n)})),o=Object.keys(n.attributes||{}).reduce((function(e,t){var r=n.attributes[t];switch(t){case"class":e.attrs.className=r,delete n.attributes.class;break;case"style":e.attrs.style=r.split(";").map((function(e){return e.trim()})).filter((function(e){return e})).reduce((function(e,t){var n,r=t.indexOf(":"),i=p(t.slice(0,r)),o=t.slice(r+1).trim();return i.startsWith("webkit")?e[(n=i,n.charAt(0).toUpperCase()+n.slice(1))]=o:e[i]=o,e}),{});break;default:0===t.indexOf("aria-")||0===t.indexOf("data-")?e.attrs[t.toLowerCase()]=r:e.attrs[p(t)]=r}return e}),{attrs:{}}),s=r.style,l=void 0===s?{}:s,c=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(r,f);return o.attrs.style=a(a({},o.attrs.style),l),t.apply(void 0,[n.tag,a(a({},o.attrs),c)].concat(d(i)))}.bind(null,s.createElement)},75118(e,t,n){"use strict";e.exports=n(3643)},76142(e,t,n){"use strict";n.d(t,{f8:()=>a,nU:()=>c,wE:()=>l});var r=n(50061),i=n(2305),o=n(62852),s=n(83992);const l="button-ghost-icon";function a(e){0===e.button&&e.preventDefault()}function c({ref:e,shortcut:t,overrideShortcut:n,title:c,onClick:h,isDisabled:d,isActive:u,icon:p,className:f,"aria-label":m}){const g=Boolean(t||n),y=navigator.userAgent.indexOf("Mac")>0?"â":"ctrl+",w=g?`${c} (${n??`${y}${t}`})`:c,{editor:b}=(0,s.mi)(),v=(0,i.cn)(l,f);return d?(0,r.jsx)("button",{type:"button",ref:e,disabled:!0,"aria-label":m??c,"data-active":u?"true":void 0,className:v,children:p}):(0,r.jsxs)(o.m_,{children:[(0,r.jsx)(o.k$,{asChild:!0,children:(0,r.jsx)("button",{type:"button",ref:e,"aria-label":m??c,"data-active":u?"true":void 0,className:v,onPointerDown:a,onClick:e=>{e.preventDefault(),b.view.focus(),h()},children:p})}),(0,r.jsx)(o.ZI,{side:"top",align:"start",children:w})]})}},78098(e,t,n){"use strict";n.d(t,{K:()=>m,w:()=>f});for(var r={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:"'"},i={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},o="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),s="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),l=0;l<10;l++)r[48+l]=r[96+l]=String(l);for(l=1;l<=24;l++)r[l+111]="F"+l;for(l=65;l<=90;l++)r[l]=String.fromCharCode(l+32),i[l]=String.fromCharCode(l);for(var a in r)i.hasOwnProperty(a)||(i[a]=r[a]);var c=n(3554);const h="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),d="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function u(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let e=0;e<o.length-1;e++){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!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);h?i=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}
2function p(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function f(e){return new c.k_({props:{handleKeyDown:m(e)}})}function m(e){let t=function(e){let t=Object.create(null);for(let n in e)t[u(n)]=e[n];return t}(e);return function(e,n){let l,a=function(e){var t=!(o&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||s&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?i:r)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),c=t[p(a,n)];if(c&&c(e.state,e.dispatch,e))return!0;if(1==a.length&&" "!=a){if(n.shiftKey){let r=t[p(a,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(d&&n.ctrlKey&&n.altKey)&&(l=r[n.keyCode])&&l!=a){let r=t[p(l,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}},82900(e,t,n){"use strict";n.d(t,{AH:()=>h});var r=n(36251),i=n(20075),o=n(87236);function s(e,t){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0)}function l(e,t,n){var r=[],i=(0,o.Rk)(e,r,n);return r.length<2?n:i+t(r)}var a=function e(t){for(var n="",r=0;r<t.length;r++){var i=t[r];if(null!=i){var o=void 0;switch(typeof i){case"boolean":break;case"object":if(Array.isArray(i))o=e(i);else for(var s in o="",i)i[s]&&s&&(o&&(o+=" "),o+=s);break;default:o=i}o&&(n&&(n+=" "),n+=o)}}return n},c=function(e){var t=(0,r.A)({key:"css"});t.sheet.speedy=function(e){this.isSpeedy=e},t.compat=!0;var n=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var s=(0,i.J)(n,t.registered,void 0);return(0,o.sk)(t,s,!1),t.key+"-"+s.name};return{css:n,cx:function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return l(t.registered,n,a(r))},injectGlobal:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=(0,i.J)(n,t.registered);s(t,o)},keyframes:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=(0,i.J)(n,t.registered),l="animation-"+o.name;return s(t,{name:o.name,styles:"@keyframes "+l+"{"+o.styles+"}"}),l},hydrate:function(e){e.forEach((function(e){t.inserted[e]=!0}))},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:o.Rk.bind(null,t.registered),merge:l.bind(null,t.registered,n)}}(),h=(c.flush,c.hydrate,c.cx,c.merge,c.getRegisteredStyles,c.injectGlobal,c.keyframes,c.css);c.sheet,c.cache},82919(e,t,n){"use strict";n.d(t,{du:()=>s});var r=n(4079);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class o{getOut(){return this.out}getPrefix(){return this.prefix}getSchema(){return this.schema}append(e){this.out+=e}renderDoc(e){e.forEach((e=>this.render(e)))}render(e){const t=this.nodes[e.type.name];if(!t)throw new r.Uj("no function for "+e.type.name);t(this,e)}renderPrefix(e,t,n,r=""){const i=this.prefix,o=i.length+t.length;this.prefix=t.repeat(o)+r,n(),this.prefix=i}renderList(e,t){e.forEach((e=>{this.renderPrefix(e,t,(()=>{e.forEach((e=>this.render(e)))}))}))}renderRestartedList(e){const t=e.firstChild;t&&(this.renderPrefix(t,"#",(()=>{t.forEach((e=>this.render(e)))}),`${e.attrs.start}.`),e.forEach(((e,t,n)=>{0!==n&&this.renderPrefix(e,"#",(()=>{e.forEach((e=>this.render(e)))}))})))}inline(e){const t=new Map,n=new Map,r=[];e.forEach((e=>e.isText&&r.push(e))),r.reverse(),r.forEach((e=>{if(!e.marks.length)return t.forEach(((e,n)=>t.delete(n))),void n.set(e,new Map);const r=e.marks.map((e=>e.type.name));r.forEach((e=>{t.has(e)||t.set(e,0)})),t.forEach(((n,r)=>t.set(r,e.text?n+e.text.length:0)));const i=new Map;t.forEach(((e,n)=>{r.includes(n)?i.set(n,e):t.delete(n)})),n.set(e,i)})),e.forEach((e=>this.text(e,n))),this.end_inline()}end_inline(){this.closeMarks(this.currentlyOpenMarks),this.currentlyOpenMarks=[],this.spaces=""}text(e,t){const n=e.marks,i=this.currentlyOpenMarks.filter((e=>0===n.filter((t=>e.eq(t))).length)),o=function(e,t){const n=t.reduce(((t,n)=>Math.min(t,e.indexOf(n))),e.length);if(-1===n)throw new r.Uj("Don't use this function on `needles` that may not be in `haystack`");return n}(this.currentlyOpenMarks,i);this.closeMarks(this.currentlyOpenMarks.slice(o)),this.currentlyOpenMarks=this.currentlyOpenMarks.slice(0,o);const s=n.filter((e=>0===this.currentlyOpenMarks.filter((t=>e.eq(t))).length));if(t){const n=t.get(e);n&&s.sort(((e,t)=>
2n.get(t.type.name)-n.get(e.type.name)))}if(this.currentlyOpenMarks=this.currentlyOpenMarks.concat(s),e.isText&&e.text){const[,t,n,r]=e.text.match(/^(\s*)([^]*?)(\s*)$/)||[];this.out+=this.spaces,this.out+=t,this.openMarks(s),this.out+=n,this.spaces=r}else this.out+=this.spaces,this.spaces="",this.openMarks(s),this.render(e)}closeMarks(e){this.out+=e.reduceRight(((e,t)=>{const n=this.marks[t.type.name]?.close;if(!n)throw new r.Uj("mark not found: "+t.type.name);return e+("function"==typeof n?n(t):n)}),"")}openMarks(e){this.out+=e.reduce(((e,t)=>{const n=this.marks[t.type.name]?.open;if(!n)throw new r.Uj("mark not found: "+t.type.name);return e+("function"==typeof n?n(t):n)}),"")}constructor(e,t,n){i(this,"nodes",void 0),i(this,"marks",void 0),i(this,"prefix",void 0),i(this,"out",void 0),i(this,"currentlyOpenMarks",void 0),i(this,"spaces",void 0),i(this,"schema",void 0),this.nodes=e,this.marks=t,this.prefix="",this.out="",this.schema=n,this.currentlyOpenMarks=[],this.spaces=""}}const s=new class{serialize(e){const t=e.type.schema,n=new o(this.nodes,this.marks,t);return n.renderDoc(e),n.getOut().trim()}constructor(e,t){i(this,"nodes",void 0),i(this,"marks",void 0),this.nodes=e,this.marks=t}}({paragraph(e,t){const n=e.getPrefix();n&&e.append(n+" "),e.inline(t),e.append("\n"),n||e.append("\n")},text(e,t){e.text(t),e.end_inline()},customHardBreak(e,t){e.append("[br]\n")},heading(e,t){const n="=".repeat(t.attrs.level);e.append(n+" "),e.inline(t),e.append(" "+n+"\n")},image(e,t){const{imageid:n,align:r,size:i}=t.attrs;e.append(`[image|${n}|align=${r}|size=${i}]`)},codeBlock(e,t){e.append("[code]\n"),e.inline(t),e.append("\n[/code]\n")},table(e,t){e.inline(t),e.append("\n")},blockquote(e,t){let n=t.attrs.attribute;const r=t.attrs.format,i=t.type.spec.attrs;"null"===n&&(n=null),e.append("[quote"),i&&(n&&n!==i.attribute.default&&(e.append("|"),n=e.getSchema().nodeFromJSON(n),e.inline(n)),r&&r!==i.format.default&&e.append("|format="+r)),e.append("]\n"),e.inline(t),e.append("[/quote]\n")},featuredQuote(e,t){e.append("[quote|format=featured]\n"),e.inline(t),e.append("[/quote]\n")},grid(e,t){const n=t.attrs.columns;null===n?e.append("[grid]\n"):e.append(`[grid|columns=${n}]\n`),e.inline(t),e.append("[/grid]\n")},orderedList(e,t){1===t.attrs.start?e.renderList(t,"#"):e.renderRestartedList(t)},bulletList(e,t){e.renderList(t,"*")},mention(e,t){e.append(`@${t.attrs.id}`)},note(e,t){"note"===t.attrs.type?e.append("[note]\n"):e.append(`[note|type=${t.attrs.type}]\n`),e.inline(t),e.append("[/note]\n")}},{italic:{open:"''",close:"''"},bold:{open:"***",close:"***"},underline:{open:"++",close:"++"},subscript:{open:",,",close:",,"},superscript:{open:"^^",close:"^^"},code:{open:"``",close:"``"},strike:{open:"~~",close:"~~"},link:{open:e=>"[link|"+e.attrs.href+"|",close:e=>"_blank"===e.attrs.target?"|new_window=true]":"]"},wikiLink:{open:e=>null===e.attrs.target?"[[":"[["+e.attrs.target+"|",close:e=>(null===e.attrs.tag?"":"|tag="+e.attrs.tag)+(e.attrs.newWindow?"|new_window=true":"")+"]]"}});var l=n(52276),a=n(80542),c=n(31814),h=n(9914),d=n(94171),u=n(6294),p=n(94586),f=n(32498);(0,l._w)([c.y,u.f,p.E,h.J2,a.yN,f.z,d.N_]);var m=n(74379),g=n(45518),y=n(16315),w=n(36066),b=n(17268),v=n(96026),k=n(56791),x=n(2053),S=n(38852),C=n(88724);(0,l._w)([c.y,u.f,p.E,w.D,y.NG,m.Cv,b._V,h.J2,a.yN,f.z,k.E,x.Z,g.Cy,v.n,d.N_,C.BM,S.X,C.HX,C.YE]);var O=n(57613);(0,l._w)([c.y,u.f,p.E,w.D,y.NG,m.Cv,b._V,h.J2,a.yN,f.z,k.E,x.Z,g.Cy,v.n,d.N_,O.ck,O.Rg,O._J])},83279(e,t,n){"use strict";n.d(t,{$L:()=>I,Ln:()=>y,N0:()=>A,Um:()=>D,Wg:()=>w,X9:()=>a,Ys:()=>f,dL:()=>K,jP:()=>x,n9:()=>E,oM:()=>S,zy:()=>M});var r=n(6113);const i=Math.pow(2,16);function o(e){return 65535&e}class s{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}constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}}class l{recover(e){let t=0,n=o(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/i}(e)}
2mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,o=this.inverted?2:1,l=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let c=this.ranges[a]-(this.inverted?r:0);if(c>e)break;let h=this.ranges[a+o],d=this.ranges[a+l],u=c+h;if(e<=u){let o=c+r+((h?e==c?-1:e==u?1:t:t)<0?0:d);if(n)return o;let l=e==c?2:e==u?1:4;return(t<0?e!=c:e!=u)&&(l|=8),new s(o,l,e==(t<0?c:u)?null:a/3+(e-c)*i)}r+=d-h}return n?e+r:new s(e+r,0,null)}touches(e,t){let n=0,r=o(t),i=this.inverted?2:1,s=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let l=this.ranges[t+i];if(e<=o+l&&t==3*r)return!0;n+=this.ranges[t+s]-l}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),l=o+(this.inverted?0:i),a=this.ranges[r+t],c=this.ranges[r+n];e(s,s+a,l,l+c),i+=c-a}}invert(){return new l(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?l.empty:new l(e<0?[0,-e,0]:[0,0,e])}constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&l.empty)return l.empty}}l.empty=new l([]);class a{get maps(){return this._maps}slice(e=0,t=this.maps.length){return new a(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new a;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(null!=i.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new s(e,r,null)}constructor(e,t,n=0,r=(e?e.length:0)){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}}const c=Object.create(null);class h{getMap(){return l.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=c[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in c)throw new RangeError("Duplicate use of step JSON ID "+e);return c[e]=t,t.prototype.jsonID=e,t}}class d{static ok(e){return new d(e,null)}static fail(e){return new d(null,e)}static fromReplace(e,t,n,i){try{return d.ok(e.replace(t,n,i))}catch(e){if(e instanceof r.vI)return d.fail(e.message);throw e}}constructor(e,t){this.doc=e,this.failed=t}}function u(e,t,n){let i=[];for(let r=0;r<e.childCount;r++){let o=e.child(r);o.content.size&&(o=o.copy(u(o.content,t,o))),o.isInline&&(o=t(o,n,r)),i.push(o)}return r.FK.fromArray(i)}class p extends h{apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),o=new r.Ji(u(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),i),t.openStart,t.openEnd);return d.fromReplace(e,this.from,this.to,o)}invert(){return new f(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new p(t.pos,n.pos,this.mark)}merge(e){return e instanceof p&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new p(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new p(t.from,t.to,e.markFromJSON(t.mark))}constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}}h.jsonID("addMark",p);class f extends h{apply(e){let t=e.slice(this.from,this.to),n=new r.Ji(u(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return d.fromReplace(e,this.from,this.to,n)}invert(){return new p(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new f(t.pos,n.pos,this.mark)}merge(e){return e instanceof f&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new f(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new f(t.from,t.to,e.markFromJSON(t.mark))}constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}}h.jsonID("removeMark",f);class m extends h{apply(e){let t=e.nodeAt(this.pos);if(!t)return d.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return d.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new m(this.pos,t.marks[n]);return new m(this.pos,this.mark)}}return new g(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new m(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new m(t.pos,e.markFromJSON(t.mark))}constructor(e,t){super(),this.pos=e,this.mark=t}}h.jsonID("addNodeMark",m);class g extends h{apply(e){let t=e.nodeAt(this.pos);if(!t)return d.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return d.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new m(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new g(t.pos,this.mark)}
2toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new g(t.pos,e.markFromJSON(t.mark))}constructor(e,t){super(),this.pos=e,this.mark=t}}h.jsonID("removeNodeMark",g);class y extends h{apply(e){return this.structure&&b(e,this.from,this.to)?d.fail("Structure replace would overwrite content"):d.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new l([this.from,this.to-this.from,this.slice.size])}invert(e){return new y(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),n=this.from==this.to&&y.MAP_BIAS<0?t:e.mapResult(this.from,1);return n.deletedAcross&&t.deletedAcross?null:new y(n.pos,Math.max(n.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof y)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?r.Ji.empty:new r.Ji(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new y(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?r.Ji.empty:new r.Ji(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new y(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new y(t.from,t.to,r.Ji.fromJSON(e,t.slice),!!t.structure)}constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}}y.MAP_BIAS=1,h.jsonID("replace",y);class w extends h{apply(e){if(this.structure&&(b(e,this.from,this.gapFrom)||b(e,this.gapTo,this.to)))return d.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return d.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?d.fromReplace(e,this.from,this.to,n):d.fail("Content does not fit in gap")}getMap(){return new l([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new w(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new w(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new w(t.from,t.to,t.gapFrom,t.gapTo,r.Ji.fromJSON(e,t.slice),t.insert,!!t.structure)}constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}}function b(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function v(e,t,n,i=n.contentMatch,o=!0){let s=e.doc.nodeAt(t),l=[],a=t+1;for(let t=0;t<s.childCount;
2t++){let c=s.child(t),h=a+c.nodeSize,d=i.matchType(c.type);if(d){i=d;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new f(a,h,c.marks[t]));if(o&&c.isText&&"pre"!=n.whitespace){let e,t,i=/\r?\n|\r/g;for(;e=i.exec(c.text);)t||(t=new r.Ji(r.FK.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),l.push(new y(a+e.index,a+e.index+e[0].length,t))}}else l.push(new y(a,h,r.Ji.empty));a=h}if(!i.validEnd){let t=i.fillBefore(r.FK.empty,!0);e.replace(a,a,new r.Ji(t,0,0))}for(let t=l.length-1;t>=0;t--)e.step(l[t])}function k(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function x(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let o=e.$from.node(n),s=e.$from.index(n)+r,l=e.$to.indexAfter(n)-i;if(n<e.depth&&o.canReplace(s,l,t))return n;if(0==n||o.type.spec.isolating||!k(o,s,l))break;s&&(r=1),l<o.childCount&&(i=1)}return null}function S(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}(e,t),o=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;l&&e<i;e++)l=l.matchType(n.child(e).type);return l&&l.validEnd?s:null}(r,t);return o?i.map(C).concat({type:t,attrs:n}).concat(o.map(C)):null}function C(e){return{type:e,attrs:null}}function O(e,t,n,r){t.forEach(((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let i=e.mapping.slice(r).map(n+1+o+s.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}}))}function N(e,t,n,r){t.forEach(((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+o);e.replaceWith(i,i+1,t.type.schema.text("\n"))}}))}function M(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>o;e--,t--){let n=i.node(e),o=i.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),l=r&&r[t+1];l&&(s=s.replaceChild(0,l.type.create(l.attrs)));let a=r&&r[t]||n;if(!n.canReplace(o+1,n.childCount)||!a.type.validContent(s))return!1}let l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}function E(e,t){let n=e.resolve(t),r=n.index();return T(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function T(e,t){return!(!e||!t||e.isLeaf||!function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let o=t.child(i),s=o.type==r?e.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n)return!1;if(!e.type.allowsMarks(o.marks))return!1}return n.validEnd}(e,t))}function A(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,o,s=r.index(e);if(e==r.depth?(i=r.nodeBefore,o=r.nodeAfter):n>0?(i=r.node(e+1),s++,o=r.node(e).maybeChild(s)):(i=r.node(e).maybeChild(s-1),o=r.node(e+1)),i&&!i.isTextblock&&T(i,o)&&r.node(e).canReplace(s,s+1))return t;if(0==e)break;t=n<0?r.before(e):r.after(e)}}function D(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,o=r.index(t)+(n>0?1:0),s=r.node(t),l=!1;if(1==e)l=s.canReplace(o,o,i);else{let e=s.contentMatchAt(o).findWrapping(i.firstChild.type);l=e&&s.canReplaceWith(o,o,e[0])}if(l)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function I(e,t,n=t,i=r.Ji.empty){if(t==n&&!i.size)return null;let o=e.resolve(t),s=e.resolve(n);return R(o,s,i)?new y(t,n,i):new z(o,s,i).fit()}function R(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}h.jsonID("replaceAround",w);class z{get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let o=this.placed,s=n.depth,l=i.depth;for(;s&&l&&1==o.childCount;)o=o.firstChild.content,s--,l--;let a=new r.Ji(o,s,l);return e>-1?new w(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new y(n.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,i=null;n?(i=$(this.unplaced.content,n-1).firstChild,e=i.content):e=this.unplaced.content;let o=e.firstChild;for(let e=this.depth;e>=0;
2e--){let s,{type:l,match:a}=this.frontier[e],c=null;if(1==t&&(o?a.matchType(o.type)||(c=a.fillBefore(r.FK.from(o),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:n,frontierDepth:e,parent:i,inject:c};if(2==t&&o&&(s=a.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:e,parent:i,wrap:s};if(i&&a.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=$(e,t);return!(!i.childCount||i.firstChild.isLeaf||(this.unplaced=new r.Ji(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),0))}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=$(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new r.Ji(P(e,t-1,1),t-1,o?t-1:n)}else this.unplaced=new r.Ji(P(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let e=0;e<o.length;e++)this.openFrontierNode(o[e]);let s=this.unplaced,l=n?n.content:s.content,a=s.openStart-e,c=0,h=[],{match:d,type:u}=this.frontier[t];if(i){for(let e=0;e<i.childCount;e++)h.push(i.child(e));d=d.matchFragment(i)}let p=l.size+e-(s.content.size-s.openEnd);for(;c<l.childCount;){let e=l.child(c),t=d.matchType(e.type);if(!t)break;c++,(c>1||0==a||e.content.size)&&(d=t,h.push(F(e.mark(u.allowedMarks(e.marks)),1==c?a:0,c==l.childCount?p:-1)))}let f=c==l.childCount;f||(p=-1),this.placed=L(this.placed,t,r.FK.from(h)),this.frontier[t].match=d,f&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=l;e<p;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=f?0==e?r.Ji.empty:new r.Ji(P(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new r.Ji(P(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!j(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.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(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=j(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=j(e,n,r,t,!0);if(!i||i.childCount)continue e}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=L(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=L(this.placed,this.depth,r.FK.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(r.FK.empty,!0);e.childCount&&(this.placed=L(this.placed,this.frontier.length,e))}constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=r.FK.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=r.FK.from(e.node(t).copy(this.placed))}}function P(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(P(e.firstChild.content,t-1,n)))}function L(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(L(e.lastChild.content,t-1,n)))}function $(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function F(e,t,n){if(t<=0)return e;let i=e.content;return t>1&&(i=i.replaceChild(0,F(i.firstChild,t-1,1==i.childCount?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(r.FK.empty,!0)))),e.copy(i)}function j(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,s)?l:null}function B(e,t,n,i,o){if(t<n){let r=e.firstChild;e=e.replaceChild(0,r.copy(B(r.content,t+1,n,i,r)))}if(t>
2i){let t=o.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(r.FK.empty,!0))}return e}function V(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let i=e.start(r);if(i<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(i==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==i-1)&&n.push(r)}return n}class _ extends h{apply(e){let t=e.nodeAt(this.pos);if(!t)return d.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let i=t.type.create(n,null,t.marks);return d.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(i),0,t.isLeaf?0:1))}getMap(){return l.empty}invert(e){return new _(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new _(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new _(t.pos,t.attr,t.value)}constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}}h.jsonID("attr",_);class J extends h{apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return d.ok(n)}getMap(){return l.empty}invert(e){return new J(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new J(t.attr,t.value)}constructor(e,t){super(),this.attr=e,this.value=t}}h.jsonID("docAttr",J);let q=class extends Error{};q=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(q.prototype=Object.create(Error.prototype)).constructor=q,q.prototype.name="TransformError";class K{get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new q(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach(((n,r,i,o)=>{e=Math.min(e,i),t=Math.max(t,o)}))}return 1e9==e?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=r.Ji.empty){let i=I(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new r.Ji(r.FK.from(n),0,0))}delete(e,t){return this.replace(e,t,r.Ji.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,i){if(!i.size)return e.deleteRange(t,n);let o=e.doc.resolve(t),s=e.doc.resolve(n);if(R(o,s,i))return e.step(new y(t,n,i));let l=V(o,s);0==l[l.length-1]&&l.pop();let a=-(o.depth+1);l.unshift(a);for(let e=o.depth,t=o.pos-1;e>0;e--,t--){let n=o.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;l.indexOf(e)>-1?a=e:o.before(e)==t&&l.splice(1,0,-e)}let c=l.indexOf(a),h=[],d=i.openStart;for(let e=i.content,t=0;;t++){let n=e.firstChild;if(h.push(n),t==i.openStart)break;e=n.content}for(let e=d-1;e>=0;e--){let t=h[e],n=(u=t.type).spec.defining||u.spec.definingForContent;if(n&&!t.sameMarkup(o.node(Math.abs(a)-1)))d=e;else if(n||!t.type.isTextblock)break}var u;for(let t=i.openStart;t>=0;t--){let a=(t+d+1)%(i.openStart+1),u=h[a];if(u)for(let t=0;t<l.length;t++){let h=l[(t+c)%l.length],d=!0;h<0&&(d=!1,h=-h);let p=o.node(h-1),f=o.index(h-1);if(p.canReplaceWith(f,f,u.type,u.marks))return e.replace(o.before(h),d?s.after(h):n,new r.Ji(B(i.content,0,i.openStart,a),a,i.openEnd))}}let p=e.steps.length;for(let r=l.length-1;r>=0&&(e.replace(t,n,i),!(e.steps.length>p));r--){let e=l[r];e<0||(t=o.before(e),n=s.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let r=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}(e.doc,t,i.type);null!=r&&(t=n=r)}e.replaceRange(t,n,new r.Ji(r.FK.from(i),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&0==r.parentOffset&&0==i.parentOffset){let o=r.sharedDepth(n),s=!1;for(let e=r.depth;e>o;e--)r.node(e).type.spec.isolating&&(s=!0);for(let e=i.depth;e>o;e--)i.node(e).type.spec.isolating&&(s=!0);if(!s){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let o=V(r,i);for(let t=0;t<o.length;t++){let n=o[t],s=t==o.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(t-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return e.delete(r.before(o),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:i,$to:o,depth:s}=t,l=i.before(s+1),a=o.after(s+1),c=l,h=a,d=r.FK.empty,u=0;for(let e=s,t=!1;e>n;e--)t||i.index(e)>
20?(t=!0,d=r.FK.from(i.node(e).copy(d)),u++):c--;let p=r.FK.empty,f=0;for(let e=s,t=!1;e>n;e--)t||o.after(e+1)<o.end(e)?(t=!0,p=r.FK.from(o.node(e).copy(p)),f++):h++;e.step(new w(c,h,l,a,new r.Ji(d.append(p),u,f),d.size-u,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let i=null,{linebreakReplacement:o}=e.doc.type.schema,s=e.doc.resolve(t-n),l=s.node().type;if(o&&l.inlineContent){let e="pre"==l.whitespace,t=!!l.contentMatch.matchType(o);e&&!t?i=!1:!e&&t&&(i=!0)}let a=e.steps.length;if(!1===i){let r=e.doc.resolve(t+n);N(e,r.node(),r.before(),a)}l.inlineContent&&v(e,t+n-1,l,s.node().contentMatchAt(s.index()),null==i);let c=e.mapping.slice(a),h=c.map(t-n);if(e.step(new y(h,c.map(t+n,-1),r.Ji.empty,!0)),!0===i){let t=e.doc.resolve(h);O(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return function(e,t,n){let i=r.FK.empty;for(let e=n.length-1;e>=0;e--){if(i.size){let t=n[e].type.contentMatch.matchFragment(i);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=r.FK.from(n[e].type.create(n[e].attrs,i))}let o=t.start,s=t.end;e.step(new w(o,s,o,s,new r.Ji(i,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,i=null){return function(e,t,n,i,o){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{let l="function"==typeof o?o(t):o;if(t.isTextblock&&!t.hasMarkup(i,l)&&function(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(e.doc,e.mapping.slice(s).map(n),i)){let o=null;if(i.schema.linebreakReplacement){let e="pre"==i.whitespace,t=!!i.contentMatch.matchType(i.schema.linebreakReplacement);e&&!t?o=!1:!e&&t&&(o=!0)}!1===o&&N(e,t,n,s),v(e,e.mapping.slice(s).map(n,1),i,void 0,null===o);let a=e.mapping.slice(s),c=a.map(n,1),h=a.map(n+t.nodeSize,1);return e.step(new w(c,h,c+1,h-1,new r.Ji(r.FK.from(i.create(l,null,t.marks)),0,0),1,!0)),!0===o&&O(e,t,n,s),!1}}))}(this,e,t,n,i),this}setNodeMarkup(e,t,n=null,i){return function(e,t,n,i,o){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let l=n.create(i,null,o||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,l);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new w(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new r.Ji(r.FK.from(l),0,0),1,!0))}(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new _(e,t,n)),this}setDocAttribute(e,t){return this.step(new J(e,t)),this}addNodeMark(e,t){return this.step(new m(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t instanceof r.CU)t.isInSet(n.marks)&&this.step(new g(e,t));else{let r,i=n.marks,o=[];for(;r=t.isInSet(i);)o.push(new g(e,r)),i=r.removeFromSet(i);for(let e=o.length-1;e>=0;e--)this.step(o[e])}return this}split(e,t=1,n){return function(e,t,n=1,i){let o=e.doc.resolve(t),s=r.FK.empty,l=r.FK.empty;for(let e=o.depth,t=o.depth-n,a=n-1;e>t;e--,a--){s=r.FK.from(o.node(e).copy(s));let t=i&&i[a];l=r.FK.from(t?t.type.create(t.attrs,l):o.node(e).copy(l))}e.step(new y(t,t,new r.Ji(s.append(l),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let i,o,s=[],l=[];e.doc.nodesBetween(t,n,((e,a,c)=>{if(!e.isInline)return;let h=e.marks;if(!r.isInSet(h)&&c.type.allowsMarkType(r.type)){let c=Math.max(a,t),d=Math.min(a+e.nodeSize,n),u=r.addToSet(h);for(let e=0;e<h.length;e++)h[e].isInSet(u)||(i&&i.to==c&&i.mark.eq(h[e])?i.to=d:s.push(i=new f(c,d,h[e])));o&&o.to==c?o.to=d:l.push(o=new p(c,d,r))}})),s.forEach((t=>e.step(t))),l.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,i){let o=[],s=0;e.doc.nodesBetween(t,n,((e,l)=>{if(!e.isInline)return;s++;let a=null;if(i instanceof r.sX){let t,n=e.marks;for(;t=i.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else i?i.isInSet(e.marks)&&(a=[i]):a=e.marks;if(a&&a.length){let r=Math.min(l+e.nodeSize,n);for(let e=0;e<a.length;e++){let n,i=a[e];for(let e=0;e<o.length;e++){let t=o[e];t.step==s-1&&i.eq(o[e].style)&&(n=t)}n?(n.to=r,n.step=s):o.push({style:i,from:Math.max(l,t),to:r,step:s})}}})),o.forEach((t=>e.step(new f(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return v(this,e,t,n),this}constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new a}}},83992(e,t,n){"use strict";n.d(t,{QR:()=>a,mi:()=>l,pl:()=>s});var r=n(97145),i=n(77780);const o={editor:null,preset:""},s=(0,r.createContext)(o),l=()=>(0,r.useContext)(s);function a(e){const{editor:t}=l();return(0,i.erU)({editor:t,selector:({editor:t})=>t&&!t.isDestroyed?e(t):null})}},88639(e,t,n){"use strict";n.d(t,{z:()=>h});var r=n(78098),i=n(3554),o=n(6113),s=n(11139);class l extends i.LN{map(e,t){let n=e.resolve(t.map(this.head));return l.valid(n)?new l(n):i.LN.near(n)}content(){return o.Ji.empty}eq(e){return e instanceof l&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new l(e.resolve(t.pos))}getBookmark(){return new a(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||c(e.type))return!0;
2if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||c(e.type))return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&l.valid(e))return e;let r=e.pos,o=null;for(let n=e.depth;;n--){let i=e.node(n);if(t>0?e.indexAfter(n)<i.childCount:e.index(n)>0){o=i.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(l.valid(s))return s}for(;;){let s=t>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!i.nh.isSelectable(o)){e=e.doc.resolve(r+o.nodeSize*t),n=!1;continue e}break}o=s,r+=t;let a=e.doc.resolve(r);if(l.valid(a))return a}return null}}constructor(e){super(e,e)}}l.prototype.visible=!1,l.findFrom=l.findGapCursorFrom,i.LN.jsonID("gapcursor",l);class a{map(e){return new a(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return l.valid(t)?new l(t):i.LN.near(t)}constructor(e){this.pos=e}}function c(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function h(){return new i.k_({props:{decorations:m,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&l.valid(n)?new l(n):null,handleClick:p,handleKeyDown:d,handleDOMEvents:{beforeinput
2:f}}})}const d=(0,r.K)({ArrowLeft:u("horiz",-1),ArrowRight:u("horiz",1),ArrowUp:u("vert",-1),ArrowDown:u("vert",1)});function u(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,o){let s=e.selection,a=t>0?s.$to:s.$from,c=s.empty;if(s instanceof i.U3){if(!o.endOfTextblock(n)||0==a.depth)return!1;c=!1,a=e.doc.resolve(t>0?a.after():a.before())}let h=l.findGapCursorFrom(a,t,c);return!!h&&(r&&r(e.tr.setSelection(new l(h))),!0)}}function p(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!l.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&i.nh.isSelectable(e.state.doc.nodeAt(o.inside))||(e.dispatch(e.state.tr.setSelection(new l(r))),0))}function f(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof l))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let s=o.FK.empty;for(let e=r.length-1;e>=0;e--)s=o.FK.from(r[e].createAndFill(null,s));let a=e.state.tr.replace(n.pos,n.pos,new o.Ji(s,0,0));return a.setSelection(i.U3.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function m(e){if(!(e.selection instanceof l))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",s.zF.create(e.doc,[s.NZ.widget(e.selection.head,t,{key:"gapcursor"})])}},88724(e,t,n){"use strict";n.d(t,{Cv:()=>r.Cv,yN:()=>i.yN,Rg:()=>o.Rg,n4:()=>l.n4,Cy:()=>s.Cy,NG:()=>c.NG,AX:()=>Oe,xd:()=>b,YE:()=>a,mg:()=>fe,W4:()=>Q,r2:()=>he,yb:()=>ye,sg:()=>Se,yo:()=>d.y,Lp:()=>J,TZ:()=>ne,HX:()=>Le,xA:()=>Re,DZ:()=>h.D,BZ:()=>l.lb,oC:()=>te,J2:()=>u.J2,ck:()=>o.ck,gG:()=>le,PX:()=>p.P,L7:()=>be.L7,_J:()=>o._J,f:()=>oe,fz:()=>f.f,uW:()=>pe,n:()=>g.n,XT:()=>Ce,Xd:()=>we,E:()=>m.E,Z3:()=>w.Z,XI:()=>Ne.X,EY:()=>y.E,z2:()=>v.z,rA:()=>Me,Ce:()=>ve,BM:()=>Te});var r=n(74379),i=n(80542),o=n(57613),s=n(45518),l=n(77571);const a=n(18858).B.extend({name:"customHardBreak",renderHTML:()=>["span","â",["br"]]});var c=n(16315),h=n(36066),d=n(31814),u=n(9914),p=n(48508),f=n(6294),m=n(56791),g=n(96026),y=n(94586),w=n(2053);const b=s.Cy.extend({addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode(),"Mod-`":()=>this.editor.commands.toggleCode()}},excludes:null,priority:200});var v=n(32498),k=n(97502),x=n(94171),S=n(77780),C=n(50061),O=n(82306),N=n(97145),M=n(97287),E=n(67672),T=n(75268),A=n(59170),D=n(24060),I=n(2305),R=n(76142),z=n(83992);const P=["link","wikiLink"];function L(e){return P.find((t=>e.isActive(t)))??null}function $(e){return null!==L(e)}function F(e){const t=L(e);return"wikiLink"===t?Boolean(e.getAttributes("wikiLink").newWindow):"link"===t&&"_blank"===e.getAttributes("link").target}const j="rounded-md border border-gray-300 bg-gray-50 p-2.5 shadow-[0_2px_4px_rgba(17,22,26,0.1),0_8px_16px_rgba(17,22,26,0.2)]",B=e=>e.editor.isDestroyed||!$(e.editor)?null:(0,C.jsxs)("div",{"data-link-editor-bubble":"",className:(0,I.cn)(j,"flex max-w-[min(350px,90vw)] md:max-w-[min(500px,90vw)] lg:max-w-[min(600px,90vw)]"),children:[(0,C.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex min-w-0 grow-[2] items-center gap-2 text-brand-500",children:[(0,C.jsx)(E.g,{icon:M.AaJ,className:"text-gray-500"}),(0,C.jsx)("span",{className:"line-clamp-1 min-w-0 break-words text-base",children:e.url})]}),(0,C.jsx)(R.nU,{icon:(0,C.jsx)(E.g,{icon:M.cNj}),onClick:e.handleEdit,title:(0,O.N)("Edit link"),className:"ml-2 min-h-10 min-w-10"}),(0,C.jsx)(R.nU,{icon:(0,C.jsx)(E.g,{icon:M.yLS}),onClick:e.handleRemove,title:(0,O.N)("Remove link"),className:"ml-2 min-h-10 min-w-10"})]}),V=e=>{const{editor:t,url:n,setUrl:r,text:i,setText:o,newTab:s,setNewTab:l,handleSave:a,handleCancel:c}=e,h=(0,N.useRef)(null),d=(0,N.useRef)(null);(0,N.useEffect)((()=>{setTimeout(n?()=>{h.current?.focus(),l(F(t))}:()=>d.current?.focus(),100)}),[]);const u=e=>{"Enter"===e.key&&(e.preventDefault(),n&&a())};return(0,C.jsxs)("div",{"data-link-editor-bubble":"",className:(0,I.cn)(j,"flex w-[350px] max-w-[90vw] flex-col gap-2 md:w-[500px] lg:w-[600px]"),children:[(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)(A.J,{htmlFor:"link-text",children:(0,O.N)("Link text")}),(0,C.jsx)(T.p,{id:"link-text",className:"text-sm",value:i,onChange:e=>{o(e.target.value)},onKeyDown:u,ref:h})]}),(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)(A.J,{htmlFor:"link-address",children:(0,O.N)("Link address")}),(0,C.jsx)(T.p,{id:"link-address",className:"text-sm",placeholder:"https://www.example.com",value:n,onChange:e=>{r(e.target.value)},onKeyDown:u,ref:d,type:"url"})]}),(0,C.jsxs)("div",{className:"mt-2 flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,C.jsxs)("div",{className:"flex items-center gap-2",children:[(0,C.jsx)(A.J,{htmlFor:"newTabSwitch",children:(0,O.N)("Open in a new tab")}),(0,C.jsx)(D.d,{id:"newTabSwitch",checked:s,onCheckedChange:()=>l(!s)})]}),(0,C.jsxs)("div",{className:"flex justify-end gap-2 sm:ml-auto",children:[(0,C.jsx)("button",{type:"button",onClick:c,className:"button-secondary button-md",children:(0,O.N)("Cancel")}),(0,C.jsx)("button",{type:"button",onClick:a,disabled:!n,className:"button-primary button-md",children:(0,O.N)("Confirm Link")})]})]})]})};function _({ref:e,...t}){const{editor:n}=t,{preset:r}=(0,z.mi)(),i="guide_intro"===r?"_blank":"",[o,s]=(0,N.useState)(""),[l,a]=(0,N.useState)(""),[c,h]=(0,N.useState)("_blank"===i),[d,u]=(0,N.useState)("preview"),[p,f]=(0,N.useState)({from:0,to:0}),[m,g]=(0,N.useState)(null),[y,w]=(0,N.useState)({}),[b,v]=(0,N.useState)(""),k=()=>{const{from:e,to:t}=n.state.selection;f({from:e,to:t});const r=n.state.doc.textBetween(e,t);a(r),v(r);const o=L(n),l=o?n.getAttributes(o):{};g(o),w(l),s(l.href||""),h(o?F(n):"_blank"===i)};(0,N.useImperativeHandle)(e,(()=>({show:e=>(e&&u(e),k(),!0),hide:()=>(a(""),s(""),u("preview"),!0)})));const x=()=>{const e=L(n);e&&n.chain().focus().extendMarkRange(e).unsetMark(e).run()},S={editor:n,url:o,text:l,setUrl:s,setText:a,newTab:c,setNewTab:h,handleEdit:()=>{const e=L(n);e&&n.commands.extendMarkRange(e),k(),u("edit")},handleSave:()=>{if("wikiLink"===m&&o===(y.href||"")){const i=l||b,o=(t=b,r=i,null===(e=y).target&&r!==t?t:e.target??null),s={type:"text",marks:[{type:"wikiLink",attrs:{...y,target:o,newWindow:c}}],text:i};return n.chain().focus().insertContentAt(p,s).run(),void u("preview")}var e,t,r;let i=o;const a=/^[a-z][\d+.a-z-]*:\/\//i.test(i),h=i.startsWith("/"),d=c?"_blank":"";i.includes("mailto:")?s(i):!i||a||h||(i="https://"+i,s(i));const f={type:"text",marks:[{type:"link",attrs:{href:i,target:d}}],text:l||i};n.chain().focus().insertContentAt(p,f).run(),u("preview")},handleRemove:x,handleCancel:()=>{const e=L(n),t=(e?n.getAttributes(e):{}).href||"";t?s(t):x(),h(e?F(n):"_blank"===i),n.commands.focus(),u("preview")}};return d?n&&("preview"==d?(0,C.jsx)(B,{...S}):(0,C.jsx)(V,{...S})):null}const J=x.N_.extend({inclusive:!1,priority:-10,onCreate(){const e={editor:this.editor},t=this.editor.storage.editorid.editorid;this.storage[`${t}-renderer`]=new S.NVQ(_,{props:e,editor:this.editor});const n=this.storage[`${t}-renderer`].element;
2n.style.zIndex="50",n.classList.add("w-max");const r=`bubble-menu-${t}`;this.storage.bubbleMenu=(0,k.V$)({pluginKey:r,editor:this.editor,element:n,appendTo:()=>document.body,shouldShow:()=>$(this.editor)||this.storage.forceShow,options:{placement:"bottom",strategy:"fixed",flip:{padding:8},shift:{padding:8,crossAxis:!0},onShow:()=>{n.style.visibility="hidden"}},updateDelay:50}),this.editor.registerPlugin(this.storage.bubbleMenu);const i=new ResizeObserver((()=>{this.editor.isDestroyed||this.editor.view.dispatch(this.editor.state.tr.setMeta(r,"updatePosition"))}));i.observe(n),this.storage[`${t}-resizeObserver`]=i},onDestroy(){const e=this.editor.storage.editorid?.editorid,t=this.storage[`${e}-renderer`];this.storage[`${e}-resizeObserver`]?.disconnect(),t?.destroy()},addCommands(){return{...this.parent?.(),showLinkEditor:e=>({dispatch:t})=>{const n=this.editor.storage.editorid.editorid,r=this.storage[`${n}-renderer`];return t&&r&&r.ref?.show?.(e),!0},hideLinkEditor:()=>({dispatch:e})=>{const t=this.editor.storage.editorid.editorid,n=this.storage[`${t}-renderer`];return e&&n&&n.ref?.hide?.(),!0},editLink:()=>({dispatch:e,commands:t,editor:n})=>{if(!e)return!0;const r=L(n);return r?t.extendMarkRange(r):t.forceShow(),t.showLinkEditor("edit"),!0},attachLinkEditor:()=>({dispatch:e,editor:t})=>{if(!e)return!0;const n=t.storage.editorid.editorid,r=this.storage[`${n}-renderer`],i=t.contentComponent;return r&&!r.destroyed&&i&&!Object.hasOwn(i.getSnapshot(),r.id)&&r.render(),!0},forceShow:()=>({dispatch:e,editor:t})=>!e||(this.storage.forceShow=!0,t.commands.blur(),requestAnimationFrame((()=>{t.commands.focus()})),!0)}},addStorage:()=>({renderer:null,bubbleMenu:null,forceShow:!1}),addKeyboardShortcuts(){return{"Mod-k":()=>this.editor.commands.editLink()}},onSelectionUpdate(){this.storage.forceShow=!1,$(this.editor)?this.editor.commands.showLinkEditor("preview"):this.editor.commands.hideLinkEditor()},addPasteRules:()=>[],parseHTML(){return(this.parent?.()??[]).map((e=>"string"==typeof e.tag?{...e,tag:`${e.tag}:not([data-wikilink])`}:e))}}).configure({openOnClick:!1,linkOnPaste:!1,autolink:!1}),q=e=>(0,C.jsx)("span",{className:(0,I.cn)("pr-2.5 text-base text-black",e.bold&&"font-bold"),children:e.children}),K=e=>(0,C.jsx)("li",{className:"overflow-auto text-start",children:(0,C.jsxs)("button",{type:"button",className:(0,I.cn)("flex w-full items-center py-1.5 px-1",e.selected?"mentionSelected bg-gray-200":"bg-white"),onClick:e.onClick,onMouseOver:e.onMouseOver,children:[(0,C.jsx)("img",{src:e.item.image,alt:"",className:"relative mt-0.5 mr-2 size-6 rounded-full"}),(0,C.jsx)(q,{bold:!0,children:e.item.unique_username}),(0,C.jsx)(q,{children:e.item.username})]})});function U({ref:e,...t}){const[n,r]=(0,N.useState)(0),i=e=>{const n=t.items[e];n&&t.command({id:n.unique_username})};return(0,N.useEffect)((()=>r(0)),[t.items]),(0,N.useImperativeHandle)(e,(()=>({onKeyDown:({event:e})=>{switch(e.key){case"ArrowUp":return r((n+t.items.length-1)%t.items.length),!0;case"ArrowDown":return r((n+1)%t.items.length),!0;case"Enter":case"Tab":return i(n),!0;default:return!1}}}))),(0,C.jsx)("ul",{className:"m-0 rounded bg-white p-0 shadow-[0_2px_6px_rgba(0,0,0,0.3)]",children:t.items.map(((e,t)=>(0,C.jsx)(K,{index:t,item:e,selected:t===n,onClick:()=>i(t),onMouseOver:()=>r(t)},t)))})}var W=n(68198),H=n(63844),G=n.n(H),Y=n(89133),X=n.n(Y),Z=n(78787);const Q=p.P.configure({HTMLAttributes:{class:"mention_yqash"},suggestion:{items:function({query:e}){const t=Object.values(App.users||{});if(!e&&t)return t.slice(0,5);const n=t.map((t=>{let n=6;return t.unique_username===e?n=1:t.username===e?n=2:t.unique_username.startsWith(e)?n=3:t.username.startsWith(e)?n=4:(t.unique_username.includes(e)||t.username.includes(e))&&(n=5),{...t,rank:n}})).filter((e=>e.rank<6)).sort(((e,t)=>e.rank-t.rank)).map((e=>G()(e,["rank"])));return n.length>=5?n.slice(0,5):new Z.A(`users/search/${e}?limit=5&uniqueOnly`,{method:"GET"}).send().then((e=>{const t=e.results.filter((e=>null!==e.username&&null!==e.unique_username)).map((e=>({...e,image:e.image.mini})));return X()(n.concat(t),"unique_username").slice(0,5)}))},render:function(){let e,t,n=!1,r=!1;return{onStart:i=>{r?r=!1:(e=new S.NVQ(U,{props:i,editor:i.editor}),t=(0,W.default)("body",{getReferenceClientRect:i.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}),n=!0)},onUpdate(r){n&&(e.updateProps(r),t[0].setProps({getReferenceClientRect:r.clientRect}))},onKeyDown:r=>!!n&&("Escape"===r.event.key?(t[0].hide(),!0):e.ref&&e.ref.onKeyDown(r)),onExit(){n?(t&&t[0]&&t[0].destroy(),e&&e.destroy()):r=!0}}},command:({editor:e,range:t,props:n})=>{const r=e.view.state.selection.$to.nodeAfter,i=r?.text?.startsWith(" ");i&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:"mention",attrs:n},{type:"text",text:" "}]).run(),window.getSelection().collapseToEnd()}}});var ee=n(52276);const te=ee.YY.create({name:"isFocused",addStorage:()=>({isFocused:!1}),onTransaction({transaction:e}){e.getMeta("focus")&&(this.storage.isFocused=!0),e.getMeta("blur")&&(this.storage.isFocused=!1)}}),ne=ee.YY.create({name:"editorid",addStorage:()=>({editorid:null}),onCreate(){this.storage.editorid=this.options.editorid}});var re=n(90330),ie=n.n(re);const oe=ee.YY.create({name:"originalState",addOptions:()=>({debounce:500,handleModified:()=>{}}),addCommands(){return{updateSavedContent:()=>({dispatch:e})=>(e&&(this.storage.savedContent=this.editor.state.doc,this.storage.hasUnsavedChanges=!1),!0)}},onUpdate(){this.storage.checkModified(this.editor)},onCreate(){var e,t;this.editor.commands.updateSavedContent(),this.storage.checkModified=(e=this.options.debounce,t=this.options.handleModified,ie()((e=>{const n=!e.state.doc.eq(e.storage.originalState.savedContent);t(n),e.storage.originalState.hasUnsavedChanges=n}),e,{leading:!0}))},addStorage:()=>({savedContent:null,hasUnsavedChanges:!1,checkModified:()=>{}})});var se=n(30628);const le=ee.YY.create({name:"mediaManager",addCommands(){return{activateMediaManager:()=>({commands:e})=>{e.blur();const t=this.editor;return(0,se.Z)("wiki_media").then((e=>{const n=e.toWikiText();t.chain().focus().insertContent(n).run()})),!0}}}}),ae=/(,{2}([^,]+),{2})$/,ce=/(,{2}([^,]+),{2})/g,he=m.E.extend({addInputRules(){return[(0,ee.OX)({find:ae,type:this.t
2ype})]},addPasteRules(){return[(0,ee.Zc)({find:ce,type:this.type})]}});var de=n(43023);const ue=e=>{const t=(e=>`${e}_${window.location.pathname}`)(e);return`prosemirror_editor_doc_${t}`},pe=ee.YY.create({name:"sessionStorage",onCreate(){const e=(e=>{const t=ue(e);try{return de.R.getJson(t)}catch{return null}})(this.options.editorId);var t;this.editor.isEmpty&&e&&this.editor.commands.setContent(e,{emitUpdate:!1}),this.storage.autosave=(t=this.options.autosaveWait,ie()(((e,t)=>{if(t.isDestroyed)return;const n=ue(e),r=JSON.stringify(t.getJSON());de.R.setItem(n,r)}),t))},onUpdate(){this.storage.autosave?.(this.options.editorId,this.editor)},onDestroy(){this.storage.autosave?.cancel()},addStorage:()=>({autosave:null}),addCommands(){return{clearSessionStorage:()=>()=>{const e=ue(this.options.editorId);return de.R.removeItem(e),!0}}}}),fe=h.D.extend({content:"text*",group:"block quoteless",inline:!1}),me=/(\^{2}([^^]+)\^{2})$/,ge=/(\^{2}([^^]+)\^{2})/g,ye=w.Z.extend({addInputRules(){return[(0,ee.OX)({find:me,type:this.type})]},addPasteRules(){return[(0,ee.Zc)({find:ge,type:this.type})]}}),we=ee.YY.create({name:"submitError",addStorage:()=>({error:null}),addCommands(){return{showError:e=>({dispatch:t})=>(t&&(this.storage.error=e),!0),clearError:()=>({dispatch:e})=>(e&&(this.storage.error=null),!0)}}});var be=n(65902);const ve=ee.YY.create({name:"video",addCommands:()=>({insertVideoContent:(e,t)=>({commands:n,dispatch:r})=>{const i=t?"]"+t+"[/video]":"]",o=/https?:\/\//.test(e)?e:"http://"+e;return r&&n.insertContent("[video|"+o+i),!0}})}),ke=/(?:^|\s)(\+{2}([^+]+)\+{2})$/,xe=/(?:^|\s)(\+{2}([^+]+)\+{2})/g,Se=v.z.extend({addInputRules(){return[(0,ee.OX)({find:ke,type:this.type})]},addPasteRules(){return[(0,ee.Zc)({find:xe,type:this.type})]}}),Ce=ee.YY.create({name:"submit",addOptions:()=>({submit:()=>{}}),addCommands(){return{submit:()=>()=>(this.options.submit(),!0)}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.submit()}}}),Oe=l.n4.extend({addOptions(){return{...this.parent?.(),minCharacters:0,autoTrim:!1}},addStorage(){return{...this.parent?.(),minCharacters:this.options.minCharacters,maxCharacters:this.options.limit}}});var Ne=n(38852);const Me=ee.YY.create({name:"validateDoc",addOptions:()=>({doc:{},fallbackHandler:()=>{}}),onCreate(){try{this.editor.schema.nodeFromJSON(this.options.doc).check()}catch(e){this.options.fallbackHandler(e)}}});var Ee=n(3554);const Te=ee.CU.create({name:"wikiLink",inclusive:!1,addAttributes:()=>({target:{default:null,parseHTML:e=>e.dataset.target??null,renderHTML:e=>null===e.target?{}:{"data-target":e.target}},tag:{default:null,parseHTML:e=>e.dataset.tag??null,renderHTML:e=>null===e.tag?{}:{"data-tag":e.tag}},newWindow:{default:!1,parseHTML:e=>"true"===e.dataset.newWindow,renderHTML:e=>e.newWindow?{"data-new-window":"true"}:{}},href:{default:null,parseHTML:e=>e.getAttribute("href"),renderHTML:e=>null===e.href?{}:{href:e.href}}}),parseHTML:()=>[{tag:"a[data-wikilink]"}],renderHTML:({HTMLAttributes:e})=>["a",(0,ee.KV)({"data-wikilink":""},e),0],addProseMirrorPlugins:()=>[new Ee.k_({key:new Ee.hs("wikiLinkClick"),props:{handleDOMEvents:{click:(e,t)=>{const n=t.target;return n instanceof Element&&n.closest("a[data-wikilink]")&&(t.preventDefault(),t.stopPropagation()),!1}}}})]});var Ae=n(82900),De=n(6113),Ie=n(83279);const Re=ee.bP.create({name:"grid",content:"block*",group:"block",selectable:!0,renderHTML:({HTMLAttributes:e})=>["div",(0,ee.KV)(e,{class:"wiki-grid"}),0],addNodeView:()=>(0,S.gu3)(ze),addAttributes:()=>({columns:{default:null,renderHTML:e=>{const t=Number.parseInt(e.columns,10);return t>0?{class:"wiki-grid-columns",style:`--wiki-grid-columns: ${t}`}:{}}}}),addKeyboardShortcuts:()=>({Tab:({editor:e})=>e.chain().focus().nextGridCell().run()}),addCommands(){return{toggleGrid:e=>({chain:t,editor:n})=>n.isActive(this.name)?t().focus().removeGridNode().run():t().toggleWrap(this.name).updateAttributes(this.name,{columns:e}).focus().run(),setGridMode:e=>({chain:t})=>t().focus().updateAttributes(this.name,{columns:e}).run(),increaseColumns:()=>({chain:e,editor:t})=>{const n=t.getAttributes(this.name).columns;return e().updateAttributes(this.name,{columns:(n||0)+1}).focus().run()},decreaseColumns:()=>({chain:e,editor:t})=>{const n=t.getAttributes(this.name).columns;return!(!n||n<=1)&&e().updateAttributes(this.name,{columns:n-1}).focus().run()},removeGridNode:()=>({tr:e,state:t,dispatch:n})=>{const r=(0,ee.KP)((e=>
2e.type.name===this.name))(t.selection);if(!r)return!1;const i=r.node,o=e.doc.resolve(r.start),s=e.doc.resolve(r.start+i.content.size),l=new De.u$(o,s,r.depth),a=(0,Ie.jP)(l);return null!==a&&(n&&e.lift(l,a),!0)},nextGridCell:()=>({tr:e,state:t,dispatch:n})=>{const r=(0,ee.KP)((e=>e.type.name===this.name))(t.selection);if(!r)return!1;const i=r.node,o=t.selection.from-r.start,s=i.childAfter(o),l=s.index+1;if(i.maybeChild(l)){const t=e.doc.resolve(r.start).posAtIndex(l),i=e.doc.resolve(t);if(n){const t=Ee.LN.near(i);e.setSelection(t)}}else{const o=s.node;if(0===(o.isText?o.nodeSize:o.childCount)){const t=s.offset,o=r.start+t;n&&e.delete(o,o+2);const l=r.start+i.content.size,a=e.doc.resolve(l);if(n){const t=Ee.LN.near(a);e.setSelection(t)}return!0}const l=t.schema.nodes.paragraph.create(),a=r.start+i.content.size;if(n){e.insert(a,l);const t=e.doc.resolve(a),n=Ee.LN.near(t);e.setSelection(n)}}return!0}}}}),ze=e=>(0,C.jsx)(S.VRb,{children:(0,C.jsx)(Pe,{columns:e.node.attrs.columns,children:(0,C.jsx)(S.$p7,{})})}),Pe=({columns:e,children:t})=>{const n=Ae.AH` 3 outline: 1px solid purple; 4 > div { 5 display: contents; 6 > div { 7 display: contents; 8 > * { 9 margin: 0 !important; 10 grid-row-end: span 2; 11 word-break: break-all; 12 overflow-wrap: break-word; 13 } 14 } 15 } 16 `,r=Ae.AH` 17 ${n} 18 display: grid; 19 grid-template-columns: repeat(${e||1}, 1fr); 20 align-items: center; 21 justify-items: center; 22 align-content: space-between; 23 justify-content: space-between; 24 gap: 0.5em; 25 `,i=Ae.AH` 26 ${n} 27 width: 100%; 28 display: grid; 29 grid-template-columns: repeat(auto-fit, minmax(100px, max-content)); 30 justify-content: center; 31 align-items: end; 32 justify-items: center; 33 gap: 10px; 34 `;return(0,C.jsx)("div",{className:null===e?i:r,children:t})},Le=r.Cv.extend({name:"featuredQuote"}).configure({HTMLAttributes:{class:"featuredQuote_cIv2m"}})},89133(e,t,n){var r=n(67972),i=n(40276);e.exports=function(e,t){return e&&e.length?i(e,r(t,2)):[]}},90873(e,t,n){"use strict";n.d(t,{rn:()=>g});var r=n(3554),i=n(6113),o=n(78098);let s,l;if("undefined"!=typeof WeakMap){let e=new WeakMap;s=t=>e.get(t),l=(t,n)=>(e.set(t,n),n)}else{const e=[],t=10;let n=0;s=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},l=(r,i)=>(n==t&&(n=0),e[n++]=r,e[n++]=i)}var a=class{findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const r=t%this.width,i=t/this.width|0;let o=r+1,s=i+1;for(let e=1;o<this.width&&this.map[t+e]==n;e++)o++;for(let e=1;s<this.height&&this.map[t+this.width*e]==n;e++)s++;return{left:r,top:i,right:o,bottom:s}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:r,right:i,top:o,bottom:s}=this.findCell(e);return"horiz"==t?(n<0?0==r:i==this.width)?null:this.map[o*this.width+(n<0?r-1:i)]:(n<0?0==o:s==this.height)?null:this.map[r+this.width*(n<0?o-1:s)]}rectBetween(e,t){const{left:n,right:r,top:i,bottom:o}=this.findCell(e),{left:s,right:l,top:a,bottom:c}=this.findCell(t);return{left:Math.min(n,s),top:Math.min(i,a),right:Math.max(r,l),bottom:Math.max(o,c)}}cellsInRect(e){const t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){const o=r*this.width+i,s=this.map[o];n[s]||(n[s]=!0,i==e.left&&i&&this.map[o-1]==s||r==e.top&&r&&this.map[o-this.width]==s||t.push(s))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){const o=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width;const r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?o-1:this.map[n]}i=o}}static get(e){return s(e)||l(e,function(e){if("table"!=e.type.spec.tableRole)throw new RangeError("Not a table node: "+e.type.name);const t=function(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){const i=e.child(r);let o=0;if(n)for(let t=0;t<r;t++){const n=e.child(t);for(let e=0;e<n.childCount;e++){const i=n.child(e);t+i.attrs.rowspan>r&&(o+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){const t=i.child(e);o+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}-1==t?t=o:t!=o&&(t=Math.max(t,o))}return t}(e),n=e.childCount,r=[];let i=0,o=null;const s=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let l=0,a=0;l<n;l++){const c=e.child(l);a++;for(let e=0;;e++){for(;i<r.length&&0!=r[i];)i++;if(e==c.childCount)break;const h=c.child(e),{colspan:d,rowspan:u,colwidth:p}=h.attrs;for(let e=0;e<u;e++){if(e+l>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:a,n:u-e});break}const c=i+e*t;for(let e=0;e<d;e++){0==r[c+e]?r[c+e]=a:(o||(o=[])).push({type:"collision",row:l,pos:a,n:d-e});const n=p&&p[e];if(n){const r=(c+e)%t*2,i=s[r];null==i||i!=n&&1==s[r+1]?(s[r]=n,s[r+1]=1):i==n&&s[r+1]++}}}i+=d,a+=h.nodeSize}const h=(l+1)*t;let d=0;for(;
34i<h;)0==r[i++]&&d++;d&&(o||(o=[])).push({type:"missing",row:l,n:d}),a++}0!==t&&0!==n||(o||(o=[])).push({type:"zero_sized"});const l=new a(t,n,r,o);let h=!1;for(let e=0;!h&&e<s.length;e+=2)null!=s[e]&&s[e+1]<n&&(h=!0);return h&&function(e,t,n){e.problems||(e.problems=[]);const r={};for(let i=0;i<e.map.length;i++){const o=e.map[i];if(r[o])continue;r[o]=!0;const s=n.nodeAt(o);if(!s)throw new RangeError(`No cell with offset ${o} found`);let l=null;const a=s.attrs;for(let n=0;n<a.colspan;n++){const r=t[(i+n)%e.width*2];null==r||a.colwidth&&a.colwidth[n]==r||((l||(l=c(a)))[n]=r)}l&&e.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:l})}}(l,s,e),l}(e))}constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}};function c(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function h(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}function d(e){const t=e.selection.$head;for(let e=t.depth;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return!0;return!1}function u(e){return"row"==e.parent.type.spec.tableRole&&!!e.nodeAfter}function p(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function f(e,t,n){const r=e.node(-1),i=a.get(r),o=e.start(-1),s=i.nextCell(e.pos-o,t,n);return null==s?null:e.node(0).resolve(o+s)}function m(e,t,n=1){const r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some((e=>e>0))||(r.colwidth=null)),r}new r.hs("selectingCells");var g=class e extends r.LN{map(t,n){const i=t.resolve(n.map(this.$anchorCell.pos)),o=t.resolve(n.map(this.$headCell.pos));if(u(i)&&u(o)&&p(i,o)){const t=this.$anchorCell.node(-1)!=i.node(-1);return t&&this.isRowSelection()?e.rowSelection(i,o):t&&this.isColSelection()?e.colSelection(i,o):new e(i,o)}return r.U3.between(i,o)}content(){const e=this.$anchorCell.node(-1),t=a.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},s=[];for(let n=r.top;n<r.bottom;n++){const l=[];for(let i=n*t.width+r.left,s=r.left;s<r.right;s++,i++){const n=t.map[i];if(o[n])continue;o[n]=!0;const s=t.findCell(n);let a=e.nodeAt(n);if(!a)throw new RangeError(`No cell with offset ${n} found`);const c=r.left-s.left,h=s.right-r.right;if(c>0||h>0){let e=a.attrs;if(c>0&&(e=m(e,0,c)),h>0&&(e=m(e,e.colspan-h,h)),s.left<r.left){if(a=a.type.createAndFill(e),!a)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else a=a.type.create(e,a.content)}if(s.top<r.top||s.bottom>r.bottom){const e={...a.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};a=s.top<r.top?a.type.createAndFill(e):a.type.create(e,a.content)}l.push(a)}s.push(e.child(n).copy(i.FK.from(l)))}const l=this.isColSelection()&&this.isRowSelection()?e:s;return new i.Ji(i.FK.from(l),1,1)}replace(e,t=i.Ji.empty){const n=e.steps.length,o=this.ranges;for(let r=0;r<o.length;r++){const{$from:s,$to:l}=o[r],a=e.mapping.slice(n);e.replace(a.map(s.pos),a.map(l.pos),r?i.Ji.empty:t)}const s=r.LN.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,t){this.replace(e,new i.Ji(i.FK.from(t),0,0))}forEachCell(e){const t=this.$anchorCell.node(-1),n=a.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){const e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;const n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const r=t.node(-1),i=a.get(r),o=t.start(-1),s=i.findCell(t.pos-o),l=i.findCell(n.pos-o),c=t.node(0);return s.top<=l.top?(s.top>0&&(t=c.resolve(o+i.map[s.left])),l.bottom<i.height&&(n=c.resolve(o+i.map[i.width*(i.height-1)+l.right-1]))):(l.top>0&&(n=c.resolve(o+i.map[l.left])),s.bottom<i.height&&(t=c.resolve(o+i.map[i.width*(i.height-1)+s.right-1]))),new e(t,n)}isRowSelection(){const e=this.$anchorCell.node(-1),t=a.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);
34if(Math.min(r,i)>0)return!1;const o=r+this.$anchorCell.nodeAfter.attrs.colspan,s=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,s)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const r=t.node(-1),i=a.get(r),o=t.start(-1),s=i.findCell(t.pos-o),l=i.findCell(n.pos-o),c=t.node(0);return s.left<=l.left?(s.left>0&&(t=c.resolve(o+i.map[s.top*i.width])),l.right<i.width&&(n=c.resolve(o+i.map[i.width*(l.top+1)-1]))):(l.left>0&&(n=c.resolve(o+i.map[l.top*i.width])),s.right<i.width&&(t=c.resolve(o+i.map[i.width*(s.top+1)-1]))),new e(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new y(this.$anchorCell.pos,this.$headCell.pos)}constructor(e,t=e){const n=e.node(-1),i=a.get(n),o=e.start(-1),s=i.rectBetween(e.pos-o,t.pos-o),l=e.node(0),c=i.cellsInRect(s).filter((e=>e!=t.pos-o));c.unshift(t.pos-o);const h=c.map((e=>{const t=n.nodeAt(e);if(!t)throw new RangeError(`No cell with offset ${e} found`);const i=o+e+1;return new r.yn(l.resolve(i),l.resolve(i+t.content.size))}));super(h[0].$from,h[0].$to,h),this.$anchorCell=e,this.$headCell=t}};g.prototype.visible=!1,r.LN.jsonID("cell",g);var y=class e{map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){const t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&p(t,n)?new g(t,n):r.LN.near(n,1)}constructor(e,t){this.anchor=e,this.head=t}};function w(e){const t=e.selection,n=function(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&"cell"==t.node.type.spec.tableRole)return t.$anchor;const n=function(e){for(let t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}(t.$head)||function(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n-t.nodeSize)}}(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}(e),r=n.node(-1),i=n.start(-1),o=a.get(r);return{...t instanceof g?o.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):o.findCell(n.pos-i),tableStart:i,map:o,table:r}}function b(e,t,n){const r=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1});for(let e=0;e<r.length;e++){const i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function v(e,t){return(t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(e){return function(t,n){if(!d(t))return!1;if(n){const r=h(t.schema),i=w(t),o=t.tr,s=i.map.cellsInRect("column"==e?{left:i.left,top:0,right:i.right,bottom:i.map.height}:"row"==e?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),l=s.map((e=>i.table.nodeAt(e)));for(let e=0;e<s.length;e++)l[e].type==r.header_cell&&o.setNodeMarkup(i.tableStart+s[e],r.cell,l[e].attrs);if(0===o.steps.length)for(let e=0;e<s.length;e++)o.setNodeMarkup(i.tableStart+s[e],r.header_cell,l[e].attrs);n(o)}return!0}}(e):function(t,n){if(!d(t))return!1;if(n){const r=h(t.schema),i=w(t),o=t.tr,s=b("row",i,r),l=b("column",i,r),a=("column"===e?s:"row"===e&&l)?1:0,c="column"==e?{left:0,top:a,right:1,bottom:i.map.height}:"row"==e?{left:a,top:0,right:i.map.width,bottom:1}:i,d="column"==e?l?r.cell:r.header_cell:"row"==e?s?r.cell:r.header_cell:r.cell;i.map.cellsInRect(c).forEach((e=>{const t=e+i.tableStart,n=o.doc.nodeAt(t);n&&o.setNodeMarkup(t,d,n.attrs)})),n(o)}return!0}}function k(e,t){const n=e.selection;if(!(n instanceof g))return!1;if(t){const r=e.tr,o=h(e.schema).cell.createAndFill().content;n.forEachCell(((e,t)=>{e.content.eq(o)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new i.Ji(o,0,0))})),r.docChanged&&t(r)}return!0}function x(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function S(e,t){return(n,i,o)=>
34{if(!o)return!1;const s=n.selection;if(s instanceof g)return x(n,i,r.LN.near(s.$headCell,t));if("horiz"!=e&&!s.empty)return!1;const l=O(o,e,t);if(null==l)return!1;if("horiz"==e)return x(n,i,r.LN.near(n.doc.resolve(s.head+t),t));{const o=n.doc.resolve(l),s=f(o,e,t);let a;return a=s?r.LN.near(s,1):t<0?r.LN.near(n.doc.resolve(o.before(-1)),-1):r.LN.near(n.doc.resolve(o.after(-1)),1),x(n,i,a)}}}function C(e,t){return(n,r,i)=>{if(!i)return!1;const o=n.selection;let s;if(o instanceof g)s=o;else{const r=O(i,e,t);if(null==r)return!1;s=new g(n.doc.resolve(r))}const l=f(s.$headCell,e,t);return!!l&&x(n,r,new g(s.$anchorCell,l))}}function O(e,t,n){if(!(e.state.selection instanceof r.U3))return null;const{$head:i}=e.state.selection;for(let r=i.depth-1;r>=0;r--){const o=i.node(r);if((n<0?i.index(r):i.indexAfter(r))!=(n<0?0:o.childCount))return null;if("cell"==o.type.spec.tableRole||"header_cell"==o.type.spec.tableRole){const o=i.before(r),s="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(s)?o:null}}return null}new r.hs("fix-tables"),v("row",{useDeprecatedLogic:!0}),v("column",{useDeprecatedLogic:!0}),v("cell",{useDeprecatedLogic:!0}),(0,o.K)({ArrowLeft:S("horiz",-1),ArrowRight:S("horiz",1),ArrowUp:S("vert",-1),ArrowDown:S("vert",1),"Shift-ArrowLeft":C("horiz",-1),"Shift-ArrowRight":C("horiz",1),"Shift-ArrowUp":C("vert",-1),"Shift-ArrowDown":C("vert",1),Backspace:k,"Mod-Backspace":k,Delete:k,"Mod-Delete":k}),new r.hs("tableColumnResizing")},94988(e,t,n){"use strict";n.d(t,{$B:()=>l,Sd:()=>o,T2:()=>s});var r=n(83279),i=n(6113);function o(e,t=null){return function(n,o){let{$from:s,$to:l}=n.selection,a=s.blockRange(l);if(!a)return!1;let c=o?n.tr:null;return!!function(e,t,n,o=null){let s=!1,l=t,a=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&0==t.startIndex){if(0==t.$from.index(t.depth-1))return!1;let e=a.resolve(t.start-2);l=new i.u$(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new i.u$(t.$from,a.resolve(t.$to.end(t.depth)),t.depth)),s=!0}let c=(0,r.oM)(l,n,o,t);return!!c&&(e&&function(e,t,n,o,s){let l=i.FK.empty;for(let e=n.length-1;e>=0;e--)l=i.FK.from(n[e].type.create(n[e].attrs,l));e.step(new r.Wg(t.start-(o?2:0),t.end,t.start,t.end,new i.Ji(l,0,0),n.length,!0));let a=0;for(let e=0;e<n.length;e++)n[e].type==s&&(a=e+1);let c=n.length-a,h=t.start+n.length-(o?2:0),d=t.parent;for(let n=t.startIndex,i=t.endIndex,o=!0;n<i;n++,o=!1)!o&&(0,r.zy)(e.doc,h,c)&&(e.split(h,c),h+=2*c),h+=d.child(n).nodeSize}(e,t,c,s,n),!0)}(c,a,e,t)&&(o&&o(c.scrollIntoView()),!0)}}function s(e){return function(t,n){let{$from:o,$to:s}=t.selection,l=o.blockRange(s,(t=>t.childCount>0&&t.firstChild.type==e));return!!l&&(!n||(o.node(l.depth-1).type==e?function(e,t,n,o){let s=e.tr,l=o.end,a=o.$to.end(o.depth);l<a&&(s.step(new r.Wg(l-1,a,l,a,new i.Ji(i.FK.from(n.create(null,o.parent.copy())),1,0),1,!0)),o=new i.u$(s.doc.resolve(o.$from.pos),s.doc.resolve(a),o.depth));const c=(0,r.jP)(o);if(null==c)return!1;s.lift(o,c);let h=s.doc.resolve(s.mapping.map(l,-1)-1);return(0,r.n9)(s.doc,h.pos)&&h.nodeBefore.type==h.nodeAfter.type&&s.join(h.pos),t(s.scrollIntoView()),!0}(t,n,e,l):function(e,t,n){let o=e.tr,s=n.parent;for(let e=n.end,t=n.endIndex-1,r=n.startIndex;t>r;t--)e-=s.child(t).nodeSize,o.delete(e-1,e+1);let l=o.doc.resolve(n.start),a=l.nodeAfter;if(o.mapping.map(n.end)!=n.start+l.nodeAfter.nodeSize)return!1;let c=0==n.startIndex,h=n.endIndex==s.childCount,d=l.node(-1),u=l.index(-1);if(!d.canReplace(u+(c?0:1),u+1,a.content.append(h?i.FK.empty:i.FK.from(s))))return!1;let p=l.pos,f=p+a.nodeSize;return o.step(new r.Wg(p-(c?1:0),f+(h?1:0),p+1,f-1,new i.Ji((c?i.FK.empty:i.FK.from(s.copy(i.FK.empty))).append(h?i.FK.empty:i.FK.from(s.copy(i.FK.empty))),c?0:1,h?0:1),c?0:1)),t(o.scrollIntoView()),!0}(t,n,l)))}}function l(e){return function(t,n){let{$from:o,$to:s}=t.selection,l=o.blockRange(s,(t=>t.childCount>0&&t.firstChild.type==e));if(!l)return!1;let a=l.startIndex;if(0==a)return!1;let c=l.parent,h=c.child(a-1);if(h.type!=e)return!1;if(n){let o=h.lastChild&&h.lastChild.type==c.type,s=i.FK.from(o?e.create():null),a=new i.Ji(i.FK.from(e.create(null,i.FK.from(c.type.create(null,s)))),o?3:1,0),d=l.start,u=l.end;n(t.tr.step(new r.Wg(d-(o?3:1),u,d,u,a,1,!0)).scrollIntoView())}return!0}}},95366(e,t,n){"use strict";n.d(t,{g:()=>l});var r=n(18891),i=n(48881),o=n(76051),s=n(57643);onDomReady((()=>{l.initialize()}));const l=function(){let e,t={};o.MediaItem.addEvent("toggleMenu",((t,n)=>{e.toggleForMediaItem(t,n)}));let a={initialize:function(){i.m.registerAllTargets(),function(){e=new s.A;let t=e.menuItems;Promise.all([n.e(7108),n.e(4652),n.e(552),n.e(697),n.e(9782)]).then(n.bind(n,60596)).then((({Modal:e})=>{e.addEvents({onImageMarkersLoad:function(e,t,n){ImageMarkers.initialize(e,t,n)},onImageMarkersUnload:function(){ImageMarkers.unload()}})})),t.addEvents({markers:function(e){r.Auth.required({onAuthorize:function(){let t={mediaImage:e};Promise.all([n.e(7108),n.e(4652),n.e(552),n.e(697),n.e(9782)]).then(n.bind(n,60596)).then((({Modal:n})=>{n.open({type:"module",name:"ImageMarkers",boxClass:"mediaLibraryModalBox editPhoto",clientOptions:t,serverOptions:{imageid:e.getID()}})}))}})},crop:function(e){r.Auth.required({onAuthorize:function(){let t=e.getContext(),n=instanceOf(t,
34i.m)?t:null;ImageCrop.showForMediaItem(e,n)}})},deleted:function(e){a.detach(e)},fullsize:function(e){let t=e.data.original();window.open(t)},copy:function(e){r.Auth.required({onAuthorize:e.copyToMediaLibrary.bind(e)})}})}()},detach:function(e){r.Auth.required({onAuthorize:function(){delete t[e.getGlobalID()],e.deleted()}})},browse:function(e){if(!r.Auth.isLoggedIn())return void r.Auth.required({onAuthorize:()=>l.browse(e)});let i=function(n){e.attachItem(n,((e,r,i)=>{r?(e&&delete t[e.getGlobalID()],n.whenReady((()=>{t[n.getGlobalID()]=!0}))):i&&alert(i)}))},s=(t,r)=>{let i,s,l=new Promise((e=>{i=e})),a=new Promise((e=>{s=e}));if("crop"===r)ImageCrop.showForMediaItem(o.MediaItem.createFromData(t),e,(e=>{i(),e?e.whenReady((()=>s())):s()}));else{let e=t.medium||t.standard||t.original||t.thumbnail,r=t.medium?t:{...t,medium:e&&e.replace(/\.[^./]+$/,".medium")},l=o.MediaItem.createFromData(r);Promise.all([n.e(7108),n.e(4652),n.e(552),n.e(697),n.e(9782)]).then(n.bind(n,60596)).then((({Modal:e})=>{e.open({type:"module",name:"ImageMarkers",boxClass:"mediaLibraryModalBox editPhoto",clientOptions:{mediaImage:l},serverOptions:{imageid:l.getID()},onClose:()=>{i(),l.whenReady((()=>s()))}})}))}return{closed:l,saved:a}};Promise.all([n.e(9967),n.e(6151),n.e(1819),n.e(5370),n.e(7179),n.e(5961),n.e(1218),n.e(2305),n.e(9462),n.e(2726),n.e(3086),n.e(8765),n.e(7358),n.e(9410),n.e(4032),n.e(2801),n.e(2628),n.e(4434)]).then(n.bind(n,22628)).then((({openMediaManager:n})=>{n({accepts:e.getMediaFilterName(),hiddenGlobalIds:Object.keys(t),browseOnly:e.isBrowseOnly?.()??!1,editItem:s}).then((t=>{if(!t)return;let n=o.MediaItem.createFromData(t);"crop"===t.filter_state?ImageCrop.showForMediaItem(n,e,(t=>{t?(e._displayLoading?.(!0),t.whenReady((()=>i(t)))):l.browse(e)})):i(n)}))}))}};return a}()}}]); 35//# sourceMappingURL=5959.2e60e9c5e3ae0e6fc428.js.map
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.