1/*! For license information please see 509.8cef6bba.chunk.js.LICENSE.txt */ 2"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[509],{1367:(t,e,n)=>{n.d(e,{A:()=>r});const r=(0,n(77784).A)("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]])},76833:(t,e,n)=>{n.d(e,{A:()=>r});const r=(0,n(77784).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},29868:(t,e,n)=>{n.d(e,{A:()=>r});const r=(0,n(77784).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},33908:(t,e,n)=>{n.d(e,{A:()=>r});const r=(0,n(77784).A)("ImagePlus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]])},73728:(t,e,n)=>{n.d(e,{A:()=>r});const r=(0,n(77784).A)("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]])},4596:(t,e,n)=>{n.d(e,{A:()=>r});const r=(0,n(77784).A)("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]])},87367:(t,e,n)=>{n.d(e,{A:()=>r});const r=(0,n(77784).A)("Skull",[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]])},82300:(t,e,n)=>{n.d(e,{A:()=>r});const r=(0,n(77784).A)("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]])},72330:(t,e,n)=>{var r=n(65043);var o="function"===typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t===1/e)||t!==t&&e!==e},i=r.useState,s=r.useEffect,a=r.useLayoutEffect,l=r.useDebugValue;function c(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!o(t,n)}catch(r){return!0}}var u="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),r=i({inst:{value:n,getSnapshot:e}}),o=r[0].inst,u=r[1];return a((function(){o.value=n,o.getSnapshot=e,c(o)&&u({inst:o})}),[t,n,e]),s((function(){return c(o)&&u({inst:o}),t((function(){c(o)&&u({inst:o})}))}),[t]),l(n),n};e.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},79717:(t,e,n)=>{var r=n(65043),o=n(29461);var i="function"===typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t===1/e)||t!==t&&e!==e},s=o.useSyncExternalStore,a=r.useRef,l=r.useEffect,c=r.useMemo,u=r.useDebugValue;e.useSyncExternalStoreWithSelector=function(t,e,n,r,o){var d=a(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=c((function(){function t(t){if(!l){if(l=!0,s=t,t=r(t),void 0!==o&&h.hasValue){var e=h.value;if(o(e,t))return a=e}return a=t}if(e=a,i(s,t))return e;var n=r(t);return void 0!==o&&o(e,n)?(s=t,e):(s=t,a=n)}var s,a,l=!1,c=void 0===n?null:n;return[function(){return t(e())},null===c?void 0:function(){return t(c())}]}),[e,n,r,o]);var p=s(t,d[0],d[1]);return l((function(){h.hasValue=!0,h.value=p}),[p]),u(p),p}},29461:(t,e,n)=>{t.exports=n(72330)},98443:(t,e,n)=>{t.exports=n(79717)},129:(t,e,n)=>{n.d(e,{KE:()=>On,YY:()=>yn,CU:()=>dn,Db:()=>_n,bP:()=>Wn,Yv:()=>Gn,gk:()=>oe,AB:()=>In,T7:()=>Zt,ur:()=>Kn,GG:()=>Ln,Nx:()=>Xt,gu:()=>ve,FF:()=>be,iI:()=>te,hO:()=>ke,fl:()=>we,Pg:()=>Z,zU:()=>le,QN:()=>Ee,J_:()=>Se,rU:()=>Bt,Op:()=>Oe,BQ:()=>Fe,OX:()=>Fn,Zc:()=>Yn,KV:()=>ae,jT:()=>Nn,Dd:()=>qn,kj:()=>Jn,JJ:()=>Bn,tG:()=>Rn});var r=n(89379),o=n(28115),i=n(54282),s=n(17184);const a=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function l(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const c=(t,e,n)=>{let r=l(t,n);if(!r)return!1;let a=p(r);if(!a){let n=r.blockRange(),i=n&&(0,o.jP)(n);return null!=i&&(e&&e(t.tr.lift(n,i).scrollIntoView()),!0)}let c=a.nodeBefore;if(x(t,a,e,-1))return!0;
2if(0==r.parent.content.size&&(d(c,"end")||s.nh.isSelectable(c)))for(let l=r.depth;;l--){let n=(0,o.$L)(t.doc,r.before(l),r.after(l),i.Ji.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(d(c,"end")?s.LN.findFrom(r.doc.resolve(r.mapping.map(a.pos,-1)),-1):s.nh.create(r.doc,a.pos-c.nodeSize)),e(r.scrollIntoView())}return!0}if(1==l||r.node(l-1).childCount>1)break}return!(!c.isAtom||a.depth!=r.depth-1)&&(e&&e(t.tr.delete(a.pos-c.nodeSize,a.pos).scrollIntoView()),!0)};function u(t,e,n){let r=e.nodeBefore,a=e.pos-1;for(;!r.isTextblock;a--){if(r.type.spec.isolating)return!1;let t=r.lastChild;if(!t)return!1;r=t}let l=e.nodeAfter,c=e.pos+1;for(;!l.isTextblock;c++){if(l.type.spec.isolating)return!1;let t=l.firstChild;if(!t)return!1;l=t}let u=(0,o.$L)(t.doc,a,c,i.Ji.empty);if(!u||u.from!=a||u instanceof o.Ln&&u.slice.size>=c-a)return!1;if(n){let e=t.tr.step(u);e.setSelection(s.U3.create(e.doc,a)),n(e.scrollIntoView())}return!0}function d(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}const h=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=p(r)}let a=i&&i.nodeBefore;return!(!a||!s.nh.isSelectable(a))&&(e&&e(t.tr.setSelection(s.nh.create(t.doc,i.pos-a.nodeSize)).scrollIntoView()),!0)};function p(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function f(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const m=(t,e,n)=>{let r=f(t,n);if(!r)return!1;let a=y(r);if(!a)return!1;let l=a.nodeAfter;if(x(t,a,e,1))return!0;if(0==r.parent.content.size&&(d(l,"start")||s.nh.isSelectable(l))){let n=(0,o.$L)(t.doc,r.before(),r.after(),i.Ji.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(d(l,"start")?s.LN.findFrom(r.doc.resolve(r.mapping.map(a.pos)),1):s.nh.create(r.doc,r.mapping.map(a.pos))),e(r.scrollIntoView())}return!0}}return!(!l.isAtom||a.depth!=r.depth-1)&&(e&&e(t.tr.delete(a.pos,a.pos+l.nodeSize).scrollIntoView()),!0)},g=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=y(r)}let a=i&&i.nodeAfter;return!(!a||!s.nh.isSelectable(a))&&(e&&e(t.tr.setSelection(s.nh.create(t.doc,i.pos)).scrollIntoView()),!0)};function y(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const v=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)};function D(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const b=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),a=D(o.contentMatchAt(i));if(!a||!o.canReplaceWith(i,i,a))return!1;if(e){let r=n.after(),o=t.tr.replaceWith(r,r,a.createAndFill());o.setSelection(s.LN.near(o.doc.resolve(r),1)),e(o.scrollIntoView())}return!0},k=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof s.i5||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=D(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,a=t.tr.insert(n,i.createAndFill());a.setSelection(s.U3.create(a.doc,n+1)),e(a.scrollIntoView())}return!0},w=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if((0,o.zy)(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&(0,o.jP)(r);return null!=i&&(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};const C=(t,e)=>{let{$from:n,$to:r}=t.selection;if(t.selection instanceof s.nh&&t.selection.node.isBlock)return!(!n.parentOffset||!(0,o.zy)(t.doc,n.pos))&&(e&&e(t.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let i,a,l=[],c=!1,u=!1;for(let o=n.depth;;o--){if(n.node(o).isBlock){c=n.end(o)==n.pos+(n.depth-o),u=n.start(o)==n.pos-(n.depth-o),a=D(n.node(o-1).contentMatchAt(n.indexAfter(o-1)));let t=A&&A(r.parent,c,n);l.unshift(t||(c&&a?{type:a}:null)),i=o;break}if(1==o)return!1;l.unshift(null)}let d=t.tr;(t.selection instanceof s.U3||t.selection instanceof s.i5)&&d.deleteSelection();let h=d.mapping.map(n.pos),p=(0,o.zy)(d.doc,h,l.length,l);if(p||(l[0]=a?{type:a}:null,p=(0,o.zy)(d.doc,h,l.length,l)),!p)return!1;if(d.split(h,l.length,l),!c&&u&&n.node(i).type!=a){let t=d.mapping.map(n.before(i)),e=d.doc.resolve(t);a&&n.node(i-1).canReplaceWith(e.index(),e.index()+1,a)&&d.setNodeMarkup(d.mapping.map(n.before(i)),a)}return e&&e(d.scrollIntoView()),!0};var A;function x(t,e,n,r){let a,l,c=e.nodeBefore,u=e.nodeAfter,h=c.type.spec.isolating||u.type.spec.isolating;if(!h&&function(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!!(r&&i&&r.type.compatibleContent(i.type))&&(!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!(!e.parent.canReplace(s,s+1)||!i.isTextblock&&!(0,o.n9)(t.doc,e.pos))&&(n&&n(t.tr.join(e.pos).scrollIntoView()),!0))}(t,e,n))return!0;let p=!h&&e.parent.canReplace(e.index(),e.index()+1);if(p&&(a=(l=c.contentMatchAt(c.childCount)).findWrapping(u.type))&&l.matchType(a[0]||u.type).validEnd){if(n){let r=e.pos+u.nodeSize,s=i.FK.empty;for(let t=a.length-1;t>=0;t--)s=i.FK.from(a[t].create(null,s));s=i.FK.from(c.copy(s));let l=t.tr.step(new o.Wg(e.pos-1,r,e.pos,r,new i.Ji(s,1,0),a.length,!0)),d=l.doc.resolve(r+2*a.length);d.nodeAfter&&d.nodeAfter.type==c.type&&(0,o.n9)(l.doc,d.pos)&&l.join(d.pos),n(l.scrollIntoView())}return!0}let f=u.type.spec.isolating||r>0&&h?null:s.LN.findFrom(e,1),m=f&&f.$from.blockRange(f.$to),g=m&&(0,o.jP)(m);if(null!=g&&g>=e.depth)return n&&n(t.tr.lift(m,g).scrollIntoView()),!0;if(p&&d(u,"start",!0)&&d(c,"end")){let r=c,s=[];for(;s.push(r),!r.isTextblock;)r=r.lastChild;let a=u,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,a.content)){if(n){let r=i.FK.empty;for(let t=s.length-1;t>=0;t--)r=i.FK.from(s[t].copy(r));n(t.tr.step(new o.Wg(e.pos-s.length,e.pos+u.nodeSize,e.pos+l,e.pos+u.nodeSize-l,new i.Ji(r,s.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function E(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(e.tr.setSelection(s.U3.create(e.doc,t<0?o.start(i):o.end(i)))),!0)}}const S=E(-1),M=E(1);function T(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){let o=!1;for(let i=0;i<n.selection.ranges.length&&!o;i++){let{$from:{pos:r},$to:{pos:s}}=n.selection.ranges[i];n.doc.nodesBetween(r,s,((r,i)=>{if(o)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)o=!0;else{let e=n.doc.resolve(i),r=e.index();o=e.parent.canReplaceWith(r,r+1,t)}}))}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];o.setBlockType(i,s,t,e)}r(o.scrollIntoView())}return!0}}function O(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t,n,r){for(let o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}let F=O(a,c,h),N=O(a,m,g);const B={Enter:O(v,k,w,C),"Mod-Enter":b,Backspace:F,"Mod-Backspace":F,"Shift-Backspace":F,Delete:N,"Mod-Delete":N,"Mod-a":(t,e)=>(e&&e(t.tr.setSelection(new s.i5(t.doc))),!0)},R={"Ctrl-h":B.Backspace,"Alt-Backspace":B["Mod-Backspace"],"Ctrl-d":B.Delete,"Ctrl-Alt-Backspace":B["Mod-Delete"],"Alt-Delete":B["Mod-Delete"],"Alt-d":B["Mod-Delete"],"Ctrl-a":S,"Ctrl-e":M};for(let Zn in B)R[Zn]=B[Zn];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&os.platform();function I(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){let{$from:s,$to:a}=n.selection,l=s.blockRange(a);if(!l)return!1;let c=r?n.tr:null;return!!function(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=!1,a=e,l=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&0==e.startIndex){
2if(0==e.$from.index(e.depth-1))return!1;let t=l.resolve(e.start-2);a=new i.u$(t,t,e.depth),e.endIndex<e.parent.childCount&&(e=new i.u$(e.$from,l.resolve(e.$to.end(e.depth)),e.depth)),s=!0}let c=(0,o.oM)(a,n,r,e);if(!c)return!1;t&&function(t,e,n,r,s){let a=i.FK.empty;for(let o=n.length-1;o>=0;o--)a=i.FK.from(n[o].type.create(n[o].attrs,a));t.step(new o.Wg(e.start-(r?2:0),e.end,e.start,e.end,new i.Ji(a,0,0),n.length,!0));let l=0;for(let o=0;o<n.length;o++)n[o].type==s&&(l=o+1);let c=n.length-l,u=e.start+n.length-(r?2:0),d=e.parent;for(let i=e.startIndex,h=e.endIndex,p=!0;i<h;i++,p=!1)!p&&(0,o.zy)(t.doc,u,c)&&(t.split(u,c),u+=2*c),u+=d.child(i).nodeSize}(t,e,c,s,n);return!0}(c,l,t,e)&&(r&&r(c.scrollIntoView()),!0)}}function L(t){return function(e,n){let{$from:r,$to:s}=e.selection,a=r.blockRange(s,(e=>e.childCount>0&&e.firstChild.type==t));return!!a&&(!n||(r.node(a.depth-1).type==t?function(t,e,n,r){let s=t.tr,a=r.end,l=r.$to.end(r.depth);a<l&&(s.step(new o.Wg(a-1,l,a,l,new i.Ji(i.FK.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new i.u$(s.doc.resolve(r.$from.pos),s.doc.resolve(l),r.depth));const c=(0,o.jP)(r);if(null==c)return!1;s.lift(r,c);let u=s.doc.resolve(s.mapping.map(a,-1)-1);(0,o.n9)(s.doc,u.pos)&&u.nodeBefore.type==u.nodeAfter.type&&s.join(u.pos);return e(s.scrollIntoView()),!0}(e,n,t,a):function(t,e,n){let r=t.tr,s=n.parent;for(let o=n.end,i=n.endIndex-1,m=n.startIndex;i>m;i--)o-=s.child(i).nodeSize,r.delete(o-1,o+1);let a=r.doc.resolve(n.start),l=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let c=0==n.startIndex,u=n.endIndex==s.childCount,d=a.node(-1),h=a.index(-1);if(!d.canReplace(h+(c?0:1),h+1,l.content.append(u?i.FK.empty:i.FK.from(s))))return!1;let p=a.pos,f=p+l.nodeSize;return r.step(new o.Wg(p-(c?1:0),f+(u?1:0),p+1,f-1,new i.Ji((c?i.FK.empty:i.FK.from(s.copy(i.FK.empty))).append(u?i.FK.empty:i.FK.from(s.copy(i.FK.empty))),c?0:1,u?0:1),c?0:1)),e(r.scrollIntoView()),!0}(e,n,a)))}}var P=n(11140),z=n(62195);var $=Object.defineProperty,j=(t,e)=>{for(var n in e)$(t,n,{get:e[n],enumerable:!0})};function V(t){const{state:e,transaction:n}=t;let{selection:o}=n,{doc:i}=n,{storedMarks:s}=n;return(0,r.A)((0,r.A)({},e),{},{apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return o},get doc(){return i},get tr(){return o=n.selection,i=n.doc,s=n.storedMarks,n}})}var H=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){var t=this;const{rawCommands:e,editor:n,state:r}=this,{view:o}=n,{tr:i}=r,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map((e=>{let[n,r]=e;return[n,function(){const e=r(...arguments)(s);return i.getMeta("preventDispatch")||t.hasCustomState||o.dispatch(i),e}]})))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t){var e=this;let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{rawCommands:o,editor:i,state:s}=this,{view:a}=i,l=[],c=!!t,u=t||s.tr,d=(0,r.A)((0,r.A)({},Object.fromEntries(Object.entries(o).map((t=>{let[r,o]=t;return[r,function(){const t=e.buildProps(u,n),r=o(...arguments)(t);return l.push(r),d}]})))),{},{run:()=>(c||!n||u.getMeta("preventDispatch")||this.hasCustomState||a.dispatch(u),l.every((t=>!0===t)))});return d}createCan(t){const{rawCommands:e,state:n}=this,o=!1,i=t||n.tr,s=this.buildProps(i,o),a=Object.fromEntries(Object.entries(e).map((t=>{let[e,n]=t;return[e,function(){return n(...arguments)((0,r.A)((0,r.A)({},s),{},{dispatch:void 0}))}]})));return(0,r.A)((0,r.A)({},a),{},{chain:()=>this.createChain(i,o)})}buildProps(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s={tr:t,editor:r,view:i,state:V({state:o,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map((t=>{let[e,n]=t;return[e,function(){return n(...arguments)(s)}]})))}};return s}},K={};j(K,{blur:()=>q,clearContent:()=>J,clearNodes:()=>U,command:()=>_,createParagraphNear:()=>W,cut:()=>G,deleteCurrentNode:()=>Y,deleteNode:()=>X,deleteRange:()=>Q,deleteSelection:()=>tt,enter:()=>et,exitCode:()=>nt,extendMarkRange:()=>ct,first:()=>
2ut,focus:()=>gt,forEach:()=>yt,insertContent:()=>vt,insertContentAt:()=>wt,joinBackward:()=>xt,joinDown:()=>At,joinForward:()=>Et,joinItemBackward:()=>St,joinItemForward:()=>Mt,joinTextblockBackward:()=>Tt,joinTextblockForward:()=>Ot,joinUp:()=>Ct,keyboardShortcut:()=>Nt,lift:()=>Rt,liftEmptyBlock:()=>It,liftListItem:()=>Lt,newlineInCode:()=>Pt,resetAttributes:()=>jt,scrollIntoView:()=>Vt,selectAll:()=>Ht,selectNodeBackward:()=>Kt,selectNodeForward:()=>qt,selectParentNode:()=>Jt,selectTextblockEnd:()=>Ut,selectTextblockStart:()=>_t,setContent:()=>Gt,setMark:()=>Ie,setMeta:()=>Le,setNode:()=>Pe,setNodeSelection:()=>ze,setTextDirection:()=>$e,setTextSelection:()=>je,sinkListItem:()=>Ve,splitBlock:()=>Ke,splitListItem:()=>qe,toggleList:()=>_e,toggleMark:()=>We,toggleNode:()=>Ge,toggleWrap:()=>Ye,undoInputRule:()=>Ze,unsetAllMarks:()=>Xe,unsetMark:()=>Qe,unsetTextDirection:()=>tn,updateAttributes:()=>en,wrapIn:()=>nn,wrapInList:()=>rn});var q=()=>t=>{let{editor:e,view:n}=t;return requestAnimationFrame((()=>{var t;e.isDestroyed||(n.dom.blur(),null==(t=null==window?void 0:window.getSelection())||t.removeAllRanges())})),!0},J=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return e=>{let{commands:n}=e;return n.setContent("",{emitUpdate:t})}},U=()=>t=>{let{state:e,tr:n,dispatch:r}=t;const{selection:i}=n,{ranges:s}=i;return!r||(s.forEach((t=>{let{$from:r,$to:i}=t;e.doc.nodesBetween(r.pos,i.pos,((t,e)=>{if(t.type.isText)return;const{doc:r,mapping:i}=n,s=r.resolve(i.map(e)),a=r.resolve(i.map(e+t.nodeSize)),l=s.blockRange(a);if(!l)return;const c=(0,o.jP)(l);if(t.type.isTextblock){const{defaultType:t}=s.parent.contentMatchAt(s.index());n.setNodeMarkup(l.start,t)}(c||0===c)&&n.lift(l,c)}))})),!0)},_=t=>e=>t(e),W=()=>t=>{let{state:e,dispatch:n}=t;return k(e,n)},G=(t,e)=>n=>{let{editor:r,tr:o}=n;const{state:i}=r,a=i.doc.slice(t.from,t.to);o.deleteRange(t.from,t.to);const l=o.mapping.map(e);return o.insert(l,a.content),o.setSelection(new s.U3(o.doc.resolve(Math.max(l-1,0)))),!0},Y=()=>t=>{let{tr:e,dispatch:n}=t;const{selection:r}=e,o=r.$anchor.node();if(o.content.size>0)return!1;const i=e.selection.$anchor;for(let s=i.depth;s>0;s-=1){if(i.node(s).type===o.type){if(n){const t=i.before(s),n=i.after(s);e.delete(t,n).scrollIntoView()}return!0}}return!1};function Z(t,e){if("string"===typeof t){if(!e.nodes[t])throw Error("There is no node type named '".concat(t,"'. Maybe you forgot to add the extension?"));return e.nodes[t]}return t}var X=t=>e=>{let{tr:n,state:r,dispatch:o}=e;const i=Z(t,r.schema),s=n.selection.$anchor;for(let t=s.depth;t>0;t-=1){if(s.node(t).type===i){if(o){const e=s.before(t),r=s.after(t);n.delete(e,r).scrollIntoView()}return!0}}return!1},Q=t=>e=>{let{tr:n,dispatch:r}=e;const{from:o,to:i}=t;return r&&n.delete(o,i),!0},tt=()=>t=>{let{state:e,dispatch:n}=t;return a(e,n)},et=()=>t=>{let{commands:e}=t;return e.keyboardShortcut("Enter")},nt=()=>t=>{let{state:e,dispatch:n}=t;return b(e,n)};function rt(t){return"[object RegExp]"===Object.prototype.toString.call(t)}function ot(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{strict:!0};const r=Object.keys(e);return!r.length||r.every((r=>n.strict?e[r]===t[r]:rt(e[r])?e[r].test(t[r]):e[r]===t[r]))}function it(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.find((t=>t.type===e&&ot(Object.fromEntries(Object.keys(n).map((e=>[e,t.attrs[e]]))),n)))}function st(t,e){return!!it(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function at(t,e,n){var r;if(!t||!e)return;let o=t.parent.childAfter(t.parentOffset);if(o.node&&o.node.marks.some((t=>t.type===e))||(o=t.parent.childBefore(t.parentOffset)),!o.node||!o.node.marks.some((t=>t.type===e)))return;n=n||(null==(r=o.node.marks[0])?void 0:r.attrs);if(!it([...o.node.marks],e,n))return;let i=o.index,s=t.start()+o.offset,a=i+1,l=s+o.node.nodeSize;for(;i>0&&st([...t.parent.child(i-1).marks],e,n);)i-=1,s-=t.parent.child(i).nodeSize;for(;a<t.parent.childCount&&st([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function lt(t,e){if("string"===typeof t){if(!e.marks[t])throw Error("There is no mark type named '".concat(t,"'. Maybe you forgot to add the extension?"));return e.marks[t]}return t}var ct=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{tr:r,state:o,dispatch:i}=n;const a=lt(t,o.schema),{doc:l,selection:c}=r,{$from:u,from:d,to:h}=c;if(i){const t=at(u,a,e);if(t&&t.from<=d&&t.to>=h){const e=s.U3.create(l,t.from,t.to);r.setSelection(e)}}return!0}},ut=t=>e=>{const n="function"===typeof t?t(e):t;for(let t=0;t<n.length;t+=1)if(n[t](e))return!0;return!1};function dt(t){return t instanceof s.U3}function ht(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Math.min(Math.max(t,e),n)}function pt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return null;const n=s.LN.atStart(t),r=s.LN.atEnd(t);if("start"===e||!0===e)return n;if("end"===e)return r;const o=n.from,i=r.to;return"all"===e?s.U3.create(t,ht(0,o,i),ht(t.content.size,o,i)):s.U3.create(t,ht(e,o,i),ht(e,o,i))}function ft(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function mt(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var gt=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{editor:o,view:i,tr:s,dispatch:a}=n;e=(0,r.A)({scrollIntoView:!0},e);const l=()=>{(mt()||ft())&&i.dom.focus(),requestAnimationFrame((()=>{o.isDestroyed||(i.focus(),(null==e?void 0:e.scrollIntoView)&&o.commands.scrollIntoView())}))};if(i.hasFocus()&&null===t||!1===t)return!0;
2if(a&&null===t&&!dt(o.state.selection))return l(),!0;const c=pt(s.doc,t)||o.state.selection,u=o.state.selection.eq(c);return a&&(u||s.setSelection(c),u&&s.storedMarks&&s.setStoredMarks(s.storedMarks),l()),!0}},yt=(t,e)=>n=>t.every(((t,o)=>e(t,(0,r.A)((0,r.A)({},n),{},{index:o})))),vt=(t,e)=>n=>{let{tr:r,commands:o}=n;return o.insertContentAt({from:r.selection.from,to:r.selection.to},t,e)},Dt=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):1===r.nodeType&&Dt(r)}return t};function bt(t){if("undefined"===typeof window)throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e="<body>".concat(t,"</body>"),n=(new window.DOMParser).parseFromString(e,"text/html").body;return Dt(n)}function kt(t,e,n){if(t instanceof i.bP||t instanceof i.FK)return t;n=(0,r.A)({slice:!0,parseOptions:{}},n);const o="string"===typeof t;if("object"===typeof t&&null!==t)try{if(Array.isArray(t)&&t.length>0)return i.FK.fromArray(t.map((t=>e.nodeFromJSON(t))));const r=e.nodeFromJSON(t);return n.errorOnInvalidContent&&r.check(),r}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),kt("",e,n)}if(o){if(n.errorOnInvalidContent){let r=!1,o="";const s=new i.Sj({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:t=>(r=!0,o="string"===typeof t?t:t.outerHTML,null)}]}})});if(n.slice?i.S4.fromSchema(s).parseSlice(bt(t),n.parseOptions):i.S4.fromSchema(s).parse(bt(t),n.parseOptions),n.errorOnInvalidContent&&r)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error("Invalid element found: ".concat(o))})}const r=i.S4.fromSchema(e);return n.slice?r.parseSlice(bt(t),n.parseOptions).content:r.parse(bt(t),n.parseOptions)}return kt("",e,n)}var wt=(t,e,n)=>a=>{let{tr:l,dispatch:c,editor:u}=a;var d;if(c){let a;n=(0,r.A)({parseOptions:u.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1},n);const c=t=>{u.emit("contentError",{editor:u,error:t,disableCollaboration:()=>{"collaboration"in u.storage&&"object"===typeof u.storage.collaboration&&u.storage.collaboration&&(u.storage.collaboration.isDisabled=!0)}})},p=(0,r.A)({preserveWhitespace:"full"},n.parseOptions);if(!n.errorOnInvalidContent&&!u.options.enableContentCheck&&u.options.emitContentError)try{kt(e,u.schema,{parseOptions:p,errorOnInvalidContent:!0})}catch(h){c(h)}try{a=kt(e,u.schema,{parseOptions:p,errorOnInvalidContent:null!=(d=n.errorOnInvalidContent)?d:u.options.enableContentCheck})}catch(h){return c(h),!1}let{from:f,to:m}="number"===typeof t?{from:t,to:t}:{from:t.from,to:t.to},g=!0,y=!0;if(("type"in a?[a]:a).forEach((t=>{t.check(),g=!!g&&(t.isText&&0===t.marks.length),y=!!y&&t.isBlock})),f===m&&y){const{parent:t}=l.doc.resolve(f);t.isTextblock&&!t.type.spec.code&&!t.childCount&&(f-=1,m+=1)}let v;if(g){if(Array.isArray(e))v=e.map((t=>t.text||"")).join("");else if(e instanceof i.FK){let t="";e.forEach((e=>{e.text&&(t+=e.text)})),v=t}else v="object"===typeof e&&e&&e.text?e.text:e;l.insertText(v,f,m)}else{v=a;const t=l.doc.resolve(f),e=t.node(),n=0===t.parentOffset,r=e.isText||e.isTextblock,o=e.content.size>0;n&&r&&o&&(f=Math.max(0,f-1)),l.replaceWith(f,m,v)}n.updateSelection&&function(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof o.Ln||i instanceof o.Wg))return;const a=t.mapping.maps[r];let l=0;a.forEach(((t,e,n,r)=>{0===l&&(l=r)})),t.setSelection(s.LN.near(t.doc.resolve(l),n))}(l,l.steps.length-1,-1),n.applyInputRules&&l.setMeta("applyInputRules",{from:f,text:v}),n.applyPasteRules&&l.setMeta("applyPasteRules",{from:f,text:v})}return!0},Ct=()=>t=>{let{state:e,dispatch:n}=t;return((t,e)=>{let n,r=t.selection,i=r instanceof s.nh;if(i){if(r.node.isTextblock||!(0,o.n9)(t.doc,r.from))return!1;n=r.from}else if(n=(0,o.N0)(t.doc,r.from,-1),null==n)return!1;if(e){let r=t.tr.join(n);i&&r.setSelection(s.nh.create(r.doc,n-t.doc.resolve(n).nodeBefore.nodeSize)),e(r.scrollIntoView())}return!0})(e,n)},At=()=>t=>{let{state:e,dispatch:n}=t;return((t,e)=>{let n,r=t.selection;if(r instanceof s.nh){if(r.node.isTextblock||!(0,o.n9)(t.doc,r.to))return!1;n=r.to}else if(n=(0,o.N0)(t.doc,r.to,1),null==n)return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0})(e,n)},xt=()=>t=>{let{state:e,dispatch:n}=t;return c(e,n)},Et=()=>t=>{let{state:e,dispatch:n}=t;return m(e,n)},St=()=>t=>{let{state:e,dispatch:n,tr:r}=t;try{const t=(0,o.N0)(e.doc,e.selection.$from.pos,-1);return null!==t&&void 0!==t&&(r.join(t,2),n&&n(r),!0)}catch(i){return!1}},Mt=()=>t=>{let{state:e,dispatch:n,tr:r}=t;try{const t=(0,o.N0)(e.doc,e.selection.$from.pos,1);return null!==t&&void 0!==t&&(r.join(t,2),n&&n(r),!0)}catch(i){return!1}},Tt=()=>t=>{let{state:e,dispatch:n}=t;return((t,e,n)=>{let r=l(t,n);if(!r)return!1;let o=p(r);return!!o&&u(t,o,e)})(e,n)},Ot=()=>t=>{let{state:e,dispatch:n}=t;return((t,e,n)=>{let r=f(t,n);if(!r)return!1;let o=y(r);return!!o&&u(t,o,e)})(e,n)};function Ft(){return"undefined"!==typeof navigator&&/Mac/.test(navigator.platform)}var Nt=t=>e=>{let{editor:n,view:r,tr:o,dispatch:i}=e;const s=function(t){const e=t.split(/-(?!$)/);let n,r,o,i,s=e[e.length-1];"Space"===s&&(s=" ");for(let a=0;a<e.length-1;a+=1){const t=e[a];if(/^(cmd|meta|m)$/i.test(t))i=!0;else if(/^a(lt)?$/i.test(t))n=!0;else if(/^(c|ctrl|control)$/i.test(t))r=!0;else if(/^s(hift)?$/i.test(t))o=!0;else{if(!/^mod$/i.test(t))throw new Error("Unrecognized modifier name: ".concat(t));mt()||Ft()?i=!0:r=!0}}return n&&(s="Alt-".concat(s)),r&&(s="Ctrl-".concat(s)),i&&(s="Meta-".concat(s)),o&&(s="Shift-".concat(s)),s}(t).split(/-(?!$)/),a=s.find((t=>!["Alt","Ctrl","Meta","Shift"].includes(t))),l=new KeyboardEvent("keydown",{key:"Space"
2===a?" ":a,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),c=n.captureTransaction((()=>{r.someProp("handleKeyDown",(t=>t(r,l)))}));return null==c||c.steps.forEach((t=>{const e=t.map(o.mapping);e&&i&&o.maybeStep(e)})),!0};function Bt(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{from:r,to:o,empty:i}=t.selection,s=e?Z(e,t.schema):null,a=[];t.doc.nodesBetween(r,o,((t,e)=>{if(t.isText)return;const n=Math.max(r,e),i=Math.min(o,e+t.nodeSize);a.push({node:t,from:n,to:i})}));const l=o-r,c=a.filter((t=>!s||s.name===t.node.type.name)).filter((t=>ot(t.node.attrs,n,{strict:!1})));if(i)return!!c.length;return c.reduce(((t,e)=>t+e.to-e.from),0)>=l}var Rt=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{state:r,dispatch:i}=n;return!!Bt(r,Z(t,r.schema),e)&&((t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),s=i&&(0,o.jP)(i);return null!=s&&(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)})(r,i)}},It=()=>t=>{let{state:e,dispatch:n}=t;return w(e,n)},Lt=t=>e=>{let{state:n,dispatch:r}=e;return L(Z(t,n.schema))(n,r)},Pt=()=>t=>{let{state:e,dispatch:n}=t;return v(e,n)};function zt(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function $t(t,e){const n="string"===typeof e?[e]:e;return Object.keys(t).reduce(((e,r)=>(n.includes(r)||(e[r]=t[r]),e)),{})}var jt=(t,e)=>n=>{let{tr:r,state:o,dispatch:i}=n,s=null,a=null;const l=zt("string"===typeof t?t:t.name,o.schema);if(!l)return!1;"node"===l&&(s=Z(t,o.schema)),"mark"===l&&(a=lt(t,o.schema));let c=!1;return r.selection.ranges.forEach((t=>{o.doc.nodesBetween(t.$from.pos,t.$to.pos,((t,n)=>{s&&s===t.type&&(c=!0,i&&r.setNodeMarkup(n,void 0,$t(t.attrs,e))),a&&t.marks.length&&t.marks.forEach((o=>{a===o.type&&(c=!0,i&&r.addMark(n,n+t.nodeSize,a.create($t(o.attrs,e))))}))}))})),c},Vt=()=>t=>{let{tr:e,dispatch:n}=t;return n&&e.scrollIntoView(),!0},Ht=()=>t=>{let{tr:e,dispatch:n}=t;if(n){const t=new s.i5(e.doc);e.setSelection(t)}return!0},Kt=()=>t=>{let{state:e,dispatch:n}=t;return h(e,n)},qt=()=>t=>{let{state:e,dispatch:n}=t;return g(e,n)},Jt=()=>t=>{let{state:e,dispatch:n}=t;return((t,e)=>{let n,{$from:r,to:o}=t.selection,i=r.sharedDepth(o);return 0!=i&&(n=r.before(i),e&&e(t.tr.setSelection(s.nh.create(t.doc,n))),!0)})(e,n)},Ut=()=>t=>{let{state:e,dispatch:n}=t;return M(e,n)},_t=()=>t=>{let{state:e,dispatch:n}=t;return S(e,n)};function Wt(t,e){return kt(t,e,{slice:!1,parseOptions:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},errorOnInvalidContent:(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).errorOnInvalidContent})}var Gt=function(t){let{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o=>{let{editor:i,tr:s,dispatch:a,commands:l}=o;const{doc:c}=s;if("full"!==r.preserveWhitespace){const o=Wt(t,i.schema,r,{errorOnInvalidContent:null!=e?e:i.options.enableContentCheck});return a&&s.replaceWith(0,c.content.size,o).setMeta("preventUpdate",!n),!0}return a&&s.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:c.content.size},t,{parseOptions:r,errorOnInvalidContent:null!=e?e:i.options.enableContentCheck})}};function Yt(t,e){const n=lt(e,t.schema),{from:o,to:i,empty:s}=t.selection,a=[];s?(t.storedMarks&&a.push(...t.storedMarks),a.push(...t.selection.$head.marks())):t.doc.nodesBetween(o,i,(t=>{a.push(...t.marks)}));const l=a.find((t=>t.type.name===n.name));return l?(0,r.A)({},l.attrs):{}}function Zt(t,e){const n=new o.dL(t);return e.forEach((t=>{t.steps.forEach((t=>{n.step(t)}))})),n}function Xt(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,((t,e)=>{n(t)&&r.push({node:t,pos:e})})),r}function Qt(t){return e=>function(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}(e.$from,t)}function te(t,e,n){if(void 0===t.config[e]&&t.parent)return te(t.parent,e,n);if("function"===typeof t.config[e]){return t.config[e].bind((0,r.A)((0,r.A)({},n),{},{parent:t.parent?te(t.parent,e,n):null}))}return t.config[e]}function ee(t){return t.map((t=>{const e=te(t,"addExtensions",{name:t.name,options:t.options,storage:t.storage});return e?[t,...ee(e())]:t})).flat(10)}function ne(t,e){const n=i.ZF.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function re(t){return"function"===typeof t}function oe(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(re(t)){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return e?t.bind(e)(...r):t(...r)}return t}function ie(t){return{baseExtensions:t.filter((t=>"extension"===t.type)),nodeExtensions:t.filter((t=>"node"===t.type)),markExtensions:t.filter((t=>"mark"===t.type))}}function se(t){const e=[],{nodeExtensions:n,markExtensions:o}=ie(t),i=[...n,...o],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach((t=>{const n=te(t,"addGlobalAttributes",{name:t.name,options:t.options,storage:t.storage,extensions:i});if(!n)return;
2n().forEach((t=>{t.types.forEach((n=>{Object.entries(t.attributes).forEach((t=>{let[o,i]=t;e.push({type:n,name:o,attribute:(0,r.A)((0,r.A)({},s),i)})}))}))}))})),i.forEach((t=>{const n={name:t.name,options:t.options,storage:t.storage},o=te(t,"addAttributes",n);if(!o)return;const i=o();Object.entries(i).forEach((n=>{let[o,i]=n;const a=(0,r.A)((0,r.A)({},s),i);"function"===typeof(null==a?void 0:a.default)&&(a.default=a.default()),(null==a?void 0:a.isRequired)&&void 0===(null==a?void 0:a.default)&&delete a.default,e.push({type:t.name,name:o,attribute:a})}))})),e}function ae(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.filter((t=>!!t)).reduce(((t,e)=>{const n=(0,r.A)({},t);return Object.entries(e).forEach((t=>{let[e,r]=t;if(n[e])if("class"===e){const t=r?String(r).split(" "):[],o=n[e]?n[e].split(" "):[],i=t.filter((t=>!o.includes(t)));n[e]=[...o,...i].join(" ")}else if("style"===e){const t=r?r.split(";").map((t=>t.trim())).filter(Boolean):[],o=n[e]?n[e].split(";").map((t=>t.trim())).filter(Boolean):[],i=new Map;o.forEach((t=>{const[e,n]=t.split(":").map((t=>t.trim()));i.set(e,n)})),t.forEach((t=>{const[e,n]=t.split(":").map((t=>t.trim()));i.set(e,n)})),n[e]=Array.from(i.entries()).map((t=>{let[e,n]=t;return"".concat(e,": ").concat(n)})).join("; ")}else n[e]=r;else n[e]=r})),n}),{})}function le(t,e){return e.filter((e=>e.type===t.type.name)).filter((t=>t.attribute.rendered)).map((e=>e.attribute.renderHTML?e.attribute.renderHTML(t.attrs)||{}:{[e.name]:t.attrs[e.name]})).reduce(((t,e)=>ae(t,e)),{})}function ce(t,e){return"style"in t?t:(0,r.A)((0,r.A)({},t),{},{getAttrs:n=>{const o=t.getAttrs?t.getAttrs(n):t.attrs;if(!1===o)return!1;const i=e.reduce(((t,e)=>{const o=e.attribute.parseHTML?e.attribute.parseHTML(n):function(t){return"string"!==typeof t?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):"true"===t||"false"!==t&&t}(n.getAttribute(e.name));return null===o||void 0===o?t:(0,r.A)((0,r.A)({},t),{},{[e.name]:o})}),{});return(0,r.A)((0,r.A)({},o),i)}})}function ue(t){return Object.fromEntries(Object.entries(t).filter((t=>{let[e,n]=t;return("attrs"!==e||!function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 0===Object.keys(t).length&&t.constructor===Object}(n))&&(null!==n&&void 0!==n)})))}function de(t){var e,n;const r={};return!(null==(e=null==t?void 0:t.attribute)?void 0:e.isRequired)&&"default"in((null==t?void 0:t.attribute)||{})&&(r.default=t.attribute.default),void 0!==(null==(n=null==t?void 0:t.attribute)?void 0:n.validate)&&(r.validate=t.attribute.validate),[t.name,r]}function he(t,e){var n;const o=se(t),{nodeExtensions:s,markExtensions:a}=ie(t),l=null==(n=s.find((t=>te(t,"topNode"))))?void 0:n.name,c=Object.fromEntries(s.map((n=>{const i=o.filter((t=>t.type===n.name)),s={name:n.name,options:n.options,storage:n.storage,editor:e},a=t.reduce(((t,e)=>{const o=te(e,"extendNodeSchema",s);return(0,r.A)((0,r.A)({},t),o?o(n):{})}),{}),l=ue((0,r.A)((0,r.A)({},a),{},{content:oe(te(n,"content",s)),marks:oe(te(n,"marks",s)),group:oe(te(n,"group",s)),inline:oe(te(n,"inline",s)),atom:oe(te(n,"atom",s)),selectable:oe(te(n,"selectable",s)),draggable:oe(te(n,"draggable",s)),code:oe(te(n,"code",s)),whitespace:oe(te(n,"whitespace",s)),linebreakReplacement:oe(te(n,"linebreakReplacement",s)),defining:oe(te(n,"defining",s)),isolating:oe(te(n,"isolating",s)),attrs:Object.fromEntries(i.map(de))})),c=oe(te(n,"parseHTML",s));c&&(l.parseDOM=c.map((t=>ce(t,i))));const u=te(n,"renderHTML",s);u&&(l.toDOM=t=>u({node:t,HTMLAttributes:le(t,i)}));const d=te(n,"renderText",s);return d&&(l.toText=d),[n.name,l]}))),u=Object.fromEntries(a.map((n=>{const i=o.filter((t=>t.type===n.name)),s={name:n.name,options:n.options,storage:n.storage,editor:e},a=t.reduce(((t,e)=>{const o=te(e,"extendMarkSchema",s);return(0,r.A)((0,r.A)({},t),o?o(n):{})}),{}),l=ue((0,r.A)((0,r.A)({},a),{},{inclusive:oe(te(n,"inclusive",s)),excludes:oe(te(n,"excludes",s)),group:oe(te(n,"group",s)),spanning:oe(te(n,"spanning",s)),code:oe(te(n,"code",s)),attrs:Object.fromEntries(i.map(de))})),c=oe(te(n,"parseHTML",s));c&&(l.parseDOM=c.map((t=>ce(t,i))));const u=te(n,"renderHTML",s);return u&&(l.toDOM=t=>u({mark:t,HTMLAttributes:le(t,i)})),[n.name,l]})));return new i.Sj({topNode:l,nodes:c,marks:u})}function pe(t){return t.sort(((t,e)=>{const n=te(t,"priority")||100,r=te(e,"priority")||100;return n>r?-1:n<r?1:0}))}function fe(t){const e=pe(ee(t)),n=function(t){const e=t.filter(((e,n)=>t.indexOf(e)!==n));return Array.from(new Set(e))}(e.map((t=>t.name)));return n.length&&console.warn("[tiptap warn]: Duplicate extension names found: [".concat(n.map((t=>"'".concat(t,"'"))).join(", "),"]. This can lead to issues.")),e}function me(t,e,n){const{from:r,to:o}
2=e,{blockSeparator:i="\n\n",textSerializers:s={}}=n||{};let a="";return t.nodesBetween(r,o,((t,n,l,c)=>{var u;t.isBlock&&n>r&&(a+=i);const d=null==s?void 0:s[t.type.name];if(d)return l&&(a+=d({node:t,pos:n,parent:l,index:c,range:e})),!1;t.isText&&(a+=null==(u=null==t?void 0:t.text)?void 0:u.slice(Math.max(r,n)-n,o-n))})),a}function ge(t,e){return me(t,{from:0,to:t.content.size},e)}function ye(t){return Object.fromEntries(Object.entries(t.nodes).filter((t=>{let[,e]=t;return e.spec.toText})).map((t=>{let[e,n]=t;return[e,n.spec.toText]})))}function ve(t,e){const n=zt("string"===typeof e?e:e.name,t.schema);return"node"===n?function(t,e){const n=Z(e,t.schema),{from:o,to:i}=t.selection,s=[];t.doc.nodesBetween(o,i,(t=>{s.push(t)}));const a=s.reverse().find((t=>t.type.name===n.name));return a?(0,r.A)({},a.attrs):{}}(t,e):"mark"===n?Yt(t,e):{}}function De(t){const e=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:JSON.stringify;const n={};return t.filter((t=>{const r=e(t);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(t);return 1===e.length?e:e.filter(((t,n)=>!e.filter(((t,e)=>e!==n)).some((e=>t.oldRange.from>=e.oldRange.from&&t.oldRange.to<=e.oldRange.to&&t.newRange.from>=e.newRange.from&&t.newRange.to<=e.newRange.to))))}function be(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach(((t,o)=>{const i=[];if(t.ranges.length)t.forEach(((t,e)=>{i.push({from:t,to:e})}));else{const{from:t,to:e}=n[o];if(void 0===t||void 0===e)return;i.push({from:t,to:e})}i.forEach((t=>{let{from:n,to:i}=t;const s=e.slice(o).map(n,-1),a=e.slice(o).map(i),l=e.invert().map(s,-1),c=e.invert().map(a);r.push({oldRange:{from:l,to:c},newRange:{from:s,to:a}})}))})),De(r)}function ke(t,e,n){const o=[];return t===e?n.resolve(t).marks().forEach((e=>{const i=at(n.resolve(t),e.type);i&&o.push((0,r.A)({mark:e},i))})):n.nodesBetween(t,e,((t,e)=>{t&&void 0!==(null==t?void 0:t.nodeSize)&&o.push(...t.marks.map((n=>({from:e,to:e+t.nodeSize,mark:n}))))})),o}var we=function(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:20;const o=t.doc.resolve(n);let i=r,s=null;for(;i>0&&null===s;){const t=o.node(i);(null==t?void 0:t.type.name)===e?s=t:i-=1}return[s,i]};function Ce(t,e){return e.nodes[t]||e.marks[t]||null}function Ae(t,e,n){return Object.fromEntries(Object.entries(n).filter((n=>{let[r]=n;const o=t.find((t=>t.type===e&&t.name===r));return!!o&&o.attribute.keepOnSplit})))}function xe(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{empty:r,ranges:o}=t.selection,i=e?lt(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter((t=>!i||i.name===t.type.name)).find((t=>ot(t.attrs,n,{strict:!1})));let s=0;const a=[];if(o.forEach((e=>{let{$from:n,$to:r}=e;const o=n.pos,i=r.pos;t.doc.nodesBetween(o,i,((t,e)=>{if(!t.isText&&!t.marks.length)return;const n=Math.max(o,e),r=Math.min(i,e+t.nodeSize);s+=r-n,a.push(...t.marks.map((t=>({mark:t,from:n,to:r}))))}))})),0===s)return!1;const l=a.filter((t=>!i||i.name===t.mark.type.name)).filter((t=>ot(t.mark.attrs,n,{strict:!1}))).reduce(((t,e)=>t+e.to-e.from),0),c=a.filter((t=>!i||t.mark.type!==i&&t.mark.type.excludes(i))).reduce(((t,e)=>t+e.to-e.from),0);return(l>0?l+c:l)>=s}var Ee=(t,e)=>{const{$from:n,$to:r,$anchor:o}=t.selection;if(e){const n=Qt((t=>t.type.name===e))(t.selection);if(!n)return!1;const r=t.doc.resolve(n.pos+1);return o.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Se=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function Me(t,e){return Array.isArray(e)?e.some((e=>("string"===typeof e?e:e.name)===t.name)):e}function Te(t,e){const{nodeExtensions:n}=ie(e),r=n.find((e=>e.name===t));if(!r)return!1;const o=oe(te(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"===typeof o&&o.split(" ").includes("list")}function Oe(t){let{checkChildren:e=!0,ignoreWhitespace:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var r;if(n){if("hardBreak"===t.type.name)return!0;if(t.isText)return/^\s*$/m.test(null!=(r=t.text)?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(0===t.content.childCount)return!0;
2if(e){let r=!0;return t.content.forEach((t=>{!1!==r&&(Oe(t,{ignoreWhitespace:n,checkChildren:e})||(r=!1))})),r}return!1}function Fe(t){return t instanceof s.nh}var Ne=class t{constructor(t){this.position=t}static fromJSON(e){return new t(e.position)}toJSON(){return{position:this.position}}};function Be(t,e){const n=e.mapping.mapResult(t.position);return{position:new Ne(n.pos),mapResult:n}}function Re(t){return new Ne(t)}var Ie=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{tr:o,state:i,dispatch:s}=n;const{selection:a}=o,{empty:l,ranges:c}=a,u=lt(t,i.schema);if(s)if(l){const t=Yt(i,u);o.addStoredMark(u.create((0,r.A)((0,r.A)({},t),e)))}else c.forEach((t=>{const n=t.$from.pos,s=t.$to.pos;i.doc.nodesBetween(n,s,((t,i)=>{const a=Math.max(i,n),l=Math.min(i+t.nodeSize,s);t.marks.find((t=>t.type===u))?t.marks.forEach((t=>{u===t.type&&o.addMark(a,l,u.create((0,r.A)((0,r.A)({},t.attrs),e)))})):o.addMark(a,l,u.create(e))}))}));return function(t,e,n){var r;const{selection:o}=e;let i=null;if(dt(o)&&(i=o.$cursor),i){const e=null!=(r=t.storedMarks)?r:i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(e)||!e.some((t=>t.type.excludes(n))))}const{ranges:s}=o;return s.some((e=>{let{$from:r,$to:o}=e,i=0===r.depth&&t.doc.inlineContent&&t.doc.type.allowsMarkType(n);return t.doc.nodesBetween(r.pos,o.pos,((t,e,r)=>{if(i)return!1;if(t.isInline){const e=!r||r.type.allowsMarkType(n),o=!!n.isInSet(t.marks)||!t.marks.some((t=>t.type.excludes(n)));i=e&&o}return!i})),i}))}(i,o,u)}},Le=(t,e)=>n=>{let{tr:r}=n;return r.setMeta(t,e),!0},Pe=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{state:o,dispatch:i,chain:s}=n;const a=Z(t,o.schema);let l;return o.selection.$anchor.sameParent(o.selection.$head)&&(l=o.selection.$anchor.parent.attrs),a.isTextblock?s().command((t=>{let{commands:n}=t;return!!T(a,(0,r.A)((0,r.A)({},l),e))(o)||n.clearNodes()})).command((t=>{let{state:n}=t;return T(a,(0,r.A)((0,r.A)({},l),e))(n,i)})).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)}},ze=t=>e=>{let{tr:n,dispatch:r}=e;if(r){const{doc:e}=n,r=ht(t,0,e.content.size),o=s.nh.create(e,r);n.setSelection(o)}return!0},$e=(t,e)=>n=>{let{tr:o,state:i,dispatch:s}=n;const{selection:a}=i;let l,c;return"number"===typeof e?(l=e,c=e):e&&"from"in e&&"to"in e?(l=e.from,c=e.to):(l=a.from,c=a.to),s&&o.doc.nodesBetween(l,c,((e,n)=>{e.isText||o.setNodeMarkup(n,void 0,(0,r.A)((0,r.A)({},e.attrs),{},{dir:t}))})),!0},je=t=>e=>{let{tr:n,dispatch:r}=e;if(r){const{doc:e}=n,{from:r,to:o}="number"===typeof t?{from:t,to:t}:t,i=s.U3.atStart(e).from,a=s.U3.atEnd(e).to,l=ht(r,i,a),c=ht(o,i,a),u=s.U3.create(e,l,c);n.setSelection(u)}return!0},Ve=t=>e=>{let{state:n,dispatch:r}=e;const s=Z(t,n.schema);return(a=s,function(t,e){let{$from:n,$to:r}=t.selection,s=n.blockRange(r,(t=>t.childCount>0&&t.firstChild.type==a));if(!s)return!1;let l=s.startIndex;if(0==l)return!1;let c=s.parent,u=c.child(l-1);if(u.type!=a)return!1;if(e){let n=u.lastChild&&u.lastChild.type==c.type,r=i.FK.from(n?a.create():null),l=new i.Ji(i.FK.from(a.create(null,i.FK.from(c.type.create(null,r)))),n?3:1,0),d=s.start,h=s.end;e(t.tr.step(new o.Wg(d-(n?3:1),h,d,h,l,1,!0)).scrollIntoView())}return!0})(n,r);var a};function He(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter((t=>null==e?void 0:e.includes(t.type.name)));t.tr.ensureMarks(r)}}var Ke=function(){let{keepMarks:t=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e=>{let{tr:n,state:r,dispatch:i,editor:a}=e;const{selection:l,doc:c}=n,{$from:u,$to:d}=l,h=Ae(a.extensionManager.attributes,u.node().type.name,u.node().attrs);if(l instanceof s.nh&&l.node.isBlock)return!(!u.parentOffset||!(0,o.zy)(c,u.pos))&&(i&&(t&&He(r,a.extensionManager.splittableMarks),n.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;const p=d.parentOffset===d.parent.content.size,f=0===u.depth?void 0:function(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(u.node(-1).contentMatchAt(u.indexAfter(-1)));let m=p&&f?[{type:f,attrs:h}]:void 0,g=(0,o.zy)(n.doc,n.mapping.map(u.pos),1,m);if(m||g||!(0,o.zy)(n.doc,n.mapping.map(u.pos),1,f?[{type:f}]:void 0)||(g=!0,m=f?[{type:f,attrs:h}]:void 0),i){if(g&&(l instanceof s.U3&&n.deleteSelection(),n.split(n.mapping.map(u.pos),1,m),f&&!p&&
2!u.parentOffset&&u.parent.type!==f)){const t=n.mapping.map(u.before()),e=n.doc.resolve(t);u.node(-1).canReplaceWith(e.index(),e.index()+1,f)&&n.setNodeMarkup(n.mapping.map(u.before()),f)}t&&He(r,a.extensionManager.splittableMarks),n.scrollIntoView()}return g}},qe=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{tr:a,state:l,dispatch:c,editor:u}=n;var d;const h=Z(t,l.schema),{$from:p,$to:f}=l.selection,m=l.selection.node;if(m&&m.isBlock||p.depth<2||!p.sameParent(f))return!1;const g=p.node(-1);if(g.type!==h)return!1;const y=u.extensionManager.attributes;if(0===p.parent.content.size&&p.node(-1).childCount===p.indexAfter(-1)){if(2===p.depth||p.node(-3).type!==h||p.index(-2)!==p.node(-2).childCount-1)return!1;if(c){let t=i.FK.empty;const n=p.index(-1)?1:p.index(-2)?2:3;for(let e=p.depth-n;e>=p.depth-3;e-=1)t=i.FK.from(p.node(e).copy(t));const o=p.indexAfter(-1)<p.node(-2).childCount?1:p.indexAfter(-2)<p.node(-3).childCount?2:3,l=(0,r.A)((0,r.A)({},Ae(y,p.node().type.name,p.node().attrs)),e),c=(null==(d=h.contentMatch.defaultType)?void 0:d.createAndFill(l))||void 0;t=t.append(i.FK.from(h.createAndFill(null,c)||void 0));const u=p.before(p.depth-(n-1));a.replace(u,p.after(-o),new i.Ji(t,4-n,0));let f=-1;a.doc.nodesBetween(u,a.doc.content.size,((t,e)=>{if(f>-1)return!1;t.isTextblock&&0===t.content.size&&(f=e+1)})),f>-1&&a.setSelection(s.U3.near(a.doc.resolve(f))),a.scrollIntoView()}return!0}const v=f.pos===p.end()?g.contentMatchAt(0).defaultType:null,D=(0,r.A)((0,r.A)({},Ae(y,g.type.name,g.attrs)),e),b=(0,r.A)((0,r.A)({},Ae(y,p.node().type.name,p.node().attrs)),e);a.delete(p.pos,f.pos);const k=v?[{type:h,attrs:D},{type:v,attrs:b}]:[{type:h,attrs:D}];if(!(0,o.zy)(a.doc,p.pos,2))return!1;if(c){const{selection:t,storedMarks:e}=l,{splittableMarks:n}=u.extensionManager,r=e||t.$to.parentOffset&&t.$from.marks();if(a.split(p.pos,2,k).scrollIntoView(),!r||!c)return!0;const o=r.filter((t=>n.includes(t.type.name)));a.ensureMarks(o)}return!0}},Je=(t,e)=>{const n=Qt((t=>t.type===e))(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const i=t.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!(0,o.n9)(t.doc,n.pos)||(t.join(n.pos),!0)},Ue=(t,e)=>{const n=Qt((t=>t.type===e))(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const i=t.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!(0,o.n9)(t.doc,r)||(t.join(r),!0)},_e=function(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return o=>{let{editor:i,tr:s,state:a,dispatch:l,chain:c,commands:u,can:d}=o;const{extensions:h,splittableMarks:p}=i.extensionManager,f=Z(t,a.schema),m=Z(e,a.schema),{selection:g,storedMarks:y}=a,{$from:v,$to:D}=g,b=v.blockRange(D),k=y||g.$to.parentOffset&&g.$from.marks();if(!b)return!1;const w=Qt((t=>Te(t.type.name,h)))(g);if(b.depth>=1&&w&&b.depth-w.depth<=1){if(w.node.type===f)return u.liftListItem(m);if(Te(w.node.type.name,h)&&f.validContent(w.node.content)&&l)return c().command((()=>(s.setNodeMarkup(w.pos,f),!0))).command((()=>Je(s,f))).command((()=>Ue(s,f))).run()}return n&&k&&l?c().command((()=>{const t=d().wrapInList(f,r),e=k.filter((t=>p.includes(t.type.name)));return s.ensureMarks(e),!!t||u.clearNodes()})).wrapInList(f,r).command((()=>Je(s,f))).command((()=>Ue(s,f))).run():c().command((()=>!!d().wrapInList(f,r)||u.clearNodes())).wrapInList(f,r).command((()=>Je(s,f))).command((()=>Ue(s,f))).run()}},We=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r=>{let{state:o,commands:i}=r;const{extendEmptyMarkRange:s=!1}=n,a=lt(t,o.schema);return xe(o,a,e)?i.unsetMark(a,{extendEmptyMarkRange:s}):i.setMark(a,e)}},Ge=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o=>{let{state:i,commands:s}=o;const a=Z(t,i.schema),l=Z(e,i.schema),c=Bt(i,a,n);let u;return i.selection.$anchor.sameParent(i.selection.$head)&&(u=i.selection.$anchor.parent.attrs),c?s.setNode(l,u):s.setNode(a,(0,r.A)((0,r.A)({},u),n))}},Ye=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{state:r,commands:o}=n;const i=Z(t,r.schema);return Bt(r,i,e)?o.lift(i):o.wrapIn(i,e)}},Ze=()=>t=>{let{state:e,dispatch:n}=t;const r=e.plugins;for(let o=0;o<r.length;o+=1){const t=r[o];let i;if(t.spec.isInputRules&&(i=t.getState(e))){if(n){const t=e.tr,n=i.transform;
2for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(i.text){const n=t.doc.resolve(i.from).marks();t.replaceWith(i.from,i.to,e.schema.text(i.text,n))}else t.delete(i.from,i.to)}return!0}}return!1},Xe=()=>t=>{let{tr:e,dispatch:n}=t;const{selection:r}=e,{empty:o,ranges:i}=r;return o||n&&i.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},Qe=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{tr:r,state:o,dispatch:i}=n;var s;const{extendEmptyMarkRange:a=!1}=e,{selection:l}=r,c=lt(t,o.schema),{$from:u,empty:d,ranges:h}=l;if(!i)return!0;if(d&&a){let{from:t,to:e}=l;const n=null==(s=u.marks().find((t=>t.type===c)))?void 0:s.attrs,o=at(u,c,n);o&&(t=o.from,e=o.to),r.removeMark(t,e,c)}else h.forEach((t=>{r.removeMark(t.$from.pos,t.$to.pos,c)}));return r.removeStoredMark(c),!0}},tn=t=>e=>{let{tr:n,state:o,dispatch:i}=e;const{selection:s}=o;let a,l;return"number"===typeof t?(a=t,l=t):t&&"from"in t&&"to"in t?(a=t.from,l=t.to):(a=s.from,l=s.to),i&&n.doc.nodesBetween(a,l,((t,e)=>{if(t.isText)return;const o=(0,r.A)({},t.attrs);delete o.dir,n.setNodeMarkup(e,void 0,o)})),!0},en=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{tr:o,state:i,dispatch:s}=n,a=null,l=null;const c=zt("string"===typeof t?t:t.name,i.schema);if(!c)return!1;"node"===c&&(a=Z(t,i.schema)),"mark"===c&&(l=lt(t,i.schema));let u=!1;return o.selection.ranges.forEach((t=>{const n=t.$from.pos,c=t.$to.pos;let d,h,p,f;o.selection.empty?i.doc.nodesBetween(n,c,((t,e)=>{a&&a===t.type&&(u=!0,p=Math.max(e,n),f=Math.min(e+t.nodeSize,c),d=e,h=t)})):i.doc.nodesBetween(n,c,((t,i)=>{i<n&&a&&a===t.type&&(u=!0,p=Math.max(i,n),f=Math.min(i+t.nodeSize,c),d=i,h=t),i>=n&&i<=c&&(a&&a===t.type&&(u=!0,s&&o.setNodeMarkup(i,void 0,(0,r.A)((0,r.A)({},t.attrs),e))),l&&t.marks.length&&t.marks.forEach((a=>{if(l===a.type&&(u=!0,s)){const s=Math.max(i,n),u=Math.min(i+t.nodeSize,c);o.addMark(s,u,l.create((0,r.A)((0,r.A)({},a.attrs),e)))}})))})),h&&(void 0!==d&&s&&o.setNodeMarkup(d,void 0,(0,r.A)((0,r.A)({},h.attrs),e)),l&&h.marks.length&&h.marks.forEach((t=>{l===t.type&&s&&o.addMark(p,f,l.create((0,r.A)((0,r.A)({},t.attrs),e)))})))})),u}},nn=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{state:r,dispatch:i}=n;return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){let{$from:i,$to:s}=n.selection,a=i.blockRange(s),l=a&&(0,o.oM)(a,t,e);return!!l&&(r&&r(n.tr.wrap(a,l).scrollIntoView()),!0)}}(Z(t,r.schema),e)(r,i)}},rn=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{state:r,dispatch:o}=n;return I(Z(t,r.schema),e)(r,o)}},on=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];const o=this.callbacks[t];return o&&o.forEach((t=>t.apply(this,n))),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter((t=>t!==e)):delete this.callbacks[t]),this}once(t,e){var n=this;const r=function(){n.off(t,r);for(var o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];e.apply(n,i)};return this.on(t,r)}removeAllListeners(){this.callbacks={}}},sn=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=null==(e=t.undoable)||e}};function an(t){var e;const{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null==(e=c.nodeBefore||c.nodeAfter)?void 0:e.marks.find((t=>t.type.spec.code))))return!1;let u=!1;const d=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,((t,e,o,i)=>{var s,a;const l=(null==(a=(s=t.type.spec).toText)?void 0:a.call(s,{node:t,pos:e,parent:o,index:i}))||t.textContent||"%leaf%";n+=t.isAtom&&!t.isText?l:l.slice(0,Math.max(0,r-e))})),n}(c)+i;return s.forEach((t=>{if(u)return;const e=((t,e)=>{if(rt(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];
2return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r})(d,t.find);if(!e)return;const s=l.state.tr,c=V({state:l.state,transaction:s}),h={from:r-(e[0].length-i.length),to:o},{commands:p,chain:f,can:m}=new H({editor:n,state:c});null!==t.handler({state:c,range:h,match:e,commands:p,chain:f,can:m})&&s.steps.length&&(t.undoable&&s.setMeta(a,{transform:s,from:r,to:o,text:i}),l.dispatch(s),u=!0)})),u}function ln(t){return"Object"===function(t){return Object.prototype.toString.call(t).slice(8,-1)}(t)&&(t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype)}function cn(t,e){const n=(0,r.A)({},t);return ln(t)&&ln(e)&&Object.keys(e).forEach((r=>{ln(e[r])&&ln(t[r])?n[r]=cn(t[r],e[r]):n[r]=e[r]})),n}var un=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config=(0,r.A)((0,r.A)({},this.config),t),this.name=this.config.name}get options(){return(0,r.A)({},oe(te(this,"addOptions",{name:this.name}))||{})}get storage(){return(0,r.A)({},oe(te(this,"addStorage",{name:this.name,options:this.options}))||{})}configure(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this.extend((0,r.A)((0,r.A)({},this.config),{},{addOptions:()=>cn(this.options,t)}));return e.name=this.name,e.parent=this.parent,e}extend(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=new this.constructor((0,r.A)((0,r.A)({},this.config),t));return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},dn=class t extends un{constructor(){super(...arguments),this.type="mark"}static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n="function"===typeof e?e():e;return new t(n)}static handleExit(t){let{editor:e,mark:n}=t;const{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){const t=o.marks();if(!!!t.find((t=>(null==t?void 0:t.type.name)===n.name)))return!1;const i=t.find((t=>(null==t?void 0:t.type.name)===n.name));return i&&r.removeStoredMark(i),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}configure(t){return super.configure(t)}extend(t){const e="function"===typeof t?t():t;return super.extend(e)}};var hn=class{constructor(t){this.find=t.find,this.handler=t.handler}};function pn(t){const{editor:e,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:c,can:u}=new H({editor:e,state:n}),d=[];n.doc.nodesBetween(r,o,((t,e)=>{var h,p,f,m,g;if((null==(p=null==(h=t.type)?void 0:h.spec)?void 0:p.code)||!(t.isText||t.isTextblock||t.isInline))return;const y=null!=(g=null!=(m=null==(f=t.content)?void 0:f.size)?m:t.nodeSize)?g:0,v=Math.max(r,e),D=Math.min(o,e+y);if(v>=D)return;((t,e,n)=>{if(rt(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map((e=>{const n=[e.text];return n.index=e.index,n.input=t,n.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(e.replaceWith)),n})):[]})(t.isText?t.text||"":t.textBetween(v-e,D-e,void 0,"\ufffc"),i.find,s).forEach((t=>{if(void 0===t.index)return;const e=v+t.index+1,r=e+t[0].length,o={from:n.tr.mapping.map(e),to:n.tr.mapping.map(r)},h=i.handler({state:n,range:o,match:t,commands:l,chain:c,can:u,pasteEvent:s,dropEvent:a});d.push(h)}))}));return d.every((t=>null!==t))}var fn=null;function mn(t){const{editor:e,rules:n}=t;let r,o=null,a=!1,l=!1,c="undefined"!==typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{r="undefined"!==typeof DragEvent?new DragEvent("drop"):null}catch(d){r=null}const u=t=>{let{state:n,from:o,to:i,rule:s,pasteEvt:a}=t;const l=n.tr,u=V({state:n,transaction:l});if(pn({editor:e,state:u,from:Math.max(o-1,0),to:i.b-1,rule:s,pasteEvent:a,dropEvent:r})&&l.steps.length){try{r="undefined"!==typeof DragEvent?new DragEvent("drop"):null}catch(d){r=null}return c="undefined"!==typeof ClipboardEvent?new ClipboardEvent("paste"):null,l}};return n.map((t=>new s.k_({view(t){const n=n=>{var r;o=(null==(r=t.dom.parentElement)?void 0:r.contains(n.target))?t.dom.parentElement:null,o&&(fn=e)},r=()=>{fn&&(fn=null)};return window.addEventListener("dragstart",n),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",n),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(t,e)=>{if(l=o===t.dom.parentElement,r=e,!l){const t=fn;(null==t?void 0:t.isEditable)&&setTimeout((()=>{const e=t.state.selection;e&&t.commands.deleteRange({from:e.from,to:e.to})}),10)}return!1},paste:(t,e)=>{var n;const r=null==(n=e.clipboardData)?void 0:n.getData("text/html");return c=e,a=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(e,n,r)=>{const o=e[0],s="paste"===o.getMeta("uiEvent")&&!a,d="drop"===o.getMeta("uiEvent")&&!l,h=o.getMeta("applyPasteRules"),p=!!h;if(!s&&!d&&!p)return;if(p){let{text:e}=h;"string"===typeof e||(e=ne(i.FK.from(e),r.schema));const{from:n}=h,o=n+e.length,s=(t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(e=n.clipboardData)||e.setData("text/html",t),n})(e);return u({rule:t,state:r,from:n,to:{b:o},pasteEvt:s})}
2const f=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);return"number"===typeof f&&m&&f!==m.b?u({rule:t,state:r,from:f,to:m,pasteEvt:c}):void 0}})))}var gn=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=fe(t),this.schema=he(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce(((t,e)=>{const n=te(e,"addCommands",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Ce(e.name,this.schema)});return n?(0,r.A)((0,r.A)({},t),n()):t}),{})}get plugins(){const{editor:t}=this;return pe([...this.extensions].reverse()).flatMap((e=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:Ce(e.name,this.schema)},o=[],a=te(e,"addKeyboardShortcuts",n);let l={};if("mark"===e.type&&te(e,"exitable",n)&&(l.ArrowRight=()=>dn.handleExit({editor:t,mark:e})),a){const e=Object.fromEntries(Object.entries(a()).map((e=>{let[n,r]=e;return[n,()=>r({editor:t})]})));l=(0,r.A)((0,r.A)({},l),e)}const c=(0,z.w)(l);o.push(c);const u=te(e,"addInputRules",n);if(Me(e,t.options.enableInputRules)&&u){const e=u();if(e&&e.length){const n=function(t){const{editor:e,rules:n}=t,r=new s.k_({state:{init:()=>null,apply(t,o,s){const a=t.getMeta(r);if(a)return a;const l=t.getMeta("applyInputRules");return!!l&&setTimeout((()=>{let{text:t}=l;"string"===typeof t||(t=ne(i.FK.from(t),s.schema));const{from:o}=l,a=o+t.length;an({editor:e,from:o,to:a,text:t,rules:n,plugin:r})})),t.selectionSet||t.docChanged?null:o}},props:{handleTextInput:(t,o,i,s)=>an({editor:e,from:o,to:i,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:t=>(setTimeout((()=>{const{$cursor:o}=t.state.selection;o&&an({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(t,o){if("Enter"!==o.key)return!1;const{$cursor:i}=t.state.selection;return!!i&&an({editor:e,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:t,rules:e}),r=Array.isArray(n)?n:[n];o.push(...r)}}const d=te(e,"addPasteRules",n);if(Me(e,t.options.enablePasteRules)&&d){const e=d();if(e&&e.length){const n=mn({editor:t,rules:e});o.push(...n)}}const h=te(e,"addProseMirrorPlugins",n);if(h){const t=h();o.push(...t)}return o}))}get attributes(){return se(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=ie(this.extensions);return Object.fromEntries(e.filter((t=>!!te(t,"addNodeView"))).map((e=>{const n=this.attributes.filter((t=>t.type===e.name)),r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:Z(e.name,this.schema)},o=te(e,"addNodeView",r);if(!o)return[];const i=o();if(!i)return[];return[e.name,(r,o,s,a,l)=>{const c=le(r,n);return i({node:r,view:o,getPos:s,decorations:a,innerDecorations:l,editor:t,extension:e,HTMLAttributes:c})}]})))}get markViews(){const{editor:t}=this,{markExtensions:e}=ie(this.extensions);return Object.fromEntries(e.filter((t=>!!te(t,"addMarkView"))).map((e=>{const n=this.attributes.filter((t=>t.type===e.name)),r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:lt(e.name,this.schema)},o=te(e,"addMarkView",r);if(!o)return[];return[e.name,(r,i,s)=>{const a=le(r,n);return o()({mark:r,view:i,inline:s,editor:t,extension:e,HTMLAttributes:a,updateAttributes:e=>{Un(r,t,e)}})}]})))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map((t=>[t.name,t.storage]))),t.forEach((t=>{var e;const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Ce(t.name,this.schema)};if("mark"===t.type){(null==(e=oe(te(t,"keepOnSplit",n)))||e)&&this.splittableMarks.push(t.name)}const r=te(t,"onBeforeCreate",n),o=te(t,"onCreate",n),i=te(t,"onUpdate",n),s=te(t,"onSelectionUpdate",n),a=te(t,"onTransaction",n),l=te(t,"onFocus",n),c=te(t,"onBlur",n),u=te(t,"onDestroy",n);r&&this.editor.on("beforeCreate",r),o&&this.editor.on("create",o),i&&this.editor.on("update",i),s&&this.editor.on("selectionUpdate",s),a&&this.editor.on("transaction",a),l&&this.editor.on("focus",l),c&&this.editor.on("blur",c),u&&this.editor.on("destroy",u)}))}};gn.resolve=fe,gn.sort=pe,gn.flatten=ee;j({}
2,{ClipboardTextSerializer:()=>vn,Commands:()=>Dn,Delete:()=>bn,Drop:()=>kn,Editable:()=>wn,FocusEvents:()=>An,Keymap:()=>xn,Paste:()=>En,Tabindex:()=>Sn,TextDirection:()=>Mn,focusEventsPluginKey:()=>Cn});var yn=class t extends un{constructor(){super(...arguments),this.type="extension"}static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n="function"===typeof e?e():e;return new t(n)}configure(t){return super.configure(t)}extend(t){const e="function"===typeof t?t():t;return super.extend(e)}},vn=yn.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new s.k_({key:new s.hs("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:o,selection:i}=e,{ranges:s}=i,a=Math.min(...s.map((t=>t.$from.pos))),l=Math.max(...s.map((t=>t.$to.pos))),c=ye(n);return me(o,{from:a,to:l},(0,r.A)((0,r.A)({},void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{}),{},{textSerializers:c}))}}})]}}),Dn=yn.create({name:"commands",addCommands:()=>(0,r.A)({},K)}),bn=yn.create({name:"delete",onUpdate(t){let{transaction:e,appendedTransactions:n}=t;var r,i,s;const a=()=>{var t,r,i,s;if(null!=(s=null==(i=null==(r=null==(t=this.editor.options.coreExtensionOptions)?void 0:t.delete)?void 0:r.filterTransaction)?void 0:i.call(r,e))?s:e.getMeta("y-sync$"))return;const a=Zt(e.before,[e,...n]);be(a).forEach((t=>{a.mapping.mapResult(t.oldRange.from).deletedAfter&&a.mapping.mapResult(t.oldRange.to).deletedBefore&&a.before.nodesBetween(t.oldRange.from,t.oldRange.to,((n,r)=>{const o=r+n.nodeSize-2,i=t.oldRange.from<=r&&o<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:o,newFrom:a.mapping.map(r),newTo:a.mapping.map(o),deletedRange:t.oldRange,newRange:t.newRange,partial:!i,editor:this.editor,transaction:e,combinedTransform:a})}))}));const l=a.mapping;a.steps.forEach(((t,n)=>{var r,i;if(t instanceof o.Ys){const o=l.slice(n).map(t.from,-1),s=l.slice(n).map(t.to),c=l.invert().map(o,-1),u=l.invert().map(s),d=null==(r=a.doc.nodeAt(o-1))?void 0:r.marks.some((e=>e.eq(t.mark))),h=null==(i=a.doc.nodeAt(s))?void 0:i.marks.some((e=>e.eq(t.mark)));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:c,to:u},newRange:{from:o,to:s},partial:Boolean(h||d),editor:this.editor,transaction:e,combinedTransform:a})}}))};null==(s=null==(i=null==(r=this.editor.options.coreExtensionOptions)?void 0:r.delete)?void 0:i.async)||s?setTimeout(a,0):a()}}),kn=yn.create({name:"drop",addProseMirrorPlugins(){return[new s.k_({key:new s.hs("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),wn=yn.create({name:"editable",addProseMirrorPlugins(){return[new s.k_({key:new s.hs("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Cn=new s.hs("focusEvents"),An=yn.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new s.k_({key:Cn,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),xn=yn.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first((t=>{let{commands:e}=t;return[()=>e.undoInputRule(),()=>e.command((t=>{let{tr:n}=t;const{selection:r,doc:o}=n,{empty:i,$anchor:a}=r,{pos:l,parent:c}=a,u=a.parent.isTextblock&&l>0?n.doc.resolve(l-1):a,d=u.parent.type.spec.isolating,h=a.pos-a.parentOffset,p=d&&1===u.parent.childCount?h===a.pos:s.LN.atStart(o).from===l;return!(!i||!c.type.isTextblock||c.textContent.length||!p||p&&"paragraph"===a.parent.type.name)&&e.clearNodes()})),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]})),e=()=>this.editor.commands.first((t=>{let{commands:e}=t;return[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]})),n={Enter:()=>this.editor.commands.first((t=>{let{commands:e}=t;return[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]})),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o=(0,r.A)({},n),i=(0,r.A)((0,r.A)({},n),{},{"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()});return mt()||Ft()?i:o},addProseMirrorPlugins(){return[new s.k_({key:new s.hs("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some((t=>t.getMeta("composition"))))return;const r=t.some((t=>t.docChanged))&&!e.doc.eq(n.doc),o=t.some((t=>t.getMeta("preventClearDocument")));if(!r||o)return;const{empty:i,from:a,to:l}=e.selection,c=s.LN.atStart(e.doc).from,u=s.LN.atEnd(e.doc).to;
2if(i||!(a===c&&l===u))return;if(!Oe(n.doc))return;const d=n.tr,h=V({state:n,transaction:d}),{commands:p}=new H({editor:this.editor,state:h});return p.clearNodes(),d.steps.length?d:void 0}})]}}),En=yn.create({name:"paste",addProseMirrorPlugins(){return[new s.k_({key:new s.hs("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),Sn=yn.create({name:"tabindex",addProseMirrorPlugins(){return[new s.k_({key:new s.hs("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Mn=yn.create({name:"textDirection",addOptions:()=>({direction:void 0}),addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=ie(this.extensions);return[{types:t.filter((t=>"text"!==t.name)).map((t=>t.name)),attributes:{dir:{default:this.options.direction,parseHTML:t=>{const e=t.getAttribute("dir");return!e||"ltr"!==e&&"rtl"!==e&&"auto"!==e?this.options.direction:e},renderHTML:t=>t.dir?{dir:t.dir}:{}}}}]},addProseMirrorPlugins(){return[new s.k_({key:new s.hs("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),Tn=class t{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=t,this.editor=e,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return null!=(t=this.actualDepth)?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let e=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return void console.error("You can\u2019t set content on a block node. Tried to set content on ".concat(this.name," at ").concat(this.pos));e=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:e,to:n},t)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(0===this.depth)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new t(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new t(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new t(e,this.editor)}get children(){const e=[];return this.node.content.forEach(((n,r)=>{const o=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,s=this.pos+r+(i?0:1);if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(s);if(!o&&a.depth<=this.depth)return;const l=new t(a,this.editor,o,o?n:null);o&&(l.actualDepth=this.depth+1),e.push(new t(a,this.editor,o,o?n:null))})),e}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===t)if(Object.keys(e).length>0){const t=r.node.attrs,n=Object.keys(e);for(let r=0;r<n.length;r+=1){const o=n[r];if(t[o]!==e[o])break}}else n=r;r=r.parent}return n}querySelector(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.querySelectorAll(t,e,!0)[0]||null}querySelectorAll(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[];if(!this.children||0===this.children.length)return r;const o=Object.keys(e);return this.children.forEach((i=>{if(!(n&&r.length>
20)){if(i.node.type.name===t){o.every((t=>e[t]===i.node.attrs[t]))&&r.push(i)}n&&r.length>0||(r=r.concat(i.querySelectorAll(t,e,n)))}})),r}setAttribute(t){const{tr:e}=this.editor.state;e.setNodeMarkup(this.from,void 0,(0,r.A)((0,r.A)({},this.node.attrs),t)),this.editor.view.dispatch(e)}};var On=class extends on{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:"undefined"!==typeof document?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:t=>{let{error:e}=t;throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:Be,createMappablePosition:Re},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",(t=>{let{event:e,slice:n,moved:r}=t;return this.options.onDrop(e,n,r)})),this.on("paste",(t=>{let{event:e,slice:n}=t;return this.options.onPaste(e,n)})),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=pt(e,this.options.autofocus);this.editorState=s.$t.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if("undefined"===typeof document)throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout((()=>{this.isDestroyed||(!1!==this.options.autofocus&&null!==this.options.autofocus&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)}),0)}unmount(){if(this.editorView){const t=this.editorView.dom;(null==t?void 0:t.editor)&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(".".concat(this.className)).length)try{"function"===typeof this.css.remove?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&"undefined"!==typeof document&&(this.css=function(t,e,n){const r=document.querySelector("style[data-tiptap-style".concat(n?"-".concat(n):"","]"));if(null!==r)return r;const o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute("data-tiptap-style".concat(n?"-".concat(n):""),""),o.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(o),o}('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}
2\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}',this.options.injectNonce))}setOptions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=(0,r.A)((0,r.A)({},this.options),t),this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if("state"===e)return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error("[tiptap error]: The editor view is not available. Cannot access view['".concat(e,"']. The editor may not be mounted yet."))}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=re(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach((t=>{const e="string"===typeof t?"".concat(t,"$"):t.key;n=n.filter((t=>!t.key.startsWith(e)))})),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e;const n=[...this.options.enableCoreExtensions?[wn,vn.configure({blockSeparator:null==(e=null==(t=this.options.coreExtensionOptions)?void 0:t.clipboardTextSerializer)?void 0:e.blockSeparator}),Dn,An,xn,Sn,kn,En,bn,Mn.configure({direction:this.options.textDirection})].filter((t=>"object"!==typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[t.name])):[],...this.options.extensions].filter((t=>["extension","node","mark"].includes(null==t?void 0:t.type)));this.extensionManager=new gn(n,this)}createCommandManager(){this.commandManager=new H({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=Wt(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&"object"===typeof this.storage.collaboration&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter((t=>"collaboration"!==t.name)),this.createExtensionManager()}}),t=Wt(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){var e;this.editorView=new P.Lz(t,(0,r.A)((0,r.A)({},this.options.editorProps),{},{attributes:(0,r.A)({role:"textbox"},null==(e=this.options.editorProps)?void 0:e.attributes),dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews}));const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.prependClass(),this.injectCSS();this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className="".concat(this.className," ").concat(this.view.dom.className)}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void t.steps.forEach((t=>{var e;return null==(e=this.capturedTransaction)?void 0:e.step(t)})):void(this.capturedTransaction=t);const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),o=n.includes(t),i=this.state;
2if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!o)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const s=n.findLast((t=>t.getMeta("focus")||t.getMeta("blur"))),a=null==s?void 0:s.getMeta("focus"),l=null==s?void 0:s.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:s}),l&&this.emit("blur",{editor:this,event:l.event,transaction:s}),t.getMeta("preventUpdate")||!n.some((t=>t.docChanged))||i.doc.eq(e.doc)||this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return ve(this.state,t)}isActive(t,e){const n="string"===typeof t?t:null,r="string"===typeof t?e:t;return function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return Bt(t,null,n)||xe(t,null,n);const r=zt(e,t.schema);return"node"===r?Bt(t,e,n):"mark"===r&&xe(t,e,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ne(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e="\n\n",textSerializers:n={}}=t||{};return ge(this.state.doc,{blockSeparator:e,textSerializers:(0,r.A)((0,r.A)({},ye(this.schema)),n)})}get isEmpty(){return Oe(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var t,e;return null==(e=null==(t=this.editorView)?void 0:t.isDestroyed)||e}$node(t,e){var n;return(null==(n=this.$doc)?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return(null==(n=this.$doc)?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new Tn(e,this)}get $doc(){return this.$pos(0)}};function Fn(t){return new sn({find:t.find,handler:e=>{let{state:n,range:r,match:o}=e;const i=oe(t.getAttributes,void 0,o);if(!1===i||null===i)return null;const{tr:s}=n,a=o[o.length-1],l=o[0];if(a){const e=l.search(/\S/),o=r.from+l.indexOf(a),c=o+a.length;if(ke(r.from,r.to,n.doc).filter((e=>e.mark.type.excluded.find((n=>n===t.type&&n!==e.mark.type)))).filter((t=>t.to>o)).length)return null;c<r.to&&s.delete(c,r.to),o>r.from&&s.delete(r.from+e,o);const u=r.from+e+a.length;s.addMark(r.from+e,u,t.type.create(i||{})),s.removeStoredMark(t.type)}},undoable:t.undoable})}function Nn(t){return new sn({find:t.find,handler:e=>{let{state:n,range:r,match:o}=e;const i=oe(t.getAttributes,void 0,o)||{},{tr:s}=n,a=r.from;let l=r.to;const c=t.type.create(i);if(o[1]){let t=a+o[0].lastIndexOf(o[1]);t>l?t=l:l=t+o[1].length;const e=o[0][o[0].length-1];s.insertText(e,a+o[0].length-1),s.replaceWith(t,l,c)}else if(o[0]){const e=t.type.isInline?a:a-1;s.insert(e,t.type.create(i)).delete(s.mapping.map(a),s.mapping.map(l))}s.scrollIntoView()},undoable:t.undoable})}function Bn(t){return new sn({find:t.find,handler:e=>{let{state:n,range:r,match:o}=e;const i=n.doc.resolve(r.from),s=oe(t.getAttributes,void 0,o)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;n.tr.delete(r.from,r.to).setBlockType(r.from,r.from,t.type,s)},undoable:t.undoable})}function Rn(t){return new sn({find:t.find,handler:e=>{let{state:n,range:r,match:i,chain:s}=e;const a=oe(t.getAttributes,void 0,i)||{},l=n.tr.delete(r.from,r.to),c=l.doc.resolve(r.from).blockRange(),u=c&&(0,o.oM)(c,t.type,a);if(!u)return null;if(l.wrap(c,u),t.keepMarks&&t.editor){const{selection:e,storedMarks:r}=n,{splittableMarks:o}=t.editor.extensionManager,i=r||e.$to.parentOffset&&e.$from.marks();if(i){const t=i.filter((t=>o.includes(t.type.name)));l.ensureMarks(t)}}if(t.keepAttributes){const e="bulletList"===t.type.name||"orderedList"===t.type.name?"listItem":"taskList";s().updateAttributes(e,a).run()}const d=l.doc.resolve(r.from-1).nodeBefore;d&&d.type===t.type&&(0,o.n9)(l.doc,r.from-1)&&(!t.joinPredicate||t.joinPredicate(i,d))&&l.join(r.from-1)},undoable:t.undoable})}function In(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof s.nh){const t=r.index();return r.parent.canReplaceWith(t,t+1,e)}let o=r.depth;for(;o>=0;){const t=r.index(o);if(r.node(o).contentMatchAt(t).matchType(e))return!0;o-=1}return!1}function Ln(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function Pn(t){if(!(null==t?void 0:t.trim()))return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,(t=>(n.push(t),"__QUOTED_".concat(n.length-1,"__")))),o=r.match(/(?:^|\s)\.([a-zA-Z][\
2w-]*)/g);if(o){const t=o.map((t=>t.trim().slice(1)));e.class=t.join(" ")}const i=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);i&&(e.id=i[1]);Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach((t=>{let[,r,o]=t;var i;const s=parseInt((null==(i=o.match(/__QUOTED_(\d+)__/))?void 0:i[1])||"0",10),a=n[s];a&&(e[r]=a.slice(1,-1))}));const s=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();if(s){s.split(/\s+/).filter(Boolean).forEach((t=>{t.match(/^[a-zA-Z][\w-]*$/)&&(e[t]=!0)}))}return e}function zn(t){if(!t||0===Object.keys(t).length)return"";const e=[];if(t.class){String(t.class).split(/\s+/).filter(Boolean).forEach((t=>e.push(".".concat(t))))}return t.id&&e.push("#".concat(t.id)),Object.entries(t).forEach((t=>{let[n,r]=t;"class"!==n&&"id"!==n&&(!0===r?e.push(n):!1!==r&&null!=r&&e.push("".concat(n,'="').concat(String(r),'"')))})),e.join(" ")}function $n(t){const{nodeName:e,name:n,parseAttributes:o=Pn,serializeAttributes:i=zn,defaultAttributes:s={},requiredAttributes:a=[],allowedAttributes:l}=t,c=n||e;return{parseMarkdown:(t,n)=>{const o=(0,r.A)((0,r.A)({},s),t.attributes);return n.createNode(e,o,[])},markdownTokenizer:{name:e,level:"block",start(t){var e;const n=new RegExp("^:::".concat(c,"(?:\\s|$)"),"m"),r=null==(e=t.match(n))?void 0:e.index;return void 0!==r?r:-1},tokenize(t,n,r){const i=new RegExp("^:::".concat(c,"(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)")),s=t.match(i);if(!s)return;const l=s[1]||"",u=o(l);return a.find((t=>!(t in u)))?void 0:{type:e,raw:s[0],attributes:u}}},renderMarkdown:t=>{const e=(t=>{if(!l)return t;const e={};return l.forEach((n=>{n in t&&(e[n]=t[n])})),e})(t.attrs||{}),n=i(e),r=n?" {".concat(n,"}"):"";return":::".concat(c).concat(r," :::")}}}function jn(t){const{nodeName:e,name:n,getContent:o,parseAttributes:i=Pn,serializeAttributes:s=zn,defaultAttributes:a={},content:l="block",allowedAttributes:c}=t,u=n||e;return{parseMarkdown:(t,n)=>{let i;if(o){const e=o(t);i="string"===typeof e?[{type:"text",text:e}]:e}else i="block"===l?n.parseChildren(t.tokens||[]):n.parseInline(t.tokens||[]);const s=(0,r.A)((0,r.A)({},a),t.attributes);return n.createNode(e,s,i)},markdownTokenizer:{name:e,level:"block",start(t){var e;const n=new RegExp("^:::".concat(u),"m"),r=null==(e=t.match(n))?void 0:e.index;return void 0!==r?r:-1},tokenize(t,n,r){var o;const s=new RegExp("^:::".concat(u,"(?:\\s+\\{([^}]*)\\})?\\s*\\n")),a=t.match(s);if(!a)return;const[c,d=""]=a,h=i(d);let p=1;const f=c.length;let m="";const g=/^:::([\w-]*)(\s.*)?/gm,y=t.slice(f);for(g.lastIndex=0;;){const n=g.exec(y);if(null===n)break;const i=n.index,s=n[1];if(!(null==(o=n[2])?void 0:o.endsWith(":::")))if(s)p+=1;else if(p-=1,0===p){const o=y.slice(0,i);m=o.trim();const s=t.slice(0,f+i+n[0].length);let a=[];if(m)if("block"===l)for(a=r.blockTokens(o),a.forEach((t=>{!t.text||t.tokens&&0!==t.tokens.length||(t.tokens=r.inlineTokens(t.text))}));a.length>0;){const t=a[a.length-1];if("paragraph"!==t.type||t.text&&""!==t.text.trim())break;a.pop()}else a=r.inlineTokens(m);return{type:e,raw:s,attributes:h,content:m,tokens:a}}}}},renderMarkdown:(t,e)=>{const n=(t=>{if(!c)return t;const e={};return c.forEach((n=>{n in t&&(e[n]=t[n])})),e})(t.attrs||{}),r=s(n),o=r?" {".concat(r,"}"):"",i=e.renderChildren(t.content||[],"\n\n");return":::".concat(u).concat(o,"\n\n").concat(i,"\n\n:::")}}}function Vn(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;null!==r;){const[,o,i,s]=r;e[o]=i||s,r=n.exec(t)}return e}function Hn(t){return Object.entries(t).filter((t=>{let[,e]=t;return void 0!==e&&null!==e})).map((t=>{let[e,n]=t;return"".concat(e,'="').concat(n,'"')})).join(" ")}function Kn(t){const{nodeName:e,name:n,getContent:o,parseAttributes:i=Vn,serializeAttributes:s=Hn,defaultAttributes:a={},selfClosing:l=!1,allowedAttributes:c}=t,u=n||e,d=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(t,n)=>{const i=(0,r.A)((0,r.A)({},a),t.attributes);if(l)return n.createNode(e,i);const s=o?o(t):t.content||"";return s?n.createNode(e,i,[n.createTextNode(s)]):n.createNode(e,i,[])},markdownTokenizer:{name:e,level:"inline",start(t){const e=l?new RegExp("\\[".concat(d,"\\s*[^\\]]*\\]")):new RegExp("\\[".concat(d,"\\s*[^\\]]*\\][\\s\\S]*?\\[\\/").concat(d,"\\]")),n=t.match(e),r=null==n?void 0:n.index;return void 0!==r?r:-1}
2,tokenize(t,n,r){const o=l?new RegExp("^\\[".concat(d,"\\s*([^\\]]*)\\]")):new RegExp("^\\[".concat(d,"\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/").concat(d,"\\]")),s=t.match(o);if(!s)return;let a="",c="";if(l){const[,t]=s;c=t}else{const[,t,e]=s;c=t,a=e||""}const u=i(c.trim());return{type:e,raw:s[0],content:a.trim(),attributes:u}}},renderMarkdown:t=>{let e="";o?e=o(t):t.content&&t.content.length>0&&(e=t.content.filter((t=>"text"===t.type)).map((t=>t.text)).join(""));const n=(t=>{if(!c)return t;const e={};return c.forEach((n=>{const r="string"===typeof n?n:n.name,o="string"===typeof n?void 0:n.skipIfDefault;if(r in t){const n=t[r];if(void 0!==o&&n===o)return;e[r]=n}})),e})(t.attrs||{}),r=s(n),i=r?" ".concat(r):"";return l?"[".concat(u).concat(i,"]"):"[".concat(u).concat(i,"]").concat(e,"[/").concat(u,"]")}}}function qn(t,e,n){var r,o,i,s;const a=t.split("\n"),l=[];let c="",u=0;const d=e.baseIndentSize||2;for(;u<a.length;){const t=a[u],h=t.match(e.itemPattern);if(!h){if(l.length>0)break;if(""===t.trim()){u+=1,c="".concat(c).concat(t,"\n");continue}return}const p=e.extractItemData(h),{indentLevel:f,mainContent:m}=p;c="".concat(c).concat(t,"\n");const g=[m];for(u+=1;u<a.length;){const t=a[u];if(""===t.trim()){const e=a.slice(u+1).findIndex((t=>""!==t.trim()));if(-1===e)break;if(((null==(o=null==(r=a[u+1+e].match(/^(\s*)/))?void 0:r[1])?void 0:o.length)||0)>f){g.push(t),c="".concat(c).concat(t,"\n"),u+=1;continue}break}if(!(((null==(s=null==(i=t.match(/^(\s*)/))?void 0:i[1])?void 0:s.length)||0)>f))break;g.push(t),c="".concat(c).concat(t,"\n"),u+=1}let y;const v=g.slice(1);if(v.length>0){const t=v.map((t=>t.slice(f+d))).join("\n");t.trim()&&(y=e.customNestedParser?e.customNestedParser(t):n.blockTokens(t))}const D=e.createToken(p,y);l.push(D)}if(0!==l.length)return{items:l,raw:c}}function Jn(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const o="function"===typeof n?n(r):n,[i,...s]=t.content,a=e.renderChildren([i]),l=["".concat(o).concat(a)];return s&&s.length>0&&s.forEach((t=>{const n=e.renderChildren([t]);if(n){const t=n.split("\n").map((t=>t?e.indent(t):"")).join("\n");l.push(t)}})),l.join("\n")}function Un(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{state:o}=e,{doc:i,tr:s}=o,a=t;i.descendants(((e,o)=>{const i=s.mapping.map(o),l=s.mapping.map(o)+e.nodeSize;let c=null;if(e.marks.forEach((t=>{if(t!==a)return!1;c=t})),!c)return;let u=!1;if(Object.keys(n).forEach((t=>{n[t]!==c.attrs[t]&&(u=!0)})),u){const e=t.type.create((0,r.A)((0,r.A)({},t.attrs),n));s.removeMark(i,l,t.type),s.addMark(i,l,e)}})),s.docChanged&&e.view.dispatch(s)}j({},{createAtomBlockMarkdownSpec:()=>$n,createBlockMarkdownSpec:()=>jn,createInlineMarkdownSpec:()=>Kn,parseAttributes:()=>Pn,parseIndentedBlocks:()=>qn,renderNestedMarkdownContent:()=>Jn,serializeAttributes:()=>zn});var _n=class{constructor(t,e,n){this.component=t,this.editor=e.editor,this.options=(0,r.A)({},n),this.mark=e.mark,this.HTMLAttributes=e.HTMLAttributes}get dom(){return this.editor.view.dom}get contentDOM(){return null}updateAttributes(t,e){Un(e||this.mark,this.editor,t)}ignoreMutation(t){if(!this.dom||!this.contentDOM)return!0;if("function"===typeof this.options.ignoreMutation)return this.options.ignoreMutation({mutation:t});if("selection"===t.type)return!1;if(this.dom.contains(t.target)&&"childList"===t.type&&(mt()||ft())&&this.editor.isFocused){if([...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every((t=>t.isContentEditable)))return!1}return this.contentDOM===t.target&&"attributes"===t.type||!this.contentDOM.contains(t.target)}},Wn=class t extends un{constructor(){super(...arguments),this.type="node"}static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n="function"===typeof e?e():e;return new t(n)}configure(t){return super.configure(t)}extend(t){const e="function"===typeof t?t():t;return super.extend(e)}},Gn=class{constructor(t,e,n){this.isDragging=!1,this.component=t,this.editor=e.editor,this.options=(0,r.A)({stopEvent:null,ignoreMutation:null},n),this.extension=e.extension,this.node=e.node,this.decorations=e.decorations,this.innerDecorations=e.innerDecorations,this.view=e.view,this.HTMLAttributes=e.HTMLAttributes,this.getPos=e.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(t){var e,n,r,o,i,a,l;const{view:c}=this.editor,u=t.target,d=3===u.nodeType?null==(e=u.parentElement)?void 0:e.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||(null==(n=this.contentDOM)?void 0:n.contains(u))||!d)return;let h=0,p=0;if(this.dom!==d){const e=this.dom.getBoundingClientRect(),n=d.getBoundingClientRect(),s=null!=(o=t.offsetX)?o:null==(r=t.nativeEvent)?void 0:r.offsetX,l=null!=(a=t.offsetY)?a:null==(i=t.nativeEvent)?void 0:i.offsetY;h=n.x-e.x+s,p=n.y-e.y+l}const f=this.dom.cloneNode(!0);try{const t=this.dom.getBoundingClientRect();f.style.width="".concat(Math.round(t.width),"px"),f.style.height="".concat(Math.round(t.height),"px"),f.style.boxSizing="border-box",f.style.pointerEvents="none"}catch(D){}let m=null;try{m=document.createElement("div"),m.style.position="absolute",m.style.top="-9999px",m.style.left="-9999px",m.style.pointerEvents="none",m.appendChild(f),document.body.appendChild(m),null==(l=t.dataTransfer)||l.setDragImage(f,h,p)}finally{m&&setTimeout((()=>{try{null==m||m.remove()}catch(t){}}),0)}const g=this.getPos();if("number"!==typeof g)return;const y=s.nh.create(c.state.doc,g),v=c.state.tr.setSelection(y);c.dispatch(v)}stopEvent(t){var e;if(!this.dom)return!1;if("function"===typeof this.options.stopEvent)return this.options.stopEvent({event:t});const n=t.target;if(!(this.dom.contains(n)&&!(null==(e=this.contentDOM)?void 0:e.contains(n))))return!1;const r=t.type.startsWith("drag"),o="drop"===t.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!o&&!r)return!0;const{isEditable:i}=this.editor,{isDragging:a}=this,l=!!this.node.type.spec.draggable,c=s.nh.isSelectable(this.node),u="copy"===t.type,d="paste"===t.type,h="cut"
2===t.type,p="mousedown"===t.type;if(!l&&c&&r&&t.target===this.dom&&t.preventDefault(),l&&r&&!a&&t.target===this.dom)return t.preventDefault(),!1;if(l&&i&&!a&&p){const t=n.closest("[data-drag-handle]");t&&(this.dom===t||this.dom.contains(t))&&(this.isDragging=!0,document.addEventListener("dragend",(()=>{this.isDragging=!1}),{once:!0}),document.addEventListener("drop",(()=>{this.isDragging=!1}),{once:!0}),document.addEventListener("mouseup",(()=>{this.isDragging=!1}),{once:!0}))}return!(a||o||u||d||h||p&&c)}ignoreMutation(t){if(!this.dom||!this.contentDOM)return!0;if("function"===typeof this.options.ignoreMutation)return this.options.ignoreMutation({mutation:t});if(this.node.isLeaf||this.node.isAtom)return!0;if("selection"===t.type)return!1;if(this.dom.contains(t.target)&&"childList"===t.type&&(mt()||ft())&&this.editor.isFocused){if([...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every((t=>t.isContentEditable)))return!1}return this.contentDOM===t.target&&"attributes"===t.type||!this.contentDOM.contains(t.target)}updateAttributes(t){this.editor.commands.command((e=>{let{tr:n}=e;const o=this.getPos();return"number"===typeof o&&(n.setNodeMarkup(o,void 0,(0,r.A)((0,r.A)({},this.node.attrs),t)),!0)}))}deleteNode(){const t=this.getPos();if("number"!==typeof t)return;const e=t+this.node.nodeSize;this.editor.commands.deleteRange({from:t,to:e})}};function Yn(t){return new hn({find:t.find,handler:e=>{let{state:n,range:r,match:o,pasteEvent:i}=e;const s=oe(t.getAttributes,void 0,o,i);if(!1===s||null===s)return null;const{tr:a}=n,l=o[o.length-1],c=o[0];let u=r.to;if(l){const e=c.search(/\S/),o=r.from+c.indexOf(l),i=o+l.length;if(ke(r.from,r.to,n.doc).filter((e=>e.mark.type.excluded.find((n=>n===t.type&&n!==e.mark.type)))).filter((t=>t.to>o)).length)return null;i<r.to&&a.delete(i,r.to),o>r.from&&a.delete(r.from+e,o),u=r.from+e+l.length,a.addMark(r.from+e,u,t.type.create(s||{})),a.removeStoredMark(t.type)}}})}},90621:(t,e,n)=>{n.d(e,{N_:()=>oe,Ay:()=>ie});var r=n(89379),o=n(129);const i="numeric",s="ascii",a="alpha",l="asciinumeric",c="alphanumeric",u="domain",d="emoji",h="scheme",p="slashscheme",f="whitespace";function m(t,e){return t in e||(e[t]=[]),e[t]}function g(t,e,n){e[i]&&(e[l]=!0,e[c]=!0),e[s]&&(e[l]=!0,e[a]=!0),e[l]&&(e[c]=!0),e[a]&&(e[c]=!0),e[c]&&(e[u]=!0),e[d]&&(e[u]=!0);for(const r in e){const e=m(r,n);e.indexOf(t)<0&&e.push(t)}}function y(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.j={},this.jr=[],this.jd=null,this.t=t}y.groups={},y.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const n=e.jr[r][0],o=e.jr[r][1];if(o&&n.test(t))return o}return e.jd},has(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let o=0;o<t.length;o++)this.tt(t[o],e,n,r)},tr(t,e,n,r){let o;return r=r||y.groups,e&&e.j?o=e:(o=new y(e),n&&r&&g(e,n,r)),this.jr.push([t,o]),o},ts(t,e,n,r){let o=this;const i=t.length;if(!i)return o;for(let s=0;s<i-1;s++)o=o.tt(t[s]);return o.tt(t[i-1],e,n,r)},tt(t,e,n,r){r=r||y.groups;const o=this;if(e&&e.j)return o.j[t]=e,e;const i=e;let s,a=o.go(t);if(a?(s=new y,Object.assign(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new y,i){if(r)if(s.t&&"string"===typeof s.t){const t=Object.assign(function(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}(s.t,r),n);g(i,t,r)}else n&&g(i,n,r);s.t=i}return o.j[t]=s,s}};const v=(t,e,n,r,o)=>t.ta(e,n,r,o),D=(t,e,n,r,o)=>t.tr(e,n,r,o),b=(t,e,n,r,o)=>t.ts(e,n,r,o),k=(t,e,n,r,o)=>t.tt(e,n,r,o),w="WORD",C="UWORD",A="ASCIINUMERICAL",x="ALPHANUMERICAL",E="LOCALHOST",S="TLD",M="UTLD",T="SCHEME",O="SLASH_SCHEME",F="NUM",N="WS",B="NL",R="OPENBRACE",I="CLOSEBRACE",L="OPENBRACKET",P="CLOSEBRACKET",z="OPENPAREN",$="CLOSEPAREN",j="OPENANGLEBRACKET",V="CLOSEANGLEBRACKET",H="FULLWIDTHLEFTPAREN",K="FULLWIDTHRIGHTPAREN",q="LEFTCORNERBRACKET",J="RIGHTCORNERBRACKET",U="LEFTWHITECORNERBRACKET",_="RIGHTWHITECORNERBRACKET",W="FULLWIDTHLESSTHAN",G="FULLWIDTHGREATERTHAN",Y="AMPERSAND",Z="APOSTROPHE",X="ASTERISK",Q="AT",tt="BACKSLASH",et="BACKTICK",nt="CARET",rt="COLON",ot="COMMA",it="DOLLAR",st="DOT",at="EQUALS",lt="EXCLAMATION",ct="HYPHEN",ut="PERCENT",dt="PIPE",ht="PLUS",pt="POUND",ft="QUERY",mt="QUOTE",gt="FULLWIDTHMIDDLEDOT",yt="SEMI",vt="SLASH",Dt="TILDE",bt="UNDERSCORE",kt="EMOJI",wt="SYM";var Ct=Object.freeze({__proto__:null,ALPHANUMERICAL:x,AMPERSAND:Y,APOSTROPHE:Z,ASCIINUMERICAL:A,ASTERISK:X,AT:Q,BACKSLASH:tt,BACKTICK:et,CARET:nt,CLOSEANGLEBRACKET:V,CLOSEBRACE:I,CLOSEBRACKET:P,CLOSEPAREN:$,COLON:rt,COMMA:ot,DOLLAR:it,DOT:st,EMOJI:kt,EQUALS:at,EXCLAMATION:lt,FULLWIDTHGREATERTHAN:G,FULLWIDTHLEFTPAREN:H,FULLWIDTHLESSTHAN:W,FULLWIDTHMIDDLEDOT:gt,FULLWIDTHRIGHTPAREN:K,HYPHEN:ct,LEFTCORNERBRACKET:q,LEFTWHITECORNERBRACKET:U,LOCALHOST:E,NL:B,NUM:F,OPENANGLEBRACKET:j,OPENBRACE:R,OPENBRACKET:L,OPENPAREN:z,PERCENT:ut,PIPE:dt,PLUS:ht,POUND:pt,QUERY:ft,QUOTE:mt,RIGHTCORNERBRACKET:J,RIGHTWHITECORNERBRACKET:_,SCHEME:T,SEMI:yt,SLASH:vt,SLASH_SCHEME:O,SYM:wt,TILDE:Dt,TLD:S,UNDERSCORE:bt,UTLD:M,UWORD:C,WORD:w,WS:N});const At=/[a-z]/,xt=/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u
20EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC4\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE4
20-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])/,Et=/(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEDC-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9\uDEF0-\uDEF8])/,St=/\d/,Mt=/\s/;let Tt=null,Ot=null;function Ft(t,e){const n=function(t){const e=[],n=t.length;let r=0;for(;r<n;){let o,i=t.charCodeAt(r),s=i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}(e.replace(/[A-Z]/g,(t=>t.toLowerCase()))),r=n.length,o=[];let i=0,s=0;for(;s<r;){let a=t,l=null,c=0,u=null,d=-1,h=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(d=0,h=0,u=a):d>=0&&(d+=n[s].length,h++),c+=n[s].length,i+=n[s].length,s++;i-=d,s-=h,c-=d,o.push({t:u.t,v:e.slice(i-c,i),s:i-c,e:i})}return o}function Nt(t,e,n,r,o){let i;const s=e.length;for(let a=0;a<s-1;a++){const n=e[a];t.j[n]?i=t.j[n]:(i=new y(r),i.jr=o.slice(),t.j[n]=i),t=i}return i=new y(n),i.jr=o.slice(),t.j[e[s-1]]=i,i}function Bt(t){const e=[],n=[];let r=0;for(;r<t.length;){let o=0;for(;"0123456789".indexOf(t[r+o])>=0;)o++;if(o>0){e.push(n.join(""));for(let e=parseInt(t.substring(r,r+o),10);e>0;e--)n.pop();r+=o}else n.push(t[r]),r++}return e}const Rt={defaultProtocol:"http",events:null,format:Lt,formatHref:Lt,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function It(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Object.assign({},Rt);t&&(n=Object.assign(n,t instanceof It?t.o:t));const r=n.ignoreTags,o=[];for(let i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}function Lt(t){return t}It.prototype={o:Rt,ignoreTags:[],defaultRender:t=>t,check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=null!=e;let o=this.o[t];return o?("object"===typeof o?(o=n.t in o?o[n.t]:Rt[t],"function"===typeof o&&r&&(o=o(e,n))):"function"===typeof o&&r&&(o=o(e,n.t,n)),o):o},getObj(t,e,n){let r=this.o[t];return"function"===typeof r&&null!=e&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Pt(t,e){this.t="token",this.v=t,this.tk=e}
2function zt(t,e){class n extends Pt{constructor(e,n){super(e,n),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}Pt.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"\u2026":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rt.defaultProtocol;return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),i=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),u=t.getObj("attributes",n,e),d=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),u&&Object.assign(s,u),{tagName:o,attributes:s,content:i,eventListeners:d}}};const $t=zt("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),jt=zt("text"),Vt=zt("nl"),Ht=zt("url",{isLink:!0,toHref(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rt.defaultProtocol;return this.hasProtocol()?this.v:"".concat(t,"://").concat(this.v)},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==E&&t[1].t===rt}});const Kt=t=>new y(t);function qt(t,e,n){const r=n[0].s,o=n[n.length-1].e;return new t(e.slice(r,o),n)}const Jt="undefined"!==typeof console&&console&&console.warn||(()=>{}),Ut="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",_t={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Wt(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(_t.initialized&&Jt('linkifyjs: already initialized - will not register custom scheme "'.concat(t,'" ').concat(Ut)),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error('linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or "-"\n2. Cannot start or end with "-"\n3. "-" cannot repeat');_t.customSchemes.push([t,e])}function Gt(){_t.scanner=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e={};y.groups=e;const n=new y;null==Tt&&(Tt=Bt("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2
2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xf6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==Ot&&(Ot=Bt("\u03b5\u03bb1\u03c52\u0431\u04331\u0435\u043b3\u0434\u0435\u0442\u04384\u0435\u044e2\u043a\u0430\u0442\u043e\u043b\u0438\u043a6\u043e\u043c3\u043c\u043a\u04342\u043e\u043d1\u0441\u043a\u0432\u04306\u043e\u043d\u043b\u0430\u0439\u043d5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043a\u04403\u049b\u0430\u04373\u0570\u0561\u05753\u05d9\u05e9\u05e8\u05d0\u05dc5\u05e7\u05d5\u05dd3\u0627\u0628\u0648\u0638\u0628\u064a5\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062f\u06464\u0628\u062d\u0631\u064a\u06465\u062c\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062f\u064a\u06296\u0639\u0644\u064a\u0627\u06465\u0645\u063a\u0631\u06285\u0645\u0627\u0631\u0627\u062a5\u06cc\u0631\u0627\u06465\u0628\u0627\u0631\u062a2\u0632\u0627\u06314\u064a\u062a\u06433\u06be\u0627\u0631\u062a5\u062a\u0648\u0646\u06334\u0633\u0648\u062f\u0627\u06463\u0631\u064a\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064a\u06466\u0642\u0637\u06313\u0643\u0627\u062b\u0648\u0644\u064a\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064a\u0633\u064a\u06275\u0648\u0631\u064a\u062a\u0627\u0646\u064a\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067e\u0627\u06a9\u0633\u062a\u0627\u06467\u0680\u0627\u0631\u062a4\u0915\u0949\u092e3\u0928\u0947\u091f3\u092d\u093e\u0930\u09240\u092e\u094d3\u094b\u09245\u0938\u0902\u0917\u0920\u09285\u09ac\u09be\u0982\u09b2\u09be5\u09ad\u09be\u09b0\u09a42\u09f0\u09a44\u0a2d\u0a3e\u0a30\u0a244\u0aad\u0abe\u0ab0\u0aa44\u0b2d\u0b3e\u0b30\u0b244\u0b87\u0ba8\u0bcd\u0ba4\u0bbf\u0baf\u0bbe6\u0bb2\u0b99\u0bcd\u0b95\u0bc86\u0b9a\u0bbf\u0b99\u0bcd\u0b95\u0baa\u0bcd\u0baa\u0bc2\u0bb0\u0bcd11\u0c2d\u0c3e\u0c30\u0c24\u0c4d5\u0cad\u0cbe\u0cb0\u0ca44\u0d2d\u0d3e\u0d30\u0d24\u0d025\u0dbd\u0d82\u0d9a\u0dcf4\u0e04\u0e2d\u0e213\u0e44\u0e17\u0e223\u0ea5\u0eb2\u0ea73\u10d2\u10d42\u307f\u3093\u306a3\u30a2\u30de\u30be\u30f34\u30af\u30e9\u30a6\u30c94\u30b0\u30fc\u30b0\u30eb4\u30b3\u30e02\u30b9\u30c8\u30a23\u30bb\u30fc\u30eb3\u30d5\u30a1\u30c3\u30b7\u30e7\u30f36\u30dd\u30a4\u30f3\u30c84\u4e16\u754c2\u4e2d\u4fe11\u56fd1\u570b1\u6587\u7f513\u4e9a\u9a6c\u900a3\u4f01\u4e1a2\u4f5b\u5c712\u4fe1\u606f2\u5065\u5eb72\u516b\u53662\u516c\u53f81\u76ca2\u53f0\u6e7e1\u70632\u5546\u57ce1\u5e971\u68072\u5609\u91cc0\u5927\u9152\u5e975\u5728\u7ebf2\u5927\u62ff2\u5929\u4e3b\u65593\u5a31\u4e502\u5bb6\u96fb2\u5e7f\u4e1c2\u5fae\u535a2\u6148\u55842\u6211\u7231\u4f603\u624b\u673a2\u62db\u80582\u653f\u52a11\u5e9c2\u65b0\u52a0\u57612\u95fb2\u65f6\u5c1a2\u66f8\u7c4d2\u673a\u67842\u6de1\u9a6c\u95213\u6e38\u620f2\u6fb3\u95802\u70b9\u770b2\u79fb\u52a82\u7ec4\u7ec7\u673a\u67844\u7f51\u57401\u5e971\u7ad91\u7edc2\u8054\u901a2\u8c37\u6b4c2\u8d2d\u72692\u901a\u8ca92\u96c6\u56e22\u96fb\u8a0a\u76c8\u79d14\u98de\u5229\u6d663\u98df\u54c12\u9910\u53852\u9999\u683c\u91cc\u62c93\u6e2f2\ub2f7\ub1371\ucef42\uc0bc\uc1312\ud55c\uad6d2")),k(n,"'",Z),k(n,"{",R),k(n,"}
2",I),k(n,"[",L),k(n,"]",P),k(n,"(",z),k(n,")",$),k(n,"<",j),k(n,">",V),k(n,"\uff08",H),k(n,"\uff09",K),k(n,"\u300c",q),k(n,"\u300d",J),k(n,"\u300e",U),k(n,"\u300f",_),k(n,"\uff1c",W),k(n,"\uff1e",G),k(n,"&",Y),k(n,"*",X),k(n,"@",Q),k(n,"`",et),k(n,"^",nt),k(n,":",rt),k(n,",",ot),k(n,"$",it),k(n,".",st),k(n,"=",at),k(n,"!",lt),k(n,"-",ct),k(n,"%",ut),k(n,"|",dt),k(n,"+",ht),k(n,"#",pt),k(n,"?",ft),k(n,'"',mt),k(n,"/",vt),k(n,";",yt),k(n,"~",Dt),k(n,"_",bt),k(n,"\\",tt),k(n,"\u30fb",gt);const r=D(n,St,F,{[i]:!0});D(r,St,r);const o=D(r,At,A,{[l]:!0}),m=D(r,xt,x,{[c]:!0}),v=D(n,At,w,{[s]:!0});D(v,St,o),D(v,At,v),D(o,St,o),D(o,At,o);const Ft=D(n,xt,C,{[a]:!0});D(Ft,At),D(Ft,St,m),D(Ft,xt,Ft),D(m,St,m),D(m,At),D(m,xt,m);const Rt=k(n,"\n",B,{[f]:!0}),It=k(n,"\r",N,{[f]:!0}),Lt=D(n,Mt,N,{[f]:!0});k(n,"\ufffc",Lt),k(It,"\n",Rt),k(It,"\ufffc",Lt),D(It,Mt,Lt),k(Lt,"\r"),k(Lt,"\n"),D(Lt,Mt,Lt),k(Lt,"\ufffc",Lt);const Pt=D(n,Et,kt,{[d]:!0});k(Pt,"#"),D(Pt,Et,Pt),k(Pt,"\ufe0f",Pt);const zt=k(Pt,"\u200d");k(zt,"#"),D(zt,Et,Pt);const $t=[[At,v],[St,o]],jt=[[At,null],[xt,Ft],[St,m]];for(let i=0;i<Tt.length;i++)Nt(n,Tt[i],S,w,$t);for(let i=0;i<Ot.length;i++)Nt(n,Ot[i],M,C,jt);g(S,{tld:!0,ascii:!0},e),g(M,{utld:!0,alpha:!0},e),Nt(n,"file",T,w,$t),Nt(n,"mailto",T,w,$t),Nt(n,"http",O,w,$t),Nt(n,"https",O,w,$t),Nt(n,"ftp",O,w,$t),Nt(n,"ftps",O,w,$t),g(T,{scheme:!0,ascii:!0},e),g(O,{slashscheme:!0,ascii:!0},e),t=t.sort(((t,e)=>t[0]>e[0]?1:-1));for(let a=0;a<t.length;a++){const e=t[a][0],r=t[a][1]?{[h]:!0}:{[p]:!0};e.indexOf("-")>=0?r[u]=!0:At.test(e)?St.test(e)?r[l]=!0:r[s]=!0:r[i]=!0,b(n,e,e,r)}return b(n,"localhost",E,{ascii:!0}),n.jd=new y(wt),{start:n,tokens:Object.assign({groups:e},Ct)}}(_t.customSchemes);for(let t=0;t<_t.tokenQueue.length;t++)_t.tokenQueue[t][1]({scanner:_t.scanner});_t.parser=function(t){let{groups:e}=t;const n=e.domain.concat([Y,X,Q,tt,et,nt,it,at,ct,F,ut,dt,ht,pt,vt,wt,Dt,bt]),r=[Z,rt,ot,st,lt,ut,ft,mt,yt,j,V,R,I,P,L,z,$,H,K,q,J,U,_,W,G],o=[Y,Z,X,tt,et,nt,it,at,ct,R,I,ut,dt,ht,pt,ft,vt,wt,Dt,bt],i=Kt(),s=k(i,Dt);v(s,o,s),v(s,e.domain,s);const a=Kt(),l=Kt(),c=Kt();v(i,e.domain,a),v(i,e.scheme,l),v(i,e.slashscheme,c),v(a,o,s),v(a,e.domain,a);const u=k(a,Q);k(s,Q,u),k(l,Q,u),k(c,Q,u);const d=k(s,st);v(d,o,s),v(d,e.domain,s);const h=Kt();v(u,e.domain,h),v(h,e.domain,h);const p=k(h,st);v(p,e.domain,h);const f=Kt($t);v(p,e.tld,f),v(p,e.utld,f),k(u,E,f);const m=k(h,ct);k(m,ct,m),v(m,e.domain,h),v(f,e.domain,h),k(f,st,p),k(f,ct,m);const g=k(f,rt);v(g,e.numeric,$t);const y=k(a,ct),D=k(a,st);k(y,ct,y),v(y,e.domain,a),v(D,o,s),v(D,e.domain,a);const b=Kt(Ht);v(D,e.tld,b),v(D,e.utld,b),v(b,e.domain,a),v(b,o,s),k(b,st,D),k(b,ct,y),k(b,Q,u);const w=k(b,rt),C=Kt(Ht);v(w,e.numeric,C);const A=Kt(Ht),x=Kt();v(A,n,A),v(A,r,x),v(x,n,A),v(x,r,x),k(b,vt,A),k(C,vt,A);const S=k(l,rt),M=k(c,rt),T=k(M,vt),O=k(T,vt);v(l,e.domain,a),k(l,st,D),k(l,ct,y),v(c,e.domain,a),k(c,st,D),k(c,ct,y),v(S,e.domain,A),k(S,vt,A),k(S,ft,A),v(O,e.domain,A),v(O,n,A),k(O,vt,A);const N=[[R,I],[L,P],[z,$],[j,V],[H,K],[q,J],[U,_],[W,G]];for(let E=0;E<N.length;E++){const[t,e]=N[E],o=k(A,t);k(x,t,o),k(o,e,A);const i=Kt(Ht);v(o,n,i);const s=Kt();v(o,r),v(i,n,i),v(i,r,s),v(s,n,i),v(s,r,s),k(i,e,A),k(s,e,A)}return k(i,E,b),k(i,B,Vt),{start:i,tokens:Ct}}(_t.scanner.tokens);for(let t=0;t<_t.pluginQueue.length;t++)_t.pluginQueue[t][1]({scanner:_t.scanner,parser:_t.parser});return _t.initialized=!0,_t}function Yt(t){return _t.initialized||Gt(),function(t,e,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let a=t,l=null,c=null,u=0,d=null,h=-1;for(;o<r&&!(l=a.go(n[o].t));)s.push(n[o++]);for(;o<r&&(c=l||a.go(n[o].t));)l=null,a=c,a.accepts()?(h=0,d=a):h>=0&&h++,o++,u++;if(h<0)o-=u,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(qt(jt,e,s)),s=[]),o-=h,u-=h;const t=d.t,r=n.slice(o-u,o);i.push(qt(t,e,r))}}return s.length>0&&i.push(qt(jt,e,s)),i}(_t.parser.start,t,Ft(_t.scanner.start,t))}function Zt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(e&&"object"===typeof e){if(n)throw Error("linkifyjs: Invalid link type ".concat(e,"; must be a string"));n=e,e=null}const r=new It(n),o=Yt(t),i=[];for(let s=0;s<o.length;s++){const t=o[s];!t.isLink||e&&t.t!==e||!r.check(t)||i.push(t.toFormattedObject(r))}return i}Yt.scan=Ft;var Xt=n(17184),Qt="[\0- \xa0\u1680\u180e\u2000-\u2029\u205f\u3000]",te=ne
2w RegExp(Qt),ee=new RegExp("".concat(Qt,"$")),ne=new RegExp(Qt,"g");function re(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach((t=>{const e="string"===typeof t?t:t.scheme;e&&n.push(e)})),!t||t.replace(ne,"").match(new RegExp("^(?:(?:".concat(n.join("|"),"):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))"),"i"))}var oe=o.CU.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach((t=>{"string"!==typeof t?Wt(t.scheme,t.optionalSlashes):Wt(t)}))},onDestroy(){y.groups={},_t.scanner=null,_t.parser=null,_t.tokenQueue=[],_t.pluginQueue=[],_t.customSchemes=[],_t.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!re(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}),addAttributes(){return{href:{default:null,parseHTML:t=>t.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!(!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!re(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML(t){let{HTMLAttributes:e}=t;return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!re(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",(0,o.KV)(this.options.HTMLAttributes,e),0]:["a",(0,o.KV)(this.options.HTMLAttributes,(0,r.A)((0,r.A)({},e),{},{href:""})),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n;const r=(null==(n=t.attrs)?void 0:n.href)||"",o=e.renderChildren(t);return"[".concat(o,"](").concat(r,")")},addCommands(){return{setLink:t=>e=>{let{chain:n}=e;const{href:r}=t;return!!this.options.isAllowedUri(r,{defaultValidate:t=>!!re(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&n().setMark(this.name,t).setMeta("preventAutolink",!0).run()},toggleLink:t=>e=>{let{chain:n}=e;const{href:r}=t||{};return!(r&&!this.options.isAllowedUri(r,{defaultValidate:t=>!!re(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&n().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>t=>{let{chain:e}=t;return e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}}},addPasteRules(){return[(0,o.Zc)({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,o=Zt(t).filter((t=>t.isLink&&this.options.isAllowedUri(t.value,{defaultValidate:t=>!!re(t,n),protocols:n,defaultProtocol:r})));o.length&&o.forEach((t=>{this.options.shouldAutoLink(t.value)&&e.push({text:t.value,data:{href:t.href},index:t.start})}))}return e}
2,type:this.type,getAttributes:t=>{var e;return{href:null==(e=t.data)?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(function(t){return new Xt.k_({key:new Xt.hs("autolink"),appendTransaction:(e,n,i)=>{const s=e.some((t=>t.docChanged))&&!n.doc.eq(i.doc),a=e.some((t=>t.getMeta("preventAutolink")));if(!s||a)return;const{tr:l}=i,c=(0,o.T7)(n.doc,[...e]);return(0,o.FF)(c).forEach((e=>{let{newRange:n}=e;const s=(0,o.Nx)(i.doc,n,(t=>t.isTextblock));let a,c;if(s.length>1)a=s[0],c=i.doc.textBetween(a.pos,a.pos+a.node.nodeSize,void 0," ");else if(s.length){const t=i.doc.textBetween(n.from,n.to," "," ");if(!ee.test(t))return;a=s[0],c=i.doc.textBetween(a.pos,n.to,void 0," ")}if(a&&c){const e=c.split(te).filter(Boolean);if(e.length<=0)return!1;const n=e[e.length-1],s=a.pos+c.lastIndexOf(n);if(!n)return!1;const d=Yt(n).map((e=>e.toObject(t.defaultProtocol)));if(!(1===(u=d).length?u[0].isLink:3===u.length&&u[1].isLink&&["()","[]"].includes(u[0].value+u[2].value)))return!1;d.filter((t=>t.isLink)).map((t=>(0,r.A)((0,r.A)({},t),{},{from:s+t.start+1,to:s+t.end+1}))).filter((t=>!i.schema.marks.code||!i.doc.rangeHasMark(t.from,t.to,i.schema.marks.code))).filter((e=>t.validate(e.value))).filter((e=>t.shouldAutoLink(e.value))).forEach((e=>{(0,o.hO)(e.from,e.to,i.doc).some((e=>e.mark.type===t.type))||l.addMark(e.from,e.to,t.type.create({href:e.href}))}))}var u})),l.steps.length?l:void 0}})}({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:t=>this.options.isAllowedUri(t,{defaultValidate:t=>!!re(t,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(function(t){return new Xt.k_({key:new Xt.hs("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,s;if(0!==r.button)return!1;if(!e.editable)return!1;let a=!1;if(t.enableClickSelection&&(a=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){let n=null;if(r.target instanceof HTMLAnchorElement)n=r.target;else{let t=r.target;const e=[];for(;"DIV"!==t.nodeName;)e.push(t),t=t.parentNode;n=e.find((t=>"A"===t.nodeName))}if(!n)return a;const l=(0,o.gu)(e.state,t.type.name),c=null!=(i=null==n?void 0:n.href)?i:l.href,u=null!=(s=null==n?void 0:n.target)?s:l.target;n&&c&&(window.open(c,u),a=!0)}return a}}})}({type:this.type,editor:this.editor,openOnClick:"whenNotEditable"===this.options.openOnClick||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(function(t){return new Xt.k_({key:new Xt.hs("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{shouldAutoLink:o}=t,{state:i}=e,{selection:s}=i,{empty:a}=s;if(a)return!1;let l="";r.content.forEach((t=>{l+=t.textContent}));const c=Zt(l,{defaultProtocol:t.defaultProtocol}).find((t=>t.isLink&&t.value===l));return!(!l||!c||void 0!==o&&!o(c.href))&&t.editor.commands.setMark(t.type,{href:c.href})}}})}({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),ie=oe},50675:(t,e,n)=>{n.d(e,{A:()=>p});var r=n(89379),o=n(129),i=n(54282),s=n(17184),a=n(11140);function l(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:s,startOfLine:a,$position:l}=t,c=r&&!i,u=(0,o.GG)(n),d=new RegExp("\\s".concat(u,"$")),h=a?"^":"",p=i?"":u,f=c?new RegExp("".concat(h).concat(u,".*?(?=\\s").concat(p,"|$)"),"gm"):new RegExp("".concat(h,"(?:^)?").concat(u,"[^\\s").concat(p,"]*"),"gm"),m=(null==(e=l.nodeBefore)?void 0:e.isText)&&l.nodeBefore.text;if(!m)return null;const g=l.pos-m.length,y=Array.from(m.matchAll(f)).pop();if(!y||void 0===y.input||void 0===y.index)return null;const v=y.input.slice(Math.max(0,y.index-1),y.index),D=new RegExp("^[".concat(null==s?void 0:s.join(""),"\0]?$")).test(v);if(null!==s&&!D)return null;const b=g+y.index;let k=b+y[0].length;return c&&d.test(m.slice(k-1,k+1))&&(y[0]+=" ",k+=1),b<l.pos&&k>=l.pos?{range:{from:b,to:k},query:y[0].slice(n.length),text:y[0]}:null}var c=new s.hs("suggestion");function u(t){let e,{pluginKey:n=c,editor:o,char:i="@",allowSpaces:u=!1,allowToIncludeChar:d=!1,allowedPrefixes:h=[" "],startOfLine:p=!1,decorationTag:f="span",decorationClass:m="suggestion",decorationContent:g="",decorationEmptyClass:y="is-empty",command:v=()=>null,items:D=()=>[],render:b=()=>({}),allow:k=()=>!0,findSuggestionMatch:w=l}=t;
2const C=null==b?void 0:b(),A=()=>{const t=o.state.selection.$anchor.pos,e=o.view.coordsAtPos(t),{top:n,right:r,bottom:i,left:s}=e;try{return new DOMRect(s,n,r-s,i-n)}catch(a){return null}},x=(t,e)=>e?()=>{const e=n.getState(o.state),r=null==e?void 0:e.decorationId,i=t.dom.querySelector('[data-decoration-id="'.concat(r,'"]'));return(null==i?void 0:i.getBoundingClientRect())||null}:A;const E=new s.k_({key:n,view(){return{update:async(t,n)=>{var r,i,s,a,l,c,u;const d=null==(r=this.key)?void 0:r.getState(n),h=null==(i=this.key)?void 0:i.getState(t.state),p=d.active&&h.active&&d.range.from!==h.range.from,f=!d.active&&h.active,m=d.active&&!h.active,g=!f&&!m&&d.query!==h.query,y=f||p&&g,b=g||p,k=m||p&&g;if(!y&&!b&&!k)return;const w=k&&!y?d:h,A=t.dom.querySelector('[data-decoration-id="'.concat(w.decorationId,'"]'));e={editor:o,range:w.range,query:w.query,text:w.text,items:[],command:t=>v({editor:o,range:w.range,props:t}),decorationNode:A,clientRect:x(t,A)},y&&(null==(s=null==C?void 0:C.onBeforeStart)||s.call(C,e)),b&&(null==(a=null==C?void 0:C.onBeforeUpdate)||a.call(C,e)),(b||y)&&(e.items=await D({editor:o,query:w.query})),k&&(null==(l=null==C?void 0:C.onExit)||l.call(C,e)),b&&(null==(c=null==C?void 0:C.onUpdate)||c.call(C,e)),y&&(null==(u=null==C?void 0:C.onStart)||u.call(C,e))},destroy:()=>{var t;e&&(null==(t=null==C?void 0:C.onExit)||t.call(C,e))}}},state:{init:()=>({active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}),apply(t,e,s,a){const{isEditable:l}=o,{composing:c}=o.view,{selection:f}=t,{empty:m,from:g}=f,y=(0,r.A)({},e),v=t.getMeta(n);if(v&&v.exit)return y.active=!1,y.decorationId=null,y.range={from:0,to:0},y.query=null,y.text=null,y;if(y.composing=c,l&&(m||o.view.composing)){!(g<e.range.from||g>e.range.to)||c||e.composing||(y.active=!1);const t=w({char:i,allowSpaces:u,allowToIncludeChar:d,allowedPrefixes:h,startOfLine:p,$position:f.$from}),n="id_".concat(Math.floor(4294967295*Math.random()));t&&k({editor:o,state:a,range:t.range,isActive:e.active})?(y.active=!0,y.decorationId=e.decorationId?e.decorationId:n,y.range=t.range,y.query=t.query,y.text=t.text):y.active=!1}else y.active=!1;return y.active||(y.decorationId=null,y.range={from:0,to:0},y.query=null,y.text=null),y}},props:{handleKeyDown(t,r){var i,s,a,l;const{active:c,range:u}=E.getState(t.state);if(!c)return!1;if("Escape"===r.key||"Esc"===r.key){const l=E.getState(t.state),c=null!=(i=null==e?void 0:e.decorationNode)?i:null,u=null!=c?c:(null==l?void 0:l.decorationId)?t.dom.querySelector('[data-decoration-id="'.concat(l.decorationId,'"]')):null;if((null==(s=null==C?void 0:C.onKeyDown)?void 0:s.call(C,{view:t,event:r,range:l.range}))||!1)return!0;const d={editor:o,range:l.range,query:l.query,text:l.text,items:[],command:t=>v({editor:o,range:l.range,props:t}),decorationNode:u,clientRect:u?()=>u.getBoundingClientRect()||null:null};return null==(a=null==C?void 0:C.onExit)||a.call(C,d),function(t,e){var r;try{const e=n.getState(t.state),i=(null==e?void 0:e.decorationId)?t.dom.querySelector('[data-decoration-id="'.concat(e.decorationId,'"]')):null,s={editor:o,range:(null==e?void 0:e.range)||{from:0,to:0},query:(null==e?void 0:e.query)||null,text:(null==e?void 0:e.text)||null,items:[],command:t=>v({editor:o,range:(null==e?void 0:e.range)||{from:0,to:0},props:t}),decorationNode:i,clientRect:x(t,i)};null==(r=null==C?void 0:C.onExit)||r.call(C,s)}catch(s){}const i=t.state.tr.setMeta(e,{exit:!0});t.dispatch(i)}(t,n),!0}return(null==(l=null==C?void 0:C.onKeyDown)?void 0:l.call(C,{view:t,event:r,range:u}))||!1},decorations(t){const{active:e,range:n,decorationId:r,query:o}=E.getState(t);if(!e)return null;const i=!(null==o?void 0:o.length),s=[m];return i&&s.push(y),a.zF.create(t.doc,[a.NZ.inline(n.from,n.to,{nodeName:f,class:s.join(" "),"data-decoration-id":r,"data-decoration-content":g})])}}});return E}function d(t){return(t.options.suggestions.length?t.options.suggestions:[t.options.suggestion]).map((e=>function(t){let{editor:e,overrideSuggestionOptions:n,extensionName:o,char:i="@"}=t;const a=new s.hs;return(0,r.A)({editor:e,char:i,pluginKey:a,command:t=>{let{editor:e,range:n,props:s}=t;var a,l,c;const u=e.view.state.selection.$to.nodeAfter;(null==(a=null==u?void 0:u.text)?void 0:a.startsWith(" "))&&(n.to+=1),e.chain().focus().insertContentAt(n,[{type:o,attrs:(0,r.A)((0,r.A)({},s),{},{mentionSuggestionChar:i})},{type:"text",text:" "}]).run(),null==(c=null==(l=e.view.dom.ownerDocument.defaultView)?void 0:l.getSelection())||c.collapseToEnd()},allow:t=>{let{state:e,range:n}=t;
2const r=e.doc.resolve(n.from),i=e.schema.nodes[o];return!!r.parent.type.contentMatch.matchType(i)}},n)}({editor:t.editor,overrideSuggestionOptions:e,extensionName:t.name,char:e.char})))}function h(t,e){const n=d(t),r=n.find((t=>t.char===e));return r||(n.length?n[0]:null)}var p=o.bP.create((0,r.A)((0,r.A)({name:"mention",priority:101,addOptions:()=>({HTMLAttributes:{},renderText(t){let{node:e,suggestion:n}=t;var r,o;return"".concat(null!=(r=null==n?void 0:n.char)?r:"@").concat(null!=(o=e.attrs.label)?o:e.attrs.id)},deleteTriggerWithBackspace:!1,renderHTML(t){let{options:e,node:n,suggestion:r}=t;var i,s;return["span",(0,o.KV)(this.HTMLAttributes,e.HTMLAttributes),"".concat(null!=(i=null==r?void 0:r.char)?i:"@").concat(null!=(s=n.attrs.label)?s:n.attrs.id)]},suggestions:[],suggestion:{}}),group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:()=>({id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}},mentionSuggestionChar:{default:"@",parseHTML:t=>t.getAttribute("data-mention-suggestion-char"),renderHTML:t=>({"data-mention-suggestion-char":t.mentionSuggestionChar})}}),parseHTML(){return[{tag:'span[data-type="'.concat(this.name,'"]')}]},renderHTML(t){let{node:e,HTMLAttributes:n}=t;const i=h(this,e.attrs.mentionSuggestionChar);if(void 0!==this.options.renderLabel)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",(0,o.KV)({"data-type":this.name},this.options.HTMLAttributes,n),this.options.renderLabel({options:this.options,node:e,suggestion:i})];const s=(0,r.A)({},this.options);s.HTMLAttributes=(0,o.KV)({"data-type":this.name},this.options.HTMLAttributes,n);const a=this.options.renderHTML({options:s,node:e,suggestion:i});return"string"===typeof a?["span",(0,o.KV)({"data-type":this.name},this.options.HTMLAttributes,n),a]:a}},(0,o.ur)({nodeName:"mention",name:"@",selfClosing:!0,allowedAttributes:["id","label",{name:"mentionSuggestionChar",skipIfDefault:"@"}],parseAttributes:t=>{const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;null!==r;){const[,o,i,s]=r,a=null!=i?i:s;e["char"===o?"mentionSuggestionChar":o]=a,r=n.exec(t)}return e},serializeAttributes:t=>Object.entries(t).filter((t=>{let[,e]=t;return void 0!==e&&null!==e})).map((t=>{let[e,n]=t;return"".concat("mentionSuggestionChar"===e?"char":e,'="').concat(n,'"')})).join(" ")})),{},{renderText(t){let{node:e}=t;const n={options:this.options,node:e,suggestion:h(this,e.attrs.mentionSuggestionChar)};return void 0!==this.options.renderLabel?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel(n)):this.options.renderText(n)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command((t=>{let{tr:e,state:n}=t,r=!1;const{selection:o}=n,{empty:s,anchor:a}=o;if(!s)return!1;let l=new i.bP,c=0;return n.doc.nodesBetween(a-1,a,((t,e)=>{if(t.type.name===this.name)return r=!0,l=t,c=e,!1})),r&&e.insertText(this.options.deleteTriggerWithBackspace?"":l.attrs.mentionSuggestionChar,c,c+l.nodeSize),r}))}},addProseMirrorPlugins(){return d(this).map(u)}}))},59368:(t,e,n)=>{n.d(e,{A:()=>r});var r=n(78666).Or},78666:(t,e,n)=>{n.d(e,{QO:()=>$,vR:()=>j,Or:()=>V,JU:()=>K,lb:()=>q});var r=n(129),o=n(17184),i=n(28115);function s(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new o.k_({view:e=>new a(e,t)})}class a{constructor(t,e){var n;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=e.width)&&void 0!==n?n:1,this.color=!1===e.color?void 0:e.color||"black",this.class=e.class,this.handlers=["dragover","dragend","drop","dragleave"].map((e=>{let n=t=>{this[e](t)};return t.dom.addEventListener(e,n),{name:e,handler:n}}))}destroy(){this.handlers.forEach((t=>{let{name:e,handler:n}=t;return this.editorView.dom.removeEventListener(e,n)}))}update(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t,e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r=this.editorView.dom,o=r.getBoundingClientRect(),i=o.width/r.offsetWidth,s=o.height/r.offsetHeight;if(n){let n=e.nodeBefore,r=e.nodeAfter;if(n||r){let e=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(e){let o=e.getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let a=this.width/2*s;t={left:o.left,right:o.right,top:i-a,bottom:i+a}}}}if(!t){let e=this.editorView.coordsAtPos(this.cursorPos),n=this.width/2*i;t={left:e.left-n,right:e.left+n,top:e.top,bottom:e.bottom}}let a,l,c=this.editorView.dom.offsetParent;if(this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),!c||c==document.body&&"static"==getComputedStyle(c).position)a=-pageXOffset,l=-pageYOffset;else{let t=c.getBoundingClientRect(),e=t.width/c.offsetWidth,n=t.height/c.offsetHeight;a=t.left-c.scrollLeft*e,l=t.top-c.scrollTop*n}this.element.style.left=(t.left-a)/i+"px",this.element.style.top=(t.top-l)/s+"px",this.element.style.width=(t.right-t.left)/i+"px",this.element.style.height=(t.bottom-t.top)/s+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout((()=>this.setCursor(null)),t)}dragover(t){if(!this.editorView.editable)return;let e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),n=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,e,t):r;if(e&&!o){let t=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=(0,i.Um)(this.editorView.state.doc,t,this.editorView.dragging.slice);null!=e&&(t=e)}this.setCursor(t),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}var l=n(11140),c=n(62195),u=n(54282);class d extends o.LN{constructor(t){super(t,t)}map(t,e){let n=t.resolve(e.map(this.head));return d.valid(n)?new d(n):o.LN.near(n)}content(){return u.Ji.empty}eq(t){return t instanceof d&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new d(t.resolve(e.pos))}getBookmark(){return new h(this.anchor)}static valid(t){let e=t.parent;if(e.isTextblock||!function(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(0!=n)for(let t=r.child(n-1);;t=t.lastChild){if(0==t.childCount&&!t.inlineContent||p(t.type))return!0;
vendor: 5,421 bytes, line 2
2if(t.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(t)||!function(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n!=r.childCount)for(let t=r.child(n);;t=t.firstChild){if(0==t.childCount&&!t.inlineContent||p(t.type))return!0;if(t.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(t))return!1;let n=e.type.spec.allowGapCursor;if(null!=n)return n;let r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t:for(;;){if(!n&&d.valid(t))return t;let r=t.pos,i=null;for(let n=t.depth;;n--){let o=t.node(n);if(e>0?t.indexAfter(n)<o.childCount:t.index(n)>0){i=o.child(e>0?t.indexAfter(n):t.index(n)-1);break}if(0==n)return null;r+=e;let s=t.doc.resolve(r);if(d.valid(s))return s}for(;;){let s=e>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!o.nh.isSelectable(i)){t=t.doc.resolve(r+i.nodeSize*e),n=!1;continue t}break}i=s,r+=e;let a=t.doc.resolve(r);if(d.valid(a))return a}return null}}}d.prototype.visible=!1,d.findFrom=d.findGapCursorFrom,o.LN.jsonID("gapcursor",d);class h{constructor(t){this.pos=t}map(t){return new h(t.map(this.pos))}resolve(t){let e=t.resolve(this.pos);return d.valid(e)?new d(e):o.LN.near(e)}}function p(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}const f=(0,c.K)({ArrowLeft:m("horiz",-1),ArrowRight:m("horiz",1),ArrowUp:m("vert",-1),ArrowDown:m("vert",1)});function m(t,e){const n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,r,i){let s=t.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof o.U3){if(!i.endOfTextblock(n)||0==a.depth)return!1;l=!1,a=t.doc.resolve(e>0?a.after():a.before())}let c=d.findGapCursorFrom(a,e,l);return!!c&&(r&&r(t.tr.setSelection(new d(c))),!0)}}function g(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!d.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&o.nh.isSelectable(t.state.doc.nodeAt(i.inside)))&&(t.dispatch(t.state.tr.setSelection(new d(r))),!0)}function y(t,e){if("insertCompositionText"!=e.inputType||!(t.state.selection instanceof d))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=u.FK.empty;for(let o=r.length-1;o>=0;o--)i=u.FK.from(r[o].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new u.Ji(i,0,0));return s.setSelection(o.U3.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function v(t){if(!(t.selection instanceof d))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",l.zF.create(t.doc,[l.NZ.widget(t.selection.head,e,{key:"gapcursor"})])}var D=200,b=function(){};b.prototype.append=function(t){return t.length?(t=b.from(t),!this.length&&t||t.length<D&&this.leafAppend(t)||this.length<D&&t.leafPrepend(this)||this.appendInner(t)):this},b.prototype.prepend=function(t){return t.length?b.from(t).append(this):this},b.prototype.appendInner=function(t){return new w(this,t)},b.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?b.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},b.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},b.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},b.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},b.from=function(t){return t instanceof b?t:t&&t.length?new k(t):b.empty};var k=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var o=e;o<n;o++)if(!1===t(this.values[o],r+o))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var o=e-1;o>=n;o--)if(!1===t(this.values[o],r+o))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=D)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=D)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(b);b.empty=new k([]);var w=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var o=this.left.length;return!(e<o&&!1===this.left.forEachInner(t,e,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var o=this.left.length;return!(e>
2o&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(t,Math.min(e,o),n,r))&&void 0)},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(b);const C=b;class A{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--){if(this.items.get(o-1).selection){--o;break}}e&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,a=t.tr,l=[],c=[];return this.items.forEach(((t,e)=>{if(!t.step)return n||(n=this.remapping(o,e+1),r=n.maps.length),r--,void c.push(t);if(n){c.push(new x(t.map));let e,o=t.step.map(n.slice(r));o&&a.maybeStep(o).doc&&(e=a.mapping.maps[a.mapping.maps.length-1],l.push(new x(e,void 0,void 0,l.length+c.length))),r--,e&&n.appendMap(e,r)}else a.maybeStep(t.step);return t.selection?(i=n?t.selection.map(n.slice(r)):t.selection,s=new A(this.items.slice(0,o).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(t,e,n,r){let o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let c=0;c<t.steps.length;c++){let n,l=t.steps[c].invert(t.docs[c]),u=new x(t.mapping.maps[c],l,e);(n=a&&a.merge(u))&&(u=n,c?o.pop():s=s.slice(0,s.length-1)),o.push(u),e&&(i++,e=void 0),r||(a=u)}let l=i-n.depth;return l>S&&(s=function(t,e){let n;return t.forEach(((t,r)=>{if(t.selection&&0==e--)return n=r,!1})),t.slice(n)}(s,l),i-=l),new A(s.append(o),i)}remapping(t,e){let n=new i.X9;return this.items.forEach(((e,r)=>{let o=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,o)}),t,e),n}addMaps(t){return 0==this.eventCount?this:new A(this.items.append(t.map((t=>new x(t)))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),o=t.mapping,i=t.steps.length,s=this.eventCount;this.items.forEach((t=>{t.selection&&s--}),r);let a=e;this.items.forEach((e=>{let r=o.getMirror(--a);if(null==r)return;i=Math.min(i,r);let l=o.maps[r];if(e.step){let i=t.steps[r].invert(t.docs[r]),c=e.selection&&e.selection.map(o.slice(a+1,r));c&&s++,n.push(new x(l,i,c))}else n.push(new x(l))}),r);let l=[];for(let d=e;d<i;d++)l.push(new x(o.maps[d]));let c=this.items.slice(0,r).append(l).append(n),u=new A(c,s);return u.emptyItemCount()>500&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let t=0;return this.items.forEach((e=>{e.step||t++})),t}compress(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.items.length,e=this.remapping(0,t),n=e.maps.length,r=[],o=0;return this.items.forEach(((i,s)=>{if(s>=t)r.push(i),i.selection&&o++;else if(i.step){let t=i.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let a=i.selection&&i.selection.map(e.slice(n));a&&o++;let l,c=new x(s.invert(),t,a),u=r.length-1;(l=r.length&&r[u].merge(c))?r[u]=l:r.push(c)}}else i.map&&n--}),this.items.length,0),new A(C.from(r.reverse()),o)}}A.empty=new A(C.empty,0);class x{constructor(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new x(e.getMap().invert(),e,this.selection)}}}class E{constructor(t,e,n,r,o){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}}const S=20;function M(t){let e=[];for(let n=t.length-1;n>=0&&0==e.length;n--)t[n].forEach(((t,n,r,o)=>e.push(r,o)));return e}function T(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}let O=!1,F=null;function N(t){let e=t.plugins;if(F!=e){O=!1,F=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){O=!0;break}}return O}const B=new o.hs("history"),R=new o.hs("closeHistory");function I(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new o.k_({key:B,state:{init:()=>new E(A.empty,A.empty,null,0,-1),apply:(e,n,r)=>function(t,e,n,r){let o,i=n.getMeta(B);if(i)return i.historyState;n.getMeta(R)&&(t=new E(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(B))return s.getMeta(B).redo?new E(t.done.addTransform(n,void 0,r,N(e)),t.undone,M(n.mapping.maps),t.prevTime,t.prevComposition):new E(t.done,t.undone.addTransform(n,void 0,r,N(e)),null,t.prevTime,t.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new E(t.done.rebased(n,o),t.undone.rebased(n,o),T(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new E(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),T(t.prevRanges,n.mapping),t.prevTime,t.prevComposition);{let o=n.getMeta("composition"),i=0==t.prevTime||!s&&t.prevComposition!=o&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;
2return t.mapping.maps[0].forEach(((t,r)=>{for(let o=0;o<e.length;o+=2)t<=e[o+1]&&r>=e[o]&&(n=!0)})),n}(n,t.prevRanges)),a=s?T(t.prevRanges,n.mapping):M(n.mapping.maps);return new E(t.done.addTransform(n,i?e.selection.getBookmark():void 0,r,N(e)),A.empty,a,n.time,null==o?t.prevComposition:o)}}(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?P:"historyRedo"==n?z:null;return!(!r||!t.editable)&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}function L(t,e){return(n,r)=>{let o=B.getState(n);if(!o||0==(t?o.undone:o.done).eventCount)return!1;if(r){let i=function(t,e,n){let r=N(e),o=B.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),a=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),o,r),l=new E(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(B,{redo:n,historyState:l})}(o,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}const P=L(!1,!0),z=L(!0,!0);L(!1,!1),L(!0,!1);r.YY.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter((t=>""!==t)).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=t=>{const e=(null==t?void 0:t.node)||this.editor.state.doc;if("textSize"===((null==t?void 0:t.mode)||this.options.mode)){const t=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(t)}return e.nodeSize},this.storage.words=t=>{const e=(null==t?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new o.k_({key:new o.hs("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const o=this.options.limit;if(null===o||void 0===o||0===o)return void(t=!0);const i=this.storage.characters({node:r.doc});if(i>o){const e=0,n=i-o;console.warn("[CharacterCount] Initial content exceeded limit of ".concat(o," characters. Content was automatically trimmed."));const s=r.tr.deleteRange(e,n);return t=!0,s}t=!0},filterTransaction:(t,e)=>{const n=this.options.limit;if(!t.docChanged||0===n||null===n||void 0===n)return!0;const r=this.storage.characters({node:e.doc}),o=this.storage.characters({node:t.doc});if(o<=n)return!0;if(r>n&&o>n&&o<=r)return!0;if(r>n&&o>n&&o>r)return!1;if(!t.getMeta("paste"))return!1;const i=t.selection.$head.pos,s=i-(o-n),a=i;t.deleteRange(s,a);return!(this.storage.characters({node:t.doc})>n)}})]}});var $=r.YY.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[s(this.options)]}}),j=(r.YY.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new o.k_({key:new o.hs("focus"),props:{decorations:t=>{let{doc:e,selection:n}=t;const{isEditable:r,isFocused:o}=this.editor,{anchor:i}=n,s=[];if(!r||!o)return l.zF.create(e,[]);let a=0;"deepest"===this.options.mode&&e.descendants(((t,e)=>{if(t.isText)return;if(!(i>=e&&i<=e+t.nodeSize-1))return!1;a+=1}));let c=0;return e.descendants(((t,e)=>{if(t.isText)return!1;if(!(i>=e&&i<=e+t.nodeSize-1))return!1;c+=1;if("deepest"===this.options.mode&&a-c>0||"shallowest"===this.options.mode&&c>1)return"deepest"===this.options.mode;s.push(l.NZ.node(e,e+t.nodeSize,{class:this.options.className}))})),l.zF.create(e,s)}}})]}}),r.YY.create({name:"gapCursor",addProseMirrorPlugins:()=>[new o.k_({props:{decorations:v,createSelectionBetween:(t,e,n)=>e.pos==n.pos&&d.valid(n)?new d(n):null,handleClick:g,handleKeyDown:f,handleDOMEvents:{beforeinput
2:y}}})],extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:null!=(e=(0,r.gk)((0,r.iI)(t,"allowGapCursor",n)))?e:null}}})),V=r.YY.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new o.k_({key:new o.hs("placeholder"),props:{decorations:t=>{let{doc:e,selection:n}=t;const o=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,s=[];if(!o)return null;const a=this.editor.isEmpty;return e.descendants(((t,e)=>{const n=i>=e&&i<=e+t.nodeSize,o=!t.isLeaf&&(0,r.Op)(t);if((n||!this.options.showOnlyCurrent)&&o){const r=[this.options.emptyNodeClass];a&&r.push(this.options.emptyEditorClass);const o=l.NZ.node(e,e+t.nodeSize,{class:r.join(" "),"data-placeholder":"function"===typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:t,pos:e,hasAnchor:n}):this.options.placeholder});s.push(o)}return this.options.includeChildren})),l.zF.create(e,s)}}})]}});r.YY.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new o.k_({key:new o.hs("selection"),props:{decorations:n=>n.selection.empty||t.isFocused||!t.isEditable||(0,r.BQ)(n.selection)||t.view.dragging?null:l.zF.create(n.doc,[l.NZ.inline(n.selection.from,n.selection.to,{class:e.className})])}})]}});function H(t){let{types:e,node:n}=t;return n&&Array.isArray(e)&&e.includes(n.type)||(null==n?void 0:n.type)===e}var K=r.YY.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var t;const e=new o.hs(this.name),n=this.options.node||(null==(t=this.editor.schema.topNodeType.contentMatch.defaultType)?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map((t=>{let[,e]=t;return e})).filter((t=>(this.options.notAfter||[]).concat(n).includes(t.name)));return[new o.k_({key:e,appendTransaction:(t,r,o)=>{const{doc:i,tr:s,schema:a}=o,l=e.getState(o),c=i.content.size,u=a.nodes[n];if(l)return s.insert(c,u.create())},state:{init:(t,e)=>!H({node:e.tr.doc.lastChild,types:r}),apply:(t,e)=>{if(!t.docChanged)return e;if(t.getMeta("__uniqueIDTransaction"))return e;return!H({node:t.doc.lastChild,types:r})}}})]}}),q=r.YY.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>t=>{let{state:e,dispatch:n}=t;return P(e,n)},redo:()=>t=>{let{state:e,dispatch:n}=t;return z(e,n)}}),addProseMirrorPlugins(){return[I(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-\u044f":()=>this.editor.commands.undo(),"Shift-Mod-\u044f":()=>this.editor.commands.redo()}}})},88335:(t,e,n)=>{n.d(e,{$Z:()=>_,NV:()=>it,hG:()=>Q});var r=n(80045),o=n(89379),i=n(65043),s=n(97950),a=n(29461),l=n(70579),c=n(129);const{getOwnPropertyNames:u,getOwnPropertySymbols:d}=Object,{hasOwnProperty:h}=Object.prototype;function p(t,e){return function(n,r,o){return t(n,r,o)&&e(n,r,o)}}function f(t){return function(e,n,r){if(!e||!n||"object"!==typeof e||"object"!==typeof n)return t(e,n,r);const{cache:o}=r,i=o.get(e),s=o.get(n);if(i&&s)return i===n&&s===e;o.set(e,n),o.set(n,e);const a=t(e,n,r);return o.delete(e),o.delete(n),a}}function m(t){return u(t).concat(d(t))}const g=Object.hasOwn||((t,e)=>h.call(t,e));function y(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const{getOwnPropertyDescriptor:v,keys:D}=Object;function b(t,e){return t.byteLength===e.byteLength&&B(new Uint8Array(t),new Uint8Array(e))}function k(t,e,n){let r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function w(t,e){return t.byteLength===e.byteLength&&B(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function C(t,e){return y(t.getTime(),e.getTime())}function A(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function x(t,e){return t===e}function E(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const o=new Array(r),i=t.entries();let s,a,l=0;for(;(s=i.next())&&!s.done;){const r=e.entries();let i=!1,c=0;for(;(a=r.next())&&!a.done;){if(o[c]){c++;continue}const r=s.value,u=a.value;if(n.equals(r[0],u[0],l,c,t,e,n)&&n.equals(r[1],u[1],r[0],u[0],t,e,n)){i=o[c]=!0;break}c++}if(!i)return!1;l++}return!0}const S=y;function M(t,e,n){const r=D(t);let o=r.length;if(D(e).length!==o)return!1;for(;o-- >0;)if(!I(t,e,n,r[o]))return!1;return!0}function T(t,e,n){const r=m(t);let o,i,s,a=r.length;if(m(e).length!==a)return!1;for(;a-- >0;){if(o=r[a],!I(t,e,n,o))return!1;if(i=v(t,o),s=v(e,o),(i||s)&&(!i||!s||i.configurable!==s.configurable||i.enumerable!==s.enumerable||i.writable!==s.writable))return!1}return!0}function O(t,e){return y(t.valueOf(),e.valueOf())}function F(t,e){return t.source===e.source&&t.flags===e.flags}function N(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const o=new Array(r),i=t.values();let s,a;for(;(s=i.next())&&!s.done;){const r=e.values();let i=!1,l=0;for(;(a=r.next())&&!a.done;){if(!o[l]&&n.equals(s.value,a.value,s.value,a.value,t,e,n)){i=o[l]=!0;break}l++}if(!i)return!1}return!0}function B(t,e){let n=t.byteLength;if(e.byteLength!==n||t.byteOffset!==e.byteOffset)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function R(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function I(t,e,n,r){return!("_owner"!==r&&"__o"!==r&&"__v"!==r||!t.$$typeof&&!e.$$typeof)||g(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const L={"[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},P=Object.prototype.toString;function z(t){let{areArrayBuffersEqual:e,areArraysEqual:n,areDataViewsEqual:r,areDatesEqual:o,areErrorsEqual:i,areFunctionsEqual:s,areMapsEqual:a,areNumbersEqual:l,areObjectsEqual:c,arePrimitiveWrappersEqual:u,areRegExpsEqual:d,areSetsEqual:h,areTypedArraysEqual:p,areUrlsEqual:f,unknownTagComparators:m}=t;return function(t,g,y){if(t===g)return!0;if(null==t||null==g)return!1;const v=typeof t;if(v!==typeof g)return!1;if("object"!==v)return"number"===v?l(t,g,y):"function"===v&&s(t,g,y);const D=t.constructor;if(D!==g.constructor)return!1;if(D===Object)return c(t,g,y);if(Array.isArray(t))return n(t,g,y);if(D===Date)return o(t,g,y);if(D===RegExp)return d(t,g,y);if(D===Map)return a(t,g,y);if(D===Set)return h(t,g,y);const b=P.call(t);if("[object Date]"===b)return o(t,g,y);if("[object RegExp]"===b)return d(t,g,y);if("[object Map]"===b)return a(t,g,y);if("[object Set]"===b)return h(t,g,y);if("[object Object]"===b)return"function"!==typeof t.then&&"function"!==typeof g.then&&c(t,g,y);if("[object URL]"===b)return f(t,g,y);if("[object Error]"===b)return i(t,g,y);if("[object Arguments]"===b)return c(t,g,y);if(L[b])return p(t,g,y);if("[object ArrayBuffer]"===b)return e(t,g,y);if("[object DataView]"===b)return r(t,g,y);if("[object Boolean]"===b||"[object Number]"===b||"[object String]"===b)return u(t,g,y);if(m){let e=m[b];if(!e){const n=null!=(k=t)?k[Symbol.toStringTag]:void 0;n&&(e=m[n])}if(e)return e(t,g,y)}var k;return!1}}const $=j();j({strict:!0}),j({circular:!0}),j({circular:!0,strict:!0}),j({createInternalComparator:()=>y}),j({strict:!0,createInternalComparator:()=>y}),j({circular:!0,createInternalComparator:()=>y}),j({circular:!0,createInternalComparator:()=>y,strict:!0});function j(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{circular:e=!1,createInternalComparator:n,createState:r,strict:o=!1}=t,i=function(t){let{circular:e,createCustomConfig:n,strict:r}=t,o={areArrayBuffersEqual:b,areArraysEqual:r?T:k,areDataViewsEqual:w,areDatesEqual:C,areErrorsEqual:A,areFunctionsEqual:x,areMapsEqual:r?p(E,T):E,areNumbersEqual:S,areObjectsEqual:r?T:M,arePrimitiveWrappersEqual:O,areRegExpsEqual:F,areSetsEqual:r?p(N,T):N,areTypedArraysEqual:r?p(B,T):B,areUrlsEqual:R,unknownTagComparators:void 0};if(n&&(o=Object.assign({},o,n(o))),e){const t=f(o.areArraysEqual),e=f(o.areMapsEqual),n=f(o.areObjectsEqual),r=f(o.areSetsEqual);o=Object.assign({},o,{areArraysEqual:t,areMapsEqual:e,areObjectsEqual:n,areSetsEqual:r})}return o}(t),s=z(i);var a;return function(t){let{circular:e,comparator:n,createState:r,equals:o,strict:i}=t;if(r)return function(t,s){const{cache:a=(e?new WeakMap:void 0),meta:l}=r();return n(t,s,{cache:a,equals:o,meta:l,strict:i})};if(e)return function(t,e){return n(t,e,{cache:new WeakMap,equals:o,meta:void 0,strict:i})};const s={cache:void 0,equals:o,meta:void 0,strict:i};return function(t,e){return n(t,e,s)}}({circular:e,comparator:s,createState:r,equals:n?n(s):(a=s,function(t,e,n,r,o,i,s){return a(t,e,s)}),strict:o})}var V=n(98443);const H=["editor","innerRef"];var K=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return t=>{e.forEach((e=>{"function"===typeof e?e(t):e&&(e.current=t)}))}},q=t=>{let{contentComponent:e}=t;const n=(0,a.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,l.jsx)(l.Fragment,{children:Object.values(n)})};var J=class extends i.Component{constructor(t){var e;super(t),this.editorContentRef=i.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:Boolean(null==(e=t.editor)?void 0:e.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;const e=this.props.editor;if(e&&!e.isDestroyed&&(null==(t=e.view.dom)?void 0:t.parentNode)){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=function(){const t=new Set;let e={};return{subscribe:e=>(t.add(e),()=>{t.delete(e)}),getSnapshot:()=>e,getServerSnapshot:()=>e,setRenderer(n,r){e=(0,o.A)((0,o.A)({},e),{},{[n]:s.createPortal(r.reactElement,r.element,n)}),t.forEach((t=>t()))},removeRenderer(n){const r=(0,o.A)({},e);delete r[n],e=r,t.forEach((t=>t()))}}}(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe((()=>{this.setState((t=>t.hasContentComponentInitialized?t:{hasContentComponentInitialized:!0})),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()}))),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var t;const e=this.props.editor;if(e){this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null;try{if(!(null==(t=e.view.dom)?void 0:t.parentNode))return;const n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch(n){}}}render(){const t=this.props,{editor:e,innerRef:n}=t,i=(0,r.A)(t,H);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",(0,o.A)({ref:K(n,this.editorContentRef)}
2,i)),(null==e?void 0:e.contentComponent)&&(0,l.jsx)(q,{contentComponent:e.contentComponent})]})}},U=(0,i.forwardRef)(((t,e)=>{const n=i.useMemo((()=>Math.floor(4294967295*Math.random()).toString()),[t.editor]);return i.createElement(J,(0,o.A)({key:n,innerRef:e},t))})),_=i.memo(U),W="undefined"!==typeof window?i.useLayoutEffect:i.useEffect,G=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const t=()=>{this.transactionNumber+=1,this.subscribers.forEach((t=>t()))},e=this.editor;return e.on("transaction",t),()=>{e.off("transaction",t)}}}};var Y="undefined"===typeof window,Z=Y||Boolean("undefined"!==typeof window&&window.next),X=class t{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach((t=>t()))}getInitialEditor(){return void 0===this.options.current.immediatelyRender?Y||Z?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){var t=this;const e=(0,o.A)((0,o.A)({},this.options.current),{},{onBeforeCreate:function(){for(var e,n,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return null==(n=(e=t.options.current).onBeforeCreate)?void 0:n.call(e,...o)},onBlur:function(){for(var e,n,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return null==(n=(e=t.options.current).onBlur)?void 0:n.call(e,...o)},onCreate:function(){for(var e,n,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return null==(n=(e=t.options.current).onCreate)?void 0:n.call(e,...o)},onDestroy:function(){for(var e,n,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return null==(n=(e=t.options.current).onDestroy)?void 0:n.call(e,...o)},onFocus:function(){for(var e,n,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return null==(n=(e=t.options.current).onFocus)?void 0:n.call(e,...o)},onSelectionUpdate:function(){for(var e,n,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return null==(n=(e=t.options.current).onSelectionUpdate)?void 0:n.call(e,...o)},onTransaction:function(){for(var e,n,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return null==(n=(e=t.options.current).onTransaction)?void 0:n.call(e,...o)},onUpdate:function(){for(var e,n,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return null==(n=(e=t.options.current).onUpdate)?void 0:n.call(e,...o)},onContentError:function(){for(var e,n,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return null==(n=(e=t.options.current).onContentError)?void 0:n.call(e,...o)},onDrop:function(){for(var e,n,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return null==(n=(e=t.options.current).onDrop)?void 0:n.call(e,...o)},onPaste:function(){for(var e,n,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return null==(n=(e=t.options.current).onPaste)?void 0:n.call(e,...o)},onDelete:function(){for(var e,n,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return null==(n=(e=t.options.current).onDelete)?void 0:n.call(e,...o)}});return new c.KE(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}static compareOptions(t,e){return Object.keys(t).every((n=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&t.extensions&&e.extensions?t.extensions.length===e.extensions.length&&t.extensions.every(((t,n)=>{var r;return t===(null==(r=e.extensions)?void 0:r[n])})):t[n]===e[n])))}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===e.length?t.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions((0,o.A)((0,o.A)({},this.options.current),{},{editable:this.editor.isEditable}
2)):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(t){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps)return void(this.previousDeps=t);if(this.previousDeps.length===t.length&&this.previousDeps.every(((e,n)=>e===t[n])))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){const t=this.instanceId,e=this.editor;this.scheduledDestructionTimeout=setTimeout((()=>{this.isComponentMounted&&this.instanceId===t?e&&e.setOptions(this.options.current):e&&!e.isDestroyed&&(e.destroy(),this.instanceId===t&&this.setEditor(null))}),1)}};function Q(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=(0,i.useRef)(t);n.current=t;const[r]=(0,i.useState)((()=>new X(n))),o=(0,a.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,i.useDebugValue)(o),(0,i.useEffect)(r.onRender(e)),function(t){var e;const[n]=(0,i.useState)((()=>new G(t.editor))),r=(0,V.useSyncExternalStoreWithSelector)(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,null!=(e=t.equalityFn)?e:$);W((()=>n.watch(t.editor)),[t.editor,n]),(0,i.useDebugValue)(r)}({editor:o,selector:e=>{let{transactionNumber:n}=e;return!1===t.shouldRerenderOnTransaction||void 0===t.shouldRerenderOnTransaction?null:t.immediatelyRender&&0===n?0:n+1}}),o}var tt=(0,i.createContext)({editor:null});tt.Consumer;var et=(0,i.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),nt=()=>(0,i.useContext)(et);i.forwardRef(((t,e)=>{const{onDragStart:n}=nt(),r=t.as||"div";return(0,l.jsx)(r,(0,o.A)((0,o.A)({},t),{},{ref:e,"data-node-view-wrapper":"",onDragStart:n,style:(0,o.A)({whiteSpace:"normal"},t.style)}))}));function rt(t){return!("function"!==typeof t||!t.prototype||!t.prototype.isReactComponent)}function ot(t){return!("object"!==typeof t||!t.$$typeof||"Symbol(react.forward_ref)"!==t.$$typeof.toString()&&"react.forward_ref"!==t.$$typeof.description)}var it=class{constructor(t,e){let{editor:n,props:r={},as:o="div",className:i=""}=e;this.ref=null,this.id=Math.floor(4294967295*Math.random()).toString(),this.component=t,this.editor=n,this.props=r,this.element=document.createElement(o),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),this.editor.isInitialized?(0,s.flushSync)((()=>{this.render()})):queueMicrotask((()=>{this.render()}))}render(){var t;const e=this.component,n=this.props,r=this.editor,s=function(){try{if(i.version)return parseInt(i.version.split(".")[0],10)>=19}catch(t){}return!1}(),a=function(t){if(rt(t))return!0;if(ot(t))return!0;if(function(t){return!("object"!==typeof t||!t.$$typeof||"Symbol(react.memo)"!==t.$$typeof.toString()&&"react.memo"!==t.$$typeof.description)}(t)){const e=t.type;if(e)return rt(e)||ot(e)}return!1}(e),c=(0,o.A)({},n);!c.ref||s||a||delete c.ref,c.ref||!s&&!a||(c.ref=t=>{this.ref=t}),this.reactElement=(0,l.jsx)(e,(0,o.A)({},c)),null==(t=null==r?void 0:r.contentComponent)||t.setRenderer(this.id,this)}updateProps(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.props=(0,o.A)((0,o.A)({},this.props),t),this.render()}destroy(){var t;const e=this.editor;null==(t=null==e?void 0:e.contentComponent)||t.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch(n){}}updateAttributes(t){Object.keys(t).forEach((e=>{this.element.setAttribute(e,t[e])}))}},st=i.createContext({markViewContentRef:()=>{}});c.Db;c.Yv},96571:(t,e,n)=>{n.d(e,{A:()=>dt});var r=n(129),o=n(89379),i=n(80045);const s=["children"];var a=(t,e)=>{if("slot"===t)return 0;if(t instanceof Function)return t(e);const n=null!=e?e:{},{children:r}=n,o=(0,i.A)(n,s);if("svg"===t)throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,o,r]},l=/^\s*>\s$/,c=r.bP.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML(t){let{HTMLAttributes:e}=t;return a("blockquote",(0,o.A)((0,o.A)({},(0,r.KV)(this.options.HTMLAttributes,e)),{},{children:a("slot",{})}))},parseMarkdown:(t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),renderMarkdown:(t,e)=>{if(!t.content)return"";const n=[];return t.content.forEach((t=>{const r=e.renderChildren([t]).split("\n").map((t=>""===t.trim()?">":"".concat(">"," ").concat(t)));n.push(r.join("\n"))})),n.join("\n".concat(">","\n"))},addCommands(){return{setBlockquote:()=>t=>{let{commands:e}=t;return e.wrapIn(this.name)},toggleBlockquote:()=>t=>{let{commands:e}=t;return e.toggleWrap(this.name)},unsetBlockquote:()=>t=>{let{commands:e}=t;return e.lift(this.name)}}}
2,addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[(0,r.tG)({find:l,type:this.type})]}}),u=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,d=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,h=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,p=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,f=r.CU.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML(t){let{HTMLAttributes:e}=t;return a("strong",(0,o.A)((0,o.A)({},(0,r.KV)(this.options.HTMLAttributes,e)),{},{children:a("slot",{})}))},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>"**".concat(e.renderChildren(t),"**"),addCommands(){return{setBold:()=>t=>{let{commands:e}=t;return e.setMark(this.name)},toggleBold:()=>t=>{let{commands:e}=t;return e.toggleMark(this.name)},unsetBold:()=>t=>{let{commands:e}=t;return e.unsetMark(this.name)}}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[(0,r.OX)({find:u,type:this.type}
2),(0,r.OX)({find:h,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:d,type:this.type}),(0,r.Zc)({find:p,type:this.type})]}}),m=/(^|[^`])`([^`]+)`(?!`)$/,g=/(^|[^`])`([^`]+)`(?!`)/g,y=r.CU.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML(t){let{HTMLAttributes:e}=t;return["code",(0,r.KV)(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?"`".concat(e.renderChildren(t.content),"`"):"",addCommands(){return{setCode:()=>t=>{let{commands:e}=t;return e.setMark(this.name)},toggleCode:()=>t=>{let{commands:e}=t;return e.toggleMark(this.name)},unsetCode:()=>t=>{let{commands:e}=t;return e.unsetMark(this.name)}}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[(0,r.OX)({find:m,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:g,type:this.type})]}}),v=n(17184),D=/^```([a-z]+)?[\s\n]$/,b=/^~~~([a-z]+)?[\s\n]$/,k=r.bP.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;if(!n)return null;const r=[...(null==(e=t.firstElementChild)?void 0:e.classList)||[]].filter((t=>t.startsWith(n))).map((t=>t.replace(n,"")))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML(t){let{node:e,HTMLAttributes:n}=t;return["pre",(0,r.KV)(this.options.HTMLAttributes,n),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n;return!1===(null==(n=t.raw)?void 0:n.startsWith("```"))&&"indented"!==t.codeBlockStyle?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let r="";const o=(null==(n=t.attrs)?void 0:n.language)||"";if(t.content){r=["```".concat(o),e.renderChildren(t.content),"```"].join("\n")}else r="```".concat(o,"\n\n```");return r},addCommands(){return{setCodeBlock:t=>e=>{let{commands:n}=e;return n.setNode(this.name,t)},toggleCodeBlock:t=>e=>{let{commands:n}=e;return n.toggleNode(this.name,"paragraph",t)}}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=1===e.pos;return!(!t||e.parent.type.name!==this.name)&&(!(!n&&e.parent.textContent.length)&&this.editor.commands.clearNodes())},Tab:t=>{let{editor:e}=t;var n;if(!this.options.enableTabIndentation)return!1;const r=null!=(n=this.options.tabSize)?n:4,{state:o}=e,{selection:i}=o,{$from:s,empty:a}=i;if(s.parent.type!==this.type)return!1;const l=" ".repeat(r);return a?e.commands.insertContent(l):e.commands.command((t=>{let{tr:e}=t;const{from:n,to:r}=i,s=o.doc.textBetween(n,r,"\n","\n").split("\n").map((t=>l+t)).join("\n");return e.replaceWith(n,r,o.schema.text(s)),!0}))},"Shift-Tab":t=>{let{editor:e}=t;var n;if(!this.options.enableTabIndentation)return!1;const r=null!=(n=this.options.tabSize)?n:4,{state:o}=e,{selection:i}=o,{$from:s,empty:a}=i;return s.parent.type===this.type&&(a?e.commands.command((t=>{let{tr:e}=t;var n;const{pos:i}=s,a=s.start(),l=s.end(),c=o.doc.textBetween(a,l,"\n","\n").split("\n");let u=0,d=0;const h=i-a;for(let r=0;r<c.length;r+=1){if(d+c[r].length>=h){u=r;break}d+=c[r].length+1}const p=(null==(n=c[u].match(/^ */))?void 0:n[0])||"",f=Math.min(p.length,r);if(0===f)return!0;let m=a;for(let r=0;r<u;r+=1)m+=c[r].length+1;e.delete(m,m+f);return i-m<=f&&e.setSelection(v.U3.create(e.doc,m)),!0})):e.commands.command((t=>{let{tr:e}=t;const{from:n,to:s}=i,a=o.doc.textBetween(n,s,"\n","\n").split("\n").map((t=>{var e;const n=(null==(e=t.match(/^ */))?void 0:e[0])||"",o=Math.min(n.length,r);return t.slice(o)})).join("\n");return e.replaceWith(n,s,o.schema.text(a)),!0})))},Enter:t=>{let{editor:e}=t;if(!this.options.exitOnTripleEnter)return!1;const{state:n}=e,{selection:r}=n,{$from:o,empty:i}=r;if(!i||o.parent.type!==this.type)return!1;const s=o.parentOffset===o.parent.nodeSize-2,a=o.parent.textContent.endsWith("\n\n");return!(!s||!a)&&e.chain().command((t=>{let{tr:e}=t;return e.delete(o.pos-2,o.pos),!0})).exitCode().run()},ArrowDown:t=>{let{editor:e}=t;if(!this.options.exitOnArrowDown)return!1;const{state:n}=e,{selection:r,doc:o}=n,{$from:i,empty:s}=r;if(!s||i.parent.type!==this.type)return!1;if(!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();if(void 0===a)return!1;return o.nodeAt(a)?e.commands.command((t=>{let{tr:e}=t;
2return e.setSelection(v.LN.near(o.resolve(a))),!0})):e.commands.exitCode()}}},addInputRules(){return[(0,r.JJ)({find:D,type:this.type,getAttributes:t=>({language:t[1]})}),(0,r.JJ)({find:b,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new v.k_({key:new v.hs("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=null==o?void 0:o.mode;if(!n||!i)return!1;const{tr:s,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,"\n"));return s.replaceSelectionWith(this.type.create({language:i},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(v.U3.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),w=r.bP.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,"\n\n"):""}),C=r.bP.create({name:"hardBreak",markdownTokenName:"br",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML(t){let{HTMLAttributes:e}=t;return["br",(0,r.KV)(this.options.HTMLAttributes,e)]},renderText:()=>"\n",renderMarkdown:()=>" \n",parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>t=>{let{commands:e,chain:n,state:r,editor:o}=t;return e.first([()=>e.exitCode(),()=>e.command((()=>{const{selection:t,storedMarks:e}=r;if(t.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:s}=o.extensionManager,a=e||t.$to.parentOffset&&t.$from.marks();return n().insertContent({type:this.name}).command((t=>{let{tr:e,dispatch:n}=t;if(n&&a&&i){const t=a.filter((t=>s.includes(t.type.name)));e.ensureMarks(t)}return!0})).run()}))])}}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),A=r.bP.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((t=>({tag:"h".concat(t),attrs:{level:t}})))},renderHTML(t){let{node:e,HTMLAttributes:n}=t;const o=this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0];return["h".concat(o),(0,r.KV)(this.options.HTMLAttributes,n),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const r=(null==(n=t.attrs)?void 0:n.level)?parseInt(t.attrs.level,10):1,o="#".repeat(r);return t.content?"".concat(o," ").concat(e.renderChildren(t.content)):""},addCommands(){return{setHeading:t=>e=>{let{commands:n}=e;return!!this.options.levels.includes(t.level)&&n.setNode(this.name,t)},toggleHeading:t=>e=>{let{commands:n}=e;return!!this.options.levels.includes(t.level)&&n.toggleNode(this.name,"paragraph",t)}}},addKeyboardShortcuts(){return this.options.levels.reduce(((t,e)=>(0,o.A)((0,o.A)({},t),{["Mod-Alt-".concat(e)]:()=>this.editor.commands.toggleHeading({level:e})})),{})},addInputRules(){return this.options.levels.map((t=>(0,r.JJ)({find:new RegExp("^(#{".concat(Math.min(...this.options.levels),",").concat(t,"}
2)\\s$")),type:this.type,getAttributes:{level:t}})))}}),x=r.bP.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{},nextNodeType:"paragraph"}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML(t){let{HTMLAttributes:e}=t;return["hr",(0,r.KV)(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>t=>{let{chain:e,state:n}=t;if(!(0,r.AB)(n,n.schema.nodes[this.name]))return!1;const{selection:o}=n,{$to:i}=o,s=e();return(0,r.BQ)(o)?s.insertContentAt(i.pos,{type:this.name}):s.insertContent({type:this.name}),s.command((t=>{let{state:e,tr:n,dispatch:r}=t;if(r){const{$to:t}=n.selection,r=t.end();if(t.nodeAfter)t.nodeAfter.isTextblock?n.setSelection(v.U3.create(n.doc,t.pos+1)):t.nodeAfter.isBlock?n.setSelection(v.nh.create(n.doc,t.pos)):n.setSelection(v.U3.create(n.doc,t.pos));else{const o=e.schema.nodes[this.options.nextNodeType]||t.parent.type.contentMatch.defaultType,i=null==o?void 0:o.create();i&&(n.insert(r,i),n.setSelection(v.U3.create(n.doc,r+1)))}n.scrollIntoView()}return!0})).run()}}},addInputRules(){return[(0,r.jT)({find:/^(?:---|\u2014-|___\s|\*\*\*\s)$/,type:this.t
2ype})]}}),E=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,S=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,M=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,T=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,O=r.CU.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>"normal"!==t.style.fontStyle&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML(t){let{HTMLAttributes:e}=t;return["em",(0,r.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>t=>{let{commands:e}=t;return e.setMark(this.name)},toggleItalic:()=>t=>{let{commands:e}=t;return e.toggleMark(this.name)},unsetItalic:()=>t=>{let{commands:e}=t;return e.unsetMark(this.name)}}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>"*".concat(e.renderChildren(t),"*"),addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}}
2,addInputRules(){return[(0,r.OX)({find:E,type:this.type}),(0,r.OX)({find:M,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:S,type:this.type}),(0,r.Zc)({find:T,type:this.type})]}}),F=n(90621);const N=["start"];var B=Object.defineProperty,R="textStyle",I=/^\s*([-+*])\s$/,L=r.bP.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return"".concat(this.options.itemTypeName,"+")},parseHTML:()=>[{tag:"ul"}],renderHTML(t){let{HTMLAttributes:e}=t;return["ul",(0,r.KV)(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>"list"!==t.type||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,"\n"):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>t=>{let{commands:e,chain:n}=t;return this.options.keepAttributes?n().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(R)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}}
2,addInputRules(){let t=(0,r.tG)({find:I,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=(0,r.tG)({find:I,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(R),editor:this.editor})),[t]}}),P=r.bP.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML(t){let{HTMLAttributes:e}=t;return["li",(0,r.KV)(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{if("list_item"!==t.type)return[];let n=[];if(t.tokens&&t.tokens.length>0){if(t.tokens.some((t=>"paragraph"===t.type)))n=e.parseChildren(t.tokens);else{const r=t.tokens[0];if(r&&"text"===r.type&&r.tokens&&r.tokens.length>0){if(n=[{type:"paragraph",content:e.parseInline(r.tokens)}],t.tokens.length>1){const r=t.tokens.slice(1),o=e.parseChildren(r);n.push(...o)}}else n=e.parseChildren(t.tokens)}}return 0===n.length&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},renderMarkdown:(t,e,n)=>(0,r.kj)(t,e,(t=>"bulletList"===t.parentType?"- ":"orderedList"===t.parentType?"".concat(t.index+1,". "):"- "),n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});((t,e)=>{for(var n in e)B(t,n,{get:e[n],enumerable:!0})})({},{findListItemPos:()=>z,getNextListDepth:()=>$,handleBackspace:()=>K,handleDelete:()=>U,hasListBefore:()=>j,hasListItemAfter:()=>_,hasListItemBefore:()=>V,listItemHasSubList:()=>H,nextListIsDeeper:()=>q,nextListIsHigher:()=>J});var z=(t,e)=>{const{$from:n}=e.selection,o=(0,r.Pg)(t,e.schema);let i=null,s=n.depth,a=n.pos,l=null;for(;s>0&&null===l;)i=n.node(s),i.type===o?l=s:(s-=1,a-=1);return null===l?null:{$pos:e.doc.resolve(a),depth:l}},$=(t,e)=>{const n=z(t,e);if(!n)return!1;const[,o]=(0,r.fl)(e,t,n.$pos.pos+4);return o},j=(t,e,n)=>{const{$anchor:r}=t.selection,o=Math.max(0,r.pos-2),i=t.doc.resolve(o).node();return!(!i||!n.includes(i.type.name))},V=(t,e)=>{var n;const{$anchor:r}=e.selection,o=e.doc.resolve(r.pos-2);return 0!==o.index()&&(null==(n=o.nodeBefore)?void 0:n.type.name)===t},H=(t,e,n)=>{if(!n)return!1;const o=(0,r.Pg)(t,e.schema);let i=!1;return n.descendants((t=>{t.type===o&&(i=!0)})),i},K=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!(0,r.rU)(t.state,e)&&j(t.state,e,n)){const{$anchor:n}=t.state.selection,r=t.state.doc.resolve(n.before()-1),o=[];r.node().descendants(((t,n)=>{t.type.name===e&&o.push({node:t,pos:n})}));const i=o.at(-1);if(!i)return!1;const s=t.state.doc.resolve(r.start()+i.pos+1);return t.chain().cut({from:n.start()-1,to:n.end()+1},s.end()).joinForward().run()}if(!(0,r.rU)(t.state,e))return!1;if(!(0,r.J_)(t.state))return!1;const o=z(e,t.state);if(!o)return!1;const i=t.state.doc.resolve(o.$pos.pos-2).node(o.depth),s=H(e,t.state,i);return V(e,t.state)&&!s?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},q=(t,e)=>{const n=$(t,e),r=z(t,e);return!(!r||!n)&&n>r.depth},J=(t,e)=>{const n=$(t,e),r=z(t,e);return!(!r||!n)&&n<r.depth},U=(t,e)=>{if(!(0,r.rU)(t.state,e))return!1;if(!(0,r.QN)(t.state,e))return!1;const{selection:n}=t.state,{$from:o,$to:i}=n;return!(!n.empty&&o.sameParent(i))&&(q(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():J(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward())},_=(t,e)=>{var n;const{$anchor:r}=e.selection,o=e.doc.resolve(r.pos-r.parentOffset-2);return o.index()!==o.parent.childCount-1&&(null==(n=o.nodeAfter)?void 0:n.type.name)===t},W=r.YY.create({name:"listKeymap",addOptions:()=>({listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}),addKeyboardShortcuts(){return{Delete:t=>{let{editor:e}=t,n=!1;return this.options.listTypes.forEach((t=>{let{itemName:r}=t;void 0!==e.state.schema.nodes[r]&&U(e,r)&&(n=!0)})),n},"Mod-Delete":t=>{let{editor:e}=t,n=!1;
2return this.options.listTypes.forEach((t=>{let{itemName:r}=t;void 0!==e.state.schema.nodes[r]&&U(e,r)&&(n=!0)})),n},Backspace:t=>{let{editor:e}=t,n=!1;return this.options.listTypes.forEach((t=>{let{itemName:r,wrapperNames:o}=t;void 0!==e.state.schema.nodes[r]&&K(e,r,o)&&(n=!0)})),n},"Mod-Backspace":t=>{let{editor:e}=t,n=!1;return this.options.listTypes.forEach((t=>{let{itemName:r,wrapperNames:o}=t;void 0!==e.state.schema.nodes[r]&&K(e,r,o)&&(n=!0)})),n}}}}),G=/^(\s*)(\d+)\.\s+(.*)$/,Y=/^\s/;function Z(t,e,n){var r;const o=[];let i=0;for(;i<t.length;){const s=t[i];if(s.indent===e){const a=s.content.split("\n"),l=(null==(r=a[0])?void 0:r.trim())||"",c=[];l&&c.push({type:"paragraph",raw:l,tokens:n.inlineTokens(l)});const u=a.slice(1).join("\n").trim();if(u){const t=n.blockTokens(u);c.push(...t)}let d=i+1;const h=[];for(;d<t.length&&t[d].indent>e;)h.push(t[d]),d+=1;if(h.length>0){const t=Math.min(...h.map((t=>t.indent))),e=Z(h,t,n);c.push({type:"list",ordered:!0,start:h[0].number,items:e,raw:h.map((t=>t.raw)).join("\n")})}o.push({type:"list_item",raw:s.raw,tokens:c}),i=d}else i+=1}return o}var X="textStyle",Q=/^(\d+)\.\s$/,tt=r.bP.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return"".concat(this.options.itemTypeName,"+")},addAttributes:()=>({start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML(t){let{HTMLAttributes:e}=t;const{start:n}=e,o=(0,i.A)(e,N);return 1===n?["ol",(0,r.KV)(this.options.HTMLAttributes,o),0]:["ol",(0,r.KV)(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if("list"!==t.type||!t.ordered)return[];const n=t.start||1,r=t.items?function(t,e){return t.map((t=>{if("list_item"!==t.type)return e.parseChildren([t])[0];const n=[];return t.tokens&&t.tokens.length>0&&t.tokens.forEach((t=>{if("paragraph"===t.type||"list"===t.type||"blockquote"===t.type||"code"===t.type)n.push(...e.parseChildren([t]));else if("text"===t.type&&t.tokens){const r=e.parseChildren([t]);n.push({type:"paragraph",content:r})}else{const r=e.parseChildren([t]);r.length>0&&n.push(...r)}})),{type:"listItem",content:n}}))}(t.items,e):[];return 1!==n?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,"\n"):"",markdownTokenizer:{name:"orderedList",level:"block",start:t=>{const e=t.match(/^(\s*)(\d+)\.\s+/),n=null==e?void 0:e.index;return void 0!==n?n:-1},tokenize:(t,e,n)=>{var r;const o=t.split("\n"),[i,s]=function(t){const e=[];let n=0,r=0;for(;n<t.length;){const o=t[n],i=o.match(G);if(!i)break;const[,s,a,l]=i,c=s.length;let u=l,d=n+1;const h=[o];for(;d<t.length;){const e=t[d];if(e.match(G))break;if(""===e.trim())h.push(e),u+="\n",d+=1;else{if(!e.match(Y))break;h.push(e),u+="\n".concat(e.slice(c+2)),d+=1}}e.push({indent:c,number:parseInt(a,10),content:u.trim(),raw:h.join("\n")}),r=d,n=d}return[e,r]}(o);if(0===i.length)return;const a=Z(i,0,n);if(0===a.length)return;return{type:"list",ordered:!0,start:(null==(r=i[0])?void 0:r.number)||1,items:a,raw:o.slice(0,s).join("\n")}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>t=>{let{commands:e,chain:n}=t;return this.options.keepAttributes?n().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(X)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}}
2,addInputRules(){let t=(0,r.tG)({find:Q,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=(0,r.tG)({find:Q,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>(0,o.A)({start:+t[1]},this.editor.getAttributes(X)),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1],editor:this.editor})),[t]}}),et=/^\s*(\[([( |x])?\])\s$/,nt=r.bP.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return""===e||"true"===e},renderHTML:t=>({"data-checked":t.checked})}}),parseHTML(){return[{tag:'li[data-type="'.concat(this.name,'"]'),priority:51}]},renderHTML(t){let{node:e,HTMLAttributes:n}=t;return["li",(0,r.KV)(this.options.HTMLAttributes,n,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;const o=(null==(n=t.attrs)?void 0:n.checked)?"x":" ",i="- [".concat(o,"] ");return(0,r.kj)(t,e,i)},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?(0,o.A)((0,o.A)({},t),{},{Tab:()=>this.editor.commands.sinkListItem(this.name)}):t},addNodeView(){return t=>{let{node:e,HTMLAttributes:n,getPos:r,editor:i}=t;const s=document.createElement("li"),a=document.createElement("label"),l=document.createElement("span"),c=document.createElement("input"),u=document.createElement("div"),d=t=>{var e,n;c.ariaLabel=(null==(n=null==(e=this.options.a11y)?void 0:e.checkboxLabel)?void 0:n.call(e,t,c.checked))||"Task item checkbox for ".concat(t.textContent||"empty task item")};return d(e),a.contentEditable="false",c.type="checkbox",c.addEventListener("mousedown",(t=>t.preventDefault())),c.addEventListener("change",(t=>{if(!i.isEditable&&!this.options.onReadOnlyChecked)return void(c.checked=!c.checked);const{checked:n}=t.target;i.isEditable&&"function"===typeof r&&i.chain().focus(void 0,{scrollIntoView:!1}).command((t=>{let{tr:e}=t;const i=r();if("number"!==typeof i)return!1;const s=e.doc.nodeAt(i);return e.setNodeMarkup(i,void 0,(0,o.A)((0,o.A)({},null==s?void 0:s.attrs),{},{checked:n})),!0})).run(),!i.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,n)||(c.checked=!c.checked))})),Object.entries(this.options.HTMLAttributes).forEach((t=>{let[e,n]=t;s.setAttribute(e,n)})),s.dataset.checked=e.attrs.checked,c.checked=e.attrs.checked,a.append(c,l),s.append(a,u),Object.entries(n).forEach((t=>{let[e,n]=t;s.setAttribute(e,n)})),{dom:s,contentDOM:u,update:t=>t.type===this.type&&(s.dataset.checked=t.attrs.checked,c.checked=t.attrs.checked,d(t),!0)}}},addInputRules(){return[(0,r.tG)({find:et,type:this.type,getAttributes:t=>({checked:"x"===t[t.length-1]})})]}}),rt=r.bP.create({name:"taskList",addOptions:()=>({itemTypeName:"taskItem",HTMLAttributes:{}}),group:"block list",content(){return"".concat(this.options.itemTypeName,"+")},parseHTML(){return[{tag:'ul[data-type="'.concat(this.name,'"]'),priority:51}]},renderHTML(t){let{HTMLAttributes:e}=t;return["ul",(0,r.KV)(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,"\n"):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=null==(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))?void 0:e.index;return void 0!==n?n:-1},tokenize(t,e,n){const o=t=>{const e=(0,r.Dd)(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:t=>({indentLevel:t[1].length,mainContent:t[4],checked:"x"===t[3].toLowerCase()}),createToken:(t,e)=>({type:"taskItem",raw:"",mainContent:t.mainContent,indentLevel:t.indentLevel,checked:t.checked,text:t.mainContent,tokens:n.inlineTokens(t.mainContent),nestedTokens:e}),customNestedParser:o},n);return e?[{type:"taskList",raw:e.raw,items:e.items}]:n.blockTokens(t)},i=(0,r.Dd)(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:t=>({indentLevel:t[1].length,mainContent:t[4],checked:"x"===t[3].toLowerCase()}),createToken:(t,e)=>({type:"taskItem",raw:"",mainContent:t.mainContent,indentLevel:t.indentLevel,checked:t.checked,text:t.mainContent,tokens:n.inlineTokens(t.mainContent),nestedTokens:e}),customNestedParser:o},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>t=>{let{commands:e}=t;return e.toggleList(this.name,this.options.itemTypeName)}}}
2,addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),ot=(r.YY.create({name:"listKit",addExtensions(){const t=[];return!1!==this.options.bulletList&&t.push(L.configure(this.options.bulletList)),!1!==this.options.listItem&&t.push(P.configure(this.options.listItem)),!1!==this.options.listKeymap&&t.push(W.configure(this.options.listKeymap)),!1!==this.options.orderedList&&t.push(tt.configure(this.options.orderedList)),!1!==this.options.taskItem&&t.push(nt.configure(this.options.taskItem)),!1!==this.options.taskList&&t.push(rt.configure(this.options.taskList)),t}}),r.bP.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML(t){let{HTMLAttributes:e}=t;return["p",(0,r.KV)(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];return 1===n.length&&"image"===n[0].type?e.parseChildren([n[0]]):e.createNode("paragraph",void 0,e.parseInline(n))},renderMarkdown:(t,e)=>t&&Array.isArray(t.content)?e.renderChildren(t.content):"",addCommands(){return{setParagraph:()=>t=>{let{commands:e}=t;return e.setNode(this.name)}}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}})),it=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,st=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,at=r.CU.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("line-through")&&{}}],renderHTML(t){let{HTMLAttributes:e}=t;return["s",(0,r.KV)(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>"~~".concat(e.renderChildren(t),"~~"),addCommands(){return{setStrike:()=>t=>{let{commands:e}=t;return e.setMark(this.name)},toggleStrike:()=>t=>{let{commands:e}=t;return e.toggleMark(this.name)},unsetStrike:()=>t=>{let{commands:e}=t;return e.unsetMark(this.name)}}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[(0,r.OX)({find:it,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:st,type:this.type})]}}),lt=r.bP.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),ct=r.CU.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("underline")&&{}}],renderHTML(t){let{HTMLAttributes:e}=t;return["u",(0,r.KV)(this.options.HTMLAttributes,e),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown:(t,e)=>"++".concat(e.renderChildren(t),"++"),markdownTokenizer:{name:"underline",level:"inline",start:t=>t.indexOf("++"),tokenize(t,e,n){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!r)return;const o=r[2].trim();return{type:"underline",raw:r[0],text:o,tokens:n.inlineTokens(o)}}},addCommands(){return{setUnderline:()=>t=>{let{commands:e}=t;return e.setMark(this.name)},toggleUnderline:()=>t=>{let{commands:e}=t;return e.toggleMark(this.name)},unsetUnderline:()=>t=>{let{commands:e}=t;return e.unsetMark(this.name)}}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),ut=n(78666),dt=r.YY.create({name:"starterKit",addExtensions(){var t,e,n,r;const o=[];return!1!==this.options.bold&&o.push(f.configure(this.options.bold)),!1!==this.options.blockquote&&o.push(c.configure(this.options.blockquote)),!1!==this.options.bulletList&&o.push(L.configure(this.options.bulletList)),!1!==this.options.code&&o.push(y.configure(this.options.code)),!1!==this.options.codeBlock&&o.push(k.configure(this.options.codeBlock)),!1!==this.options.document&&o.push(w.configure(this.options.document)),!1!==this.options.dropcursor&&o.push(ut.QO.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&o.push(ut.vR.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&o.push(C.configure(this.options.hardBreak)),!1!==this.options.heading&&o.push(A.configure(this.options.heading)),!1!==this.options.undoRedo&&o.push(ut.lb.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&o.push(x.configure(this.options.horizontalRule)),!1!==this.options.italic&&o.push(O.configure(this.options.italic)),!1!==this.options.listItem&&o.push(P.configure(this.options.listItem)),!1!==this.options.listKeymap&&o.push(W.configure(null==(t=this.options)?void 0:t.listKeymap)),!1!==this.options.link&&o.push(F.N_.configure(null==(e=this.options)?void 0:e.link)),!1!==this.options.orderedList&&o.push(tt.configure(this.options.orderedList)),!1!==this.options.paragraph&&o.push(ot.configure(this.options.paragraph)),!1!==this.options.strike&&o.push(at.configure(this.options.strike)),!1!==this.options.text&&o.push(lt.configure(this.options.text)),!1!==this.options.underline&&o.push(ct.configure(null==(n=this.options)?void 0:n.underline)),!1!==this.options.trailingNode&&o.push(ut.JU.configure(null==(r=this.options)?void 0:r.trailingNode)),o}})},62195:(t,e,n)=>{n.d(e,{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:"'"},o={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},i="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),s="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),a=0;a<10;a++)r[48+a]=r[96+a]=String(a);for(a=1;a<=24;a++)r[a+111]="F"+a;for(a=65;a<=90;a++)r[a]=String.fromCharCode(a+32),o[a]=String.fromCharCode(a);for(var l in r)o.hasOwnProperty(l)||(o[l]=r[l]);var c=n(17184);const u="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),d="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function h(t){let e,n,r,o,i=t.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let a=0;a<i.length-1;a++){let t=i[a];if(/^(cmd|meta|m)$/i.test(t))o=!0;else if(/^a(lt)?$/i.test(t))e=!0;else if(/^(c|ctrl|control)$/i.test(t))n=!0;else if(/^s(hift)?$/i.test(t))r=!0;else{if(!/^mod$/i.test(t))throw new Error("Unrecognized modifier name: "+t);u?o=!0:n=!0}}return e&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function p(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];
2return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function f(t){return new c.k_({props:{handleKeyDown:m(t)}})}function m(t){let e=function(t){let e=Object.create(null);for(let n in t)e[h(n)]=t[n];return e}(t);return function(t,n){let a,l=function(t){var e=!(i&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||s&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?o:r)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(n),c=e[p(l,n)];if(c&&c(t.state,t.dispatch,t))return!0;if(1==l.length&&" "!=l){if(n.shiftKey){let r=e[p(l,n,!1)];if(r&&r(t.state,t.dispatch,t))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(d&&n.ctrlKey&&n.altKey)&&(a=r[n.keyCode])&&a!=l){let r=e[p(a,n)];if(r&&r(t.state,t.dispatch,t))return!0}}return!1}}},54282:(t,e,n)=>{function r(t){this.content=t}n.d(e,{S4:()=>X,ZF:()=>lt,FK:()=>a,CU:()=>d,sX:()=>G,bP:()=>F,u$:()=>T,vI:()=>h,Sj:()=>Y,Ji:()=>p}),r.prototype={constructor:r,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return-1==e?void 0:this.content[e+1]},update:function(t,e,n){var o=n&&n!=t?this.remove(n):this,i=o.find(t),s=o.content.slice();return-1==i?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new r(s)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new r(n)},addToStart:function(t,e){return new r([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new r(n)},addBefore:function(t,e,n){var o=this.remove(e),i=o.content.slice(),s=o.find(t);return i.splice(-1==s?i.length:s,0,e,n),new r(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=r.from(t)).size?new r(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=r.from(t)).size?new r(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=r.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach((function(e,n){t[e]=n})),t},get size(){return this.content.length>>1}},r.from=function(t){if(t instanceof r)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new r(e)};const o=r;function i(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),s=e.child(r);if(o!=s){if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){for(let t=0;o.text[t]==s.text[t];t++)n++;return n}if(o.content.size||s.content.size){let t=i(o.content,s.content,n+1);if(null!=t)return t}n+=o.nodeSize}else n+=o.nodeSize}}function s(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let a=t.child(--o),l=e.child(--i),c=a.nodeSize;if(a!=l){if(!a.sameMarkup(l))return{a:n,b:r};if(a.isText&&a.text!=l.text){let t=0,e=Math.min(a.text.length,l.text.length);for(;t<e&&a.text[a.text.length-t-1]==l.text[l.text.length-t-1];)t++,n--,r--;return{a:n,b:r}}if(a.content.size||l.content.size){let t=s(a.content,l.content,n-1,r-1);if(t)return t}n-=c,r-=c}else n-=c,r-=c}}class a{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let n=0;n<t.length;n++)this.size+=t[n].nodeSize}nodesBetween(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4?arguments[4]:void 0;for(let i=0,s=0;s<e;i++){let a=this.content[i],l=s+a.nodeSize;if(l>t&&!1!==n(a,r+s,o||null,i)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,t-o),Math.min(a.content.size,e-o),n,r+o)}s=l}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let o="",i=!0;return this.nodesBetween(t,e,((s,a)=>{let l=s.isText?s.text.slice(Math.max(t,a)-a,e-a):s.isLeaf?r?"function"===typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&l||s.isTextblock)&&n&&(i?i=!1:o+=n),o+=l}),0),o}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);o<t.content.length;o++)r.push(t.content[o]);return new a(r,this.size+t.size)}cut(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size;if(0==t&&e==this.size)return this;let n=[],r=0;if(e>t)for(let o=0,i=0;i<e;o++){let s=this.content[o],a=i+s.nodeSize;a>t&&((i<t||a>e)&&(s=s.isText?s.cut(Math.max(0,t-i),Math.min(s.text.length,e-i)):s.cut(Math.max(0,t-i-1),Math.min(s.content.size,e-i-1))),n.push(s),r+=s.nodeSize),i=a}return new a(n,r)}cutByIndex(t,e){return t==e?a.empty:0==t&&e==this.content.length?this:new a(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new a(r,o)}addToStart(t){return new a([t].concat(this.content),this.size+t.no
2deSize)}addToEnd(t){return new a(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,n=0;e<this.content.length;e++){let r=this.content[e];t(r,n,e),n+=r.nodeSize}}findDiffStart(t){return i(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)}findDiffEnd(t){return s(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size,arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.size)}findIndex(t){if(0==t)return c(0,t);if(t==this.size)return c(this.content.length,t);if(t>this.size||t<0)throw new RangeError("Position ".concat(t," outside of fragment (").concat(this,")"));for(let e=0,n=0;;e++){let r=n+this.child(e).nodeSize;if(r>=t)return r==t?c(e+1,r):c(e,n);n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((t=>t.toJSON())):null}static fromJSON(t,e){if(!e)return a.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new a(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return a.empty;let e,n=0;for(let r=0;r<t.length;r++){let o=t[r];n+=o.nodeSize,r&&o.isText&&t[r-1].sameMarkup(o)?(e||(e=t.slice(0,r)),e[e.length-1]=o.withText(e[e.length-1].text+o.text)):e&&e.push(o)}return new a(e||t,n)}static from(t){if(!t)return a.empty;if(t instanceof a)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new a([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}a.empty=new a([],0);const l={index:0,offset:0};function c(t,e){return l.index=t,l.offset=e,l}function u(t,e){if(t===e)return!0;if(!t||"object"!=typeof t||!e||"object"!=typeof e)return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!u(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!u(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}class d{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,n=!1;for(let r=0;r<t.length;r++){let o=t[r];if(this.eq(o))return t;if(this.type.excludes(o.type))e||(e=t.slice(0,r));else{if(o.type.excludes(this.type))return t;!n&&o.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(o)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&u(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");let n=t.marks[e.type];if(!n)throw new RangeError("There is no mark type ".concat(e.type," in this schema"));let r=n.create(e.attrs);return n.checkAttrs(r.attrs),r}static sameSet(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&0==t.length)return d.none;if(t instanceof d)return[t];let e=t.slice();return e.sort(((t,e)=>t.type.rank-e.type.rank)),e}}d.none=[];
vendor: 6,575 bytes, line 2
2class h extends Error{}class p{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=m(this.content,t+this.openStart,e);return n&&new p(n,this.openStart,this.openEnd)}removeBetween(t,e){return new p(f(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return p.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new p(a.fromJSON(t,e.content),n,r)}static maxOpen(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=0,r=0;for(let o=t.firstChild;o&&!o.isLeaf&&(e||!o.type.spec.isolating);o=o.firstChild)n++;for(let o=t.lastChild;o&&!o.isLeaf&&(e||!o.type.spec.isolating);o=o.lastChild)r++;return new p(t,n,r)}}function f(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(f(i.content,e-o-1,n-o-1)))}function m(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=m(s.content,e-i-1,n,s);return a&&t.replaceChild(o,s.copy(a))}function g(t,e,n){if(n.openStart>t.depth)throw new h("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new h("Inconsistent open depths");return y(t,e,n,0)}function y(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=y(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=r||e.depth!=r){let{start:o,end:s}=function(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)r=e.node(o).copy(a.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return w(i,C(t,o,s,e,r))}{let r=t.parent,o=r.content;return w(r,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}}return w(i,A(t,e,r))}function v(t,e){if(!e.type.compatibleContent(t.type))throw new h("Cannot join "+e.type.name+" onto "+t.type.name)}function D(t,e,n){let r=t.node(n);return v(r,e.node(n)),r}function b(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function k(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(b(t.nodeAfter,r),i++));for(let a=i;a<s;a++)b(o.child(a),r);e&&e.depth==n&&e.textOffset&&b(e.nodeBefore,r)}function w(t,e){return t.type.checkContent(e),t.copy(e)}function C(t,e,n,r,o){let i=t.depth>o&&D(t,e,o+1),s=r.depth>o&&D(n,r,o+1),l=[];return k(null,t,o,l),i&&s&&e.index(o)==n.index(o)?(v(i,s),b(w(i,C(t,e,n,r,o+1)),l)):(i&&b(w(i,A(t,e,o+1)),l),k(e,n,o,l),s&&b(w(s,A(n,r,o+1)),l)),k(r,null,o,l),new a(l)}function A(t,e,n){let r=[];if(k(null,t,n,r),t.depth>n){b(w(D(t,e,n+1),A(t,e,n+1)),r)}return k(e,null,n,r),new a(r)}p.empty=new p(a.empty,0,0);class x{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let o=0;o<t;o++)r+=n.child(o).nodeSize;return r}marks(){let t=this.parent,e=this.index();if(0==t.content.size)return d.none;if(this.textOffset)return t.child(e).marks;let n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){let t=n;n=r,r=t}let o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}marksAcross(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let n=e.marks,r=t.parent.maybeChild(t.index());for(var o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n}sharedDepth(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this,e=arguments.length>1?arguments[1]:void 0;if(t.pos<this.pos)return t.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new T(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let n=[],r=0,o=e;for(let i=t;;){let{index:t,offset:e}=i.content.findIndex(o),s=o-e;if(n.push(i,t,r+e),!s)break;if(i=i.child(t),i.isText)break;o=s-1,r+=e+1}return new x(e,n,o)}
2static resolveCached(t,e){let n=M.get(t);if(n)for(let o=0;o<n.elts.length;o++){let t=n.elts[o];if(t.pos==e)return t}else M.set(t,n=new E);let r=n.elts[n.i]=x.resolve(t,e);return n.i=(n.i+1)%S,r}}class E{constructor(){this.elts=[],this.i=0}}const S=12,M=new WeakMap;class T{constructor(t,e,n){this.$from=t,this.$to=e,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const O=Object.create(null);class F{constructor(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:d.none;this.type=t,this.attrs=e,this.marks=r,this.content=n||a.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.content.nodesBetween(t,e,n,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,e,n,r){return this.content.textBetween(t,e,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,e,n){return this.type==t&&u(this.attrs,e||t.defaultAttrs||O)&&d.sameSet(this.marks,n||d.none)}copy(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t==this.content?this:new F(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new F(this.type,this.attrs,this.content,t)}cut(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size;return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t==e)return p.empty;let r=this.resolve(t),o=this.resolve(e),i=n?0:r.sharedDepth(e),s=r.start(i),a=r.node(i).content.cut(r.pos-s,o.pos-s);return new p(a,r.depth-i,o.depth-i)}replace(t,e,n){return g(this.resolve(t),this.resolve(e),n)}nodeAt(t){for(let e=this;;){let{index:n,offset:r}=e.content.findIndex(t);if(e=e.maybeChild(n),!e)return null;if(r==t||e.isText)return e;t-=r+1}}childAfter(t){let{index:e,offset:n}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:n}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:e,offset:n}=this.content.findIndex(t);if(n<t)return{node:this.content.child(e),index:e,offset:n};let r=this.content.child(e-1);return{node:r,index:e-1,offset:n-r.nodeSize}}resolve(t){return x.resolveCached(this,t)}resolveNoCache(t){return x.resolve(this,t)}rangeHasMark(t,e,n){let r=!1;return e>t&&this.nodesBetween(t,e,(t=>(n.isInSet(t.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),B(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.empty,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:n.childCount,i=this.contentMatchAt(t).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(let a=r;a<o;a++)if(!this.type.allowsMarks(n.child(a).marks))return!1;return!0}
2canReplaceWith(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(t).matchType(n),i=o&&o.matchFragment(this.content,e);return!!i&&i.validEnd}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=d.none;for(let e=0;e<this.marks.length;e++){let n=this.marks[e];n.type.checkAttrs(n.attrs),t=n.addToSet(t)}if(!d.sameSet(t,this.marks))throw new RangeError("Invalid collection of marks for node ".concat(this.type.name,": ").concat(this.marks.map((t=>t.type.name))));this.content.forEach((t=>t.check()))}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map((t=>t.toJSON()))),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=a.fromJSON(t,e.content),o=t.nodeType(e.type).create(e.attrs,r,n);return o.type.checkAttrs(o.attrs),o}}F.prototype.text=void 0;class N extends F{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):B(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new N(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new N(this.type,this.attrs,t,this.marks)}cut(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.text.length;return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function B(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class R{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new I(t,e);if(null==n.next)return R.empty;let r=L(n);n.next&&n.err("Unexpected trailing text");let o=function(t){let e=Object.create(null);return n(H(t,0));function n(r){let o=[];r.forEach((e=>{t[e].forEach((e=>{let n,{term:r,to:i}=e;if(r){for(let t=0;t<o.length;t++)o[t][0]==r&&(n=o[t][1]);H(t,i).forEach((t=>{n||o.push([r,n=[]]),-1==n.indexOf(t)&&n.push(t)}))}}))}));let i=e[r.join(",")]=new R(r.indexOf(t.length-1)>-1);for(let t=0;t<o.length;t++){let r=o[t][1].sort(V);i.next.push({type:o[t][0],next:e[r.join(",")]||n(r)})}return i}}(function(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){let o={term:r,to:n};return e[t].push(o),o}function o(t,e){t.forEach((t=>t.to=e))}function i(t,e){if("choice"==t.type)return t.exprs.reduce(((t,n)=>t.concat(i(n,e))),[]);if("seq"!=t.type){if("star"==t.type){let s=n();return r(e,s),o(i(t.expr,s),s),[r(s)]}if("plus"==t.type){let s=n();return o(i(t.expr,e),s),o(i(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(e)].concat(i(t.expr,e));if("range"==t.type){let s=e;for(let e=0;e<t.min;e++){let e=n();o(i(t.expr,s),e),s=e}if(-1==t.max)o(i(t.expr,s),s);else for(let e=t.min;e<t.max;e++){let e=n();r(s,e),o(i(t.expr,s),e),s=e}return[r(s)]}if("name"==t.type)return[r(e,void 0,t.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=i(t.exprs[r],e);if(r==t.exprs.length-1)return s;o(s,e=n())}}}(r));return function(t,e){for(let n=0,r=[t];n<r.length;n++){let t=r[n],o=!t.validEnd,i=[];for(let e=0;e<t.next.length;e++){let{type:n,next:s}=t.next[e];i.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==r.indexOf(s)&&r.push(s)}o&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.childCount,r=this;for(let o=e;r&&o<n;o++)r=r.matchType(t.child(o).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!e.isText&&!e.hasRequiredAttrs())return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}fillBefore(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=[this];return function o(i,s){let l=i.matchFragment(t,n);if(l&&(!e||l.validEnd))return a.from(s.map((t=>t.createAndFill())));for(let t=0;t<i.next.length;t++){let{type:e,next:n}=i.next[t];if(!e.isText&&!e.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let t=o(n,s.concat(e));if(t)return t}}return null}(this,[])}findWrapping(t){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==t)return this.wrapCache[n+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),o=r.match;if(o.matchType(t)){let t=[];for(let e=r;e.type;e=e.via)t.push(e.type);return t.reverse()}for(let t=0;t<o.next.length;t++){let{type:i,next:s}=o.next[t];i.isLeaf||i.hasRequiredAttrs()||i.name in e||r.type&&!s.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),e[i.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError("There's no ".concat(t,"th edge in this content match"));return this.next[t]}toString(){let t=[];return function e(n){t.push(n);for(let r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)}(this),t.map(((e,n)=>{let r=n+(e.validEnd?"*":" ")+" ";for(let o=0;o<e.next.length;o++)r+=(o?", ":"")+e.next[o].type.name+"->"+t.indexOf(e.next[o].next);return r})).join("\n")}}R.empty=new R(!0);class I{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?
2=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function L(t){let e=[];do{e.push(P(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function P(t){let e=[];do{e.push(z(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function z(t){let e=function(t){if(t.eat("(")){let e=L(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){let e=function(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let t=n[i];t.isInGroup(e)&&o.push(t)}0==o.length&&t.err("No node type or group '"+e+"' found");return o}(t,t.next).map((e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e})));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}t.err("Unexpected token '"+t.next+"'")}(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=j(t,e)}return e}function $(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function j(t,e){let n=$(t),r=n;return t.eat(",")&&(r="}"!=t.next?$(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function V(t,e){return e-t}function H(t,e){let n=[];return function e(r){let o=t[r];if(1==o.length&&!o[0].term)return e(o[0].to);n.push(r);for(let t=0;t<o.length;t++){let{term:r,to:i}=o[t];r||-1!=n.indexOf(i)||e(i)}}(e),n.sort(V)}function K(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function q(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(void 0===o){let e=t[r];if(!e.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=e.default}n[r]=o}return n}function J(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError("Unsupported attribute ".concat(o," for ").concat(n," of type ").concat(o));for(let o in t){let n=t[o];n.validate&&n.validate(e[o])}}function U(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new W(t,r,e[r]);return n}class _{constructor(t,e,n){this.name=t,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=U(t,n.attrs),this.defaultAttrs=K(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==R.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:q(this.attrs,t)}create(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new F(this,this.computeAttrs(t),a.from(e),d.setFrom(n))}createChecked(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;return e=a.from(e),this.checkContent(e),new F(this,this.computeAttrs(t),e,d.setFrom(n))}createAndFill(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(t=this.computeAttrs(t),e=a.from(e),e.size){let t=this.contentMatch.fillBefore(e);if(!t)return null;e=t.append(e)}let r=this.contentMatch.matchFragment(e),o=r&&r.fillBefore(a.empty,!0);return o?new F(this,t,e.append(o),d.setFrom(n)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let n=0;n<t.childCount;n++)if(!this.allowsMarks(t.child(n).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError("Invalid content for node ".concat(this.name,": ").concat(t.toString().slice(0,50)))}checkAttrs(t){J(this.attrs,t,"node",this.name)}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){if(null==this.markSet)return t;let e;for(let n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:d.none:t}static compile(t,e){let n=Object.create(null);t.forEach(((t,r)=>n[t]=new _(t,e,r)));let r=e.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");
vendor: 8,019 bytes, line 2
2if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let o in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class W{constructor(t,e,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(t,e,n){let r=n.split("|");return n=>{let o=null===n?"null":typeof n;if(r.indexOf(o)<0)throw new RangeError("Expected value of type ".concat(r," for attribute ").concat(e," on type ").concat(t,", got ").concat(o))}}(t,e,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class G{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=U(t,r.attrs),this.excluded=null;let o=K(this.attrs);this.instance=o?new d(this,o):null}create(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!t&&this.instance?this.instance:new d(this,q(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach(((t,o)=>n[t]=new G(t,r++,e,o))),n}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}checkAttrs(t){J(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class Y{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let e=this.spec={};for(let r in t)e[r]=t[r];e.nodes=o.from(t.nodes),e.marks=o.from(t.marks||{}),this.nodes=_.compile(this.spec.nodes,this),this.marks=G.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let t=this.nodes[r],e=t.spec.content||"",o=t.spec.marks;if(t.contentMatch=n[e]||(n[e]=R.parse(e,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="_"==o?null:o?Z(this,o.split(" ")):""!=o&&t.inlineContent?null:[]}for(let r in this.marks){let t=this.marks[r],e=t.spec.excludes;t.excluded=null==e?[t]:""==e?[]:Z(this,e.split(" "))}this.nodeFromJSON=t=>F.fromJSON(this,t),this.markFromJSON=t=>d.fromJSON(this,t),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof _))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new N(n,n.defaultAttrs,t,d.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function Z(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(let e in t.marks){let r=t.marks[e];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class X{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[];let n=this.matchedStyles=[];e.forEach((t=>{if(function(t){return null!=t.tag}(t))this.tags.push(t);else if(function(t){return null!=t.style}(t)){let e=/[^=]*/.exec(t.style)[0];n.indexOf(e)<0&&n.push(e),this.styles.push(t)}})),this.normalizeLists=!this.tags.some((e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)}))}parse(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new ot(this,e,!1);return n.addAll(t,d.none,e.from,e.to),n.finish()}parseSlice(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new ot(this,e,!0);return n.addAll(t,d.none,e.from,e.to),p.maxOpen(n.finish())}matchTag(t,e,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(it(t,n.tag)&&(void 0===n.namespace||t.namespaceURI==n.namespace)&&(!n.context||e.matchesContext(n.context))){if(n.getAttrs){let e=n.getAttrs(t);if(!1===e)continue;n.attrs=e||void 0}return n}}}matchStyle(t,e,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(!(0!=i.indexOf(t)||r.context&&!n.matchesContext(r.context)||i.length>t.length&&(61!=i.charCodeAt(t.length)||i.slice(t.length+1)!=e))){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r<e.length;r++){let t=e[r];if((null==t.priority?50:t.priority)<n)break}e.splice(r,0,t)}for(let r in t.marks){let e=t.marks[r].spec.parseDOM;e&&e.forEach((t=>{n(t=st(t)),t.mark||t.ignore||t.clearMark||(t.mark=r)}))}for(let r in t.nodes){let e=t.nodes[r].spec.parseDOM;e&&e.forEach((t=>{n(t=st(t)),t.node||t.ignore||t.mark||(t.node=r)}))}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new X(t,X.schemaRules(t)))}}const Q={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},tt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},et={ol:!0,ul:!0};function nt(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class rt{constructor(t,e,n,r,o,i){this.type=t,this.attrs=e,this.marks=n,this.solid=r,this.options=i,this.content=[],this.activeMarks=d.none,this.match=o||(4&i?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(a.from(t));if(!e){let e,n=this.type.contentMatch;return(e=n.findWrapping(t.type))?(this.match=n,e):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t,e=this.content[this.content.length-1];if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let e=a.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(a.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Q.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class ot{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r,o=e.topNode,i=nt(null,e.preserveWhitespace,0)|(n?4:0);r=o?new rt(o.type,o.attrs,d.none,!0,e.topMatch||o.type.contentMatch,i):new rt(n?null:t.schema.topNodeType,null,d.none,!0,null,i),this.nodes=[r],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,e){3==t.nodeType?this.addTextNode(t,e):1==t.nodeType&&this.addElement(t,e)}addTextNode(t,e){let n=t.nodeValue,r=this.top,o=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:i}=this.parser;if("full"===o||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(o)if("full"===o)n=n.replace(/\r\n?/g,"\n");else if(i.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(i.linebreakReplacement.create())){let t=n.split(/\r?\n|\r/);for(let n=0;n<t.length;n++)n&&this.insertNode(i.linebreakReplacement.create(),e,!0),t[n]&&this.insertNode(i.text(t[n]),e,!/\S/.test(t[n]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let e=r.content[r.content.length-1],o=t.previousSibling;
vendor: 9,859 bytes, line 2
2(!e||o&&"BR"==o.nodeName||e.isText&&/[ \t\r\n\u000c]$/.test(e.text))&&(n=n.slice(1))}n&&this.insertNode(i.text(n),e,!/\S/.test(n)),this.findInText(t)}else this.findInside(t)}addElement(t,e,n){let r=this.localPreserveWS,o=this.top;("PRE"==t.tagName||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let i,s=t.nodeName.toLowerCase();et.hasOwnProperty(s)&&this.parser.normalizeLists&&function(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let t=1==e.nodeType?e.nodeName.toLowerCase():null;t&&et.hasOwnProperty(t)&&n?(n.appendChild(e),e=n):"li"==t?n=e:t&&(n=null)}}(t);let a=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,n));t:if(a?a.ignore:tt.hasOwnProperty(s))this.findInside(t),this.ignoreFallback(t,e);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(t=a.skip);let n,r=this.needsBlock;if(Q.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),n=!0,o.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,e);break t}let i=a&&a.skip?e:this.readStyles(t,e);i&&this.addAll(t,i),n&&this.sync(o),this.needsBlock=r}else{let n=this.readStyles(t,e);n&&this.addElementByRule(t,a,n,!1===a.consuming?i:void 0)}this.localPreserveWS=r}leafFallback(t,e){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"),e)}ignoreFallback(t,e){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),e,!0)}readStyles(t,e){let n=t.style;if(n&&n.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let t=this.parser.matchedStyles[r],o=n.getPropertyValue(t);if(o)for(let n;;){let r=this.parser.matchStyle(t,o,this,n);if(!r)break;if(r.ignore)return null;if(e=r.clearMark?e.filter((t=>!r.clearMark(t))):e.concat(this.parser.schema.marks[r.mark].create(r.attrs)),!1!==r.consuming)break;n=r}}return e}addElementByRule(t,e,n,r){let o,i;if(e.node)if(i=this.parser.schema.nodes[e.node],i.isLeaf)this.insertNode(i.create(e.attrs),n,"BR"==t.nodeName)||this.leafFallback(t,n);else{let t=this.enter(i,e.attrs||null,n,e.preserveWhitespace);t&&(o=!0,n=t)}else{let t=this.parser.schema.marks[e.mark];n=n.concat(t.create(e.attrs))}let s=this.top;if(i&&i.isLeaf)this.findInside(t);else if(r)this.addElement(t,n,r);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((t=>this.insertNode(t,n,!1)));else{let r=t;"string"==typeof e.contentElement?r=t.querySelector(e.contentElement):"function"==typeof e.contentElement?r=e.contentElement(t):e.contentElement&&(r=e.contentElement),this.findAround(t,r,!0),this.addAll(r,n),this.findAround(t,r,!1)}o&&this.sync(s)&&this.open--}addAll(t,e,n,r){let o=n||0;for(let i=n?t.childNodes[n]:t.firstChild,s=null==r?null:t.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(i,e);this.findAtPoint(t,o)}findPlace(t,e,n){let r,o;for(let i=this.open,s=0;i>=0;i--){let e=this.nodes[i],a=e.findWrapping(t);if(a&&(!r||r.length>a.length+s)&&(r=a,o=e,!a.length))break;if(e.solid){if(n)break;s+=2}}if(!r)return null;this.sync(o);for(let i=0;i<r.length;i++)e=this.enterInner(r[i],null,e,!1);return e}insertNode(t,e,n){if(t.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&(e=this.enterInner(t,null,e))}let r=this.findPlace(t,e,n);if(r){this.closeExtra();let e=this.top;e.match&&(e.match=e.match.matchType(t.type));let n=d.none;for(let o of r.concat(t.marks))(e.type?e.type.allowsMarkType(o.type):at(o.type,t.type))&&(n=o.addToSet(n));return e.content.push(t.mark(n)),!0}return!1}enter(t,e,n,r){let o=this.findPlace(t.create(e),n,!1);return o&&(o=this.enterInner(t,e,n,!0,r)),o}enterInner(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(t);let s=nt(t,o,i.options);4&i.options&&0==i.content.length&&(s|=4);let a=d.none;return n=n.filter((e=>!(i.type?i.type.allowsMarkType(e.type):at(e.type,t))||(a=e.addToSet(a),!1))),this.nodes.push(new rt(t,e,a,r,null,s)),this.open++,n}closeExtra(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!(!this.isOpen&&!this.options.topOpen))}sync(t){for(let e=this.open;e>=0;e--){if(this.nodes[e]==t)return this.open=e,!0;this.localPreserveWS&&(this.nodes[e].options|=1)}return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,n){if(t!=e&&this.find)for(let r=0;r<this.find.length;r++)if(null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)){e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),o=-(n?n.depth+1:0)+(r?0:1),i=(t,s)=>{for(;t>=0;t--){let a=e[t];if(""==a){if(t==e.length-1||0==t)continue;for(;s>=o;s--)if(i(t-1,s))return!0;return!1}{let t=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!t||t.name!=a&&!t.isInGroup(a))return!1;s--}}return!0};return i(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}}function it(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function st(t){let e={};for(let n in t)e[n]=t[n];return e}function at(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=t=>{i.push(t);for(let n=0;n<t.edgeCount;n++){let{type:r,next:o}=t.edge(n);if(r==e)return!0;if(i.indexOf(o)<0&&s(o))return!0}};if(s(o.contentMatch))return!0}}class lt{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;n||(n=ut(e).createDocumentFragment());let r=n,o=[];return t.forEach((t=>{if(o.length||t.marks.length){let n=0,i=0;for(;n<o.length&&i<t.marks.length;){let e=t.marks[i];if(this.marks[e.type.name]){if(!e.eq(o[n][0])||!1===e.type.spec.spanning)break;n++,i++}else i++}for(;n<o.length;)r=o.pop()[1];for(;i<t.marks.length;){let n=t.marks[i++],s=this.serializeMark(n,t.isInline,e);s&&(o.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(t,e))})),n}serializeNodeInner(t,e){let{dom:n,contentDOM:r}=pt(ut(e),this.nodes[t.type.name](t),null,t.attrs);if(r){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,r)}return n}serializeNode(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.serializeNodeInner(t,e);for(let r=t.marks.length-1;r>=0;r--){let o=this.serializeMark(t.marks[r],t.isInline,e);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.marks[t.type.name];return r&&pt(ut(n),r(t,e),null,t.attrs)}static renderSpec(t,e){return pt(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,arguments.length>3?arguments[3]:void 0)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new lt(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=ct(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return ct(t.marks)}}function ct(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function ut(t){return t.document||window.document}const dt=new WeakMap;function ht(t){let e=dt.get(t);return void 0===e&&dt.set(t,e=function(t){let e=null;function n(t){if(t&&"object"==typeof t)if(Array.isArray(t))if("string"==typeof t[0])e||(e=[]),e.push(t);else for(let e=0;e<t.length;e++)n(t[e]);else for(let e in t)n(t[e])}return n(t),e}(t)),e}function pt(t,e,n,r){if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let o,i=e[0];if("string"!=typeof i)throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=ht(r))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s,a=i.indexOf(" ");a>0&&(n=i.slice(0,a),i=i.slice(a+1));let l=n?t.createElementNS(n,i):t.createElement(i),c=e[1],u=1;if(c&&"object"==typeof c&&null==c.nodeType&&!Array.isArray(c)){u=2;for(let t in c)if(null!=c[t]){let e=t.indexOf(" ");e>0?l.setAttributeNS(t.slice(0,e),t.slice(e+1),c[t]):"style"==t&&l.style?l.style.cssText=c[t]:l.setAttribute(t,c[t])}}for(let d=u;d<e.length;d++){let o=e[d];if(0===o){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}{let{dom:e,contentDOM:i}=pt(t,o,n,r);
vendor: 13,569 bytes, line 2
2if(l.appendChild(e),i){if(s)throw new RangeError("Multiple content holes");s=i}}}return{dom:l,contentDOM:s}}},17184:(t,e,n)=>{n.d(e,{$t:()=>C,LN:()=>s,U3:()=>u,hs:()=>M,i5:()=>f,k_:()=>x,nh:()=>h});var r=n(54282),o=n(28115);const i=Object.create(null);class s{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new a(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.Ji.empty,n=e.content.lastChild,o=null;for(let r=0;r<e.openEnd;r++)o=n,n=n.lastChild;let i=t.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],u=t.mapping.slice(i);t.replaceRange(u.map(l.pos),u.map(c.pos),a?r.Ji.empty:e),0==a&&y(t,i,(n?n.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(t,e){let n=t.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],a=t.mapping.slice(n),l=a.map(i.pos),c=a.map(s.pos);o?t.deleteRange(l,c):(t.replaceRangeWith(l,c,e),y(t,n,e.isInline?-1:1))}}static findFrom(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t.parent.inlineContent?new u(t):g(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(let o=t.depth-1;o>=0;o--){let r=e<0?g(t.node(0),t.node(o),t.before(o+1),t.index(o),e,n):g(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,e,n);if(r)return r}return null}static near(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.findFrom(t,e)||this.findFrom(t,-e)||new f(t.node(0))}static atStart(t){return g(t,t,0,0,1)||new f(t)}static atEnd(t){return g(t,t,t.content.size,t.childCount,-1)||new f(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=i[e.type];if(!n)throw new RangeError("No selection type ".concat(e.type," defined"));return n.fromJSON(t,e)}static jsonID(t,e){if(t in i)throw new RangeError("Duplicate use of selection JSON ID "+t);return i[t]=e,e.prototype.jsonID=t,e}getBookmark(){return u.between(this.$anchor,this.$head).getBookmark()}}s.prototype.visible=!0;class a{constructor(t,e){this.$from=t,this.$to=e}}let l=!1;function c(t){l||t.parent.inlineContent||(l=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class u extends s{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;c(t),c(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return s.near(n);let r=t.resolve(e.map(this.anchor));return new u(r.parent.inlineContent?r:n,n)}replace(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.Ji.empty;if(super.replace(t,e),e==r.Ji.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof u&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new d(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new u(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}static between(t,e,n){let r=t.pos-e.pos;if(n&&!r||(n=r>=0?1:-1),!e.parent.inlineContent){let t=s.findFrom(e,n,!0)||s.findFrom(e,-n,!0);if(!t)return s.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r||(t=(s.findFrom(t,-n,!0)||s.findFrom(t,n,!0)).$anchor).pos<e.pos!=r<0)&&(t=e),new u(t,e)}}s.jsonID("text",u);class d{constructor(t,e){this.anchor=t,this.head=e}map(t){return new d(t.map(this.anchor),t.map(this.head))}resolve(t){return u.between(t.resolve(this.anchor),t.resolve(this.head))}}class h extends s{constructor(t){let e=t.nodeAfter,n=t.node(0).resolve(t.pos+e.nodeSize);super(t,n),this.node=e}map(t,e){let{deleted:n,pos:r}=e.mapResult(this.anchor),o=t.resolve(r);return n?s.near(o):new h(o)}content(){return new r.Ji(r.FK.from(this.node),0,0)}eq(t){return t instanceof h&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new p(this.anchor)}static fromJSON(t,e){if("number"!=typeof e.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new h(t.resolve(e.anchor))}static create(t,e){return new h(t.resolve(e))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}h.prototype.visible=!1,s.jsonID("node",h);class p{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:n}=t.mapResult(this.anchor);return e?new d(n,n):new p(n)}resolve(t){let e=t.resolve(this.anchor),n=e.nodeAfter;return n&&h.isSelectable(n)?new h(e):s.near(e)}}class f extends s{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.Ji.empty;if(e==r.Ji.empty){t.delete(0,t.doc.content.size);let e=s.atStart(t.doc);e.eq(t.selection)||t.setSelection(e)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new f(t)}map(t){return new f(t)}eq(t){return t instanceof f}getBookmark(){return m}}s.jsonID("all",f);const m={map(){return this},resolve:t=>new f(t)};function g(t,e,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e.inlineContent)return u.create(t,n);for(let s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let r=e.child(s);if(r.isAtom){if(!i&&h.isSelectable(r))return h.create(t,n-(o<0?r.nodeSize:0))}else{let e=g(t,r,n+o,o<0?r.childCount:0,o,i);if(e)return e}n+=r.nodeSize*o}return null}function y(t,e,n){let r=t.steps.length-1;if(r<e)return;let i,a=t.steps[r];(a instanceof o.Ln||a instanceof o.Wg)&&(t.mapping.maps[r].forEach(((t,e,n,r)=>{null==i&&(i=r)})),t.setSelection(s.near(t.doc.resolve(i),n)))}class v extends o.dL{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return r.CU.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(t,e){super.addStep(t,e),this.updated=-3&this.updated,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.CU.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,n){let r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();{if(null==n&&(n=e),!t)return this.deleteRange(e,n);let o=this.storedMarks;if(!o){let t=this.doc.resolve(e);o=n==e?t.marks():t.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,o)),this.selection.empty||this.selection.to!=e+t.length||this.setSelection(s.near(this.selection.$to)),this}}setMeta(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function D(t,e){return e&&t?t.bind(e):t}class b{constructor(t,e,n){this.name=t,this.init=D(e.init,n),this.apply=D(e.apply,n)}}const k=[new b("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new b("selection",{init:(t,e)=>t.selection||s.atStart(e.doc),apply:t=>t.selection}),new b("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new b("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})];class w{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=k.slice(),e&&e.forEach((t=>{if(this.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new b(t.key,t.spec.state,t))}))}}class C{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;for(let n=0;n<this.config.plugins.length;n++)if(n!=e){let e=this.config.plugins[n];if(e.spec.filterTransaction&&!e.spec.filterTransaction.call(e,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let e=[t],n=this.applyInner(t),r=null;for(;;){let o=!1;for(let i=0;i<this.config.plugins.length;i++){let s=this.config.plugins[i];if(s.spec.appendTransaction){let a=r?r[i].n:0,l=r?r[i].state:this,c=a<e.length&&s.spec.appendTransaction.call(s,a?e.slice(a):e,l,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",t),!r){r=[];for(let t=0;t<this.config.plugins.length;t++)r.push(t<i?{state:n,n:e.length}:{state:this,n:0})}e.push(c),n=n.applyInner(c),o=!0}r&&(r[i]={state:n,n:e.length})}}if(!o)return{state:n,transactions:e}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let e=new C(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let o=n[r];e[o.name]=o.apply(t,this[o.name],this,e)}return e}get tr(){return new v(this)}static create(t){let e=new w(t.doc?t.doc.type.schema:t.schema,t.plugins),n=new C(e);for(let r=0;r<e.fields.length;r++)n[e.fields[r].name]=e.fields[r].init(t,n);return n}reconfigure(t){let e=new w(this.schema,t.plugins),n=e.fields,r=new C(e);for(let o=0;o<n.length;o++){let e=n[o].name;r[e]=this.hasOwnProperty(e)?this[e]:n[o].init(t,r)}return r}toJSON(t){let e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map((t=>t.toJSON()))),t&&"object"==typeof t)for(let n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=t[n],o=r.spec.state;o&&o.toJSON&&(e[n]=o.toJSON.call(r,this[r.key]))}return e}static fromJSON(t,e,n){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new w(t.schema,t.plugins),i=new C(o);return o.fields.forEach((o=>{if("doc"==o.name)i.doc=r.bP.fromJSON(t.schema,e.doc);else if("selection"==o.name)i.selection=s.fromJSON(i.doc,e.selection);else if("storedMarks"==o.name)e.storedMarks&&(i.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let r in n){let s=n[r],a=s.spec.state;if(s.key==o.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(e,r))return void(i[o.name]=a.fromJSON.call(s,t,e[r],i))}i[o.name]=o.init(t,i)}})),i}}function A(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):"handleDOMEvents"==r&&(o=A(o,e,{})),n[r]=o}return n}class x{constructor(t){this.spec=t,this.props={},t.props&&A(t.props,this,this.props),this.key=t.key?t.key.key:S("plugin")}getState(t){return t[this.key]}}const E=Object.create(null);function S(t){return t in E?t+"$"+ ++E[t]:(E[t]=0,t+"$")}class M{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"key";this.key=S(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}},28115:(t,e,n)=>{n.d(e,{$L:()=>N,Ln:()=>y,N0:()=>O,Um:()=>F,Wg:()=>v,X9:()=>l,Ys:()=>f,dL:()=>J,jP:()=>w,n9:()=>M,oM:()=>C,zy:()=>S});var r=n(54282);const o=Math.pow(2,16);function i(t){return 65535&t}class s{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class a{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.ranges=t,this.inverted=e,!t.length&&a.empty)return a.empty}recover(t){let e=0,n=i(t);if(!this.inverted)for(let r=0;r<n;r++)e+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+e+function(t){return(t-(65535&t))/o}(t)}mapResult(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(t,e,!1)}map(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(t,e,!0)}_map(t,e,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;
2for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?r:0);if(c>t)break;let u=this.ranges[l+i],d=this.ranges[l+a],h=c+u;if(t<=h){let i=c+r+((u?t==c?-1:t==h?1:e:e)<0?0:d);if(n)return i;let a=t==(e<0?c:h)?null:l/3+(t-c)*o,p=t==c?2:t==h?1:4;return(e<0?t!=c:t!=h)&&(p|=8),new s(i,p,a)}r+=d-u}return n?t+r:new s(t+r,0,null)}touches(t,e){let n=0,r=i(e),o=this.inverted?2:1,s=this.inverted?1:2;for(let i=0;i<this.ranges.length;i+=3){let e=this.ranges[i]-(this.inverted?n:0);if(e>t)break;let a=this.ranges[i+o];if(t<=e+a&&i==3*r)return!0;n+=this.ranges[i+s]-a}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),l=this.ranges[r+e],c=this.ranges[r+n];t(s,s+l,a,a+c),o+=c-l}}invert(){return new a(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?a.empty:new a(t<0?[0,-t,0]:[0,0,t])}}a.empty=new a([]);class l{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t?t.length:0;this.mirror=e,this.from=n,this.to=r,this._maps=t||[],this.ownData=!(t||e)}get maps(){return this._maps}slice(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.maps.length;return new l(this._maps,this.mirror,t,e)}appendMap(t,e){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),null!=e&&this.setMirror(this._maps.length-1,e)}appendMapping(t){for(let e=0,n=this._maps.length;e<t._maps.length;e++){let r=t.getMirror(e);this.appendMap(t._maps[e],null!=r&&r<e?n+r:void 0)}}getMirror(t){if(this.mirror)for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}setMirror(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}appendMappingInverted(t){for(let e=t.maps.length-1,n=this._maps.length+t._maps.length;e>=0;e--){let r=t.getMirror(e);this.appendMap(t._maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}invert(){let t=new l;return t.appendMappingInverted(this),t}map(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this.mirror)return this._map(t,e,!0);for(let n=this.from;n<this.to;n++)t=this._maps[n].map(t,e);return t}mapResult(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(t,e,!1)}_map(t,e,n){let r=0;for(let o=this.from;o<this.to;o++){let n=this._maps[o].mapResult(t,e);if(null!=n.recover){let e=this.getMirror(o);if(null!=e&&e>o&&e<this.to){o=e,t=this._maps[e].recover(n.recover);continue}}r|=n.delInfo,t=n.pos}return n?t:new s(t,r,null)}}const c=Object.create(null);class u{getMap(){return a.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=c[e.stepType];if(!n)throw new RangeError("No step type ".concat(e.stepType," defined"));return n.fromJSON(t,e)}static jsonID(t,e){if(t in c)throw new RangeError("Duplicate use of step JSON ID "+t);return c[t]=e,e.prototype.jsonID=t,e}}class d{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new d(t,null)}static fail(t){return new d(null,t)}static fromReplace(t,e,n,o){try{return d.ok(t.replace(e,n,o))}catch(i){if(i instanceof r.vI)return d.fail(i.message);throw i}}}function h(t,e,n){let o=[];for(let r=0;r<t.childCount;r++){let i=t.child(r);i.content.size&&(i=i.copy(h(i.content,e,i))),i.isInline&&(i=e(i,n,r)),o.push(i)}return r.FK.fromArray(o)}class p extends u{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=t.resolve(this.from),o=n.node(n.sharedDepth(this.to)),i=new r.Ji(h(e.content,((t,e)=>t.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t),o),e.openStart,e.openEnd);return d.fromReplace(t,this.from,this.to,i)}invert(){return new f(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new p(e.pos,n.pos,this.mark)}merge(t){return t instanceof p&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new p(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new p(e.from,e.to,t.markFromJSON(e.mark))}}u.jsonID("addMark",p);class f extends u{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}
vendor: 6,597 bytes, line 2
2apply(t){let e=t.slice(this.from,this.to),n=new r.Ji(h(e.content,(t=>t.mark(this.mark.removeFromSet(t.marks))),t),e.openStart,e.openEnd);return d.fromReplace(t,this.from,this.to,n)}invert(){return new p(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new f(e.pos,n.pos,this.mark)}merge(t){return t instanceof f&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new f(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new f(e.from,e.to,t.markFromJSON(e.mark))}}u.jsonID("removeMark",f);class m extends u{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return d.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return d.fromReplace(t,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;n<e.marks.length;n++)if(!e.marks[n].isInSet(t))return new m(this.pos,e.marks[n]);return new m(this.pos,this.mark)}}return new g(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new m(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new m(e.pos,t.markFromJSON(e.mark))}}u.jsonID("addNodeMark",m);class g extends u{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return d.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return d.fromReplace(t,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new m(this.pos,this.mark):this}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new g(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new g(e.pos,t.markFromJSON(e.mark))}}u.jsonID("removeNodeMark",g);class y extends u{constructor(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];super(),this.from=t,this.to=e,this.slice=n,this.structure=r}apply(t){return this.structure&&D(t,this.from,this.to)?d.fail("Structure replace would overwrite content"):d.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new a([this.from,this.to-this.from,this.slice.size])}invert(t){return new y(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deletedAcross&&n.deletedAcross?null:new y(e.pos,Math.max(e.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof y)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let e=this.slice.size+t.slice.size==0?r.Ji.empty:new r.Ji(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new y(t.from,this.to,e,this.structure)}}{let e=this.slice.size+t.slice.size==0?r.Ji.empty:new r.Ji(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new y(this.from,this.to+(t.to-t.from),e,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new y(e.from,e.to,r.Ji.fromJSON(t,e.slice),!!e.structure)}}u.jsonID("replace",y);class v extends u{constructor(t,e,n,r,o,i){let s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];super(),this.from=t,this.to=e,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(t){if(this.structure&&(D(t,this.from,this.gapFrom)||D(t,this.gapTo,this.to)))return d.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return d.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,e.content);return n?d.fromReplace(t,this.from,this.to,n):d.fail("Content does not fit in gap")}getMap(){return new a([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new v(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1),r=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?n.pos:t.map(this.gapTo,1);return e.deletedAcross&&n.deletedAcross||r<e.pos||o>n.pos?null:new v(e.pos,n.pos,r,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new v(e.from,e.to,e.gapFrom,e.gapTo,r.Ji.fromJSON(t,e.slice),e.insert,!!e.structure)}}function D(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let t=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,o--}}return!1}function b(t,e,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.contentMatch,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=t.doc.nodeAt(e),a=[],l=e+1;for(let c=0;c<s.childCount;c++){let e=s.child(c),u=l+e.nodeSize,d=o.matchType(e.type);if(d){o=d;for(let r=0;r<e.marks.length;r++)n.allowsMarkType(e.marks[r].type)||t.step(new f(l,u,e.marks[r]));if(i&&e.isText&&"pre"!=n.whitespace){let t,o,i=/\r?\n|\r/g;
vendor: 11,645 bytes, line 2
2for(;t=i.exec(e.text);)o||(o=new r.Ji(r.FK.from(n.schema.text(" ",n.allowedMarks(e.marks))),0,0)),a.push(new y(l+t.index,l+t.index+t[0].length,o))}}else a.push(new y(l,u,r.Ji.empty));l=u}if(!o.validEnd){let e=o.fillBefore(r.FK.empty,!0);t.replace(l,l,new r.Ji(e,0,0))}for(let r=a.length-1;r>=0;r--)t.step(a[r])}function k(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function w(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth,r=0,o=0;;--n){let i=t.$from.node(n),s=t.$from.index(n)+r,a=t.$to.indexAfter(n)-o;if(n<t.depth&&i.canReplace(s,a,e))return n;if(0==n||i.type.spec.isolating||!k(i,s,a))break;s&&(r=1),a<i.childCount&&(o=1)}return null}function C(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t,o=function(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}(t,e),i=o&&function(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let l=r;a&&l<o;l++)a=a.matchType(n.child(l).type);return a&&a.validEnd?s:null}(r,e);return i?o.map(A).concat({type:e,attrs:n}).concat(i.map(A)):null}function A(t){return{type:t,attrs:null}}function x(t,e,n,r){e.forEach(((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let o=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(o,o+1,e.type.schema.linebreakReplacement.create())}}}))}function E(t,e,n,r){e.forEach(((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+i);t.replaceWith(o,o+1,e.type.schema.text("\n"))}}))}function S(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=n-2;c>i;c--,u--){let t=o.node(c),e=o.index(c);if(t.type.spec.isolating)return!1;let n=t.content.cutByIndex(e,t.childCount),i=r&&r[u+1];i&&(n=n.replaceChild(0,i.type.create(i.attrs)));let s=r&&r[u]||t;if(!t.canReplace(e+1,t.childCount)||!s.type.validContent(n))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function M(t,e){let n=t.resolve(e),r=n.index();return T(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function T(t,e){return!(!t||!e||t.isLeaf||!function(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let i=e.child(o),s=i.type==r?t.type.schema.nodes.text:i.type;if(n=n.matchType(s),!n)return!1;if(!t.type.allowsMarks(i.marks))return!1}return n.validEnd}(t,e))}function O(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=t.resolve(e);for(let o=r.depth;;o--){let t,i,s=r.index(o);if(o==r.depth?(t=r.nodeBefore,i=r.nodeAfter):n>0?(t=r.node(o+1),s++,i=r.node(o).maybeChild(s)):(t=r.node(o).maybeChild(s-1),i=r.node(o+1)),t&&!t.isTextblock&&T(t,i)&&r.node(o).canReplace(s,s+1))return e;if(0==o)break;e=n<0?r.before(o):r.after(o)}}function F(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(0==n.openStart&&n.size?2:1);i++)for(let t=r.depth;t>=0;t--){let e=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,n=r.index(t)+(e>0?1:0),s=r.node(t),a=!1;if(1==i)a=s.canReplace(n,n,o);else{let t=s.contentMatchAt(n).findWrapping(o.firstChild.type);a=t&&s.canReplaceWith(n,n,t[0])}if(a)return 0==e?r.pos:e<0?r.before(t+1):r.after(t+1)}return null}function N(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r.Ji.empty;if(e==n&&!o.size)return null;let i=t.resolve(e),s=t.resolve(n);return B(i,s,o)?new y(e,n,o):new R(i,s,o).fit()}function B(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}u.jsonID("replaceAround",v);class R{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=r.FK.empty;for(let r=0;r<=t.depth;r++){let e=t.node(r);this.frontier.push({type:e.type,match:e.contentMatchAt(t.indexAfter(r))})}for(let o=t.depth;o>0;o--)this.placed=r.FK.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,o=this.close(t<0?this.$to:n.doc.resolve(t));if(!o)return null;let i=this.placed,s=n.depth,a=o.depth;for(;s&&a&&1==i.childCount;)i=i.firstChild.content,s--,a--;let l=new r.Ji(i,s,a);return t>-1?new v(n.pos,t,this.$to.pos,this.$to.end(),l,e):l.size||n.pos!=this.$to.pos?new y(n.pos,o.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<t;n++){let o=e.firstChild;if(e.childCount>1&&(r=0),o.type.spec.isolating&&r<=n){t=n;break}e=o.content}for(let e=1;e<=2;e++)for(let n=1==e?t:this.unplaced.openStart;n>=0;n--){let t,o=null;n?(o=P(this.unplaced.content,n-1).firstChild,t=o.content):t=this.unplaced.content;let i=t.firstChild;for(let s=this.depth;s>=0;s--){let t,{type:a,match:l}=this.frontier[s],c=null;if(1==e&&(i?l.matchType(i.type)||(c=l.fillBefore(r.FK.from(i),!1)):o&&a.compatibleContent(o.type)))return{sliceDepth:n,frontierDepth:s,parent:o,inject:c};if(2==e&&i&&(t=l.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:s,parent:o,wrap:t};if(o&&l.matchType(o.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,o=P(t,e);return!(!o.childCount||o.firstChild.isLeaf)&&(this.unplaced=new r.Ji(t,e+1,Math.max(n,o.size+e>=t.size-n?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,o=P(t,e);if(o.childCount<=1&&e>0){let i=t.size-e<=e+o.size;this.unplaced=new r.Ji(I(t,e-1,1),e-1,i?e-1:n)}else this.unplaced=new r.Ji(I(t,e,1),e,n)}placeNodes(t){let{sliceDepth:e,frontierDepth:n,parent:o,inject:i,wrap:s}=t;for(;this.depth>n;)this.closeFrontierNode();if(s)for(let r=0;r<s.length;r++)this.openFrontierNode(s[r]);let a=this.unplaced,l=o?o.content:a.content,c=a.openStart-e,u=0,d=[],{match:h,type:p}=this.frontier[n];if(i){for(let t=0;t<i.childCount;t++)d.push(i.child(t));h=h.matchFragment(i)}let f=l.size+e-(a.content.size-a.openEnd);for(;u<l.childCount;){let t=l.child(u),e=h.matchType(t.type);if(!e)break;u++,(u>1||0==c||t.content.size)&&(h=e,d.push(z(t.mark(p.allowedMarks(t.marks)),1==u?c:0,u==l.childCount?f:-1)))}let m=u==l.childCount;m||(f=-1),this.placed=L(this.placed,n,r.FK.from(d)),this.frontier[n].match=h,m&&f<0&&o&&o.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let r=0,g=l;r<f;r++){let t=g.lastChild;this.frontier.push({type:t.type,match:t.contentMatchAt(t.childCount)}),g=t.content}this.unplaced=m?0==e?r.Ji.empty:new r.Ji(I(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new r.Ji(I(a.content,e,u),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t,e=this.frontier[this.depth];if(!e.type.isTextblock||!$(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],o=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),i=$(t,e,r,n,o);if(i){for(let n=e-1;n>=0;n--){let{match:e,type:r}=this.frontier[n],o=$(t,n,r,e,!0);if(!o||o.childCount)continue t}return{depth:e,fit:i,move:o?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=L(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),r=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,r)}return t}openFrontierNode(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=L(this.placed,this.depth,r.FK.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(r.FK.empty,!0);t.childCount&&(this.placed=L(this.placed,this.frontier.length,t))}}function I(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(I(t.firstChild.content,e-1,n)))}function L(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(L(t.lastChild.content,e-1,n)))}function P(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function z(t,e,n){if(e<=0)return t;let o=t.content;return e>1&&(o=o.replaceChild(0,z(o.firstChild,e-1,1==o.childCount?n-1:0))),e>0&&(o=t.type.contentMatch.fillBefore(o).append(o),n<=0&&(o=o.append(t.type.contentMatch.matchFragment(o).fillBefore(r.FK.empty,!0)))),t.copy(o)}function $(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!function(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,i.content,s)?a:null}function j(t,e,n,o,i){if(e<n){let r=t.firstChild;t=t.replaceChild(0,r.copy(j(r.content,e+1,n,o,r)))}if(e>o){let e=i.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(r.FK.empty,!0))}return t}function V(t,e){let n=[];for(let r=Math.min(t.depth,e.depth);r>=0;r--){let o=t.start(r);if(o<t.pos-(t.depth-r)||e.end(r)>e.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(o==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==o-1)&&n.push(r)}return n}class H extends u{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return d.fail("No node at attribute step's position");let n=Object.create(null);for(let r in e.attrs)n[r]=e.attrs[r];n[this.attr]=this.value;let o=e.type.create(n,null,e.marks);return d.fromReplace(t,this.pos,this.pos+1,new r.Ji(r.FK.from(o),0,e.isLeaf?0:1))}getMap(){return a.empty}invert(t){return new H(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new H(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new H(e.pos,e.attr,e.value)}}u.jsonID("attr",H);class K extends u{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let r in t.attrs)e[r]=t.attrs[r];e[this.attr]=this.value;let n=t.type.create(e,t.content,t.marks);return d.ok(n)}getMap(){return a.empty}invert(t){return new K(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,e){if("string"!=typeof e.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new K(e.attr,e.value)}}u.jsonID("docAttr",K);
2let q=class extends Error{};q=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(q.prototype=Object.create(Error.prototype)).constructor=q,q.prototype.name="TransformError";class J{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new l}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new q(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.Ji.empty,o=N(this.doc,t,e,n);return o&&this.step(o),this}replaceWith(t,e,n){return this.replace(t,e,new r.Ji(r.FK.from(n),0,0))}delete(t,e){return this.replace(t,e,r.Ji.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return function(t,e,n,o){if(!o.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),s=t.doc.resolve(n);if(B(i,s,o))return t.step(new y(e,n,o));let a=V(i,s);0==a[a.length-1]&&a.pop();let l=-(i.depth+1);a.unshift(l);for(let r=i.depth,f=i.pos-1;r>0;r--,f--){let t=i.node(r).type.spec;if(t.defining||t.definingAsContext||t.isolating)break;a.indexOf(r)>-1?l=r:i.before(r)==f&&a.splice(1,0,-r)}let c=a.indexOf(l),u=[],d=o.openStart;for(let r=o.content,f=0;;f++){let t=r.firstChild;if(u.push(t),f==o.openStart)break;r=t.content}for(let r=d-1;r>=0;r--){let t=u[r],e=(h=t.type).spec.defining||h.spec.definingForContent;if(e&&!t.sameMarkup(i.node(Math.abs(l)-1)))d=r;else if(e||!t.type.isTextblock)break}var h;for(let f=o.openStart;f>=0;f--){let e=(f+d+1)%(o.openStart+1),l=u[e];if(l)for(let u=0;u<a.length;u++){let d=a[(u+c)%a.length],h=!0;d<0&&(h=!1,d=-d);let p=i.node(d-1),f=i.index(d-1);if(p.canReplaceWith(f,f,l.type,l.marks))return t.replace(i.before(d),h?s.after(d):n,new r.Ji(j(o.content,0,o.openStart,e),e,o.openEnd))}}let p=t.steps.length;for(let r=a.length-1;r>=0&&(t.replace(e,n,o),!(t.steps.length>p));r--){let t=a[r];t<0||(e=i.before(t),n=s.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){return function(t,e,n,o){if(!o.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let r=function(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(let o=r.depth-1;o>=0;o--){let t=r.index(o);if(r.node(o).canReplaceWith(t,t,n))return r.before(o+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let t=r.indexAfter(o);if(r.node(o).canReplaceWith(t,t,n))return r.after(o+1);if(t<r.node(o).childCount)return null}return null}(t.doc,e,o.type);null!=r&&(e=n=r)}t.replaceRange(e,n,new r.Ji(r.FK.from(o),0,0))}(this,t,e,n),this}deleteRange(t,e){return function(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=V(r,o);for(let s=0;s<i.length;s++){let e=i[s],n=s==i.length-1;if(n&&0==e||r.node(e).type.contentMatch.validEnd)return t.delete(r.start(e),o.end(e));if(e>0&&(n||r.node(e-1).canReplace(r.index(e-1),o.indexAfter(e-1))))return t.delete(r.before(e),o.after(e))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s&&r.start(s-1)==o.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),o.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}(this,t,e),this}lift(t,e){return function(t,e,n){let{$from:o,$to:i,depth:s}=e,a=o.before(s+1),l=i.after(s+1),c=a,u=l,d=r.FK.empty,h=0;for(let m=s,g=!1;m>n;m--)g||o.index(m)>0?(g=!0,d=r.FK.from(o.node(m).copy(d)),h++):c--;let p=r.FK.empty,f=0;for(let m=s,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,p=r.FK.from(i.node(m).copy(p)),f++):u++;t.step(new v(c,u,a,l,new r.Ji(d.append(p),h,f),d.size-h,!0))}(this,t,e),this}join(t){return function(t,e,n){let o=null,{linebreakReplacement:i}=t.doc.type.schema,s=t.doc.resolve(e-n),a=s.node().type;if(i&&a.inlineContent){let t="pre"==a.whitespace,e=!!a.contentMatch.matchType(i);t&&!e?o=!1:!t&&e&&(o=!0)}let l=t.steps.length;if(!1===o){let r=t.doc.resolve(e+n);E(t,r.node(),r.before(),l)}a.inlineContent&&b(t,e+n-1,a,s.node().contentMatchAt(s.index()),null==o);let c=t.mapping.slice(l),u=c.map(e-n);if(t.step(new y(u,c.map(e+n,-1),r.Ji.empty,!0)),!0===o){let e=t.doc.resolve(u);x(t,e.node(),e.before(),t.steps.length)}}(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),this}wrap(t,e){return function(t,e,n){let o=r.FK.empty;for(let a=n.length-1;a>=0;a--){if(o.size){let t=n[a].type.contentMatch.matchFragment(o);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}o=r.FK.from(n[a].type.create(n[a].attrs,o))}let i=e.start,s=e.end;t.step(new v(i,s,i,s,new r.Ji(o,0,0),n.length,!0))}(this,t,e),this}setBlockType(t){return function(t,e,n,o,i){if(!o.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,((e,n)=>{let a="function"==typeof i?i(e):i;if(e.isTextblock&&!e.hasMarkup(o,a)&&function(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(t.doc,t.mapping.slice(s).map(n),o)){let i=null;if(o.schema.linebreakReplacement){let t="pre"==o.whitespace,e=!!o.contentMatch.matchType(o.schema.linebreakReplacement);t&&!e?i=!1:!t&&e&&(i=!0)}!1===i&&E(t,e,n,s),b(t,t.mapping.slice(s).map(n,1),o,void 0,null===i);let l=t.mapping.slice(s),c=l.map(n,1),u=l.map(n+e.nodeSize,1);return t.step(new v(c,u,c+1,u-1,new r.Ji(r.FK.from(o.create(a,null,e.marks)),0,0),1,!0)),!0===i&&x(t,e,n,s),!1}}))}(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,arguments.length>2?arguments[2]:void 0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:null),this}setNodeMarkup(t,e){return function(t,e,n,o,i){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let a=n.create(o,null,i||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,a);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new v(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new r.Ji(r.FK.from(a),0,0),1,!0))}(this,t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,arguments.length>3?arguments[3]:void 0),this}setNodeAttribute(t,e,n){return this.step(new H(t,e,n)),this}setDocAttribute(t,e){return this.step(new K(t,e)),this}addNodeMark(t,e){return this.step(new m(t,e)),this}
vendor: 6,288 bytes, line 2
2removeNodeMark(t,e){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(e instanceof r.CU)e.isInSet(n.marks)&&this.step(new g(t,e));else{let r,o=n.marks,i=[];for(;r=e.isInSet(o);)i.push(new g(t,r)),o=r.removeFromSet(o);for(let t=i.length-1;t>=0;t--)this.step(i[t])}return this}split(t){return function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3?arguments[3]:void 0,i=t.doc.resolve(e),s=r.FK.empty,a=r.FK.empty;for(let l=i.depth,c=i.depth-n,u=n-1;l>c;l--,u--){s=r.FK.from(i.node(l).copy(s));let t=o&&o[u];a=r.FK.from(t?t.type.create(t.attrs,a):i.node(l).copy(a))}t.step(new y(e,e,new r.Ji(s.append(a),n,n),!0))}(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,arguments.length>2?arguments[2]:void 0),this}addMark(t,e,n){return function(t,e,n,r){let o,i,s=[],a=[];t.doc.nodesBetween(e,n,((t,l,c)=>{if(!t.isInline)return;let u=t.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,e),d=Math.min(l+t.nodeSize,n),h=r.addToSet(u);for(let t=0;t<u.length;t++)u[t].isInSet(h)||(o&&o.to==c&&o.mark.eq(u[t])?o.to=d:s.push(o=new f(c,d,u[t])));i&&i.to==c?i.to=d:a.push(i=new p(c,d,r))}})),s.forEach((e=>t.step(e))),a.forEach((e=>t.step(e)))}(this,t,e,n),this}removeMark(t,e,n){return function(t,e,n,o){let i=[],s=0;t.doc.nodesBetween(e,n,((t,a)=>{if(!t.isInline)return;s++;let l=null;if(o instanceof r.sX){let e,n=t.marks;for(;e=o.isInSet(n);)(l||(l=[])).push(e),n=e.removeFromSet(n)}else o?o.isInSet(t.marks)&&(l=[o]):l=t.marks;if(l&&l.length){let r=Math.min(a+t.nodeSize,n);for(let t=0;t<l.length;t++){let n,o=l[t];for(let t=0;t<i.length;t++){let e=i[t];e.step==s-1&&o.eq(i[t].style)&&(n=e)}n?(n.to=r,n.step=s):i.push({style:o,from:Math.max(a,e),to:r,step:s})}}})),i.forEach((e=>t.step(new f(e.from,e.to,e.style))))}(this,t,e,n),this}clearIncompatible(t,e,n){return b(this,t,e,n),this}}},11140:(t,e,n)=>{n.d(e,{Lz:()=>yn,NZ:()=>He,zF:()=>Je});var r=n(17184),o=n(54282),i=n(28115);const s=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},a=function(t){let e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e};let l=null;const c=function(t,e,n){let r=l||(l=document.createRange());return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r},u=function(t,e,n,r){return n&&(h(t,e,n,r,-1)||h(t,e,n,r,1))},d=/^(img|br|input|textarea|hr)$/i;function h(t,e,n,r,o){for(var i;;){if(t==n&&e==r)return!0;if(e==(o<0?0:p(t))){let n=t.parentNode;if(!n||1!=n.nodeType||f(t)||d.test(t.nodeName)||"false"==t.contentEditable)return!1;e=s(t)+(o<0?0:1),t=n}else{if(1!=t.nodeType)return!1;{let n=t.childNodes[e+(o<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable){if(!(null===(i=n.pmViewDesc)||void 0===i?void 0:i.ignoreForSelection))return!1;e+=o}else t=n,e=o<0?p(t):0}}}}function p(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function f(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const m=function(t){return t.focusNode&&u(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function g(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}const y="undefined"!=typeof navigator?navigator:null,v="undefined"!=typeof document?document:null,D=y&&y.userAgent||"",b=/Edge\/(\d+)/.exec(D),k=/MSIE \d/.exec(D),w=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(D),C=!!(k||w||b),A=k?document.documentMode:w?+w[1]:b?+b[1]:0,x=!C&&/gecko\/(\d+)/i.test(D);x&&(/Firefox\/(\d+)/.exec(D)||[0,0])[1];const E=!C&&/Chrome\/(\d+)/.exec(D),S=!!E,M=E?+E[1]:0,T=!C&&!!y&&/Apple Computer/.test(y.vendor),O=T&&(/Mobile\/\w+/.test(D)||!!y&&y.maxTouchPoints>2),F=O||!!y&&/Mac/.test(y.platform),N=!!y&&/Win/.test(y.platform),B=/Android \d/.test(D),R=!!v&&"webkitFontSmoothing"in v.documentElement.style,I=R?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function L(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function P(t,e){return"number"==typeof t?t:t[e]}function z(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function $(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=n||t.dom;s;){if(1!=s.nodeType){s=a(s);continue}let t=s,n=t==i.body,l=n?L(i):z(t),c=0,u=0;if(e.top<l.top+P(r,"top")?u=-(l.top-e.top+P(o,"top")):e.bottom>l.bottom-P(r,"bottom")&&(u=e.bottom-e.top>l.bottom-l.top?e.top+P(o,"top")-l.top:e.bottom-l.bottom+P(o,"bottom")),e.left<l.left+P(r,"left")?c=-(l.left-e.left+P(o,"left")):e.right>l.right-P(r,"right")&&(c=e.right-l.right+P(o,"right")),c||u)if(n)i.defaultView.scrollBy(c,u);else{let n=t.scrollLeft,r=t.scrollTop;u&&(t.scrollTop+=u),c&&(t.scrollLeft+=c);let o=t.scrollLeft-n,i=t.scrollTop-r;e={left:e.left-o,top:e.top-i,right:e.right-o,bottom:e.bottom-i}}let d=n?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(d))break;s="absolute"==d?s.offsetParent:a(s)}}function j(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=a(r));return e}function V(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:i}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let H=null;function K(t,e){let n,r,o,i,s=2e8,a=0,l=e.top,u=e.top;for(let d=t.firstChild,h=0;d;d=d.nextSibling,h++){let t;if(1==d.nodeType)t=d.getClientRects();else{if(3!=d.nodeType)continue;t=c(d).getClientRects()}for(let c=0;c<t.length;c++){let p=t[c];if(p.top<=l&&p.bottom>=u){l=Math.max(p.bottom,l),u=Math.min(p.top,u);let t=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(t<s){n=d,s=t,r=t&&3==n.nodeType?{left:p.right<e.left?p.right:p.left,top:e.top}:e,1==d.nodeType&&t&&(a=h+(e.left>=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!o&&p.left<=e.left&&p.right>=e.left&&(o=d,i={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(a=h+1)}}return!n&&o&&(n=o,r=i,s=0),n&&3==n.nodeType?function(t,e){let n,r=t.no
vendor: 19,217 bytes, line 2
2deValue.length,o=document.createRange();for(let i=0;i<r;i++){o.setEnd(t,i+1),o.setStart(t,i);let r=W(o,1);if(r.top!=r.bottom&&q(e,r)){n={node:t,offset:i+(e.left>=(r.left+r.right)/2?1:0)};break}}return o.detach(),n||{node:t,offset:0}}(n,r):!n||s&&1==n.nodeType?{node:t,offset:a}:K(n,r)}function q(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function J(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let n=t.childNodes[i];if(1==n.nodeType){let t=n.getClientRects();for(let r=0;r<t.length;r++){let o=t[r];if(q(e,o))return J(n,e,o)}}if((i=(i+1)%r)==o)break}return t}function U(t,e){let n,r=t.dom.ownerDocument,o=0,i=function(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(p(r.offsetNode),r.offset)}}catch(r){}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(p(r.startContainer),r.startOffset)}}}(r,e.left,e.top);i&&({node:n,offset:o}=i);let s,l=(t.root.elementFromPoint?t.root:r).elementFromPoint(e.left,e.top);if(!l||!t.dom.contains(1!=l.nodeType?l.parentNode:l)){let n=t.dom.getBoundingClientRect();if(!q(e,n))return null;if(l=J(t.dom,e,n),!l)return null}if(T)for(let u=l;n&&u;u=a(u))u.draggable&&(n=void 0);if(l=function(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}(l,e),n){if(x&&1==n.nodeType&&(o=Math.min(o,n.childNodes.length),o<n.childNodes.length)){let t,r=n.childNodes[o];"IMG"==r.nodeName&&(t=r.getBoundingClientRect()).right<=e.left&&t.bottom>e.top&&o++}let r;R&&o&&1==n.nodeType&&1==(r=n.childNodes[o-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=e.top&&o--,n==t.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&e.top>n.lastChild.getBoundingClientRect().bottom?s=t.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(s=function(t,e,n,r){let o=-1;for(let i=e,s=!1;i!=t.dom;){let e,n=t.docView.nearestDesc(i,!0);if(!n)return null;if(1==n.dom.nodeType&&(n.node.isBlock&&n.parent||!n.contentDOM)&&((e=n.dom.getBoundingClientRect()).width||e.height)&&(n.node.isBlock&&n.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(n.dom.nodeName)&&(!s&&e.left>r.left||e.top>r.top?o=n.posBefore:(!s&&e.right<r.left||e.bottom<r.top)&&(o=n.posAfter),s=!0),!n.contentDOM&&o<0&&!n.node.isText))return(n.node.isBlock?r.top<(e.top+e.bottom)/2:r.left<(e.left+e.right)/2)?n.posBefore:n.posAfter;i=n.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}(t,n,o,e))}null==s&&(s=function(t,e,n){let{node:r,offset:o}=K(e,n),i=-1;if(1==r.nodeType&&!r.firstChild){let t=r.getBoundingClientRect();i=t.left!=t.right&&n.left>(t.left+t.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}(t,l,e));let c=t.docView.nearestDesc(l,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function _(t){return t.top<t.bottom||t.left<t.right}function W(t,e){let n=t.getClientRects();if(n.length){let t=n[e<0?0:n.length-1];if(_(t))return t}return Array.prototype.find.call(n,_)||t.getBoundingClientRect()}const G=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Y(t,e,n){let{node:r,offset:o,atom:i}=t.docView.domFromPos(e,n<0?-1:1),s=R||x;if(3==r.nodeType){if(!s||!G.test(r.nodeValue)&&(n<0?o:o!=r.nodeValue.length)){let t=o,e=o,i=n<0?1:-1;return n<0&&!o?(e++,i=-1):n>=0&&o==r.nodeValue.length?(t--,i=1):n<0?t--:e++,Z(W(c(r,t,e),i),i<0)}{let t=W(c(r,o,o),n);if(x&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let e=W(c(r,o-1,o-1),-1);if(e.top==t.top){let n=W(c(r,o,o+1),-1);if(n.top!=t.top)return Z(n,n.left<e.left)}}return t}}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(null==i&&o&&(n<0||o==p(r))){let t=r.childNodes[o-1];if(1==t.nodeType)return X(t.getBoundingClientRect(),!1)}if(null==i&&o<p(r)){let t=r.childNodes[o];if(1==t.nodeType)return X(t.getBoundingClientRect(),!0)}return X(r.getBoundingClientRect(),n>=0)}if(null==i&&o&&(n<0||o==p(r))){let t=r.childNodes[o-1],e=3==t.nodeType?c(t,p(t)-(s?0:1)):1!=t.nodeType||"BR"==t.nodeName&&t.nextSibling?null:t;if(e)return Z(W(e,1),!1)}if(null==i&&o<p(r)){let t=r.childNodes[o];for(;t.pmViewDesc&&t.pmViewDesc.ignoreForCoords;)t=t.nextSibling;let e=t?3==t.nodeType?c(t,0,s?0:1):1==t.nodeType?t:null:null;if(e)return Z(W(e,-1),!0)}return Z(W(3==r.nodeType?c(r):r,-n),n>=0)}function Z(t,e){if(0==t.width)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function X(t,e){if(0==t.height)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Q(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}const tt=/[\u0590-\u08ac]/;let et=null,nt=null,rt=!1;function ot(t,e,n){return et==e&&nt==n?rt:(et=e,nt=n,rt="up"==n||"down"==n?function(t,e,n){let r=e.selection,o="up"==n?r.$from:r.$to;return Q(t,e,(()=>{let{node:e}=t.docView.domFromPos(o.pos,"up"==n?-1:1);for(;;){let n=t.docView.nearestDesc(e,!0);if(!n)break;if(n.node.isBlock){e=n.contentDOM||n.dom;break}e=n.dom.parentNode}let r=Y(t,o.pos,1);for(let t=e.firstChild;t;t=t.nextSibling){let e;if(1==t.nodeType)e=t.getClientRects();else{if(3!=t.nodeType)continue;e=c(t,0,t.nodeValue.length).getClientRects()}for(let t=0;t<e.length;t++){let o=e[t];if(o.bottom>o.top+1&&("up"==n?r.top-o.top>2*(o.bottom-r.top):o.bottom-r.bottom>2*(r.bottom-o.top)))return!1}}return!0}))}(t,e,n):function(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=t.domSelection();return a?tt.test(r.parent.textContent)&&a.modify?Q(t,e,(()=>{let{focusNode:e,focusOffset:o,anchorNode:i,anchorOffset:s}=t.domSelectionRange(),l=a.caretBidiLevel;a.modify("move",n,"character");let c=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:u,focusOffset:d}=t.domSelectionRange(),h=u&&!c.contains(1==u.nodeType?u:u.parentNode)||e==u&&o==d;try{a.collapse(i,s),e&&(e!=i||o!=s)&&a.extend&&a.extend(e,o)}catch(p){}return null!=l&&(a.caretBidiLevel=l),h})):"left"==n||"backward"==n?i:s:r.pos==r.start()||r.pos==r.end()}(t,e,n))}class it{constructor(t,e,n,r){this.parent=t,this.children=e,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,e,n){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let e=0;e<this.children.length;e++)t+=this.children[e].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let e=0,n=this.posAtStart;;e++){let r=this.children[e];if(r==t)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,e,n){if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(n<0){let n,r;if(t==this.contentDOM)n=t.childNodes[e-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;n=t.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(t==this.contentDOM)n=t.childNodes[e];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;n=t.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(t==this.dom&&this.contentDOM)r=e>s(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!1;break}if(e.previousSibling)break}if(null==r&&e==t.childNodes.length)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!0;break}if(e.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(let n=!0,r=t;r;r=r.parentNode){let o,i=this.getDesc(r);if(i&&(!e||i.node)){if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==t.nodeType?t:t.parentNode):o==t))return i;n=!1}}}getDesc(t){let e=t.pmViewDesc;for(let n=e;n;n=n.parent)if(n==this)return e}posFromDOM(t,e,n){for(let r=t;r;r=r.parentNode){let o=this.getDesc(r);if(o)return o.localPosFromDOM(t,e,n)}return-1}descAt(t){for(let e=0,n=0;e<this.children.length;e++){let r=this.children[e],o=n+r.size;if(n==t&&o!=n){for(;!r.border&&r.children.length;)for(let t=0;t<r.children.length;t++){let e=r.children[t];if(e.size){r=e;break}}return r}if(t<o)return r.descAt(t-n-r.border);n=o}}domFromPos(t,e){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let n=0,r=0;for(let o=0;n<this.children.length;n++){let e=this.children[n],i=o+e.size;if(i>t||e instanceof ht){r=t-o;break}o=i}if(r)return this.children[n].domFromPos(r-this.children[n].border,e);for(let o;n&&!(o=this.children[n-1]).size&&o instanceof st&&o.side>=0;n--);if(e<=0){let t,r=!0;for(;t=n?this.children[n-1]:null,t&&t.dom.parentNode!=this.contentDOM;n--,r=!1);return t&&e&&r&&!t.border&&!t.domAtom?t.domFromPos(t.size,e):{node:this.contentDOM,offset:t?s(t.dom)+1:0}}{let t,r=!0;for(;t=n<this.children.length?this.children[n]:null,t&&t.dom.parentNode!=this.contentDOM;n++,r=!1);return t&&r&&!t.border&&!t.domAtom?t.domFromPos(0,e):{node:this.contentDOM,offset:t?s(t.dom):this.contentDOM.childNodes.length}}}parseRange(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(0==this.children.length)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,o=-1;for(let i=n,a=0;;a++){let n=this.children[a],l=i+n.size;if(-1==r&&t<=l){let o=i+n.border;if(t>=o&&e<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(t,e,o);t=i;for(let e=a;e>0;e--){let n=this.children[e-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=s(n.dom)+1;break}t-=n.size}-1==r&&(r=0)}if(r>-1&&(l>e||a==this.children.length-1)){e=l;for(let t=a+1;t<this.children.length;t++){let n=this.children[t];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){o=s(n.dom);break}e+=n.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=l}return{node:this.contentDOM,from:t,to:e,fromOffset:r,toOffset:o}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let e=this.children[t<0?0:this.children.length-1];return 0==e.size||e.emptyChildAt(t)}domAfterPos(t){let{node:e,offset:n}=this.domFromPos(t,0);if(1!=e.nodeType||n==e.childNodes.length)throw new RangeError("No node after pos "+t);return e.childNodes[n]}setSelection(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=Math.min(t,e),i=Math.max(t,e);for(let s=0,u=0;s<this.children.length;s++){let a=this.children[s],l=u+a.size;if(o>u&&i<l)return a.setSelection(t-u-a.border,e-u-a.border,n,r);u=l}let a=this.domFromPos(t,t?-1:1),l=e==t?a:this.domFromPos(e,e?-1:1),c=n.root.getSelection(),d=n.domSelectionRange(),h=!1;if((x||T)&&t==e){let{node:t,offset:e}=a;if(3==t.nodeType){if(h=!(!e||"\n"!=t.nodeValue[e-1]),h&&e==t.nodeValue.length)for(let n,r=t;r;r=r.parentNode){if(n=r.nextSibling){"BR"==n.nodeName&&(a=l={node:n.parentNode,offset:s(n)+1});break}let t=r.pmViewDesc;if(t&&t.node&&t.node.isBlock)break}}else{let n=t.childNodes[e-1];h=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(x&&d.focusNode&&d.focusNode!=l.node&&1==d.focusNode.nodeType){let t=d.focusNode.childNodes[d.focusOffset];t&&"false"==t.contentEditable&&(r=!0)}if(!(r||h&&T)&&u(a.node,a.offset,d.anchorNode,d.anchorOffset)&&u(l.node,l.offset,d.focusNode,d.focusOffset))return;let p=!1;if((c.extend||t==e)&&(!h||!x)){c.collapse(a.node,a.offset);try{t!=e&&c.extend(l.node,l.offset),p=!0}catch(f){}}if(!p){if(t>e){let t=a;a=l,l=t}let n=document.createRange();n.setEnd(l.node,l.offset),n.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,e){for(let n=0,r=0;r<this.children.length;r++){let o=this.children[r],i=n+o.size;if(n==i?t<=i&&e>=n:t<i&&e>n){let r=n+o.border,s=i-o.border;if(t>=r&&e<=s)return this.dirty=t==n||e==i?2:1,void(t!=r||e!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(t-r,e-r):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}markParentsDirty(){let t=1;for(let e=this.parent;e;e=e.parent,t++){let n=1==t?2:1;e.dirty<n&&(e.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class st extends it{constructor(t,e,n,r){let o,i=e.type.toDOM;if("function"==typeof i&&(i=i(n,(()=>o?o.parent?o.parent.posBeforeChild(o):void 0:r))),!e.type.spec.raw){if(1!=i.nodeType){let t=document.createElement("span");t.appendChild(i),i=t}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(t,[],i,null),this.widget=e,this.widget=e,o=this}matchesWidget(t){return 0==this.dirty&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let e=this.widget.spec.stopEvent;return!!e&&e(t)}ignoreMutation(t){return"selection"!=t.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class at extends it{constructor(t,e,n,r){super(t,[],e,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue}}class lt extends it{constructor(t,e,n,r,o){super(t,[],n,r),this.mark=e,this.spec=o}static create(t,e,n,r){let i=r.nodeViews[e.type.name],s=i&&i(e,r,n);return s&&s.dom||(s=o.ZF.renderSpec(document,e.type.spec.toDOM(e,n),null,e.attrs)),new lt(t,e,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(t){return 3!=this.dirty&&this.mark.eq(t)}markDirty(t,e){if(super.markDirty(t,e),0!=this.dirty){let t=this.parent;for(;!t.node;)t=t.parent;t.dirty<this.dirty&&(t.dirty=this.dirty),this.dirty=0}}slice(t,e,n){let r=lt.create(this.parent,this.mark,!0,n),o=this.children,i=this.size;e<i&&(o=xt(o,e,i,n)),t>0&&(o=xt(o,0,t,n));for(let s=0;s<o.length;s++)o[s].parent=r;return r.children=o,r}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class ct extends it{constructor(t,e,n,r,o,i,s,a,l){super(t,[],o,i),this.node=e,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s}static create(t,e,n,r,i,s){let a,l=i.nodeViews[e.type.name],c=l&&l(e,i,(()=>a?a.parent?a.parent.posBeforeChild(a):void 0:s),n,r),u=c&&c.dom,d=c&&c.contentDOM;if(e.isText)if(u){if(3!=u.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else u=document.createTextNode(e.text);else if(!u){let t=o.ZF.renderSpec(document,e.type.spec.toDOM(e),null,e.attrs);({dom:u,contentDOM:d}=t)}d||e.isText||"BR"==u.nodeName||(u.hasAttribute("contenteditable")||(u.contentEditable="false"),e.type.spec.draggable&&(u.draggable=!0));let h=u;return u=bt(u,n,e),c?a=new pt(t,e,n,r,u,d||null,h,c,i,s+1):e.isText?new dt(t,e,n,r,u,h,i):new ct(t,e,n,r,u,d||null,h,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let 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}}t.contentElement||(t.getContent=()=>o.FK.empty)}else t.contentElement=this.contentDOM;else t.getContent=()=>this.node.content;return t}matchesNode(t,e,n){return 0==this.dirty&&t.eq(this.node)&&kt(e,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,e){let n=this.node.inlineContent,r=e,i=t.composing?this.localCompositionInfo(t,e):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new Ct(this,s&&s.node,t);!function(t,e,n,r){let o=e.locals(t),i=0;if(0==o.length){for(let n=0;n<t.childCount;n++){let s=t.child(n);r(s,o,e.forChild(i,s),n),i+=s.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let u,d,h,p;for(;s<o.length&&o[s].to==i;){let t=o[s++];t.widget&&(u?(d||(d=[u])).push(t):u=t)}if(u)if(d){d.sort(At);for(let t=0;t<d.length;t++)n(d[t],c,!!l)}else n(u,c,!!l);if(l)p=-1,h=l,l=null;else{if(!(c<t.childCount))break;p=c,h=t.child(c++)}for(let t=0;t<a.length;t++)a[t].to<=i&&a.splice(t--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let f=i+h.nodeSize;if(h.isText){let t=f;s<o.length&&o[s].from<t&&(t=o[s].from);for(let e=0;e<a.length;e++)a[e].to<t&&(t=a[e].to);t<f&&(l=h.cut(t-i),h=h.cut(0,t-i),f=t,p=-1)}else for(;s<o.length&&o[s].to<f;)s++;r(h,h.isInline&&!h.isLeaf?a.filter((t=>!t.inline)):a.slice(),e.forChild(i,h),p),i=f}}(this.node,this.innerDeco,((e,i,s)=>{e.spec.marks?l.syncToMarks(e.spec.marks,n,t):e.type.side>=0&&!s&&l.syncToMarks(i==this.node.childCount?o.CU.none:this.node.child(i).marks,n,t),l.placeWidget(e,t,r)}),((e,o,s,c)=>{let u;l.syncToMarks(e.marks,n,t),l.findNodeMatch(e,o,s,c)||a&&t.state.selection.from>r&&t.state.selection.to<r+e.nodeSize&&(u=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(e,o,s,u,t)||l.updateNextNode(e,o,s,t,c,r)||l.addNode(e,o,s,t,r),r+=e.nodeSize})),l.syncToMarks([],n,t),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(s&&this.protectLocalComposition(t,s),ft(this.contentDOM,this.children,t),O&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))}localCompositionInfo(t,e){let{from:n,to:o}=t.state.selection;if(!(t.state.selection instanceof r.U3)||n<e||o>e+this.node.content.size)return null;let i=t.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let t=i.nodeValue,r=function(t,e,n,r){for(let o=0,i=0;o<t.childCount&&i<=r;){let s=t.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<t.childCount;){let e=t.child(o++);if(i+=e.nodeSize,!e.isText)break;l+=e.text}if(i>=n){if(i>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let t=a<r?l.lastIndexOf(e,r-a-1):-1;if(t>=0&&t+e.length+a>=n)return a+t;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}(this.node.content,t,n-e,o-e);return r<0?null:{node:i,pos:r,text:t}}return{node:i,pos:-1,text:""}}
vendor: 4,937 bytes, line 2
2protectLocalComposition(t,e){let{node:n,pos:r,text:o}=e;if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new at(this,i,n,o);t.input.compositionNodes.push(s),this.children=xt(this.children,r,r+o.length,t,s)}update(t,e,n,r){return!(3==this.dirty||!t.sameMarkup(this.node))&&(this.updateInner(t,e,n,r),!0)}updateInner(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(t){if(kt(t,this.outerDeco))return;let e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=vt(this.dom,this.nodeDOM,yt(this.outerDeco,this.node,e),yt(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function ut(t,e,n,r,o){bt(r,e,t);let i=new ct(void 0,t,e,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class dt extends ct{constructor(t,e,n,r,o,i,s){super(t,e,n,r,o,null,i,s,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,e,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=0,!0)}inParent(){let t=this.parent.contentDOM;for(let e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,e,n){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):super.localPosFromDOM(t,e,n)}ignoreMutation(t){return"characterData"!=t.type&&"selection"!=t.type}slice(t,e,n){let r=this.node.cut(t,e),o=document.createTextNode(r.text);return new dt(this.parent,r,this.outerDeco,this.innerDeco,o,o,n)}markDirty(t,e){super.markDirty(t,e),this.dom==this.nodeDOM||0!=t&&e!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}isText(t){return this.node.text==t}}class ht extends it{parseRule(){return{ignore:!0}}matchesHack(t){return 0==this.dirty&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class pt extends ct{constructor(t,e,n,r,o,i,s,a,l,c){super(t,e,n,r,o,i,s,l,c),this.spec=a}update(t,e,n,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let o=this.spec.update(t,e,n);return o&&this.updateInner(t,e,n,r),o}return!(!this.contentDOM&&!t.isLeaf)&&super.update(t,e,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,e,n,r){this.spec.setSelection?this.spec.setSelection(t,e,n.root):super.setSelection(t,e,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function ft(t,e,n){let r=t.firstChild,o=!1;for(let i=0;i<e.length;i++){let s=e[i],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=wt(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(a,r);if(s instanceof lt){let e=r?r.previousSibling:t.lastChild;ft(s.contentDOM,s.children,n),r=e?e.nextSibling:t.firstChild}}for(;r;)r=wt(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const mt=function(t){t&&(this.nodeName=t)};mt.prototype=Object.create(null);const gt=[new mt];function yt(t,e,n){if(0==t.length)return gt;let r=n?gt[0]:new mt,o=[r];for(let i=0;i<t.length;i++){let s=t[i].type.attrs;if(s){s.nodeName&&o.push(r=new mt(s.nodeName));for(let t in s){let i=s[t];null!=i&&(n&&1==o.length&&o.push(r=new mt(e.isInline?"span":"div")),"class"==t?r.class=(r.class?r.class+" ":"")+i:"style"==t?r.style=(r.style?r.style+";":"")+i:"nodeName"!=t&&(r[t]=i))}}}return o}function vt(t,e,n,r){if(n==gt&&r==gt)return e;let o=e;for(let i=0;i<r.length;i++){let e=r[i],s=n[i];if(i){let n;s&&s.nodeName==e.nodeName&&o!=t&&(n=o.parentNode)&&n.nodeName.toLowerCase()==e.nodeName||(n=document.createElement(e.nodeName),n.pmIsDeco=!0,n.appendChild(o),s=gt[0]),o=n}Dt(o,s||gt[0],e)}return o}function Dt(t,e,n){for(let r in e)"class"==r||"style"==r||"nodeName"==r||r in n||t.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=e[r]&&t.setAttribute(r,n[r]);
vendor: 4,553 bytes, line 2
2if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let e=0;e<r.length;e++)-1==o.indexOf(r[e])&&t.classList.remove(r[e]);for(let e=0;e<o.length;e++)-1==r.indexOf(o[e])&&t.classList.add(o[e]);0==t.classList.length&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(e.style);)t.style.removeProperty(n[1])}n.style&&(t.style.cssText+=n.style)}}function bt(t,e,n){return vt(t,t,gt,yt(e,n,1!=t.nodeType))}function kt(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function wt(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Ct{constructor(t,e,n){this.lock=e,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=function(t,e){let n=e,r=n.children.length,o=t.childCount,i=new Map,s=[];t:for(;o>0;){let a;for(;;)if(r){let t=n.children[r-1];if(!(t instanceof lt)){a=t,r--;break}n=t,r=t.children.length}else{if(n==e)break t;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}(t.node.content,t)}destroyBetween(t,e){if(t!=e){for(let n=t;n<e;n++)this.top.children[n].destroy();this.top.children.splice(t,e-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,e,n){let r=0,o=this.stack.length>>1,i=Math.min(o,t.length);for(;r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(t[r])&&!1!==t[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<t.length;){this.stack.push(this.top,this.index+1);let r=-1;for(let e=this.index;e<Math.min(this.index+3,this.top.children.length);e++){let n=this.top.children[e];if(n.matchesMark(t[o])&&!this.isLocked(n.dom)){r=e;break}}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=lt.create(this.top,t[o],e,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,o++}}findNodeMatch(t,e,n,r){let o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(t,e,n))i=this.top.children.indexOf(o,this.index);else for(let s=this.index,a=Math.min(this.top.children.length,s+5);s<a;s++){let r=this.top.children[s];if(r.matchesNode(t,e,n)&&!this.preMatch.matched.has(r)){i=s;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(t,e,n,r,o){let i=this.top.children[r];return 3==i.dirty&&i.dom==i.contentDOM&&(i.dirty=2),!!i.update(t,e,n,o)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(t){for(;;){let e=t.parentNode;if(!e)return-1;if(e==this.top.contentDOM){let e=t.pmViewDesc;if(e)for(let t=this.index;t<this.top.children.length;t++)if(this.top.children[t]==e)return t;return-1}t=e}}updateNextNode(t,e,n,r,o,i){for(let s=this.index;s<this.top.children.length;s++){let a=this.top.children[s];if(a instanceof ct){let l=this.preMatch.matched.get(a);if(null!=l&&l!=o)return!1;let c,u=a.dom,d=this.isLocked(u)&&!(t.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==t.text&&3!=a.dirty&&kt(e,a.outerDeco));if(!d&&a.update(t,e,n,r))return this.destroyBetween(this.index,s),a.dom!=u&&(this.changed=!0),this.index++,!0;if(!d&&(c=this.recreateWrapper(a,t,e,n,r,i)))return this.destroyBetween(this.index,s),this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(r,i+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,e,n,r,o,i){if(t.dirty||e.isAtom||!t.children.length||!t.node.content.eq(e.content)||!kt(n,t.outerDeco)||!r.eq(t.innerDeco))return null;let s=ct.create(this.top,e,n,r,o,i);if(s.contentDOM){s.children=t.children,t.children=[];for(let t of s.children)t.parent=s}return t.destroy(),s}addNode(t,e,n,r,o){let i=ct.create(this.top,t,e,n,r,o);i.contentDOM&&i.updateChildren(r,o+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(t,e,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(t)||t!=r.widget&&r.widget.type.toDOM.parentNode){let r=new st(this.top,t,e,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let t=this.top.children[this.index-1],e=this.top;for(;t instanceof lt;)e=t,t=e.children[e.children.length-1];
2(!t||!(t instanceof dt)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((T||S)&&t&&"false"==t.dom.contentEditable&&this.addHackNode("IMG",e),this.addHackNode("BR",this.top))}addHackNode(t,e){if(e==this.top&&this.index<e.children.length&&e.children[this.index].matchesHack(t))this.index++;else{let n=document.createElement(t);"IMG"==t&&(n.className="ProseMirror-separator",n.alt=""),"BR"==t&&(n.className="ProseMirror-trailingBreak");let r=new ht(this.top,[],n,null);e!=this.top?e.children.push(r):e.children.splice(this.index++,0,r),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||1==t.nodeType&&t.contains(this.lock.parentNode))}}function At(t,e){return t.type.side-e.type.side}function xt(t,e,n,r,o){let i=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],c=a,u=a+=l.size;c>=n||u<=e?i.push(l):(c<e&&i.push(l.slice(0,e-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(l.slice(n-c,l.size,r)))}return i}function Et(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t.domSelectionRange(),o=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),a=i&&0==i.size,l=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(l<0)return null;let c,u,d=o.resolve(l);if(m(n)){for(c=l;i&&!i.node;)i=i.parent;let t=i.node;if(i&&t.isAtom&&r.nh.isSelectable(t)&&i.parent&&(!t.isInline||!function(t,e,n){for(let r=0==e,o=e==p(t);r||o;){if(t==n)return!0;let e=s(t);if(!(t=t.parentNode))return!1;r=r&&0==e,o=o&&e==p(t)}}(n.focusNode,n.focusOffset,i.dom))){let t=i.posBefore;u=new r.nh(l==t?d:o.resolve(t))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let e=l,r=l;for(let o=0;o<n.rangeCount;o++){let i=n.getRangeAt(o);e=Math.min(e,t.docView.posFromDOM(i.startContainer,i.startOffset,1)),r=Math.max(r,t.docView.posFromDOM(i.endContainer,i.endOffset,-1))}if(e<0)return null;[c,l]=r==t.state.selection.anchor?[r,e]:[e,r],d=o.resolve(l)}else c=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let h=o.resolve(c);if(!u){u=It(t,h,d,"pointer"==e||t.state.selection.head<d.pos&&!a?1:-1)}return u}function St(t){return t.editable?t.hasFocus():Pt(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Mt(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.state.selection;if(Bt(t,n),St(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&S){let e=t.domSelectionRange(),n=t.domObserver.currentSelection;if(e.anchorNode&&n.anchorNode&&u(e.anchorNode,e.anchorOffset,n.anchorNode,n.anchorOffset))return t.input.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)!function(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r="IMG"==n.nodeName;r?e.collapse(n.parentNode,s(n)+1):e.collapse(n,0);!r&&!t.state.selection.visible&&C&&A<=11&&(n.disabled=!0,n.disabled=!1)}(t);else{let o,i,{anchor:s,head:a}=n;!Tt||n instanceof r.U3||(n.$from.parent.inlineContent||(o=Ot(t,n.from)),n.empty||n.$from.parent.inlineContent||(i=Ot(t,n.to))),t.docView.setSelection(s,a,t,e),Tt&&(o&&Nt(o),i&&Nt(i)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==o||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout((()=>{St(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Tt=T||S&&M<63;function Ot(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(T&&o&&"false"==o.contentEditable)return Ft(o);if((!o||"false"==o.contentEditable)&&(!i||"false"==i.contentEditable)){if(o)return Ft(o);if(i)return Ft(i)}}function Ft(t){return t.contentEditable="true",T&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Nt(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Bt(t,e){if(e instanceof r.nh){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Rt(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Rt(t)}function Rt(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function It(t,e,n,o){return t.someProp("createSelectionBetween",(r=>r(t,e,n)))||r.U3.between(e,n,o)}function Lt(t){return!(t.editable&&!t.hasFocus())&&Pt(t)}function Pt(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(n){return!1}}function zt(t,e){let{$anchor:n,$head:o}=t.selection,i=e>0?n.max(o):n.min(o),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&r.LN.findFrom(s,e)}function $t(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function jt(t,e,n){let o=t.state.selection;if(!(o instanceof r.U3)){if(o instanceof r.nh&&o.node.isInline)return $t(t,new r.U3(e>0?o.$to:o.$from));{let n=zt(t.state,e);return!!n&&$t(t,n)}}if(n.indexOf("s")>-1){let{$head:n}=o,i=n.textOffset?null:e<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=t.state.doc.resolve(n.pos+i.nodeSize*(e<0?-1:1));return $t(t,new r.U3(o.$anchor,s))}if(!o.empty)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){let n=zt(t.state,e);return!!(n&&n instanceof r.nh)&&$t(t,n)}if(!(F&&n.indexOf("m")>-1)){let n,i=o.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText)return!1;let a=e<0?i.pos-s.nodeSize:i.pos;return!!(s.isAtom||(n=t.docView.descAt(a))&&!n.contentDOM)&&(r.nh.isSelectable(s)?$t(t,new r.nh(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):!!R&&$t(t,new r.U3(t.state.doc.resolve(e<0?a:a+s.nodeSize))))}}function Vt(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}
vendor: 1,694 bytes, line 2
2function Ht(t,e){let n=t.pmViewDesc;return n&&0==n.size&&(e<0||t.nextSibling||"BR"!=t.nodeName)}function Kt(t,e){return e<0?function(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,a=!1;x&&1==n.nodeType&&r<Vt(n)&&Ht(n.childNodes[r],-1)&&(a=!0);for(;;)if(r>0){if(1!=n.nodeType)break;{let t=n.childNodes[r-1];if(Ht(t,-1))o=n,i=--r;else{if(3!=t.nodeType)break;n=t,r=n.nodeValue.length}}}else{if(qt(n))break;{let e=n.previousSibling;for(;e&&Ht(e,-1);)o=n.parentNode,i=s(e),e=e.previousSibling;if(e)n=e,r=Vt(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}a?Jt(t,n,r):o&&Jt(t,o,i)}(t):function(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,a=Vt(n);for(;;)if(r<a){if(1!=n.nodeType)break;if(!Ht(n.childNodes[r],1))break;o=n,i=++r}else{if(qt(n))break;{let e=n.nextSibling;for(;e&&Ht(e,1);)o=e.parentNode,i=s(e)+1,e=e.nextSibling;if(e)n=e,r=0,a=Vt(n);else{if(n=n.parentNode,n==t.dom)break;r=a=0}}}o&&Jt(t,o,i)}(t)}function qt(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Jt(t,e,n){if(3!=e.nodeType){let t,r;(r=function(t,e){for(;t&&e==t.childNodes.length&&!f(t);)e=s(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=n,e=0}}(e,n))?(e=r,n=0):(t=function(t,e){for(;t&&!e&&!f(t);)e=s(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=(t=n).childNodes.length}}(e,n))&&(e=t,n=t.nodeValue.length)}let r=t.domSelection();if(!r)return;if(m(r)){let t=document.createRange();t.setEnd(e,n),t.setStart(e,n),r.removeAllRanges(),r.addRange(t)}
2else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout((()=>{t.state==o&&Mt(t)}),50)}function Ut(t,e){let n=t.state.doc.resolve(e);if(!S&&!N&&n.parent.inlineContent){let r=t.coordsAtPos(e);if(e>n.start()){let n=t.coordsAtPos(e-1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(e<n.end()){let n=t.coordsAtPos(e+1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(t.dom).direction?"rtl":"ltr"}function _t(t,e,n){let o=t.state.selection;if(o instanceof r.U3&&!o.empty||n.indexOf("s")>-1)return!1;if(F&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=o;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let n=zt(t.state,e);if(n&&n instanceof r.nh)return $t(t,n)}if(!i.parent.inlineContent){let n=e<0?i:s,a=o instanceof r.i5?r.LN.near(n,e):r.LN.findFrom(n,e);return!!a&&$t(t,a)}return!1}function Wt(t,e){if(!(t.state.selection instanceof r.U3))return!0;let{$head:n,$anchor:o,empty:i}=t.state.selection;if(!n.sameParent(o))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let r=t.state.tr;return e<0?r.delete(n.pos-s.nodeSize,n.pos):r.delete(n.pos,n.pos+s.nodeSize),t.dispatch(r),!0}return!1}function Gt(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Yt(t,e){let n=e.keyCode,r=function(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);if(8==n||F&&72==n&&"c"==r)return Wt(t,-1)||Kt(t,-1);if(46==n&&!e.shiftKey||F&&68==n&&"c"==r)return Wt(t,1)||Kt(t,1);if(13==n||27==n)return!0;if(37==n||F&&66==n&&"c"==r){let e=37==n?"ltr"==Ut(t,t.state.selection.from)?-1:1:-1;return jt(t,e,r)||Kt(t,e)}if(39==n||F&&70==n&&"c"==r){let e=39==n?"ltr"==Ut(t,t.state.selection.from)?1:-1:1;return jt(t,e,r)||Kt(t,e)}return 38==n||F&&80==n&&"c"==r?_t(t,-1,r)||Kt(t,-1):40==n||F&&78==n&&"c"==r?function(t){if(!T||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&1==e.nodeType&&0==n&&e.firstChild&&"false"==e.firstChild.contentEditable){let n=e.firstChild;Gt(t,n,"true"),setTimeout((()=>Gt(t,n,"false")),20)}return!1}(t)||_t(t,1,r)||Kt(t,1):r==(F?"m":"c")&&(66==n||73==n||89==n||90==n)}function Zt(t,e){t.someProp("transformCopied",(n=>{e=n(e,t)}));let n=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,s--;let t=r.firstChild;n.push(t.type.name,t.attrs!=t.type.defaultAttrs?t.attrs:null),r=t.content}let a=t.someProp("clipboardSerializer")||o.ZF.fromSchema(t.state.schema),l=ae(),c=l.createElement("div");c.appendChild(a.serializeFragment(r,{document:l}));let u,d=c.firstChild,h=0;for(;d&&1==d.nodeType&&(u=ie[d.nodeName.toLowerCase()]);){for(let t=u.length-1;t>=0;t--){let e=l.createElement(u[t]);for(;c.firstChild;)e.appendChild(c.firstChild);c.appendChild(e),h++}d=c.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice","".concat(i," ").concat(s).concat(h?" -".concat(h):""," ").concat(JSON.stringify(n))),{dom:c,text:t.someProp("clipboardTextSerializer",(n=>n(e,t)))||e.content.textBetween(0,e.content.size,"\n\n"),slice:e}}function Xt(t,e,n,r,i){let s,a,l=i.parent.type.spec.code;if(!n&&!e)return null;let c=!!e&&(r||l||!n);if(c){if(t.someProp("transformPastedText",(n=>{e=n(e,l||r,t)})),l)return a=new o.Ji(o.FK.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0),t.someProp("transformPasted",(e=>{a=e(a,t,!0)})),a;let n=t.someProp("clipboardTextParser",(n=>n(e,i,r,t)));if(n)a=n;else{let n=i.marks(),{schema:r}=t.state,a=o.ZF.fromSchema(r);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((t=>{let e=s.appendChild(document.createElement("p"));t&&e.appendChild(a.serializeNode(r.text(t,n)))}))}}else t.someProp("transformPastedHTML",(e=>{n=e(n,t)})),s=function(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n,r=ae().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(t);(n=o&&ie[o[1].toLowerCase()])&&(t=n.map((t=>"<"+t+">")).join("")+t+n.map((t=>"</"+t+">")).reverse().join(""));if(r.innerHTML=function(t){let e=window.trustedTypes;if(!e)return t;le||(le=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t}));return le.createHTML(t)}(t),n)for(let i=0;i<n.length;i++)r=r.querySelector(n[i])||r;return r}(n),R&&function(t){let e=t.querySelectorAll(S?"span:not([class]):not
2([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];1==r.childNodes.length&&"\xa0"==r.textContent&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}(s);let u=s&&s.querySelector("[data-pm-slice]"),d=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let o=+d[3];o>0;o--){let t=s.firstChild;for(;t&&1!=t.nodeType;)t=t.nextSibling;if(!t)break;s=t}if(!a){let e=t.someProp("clipboardParser")||t.someProp("domParser")||o.S4.fromSchema(t.state.schema);a=e.parseSlice(s,{preserveWhitespace:!(!c&&!d),context:i,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||Qt.test(t.parentNode.nodeName)?null:{ignore:!0}})}if(d)a=function(t,e){if(!t.size)return t;let n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(l){return t}let{content:i,openStart:s,openEnd:a}=t;for(let c=n.length-2;c>=0;c-=2){let t=r.nodes[n[c]];if(!t||t.hasRequiredAttrs())break;i=o.FK.from(t.create(n[c+1],i)),s++,a++}return new o.Ji(i,s,a)}(oe(a,+d[1],+d[2]),d[4]);else if(a=o.Ji.maxOpen(function(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r,i=e.node(n).contentMatchAt(e.index(n)),s=[];if(t.forEach((t=>{if(!s)return;let e,n=i.findWrapping(t.type);if(!n)return s=null;if(e=s.length&&r.length&&ee(n,r,t,s[s.length-1],0))s[s.length-1]=e;else{s.length&&(s[s.length-1]=ne(s[s.length-1],r.length));let e=te(t,n);s.push(e),i=i.matchType(e.type),r=n}})),s)return o.FK.from(s)}return t}(a.content,i),!0),a.openStart||a.openEnd){let t=0,e=0;for(let n=a.content.firstChild;t<a.openStart&&!n.type.spec.isolating;t++,n=n.firstChild);for(let n=a.content.lastChild;e<a.openEnd&&!n.type.spec.isolating;e++,n=n.lastChild);a=oe(a,t,e)}return t.someProp("transformPasted",(e=>{a=e(a,t,c)})),a}const Qt=/^(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 te(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;for(let r=e.length-1;r>=n;r--)t=e[r].create(null,o.FK.from(t));return t}function ee(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=ee(t,e,n,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(o.FK.from(te(n,t,i+1))))}}function ne(t,e){if(0==e)return t;let n=t.content.replaceChild(t.childCount-1,ne(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(o.FK.empty,!0);return t.copy(n.append(r))}function re(t,e,n,r,i,s){let a=e<0?t.firstChild:t.lastChild,l=a.content;return t.childCount>1&&(s=0),i<r-1&&(l=re(l,e,n,r,i+1,s)),i>=n&&(l=e<0?a.contentMatchAt(0).fillBefore(l,s<=i).append(l):l.append(a.contentMatchAt(a.childCount).fillBefore(o.FK.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(l))}function oe(t,e,n){return e<t.openStart&&(t=new o.Ji(re(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new o.Ji(re(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const ie={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let se=null;function ae(){return se||(se=document.implementation.createHTMLDocument("title"))}let le=null;const ce={},ue={},de={touchstart:!0,touchmove:!0};class he{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function pe(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function fe(t){t.someProp("handleDOMEvents",(e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=e=>me(t,e))}))}function me(t,e){return t.someProp("handleDOMEvents",(n=>{let r=n[e.type];return!!r&&(r(t,e)||e.defaultPrevented)}))}function ge(t,e){if(!e.bubbles)return!0;
2if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function ye(t){return{left:t.clientX,top:t.clientY}}function ve(t,e,n,r,o){if(-1==r)return!1;let i=t.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(t.someProp(e,(e=>s>i.depth?e(t,n,i.nodeAfter,i.before(s),o,!0):e(t,n,i.node(s),i.before(s),o,!1))))return!0;return!1}function De(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function be(t,e,n,o,i){return ve(t,"handleClickOn",e,n,o)||t.someProp("handleClick",(n=>n(t,e,o)))||(i?function(t,e){if(-1==e)return!1;let n,o,i=t.state.selection;i instanceof r.nh&&(n=i.node);let s=t.state.doc.resolve(e);for(let a=s.depth+1;a>0;a--){let t=a>s.depth?s.nodeAfter:s.node(a);if(r.nh.isSelectable(t)){o=n&&i.$from.depth>0&&a>=i.$from.depth&&s.before(i.$from.depth+1)==i.$from.pos?s.before(i.$from.depth):s.before(a);break}}return null!=o&&(De(t,r.nh.create(t.state.doc,o),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;let n=t.state.doc.resolve(e),o=n.nodeAfter;return!!(o&&o.isAtom&&r.nh.isSelectable(o))&&(De(t,new r.nh(n),"pointer"),!0)}(t,n))}function ke(t,e,n,r){return ve(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(n=>n(t,e,r)))}function we(t,e,n,o){return ve(t,"handleTripleClickOn",e,n,o)||t.someProp("handleTripleClick",(n=>n(t,e,o)))||function(t,e,n){if(0!=n.button)return!1;let o=t.state.doc;if(-1==e)return!!o.inlineContent&&(De(t,r.U3.create(o,0,o.content.size),"pointer"),!0);let i=o.resolve(e);for(let s=i.depth+1;s>0;s--){let e=s>i.depth?i.nodeAfter:i.node(s),n=i.before(s);if(e.inlineContent)De(t,r.U3.create(o,n+1,n+1+e.content.size),"pointer");else{if(!r.nh.isSelectable(e))continue;De(t,r.nh.create(o,n),"pointer")}return!0}}(t,n,o)}function Ce(t){return Fe(t)}ue.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!Ee(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!B||!S||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!O||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",(e=>e(t,n)))||Yt(t,n)?n.preventDefault():pe(t,"key");else{let e=Date.now();t.input.lastIOSEnter=e,t.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{t.input.lastIOSEnter==e&&(t.someProp("handleKeyDown",(e=>e(t,g(13,"Enter")))),t.input.lastIOSEnter=0)}),200)}},ue.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},ue.keypress=(t,e)=>{let n=e;if(Ee(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||F&&n.metaKey)return;if(t.someProp("handleKeyPress",(e=>e(t,n))))return void n.preventDefault();let o=t.state.selection;if(!(o instanceof r.U3)||!o.$from.sameParent(o.$to)){let e=String.fromCharCode(n.charCode),r=()=>t.state.tr.insertText(e).scrollIntoView();/[\r\n]/.test(e)||t.someProp("handleTextInput",(n=>n(t,o.$from.pos,o.$to.pos,e,r)))||t.dispatch(r()),n.preventDefault()}};const Ae=F?"metaKey":"ctrlKey";ce.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Ce(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&function(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(n,t.input.lastClick)&&!n[Ae]&&t.input.lastClick.button==n.button&&("singleClick"==t.input.lastClick.type?i="doubleClick":"doubleClick"==t.input.lastClick.type&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i,button:n.button};let s=t.posAtCoords(ye(n));s&&("singleClick"==i?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new xe(t,s,n,!!r)):("doubleClick"==i?ke:we)(t,s.pos,s.inside,n)?n.preventDefault():pe(t,"pointer"))};class xe{constructor(t,e,n,o){let i,s;if(this.view=t,this.pos=e,this.event=n,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[Ae],this.allowDefault=n.shiftKey,e.inside>-1)i=t.state.doc.nodeAt(e.inside),s=e.inside;else{let n=t.state.doc.resolve(e.pos);i=n.parent,s=n.depth?n.before():0}const a=o?null:n.target,l=a?t.docView.nearestDesc(a,!0):null;this.target=l&&1==l.nodeDOM.nodeType?l.nodeDOM:null;let{selection:c}=t.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||c instanceof r.nh&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!x||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()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),pe(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>Mt(this.view))),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(ye(t))),this.updateAllowDefault(t),this.allowDefault||!e?pe(this.view,"pointer"):be(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||T&&this.mightDrag&&!this.mightDrag.node.isAtom||S&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(De(this.view,r.LN.near
vendor: 20,556 bytes, line 2
2(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):pe(this.view,"pointer")}move(t){this.updateAllowDefault(t),pe(this.view,"pointer"),0==t.buttons&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}function Ee(t,e){return!!t.composing||!!(T&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}ce.touchstart=t=>{t.input.lastTouch=Date.now(),Ce(t),pe(t,"pointer")},ce.touchmove=t=>{t.input.lastTouch=Date.now(),pe(t,"pointer")},ce.contextmenu=t=>Ce(t);const Se=B?5e3:-1;function Me(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout((()=>Fe(t)),e))}function Te(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Oe(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=function(t,e){for(;;){if(3==t.nodeType&&e)return t;if(1==t.nodeType&&e>0){if("false"==t.contentEditable)return null;e=p(t=t.childNodes[e-1])}else{if(!t.parentNode||f(t))return null;e=s(t),t=t.parentNode}}}(e.focusNode,e.focusOffset),r=function(t,e){for(;;){if(3==t.nodeType&&e<t.nodeValue.length)return t;if(1==t.nodeType&&e<t.childNodes.length){if("false"==t.contentEditable)return null;t=t.childNodes[e],e=0}else{if(!t.parentNode||f(t))return null;e=s(t)+1,t=t.parentNode}}}(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let e=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!e||!e.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let t=n.pmViewDesc;if(t&&t.isText(n.nodeValue))return r}}return n||r}function Fe(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(B&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Te(t),e||t.docView&&t.docView.dirty){let n=Et(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):!t.markCursor&&!e||r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.updateState(t.state):t.dispatch(t.state.tr.deleteSelection()),!0}return!1}}ue.compositionstart=ue.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof r.U3&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((t=>!1===t.type.spec.inclusive))||S&&N&&function(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||1!=e.nodeType||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return 1==r.nodeType&&"false"==r.contentEditable}(t)))t.markCursor=t.state.storedMarks||n.marks(),Fe(t,!0),t.markCursor=null;else if(Fe(t,!e.selection.empty),x&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let e=t.domSelectionRange();for(let n=e.focusNode,r=e.focusOffset;n&&1==n.nodeType&&0!=r;){let e=r<0?n.lastChild:n.childNodes[r-1];if(!e)break;if(3==e.nodeType){let n=t.domSelection();n&&n.collapse(e,e.nodeValue.length);break}n=e,r=-1}}t.input.composing=!0}Me(t,Se)},ue.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then((()=>t.domObserver.flush())),t.input.compositionID++,Me(t,20))};const Ne=C&&A<15||O&&I<604;function Be(t,e,n,r,i){let s=Xt(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",(e=>e(t,i,s||o.Ji.empty))))return!0;if(!s)return!1;let a=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(s),l=a?t.state.tr.replaceSelectionWith(a,r):t.state.tr.replaceSelection(s);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Re(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}ce.copy=ue.cut=(t,e)=>{let n=e,r=t.state.selection,o="cut"==n.type;if(r.empty)return;let i=Ne?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Zt(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):function(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},ue.paste=(t,e)=>{let n=e;if(t.composing&&!B)return;let r=Ne?null:n.clipboardData,o=t.input.shiftKey&&45!=t.input.lastKeyCode;r&&Be(t,Re(r),r.getData("text/html"),o,n)?n.preventDefault():function(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=t.input.shiftKey&&45!=t.input.lastKeyCode;setTimeout((()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Be(t,r.value,null,o,e):Be(t,r.textContent,r.innerHTML,o,e)}),50)}(t,n)};class Ie{constructor(t,e,n){this.slice=t,this.move=e,this.node=n}}const Le=F?"altKey":"ctrlKey";function Pe(t,e){let n=t.someProp("dragCopies",(t=>!t(e)));return null!=n?n:!e[Le]}ce.dragstart=(t,e)=>{let n=e,o=t.input.mouseDown;if(o&&o.done(),!n.dataTransfer)return;let i,s=t.state.selection,a=s.empty?null:t.posAtCoords(ye(n));if(a&&a.pos>=s.from&&a.pos<=(s instanceof r.nh?s.to-1:s.to));else if(o&&o.mightDrag)i=r.nh.create(t.state.doc,o.mightDrag.pos);else if(n.target&&1==n.target.nodeType){let e=t.docView.nearestDesc(n.target,!0);e&&e.node.type.spec.draggable&&e!=t.docView&&(i=r.nh.create(t.state.doc,e.posBefore))}let l=(i||t.state.selection).content(),{dom:c,text:u,slice:d}=Zt(t,l);(!n.dataTransfer.files.length||!S||M>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Ne?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",Ne||n.dataTransfer.setData("text/plain",u),t.dragging=new Ie(d,Pe(t,n),i)},ce.dragend=t=>{let e=t.dragging;window.setTimeout((()=>{t.dragging==e&&(t.dragging=null)}),50)},ue.dragover=ue.dragenter=(t,e)=>e.preventDefault(),ue.drop=(t,e)=>{try{!function(t,e,n){if(!e.dataTransfer)return;let s=t.posAtCoords(ye(e));if(!s)return;let a=t.state.doc.resolve(s.pos),l=n&&n.slice;l?t.someProp("transformPasted",(e=>{l=e(l,t,!1)})):l=Xt(t,Re(e.dataTransfer),Ne?null:e.dataTransfer.getData("text/html"),!1,a);let c=!(!n||!Pe(t,e));if(t.someProp("handleDrop",(n=>n(t,e,l||o.Ji.empty,c))))return void e.preventDefault();if(!l)return;e.preventDefault();let u=l?(0,i.Um)(t.state.doc,a.pos,l):a.pos;null==u&&(u=a.pos);let d=t.state.tr;if(c){let{node:t}=n;t?t.replace(d):d.deleteSelection()}let h=d.mapping.map(u),p=0==l.openStart&&0==l.openEnd&&1==l.content.childCount,f=d.doc;p?d.replaceRangeWith(h,h,l.content.firstChild):d.replaceRange(h,h,l);if(d.doc.eq(f))return;let m=d.doc.resolve(h);if(p&&r.nh.isSelectable(l.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(l.content.firstChild))d.setSelection(new r.nh(m));else{let e=d.mapping.map(u);d.mapping.maps[d.mapping.maps.length-1].forEach(((t,n,r,o)=>e=o)),d.setSelection(It(t,m,d.doc.resolve(e)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))}(t,e,t.dragging)}finally{t.dragging=null}},ce.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Mt(t)}),20))},ce.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},ce.beforeinput=(t,e)=>{if(S&&B&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();let{domChangeCount:e}=t.input;setTimeout((()=>{if(t.input.domChangeCount!=e)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",(e=>e(t,g(8,"Backspace")))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let Cn in ue)ce[Cn]=ue[Cn];function ze(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class $e{constructor(t,e){this.toDOM=t,this.spec=e||qe,this.side=this.spec.side||0}map(t,e,n,r){let{pos:o,deleted:i}=t.mapResult(e.from+r,this.side<0?-1:1);return i?null:new He(o-n,o-n,this)}valid(){return!0}eq(t){return this==t||t instanceof $e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&ze(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class je{constructor(t,e){this.attrs=t,this.spec=e||qe}map(t,e,n,r){let o=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,i=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new He(o,i,this)}valid(t,e){return e.from<e.to}eq(t){return this==t||t instanceof je&&ze(this.attrs,t.attrs)&&ze(this.spec,t.spec)}static is(t){return t.type instanceof je}destroy(){}}class Ve{constructor(t,e){this.attrs=t,this.spec=e||qe}map(t,e,n,r){let o=t.mapResult(e.from+r,1);if(o.deleted)return null;let i=t.mapResult(e.to+r,-1);return i.deleted||i.pos<=o.pos?null:new He(o.pos-n,i.pos-n,this)}valid(t,e){let n,{index:r,offset:o}=t.content.findIndex(e.from);return o==e.from&&!(n=t.child(r)).isText&&o+n.nodeSize==e.to}eq(t){return this==t||t instanceof Ve&&ze(this.attrs,t.attrs)&&ze(this.spec,t.spec)}destroy(){}}class He{constructor(t,e,n){this.from=t,this.to=e,this.type=n}copy(t,e){return new He(t,e,this.type)}eq(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to}map(t,e,n){return this.type.map(t,this,e,n)}static widget(t,e,n){return new He(t,t,new $e(e,n))}static inline(t,e,n,r){return new He(t,e,new je(n,r))}static node(t,e,n,r){return new He(t,e,new Ve(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof je}get widget(){return this.type instanceof $e}}const Ke=[],qe={};class Je{constructor(t,e){this.local=t.length?t:Ke,this.children=e.length?e:Ke}static create(t,e){return e.length?Ze(e,t,0,qe):Ue}find(t,e,n){let r=[];return this.findInner(null==t?0:t,null==e?1e9:e,r,0,n),r}findInner(t,e,n,r,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=e&&s.to>=t&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<e&&this.children[i+1]>t){let s=this.children[i]+1;this.children[i+2].findInner(t-s,e-s,n,r+s,o)}}map(t,e,n){return this==Ue||0==t.maps.length?this:this.mapInner(t,e,0,0,n||qe)}mapInner(t,e,n,r,o){let i;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(t,n,r);a&&a.type.valid(e,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(t,e,n,r,o,i,s){let a=t.slice();for(let c=0,u=i;c<n.maps.length;c++){let t=0;n.maps[c].forEach(((e,n,r,o)=>{let i=o-r-(n-e);for(let s=0;s<a.length;s+=3){let r=a[s+1];if(r<0||e>r+u-t)continue;let o=a[s]+u-t;n>=o?a[s+1]=e<=o?-2:-1:e>=u&&i&&(a[s]+=i,a[s+1]+=i)}t+=i})),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(-2==a[c+1]){l=!0,a[c+1]=-1;continue}let e=n.map(t[c]+i),u=e-o;if(u<0||u>=r.content.size){l=!0;continue}let d=n.map(t[c+1]+i,-1)-o,{index:h,offset:p}=r.content.findIndex(u),f=r.maybeChild(h);if(f&&p==u&&p+f.nodeSize==d){let r=a[c+2].mapInner(n,f,e+1,t[c]+i+1,s);r!=Ue?(a[c]=u,a[c+1]=d,a[c+2]=r):(a[c+1]=-2,l=!0)}else l=!0}if(l){let l=function(t,e,n,r,o,i,s){function a(t,e){for(let i=0;i<t.local.length;i++){let a=t.local[i].map(r,o,e);a?n.push(a):s.onRemove&&s.onRemove(t.local[i].spec)}for(let n=0;n<t.children.length;n+=3)a(t.children[n+2],t.children[n]+e+1)}for(let l=0;l<t.length;l+=3)-1==t[l+1]&&a(t[l+2],e[l]+i+1);return n}(a,t,e,n,o,i,s),c=Ze(l,r,0,s);e=c.local;for(let t=0;t<a.length;t+=3)a[t+1]<0&&(a.splice(t,3),t-=3);for(let t=0,e=0;t<c.children.length;t+=3){let n=c.children[t];for(;e<a.length&&a[e]<n;)e+=3;a.splice(e,0,c.children[t],c.children[t+1],c.children[t+2])}}return new Je(e.sort(Xe),a)}(this.children,i||[],t,e,n,r,o):i?new Je(i.sort(Xe),Ke):Ue}add(t,e){return e.length?this==Ue?Je.create(t,e):this.addInner(t,e,0):this}addInner(t,e,n){let r,o=0;t.forEach(((t,i)=>{let s,a=i+n;if(s=Ge(e,t,a)){for(r||(r=this.children.slice());o<r.length&&r[o]<i;)o+=3;r[o]==i?r[o+2]=r[o+2].addInner(t,s,a+1):r.splice(o,0,i,i+t.nodeSize,Ze(s,t,a+1,qe)),o+=3}}));let i=We(o?Ye(e):e,-n);for(let s=0;s<i.length;s++)i[s].type.valid(t,i[s])||i.splice(s--,1);return new Je(i.length?this.local.concat(i).sort(Xe):this.local,r||this.children)}remove(t){return 0==t.length||this==Ue?this:this.removeInner(t,0)}removeInner(t,e){let n=this.children,r=this.local;for(let o=0;o<n.length;o+=3){let r,i=n[o]+e,s=n[o+1]+e;for(let e,n=0;n<t.length;n++)(e=t[n])&&e.from>i&&e.to<s&&(t[n]=null,(r||(r=[])).push(e));if(!r)continue;n==this.children&&(n=this.children.slice());let a=n[o+2].removeInner(r,i+1);a!=Ue?n[o+2]=a:(n.splice(o,3),o-=3)}if(r.length)for(let o,i=0;i<t.length;i++)if(o=t[i])for(let t=0;t<r.length;t++)r[t].eq(o,e)&&(r==this.local&&(r=this.local.slice()),r.splice(t--,1));return n==this.children&&r==this.local?this:r.length||n.length?new Je(r,n):Ue}forChild(t,e){if(this==Ue)return this;if(e.isLeaf)return Je.empty;let n,r;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=t){this.children[s]==t&&(n=this.children[s+2]);break}let o=t+1,i=o+e.content.size;for(let s=0;s<this.local.length;s++){let t=this.local[s];if(t.from<i&&t.to>o&&t.type instanceof je){let e=Math.max(o,t.from)-o,n=Math.min(i,t.to)-o;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let t=new Je(r.sort(Xe),Ke);return n?new _e([t,n]):t}return n||Ue}eq(t){if(this==t)return!0;if(!(t instanceof Je)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(t){return Qe(this.localsInner(t))}localsInner(t){if(this==Ue)return Ke;if(t.inlineContent||!this.local.some(je.is))return this.local;let e=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof je||e.push(this.local[n]);return e}forEachSet(t){t(this)}}Je.empty=new Je([],[]),Je.removeOverlap=Qe;const Ue=Je.empty;class _e{constructor(t){this.members=t}map(t,e){const n=this.members.map((n=>n.map(t,e,qe)));return _e.from(n)}forChild(t,e){if(e.isLeaf)return Je.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(t,e);o!=Ue&&(o instanceof _e?n=n.concat(o.members):n.push(o))}return _e.from(n)}eq(t){if(!(t instanceof _e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(t){let e,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(t);if(o.length)if(e){n&&(e=e.slice(),n=!1);for(let t=0;t<o.length;t++)e.push(o[t])}else e=o}return e?Qe(n?e:e.sort(Xe)):Ke}static from(t){switch(t.length){case 0:return Ue;case 1:return t[0];default:return new _e(t.every((t=>t instanceof Je))?t:t.reduce(((t,e)=>t.concat(e instanceof Je?e:e.members)),[]))}}forEachSet(t){for(let e=0;e<this.members.length;e++)this.members[e].forEachSet(t)}}function We(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new He(o.from+e,o.to+e,o.type))}return n}function Ge(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let i,s=0;s<t.length;s++)(i=t[s])&&i.from>n&&i.to<r&&((o||(o=[])).push(i),t[s]=null);return o}function Ye(t){let e=[];for(let n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function Ze(t,e,n,r){let o=[],i=!1;e.forEach(((e,s)=>{let a=Ge(t,e,s+n);if(a){i=!0;let t=Ze(a,e,n+s+1,r);t!=Ue&&o.push(s,s+e.nodeSize,t)}}));let s=We(i?Ye(t):t,-n).sort(Xe);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||o.length?new Je(s,o):Ue}function Xe(t,e){return t.from-e.from||t.to-e.to}function Qe(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let i=e[o];if(i.from!=r.from){i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),tn(e,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),tn(e,o+1,i.copy(r.to,i.to)))}}return e}function tn(t,e,n){for(;e<t.length&&Xe(n,t[e])>0;)e++;t.splice(e,0,n)}function en(t){let e=[];return t.someProp("decorations",(n=>{let r=n(t.state);r&&r!=Ue&&e.push(r)})),t.cursorWrapper&&e.push(Je.create(t.state.doc,[t.cursorWrapper.deco])),_e.from(e)}const nn={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},rn=C&&A<=11;class on{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class sn{constructor(t,e){this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new on,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]);C&&A<=11&&t.some((t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length))?this.flushSoon():this.flush()})),rn&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,nn)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let e=0;e<t.length;e++)this.queue.push(t[e]);window.setTimeout((()=>this.flush()),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout((()=>this.suppressingSelectionUpdates=!1),50)}onSelectionChange(){if(Lt(this.view)){if(this.suppressingSelectionUpdates)return Mt(this.view);if(C&&A<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&u(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let e,n=new Set;for(let o=t.focusNode;o;o=a(o))n.add(o);for(let o=t.anchorNode;o;o=a(o))if(n.has(o)){e=o;break}let r=e&&this.view.docView.nearestDesc(e);return r&&r.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let e=this.pendingRecords();e.length&&(this.queue=[]);let n=t.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Lt(t)&&!this.ignoreSelectionChange(n),i=-1,s=-1,a=!1,l=[];
2if(t.editable)for(let r=0;r<e.length;r++){let t=this.registerMutation(e[r],l);t&&(i=i<0?t.from:Math.min(t.from,i),s=s<0?t.to:Math.max(t.to,s),t.typeOver&&(a=!0))}if(x&&l.length){let e=l.filter((t=>"BR"==t.nodeName));if(2==e.length){let[t,n]=e;t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of e){let e=r.parentNode;!e||"LI"!=e.nodeName||n&&un(t,n)==e||r.remove()}}}else if((S||T)&&l.some((t=>"BR"==t.nodeName))&&(8==t.input.lastKeyCode||46==t.input.lastKeyCode))for(let r of l)if("BR"==r.nodeName&&r.parentNode){let t=r.nextSibling;t&&1==t.nodeType&&"false"==t.contentEditable&&r.parentNode.removeChild(r)}let c=null;i<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&m(n)&&(c=Et(t))&&c.eq(r.LN.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,Mt(t),this.currentSelection.set(n),t.scrollToSelection()):(i>-1||o)&&(i>-1&&(t.docView.markDirty(i,s),function(t){if(an.has(t))return;if(an.set(t,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)){if(t.requiresGeckoHackNode=x,ln)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."),ln=!0}}(t)),this.handleDOMChange(i,s,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||Mt(t),this.currentSelection.set(n))}registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(let n=0;n<t.addedNodes.length;n++){let r=t.addedNodes[n];e.push(r),3==r.nodeType&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(t.target))return{from:n.posBefore,to:n.posAfter};let r=t.previousSibling,o=t.nextSibling;if(C&&A<=11&&t.addedNodes.length)for(let e=0;e<t.addedNodes.length;e++){let{previousSibling:n,nextSibling:i}=t.addedNodes[e];(!n||Array.prototype.indexOf.call(t.addedNodes,n)<0)&&(r=n),(!i||Array.prototype.indexOf.call(t.addedNodes,i)<0)&&(o=i)}let i=r&&r.parentNode==t.target?s(r)+1:0,a=n.localPosFromDOM(t.target,i,-1),l=o&&o.parentNode==t.target?s(o):t.target.childNodes.length;return{from:a,to:n.localPosFromDOM(t.target,l,1)}}return"attributes"==t.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=t.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let an=new WeakMap,ln=!1;function cn(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,i=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return u(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function un(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let e=t.docView.nearestDesc(n,!0);if(e&&e.node.isBlock)return n}return null}function dn(t){let e=t.pmViewDesc;if(e)return e.parseRule();if("BR"==t.nodeName&&t.parentNode){if(T&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}if(t.parentNode.lastChild==t||T&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const hn=/^(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 pn(t,e,n,i,s){let a=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let e=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,n=Et(t,e);
vendor: 10,687 bytes, line 2
2if(n&&!t.state.selection.eq(n)){if(S&&B&&13===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",(e=>e(t,g(13,"Enter")))))return;let r=t.state.tr.setSelection(n);"pointer"==e?r.setMeta("pointer",!0):"key"==e&&r.scrollIntoView(),a&&r.setMeta("composition",a),t.dispatch(r)}return}let l=t.state.doc.resolve(e),c=l.sharedDepth(n);e=l.before(c+1),n=t.state.doc.resolve(n).after(c+1);let u,d,h=t.state.selection,p=function(t,e,n){let r,{node:i,fromOffset:s,toOffset:a,from:l,to:c}=t.docView.parseRange(e,n),u=t.domSelectionRange(),d=u.anchorNode;if(d&&t.dom.contains(1==d.nodeType?d:d.parentNode)&&(r=[{node:d,offset:u.anchorOffset}],m(u)||r.push({node:u.focusNode,offset:u.focusOffset})),S&&8===t.input.lastKeyCode)for(let o=a;o>s;o--){let t=i.childNodes[o-1],e=t.pmViewDesc;if("BR"==t.nodeName&&!e){a=o;break}if(!e||e.size)break}let h=t.state.doc,p=t.someProp("domParser")||o.S4.fromSchema(t.state.schema),f=h.resolve(l),g=null,y=p.parse(i,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:s,to:a,preserveWhitespace:"pre"!=f.parent.type.whitespace||"full",findPositions:r,ruleFromNode:dn,context:f});if(r&&null!=r[0].pos){let t=r[0].pos,e=r[1]&&r[1].pos;null==e&&(e=t),g={anchor:t+l,head:e+l}}return{doc:y,sel:g,from:l,to:c}}(t,e,n),f=t.state.doc,y=f.slice(p.from,p.to);8===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime?(u=t.state.selection.to,d="end"):(u=t.state.selection.from,d="start"),t.input.lastKeyCode=null;let v=function(t,e,n,r,o){let i=t.findDiffStart(e,n);if(null==i)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if("end"==o){r-=s+Math.max(0,i-Math.min(s,a))-i}if(s<i&&t.size<e.size){let t=r<=i&&r>=s?i-r:0;i-=t,i&&i<e.size&&gn(e.textBetween(i-1,i+1))&&(i+=t?1:-1),a=i+(a-s),s=i}else if(a<i){let e=r<=i&&r>=a?i-r:0;i-=e,i&&i<t.size&&gn(t.textBetween(i-1,i+1))&&(i+=e?1:-1),s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}(y.content,p.doc.content,p.from,u,d);if(v&&t.input.domChangeCount++,(O&&t.input.lastIOSEnter>Date.now()-225||B)&&s.some((t=>1==t.nodeType&&!hn.test(t.nodeName)))&&(!v||v.endA>=v.endB)&&t.someProp("handleKeyDown",(e=>e(t,g(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(!v){if(!(i&&h instanceof r.U3&&!h.empty&&h.$head.sameParent(h.$anchor))||t.composing||p.sel&&p.sel.anchor!=p.sel.head){if(p.sel){let e=fn(t,t.state.doc,p.sel);if(e&&!e.eq(t.state.selection)){let n=t.state.tr.setSelection(e);a&&n.setMeta("composition",a),t.dispatch(n)}}return}v={start:h.from,endA:h.to,endB:h.to}}t.state.selection.from<t.state.selection.to&&v.start==v.endB&&t.state.selection instanceof r.U3&&(v.start>t.state.selection.from&&v.start<=t.state.selection.from+2&&t.state.selection.from>=p.from?v.start=t.state.selection.from:v.endA<t.state.selection.to&&v.endA>=t.state.selection.to-2&&t.state.selection.to<=p.to&&(v.endB+=t.state.selection.to-v.endA,v.endA=t.state.selection.to)),C&&A<=11&&v.endB==v.start+1&&v.endA==v.start&&v.start>p.from&&" \xa0"==p.doc.textBetween(v.start-p.from-1,v.start-p.from+1)&&(v.start--,v.endA--,v.endB--);let D=p.doc.resolveNoCache(v.start-p.from),b=p.doc.resolveNoCache(v.endB-p.from),k=f.resolve(v.start),w=D.sameParent(b)&&D.parent.inlineContent&&k.end()>=v.endA;if((O&&t.input.lastIOSEnter>Date.now()-225&&(!w||s.some((t=>"DIV"==t.nodeName||"P"==t.nodeName)))||!w&&D.pos<p.doc.content.size&&(!D.sameParent(b)||!D.parent.inlineContent)&&D.pos<b.pos&&!/\S/.test(p.doc.textBetween(D.pos,b.pos,"","")))&&t.someProp("handleKeyDown",(e=>e(t,g(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(t.state.selection.anchor>v.start&&function(t,e,n,r,o){if(n-e<=o.pos-r.pos||mn(r,!0,!1)<o.pos)return!1;let i=t.resolve(e);if(!r.parent.isTextblock){let t=i.nodeAfter;return null!=t&&n==e+t.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=t.resolve(mn(i,!0,!0));return!(!s.parent.isTextblock||s.pos>n||mn(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(f,v.start,v.endA,D,b)&&t.someProp("handleKeyDown",(e=>e(t,g(8,"Backspace")))))return void(B&&S&&t.domObserver.suppressSelectionUpdates());S&&v.endB==v.start&&(t.input.lastChromeDelete=Date.now()),B&&!w&&D.start()!=b.start()&&0==b.parentOffset&&D.depth==b.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==v.endA&&(v.endB-=2,b=p.doc.resolveNoCache(v.endB-p.from),setTimeout((()=>{t.someProp("handleKeyDown",(function(e){return e(t,g(13,"Enter"))}))}),20));let x,E=v.start,M=v.endA,T=e=>{let n=e||t.state.tr.replace(E,M,p.doc.slice(v.start-p.from,v.endB-p.from));if(p.sel){let e=fn(t,n.doc,p.sel);e&&!(S&&t.composing&&e.empty&&(v.start!=v.endB||t.input.lastChromeDelete<Date.now()-100)&&(e.head==E||e.head==n.mapping.map(M)-1)||C&&e.empty&&e.head==E)&&n.setSelection(e)}return a&&n.setMeta("composition",a),n.scrollIntoView()};if(w)if(D.pos==b.pos){C&&A<=11&&0==D.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout((()=>Mt(t)),20));let e=T(t.state.tr.delete(E,M)),n=f.resolve(v.start).marksAcross(f.resolve(v.endA));n&&e.ensureMarks(n),t.dispatch(e)}else if(v.endA==v.endB&&(x=function(t,e){let n,r,i,s=t.firstChild.marks,a=e.firstChild.marks,l=s,c=a;for(let o=0;o<a.length;o++)l=a[o].removeFromSet(l);for(let o=0;o<s.length;o++)c=s[o].removeFromSet(c);if(1==l.length&&0==c.length)r=l[0],n="add",i=t=>t.mark(r.addToSet(t.marks));else{if(0!=l.length||1!=c.length)return null;r=c[0],n="remove",i=t=>t.mark(r.removeFromSet(t.marks))}let u=[];for(let o=0;o<e.childCount;o++)u.push(i(e.child(o)));if(o.FK.from(u).eq(t))return{mark:r,type:n}}(D.parent.content.cut(D.parentOffset,b.parentOffset),k.parent.content.cut(k.parentOffset,v.endA-k.start())))){let e=T(t.state.tr);"add"==x.type?e.addMark(E,M,x.mark):e.removeMark(E,M,x.mark),t.dispatch(e)}else if(D.parent.child(D.index()).isText&&D.index()==b.index()-(b.textOffset?0:1)){let e=D.parent.textBetween(D.parentOffset,b.parentOffset),n=()=>T(t.state.tr.insertText(e,E,M));t.someProp("handleTextInput",(r=>r(t,E,M,e,n)))||t.dispatch(n())}else t.dispatch(T());else t.dispatch(T())}function fn(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:It(t,e.resolve(n.anchor),e.resolve(n.head))}function mn(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let e=t.node(r).maybeChild(t.indexAfter(r));for(;e&&!e.isLeaf;)e=e.firstChild,o++}return o}function gn(t){if(2!=t.length)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class yn{constructor(t,e){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new he,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(wn),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=bn(this),Dn(this),this.nodeViews=kn(this),this.docView=ut(this.state.doc,vn(this),en(this),this.dom,this),this.domObserver=new sn(this,((t,e,n,r)=>pn(this,t,e,n,r))),this.domObserver.start(),function(t){for(let e in ce){let n=ce[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=e=>{!ge(t,e)||me(t,e)||!t.editable&&e.type in ue||n(t,e)},de[e]?{passive:!0}:void 0)}T&&t.dom.addEventListener("input",(()=>null)),fe(t)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let e in t)this._props[e]=t[e];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&fe(this);let e=this._props;this._props=t,t.plugins&&(t.plugins.forEach(wn),this.directPlugins=t.plugins),this.updateStateInner(t.state,e)}setProps(t){let e={};for(let n in this._props)e[n]=this._props[n];e.state=this.state;for(let n in t)e[n]=t[n];this.update(e)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,e){var n;let r=this.state,o=!1,i=!1;t.storedMarks&&this.composing&&(Te(this),i=!0),this.state=t;let s=r.plugins!=t.plugins||this._props.plugins!=e.plugins;if(s||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){let t=kn(this);(function(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r})(t,this.nodeViews)&&(this.nodeViews=t,o=!0)}(s||e.handleDOMEvents!=this._props.handleDOMEvents)&&fe(this),this.editable=bn(this),Dn(this);let a=en(this),l=vn(this),c=r.plugins==t.plugins||r.doc.eq(t.doc)?t.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",d=o||!this.docView.matchesNode(t.doc,l,a);!d&&t.selection.eq(r.selection)||(i=!0);let h="preserve"==c&&i&&null==this.dom.style.overflowAnchor&&function(t){let e,n,r=t.dom.getBoundingClientRect(),o=Math.max(0,r.top);for(let i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=t.root.elementFromPoint(i,s);if(!r||r==t.dom||!t.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=o-20){e=r,n=a.top;break}}return{refDOM:e,refTop:n,stack:j(t.dom)}}(this);if(i){this.domObserver.stop();let e=d&&(C||S)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&function(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}(r.selection,t.selection);if(d){let n=S?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Oe(this)),!o&&this.docView.update(t.doc,l,a,this)||(this.docView.updateOuterDeco(l),this.docView.destroy(),this.docView=ut(t.doc,l,a,this.dom,this)),n&&!this.trackWrites&&(e=!0)}e||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return u(e.node,e.offset,n.anchorNode,n.anchorOffset)}(this))?Mt(this,e):(Bt(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():h&&function(t){let{refDOM:e,refTop:n,stack:r}=t,o=e?e.getBoundingClientRect().top:0;V(r,0==o?0:o-n)}(h)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(t&&this.dom.contains(1==t.nodeType?t:t.parentNode))if(this.someProp("handleScrollToSelection",(t=>t(this))));else if(this.state.selection instanceof r.nh){let e=this.docView.domAfterPos(this.state.selection.from);
vendor: 4,106 bytes, line 2
21==e.nodeType&&$(this,e.getBoundingClientRect(),t)}else $(this,this.coordsAtPos(this.state.selection.head,1),t);else;}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let e=0;e<this.pluginViews.length;e++){let n=this.pluginViews[e];n.update&&n.update(this,t)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let e=this.directPlugins[t];e.spec.view&&this.pluginViews.push(e.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let e=this.state.plugins[t];e.spec.view&&this.pluginViews.push(e.spec.view(this))}}}updateDraggedNode(t,e){let n=t.node,o=-1;if(this.state.doc.nodeAt(n.from)==n.node)o=n.from;else{let t=n.from+(this.state.doc.content.size-e.doc.content.size);(t>0&&this.state.doc.nodeAt(t))==n.node&&(o=t)}this.dragging=new Ie(t.slice,t.move,o<0?void 0:r.nh.create(this.state.doc,o))}someProp(t,e){let n,r=this._props&&this._props[t];if(null!=r&&(n=e?e(r):r))return n;for(let i=0;i<this.directPlugins.length;i++){let r=this.directPlugins[i].props[t];if(null!=r&&(n=e?e(r):r))return n}let o=this.state.plugins;if(o)for(let i=0;i<o.length;i++){let r=o[i].props[t];if(null!=r&&(n=e?e(r):r))return n}}hasFocus(){if(C){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if("false"==t.contentEditable)return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(t){if(t.setActive)return t.setActive();if(H)return t.focus(H);let e=j(t);t.focus(null==H?{get preventScroll(){return H={preventScroll:!0},!0}}:void 0),H||(H=!1,V(e,0))}(this.dom),Mt(this),this.domObserver.start()}get root(){let t=this._root;if(null==t)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 t||document}updateRoot(){this._root=null}posAtCoords(t){return U(this,t)}coordsAtPos(t){return Y(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)}domAtPos(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.domFromPos(t,e)}nodeDOM(t){let e=this.docView.descAt(t);return e?e.nodeDOM:null}posAtDOM(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=this.docView.posFromDOM(t,e,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(t,e){return ot(this,e||this.state,t)}pasteHTML(t,e){return Be(this,"",t,!1,e||new ClipboardEvent("paste"))}pasteText(t,e){return Be(this,t,null,!0,e||new ClipboardEvent("paste"))}serializeForClipboard(t){return Zt(this,t)}destroy(){this.docView&&(!function(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],en(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,l=null)}get isDestroyed(){return null==this.docView}dispatchEvent(t){return function(t,e){me(t,e)||!ce[e.type]||!t.editable&&e.type in ue||ce[e.type](t,e)}(this,t)}domSelectionRange(){let t=this.domSelection();return t?T&&11===this.root.nodeType&&function(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}(this.dom.ownerDocument)==this.dom&&function(t,e){if(e.getComposedRanges){let n=e.getComposedRanges(t.root)[0];if(n)return cn(t,n)}let n;function r(t){t.preventDefault(),t.stopImmediatePropagation(),n=t.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?cn(t,n):null}(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}
vendor: 1,353 bytes, lines 2-3
2domSelection(){return this.root.getSelection()}}function vn(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(t.state)),n)for(let t in n)"class"==t?e.class+=" "+n[t]:"style"==t?e.style=(e.style?e.style+";":"")+n[t]:e[t]||"contenteditable"==t||"nodeName"==t||(e[t]=String(n[t]))})),e.translate||(e.translate="no"),[He.node(0,t.state.doc.content.size,e)]}function Dn(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:He.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function bn(t){return!t.someProp("editable",(e=>!1===e(t.state)))}function kn(t){let e=Object.create(null);function n(t){for(let n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function wn(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}yn.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))}}}]); 3//# sourceMappingURL=509.8cef6bba.chunk.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.