"use strict";(globalThis.zipifyJsonp=globalThis.zipifyJsonp||[]).push([["309"],{11516:function(e,t,n){n.d(t,{Z:()=>r});function r(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}},13466:function(e,t,n){n.d(t,{Z:()=>o});var r=n(88897),i=n(92007);let o=r.hj.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(e=>""!==e).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{let t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){let e=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=(null==e?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new i.Sy({key:new i.H$("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit;if(null==i||0===i){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let t=r.tr.deleteRange(0,o-i);return e=!0,t}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta("paste"))return!1;let o=e.selection.$head.pos;return e.deleteRange(o-(i-n),o),!(this.storage.characters({node:e.doc})>n)}})]}})},138:function(e,t,n){n.d(t,{Fp:()=>r,NM:()=>o,VV:()=>i});var r=Math.max,i=Math.min,o=Math.round},14943:function(e,t,n){n.d(t,{Z:()=>r});function r(e){return e.split("-")[1]}},17824:function(e,t,n){n.d(t,{Z:()=>o});var r=n(96333),i=n(62556);let o={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},o=t.attributes[e]||{},s=t.elements[e];(0,i.Re)(s)&&(0,r.Z)(s)&&(Object.assign(s.style,n),Object.keys(o).forEach(function(e){var t=o[e];!1===t?s.removeAttribute(e):s.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var o=t.elements[e],s=t.attributes[e]||{},l=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]="",e},{});(0,i.Re)(o)&&(0,r.Z)(o)&&(Object.assign(o.style,l),Object.keys(s).forEach(function(e){o.removeAttribute(e)}))})}},requires:["computeStyles"]}},18e3:function(e,t,n){n.d(t,{Z:()=>i});var r=n(88897);let i=r.NB.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(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){let n=this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0];return[`h${n}`,(0,r.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,...{[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}}),{})},addInputRules(){return this.options.levels.map(e=>(0,r.zK)({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}})},18328:function(e,t,n){n.d(t,{Z:()=>r});function r(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}},18490:function(e,t,n){n.d(t,{ZP:()=>s});var r=n(88897);let i="textStyle",o=/^\s*([-+*])\s$/,s=r.NB.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",(0,r.P1)(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(i)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=(0,r.S0)({find:o,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=(0,r.S0)({find:o,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(i),editor:this.editor})),[e]}})},18923:function(e,t,n){n.d(t,{IB:()=>s,KI:()=>o,bw:()=>l});var r=n(83311),i=n(41084);function o(e,t=null){return function(n,o){let{$from:s,$to:l}=n.selection,a=s.blockRange(l);if(!a)return!1;let c=o?n.tr:null;return!!function(e,t,n,o=null){let s=!1,l=t,a=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&0==t.startIndex){if(0==t.$from.index(t.depth-1))return!1;let e=a.resolve(t.start-2);l=new i.Ts(e,e,t.depth),t.endIndex=0;e--)l=i.HY.from(n[e].type.create(n[e].attrs,l));e.step(new r.FC(t.start-2*!!o,t.end,t.start,t.end,new i.p2(l,0,0),n.length,!0));let a=0;for(let e=0;et.childCount>0&&t.firstChild.type==e);return!!l&&(!n||(o.node(l.depth-1).type==e?function(e,t,n,o){let s=e.tr,l=o.end,a=o.$to.end(o.depth);lr;t--)e-=s.child(t).nodeSize,o.delete(e-1,e+1);let l=o.doc.resolve(n.start),a=l.nodeAfter;if(o.mapping.map(n.end)!=n.start+l.nodeAfter.nodeSize)return!1;let c=0==n.startIndex,d=n.endIndex==s.childCount,h=l.node(-1),p=l.index(-1);if(!h.canReplace(p+ +!c,p+1,a.content.append(d?i.HY.empty:i.HY.from(s))))return!1;let u=l.pos,f=u+a.nodeSize;return o.step(new r.FC(u-!!c,f+ +!!d,u+1,f-1,new i.p2((c?i.HY.empty:i.HY.from(s.copy(i.HY.empty))).append(d?i.HY.empty:i.HY.from(s.copy(i.HY.empty))),+!c,+!d),+!c)),t(o.scrollIntoView()),!0}(t,n,l)))}}function l(e){return function(t,n){let{$from:o,$to:s}=t.selection,l=o.blockRange(s,t=>t.childCount>0&&t.firstChild.type==e);if(!l)return!1;let a=l.startIndex;if(0==a)return!1;let c=l.parent,d=c.child(a-1);if(d.type!=e)return!1;if(n){let o=d.lastChild&&d.lastChild.type==c.type,s=i.HY.from(o?e.create():null),a=new i.p2(i.HY.from(e.create(null,i.HY.from(c.type.create(null,s)))),o?3:1,0),h=l.start,p=l.end;n(t.tr.step(new r.FC(h-(o?3:1),p,h,p,a,1,!0)).scrollIntoView())}return!0}}},19892:function(e,t,n){n.d(t,{Z:()=>l});var r=n(87701),i=n(23161);function o(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function s(e){return[r.we,r.F2,r.I,r.t$].some(function(t){return e[t]>=0})}let l={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,l=t.rects.popper,a=t.modifiersData.preventOverflow,c=(0,i.Z)(t,{elementContext:"reference"}),d=(0,i.Z)(t,{altBoundary:!0}),h=o(c,r),p=o(d,l,a),u=s(h),f=s(p);t.modifiersData[n]={referenceClippingOffsets:h,popperEscapeOffsets:p,isReferenceHidden:u,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}}},20804:function(e,t,n){n.d(t,{fi:()=>f});var r=n(89188),i=n(82372),o=n(77421),s=n(36531),l=n(17824),a=n(82122),c=n(4927),d=n(5219),h=n(66896),p=n(19892),u=[i.Z,o.Z,s.Z,l.Z,a.Z,c.Z,d.Z,h.Z,p.Z],f=(0,r.kZ)({defaultModifiers:u})},21437:function(e,t,n){n.d(t,{Z:()=>v});var r=n(87701),i=n(3155),o=n(27723),s=n(7994),l=n(21955),a=n(67252),c=n(43062),d=n(62556),h=n(50400),p=n(95923),u=n(94985),f=n(96333),m=n(65626),g=n(138);function y(e,t,n){var s;return t===r.Pj?(0,m.Z)((0,i.Z)(e,n)):(0,d.kK)(t)?((s=(0,h.Z)(t,!1,"fixed"===n)).top=s.top+t.clientTop,s.left=s.left+t.clientLeft,s.bottom=s.top+t.clientHeight,s.right=s.left+t.clientWidth,s.width=t.clientWidth,s.height=t.clientHeight,s.x=s.left,s.y=s.top,s):(0,m.Z)((0,o.Z)((0,a.Z)(e)))}function v(e,t,n,r){var i,o,a=[].concat("clippingParents"===t?(i=(0,s.Z)((0,p.Z)(e)),o=["absolute","fixed"].indexOf((0,c.Z)(e).position)>=0&&(0,d.Re)(e)?(0,l.Z)(e):e,(0,d.kK)(o)?i.filter(function(e){return(0,d.kK)(e)&&(0,u.Z)(e,o)&&"body"!==(0,f.Z)(e)}):[]):[].concat(t),[n]),h=a[0],m=a.reduce(function(t,n){var i=y(e,n,r);return t.top=(0,g.Fp)(i.top,t.top),t.right=(0,g.VV)(i.right,t.right),t.bottom=(0,g.VV)(i.bottom,t.bottom),t.left=(0,g.Fp)(i.left,t.left),t},y(e,h,r));return m.width=m.right-m.left,m.height=m.bottom-m.top,m.x=m.left,m.y=m.top,m}},21834:function(e,t,n){n.d(t,{Ig:()=>w,MI:()=>b,N0:()=>T,NE:()=>s,QK:()=>k,U9:()=>A,X0:()=>C,Y_:()=>g,_M:()=>u,al:()=>a,cR:()=>d,mD:()=>O,nw:()=>D,o:()=>y,rr:()=>c,uJ:()=>I,uo:()=>M,xb:()=>x,ym:()=>R});var r=n(83311),i=n(41084),o=n(92007);let s=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function l(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("backward",e):!(n.parentOffset>0))?n:null}let a=(e,t,n)=>{let s=l(e,n);if(!s)return!1;let a=f(s);if(!a){let n=s.blockRange(),i=n&&(0,r.k9)(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let c=a.nodeBefore;if(N(e,a,t,-1))return!0;if(0==s.parent.content.size&&(p(c,"end")||o.qv.isSelectable(c)))for(let n=s.depth;;n--){let l=(0,r.dR)(e.doc,s.before(n),s.after(n),i.p2.empty);if(l&&l.slice.size1)break}return!!c.isAtom&&a.depth==s.depth-1&&(t&&t(e.tr.delete(a.pos-c.nodeSize,a.pos).scrollIntoView()),!0)},c=(e,t,n)=>{let r=l(e,n);if(!r)return!1;let i=f(r);return!!i&&h(e,i,t)},d=(e,t,n)=>{let r=m(e,n);if(!r)return!1;let i=v(r);return!!i&&h(e,i,t)};function h(e,t,n){let s=t.nodeBefore,l=t.pos-1;for(;!s.isTextblock;l--){if(s.type.spec.isolating)return!1;let e=s.lastChild;if(!e)return!1;s=e}let a=t.nodeAfter,c=t.pos+1;for(;!a.isTextblock;c++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let d=(0,r.dR)(e.doc,l,c,i.p2.empty);if(!d||d.from!=l||d instanceof r.Pu&&d.slice.size>=c-l)return!1;if(n){let t=e.tr.step(d);t.setSelection(o.Bs.create(t.doc,l)),n(t.scrollIntoView())}return!0}function p(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)break}return!1}let u=(e,t,n)=>{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;s=f(r)}let l=s&&s.nodeBefore;return!!l&&!!o.qv.isSelectable(l)&&(t&&t(e.tr.setSelection(o.qv.create(e.doc,s.pos-l.nodeSize)).scrollIntoView()),!0)};function f(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function m(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("forward",e):!(n.parentOffset{let s=m(e,n);if(!s)return!1;let l=v(s);if(!l)return!1;let a=l.nodeAfter;if(N(e,l,t,1))return!0;if(0==s.parent.content.size&&(p(a,"start")||o.qv.isSelectable(a))){let n=(0,r.dR)(e.doc,s.before(),s.after(),i.p2.empty);if(n&&n.slice.size{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset=0;t--){let n=e.node(t);if(e.index(t)+1{let n=e.selection,i=n instanceof o.qv,s;if(i){if(n.node.isTextblock||!(0,r.Mn)(e.doc,n.from))return!1;s=n.from}else if(null==(s=(0,r.GJ)(e.doc,n.from,-1)))return!1;if(t){let n=e.tr.join(s);i&&n.setSelection(o.qv.create(n.doc,s-e.doc.resolve(s).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},w=(e,t)=>{let n=e.selection,i;if(n instanceof o.qv){if(n.node.isTextblock||!(0,r.Mn)(e.doc,n.to))return!1;i=n.to}else if(null==(i=(0,r.GJ)(e.doc,n.to,1)))return!1;return t&&t(e.tr.join(i).scrollIntoView()),!0},x=(e,t)=>{let{$from:n,$to:i}=e.selection,o=n.blockRange(i),s=o&&(0,r.k9)(o);return null!=s&&(t&&t(e.tr.lift(o,s).scrollIntoView()),!0)},k=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!!n.parent.type.spec.code&&!!n.sameParent(r)&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function S(e){for(let t=0;t{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),l=S(i.contentMatchAt(s));if(!l||!i.canReplaceWith(s,s,l))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,l.createAndFill());i.setSelection(o.Y1.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},O=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof o.C1||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=S(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index(){let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if((0,r.Ax)(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let i=n.blockRange(),o=i&&(0,r.k9)(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},T=(e,t)=>{let{$from:n,to:r}=e.selection,i,s=n.sharedDepth(r);return 0!=s&&(i=n.before(s),t&&t(e.tr.setSelection(o.qv.create(e.doc,i))),!0)};function N(e,t,n,s){let l,a,c,d=t.nodeBefore,h=t.nodeAfter,u,f,m=d.type.spec.isolating||h.type.spec.isolating;if(!m&&(l=t.nodeBefore,a=t.nodeAfter,c=t.index(),l&&a&&l.type.compatibleContent(a.type)&&(!l.content.size&&t.parent.canReplace(c-1,c)?(n&&n(e.tr.delete(t.pos-l.nodeSize,t.pos).scrollIntoView()),!0):!!t.parent.canReplace(c,c+1)&&!!(a.isTextblock||(0,r.Mn)(e.doc,t.pos))&&(n&&n(e.tr.join(t.pos).scrollIntoView()),!0))))return!0;let g=!m&&t.parent.canReplace(t.index(),t.index()+1);if(g&&(u=(f=d.contentMatchAt(d.childCount)).findWrapping(h.type))&&f.matchType(u[0]||h.type).validEnd){if(n){let o=t.pos+h.nodeSize,s=i.HY.empty;for(let e=u.length-1;e>=0;e--)s=i.HY.from(u[e].create(null,s));s=i.HY.from(d.copy(s));let l=e.tr.step(new r.FC(t.pos-1,o,t.pos,o,new i.p2(s,1,0),u.length,!0)),a=l.doc.resolve(o+2*u.length);a.nodeAfter&&a.nodeAfter.type==d.type&&(0,r.Mn)(l.doc,a.pos)&&l.join(a.pos),n(l.scrollIntoView())}return!0}let y=h.type.spec.isolating||s>0&&m?null:o.Y1.findFrom(t,1),v=y&&y.$from.blockRange(y.$to),b=v&&(0,r.k9)(v);if(null!=b&&b>=t.depth)return n&&n(e.tr.lift(v,b).scrollIntoView()),!0;if(g&&p(h,"start",!0)&&p(d,"end")){let o=d,s=[];for(;s.push(o),!o.isTextblock;)o=o.lastChild;let l=h,a=1;for(;!l.isTextblock;l=l.firstChild)a++;if(o.canReplace(o.childCount,o.childCount,l.content)){if(n){let o=i.HY.empty;for(let e=s.length-1;e>=0;e--)o=i.HY.from(s[e].copy(o));n(e.tr.step(new r.FC(t.pos-s.length,t.pos+h.nodeSize,t.pos+a,t.pos+h.nodeSize-a,new i.p2(o,s.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function E(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return!!i.node(s).isTextblock&&(n&&n(t.tr.setSelection(o.Bs.create(t.doc,e<0?i.start(s):i.end(s)))),!0)}}let A=E(-1),D=E(1);function R(e,t=null){return function(n,i){let{$from:o,$to:s}=n.selection,l=o.blockRange(s),a=l&&(0,r.nd)(l,e,t);return!!a&&(i&&i(n.tr.wrap(l,a).scrollIntoView()),!0)}}function I(e,t=null){return function(n,r){let i=!1;for(let r=0;r{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(o),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r{let{$from:n,$to:i}=e.selection;if(e.selection instanceof o.qv&&e.selection.node.isBlock)return!!n.parentOffset&&!!(0,r.Ax)(e.doc,n.pos)&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let s=[],l,a,c=!1,d=!1;for(let e=n.depth;;e--){if(n.node(e).isBlock){let t;c=n.end(e)==n.pos+(n.depth-e),d=n.start(e)==n.pos-(n.depth-e),a=S(n.node(e-1).contentMatchAt(n.indexAfter(e-1)));s.unshift(t||(c&&a?{type:a}:null)),l=e;break}if(1==e)return!1;s.unshift(null)}let h=e.tr;(e.selection instanceof o.Bs||e.selection instanceof o.C1)&&h.deleteSelection();let p=h.mapping.map(n.pos),u=(0,r.Ax)(h.doc,p,s.length,s);if(u||(s[0]=a?{type:a}:null,u=(0,r.Ax)(h.doc,p,s.length,s)),h.split(p,s.length,s),!c&&d&&n.node(l).type!=a){let e=h.mapping.map(n.before(l)),t=h.doc.resolve(e);a&&n.node(l-1).canReplaceWith(t.index(),t.index()+1,a)&&h.setNodeMarkup(h.mapping.map(n.before(l)),a)}return t&&t(h.scrollIntoView()),!0}),"Mod-Enter":M,Backspace:B,"Mod-Backspace":B,"Shift-Backspace":B,Delete:z,"Mod-Delete":z,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new o.C1(e.doc))),!0)},L={"Ctrl-h":$.Backspace,"Alt-Backspace":$["Mod-Backspace"],"Ctrl-d":$.Delete,"Ctrl-Alt-Backspace":$["Mod-Delete"],"Alt-Delete":$["Mod-Delete"],"Alt-d":$["Mod-Delete"],"Ctrl-a":A,"Ctrl-e":D};for(let e in $)L[e]=$[e];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform()},21955:function(e,t,n){n.d(t,{Z:()=>h});var r=n(62057),i=n(96333),o=n(43062),s=n(62556),l=n(67313),a=n(95923),c=n(85918);function d(e){return(0,s.Re)(e)&&"fixed"!==(0,o.Z)(e).position?e.offsetParent:null}function h(e){for(var t=(0,r.Z)(e),n=d(e);n&&(0,l.Z)(n)&&"static"===(0,o.Z)(n).position;)n=d(n);return n&&("html"===(0,i.Z)(n)||"body"===(0,i.Z)(n)&&"static"===(0,o.Z)(n).position)?t:n||function(e){var t=/firefox/i.test((0,c.Z)());if(/Trident/i.test((0,c.Z)())&&(0,s.Re)(e)&&"fixed"===(0,o.Z)(e).position)return null;var n=(0,a.Z)(e);for((0,s.Zq)(n)&&(n=n.host);(0,s.Re)(n)&&0>["html","body"].indexOf((0,i.Z)(n));){var r=(0,o.Z)(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}},22225:function(e,t,n){n.d(t,{JF:()=>l});var r=n(88897),i=n(92007),o=n(45088);class s{getTextContent(e){return(0,r.Q)(e,{textSerializers:(0,r.Is)(this.editor.schema)})}constructor({editor:e,element:t,view:n,tippyOptions:r={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:e,state:t})=>{let{selection:n}=t,{$anchor:r,empty:i}=n,o=1===r.depth,s=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent&&0===r.parent.childCount&&!this.getTextContent(r.parent);return!!e.hasFocus()&&!!i&&!!o&&!!s&&!!this.editor.isEditable},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{var t;if(this.preventHide){this.preventHide=!1;return}(null==e?void 0:e.relatedTarget)&&(null==(t=this.element.parentNode)?void 0:t.contains(e.relatedTarget))||(null==e?void 0:e.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=e=>{this.blurHandler({event:e})},this.editor=e,this.element=t,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){let{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=(0,o.ZP)(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,t){var n,i,o;let{state:s}=e,{doc:l,selection:a}=s,{from:c,to:d}=a;if(!(t&&t.doc.eq(l)&&t.selection.eq(a))){if(this.createTooltip(),!(null==(n=this.shouldShow)?void 0:n.call(this,{editor:this.editor,view:e,state:s,oldState:t})))return void this.hide();null==(i=this.tippy)||i.setProps({getReferenceClientRect:(null==(o=this.tippyOptions)?void 0:o.getReferenceClientRect)||(()=>(0,r.pr)(e,c,d))}),this.show()}}show(){var e;null==(e=this.tippy)||e.show()}hide(){var e;null==(e=this.tippy)||e.hide()}destroy(){var e,t;(null==(e=this.tippy)?void 0:e.popper.firstChild)&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),null==(t=this.tippy)||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}let l=e=>new i.Sy({key:"string"==typeof e.pluginKey?new i.H$(e.pluginKey):e.pluginKey,view:t=>new s({view:t,...e})});r.hj.create({name:"floatingMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[l({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}})},23161:function(e,t,n){n.d(t,{Z:()=>p});var r=n(21437),i=n(67252),o=n(50400),s=n(72581),l=n(65626),a=n(87701),c=n(62556),d=n(63293),h=n(33706);function p(e,t){void 0===t&&(t={});var n=t,p=n.placement,u=void 0===p?e.placement:p,f=n.strategy,m=void 0===f?e.strategy:f,g=n.boundary,y=void 0===g?a.zV:g,v=n.rootBoundary,b=void 0===v?a.Pj:v,w=n.elementContext,x=void 0===w?a.k5:w,k=n.altBoundary,S=n.padding,M=void 0===S?0:S,O=(0,d.Z)("number"!=typeof M?M:(0,h.Z)(M,a.mv)),C=x===a.k5?a.YP:a.k5,T=e.rects.popper,N=e.elements[void 0!==k&&k?C:x],E=(0,r.Z)((0,c.kK)(N)?N:N.contextElement||(0,i.Z)(e.elements.popper),y,b,m),A=(0,o.Z)(e.elements.reference),D=(0,s.Z)({reference:A,element:T,strategy:"absolute",placement:u}),R=(0,l.Z)(Object.assign({},T,D)),I=x===a.k5?R:A,P={top:E.top-I.top+O.top,bottom:I.bottom-E.bottom+O.bottom,left:E.left-I.left+O.left,right:I.right-E.right+O.right},B=e.modifiersData.offset;if(x===a.k5&&B){var z=B[u];Object.keys(P).forEach(function(e){var t=[a.F2,a.I].indexOf(e)>=0?1:-1,n=[a.we,a.I].indexOf(e)>=0?"y":"x";P[e]+=z[n]*t})}return P}},23607:function(e,t,n){n.d(t,{Z:()=>r});function r(){return{top:0,right:0,bottom:0,left:0}}},23775:function(e,t,n){n.d(t,{Z:()=>s});var r=function(){};r.prototype.append=function(e){return e.length?(e=r.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},r.prototype.prepend=function(e){return e.length?r.from(e).append(this):this},r.prototype.appendInner=function(e){return new o(this,e)},r.prototype.slice=function(e,t){return(void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t)?r.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},r.prototype.get=function(e){if(!(e<0)&&!(e>=this.length))return this.getInner(e)},r.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},r.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},r.from=function(e){return e instanceof r?e:e&&e.length?new i(e):r.empty};var i=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(r);r.empty=new i([]);var o=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return ei&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)||n=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(r);let s=r},26143:function(e,t,n){n.d(t,{Z:()=>h});var r=n(50400),i=n(64782),o=n(96333),s=n(62556),l=n(4063),a=n(67252),c=n(60611),d=n(138);function h(e,t,n){void 0===n&&(n=!1);var h,p,u,f=(0,s.Re)(t),m=(0,s.Re)(t)&&(h=t.getBoundingClientRect(),p=(0,d.NM)(h.width)/t.offsetWidth||1,u=(0,d.NM)(h.height)/t.offsetHeight||1,1!==p||1!==u),g=(0,a.Z)(t),y=(0,r.Z)(e,m,n),v={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(f||!f&&!n)&&(("body"!==(0,o.Z)(t)||(0,c.Z)(g))&&(v=(0,i.Z)(t)),(0,s.Re)(t)?(b=(0,r.Z)(t,!0),b.x+=t.clientLeft,b.y+=t.clientTop):g&&(b.x=(0,l.Z)(g))),{x:y.left+v.scrollLeft-b.x,y:y.top+v.scrollTop-b.y,width:y.width,height:y.height}}},27723:function(e,t,n){n.d(t,{Z:()=>a});var r=n(67252),i=n(43062),o=n(4063),s=n(82163),l=n(138);function a(e){var t,n=(0,r.Z)(e),a=(0,s.Z)(e),c=null==(t=e.ownerDocument)?void 0:t.body,d=(0,l.Fp)(n.scrollWidth,n.clientWidth,c?c.scrollWidth:0,c?c.clientWidth:0),h=(0,l.Fp)(n.scrollHeight,n.clientHeight,c?c.scrollHeight:0,c?c.clientHeight:0),p=-a.scrollLeft+(0,o.Z)(e),u=-a.scrollTop;return"rtl"===(0,i.Z)(c||n).direction&&(p+=(0,l.Fp)(n.clientWidth,c?c.clientWidth:0)-d),{width:d,height:h,x:p,y:u}}},3:function(e,t,n){n.d(t,{Z:()=>r});function r(e){var t=e.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{});return Object.keys(t).map(function(e){return t[e]})}},30355:function(e,t,n){n.d(t,{KX:()=>w,Yw:()=>b,m8:()=>y});var r=n(23775),i=n(83311),o=n(92007);class s{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){let n,r,i,o;if(0==this.eventCount)return null;let a=this.items.length;for(;;a--)if(this.items.get(a-1).selection){--a;break}t&&(r=(n=this.remapping(a,this.items.length)).maps.length);let c=e.tr,d=[],h=[];return this.items.forEach((e,t)=>{if(!e.step){n||(r=(n=this.remapping(a,t+1)).maps.length),r--,h.push(e);return}if(n){h.push(new l(e.map));let t=e.step.map(n.slice(r)),i;t&&c.maybeStep(t).doc&&(i=c.mapping.maps[c.mapping.maps.length-1],d.push(new l(i,void 0,void 0,d.length+h.length))),r--,i&&n.appendMap(i,r)}else c.maybeStep(e.step);if(e.selection)return i=n?e.selection.map(n.slice(r)):e.selection,o=new s(this.items.slice(0,a).append(h.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:o,transform:c,selection:i}}addTransform(e,t,n,r){var i,o;let a,d=[],h=this.eventCount,p=this.items,u=!r&&p.length?p.get(p.length-1):null;for(let n=0;nc&&(i=p,o=f,i.forEach((e,t)=>{if(e.selection&&0==o--)return a=t,!1}),p=i.slice(a),h-=f),new s(p.append(d),h)}remapping(e,t){let n=new i.vs;return this.items.forEach((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(e){return 0==this.eventCount?this:new s(this.items.append(e.map(e=>new l(e))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(e=>{e.selection&&a--},r);let c=t;this.items.forEach(t=>{let r=i.getMirror(--c);if(null==r)return;o=Math.min(o,r);let s=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),d=t.selection&&t.selection.map(i.slice(c+1,r));d&&a++,n.push(new l(s,o,d))}else n.push(new l(s))},r);let d=[];for(let e=t;e500&&(h=h.compress(this.items.length-n.length)),h}emptyItemCount(){let e=0;return this.items.forEach(t=>{!t.step&&e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,i=[],o=0;return this.items.forEach((r,s)=>{if(s>=e)i.push(r),r.selection&&o++;else if(r.step){let e=r.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=r.selection&&r.selection.map(t.slice(n));a&&o++;let c=new l(s.invert(),e,a),d,h=i.length-1;(d=i.length&&i[h].merge(c))?i[h]=d:i.push(c)}}else r.map&&n--},this.items.length,0),new s(r.Z.from(i.reverse()),o)}}s.empty=new s(r.Z.empty,0);class l{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new l(t.getMap().invert(),t,this.selection)}}}class a{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}let c=20;function d(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function h(e,t){if(!e)return null;let n=[];for(let r=0;rnew a(s.empty,s.empty,null,0,-1),apply:(t,n,r)=>(function(e,t,n,r){let i=n.getMeta(m),o;if(i)return i.historyState;n.getMeta(g)&&(e=new a(e.done,e.undone,null,0,-1));let l=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(l&&l.getMeta(m))if(l.getMeta(m).redo)return new a(e.done.addTransform(n,void 0,r,f(t)),e.undone,d(n.mapping.maps),e.prevTime,e.prevComposition);else return new a(e.done,e.undone.addTransform(n,void 0,r,f(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||l&&!1===l.getMeta("addToHistory"))if(o=n.getMeta("rebased"))return new a(e.done.rebased(n,o),e.undone.rebased(n,o),h(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new a(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),h(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let i=n.getMeta("composition"),o=0==e.prevTime||!l&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i=t[i]&&(n=!0)}),n}(n,e.prevRanges)),c=l?h(e.prevRanges,n.mapping):d(n.mapping.maps);return new a(e.done.addTransform(n,o?t.selection.getBookmark():void 0,r,f(t)),s.empty,c,n.time,null==i?e.prevComposition:i)}})(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?b:"historyRedo"==n?w:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function v(e,t){return(n,r)=>{let i=m.getState(n);if(!i||0==(e?i.undone:i.done).eventCount)return!1;if(r){let o=function(e,t,n){let r=f(t),i=m.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),l=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),c=new a(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(s).setMeta(m,{redo:n,historyState:c})}(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}let b=v(!1,!0),w=v(!0,!0);v(!1,!1),v(!0,!1)},3038:function(e,t,n){n.d(t,{ZP:()=>o});var r=n(88897);let i=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,o=r.NB.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",(0,r.P1)(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[(0,r.x2)({find:i,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}})},30483:function(e,t,n){n.d(t,{Z:()=>i});var r={start:"end",end:"start"};function i(e){return e.replace(/start|end/g,function(e){return r[e]})}},30697:function(e,t,n){n.d(t,{Z:()=>i});var r={left:"right",right:"left",bottom:"top",top:"bottom"};function i(e){return e.replace(/left|right|bottom|top/g,function(e){return r[e]})}},3155:function(e,t,n){n.d(t,{Z:()=>l});var r=n(62057),i=n(67252),o=n(4063),s=n(67977);function l(e,t){var n=(0,r.Z)(e),l=(0,i.Z)(e),a=n.visualViewport,c=l.clientWidth,d=l.clientHeight,h=0,p=0;if(a){c=a.width,d=a.height;var u=(0,s.Z)();(u||!u&&"fixed"===t)&&(h=a.offsetLeft,p=a.offsetTop)}return{width:c,height:d,x:h+(0,o.Z)(e),y:p}}},32018:function(e,t,n){n.d(t,{ZP:()=>s});var r=n(88897);let i="textStyle",o=/^(\d+)\.\s$/,s=r.NB.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return 1===t?["ol",(0,r.P1)(this.options.HTMLAttributes,n),0]:["ol",(0,r.P1)(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(i)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=(0,r.S0)({find:o,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=(0,r.S0)({find:o,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(i)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}})},33706:function(e,t,n){n.d(t,{Z:()=>r});function r(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}},36531:function(e,t,n){n.d(t,{Z:()=>u});var r=n(87701),i=n(21955),o=n(62057),s=n(67252),l=n(43062),a=n(6206),c=n(14943),d=n(138),h={top:"auto",right:"auto",bottom:"auto",left:"auto"};function p(e){var t,n,a,c,p,u,f,m=e.popper,g=e.popperRect,y=e.placement,v=e.variation,b=e.offsets,w=e.position,x=e.gpuAcceleration,k=e.adaptive,S=e.roundOffsets,M=e.isFixed,O=b.x,C=void 0===O?0:O,T=b.y,N=void 0===T?0:T,E="function"==typeof S?S({x:C,y:N}):{x:C,y:N};C=E.x,N=E.y;var A=b.hasOwnProperty("x"),D=b.hasOwnProperty("y"),R=r.t$,I=r.we,P=window;if(k){var B=(0,i.Z)(m),z="clientHeight",$="clientWidth";B===(0,o.Z)(m)&&(B=(0,s.Z)(m),"static"!==(0,l.Z)(B).position&&"absolute"===w&&(z="scrollHeight",$="scrollWidth")),(y===r.we||(y===r.t$||y===r.F2)&&v===r.ut)&&(I=r.I,N-=(M&&B===P&&P.visualViewport?P.visualViewport.height:B[z])-g.height,N*=x?1:-1),(y===r.t$||(y===r.we||y===r.I)&&v===r.ut)&&(R=r.F2,C-=(M&&B===P&&P.visualViewport?P.visualViewport.width:B[$])-g.width,C*=x?1:-1)}var L=Object.assign({position:w},k&&h),V=!0===S?(t={x:C,y:N},n=(0,o.Z)(m),a=t.x,c=t.y,p=n.devicePixelRatio||1,{x:(0,d.NM)(a*p)/p||0,y:(0,d.NM)(c*p)/p||0}):{x:C,y:N};return(C=V.x,N=V.y,x)?Object.assign({},L,((f={})[I]=D?"0":"",f[R]=A?"0":"",f.transform=1>=(P.devicePixelRatio||1)?"translate("+C+"px, "+N+"px)":"translate3d("+C+"px, "+N+"px, 0)",f)):Object.assign({},L,((u={})[I]=D?N+"px":"",u[R]=A?C+"px":"",u.transform="",u))}let u={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=n.adaptive,o=n.roundOffsets,s=void 0===o||o,l={placement:(0,a.Z)(t.placement),variation:(0,c.Z)(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:void 0===r||r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,p(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:void 0===i||i,roundOffsets:s})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,p(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:s})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}}},36779:function(e,t,n){n.d(t,{q3:()=>l});var r=n(88897),i=n(92007),o=n(45088);class s{constructor({editor:e,element:t,view:n,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:e,state:t,from:n,to:i})=>{let{doc:o,selection:s}=t,{empty:l}=s,a=!o.textBetween(n,i).length&&(0,r.xh)(t.selection),c=this.element.contains(document.activeElement);return!!(e.hasFocus()||c)&&!l&&!a&&!!this.editor.isEditable},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{var t;if(this.preventHide){this.preventHide=!1;return}(null==e?void 0:e.relatedTarget)&&(null==(t=this.element.parentNode)?void 0:t.contains(e.relatedTarget))||(null==e?void 0:e.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=e=>{this.blurHandler({event:e})},this.handleDebouncedUpdate=(e,t)=>{let n=!(null==t?void 0:t.selection.eq(e.state.selection)),r=!(null==t?void 0:t.doc.eq(e.state.doc));(n||r)&&(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,n,r,t)},this.updateDelay))},this.updateHandler=(e,t,n,i)=>{var o,s,l;let{state:a,composing:c}=e,{selection:d}=a;if(c||!t&&!n)return;this.createTooltip();let{ranges:h}=d,p=Math.min(...h.map(e=>e.$from.pos)),u=Math.max(...h.map(e=>e.$to.pos));if(!(null==(o=this.shouldShow)?void 0:o.call(this,{editor:this.editor,element:this.element,view:e,state:a,oldState:i,from:p,to:u})))return void this.hide();null==(s=this.tippy)||s.setProps({getReferenceClientRect:(null==(l=this.tippyOptions)?void 0:l.getReferenceClientRect)||(()=>{if((0,r.EG)(a.selection)){let t=e.nodeDOM(p);if(t){let e=t.dataset.nodeViewWrapper?t:t.querySelector("[data-node-view-wrapper]");if(e&&(t=e.firstChild),t)return t.getBoundingClientRect()}}return(0,r.pr)(e,p,u)})}),this.show()},this.editor=e,this.element=t,this.view=n,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){let{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=(0,o.ZP)(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,t){let{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r)return void this.handleDebouncedUpdate(e,t);let i=!(null==t?void 0:t.selection.eq(e.state.selection)),o=!(null==t?void 0:t.doc.eq(e.state.doc));this.updateHandler(e,i,o,t)}show(){var e;null==(e=this.tippy)||e.show()}hide(){var e;null==(e=this.tippy)||e.hide()}destroy(){var e,t;(null==(e=this.tippy)?void 0:e.popper.firstChild)&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),null==(t=this.tippy)||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}let l=e=>new i.Sy({key:"string"==typeof e.pluginKey?new i.H$(e.pluginKey):e.pluginKey,view:t=>new s({view:t,...e})});r.hj.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[l({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}})},40583:function(e,t,n){n.d(t,{Z:()=>i});var r=n(50400);function i(e){var t=(0,r.Z)(e),n=e.offsetWidth,i=e.offsetHeight;return 1>=Math.abs(t.width-n)&&(n=t.width),1>=Math.abs(t.height-i)&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}},4063:function(e,t,n){n.d(t,{Z:()=>s});var r=n(50400),i=n(67252),o=n(82163);function s(e){return(0,r.Z)((0,i.Z)(e)).left+(0,o.Z)(e).scrollLeft}},41025:function(e,t,n){n.d(t,{h:()=>l});var r=n(62737),i=n(92007);let o="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function s(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function l(e){let t;return new i.Sy({props:{handleKeyDown:(t=function(e){let t=Object.create(null);for(let n in e)t[function(e){let t,n,r,i,s=e.split(/-(?!$)/),l=s[s.length-1];"Space"==l&&(l=" ");for(let e=0;e127)&&(o=r.ue[n.keyCode])&&o!=i){let r=t[s(o,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1})}})}},41084:function(e,t,n){n.d(t,{HY:()=>i,NB:()=>S,PW:()=>_,Ts:()=>x,V_:()=>L,ZU:()=>$,aw:()=>H,e4:()=>c,p2:()=>d,vc:()=>a});var r=n(70614);class i{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;te&&!1!==n(l,r+s,i||null,o)&&l.content.size){let i=s+1;l.nodesBetween(Math.max(0,e-i),Math.min(l.content.size,t-i),n,r+i)}s=a}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,(s,l)=>{let a=s.isText?s.text.slice(Math.max(e,l)-l,t-l):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&a||s.isTextblock)&&n&&(o?o=!1:i+=n),i+=a},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),o=1);oe)for(let i=0,o=0;oe&&((ot)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),r+=s.nodeSize),o=l}return new i(n,r)}cutByIndex(e,t){return e==t?i.empty:0==e&&t==this.content.length?this:new i(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new i(r,o)}addToStart(e){return new i([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new i(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=e){if(i==e||t>0)return s(n+1,i);return s(n,r)}r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return i.empty;if(!Array.isArray(t))throw RangeError("Invalid input for Fragment.fromJSON");return new i(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return i.empty;let t,n=0;for(let r=0;rthis.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;te.type.rank-t.type.rank),t}}a.none=[];class c extends Error{}class d{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=function e(t,n,r,i){let{index:o,offset:s}=t.findIndex(n),l=t.maybeChild(o);if(s==n||l.isText)return i&&!i.canReplace(o,o,r)?null:t.cut(0,n).append(r).append(t.cut(n));let a=e(l.content,n-s-1,r);return a&&t.replaceChild(o,l.copy(a))}(this.content,e+this.openStart,t);return n&&new d(n,this.openStart,this.openEnd)}removeBetween(e,t){return new d(function e(t,n,r){let{index:i,offset:o}=t.findIndex(n),s=t.maybeChild(i),{index:l,offset:a}=t.findIndex(r);if(o==n||s.isText){if(a!=r&&!t.child(l).isText)throw RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(r))}if(i!=l)throw RangeError("Removing non-flat range");return t.replaceChild(i,s.copy(e(s.content,n-o-1,r-o-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return d.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw RangeError("Invalid input for Slice.fromJSON");return new d(i.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new d(e,n,r)}}function h(e,t){if(!t.type.compatibleContent(e.type))throw new c("Cannot join "+t.type.name+" onto "+e.type.name)}function p(e,t,n){let r=e.node(n);return h(r,t.node(n)),r}function u(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function f(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(u(e.nodeAfter,r),o++));for(let e=o;en&&u(m(p(e,t,n+1),g(e,t,n+1)),r),f(t,null,n,r),new i(r)}d.empty=new d(i.empty,0,0);class y{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new x(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let t=e;;){let{index:e,offset:o}=t.content.findIndex(i),s=i-o;if(n.push(t,e,r+o),!s||(t=t.child(e)).isText)break;i=s-1,r+=o+1}return new y(t,n,i)}static resolveCached(e,t){let n=w.get(e);if(n)for(let e=0;er.depth)throw new c("Inserted content deeper than insertion position");if(r.depth-n.openStart!=o.depth-n.openEnd)throw new c("Inconsistent open depths");return function e(t,n,r,o){let s=t.index(o),l=t.node(o);if(s==n.index(o)&&o=0;e--)r=t.node(e).copy(i.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(r,t);return m(l,function e(t,n,r,o,s){let l=t.depth>s&&p(t,n,s+1),a=o.depth>s&&p(r,o,s+1),c=[];return f(null,t,s,c),l&&a&&n.index(s)==r.index(s)?(h(l,a),u(m(l,e(t,n,r,o,s+1)),c)):(l&&u(m(l,g(t,n,s+1)),c),f(n,r,s,c),a&&u(m(a,g(r,o,s+1)),c)),f(o,null,s,c),new i(c)}(t,e,s,n,o))}{let e=t.parent,i=e.content;return m(e,i.cut(0,t.parentOffset).append(r.content).append(i.cut(n.parentOffset)))}}(r,o,n,0)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(!(t=t.maybeChild(n)))return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(ne&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),O(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=i.empty,r=0,o=n.childCount){let s=this.contentMatchAt(e).matchFragment(n,r,o),l=s&&s.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let e=r;ee.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){let n;if(!t)throw RangeError("Invalid input for Node.fromJSON");if(t.marks){if(!Array.isArray(t.marks))throw RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=i.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,r,n);return o.type.checkAttrs(o.attrs),o}}S.prototype.text=void 0;class M extends S{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):O(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new M(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new M(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function O(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class C{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){var n;let r,i=new T(e,t);if(null==i.next)return C.empty;let o=function e(t){let n=[];do n.push(function(t){let n=[];do n.push(function(t){let n=function(t){if(t.eat("(")){let n=e(t);return t.eat(")")||t.err("Missing closing paren"),n}if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=(function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return 0==i.length&&e.err("No node type or group '"+t+"' found"),i})(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);for(;;)if(t.eat("+"))n={type:"plus",expr:n};else if(t.eat("*"))n={type:"star",expr:n};else if(t.eat("?"))n={type:"opt",expr:n};else if(t.eat("{"))n=function(e,t){let n=N(e),r=n;return e.eat(",")&&(r="}"!=e.next?N(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}(t,n);else break;return n}(t));while(t.next&&")"!=t.next&&"|"!=t.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}(t));while(t.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}(i);i.next&&i.err("Unexpected trailing text");let s=(n=function(e){let t=[[]];return i(function e(t,o){if("choice"==t.type)return t.exprs.reduce((t,n)=>t.concat(e(n,o)),[]);if("seq"==t.type)for(let r=0;;r++){let s=e(t.exprs[r],o);if(r==t.exprs.length-1)return s;i(s,o=n())}else if("star"==t.type){let s=n();return r(o,s),i(e(t.expr,s),s),[r(s)]}else if("plus"==t.type){let s=n();return i(e(t.expr,o),s),i(e(t.expr,s),s),[r(s)]}else if("opt"==t.type)return[r(o)].concat(e(t.expr,o));else if("range"==t.type){let s=o;for(let r=0;re.to=t)}}(o),r=Object.create(null),function e(t){let i=[];t.forEach(e=>{n[e].forEach(({term:e,to:t})=>{let r;if(e){for(let t=0;t{r||i.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)})}})});let o=r[t.join(",")]=new C(t.indexOf(n.length-1)>-1);for(let t=0;te.createAndFill()));for(let e=0;e=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return!function t(n){e.push(n);for(let r=0;r{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n"+e.indexOf(t.next[n].next);return r}).join("\n")}}C.empty=new C(!0);class T{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+" (in content expression '"+this.string+"')")}}function N(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function E(e,t){return t-e}function A(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:R(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new S(this,this.computeAttrs(e),i.from(t),a.setFrom(n))}createChecked(e=null,t,n){return t=i.from(t),this.checkContent(t),new S(this,this.computeAttrs(e),t,a.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=i.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),o=r&&r.fillBefore(i.empty,!0);return o?new S(this,e,t.append(o),a.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;tn[e]=new B(e,t,r));let r=t.spec.topNode||"doc";if(!n[r])throw RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw RangeError("The text node type should not have attributes");return n}}class z{constructor(e,t,n){let r;this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?(r=n.validate.split("|"),n=>{let i=null===n?"null":typeof n;if(0>r.indexOf(i))throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}):n.validate}get isRequired(){return!this.hasDefault}}class ${constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=P(e,r.attrs),this.excluded=null;let i=D(this.attrs);this.instance=i?new a(this,i):null}create(e=null){return!e&&this.instance?this.instance:new a(this,R(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach((e,i)=>n[e]=new $(e,r++,t,i)),n}removeFromSet(e){for(var t=0;t-1}}class L{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=r.Z.from(e.nodes),t.marks=r.Z.from(e.marks||{}),this.nodes=B.compile(this.spec.nodes,this),this.marks=$.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],r=t.spec.content||"",i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=C.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t}t.markSet="_"==i?null:i?V(this,i.split(" ")):""!=i&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:V(this,n.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else if(e instanceof B){if(e.schema!=this)throw RangeError("Node type from different schema used ("+e.name+")")}else throw RangeError("Invalid node type: "+e);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new M(n,n.defaultAttrs,e,a.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return S.fromJSON(this,e)}markFromJSON(e){return a.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError("Unknown node type: "+e);return t}}function V(e,t){let n=[];for(let r=0;r-1)&&n.push(s=r)}if(!s)throw SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class H{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(null!=e.tag)this.tags.push(e);else if(null!=e.style){let t=/[^=]*/.exec(e.style)[0];0>n.indexOf(t)&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new J(this,t,!1);return n.addAll(e,a.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new J(this,t,!0);return n.addAll(e,a.none,t.from,t.to),d.maxOpen(n.finish())}matchTag(e,t,n){for(let o=n?this.tags.indexOf(n)+1:0;oe.length)||61==o.charCodeAt(e.length)&&o.slice(e.length+1)==t)){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r{n(e=K(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=K(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new H(e,H.schemaRules(e)))}}let F={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},Z={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},j={ol:!0,ul:!0};function q(e,t,n){return null!=t?!!t|2*("full"===t):e&&"pre"==e.whitespace?3:-5&n}class W{constructor(e,t,n,r,i,o){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=o,this.content=[],this.activeMarks=a.none,this.match=i||(4&o?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(i.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e=this.content[this.content.length-1],t;e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))&&(e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=e.withText(e.text.slice(0,e.text.length-t[0].length)))}let t=i.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(i.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!F.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class J{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,o=q(null,t.preserveWhitespace,0)|4*!!n;i=r?new W(r.type,r.attrs,a.none,!0,t.topMatch||r.type.contentMatch,o):n?new W(null,null,a.none,!0,null,o):new W(e.schema.topNodeType,null,a.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=2&r.options?"full":this.localPreserveWS||(1&r.options)>0;if("full"===i||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(i)n="full"!==i?n.replace(/\r?\n|\r/g," "):n.replace(/\r\n?/g,"\n");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&"BR"==i.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),t),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),s;j.hasOwnProperty(o)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&j.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,n));e:if(l?l.ignore:Z.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let n,r=this.needsBlock;if(F.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let s=l&&l.skip?t:this.readStyles(e,t);s&&this.addAll(e,s),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,l,n,!1===l.consuming?s:void 0)}this.localPreserveWS=r}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1===n.consuming)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,o;if(t.node)if((o=this.parser.schema.nodes[t.node]).isLeaf)this.insertNode(o.create(t.attrs),n)||this.leafFallback(e,n);else{let e=this.enter(o,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n));else{let r=e;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(s)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=null==r?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t){let n,r;for(let t=this.open;t>=0;t--){let i=this.nodes[t],o=i.findWrapping(e);if(o&&(!n||n.length>o.length)&&(n=o,r=i,!o.length)||i.solid)break}if(!n)return null;this.sync(r);for(let e=0;e(o.type?!o.type.allowsMarkType(t.type):!Y(t.type,e))||(l=t.addToSet(l),!1)),this.nodes.push(new W(e,t,l,r,null,s)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=1);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,o=(e,s)=>{for(;e>=0;e--){let l=t[e];if(""==l){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=l&&!e.isInGroup(l))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}}function K(e){let t={};for(let n in e)t[n]=e[n];return t}function Y(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;no.indexOf(i)&&s(i))return!0}};if(s(i.contentMatch))return!0}}class _{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=G(t).createDocumentFragment());let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&Q(G(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return Q(e,t,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new _(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=U(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return U(e.marks)}}function U(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function G(e){return e.document||window.document}let X=new WeakMap;function Q(e,t,n,r){let i,o,s;if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let l=t[0],a;if("string"!=typeof l)throw RangeError("Invalid array passed to renderSpec");if(r&&(void 0===(o=X.get(r))&&X.set(r,(s=null,!function e(t){if(t&&"object"==typeof t)if(Array.isArray(t))if("string"==typeof t[0])s||(s=[]),s.push(t);else for(let n=0;n-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let c=l.indexOf(" ");c>0&&(n=l.slice(0,c),l=l.slice(c+1));let d=n?e.createElementNS(n,l):e.createElement(l),h=t[1],p=1;if(h&&"object"==typeof h&&null==h.nodeType&&!Array.isArray(h)){for(let e in p=2,h)if(null!=h[e]){let t=e.indexOf(" ");t>0?d.setAttributeNS(e.slice(0,t),e.slice(t+1),h[e]):d.setAttribute(e,h[e])}}for(let o=p;op)throw RangeError("Content hole must be the only child of its parent node");return{dom:d,contentDOM:d}}{let{dom:t,contentDOM:o}=Q(e,s,n,r);if(d.appendChild(t),o){if(i)throw RangeError("Multiple content holes");i=o}}}return{dom:d,contentDOM:i}}},43062:function(e,t,n){n.d(t,{Z:()=>i});var r=n(62057);function i(e){return(0,r.Z)(e).getComputedStyle(e)}},43557:function(e,t,n){n.d(t,{Z:()=>r});let r=n(88897).NB.create({name:"doc",topNode:!0,content:"block+"})},45088:function(e,t,n){n.d(t,{ZP:()=>j});var r=n(20804),i=n(17824),o="tippy-content",s="tippy-arrow",l="tippy-svg-arrow",a={passive:!0,capture:!0},c=function(){return document.body};function d(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function h(e,t){var n=({}).toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function p(e,t){return"function"==typeof e?e.apply(void 0,t):e}function u(e,t){var n;return 0===t?e:function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function f(e){return[].concat(e)}function m(e,t){-1===e.indexOf(t)&&e.push(t)}function g(e){return[].slice.call(e)}function y(e){return Object.keys(e).reduce(function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t},{})}function v(){return document.createElement("div")}function b(e){return["Element","Fragment"].some(function(t){return h(e,t)})}function w(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function x(e,t){e.forEach(function(e){e&&e.setAttribute("data-state",t)})}function k(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(t){e[r](t,n)})}function S(e,t){for(var n,r=t;r;){if(e.contains(r))return!0;r=null==r.getRootNode||null==(n=r.getRootNode())?void 0:n.host}return!1}var M={isTouch:!1},O=0;function C(){!M.isTouch&&(M.isTouch=!0,window.performance&&document.addEventListener("mousemove",T))}function T(){var e=performance.now();e-O<20&&(M.isTouch=!1,document.removeEventListener("mousemove",T)),O=e}function N(){var e=document.activeElement;if(e&&e._tippy&&e._tippy.reference===e){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var E="undefined"!=typeof window&&"undefined"!=typeof document&&!!window.msCrypto,A=Object.assign({appendTo:c,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),D=Object.keys(A);function R(e){var t=(e.plugins||[]).reduce(function(t,n){var r,i=n.name,o=n.defaultValue;return i&&(t[i]=void 0!==e[i]?e[i]:null!=(r=A[i])?r:o),t},{});return Object.assign({},e,t)}function I(e,t){var n,r=Object.assign({},t,{content:p(t.content,[e])},t.ignoreAttributes?{}:((n=t.plugins)?Object.keys(R(Object.assign({},A,{plugins:n}))):D).reduce(function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t},{}));return r.aria=Object.assign({},A.aria,r.aria),r.aria={expanded:"auto"===r.aria.expanded?t.interactive:r.aria.expanded,content:"auto"===r.aria.content?t.interactive?null:"describedby":r.aria.content},r}function P(e,t){e.innerHTML=t}function B(e){var t=v();return!0===e?t.className=s:(t.className=l,b(e)?t.appendChild(e):P(t,e)),t}function z(e,t){b(t.content)?(P(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?P(e,t.content):e.textContent=t.content)}function $(e){var t=e.firstElementChild,n=g(t.children);return{box:t,content:n.find(function(e){return e.classList.contains(o)}),arrow:n.find(function(e){return e.classList.contains(s)||e.classList.contains(l)}),backdrop:n.find(function(e){return e.classList.contains("tippy-backdrop")})}}function L(e){var t=v(),n=v();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=v();function i(n,r){var i=$(t),o=i.box,s=i.content,l=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),(n.content!==r.content||n.allowHTML!==r.allowHTML)&&z(s,e.props),r.arrow?l?n.arrow!==r.arrow&&(o.removeChild(l),o.appendChild(B(r.arrow))):o.appendChild(B(r.arrow)):l&&o.removeChild(l)}return r.className=o,r.setAttribute("data-state","hidden"),z(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}L.$$tippy=!0;var V=1,H=[],F=[];function Z(e,t){void 0===t&&(t={});var n,i=A.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",C,a),window.addEventListener("blur",N);var o=Object.assign({},t,{plugins:i}),s=(b(n=e)?[n]:h(n,"NodeList")?g(n):Array.isArray(n)?n:g(document.querySelectorAll(n))).reduce(function(e,t){var n=t&&function(e,t){var n,i,o,s,l,b,O,C,T=I(e,Object.assign({},A,R(y(t)))),N=!1,D=!1,P=!1,B=!1,z=[],L=u(eg,T.interactiveDebounce),Z=V++,j=(n=T.plugins).filter(function(e,t){return n.indexOf(e)===t}),q={id:Z,reference:e,popper:v(),popperInstance:null,props:T,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:j,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(o),cancelAnimationFrame(s)},setProps:function(t){if(!q.state.isDestroyed){en("onBeforeUpdate",[q,t]),ef();var n=q.props,r=I(e,Object.assign({},n,y(t),{ignoreAttributes:!0}));q.props=r,eu(),n.interactiveDebounce!==r.interactiveDebounce&&(eo(),L=u(eg,r.interactiveDebounce)),n.triggerTarget&&!r.triggerTarget?f(n.triggerTarget).forEach(function(e){e.removeAttribute("aria-expanded")}):r.triggerTarget&&e.removeAttribute("aria-expanded"),ei(),et(),K&&K(n,r),q.popperInstance&&(ew(),ek().forEach(function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})),en("onAfterUpdate",[q,t])}},setContent:function(e){q.setProps({content:e})},show:function(){var t=q.state.isVisible,n=q.state.isDestroyed,r=!q.state.isEnabled,i=M.isTouch&&!q.props.touch,o=d(q.props.duration,0,A.duration);if(!(t||n||r||i||(C||e).hasAttribute("disabled"))&&(en("onShow",[q],!1),!1!==q.props.onShow(q))){if(q.state.isVisible=!0,X()&&(J.style.visibility="visible"),et(),ec(),q.state.isMounted||(J.style.transition="none"),X()){var s,l,a,h=$(J);w([h.box,h.content],0)}O=function(){var e;if(q.state.isVisible&&!B){if(B=!0,J.offsetHeight,J.style.transition=q.props.moveTransition,X()&&q.props.animation){var t=$(J),n=t.box,r=t.content;w([n,r],o),x([n,r],"visible")}er(),ei(),m(F,q),null==(e=q.popperInstance)||e.forceUpdate(),en("onMount",[q]),q.props.animation&&X()&&eh(o,function(){q.state.isShown=!0,en("onShown",[q])})}},l=q.props.appendTo,a=C||e,(s=q.props.interactive&&l===c||"parent"===l?a.parentNode:p(l,[a])).contains(J)||s.appendChild(J),q.state.isMounted=!0,ew()}},hide:function(){var e=!q.state.isVisible,t=q.state.isDestroyed,n=!q.state.isEnabled,r=d(q.props.duration,1,A.duration);if(!e&&!t&&!n&&(en("onHide",[q],!1),!1!==q.props.onHide(q))){if(q.state.isVisible=!1,q.state.isShown=!1,B=!1,N=!1,X()&&(J.style.visibility="hidden"),eo(),ed(),et(!0),X()){var i,o=$(J),s=o.box,l=o.content;q.props.animation&&(w([s,l],r),x([s,l],"hidden"))}(er(),ei(),q.props.animation)?X()&&(i=q.unmount,eh(r,function(){!q.state.isVisible&&J.parentNode&&J.parentNode.contains(J)&&i()})):q.unmount()}},hideWithInteractivity:function(e){Q().addEventListener("mousemove",L),m(H,L),L(e)},enable:function(){q.state.isEnabled=!0},disable:function(){q.hide(),q.state.isEnabled=!1},unmount:function(){q.state.isVisible&&q.hide(),q.state.isMounted&&(ex(),ek().forEach(function(e){e._tippy.unmount()}),J.parentNode&&J.parentNode.removeChild(J),F=F.filter(function(e){return e!==q}),q.state.isMounted=!1,en("onHidden",[q]))},destroy:function(){q.state.isDestroyed||(q.clearDelayTimeouts(),q.unmount(),ef(),delete e._tippy,q.state.isDestroyed=!0,en("onDestroy",[q]))}};if(!T.render)return q;var W=T.render(q),J=W.popper,K=W.onUpdate;J.setAttribute("data-tippy-root",""),J.id="tippy-"+q.id,q.popper=J,e._tippy=q,J._tippy=q;var Y=j.map(function(e){return e.fn(q)}),_=e.hasAttribute("aria-expanded");return eu(),ei(),et(),en("onCreate",[q]),T.showOnCreate&&eS(),J.addEventListener("mouseenter",function(){q.props.interactive&&q.state.isVisible&&q.clearDelayTimeouts()}),J.addEventListener("mouseleave",function(){q.props.interactive&&q.props.trigger.indexOf("mouseenter")>=0&&Q().addEventListener("mousemove",L)}),q;function U(){var e=q.props.touch;return Array.isArray(e)?e:[e,0]}function G(){return"hold"===U()[0]}function X(){var e;return!!(null!=(e=q.props.render)&&e.$$tippy)}function Q(){var t,n,r=(C||e).parentNode;return r&&null!=(n=f(r)[0])&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function ee(e){return q.state.isMounted&&!q.state.isVisible||M.isTouch||l&&"focus"===l.type?0:d(q.props.delay,+!e,A.delay)}function et(e){void 0===e&&(e=!1),J.style.pointerEvents=q.props.interactive&&!e?"":"none",J.style.zIndex=""+q.props.zIndex}function en(e,t,n){if(void 0===n&&(n=!0),Y.forEach(function(n){n[e]&&n[e].apply(n,t)}),n){var r;(r=q.props)[e].apply(r,t)}}function er(){var t=q.props.aria;if(t.content){var n="aria-"+t.content,r=J.id;f(q.props.triggerTarget||e).forEach(function(e){var t=e.getAttribute(n);if(q.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}})}}function ei(){!_&&q.props.aria.expanded&&f(q.props.triggerTarget||e).forEach(function(t){q.props.interactive?t.setAttribute("aria-expanded",q.state.isVisible&&t===(C||e)?"true":"false"):t.removeAttribute("aria-expanded")})}function eo(){Q().removeEventListener("mousemove",L),H=H.filter(function(e){return e!==L})}function es(t){if(!M.isTouch||!P&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!(q.props.interactive&&S(J,n))){if(f(q.props.triggerTarget||e).some(function(e){return S(e,n)})){if(M.isTouch||q.state.isVisible&&q.props.trigger.indexOf("click")>=0)return}else en("onClickOutside",[q,t]);!0===q.props.hideOnClick&&(q.clearDelayTimeouts(),q.hide(),D=!0,setTimeout(function(){D=!1}),q.state.isMounted||ed())}}}function el(){P=!0}function ea(){P=!1}function ec(){var e=Q();e.addEventListener("mousedown",es,!0),e.addEventListener("touchend",es,a),e.addEventListener("touchstart",ea,a),e.addEventListener("touchmove",el,a)}function ed(){var e=Q();e.removeEventListener("mousedown",es,!0),e.removeEventListener("touchend",es,a),e.removeEventListener("touchstart",ea,a),e.removeEventListener("touchmove",el,a)}function eh(e,t){var n=$(J).box;function r(e){e.target===n&&(k(n,"remove",r),t())}if(0===e)return t();k(n,"remove",b),k(n,"add",r),b=r}function ep(t,n,r){void 0===r&&(r=!1),f(q.props.triggerTarget||e).forEach(function(e){e.addEventListener(t,n,r),z.push({node:e,eventType:t,handler:n,options:r})})}function eu(){G()&&(ep("touchstart",em,{passive:!0}),ep("touchend",ey,{passive:!0})),q.props.trigger.split(/\s+/).filter(Boolean).forEach(function(e){if("manual"!==e)switch(ep(e,em),e){case"mouseenter":ep("mouseleave",ey);break;case"focus":ep(E?"focusout":"blur",ev);break;case"focusin":ep("focusout",ev)}})}function ef(){z.forEach(function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)}),z=[]}function em(e){var t,n=!1;if(!(!q.state.isEnabled||eb(e))&&!D){var r=(null==(t=l)?void 0:t.type)==="focus";l=e,C=e.currentTarget,ei(),!q.state.isVisible&&h(e,"MouseEvent")&&H.forEach(function(t){return t(e)}),"click"===e.type&&(0>q.props.trigger.indexOf("mouseenter")||N)&&!1!==q.props.hideOnClick&&q.state.isVisible?n=!0:eS(e),"click"===e.type&&(N=!n),n&&!r&&eM(e)}}function eg(t){var n,r,i,o=t.target,s=(C||e).contains(o)||J.contains(o);("mousemove"!==t.type||!s)&&(n=ek().concat(J).map(function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:T}:null}).filter(Boolean),r=t.clientX,i=t.clientY,n.every(function(e){var t=e.popperRect,n=e.popperState,o=e.props.interactiveBorder,s=n.placement.split("-")[0],l=n.modifiersData.offset;if(!l)return!0;var a="bottom"===s?l.top.y:0,c="top"===s?l.bottom.y:0,d="right"===s?l.left.x:0,h="left"===s?l.right.x:0,p=t.top-i+a>o,u=i-t.bottom-c>o,f=t.left-r+d>o,m=r-t.right-h>o;return p||u||f||m})&&(eo(),eM(t)))}function ey(e){if(!(eb(e)||q.props.trigger.indexOf("click")>=0&&N)){if(q.props.interactive)return void q.hideWithInteractivity(e);eM(e)}}function ev(t){(!(0>q.props.trigger.indexOf("focusin"))||t.target===(C||e))&&(q.props.interactive&&t.relatedTarget&&J.contains(t.relatedTarget)||eM(t))}function eb(e){return!!M.isTouch&&G()!==e.type.indexOf("touch")>=0}function ew(){ex();var t=q.props,n=t.popperOptions,i=t.placement,o=t.offset,s=t.getReferenceClientRect,l=t.moveTransition,a=X()?$(J).arrow:null,c=s?{getBoundingClientRect:s,contextElement:s.contextElement||C||e}:e,d=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!l}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(X()){var n=$(J).box;["placement","reference-hidden","escaped"].forEach(function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)}),t.attributes.popper={}}}}];X()&&a&&d.push({name:"arrow",options:{element:a,padding:3}}),d.push.apply(d,(null==n?void 0:n.modifiers)||[]),q.popperInstance=(0,r.fi)(c,J,Object.assign({},n,{placement:i,onFirstUpdate:O,modifiers:d}))}function ex(){q.popperInstance&&(q.popperInstance.destroy(),q.popperInstance=null)}function ek(){return g(J.querySelectorAll("[data-tippy-root]"))}function eS(e){q.clearDelayTimeouts(),e&&en("onTrigger",[q,e]),ec();var t=ee(!0),n=U(),r=n[0],o=n[1];M.isTouch&&"hold"===r&&o&&(t=o),t?i=setTimeout(function(){q.show()},t):q.show()}function eM(e){if(q.clearDelayTimeouts(),en("onUntrigger",[q,e]),!q.state.isVisible)return void ed();if(!(q.props.trigger.indexOf("mouseenter")>=0&&q.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0)||!N){var t=ee(!1);t?o=setTimeout(function(){q.state.isVisible&&q.hide()},t):s=requestAnimationFrame(function(){q.hide()})}}}(t,o);return n&&e.push(n),e},[]);return b(e)?s[0]:s}Z.defaultProps=A,Z.setDefaultProps=function(e){Object.keys(e).forEach(function(t){A[t]=e[t]})},Z.currentInput=M,Object.assign({},i.Z,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),Z.setDefaultProps({render:L});let j=Z},45901:function(e,t,n){n.d(t,{tk:()=>tF});var r=n(92007),i=n(41084),o=n(83311);let s=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},l=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},a=null,c=function(e,t,n){let r=a||(a=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},d=function(){a=null},h=function(e,t,n,r){return n&&(u(e,t,n,r,-1)||u(e,t,n,r,1))},p=/^(img|br|input|textarea|hr)$/i;function u(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:f(e))){let n=e.parentNode;if(!n||1!=n.nodeType||m(e)||p.test(e.nodeName)||"false"==e.contentEditable)return!1;t=s(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType||"false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?f(e):0}}}function f(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function m(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}let g=function(e){return e.focusNode&&h(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function y(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}let v="undefined"!=typeof navigator?navigator:null,b="undefined"!=typeof document?document:null,w=v&&v.userAgent||"",x=/Edge\/(\d+)/.exec(w),k=/MSIE \d/.exec(w),S=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(w),M=!!(k||S||x),O=k?document.documentMode:S?+S[1]:x?+x[1]:0,C=!M&&/gecko\/(\d+)/i.test(w);C&&(/Firefox\/(\d+)/.exec(w)||[0,0])[1];let T=!M&&/Chrome\/(\d+)/.exec(w),N=!!T,E=T?+T[1]:0,A=!M&&!!v&&/Apple Computer/.test(v.vendor),D=A&&(/Mobile\/\w+/.test(w)||!!v&&v.maxTouchPoints>2),R=D||!!v&&/Mac/.test(v.platform),I=!!v&&/Win/.test(v.platform),P=/Android \d/.test(w),B=!!b&&"webkitFontSmoothing"in b.documentElement.style,z=B?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function $(e,t){return"number"==typeof e?e:e[t]}function L(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(1!=s.nodeType){s=l(s);continue}let e=s,n=e==o.body,a=n?function(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}(o):function(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}(e),c=0,d=0;if(t.topa.bottom-$(r,"bottom")&&(d=t.bottom-t.top>a.bottom-a.top?t.top+$(i,"top")-a.top:t.bottom-a.bottom+$(i,"bottom")),t.lefta.right-$(r,"right")&&(c=t.right-a.right+$(i,"right")),c||d)if(n)o.defaultView.scrollBy(c,d);else{let n=e.scrollLeft,r=e.scrollTop;d&&(e.scrollTop+=d),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,o=e.scrollTop-r;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}let h=n?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(h))break;s="absolute"==h?s.offsetParent:l(s)}}function V(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=l(r));return t}function H(e,t){for(let n=0;n=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function j(e){return e.top=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,K(q(c(r,e,t),o),o<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(null==o&&i&&(n<0||i==f(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return Y(e.getBoundingClientRect(),!1)}if(null==o&&i=0)}if(null==o&&i&&(n<0||i==f(r))){let e=r.childNodes[i-1],t=3==e.nodeType?c(e,f(e)-!s):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return K(q(t,1),!1)}if(null==o&&i=0)}function K(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Y(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function _(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}let U=/[\u0590-\u08ac]/,G=null,X=null,Q=!1;class ee{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;ts(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),o;if(i&&(!t||i.node))if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return i;else n=!1}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return -1}descAt(e){for(let t=0,n=0;te||i instanceof el){r=e-t;break}t=o}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof et&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;(e=n?this.children[n-1]:null)&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?s(e.dom)+1:0}}{let e,r=!0;for(;(e=n=i&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=l;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=s(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(a>t||l==this.children.length-1)){t=a;for(let e=l+1;el&&ot){let e=l;l=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r=n:en){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s){this.dirty=e==n||t==o?2:1,e==r&&t==s&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=3:i.markDirty(e-r,t-r);return}i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirtyi?i.parent?i.parent.posBeforeChild(i):void 0:r)),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class en extends ee{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class er extends ee{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(e,t,n,r){let o=r.nodeViews[t.type.name],s=o&&o(t,r,n);return s&&s.dom||(s=i.PW.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new er(e,t,s.dom,s.contentDOM||s.dom,s)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty0&&(i=ev(i,0,e,n));for(let e=0;ea?a.parent?a.parent.posBeforeChild(a):void 0:s,n,r),d=c&&c.dom,h=c&&c.contentDOM;if(t.isText)if(d){if(3!=d.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else d=document.createTextNode(t.text);else if(!d){let e=i.PW.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:d,contentDOM:h}=e)}h||t.isText||"BR"==d.nodeName||(d.hasAttribute("contenteditable")||(d.contentEditable="false"),t.type.spec.draggable&&(d.draggable=!0));let p=d;return(d=eu(d,n,t),c)?a=new ea(e,t,n,r,d,h||null,p,c,o,s+1):t.isText?new es(e,t,n,r,d,p,o):new ei(e,t,n,r,d,h||null,p,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>i.HY.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&ef(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,o=e.composing?this.localCompositionInfo(e,t):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,a=new eg(this,s&&s.node,e);(function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;no;)l.push(i[s++]);let f=o+p.nodeSize;if(p.isText){let e=f;s!e.inline):l.slice();r(p,m,t.forChild(o,p),u),o=f}})(this.node,this.innerDeco,(t,o,s)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!s&&a.syncToMarks(o==this.node.childCount?i.vc.none:this.node.child(o).marks,n,e),a.placeWidget(t,e,r)},(t,i,s,c)=>{let d;a.syncToMarks(t.marks,n,e),a.findNodeMatch(t,i,s,c)||l&&e.state.selection.from>r&&e.state.selection.to-1&&a.updateNodeAt(t,i,s,d,e)||a.updateNextNode(t,i,s,e,c,r)||a.addNode(t,i,s,e,r),r+=t.nodeSize}),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(s&&this.protectLocalComposition(e,s),function e(t,n,r){let i=t.firstChild,o=!1;for(let s=0;st+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(!this.node.inlineContent)return{node:o,pos:-1,text:""};{let e=o.nodeValue,r=function(e,t,n,r){for(let i=0,o=0;i=n){if(o>=r&&a.slice(r-t.length-l,r-l)==t)return r-t.length;let e=l=0&&e+t.length+l>=n)return l+e;if(n==r&&a.length>=r+t.length-l&&a.slice(r-l,r-l+t.length)==t)return r}}return -1}(this.node.content,e,n-t,i-t);return r<0?null:{node:o,pos:r,text:e}}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new en(this,i,t,r);e.input.compositionNodes.push(o),this.children=ev(this.children,n,n+r.length,e,o)}update(e,t,n,r){return 3!=this.dirty&&!!e.sameMarkup(this.node)&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(ef(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=ep(this.dom,this.nodeDOM,eh(this.outerDeco,this.node,t),eh(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function eo(e,t,n,r,i){eu(r,t,e);let o=new ei(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class es extends ei{constructor(e,t,n,r,i,o,s){super(e,t,n,r,i,null,o,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return 3!=this.dirty&&(0==this.dirty||!!this.inParent())&&!!e.sameMarkup(this.node)&&(this.updateOuterDeco(t),(0!=this.dirty||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new es(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(0==e||t==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class el extends ee{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class ea extends ei{constructor(e,t,n,r,i,o,s,l,a,c){super(e,t,n,r,i,o,s,a,c),this.spec=l}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return(!!this.contentDOM||!!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}let ec=function(e){e&&(this.nodeName=e)};ec.prototype=Object.create(null);let ed=[new ec];function eh(e,t,n){if(0==e.length)return ed;let r=n?ed[0]:new ec,i=[r];for(let o=0;o0;){let l;for(;;)if(r){let e=n.children[r-1];if(e instanceof er)n=e,r=e.children.length;else{l=e,r--;break}}else if(n==t)break t;else r=n.parent.children.indexOf(n),n=n.parent;let a=l.node;if(a){if(a!=e.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n>1,o=Math.min(i,e.length);for(;r-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=er.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let i=-1,o;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(let r=this.index,o=Math.min(this.top.children.length,r+5);r=n||d<=t?o.push(a):(cn&&o.push(a.slice(n-c,a.size,r)))}return o}function eb(e,t=null){let n=e.domSelectionRange(),i=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),l=o&&0==o.size,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let c=i.resolve(a),d,h;if(g(n)){for(d=a;o&&!o.node;)o=o.parent;let e=o.node;if(o&&e.isAtom&&r.qv.isSelectable(e)&&o.parent&&!(e.isInline&&function(e,t,n){for(let r=0==t,i=t==f(e);r||i;){if(e==n)return!0;let t=s(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==f(e)}}(n.focusNode,n.focusOffset,o.dom))){let e=o.posBefore;h=new r.qv(a==e?c:i.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=a,r=a;for(let i=0;i{(s.anchorNode!=l||s.anchorOffset!=a)&&(o.removeEventListener("selectionchange",i.input.hideSelectionGuard),setTimeout(()=>{(!ew(i)||i.state.selection.visible)&&i.dom.classList.remove("ProseMirror-hideselection")},20))})))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}let ek=A||N&&E<63;function eS(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=rr(e,t,n))||r.Bs.between(t,n,i)}function eE(e){return(!e.editable||!!e.hasFocus())&&eA(e)}function eA(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function eD(e,t){let{$anchor:n,$head:i}=e.selection,o=t>0?n.max(i):n.min(i),s=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return s&&r.Y1.findFrom(s,t)}function eR(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function eI(e,t,n){let i=e.state.selection;if(i instanceof r.Bs){if(n.indexOf("s")>-1){let{$head:n}=i,o=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=e.state.doc.resolve(n.pos+o.nodeSize*(t<0?-1:1));return eR(e,new r.Bs(i.$anchor,s))}else if(!i.empty)return!1;else if(e.endOfTextblock(t>0?"forward":"backward")){let n=eD(e.state,t);return!!n&&n instanceof r.qv&&eR(e,n)}else if(!(R&&n.indexOf("m")>-1)){let n=i.$head,o=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,s;if(!o||o.isText)return!1;let l=t<0?n.pos-o.nodeSize:n.pos;return!!(o.isAtom||(s=e.docView.descAt(l))&&!s.contentDOM)&&(r.qv.isSelectable(o)?eR(e,new r.qv(t<0?e.state.doc.resolve(n.pos-o.nodeSize):n)):!!B&&eR(e,new r.Bs(e.state.doc.resolve(t<0?l:l+o.nodeSize))))}}else{if(i instanceof r.qv&&i.node.isInline)return eR(e,new r.Bs(t>0?i.$to:i.$from));let n=eD(e.state,t);return!!n&&eR(e,n)}}function eP(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function eB(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function ez(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,l=!1;for(C&&1==n.nodeType&&r0)if(1!=n.nodeType)break;else{let e=n.childNodes[r-1];if(eB(e,-1))i=n,o=--r;else if(3==e.nodeType)r=(n=e).nodeValue.length;else break}else if(e$(n))break;else{let t=n.previousSibling;for(;t&&eB(t,-1);)i=n.parentNode,o=s(t),t=t.previousSibling;if(t)r=eP(n=t);else{if((n=n.parentNode)==e.dom)break;r=0}}l?eL(e,n,r):i&&eL(e,i,o)}(e):function(e){let t,n,r=e.domSelectionRange(),i=r.focusNode,o=r.focusOffset;if(!i)return;let l=eP(i);for(;;)if(o{e.state==i&&ex(e)},50)}function eV(e,t){let n=e.state.doc.resolve(t);if(!(N||I)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i1)return n.leftr.top&&i1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function eH(e,t,n){let i=e.state.selection;if(i instanceof r.Bs&&!i.empty||n.indexOf("s")>-1||R&&n.indexOf("m")>-1)return!1;let{$from:o,$to:s}=i;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=eD(e.state,t);if(n&&n instanceof r.qv)return eR(e,n)}if(!o.parent.inlineContent){let n=t<0?o:s,l=i instanceof r.C1?r.Y1.near(n,t):r.Y1.findFrom(n,t);return!!l&&eR(e,l)}return!1}function eF(e,t){if(!(e.state.selection instanceof r.Bs))return!0;let{$head:n,$anchor:i,empty:o}=e.state.selection;if(!n.sameParent(i))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let s=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let r=e.state.tr;return t<0?r.delete(n.pos-s.nodeSize,n.pos):r.delete(n.pos,n.pos+s.nodeSize),e.dispatch(r),!0}return!1}function eZ(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function ej(e,t){e.someProp("transformCopied",n=>{t=n(t,e)});let n=[],{content:r,openStart:o,openEnd:s}=t;for(;o>1&&s>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,s--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let l=e.someProp("clipboardSerializer")||i.PW.fromSchema(e.state.schema),a=eG(),c=a.createElement("div");c.appendChild(l.serializeFragment(r,{document:a}));let d=c.firstChild,h,p=0;for(;d&&1==d.nodeType&&(h=e_[d.nodeName.toLowerCase()]);){for(let e=h.length-1;e>=0;e--){let t=a.createElement(h[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),p++}d=c.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice",`${o} ${s}${p?` -${p}`:""} ${JSON.stringify(n)}`),{dom:c,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function eq(e,t,n,r,o){let s,l,a=o.parent.type.spec.code;if(!n&&!t)return null;let c=t&&(r||a||!n);if(c){if(e.someProp("transformPastedText",n=>{t=n(t,a||r,e)}),a)return t?new i.p2(i.HY.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):i.p2.empty;let n=e.someProp("clipboardTextParser",n=>n(t,o,r,e));if(n)l=n;else{let n=o.marks(),{schema:r}=e.state,l=i.PW.fromSchema(r);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=s.appendChild(document.createElement("p"));e&&t.appendChild(l.serializeNode(r.text(e,n)))})}}else e.someProp("transformPastedHTML",t=>{n=t(n,e)}),s=function(e){var t;let n,r=/^(\s*]*>)*/.exec(e);r&&(e=e.slice(r[0].length));let i=eG().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e),s;if((s=o&&e_[o[1].toLowerCase()])&&(e=s.map(e=>"<"+e+">").join("")+e+s.map(e=>"").reverse().join("")),i.innerHTML=(t=e,(n=window.trustedTypes)?(eX||(eX=n.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})),eX.createHTML(t)):t),s)for(let e=0;e0;e--){let e=s.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;s=e}if(l||(l=(e.someProp("clipboardParser")||e.someProp("domParser")||i.aw.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(c||h),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||eW.test(e.parentNode.nodeName)?null:{ignore:!0}})),h)l=function(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch(t){return e}let{content:o,openStart:s,openEnd:l}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;o=i.HY.from(t.create(r[e+1],o)),s++,l++}return new i.p2(o,s,l)}(eY(l,+h[1],+h[2]),h[4]);else if((l=i.p2.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),o,s=[];if(e.forEach(e=>{if(!s)return;let t=r.findWrapping(e.type),n;if(!t)return s=null;if(n=s.length&&o.length&&function e(t,n,r,o,s){if(s{l=t(l,e)}),l}let eW=/^(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 eJ(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,i.HY.from(e));return e}function eK(e,t,n,r,o,s){let l=t<0?e.firstChild:e.lastChild,a=l.content;return e.childCount>1&&(s=0),o=n&&(a=t<0?l.contentMatchAt(0).fillBefore(a,s<=o).append(a):a.append(l.contentMatchAt(l.childCount).fillBefore(i.HY.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,l.copy(a))}function eY(e,t,n){return t{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>e6(e,t))})}function e6(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)})}function e8(e){return{left:e.clientX,top:e.clientY}}function e7(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let r=o.depth+1;r>0;r--)if(e.someProp(t,t=>r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1)))return!0;return!1}function e9(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}e0.keydown=(e,t)=>{if((e.input.shiftKey=16==t.keyCode||t.shiftKey,!tt(e,t))&&(e.input.lastKeyCode=t.keyCode,e.input.lastKeyCodeTime=Date.now(),!P||!N||13!=t.keyCode))if(229!=t.keyCode&&e.domObserver.forceFlush(),!D||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",n=>n(e,t))||function(e,t){let n,r=t.keyCode,i=(n="",t.ctrlKey&&(n+="c"),t.metaKey&&(n+="m"),t.altKey&&(n+="a"),t.shiftKey&&(n+="s"),n);if(8==r||R&&72==r&&"c"==i)return eF(e,-1)||ez(e,-1);if(46==r&&!t.shiftKey||R&&68==r&&"c"==i)return eF(e,1)||ez(e,1);if(13==r||27==r)return!0;if(37==r||R&&66==r&&"c"==i){let t=37==r?"ltr"==eV(e,e.state.selection.from)?-1:1:-1;return eI(e,t,i)||ez(e,t)}if(39==r||R&&70==r&&"c"==i){let t=39==r?"ltr"==eV(e,e.state.selection.from)?1:-1:1;return eI(e,t,i)||ez(e,t)}else if(38==r||R&&80==r&&"c"==i)return eH(e,-1,i)||ez(e,-1);else if(40==r||R&&78==r&&"c"==i)return function(e){if(!A||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;eZ(e,n,"true"),setTimeout(()=>eZ(e,n,"false"),20)}return!1}(e)||eH(e,1,i)||ez(e,1);else if(i==(R?"m":"c")&&(66==r||73==r||89==r||90==r))return!0;return!1}(e,t)?t.preventDefault():e3(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,y(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},e0.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},e0.keypress=(e,t)=>{if(tt(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||R&&t.metaKey)return;if(e.someProp("handleKeyPress",n=>n(e,t)))return void t.preventDefault();let n=e.state.selection;if(!(n instanceof r.Bs)||!n.$from.sameParent(n.$to)){let r=String.fromCharCode(t.charCode);/[\r\n]/.test(r)||e.someProp("handleTextInput",t=>t(e,n.$from.pos,n.$to.pos,r))||e.dispatch(e.state.tr.insertText(r).scrollIntoView()),t.preventDefault()}};let e4=R?"metaKey":"ctrlKey";eQ.mousedown=(e,t)=>{var n;let i,o;e.input.shiftKey=t.shiftKey;let s=to(e),l=Date.now(),a="singleClick";l-e.input.lastClick.time<500&&(i=(n=e.input.lastClick).x-t.clientX)*i+(o=n.y-t.clientY)*o<100&&!t[e4]&&("singleClick"==e.input.lastClick.type?a="doubleClick":"doubleClick"==e.input.lastClick.type&&(a="tripleClick")),e.input.lastClick={time:l,x:t.clientX,y:t.clientY,type:a};let c=e.posAtCoords(e8(t));c&&("singleClick"==a?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new te(e,c,t,!!s)):("doubleClick"==a?function(e,t,n,r){return e7(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",n=>n(e,t,r))}:function(e,t,n,i){return e7(e,"handleTripleClickOn",t,n,i)||e.someProp("handleTripleClick",n=>n(e,t,i))||function(e,t,n){if(0!=n.button)return!1;let i=e.state.doc;if(-1==t)return!!i.inlineContent&&(e9(e,r.Bs.create(i,0,i.content.size),"pointer"),!0);let o=i.resolve(t);for(let t=o.depth+1;t>0;t--){let n=t>o.depth?o.nodeAfter:o.node(t),s=o.before(t);if(n.inlineContent)e9(e,r.Bs.create(i,s+1,s+1+n.content.size),"pointer");else{if(!r.qv.isSelectable(n))continue;e9(e,r.qv.create(i,s),"pointer")}return!0}}(e,n,i)})(e,c.pos,c.inside,t)?t.preventDefault():e3(e,"pointer"))};class te{constructor(e,t,n,i){let o,s;if(this.view=e,this.pos=t,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[e4],this.allowDefault=n.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),s=t.inside;else{let n=e.state.doc.resolve(t.pos);o=n.parent,s=n.depth?n.before():0}let l=i?null:n.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&1==a.dom.nodeType?a.dom:null;let{selection:c}=e.state;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||c instanceof r.qv&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&C&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),e3(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>ex(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;if(this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(e8(e))),this.updateAllowDefault(e),this.allowDefault||!t)e3(this.view,"pointer");else{var n,i,o,s;(n=this.view,i=t.pos,o=t.inside,s=this.selectNode,e7(n,"handleClickOn",i,o,e)||n.someProp("handleClick",t=>t(n,i,e))||(s?function(e,t){if(-1==t)return!1;let n=e.state.selection,i,o;n instanceof r.qv&&(i=n.node);let s=e.state.doc.resolve(t);for(let e=s.depth+1;e>0;e--){let t=e>s.depth?s.nodeAfter:s.node(e);if(r.qv.isSelectable(t)){o=i&&n.$from.depth>0&&e>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?s.before(n.$from.depth):s.before(e);break}}return null!=o&&(e9(e,r.qv.create(e.state.doc,o),"pointer"),!0)}(n,o):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),i=n.nodeAfter;return!!(i&&i.isAtom&&r.qv.isSelectable(i))&&(e9(e,new r.qv(n),"pointer"),!0)}(n,o)))?e.preventDefault():0==e.button&&(this.flushed||A&&this.mightDrag&&!this.mightDrag.node.isAtom||N&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to)))?(e9(this.view,r.Y1.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):e3(this.view,"pointer")}}move(e){this.updateAllowDefault(e),e3(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function tt(e,t){return!!e.composing||!!(A&&500>Math.abs(t.timeStamp-e.input.compositionEndedAt))&&(e.input.compositionEndedAt=-2e8,!0)}eQ.touchstart=e=>{e.input.lastTouch=Date.now(),to(e),e3(e,"pointer")},eQ.touchmove=e=>{e.input.lastTouch=Date.now(),e3(e,"pointer")},eQ.contextmenu=e=>to(e);let tn=P?5e3:-1;function tr(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>to(e),t))}function ti(e){let t;for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=((t=document.createEvent("Event")).initEvent("event",!0,!0),t.timeStamp));e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function to(e,t=!1){if(!P||!(e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),ti(e),t||e.docView&&e.docView.dirty){let n=eb(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!e.state.selection.empty?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}e0.compositionstart=e0.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof r.Bs&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)))e.markCursor=e.state.storedMarks||n.marks(),to(e,!0),e.markCursor=null;else if(to(e,!t.selection.empty),C&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}tr(e,tn)},e0.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,tr(e,20))};let ts=M&&O<15||D&&z<604;function tl(e,t,n,r,o){let s=eq(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,o,s||i.p2.empty)))return!0;if(!s)return!1;let l=0==s.openStart&&0==s.openEnd&&1==s.content.childCount?s.content.firstChild:null,a=l?e.state.tr.replaceSelectionWith(l,r):e.state.tr.replaceSelection(s);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function ta(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}eQ.copy=e0.cut=(e,t)=>{let n=e.state.selection,r="cut"==t.type;if(n.empty)return;let i=ts?null:t.clipboardData,{dom:o,text:s}=ej(e,n.content());i?(t.preventDefault(),i.clearData(),i.setData("text/html",o.innerHTML),i.setData("text/plain",s)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}(e,o),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},e0.paste=(e,t)=>{if(e.composing&&!P)return;let n=ts?null:t.clipboardData,r=e.input.shiftKey&&45!=e.input.lastKeyCode;n&&tl(e,ta(n),n.getData("text/html"),r,t)?t.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?tl(e,r.value,null,i,t):tl(e,r.textContent,r.innerHTML,i,t)},50)}(e,t)};class tc{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}let td=R?"altKey":"ctrlKey";for(let e in eQ.dragstart=(e,t)=>{let n,i=e.input.mouseDown;if(i&&i.done(),!t.dataTransfer)return;let o=e.state.selection,s=o.empty?null:e.posAtCoords(e8(t));if(s&&s.pos>=o.from&&s.pos<=(o instanceof r.qv?o.to-1:o.to));else if(i&&i.mightDrag)n=r.qv.create(e.state.doc,i.mightDrag.pos);else if(t.target&&1==t.target.nodeType){let i=e.docView.nearestDesc(t.target,!0);i&&i.node.type.spec.draggable&&i!=e.docView&&(n=r.qv.create(e.state.doc,i.posBefore))}let l=(n||e.state.selection).content(),{dom:a,text:c,slice:d}=ej(e,l);t.dataTransfer.files.length&&N&&!(E>120)||t.dataTransfer.clearData(),t.dataTransfer.setData(ts?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",ts||t.dataTransfer.setData("text/plain",c),e.dragging=new tc(d,!t[td],n)},eQ.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},e0.dragover=e0.dragenter=(e,t)=>t.preventDefault(),e0.drop=(e,t)=>{let n=e.dragging;if(e.dragging=null,!t.dataTransfer)return;let s=e.posAtCoords(e8(t));if(!s)return;let l=e.state.doc.resolve(s.pos),a=n&&n.slice;a?e.someProp("transformPasted",t=>{a=t(a,e)}):a=eq(e,ta(t.dataTransfer),ts?null:t.dataTransfer.getData("text/html"),!1,l);let c=!!(n&&!t[td]);if(e.someProp("handleDrop",n=>n(e,t,a||i.p2.empty,c)))return void t.preventDefault();if(!a)return;t.preventDefault();let d=a?(0,o.nj)(e.state.doc,l.pos,a):l.pos;null==d&&(d=l.pos);let h=e.state.tr;if(c){let{node:e}=n;e?e.replace(h):h.deleteSelection()}let p=h.mapping.map(d),u=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,f=h.doc;if(u?h.replaceRangeWith(p,p,a.content.firstChild):h.replaceRange(p,p,a),h.doc.eq(f))return;let m=h.doc.resolve(p);if(u&&r.qv.isSelectable(a.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(a.content.firstChild))h.setSelection(new r.qv(m));else{let t=h.mapping.map(d);h.mapping.maps[h.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),h.setSelection(eN(e,m,h.doc.resolve(t)))}e.focus(),e.dispatch(h.setMeta("uiEvent","drop"))},eQ.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&ex(e)},20))},eQ.blur=(e,t)=>{e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),t.relatedTarget&&e.dom.contains(t.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},eQ.beforeinput=(e,t)=>{if(N&&P&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,y(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}},e0)eQ[e]=e0[e];function th(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class tp{constructor(e,t){this.toDOM=e,this.spec=t||ty,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new tm(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof tp&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&th(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class tu{constructor(e,t){this.attrs=e,this.spec=t||ty}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new tm(i,o,this)}valid(e,t){return t.from=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;oe){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==tb||0==e.maps.length?this:this.mapInner(e,t,0,0,n||ty)}mapInner(e,t,n,r,i){let o;for(let s=0;s{let s=o-i-(n-e);for(let i=0;io+t-r)continue;let a=l[i]+t-r;n>=a?l[i+1]=e<=a?-2:-1:e>=t&&s&&(l[i]+=s,l[i+1]+=s)}r+=s}),t=n.maps[e].map(t,-1)}let a=!1;for(let t=0;t=r.content.size){a=!0;continue}let h=n.map(e[t+1]+o,-1)-i,{index:p,offset:u}=r.content.findIndex(d),f=r.maybeChild(p);if(f&&u==d&&u+f.nodeSize==h){let r=l[t+2].mapInner(n,f,c+1,e[t]+o+1,s);r!=tb?(l[t]=d,l[t+1]=h,l[t+2]=r):(l[t+1]=-2,a=!0)}else a=!0}if(a){let a=tM(function(e,t,n,r,i,o,s){for(let l=0;l{let s=o+n,l;if(l=tk(t,e,s)){for(r||(r=this.children.slice());io&&n.to=e){this.children[t]==e&&(n=this.children[t+2]);break}let i=e+1,o=i+t.content.size;for(let e=0;ei&&t.type instanceof tu){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;en.map(e,t,ty));return tw.from(n)}forChild(e,t){if(t.isLeaf)return tv.empty;let n=[];for(let r=0;re instanceof tv)?e:e.reduce((e,t)=>e.concat(t instanceof tv?t:t.members),[]))}}forEachSet(e){for(let t=0;tn&&o.to{let l=tk(e,t,s+n);if(l){o=!0;let e=tM(l,t,n+s+1,r);e!=tb&&i.push(s,s+t.nodeSize,e)}});let s=tx(o?tS(e):e,-n).sort(tO);for(let e=0;e0;)t++;e.splice(t,0,n)}function tN(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=tb&&t.push(r)}),e.cursorWrapper&&t.push(tv.create(e.state.doc,[e.cursorWrapper.deco])),tw.from(t)}let tE={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},tA=M&&O<=11;class tD{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class tR{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new tD,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(e=>{for(let t=0;t"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),tA&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.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,tE)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;tthis.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(eE(this.view)){if(this.suppressingSelectionUpdates)return ex(this.view);if(M&&O<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&h(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=l(n))t.add(n);for(let r=e.anchorNode;r;r=l(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:"selection",target:3==n.nodeType?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){var e;let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let i=t.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(i)&&eE(t)&&!this.ignoreSelectionChange(i),s=-1,l=-1,a=!1,c=[];if(t.editable)for(let e=0;e"BR"==e.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||function(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}(t,n)!=e)&&r.remove()}}}let d=null;s<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||o)&&(s>-1&&(t.docView.markDirty(s,l),e=t,!tI.has(e)&&(tI.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))&&(e.requiresGeckoHackNode=C,tP||(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."),tP=!0))),this.handleDOMChange(s,l,a,c),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(i)||ex(t),this.currentSelection.set(i))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;nArray.prototype.indexOf.call(e.addedNodes,n))&&(r=n),(!o||0>Array.prototype.indexOf.call(e.addedNodes,o))&&(i=o)}let o=r&&r.parentNode==e.target?s(r)+1:0,l=n.localPosFromDOM(e.target,o,-1),a=i&&i.parentNode==e.target?s(i):e.target.childNodes.length;return{from:l,to:n.localPosFromDOM(e.target,a,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let tI=new WeakMap,tP=!1;function tB(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return h(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function tz(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(A&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}else if(e.parentNode.lastChild==e||A&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}let t$=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function tL(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:eN(e,t.resolve(n.anchor),t.resolve(n.head))}function tV(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function tH(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class tF{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new e2,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(tJ),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=tq(this),tj(this),this.nodeViews=tW(this),this.docView=eo(this.state.doc,tZ(this),tN(this),this.dom,this),this.domObserver=new tR(this,(e,t,n,o)=>(function(e,t,n,o,s){let l,a,c,d,h,p,u=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=eb(e,t);if(n&&!e.state.selection.eq(n)){if(N&&P&&13===e.input.lastKeyCode&&Date.now()-100t(e,y(13,"Enter"))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),u&&r.setMeta("composition",u),e.dispatch(r)}return}let f=e.state.doc.resolve(t),m=f.sharedDepth(n);t=f.before(m+1),n=e.state.doc.resolve(n).after(m+1);let v=e.state.selection,b=function(e,t,n){let r,{node:o,fromOffset:s,toOffset:l,from:a,to:c}=e.docView.parseRange(t,n),d=e.domSelectionRange(),h=d.anchorNode;if(h&&e.dom.contains(1==h.nodeType?h:h.parentNode)&&(r=[{node:h,offset:d.anchorOffset}],g(d)||r.push({node:d.focusNode,offset:d.focusOffset})),N&&8===e.input.lastKeyCode)for(let e=l;e>s;e--){let t=o.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){l=e;break}if(!n||n.size)break}let p=e.state.doc,u=e.someProp("domParser")||i.aw.fromSchema(e.state.schema),f=p.resolve(a),m=null,y=u.parse(o,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:s,to:l,preserveWhitespace:"pre"!=f.parent.type.whitespace||"full",findPositions:r,ruleFromNode:tz,context:f});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),m={anchor:e+a,head:t+a}}return{doc:y,sel:m,from:a,to:c}}(e,t,n),w=e.state.doc,x=w.slice(b.from,b.to);8===e.input.lastKeyCode&&Date.now()-100=s?o-r:0;(o-=e)&&o=l?o-r:0;(o-=t)&&oDate.now()-225||P)&&s.some(e=>1==e.nodeType&&!t$.test(e.nodeName))&&(!k||k.endA>=k.endB)&&e.someProp("handleKeyDown",t=>t(e,y(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!k)if(o&&v instanceof r.Bs&&!v.empty&&v.$head.sameParent(v.$anchor)&&!e.composing&&!(b.sel&&b.sel.anchor!=b.sel.head))k={start:v.from,endA:v.to,endB:v.to};else{if(b.sel){let t=tL(e,e.state.doc,b.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);u&&n.setMeta("composition",u),e.dispatch(n)}}return}e.state.selection.frome.state.selection.from&&k.start<=e.state.selection.from+2&&e.state.selection.from>=b.from?k.start=e.state.selection.from:k.endA=e.state.selection.to-2&&e.state.selection.to<=b.to&&(k.endB+=e.state.selection.to-k.endA,k.endA=e.state.selection.to)),M&&O<=11&&k.endB==k.start+1&&k.endA==k.start&&k.start>b.from&&" \xa0"==b.doc.textBetween(k.start-b.from-1,k.start-b.from+1)&&(k.start--,k.endA--,k.endB--);let S=b.doc.resolveNoCache(k.start-b.from),C=b.doc.resolveNoCache(k.endB-b.from),T=w.resolve(k.start),E=S.sameParent(C)&&S.parent.inlineContent&&T.end()>=k.endA;if((D&&e.input.lastIOSEnter>Date.now()-225&&(!E||s.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!E&&S.post(e,y(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>k.start&&function(e,t,n,r,i){if(n-t<=i.pos-r.pos||tV(r,!0,!1)n||tV(s,!0,!1)t(e,y(8,"Backspace")))){P&&N&&e.domObserver.suppressSelectionUpdates();return}N&&k.endB==k.start&&(e.input.lastChromeDelete=Date.now()),P&&!E&&S.start()!=C.start()&&0==C.parentOffset&&S.depth==C.depth&&b.sel&&b.sel.anchor==b.sel.head&&b.sel.head==k.endA&&(k.endB-=2,C=b.doc.resolveNoCache(k.endB-b.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,y(13,"Enter"))})},20));let A=k.start,R=k.endA;if(E){if(S.pos==C.pos)M&&O<=11&&0==S.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>ex(e),20)),d=e.state.tr.delete(A,R),h=w.resolve(k.start).marksAcross(w.resolve(k.endA));else if(k.endA==k.endB&&(p=function(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,o=n,s=r,l,a,c;for(let e=0;ee.mark(a.addToSet(e.marks));else{if(0!=o.length||1!=s.length)return null;a=s[0],l="remove",c=e=>e.mark(a.removeFromSet(e.marks))}let d=[];for(let e=0;en(e,A,R,t)))return;d=e.state.tr.insertText(t,A,R)}}if(d||(d=e.state.tr.replace(A,R,b.doc.slice(k.start-b.from,k.endB-b.from))),b.sel){let t=tL(e,d.doc,b.sel);t&&!(N&&e.composing&&t.empty&&(k.start!=k.endB||e.input.lastChromeDelete{!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}(n,e)||e6(n,e)||!n.editable&&e.type in e0||t(n,e)},e1[e]?{passive:!0}:void 0)}A&&n.dom.addEventListener("input",()=>null),e5(n),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;for(let t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&e5(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(tJ),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];for(let n in t.state=this.state,e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n,r,i;let o=this.state,l=!1,a=!1;e.storedMarks&&this.composing&&(ti(this),a=!0),this.state=e;let c=o.plugins!=e.plugins||this._props.plugins!=t.plugins;if(c||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=tW(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,l=!0)}(c||t.handleDOMEvents!=this._props.handleDOMEvents)&&e5(this),this.editable=tq(this),tj(this);let d=tN(this),p=tZ(this),u=o.plugins==e.plugins||o.doc.eq(e.doc)?e.scrollToSelection>o.scrollToSelection?"to selection":"preserve":"reset",g=l||!this.docView.matchesNode(e.doc,p,d);(g||!e.selection.eq(o.selection))&&(a=!0);let y="preserve"==u&&a&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s=i-20){t=r,n=l.top;break}}return{refDOM:t,refTop:n,stack:V(e.dom)}}(this);if(a){let t,n,a;this.domObserver.stop();let c=g&&(M||N)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&(r=o.selection,i=e.selection,a=Math.min(r.$anchor.sharedDepth(r.head),i.$anchor.sharedDepth(i.head)),r.$anchor.start(a)!=i.$anchor.start(a));if(g){let t=N?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=f(e=e.childNodes[t-1])}else{if(!e.parentNode||m(e))return null;t=s(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(3==e.nodeType&&te(this)));else if(this.state.selection instanceof r.qv){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&L(this,t.getBoundingClientRect(),e)}else L(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t0&&this.state.doc.nodeAt(e))==n.node&&(i=e)}this.dragging=new tc(e.slice,e.move,i<0?void 0:r.qv.create(this.state.doc,i))}someProp(e,t){let n=this._props&&this._props[e],r;if(null!=n&&(r=t?t(n):n))return r;for(let n=0;ne.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return function(e,t){var n;let r,i,o=e.dom.ownerDocument,s,a=0,d=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(f(r.offsetNode),r.offset)}}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(f(r.startContainer),r.startOffset)}}}(o,t.left,t.top);d&&({node:s,offset:a}=d);let h=(e.root.elementFromPoint?e.root:o).elementFromPoint(t.left,t.top);if(!h||!e.dom.contains(1!=h.nodeType?h.parentNode:h)){let n=e.dom.getBoundingClientRect();if(!Z(t,n)||!(h=function e(t,n,r){let i=t.childNodes.length;if(i&&r.topt.top&&a++}B&&a&&1==s.nodeType&&1==(n=s.childNodes[a-1]).nodeType&&"false"==n.contentEditable&&n.getBoundingClientRect().top>=t.top&&a--,s==e.dom&&a==s.childNodes.length-1&&1==s.lastChild.nodeType&&t.top>s.lastChild.getBoundingClientRect().bottom?i=e.state.doc.content.size:(0==a||1!=s.nodeType||"BR"!=s.childNodes[a-1].nodeName)&&(i=function(e,t,n,r){let i=-1;for(let n=t,o=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),s;if(!t)return null;if(1==t.dom.nodeType&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((s=t.dom.getBoundingClientRect()).width||s.height)&&(t.node.isBlock&&t.parent&&(!o&&s.left>r.left||s.top>r.top?i=t.posBefore:(!o&&s.right-1?i:e.docView.posFromDOM(t,n,-1)}(e,s,a,t))}null==i&&(i=function(e,t,n){let{node:r,offset:i}=function e(t,n){let r,i,o,s=2e8,l,a=0,d=n.top,h=n.top;for(let e=t.firstChild,p=0;e;e=e.nextSibling,p++){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=c(e).getClientRects()}for(let c=0;c=h){d=Math.max(u.bottom,d),h=Math.min(u.top,h);let t=u.left>n.left?u.left-n.left:u.right=(u.left+u.right)/2));continue}}else u.top>n.top&&!r&&u.left<=n.left&&u.right>=n.left&&(r=e,i={left:Math.max(u.left,Math.min(u.right,n.left)),top:u.top});!o&&(n.left>=u.right&&n.top>=u.top||n.left>=u.left&&n.top>=u.bottom)&&(a=p+1)}}return(!o&&r&&(o=r,l=i,s=0),o&&3==o.nodeType)?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i=(n.left+n.right)/2)}}return{node:e,offset:0}}(o,l):!o||s&&1==o.nodeType?{node:t,offset:a}:e(o,l)}(t,n),o=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}(e,h,t));let p=e.docView.nearestDesc(h,!0);return{pos:i,inside:p?p.posAtStart-p.border:-1}}(this,e)}coordsAtPos(e,t=1){return J(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return function(e,t,n){let r,i;return G==t&&X==n?Q:(G=t,X=n,Q="up"==n||"down"==n?(r=t.selection,i="up"==n?r.$from:r.$to,_(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=J(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=c(e,0,e.nodeValue.length).getClientRects()}for(let e=0;ei.top+1&&("up"==n?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=i==r.parent.content.size,s=e.domSelection();return s?U.test(r.parent.textContent)&&s.modify?_(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:o,anchorOffset:l}=e.domSelectionRange(),a=s.caretBidiLevel;s.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:d,focusOffset:h}=e.domSelectionRange(),p=d&&!c.contains(1==d.nodeType?d:d.parentNode)||t==d&&i==h;try{s.collapse(o,l),t&&(t!=o||i!=l)&&s.extend&&s.extend(t,i)}catch(e){}return null!=a&&(s.caretBidiLevel=a),p}):"left"==n||"backward"==n?!i:o:r.pos==r.start()||r.pos==r.end()}(e,t,n))}(this,t||this.state,e)}pasteHTML(e,t){return tl(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return tl(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return ej(this,e)}destroy(){if(this.docView){for(let e in this.domObserver.stop(),this.input.eventHandlers)this.dom.removeEventListener(e,this.input.eventHandlers[e]);clearTimeout(this.input.composingTimeout),clearTimeout(this.input.lastIOSEnterFallbackTimeout),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],tN(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,d()}}get isDestroyed(){return null==this.docView}dispatchEvent(e){!e6(this,e)&&eQ[e.type]&&(this.editable||!(e.type in e0))&&eQ[e.type](this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?A&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){let n;if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return tB(e,n)}function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?tB(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function tZ(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))}),t.translate||(t.translate="no"),[tm.node(0,e.state.doc.content.size,t)]}function tj(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:tm.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function tq(e){return!e.someProp("editable",t=>!1===t(e.state))}function tW(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function tJ(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}},4927:function(e,t,n){n.d(t,{Z:()=>d});var r=n(30697),i=n(6206),o=n(30483),s=n(23161),l=n(86413),a=n(87701),c=n(14943);let d={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,d=e.name;if(!t.modifiersData[d]._skip){for(var h=n.mainAxis,p=void 0===h||h,u=n.altAxis,f=void 0===u||u,m=n.fallbackPlacements,g=n.padding,y=n.boundary,v=n.rootBoundary,b=n.altBoundary,w=n.flipVariations,x=void 0===w||w,k=n.allowedAutoPlacements,S=t.options.placement,M=(0,i.Z)(S)===S,O=m||(M||!x?[(0,r.Z)(S)]:function(e){if((0,i.Z)(e)===a.d7)return[];var t=(0,r.Z)(e);return[(0,o.Z)(e),t,(0,o.Z)(t)]}(S)),C=[S].concat(O).reduce(function(e,n){return e.concat((0,i.Z)(n)===a.d7?(0,l.Z)(t,{placement:n,boundary:y,rootBoundary:v,padding:g,flipVariations:x,allowedAutoPlacements:k}):n)},[]),T=t.rects.reference,N=t.rects.popper,E=new Map,A=!0,D=C[0],R=0;R=0,$=z?"width":"height",L=(0,s.Z)(t,{placement:I,boundary:y,rootBoundary:v,altBoundary:b,padding:g}),V=z?B?a.F2:a.t$:B?a.I:a.we;T[$]>N[$]&&(V=(0,r.Z)(V));var H=(0,r.Z)(V),F=[];if(p&&F.push(L[P]<=0),f&&F.push(L[V]<=0,L[H]<=0),F.every(function(e){return e})){D=I,A=!1;break}E.set(I,F)}if(A)for(var Z=x?3:1,j=function(e){var t=C.find(function(t){var n=E.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return D=t,"break"},q=Z;q>0&&"break"!==j(q);q--);t.placement!==D&&(t.modifiersData[d]._skip=!0,t.placement=D,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}}},50380:function(e,t,n){n.d(t,{Z:()=>i});var r=n(87701);function i(e){var t,n,i,o=(t=new Map,n=new Set,i=[],e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){n.has(e.name)||function e(r){n.add(r.name),[].concat(r.requires||[],r.requiresIfExists||[]).forEach(function(r){if(!n.has(r)){var i=t.get(r);i&&e(i)}}),i.push(r)}(e)}),i);return r.xs.reduce(function(e,t){return e.concat(o.filter(function(e){return e.phase===t}))},[])}},50400:function(e,t,n){n.d(t,{Z:()=>l});var r=n(62556),i=n(138),o=n(62057),s=n(67977);function l(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var l=e.getBoundingClientRect(),a=1,c=1;t&&(0,r.Re)(e)&&(a=e.offsetWidth>0&&(0,i.NM)(l.width)/e.offsetWidth||1,c=e.offsetHeight>0&&(0,i.NM)(l.height)/e.offsetHeight||1);var d=((0,r.kK)(e)?(0,o.Z)(e):window).visualViewport,h=!(0,s.Z)()&&n,p=(l.left+(h&&d?d.offsetLeft:0))/a,u=(l.top+(h&&d?d.offsetTop:0))/c,f=l.width/a,m=l.height/c;return{width:f,height:m,top:u,right:p+f,bottom:u+m,left:p,x:p,y:u}}},51127:function(e,t,n){n.d(t,{Z:()=>o});var r=n(88897),i=n(30355);let o=r.hj.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>(0,i.Yw)(e,t),redo:()=>({state:e,dispatch:t})=>(0,i.KX)(e,t)}),addProseMirrorPlugins(){return[(0,i.m8)(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}})},5219:function(e,t,n){n.d(t,{Z:()=>f});var r=n(87701),i=n(6206),o=n(11516),s=n(73967),l=n(57516),a=n(40583),c=n(21955),d=n(23161),h=n(14943),p=n(23607),u=n(138);let f={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,f=e.name,m=n.mainAxis,g=n.altAxis,y=n.boundary,v=n.rootBoundary,b=n.altBoundary,w=n.padding,x=n.tether,k=void 0===x||x,S=n.tetherOffset,M=void 0===S?0:S,O=(0,d.Z)(t,{boundary:y,rootBoundary:v,padding:w,altBoundary:b}),C=(0,i.Z)(t.placement),T=(0,h.Z)(t.placement),N=!T,E=(0,o.Z)(C),A=(0,s.Z)(E),D=t.modifiersData.popperOffsets,R=t.rects.reference,I=t.rects.popper,P="function"==typeof M?M(Object.assign({},t.rects,{placement:t.placement})):M,B="number"==typeof P?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),z=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,$={x:0,y:0};if(D){if(void 0===m||m){var L,V="y"===E?r.we:r.t$,H="y"===E?r.I:r.F2,F="y"===E?"height":"width",Z=D[E],j=Z+O[V],q=Z-O[H],W=k?-I[F]/2:0,J=T===r.BL?R[F]:I[F],K=T===r.BL?-I[F]:-R[F],Y=t.elements.arrow,_=k&&Y?(0,a.Z)(Y):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:(0,p.Z)(),G=U[V],X=U[H],Q=(0,l.u)(0,R[F],_[F]),ee=N?R[F]/2-W-Q-G-B.mainAxis:J-Q-G-B.mainAxis,et=N?-R[F]/2+W+Q+X+B.mainAxis:K+Q+X+B.mainAxis,en=t.elements.arrow&&(0,c.Z)(t.elements.arrow),er=en?"y"===E?en.clientTop||0:en.clientLeft||0:0,ei=null!=(L=null==z?void 0:z[E])?L:0,eo=(0,l.u)(k?(0,u.VV)(j,Z+ee-ei-er):j,Z,k?(0,u.Fp)(q,Z+et-ei):q);D[E]=eo,$[E]=eo-Z}if(void 0!==g&&g){var es,el="x"===E?r.we:r.t$,ea="x"===E?r.I:r.F2,ec=D[A],ed="y"===A?"height":"width",eh=ec+O[el],ep=ec-O[ea],eu=-1!==[r.we,r.t$].indexOf(C),ef=null!=(es=null==z?void 0:z[A])?es:0,em=eu?eh:ec-R[ed]-I[ed]-ef+B.altAxis,eg=eu?ec+R[ed]+I[ed]-ef-B.altAxis:ep,ey=k&&eu?(0,l.q)(em,ec,eg):(0,l.u)(k?em:eh,ec,k?eg:ep);D[A]=ey,$[A]=ey-ec}t.modifiersData[f]=$}},requiresIfExists:["offset"]}},55457:function(e,t,n){n.d(t,{ML:()=>o,kg:()=>s}),n(36779);var r=n(88897);n(22225);var i=n(81891);class o extends r.ML{constructor(){super(...arguments),this.contentComponent=null}}let s={name:"EditorContent",props:{editor:{default:null,type:Object}},watch:{editor:{immediate:!0,handler(e){e&&e.options.element&&this.$nextTick(()=>{let t=this.$el;t&&e.options.element.firstChild&&(t.append(...e.options.element.childNodes),e.contentComponent=this,e.setOptions({element:t}),e.createNodeViews())})}}},render:e=>e("div"),beforeDestroy(){let{editor:e}=this;if(!e||(e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null,!e.options.element.firstChild))return;let t=document.createElement("div");t.append(...e.options.element.childNodes),e.setOptions({element:t})}};(0,i.objectProp)().required,(0,i.objectProp)().required,(0,i.objectProp)().required,(0,i.booleanProp)().required,(0,i.objectProp)().required,(0,i.functionProp)().required,(0,i.functionProp)().required,(0,i.functionProp)().required},55786:function(e,t,n){n.d(t,{Z:()=>i});var r=n(88897);let i=r.NB.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",(0,r.P1)(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}})},55963:function(e,t,n){n.d(t,{Z:()=>r});let r=n(88897).NB.create({name:"text",group:"inline"})},57516:function(e,t,n){n.d(t,{q:()=>o,u:()=>i});var r=n(138);function i(e,t,n){return(0,r.Fp)(e,(0,r.VV)(t,n))}function o(e,t,n){var r=i(e,t,n);return r>n?n:r}},60611:function(e,t,n){n.d(t,{Z:()=>i});var r=n(43062);function i(e){var t=(0,r.Z)(e),n=t.overflow,i=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+i)}},62057:function(e,t,n){n.d(t,{Z:()=>r});function r(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}},6206:function(e,t,n){n.d(t,{Z:()=>r});function r(e){return e.split("-")[0]}},62556:function(e,t,n){n.d(t,{Re:()=>o,Zq:()=>s,kK:()=>i});var r=n(62057);function i(e){var t=(0,r.Z)(e).Element;return e instanceof t||e instanceof Element}function o(e){var t=(0,r.Z)(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function s(e){if("undefined"==typeof ShadowRoot)return!1;var t=(0,r.Z)(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}},62737:function(e,t,n){n.d(t,{YG:()=>c,ue:()=>r});for(var r={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},i={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},o="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),s="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),l=0;l<10;l++)r[48+l]=r[96+l]=String(l);for(var l=1;l<=24;l++)r[l+111]="F"+l;for(var l=65;l<=90;l++)r[l]=String.fromCharCode(l+32),i[l]=String.fromCharCode(l);for(var a in r)i.hasOwnProperty(a)||(i[a]=r[a]);function c(e){var t=!(o&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||s&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?i:r)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}},63293:function(e,t,n){n.d(t,{Z:()=>i});var r=n(23607);function i(e){return Object.assign({},(0,r.Z)(),e)}},64782:function(e,t,n){n.d(t,{Z:()=>l});var r=n(82163),i=n(62057),o=n(62556),s=n(18328);function l(e){return e!==(0,i.Z)(e)&&(0,o.Re)(e)?(0,s.Z)(e):(0,r.Z)(e)}},65626:function(e,t,n){n.d(t,{Z:()=>r});function r(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}},66896:function(e,t,n){n.d(t,{Z:()=>p});var r=n(6206),i=n(40583),o=n(94985),s=n(21955),l=n(11516),a=n(57516),c=n(63293),d=n(33706),h=n(87701);let p={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,o=e.name,p=e.options,u=n.elements.arrow,f=n.modifiersData.popperOffsets,m=(0,r.Z)(n.placement),g=(0,l.Z)(m),y=[h.t$,h.F2].indexOf(m)>=0?"height":"width";if(u&&f){var v,b=(v=p.padding,v="function"==typeof v?v(Object.assign({},n.rects,{placement:n.placement})):v,(0,c.Z)("number"!=typeof v?v:(0,d.Z)(v,h.mv))),w=(0,i.Z)(u),x="y"===g?h.we:h.t$,k="y"===g?h.I:h.F2,S=n.rects.reference[y]+n.rects.reference[g]-f[g]-n.rects.popper[y],M=f[g]-n.rects.reference[g],O=(0,s.Z)(u),C=O?"y"===g?O.clientHeight||0:O.clientWidth||0:0,T=b[x],N=C-w[y]-b[k],E=C/2-w[y]/2+(S/2-M/2),A=(0,a.u)(T,E,N);n.modifiersData[o]=((t={})[g]=A,t.centerOffset=A-E,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;if(null!=r)("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&(0,o.Z)(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]}},67252:function(e,t,n){n.d(t,{Z:()=>i});var r=n(62556);function i(e){return(((0,r.kK)(e)?e.ownerDocument:e.document)||window.document).documentElement}},67313:function(e,t,n){n.d(t,{Z:()=>i});var r=n(96333);function i(e){return["table","td","th"].indexOf((0,r.Z)(e))>=0}},67977:function(e,t,n){n.d(t,{Z:()=>i});var r=n(85918);function i(){return!/^((?!chrome|android).)*safari/i.test((0,r.Z)())}},70614:function(e,t,n){function r(e){this.content=e}n.d(t,{Z:()=>i}),r.prototype={constructor:r,find:function(e){for(var t=0;t>1}},r.from=function(e){if(e instanceof r)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new r(t)};let i=r},72581:function(e,t,n){n.d(t,{Z:()=>l});var r=n(6206),i=n(14943),o=n(11516),s=n(87701);function l(e){var t,n=e.reference,l=e.element,a=e.placement,c=a?(0,r.Z)(a):null,d=a?(0,i.Z)(a):null,h=n.x+n.width/2-l.width/2,p=n.y+n.height/2-l.height/2;switch(c){case s.we:t={x:h,y:n.y-l.height};break;case s.I:t={x:h,y:n.y+n.height};break;case s.F2:t={x:n.x+n.width,y:p};break;case s.t$:t={x:n.x-l.width,y:p};break;default:t={x:n.x,y:n.y}}var u=c?(0,o.Z)(c):null;if(null!=u){var f="y"===u?"height":"width";switch(d){case s.BL:t[u]=t[u]-(n[f]/2-l[f]/2);break;case s.ut:t[u]=t[u]+(n[f]/2-l[f]/2)}}return t}},73967:function(e,t,n){n.d(t,{Z:()=>r});function r(e){return"x"===e?"y":"x"}},77421:function(e,t,n){n.d(t,{Z:()=>i});var r=n(72581);let i={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=(0,r.Z)({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}}},7994:function(e,t,n){n.d(t,{Z:()=>function e(t,n){void 0===n&&(n=[]);var l,a=(0,r.Z)(t),c=a===(null==(l=t.ownerDocument)?void 0:l.body),d=(0,o.Z)(a),h=c?[d].concat(d.visualViewport||[],(0,s.Z)(a)?a:[]):a,p=n.concat(h);return c?p:p.concat(e((0,i.Z)(h)))}});var r=n(97523),i=n(95923),o=n(62057),s=n(60611)},82122:function(e,t,n){n.d(t,{Z:()=>o});var r=n(6206),i=n(87701);let o={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,o=e.name,s=n.offset,l=void 0===s?[0,0]:s,a=i.Ct.reduce(function(e,n){var o,s,a,c,d,h;return e[n]=(o=t.rects,s=(0,r.Z)(n),a=[i.t$,i.we].indexOf(s)>=0?-1:1,d=(c="function"==typeof l?l(Object.assign({},o,{placement:n})):l)[0],h=c[1],d=d||0,h=(h||0)*a,[i.t$,i.F2].indexOf(s)>=0?{x:h,y:d}:{x:d,y:h}),e},{}),c=a[t.placement],d=c.x,h=c.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=d,t.modifiersData.popperOffsets.y+=h),t.modifiersData[o]=a}}},82163:function(e,t,n){n.d(t,{Z:()=>i});var r=n(62057);function i(e){var t=(0,r.Z)(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}},82372:function(e,t,n){n.d(t,{Z:()=>o});var r=n(62057),i={passive:!0};let o={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,o=e.options,s=o.scroll,l=void 0===s||s,a=o.resize,c=void 0===a||a,d=(0,r.Z)(t.elements.popper),h=[].concat(t.scrollParents.reference,t.scrollParents.popper);return l&&h.forEach(function(e){e.addEventListener("scroll",n.update,i)}),c&&d.addEventListener("resize",n.update,i),function(){l&&h.forEach(function(e){e.removeEventListener("scroll",n.update,i)}),c&&d.removeEventListener("resize",n.update,i)}},data:{}}},83311:function(e,t,n){n.d(t,{Ax:()=>M,FC:()=>g,GJ:()=>T,Mn:()=>O,Pu:()=>m,dR:()=>E,k9:()=>b,nd:()=>w,nj:()=>N,vs:()=>s,wx:()=>H});var r=n(41084);class i{constructor(e,t,n){this.pos=e,this.delInfo=t,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 o{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&o.empty)return o.empty}recover(e){let t=0,n=65535&e;if(!this.inverted)for(let e=0;ee)break;let c=this.ranges[l+o],d=this.ranges[l+s],h=a+c;if(e<=h){let o=c?e==a?-1:e==h?1:t:t,s=a+r+(o<0?0:d);if(n)return s;let p=e==(t<0?a:h)?null:l/3+(e-a)*65536,u=e==a?2:e==h?1:4;return(t<0?e!=a:e!=h)&&(u|=8),new i(s,u,p)}r+=d-c}return n?e+r:new i(e+r,0,null)}touches(e,t){let n=0,r=65535&t,i=this.inverted?2:1,o=this.inverted?1:2;for(let t=0;te)break;let l=this.ranges[t+i];if(e<=s+l&&t==3*r)return!0;n+=this.ranges[t+o]-l}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new s;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;nn&&te.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,i),t.openStart,t.openEnd);return c.fromReplace(e,this.from,this.to,o)}invert(){return new p(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new h(t.pos,n.pos,this.mark)}merge(e){return e instanceof h&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new h(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new h(t.from,t.to,e.markFromJSON(t.mark))}}a.jsonID("addMark",h);class p extends a{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new r.p2(d(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return c.fromReplace(e,this.from,this.to,n)}invert(){return new h(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new p(t.pos,n.pos,this.mark)}merge(e){return e instanceof p&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new p(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new p(t.from,t.to,e.markFromJSON(t.mark))}}a.jsonID("removeMark",p);class u extends a{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return c.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return c.fromReplace(e,this.pos,this.pos+1,new r.p2(r.HY.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;nn.pos?null:new g(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new g(t.from,t.to,t.gapFrom,t.gapTo,r.p2.fromJSON(e,t.slice),t.insert,!!t.structure)}}function y(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function v(e,t,n,i=n.contentMatch,o=!0){let s=e.doc.nodeAt(t),l=[],a=t+1;for(let t=0;t=0;t--)e.step(l[t])}function b(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(n{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let i=e.mapping.slice(r).map(n+1+o+s.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function S(e,t,n,r){t.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+o);e.replaceWith(i,i+1,t.type.schema.text("\n"))}})}function M(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>o;e--,t--){let n=i.node(e),o=i.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),l=r&&r[t+1];l&&(s=s.replaceChild(0,l.type.create(l.attrs)));let a=r&&r[t]||n;if(!n.canReplace(o+1,n.childCount)||!a.type.validContent(s))return!1}let l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}function O(e,t){let n=e.resolve(t),r=n.index();return C(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function C(e,t){return!!(e&&t&&!e.isLeaf&&function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i0?(i=r.node(e+1),s++,o=r.node(e).maybeChild(s)):(i=r.node(e).maybeChild(s-1),o=r.node(e+1)),i&&!i.isTextblock&&C(i,o)&&r.node(e).canReplace(s,s+1))return t;if(0==e)break;t=n<0?r.before(e):r.after(e)}}function N(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,o=r.index(t)+ +(n>0),s=r.node(t),l=!1;if(1==e)l=s.canReplace(o,o,i);else{let e=s.contentMatchAt(o).findWrapping(i.firstChild.type);l=e&&s.canReplaceWith(o,o,e[0])}if(l)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function E(e,t,n=t,i=r.p2.empty){if(t==n&&!i.size)return null;let o=e.resolve(t),s=e.resolve(n);return A(o,s,i)?new m(t,n,i):new D(o,s,i).fit()}function A(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}a.jsonID("replaceAround",g);class D{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=r.HY.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=r.HY.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let o=this.placed,s=n.depth,l=i.depth;for(;s&&l&&1==o.childCount;)o=o.firstChild.content,s--,l--;let a=new r.p2(o,s,l);return e>-1?new g(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new m(n.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,i=null,o=(n?(i=P(this.unplaced.content,n-1).firstChild).content:this.unplaced.content).firstChild;for(let e=this.depth;e>=0;e--){let{type:s,match:l}=this.frontier[e],a,c=null;if(1==t&&(o?l.matchType(o.type)||(c=l.fillBefore(r.HY.from(o),!1)):i&&s.compatibleContent(i.type)))return{sliceDepth:n,frontierDepth:e,parent:i,inject:c};if(2==t&&o&&(a=l.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:e,parent:i,wrap:a};if(i&&l.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=P(e,t);return!!i.childCount&&!i.firstChild.isLeaf&&(this.unplaced=new r.p2(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=P(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new r.p2(R(e,t-1,1),t-1,o?t-1:n)}else this.unplaced=new r.p2(R(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let e=0;e1||0==a||e.content.size)&&(h=t,d.push(function e(t,n,i){if(n<=0)return t;let o=t.content;return n>1&&(o=o.replaceChild(0,e(o.firstChild,n-1,1==o.childCount?i-1:0))),n>0&&(o=t.type.contentMatch.fillBefore(o).append(o),i<=0&&(o=o.append(t.type.contentMatch.matchFragment(o).fillBefore(r.HY.empty,!0)))),t.copy(o)}(e.mark(p.allowedMarks(e.marks)),1==c?a:0,c==l.childCount?u:-1)))}let f=c==l.childCount;f||(u=-1),this.placed=I(this.placed,t,r.HY.from(d)),this.frontier[t].match=h,f&&u<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=l;e1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){n:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t=0;n--){let{match:t,type:r}=this.frontier[n],i=B(e,n,r,t,!0);if(!i||i.childCount)continue n}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=I(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=I(this.placed,this.depth,r.HY.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(r.HY.empty,!0);e.childCount&&(this.placed=I(this.placed,this.frontier.length,e))}}function R(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(R(e.firstChild.content,t-1,n)))}function I(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(I(e.lastChild.content,t-1,n)))}function P(e,t){for(let n=0;n=0;i--){let r=e.start(i);if(rt.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}class $ extends a{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return c.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let i=t.type.create(n,null,t.marks);return c.fromReplace(e,this.pos,this.pos+1,new r.p2(r.HY.from(i),0,+!t.isLeaf))}getMap(){return o.empty}invert(e){return new $(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new $(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new $(t.pos,t.attr,t.value)}}a.jsonID("attr",$);class L extends a{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return c.ok(n)}getMap(){return o.empty}invert(e){return new L(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new L(t.attr,t.value)}}a.jsonID("docAttr",L);let V=class extends Error{};(V=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype),V.prototype.constructor=V,V.prototype.name="TransformError";class H{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new s}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new V(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=r.p2.empty){let i=E(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new r.p2(r.HY.from(n),0,0))}delete(e,t){return this.replace(e,t,r.p2.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return!function(e,t,n,i){if(!i.size)return e.deleteRange(t,n);let o=e.doc.resolve(t),s=e.doc.resolve(n);if(A(o,s,i))return e.step(new m(t,n,i));let l=z(o,e.doc.resolve(n));0==l[l.length-1]&&l.pop();let a=-(o.depth+1);l.unshift(a);for(let e=o.depth,t=o.pos-1;e>0;e--,t--){let n=o.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;l.indexOf(e)>-1?a=e:o.before(e)==t&&l.splice(1,0,-e)}let c=l.indexOf(a),d=[],h=i.openStart;for(let e=i.content,t=0;;t++){let n=e.firstChild;if(d.push(n),t==i.openStart)break;e=n.content}for(let e=h-1;e>=0;e--){var p;let t=d[e],n=(p=t.type).spec.defining||p.spec.definingForContent;if(n&&!t.sameMarkup(o.node(Math.abs(a)-1)))h=e;else if(n||!t.type.isTextblock)break}for(let t=i.openStart;t>=0;t--){let a=(t+h+1)%(i.openStart+1),p=d[a];if(p)for(let t=0;to){let e=s.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(r.HY.empty,!0))}return t}(i.content,0,i.openStart,a),a,i.openEnd))}}let u=e.steps.length;for(let r=l.length-1;r>=0&&(e.replace(t,n,i),!(e.steps.length>u));r--){let e=l[r];e<0||(t=o.before(e),n=s.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){var i=e,o=t;if(!n.isInline&&i==o&&this.doc.resolve(i).parent.content.size){let e=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t0&&(s||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(t-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return e.delete(r.before(o),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return!function(e,t,n){let{$from:i,$to:o,depth:s}=t,l=i.before(s+1),a=o.after(s+1),c=l,d=a,h=r.HY.empty,p=0;for(let e=s,t=!1;e>n;e--)t||i.index(e)>0?(t=!0,h=r.HY.from(i.node(e).copy(h)),p++):c--;let u=r.HY.empty,f=0;for(let e=s,t=!1;e>n;e--)t||o.after(e+1)=0;e--){if(i.size){let t=n[e].type.contentMatch.matchFragment(i);if(!t||!t.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=r.HY.from(n[e].type.create(n[e].attrs,i))}let o=t.start,s=t.end;e.step(new g(o,s,o,s,new r.p2(i,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,i=null){var o=this;if(!n.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let s=o.steps.length;return o.doc.nodesBetween(e,t,(e,t)=>{var l,a,c;let d,h,p="function"==typeof i?i(e):i;if(e.isTextblock&&!e.hasMarkup(n,p)&&(l=o.doc,a=o.mapping.slice(s).map(t),c=n,h=(d=l.resolve(a)).index(),d.parent.canReplaceWith(h,h+1,c))){let i=null;if(n.schema.linebreakReplacement){let e="pre"==n.whitespace,t=!!n.contentMatch.matchType(n.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}!1===i&&S(o,e,t,s),v(o,o.mapping.slice(s).map(t,1),n,void 0,null===i);let l=o.mapping.slice(s),a=l.map(t,1),c=l.map(t+e.nodeSize,1);return o.step(new g(a,c,a+1,c-1,new r.p2(r.HY.from(n.create(p,null,e.marks)),0,0),1,!0)),!0===i&&k(o,e,t,s),!1}}),this}setNodeMarkup(e,t,n=null,i){return!function(e,t,n,i,o){let s=e.doc.nodeAt(t);if(!s)throw RangeError("No node at given position");n||(n=s.type);let l=n.create(i,null,o||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,l);if(!n.validContent(s.content))throw RangeError("Invalid content for node type "+n.name);e.step(new g(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new r.p2(r.HY.from(l),0,0),1,!0))}(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new $(e,t,n)),this}setDocAttribute(e,t){return this.step(new L(e,t)),this}addNodeMark(e,t){return this.step(new u(e,t)),this}removeNodeMark(e,t){if(!(t instanceof r.vc)){let n=this.doc.nodeAt(e);if(!n)throw RangeError("No node at position "+e);if(!(t=t.isInSet(n.marks)))return this}return this.step(new f(e,t)),this}split(e,t=1,n){return!function(e,t,n=1,i){let o=e.doc.resolve(t),s=r.HY.empty,l=r.HY.empty;for(let e=o.depth,t=o.depth-n,a=n-1;e>t;e--,a--){s=r.HY.from(o.node(e).copy(s));let t=i&&i[a];l=r.HY.from(t?t.type.create(t.attrs,l):o.node(e).copy(l))}e.step(new m(t,t,new r.p2(s.append(l),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){var r;let i,o,s,l;return r=this,s=[],l=[],r.doc.nodesBetween(e,t,(r,a,c)=>{if(!r.isInline)return;let d=r.marks;if(!n.isInSet(d)&&c.type.allowsMarkType(n.type)){let c=Math.max(a,e),u=Math.min(a+r.nodeSize,t),f=n.addToSet(d);for(let e=0;er.step(e)),l.forEach(e=>r.step(e)),this}removeMark(e,t,n){var i;let o,s;return i=this,o=[],s=0,i.doc.nodesBetween(e,t,(i,l)=>{if(!i.isInline)return;s++;let a=null;if(n instanceof r.ZU){let e=i.marks,t;for(;t=n.isInSet(e);)(a||(a=[])).push(t),e=t.removeFromSet(e)}else n?n.isInSet(i.marks)&&(a=[n]):a=i.marks;if(a&&a.length){let n=Math.min(l+i.nodeSize,t);for(let t=0;ti.step(new p(e.from,e.to,e.style))),this}clearIncompatible(e,t,n){return v(this,e,t,n),this}}},85918:function(e,t,n){n.d(t,{Z:()=>r});function r(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}},86413:function(e,t,n){n.d(t,{Z:()=>l});var r=n(14943),i=n(87701),o=n(23161),s=n(6206);function l(e,t){void 0===t&&(t={});var n=t,l=n.placement,a=n.boundary,c=n.rootBoundary,d=n.padding,h=n.flipVariations,p=n.allowedAutoPlacements,u=void 0===p?i.Ct:p,f=(0,r.Z)(l),m=f?h?i.bw:i.bw.filter(function(e){return(0,r.Z)(e)===f}):i.mv,g=m.filter(function(e){return u.indexOf(e)>=0});0===g.length&&(g=m);var y=g.reduce(function(t,n){return t[n]=(0,o.Z)(e,{placement:n,boundary:a,rootBoundary:c,padding:d})[(0,s.Z)(n)],t},{});return Object.keys(y).sort(function(e,t){return y[e]-y[t]})}},87701:function(e,t,n){n.d(t,{BL:()=>c,Ct:()=>g,F2:()=>o,I:()=>i,Pj:()=>p,YP:()=>f,bw:()=>m,d7:()=>l,k5:()=>u,mv:()=>a,t$:()=>s,ut:()=>d,we:()=>r,xs:()=>y,zV:()=>h});var r="top",i="bottom",o="right",s="left",l="auto",a=[r,i,o,s],c="start",d="end",h="clippingParents",p="viewport",u="popper",f="reference",m=a.reduce(function(e,t){return e.concat([t+"-"+c,t+"-"+d])},[]),g=[].concat(a,[l]).reduce(function(e,t){return e.concat([t,t+"-"+c,t+"-"+d])},[]),y=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"]},88897:function(e,t,n){n.d(t,{EG:()=>eu,Is:()=>H,ML:()=>eE,NB:()=>eI,P1:()=>y,Q:()=>ea,S0:()=>eR,hj:()=>L,pr:()=>ef,vc:()=>I,x2:()=>eA,xh:()=>K,zK:()=>eD});var r=n(92007),i=n(45901),o=n(41025),s=n(41084),l=n(83311),a=n(21834),c=n(18923);function d(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class h{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(o);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],l=!!e,a=e||i.tr,c={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(a,t),i=n(...e)(r);return s.push(i),c}])),run:()=>(l||!t||a.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(a),s.every(e=>!0===e))};return c}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s={tr:e,editor:r,view:o,state:d({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(s)]))}};return s}}class p{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}}function u(e,t,n){return void 0===e.config[t]&&e.parent?u(e.parent,t,n):"function"==typeof e.config[t]?e.config[t].bind({...n,parent:e.parent?u(e.parent,t,n):null}):e.config[t]}function f(e){let t=e.filter(e=>"extension"===e.type);return{baseExtensions:t,nodeExtensions:e.filter(e=>"node"===e.type),markExtensions:e.filter(e=>"mark"===e.type)}}function m(e){let t=[],{nodeExtensions:n,markExtensions:r}=f(e),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage,extensions:i},r=u(e,"addGlobalAttributes",n);r&&r().forEach(e=>{e.types.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...o,...r}})})})})}),i.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage},r=u(e,"addAttributes",n);r&&Object.entries(r()).forEach(([n,r])=>{let i={...o,...r};"function"==typeof(null==i?void 0:i.default)&&(i.default=i.default()),(null==i?void 0:i.isRequired)&&(null==i?void 0:i.default)===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function g(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function y(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if("class"===e){let r=t?String(t).split(" "):[],i=n[e]?n[e].split(" "):[],o=r.filter(e=>!i.includes(e));n[e]=[...i,...o].join(" ")}else if("style"===e){let r=t?t.split(";").map(e=>e.trim()).filter(Boolean):[],i=n[e]?n[e].split(";").map(e=>e.trim()).filter(Boolean):[],o=new Map;i.forEach(e=>{let[t,n]=e.split(":").map(e=>e.trim());o.set(t,n)}),r.forEach(e=>{let[t,n]=e.split(":").map(e=>e.trim());o.set(t,n)}),n[e]=Array.from(o.entries()).map(([e,t])=>`${e}: ${t}`).join("; ")}else n[e]=t}),n},{})}function v(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>y(e,t),{})}function b(e){return"function"==typeof e}function w(e,t,...n){return b(e)?t?e.bind(t)(...n):e(...n):e}function x(e,t){return"style"in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;let i=t.reduce((e,t)=>{var r;let i=t.attribute.parseHTML?t.attribute.parseHTML(n):"string"!=typeof(r=n.getAttribute(t.name))?r:r.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(r):"true"===r||"false"!==r&&r;return null==i?e:{...e,[t.name]:i}},{});return{...r,...i}}}}function k(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!("attrs"===e&&function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t))}function S(e,t){return t.nodes[e]||t.marks[e]||null}function M(e,t){return Array.isArray(t)?t.some(t=>("string"==typeof t?t:t.name)===e.name):t}function O(e,t){let n=s.PW.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}let C=(e,t=500)=>{let n="",r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,o)=>{var s,l;let a=(null==(l=(s=e.type.spec).toText)?void 0:l.call(s,{node:e,pos:t,parent:i,index:o}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?a:a.slice(0,Math.max(0,r-t))}),n};function T(e){return"[object RegExp]"===Object.prototype.toString.call(e)}class N{constructor(e){this.find=e.find,this.handler=e.handler}}let E=(e,t)=>{if(T(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,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};function A(e){var t;let{editor:n,from:r,to:i,text:o,rules:s,plugin:l}=e,{view:a}=n;if(a.composing)return!1;let c=a.state.doc.resolve(r);if(c.parent.type.spec.code||(null==(t=c.nodeBefore||c.nodeAfter)?void 0:t.marks.find(e=>e.type.spec.code)))return!1;let p=!1,u=C(c)+o;return s.forEach(e=>{if(p)return;let t=E(u,e.find);if(!t)return;let s=a.state.tr,c=d({state:a.state,transaction:s}),f={from:r-(t[0].length-o.length),to:i},{commands:m,chain:g,can:y}=new h({editor:n,state:c});null!==e.handler({state:c,range:f,match:t,commands:m,chain:g,can:y})&&s.steps.length&&(s.setMeta(l,{transform:s,from:r,to:i,text:o}),a.dispatch(s),p=!0)}),p}function D(e){return"Object"===Object.prototype.toString.call(e).slice(8,-1)&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function R(e,t){let n={...e};return D(e)&&D(t)&&Object.keys(t).forEach(r=>{D(t[r])&&D(e[r])?n[r]=R(e[r],t[r]):n[r]=t[r]}),n}class I{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=w(u(this,"addOptions",{name:this.name}))),this.storage=w(u(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new I(e)}configure(e={}){let t=this.extend({...this.config,addOptions:()=>R(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new I(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=w(u(t,"addOptions",{name:t.name})),t.storage=w(u(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>(null==e?void 0:e.type.name)===t.name))return!1;let o=i.find(e=>(null==e?void 0:e.type.name)===t.name);return o&&n.removeStoredMark(o),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}}let P=(e,t,n)=>{if(T(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n}):[]},B=null,z=e=>{var t;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(t=n.clipboardData)||t.setData("text/html",e),n};class ${constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=$.resolve(e),this.schema=function(e,t){var n;let r=m(e),{nodeExtensions:i,markExtensions:o}=f(e),l=null==(n=i.find(e=>u(e,"topNode")))?void 0:n.name,a=Object.fromEntries(i.map(n=>{let i=r.filter(e=>e.type===n.name),o={name:n.name,options:n.options,storage:n.storage,editor:t},s=k({...e.reduce((e,t)=>{let r=u(t,"extendNodeSchema",o);return{...e,...r?r(n):{}}},{}),content:w(u(n,"content",o)),marks:w(u(n,"marks",o)),group:w(u(n,"group",o)),inline:w(u(n,"inline",o)),atom:w(u(n,"atom",o)),selectable:w(u(n,"selectable",o)),draggable:w(u(n,"draggable",o)),code:w(u(n,"code",o)),whitespace:w(u(n,"whitespace",o)),linebreakReplacement:w(u(n,"linebreakReplacement",o)),defining:w(u(n,"defining",o)),isolating:w(u(n,"isolating",o)),attrs:Object.fromEntries(i.map(e=>{var t;return[e.name,{default:null==(t=null==e?void 0:e.attribute)?void 0:t.default}]}))}),l=w(u(n,"parseHTML",o));l&&(s.parseDOM=l.map(e=>x(e,i)));let a=u(n,"renderHTML",o);a&&(s.toDOM=e=>a({node:e,HTMLAttributes:v(e,i)}));let c=u(n,"renderText",o);return c&&(s.toText=c),[n.name,s]})),c=Object.fromEntries(o.map(n=>{let i=r.filter(e=>e.type===n.name),o={name:n.name,options:n.options,storage:n.storage,editor:t},s=k({...e.reduce((e,t)=>{let r=u(t,"extendMarkSchema",o);return{...e,...r?r(n):{}}},{}),inclusive:w(u(n,"inclusive",o)),excludes:w(u(n,"excludes",o)),group:w(u(n,"group",o)),spanning:w(u(n,"spanning",o)),code:w(u(n,"code",o)),attrs:Object.fromEntries(i.map(e=>{var t;return[e.name,{default:null==(t=null==e?void 0:e.attribute)?void 0:t.default}]}))}),l=w(u(n,"parseHTML",o));l&&(s.parseDOM=l.map(e=>x(e,i)));let a=u(n,"renderHTML",o);return a&&(s.toDOM=e=>a({mark:e,HTMLAttributes:v(e,i)})),[n.name,s]}));return new s.V_({topNode:l,nodes:a,marks:c})}(this.extensions,t),this.setupExtensions()}static resolve(e){var t;let n=$.sort($.flatten(e)),r=Array.from(new Set((t=n.map(e=>e.name)).filter((e,n)=>t.indexOf(e)!==n)));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(e=>`'${e}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(e=>{let t={name:e.name,options:e.options,storage:e.storage},n=u(e,"addExtensions",t);return n?[e,...this.flatten(n())]:e}).flat(10)}static sort(e){return e.sort((e,t)=>{let n=u(e,"priority")||100,r=u(t,"priority")||100;return n>r?-1:+(n{let n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:S(t.name,this.schema)},r=u(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){let{editor:e}=this,t=$.sort([...this.extensions].reverse()),n=[],i=[],l=t.map(t=>{let r={name:t.name,options:t.options,storage:t.storage,editor:e,type:S(t.name,this.schema)},s=[],l=u(t,"addKeyboardShortcuts",r),a={};if("mark"===t.type&&u(t,"exitable",r)&&(a.ArrowRight=()=>I.handleExit({editor:e,mark:t})),l){let t=Object.fromEntries(Object.entries(l()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let c=(0,o.h)(a);s.push(c);let d=u(t,"addInputRules",r);M(t,e.options.enableInputRules)&&d&&n.push(...d());let h=u(t,"addPasteRules",r);M(t,e.options.enablePasteRules)&&h&&i.push(...h());let p=u(t,"addProseMirrorPlugins",r);if(p){let e=p();s.push(...e)}return s}).flat();return[function(e){let{editor:t,rules:n}=e,i=new r.Sy({state:{init:()=>null,apply(e,r,o){let l=e.getMeta(i);if(l)return l;let a=e.getMeta("applyInputRules");return a&&setTimeout(()=>{let{text:e}=a;"string"==typeof e||(e=O(s.HY.from(e),o.schema));let{from:r}=a,l=r+e.length;A({editor:t,from:r,to:l,text:e,rules:n,plugin:i})}),e.selectionSet||e.docChanged?null:r}},props:{handleTextInput:(e,r,o,s)=>A({editor:t,from:r,to:o,text:s,rules:n,plugin:i}),handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:r}=e.state.selection;r&&A({editor:t,from:r.pos,to:r.pos,text:"",rules:n,plugin:i})}),!1)},handleKeyDown(e,r){if("Enter"!==r.key)return!1;let{$cursor:o}=e.state.selection;return!!o&&A({editor:t,from:o.pos,to:o.pos,text:"\n",rules:n,plugin:i})}},isInputRules:!0});return i}({editor:e,rules:n}),...function(e){let t,{editor:n,rules:i}=e,o=null,l=!1,a=!1,c="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{t="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{t=null}let p=({state:e,from:r,to:i,rule:o,pasteEvt:s})=>{let l=e.tr;if(function(e){let{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=e,{commands:a,chain:c,can:d}=new h({editor:t,state:n}),p=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(!e.isTextblock||e.type.spec.code)return;let h=Math.max(r,t),u=Math.min(i,t+e.content.size);P(e.textBetween(h-t,u-t,void 0,""),o.find,s).forEach(e=>{if(void 0===e.index)return;let t=h+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},u=o.handler({state:n,range:i,match:e,commands:a,chain:c,can:d,pasteEvent:s,dropEvent:l});p.push(u)})}),p.every(e=>null!==e)}({editor:n,state:d({state:e,transaction:l}),from:Math.max(r-1,0),to:i.b-1,rule:o,pasteEvent:s,dropEvent:t})&&l.steps.length){try{t="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{t=null}return c="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,l}};return i.map(e=>new r.Sy({view(e){let t=t=>{var r;(o=(null==(r=e.dom.parentElement)?void 0:r.contains(t.target))?e.dom.parentElement:null)&&(B=n)},r=()=>{B&&(B=null)};return window.addEventListener("dragstart",t),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",t),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(e,n)=>{if(a=o===e.dom.parentElement,t=n,!a){let e=B;e&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{var n;let r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return c=t,l=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{let i=t[0],o="paste"===i.getMeta("uiEvent")&&!l,d="drop"===i.getMeta("uiEvent")&&!a,h=i.getMeta("applyPasteRules"),u=!!h;if(!o&&!d&&!u)return;if(u){let{text:t}=h;"string"==typeof t||(t=O(s.HY.from(t),r.schema));let{from:n}=h,i=n+t.length;return p({rule:e,state:r,from:n,to:{b:i},pasteEvt:z(t)})}let f=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if("number"==typeof f&&m&&f!==m.b)return p({rule:e,state:r,from:f,to:m,pasteEvt:c})}}))}({editor:e,rules:i}),...l]}get attributes(){return m(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=f(this.extensions);return Object.fromEntries(t.filter(e=>!!u(e,"addNodeView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r={name:t.name,options:t.options,storage:t.storage,editor:e,type:g(t.name,this.schema)},i=u(t,"addNodeView",r);return i?[t.name,(r,o,s,l,a)=>{let c=v(r,n);return i()({node:r,view:o,getPos:s,decorations:l,innerDecorations:a,editor:e,extension:t,HTMLAttributes:c})}]:[]}))}setupExtensions(){this.extensions.forEach(e=>{var t;this.editor.extensionStorage[e.name]=e.storage;let n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:S(e.name,this.schema)};"mark"===e.type&&(null==(t=w(u(e,"keepOnSplit",n)))||t)&&this.splittableMarks.push(e.name);let r=u(e,"onBeforeCreate",n),i=u(e,"onCreate",n),o=u(e,"onUpdate",n),s=u(e,"onSelectionUpdate",n),l=u(e,"onTransaction",n),a=u(e,"onFocus",n),c=u(e,"onBlur",n),d=u(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),i&&this.editor.on("create",i),o&&this.editor.on("update",o),s&&this.editor.on("selectionUpdate",s),l&&this.editor.on("transaction",l),a&&this.editor.on("focus",a),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)})}}class L{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=w(u(this,"addOptions",{name:this.name}))),this.storage=w(u(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new L(e)}configure(e={}){let t=this.extend({...this.config,addOptions:()=>R(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new L({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=w(u(t,"addOptions",{name:t.name})),t.storage=w(u(t,"addStorage",{name:t.name,options:t.options})),t}}function V(e,t,n){let{from:r,to:i}=t,{blockSeparator:o="\n\n",textSerializers:s={}}=n||{},l="";return e.nodesBetween(r,i,(e,n,a,c)=>{var d;e.isBlock&&n>r&&(l+=o);let h=null==s?void 0:s[e.type.name];if(h)return a&&(l+=h({node:e,pos:n,parent:a,index:c,range:t})),!1;e.isText&&(l+=null==(d=null==e?void 0:e.text)?void 0:d.slice(Math.max(r,n)-n,i-n))}),l}function H(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}let F=L.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new r.Sy({key:new r.H$("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map(e=>e.$from.pos)),l=Math.max(...o.map(e=>e.$to.pos)),a=H(n);return V(r,{from:s,to:l},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}});function Z(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:T(t[r])?t[r].test(e[r]):t[r]===e[r])}function j(e,t,n={}){return e.find(e=>e.type===t&&Z(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function q(e,t,n={}){return!!j(e,t,n)}function W(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if(i.node&&i.node.marks.some(e=>e.type===t)||(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some(e=>e.type===t)||(n=n||(null==(r=i.node.marks[0])?void 0:r.attrs),!j([...i.node.marks],t,n)))return;let o=i.index,s=e.start()+i.offset,l=o+1,a=s+i.node.nodeSize;for(;o>0&&q([...e.parent.child(o-1).marks],t,n);)o-=1,s-=e.parent.child(o).nodeSize;for(;l{let t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){let r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&G(r)}return e};function X(e){let t=`${e}`;return G(new window.DOMParser().parseFromString(t,"text/html").body)}function Q(e,t,n){if(e instanceof s.NB||e instanceof s.HY)return e;n={slice:!0,parseOptions:{},...n};let r="object"==typeof e&&null!==e,i="string"==typeof e;if(r)try{if(Array.isArray(e)&&e.length>0)return s.HY.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Q("",t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i="",o=new s.V_({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:e=>(r=!0,i="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?s.aw.fromSchema(o).parseSlice(X(e),n.parseOptions):s.aw.fromSchema(o).parse(X(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error("[tiptap error]: Invalid HTML content",{cause:Error(`Invalid element found: ${i}`)})}let r=s.aw.fromSchema(t);return n.slice?r.parseSlice(X(e),n.parseOptions).content:r.parse(X(e),n.parseOptions)}return Q("",t,n)}let ee=e=>!("type"in e);function et(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function en(e,t,n={}){let{from:r,to:i,empty:o}=e.selection,s=t?g(t,e.schema):null,l=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);l.push({node:e,from:n,to:o})});let a=i-r,c=l.filter(e=>!s||s.name===e.node.type.name).filter(e=>Z(e.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((e,t)=>e+t.to-t.from,0)>=a}function er(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function ei(e,t){let n="string"==typeof t?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}function eo(e,t,n={},r={}){return Q(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}function es(e,t){let n=J(t,e.schema),{from:r,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{s.push(...e.marks)});let l=s.find(e=>e.type.name===n.name);return l?{...l.attrs}:{}}function el(e){return t=>(function(e,t){for(let n=e.depth;n>0;n-=1){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}})(t.$from,e)}function ea(e,t){let n={from:0,to:e.content.size};return V(e,n,t)}function ec(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return!!r&&r.attribute.keepOnSplit}))}function ed(e,t,n={}){let{empty:r,ranges:i}=e.selection,o=t?J(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!o||o.name===e.type.name).find(e=>Z(e.attrs,n,{strict:!1}));let s=0,l=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);s+=o-n,l.push(...e.marks.map(e=>({mark:e,from:n,to:o})))})}),0===s)return!1;let a=l.filter(e=>!o||o.name===e.mark.type.name).filter(e=>Z(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),c=l.filter(e=>!o||e.mark.type!==o&&e.mark.type.excludes(o)).reduce((e,t)=>e+t.to-t.from,0);return(a>0?a+c:a)>=s}function eh(e,t){let{nodeExtensions:n}=f(t),r=n.find(t=>t.name===e);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=w(u(r,"group",i));return"string"==typeof o&&o.split(" ").includes("list")}function ep(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if("hardBreak"===e.type.name)return!0;if(e.isText)return/^\s*$/m.test(null!=(r=e.text)?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach(e=>{!1!==r&&(ep(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function eu(e){return e instanceof r.qv}function ef(e,t,n){let r=e.state.doc.content.size,i=Y(t,0,r),o=Y(n,0,r),s=e.coordsAtPos(i),l=e.coordsAtPos(o,-1),a=Math.min(s.top,l.top),c=Math.max(s.bottom,l.bottom),d=Math.min(s.left,l.left),h=Math.max(s.right,l.right),p={top:a,bottom:c,left:d,right:h,width:h-d,height:c-a,x:d,y:a};return{...p,toJSON:()=>p}}function em(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>null==t?void 0:t.includes(e.type.name));e.tr.ensureMarks(r)}}let eg=(e,t)=>{let n=el(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===(null==i?void 0:i.type)&&(0,l.Mn)(e.doc,n.pos))||(e.join(n.pos),!0)},ey=(e,t)=>{let n=el(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===(null==i?void 0:i.type)&&(0,l.Mn)(e.doc,r))||(e.join(r),!0)};var ev=Object.freeze({__proto__:null,blur:()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())}),!0),clearContent:(e=!1)=>({commands:t})=>t.setContent("",e),clearNodes:()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return!n||(i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,o=r.resolve(i.map(n)),s=r.resolve(i.map(n+e.nodeSize)),a=o.blockRange(s);if(!a)return;let c=(0,l.k9)(a);if(e.type.isTextblock){let{defaultType:e}=o.parent.contentMatchAt(o.index());t.setNodeMarkup(a.start,e)}(c||0===c)&&t.lift(a,c)})}),!0)},command:e=>t=>e(t),createParagraphNear:()=>({state:e,dispatch:t})=>(0,a.mD)(e,t),cut:(e,t)=>({editor:n,tr:i})=>{let{state:o}=n,s=o.doc.slice(e.from,e.to);i.deleteRange(e.from,e.to);let l=i.mapping.map(t);return i.insert(l,s.content),i.setSelection(new r.Bs(i.doc.resolve(l-1))),!0},deleteCurrentNode:()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;n-=1)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1},deleteNode:e=>({tr:t,state:n,dispatch:r})=>{let i=g(e,n.schema),o=t.selection.$anchor;for(let e=o.depth;e>0;e-=1)if(o.node(e).type===i){if(r){let n=o.before(e),r=o.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},deleteRange:e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},deleteSelection:()=>({state:e,dispatch:t})=>(0,a.NE)(e,t),enter:()=>({commands:e})=>e.keyboardShortcut("Enter"),exitCode:()=>({state:e,dispatch:t})=>(0,a.uo)(e,t),extendMarkRange:(e,t={})=>({tr:n,state:i,dispatch:o})=>{let s=J(e,i.schema),{doc:l,selection:a}=n,{$from:c,from:d,to:h}=a;if(o){let e=W(c,s,t);if(e&&e.from<=d&&e.to>=h){let t=r.Bs.create(l,e.from,e.to);n.setSelection(t)}}return!0},first:e=>t=>{let n="function"==typeof e?e(t):e;for(let e=0;e({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};let s=()=>{(U()||"Android"===navigator.platform||/android/i.test(navigator.userAgent))&&r.dom.focus(),requestAnimationFrame(()=>{!n.isDestroyed&&(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())})};if(r.hasFocus()&&null===e||!1===e)return!0;if(o&&null===e&&!K(n.state.selection))return s(),!0;let l=_(i.doc,e)||n.state.selection,a=n.state.selection.eq(l);return o&&(a||i.setSelection(l),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},forEach:(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),insertContent:(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),insertContentAt:(e,t,n)=>({tr:i,dispatch:o,editor:a})=>{var c;if(o){let o,d;n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};try{o=Q(t,a.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:null!=(c=n.errorOnInvalidContent)?c:a.options.enableContentCheck})}catch(e){return a.emit("contentError",{editor:a,error:e,disableCollaboration:()=>{a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}}),!1}let{from:h,to:p}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},u=!0,f=!0;if((ee(o)?o:[o]).forEach(e=>{e.check(),u=!!u&&e.isText&&0===e.marks.length,f=!!f&&e.isBlock}),h===p&&f){let{parent:e}=i.doc.resolve(h);!e.isTextblock||e.type.spec.code||e.childCount||(h-=1,p+=1)}if(u){if(Array.isArray(t))d=t.map(e=>e.text||"").join("");else if(t instanceof s.HY){let e="";t.forEach(t=>{t.text&&(e+=t.text)}),d=e}else d="object"==typeof t&&t&&t.text?t.text:t;i.insertText(d,h,p)}else d=o,i.replaceWith(h,p,d);n.updateSelection&&function(e,t,n){let i=e.steps.length-1;if(i{0===a&&(a=r)}),e.setSelection(r.Y1.near(e.doc.resolve(a),-1))}(i,i.steps.length-1,0),n.applyInputRules&&i.setMeta("applyInputRules",{from:h,text:d}),n.applyPasteRules&&i.setMeta("applyPasteRules",{from:h,text:d})}return!0},joinBackward:()=>({state:e,dispatch:t})=>(0,a.al)(e,t),joinDown:()=>({state:e,dispatch:t})=>(0,a.Ig)(e,t),joinForward:()=>({state:e,dispatch:t})=>(0,a.Y_)(e,t),joinItemBackward:()=>({state:e,dispatch:t,tr:n})=>{try{let r=(0,l.GJ)(e.doc,e.selection.$from.pos,-1);if(null==r)return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},joinItemForward:()=>({state:e,dispatch:t,tr:n})=>{try{let r=(0,l.GJ)(e.doc,e.selection.$from.pos,1);if(null==r)return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},joinTextblockBackward:()=>({state:e,dispatch:t})=>(0,a.rr)(e,t),joinTextblockForward:()=>({state:e,dispatch:t})=>(0,a.cR)(e,t),joinUp:()=>({state:e,dispatch:t})=>(0,a.MI)(e,t),keyboardShortcut:e=>({editor:t,view:n,tr:r,dispatch:i})=>{let o=(function(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"===s&&(s=" ");for(let e=0;e!["Alt","Ctrl","Meta","Shift"].includes(e)),l=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),a=t.captureTransaction(()=>{n.someProp("handleKeyDown",e=>e(n,l))});return null==a||a.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0},lift:(e,t={})=>({state:n,dispatch:r})=>{let i=g(e,n.schema);return!!en(n,i,t)&&(0,a.xb)(n,r)},liftEmptyBlock:()=>({state:e,dispatch:t})=>(0,a.X0)(e,t),liftListItem:e=>({state:t,dispatch:n})=>{let r=g(e,t.schema);return(0,c.IB)(r)(t,n)},newlineInCode:()=>({state:e,dispatch:t})=>(0,a.QK)(e,t),resetAttributes:(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=er("string"==typeof e?e:e.name,r.schema);return!!l&&("node"===l&&(o=g(e,r.schema)),"mark"===l&&(s=J(e,r.schema)),i&&n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{o&&o===e.type&&n.setNodeMarkup(r,void 0,ei(e.attrs,t)),s&&e.marks.length&&e.marks.forEach(i=>{s===i.type&&n.addMark(r,r+e.nodeSize,s.create(ei(i.attrs,t)))})})}),!0)},scrollIntoView:()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),selectAll:()=>({tr:e,dispatch:t})=>{if(t){let t=new r.C1(e.doc);e.setSelection(t)}return!0},selectNodeBackward:()=>({state:e,dispatch:t})=>(0,a._M)(e,t),selectNodeForward:()=>({state:e,dispatch:t})=>(0,a.o)(e,t),selectParentNode:()=>({state:e,dispatch:t})=>(0,a.N0)(e,t),selectTextblockEnd:()=>({state:e,dispatch:t})=>(0,a.nw)(e,t),selectTextblockStart:()=>({state:e,dispatch:t})=>(0,a.U9)(e,t),setContent:(e,t=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:l})=>{var a,c;let{doc:d}=o;if("full"!==n.preserveWhitespace){let l=eo(e,i.schema,n,{errorOnInvalidContent:null!=(a=r.errorOnInvalidContent)?a:i.options.enableContentCheck});return s&&o.replaceWith(0,d.content.size,l).setMeta("preventUpdate",!t),!0}return s&&o.setMeta("preventUpdate",!t),l.insertContentAt({from:0,to:d.content.size},e,{parseOptions:n,errorOnInvalidContent:null!=(c=r.errorOnInvalidContent)?c:i.options.enableContentCheck})},setMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:l}=o,a=J(e,r.schema);if(i)if(s){let e=es(r,a);n.addStoredMark(a.create({...e,...t}))}else l.forEach(e=>{let i=e.$from.pos,o=e.$to.pos;r.doc.nodesBetween(i,o,(e,r)=>{let s=Math.max(r,i),l=Math.min(r+e.nodeSize,o);e.marks.find(e=>e.type===a)?e.marks.forEach(e=>{a===e.type&&n.addMark(s,l,a.create({...e.attrs,...t}))}):n.addMark(s,l,a.create(t))})});return function(e,t,n){var r;let{selection:i}=t,o=null;if(K(i)&&(o=i.$cursor),o){let t=null!=(r=e.storedMarks)?r:o.marks();return!!n.isInSet(t)||!t.some(e=>e.type.excludes(n))}let{ranges:s}=i;return s.some(({$from:t,$to:r})=>{let i=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),o=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&o}return!i}),i})}(r,n,a)},setMeta:(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),setNode:(e,t={})=>({state:n,dispatch:r,chain:i})=>{let o,s=g(e,n.schema);return(n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock)?i().command(({commands:e})=>!!(0,a.uJ)(s,{...o,...t})(n)||e.clearNodes()).command(({state:e})=>(0,a.uJ)(s,{...o,...t})(e,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,i=Y(e,0,n.content.size),o=r.qv.create(n,i);t.setSelection(o)}return!0},setTextSelection:e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:i,to:o}="number"==typeof e?{from:e,to:e}:e,s=r.Bs.atStart(n).from,l=r.Bs.atEnd(n).to,a=Y(i,s,l),c=Y(o,s,l),d=r.Bs.create(n,a,c);t.setSelection(d)}return!0},sinkListItem:e=>({state:t,dispatch:n})=>{let r=g(e,t.schema);return(0,c.bw)(r)(t,n)},splitBlock:({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:i,editor:o})=>{let{selection:s,doc:a}=t,{$from:c,$to:d}=s,h=ec(o.extensionManager.attributes,c.node().type.name,c.node().attrs);if(s instanceof r.qv&&s.node.isBlock)return!!c.parentOffset&&!!(0,l.Ax)(a,c.pos)&&(i&&(e&&em(n,o.extensionManager.splittableMarks),t.split(c.pos).scrollIntoView()),!0);if(!c.parent.isBlock)return!1;let p=d.parentOffset===d.parent.content.size,u=0===c.depth?void 0:function(e){for(let t=0;t({tr:n,state:i,dispatch:o,editor:a})=>{var c;let d=g(e,i.schema),{$from:h,$to:p}=i.selection,u=i.selection.node;if(u&&u.isBlock||h.depth<2||!h.sameParent(p))return!1;let f=h.node(-1);if(f.type!==d)return!1;let m=a.extensionManager.attributes;if(0===h.parent.content.size&&h.node(-1).childCount===h.indexAfter(-1)){if(2===h.depth||h.node(-3).type!==d||h.index(-2)!==h.node(-2).childCount-1)return!1;if(o){let e=s.HY.empty,i=h.index(-1)?1:h.index(-2)?2:3;for(let t=h.depth-i;t>=h.depth-3;t-=1)e=s.HY.from(h.node(t).copy(e));let o=h.indexAfter(-1){if(u>-1)return!1;e.isTextblock&&0===e.content.size&&(u=t+1)}),u>-1&&n.setSelection(r.Bs.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let y=p.pos===h.end()?f.contentMatchAt(0).defaultType:null,v={...ec(m,f.type.name,f.attrs),...t},b={...ec(m,h.node().type.name,h.node().attrs),...t};n.delete(h.pos,p.pos);let w=y?[{type:d,attrs:v},{type:y,attrs:b}]:[{type:d,attrs:v}];if(!(0,l.Ax)(n.doc,h.pos,2))return!1;if(o){let{selection:e,storedMarks:t}=i,{splittableMarks:r}=a.extensionManager,s=t||e.$to.parentOffset&&e.$from.marks();if(n.split(h.pos,2,w).scrollIntoView(),!s||!o)return!0;let l=s.filter(e=>r.includes(e.type.name));n.ensureMarks(l)}return!0},toggleList:(e,t,n,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:a,commands:c,can:d})=>{let{extensions:h,splittableMarks:p}=i.extensionManager,u=g(e,s.schema),f=g(t,s.schema),{selection:m,storedMarks:y}=s,{$from:v,$to:b}=m,w=v.blockRange(b),x=y||m.$to.parentOffset&&m.$from.marks();if(!w)return!1;let k=el(e=>eh(e.type.name,h))(m);if(w.depth>=1&&k&&w.depth-k.depth<=1){if(k.node.type===u)return c.liftListItem(f);if(eh(k.node.type.name,h)&&u.validContent(k.node.content)&&l)return a().command(()=>(o.setNodeMarkup(k.pos,u),!0)).command(()=>eg(o,u)).command(()=>ey(o,u)).run()}return n&&x&&l?a().command(()=>{let e=d().wrapInList(u,r),t=x.filter(e=>p.includes(e.type.name));return o.ensureMarks(t),!!e||c.clearNodes()}).wrapInList(u,r).command(()=>eg(o,u)).command(()=>ey(o,u)).run():a().command(()=>!!d().wrapInList(u,r)||c.clearNodes()).wrapInList(u,r).command(()=>eg(o,u)).command(()=>ey(o,u)).run()},toggleMark:(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=J(e,r.schema);return ed(r,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},toggleNode:(e,t,n={})=>({state:r,commands:i})=>{let o,s=g(e,r.schema),l=g(t,r.schema),a=en(r,s,n);return(r.selection.$anchor.sameParent(r.selection.$head)&&(o=r.selection.$anchor.parent.attrs),a)?i.setNode(l,o):i.setNode(s,{...o,...n})},toggleWrap:(e,t={})=>({state:n,commands:r})=>{let i=g(e,n.schema);return en(n,i,t)?r.lift(i):r.wrapIn(i,t)},undoInputRule:()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(i.text){let 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},unsetAllMarks:()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;return!!r||(t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0)},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=t,{selection:l}=n,a=J(e,r.schema),{$from:c,empty:d,ranges:h}=l;if(!i)return!0;if(d&&s){let{from:e,to:t}=l,r=null==(o=c.marks().find(e=>e.type===a))?void 0:o.attrs,i=W(c,a,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,a)}else h.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,a)});return n.removeStoredMark(a),!0},updateAttributes:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=er("string"==typeof e?e:e.name,r.schema);return!!l&&("node"===l&&(o=g(e,r.schema)),"mark"===l&&(s=J(e,r.schema)),i&&n.selection.ranges.forEach(e=>{let i,l,a,c,d=e.$from.pos,h=e.$to.pos;n.selection.empty?r.doc.nodesBetween(d,h,(e,t)=>{o&&o===e.type&&(a=Math.max(t,d),c=Math.min(t+e.nodeSize,h),i=t,l=e)}):r.doc.nodesBetween(d,h,(e,r)=>{r=d&&r<=h&&(o&&o===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),s&&e.marks.length&&e.marks.forEach(i=>{if(s===i.type){let o=Math.max(r,d),l=Math.min(r+e.nodeSize,h);n.addMark(o,l,s.create({...i.attrs,...t}))}}))}),l&&(void 0!==i&&n.setNodeMarkup(i,void 0,{...l.attrs,...t}),s&&l.marks.length&&l.marks.forEach(e=>{s===e.type&&n.addMark(a,c,s.create({...e.attrs,...t}))}))}),!0)},wrapIn:(e,t={})=>({state:n,dispatch:r})=>{let i=g(e,n.schema);return(0,a.ym)(i,t)(n,r)},wrapInList:(e,t={})=>({state:n,dispatch:r})=>{let i=g(e,n.schema);return(0,c.KI)(i,t)(n,r)}});let eb=L.create({name:"commands",addCommands:()=>({...ev})}),ew=L.create({name:"drop",addProseMirrorPlugins(){return[new r.Sy({key:new r.H$("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),ex=L.create({name:"editable",addProseMirrorPlugins(){return[new r.Sy({key:new r.H$("editable"),props:{editable:()=>this.editor.options.editable}})]}}),ek=new r.H$("focusEvents"),eS=L.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:e}=this;return[new r.Sy({key:ek,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),eM=L.create({name:"keymap",addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:i}=t,{empty:o,$anchor:s}=n,{pos:l,parent:a}=s,c=s.parent.isTextblock&&l>0?t.doc.resolve(l-1):s,d=c.parent.type.spec.isolating,h=s.pos-s.parentOffset,p=d&&1===c.parent.childCount?h===s.pos:r.Y1.atStart(i).from===l;return!!o&&!!a.type.isTextblock&&!a.textContent.length&&!!p&&(!p||"paragraph"!==s.parent.type.name)&&e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},i={...n},o={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return U()||et()?o:i},addProseMirrorPlugins(){return[new r.Sy({key:new r.H$("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta("composition")))return;let i=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),o=e.some(e=>e.getMeta("preventClearDocument"));if(!i||o)return;let{empty:s,from:l,to:a}=t.selection,c=r.Y1.atStart(t.doc).from,p=r.Y1.atEnd(t.doc).to;if(s||l!==c||a!==p||!ep(n.doc))return;let u=n.tr,f=d({state:n,transaction:u}),{commands:m}=new h({editor:this.editor,state:f});if(m.clearNodes(),u.steps.length)return u}})]}}),eO=L.create({name:"paste",addProseMirrorPlugins(){return[new r.Sy({key:new r.H$("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),eC=L.create({name:"tabindex",addProseMirrorPlugins(){return[new r.Sy({key:new r.H$("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class eT{get name(){return this.node.type.name}constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return null!=(e=this.actualDepth)?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return void console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(0===this.depth)return null;let e=this.resolvedPos.start(this.resolvedPos.depth-1);return new eT(this.resolvedPos.doc.resolve(e),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 eT(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 eT(e,this.editor)}get children(){let e=[];return this.node.content.forEach((t,n)=>{let r=t.isBlock&&!t.isTextblock,i=t.isAtom&&!t.isText,o=this.pos+n+ +!i,s=this.resolvedPos.doc.resolve(o);if(!r&&s.depth<=this.depth)return;let l=new eT(s,this.editor,r,r?t:null);r&&(l.actualDepth=this.depth+1),e.push(new eT(s,this.editor,r,r?t:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r{(!n||!(r.length>0))&&(o.node.type.name===e&&i.every(e=>t[e]===o.node.attrs[e])&&r.push(o),n&&r.length>0||(r=r.concat(o.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}}let eN=`.ProseMirror { position: relative; } .ProseMirror { word-wrap: break-word; white-space: pre-wrap; white-space: break-spaces; -webkit-font-variant-ligatures: none; font-variant-ligatures: none; font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ } .ProseMirror [contenteditable="false"] { white-space: normal; } .ProseMirror [contenteditable="false"] [contenteditable="true"] { white-space: pre-wrap; } .ProseMirror pre { white-space: pre-wrap; } img.ProseMirror-separator { display: inline !important; border: none !important; margin: 0 !important; width: 0 !important; height: 0 !important; } .ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; margin: 0; } .ProseMirror-gapcursor:after { content: ""; display: block; position: absolute; top: -2px; width: 20px; border-top: 1px solid black; animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; } @keyframes ProseMirror-cursor-blink { to { visibility: hidden; } } .ProseMirror-hideselection *::selection { background: transparent; } .ProseMirror-hideselection *::-moz-selection { background: transparent; } .ProseMirror-hideselection * { caret-color: transparent; } .ProseMirror-focused .ProseMirror-gapcursor { display: block; } .tippy-box[data-animation=fade][data-state=hidden] { opacity: 0 }`;class eE extends p{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on("paste",({event:e,slice:t})=>this.options.onPaste(e,t)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=function(e,t,n){let r=document.querySelector("style[data-tiptap-style]");if(null!==r)return r;let i=document.createElement("style");return t&&i.setAttribute("nonce",t),i.setAttribute("data-tiptap-style",""),i.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(i),i}(eN,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){let n=b(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let r="string"==typeof e?`${e}$`:e.key;n=t.filter(e=>!e.key.startsWith(r))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;let n=[...this.options.enableCoreExtensions?[ex,F.configure({blockSeparator:null==(t=null==(e=this.options.coreExtensionOptions)?void 0:e.clipboardTextSerializer)?void 0:t.blockSeparator}),eb,eS,eM,eC,ew,eO].filter(e=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[e.name]):[],...this.options.extensions].filter(e=>["extension","node","mark"].includes(null==e?void 0:e.type));this.extensionManager=new $(n,this)}createCommandManager(){this.commandManager=new h({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let t;try{t=eo(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:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>"collaboration"!==e.name),this.createExtensionManager()}}),t=eo(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}let n=_(t,this.options.autofocus);this.view=new i.tk(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...null==(e=this.options.editorProps)?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:r.yy.create({doc:t,selection:n||void 0})});let o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.createNodeViews(),this.prependClass(),this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>{var t;return null==(t=this.capturedTransaction)?void 0:t.step(e)});return}let t=this.state.apply(e),n=!this.state.selection.eq(t.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});let r=e.getMeta("focus"),i=e.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),!e.docChanged||e.getMeta("preventUpdate")||this.emit("update",{editor:this,transaction:e})}getAttributes(e){return function(e,t){let n=er("string"==typeof t?t:t.name,e.schema);if("node"===n){let n=g(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,e=>{o.push(e)});let s=o.reverse().find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}return"mark"===n?es(e,t):{}}(this.state,e)}isActive(e,t){let n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return en(e,null,n)||ed(e,null,n);let r=er(t,e.schema);return"node"===r?en(e,t,n):"mark"===r&&ed(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return O(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return ea(this.state.doc,{blockSeparator:t,textSerializers:{...H(this.schema),...n}})}get isEmpty(){return ep(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){let e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(null==(e=this.view)?void 0:e.docView)}$node(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelectorAll(e,t))||null}$pos(e){return new eT(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}}function eA(e){return new N({find:e.find,handler:({state:t,range:n,match:r})=>{let i=w(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from,l=n.to,a=e.type.create(i);if(r[1]){let e=s+r[0].lastIndexOf(r[1]);e>l?e=l:l=e+r[1].length;let t=r[0][r[0].length-1];o.insertText(t,s+r[0].length-1),o.replaceWith(e,l,a)}else if(r[0]){let t=e.type.isInline?s:s-1;o.insert(t,e.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l))}o.scrollIntoView()}})}function eD(e){return new N({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),o=w(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function eR(e){return new N({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let o=w(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),c=a&&(0,l.nd)(a,e.type,o);if(!c)return null;if(s.wrap(a,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,o=r||n.$to.parentOffset&&n.$from.marks();if(o){let e=o.filter(e=>i.includes(e.type.name));s.ensureMarks(e)}}if(e.keepAttributes){let t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";i().updateAttributes(t,o).run()}let d=s.doc.resolve(n.from-1).nodeBefore;d&&d.type===e.type&&(0,l.Mn)(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,d))&&s.join(n.from-1)}})}class eI{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=w(u(this,"addOptions",{name:this.name}))),this.storage=w(u(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new eI(e)}configure(e={}){let t=this.extend({...this.config,addOptions:()=>R(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new eI(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=w(u(t,"addOptions",{name:t.name})),t.storage=w(u(t,"addStorage",{name:t.name,options:t.options})),t}}},89188:function(e,t,n){n.d(t,{kZ:()=>u});var r=n(26143),i=n(40583),o=n(7994),s=n(21955),l=n(50380),a=n(98293),c=n(3),d=n(62556),h={placement:"bottom",modifiers:[],strategy:"absolute"};function p(){for(var e=arguments.length,t=Array(e),n=0;ni});var r=n(88897);let i=r.NB.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",(0,r.P1)(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}})},92007:function(e,t,n){n.d(t,{Bs:()=>d,C1:()=>f,H$:()=>T,Sy:()=>M,Y1:()=>s,qv:()=>p,yy:()=>S});var r=n(41084),i=n(83311);let o=Object.create(null);class s{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new l(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;r--){let i=t<0?g(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):g(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new f(e.node(0))}static atStart(e){return g(e,e,0,0,1)||new f(e)}static atEnd(e){return g(e,e,e.content.size,e.childCount,-1)||new f(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError("Invalid input for Selection.fromJSON");let n=o[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in o)throw RangeError("Duplicate use of selection JSON ID "+e);return o[e]=t,t.prototype.jsonID=e,t}getBookmark(){return d.between(this.$anchor,this.$head).getBookmark()}}s.prototype.visible=!0;class l{constructor(e,t){this.$from=e,this.$to=t}}let a=!1;function c(e){a||e.parent.inlineContent||(a=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class d extends s{constructor(e,t=e){c(e),c(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return s.near(n);let r=e.resolve(t.map(this.anchor));return new d(r.parent.inlineContent?r:n,n)}replace(e,t=r.p2.empty){if(super.replace(e,t),t==r.p2.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof d&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new h(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new d(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if((!n||r)&&(n=r>=0?1:-1),!t.parent.inlineContent){let e=s.findFrom(t,n,!0)||s.findFrom(t,-n,!0);if(!e)return s.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r?e=t:(e=(s.findFrom(e,-n,!0)||s.findFrom(e,n,!0)).$anchor).posnew f(e)};function g(e,t,n,r,i,o=!1){if(t.inlineContent)return d.create(e,n);for(let s=r-(i>0?0:1);i>0?s=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&p.isSelectable(r))return p.create(e,n-(i<0?r.nodeSize:0))}else{let t=g(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function y(e,t,n){let r,o=e.steps.length-1;if(o{null==r&&(r=i)}),e.setSelection(s.near(e.doc.resolve(r),n)))}class v extends i.wx{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return r.vc.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.vc.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.setSelection(s.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function b(e,t){return t&&e?e.bind(t):e}class w{constructor(e,t,n){this.name=e,this.init=b(t.init,n),this.apply=b(t.apply,n)}}let x=[new w("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new w("selection",{init:(e,t)=>e.selection||s.atStart(t.doc),apply:e=>e.selection}),new w("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new w("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class k{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=x.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new w(e.key,e.spec.state,e))})}}class S{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;ne.toJSON())),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw RangeError("Required config field 'schema' missing");let i=new k(e.schema,e.plugins),o=new S(i);return i.fields.forEach(i=>{if("doc"==i.name)o.doc=r.NB.fromJSON(e.schema,t.doc);else if("selection"==i.name)o.selection=s.fromJSON(o.doc,t.selection);else if("storedMarks"==i.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let r in n){let s=n[r],l=s.spec.state;if(s.key==i.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(t,r)){o[i.name]=l.fromJSON.call(s,e,t[r],o);return}}o[i.name]=i.init(e,o)}}),o}}class M{constructor(e){this.spec=e,this.props={},e.props&&function e(t,n,r){for(let i in t){let o=t[i];o instanceof Function?o=o.bind(n):"handleDOMEvents"==i&&(o=e(o,n,{})),r[i]=o}return r}(e.props,this,this.props),this.key=e.key?e.key.key:C("plugin")}getState(e){return e[this.key]}}let O=Object.create(null);function C(e){return e in O?e+"$"+ ++O[e]:(O[e]=0,e+"$")}class T{constructor(e="key"){this.key=C(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}},94985:function(e,t,n){n.d(t,{Z:()=>i});var r=n(62556);function i(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&(0,r.Zq)(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}},95923:function(e,t,n){n.d(t,{Z:()=>s});var r=n(96333),i=n(67252),o=n(62556);function s(e){return"html"===(0,r.Z)(e)?e:e.assignedSlot||e.parentNode||((0,o.Zq)(e)?e.host:null)||(0,i.Z)(e)}},96333:function(e,t,n){n.d(t,{Z:()=>r});function r(e){return e?(e.nodeName||"").toLowerCase():null}},97523:function(e,t,n){n.d(t,{Z:()=>function e(t){return["html","body","#document"].indexOf((0,o.Z)(t))>=0?t.ownerDocument.body:(0,s.Re)(t)&&(0,i.Z)(t)?t:e((0,r.Z)(t))}});var r=n(95923),i=n(60611),o=n(96333),s=n(62556)},98293:function(e,t,n){n.d(t,{Z:()=>r});function r(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}},99961:function(e,t,n){n.d(t,{Z:()=>i});var r=n(88897);let i=r.NB.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",(0,r.P1)(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:o}=this.options,{splittableMarks:s}=r.extensionManager,l=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&l&&o){let t=l.filter(e=>s.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}})}}]);