PageSourceSearch

https://prod-cdn.pathwright.com/static/js/async/a2.f0eda4bb7f.js

js pathwright.com collected 2026-10-02 03:20:44 UTC 462,570 bytes, 89 lines download raw bytes

1/*! LICENSE: a2.f0eda4bb7f.js.LICENSE.txt */
2"use strict";(self.rspackChunk_pathwright_mainclient=self.rspackChunk_pathwright_mainclient||[]).push([["a2"],{jB(e,t,n){var r=n("dx"),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=r.useState,s=r.useEffect,l=r.useLayoutEffect,a=r.useDebugValue;function d(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(e){return!0}}var h="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=o({inst:{value:n,getSnapshot:t}}),i=r[0].inst,h=r[1];return l(function(){i.value=n,i.getSnapshot=t,d(i)&&h({inst:i})},[e,n,t]),s(function(){return d(i)&&h({inst:i}),e(function(){d(i)&&h({inst:i})})},[e]),a(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:h},Wp(e,t,n){var r=n("dx"),i=n("cfZ"),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=i.useSyncExternalStore,l=r.useRef,a=r.useEffect,d=r.useMemo,h=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var c=l(null);if(null===c.current){var u={hasValue:!1,value:null};c.current=u}else u=c.current;var p=s(e,(c=d(function(){function e(e){if(!a){if(a=!0,s=e,e=r(e),void 0!==i&&u.hasValue){var t=u.value;if(i(t,e))return l=t}return l=e}if(t=l,o(s,e))return t;var n=r(e);return void 0!==i&&i(t,n)?(s=e,t):(s=e,l=n)}var s,l,a=!1,d=void 0===n?null:n;return[function(){return e(t())},null===d?void 0:function(){return e(d())}]},[t,n,r,i]))[0],c[1]);return a(function(){u.hasValue=!0,u.value=p},[p]),h(p),p}},cfZ(e,t,n){e.exports=n("jB")},njQ5(e,t,n){e.exports=n("Wp")},CaV(e,t,n){var r=n("PT"),i=n("dx"),o=n("qx"),s=n("Fr"),l=n("MM");let{withPropsProvider:a,useRecipeResult:d}=(0,o.a)({key:"colorSwatch"}),h=(0,i.forwardRef)(function(e,t){let{value:n,...i}=e,{styles:o,className:a,props:h}=d(i);return(0,r.jsx)(s.B.span,{...h,ref:t,"data-value":n,css:[o,{"--color":n},e.css],className:(0,l.cx)(a,e.className)})});a(),n.d(t,{},{qM:h})},VLn(e,t,n){let r=(0,n("Fr").B)("div",{base:{borderWidth:0,alignSelf:"stretch",borderColor:"inherit",width:"auto",height:"auto"}});r.displayName="StackSeparator",n.d(t,{},{k:r})},Pl(e,t,n){n.d(t,{PR:()=>_,Mo:()=>J,ZI:()=>q,ol:()=>W,sb:()=>U,k$:()=>K});var r=n("PT"),i=n("Rt"),o=n("gk"),s=n("ft"),l=n("ek");let[a,d]=(0,n("Cd").q)({name:"TooltipContext",hookName:"useTooltipContext",providerName:"<TooltipProvider />"});var h=n("Ck"),c=n("jo"),u=n("nS"),p=n("fp"),f=n("hQ"),m=n("Sfb"),g=n("Wy"),y=e=>e.ids?.trigger??`tooltip:${e.id}:trigger`,v=e=>e.ids?.positioner??`tooltip:${e.id}:popper`,b=e=>e.getById(y(e)),w=e=>e.getById(v(e)),k=function(e,t=Object.is){let n={...e},r=new Set,i=()=>{r.forEach(e=>e())};return{subscribe:e=>(r.add(e),()=>r.delete(e)),get:e=>n[e],set:(e,r)=>{t(n[e],r)||(n[e]=r,i())},update:e=>{let r=!1;for(let i in e){let o=e[i];void 0===o||t(n[i],o)||(n[i]=o,r=!0)}r&&i()},snapshot:()=>({...n})}}({id:null,prevId:null,instant:!1}),x=n("Uo"),{and:S,not:M}=(0,u.b6)(),C=(0,u.Op)({initialState:({prop:e})=>e("open")||e("defaultOpen")?"open":"closed",props({props:e}){(0,x.Pe)(e,["id"]);let t=e.closeOnClick??!0,n=e.closeOnPointerDown??t;return{openDelay:400,closeDelay:150,closeOnEscape:!0,interactive:!1,closeOnScroll:!0,disabled:!1,...e,closeOnPointerDown:n,closeOnClick:t,positioning:{placement:"bottom",...e.positioning}}},effects:["trackFocusVisible","trackStore"],context:({bindable:e})=>({currentPlacement:e(()=>({defaultValue:void 0})),hasPointerMoveOpened:e(()=>({defaultValue:!1}))}),watch({track:e,action:t,prop:n}){e([()=>n("disabled")],()=>{t(["closeIfDisabled"])}),e([()=>n("open")],()=>{t(["toggleVisibility"])})},states:{closed:{entry:["clearGlobalId"],on:{"controlled.open":{target:"open"},open:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],"pointer.leave":{actions:["clearPointerMoveOpened"]},"pointer.move":[{guard:S("noVisibleTooltip",M("hasPointerMoveOpened")),target:"opening"},{guard:M("hasPointerMoveOpened"),target:"open",actions:["setPointerMoveOpened","invokeOnOpen"]}]}},opening:{effects:["trackScroll","trackPointerlockChange","waitForOpenDelay"],on:{"after.openDelay":[{guard:"isOpenControlled",actions:["setPointerMoveOpened","invokeOnOpen"]},{target:"open",actions:["setPointerMoveOpened","invokeOnOpen"]}],"controlled.open":{target:"open"},"controlled.close":{target:"closed"},open:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],"pointer.leave":[{guard:"isOpenControlled",actions:["clearPointerMoveOpened","invokeOnClose","toggleVisibility"]},{target:"closed",actions:["clearPointerMoveOpened","invokeOnClose"]}],close:[{guard:"isOpenControlled",actions:["invokeOnClose","toggleVisibility"]},{target:"closed",actions:["invokeOnClose"]}]}},open:{effects:["trackEscapeKey","trackScroll","trackPointerlockChange","trackPositioning"],entry:["setGlobalId"],on:{"controlled.close":{target:"closed"},close:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"pointer.leave":[{guard:"isVisible",target:"closing",actions:["clearPointerMoveOpened"]},{guard:"isOpenControlled",actions:["clearPointerMoveOpened","invokeOnClose"]},{target:"closed",actions:["clearPointerMoveOpened","invokeOnClose"]}],"content.pointer.leave":{guard:"isInteractive",target:"closing"},"positioning.set":{actions:["reposition"]}}},closing:{effects:["trackPositioning","waitForCloseDelay"],on:{"after.closeDelay":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"controlled.close":{target:"closed"},"controlled.open":{target:"open"},close:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"pointer.move":[{guard:"isOpenControlled",actions:["setPointerMoveOpened","invokeOnOpen","toggleVisibility"]},{target:"open",actions:["setPointerMoveOpened","invokeOnOpen"]}],"content.pointer.move":{guard:"isInteractive",target:"open"},"positioning.set":{actions:["reposition"]}}}},implementations:{guards:{noVisibleTooltip:()=>null===k.get("id"),isVisible:({prop:e})=>e("id")===k.get("id"),isInteractive:({prop:e})=>!!e("interactive"),hasPointerMoveOpened:({context:e})=>e.get("hasPointerMoveOpened"),isOpenControlled:({prop:e})=>void 0!==e("open")},actions:{setGlobalId:({prop:e})=>{let t=k.get("id"),n=null!==t&&t!==e("id");k.update({id:e("id"),prevId:n?t:null,instant:n})},clearGlobalId:({prop:e})=>{e("id")===k.get("id")&&k.update({id:null,prevId:null,instant:!1})},invokeOnOpen:({prop:e})=>{e("onOpenChange")?.({open:!0})},invokeOnClose:({prop:e})=>{e("onOpenChange")?.({open:!1})},closeIfDisabled:({prop:e,send:t})=>{e("disabled")&&t({type:"close",src:"disabled.change"})},reposition:({context:e,event:t,prop:n,scope:r})=>{if("positioning.set"===t.type)return(0,g.O)(b(r),()=>w(r),{...n("positioning"),...t.options,defer:!0,listeners:!1,onComplete(t){e.set("currentPlacement",t.placement)}})},toggleVisibility:({prop:e,event:t,send:n})=>{queueMicrotask(()=>{n({type:e("open")?"controlled.open":"controlled.close",previousEvent:t})})},setPointerMoveOpened:({context:e})=>{e.set("hasPointerMoveOpened",!0)},clearPointerMoveOpened:({context:e})=>{e.set("hasPointerMoveOpened",!1)}},effects:{trackFocusVisible:({scope:e})=>(0,m.Yy)({root:e.getRootNode?.()}),trackPositioning:({context:e,prop:t,scope:n})=>
2(e.get("currentPlacement")||e.set("currentPlacement",t("positioning").placement),(0,g.O)(b(n),()=>w(n),{...t("positioning"),defer:!0,onComplete(t){e.set("currentPlacement",t.placement)}})),trackPointerlockChange:({send:e,scope:t})=>{let n=t.getDoc();return(0,p.kn)(n,"pointerlockchange",()=>e({type:"close",src:"pointerlock:change"}),!1)},trackScroll:({send:e,prop:t,scope:n})=>{if(!t("closeOnScroll"))return;let r=b(n);if(!r)return;let i=(0,f.v9)(r).map(t=>(0,p.kn)(t,"scroll",()=>{e({type:"close",src:"scroll"})},{passive:!0,capture:!0}));return()=>{i.forEach(e=>e?.())}},trackStore:({prop:e,send:t})=>{let n;return queueMicrotask(()=>{n=k.subscribe(()=>{k.get("id")!==e("id")&&t({type:"close",src:"id.change"})})}),()=>n?.()},trackEscapeKey:({send:e,prop:t})=>{if(t("closeOnEscape"))return(0,p.kn)(document,"keydown",t=>{(0,p.q_)(t)||"Escape"===t.key&&(t.stopPropagation(),e({type:"close",src:"keydown.escape"}))},!0)},waitForOpenDelay:({send:e,prop:t})=>{let n=setTimeout(()=>{e({type:"after.openDelay"})},t("openDelay"));return()=>clearTimeout(n)},waitForCloseDelay:({send:e,prop:t})=>{let n=setTimeout(()=>{e({type:"after.closeDelay"})},t("closeDelay"));return()=>clearTimeout(n)}}}}),O=n("uy"),T=n("U5"),E=n("f8"),N=n("dx"),A=n("B7"),D=n("pZ"),R=n("Ie");let I=(0,N.forwardRef)((e,t)=>{let n=d(),o=(0,i.v)(n.getTriggerProps(),e);return(0,r.jsx)(R.X.button,{...o,ref:t})});I.displayName="TooltipTrigger";let L=(0,N.forwardRef)((e,t)=>{let n=d(),o=(0,i.v)(n.getPositionerProps(),e);return(0,l.c)().unmounted?null:(0,r.jsx)(R.X.div,{...o,ref:t})});L.displayName="TooltipPositioner";var P=n("DK");let z=(0,N.forwardRef)((e,t)=>{let n=d(),o=(0,l.c)(),s=(0,i.v)(n.getContentProps(),o.getPresenceProps(),e);return o.unmounted?null:(0,r.jsx)(R.X.div,{...s,ref:(0,P.t)(o.ref,t)})});z.displayName="TooltipContent";let $=(0,N.forwardRef)((e,t)=>{let n=d(),o=(0,i.v)(n.getArrowTipProps(),e);return(0,r.jsx)(R.X.div,{...o,ref:t})});$.displayName="TooltipArrowTip";let B=(0,N.forwardRef)((e,t)=>{let n=d(),o=(0,i.v)(n.getArrowProps(),e);return(0,r.jsx)(R.X.div,{...o,ref:t})});B.displayName="TooltipArrow";let{withRootProvider:j,withContext:H,useStyles:F,PropsProvider:V}=(0,n("M6").c)({key:"tooltip"});j(e=>{let[t,{value:n,children:d}]=(0,o.s)(e),h=(0,s.x)((0,i.v)({present:n.open},t));return(0,r.jsx)(a,{value:n,children:(0,r.jsx)(l.j,{value:h,children:d})})});let U=j(e=>{let[t,{children:n,...d}]=(0,o.s)(e),u=(e=>{let t=(0,N.useId)(),{getRootNode:n}=(0,A.w)(),{dir:r}=(0,D.g)(),i={id:t,dir:r,getRootNode:n,...e};return function(e,t){let{state:n,context:r,send:i,scope:o,prop:s,event:l}=e,a=s("id"),d=!!s("aria-label"),h=n.matches("open","closing"),c=y(o),u=o.ids?.content??`tooltip:${o.id}:content`,f=s("disabled"),g=(0,T.a)({...s("positioning"),placement:r.get("currentPlacement")});return{open:h,setOpen(e){n.matches("open","closing")!==e&&i({type:e?"open":"close"})},reposition(e={}){i({type:"positioning.set",options:e})},getTriggerProps:()=>t.button({...E.r.trigger.attrs,id:c,dir:s("dir"),"data-expanded":(0,O.sE)(h),"data-state":h?"open":"closed","aria-describedby":h?u:void 0,onClick(e){e.defaultPrevented||f||s("closeOnClick")&&i({type:"close",src:"trigger.click"})},onFocus(e){queueMicrotask(()=>{e.defaultPrevented||f||"trigger.pointerdown"===l.src||(0,m.pP)()&&i({type:"open",src:"trigger.focus"})})},onBlur(e){e.defaultPrevented||f||a===k.get("id")&&i({type:"close",src:"trigger.blur"})},onPointerDown(e){e.defaultPrevented||f||!(0,p.Ml)(e)||s("closeOnPointerDown")&&a===k.get("id")&&i({type:"close",src:"trigger.pointerdown"})},onPointerMove(e){e.defaultPrevented||f||"touch"!==e.pointerType&&i({type:"pointer.move"})},onPointerOver(e){e.defaultPrevented||f||"touch"!==e.pointerType&&i({type:"pointer.move"})},onPointerLeave(){f||i({type:"pointer.leave"})},onPointerCancel(){f||i({type:"pointer.leave"})}}),getArrowProps:()=>t.element({id:o.ids?.arrow??`tooltip:${o.id}:arrow`,...E.r.arrow.attrs,dir:s("dir"),style:g.arrow}),getArrowTipProps:()=>t.element({...E.r.arrowTip.attrs,dir:s("dir"),style:g.arrowTip}),getPositionerProps:()=>t.element({id:v(o),...E.r.positioner.attrs,dir:s("dir"),style:g.floating}),getContentProps(){let e=k.get("id")===a,n=k.get("prevId")===a,o=k.get("instant")&&(h&&e||n);return t.element({...E.r.content.attrs,dir:s("dir"),hidden:!h,"data-state":h?"open":"closed","data-instant":(0,O.sE)(o),role:d?void 0:"tooltip",id:d?void 0:u,"data-placement":r.get("currentPlacement"),onPointerEnter(){i({type:"content.pointer.move"})},onPointerLeave(){i({type:"content.pointer.leave"})},style:{pointerEvents:s("interactive")?"auto":"none"}})}}}((0,h.z)(C,i),c._)})(d),f=(0,s.x)((0,i.v)({present:u.open},t));return(0,r.jsx)(a,{value:u,children:(0,r.jsx)(l.j,{value:f,children:n})})},{defaultProps:{lazyMount:!0,unmountOnExit:!0}}),K=H(I,"trigger",{forwardAsChild:!0}),W=H(L,"positioner",{forwardAsChild:!0}),q=H(z,"content",{forwardAsChild:!0}),J=H($,"arrowTip",{forwardAsChild:!0}),_=H(B,"arrow",{forwardAsChild:!0,defaultProps:{children:(0,r.jsx)(J,{})}})},YI9(e,t,n){n.d(t,{KE:()=>nE,YY:()=>np,CU:()=>nd,Db:()=>no,bP:()=>nB,Yv:()=>nj,Nz:()=>n$,gk:()=>e3,AB:()=>t7,T7:()=>eG,GG:()=>ne,Nx:()=>eX,gu:()=>tl,FF:()=>ta,iI:()=>eQ,hO:()=>td,fl:()=>th,Pg:()=>K,zU:()=>e9,q4:()=>to,iR:()=>ts,QN:()=>tf,J_:()=>tm,rU:()=>eR,Op:()=>tv,BQ:()=>tb,eE:()=>eo,OX:()=>nI,Zc:()=>nH,KV:()=>e8,Ce:()=>nL,Dd:()=>nn,MG:()=>tS,kj:()=>nr,JJ:()=>nP,tG:()=>nz});var r=Object.defineProperty,i=n("LYp"),o=n("A5v"),s=n("SB");let l=(e,t)=>
2!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function a(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("backward",e):!(n.parentOffset>0))?n:null}let d=(e,t,n)=>{let r=a(e,n);if(!r)return!1;let l=p(r);if(!l){let n=r.blockRange(),o=n&&(0,i.jP)(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)}let d=l.nodeBefore;if(S(e,l,t,-1))return!0;if(0==r.parent.content.size&&(c(d,"end")||s.nh.isSelectable(d)))for(let n=r.depth;;n--){let a=(0,i.$L)(e.doc,r.before(n),r.after(n),o.Ji.empty);if(a&&a.slice.size<a.to-a.from){if(t){let n=e.tr.step(a);n.setSelection(c(d,"end")?s.LN.findFrom(n.doc.resolve(n.mapping.map(l.pos,-1)),-1):s.nh.create(n.doc,l.pos-d.nodeSize)),t(n.scrollIntoView())}return!0}if(1==n||r.node(n-1).childCount>1)break}return!!d.isAtom&&l.depth==r.depth-1&&(t&&t(e.tr.delete(l.pos-d.nodeSize,l.pos).scrollIntoView()),!0)};function h(e,t,n){let r=t.nodeBefore,l=t.pos-1;for(;!r.isTextblock;l--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,d=t.pos+1;for(;!a.isTextblock;d++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let h=(0,i.$L)(e.doc,l,d,o.Ji.empty);if(!h||h.from!=l||h instanceof i.Ln&&h.slice.size>=d-l)return!1;if(n){let t=e.tr.step(h);t.setSelection(s.U3.create(t.doc,l)),n(t.scrollIntoView())}return!0}function c(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,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=p(r)}let l=o&&o.nodeBefore;return!!l&&!!s.nh.isSelectable(l)&&(t&&t(e.tr.setSelection(s.nh.create(e.doc,o.pos-l.nodeSize)).scrollIntoView()),!0)};function p(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 f(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("forward",e):!(n.parentOffset<n.parent.content.size))?n:null}let m=(e,t,n)=>{let r=f(e,n);if(!r)return!1;let l=y(r);if(!l)return!1;let a=l.nodeAfter;if(S(e,l,t,1))return!0;if(0==r.parent.content.size&&(c(a,"start")||s.nh.isSelectable(a))){let n=(0,i.$L)(e.doc,r.before(),r.after(),o.Ji.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(c(a,"start")?s.LN.findFrom(r.doc.resolve(r.mapping.map(l.pos)),1):s.nh.create(r.doc,r.mapping.map(l.pos))),t(r.scrollIntoView())}return!0}}return!!a.isAtom&&l.depth==r.depth-1&&(t&&t(e.tr.delete(l.pos,l.pos+a.nodeSize).scrollIntoView()),!0)},g=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=y(r)}let l=o&&o.nodeAfter;return!!l&&!!s.nh.isSelectable(l)&&(t&&t(e.tr.setSelection(s.nh.create(e.doc,o.pos)).scrollIntoView()),!0)};function y(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}let v=(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 b(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}let w=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),l=b(i.contentMatchAt(o));if(!l||!i.canReplaceWith(o,o,l))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,l.createAndFill());i.setSelection(s.LN.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},k=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof s.i5||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=b(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,l=e.tr.insert(n,o.createAndFill());l.setSelection(s.U3.create(l.doc,n+1)),t(l.scrollIntoView())}return!0},x=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if((0,i.zy)(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&(0,i.jP)(r);return null!=o&&(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)};function S(e,t,n,r){let l,a,d,h=t.nodeBefore,u=t.nodeAfter,p,f,m=h.type.spec.isolating||u.type.spec.isolating;if(!m&&(l=t.nodeBefore,a=t.nodeAfter,d=t.index(),l&&a&&l.type.compatibleContent(a.type)&&(!l.content.size&&t.parent.canReplace(d-1,d)?(n&&n(e.tr.delete(t.pos-l.nodeSize,t.pos).scrollIntoView()),!0):!!t.parent.canReplace(d,d+1)&&
2!!(a.isTextblock||(0,i.n9)(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&&(p=(f=h.contentMatchAt(h.childCount)).findWrapping(u.type))&&f.matchType(p[0]||u.type).validEnd){if(n){let r=t.pos+u.nodeSize,s=o.FK.empty;for(let e=p.length-1;e>=0;e--)s=o.FK.from(p[e].create(null,s));s=o.FK.from(h.copy(s));let l=e.tr.step(new i.Wg(t.pos-1,r,t.pos,r,new o.Ji(s,1,0),p.length,!0)),a=l.doc.resolve(r+2*p.length);a.nodeAfter&&a.nodeAfter.type==h.type&&(0,i.n9)(l.doc,a.pos)&&l.join(a.pos),n(l.scrollIntoView())}return!0}let y=u.type.spec.isolating||r>0&&m?null:s.LN.findFrom(t,1),v=y&&y.$from.blockRange(y.$to),b=v&&(0,i.jP)(v);if(null!=b&&b>=t.depth)return n&&n(e.tr.lift(v,b).scrollIntoView()),!0;if(g&&c(u,"start",!0)&&c(h,"end")){let r=h,s=[];for(;s.push(r),!r.isTextblock;)r=r.lastChild;let l=u,a=1;for(;!l.isTextblock;l=l.firstChild)a++;if(r.canReplace(r.childCount,r.childCount,l.content)){if(n){let r=o.FK.empty;for(let e=s.length-1;e>=0;e--)r=o.FK.from(s[e].copy(r));n(e.tr.step(new i.Wg(t.pos-s.length,t.pos+u.nodeSize,t.pos+a,t.pos+u.nodeSize-a,new o.Ji(r,s.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function M(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(s.U3.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}let C=M(-1),O=M(1);function T(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(o,s,(r,o)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(o),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];i.setBlockType(o,s,e,t)}r(i.scrollIntoView())}return!0}}function E(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}let N=E(l,d,u),A=E(l,m,g),D={Enter:E(v,k,x,(e,t)=>{if(e.selection instanceof s.nh&&e.selection.node.isBlock){let{$from:n}=e.selection;return!!n.parentOffset&&!!(0,i.zy)(e.doc,n.pos)&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0)}if(!e.selection.$from.depth)return!1;let n=e.tr;!e.selection.empty&&(e.selection instanceof s.U3||e.selection instanceof s.i5)&&n.deleteSelection();let{$from:r}=n.selection,o=n.steps.length,l=[],a,d,h=!1,c=!1;for(let e=r.depth;;e--){if(r.node(e).isBlock){let t;h=r.end(e)==r.pos+(r.depth-e),c=r.start(e)==r.pos-(r.depth-e),d=b(r.node(e-1).contentMatchAt(r.indexAfter(e-1)));l.unshift(t||(h&&d?{type:d}:null)),a=e;break}if(1==e)return!1;l.unshift(null)}let u=r.pos,p=(0,i.zy)(n.doc,u,l.length,l);if(p||(l[0]=d?{type:d}:null,p=(0,i.zy)(n.doc,u,l.length,l)),!p)return!1;if(n.split(u,l.length,l),!h&&c&&r.node(a).type!=d){let e=n.mapping.slice(o),t=e.map(r.before(a)),i=n.doc.resolve(t);d&&r.node(a-1).canReplaceWith(i.index(),i.index()+1,d)&&n.setNodeMarkup(e.map(r.before(a)),d)}return t&&t(n.scrollIntoView()),!0}),"Mod-Enter":w,Backspace:N,"Mod-Backspace":N,"Shift-Backspace":N,Delete:A,"Mod-Delete":A,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new s.i5(e.doc))),!0)},R={"Ctrl-h":D.Backspace,"Alt-Backspace":D["Mod-Backspace"],"Ctrl-d":D.Delete,"Ctrl-Alt-Backspace":D["Mod-Delete"],"Alt-Delete":D["Mod-Delete"],"Alt-d":D["Mod-Delete"],"Ctrl-a":C,"Ctrl-e":O};for(let e in D)R[e]=D[e];"u">typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"u">typeof os&&os.platform&&os.platform();var I=n("BzI"),L=n("AT7");function P(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}}}var z=class e{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,d=()=>(l||!t||a.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(a),s.every(e=>!0===e)),h={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(a,t),i=n(...e)(r);return s.push(i),h}])),run:d};return h}static createFakeChain(){let e=new Proxy({},{get:(t,n)=>{if("then"!==n)return"run"===n?()=>!1:()=>e}});return e}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)}}static createFallbackCan(){let t=e.createFakeChain();return new Proxy({chain:()=>t},{get:(e,t)=>{if("then"!==t)return"chain"===t?e.chain:()=>!1}})}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s={tr:e,editor:r,view:o,state:P({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}};let $=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{if(!e.isDestroyed){var n;t.dom.blur(),null==(n=window)||null==(n=n.getSelection())||n.removeAllRanges()}}),!0),B=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),j=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:o}=r;
2return!n||(o.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:o}=t,s=r.resolve(o.map(n)),l=r.resolve(o.map(n+e.nodeSize)),a=s.blockRange(l);if(!a)return;let d=(0,i.jP)(a);if(e.type.isTextblock){let{defaultType:e}=s.parent.contentMatchAt(s.index());t.setNodeMarkup(a.start,e)}(d||0===d)&&t.lift(a,d)})}),!0)},H=e=>t=>e(t),F=()=>({state:e,dispatch:t})=>k(e,t),V=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let l=r.mapping.map(t);return r.insert(l,o.content),r.setSelection(new s.U3(r.doc.resolve(Math.max(l-1,0)))),!0},U=()=>({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};function K(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}let W=e=>({tr:t,state:n,dispatch:r})=>{let i=K(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},q=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},J=(e,t,n)=>{var r;return!e.parent.isInline||"left"===n&&e.pos>e.start()||"right"===n&&e.pos<e.end()?e.pos:(r=t.nodes[e.parent.type.name].spec).content&&/^text(\*|\+)/.test(r.content)?"left"===n?e.start()-1:e.end()+1:e.pos},_=()=>({state:e,dispatch:t})=>{if(e.selection.empty)return!1;if(t){let n=e.tr,{ranges:r}=e.selection,i=n.steps.length;r.forEach(t=>{let r,o=n.mapping.slice(i),s=n.doc.resolve(o.map(t.$from.pos)),l=n.doc.resolve(o.map(t.$to.pos)),{from:a,to:d}={from:J(s,r=e.schema,"left"),to:J(l,r,"right")};n.deleteRange(a,d)}),n.selection.empty||n.setSelection(s.U3.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),t(n)}return!0},Y=()=>({commands:e})=>e.keyboardShortcut("Enter"),G=()=>({state:e,dispatch:t})=>w(e,t);function X(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function Z(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:X(t[r])?t[r].test(e[r]):t[r]===e[r])}function Q(e,t,n={}){return e.find(e=>e.type===t&&Z(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function ee(e,t,n={}){return!!Q(e,t,n)}function et(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(r.node&&r.node.marks.some(e=>e.type===t)||(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!Q([...r.node.marks],t,n))return;let i=r.index,o=e.start()+r.offset,s=i+1,l=o+r.node.nodeSize;for(;i>0&&ee([...e.parent.child(i-1).marks],t,n);)i-=1,o-=e.parent.child(i).nodeSize;for(;s<e.parent.childCount&&ee([...e.parent.child(s).marks],t,n);)l+=e.parent.child(s).nodeSize,s+=1;return{from:o,to:l}}function en(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}let er=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=en(e,r.schema),{doc:l,selection:a}=n,{$from:d,from:h,to:c}=a;if(i){let e=et(d,o,t);if(e&&e.from<=h&&e.to>=c){let t=s.U3.create(l,e.from,e.to);n.setSelection(t)}}return!0},ei=e=>t=>{let n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function eo(e){return e instanceof s.U3}function es(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function el(e,t=null){if(!t)return null;let n=s.LN.atStart(e),r=s.LN.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;let i=n.from,o=r.to;return"all"===t?s.U3.create(e,es(0,i,o),es(e.content.size,i,o)):s.U3.create(e,es(t,i,o),es(t,i,o))}function ea(){return["Android"].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function ed(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}let eh=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};let s=()=>{(ed()||ea())&&r.dom.focus(),"u">typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!ed()&&!ea()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{!n.isDestroyed&&(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&null===e||!1===e)return!0}catch{return!1}if(o&&null===e&&!eo(n.state.selection))return s(),!0;let l=el(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},ec=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),eu=(e,t)=>
2({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),ep=e=>{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&&ep(r)}return e};function ef(e){if("u"<typeof window)throw Error("[tiptap error]: there is no window object available, so this function cannot be used");let t=`<body>${e}</body>`;return ep(new window.DOMParser().parseFromString(t,"text/html").body)}function em(e){return"function"==typeof(null==e?void 0:e.nodesBetween)}function eg(e,t,n){if(em(e))return e;let r="object"==typeof e&&null!==e;n={slice:!0,parseOptions:{},...n};let i="string"==typeof e;if(r)try{if(Array.isArray(e)&&e.length>0)return o.FK.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),eg("",t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i="",s=new o.Sj({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?o.S4.fromSchema(s).parseSlice(ef(e),n.parseOptions):o.S4.fromSchema(s).parse(ef(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error("[tiptap error]: Invalid HTML content",{cause:Error(`Invalid element found: ${i}`)})}let r=o.S4.fromSchema(t);return n.slice?r.parseSlice(ef(e),n.parseOptions).content:r.parse(ef(e),n.parseOptions)}return eg("",t,n)}function ey(e){return!("type"in e)}function ev(e,t,n){let r=e.steps.length-1;if(r<t)return;let o=e.steps[r];if(!(o instanceof i.Ln||o instanceof i.Wg))return;let l=e.mapping.maps[r],a=0;l.forEach((e,t,n,r)=>{0===a&&(a=r)}),e.setSelection(s.LN.near(e.doc.resolve(a),n))}let eb=(e,t,n)=>({tr:r,dispatch:i,editor:s})=>{if(i){let i,a;n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let d=e=>{s.emit("contentError",{editor:s,error:e,disableCollaboration:()=>{"collaboration"in s.storage&&"object"==typeof s.storage.collaboration&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},h={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{eg(t,s.schema,{parseOptions:h,errorOnInvalidContent:!0})}catch(e){d(e)}try{var l;i=eg(t,s.schema,{parseOptions:h,errorOnInvalidContent:null!=(l=n.errorOnInvalidContent)?l:s.options.enableContentCheck})}catch(e){return d(e),!1}let{from:c,to:u}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},p=!0,f=!0,m=ey(i)?i.content:[i];if(m.forEach(e=>{e.check(),p=!!p&&e.isText&&0===e.marks.length,f=!!f&&e.isBlock}),c===u&&f){let{parent:e}=r.doc.resolve(c);!e.isTextblock||e.type.spec.code||e.childCount||(c-=1,u+=1)}if(p)a=Array.isArray(t)?t.map(e=>e.text||"").join(""):em(t)?m.map(e=>{var t;return null!=(t=e.text)?t:""}).join(""):"object"==typeof t&&t&&t.text?t.text:t,r.insertText(a,c,u);else{a=o.FK.from(m);let e=r.doc.resolve(c),t=e.node(),n=0===e.parentOffset,i=t.isText||t.isTextblock,s=t.content.size>0;n&&i&&s&&f&&(c=Math.max(0,c-1)),r.replaceWith(c,u,m)}n.updateSelection&&ev(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:a}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:a})}return!0};function ew(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}let ek=(e={})=>({tr:t,dispatch:n,editor:r})=>{let i,o,{pos:s,attrs:l,content:a,updateSelection:d=!0}=e,h=ew((i="number"==typeof s?t.doc.resolve(s):s||t.selection.$from).parent.contentMatchAt(i.index()));if(!h)return!1;let c=Object.keys(h.spec.attrs||{}),u=l?Object.fromEntries(Object.entries(l).filter(([e])=>c.includes(e))):{};if(a){let e=eg(a,r.schema);o=h.createAndFill(u,e)}else o=h.createAndFill(u);return!!o&&(n&&(t.insert(i.pos,o),d&&ev(t,t.steps.length-1,-1)),!0)},ex=()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,r=n instanceof s.nh,o;if(r){if(n.node.isTextblock||!(0,i.n9)(e.doc,n.from))return!1;o=n.from}else if(null==(o=(0,i.N0)(e.doc,n.from,-1)))return!1;if(t){let n=e.tr.join(o);r&&n.setSelection(s.nh.create(n.doc,o-e.doc.resolve(o).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0})(e,t),eS=()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,r;if(n instanceof s.nh){if(n.node.isTextblock||!(0,i.n9)(e.doc,n.to))return!1;r=n.to}else if(null==(r=(0,i.N0)(e.doc,n.to,1)))return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0})(e,t),eM=()=>({state:e,dispatch:t})=>d(e,t),eC=()=>({state:e,dispatch:t})=>m(e,t),eO=()=>({state:e,dispatch:t,tr:n})=>{try{let r=(0,i.N0)(e.doc,e.selection.$from.pos,-1);if(null==r)return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},eT=()=>({state:e,dispatch:t,tr:n})=>{try{let r=(0,i.N0)(e.doc,e.selection.$from.pos,1);if(null==r)return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},eE=()=>({state:e,dispatch:t})=>((e,t)=>{let n=a(e,void 0);if(!n)return!1;let r=p(n);return!!r&&h(e,r,t)})(e,t),eN=()=>({state:e,dispatch:t})=>((e,t)=>{let n=f(e,void 0);if(!n)return!1;let r=y(n);return!!r&&h(e,r,t)})(e,t);function eA(){return"u">typeof navigator&&/Mac/.test(navigator.platform)}let eD=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<o.length-1;e+=1){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))ed()||eA()?i=!0:n=!0;else throw Error(`Unrecognized modifier name: ${s}`)}return t&&(s=`Alt-${s}`),n&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),r&&(s=`Shift-${s}`),s})(e).split(/-(?!$)/),s=o.find(e=>!["Alt","Ctrl","Meta","Shift"].includes(e)),l=new KeyboardEvent("keydown",{key:"Space"
2===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};function eR(e,t,n={}){let{from:r,to:i,empty:o}=e.selection,s=t?K(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,d=l.filter(e=>!s||s.name===e.node.type.name).filter(e=>Z(e.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((e,t)=>e+t.to-t.from,0)>=a}let eI=(e,t={})=>({state:n,dispatch:r})=>!!eR(n,K(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,o=n.blockRange(r),s=o&&(0,i.jP)(o);return null!=s&&(t&&t(e.tr.lift(o,s).scrollIntoView()),!0)})(n,r),eL=()=>({state:e,dispatch:t})=>x(e,t),eP=e=>({state:t,dispatch:n})=>{var r;return(r=K(e,t.schema),function(e,t){let{$from:n,$to:s}=e.selection,l=n.blockRange(s,e=>e.childCount>0&&e.firstChild.type==r);return!!l&&(!t||(n.node(l.depth-1).type==r?function(e,t,n,r){let s=e.tr,l=r.end,a=r.$to.end(r.depth);l<a&&(s.step(new i.Wg(l-1,a,l,a,new o.Ji(o.FK.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new o.u$(s.doc.resolve(r.$from.pos),s.doc.resolve(a),r.depth));let d=(0,i.jP)(r);if(null==d)return!1;s.lift(r,d);let h=s.doc.resolve(s.mapping.map(l,-1)-1);return(0,i.n9)(s.doc,h.pos)&&h.nodeBefore.type==h.nodeAfter.type&&s.join(h.pos),t(s.scrollIntoView()),!0}(e,t,r,l):function(e,t,n){let r=e.tr,s=n.parent;for(let e=n.end,t=n.endIndex-1,i=n.startIndex;t>i;t--)e-=s.child(t).nodeSize,r.delete(e-1,e+1);let l=r.doc.resolve(n.start),a=l.nodeAfter;if(r.mapping.map(n.end)!=n.start+l.nodeAfter.nodeSize)return!1;let d=0==n.startIndex,h=n.endIndex==s.childCount,c=l.node(-1),u=l.index(-1);if(!c.canReplace(u+ +!d,u+1,a.content.append(h?o.FK.empty:o.FK.from(s))))return!1;let p=l.pos,f=p+a.nodeSize;return r.step(new i.Wg(p-!!d,f+ +!!h,p+1,f-1,new o.Ji((d?o.FK.empty:o.FK.from(s.copy(o.FK.empty))).append(h?o.FK.empty:o.FK.from(s.copy(o.FK.empty))),+!d,+!h),+!d)),t(r.scrollIntoView()),!0}(e,t,l)))})(t,n)},ez=()=>({state:e,dispatch:t})=>v(e,t);function e$(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function eB(e,t){let n="string"==typeof t?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}let ej=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=e$("string"==typeof e?e:e.name,r.schema);if(!l)return!1;"node"===l&&(o=K(e,r.schema)),"mark"===l&&(s=en(e,r.schema));let a=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{o&&o===e.type&&(a=!0,i&&n.setNodeMarkup(r,void 0,eB(e.attrs,t))),s&&e.marks.length&&e.marks.forEach(o=>{s===o.type&&(a=!0,i&&n.addMark(r,r+e.nodeSize,s.create(eB(o.attrs,t))))})})}),a},eH=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),eF=()=>({tr:e,dispatch:t})=>{if(t){let t=new s.i5(e.doc);e.setSelection(t)}return!0},eV=()=>({state:e,dispatch:t})=>u(e,t),eU=()=>({state:e,dispatch:t})=>g(e,t),eK=()=>({state:e,dispatch:t})=>((e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return 0!=o&&(i=n.before(o),t&&t(e.tr.setSelection(s.nh.create(e.doc,i))),!0)})(e,t),eW=()=>({state:e,dispatch:t})=>O(e,t),eq=()=>({state:e,dispatch:t})=>C(e,t);function eJ(e,t,n={},r={}){return eg(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}let e_=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:o,dispatch:s,commands:l})=>{let{doc:a}=o;if("full"!==r.preserveWhitespace){let l=eJ(e,i.schema,r,{errorOnInvalidContent:null!=t?t:i.options.enableContentCheck});if(s){let e=ey(l)?l.content:[l];o.replaceWith(0,a.content.size,e).setMeta("preventUpdate",!n)}return!0}return s&&o.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:a.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:i.options.enableContentCheck})};function eY(e,t){let n=en(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=>
2e.type.name===n.name);return l?{...l.attrs}:{}}function eG(e,t){let n=new i.dL(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function eX(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function eZ(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 eQ(e,t,n){return void 0===e.config[t]&&e.parent?eQ(e.parent,t,n):"function"==typeof e.config[t]?e.config[t].bind({...n,parent:e.parent?eQ(e.parent,t,n):null}):e.config[t]}function e0(e){return e.map(e=>{let t=eQ(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...e0(t())]:e}).flat(10)}function e1(e,t){let n=o.ZF.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function e2(e){return"function"==typeof e}function e3(e,t,...n){return e2(e)?t?e.bind(t)(...n):e(...n):e}function e4(e){return{baseExtensions:e.filter(e=>"extension"===e.type),nodeExtensions:e.filter(e=>"node"===e.type),markExtensions:e.filter(e=>"mark"===e.type)}}function e5(e){let t=[],{nodeExtensions:n,markExtensions:r}=e4(e),i=[...n,...r],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},s=n.filter(e=>"text"!==e.name).map(e=>e.name),l=r.map(e=>e.name),a=[...s,...l];return e.forEach(e=>{let n=eQ(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{(Array.isArray(e.types)?e.types:"*"===e.types?a:"nodes"===e.types?s:"marks"===e.types?l:[]).forEac
2h(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...o,...r}})})})})}),i.forEach(e=>{let n=eQ(e,"addAttributes",{name:e.name,options:e.options,storage:e.storage});n&&Object.entries(n()).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 e6(e){let t=[],n=function(e){let t=[],n="",r=!1,i=!1,o=0,s=e.length;for(let l=0;l<s;l+=1){let s=e[l];if("'"===s&&!i){r=!r,n+=s;continue}if('"'===s&&!r){i=!i,n+=s;continue}if(!r&&!i){if("("===s){o+=1,n+=s;continue}if(")"===s&&o>0){o-=1,n+=s;continue}if(";"===s&&0===o){t.push(n),n="";continue}}n+=s}return n&&t.push(n),t}(e||""),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(":");if(-1===i)continue;let o=r.slice(0,i).trim(),s=r.slice(i+1).trim();o&&s&&t.push([o,s])}return t}function e8(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if("__proto__"===e)return void Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0});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=new Map([...e6(n[e]),...e6(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join("; ")}else n[e]=t}),n},{})}function e9(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)=>e8(e,t),{})}function e7(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 te(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 tt(e){var t,n;let r={};return!(null==e||null==(t=e.attribute)?void 0:t.isRequired)&&"default"in((null==e?void 0:e.attribute)||{})&&(r.default=e.attribute.default),(null==e||null==(n=e.attribute)?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function tn(e){return e.sort((e,t)=>{let n=eQ(e,"priority")||100,r=eQ(t,"priority")||100;return n>r?-1:+(n<r)})}function tr(e){var t;let n=tn(e0(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}function ti(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,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:d,range:t})),!1;if(e.isText){var c;l+=null==e||null==(c=e.text)?void 0:c.slice(Math.max(r,n)-n,i-n)}}),l}function to(e,t){return ti(e,{from:0,to:e.content.size},t)}function ts(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function tl(e,t){let n=e$("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){let n=K(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}:{}}(e,t):"mark"===n?eY(e,t):{}}function ta(e){let t,{mapping:n,steps:r}=e,i=[];return n.maps.forEach((e,t)=>{let o=[];if(e.ranges.length)e.forEach((e,t)=>{o.push({from:e,to:t})});else{let{from:e,to:n}=r[t];if(void 0===e||void 0===n)return;o.push({from:e,to:n})}o.forEach(({from:e,to:r})=>{let o=n.slice(t).map(e,-1),s=n.slice(t).map(r),l=n.invert().map(o,-1),a=n.invert().map(s);i.push({oldRange:{from:l,to:a},newRange:{from:o,to:s}})})}),1===(t=function(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)})}
2(i)).length?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function td(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=et(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{e&&(null==e?void 0:e.nodeSize)!==void 0&&r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}let th=(e,t,n,r=20)=>{let i=e.doc.resolve(n),o=r,s=null;for(;o>0&&null===s;){let e=i.node(o);(null==e?void 0:e.type.name)===t?s=e:o-=1}return[s,o]};function tc(e,t){return t.nodes[e]||t.marks[e]||null}function tu(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 tp(e,t,n={}){let{empty:r,ranges:i}=e.selection,o=t?en(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(o&&e.inlineContent&&!e.type.allowsMarkType(o))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s+=a-n,l.push(...e.marks.map(e=>({mark:e,from:n,to:a})))})}),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),d=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+d:a)>=s}let tf=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=eZ(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2)&&n.pos===r.pos},tm=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0)&&t.pos===n.pos};function tg(e,t){return Array.isArray(t)?t.some(t=>("string"==typeof t?t:t.name)===e.name):t}function ty(e,t){let{nodeExtensions:n}=e4(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=e3(eQ(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof i&&i.split(" ").includes("list")}function tv(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if("hardBreak"===e.type.name)return!0;if(e.isText){var r;return!/\S/.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&&(tv(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function tb(e){return e instanceof s.nh}var tw=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function tk(e,t){let n=t.mapping.mapResult(e.position);return{position:new tw(n.pos),mapResult:n}}function tx(e){return new tw(e)}function tS(e,t,n){let r=e.state.doc.content.size,i=es(t,0,r),o=es(n,0,r),s=e.coordsAtPos(i),l=e.coordsAtPos(o,-1),a=Math.min(s.top,l.top),d=Math.max(s.bottom,l.bottom),h=Math.min(s.left,l.left),c=Math.max(s.right,l.right),u={top:a,bottom:d,left:h,right:c,width:c-h,height:d-a,x:h,y:a};return{...u,toJSON:()=>u}}let tM=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:l}=o,a=en(e,r.schema);if(i)if(s){let e=eY(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){let{selection:r}=t,i=null;if(eo(r)&&(i=r.$cursor),i){var o;let t=null!=(o=e.storedMarks)?o:i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:s}=r;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)},tC=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),tO=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let o,s=K(e,n.schema);return(n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock)?i().command(({commands:e})=>!!T(s,{...o,...t})(n)||e.clearNodes()).command(({state:e})=>T(s,{...o,...t})(e,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},tT=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=es(e,0,n.content.size),i=s.nh.create(n,r);t.setSelection(i)}return!0},tE=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o,s,{selection:l}=r;return"number"==typeof t?(o=t,s=t):t&&"from"in t&&"to"in t?(o=t.from,s=t.to):(o=l.from,s=l.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},tN=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,o=s.U3.atStart(n).from,l=s.U3.atEnd(n).to,a=es(r,o,l),d=es(i,o,l),h=s.U3.create(n,a,d);t.setSelection(h)}return!0},tA=e=>({state:t,dispatch:n})=>{var r;return(r=K(e,t.schema),function(e,t){let{$from:n,$to:s}=e.selection,l=n.blockRange(s,e=>e.childCount>0&&e.firstChild.type==r);if(!l)return!1;let a=l.startIndex;if(0==a)return!1;let d=l.parent,h=d.child(a-1);if(h.type!=r)return!1;if(t){let n=h.lastChild&&h.lastChild.type==d.type,s=o.FK.from(n?r.create():null),a=new o.Ji(o.FK.from(r.create(null,o.FK.from(d.type.create(null,s)))),n?3:1,0),c=l.start,u=l.end;t(e.tr.step(new i.Wg(c-(n?3:1),u,c,u,a,1,!0)).scrollIntoView())}return!0})(t,n)};function tD(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>
2null==t?void 0:t.includes(e.type.name));e.tr.ensureMarks(r)}}let tR=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:o})=>{let{selection:l,doc:a}=t,{$from:d,$to:h}=l,c=tu(o.extensionManager.attributes,d.node().type.name,d.node().attrs);if(l instanceof s.nh&&l.node.isBlock)return!!d.parentOffset&&!!(0,i.zy)(a,d.pos)&&(r&&(e&&tD(n,o.extensionManager.splittableMarks),t.split(d.pos).scrollIntoView()),!0);if(!d.parent.isBlock)return!1;let u=h.parentOffset===h.parent.content.size,p=0===d.depth?void 0:ew(d.node(-1).contentMatchAt(d.indexAfter(-1))),f=u&&p?[{type:p,attrs:c}]:void 0,m=(0,i.zy)(t.doc,t.mapping.map(d.pos),1,f);if(!f&&!m&&(0,i.zy)(t.doc,t.mapping.map(d.pos),1,p?[{type:p}]:void 0)&&(m=!0,f=p?[{type:p,attrs:c}]:void 0),r){if(m&&(l instanceof s.U3&&t.deleteSelection(),t.split(t.mapping.map(d.pos),1,f),p&&!u&&!d.parentOffset&&d.parent.type!==p)){let e=t.mapping.map(d.before()),n=t.doc.resolve(e);d.node(-1).canReplaceWith(n.index(),n.index()+1,p)&&t.setNodeMarkup(t.mapping.map(d.before()),p)}e&&tD(n,o.extensionManager.splittableMarks),t.scrollIntoView()}return m},tI=(e,t={})=>({tr:n,state:r,dispatch:l,editor:a})=>{let d=K(e,r.schema),{$from:h,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||h.depth<2||!h.sameParent(c))return!1;let p=h.node(-1);if(p.type!==d)return!1;let f=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(l){var m;let e=o.FK.empty,r=h.index(-1)?1:h.index(-2)?2:3;for(let t=h.depth-r;t>=h.depth-3;t-=1)e=o.FK.from(h.node(t).copy(e));let i=h.indexAfter(-1)<h.node(-2).childCount?1:h.indexAfter(-2)<h.node(-3).childCount?2:3,l={...tu(f,h.node().type.name,h.node().attrs),...t},a=(null==(m=d.contentMatch.defaultType)?void 0:m.createAndFill(l))||void 0;e=e.append(o.FK.from(d.createAndFill(null,a)||void 0));let c=h.before(h.depth-(r-1));n.replace(c,h.after(-i),new o.Ji(e,4-r,0));let u=-1;n.doc.nodesBetween(c,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&0===e.content.size&&(u=t+1)}),u>-1&&n.setSelection(s.U3.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let g=c.pos===h.end()?p.contentMatchAt(0).defaultType:null,y={...tu(f,p.type.name,p.attrs),...t},v={...tu(f,h.node().type.name,h.node().attrs),...t};n.delete(h.pos,c.pos);let b=g?[{type:d,attrs:y},{type:g,attrs:v}]:[{type:d,attrs:y}];if(!(0,i.zy)(n.doc,h.pos,2))return!1;if(l){let{selection:e,storedMarks:t}=r,{splittableMarks:i}=a.extensionManager,o=t||e.$to.parentOffset&&e.$from.marks();if(n.split(h.pos,2,b).scrollIntoView(),!o||!l)return!0;let s=o.filter(e=>i.includes(e.type.name));n.ensureMarks(s)}return!0};function tL(e){return e&&"1"!==e?e:null}let tP=(e,t)=>{var n,r;let o=eZ(e=>e.type===t)(e.selection);if(!o)return!0;let s=e.doc.resolve(Math.max(0,o.pos-1)).before(o.depth);if(void 0===s)return!0;let l=e.doc.nodeAt(s);return!(o.node.type===(null==l?void 0:l.type)&&(0,i.n9)(e.doc,o.pos))||(n=o.node.attrs.type,r=null==l?void 0:l.attrs.type,tL(n)!==tL(r)||(e.join(o.pos),!0))},tz=(e,t)=>{var n,r;let o=eZ(e=>e.type===t)(e.selection);if(!o)return!0;let s=e.doc.resolve(o.start).after(o.depth);if(void 0===s)return!0;let l=e.doc.nodeAt(s);return!(o.node.type===(null==l?void 0:l.type)&&(0,i.n9)(e.doc,s))||(n=o.node.attrs.type,r=null==l?void 0:l.attrs.type,tL(n)!==tL(r)||(e.join(s),!0))},t$=(e,t,n,r={})=>({editor:i,tr:o,state:l,dispatch:a,chain:d,commands:h,can:c})=>{let{extensions:u,splittableMarks:p}=i.extensionManager,f=K(e,l.schema),m=K(t,l.schema),{selection:g,storedMarks:y}=l,{$from:v,$to:b}=g,w=v.blockRange(b),k=y||g.$to.parentOffset&&g.$from.marks();if(!w)return!1;let x=eZ(e=>ty(e.type.name,u))(g),S=0===g.from&&g.to===l.doc.content.size,M=l.doc.content.content,C=1===M.length?M[0]:null,O=S&&C&&ty(C.type.name,u)?{node:C,pos:0,depth:0}:null,T=null!=x?x:O,E=!!x&&w.depth>=1&&w.depth-x.depth<=1,N=!!O;if((E||N)&&T){if(T.node.type===f)return S&&N?d().command(({tr:e,dispatch:t})=>{let n=function(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=t.resolve(1),i=t.resolve(n.nodeSize-1);return s.U3.between(r,i)}(e);return!!n&&(e.setSelection(n),t&&t(e),!0)}).liftListItem(m).run():h.liftListItem(m);
2if(ty(T.node.type.name,u)&&f.validContent(T.node.content))return d().command(()=>(o.setNodeMarkup(T.pos,f),!0)).command(()=>tP(o,f)).command(()=>tz(o,f)).run()}return n&&k&&a?d().command(()=>{let e=c().wrapInList(f,r),t=k.filter(e=>p.includes(e.type.name));return o.ensureMarks(t),!!e||h.clearNodes()}).wrapInList(f,r).command(()=>tP(o,f)).command(()=>tz(o,f)).run():d().command(()=>!!c().wrapInList(f,r)||h.clearNodes()).wrapInList(f,r).command(()=>tP(o,f)).command(()=>tz(o,f)).run()},tB=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=en(e,r.schema);return tp(r,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},tj=(e,t,n={})=>({state:r,commands:i})=>{let o,s=K(e,r.schema),l=K(t,r.schema),a=eR(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})},tH=(e,t={})=>({state:n,commands:r})=>{let i=K(e,n.schema);return eR(n,i,t)?r.lift(i):r.wrapIn(i,t)},tF=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i,o=n[r];if(o.spec.isInputRules&&(i=o.getState(e))){if(t){let t=e.tr,n=i.transform;for(let e=n.steps.length-1;e>=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},tV=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{ignoreClearable:i=!1}=e,{selection:o}=t,{empty:s,ranges:l}=o;if(s)return!0;let{nonClearableMarks:a}=r.extensionManager;if(n){let e=Object.values(r.schema.marks).filter(e=>i||!a.includes(e.name));l.forEach(n=>{for(let r of e)t.removeMark(n.$from.pos,n.$to.pos,r)})}return!0},tU=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:o=!1}=t,{selection:s}=n,l=en(e,r.schema),{$from:a,empty:d,ranges:h}=s;
2if(!i)return!0;if(d&&o){var c;let{from:e,to:t}=s,r=et(a,l,null==(c=a.marks().find(e=>e.type===l))?void 0:c.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,l)}else h.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,l)});return n.removeStoredMark(l),!0},tK=e=>({tr:t,state:n,dispatch:r})=>{let i,o,{selection:s}=n;return"number"==typeof e?(i=e,o=e):e&&"from"in e&&"to"in e?(i=e.from,o=e.to):(i=s.from,o=s.to),r&&t.doc.nodesBetween(i,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},tW=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=e$("string"==typeof e?e:e.name,r.schema);if(!l)return!1;"node"===l&&(o=K(e,r.schema)),"mark"===l&&(s=en(e,r.schema));let a=!1;return n.selection.ranges.forEach(e=>{let l,d,h,c,u=e.$from.pos,p=e.$to.pos;n.selection.empty?r.doc.nodesBetween(u,p,(e,t)=>{o&&o===e.type&&(a=!0,h=Math.max(t,u),c=Math.min(t+e.nodeSize,p),l=t,d=e)}):r.doc.nodesBetween(u,p,(e,r)=>{r<u&&o&&o===e.type&&(a=!0,h=Math.max(r,u),c=Math.min(r+e.nodeSize,p),l=r,d=e),r>=u&&r<=p&&(o&&o===e.type&&(a=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),s&&e.marks.length&&e.marks.forEach(o=>{if(s===o.type&&(a=!0,i)){let i=Math.max(r,u),l=Math.min(r+e.nodeSize,p);n.addMark(i,l,s.create({...o.attrs,...t}))}}))}),d&&(void 0!==l&&i&&n.setNodeMarkup(l,void 0,{...d.attrs,...t}),s&&d.marks.length&&d.marks.forEach(e=>{s===e.type&&i&&n.addMark(h,c,s.create({...e.attrs,...t}))}))}),a},tq=new s.hs("__tiptap_decorations__"),tJ=e=>({tr:t,dispatch:n})=>(n&&t.setMeta(tq,{type:"force",name:e}),!0),t_=(e,t={})=>({state:n,dispatch:r})=>(function(e,t=null){return function(n,r){let{$from:o,$to:s}=n.selection,l=o.blockRange(s),a=l&&(0,i.oM)(l,e,t);return!!a&&(r&&r(n.tr.wrap(l,a).scrollIntoView()),!0)}})(K(e,n.schema),t)(n,r),tY=(e,t={})=>({state:n,dispatch:r})=>(function(e,t=null){return function(n,r){let{$from:s,$to:l}=n.selection,a=s.blockRange(l);if(!a)return!1;let d=r?n.tr:null;return!!function(e,t,n,r=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 o.u$(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new o.u$(t.$from,a.resolve(t.$to.end(t.depth)),t.depth)),s=!0}let d=(0,i.oM)(l,n,r,t);return!!d&&(e&&function(e,t,n,r,s){let l=o.FK.empty;for(let e=n.length-1;e>=0;e--)l=o.FK.from(n[e].type.create(n[e].attrs,l));e.step(new i.Wg(t.start-2*!!r,t.end,t.start,t.end,new o.Ji(l,0,0),n.length,!0));let a=0;for(let e=0;e<n.length;e++)n[e].type==s&&(a=e+1);let d=n.length-a,h=t.start+n.length-2*!!r,c=t.parent;for(let n=t.startIndex,r=t.endIndex,o=!0;n<r;n++,o=!1)!o&&(0,i.zy)(e.doc,h,d)&&(e.split(h,d),h+=2*d),h+=c.child(n).nodeSize}(e,t,d,s,n),!0)}(d,a,e,t)&&(r&&r(d.scrollIntoView()),!0)}})(K(e,n.schema),t)(n,r);var tG=(e=>{let t={};for(var n in e)r(t,n,{get:e[n],enumerable:!0});return r(t,Symbol.toStringTag,{value:"Module"}),t})({blur:()=>$,clearContent:()=>B,clearNodes:()=>j,command:()=>H,createParagraphNear:()=>F,cut:()=>V,deleteCurrentNode:()=>U,deleteNode:()=>W,deleteRange:()=>q,deleteSelection:()=>_,enter:()=>Y,exitCode:()=>G,extendMarkRange:()=>er,first:()=>ei,focus:()=>eh,forEach:()=>ec,insertContent:()=>eu,insertContentAt:()=>eb,insertDefaultBlock:()=>ek,joinBackward:()=>eM,joinDown:()=>eS,joinForward:()=>eC,joinItemBackward:()=>eO,joinItemForward:()=>eT,joinTextblockBackward:()=>eE,joinTextblockForward:()=>eN,joinUp:()=>ex,keyboardShortcut:()=>eD,lift:()=>eI,liftEmptyBlock:()=>eL,liftListItem:()=>eP,newlineInCode:()=>ez,resetAttributes:()=>ej,scrollIntoView:()=>eH,selectAll:()=>eF,selectNodeBackward:()=>eV,selectNodeForward:()=>eU,selectParentNode:()=>eK,selectTextblockEnd:()=>eW,selectTextblockStart:()=>eq,setContent:()=>e_,setMark:()=>tM,setMeta:()=>tC,setNode:()=>tO,setNodeSelection:()=>tT,setTextDirection:()=>tE,setTextSelection:()=>tN,sinkListItem:()=>tA,splitBlock:()=>tR,splitListItem:()=>tI,toggleList:()=>t$,toggleMark:()=>tB,toggleNode:()=>tj,toggleWrap:()=>tH,undoInputRule:()=>tF,unsetAllMarks:()=>tV,unsetMark:()=>tU,unsetTextDirection:()=>tK,updateAttributes:()=>tW,updateDecorations:()=>tJ,wrapIn:()=>t_,wrapInList:()=>tY});let tX=new WeakMap;var tZ=class{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];
2return 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={}}};let tQ="u">typeof process&&!1;function t0(e,t){let n=[],r=new Set;for(let i of e)"widget"===i.kind&&"widget"===i.kind&&r.add(i.key),n.push(i.toPMDecoration(t));return{decorations:n,widgetKeys:r}}function t1({position:e,from:t,to:n,docSize:r}){return!(e<t)&&(e<n||e===n&&n===r)}function t2(e){var t;let n=null==(t=e.spec)?void 0:t.key;return"string"==typeof n?n:void 0}function t3(e){return"attr"===e.jsonID}function t4(e,t,n,r){return e.map(t,n,{onRemove:e=>{let t=null==e?void 0:e.key;"string"==typeof t&&r.delete(t)}})}function t5(e,t){let n=Object.values(t).flatMap(e=>e.find());return I.zF.create(e,n)}function t6(e){let t=new Set;for(let n of Object.values(e))for(let e of n)t.add(e);return t}let t8=new Set;var t9=class{constructor(e){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{let t=tq.getState(e);t&&this.warnDuplicateWidgetKeys(t)},this.editor=e.editor,this.entries=this.resolveEntries(e.entries),this.entries.forEach(({name:e,spec:t})=>(function(e,t){var n;switch(null!=(n=t.update)?n:"document"){case"document":if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case"changedRanges":if(!t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case"manual":if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(t.shouldUpdate)throw Error(`[tiptap error]: Extension "${e}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw Error(`[tiptap error]: Extension "${e}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}})(e,t)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on("beforeTransaction",this.handleBeforeTransaction)}destroy(){this.editor.off("beforeTransaction",this.handleBeforeTransaction)}liveWidgetKeys(){var e,t;return null!=(e=null==(t=tq.getState(this.editor.state))?void 0:t.widgetKeys)?e:t8}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(e){let t=[];for(let{name:n,addDecorations:r}of e){let e=r();e&&t.push({name:n,spec:e})}return t}createPlugin(){let{editor:e,entries:t}=this;return new s.k_({key:tq,state:{init:(e,n)=>{let r={},i={};for(let{name:e,spec:o}of t){let{set:t,widgetKeys:s}=this.buildFullSet(e,o,n);r[e]=t,i[e]=s}let o={decorationSetsByExtension:r,widgetKeysByExtension:i,mergedDecorationSet:this.buildMergedSet(n.doc,r),widgetKeys:t6(i)};return this.warnDuplicateWidgetKeys(o),o},apply:(n,r,i,o)=>{let s=n.getMeta(tq),l=(null==s?void 0:s.type)==="force"&&!s.name,a=(null==s?void 0:s.type)==="force"?s.name:void 0,d={},h={},c=new Set;return(!function(e,t){var n,r;tX.set(e,(null!=(n=tX.get(e))?n:0)+1);try{return t()}finally{let t=(null!=(r=tX.get(e))?r:1)-1;t>0?tX.set(e,t):tX.delete(e)}}(e,()=>{for(let{name:u,spec:p}of t){var s;let t=l||a===u;if(s={editor:e,tr:n,oldState:i,newState:o},t||"manual"!==p.update&&(p.shouldUpdate?p.shouldUpdate(s):s.tr.docChanged))if("changedRanges"===p.update&&n.docChanged&&!t){let e=this.applyChangedRangesRecompute(u,p,r,n,o);d[u]=e.set,h[u]=e.widgetKeys,c.add(u)}else{let{set:e,widgetKeys:t}=this.buildFullSet(u,p,o);d[u]=e,h[u]=t,c.add(u)}else{let e=function(e,t,n){var r,i;let o=null!=(r=t.decorationSetsByExtension[e])?r:I.zF.empty,s=new Set(null!=(i=t.widgetKeysByExtension[e])?i:[]);return{set:t4(o,n.mapping,n.doc,s),widgetKeys:s}}(u,r,n);d[u]=e.set,h[u]=e.widgetKeys}}}),0!==c.size||n.docChanged)?{decorationSetsByExtension:d,widgetKeysByExtension:h,mergedDecorationSet:this.mergeAfterApply({entries:t,previous:r,tr:n,decorationSetsByExtension:d,recomputedNames:c}),widgetKeys:t6(h)}:r}},props:{decorations(e){var t,n;return null!=(t=null==(n=tq.getState(e))?void 0:n.mergedDecorationSet)?t:I.zF.empty}}})}applyChangedRangesRecompute(e,t,n,r,i){let o=function(e,t){if(e.steps.some(e=>{let t;
2return t=!1,e.getMap().forEach(()=>{t=!0}),!(t||t3(e))&&("number"!=typeof e.from||"number"!=typeof e.to)}))return{type:"full"};let n=ta(e).map(({newRange:e})=>e);e.steps.forEach((t,r)=>{if(!t3(t))return;let i=e.mapping.slice(r);n.push({from:i.map(t.pos,-1),to:i.map(t.pos+1)})});let r=[];for(let e of n){let n=function(e,t){let n=null,r=0,i=0;for(let o=0;o<e.childCount&&!(i>t.to);o+=1){let s=i+e.child(o).nodeSize;s>=t.from&&(null===n&&(n=i),r=s),i=s}return null===n?null:{from:n,to:r}}(t,e);n&&r.push(n)}r.sort((e,t)=>e.from-t.from);let i=[];for(let e of r){let t=i[i.length-1];t&&e.from<=t.to?t.to=Math.max(t.to,e.to):i.push({...e})}return{type:"ranges",ranges:i}}(r,i.doc);return"full"===o.type?this.buildFullSet(e,t,i):this.rebuildRanges(e,t,n,r,i,o.ranges)}rebuildRanges(e,t,n,r,i,o){var s,l;let a=null!=(s=n.decorationSetsByExtension[e])?s:I.zF.empty,d=new Set(null!=(l=n.widgetKeysByExtension[e])?l:[]),h=t4(a,r.mapping,r.doc,d),c=i.doc.content.size;for(let{from:n,to:r}of o){let o=h.find(n,r).filter(e=>t1({position:e.from,from:n,to:r,docSize:c}));for(let e of o){let t=t2(e);t&&d.delete(t)}h=h.remove(o);let{decorations:s,widgetKeys:l}=t0(function({decorations:e,from:t,to:n,docSize:r,extensionName:i,warnedExtensions:o}){return e.filter(e=>!!t1({position:e.anchor,from:t,to:n,docSize:r})||e.anchor!==n&&(o.has(i)||(o.add(i),console.warn(`[tiptap warn]: Extension "${i}" returned a decoration outside the requested range [${t}, ${n}). It was ignored.`)),!1))}({decorations:this.runCreate(e,"createInRange",()=>t.createInRange({editor:this.editor,state:i,view:this.mountedView,from:n,to:r})),from:n,to:r,docSize:c,extensionName:e,warnedExtensions:this.warnedOutOfRangeExtensions}),e);for(let e of(h=h.add(i.doc,s),l))d.add(e)}return{set:h,widgetKeys:d}}buildFullSet(e,t,n){let r=this.runCreate(e,"create",()=>t.create({editor:this.editor,state:n,view:this.mountedView}));
2return function(e,t,n){let{decorations:r,widgetKeys:i}=t0(t,n);return{set:I.zF.create(e,r),widgetKeys:i}}(n.doc,r,e)}runCreate(e,t,n){try{return n()}catch(n){return console.error(`[tiptap error]: Extension "${e}" threw in \`addDecorations().${t}()\`. Its decorations were dropped for this update.`,n),[]}}warnDuplicateWidgetKeys(e){if(!tQ)return;if(0===e.widgetKeys.size)return void this.warnedWidgetKeys.clear();let t=function(e){let t=new Map,n=new Map;for(let s of e.find()){var r,i,o;let e=t2(s);if(!e)continue;let l=null!=(r=s.spec.extensionName)?r:"unknown",a=null!=(i=t.get(e))?i:new Set;a.add(l),t.set(e,a),n.set(e,(null!=(o=n.get(e))?o:0)+1)}return Array.from(t,([e,t])=>({key:e,extensions:t})).filter(({key:e})=>{var t;return(null!=(t=n.get(e))?t:0)>1})}(e.mergedDecorationSet),n=new Set(t.map(({key:e})=>e));for(let{key:e,extensions:n}of t){if(this.warnedWidgetKeys.has(e))continue;let t=Array.from(n).map(e=>`"${e}"`).join(", ");console.warn(`[tiptap warn]: Duplicate widget decoration key "${e}" in extension${1===n.size?"":"s"} ${t}. Widget decoration keys must be globally unique, otherwise ProseMirror misplaces the widget DOM. Use a stable, unique key (e.g. \`comment-$\{id}\`).`)}this.warnedWidgetKeys=n}buildMergedSet(e,t){let n=Object.keys(t);return 1===n.length?t[n[0]]:t5(e,t)}mergeAfterApply({entries:e,previous:t,tr:n,decorationSetsByExtension:r,recomputedNames:i}){return 1===e.length?r[e[0].name]:0===i.size?t.mergedDecorationSet.map(n.mapping,n.doc):t5(n.doc,r)}};function t7(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof s.nh){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;i-=1}return!1}function ne(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function nt(e){return"Object"===Object.prototype.toString.call(e).slice(8,-1)&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function nn(e,t,n){let r=e.split("\n"),i=[],o="",s=0,l=t.baseIndentSize||2;for(;s<r.length;){let e,h=r[s],c=h.match(t.itemPattern);if(!c)if(i.length>0)break;else{if(""!==h.trim())return;s+=1,o=`${o}${h}
3`;continue}let u=t.extractItemData(c),{indentLevel:p,mainContent:f}=u;o=`${o}${h}
4`;let m=[f];for(s+=1;s<r.length;){var a,d;let e=r[s];if(""===e.trim()){let t=r.slice(s+1).findIndex(e=>""!==e.trim());if(-1===t)break;if(((null==(d=r[s+1+t].match(/^(\s*)/))||null==(d=d[1])?void 0:d.length)||0)>p){m.push(e),o=`${o}${e}
5`,s+=1;continue}break}if(((null==(a=e.match(/^(\s*)/))||null==(a=a[1])?void 0:a.length)||0)>p)m.push(e),o=`${o}${e}
6`,s+=1;else break}let g=m.slice(1);if(g.length>0){let r=g.map(e=>e.slice(p+l)).join("\n");r.trim()&&(e=t.customNestedParser?t.customNestedParser(r):n.blockTokens(r))}let y=t.createToken(u,e);i.push(y)}if(0!==i.length)return{items:i,raw:o}}function nr(e,t,n,r){if(!e||!Array.isArray(e.content))return"";let i="function"==typeof n?n(r):n,[o,...s]=e.content,l=`${i}${t.renderChildren([o])}`;return s&&s.length>0&&s.forEach((e,n)=>{var r,i;let o=null!=(r=null==(i=t.renderChild)?void 0:i.call(t,e,n+1))?r:t.renderChildren([e]);if(null!=o){let n=o.split("\n").map(e=>e?t.indent(e):t.indent("")).join("\n");l+="paragraph"===e.type?`
7
8${n}`:`
9${n}`}}),l}function ni(e,t,n={}){let{state:r}=t,{doc:i,tr:o}=r;i.descendants((t,r)=>{let i=o.mapping.map(r),s=o.mapping.map(r)+t.nodeSize,l=null;if(t.marks.forEach(t=>{if(t!==e)return!1;l=t}),!l)return;let a=!1;if(Object.keys(n).forEach(e=>{n[e]!==l.attrs[e]&&(a=!0)}),a){let t=e.type.create({...e.attrs,...n});o.removeMark(i,s,e.type),o.addMark(i,s,t)}}),o.docChanged&&t.view.dispatch(o)}var no=class{constructor(e,t,n){this.component=e,this.editor=t.editor,this.options={...n},this.mark=t.mark,this.HTMLAttributes=t.HTMLAttributes}get dom(){return this.editor.view.dom}get contentDOM(){return null}updateAttributes(e,t){ni(t||this.mark,this.editor,e)}ignoreMutation(e){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:e}):!("selection"===e.type||this.dom.contains(e.target)&&"childList"===e.type&&(ed()||ea())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes
9)].every(e=>e.isContentEditable))&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)))}},ns=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=null==(t=e.undoable)||t}};function nl(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 d=a.state.doc.resolve(r);if(d.parent.type.spec.code||(null==(t=d.nodeBefore||d.nodeAfter)?void 0:t.marks.find(e=>e.type.spec.code)))return!1;let h=!1,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==(s=(l=e.type.spec).toText)?void 0:s.call(l,{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})(d)+o;return s.forEach(e=>{if(h)return;let t=((e,t)=>{if(X(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})(c,e.find);if(!t)return;let s=t[0].length-o.length;if(s>0){let e=d.parentOffset-s;if(e<0||d.parent.textBetween(e,d.parentOffset)!==t[0].slice(0,s))return}let u=a.state.tr,p=P({state:a.state,transaction:u}),f={from:r-(t[0].length-o.length),to:i}
9,{commands:m,chain:g,can:y}=new z({editor:n,state:p});null!==e.handler({state:p,range:f,match:t,commands:m,chain:g,can:y})&&u.steps.length&&(e.undoable&&u.setMeta(l,{transform:u,from:r,to:i,text:o}),a.dispatch(u),h=!0)}),h}var na=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...e3(eQ(this,"addOptions",{name:this.name}))}}get storage(){return{...e3(eQ(this,"addStorage",{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>(function e(t,n){let r={...t};return nt(t)&&nt(n)&&Object.keys(n).forEach(i=>{nt(n[i])&&nt(t[i])?r[i]=e(t[i],n[i]):r[i]=n[i]}),r})(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},nd=class e extends na{constructor(...e){super(...e),this.type="mark"}static create(t={}){return new e("function"==typeof t?t():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}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},nh=class{constructor(e){this.find=e.find,this.handler=e.handler}};let nc=null;var nu=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=t,this.baseExtensions=e,this.extensions=tr(e),this.schema=function(e,t){var n;let r=e5(e),{nodeExtensions:i,markExtensions:s}=e4(e),l=null==(n=i.find(e=>eQ(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=te({...e.reduce((e,t)=>{let r=eQ(t,"extendNodeSchema",o);return{...e,...r?r(n):{}}},{}),content:e3(eQ(n,"content",o)),marks:e3(eQ(n,"marks",o)),group:e3(eQ(n,"group",o)),inline:e3(eQ(n,"inline",o)),atom:e3(eQ(n,"atom",o)),selectable:e3(eQ(n,"selectable",o)),draggable:e3(eQ(n,"draggable",o)),code:e3(eQ(n,"code",o)),whitespace:e3(eQ(n,"whitespace",o)),linebreakReplacement:e3(eQ(n,"linebreakReplacement",o)),defining:e3(eQ(n,"defining",o)),isolating:e3(eQ(n,"isolating",o)),attrs:Object.fromEntries(i.map(tt))}),l=e3(eQ(n,"parseHTML",o));l&&(s.parseDOM=l.map(e=>e7(e,i)));let a=eQ(n,"renderHTML",o);a&&(s.toDOM=e=>a({node:e,HTMLAttributes:e9(e,i)}));let d=eQ(n,"renderText",o);return d&&(s.toText=d),[n.name,s]})),d=Object.fromEntries(s.map(n=>{let i=r.filter(e=>e.type===n.name),o={name:n.name,options:n.options,storage:n.storage,editor:t},s=te({...e.reduce((e,t)=>{let r=eQ(t,"extendMarkSchema",o);return{...e,...r?r(n):{}}},{}),inclusive:e3(eQ(n,"inclusive",o)),excludes:e3(eQ(n,"excludes",o)),group:e3(eQ(n,"group",o)),spanning:e3(eQ(n,"spanning",o)),code:e3(eQ(n,"code",o)),attrs:Object.fromEntries(i.map(tt))}),l=e3(eQ(n,"parseHTML",o));l&&(s.parseDOM=l.map(e=>e7(e,i)));let a=eQ(n,"renderHTML",o);return a&&(s.toDOM=e=>a({mark:e,HTMLAttributes:e9(e,i)})),[n.name,s]}));return new o.Sj({topNode:l,nodes:a,marks:d})}(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=eQ(t,"addCommands",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:tc(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this,t=tn([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:tc(t.name,this.schema)},r=[],i=eQ(t,"addKeyboardShortcuts",n),l={};if("mark"===t.type&&eQ(t,"exitable",n)&&(l.ArrowRight=()=>nd.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));l={...l,...t}}let a=(0,L.w)(l);r.push(a);let d=eQ(t,"addInputRules",n);if(tg(t,e.options.enableInputRules)&&d){let t=d();if(t&&t.length){let n=function(e){let{editor:t,rules:n}=e,r=new s.k_({state:{init:()=>null,apply(e,i,s){let l=e.getMeta(r);if(l)return l;let a=e.getMeta("applyInputRules");return a&&setTimeout(()=>{let{text:e}=a;"string"==typeof e||(e=e1(o.FK.from(e),s.schema));let{from:i}=a,l=i+e.length;nl({editor:t,from:i,to:l,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput:(e,i,o,s)=>nl({editor:t,from:i,to:o,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&nl({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if("Enter"!==i.key)return!1;let{$cursor:o}=e.state.selection;return!!o&&nl({editor:t,from:o.pos,to:o.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let h=eQ(t,"addPasteRules",n);if(tg(t,e.options.enablePasteRules)&&h){let t=h();if(t&&t.length){let n=function(e){let t,{editor:n,rules:r}=e,i=null,l=!1,a=!1,d="u">typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{t="u">typeof DragEvent?new DragEvent("drop"):null}catch{t=null}let h=({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:d,can:h}=new z({editor:t,state:n}),c=[];return n.doc.nodesBetween(r,i,(e,t)=>{var u,p,f,m;if((null==(u=e.type)||null==(u=u.spec)?void 0:u.code)||!(e.isText||e.isTextblock||e.isInline))return;let g=null!=(p=null!=(f=null==(m=e.content)?void 0:m.size)?f:e.nodeSize)?p:0,y=Math.max(r,t),v=Math.min(i,t+g);y>=v||((e,t,n)=>{if(X(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}):[]})(e.isText?e.text||"":e.textBetween(y-t,v-t,void 0,""),o.find,s).forEac
9h(e=>{if(void 0===e.index)return;let t=y+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:d,can:h,pasteEvent:s,dropEvent:l});c.push(u)})}),c.every(e=>null!==e)}({editor:n,state:P({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="u">typeof DragEvent?new DragEvent("drop"):null}catch{t=null}return d="u">typeof ClipboardEvent?new ClipboardEvent("paste"):null,l}};return r.map(e=>new s.k_({view(e){let t=t=>{var r;(i=(null==(r=e.dom.parentElement)?void 0:r.contains(t.target))?e.dom.parentElement:null)&&(nc=n)},r=()=>{nc&&(nc=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=i===e.dom.parentElement,t=n,!a){let e=nc;(null==e?void 0:e.isEditable)&&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 d=t,l=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{let i=t[0],s="paste"===i.getMeta("uiEvent")&&!l,c="drop"===i.getMeta("uiEvent")&&!a,u=i.getMeta("applyPasteRules"),p=!!u;if(!s&&!c&&!p)return;if(p){var f,m;let t,{text:n}=u;"string"==typeof n||(n=e1(o.FK.from(n),r.schema));let{from:i}=u,s=i+n.length;return h({rule:e,state:r,from:i,to:{b:s},pasteEvt:(f=n,null==(m=(t=new ClipboardEvent("paste",{clipboardData:new DataTransfer})).clipboardData)||m.setData("text/html",f),t)})}let g=n.doc.content.findDiffStart(r.doc.content),y=n.doc.content.findDiffEnd(r.doc.content);if("number"==typeof g&&y&&g!==y.b)return h({rule:e,state:r,from:g,to:y,pasteEvt:d})}}))}({editor:e,rules:t});r.push(...n)}}let c=eQ(t,"addProseMirrorPlugins",n);if(c){let e=c();r.push(...e)}return r}),n=this.createDecorationPlugin();return n&&t.push(n),t}createDecorationPlugin(){var e;let{editor:t}=this;null==(e=this.decorationManager)||e.destroy();let n=[];return this.extensions.forEach(e=>{let r=eQ(e,"addDecorations",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:tc(e.name,this.schema)});r&&n.push({name:e.name,addDecorations:r})}),this.decorationManager=new t9({editor:t,entries:n}),this.decorationManager.plugin}get attributes(){return e5(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=e4(this.extensions);return Object.fromEntries(t.filter(e=>!!eQ(e,"addNodeView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=eQ(t,"addNodeView",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:K(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,o,s,l,a)=>{let d=e9(r,n);return i({node:r,view:o,getPos:s,decorations:l,innerDecorations:a,editor:e,extension:t,HTMLAttributes:d})}]:[]}))}dispatchTransaction(e){let{editor:t}=this;return tn([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:tc(n.name,this.schema)},i=eQ(n,"dispatchTransaction",r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return tn([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:tc(n.name,this.schema)},i=eQ(n,"transformPastedHTML",r);return i?(t,n)=>{let o=e(t,n);return i.call(r,o)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=e4(this.extensions);return Object.fromEntries(t.filter(e=>!!eQ(e,"addMarkView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=eQ(t,"addMarkView",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:en(t.name,this.schema)});return r?[t.name,(i,o,s)=>{let l=e9(i,n);return r()({mark:i,view:o,inline:s,editor:e,extension:t,HTMLAttributes:l,updateAttributes:t=>{ni(i,e,t)}})}]:[]}))}destroy(){var e;null==(e=this.decorationManager)||e.destroy(),this.extensions.forEach(e
9=>{let t=e;for(;t.parent;){let e=t.parent;e.child===t&&(e.child=null),t=e}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:tc(e.name,this.schema)};if("mark"===e.type){var n,r;(null==(n=e3(eQ(e,"keepOnSplit",t)))||n)&&this.splittableMarks.push(e.name),null==(r=e3(eQ(e,"clearable",t)))||r||this.nonClearableMarks.push(e.name)}let i=eQ(e,"onBeforeCreate",t),o=eQ(e,"onCreate",t),s=eQ(e,"onUpdate",t),l=eQ(e,"onSelectionUpdate",t),a=eQ(e,"onTransaction",t),d=eQ(e,"onFocus",t),h=eQ(e,"onBlur",t),c=eQ(e,"onDestroy",t);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),l&&this.editor.on("selectionUpdate",l),a&&this.editor.on("transaction",a),d&&this.editor.on("focus",d),h&&this.editor.on("blur",h),c&&this.editor.on("destroy",c)})}};nu.resolve=tr,nu.sort=tn,nu.flatten=e0;var np=class e extends na{constructor(...e){super(...e),this.type="extension"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}};let nf=np.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new s.k_({key:new s.hs("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,o=ts(n),{blockSeparator:s}=this.options,l={...void 0!==s?{blockSeparator:s}:{},textSerializers:o};return[...i.ranges].sort((e,t)=>e.$from.pos-t.$from.pos).map(({$from:e,$to:t})=>ti(r,{from:e.pos,to:t.pos},l)).join(null!=s?s:"\n\n")}}})]}}),nm=np.create({name:"commands",addCommands:()=>({...tG})}),ng=np.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r;let o=()=>{var n,r,o;if(null!=(n=null==(r=this.editor.options.coreExtensionOptions)||null==(r=r.delete)||null==(o=r.filterTransaction)?void 0:o.call(r,e))?n:e.getMeta("y-sync$"))return;let s=eG(e.before,[e,...t]);
9ta(s).forEach(t=>{s.mapping.mapResult(t.oldRange.from).deletedAfter&&s.mapping.mapResult(t.oldRange.to).deletedBefore&&s.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{let i=r+n.nodeSize-2,o=t.oldRange.from<=r&&i<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:i,newFrom:s.mapping.map(r),newTo:s.mapping.map(i),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:s})})});let l=s.mapping;s.steps.forEach((t,n)=>{if(t instanceof i.Ys){var r,o;let i=l.slice(n).map(t.from,-1),a=l.slice(n).map(t.to),d=l.invert().map(i,-1),h=l.invert().map(a),c=i>0&&(null==(r=s.doc.nodeAt(i-1))?void 0:r.marks.some(e=>e.eq(t.mark))),u=null==(o=s.doc.nodeAt(a))?void 0:o.marks.some(e=>e.eq(t.mark));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:d,to:h},newRange:{from:i,to:a},partial:!!(u||c),editor:this.editor,transaction:e,combinedTransform:s})}})};null==(n=null==(r=this.editor.options.coreExtensionOptions)||null==(r=r.delete)?void 0:r.async)||n?setTimeout(o,0):o()}}),ny=np.create({name:"drop",addProseMirrorPlugins(){return[new s.k_({key:new s.hs("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),nv=np.create({name:"editable",addProseMirrorPlugins(){return[new s.k_({key:new s.hs("editable"),props:{editable:()=>this.editor.options.editable}})]}}),nb=new s.hs("focusEvents"),nw=np.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:e}=this;return[new s.k_({key:nb,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}}}})]}}),nk=np.create({name:"keymap",addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:o}=n,{pos:l,parent:a}=o,d=o.parent.isTextblock&&l>0?t.doc.resolve(l-1):o,h=d.parent.type.spec.isolating,c=o.pos-o.parentOffset,u=h&&1===d.parent.childCount?c===o.pos:s.LN.atStart(r).from===l;return!!i&&!!a.type.isTextblock&&!a.textContent.length&&!!u&&(!u||"paragraph"!==o.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()},r={...n},i={...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 ed()||eA()?i:r},addProseMirrorPlugins(){return[new s.k_({key:new s.hs("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta("composition")))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta("preventClearDocument"));if(!r||i)return;let{empty:o,from:l,to:a}=t.selection,d=s.LN.atStart(t.doc).from,h=s.LN.atEnd(t.doc).to;if(o||l!==d||a!==h||!tv(n.doc))return;let c=n.tr,u=P({state:n,transaction:c}),{commands:p}=new z({editor:this.editor,state:u});if(p.clearNodes(),c.steps.length)return c}})]}}),nx=np.create({name:"paste",addProseMirrorPlugins(){return[new s.k_({key:new s.hs("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),nS=np.create({name:"tabindex",addOptions:()=>({value:void 0}),addProseMirrorPlugins(){return[new s.k_({key:new s.hs("tabindex"),props:{attributes:()=>{var e;return this.editor.isEditable||void 0!==this.options.value?{tabindex:null!=(e=this.options.value)?e:"0"}:{}}}})]}}),nM=np.create({name:"textDirection",addOptions:()=>({direction:void 0}),addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=e4(this.extensions);return[{types:e.filter(e=>"text"!==e.name).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute("dir");return t&&("ltr"===t||"rtl"===t||"auto"===t)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new s.k_({key:new s.hs("textDirection"),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),nC=!1;
9var nO=class e{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 t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=n.isInline,l=this.pos+r+ +!o;if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;let a=this.resolvedPos.doc.resolve(l);if(!i&&!s&&a.depth<=this.depth)return;let d=new e(a,this.editor,i,i||s?n:null);i&&(d.actualDepth=this.depth+1),t.push(d)}),t}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.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||0===this.children.length)return r;let i=Object.keys(t);return this.children.forEach(o=>{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 nT=`.ProseMirror {
10  position: relative;
11}
12
13.ProseMirror {
14  word-wrap: break-word;
15  white-space: pre-wrap;
16  white-space: break-spaces;
17  -webkit-font-variant-ligatures: none;
18  font-variant-ligatures: none;
19  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
20}
21
22.ProseMirror [contenteditable="false"] {
23  white-space: normal;
24}
25
26.ProseMirror [contenteditable="false"] [contenteditable="true"] {
27  white-space: pre-wrap;
28}
29
30.ProseMirror pre {
31  white-space: pre-wrap;
32}
33
34img.ProseMirror-separator {
35  display: inline !important;
36  border: none !important;
37  margin: 0 !important;
38  width: 0 !important;
39  height: 0 !important;
40}
41
42.ProseMirror-gapcursor {
43  display: none;
44  pointer-events: none;
45  position: absolute;
46  margin: 0;
47}
48
49.ProseMirror-gapcursor:after {
50  content: "";
51  display: block;
52  position: absolute;
53  top: -2px;
54  width: 20px;
55  border-top: 1px solid black;
56  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
57}
58
59@keyframes ProseMirror-cursor-blink {
60  to {
61    visibility: hidden;
62  }
63}
64
65.ProseMirror-hideselection *::selection {
66  background: transparent;
67}
68
69.ProseMirror-hideselection *::-moz-selection {
70  background: transparent;
71}
72
73.ProseMirror-hideselection * {
74  caret-color: transparent;
75}
76
77.ProseMirror-focused .ProseMirror-gapcursor {
78  display: block;
79}`;var nE=class extends tZ{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:"u">typeof document?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:tk,createMappablePosition:tx},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit
79("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on("paste",({event:e,slice:t})=>this.options.onPaste(e,t)),this.on("delete",this.options.onDelete);let t=this.createDoc();if(!this.editorState){let e=el(t,this.options.autofocus);this.editorState=s.$t.create({doc:t,schema:this.schema,selection:e||void 0})}!function(e){let t;if(!nC){nC=!0;try{t=i.Ln.fromJSON(e,{from:0,to:0}).slice.content}catch{return}t instanceof o.FK||console.warn("[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.")}}(this.schema),this.options.element&&this.mount(this.options.element)}mount(e){if("u"<typeof document)throw Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(!1!==this.options.autofocus&&null!==this.options.autofocus&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;let e=this.editorView.dom;(null==e?void 0:e.editor)&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{"function"==typeof this.css.remove?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():z.createFakeChain()}can(){return this.commandManager?this.commandManager.can():z.createFallbackCan()}injectCSS(){this.options.injectCSS&&"u">typeof document&&(this.css=function(e,t){let n=document.querySelector("style[data-tiptap-style]");if(null!==n)return n;let r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}(nT,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if("state"===t)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return tQ&&!this.hasWarnedStaleDecorationRead&&tX.has(this)&&(this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=e2(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;
79if([].concat(e).forEach(e=>{let t="string"==typeof e?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),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?[nv,nf.configure({blockSeparator:null==(e=this.options.coreExtensionOptions)||null==(e=e.clipboardTextSerializer)?void 0:e.blockSeparator}),nm,nw,nk,nS.configure({value:null==(t=this.options.coreExtensionOptions)||null==(t=t.tabindex)?void 0:t.value}),ny,nx,ng,nM.configure({direction:this.options.textDirection})].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 nu(n,this)}createCommandManager(){this.commandManager=new z({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=eJ(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;let e=eJ(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=s.$t.create({doc:e,schema:this.schema,selection:el(e,this.options.autofocus)||void 0}),this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&"object"==typeof this.storage.collaboration&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>"collaboration"!==e.name),this.createExtensionManager()}}),this.editorState.doc}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,o=t.transformPastedHTML,s=this.extensionManager.transformPastedHTML(o);this.editorView=new I.Lz(e,{...t,attributes:{role:"textbox",...null==t?void 0:t.attributes},dispatchTransaction:i,transformPastedHTML:s,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let l=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(l),this.prependClass(),this.injectCSS(),this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(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{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),o=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});let s=n.findLast(e=>e.getMeta("focus")||e.getMeta("blur")),l=null==s?void 0:s.getMeta("focus"),a=null==s?void 0:s.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:s}),a&&this.emit("blur",{editor:this,event:a.event,transaction:s}),e.getMeta("preventUpdate")||!n.some(e=>e.docChanged)||o.doc.eq(t.doc)||this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return tl(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 eR(e,null,n)||tp(e,null,n);let r=e$(t,e.schema);return"node"===r?eR(e,t,n):"mark"===r&&tp(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}
79getHTML(){return e1(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return to(this.state.doc,{blockSeparator:t,textSerializers:{...ts(this.schema),...n}})}get isEmpty(){return tv(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var e,t;return null==(e=null==(t=this.editorView)?void 0:t.isDestroyed)||e}$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){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new nO(t,this,!1,n)}get $doc(){return this.$pos(0)}},nN=class{static Inline(e,t,n={},r){return new nA(e,t,n,r)}static Node(e,t,n={},r){return new nD(e,t,n,r)}static Widget(e,t,n){let{key:r,...i}=n;return new nR(e,t,r,i)}},nA=class extends nN{constructor(e,t,n={},r){super(),this.kind="inline",this.from=e,this.to=t,this.attrs=n,this.spec=r}get anchor(){return this.from}toPMDecoration(e){let t=e?{...this.spec,extensionName:e}:this.spec;return I.NZ.inline(this.from,this.to,this.attrs,t)}},nD=class extends nN{constructor(e,t,n={},r){super(),this.kind="node",this.from=e,this.to=t,this.attrs=n,this.spec=r}get anchor(){return this.from}toPMDecoration(e){let t=e?{...this.spec,extensionName:e}:this.spec;return I.NZ.node(this.from,this.to,this.attrs,t)}},nR=class extends nN{constructor(e,t,n,r){super(),this.kind="widget",this.pos=e,this.render=t,this.key=n,this.spec=r}get anchor(){return this.pos}toPMDecoration(e){let t=e?{...this.spec,key:this.key,extensionName:e}:{...this.spec,key:this.key};return I.NZ.widget(this.pos,this.render,t)}};function nI(e){return new ns({find:e.find,handler:({state:t,range:n,match:r})=>{let i=e3(e.getAttributes,void 0,r);if(!1===i||null===i)return null;let{tr:o}=t,s=r[r.length-1],l=r[0];if(s){let r=l.search(/\S/),a=n.from+l.indexOf(s),d=a+s.length;if(td(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>a).length)return null;
79d<n.to&&o.delete(d,n.to),a>n.from&&o.delete(n.from+r,a);let h=n.from+r+s.length;o.addMark(n.from+r,h,e.type.create(i||{})),o.removeStoredMark(e.type)}},undoable:e.undoable})}function nL(e){return new ns({find:e.find,handler:({state:t,range:n,match:r})=>{let i=e3(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()},undoable:e.undoable})}function nP(e){return new ns({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),o=e3(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)},undoable:e.undoable})}function nz(e){return new ns({find:e.find,handler:({state:t,range:n,match:r,chain:o})=>{let s=e3(e.getAttributes,void 0,r)||{},l=t.tr.delete(n.from,n.to),a=l.doc.resolve(n.from).blockRange(),d=a&&(0,i.oM)(a,e.type,s);if(!d)return null;if(l.wrap(a,d),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));l.ensureMarks(e)}}if(e.keepAttributes){let t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";o().updateAttributes(t,s).run()}let h=l.doc.resolve(n.from-1).nodeBefore;h&&h.type===e.type&&(0,i.n9)(l.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,h))&&l.join(n.from-1)},undoable:e.undoable})}var n$=class{constructor(e){var t,n,r,i,o,s;this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=e=>{"Shift"===e.key&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{"Shift"===e.key&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.element.draggable=!1,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,(null==(t=e.options)?void 0:t.min)&&(this.minSize={...this.minSize,...e.options.min}),(null==(n=e.options)?void 0:n.max)&&(this.maxSize=e.options.max),(null==e||null==(r=e.options)?void 0:r.directions)&&(this.directions=e.options.directions),(null==(i=e.options)?void 0:i.preserveAspectRatio)&&(this.preserveAspectRatio=e.options.preserveAspectRatio),(null==(o=e.options)?void 0:o.className)&&(this.classNames={container:e.options.className.container||"",wrapper:e.options.className.wrapper||"",handle:e.options.className.handle||"",resizing:e.options.className.resizing||""}),(null==(s=e.options)?void 0:s.createCustomHandle)&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var e;return null!=(e=this.contentElement)?e:null}handleEditorUpdate(){let e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&0===this.handleMap.size&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type===this.node.type&&(this.node=e,!this.onUpdate||this.onUpdate(e,t,n))}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){let e=document.createElement("div");return e.dataset.resizeContainer="",e.dataset.node=this.node.type.n
79ame,e.style.display=this.node.type.isInline?"inline-flex":"flex",this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){let e=document.createElement("div");return e.style.position="relative",e.style.display="block",e.dataset.resizeWrapper="",this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){let t=document.createElement("div");return t.dataset.resizeHandle=e,t.style.position="absolute",this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){let n=t.includes("top"),r=t.includes("bottom"),i=t.includes("left"),o=t.includes("right");n&&(e.style.top="0"),r&&(e.style.bottom="0"),i&&(e.style.left="0"),o&&(e.style.right="0"),("top"===t||"bottom"===t)&&(e.style.left="0",e.style.right="0"),("left"===t||"right"===t)&&(e.style.top="0",e.style.bottom="0")}attachHandles(){this.directions.forEach(e=>{let t;(t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e))instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener("mousedown",t=>this.handleResizeStart(t,e)),t.addEventListener("touchstart",t=>this.handleResizeStart(t,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){let e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,"touches"in e?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),o=this.applyConstraints(r,i,n);this.element.style.width=`${o.width}px`,this.element.style.height=`${o.height}px`,this.onResize&&this.onResize(o.width,o.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight,o=e.includes("right"),s=e.includes("left"),l=e.includes("bottom"),a=e.includes("top");return(o?r=this.startWidth+t:s&&(r=this.startWidth-t),l?i=this.startHeight+n:a&&(i=this.startHeight-n),("right"===e||"left"===e)&&(r=this.startWidth+(o?t:-t)),("top"===e||"bottom"===e)&&(i=this.startHeight+(l?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed)?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){var r,i,o,s;if(!n){let n=Math.max(this.minSize.width,e),r=Math.max(this.minSize.height,t);return(null==(o=this.maxSize)?void 0:o.width)&&(n=Math.min(this.maxSize.width,n)),(null==(s=this.maxSize)?void 0:s.height)&&(r=Math.min(this.maxSize.height,r)),{width:n,height:r}}let l=e,a=t;return l<this.minSize.width&&(a=(l=this.minSize.width)/this.aspectRatio),a<this.minSize.height&&(l=(a=this.minSize.height)*this.aspectRatio),(null==(r=this.maxSize)?void 0:r.width)&&l>this.maxSize.width&&(a=(l=this.maxSize.width)/this.aspectRatio),(null==(i=this.maxSize)?void 0:i.height)&&a>this.maxSize.height&&(l=(a=this.maxSize.height)*this.aspectRatio),{width:l,height:a}}applyAspectRatio(e,t,n){return"left"===n||"right"===n?{width:e,height:e/this.aspectRatio}:"top"===n||"bottom"===n?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}},nB=class e extends na{constructor(...e){super(...e),this.type="node"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},nj=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=()=>{try{return t.getPos()}catch{return}},this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,i,o,l,a;let{view:d}=this.editor,h=e.target,c=3===h.nodeType?null==(t=h.parentElement)?void 0:t.closest("[data-drag-handle]"):h.closest("[data-drag-handle]");if(!this.dom||(null==(n=this.contentDOM)?void 0:n.contains(h))||!c)return;let u=0,p=0;if(this.dom!==c){let t=this.dom.getBoundingClientRect(),n=c.getBoundingClientRect(),s=null!=(r=e.offsetX)?r:null==(i=e.nativeEvent)?void 0:i.offsetX,a=null!=(o=e.offsetY)?o:null==(l=e.nativeEvent)?void 0:l.offsetY;u=n.x-t.x+s,p=n.y-t.y+a}let f=this.dom.cloneNode(!0);try{let e=this.dom.getBoundingClientRect();f.style.width=`${Math.round(e.width)}px`,f.style.height=`${Math.round(e.height)}px`,f.style.boxSizing="border-box",f.style.pointerEvents="none"}catch{}let m=null;try{(m=document.createElement("div")).style.position="absolute",m.style.top="-9999px",m.style.left="-9999px",m.style.pointerEvents="none",m.appendChild(f),document.body.appendChild(m),null==(a=e.dataTransfer)||a.setDragImage(f,u,p)}finally{m&&setTimeout(()=>{try{null==m||m.remove()}catch{}},0)}let g=this.getPos();if("number"!=typeof g)return;let y=s.nh.create(d.state.doc,g),v=d.state.tr.setSelection(y);d.dispatch(v)}stopEvent(e){var t;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:e});let n=e.target;if(!(this.dom.contains(n)&&!(null==(t=this.contentDOM)?void 0:t.contains(n))))return!1;let r=e.type.startsWith("drag"),i="dragover"===e.type||"dragenter"===e.type,o="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!o&&!r)return!0;let{isEditable:l}=this.editor,{isDragging:a}=this,d=!!this.node.type.spec.draggable,h=s.nh.isSelectable(this.node),c="copy"===e.type,u="paste"===e.type,p="cut"
79===e.type,f="mousedown"===e.type;if(!d&&h&&r&&e.target===this.dom&&e.preventDefault(),d&&r&&!a&&e.target===this.dom)return e.preventDefault(),!1;if(d&&l&&!a&&f){let e=n.closest("[data-drag-handle]");e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!a&&!i&&!o&&!c&&!u&&!p&&(!f||!h)&&!0}ignoreMutation(e){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:e}):!!this.node.isLeaf||!!this.node.isAtom||!("selection"===e.type||this.dom.contains(e.target)&&"childList"===e.type&&(ed()||ea())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable))&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)))}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let n=this.getPos();return"number"==typeof n&&(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){let e=this.getPos();if("number"!=typeof e)return;let t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};function nH(e){return new nh({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let o=e3(e.getAttributes,void 0,r,i);if(!1===o||null===o)return null;let{tr:s}=t,l=r[r.length-1],a=r[0],d=n.to;if(l){let i=a.search(/\S/),h=n.from+a.indexOf(l),c=h+l.length;if(td(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>h).length)return null;c<n.to&&s.delete(c,n.to),h>n.from&&s.delete(n.from+i,h),d=n.from+i+l.length,s.addMark(n.from+i,d,e.type.create(o||{})),void 0!==r.index&&void 0!==r.input&&r.index+r[0].length>=r.input.length||s.removeStoredMark(e.type)}}})}},Fu(e,t,n){var r=n("ier").Q1;n.d(t,{A:()=>r})},Vf(e,t,n){var r=n("YI9"),i=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,o=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,s=r.CU.create({name:"highlight",addOptions:()=>({multicolor:!1,HTMLAttributes:{}}),addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML:()=>[{tag:"mark"}],renderHTML({HTMLAttributes:e}){return["mark",(0,r.KV)(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark("highlight",t.parseInline(e.tokens||[])),markdownTokenizer:{name:"highlight",level:"inline",start:e=>e.indexOf("=="),tokenize(e,t,n){let r=/^(==)([^=]+)(==)/.exec(e);if(r){let e=r[2].trim(),t=n.inlineTokens(e);return{type:"highlight",raw:r[0],text:e,tokens:t}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}}
79,addInputRules(){return[(0,r.OX)({find:i,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:o,type:this.type})]}});n.d(t,{Ay:()=>s})},LxN(e,t,n){var r=n("YI9"),i=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,o=r.bP.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",(0,r.KV)(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,n,r,i,o,s;let l=null!=(n=null==(t=e.attrs)?void 0:t.src)?n:"",a=null!=(i=null==(r=e.attrs)?void 0:r.alt)?i:"",d=null!=(s=null==(o=e.attrs)?void 0:o.title)?s:"";return d?`![${a}](${l} "${d}")`:`![${a}](${l})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||"u"<typeof document)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:i}=this.options.resize;return({node:o,getPos:s,HTMLAttributes:l,editor:a})=>{let d=document.createElement("img");Object.entries(l).forEach(([e,t])=>{if(null!=t)switch(e){case"width":case"height":break;default:d.setAttribute(e,t)}}),d.src=l.src;let h=new r.Nz({element:d,editor:a,node:o,getPos:s,onResize:(e,t)=>
79{d.style.width=`${e}px`,d.style.height=`${t}px`},onCommit:(e,t)=>{let n=s();void 0!==n&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,n)=>e.type===o.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:!0===i}}),c=h.dom;return c.style.visibility="hidden",c.style.pointerEvents="none",d.onload=()=>{c.style.visibility="",c.style.pointerEvents=""},h}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[(0,r.Ce)({find:i,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}});n.d(t,{Ay:()=>o})},hFG(e,t,n){n.d(t,{N_:()=>eW,Ay:()=>eq});var r=n("YI9");let i="numeric",o="ascii",s="alpha",l="asciinumeric",a="alphanumeric",d="domain",h="emoji",c="whitespace";function u(e,t,n){for(let r in t[i]&&(t[l]=!0,t[a]=!0),t[o]&&(t[l]=!0,t[s]=!0),t[l]&&(t[a]=!0),t[s]&&(t[a]=!0),t[a]&&(t[d]=!0),t[h]&&(t[d]=!0),t){let t=(r in n||(n[r]=[]),n[r]);0>t.indexOf(e)&&t.push(e)}}function p(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}p.groups={},p.prototype={accepts(){return!!this.t},go(e){let t=this.j[e];if(t)return t;for(let t=0;t<this.jr.length;t++){let n=this.jr[t][0],r=this.jr[t][1];if(r&&n.test(e))return r}return this.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){let i;return r=r||p.groups,t&&t.j?i=t:(i=new p(t),n&&r&&u(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,o=e.length;if(!o)return i;for(let t=0;t<o-1;t++)i=i.tt(e[t]);return i.tt(e[o-1],t,n,r)},tt(e,t,n,r){if(r=r||p.groups,t&&t.j)return this.j[e]=t,t;let i,o=this.go(e);return o?(Object.assign((i=new p).j,o.j),i.jr.push.apply(i.jr,o.jr),i.jd=o.jd,i.t=o.t):i=new p,t&&(r&&(i.t&&"string"==typeof i.t?u(t,Object.assign(function(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}(i.t,r),n),r):n&&u(t,n,r)),i.t=t),this.j[e]=i,i}};let f=(e,t,n,r,i)=>e.ta(t,n,r,i),m=(e,t,n,r,i)=>e.tr(t,n,r,i),g=(e,t,n,r,i)=>e.ts(t,n,r,i),y=(e,t,n,r,i)=>e.tt(t,n,r,i),v="WORD",b="UWORD",w="ASCIINUMERICAL",k="ALPHANUMERICAL",x="LOCALHOST",S="UTLD",M="SCHEME",C="SLASH_SCHEME",O="OPENBRACE",T="CLOSEBRACE",E="OPENBRACKET",N="CLOSEBRACKET",A="OPENPAREN",D="CLOSEPAREN",R="OPENANGLEBRACKET",I="CLOSEANGLEBRACKET",L="FULLWIDTHLEFTPAREN",P="FULLWIDTHRIGHTPAREN",z="LEFTCORNERBRACKET",$="RIGHTCORNERBRACKET",B="LEFTWHITECORNERBRACKET",j="RIGHTWHITECORNERBRACKET",H="FULLWIDTHLESSTHAN",F="FULLWIDTHGREATERTHAN",V="AMPERSAND",U="APOSTROPHE",K="ASTERISK",W="BACKSLASH",q="BACKTICK",J="CARET",_="COLON",Y="COMMA",G="DOLLAR",X="EQUALS",Z="EXCLAMATION",Q="HYPHEN",ee="PERCENT",et="PIPE",en="PLUS",er="POUND",ei="QUERY",eo="QUOTE",es="FULLWIDTHMIDDLEDOT",el="SEMI",ea="SLASH",ed="TILDE",eh="UNDERSCORE",ec="EMOJI";var eu=Object.freeze({__proto__:null,ALPHANUMERICAL:k,AMPERSAND:V,APOSTROPHE:U,ASCIINUMERICAL:w,ASTERISK:K,AT:"AT",BACKSLASH:W,BACKTICK:q,CARET:J,CLOSEANGLEBRACKET:I,CLOSEBRACE:T,CLOSEBRACKET:N,CLOSEPAREN:D,COLON:_,COMMA:Y,DOLLAR:G,DOT:"DOT",EMOJI:ec,EQUALS:X,EXCLAMATION:Z,FULLWIDTHGREATERTHAN:F,FULLWIDTHLEFTPAREN:L,FULLWIDTHLESSTHAN:H,FULLWIDTHMIDDLEDOT:es,FULLWIDTHRIGHTPAREN:P,HYPHEN:Q,LEFTCORNERBRACKET:z,LEFTWHITECORNERBRACKET:B,LOCALHOST:x,NL:"NL",NUM:"NUM",OPENANGLEBRACKET:R,OPENBRACE:O,OPENBRACKET:E,OPENPAREN:A,PERCENT:ee,PIPE:et,PLUS:en,POUND:er,QUERY:ei,QUOTE:eo,RIGHTCORNERBRACKET:$,RIGHTWHITECORNERBRACKET:j,SCHEME:M,SEMI:el,SLASH:ea,SLASH_SCHEME:C,SYM:"SYM",TILDE:ed,TLD:"TLD",UNDERSCORE:eh,UTLD:S,UWORD:b,WORD:v,WS:"WS"});let ep=/[a-z]/,ef=/\p{L}/u,em=/\p{Emoji}/u,eg=/\d/,ey=/\s/,ev=null,eb=null;function ew(e,t){let n=function(e){let t=[],n=e.length,r=0;for(;r<n;){let i,o=e.charCodeAt(r),s=o<55296||o>56319||r+1===n||(i=e.charCodeAt(r+1))<56320||i>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],o=0,s=0;for(;s<r;){let l=e,a=null,d=0,h=null,c=-1,u=-1;for(;s<r&&(a=l.go(n[s]));)(l=a).accepts()?(c=0,u=0,h=l):c>=0&&(c+=n[s].length,u++),d+=n[s].length,o+=n[s].length,s++;o-=c,s-=u,d-=c,i.push({t:h.t,v:t.slice(o-d,o),s:o-d,e:o})}return i}function ek(e,t,n,r,i){let o,s=t.length;for(let n=0;n<s-1;n++){let s=t[n];e.j[s]?o=e.j[s]:((o=new p(r)).jr=i.slice(),e.j[s]=o),e=o}return(o=new p(n)).jr=i.slice(),e.j[t[s-1]]=o,o}function ex(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;"0123456789".indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(""));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}let eS={defaultProtocol:"http",events:null,format:eC,formatHref:eC,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function eM(e,t=null){let n=Object.assign({},eS);e&&(n=Object.assign(n,e instanceof eM?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}function eC(e){return e}function eO(e,t){this.t="token",this.v=e,this.tk=t}
79function eT(e,t){class n extends eO{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}eM.prototype={o:eS,ignoreTags:[],defaultRender:e=>e,check(e){return this.get("validate",e.toString(),e)},get(e,t,n){let r=null!=t,i=this.o[e];return i&&("object"==typeof i?"function"==typeof(i=n.t in i?i[n.t]:eS[e])&&r&&(i=i(t,n)):"function"==typeof i&&r&&(i=i(t,n.t,n))),i},getObj(e,t,n){let r=this.o[e];return"function"==typeof r&&null!=t&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}},eO.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=eS.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){let t=this.toHref(e.get("defaultProtocol")),n=e.get("formatHref",t,this),r=e.get("tagName",t,this),i=this.toFormattedString(e),o={},s=e.get("className",t,this),l=e.get("target",t,this),a=e.get("rel",t,this),d=e.getObj("attributes",t,this),h=e.getObj("events",t,this);return o.href=n,s&&(o.class=s),l&&(o.target=l),a&&(o.rel=a),d&&Object.assign(o,d),{tagName:r,attributes:o,content:i,eventListeners:h}}};let eE=eT("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),eN=eT("text"),eA=eT("nl"),eD=eT("url",{isLink:!0,toHref(e=eS.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==x&&e[1].t===_}}),eR=e=>new p(e);function eI(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}let eL="u">typeof console&&console&&console.warn||(()=>{}),eP={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function ez(e,t=!1){if(eP.initialized&&eL(`linkifyjs: already initialized - will not register custom scheme "${e}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
801. Must only contain digits, lowercase ASCII letters or "-"
812. Cannot start or end with "-"
823. "-" cannot repeat`);eP.customSchemes.push([e,t])}function e$(e){return eP.initialized||function(){eP.scanner=function(e=[]){let t={};p.groups=t;let n=new p;null==ev&&(ev=ex("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2
82ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==eb&&(eb=ex("ελ1υ2бг1ел3дети4ею2католик6ом3мÐ
82ºÐ´2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3Õ°Õ¡Õµ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1ì»´2삼성2한국2")),y(n,"'",U),y(n,"{",O),y(n,"}",T),y(n,"[",E),y(n,"]",N),y(n,"(",A),y(n,")",D),y(n,"<",R),y(n,">",I),y(n,"(",L),y(n,")",P),y(n,"「",z),y(n,"」",$),y(n,"『",B),y(n,"』",j),y(n,"<",H),y(n,">",F),y(n,"&",V),y(n,"*",K),y(n,"@","AT"),y(n,"`",q),y(n,"^",J),y(n,":",_),y(n,",",Y),y(n,"$",G),y(n,".","DOT"),y(n,"=",X),y(n,"!",Z),y(n,"-",Q),y(n,"%",ee),y(n,"|",et),y(n,"+",en),y(n,"#",er),y(n,"?",ei),y(n,'"',eo),y(n,"/",ea),y(n,";",el),y(n,"~",ed),y(n,"_",eh),y(n,"\\",W),y(n,"・",es);let r=m(n,eg,"NUM",{[i]:!0});m(r,eg,r);let f=m(r,ep,w,{[l]:!0}),ew=m(r,ef,k,{[a]:!0}),eS=m(n,ep,v,{[o]:!0});m(eS,eg,f),m(eS,ep,eS),m(f,eg,f),m(f,ep,f);let eM=m(n,ef,b,{[s]:!0});m(eM,ep),m(eM,eg,ew),m(eM,ef,eM),m(ew,eg,ew),m(ew,ep),m(ew,ef,ew);let eC=y(n,"\n","NL",{[c]:!0}),eO=y(n,"\r","WS",{[c]:!0}),eT=m(n,ey,"WS",{[c]:!0});y(n,"",eT),y(eO,"\n",eC),y(eO,"",eT),m(eO,ey,eT),y(eT,"\r"),y(eT,"\n"),m(eT,ey,eT),y(eT,"",eT);let eE=m(n,em,ec,{[h]:!0});y(eE,"#"),m(eE,em,eE),y(eE,"️",eE);let eN=y(eE,"‍");y(eN,"#"),m(eN,em,eE);let eA=[[ep,eS],[eg,f]],eD=[[ep,null],[ef,eM],[eg,ew]];for(let e=0;e<ev.length;e++)ek(n,ev[e],"TLD",v,eA);for(let e=0;e<eb.length;e++)ek(n,eb[e],S,b,eD);u("TLD",{tld:!0,ascii:!0},t),u(S,{utld:!0,alpha:!0},t),ek(n,"file",M,v,eA),ek(n,"mailto",M,v,eA),ek(n,"http",C,v,eA),ek(n,"https",C,v,eA),ek(n,"ftp",C,v,eA),ek(n,"ftps",C,v,eA),u(M,{scheme:!0,ascii:!0},t),u(C,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],s=e[t][1]?{scheme:!0}:{slashscheme:!0};r.indexOf("-")>=0?s[d]=!0:ep.test(r)?eg.test(r)?s[l]=!0:s[o]=!0:s[i]=!0,g(n,r,r,s)}return g(n,"localhost",x,{ascii:!0}),n.jd=new p("SYM"),{start:n,tokens:Object.assign({groups:t},eu)}}(eP.customSchemes);for(let e=0;e<eP.tokenQueue.length;e++)eP.tokenQueue[e][1]({scanner:eP.scanner});eP.parser=function({groups:e}){let t=e.domain.concat([V,K,"AT",W,q,J,G,X,Q,"NUM",ee,et,en,er,ea,"SYM",ed,eh]),n=[U,_,Y,"DOT",Z,ee,ei,eo,el,R,I,O,T,N,E,A,D,L,P,z,$,B,j,H,F],r=[V,U,K,W,q,J,G,X,Q,O,T,ee,et,en,er,ei,ea,"SYM",ed,eh],i=eR(),o=y(i,ed);f(o,r,o),f(o,e.domain,o);let s=eR(),l=eR(),a=eR();f(i,e.domain,s),f(i,e.scheme,l),f(i,e.slashscheme,a),f(s,r,o),f(s,e.domain,s);let d=y(s,"AT");y(o,"AT",d),y(l,"AT",d),y(a,"AT",d);let h=y(o,"DOT");f(h,r,o),f(h,e.domain,o);let c=eR();f(d,e.domain,c),f(c,e.domain,c);let u=y(c,"DOT");f(u,e.domain,c);let p=eR(eE);f(u,e.tld,p),f(u,e.utld,p),y(d,x,p);let m=y(c,Q);y(m,Q,m),f(m,e.domain,c),f(p,e.domain,c),y(p,"DOT",u),y(p,Q,m),f(y(p,_),e.numeric,eE);let g=y(s,Q),v=y(s,"DOT");y(g,Q,g),f(g,e.domain,s),f(v,r,o),f(v,e.domain,s);let b=eR(eD);f(v,e.tld,b),f(v,e.utld,b),f(b,e.domain,s),f(b,r,o),y(b,"DOT",v),y(b,Q,g),y(b,"AT",d);let w=y(b,_),k=eR(eD);f(w,e.numeric,k);let S=eR(eD),M=eR();f(S,t,S),f(S,n,M),f(M,t,S),f(M,n,M),y(b,ea,S),y(k,ea,S);let C=y(l,_),es=y(a,_),ec=y(es,ea),ep=y(ec,ea);f(l,e.domain,s),y(l,"DOT",v),y(l,Q,g),f(a,e.domain,s),y(a,"DOT",v),y(a,Q,g),f(C,e.domain,S),y(C,ea,S),y(C,ei,S),f(ep,e.domain,S),f(ep,t,S),y(ep,ea,S);let ef=[[O,T],[E,N],[A,D],[R,I],[L,P],[z,$],[B,j],[H,F]];for(let e=0;e<ef.length;e++){let[r,i]=ef[e],o=y(S,r);y(M,r,o),y(o,i,S);let s=eR(eD);f(o,t,s);let l=eR();f(o,n),f(s,t,s),f(s,n,l),f(l,t,s),f(l,n,l),y(s,i,S),y(l,i,S)}return y(i,x,b),y(i,"NL",eA),{start:i,tokens:eu}}(eP.scanner.tokens);for(let e=0;e<eP.pluginQueue.length;e++)eP.pluginQueue[e][1]({scanner:eP.scanner,parser:eP.parser});eP.initialized=!0}(),function(e,t,n){let r=n.length,i=0,o=[],s=[];for(;i<r;){let l=e,a=null,d=null,h=0,c=null,u=-1;for(;i<r&&!(a=l.go(n[i].t));)s.push(n[i++]);for(;i<r&&(d=a||l.go(n[i].t));)a=null,(l=d).accepts()?(u=0,c=l):u>=0&&u++,i++,h++;if(u<0)(i-=h)<r&&(s.push(n[i]),i++);else{s.length>0&&(o.push(eI(eN,t,s)),s=[]),i-=u,h-=u;let e=c.t,r=n.slice(i-h,i);o.push(eI(e,t,r))}}return s.length>0&&o.push(eI(eN,t,s)),o}(eP.parser.start,e,ew(eP.scanner.start,e))}function eB(e,t=null,n=null){if(t&&"object"==typeof t){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new eM(n),i=e$(e),o=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&o.push(n.toFormattedObject(r))}return o}e$.scan=ew;var ej=n("SB"),eH="[\0-   ᠎ -\u2029  ]",eF=new RegExp(eH),eV=RegExp(`${eH}$`),eU=RegExp(eH,"g");function eK(e,t){let n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];
82return t&&t.forEach(e=>{let t="string"==typeof e?e:e.scheme;t&&n.push(t)}),!e||e.replace(eU,"").match(RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var eW=r.CU.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{"string"==typeof e?ez(e):ez(e.scheme,e.optionalSlashes)})},onDestroy(){p.groups={},eP.scanner=null,eP.parser=null,eP.tokenQueue=[],eP.pluginQueue=[],eP.customSchemes=[],eP.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!eK(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;let r=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!/^\d{1,3}(\.\d{1,3}){3}$/.test(r)&&!!/\./.test(r)}}),addAttributes(){return{href:{default:null,parseHTML:e=>e.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{let t=e.getAttribute("href");return!!t&&!!this.options.isAllowedUri(t,{defaultValidate:e=>!!eK(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!eK(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",(0,r.KV)(this.options.HTMLAttributes,e),0]:["a",(0,r.KV)(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n,r,i,o;let s=null!=(r=null==(n=e.attrs)?void 0:n.href)?r:"",l=null!=(o=null==(i=e.attrs)?void 0:i.title)?o:"",a=t.renderChildren(e);return l?`[${a}](${s} "${l}")`:`[${a}](${s})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!eK(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().setMark(this.name,e).setMeta("preventAutolink",!0).run()},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return(!n||!!this.options.isAllowedUri(n,{defaultValidate:e=>!!eK(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[(0,r.Zc)({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=eB(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!eK(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t}
82,type:this.type,getAttributes:e=>{var t;return{href:null==(t=e.data)?void 0:t.href}}})]},addProseMirrorPlugins(){var e,t,n;let i=[],{protocols:o,defaultProtocol:s}=this.options;return this.options.autolink&&i.push((e={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!eK(e,o),protocols:o,defaultProtocol:s}),shouldAutoLink:this.options.shouldAutoLink},new ej.k_({key:new ej.hs("autolink"),appendTransaction:(t,n,i)=>{let o=t.some(e=>e.docChanged)&&!n.doc.eq(i.doc),s=t.some(e=>e.getMeta("preventAutolink"));if(!o||s)return;let{tr:l}=i,a=(0,r.T7)(n.doc,[...t]);if((0,r.FF)(a).forEach(({newRange:t})=>{let n,o,s=(0,r.Nx)(i.doc,t,e=>e.isTextblock);if(s.length>1)n=s[0],o=i.doc.textBetween(n.pos,n.pos+n.node.nodeSize,void 0," ");else if(s.length){let e=i.doc.textBetween(t.from,t.to," "," ");if(!eV.test(e))return;n=s[0],o=i.doc.textBetween(n.pos,t.to,void 0," ")}if(n&&o){let t=o.split(eF).filter(Boolean);if(t.length<=0)return!1;let s=t[t.length-1],a=n.pos+o.lastIndexOf(s);if(!s)return!1;let d=e$(s).map(t=>t.toObject(e.defaultProtocol));if(!(1===d.length?d[0].isLink:3===d.length&&!!d[1].isLink&&["()","[]"].includes(d[0].value+d[2].value)))return!1;d.filter(e=>e.isLink).map(e=>({...e,from:a+e.start+1,to:a+e.end+1})).filter(e=>!i.schema.marks.code||!i.doc.rangeHasMark(e.from,e.to,i.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{(0,r.hO)(t.from,t.to,i.doc).some(t=>t.mark.type===e.type)||l.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),l.steps.length)return l}}))),i.push((t={type:this.type,editor:this.editor,openOnClick:"whenNotEditable"===this.options.openOnClick||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection},new ej.k_({key:new ej.hs("handleClickLink"),props:{handleClick:(e,n,i)=>{var o,s;if(0!==i.button||!e.editable)return!1;let l=null;if(i.target instanceof HTMLAnchorElement)l=i.target;else{let e=i.target;if(!e)return!1;let n=t.editor.view.dom;(l=e.closest("a"))&&!n.contains(l)&&(l=null)}if(!l)return!1;let a=!1;if(t.enableClickSelection&&(a=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){let n=(0,r.gu)(e.state,t.type.name),i=null!=(o=l.href)?o:n.href,d=null!=(s=l.target)?s:n.target;i&&(window.open(i,d),a=!0)}return a}}}))),this.options.linkOnPaste&&i.push((n={editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink},new ej.k_({key:new ej.hs("handlePasteLink"),props:{handlePaste:(e,t,r)=>{let{shouldAutoLink:i}=n,{state:o}=e,{selection:s}=o,{empty:l}=s;if(l)return!1;let a="";r.content.forEach(e=>{a+=e.textContent});let d=eB(a,{defaultProtocol:n.defaultProtocol}).find(e=>e.isLink&&e.value===a);return!!a&&!!d&&(void 0===i||!!i(d.value))&&n.editor.commands.setMark(n.type,{href:d.href})}}}))),i}}),eq=eW},FEa(e,t,n){var r=n("YI9"),i=Object.defineProperty,o="textStyle",s=/^\s*([-+*])\s$/,l=r.bP.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.KV)(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>"list"!==e.type||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownOptions:{indentsContent:!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(o)
82).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.tG)({find:s,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=(0,r.tG)({find:s,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(o),editor:this.editor})),[e]}}),a=r.bP.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",(0,r.KV)(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{var n;if("list_item"!==e.type)return[];let r=null!=(n=t.parseBlockChildren)?n:t.parseChildren,i=[];if(e.tokens&&e.tokens.length>0)if(e.tokens.some(e=>"paragraph"===e.type))i=r(e.tokens);else{let n=e.tokens[0];if(n&&"text"===n.type&&n.tokens&&n.tokens.length>0){if(i=[{type:"paragraph",content:t.parseInline(n.tokens)}],e.tokens.length>1){let t=r(e.tokens.slice(1));i.push(...t)}}else i=r(e.tokens)}return 0===i.length&&(i=[{type:"paragraph",content:[]}]),{type:"listItem",content:i}},renderMarkdown:(e,t,n)=>(0,r.kj)(e,t,e=>{var t,n;if("bulletList"===e.parentType)return"- ";if("orderedList"===e.parentType){let r=(null==(n=null==(t=e.meta)?void 0:t.parentAttrs)?void 0:n.start)||1;return`${r+e.index}. `}return"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),d={},h={findListItemPos:()=>u,getNextListDepth:()=>p,handleBackspace:()=>y,handleDelete:()=>w,hasListBefore:()=>f,hasListItemAfter:()=>k,hasListItemBefore:()=>m,listItemHasSubList:()=>g,nextListIsDeeper:()=>v,nextListIsHigher:()=>b};for(var c in h)i(d,c,{get:h[c],enumerable:!0});var u=(e,t)=>{let{$from:n}=t.selection,i=(0,r.Pg)(e,t.schema),o=n.depth,s=n.pos,l=null;for(;o>0&&null===l;)n.node(o).type===i?l=o:(o-=1,s-=1);return null===l?null:{$pos:t.doc.resolve(s),depth:l}},p=(e,t)=>{let n=u(e,t);if(!n)return!1;let[,i]=(0,r.fl)(t,e,n.$pos.pos+4);return i},f=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),o=e.doc.resolve(i).node();return!!o&&!!n.includes(o.type.name)},m=(e,t)=>{var n;let{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-2);return 0!==i.index()&&(null==(n=i.nodeBefore)?void 0:n.type.name)===e},g=(e,t,n)=>{if(!n)return!1;let i=(0,r.Pg)(e,t.schema),o=!1;return n.descendants(e=>{e.type===i&&(o=!0)}),o},y=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!(0,r.rU)(e.state,t)&&f(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let o=i.at(-1);if(!o)return!1;let s=e.state.doc.resolve(r.start()+o.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},s.end()).joinForward().run()}if(!(0,r.rU)(e.state,t)||!(0,r.J_)(e.state))return!1;let i=u(t,e.state);if(!i)return!1;let o=e.state.doc.resolve(i.$pos.pos-2).node(i.depth),s=g(t,e.state,o);return m(t,e.state)&&!s?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},v=(e,t)=>{let n=p(e,t),r=u(e,t);return!!r&&!!n&&n>r.depth},b=(e,t)=>{let n=p(e,t),r=u(e,t);return!!r&&!!n&&n<r.depth},w=(e,t)=>{if(!(0,r.rU)(e.state,t)||!(0,r.QN)(e.state,t))return!1;let{selection:n}=e.state,{$from:i,$to:o}=n;return!(!n.empty&&i.sameParent(o))&&(v(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():b(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward())},k=(e,t)=>{var n;let{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-r.parentOffset-2);return i.index()!==i.parent.childCount-1&&(null==(n=i.nodeAfter)?void 0:n.type.name)===e},x=r.YY.create({name:"listKeymap",addOptions:()=>({listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}),addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;
82return this.options.listTypes.forEach(({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&w(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&w(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&y(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&y(e,n,r)&&(t=!0)}),t}}}}),S=/^(\s*)(\d+)\.\s+(.*)$/,M=/^\s/,C="textStyle",O=/^(\d+)\.\s$/,T=r.bP.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.KV)(this.options.HTMLAttributes,n),0]:["ol",(0,r.KV)(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{var n;if("list"!==e.type||!e.ordered)return[];let r=e.start||1,i=e.items?(n=e.items,n.map(e=>{if("list_item"!==e.type)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if("paragraph"===e.type||"list"===e.type||"blockquote"===e.type||"code"===e.type)n.push(...t.parseChildren([e]));else if("text"===e.type&&e.tokens){let r=t.parseChildren([e]);n.push({type:"paragraph",content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:"listItem",content:n}})):[];return 1!==r?{type:"orderedList",attrs:{start:r},content:i}:{type:"orderedList",content:i}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{let t=e.match(/^(\s*)(\d+)\.\s+/),n=null==t?void 0:t.index;return void 0!==n?n:-1},tokenize:(e,t,n)=>{var r;let i=e.split("\n"),[o,s]=function(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],o=i.match(S);if(!o)break;let[,s,l,a]=o,d=s.length,h=a,c=n+1,u=[i];for(;c<e.length;){let t=e[c];if(t.match(S))break;if(""===t.trim())u.push(t),h+="\n",c+=1;else if(t.match(M))u.push(t),h+=`
83${t.slice(d+2)}`,c+=1;else break}t.push({indent:d,number:parseInt(l,10),content:h.trim(),raw:u.join("\n")}),r=c,n=c}return[t,r]}(i);if(0===o.length)return;let l=function e(t,n,r){var i;let o=[],s=0;for(;s<t.length;){let l=t[s];if(l.indent===n){let a=l.content.split("\n"),d=(null==(i=a[0])?void 0:i.trim())||"",h=[];d&&h.push({type:"paragraph",raw:d,tokens:r.inlineTokens(d)});let c=a.slice(1).join("\n").trim();if(c){let e=r.blockTokens(c);h.push(...e)}let u=s+1,p=[];for(;u<t.length&&t[u].indent>n;)p.push(t[u]),u+=1;if(p.length>0){let t=Math.min(...p.map(e=>e.indent)),n=e(p,t,r);h.push({type:"list",ordered:!0,start:p[0].number,items:n,raw:p.map(e=>e.raw).join("\n")})}o.push({type:"list_item",raw:l.raw,tokens:h}),s=u}else s+=1}return o}(o,0,n);if(0!==l.length)return{type:"list",ordered:!0,start:(null==(r=o[0])?void 0:r.number)||1,items:l,raw:i.slice(0,s).join("\n")}}},markdownOptions:{indentsContent:!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(C)).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.tG)({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.tG)({find:O,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(C)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),E=/^\s*(\[([( |x])?\])\s$/,N=r.bP.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute("data-checked");return""===t||"true"===t},renderHTML:e=>({"data-checked":e.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",(0,r.KV)(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;let i=(null==(n=e.attrs)?void 0:n.checked)?"x":" ",o=`- [${i}] `;return(0,r.kj)(e,t,o)},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:i})=>{let o=document.createElement("li"),s=document.createElement("label"),l=document.createElement("span"),a=document.createElement("input"),d=document.createElement("div"),h=e=>{var t,n;a.ariaLabel=(null==(n=null==(t=this.options.a11y)?void 0:t.checkboxLabel)?void 0:n.call(t,e,a.checked))||`Task item checkbox for ${e.textContent||"empty task item"}`};h(e),s.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",e=>e.preventDefault()),a.addEventListener("change",t=>{if(!i.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}let{checked:r}=t.target;i.isEditable&&"function"==typeof n&&i.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if("number"!=typeof t)return!1;let i=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...null==i?void 0:i.attrs,checked:r}),!0}).run(),i.isEditable||!this.options.onReadOnlyChecked||this.options.onReadOnlyChecked(e,r)||(a.checked=!a.checked)}
83),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{o.setAttribute(e,t)}),o.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,s.append(a,l),o.append(s,d),Object.entries(t).forEach(([e,t])=>{o.setAttribute(e,t)});let c=new Set(Object.keys(t));return{dom:o,contentDOM:d,update:e=>{if(e.type!==this.type)return!1;o.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,h(e);let t=i.extensionManager.attributes,n=(0,r.zU)(e,t),s=new Set(Object.keys(n)),l=this.options.HTMLAttributes;return c.forEach(e=>{s.has(e)||(e in l?o.setAttribute(e,l[e]):o.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{null==t?e in l?o.setAttribute(e,l[e]):o.removeAttribute(e):o.setAttribute(e,t)}),c=s,!0}}}},addInputRules(){return[(0,r.tG)({find:E,type:this.type,getAttributes:e=>({checked:"x"===e[e.length-1]})})]}}),A=r.bP.create({name:"taskList",addOptions:()=>({itemTypeName:"taskItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",(0,r.KV)(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;let n=null==(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))?void 0:t.index;return void 0!==n?n:-1},tokenize(e,t,n){let i=e=>{let t=(0,r.Dd)(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),createToken:(e,t)=>({type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:i},n);return t?[{type:"taskList",raw:t.raw,items:t.items}]:n.blockTokens(e)},o=(0,r.Dd)(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),createToken:(e,t)=>({type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:i},n);if(o)return{type:"taskList",raw:o.raw,items:o.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});r.YY.create({name:"listKit",addExtensions(){let e=[];return!1!==this.options.bulletList&&e.push(l.configure(this.options.bulletList)),!1!==this.options.listItem&&e.push(a.configure(this.options.listItem)),!1!==this.options.listKeymap&&e.push(x.configure(this.options.listKeymap)),!1!==this.options.orderedList&&e.push(T.configure(this.options.orderedList)),!1!==this.options.taskItem&&e.push(N.configure(this.options.taskItem)),!1!==this.options.taskList&&e.push(A.configure(this.options.taskList)),e}}),n.d(t,{Rg:()=>l,_J:()=>T,ck:()=>a,it:()=>x})},BT(e,t,n){var r=n("GE").Or;n.d(t,{A:()=>r})},qy6(e,t,n){var r=n("YI9"),i=r.CU.create({name:"subscript",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"sub"},{style:"vertical-align",getAttrs:e=>"sub"===e&&null}],renderHTML({HTMLAttributes:e}){return["sub",(0,r.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setSubscript:()=>({commands:e})=>e.setMark(this.name),toggleSubscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSubscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}});n.d(t,{A:()=>i})},SA1(e,t,n){var r=n("YI9"),i=r.CU.create({name:"superscript",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"sup"},{style:"vertical-align",getAttrs:e=>"super"===e&&null}],renderHTML({HTMLAttributes:e}){return["sup",(0,r.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setSuperscript:()=>({commands:e})=>e.setMark(this.name),toggleSuperscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSuperscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}});n.d(t,{A:()=>i})},ier(e,t,n){var r=n("YI9"),i=(e,t=0)=>{let n=[];return!e.children.length||t>
8320||Array.from(e.children).forEach(e=>{"SPAN"===e.tagName?n.push(e):e.children.length&&n.push(...i(e,t+1))}),n},o=r.CU.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{},mergeNestedSpanStyles:!0}),parseHTML(){return[{tag:"span",consuming:!1,getAttrs:e=>!!e.hasAttribute("style")&&(this.options.mergeNestedSpanStyles&&(e=>{if(!e.children.length)return;let t=i(e);t&&t.forEach(e=>{var t,n;let r=e.getAttribute("style"),i=null==(n=null==(t=e.parentElement)?void 0:t.closest("span"))?void 0:n.getAttribute("style");e.setAttribute("style",`${i};${r}`)})})(e),{})}]},renderHTML({HTMLAttributes:e}){return["span",(0,r.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleTextStyle:e=>({commands:t})=>t.toggleMark(this.name,e),removeEmptyTextStyle:()=>({tr:e})=>{let{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,(t,n)=>{if(t.isTextblock)return!0;t.marks.filter(e=>e.type===this.type).some(e=>Object.values(e.attrs).some(e=>!!e))||e.removeMark(n,n+t.nodeSize,this.type)}),!0}}}}),s=r.YY.create({name:"backgroundColor",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:e=>{var t;let n=e.getAttribute("style");if(n){let e=n.split(";").map(e=>e.trim()).filter(Boolean);for(let t=e.length-1;t>=0;t-=1){let n=e[t].split(":");if(n.length>=2){let e=n[0].trim().toLowerCase(),t=n.slice(1).join(":").trim();if("background-color"===e)return t.replace(/['"]+/g,"")}}}return null==(t=e.style.backgroundColor)?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.backgroundColor?{style:`background-color: ${e.backgroundColor}`}:{}}}}]},addCommands:()=>({setBackgroundColor:e=>({chain:t})=>t().setMark("textStyle",{backgroundColor:e}).run(),unsetBackgroundColor:()=>({chain:e})=>e().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()})}),l=r.YY.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{var t;let n=e.getAttribute("style");if(n){let e=n.split(";").map(e=>e.trim()).filter(Boolean);for(let t=e.length-1;t>=0;t-=1){let n=e[t].split(":");if(n.length>=2){let e=n[0].trim().toLowerCase(),t=n.slice(1).join(":").trim();if("color"===e)return t.replace(/['"]+/g,"")}}}return null==(t=e.style.color)?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands:()=>({setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})}),a=r.YY.create({name:"fontFamily",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:e=>e.style.fontFamily,renderHTML:e=>e.fontFamily?{style:`font-family: ${e.fontFamily}`}:{}}}}]},addCommands:()=>({setFontFamily:e=>({chain:t})=>t().setMark("textStyle",{fontFamily:e}).run(),unsetFontFamily:()=>({chain:e})=>e().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()})}),d=r.YY.create({name:"fontSize",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>e.style.fontSize,renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands:()=>({setFontSize:e=>({chain:t})=>t().setMark("textStyle",{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()})}),h=r.YY.create({name:"lineHeight",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>e.style.lineHeight,renderHTML:e=>e.lineHeight?{style:`line-height: ${e.lineHeight}`}:{}}}}]},addCommands:()=>({setLineHeight:e=>({chain:t})=>t().setMark("textStyle",{lineHeight:e}).run(),unsetLineHeight:()=>({chain:e})=>e().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()})});r.YY.create({name:"textStyleKit",addExtensions(){let e=[];return!1!==this.options.backgroundColor&&e.push(s.configure(this.options.backgroundColor)),!1!==this.options.color&&e.push(l.configure(this.options.color)),!1!==this.options.fontFamily&&e.push(a.configure(this.options.fontFamily)),!1!==this.options.fontSize&&e.push(d.configure(this.options.fontSize)),!1!==this.options.lineHeight&&e.push(h.configure(this.options.lineHeight)),!1!==this.options.textStyle&&e.push(o.configure(this.options.textStyle)),e}}),n.d(t,{Q1:()=>l,xJ:()=>o})},iK(e,t,n){var r=n("YI9"),i=r.CU.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",(0,r.KV)(this.options.HTMLAttributes,e),0]}
83,parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown:(e,t)=>`++${t.renderChildren(e)}++`,markdownTokenizer:{name:"underline",level:"inline",start:e=>e.indexOf("++"),tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:"underline",raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});n.d(t,{A:()=>i,z:()=>i})},GE(e,t,n){n.d(t,{QO:()=>P,vR:()=>z,Or:()=>B,JU:()=>H,lb:()=>F});var r=n("YI9"),i=n("SB"),o=n("LYp");class s{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=null!=(n=t.width)?n:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(null!=this.cursorPos&&t.doc!=e.state.doc)if(this.lastDragEvent){let e=this.computeTarget(this.lastDragEvent);e==this.cursorPos?this.updateOverlay():this.setCursor(e)}else this.updateOverlay()}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t,n=this.editorView.state.doc.resolve(this.cursorPos),r=!n.parent.inlineContent,i,o=this.editorView.dom,s=o.getBoundingClientRect(),l=s.width/o.offsetWidth,a=s.height/o.offsetHeight;if(r){let e=n.nodeBefore,t=n.nodeAfter;if(e||t){let n=this.editorView.nodeDOM(this.cursorPos-(e?e.nodeSize:0));if(n){let r=n.getBoundingClientRect(),o=e?r.bottom:r.top;e&&t&&(o=(o+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*a;i={left:r.left,right:r.right,top:o-s,bottom:o+s}}}}if(!i){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*l;i={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let d=this.editorView.dom.offsetParent;if(!this.element&&(this.element=d.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r),d&&(d!=document.body||"static"!=getComputedStyle(d).position)){let n=d.getBoundingClientRect(),r=n.width/d.offsetWidth,i=n.height/d.offsetHeight;e=n.left-d.scrollLeft*r,t=n.top-d.scrollTop*i}else e=-pageXOffset,t=-pageYOffset;this.element.style.left=(i.left-e)/l+"px",this.element.style.top=(i.top-t)/a+"px",this.element.style.width=(i.right-i.left)/l+"px",this.element.style.height=(i.bottom-i.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,t,e):r;if(!t||i)return null;let s=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=(0,o.Um)(this.editorView.state.doc,s,this.editorView.dragging.slice);null!=e&&(s=e)}return s}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);null!=t&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}var l=n("BzI"),a=n("AT7"),d=n("A5v");class h extends i.LN{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return h.valid(n)?new h(n):i.LN.near(n)}content(){return d.Ji.empty}eq(e){return e instanceof h&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for GapCursor.fromJSON");return new h(e.resolve(t.pos))}getBookmark(){return new c(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0==n){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||u(e.type))return!0;
83if(e.inlineContent)return!1}}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||u(e.type))return!0;if(e.inlineContent)return!1}}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&h.valid(e))return e;let r=e.pos,o=null;for(let n=e.depth;;n--){let i=e.node(n);if(t>0?e.indexAfter(n)<i.childCount:e.index(n)>0){o=i.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(h.valid(s))return s}for(;;){let s=t>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!i.nh.isSelectable(o)){e=e.doc.resolve(r+o.nodeSize*t),n=!1;continue e}break}o=s,r+=t;let l=e.doc.resolve(r);if(h.valid(l))return l}return null}}}h.prototype.visible=!1,h.findFrom=h.findGapCursorFrom,i.LN.jsonID("gapcursor",h);class c{constructor(e){this.pos=e}map(e){return new c(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return h.valid(t)?new h(t):i.LN.near(t)}}function u(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}let p=(0,a.K)({ArrowLeft:f("horiz",-1),ArrowRight:f("horiz",1),ArrowUp:f("vert",-1),ArrowDown:f("vert",1)});function f(e,t){let n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,o){let s=e.selection,l=t>0?s.$to:s.$from,a=s.empty;if(s instanceof i.U3){if(!o.endOfTextblock(n)||0==l.depth)return!1;a=!1,l=e.doc.resolve(t>0?l.after():l.before())}let d=h.findGapCursorFrom(l,t,a);return!!d&&(r&&r(e.tr.setSelection(new h(d))),!0)}}function m(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!h.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&i.nh.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new h(r))),!0)}function g(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof h))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let o=d.FK.empty;for(let e=r.length-1;e>=0;e--)o=d.FK.from(r[e].createAndFill(null,o));let s=e.state.tr.replace(n.pos,n.pos,new d.Ji(o,0,0));return s.setSelection(i.U3.near(s.doc.resolve(n.pos+1))),e.dispatch(s),!1}function y(e){if(!(e.selection instanceof h))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",l.zF.create(e.doc,[l.NZ.widget(e.selection.head,t,{key:"gapcursor"})])}var v=function(){};v.prototype.append=function(e){return e.length?(e=v.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},v.prototype.prepend=function(e){return e.length?v.from(e).append(this):this},v.prototype.appendInner=function(e){return new w(this,e)},v.prototype.slice=function(e,t){return(void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t)?v.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},v.prototype.get=function(e){if(!(e<0)&&!(e>=this.length))return this.getInner(e)},v.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)},v.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},v.from=function(e){return e instanceof v?e:e&&e.length?new b(e):v.empty};var b=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=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}(v);v.empty=new b([]);var w=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r)||n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))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<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))return!1},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(v);class k{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){let n,r,i,o;if(0==this.eventCount)return null;let s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}t&&(r=(n=this.remapping(s,this.items.length)).maps.length);let l=e.tr,a=[],d=[];
83return this.items.forEach((e,t)=>{if(!e.step){n||(r=(n=this.remapping(s,t+1)).maps.length),r--,d.push(e);return}if(n){d.push(new x(e.map));let t=e.step.map(n.slice(r)),i;t&&l.maybeStep(t).doc&&(i=l.mapping.maps[l.mapping.maps.length-1],a.push(new x(i,void 0,void 0,a.length+d.length))),r--,i&&n.appendMap(i,r)}else l.maybeStep(e.step);if(e.selection)return i=n?e.selection.map(n.slice(r)):e.selection,o=new k(this.items.slice(0,s).append(d.reverse().concat(a)),this.eventCount-1),!1},this.items.length,0),{remaining:o,transform:l,selection:i}}addTransform(e,t,n,r){var i,o;let s,l=[],a=this.eventCount,d=this.items,h=!r&&d.length?d.get(d.length-1):null;for(let n=0;n<e.steps.length;n++){let i=e.steps[n].invert(e.docs[n]),o=new x(e.mapping.maps[n],i,t),s;(s=h&&h.merge(o))&&(o=s,n?l.pop():d=d.slice(0,d.length-1)),l.push(o),t&&(a++,t=void 0),r||(h=o)}let c=a-n.depth;return c>M&&(i=d,o=c,i.forEach((e,t)=>{if(e.selection&&0==o--)return s=t,!1}),d=i.slice(s),a-=c),new k(d.append(l),a)}remapping(e,t){let n=new o.X9;return this.items.forEach((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(e){return 0==this.eventCount?this:new k(this.items.append(e.map(e=>new x(e))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},r);let l=t;this.items.forEach(t=>{let r=i.getMirror(--l);if(null==r)return;o=Math.min(o,r);let a=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),d=t.selection&&t.selection.map(i.slice(l+1,r));d&&s++,n.push(new x(a,o,d))}else n.push(new x(a))},r);let a=[];for(let e=t;e<o;e++)a.push(new x(i.maps[e]));let d=new k(this.items.slice(0,r).append(a).append(n),s);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{!t.step&&e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach((o,s)=>{if(s>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let l=o.selection&&o.selection.map(t.slice(n));l&&i++;let a=new x(s.invert(),e,l),d,h=r.length-1;(d=r.length&&r[h].merge(a))?r[h]=d:r.push(a)}}else o.map&&n--},this.items.length,0),new k(v.from(r.reverse()),i)}}k.empty=new k(v.empty,0);class x{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 x(t.getMap().invert(),t,this.selection)}}}class S{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}let M=20;function C(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 O(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}let T=!1,E=null;function N(e){let t=e.plugins;if(E!=t){T=!1,E=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){T=!0;break}}return T}let A=new i.hs("history"),D=new i.hs("closeHistory");function R(e,t){return(n,r)=>{let i=A.getState(n);if(!i||0==(e?i.undone:i.done).eventCount)return!1;if(r){let o=function(e,t,n){let r=N(t),i=A.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),l=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),a=new S(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(s).setMeta(A,{redo:n,historyState:a})}(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}let I=R(!1,!0),L=R(!0,!0);r.YY.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.k_({key:new i.hs("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;
83if(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)}})]}});var P=r.YY.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[function(e={}){return new i.k_({view:t=>new s(t,e)})}(this.options)]}});r.YY.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new i.k_({key:new i.hs("focus"),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,o=[];if(!n||!r)return l.zF.create(e,[]);let s=0;"deepest"===this.options.mode&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;s+=1}});let a=0;return e.descendants((e,t)=>!e.isText&&!!(i>=t&&i<=t+e.nodeSize-1)&&((a+=1,"deepest"===this.options.mode&&s-a>0||"shallowest"===this.options.mode&&a>1)?"deepest"===this.options.mode:void o.push(l.NZ.node(t,t+e.nodeSize,{class:this.options.className})))),l.zF.create(e,o)}}})]}});var z=r.YY.create({name:"gapCursor",addProseMirrorPlugins:()=>[new i.k_({props:{decorations:y,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&h.valid(n)?new h(n):null,handleClick:m,handleKeyDown:p,handleDOMEvents:{beforeinput
83:g}}})],extendNodeSchema(e){var t;let n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:null!=(t=(0,r.gk)((0,r.iI)(e,"allowGapCursor",n)))?t:null}}}),$="placeholder",B=r.YY.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:$,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){let e=this.options.dataAttribute?`data-${this.options.dataAttribute.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}`:`data-${$}`;return[new i.k_({key:new i.hs("placeholder"),props:{decorations:({doc:t,selection:n})=>{let i=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:o}=n,s=[];if(!i)return null;let a=this.editor.isEmpty;return t.descendants((t,n)=>{let i=o>=n&&o<=n+t.nodeSize,d=!t.isLeaf&&(0,r.Op)(t);if(!t.type.isTextblock)return this.options.includeChildren;if((i||!this.options.showOnlyCurrent)&&d){let r=[this.options.emptyNodeClass];a&&r.push(this.options.emptyEditorClass);let o=l.NZ.node(n,n+t.nodeSize,{class:r.join(" "),[e]:"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:i}):this.options.placeholder});s.push(o)}return this.options.includeChildren}),l.zF.create(t,s)}}})]}});function j({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(null==t?void 0:t.type)===e}r.YY.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new i.k_({key:new i.hs("selection"),props:{decorations:n=>n.selection.empty||e.isFocused||!e.isEditable||(0,r.BQ)(n.selection)||e.view.dragging?null:l.zF.create(n.doc,[l.NZ.inline(n.selection.from,n.selection.to,{class:t.className})])}})]}});var H=r.YY.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var e;let t=new i.hs(this.name),n=this.options.node||(null==(e=this.editor.schema.topNodeType.contentMatch.defaultType)?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(n).includes(e.name));return[new i.k_({key:t,appendTransaction:(e,r,i)=>{let{doc:o,tr:s,schema:l}=i,a=t.getState(i),d=o.content.size,h=l.nodes[n];if(!e.some(e=>e.getMeta("skipTrailingNode"))&&a)return s.insert(d,h.create())},state:{init:(e,t)=>!j({node:t.tr.doc.lastChild,types:r}),apply:(e,t)=>!e.docChanged||e.getMeta("__uniqueIDTransaction")?t:!j({node:e.doc.lastChild,types:r})}})]}}),F=r.YY.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>I(e,t),redo:()=>({state:e,dispatch:t})=>L(e,t)}),addProseMirrorPlugins(){return[function(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new i.k_({key:A,state:{init:()=>new S(k.empty,k.empty,null,0,-1),apply:(t,n,r)=>(function(e,t,n,r){let i=n.getMeta(A),o;if(i)return i.historyState;n.getMeta(D)&&(e=new S(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(A))if(s.getMeta(A).redo)return new S(e.done.addTransform(n,void 0,r,N(t)),e.undone,C(n.mapping.maps),e.prevTime,e.prevComposition);else return new S(e.done,e.undone.addTransform(n,void 0,r,N(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))if(o=n.getMeta("rebased"))return new S(e.done.rebased(n,o),e.undone.rebased(n,o),O(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new S(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),O(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let i=n.getMeta("composition"),o=0==e.prevTime||!s&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}(n,e.prevRanges)),l=s?O(e.prevRanges,n.mapping):C(n.mapping.maps);return new S(e.done.addTransform(n,o?t.selection.getBookmark():void 0,r,N(t)),k.empty,l,n.time,null==i?e.prevComposition:i)}})(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?I:"historyRedo"==n?L:null;return!!r&&!!e.editable&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}(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()}}})}
83,PsZ(e,t,n){n.d(t,{$Z:()=>F,aA:()=>Y,hG:()=>J});var r=n("dx"),i=n("fD"),o=n("cfZ"),s=n("PT"),l=n("YI9");let{getOwnPropertyNames:a,getOwnPropertySymbols:d}=Object,{hasOwnProperty:h}=Object.prototype;function c(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function u(e){return function(t,n,r){if(!t||!n||"object"!=typeof t||"object"!=typeof n)return e(t,n,r);let{cache:i}=r,o=i.get(t),s=i.get(n);if(o&&s)return o===n&&s===t;i.set(t,n),i.set(n,t);let l=e(t,n,r);return i.delete(t),i.delete(n),l}}function p(e){return a(e).concat(d(e))}let f=Object.hasOwn||((e,t)=>h.call(e,t));function m(e,t){return e===t||!e&&!t&&e!=e&&t!=t}let{getOwnPropertyDescriptor:g,keys:y}=Object;function v(e,t){return e.byteLength===t.byteLength&&A(new Uint8Array(e),new Uint8Array(t))}function b(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function w(e,t){return e.byteLength===t.byteLength&&A(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function k(e,t){return m(e.getTime(),t.getTime())}function x(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function S(e,t){return e===t}function M(e,t,n){let r,i,o=e.size;if(o!==t.size)return!1;if(!o)return!0;let s=Array(o),l=e.entries(),a=0;for(;(r=l.next())&&!r.done;){let o=t.entries(),l=!1,d=0;for(;(i=o.next())&&!i.done;){if(s[d]){d++;continue}let o=r.value,h=i.value;if(n.equals(o[0],h[0],a,d,e,t,n)&&n.equals(o[1],h[1],o[0],h[0],e,t,n)){l=s[d]=!0;break}d++}if(!l)return!1;a++}return!0}function C(e,t,n){let r=y(e),i=r.length;if(y(t).length!==i)return!1;for(;i-- >0;)if(!R(e,t,n,r[i]))return!1;return!0}function O(e,t,n){let r,i,o,s=p(e),l=s.length;if(p(t).length!==l)return!1;for(;l-- >0;)if(!R(e,t,n,r=s[l])||(i=g(e,r),o=g(t,r),(i||o)&&(!i||!o||i.configurable!==o.configurable||i.enumerable!==o.enumerable||i.writable!==o.writable)))return!1;return!0}function T(e,t){return m(e.valueOf(),t.valueOf())}function E(e,t){return e.source===t.source&&e.flags===t.flags}function N(e,t,n){let r,i,o=e.size;if(o!==t.size)return!1;if(!o)return!0;let s=Array(o),l=e.values();for(;(r=l.next())&&!r.done;){let o=t.values(),l=!1,a=0;for(;(i=o.next())&&!i.done;){if(!s[a]&&n.equals(r.value,i.value,r.value,i.value,e,t,n)){l=s[a]=!0;break}a++}if(!l)return!1}return!0}function A(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function D(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function R(e,t,n,r){return("_owner"===r||"__o"===r||"__v"===r)&&(!!e.$$typeof||!!t.$$typeof)||f(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}let I={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},L=Object.prototype.toString,P=z();function z(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,o=function({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:s,areNumbersEqual:l,areObjectsEqual:a,arePrimitiveWrappersEqual:d,areRegExpsEqual:h,areSetsEqual:c,areTypedArraysEqual:u,areUrlsEqual:p,unknownTagComparators:f}){return function(m,g,y){if(m===g)return!0;if(null==m||null==g)return!1;let v=typeof m;if(v!==typeof g)return!1;if("object"!==v)return"number"===v?l(m,g,y):"function"===v&&o(m,g,y);let b=m.constructor;if(b!==g.constructor)return!1;if(b===Object)return a(m,g,y);if(Array.isArray(m))return t(m,g,y);if(b===Date)return r(m,g,y);if(b===RegExp)return h(m,g,y);if(b===Map)return s(m,g,y);if(b===Set)return c(m,g,y);let w=L.call(m);if("[object Date]"===w)return r(m,g,y);if("[object RegExp]"===w)return h(m,g,y);if("[object Map]"===w)return s(m,g,y);if("[object Set]"===w)return c(m,g,y);if("[object Object]"===w)return"function"!=typeof m.then&&"function"!=typeof g.then&&a(m,g,y);if("[object URL]"===w)return p(m,g,y);if("[object Error]"===w)return i(m,g,y);if("[object Arguments]"===w)return a(m,g,y);if(I[w])return u(m,g,y);if("[object ArrayBuffer]"===w)return e(m,g,y);if("[object DataView]"===w)return n(m,g,y);if("[object Boolean]"===w||"[object Number]"===w||"[object String]"===w)return d(m,g,y);if(f){let e=f[w];if(!e){let t=null!=m?m[Symbol.toStringTag]:void 0;t&&(e=f[t])}if(e)return e(m,g,y)}return!1}}(function({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:v,areArraysEqual:n?O:b,areDataViewsEqual:w,areDatesEqual:k,areErrorsEqual:x,areFunctionsEqual:S,areMapsEqual:n?c(M,O):M,areNumbersEqual:m,areObjectsEqual:n?O:C,arePrimitiveWrappersEqual:T,areRegExpsEqual:E,areSetsEqual:n?c(N,O):N,areTypedArraysEqual:n?c(A,O):A,areUrlsEqual:D,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=u(r.areArraysEqual),t=u(r.areMapsEqual),n=u(r.areObjectsEqual),i=u(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}(e)),s=n?n(o):function(e,t,n,r,i,s,l){return o(e,t,l)};return function({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(o,s){let{cache:l=e?new WeakMap:void 0,meta:a}=n();return t(o,s,{cache:l,equals:r,meta:a,strict:i})};
83if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let o={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,o)}}({circular:t,comparator:o,createState:r,equals:s,strict:i})}z({strict:!0}),z({circular:!0}),z({circular:!0,strict:!0}),z({createInternalComparator:()=>m}),z({strict:!0,createInternalComparator:()=>m}),z({circular:!0,createInternalComparator:()=>m}),z({circular:!0,createInternalComparator:()=>m,strict:!0});var $=n("njQ5"),B=({contentComponent:e})=>{let t=(0,o.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,s.jsx)(s.Fragment,{children:Object.values(t)})},j=class extends r.Component{constructor(e){var t;super(e),this.editorContentRef=r.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(null==(t=e.editor)?void 0:t.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;let t=this.props.editor;if(t&&!t.isDestroyed&&(null==(e=t.view.dom)?void 0:e.parentNode)){let e,n;if(t.contentComponent)return;let r=this.editorContentRef.current;r.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:r}),e=new Set,n={},t.contentComponent={subscribe:t=>(e.add(t),()=>{e.delete(t)}),getSnapshot:()=>n,getServerSnapshot:()=>n,setRenderer(t,r){n={...n,[t]:i.createPortal(r.reactElement,r.element,t)},e.forEach(e=>e())},removeRenderer(t){let r={...n};delete r[t],n=r,e.forEach(e=>e())}},this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(e=>e.hasContentComponentInitialized?e:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var e;let t=this.props.editor;if(t){this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null;try{if(!(null==(e=t.view.dom)?void 0:e.parentNode))return;let n=document.createElement("div");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{ref:((...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})})(t,this.editorContentRef),...n}),(null==e?void 0:e.contentComponent)&&(0,s.jsx)(B,{contentComponent:e.contentComponent})]})}},H=(0,r.forwardRef)((e,t)=>{let n=r.useMemo(()=>Math.floor(0xffffffff*Math.random()).toString(),[e.editor]);return r.createElement(j,{key:n,innerRef:t,...e})}),F=r.memo(H),V="u">typeof window?r.useLayoutEffect:r.useEffect,U=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}},K="u"<typeof window,W=K||!!("u">typeof window&&window.next),q=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e
83=>e())}getInitialEditor(){if(void 0===this.options.current.immediatelyRender)return K||W?null:this.createEditor();return this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null}createEditor(){let e={...this.options.current,onBeforeCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBeforeCreate)?void 0:n.call(t,...e)},onBlur:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBlur)?void 0:n.call(t,...e)},onCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onCreate)?void 0:n.call(t,...e)},onDestroy:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDestroy)?void 0:n.call(t,...e)},onFocus:(...e)=>{var t,n;return null==(n=(t=this.options.current).onFocus)?void 0:n.call(t,...e)},onSelectionUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onSelectionUpdate)?void 0:n.call(t,...e)},onTransaction:(...e)=>{var t,n;return null==(n=(t=this.options.current).onTransaction)?void 0:n.call(t,...e)},onUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onUpdate)?void 0:n.call(t,...e)},onContentError:(...e)=>{var t,n;return null==(n=(t=this.options.current).onContentError)?void 0:n.call(t,...e)},onDrop:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDrop)?void 0:n.call(t,...e)},onPaste:(...e)=>{var t,n;return null==(n=(t=this.options.current).onPaste)?void 0:n.call(t,...e)},onDelete:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDelete)?void 0:n.call(t,...e)}};return new l.KE(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every((e,n)=>{var r;return e===(null==(r=t.extensions)?void 0:r[n])}):e[n]===t[n]))}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===t.length?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function J(e={},t=[]){let n=(0,r.useRef)(e);n.current=e;let[i]=(0,r.useState)(()=>new q(n)),s=(0,o.useSyncExternalStore)(i.subscribe,i.getEditor,i.getServerSnapshot);return(0,r.useDebugValue)(s),(0,r.useEffect)(i.onRender(t)),!function(e){var t;let[n]=(0,r.useState)(()=>new U(e.editor)),i=(0,$.useSyncExternalStoreWithSelector)(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,null!=(t=e.equalityFn)?t:P);V(()=>n.watch(e.editor),[e.editor,n]),(0,r.useDebugValue)(i)}({editor:s,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction||void 0===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),s}var _=(0,r.createContext)({editor:null});_.Consumer;var Y=()=>(0,r.useContext)(_),G=(0,r.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}});r.forwardRef((e,t)=>{let{onDragStart:n}=(0,r.useContext)(G),i=e.as||"div";return(0,s.jsx)(i,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})}),r.createContext({markViewContentRef:()=>{}}),l.Db,l.Yv;var X=(0,r.createContext)({get editor(){throw Error("useTiptap must be used within a <Tiptap> provider")}});function Z({editor:e,instance:t,children:n}){let i=null!=e?e:t;if(!i)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let o=(0,r.useMemo)(()=>({editor:i}),[i]),l=(0,r.useMemo)(()=>({editor:i}),[i]);return(0,s.jsx)(_.Provider,{value:l,children:(0,s.jsx)(X.Provider,{value:o,children:n})})}function Q({...e}){let{editor:t}=(0,r.useContext)(X);return(0,s.jsx)(F,{editor:t,...e})}X.displayName="TiptapContext",Z.displayName="Tiptap",Q.displayName="Tiptap.Content",Object.assign(Z,{Content:Q})},ZV(e,t,n){let r,i;n.d(t,{m:()=>J});var o=n("YI9"),s=n("At"),l=n("rhq"),a=n("SB"),d=n("A5v"),h=n("AT7");if("u">typeof WeakMap){let e=new WeakMap;r=t=>e.get(t),i=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;r=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},i=(n,r)=>(10==t&&(t=0),e[t++]=n,e[t++]=r)}var c=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,o=r+1,s=i+1;for(let e=1;o<this.width&&this.map[t+e]==n;e++)o++;for(let e=1;s<this.height&&this.map[t+this.width*e]==n;e++)s++;return{left:r,top:i,right:o,bottom:s}}throw RangeError(`No cell with offset ${e}
83 found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:o,bottom:s}=this.findCell(e);return"horiz"==t?(n<0?0==r:i==this.width)?null:this.map[o*this.width+(n<0?r-1:i)]:(n<0?0==o:s==this.height)?null:this.map[r+this.width*(n<0?o-1:s)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:o}=this.findCell(e),{left:s,right:l,top:a,bottom:d}=this.findCell(t);return{left:Math.min(n,s),top:Math.min(i,a),right:Math.max(r,l),bottom:Math.max(o,d)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let o=r*this.width+i,s=this.map[o];!n[s]&&(n[s]=!0,i==e.left&&i&&this.map[o-1]==s||r==e.top&&r&&this.map[o-this.width]==s||t.push(s))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let o=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?o-1:this.map[n]}i=o}}static get(e){return r(e)||i(e,function(e){if("table"!=e.type.spec.tableRole)throw RangeError("Not a table node: "+e.type.name);let t=function(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),o=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(o+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);o+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}-1==t?t=o:t!=o&&(t=Math.max(t,o))}return t}(e),n=e.childCount,r=[],i=0,o=null,s=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let l=0,a=0;l<n;l++){let d=e.child(l);a++;for(let e=0;;e++){for(;i<r.length&&0!=r[i];)i++;if(e==d.childCount)break;let h=d.child(e),{colspan:c,rowspan:u,colwidth:p}=h.attrs;for(let e=0;e<u;e++){if(e+l>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:a,n:u-e});break}let d=i+e*t;for(let e=0;e<c;e++){0==r[d+e]?r[d+e]=a:(o||(o=[])).push({type:"collision",row:l,pos:a,n:c-e});let n=p&&p[e];if(n){let r=(d+e)%t*2,i=s[r];null==i||i!=n&&1==s[r+1]?(s[r]=n,s[r+1]=1):i==n&&s[r+1]++}}}i+=c,a+=h.nodeSize}let h=(l+1)*t,c=0;for(;i<h;)0==r[i++]&&c++;c&&(o||(o=[])).push({type:"missing",row:l,n:c}),a++}(0===t||0===n)&&(o||(o=[])).push({type:"zero_sized"});let l=new c(t,n,r,o),a=!1;for(let e=0;!a&&e<s.length;e+=2)null!=s[e]&&s[e+1]<n&&(a=!0);return a&&function(e,t,n){e.problems||(e.problems=[]);let r={};for(let i=0;i<e.map.length;i++){let o=e.map[i];if(r[o])continue;r[o]=!0;let s=n.nodeAt(o);if(!s)throw RangeError(`No cell with offset ${o} found`);let l=null,a=s.attrs;for(let n=0;n<a.colspan;n++){let r=t[(i+n)%e.width*2];null==r||a.colwidth&&a.colwidth[n]==r||((l||(l=function(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}(a)))[n]=r)}l&&e.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:l})}}(l,s,e),l}(e))}};function u(e){let t=e.cached.tableNodeTypes;if(!t)for(let n in t=e.cached.tableNodeTypes={},e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}return t}function p(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return!0;return!1}function f(e){return"row"==e.parent.type.spec.tableRole&&!!e.nodeAfter}function m(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function g(e,t,n){let r=e.node(-1),i=c.get(r),o=e.start(-1),s=i.nextCell(e.pos-o,t,n);return null==s?null:e.node(0).resolve(o+s)}function y(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}new a.hs("selectingCells");var v=class e extends a.LN{constructor(e,t=e){let n=e.node(-1),r=c.get(n),i=e.start(-1),o=r.rectBetween(e.pos-i,t.pos-i),s=e.node(0),l=r.cellsInRect(o).filter(e=>e!=t.pos-i);l.unshift(t.pos-i);let d=l.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new a.yn(s.resolve(r),s.resolve(r+t.content.size))});super(d[0].$from,d[0].$to,d),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(f(r)&&f(i)&&m(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return a.U3.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=c.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},o=[];for(let n=r.top;n<r.bottom;n++){let s=[];for(let o=n*t.width+r.left,l=r.left;l<r.right;l++,o++){let n=t.map[o];if(i[n])continue;i[n]=!0;let l=t.findCell(n),a=e.nodeAt(n);if(!a)throw RangeError(`No cell with offset ${n} found`);let d=r.left-l.left,h=l.right-r.right;if(d>0||h>0){let e=a.attrs;if(d>0&&(e=y(e,0,d)),h>0&&(e=y(e,e.colspan-h,h)),l.left<r.left){if(!(a=a.type.createAndFill(e)))throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else a=a.type.create(e,a.content)}if(l.top<r.top||l.bottom>r.bottom){let e={...a.attrs,rowspan:Math.min(l.bottom,r.bottom)-Math.max(l.top,r.top)};a=l.top<r.top?a.type.createAndFill(e):a.type.create(e,a.content)}s.push(a)}o.push(e.child(n).copy(d.FK.from(s)))}let s=this.isColSelection()&&this.isRowSelection()?e:o;return new d.Ji(d.FK.from(s),1,1)}replace(e,t=d.Ji.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],l=e.mapping.slice(n);e.replace(l.map(o.pos),l.map(s.pos),i?d.Ji.empty:t)}let i=a.LN.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new d.Ji(d.FK.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=c.get(t),r=this.$anchorCell.start(-1),i=n.cells
83InRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);return!(Math.min(e,t)>0)&&Math.max(e+this.$anchorCell.nodeAfter.attrs.rowspan,t+this.$headCell.nodeAfter.attrs.rowspan)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=c.get(r),o=t.start(-1),s=i.findCell(t.pos-o),l=i.findCell(n.pos-o),a=t.node(0);return s.top<=l.top?(s.top>0&&(t=a.resolve(o+i.map[s.left])),l.bottom<i.height&&(n=a.resolve(o+i.map[i.width*(i.height-1)+l.right-1]))):(l.top>0&&(n=a.resolve(o+i.map[l.left])),s.bottom<i.height&&(t=a.resolve(o+i.map[i.width*(i.height-1)+s.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=c.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);return!(Math.min(r,i)>0)&&Math.max(r+this.$anchorCell.nodeAfter.attrs.colspan,i+this.$headCell.nodeAfter.attrs.colspan)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=c.get(r),o=t.start(-1),s=i.findCell(t.pos-o),l=i.findCell(n.pos-o),a=t.node(0);return s.left<=l.left?(s.left>0&&(t=a.resolve(o+i.map[s.top*i.width])),l.right<i.width&&(n=a.resolve(o+i.map[i.width*(l.top+1)-1]))):(l.left>0&&(n=a.resolve(o+i.map[l.top*i.width])),s.right<i.width&&(t=a.resolve(o+i.map[i.width*(s.top+1)-1]))),new e(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new b(this.$anchorCell.pos,this.$headCell.pos)}};v.prototype.visible=!1,a.LN.jsonID("cell",v);var b=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&m(t,n)?new v(t,n):a.LN.near(n,1)}};function w(e){let t=e.selection,n=function(e){let t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&"cell"==t.node.type.spec.tableRole)return t.$anchor;let n=function(e){for(let t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}(t.$head)||function(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n-t.nodeSize)}}(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}(e),r=n.node(-1),i=n.start(-1),o=c.get(r);return{...t instanceof v?o.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):o.findCell(n.pos-i),tableStart:i,map:o,table:r}}function k(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function x(e,t){if((t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic)return function(t,n){if(!p(t))return!1;if(n){let r=u(t.schema),i=w(t),o=t.tr,s=i.map.cellsInRect("column"==e?{left:i.left,top:0,right:i.right,bottom:i.map.height}:"row"==e?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),l=s.map(e=>i.table.nodeAt(e));for(let e=0;e<s.length;e++)l[e].type==r.header_cell&&o.setNodeMarkup(i.tableStart+s[e],r.cell,l[e].attrs);if(0===o.steps.length)for(let e=0;e<s.length;e++)o.setNodeMarkup(i.tableStart+s[e],r.header_cell,l[e].attrs);n(o)}return!0};return function(t,n){if(!p(t))return!1;if(n){let r=u(t.schema),i=w(t),o=t.tr,s=k("row",i,r),l=k("column",i,r),a=+("column"===e?!!s:"row"===e&&!!l),d="column"==e?{left:0,top:a,right:1,bottom:i.map.height}:"row"==e?{left:a,top:0,right:i.map.width,bottom:1}:i,h="column"==e?l?r.cell:r.header_cell:"row"==e?s?r.cell:r.header_cell:r.cell;
83i.map.cellsInRect(d).forEach(e=>{let t=e+i.tableStart,n=o.doc.nodeAt(t);n&&o.setNodeMarkup(t,h,n.attrs)}),n(o)}return!0}}function S(e,t){let n=e.selection;if(!(n instanceof v))return!1;if(t){let r=e.tr,i=u(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new d.Ji(i,0,0))}),r.docChanged&&t(r)}return!0}new a.hs("fix-tables"),x("row",{useDeprecatedLogic:!0}),x("column",{useDeprecatedLogic:!0}),x("cell",{useDeprecatedLogic:!0});function M(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function C(e,t){return(n,r,i)=>{if(!i)return!1;let o=n.selection;if(o instanceof v)return M(n,r,a.LN.near(o.$headCell,t));if("horiz"!=e&&!o.empty)return!1;let s=T(i,e,t);if(null==s)return!1;if("horiz"==e)return M(n,r,a.LN.near(n.doc.resolve(o.head+t),t));{let i,o=n.doc.resolve(s),l=g(o,e,t);return i=l?a.LN.near(l,1):t<0?a.LN.near(n.doc.resolve(o.before(-1)),-1):a.LN.near(n.doc.resolve(o.after(-1)),1),M(n,r,i)}}}function O(e,t){return(n,r,i)=>{let o;if(!i)return!1;let s=n.selection;if(s instanceof v)o=s;else{let r=T(i,e,t);if(null==r)return!1;o=new v(n.doc.resolve(r))}let l=g(o.$headCell,e,t);return!!l&&M(n,r,new v(o.$anchorCell,l))}}function T(e,t,n){if(!(e.state.selection instanceof a.U3))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))break;if("cell"==o.type.spec.tableRole||"header_cell"==o.type.spec.tableRole){let o=r.before(i),s="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(s)?o:null}}return null}(0,h.K)({ArrowLeft:C("horiz",-1),ArrowRight:C("horiz",1),ArrowUp:C("vert",-1),ArrowDown:C("vert",1),"Shift-ArrowLeft":O("horiz",-1),"Shift-ArrowRight":O("horiz",1),"Shift-ArrowUp":O("vert",-1),"Shift-ArrowDown":O("vert",1),Backspace:S,"Mod-Backspace":S,Delete:S,"Mod-Delete":S}),new a.hs("tableColumnResizing");var E=class{constructor({editor:e,element:t,view:n,pluginKey:r="bubbleMenu",updateDelay:i=250,resizeDelay:s=60,shouldShow:l,appendTo:a,getReferencedVirtualElement:d,options:h}){var c;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:e,state:t,from:n,to:r})=>{let{doc:i,selection:s}=t,{empty:l}=s,a=!i.textBetween(n,r).length&&(0,o.eE)(t.selection),d=this.element.contains(document.activeElement);return!!(e.hasFocus()||d)&&!l&&!a&&!!this.editor.isEditable},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{var t;if(this.editor.isDestroyed)return void this.destroy();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.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,r)=>{let{composing:i}=e;!i&&(t||n)&&(this.getShouldShow(r)?(this.updatePosition(),this.show()):this.hide())},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);"updatePosition"===t?this.updatePosition():t&&"object"==typeof t&&"updateOptions"===t.type&&this.updateOptions(t.options)},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=s,this.appendTo=a,this.scrollTarget=null!=(c=null==h?void 0:h.scrollTarget)?c:window,this.getReferencedVirtualElement=d,this.floatingUIOptions={...this.floatingUIOptions,...h},this.element.tabIndex=0,l&&(this.shouldShow=l),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.get
83ShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push((0,s.UU)("boolean"!=typeof this.floatingUIOptions.flip?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push((0,s.BN)("boolean"!=typeof this.floatingUIOptions.shift?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push((0,s.cY)("boolean"!=typeof this.floatingUIOptions.offset?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push((0,s.UE)(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push((0,s.Ej)("boolean"!=typeof this.floatingUIOptions.size?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push((0,s.RK)("boolean"!=typeof this.floatingUIOptions.autoPlacement?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push((0,s.jD)("boolean"!=typeof this.floatingUIOptions.hide?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push((0,s.mG)("boolean"!=typeof this.floatingUIOptions.inline?this.floatingUIOptions.inline:void 0)),e}get virtualElement(){var e,t,n,r,i;let{selection:s}=this.editor.state,l=null==(e=this.getReferencedVirtualElement)?void 0:e.call(this);if(l)return l;if(!(null==(n=null==(t=this.view)?void 0:t.dom)?void 0:n.parentNode))return;let d=(0,o.MG)(this.view,s.from,s.to),h={getBoundingClientRect:()=>d,getClientRects:()=>[d]};if(s instanceof a.nh){let e=this.view.nodeDOM(s.from),t=e.dataset.nodeViewWrapper?e:e.querySelector("[data-node-view-wrapper]");t&&(e=t),e&&(h={getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>[e.getBoundingClientRect()]})}if(s instanceof v){let e,t,n,{$anchorCell:o,$headCell:l}=s,a=o?o.pos:l.pos,d=l?l.pos:o.pos,c=this.view.nodeDOM(a),u=this.view.nodeDOM(d);if(!c||!u)return;let p=c===u?c.getBoundingClientRect():(r=c.getBoundingClientRect(),i=u.getBoundingClientRect(),e=Math.min(r.top,i.top),t=Math.max(r.bottom,i.bottom),n=Math.min(r.left,i.left),new DOMRect(n,e,Math.max(r.right,i.right)-n,t-e));h={getBoundingClientRect:()=>p,getClientRects:()=>[p]}}return h}updatePosition(){let e=this.virtualElement;e&&(0,l.rD)(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{var i,o;if((null==(i=r.hide)?void 0:i.referenceHidden)||(null==(o=r.hide)?void 0:o.escaped)){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}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)}getShouldShow(e){var t;let{state:n}=this.view,{selection:r}=n,{ranges:i}=r,o=Math.min(...i.map(e=>e.$from.pos)),s=Math.max(...i.map(e=>e.$to.pos));return(null==(t=this.shouldShow)?void 0:t.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:e,from:o,to:s}))||!1}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";let t="function"==typeof this.appendTo?this.appendTo():this.appendTo;null==(e=null!=t?t:this.view.dom.parentElement)||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(e){var t;if(void 0!==e.updateDelay&&(this.updateDelay=e.updateDelay),void 0!==e.resizeDelay&&(this.resizeDelay=e.resizeDelay),void 0!==e.appendTo&&(this.appendTo=e.appendTo),void 0!==e.getReferencedVirtualElement&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),void 0!==e.shouldShow&&e.shouldShow&&(this.shouldShow=e.shouldShow),void 0!==e.options){let n=null!=(t=e.options.scrollTarget)?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},N=e=>new a.k_({key:"string"==typeof e.pluginKey?new a.hs(e.pluginKey):e.pluginKey,view:t=>new E({view:t,...e})});o.YY.create({name:"bubbleMenu",addOptions:()=>({element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[N({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var A=n("PsZ"),D=n("dx"),R=n("fD"),I=class{constructor({editor:e,element:t,view:n,pluginKey:r="floatingMenu",updateDelay:i=250,resizeDelay:o=60,options:s,appendTo:l,shouldShow:a}){var d;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,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.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;!i&&(t||n)&&(this.getShouldShow(r)?(this.updatePosition(),this.show()):this.hide())},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({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.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);"updatePosition"===t?this.updatePosition():t&&"object"==typeof t&&"updateOptions"===t.type&&this.updateOptions(t.options)},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=o,this.appendTo=l,this.scrollTarget=null!=(d=null==s?void 0:s.scrollTarget)?d:window,this.floatingUIOptions={...this.floatingUIOptions,...s},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.get
83ShouldShow()&&(this.show(),this.updatePosition())}getTextContent(e){return(0,o.q4)(e,{textSerializers:(0,o.iR)(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push((0,s.UU)("boolean"!=typeof this.floatingUIOptions.flip?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push((0,s.BN)("boolean"!=typeof this.floatingUIOptions.shift?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push((0,s.cY)("boolean"!=typeof this.floatingUIOptions.offset?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push((0,s.UE)(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push((0,s.Ej)("boolean"!=typeof this.floatingUIOptions.size?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push((0,s.RK)("boolean"!=typeof this.floatingUIOptions.autoPlacement?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push((0,s.jD)("boolean"!=typeof this.floatingUIOptions.hide?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push((0,s.mG)("boolean"!=typeof this.floatingUIOptions.inline?this.floatingUIOptions.inline:void 0)),e}getShouldShow(e){var t;let{state:n}=this.view,{selection:r}=n,{ranges:i}=r,o=Math.min(...i.map(e=>e.$from.pos)),s=Math.max(...i.map(e=>e.$to.pos));return null==(t=this.shouldShow)?void 0:t.call(this,{editor:this.editor,view:this.view,state:n,oldState:e,from:o,to:s})}updateOptions(e){var t;if(void 0!==e.updateDelay&&(this.updateDelay=e.updateDelay),void 0!==e.resizeDelay&&(this.resizeDelay=e.resizeDelay),void 0!==e.appendTo&&(this.appendTo=e.appendTo),void 0!==e.shouldShow&&e.shouldShow&&(this.shouldShow=e.shouldShow),void 0!==e.options){let n=null!=(t=e.options.scrollTarget)?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){let{selection:e}=this.editor.state,t=(0,o.MG)(this.view,e.from,e.to);(0,l.rD)({getBoundingClientRect:()=>t,getClientRects:()=>[t]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{var i,o;if((null==(i=r.hide)?void 0:i.referenceHidden)||(null==(o=r.hide)?void 0:o.escaped)){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(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));this.updateHandler(e,n,r,t)}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";let t="function"==typeof this.appendTo?this.appendTo():this.appendTo;null==(e=null!=t?t:this.view.dom.parentElement)||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},L=e=>new a.k_({key:"string"==typeof e.pluginKey?new a.hs(e.pluginKey):e.pluginKey,view:t=>new I({view:t,...e})});function P(e,t){return null!=e?e:new a.hs(t)}o.YY.create({name:"floatingMenu",addOptions:()=>({element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}),addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[L({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});var z="u">typeof window?D.useLayoutEffect:D.useEffect,$=new Set(["left","opacity","position","top","visibility","width"]),B=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","o
83pacity","order","orphans","scale","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom"]),j=new Set(["children","className","style"]),H=new Set(["tabIndex"]),F=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),V={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function U(e,t){return/^on[A-Z]/.test(e)&&"function"==typeof t}function K(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function W(e,t,n){if("tabIndex"===t){e.tabIndex=Number(n);return}e[t]=n}function q(e,t){let n=(0,D.useRef)({}),r=(0,D.useRef)([]);z(()=>{var i,o,s;let l,a,d,h=n.current;return!function(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute("class")}}(e,h.className,t.className),i=h.style,o=t.style,l=null!=i?i:{},a=null!=o?o:{},(new Set([...Object.keys(l),...Object.keys(a)])).forEach(t=>{let n=l[t],r=a[t];if(n!==r){if(null==r)return void(!$.has(t)&&e.style.removeProperty(K(t)));$.has(t)||e.style.setProperty(K(t),"number"!=typeof r||0===r||t.startsWith("--")||B.has(t)?String(r):`${r}px`)}}),(new Set([...Object.keys(h),...Object.keys(t)])).forEach(n=>{if(j.has(n)||!(n.startsWith("aria-")||n.startsWith("data-")||F.has(n))||U(n,h[n])||U(n,t[n]))return;let r=h[n],i=t[n];if(r===i)return;let o=(n.startsWith("aria-")||n.startsWith("data-"),n);if(null==i||!1===i){H.has(n)&&function(e,t){if("tabIndex"===t)return e.removeAttribute("tabindex");let n=e[t];if("boolean"==typeof n){e[t]=!1;return}if("number"==typeof n){e[t]=0;return}e[t]=""}(e,n),e.removeAttribute(o);return}if(!0===i){H.has(n)&&W(e,n,!0),e.setAttribute(o,"");return}H.has(n)?W(e,n,i):e.setAttribute(o,String(i))}),s=r.current,s.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)}),d=[],Object.entries(t).forEach(([t,n])=>{var r;let i,o;if(!U(t,n))return;let{eventName:s,options:l}={eventName:null!=(r=V[o=((i=t.endsWith("Capture"))?t.slice(0,-7):t).slice(2)])?r:o.toLowerCase(),options:i?{capture:!0}:void 0},a=t=>{let r,i,o;n((r=t.defaultPrevented,i=!1,Object.defineProperties(o=Object.create(t),{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>void 0},isDefaultPrevented:{value:()=>r},isPropagationStopped:{value:()=>i},preventDefault:{value:()=>{r=!0,t.preventDefault()}},stopPropagation:{value:()=>{i=!0,t.stopPropagation()}}}),o))};e.addEventListener(s,a,l),d.push({eventName:s,listener:a,options:l})}),r.current=d,n.current=t,()=>{r.current.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)}),r.current=[]}},[e,t])}var J=D.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:o=null,getReferencedVirtualElement:s,options:l,children:a,...d},h)=>{let c=(0,D.useRef)(document.createElement("div")),u=(0,D.useRef)(P(e,"bubbleMenu")).current;q(c.current,d),"function"==typeof h?h(c.current):h&&(h.current=c.current);let{editor:p}=(0,A.aA)(),f=t||p,m={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:u,shouldShow:o,getReferencedVirtualElement:s,options:l},g=(0,D.useRef)(m);g.current=m;let[y,v]=(0,D.useState)(!1),b=(0,D.useRef)(!0);return(0,D.useEffect)(()=>{if(null==f?void 0:f.isDestroyed)return;if(!f)return void console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");let e=c.current;e.style.visibility="hidden",e.style.position="absolute";let t=N({...g.current,editor:f,element:e});f.registerPlugin(t);let n=g.current.pluginKey;return b.current=!0,v(!0),()=>{v(!1),f.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[f]),(0,D.useEffect)(()=>{if(y&&f&&!f.isDestroyed){if(b.current){b.current=!1;return}f.view.dispatch(f.state.tr.setMeta(u,{type:"updateOptions",options:g.current}))}},[y,f,n,r,o,l,i,s,u]),(0,R.createPortal)(a,c.current)});D.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:o=null,options:s,children:l,...a},d)=>{let h=(0,D.useRef)(document.createElement("div")),c=(0,D.useRef)(P(e,"floatingMenu")).current;q(h.current,a),"function"==typeof d?d(h.current):d&&(d.current=h.current);let{editor:u}=(0,A.aA)(),p=t||u,f={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:c,shouldShow:o,options:s},m=(0,D.useRef)(f);m.current=f;let[g,y]=(0,D.useState)(!1),v=(0,D.useRef)(!0);return(0,D.useEffect)(()=>
83{if(null==p?void 0:p.isDestroyed)return;if(!p)return void console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");let e=h.current;e.style.visibility="hidden",e.style.position="absolute";let t=L({...m.current,editor:p,element:e});p.registerPlugin(t);let n=m.current.pluginKey;return v.current=!0,y(!0),()=>{y(!1),p.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[p]),(0,D.useEffect)(()=>{if(g&&p&&!p.isDestroyed){if(v.current){v.current=!1;return}p.view.dispatch(p.state.tr.setMeta(c,{type:"updateOptions",options:m.current}))}},[g,p,n,r,o,s,i,c]),(0,R.createPortal)(l,h.current)})},yqK(e,t,n){n.d(t,{A:()=>V});var r=n("YI9");let i=new WeakSet,o=new WeakSet;function s(e){return i.add(e),e}function l(e){return Array.isArray(e)&&i.has(e)}let a=(e,t)=>(function(e,t){if("slot"===e)return 0;if(e instanceof Function){let n=e(t);return!Array.isArray(n)||l(n)||o.has(n)?n:s(n)}let{children:n,...r}=null!=t?t:{};if("svg"===e)throw Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");if(Array.isArray(n)){if(l(n))return s([e,r,n]);if(0===n.length)return s([e,r]);let t=function e(t){return t.flatMap(t=>null==t?[]:Array.isArray(t)&&o.has(t)&&!l(t)?e(t):[t])}(n);return 0===t.length?s([e,r]):s([e,r,...t])}return null!=n?s([e,r,n]):s([e,r])})(e,t);var d=/^\s*>\s$/,h=r.bP.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return a("blockquote",{...(0,r.KV)(this.options.HTMLAttributes,e),children:a("slot",{})})},parseMarkdown:(e,t)=>{var n;let r=null!=(n=t.parseBlockChildren)?n:t.parseChildren;return t.createNode("blockquote",void 0,r(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return"";let n=[];return e.content.forEach((e,r)=>{var i,o;let s=(null!=(o=null==(i=t.renderChild)?void 0:i.call(t,e,r))?o:t.renderChildren([e])).split("\n").map(e=>""===e.trim()?">":`> ${e}`);n.push(s.join("\n"))}),n.join(`
84>
85`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}}
85,addInputRules(){return[(0,r.tG)({find:d,type:this.type})]}}),c=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,u=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,p=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,f=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,m=r.CU.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return a("strong",{...(0,r.KV)(this.options.HTMLAttributes,e),children:a("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}}
85,addInputRules(){return[(0,r.OX)({find:c,type:this.type}),(0,r.OX)({find:p,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:u,type:this.type}),(0,r.Zc)({find:f,type:this.type})]}}),g=/(^|[^`])`([^`]+)`(?!`)$/,y=/(^|[^`])`([^`]+)`(?!`)/g,v=r.CU.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",(0,r.KV)(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[(0,r.OX)({find:g,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:y,type:this.type})]}}),b=n("SB"),w=/^```([a-z]+)?[\s\n]$/,k=/^~~~([a-z]+)?[\s\n]$/,x=r.bP.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;let{languageClassPrefix:n}=this.options;if(!n)return null;let r=[...(null==(t=e.firstElementChild)?void 0:t.classList)||[]].filter(e=>e.startsWith(n)).map(e=>e.replace(n,""))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",(0,r.KV)(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n,r;return(null==(n=e.raw)?void 0:n.startsWith("```"))===!1&&(null==(r=e.raw)?void 0:r.startsWith("~~~"))===!1&&"indented"!==e.codeBlockStyle?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var n;let r=(null==(n=e.attrs)?void 0:n.language)||"";return e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join("\n"):`\`\`\`${r}
86
87\`\`\``},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!!e&&t.parent.type.name===this.name&&(!!n||!t.parent.textContent.length)&&this.editor.commands.clearNodes()},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;let n=null!=(t=this.options.tabSize)?t:4,{state:r}=e,{selection:i}=r,{$from:o,empty:s}=i;if(o.parent.type!==this.type)return!1;let l=" ".repeat(n);return s?e.commands.insertContent(l):e.commands.command(({tr:e})=>{let{from:t,to:n}=i,o=r.doc.textBetween(t,n,"\n","\n").split("\n").map(e=>l+e).join("\n");return e.replaceWith(t,n,r.schema.text(o)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;let n=null!=(t=this.options.tabSize)?t:4,{state:r}=e,{selection:i}=r,{$from:o,empty:s}=i;return o.parent.type===this.type&&(s?e.commands.command(({tr:e})=>{var t;let{pos:i}=o,s=o.start(),l=o.end(),a=r.doc.textBetween(s,l,"\n","\n").split("\n"),d=0,h=0,c=i-s;for(let e=0;e<a.length;e+=1){if(h+a[e].length>=c){d=e;break}h+=a[e].length+1}let u=Math.min(((null==(t=a[d].match(/^ */))?void 0:t[0])||"").length,n);if(0===u)return!0;let p=s;for(let e=0;e<d;e+=1)p+=a[e].length+1;return e.delete(p,p+u),i-p<=u&&e.setSelection(b.U3.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:t,to:o}=i,s=r.doc.textBetween(t,o,"\n","\n").split("\n").map(e=>{var t;let r=Math.min(((null==(t=e.match(/^ */))?void 0:t[0])||"").length,n);return e.slice(r)}).join("\n");return e.replaceWith(t,o,r.schema.text(s)),!0}))},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!!o&&!!s&&e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>
87{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let s=i.after();return void 0!==s&&(r.nodeAt(s)?e.commands.command(({tr:e})=>(e.setSelection(b.LN.near(r.resolve(s))),!0)):e.commands.exitCode())}}},addInputRules(){return[(0,r.JJ)({find:w,type:this.type,getAttributes:e=>({language:e[1]})}),(0,r.JJ)({find:k,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new b.k_({key:new b.hs("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=null==i?void 0:i.mode;if(!n||!o)return!1;let{tr:s,schema:l}=e.state,a=l.text(n.replace(/\r\n?/g,"\n"));return s.replaceSelectionWith(this.type.create({language:o},a)),s.selection.$from.parent.type!==this.type&&s.setSelection(b.U3.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),S=r.bP.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n\n"):""}),M=r.bP.create({name:"hardBreak",markdownTokenName:"br",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",(0,r.KV)(this.options.HTMLAttributes,e)]},renderText:()=>"\n",renderMarkdown:()=>`  
88`,parseMarkdown:()=>({type:"hardBreak"}),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()}}}),C=r.bP.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(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.KV)(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;let r=(null==(n=e.attrs)?void 0:n.level)?parseInt(e.attrs.level,10):1,i="#".repeat(r);return e.content?`${i} ${t.renderChildren(e.content)}`:""},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.JJ)({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}}
88)\\s$`),type:this.type,getAttributes:{level:e}}))}}),O=r.bP.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{},nextNodeType:"paragraph"}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",(0,r.KV)(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!(0,r.AB)(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:i}=n,o=e();return(0,r.BQ)(n)?o.insertContentAt(i.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(b.U3.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(b.nh.create(t.doc,n.pos)):t.setSelection(b.U3.create(t.doc,n.pos));else{let i=e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType,o=null==i?void 0:i.create();o&&(t.insert(r,o),t.setSelection(b.U3.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[(0,r.Ce)({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.t
88ype})]}}),T=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,E=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,N=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,A=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,D=r.CU.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",(0,r.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[(0,r.OX)({find:T,type:this.type}
88),(0,r.OX)({find:N,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:E,type:this.type}),(0,r.Zc)({find:A,type:this.type})]}}),R=n("hFG"),I=n("FEa"),L="&nbsp;",P=r.bP.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",(0,r.KV)(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(1===n.length&&"image"===n[0].type)return t.parseChildren([n[0]]);let r=t.parseInline(n);return 1===r.length&&"text"===r[0].type&&(r[0].text===L||" "===r[0].text)?t.createNode("paragraph",void 0,[]):t.createNode("paragraph",void 0,r)},renderMarkdown:(e,t,n)=>{var r,i;if(!e)return"";let o=Array.isArray(e.content)?e.content:[];if(0===o.length){let e=Array.isArray(null==(r=null==n?void 0:n.previousNode)?void 0:r.content)?n.previousNode.content:[];return(null==(i=null==n?void 0:n.previousNode)?void 0:i.type)==="paragraph"&&0===e.length?L:""}return t.renderChildren(o)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),z=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,$=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,B=r.CU.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",(0,r.KV)(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[(0,r.OX)({find:z,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:$,type:this.type})]}}),j=r.bP.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),H=n("iK"),F=n("GE"),V=r.YY.create({name:"starterKit",addExtensions(){var e,t,n,r;let i=[];return!1!==this.options.bold&&i.push(m.configure(this.options.bold)),!1!==this.options.blockquote&&i.push(h.configure(this.options.blockquote)),!1!==this.options.bulletList&&i.push(I.Rg.configure(this.options.bulletList)),!1!==this.options.code&&i.push(v.configure(this.options.code)),!1!==this.options.codeBlock&&i.push(x.configure(this.options.codeBlock)),!1!==this.options.document&&i.push(S.configure(this.options.document)),!1!==this.options.dropcursor&&i.push(F.QO.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&i.push(F.vR.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&i.push(M.configure(this.options.hardBreak)),!1!==this.options.heading&&i.push(C.configure(this.options.heading)),!1!==this.options.undoRedo&&i.push(F.lb.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&i.push(O.configure(this.options.horizontalRule)),!1!==this.options.italic&&i.push(D.configure(this.options.italic)),!1!==this.options.listItem&&i.push(I.ck.configure(this.options.listItem)),!1!==this.options.listKeymap&&i.push(I.it.configure(null==(e=this.options)?void 0:e.listKeymap)),!1!==this.options.link&&i.push(R.N_.configure(null==(t=this.options)?void 0:t.link)),!1!==this.options.orderedList&&i.push(I._J.configure(this.options.orderedList)),!1!==this.options.paragraph&&i.push(P.configure(this.options.paragraph)),!1!==this.options.strike&&i.push(B.configure(this.options.strike)),!1!==this.options.text&&i.push(j.configure(this.options.text)),!1!==this.options.underline&&i.push(H.z.configure(null==(n=this.options)?void 0:n.underline)),!1!==this.options.trailingNode&&i.push(F.JU.configure(null==(r=this.options)?void 0:r.trailingNode)),i}})},X2(e,t,n){var r=n("SB"),i=n("BzI"),o=n("YI9");function s(e){var t;let{char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:s,startOfLine:l,$position:a}=e,d=r&&!i,h=(0,o.GG)(n),c=RegExp(`\\s${h}$`),u=l?"^":"",p=i?"":h,f=d?RegExp(`${u}${h}.*?(?=\\s${p}|$)`,"gm"):RegExp(`${u}(?:^)?${h}[^\\s${p}]*`,"gm"),m=(null==(t=a.nodeBefore)?void 0:t.isText)&&a.nodeBefore.text;if(!m)return null;
88let g=a.pos-m.length,y=Array.from(m.matchAll(f)).pop();if(!y||void 0===y.input||void 0===y.index)return null;let v=y.input.slice(Math.max(0,y.index-1),y.index),b=RegExp(`^[${null==s?void 0:s.join("")}\0]?$`).test(v);if(null!==s&&!b)return null;let w=g+y.index,k=w+y[0].length;return(d&&c.test(m.slice(k-1,k+1))&&(y[0]+=" ",k+=1),w<a.pos&&k>=a.pos)?{range:{from:w,to:k},query:y[0].slice(n.length),text:y[0]}:null}var l=new r.hs("suggestion");function a({pluginKey:e=l,editor:t,char:n="@",allowSpaces:o=!1,allowToIncludeChar:d=!1,allowedPrefixes:h=[" "],startOfLine:c=!1,decorationTag:u="span",decorationClass:p="suggestion",decorationContent:f="",decorationEmptyClass:m="is-empty",command:g=()=>null,items:y=()=>[],render:v=()=>({}),allow:b=()=>!0,findSuggestionMatch:w=s,shouldShow:k}){let x,S=null==v?void 0:v(),M=()=>{let e=t.state.selection.$anchor.pos,{top:n,right:r,bottom:i,left:o}=t.view.coordsAtPos(e);try{return new DOMRect(o,n,r-o,i-n)}catch{return null}},C=(n,r)=>r?()=>{let r=e.getState(t.state),i=null==r?void 0:r.decorationId,o=n.dom.querySelector(`[data-decoration-id="${i}"]`);return(null==o?void 0:o.getBoundingClientRect())||null}:M,O=new r.k_({key:e,view(){return{update:async(e,n)=>{var r,i,o,s,l,a,d;let h=null==(r=this.key)?void 0:r.getState(n),c=null==(i=this.key)?void 0:i.getState(e.state),u=h.active&&c.active&&h.range.from!==c.range.from,p=!h.active&&c.active,f=h.active&&!c.active,m=!p&&!f&&h.query!==c.query,v=p||u&&m,b=m||u,w=f||u&&m;if(!v&&!b&&!w)return;let k=w&&!v?h:c,M=e.dom.querySelector(`[data-decoration-id="${k.decorationId}"]`);x={editor:t,range:k.range,query:k.query,text:k.text,items:[],command:e=>g({editor:t,range:k.range,props:e}),decorationNode:M,clientRect:C(e,M)},v&&(null==(o=null==S?void 0:S.onBeforeStart)||o.call(S,x)),b&&(null==(s=null==S?void 0:S.onBeforeUpdate)||s.call(S,x)),(b||v)&&(x.items=await y({editor:t,query:k.query})),w&&(null==(l=null==S?void 0:S.onExit)||l.call(S,x)),b&&(null==(a=null==S?void 0:S.onUpdate)||a.call(S,x)),v&&(null==(d=null==S?void 0:S.onStart)||d.call(S,x))},destroy:()=>{var e;x&&(null==(e=null==S?void 0:S.onExit)||e.call(S,x))}}},state:{init:()=>({active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}),apply(r,i,s,l){let{isEditable:a}=t,{composing:u}=t.view,{selection:p}=r,{empty:f,from:m}=p,g={...i},y=r.getMeta(e);if(y&&y.exit)return g.active=!1,g.decorationId=null,g.range={from:0,to:0},g.query=null,g.text=null,g;if(g.composing=u,a&&(f||t.view.composing)){(m<i.range.from||m>i.range.to)&&!u&&!i.composing&&(g.active=!1);let e=w({char:n,allowSpaces:o,allowToIncludeChar:d,allowedPrefixes:h,startOfLine:c,$position:p.$from}),s=`id_${Math.floor(0xffffffff*Math.random())}`;e&&b({editor:t,state:l,range:e.range,isActive:i.active})&&(!k||k({editor:t,range:e.range,query:e.query,text:e.text,transaction:r}))?(g.active=!0,g.decorationId=i.decorationId?i.decorationId:s,g.range=e.range,g.query=e.query,g.text=e.text):g.active=!1}else g.active=!1;return g.active||(g.decorationId=null,g.range={from:0,to:0},g.query=null,g.text=null),g}},props:{handleKeyDown(n,r){var i,o,s,l;let{active:a,range:d}=O.getState(n.state);if(!a)return!1;if("Escape"===r.key||"Esc"===r.key){let l=O.getState(n.state),a=null!=(i=null==x?void 0:x.decorationNode)?i:null,d=null!=a?a:(null==l?void 0:l.decorationId)?n.dom.querySelector(`[data-decoration-id="${l.decorationId}"]`):null;if(null==(o=null==S?void 0:S.onKeyDown)?void 0:o.call(S,{view:n,event:r,range:l.range}))return!0;let h={editor:t,range:l.range,query:l.query,text:l.text,items:[],command:e=>g({editor:t,range:l.range,props:e}),decorationNode:d,clientRect:d?()=>d.getBoundingClientRect()||null:null};return null==(s=null==S?void 0:S.onExit)||s.call(S,h),!function(n,r){var i;try{let r=e.getState(n.state),o=(null==r?void 0:r.decorationId)?n.dom.querySelector(`[data-decoration-id="${r.decorationId}"]`):null,s={editor:t,range:(null==r?void 0:r.range)||{from:0,to:0},query:(null==r?void 0:r.query)||null,text:(null==r?void 0:r.text)||null,items:[],command:e=>g({editor:t,range:(null==r?void 0:r.range)||{from:0,to:0},props:e}),decorationNode:o,clientRect:C(n,o)};null==(i=null==S?void 0:S.onExit)||i.call(S,s)}catch{}let o=n.state.tr.setMeta(r,{exit:!0});n.dispatch(o)}(n,e),!0}return(null==(l=null==S?void 0:S.onKeyDown)?void 0:l.call(S,{view:n,event:r,range:d}))||!1},decorations(e){let{active:t,range:n,decorationId:r,query:o}=O.getState(e);if(!t)return null;let s=!(null==o?void 0:o.length),l=[p];return s&&l.push(m),i.zF.create(e.doc,[i.NZ.inline(n.from,n.to,{nodeName:u,class:l.join(" "),"data-decoration-id":r,"data-decoration-content":f})])}}});return O}n.d(t,{V0:()=>a})},AT7(e,t,n){n.d(t,{K:()=>f,w:()=>p});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="u">typeof navigator&&/Mac/.test(navigator.platform),s="u">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]);var d=n("SB");let h="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),c="u">typeof navigator&&/Win/.test(navigator.platform);
vendor: 4,427 bytes, line 88
88function u(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 p(e){return new d.k_({props:{handleKeyDown:f(e)}})}function f(e){let t=function(e){let t=Object.create(null);for(let n in e)t[function(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let e=0;e<o.length-1;e++){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))h?i=!0:n=!0;else throw Error("Unrecognized modifier name: "+s)}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}(n)]=e[n];return t}(e);return function(e,n){var l;let a=("Esc"==(l=!(o&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||s&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?i:r)[n.keyCode]||n.key||"Unidentified")&&(l="Escape"),"Del"==l&&(l="Delete"),"Left"==l&&(l="ArrowLeft"),"Up"==l&&(l="ArrowUp"),"Right"==l&&(l="ArrowRight"),"Down"==l&&(l="ArrowDown"),l),d,h=t[u(a,n)];if(h&&h(e.state,e.dispatch,e))return!0;if(1==a.length&&" "!=a){if(n.shiftKey){let r=t[u(a,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(c&&n.ctrlKey&&n.altKey)&&(d=r[n.keyCode])&&d!=a){let r=t[u(d,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}},A5v(e,t,n){function r(e){this.content=e}function i(e){return e>=56320&&e<57344}function o(e){return e>=55296&&e<56320}n.d(t,{S4:()=>V,ZF:()=>X,FK:()=>s,CU:()=>h,sX:()=>j,bP:()=>C,u$:()=>S,vI:()=>c,Sj:()=>H,Ji:()=>u}),r.prototype={constructor:r,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return -1},get:function(e){var t=this.find(e);return -1==t?void 0:this.content[t+1]},update:function(e,t,n){var i=n&&n!=e?this.remove(n):this,o=i.find(e),s=i.content.slice();return -1==o?s.push(n||e,t):(s[o+1]=t,n&&(s[o]=n)),new r(s)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new r(n)},addToStart:function(e,t){return new r([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new r(n)},addBefore:function(e,t,n){var i=this.remove(t),o=i.content.slice(),s=i.find(e);return o.splice(-1==s?o.length:s,0,t,n),new r(o)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=r.from(e)).size?new r(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=r.from(e)).size?new r(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=r.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},r.from=function(e){if(e instanceof r)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new r(t)};class s{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let o=0,s=0;s<t;o++){let l=this.content[o],a=s+l.nodeSize;if(a>e&&!1!==n(l,r+s,i||null,o)&&l.content.size){let i=s+1;l.nodesBetween(Math.max(0,e-i),Math.min(l.content.size,t-i),n,r+i)}s=a}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,(s,l)=>{let a=s.isText?s.text.slice(Math.max(e,l)-l,t-l):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&a||s.isTextblock)&&n&&(o?o=!1:i+=n),i+=a},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new s(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,o=0;o<t;i++){let s=this.content[i],l=o+s.nodeSize;l>e&&((o<e||l>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),r+=s.nodeSize),o=l}return new s(n,r)}cutByIndex(e,t){return e==t?s.empty:0==e&&t==this.content.length?this:new s(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;
88let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new s(r,i)}addToStart(e){return new s([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new s(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return function e(t,n,r){for(let s=0;;s++){if(s==t.childCount||s==n.childCount)return t.childCount==n.childCount?null:r;let l=t.child(s),a=n.child(s);if(l==a){r+=l.nodeSize;continue}if(!l.sameMarkup(a))return r;if(l.isText&&l.text!=a.text){let e=l.text,t=a.text,n=0;for(;e[n]==t[n];n++)r++;return n&&n<e.length&&n<t.length&&o(e.charCodeAt(n-1))&&i(e.charCodeAt(n))&&r--,r}if(l.content.size||a.content.size){let t=e(l.content,a.content,r+1);if(null!=t)return t}r+=l.nodeSize}}(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return function e(t,n,r,s){for(let l=t.childCount,a=n.childCount;;){if(0==l||0==a)return l==a?null:{a:r,b:s};let d=t.child(--l),h=n.child(--a),c=d.nodeSize;if(d==h){r-=c,s-=c;continue}if(!d.sameMarkup(h))return{a:r,b:s};if(d.isText&&d.text!=h.text){let e=d.text,t=h.text,n=e.length,l=t.length;for(;n>0&&l>0&&e[n-1]==t[l-1];)n--,l--,r--,s--;return n&&l&&n<e.length&&o(e.charCodeAt(n-1))&&i(e.charCodeAt(n))&&(r++,s++),{a:r,b:s}}if(d.content.size||h.content.size){let t=e(d.content,h.content,r-1,s-1);if(t)return t}r-=c,s-=c}}(this,e,t,n)}findIndex(e){if(0==e)return a(0,e);if(e==this.size)return a(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=n+this.child(t).nodeSize;if(r>=e){if(r==e)return a(t+1,r);return a(t,n)}n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return s.empty;if(!Array.isArray(t))throw RangeError("Invalid input for Fragment.fromJSON");return s.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return s.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new s(t||e,n)}static from(e){if(!e)return s.empty;if(e instanceof s)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new s([e],e.nodeSize);throw RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}s.empty=new s([],0);let l={index:0,offset:0};function a(e,t){return l.index=e,l.offset=t,l}function d(e,t){if(e===t)return!0;if(!(e&&"object"==typeof e)||!(t&&"object"==typeof t))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!d(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!d(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class h{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&d(this.attrs,e.attrs)}
vendor: 6,047 bytes, line 88
88toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return h.none;if(e instanceof h)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t}}h.none=[];class c extends Error{}class u{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,o,s){let{index:l,offset:a}=t.findIndex(n),d=t.maybeChild(l);if(a==n||d.isText)return s&&i<=0&&o<=0&&!s.canReplace(l,l,r)?null:t.cut(0,n).append(r).append(t.cut(n));let h=e(d.content,n-a-1,r,0==l?i-1:0,l==t.childCount-1?o-1:0,d);return h&&t.replaceChild(l,d.copy(h))}(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return n&&new u(n,this.openStart,this.openEnd)}removeBetween(e,t){return new u(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 u.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 u(s.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 u(e,n,r)}}function p(e,t){if(!t.type.compatibleContent(e.type))throw new c("Cannot join "+t.type.name+" onto "+e.type.name)}function f(e,t,n){let r=e.node(n);return p(r,t.node(n)),r}function m(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 g(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&&(m(e.nodeAfter,r),o++));for(let e=o;e<s;e++)m(i.child(e),r);t&&t.depth==n&&t.textOffset&&m(t.nodeBefore,r)}function y(e,t){if(!e.type.validContent(t))throw new c("Invalid content for node "+e.type.name);return e.copy(t)}function v(e,t,n){let r=[];return g(null,e,n,r),e.depth>n&&m(y(f(e,t,n+1),v(e,t,n+1)),r),g(t,null,n,r),new s(r)}u.empty=new u(s.empty,0,0);class b{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;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return h.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new S(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw 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;
88i=s-1,r+=o+1}return new b(t,n,i)}static resolveCached(e,t){let n=x.get(e);if(n)for(let e=0;e<n.elts.length;e++){let r=n.elts[e];if(r.pos==t)return r}else x.set(e,n=new w);let r=n.elts[n.i]=b.resolve(e,t);return n.i=(n.i+1)%k,r}}class w{constructor(){this.elts=[],this.i=0}}let k=12,x=new WeakMap;class S{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}let M=Object.create(null);class C{constructor(e,t,n,r=h.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||s.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&d(this.attrs,t||e.defaultAttrs||M)&&h.sameSet(this.marks,n||h.none)}copy(e=null){return e==this.content?this:new C(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new C(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return u.empty;let r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o);return new u(r.node(o).content.cut(r.pos-s,i.pos-s),r.depth-o,i.depth-o)}replace(e,t,n){var r=this.resolve(e),i=this.resolve(t);if(n.openStart>r.depth)throw new c("Inserted content deeper than insertion position");if(r.depth-n.openStart!=i.depth-n.openEnd)throw new c("Inconsistent open depths");return function e(t,n,r,i){let o=t.index(i),l=t.node(i);if(o==n.index(i)&&i<t.depth-r.openStart){let s=e(t,n,r,i+1);return l.copy(l.content.replaceChild(o,s))}if(!r.content.size)return y(l,v(t,n,i));if(r.openStart||r.openEnd||t.depth!=i||n.depth!=i){let{start:e,end:o}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(s.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(r,t);return y(l,function e(t,n,r,i,o){let l=t.depth>o&&f(t,n,o+1),a=i.depth>o&&f(r,i,o+1),d=[];return g(null,t,o,d),l&&a&&n.index(o)==r.index(o)?(p(l,a),m(y(l,e(t,n,r,i,o+1)),d)):(l&&m(y(l,v(t,n,o+1)),d),g(n,r,o,d),a&&m(y(a,v(r,i,o+1)),d)),g(i,null,o,d),new s(d)}(t,e,o,n,i))}{let e=t.parent,i=e.content;return y(e,i.cut(0,t.parentOffset).append(r.content).append(i.cut(n.parentOffset)))}}(r,i,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(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return b.resolveCached(this,e)}resolveNoCache(e){return b.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}
88toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),T(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=s.empty,r=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,r,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=h.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!h.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){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=s.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}}C.prototype.text=void 0;class O extends C{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):T(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 O(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new O(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 T(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class E{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){var n;let r,i=new N(e,t);if(null==i.next)return E.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=A(e),r=n;return e.eat(",")&&(r="}"!=e.next?A(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;r<t.min;r++){let r=n();i(e(t.expr,s),r),s=r}if(-1==t.max)i(e(t.expr,s),s);else for(let o=t.min;o<t.max;o++){let o=n();r(s,o),i(e(t.expr,s),o),s=o}return[r(s)]}else if("name"==t.type)return[r(o,void 0,t.value)];else throw Error("Unknown expr type")}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}
vendor: 5,540 bytes, line 88
88function i(e,t){e.forEach(e=>e.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<i.length;t++)i[t][0]==e&&(r=i[t][1]);R(n,t).forEach(t=>{r||i.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)})}})});let o=r[t.join(",")]=new E(t.indexOf(n.length-1)>-1);for(let t=0;t<i.length;t++){let n=i[t][1].sort(D);o.next.push({type:i[t][0],next:r[n.join(",")]||e(n)})}return o}(R(n,0)));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];o.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(s,i),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function i(o,l){let a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return s.from(l.map(e=>e.createAndFill()));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!(t.isText||t.hasRequiredAttrs())&&-1==r.indexOf(n)){r.push(n);let e=i(n,l.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:o,next:s}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return!function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r}).join("\n")}}E.empty=new E(!0);class N{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 A(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function D(e,t){return t-e}function R(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:o}=i[e];r||-1!=n.indexOf(o)||t(o)}}(t),n.sort(D)}function I(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function L(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function P(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}function z(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new B(e,r,t[r]);return n}class ${constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=z(e,n.attrs),this.defaultAttrs=I(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==E.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:L(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new C(this,this.computeAttrs(e),s.from(t),h.setFrom(n))}createChecked(e=null,t,n){return t=s.from(t),this.checkContent(t),new C(this,this.computeAttrs(e),t,h.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=s.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(s.empty,!0);return i?new C(this,e,t.append(i),h.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);
88if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){P(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){let t;if(null==this.markSet)return e;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:h.none:e}static compile(e,t){let n=Object.create(null);e.forEach((e,r)=>n[e]=new $(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 B{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 j{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=z(e,r.attrs),this.excluded=null;let i=I(this.attrs);this.instance=i?new h(this,i):null}create(e=null){return!e&&this.instance?this.instance:new h(this,L(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach((e,i)=>n[e]=new j(e,r++,t,i)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){P(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class H{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.from(e.nodes),t.marks=r.from(e.marks||{}),this.nodes=$.compile(this.spec.nodes,this),this.marks=j.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]=E.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?F(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?[]:F(this,n.split(" "))}this.nodeFromJSON=e=>C.fromJSON(this,e),this.markFromJSON=e=>h.fromJSON(this,e),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 $){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 O(n,n.defaultAttrs,e,h.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError("Unknown node type: "+e);return t}}function F(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class V{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 _(this,t,!1);return n.addAll(e,h.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new _(this,t,!0);return n.addAll(e,h.none,t.from,t.to),u.maxOpen(n.finish())}matchTag(e,t,n){for(let o=n?this.tags.indexOf(n)+1:0;o<this.tags.length;o++){var r,i;let n=this.tags[o];if(r=e,i=n.tag,(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,i)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs
88){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(0==o.indexOf(e)&&(!r.context||n.matchesContext(r.context))&&(!(o.length>e.length)||61==o.charCodeAt(e.length)&&o.slice(e.length+1)==t)){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Y(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=Y(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new V(e,V.schemaRules(e)))}}let U={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},K={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},W={ol:!0,ul:!0};function q(e,t,n){return null!=t?!!t|2*("full"===t):e&&"pre"==e.whitespace?3:-5&n}class J{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=h.none,this.match=i||(4&o?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(s.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=s.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(s.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&&!U.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class _{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 J(r.type,r.attrs,h.none,!0,t.topMatch||r.type.contentMatch,o):n?new J(null,null,h.none,!0,null,o):new J(e.schema.topNodeType,null,h.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,{schema:o}=this.parser;if("full"===i||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(i)if("full"===i)n=n.replace(/\r\n?/g,"\n");else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(o.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(o.text(e[n]),t,!/\S/.test(e[n]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&"BR"==i.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(o.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),s;W.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&&W.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));t:if(l?l.ignore:K.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(U.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 t}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,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1===n.consuming)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,o;
vendor: 4,107 bytes, line 88
88if(t.node)if((o=this.parser.schema.nodes[t.node]).isLeaf)this.insertNode(o.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(o,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(s)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=null==r?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,o=0;t>=0;t--){let s=this.nodes[t],l=s.findWrapping(e);if(l&&(!r||r.length>l.length+o)&&(r=l,i=s,!l.length))break;if(s.solid){if(n)break;o+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let n=h.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):G(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&(i=this.enterInner(e,t,n,!0,r)),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let s=q(e,i,o.options);4&o.options&&0==o.content.length&&(s|=4);let l=h.none;return n=n.filter(t=>(o.type?!o.type.allowsMarkType(t.type):!G(t.type,e))||(l=t.addToSet(l),!1)),this.nodes.push(new J(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<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,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];
88if(t.isTextblock&&t.defaultAttrs)return t}}}function Y(e){let t={};for(let n in e)t[n]=e[n];return t}function G(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||0>o.indexOf(i)&&s(i))return!0}};if(s(i.contentMatch))return!0}}class X{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Q(t).createDocumentFragment());let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n<i.length&&o<e.marks.length;){let t=e.marks[o];if(!this.marks[t.type.name]){o++;continue}if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,o++}for(;n<i.length;)r=i.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],s=this.serializeMark(n,e.isInline,t);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return Q(t).createTextNode(e.text);let{dom:n,contentDOM:r}=et(Q(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&et(Q(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return"string"==typeof t?{dom:e.createTextNode(t)}:et(e,t,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new X(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Z(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return Z(e.marks)}}function Z(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Q(e){return e.document||window.document}let ee=new WeakMap;function et(e,t,n,r){let i,o,s;if(1==t.nodeType)return{dom:t};if(t.dom&&1==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=ee.get(r))&&ee.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<t.length;n++)e(t[n]);else for(let n in t)e(t[n])}(r),o=s)),a=o)&&a.indexOf(t)>-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let d=l.indexOf(" ");d>0&&(n=l.slice(0,d),l=l.slice(d+1));let h=n?e.createElementNS(n,l):e.createElement(l),c=t[1],u=1;if(c&&"object"==typeof c&&null==c.nodeType&&!Array.isArray(c)){for(let e in u=2,c)if(null!=c[e]){let t=e.indexOf(" ");t>0?h.setAttributeNS(e.slice(0,t),e.slice(t+1),c[e]):"style"==e&&h.style?h.style.cssText=c[e]:h.setAttribute(e,c[e])}}for(let o=u;o<t.length;o++){let s=t[o];if(0===s){if(o<t.length-1||o>u)throw RangeError("Content hole must be the only child of its parent node");return{dom:h,contentDOM:h}}if("string"==typeof s)h.appendChild(e.createTextNode(s));else{let{dom:t,contentDOM:o}=et(e,s,n,r);if(h.appendChild(t),o){if(i)throw RangeError("Multiple content holes");i=o}}}return{dom:h,contentDOM:i}}},SB(e,t,n){var r=n("A5v"),i=n("LYp");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<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=r.Ji.empty){let n=t.content.lastChild,i=null;for(let e=0;e<t.openEnd;e++)i=n,n=n.lastChild;let o=e.steps.length,s=this.ranges;for(let l=0;l<s.length;l++){let{$from:a,$to:d}=s[l],h=e.mapping.slice(o);e.replaceRange(h.map(a.pos),h.map(d.pos),l?r.Ji.empty:t),0==l&&y(e,o,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],l=e.mapping.slice(n),a=l.map(o.pos),d=l.map(s.pos);i?e.deleteRange(a,d):(e.replaceRangeWith(a,d,t),y(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new h(e):g(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?g(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):g(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}
88static 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 h.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 d(e){a||e.parent.inlineContent||(a=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class h extends s{constructor(e,t=e){d(e),d(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 h(r.parent.inlineContent?r:n,n)}replace(e,t=r.Ji.empty){if(super.replace(e,t),t==r.Ji.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof h&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new c(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 h(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if((!n||r)&&(n=r>=0?1:-1),!t.parent.inlineContent){let e=s.findFrom(t,n,!0)||s.findFrom(t,-n,!0);if(!e)return s.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r?e=t:(e=(s.findFrom(e,-n,!0)||s.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0&&(e=t)),new h(e,t)}}s.jsonID("text",h);class c{constructor(e,t){this.anchor=e,this.head=t}map(e){return new c(e.map(this.anchor),e.map(this.head))}resolve(e){return h.between(e.resolve(this.anchor),e.resolve(this.head))}}class u extends s{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?s.near(i):new u(i)}content(){return new r.Ji(r.FK.from(this.node),0,0)}eq(e){return e instanceof u&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new p(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new u(e.resolve(t.anchor))}static create(e,t){return new u(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}u.prototype.visible=!1,s.jsonID("node",u);class p{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new c(n,n):new p(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&u.isSelectable(n)?new u(t):s.near(t)}}class f extends s{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=r.Ji.empty){if(t==r.Ji.empty){e.delete(0,e.doc.content.size);let t=s.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new f(e)}map(e){return new f(e)}eq(e){return e instanceof f}getBookmark(){return m}}s.jsonID("all",f);let m={map(){return this},resolve:e=>new f(e)};function g(e,t,n,r,i,o=!1){if(t.inlineContent)return h.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&u.isSelectable(r))return u.create(e,n-(i<0?r.nodeSize:0))}else{let t=g(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function y(e,t,n){let r,o=e.steps.length-1;if(o<t)return;let l=e.steps[o];(l instanceof i.Ln||l instanceof i.Wg)&&(e.mapping.maps[o].forEach((e,t,n,i)=>{null==r&&(r=i)}),e.setSelection(s.near(e.doc.resolve(r),n)))}class v extends i.dL{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return r.CU.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.CU.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(s.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function b(e,t){return t&&e?e.bind(t):e}
88class w{constructor(e,t,n){this.name=e,this.init=b(t.init,n),this.apply=b(t.apply,n)}}let k=[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 x{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=k.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw 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;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let l=r?r[o].n:0,a=r?r[o].state:this,d=l<t.length&&s.spec.appendTransaction.call(s,l?t.slice(l):t,a,n);if(d&&n.filterTransaction(d,o)){if(d.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<o?{state:n,n:t.length}:{state:this,n:0})}t.push(d),n=n.applyInner(d),i=!0}r&&(r[o]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let t=new S(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new v(this)}static create(e){let t=new x(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new S(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new x(this.schema,e.plugins),n=t.fields,r=new S(t);for(let t=0;t<n.length;t++){let i=n[t].name;r[i]=this.hasOwnProperty(i)?this[i]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw 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 x(e.schema,e.plugins),o=new S(i);return i.fields.forEach(i=>{if("doc"==i.name)o.doc=r.bP.fromJSON(e.schema,t.doc);else if("selection"==i.name)o.selection=s.fromJSON(o.doc,t.selection);else if("storedMarks"==i.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let r in n){let s=n[r],l=s.spec.state;if(s.key==i.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(t,r)){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:O("plugin")}getState(e){return e[this.key]}}let C=Object.create(null);function O(e){return e in C?e+"$"+ ++C[e]:(C[e]=0,e+"$")}class T{constructor(e="key"){this.key=O(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}n.d(t,{$t:()=>S,LN:()=>s,U3:()=>h,hs:()=>T,i5:()=>f,k_:()=>M,nh:()=>u,yn:()=>l})},LYp(e,t,n){var r=n("A5v");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;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+(e-(65535&e))/65536}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,o=this.inverted?2:1,s=this.inverted?1:2;
88for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let d=this.ranges[l+o],h=this.ranges[l+s],c=a+d;if(e<=c){let o=d?e==a?-1:e==c?1:t:t,s=a+r+(o<0?0:h);if(n)return s;let u=e==(t<0?a:c)?null:l/3+(e-a)*65536,p=e==a?2:e==c?1:4;return(t<0?e!=a:e!=c)&&(p|=8),new i(s,p,u)}r+=h-d}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;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)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<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),l=o+(this.inverted?0:i),a=this.ranges[r+t],d=this.ranges[r+n];e(s,s+a,l,l+d),i+=d-a}}invert(){return new o(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?o.empty:new o(e<0?[0,-e,0]:[0,0,e])}}o.empty=new o([]);class s{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new s(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new s;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(null!=i.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new i(e,r,null)}}let l=Object.create(null);class a{getMap(){return o.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError("Invalid input for Step.fromJSON");let n=l[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in l)throw RangeError("Duplicate use of step JSON ID "+e);return l[e]=t,t.prototype.jsonID=e,t}}class d{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new d(e,null)}static fail(e){return new d(null,e)}static fromReplace(e,t,n,i){try{return d.ok(e.replace(t,n,i))}catch(e){if(e instanceof r.vI)return d.fail(e.message);throw e}}}function h(e,t,n){let i=[];for(let r=0;r<e.childCount;r++){let o=e.child(r);o.content.size&&(o=o.copy(h(o.content,t,o))),o.isInline&&(o=t(o,n,r)),i.push(o)}return r.FK.fromArray(i)}class c 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=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),o=new r.Ji(h(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,i),t.openStart,t.openEnd);return d.fromReplace(e,this.from,this.to,o)}invert(){return new u(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 c(t.pos,n.pos,this.mark)}merge(e){return e instanceof c&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new c(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 c(t.from,t.to,e.markFromJSON(t.mark))}}a.jsonID("addMark",c);class u extends a{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}
vendor: 5,903 bytes, line 88
88apply(e){let t=e.slice(this.from,this.to),n=new r.Ji(h(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return d.fromReplace(e,this.from,this.to,n)}invert(){return new c(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 u(t.pos,n.pos,this.mark)}merge(e){return e instanceof u&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new u(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 u(t.from,t.to,e.markFromJSON(t.mark))}}a.jsonID("removeMark",u);class p extends a{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return d.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return d.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new p(this.pos,t.marks[n]);return new p(this.pos,this.mark)}}return new f(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new p(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new p(t.pos,e.markFromJSON(t.mark))}}a.jsonID("addNodeMark",p);class f extends a{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return d.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return d.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new p(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new f(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new f(t.pos,e.markFromJSON(t.mark))}}a.jsonID("removeNodeMark",f);class m extends a{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&y(e,this.from,this.to)?d.fail("Structure replace would overwrite content"):d.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new o([this.from,this.to-this.from,this.slice.size])}invert(e){return new m(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),n=this.from==this.to&&m.MAP_BIAS<0?t:e.mapResult(this.from,1);return n.deletedAcross&&t.deletedAcross?null:new m(n.pos,Math.max(n.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof m)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart)if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;else{let t=this.slice.size+e.slice.size==0?r.Ji.empty:new r.Ji(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new m(e.from,this.to,t,this.structure)}{let t=this.slice.size+e.slice.size==0?r.Ji.empty:new r.Ji(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new m(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new m(t.from,t.to,r.Ji.fromJSON(e,t.slice),!!t.structure)}}m.MAP_BIAS=1,a.jsonID("replace",m);class g extends a{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(y(e,this.from,this.gapFrom)||y(e,this.gapTo,this.to)))return d.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return d.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?d.fromReplace(e,this.from,this.to,n):d.fail("Content does not fit in gap")}getMap(){return new o([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new g(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new 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.Ji.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>
880&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function v(e,t,n,i=n.contentMatch,o=!0){let s=e.doc.nodeAt(t),l=[],a=t+1;for(let t=0;t<s.childCount;t++){let d=s.child(t),h=a+d.nodeSize,c=i.matchType(d.type);if(c){i=c;for(let t=0;t<d.marks.length;t++)n.allowsMarkType(d.marks[t].type)||e.step(new u(a,h,d.marks[t]));if(o&&d.isText&&"pre"!=n.whitespace){let e,t=/\r?\n|\r/g,i;for(;e=t.exec(d.text);)i||(i=new r.Ji(r.FK.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),l.push(new m(a+e.index,a+e.index+e[0].length,i))}}else l.push(new m(a,h,r.Ji.empty));a=h}if(!i.validEnd){let t=i.fillBefore(r.FK.empty,!0);e.replace(a,a,new r.Ji(t,0,0))}for(let t=l.length-1;t>=0;t--)e.step(l[t])}function b(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let o=e.$from.node(n),s=e.$from.index(n)+r,l=e.$to.indexAfter(n)-i;if(n<e.depth&&o.canReplace(s,l,t))return n;if(0==n||o.type.spec.isolating||!((0==s||o.canReplace(s,o.childCount))&&(l==o.childCount||o.canReplace(0,l))))break;s&&(r=1),l<o.childCount&&(i=1)}return null}function w(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}(e,t),o=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;l&&e<i;e++)l=l.matchType(n.child(e).type);return l&&l.validEnd?s:null}(r,t);return o?i.map(k).concat({type:t,attrs:n}).concat(o.map(k)):null}function k(e){return{type:e,attrs:null}}function x(e,t,n,r){t.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let i=e.mapping.slice(r).map(n+1+o+s.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function 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 C(e,t){let n=e.resolve(t),r=n.index();return O(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function O(e,t){return!!(e&&t&&!e.isLeaf&&function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let o=t.child(i),s=o.type==r?e.type.schema.nodes.text:o.type;if(!(n=n.matchType(s))||!e.type.allowsMarks(o.marks))return!1}return n.validEnd}(e,t))}function T(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,o,s=r.index(e);if(e==r.depth?(i=r.nodeBefore,o=r.nodeAfter):n>0?(i=r.node(e+1),s++,o=r.node(e).maybeChild(s)):(i=r.node(e).maybeChild(s-1),o=r.node(e+1)),i&&!i.isTextblock&&O(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 E(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,o=r.index(t)+ +(n>0),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}
88function N(e,t,n=t,i=r.Ji.empty){if(t==n&&!i.size)return null;let o=e.resolve(t),s=e.resolve(n);return 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.FK.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=r.FK.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let o=this.placed,s=n.depth,l=i.depth;for(;s&&l&&1==o.childCount;)o=o.firstChild.content,s--,l--;let a=new r.Ji(o,s,l);return e>-1?new 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;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e=null,i=(n?(e=L(this.unplaced.content,n-1).firstChild).content:this.unplaced.content).firstChild;for(let o=this.depth;o>=0;o--){let{type:s,match:l}=this.frontier[o],a,d=null;if(1==t&&(i?l.matchType(i.type)||(d=l.fillBefore(r.FK.from(i),!1)):e&&s.compatibleContent(e.type)))return{sliceDepth:n,frontierDepth:o,parent:e,inject:d};if(2==t&&i&&(a=l.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:o,parent:e,wrap:a};if(e&&l.matchType(e.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced;return!(z(e,-1)<=t)&&(this.unplaced.size>1&&z(e,1)>n&&n++,this.unplaced=new r.Ji(e,t+1,n),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=L(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new r.Ji(R(e,t-1,1),t-1,o?t-1:n)}else this.unplaced=new r.Ji(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;e<o.length;e++)this.openFrontierNode(o[e]);let s=this.unplaced,l=n?n.content:s.content,a=s.openStart-e,d=0,h=[],{match:c,type:u}=this.frontier[t];if(i){for(let e=0;e<i.childCount;e++)h.push(i.child(e));c=c.matchFragment(i)}let p=l.size+e-(s.content.size-s.openEnd);for(;d<l.childCount;){let e=l.child(d),t=c.matchType(e.type);if(!t)break;(++d>1||0==a||e.content.size)&&(c=t,h.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.FK.empty,!0)))),t.copy(o)}(e.mark(u.allowedMarks(e.marks)),1==d?a:0,d==l.childCount?p:-1)))}let f=d==l.childCount;f||(p=-1),this.placed=I(this.placed,t,r.FK.from(h)),this.frontier[t].match=c,f&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=l;e<p;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=f?0==e?r.Ji.empty:new r.Ji(R(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new r.Ji(R(s.content,e,d),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!P(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return -1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){n:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=P(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=P(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.FK.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(r.FK.empty,!0);e.childCount&&(this.placed=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.last
88Child.content,t-1,n)))}function L(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function P(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,s)?l:null}function z(e,t){for(let n=0;;n++){let r=t<0?e.firstChild:e.lastChild;if(!r||r.isAtom)return n;e=r.content}}function $(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.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 B 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 d.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let i=t.type.create(n,null,t.marks);return d.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(i),0,+!t.isLeaf))}getMap(){return o.empty}invert(e){return new B(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 B(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 B(t.pos,t.attr,t.value)}}a.jsonID("attr",B);class j 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 d.ok(n)}getMap(){return o.empty}invert(e){return new j(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new j(t.attr,t.value)}}a.jsonID("docAttr",j);let H=class extends Error{};(H=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype),H.prototype.constructor=H,H.prototype.name="TransformError";class F{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 H(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,o)=>{e=Math.min(e,i),t=Math.max(t,o)})}return 1e9==e?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=r.Ji.empty){let i=N(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new r.Ji(r.FK.from(n),0,0))}delete(e,t){return this.replace(e,t,r.Ji.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return!function(e,t,n,i){if(!i.size)return e.deleteRange(t,n);let o=e.doc.resolve(t),s=e.doc.resolve(n);if(A(o,s,i))return e.step(new m(t,n,i));let l=$(o,s);0==l[l.length-1]&&l.pop();let a=-(o.depth+1);l.unshift(a);for(let e=o.depth,t=o.pos-1;e>0;e--,t--){let n=o.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;l.indexOf(e)>-1?a=e:o.before(e)==t&&l.splice(1,0,-e)}let d=l.indexOf(a),h=[],c=i.openStart;for(let e=i.content,t=0;;t++){let n=e.firstChild;if(h.push(n),t==i.openStart)break;e=n.content}for(let e=c-1;e>=0;e--){var u;let t=h[e],n=(u=t.type).spec.defining||u.spec.definingForContent;if(n&&!t.sameMarkup(o.node(Math.abs(a)-1)))c=e;else if(n||!t.type.isTextblock)break}for(let t=i.openStart;t>=0;t--){let a=(t+c+1)%(i.openStart+1),u=h[a];if(u)for(let t=0;t<l.length;t++){let h=l[(t+d)%l.length],c=!0;h<0&&(c=!1,h=-h);let p=o.node(h-1),f=o.index(h-1);if(p.canReplaceWith(f,f,u.type,u.marks))return e.replace(o.before(h),c?s.after(h):n,new r.Ji(function e(t,n,i,o,s){if
88(n<i){let r=t.firstChild;t=t.replaceChild(0,r.copy(e(r.content,n+1,i,o,r)))}if(n>o){let e=s.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(r.FK.empty,!0))}return t}(i.content,0,i.openStart,a),a,i.openEnd))}}let p=e.steps.length;for(let r=l.length-1;r>=0&&(e.replace(t,n,i),!(e.steps.length>p));r--){let e=l[r];e<0||(t=o.before(e),n=s.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){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(t<r.node(e).childCount)break}return null}(this.doc,i,n.type);null!=e&&(i=o=e)}return this.replaceRange(i,o,new r.Ji(r.FK.from(n),0,0)),this}deleteRange(e,t){return!function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&0==r.parentOffset&&0==i.parentOffset){let o=r.sharedDepth(n),s=!1;for(let e=r.depth;e>o;e--)r.node(e).type.spec.isolating&&(s=!0);for(let e=i.depth;e>o;e--)i.node(e).type.spec.isolating&&(s=!0);if(!s){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let o=$(r,i);for(let t=0;t<o.length;t++){let n=o[t],s=t==o.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(t-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return e.delete(r.before(o),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return!function(e,t,n){let{$from:i,$to:o,depth:s}=t,l=i.before(s+1),a=o.after(s+1),d=l,h=a,c=r.FK.empty,u=0;for(let e=s,t=!1;e>n;e--)t||i.index(e)>0?(t=!0,c=r.FK.from(i.node(e).copy(c)),u++):d--;let p=r.FK.empty,f=0;for(let e=s,t=!1;e>n;e--)t||o.after(e+1)<o.end(e)?(t=!0,p=r.FK.from(o.node(e).copy(p)),f++):h++;e.step(new g(d,h,l,a,new r.Ji(c.append(p),u,f),c.size-u,!0))}(this,e,t),this}join(e,t=1){return!function(e,t,n){let i=null,{linebreakReplacement:o}=e.doc.type.schema,s=e.doc.resolve(t-n),l=s.node().type;if(o&&l.inlineContent){let e="pre"==l.whitespace,t=!!l.contentMatch.matchType(o);e&&!t?i=!1:!e&&t&&(i=!0)}let a=e.steps.length;if(!1===i){let r=e.doc.resolve(t+n);S(e,r.node(),r.before(),a)}l.inlineContent&&v(e,t+n-1,l,s.node().contentMatchAt(s.index()),null==i);let d=e.mapping.slice(a),h=d.map(t-n);if(e.step(new m(h,d.map(t+n,-1),r.Ji.empty,!0)),!0===i){let t=e.doc.resolve(h);x(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return!function(e,t,n){let i=r.FK.empty;for(let e=n.length-1;e>=0;e--){if(i.size){let t=n[e].type.contentMatch.matchFragment(i);if(!t||!t.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=r.FK.from(n[e].type.create(n[e].attrs,i))}let o=t.start,s=t.end;e.step(new g(o,s,o,s,new r.Ji(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,d;let h,c,u="function"==typeof i?i(e):i;if(e.isTextblock&&!e.hasMarkup(n,u)&&(l=o.doc,a=o.mapping.slice(s).map(t),d=n,c=(h=l.resolve(a)).index(),h.parent.canReplaceWith(c,c+1,d))){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),d=l.map(t+e.nodeSize,1);return o.step(new g(a,d,a+1,d-1,new r.Ji(r.FK.from(n.create(u,null,e.marks)),0,0),1,!0)),!0===i&&x(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.Ji(r.FK.from(l),0,0),1,!0))}(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new B(e,t,n)),this}setDocAttribute(e,t){return this.step(new j(e,t)),this}addNodeMark(e,t){return this.step(new p(e,t)),this}
88removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError("No node at position "+e);if(t instanceof r.CU)t.isInSet(n.marks)&&this.step(new f(e,t));else{let r=n.marks,i,o=[];for(;i=t.isInSet(r);)o.push(new f(e,i)),r=i.removeFromSet(r);for(let e=o.length-1;e>=0;e--)this.step(o[e])}return this}split(e,t=1,n){return!function(e,t,n=1,i){let o=e.doc.resolve(t),s=r.FK.empty,l=r.FK.empty;for(let e=o.depth,t=o.depth-n,a=n-1;e>t;e--,a--){s=r.FK.from(o.node(e).copy(s));let t=i&&i[a];l=r.FK.from(t?t.type.create(t.attrs,l):o.node(e).copy(l))}e.step(new m(t,t,new r.Ji(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,d)=>{if(!r.isInline)return;let h=r.marks;if(!n.isInSet(h)&&d.type.allowsMarkType(n.type)){let d=Math.max(a,e),p=Math.min(a+r.nodeSize,t),f=n.addToSet(h);for(let e=0;e<h.length;e++)h[e].isInSet(f)||(i&&i.to==d&&i.mark.eq(h[e])?i.to=p:s.push(i=new u(d,p,h[e])));o&&o.to==d?o.to=p:l.push(o=new c(d,p,n))}}),s.forEach(e=>r.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.sX){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;t<a.length;t++){let r=a[t],i;for(let e=0;e<o.length;e++){let t=o[e];t.step==s-1&&r.eq(o[e].style)&&(i=t)}i?(i.to=n,i.step=s):o.push({style:r,from:Math.max(l,e),to:n,step:s})}}}),o.forEach(e=>i.step(new u(e.from,e.to,e.style))),this}clearIncompatible(e,t,n){return v(this,e,t,n),this}}n.d(t,{$L:()=>N,Ln:()=>m,N0:()=>T,Um:()=>E,Wg:()=>g,X9:()=>s,Ys:()=>u,dL:()=>F,jP:()=>b,n9:()=>C,oM:()=>w,zy:()=>M})},BzI(e,t,n){var r=n("SB"),i=n("A5v"),o=n("LYp");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,d=function(e,t,n){let r=a||(a=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},h=function(){a=null},c=function(e,t,n,r){return n&&(p(e,t,n,r,-1)||p(e,t,n,r,1))},u=/^(img|br|input|textarea|hr)$/i;function p(e,t,n,r,i){for(var o;;){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)||u.test(e.nodeName)||"false"==e.contentEditable)return!1;t=s(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;let n=e.childNodes[t+(i<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable)if(null==(o=n.pmViewDesc)||!o.ignoreForSelection)return!1;else t+=i;else e=n,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&&c(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="u">typeof navigator?navigator:null,b="u">typeof document?document:null,w=v&&v.userAgent||"",k=/Edge\/(\d+)/.exec(w),x=/MSIE \d/.exec(w),S=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(w),M=!!(x||S||k),C=x?document.documentMode:S?+S[1]:k?+k[1]:0,O=!M&&/gecko\/(\d+)/i.test(w);O&&(/Firefox\/(\d+)/.exec(w)||[0,0])[1];let T=!M&&/Chrome\/(\d+)/.exec(w),E=!!T,N=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),L=/Android \d/.test(w),P=!!b&&"webkitFontSmoothing"in b.documentElement.style,z=P?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function $(e,t){return"number"==typeof e?e:e[t]}function B(e,t,n){if(!U(t)&&0==t.left)return;let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(1!=s.nodeType){s=l(s);continue}let e=s,n=e==o.body,a=n?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}}
vendor: 8,530 bytes, line 88
88(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),d=0,h=0;if(t.top<a.top+$(r,"top")?h=-(a.top-t.top+$(i,"top")):t.bottom>a.bottom-$(r,"bottom")&&(h=t.bottom-t.top>a.bottom-a.top?t.top+$(i,"top")-a.top:t.bottom-a.bottom+$(i,"bottom")),t.left<a.left+$(r,"left")?d=-(a.left-t.left+$(i,"left")):t.right>a.right-$(r,"right")&&(d=t.right-a.right+$(i,"right")),d||h)if(n)o.defaultView.scrollBy(d,h);else{let n=e.scrollLeft,r=e.scrollTop;h&&(e.scrollTop+=h),d&&(e.scrollLeft+=d);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 c=n?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(c))break;s="absolute"==c?s.offsetParent:l(s)}}function j(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<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let F=null;function V(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function U(e){return e.top<e.bottom||e.left<e.right}function K(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(U(e))return e}return Array.prototype.find.call(n,U)||e.getBoundingClientRect()}let W=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function q(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=P||O;if(3==r.nodeType)if(s&&(W.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=K(d(r,i,i),n);if(O&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=K(d(r,i-1,i-1),-1);if(t.top==e.top){let n=K(d(r,i,i+1),-1);if(n.top!=e.top)return J(n,n.left<t.left)}}return e}else{let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,J(K(d(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 _(e.getBoundingClientRect(),!1)}if(null==o&&i<f(r)){let e=r.childNodes[i];if(1==e.nodeType)return _(e.getBoundingClientRect(),!0)}return _(r.getBoundingClientRect(),n>=0)}if(null==o&&i&&(n<0||i==f(r))){let e=r.childNodes[i-1],t=3==e.nodeType?d(e,f(e)-!s):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return J(K(t,1),!1)}if(null==o&&i<f(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?d(e,0,+!s):1==e.nodeType?e:null:null;if(t)return J(K(t,-1),!0)}return J(K(3==r.nodeType?d(r):r,-n),n>=0)}function J(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 _(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 Y(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 G=/[\u0590-\u08ac]/,X=null,Z=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(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){let r;if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}if(e==this.dom&&this.contentDOM)r=t>s(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=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;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],o=t+i.size;if(o>e||i instanceof 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<this.children.length?this.children[n]:null)&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?s(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let o=n,l=0;;l++){let n=this.children[l],a=o+n.size;if(-1==r&&e<=a){let i=o+n.border;if(e>=i&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=l;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=s(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(a>t||l==this.children.length-1)){t=a;for(let e=l+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=s(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=a}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),o=Math.max(e,t);for(let s=0,l=0;s<this.children.length;s++){let a=this.children[s],d=l+a.size;if(i>l&&o<d)return a.setSelection(e-l-a.border,t-l-a.border,n,r);l=d}let l=this.domFromPos(e,e?-1:1),a=t==e?l:this.domFromPos(t,t?-1:1),d=n.root.getSelection(),h=n.domSelectionRange(),u=!1;if((O||A)&&e==t){let{node:e,offset:t}=l;if(3==e.nodeType){if((u=!!(t&&"\n"==e.nodeValue[t-1]))&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){"BR"==n.nodeName&&(l=a={node:n.parentNode,offset:s(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(O&&h.focusNode&&h.focusNode!=a.node&&1==h.focusNode.nodeType){let e=h.focusNode.childNodes[h.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}
88if(!(r||u&&A)&&c(l.node,l.offset,h.anchorNode,h.anchorOffset)&&c(a.node,a.offset,h.focusNode,h.focusOffset))return;let p=!1;if((d.extend||e==t)&&!(u&&O)){d.collapse(l.node,l.offset);try{e!=t&&d.extend(a.node,a.offset),p=!0}catch(e){}}if(!p){if(e>t){let e=l;l=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s){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.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class et extends ee{constructor(e,t,n,r){let i,o=t.type.toDOM;if("function"==typeof o&&(o=o(n,()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r)),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.hasAttribute("contenteditable")||(o.contentEditable="false"),o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}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.ZF.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.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let r=er.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;t<o&&(i=ev(i,t,o,n)),e>0&&(i=ev(i,0,e,n));for(let e=0;e<i.length;e++)i[e].parent=r;return r.children=i,r}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class ei extends ee{constructor(e,t,n,r,i,o,s){super(e,[],i,o),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s}static create(e,t,n,r,o,s){let l=o.nodeViews[t.type.name],a,d=l&&l(t,o,()=>a?a.parent?a.parent.posBeforeChild(a):void 0:s,n,r),h=d&&d.dom,c=d&&d.contentDOM;if(t.isText)if(h){if(3!=h.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else h=document.createTextNode(t.text);else if(!h){let e=i.ZF.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:h,contentDOM:c}=e)}c||t.isText||"BR"==h.nodeName||(h.hasAttribute("contenteditable")||(h.contentEditable="false"),t.type.spec.draggable&&(h.draggable=!0));let u=h;return(h=ep(h,n,t),d)?a=new ea(e,t,n,r,h,c||null,u,d):t.isText?new es(e,t,n,r,h,u):new ei(e,t,n,r,h,c||null,u)}parseRule(e){if(this.node.type.spec.reparseInView)return null;
88let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}if(!t.contentElement){let n=e&&e.find(t=>1==t.nodeType&&0>e.indexOf(t.parentNode)&&this.dom.contains(t));n?t.contentElement=n:t.getContent=()=>i.FK.empty}}else t.contentElement=this.contentDOM;else t.getContent=()=>this.node.content;return t}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&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;n<e.childCount;n++){let s=e.child(n);r(s,i,t.forChild(o,s),n),o+=s.nodeSize}return}let s=0,l=[],a=null;for(let d=0;;){let h,c,u,p;for(;s<i.length&&i[s].to==o;){let e=i[s++];e.widget&&(h?(c||(c=[h])).push(e):h=e)}if(h)if(c){c.sort(ey);for(let e=0;e<c.length;e++)n(c[e],d,!!a)}else n(h,d,!!a);if(a)p=-1,u=a,a=null;else if(d<e.childCount)p=d,u=e.child(d++);else break;for(let e=0;e<l.length;e++)l[e].to<=o&&l.splice(e--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)l.push(i[s++]);let f=o+u.nodeSize;if(u.isText){let e=f;s<i.length&&i[s].from<e&&(e=i[s].from);for(let t=0;t<l.length;t++)l[t].to<e&&(e=l[t].to);e<f&&(a=u.cut(e-o),u=u.cut(0,e-o),f=e,p=-1)}else for(;s<i.length&&i[s].to<f;)s++;let m=u.isInline&&!u.isLeaf?l.filter(e=>!e.inline):l.slice();r(u,m,t.forChild(o,u),p),o=f}})(this.node,this.innerDeco,(t,o,s)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e,o):t.type.side>=0&&!s&&a.syncToMarks(o==this.node.childCount?i.CU.none:this.node.child(o).marks,n,e,o),a.placeWidget(t,e,r)},(t,i,s,d)=>{let h;a.syncToMarks(t.marks,n,e,d),a.findNodeMatch(t,i,s,d)||l&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(h=a.findIndexWithChild(o.node))>-1&&a.updateNodeAt(t,i,s,h,e)||a.updateNextNode(t,i,s,e,d,r)||a.addNode(t,i,s,e,r),r+=t.nodeSize}),a.syncToMarks([],n,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(s&&this.protectLocalComposition(e,s),function e(t,n,r){let i=t.firstChild,o=!1;for(let s=0;s<n.length;s++){let l=n[s],a=l.dom;if(a.parentNode==t){for(;a!=i;)i=em(i),o=!0;i=i.nextSibling}else o=!0,t.insertBefore(a,i);if(l instanceof er){let n=i?i.previousSibling:t.lastChild;e(l.contentDOM,l.children,r),i=n?n.nextSibling:t.firstChild}}for(;i;)i=em(i),o=!0;o&&r.trackWrites==t&&(r.trackWrites=null)}(this.contentDOM,this.children,e),D&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof r.U3)||n<t||i>t+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(!this.node.inlineContent)return{node:o,pos:-1,text:""};{let e=o.nodeValue,r=function(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),l=o;if(o+=s.nodeSize,!s.isText)continue;let a=s.text;for(;i<e.childCount;){let t=e.child(i++);if(o+=t.nodeSize,!t.isText)break;a+=t.text}if(o>=n){if(o>=r&&a.slice(r-t.length-l,r-l)==t)return r-t.length;let e=l<r?a.lastIndexOf(t,r-l-1):-1;if(e>=0&&e+t.length+l>=n)return l+e;if(n==r&&a.length>=r+t.length-l&&a.slice(r-l,r-l+t.length)==t)return r}}return -1}(this.node.content,e,n-t,i-t);return r<0?null:{node:o,pos:r,text:e}}}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=eu(this.dom,this.nodeDOM,ec(this.outerDeco,this.node,t),ec(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function eo(e,t,n,r,i){ep(r,t,e);let o=new ei(void 0,e,t,n,r,r,r);return o.contentDOM&&o.updateChildren(i,0),o}class es extends ei{constructor(e,t,n,r,i,o){super(e,t,n,r,i,null,o)}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)}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){super(e,t,n,r,i,o,s),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 ed=function(e){e&&(this.nodeName=e)};ed.prototype=Object.create(null);let eh=[new ed];function ec(e,t,n){if(0==e.length)return eh;let r=n?eh[0]:new ed,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s)for(let e in s.nodeName&&i.push(r=new ed(s.nodeName)),s){let o=s[e];null!=o&&(n&&1==i.length&&i.push(r=new ed(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+o:"style"==e?r.style=(r.style?r.style+";":"")+o:"nodeName"!=e&&(r[e]=o))}}return i}function eu(e,t,n,r){if(n==eh&&r==eh)return t;let i=t;for(let t=0;t<r.length;t++){let o=r[t],s=n[t];if(t){let t;s&&s.nodeName==o.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==o.nodeName||((t=document.createElement(o.nodeName)).pmIsDeco=!0,t.appendChild(i),s=eh[0]),i=t}!function(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);
88if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}(i,s||eh[0],o)}return i}function ep(e,t,n){return eu(e,e,eh,ec(t,n,1!=e.nodeType))}function ef(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function em(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class eg{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];r:for(;i>0;){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 r;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<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&!1!==e[i].type.spec.spanning;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let i=-1,s=this.top.children.length;r<this.preMatch.index&&(s=Math.min(this.index+3,s));for(let t=this.index;t<s;t++){let n=this.top.children[t];if(n.matchesMark(e[o])&&!this.isLocked(n.dom)){i=t;break}}if(i<0&&this.index<this.top.children.length){let t=this.top.children[this.index];t instanceof er&&3!=t.dirty&&t.mark.type==e[o].type&&t.spec.update&&!this.isLocked(t.dom)&&t.spec.update(e[o])&&(t.mark=e[o],i=this.index,this.changed=!0)}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=er.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,r){let i=-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<o;r++){let o=this.top.children[r];if(o.matchesNode(e,t,n)&&!this.preMatch.matched.has(o)){i=r;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let o=this.top.children[r];return 3==o.dirty&&o.dom==o.contentDOM&&(o.dirty=2),!!o.update(e,t,n,i)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return -1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return -1}e=t}}updateNextNode(e,t,n,r,i,o){for(let s=this.index;s<this.top.children.length;s++){let l=this.top.children[s];if(l instanceof ei){let a=this.preMatch.matched.get(l);if(null!=a&&a!=i)return!1;let d=l.dom,h,c=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&3!=l.dirty&&ef(t,l.outerDeco));if(!c&&l.update(e,t,n,r))return this.destroyBetween(this.index,s),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!c&&(h=this.recreateWrapper(l,e,t,n,r,o)))return this.destroyBetween(this.index,s),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=2,h.updateChildren(r,o+1),h.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!ef(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let s=ei.create(this.top,t,n,r,i,o);if(s.contentDOM)for(let t of(s.children=e.children,e.children=[],s.children))t.parent=s;return e.destroy(),s}addNode(e,t,n,r,i){let o=ei.create(this.top,e,t,n,r,i);o.contentDOM&&o.updateChildren(r,i+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new et(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof er;)e=(t=e).children[t.children.length-1];(!e||!(e instanceof es)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((A||E)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new el(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}
88isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function ey(e,t){return e.type.side-t.type.side}function ev(e,t,n,r,i){let o=[];for(let s=0,l=0;s<e.length;s++){let a=e[s],d=l,h=l+=a.size;d>=n||h<=t?o.push(a):(d<t&&o.push(a.slice(0,t-d,r)),i&&(o.push(i),i=void 0),h>n&&o.push(a.slice(n-d,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 d=i.resolve(a),h,c;if(g(n)){for(h=a;o&&!o.node;)o=o.parent;let e=o.node;if(o&&e.isAtom&&r.nh.isSelectable(e)&&o.parent&&!(e.isInline&&function(e,t,n){for(let r=0==t,i=t==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;c=new r.nh(a==e?d:i.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=a,r=a;for(let i=0;i<n.rangeCount;i++){let o=n.getRangeAt(i);t=Math.min(t,e.docView.posFromDOM(o.startContainer,o.startOffset,1)),r=Math.max(r,e.docView.posFromDOM(o.endContainer,o.endOffset,-1))}if(t<0)return null;[h,a]=r==e.state.selection.anchor?[r,t]:[t,r],d=i.resolve(a)}else h=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(h<0)return null}let u=i.resolve(h);if(!c){let n="pointer"==t||e.state.selection.head<d.pos&&!l?1:-1;c=eE(e,u,d,n)}return c}function ew(e){return e.editable?e.hasFocus():eA(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function ek(e,t=!1){let n=e.state.selection;if(eO(e,n),!ew(e))return;let i=e.input.mouseDown;if(!t&&E&&i){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&c(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&i.delaySelUpdate())return void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r="IMG"==n.nodeName;r?t.collapse(n.parentNode,s(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&M&&C<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{var o;let i,s,l,a,{anchor:d,head:h}=n,c,u;ex&&!(n instanceof r.U3)&&(n.$from.parent.inlineContent||(c=eS(e,n.from)),n.empty||n.$from.parent.inlineContent||(u=eS(e,n.to))),e.docView.setSelection(d,h,e,t),ex&&(c&&eC(c),u&&eC(u)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((i=(o=e).dom.ownerDocument).removeEventListener("selectionchange",o.input.hideSelectionGuard),l=(s=o.domSelectionRange()).anchorNode,a=s.anchorOffset,i.addEventListener("selectionchange",o.input.hideSelectionGuard=()=>
88{(s.anchorNode!=l||s.anchorOffset!=a)&&(i.removeEventListener("selectionchange",o.input.hideSelectionGuard),setTimeout(()=>{(!ew(o)||o.state.selection.visible)&&o.dom.classList.remove("ProseMirror-hideselection")},20))})))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}let ex=A||E&&N<63;function eS(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(A&&i&&"false"==i.contentEditable)return eM(i);if((!i||"false"==i.contentEditable)&&(!o||"false"==o.contentEditable)){if(i)return eM(i);else if(o)return eM(o)}}function eM(e){return e.contentEditable="true",A&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function eC(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function eO(e,t){if(t instanceof r.nh){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(eT(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else eT(e)}function eT(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function eE(e,t,n,i){return e.someProp("createSelectionBetween",r=>r(e,t,n))||r.U3.between(t,n,i)}function eN(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.LN.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.U3){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.U3(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.nh&&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.nh.isSelectable(o)?eR(e,new r.nh(t<0?e.state.doc.resolve(n.pos-o.nodeSize):n)):!!P&&eR(e,new r.U3(e.state.doc.resolve(t<0?l:l+o.nodeSize))))}}else{if(i instanceof r.nh&&i.node.isInline)return eR(e,new r.U3(t>0?i.$to:i.$from));let n=eD(e.state,t);return!!n&&eR(e,n)}}function eL(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function eP(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(O&&1==n.nodeType&&r<eL(n)&&eP(n.childNodes[r],-1)&&(l=!0);;)if(r>0)if(1!=n.nodeType)break;else{let e=n.childNodes[r-1];if(eP(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&&eP(t,-1);)i=n.parentNode,o=s(t),t=t.previousSibling;if(t)r=eL(n=t);else{if((n=n.parentNode)==e.dom)break;r=0}}l?eB(e,n,r):i&&eB(e,i,o)}(e):function(e){let t,n,r=e.domSelectionRange(),i=r.focusNode,o=r.focusOffset;if(!i)return;let l=eL(i);for(;;)if(o<l){if(1!=i.nodeType)break;if(eP(i.childNodes[o],1))t=i,n=++o;else break}else if(e$(i))break;else{let r=i.nextSibling;for(;r&&eP(r,1);)t=r.parentNode,n=s(r)+1,r=r.nextSibling;if(r)o=0,l=eL(i=r);else{if((i=i.parentNode)==e.dom)break;o=l=0}}t&&eB(e,t,n)}(e)}function e$(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function eB(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!m(e);)t=s(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!m(e);)t=s(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(g(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&ek(e)},50)}function ej(e,t){let n=e.state.doc.resolve(t);if(!(E||I)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function eH(e,t,n){let i=e.state.selection;if(i instanceof r.U3&&!i.empty||n.indexOf("s")>-1||R&&n.indexOf("m")>-1)return!1;let{$from:o,$to:s}=i;
88if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=eD(e.state,t);if(n&&n instanceof r.nh)return eR(e,n)}if(!o.parent.inlineContent){let n=t<0?o:s,l=i instanceof r.i5?r.LN.near(n,t):r.LN.findFrom(n,t);return!!l&&eR(e,l)}return!1}function eF(e,t){if(!(e.state.selection instanceof r.U3))return!0;let{$head:n,$anchor:i,empty:o}=e.state.selection;if(!n.sameParent(i))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let s=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let r=e.state.tr;return t<0?r.delete(n.pos-s.nodeSize,n.pos):r.delete(n.pos,n.pos+s.nodeSize),e.dispatch(r),!0}return!1}function eV(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function eU(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.ZF.fromSchema(e.state.schema),a=eG(),d=a.createElement("div");d.appendChild(l.serializeFragment(r,{document:a}));let h=d.firstChild,c,u=0;for(;h&&1==h.nodeType&&(c=eY[h.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=a.createElement(c[e]);for(;d.firstChild;)t.appendChild(d.firstChild);d.appendChild(t),u++}h=d.firstChild}return h&&1==h.nodeType&&h.setAttribute("data-pm-slice",`${o} ${s}${u?` -${u}`:""} ${JSON.stringify(n)}`),{dom:d,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function eK(e,t,n,r,o){let s,l,a=o.parent.type.spec.code;if(!n&&!t)return null;let d=!!t&&(r||a||!n);if(d){if(e.someProp("transformPastedText",n=>{t=n(t,a||r,e)}),a)return l=new i.Ji(i.FK.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{l=t(l,e,!0)}),l;let n=e.someProp("clipboardTextParser",n=>n(t,o,r,e));if(n)l=n;else{let n=o.marks(),{schema:r}=e.state,l=i.ZF.fromSchema(r);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=s.appendChild(document.createElement("p"));e&&t.appendChild(l.serializeNode(r.text(e,n)))})}}else e.someProp("transformPastedHTML",t=>{n=t(n,e)}),s=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=eG(),r=n.body,i=/<([a-z][^>\s]+)/i.exec(e),o;if((o=i&&eY[i[1].toLowerCase()])&&(e=o.map(e=>"<"+e+">").join("")+e+o.map(e=>"</"+e+">").reverse().join("")),r.innerHTML=function(e){let t=window.trustedTypes;if(!t)return e;if(!eX){if(eX=t.defaultPolicy)try{return eX.createHTML(e)}catch(e){}eX=t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})}return eX.createHTML(e)}(e),o)for(let e=0;e<o.length;e++)r=r.querySelector(o[e])||r;for(let e=0;e<n.styleSheets.length;e++){let t=n.styleSheets[e];for(let e=0;e<t.rules.length;e++){let n=t.rules[e];if(n instanceof CSSStyleRule){let e=r.querySelectorAll(n.selectorText);for(let t=0;t<e.length;t++)e[t].style.cssText+=n.style.cssText}}}return r}(n),P&&function(e){let t=e.querySelectorAll(E?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(s);let h=s&&s.querySelector("[data-pm-slice]"),c=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let e=+c[3];e>0;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.S4.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(d||c),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||eW.test(e.parentNode.nodeName)?null:{ignore:!0}})),c)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;try{t.checkAttrs(r[e+1])}catch(e){break}o=i.FK.from(t.create(r[e+1],o)),s++,l++}return new i.Ji(o,s,l)}
88(e_(l,+c[1],+c[2]),c[4]);else if((l=i.Ji.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=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<t.length&&s<n.length&&t[s]==n[s]){let l=e(t,n,r,o.lastChild,s+1);if(l)return o.copy(o.content.replaceChild(o.childCount-1,l));if(o.contentMatchAt(o.childCount).matchType(s==t.length-1?r.type:t[s+1]))return o.copy(o.content.append(i.FK.from(eq(r,t,s+1))))}}(t,o,e,s[s.length-1],0))s[s.length-1]=n;else{s.length&&(s[s.length-1]=function e(t,n){if(0==n)return t;let r=t.content.replaceChild(t.childCount-1,e(t.lastChild,n-1)),o=t.contentMatchAt(t.childCount).fillBefore(i.FK.empty,!0);return t.copy(r.append(o))}(s[s.length-1],o.length));let n=eq(e,t);s.push(n),r=r.matchType(n.type),o=t}}),s)return i.FK.from(s)}return e}(l.content,o),!0)).openStart||l.openEnd){let e=0,t=0;for(let t=l.content.firstChild;e<l.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=l.content.lastChild;t<l.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);l=e_(l,e,t)}return e.someProp("transformPasted",t=>{l=t(l,e,d)}),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 eq(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,i.FK.from(e));return e}function eJ(e,t,n,r,o,s){let l=t<0?e.firstChild:e.lastChild,a=l.content;return e.childCount>1&&(s=0),o<r-1&&(a=eJ(a,t,n,r,o+1,s)),o>=n&&(a=t<0?l.contentMatchAt(0).fillBefore(a,s<=o).append(a):a.append(l.contentMatchAt(l.childCount).fillBefore(i.FK.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,l.copy(a))}function e_(e,t,n){return t<e.openStart&&(e=new i.Ji(eJ(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new i.Ji(eJ(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}let eY={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function eG(){return document.implementation.createHTMLDocument("title")}let eX=null,eZ={},eQ={},e0={touchstart:!0,touchmove:!0};class e1{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function e2(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function e3(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>e4(e,t))})}function e4(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)})}function e5(e){return{left:e.clientX,top:e.clientY}}function e6(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 e8(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function e9(e,t,n){let i=e.state.doc;if(-1==t)return i.inlineContent?r.U3.create(i,0,i.content.size):null;let o=i.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e),s=o.before(e);if(t.inlineContent)return r.U3.create(i,s+1,s+1+t.content.size);if(n&&r.nh.isSelectable(t))return r.nh.create(i,s)}return null}eQ.keydown=(e,t)=>{if((e.input.shiftKey=16==t.keyCode||t.shiftKey,!tr(e))&&(e.input.lastKeyCode=t.keyCode,e.input.lastKeyCodeTime=Date.now(),!L||!E||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&&
88(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"==ej(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"==ej(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;eV(e,n,"true"),setTimeout(()=>eV(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():e2(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)}},eQ.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},eQ.keypress=(e,t)=>{if(tr(e)||!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.U3)||!n.$from.sameParent(n.$to)){let r=String.fromCharCode(t.charCode),i=()=>e.state.tr.insertText(r).scrollIntoView();/[\r\n]/.test(r)||e.someProp("handleTextInput",t=>t(e,n.$from.pos,n.$to.pos,r,i))||e.dispatch(i()),t.preventDefault()}};let e7=R?"metaKey":"ctrlKey";eZ.mousedown=(e,t)=>{var n;let i,o;e.input.shiftKey=t.shiftKey;let s=tl(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[e7]&&e.input.lastClick.button==t.button&&("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,button:t.button},e.input.mouseDown&&e.input.mouseDown.done();let d=e.posAtCoords(e5(t));d&&("singleClick"==a?e.input.mouseDown=new tt(e,d,t,!!s):("doubleClick"==a?function(e,t,n,r){return e6(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",n=>n(e,t,r))}:function(e,t,n,i){return e6(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=e9(e,t,!0),o=e.state.doc;return!!i&&(e8(e,i,"pointer"),i instanceof r.U3&&o.eq(e.state.doc)&&(e.input.mouseDown=new tn(e,i)),!0)}(e,n,i)})(e,d.pos,d.inside,t)?t.preventDefault():e2(e,"pointer"))};class te{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){0==e.buttons&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class tt extends te{constructor(e,t,n,i){let o,s;if(super(e),this.pos=t,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[e7],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.nodeDOM.nodeType?a.nodeDOM:null;let{selection:d}=e.state;0==n.button&&(o.type.spec.draggable&&!1!==o.type.spec.selectable||d instanceof r.nh&&d.from<=s&&d.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&O&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e2(e,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||ek(this.view)})}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(e5(e))),this.updateAllowDefault(e),this.allowDefault||!t)e2(this.view,"pointer");else{var n,i,o,s;(n=this.view,i=t.pos,o=t.inside,s=this.selectNode,e6(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.nh&&(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.nh.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}}
88return null!=o&&(e8(e,r.nh.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.nh.isSelectable(i))&&(e8(e,new r.nh(n),"pointer"),!0)}(n,o)))?e.preventDefault():0==e.button&&(this.flushed||A&&this.mightDrag&&!this.mightDrag.node.isAtom||E&&!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)))?(e8(this.view,r.LN.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):e2(this.view,"pointer")}}move(e){this.updateAllowDefault(e),e2(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return!!this.allowDefault&&(this.delayedSelectionSync=!0,!0)}}class tn extends te{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(0==e.buttons||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc))return void this.done();e.preventDefault(),e2(this.view,"pointer");let t=this.view.posAtCoords(e5(e)),n=t&&e9(this.view,t.inside,!1);if(!n)return;let{doc:i}=this.view.state,o=this.startSelection,[s,l]=n.from<o.from?[o.to,n.from]:[o.from,n.to];e8(this.view,r.U3.create(i,s,l),"pointer")}}function tr(e,t){return!!e.composing||!!(A&&500>Math.abs(Date.now()-e.input.compositionEndedAt))&&(e.input.compositionEndedAt=-2e8,!0)}eZ.touchstart=e=>{e.input.lastTouch=Date.now(),tl(e),e2(e,"pointer")},eZ.touchmove=e=>{e.input.lastTouch=Date.now(),e2(e,"pointer")},eZ.contextmenu=e=>tl(e);let ti=L?5e3:-1;function to(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>tl(e),t))}function ts(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function tl(e,t=!1){if(!L||!(e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),ts(e),t||e.docView&&e.docView.dirty){let n=eb(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}eQ.compositionstart=eQ.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof r.U3&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||E&&I&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||1!=t.nodeType||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return 1==r.nodeType&&"false"==r.contentEditable}(e)))e.markCursor=e.state.storedMarks||n.marks(),tl(e,!0),e.markCursor=null;else if(tl(e,!t.selection.empty),O&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}to(e,ti)},eQ.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,to(e,20))};let ta=M&&C<15||D&&z<604;function td(e,t,n,r,o){let s=eK(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,o,s||i.Ji.empty)))return!0;if(!s)return!1;let l=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 th(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;
88let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}eZ.copy=eQ.cut=(e,t)=>{let n=e.state.selection,r="cut"==t.type;if(n.empty)return;let i=ta?null:t.clipboardData,{dom:o,text:s}=eU(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"))},eQ.paste=(e,t)=>{if(e.composing&&!L)return;let n=ta?null:t.clipboardData,r=e.input.shiftKey&&45!=e.input.lastKeyCode;n&&td(e,th(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?td(e,r.value,null,i,t):td(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 tu=R?"altKey":"ctrlKey";function tp(e,t){let n;return e.someProp("dragCopies",e=>{n=n||e(t)}),null!=n?!n:!t[tu]}for(let e in eZ.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(e5(t));if(s&&s.pos>=o.from&&s.pos<=(o instanceof r.nh?o.to-1:o.to));else if(i&&i.mightDrag)n=r.nh.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.nh.create(e.state.doc,i.posBefore))}let l=(n||e.state.selection).content(),{dom:a,text:d,slice:h}=eU(e,l);t.dataTransfer.files.length&&E&&!(N>120)||t.dataTransfer.clearData(),t.dataTransfer.setData(ta?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",ta||t.dataTransfer.setData("text/plain",d),e.dragging=new tc(h,tp(e,t),n)},eZ.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},eQ.dragover=eQ.dragenter=(e,t)=>t.preventDefault(),eQ.drop=(e,t)=>{try{!function(e,t,n){if(!t.dataTransfer)return;let s=e.posAtCoords(e5(t));if(!s)return;let l=e.state.doc.resolve(s.pos),a=n&&n.slice;a?e.someProp("transformPasted",t=>{a=t(a,e,!1)}):a=eK(e,th(t.dataTransfer),ta?null:t.dataTransfer.getData("text/html"),!1,l);let d=!!(n&&tp(e,t));if(e.someProp("handleDrop",n=>n(e,t,a||i.Ji.empty,d)))return t.preventDefault();if(!a)return;t.preventDefault();let h=a?(0,o.Um)(e.state.doc,l.pos,a):l.pos;null==h&&(h=l.pos);let c=e.state.tr;if(d){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let u=c.mapping.map(h),p=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,f=c.doc;if(p?c.replaceRangeWith(u,u,a.content.firstChild):c.replaceRange(u,u,a),c.doc.eq(f))return;let m=c.doc.resolve(u);if(p&&r.nh.isSelectable(a.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new r.nh(m));else{let t=c.mapping.map(h);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(eE(e,m,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))}(e,t,e.dragging)}finally{e.dragging=null}},eZ.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())&&ek(e)},20))},eZ.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)},eZ.beforeinput=(e,t)=>{if(L&&"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)}},eQ)eZ[e]=eQ[e];function tf(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 tm{constructor(e,t){this.toDOM=e,this.spec=t||tw,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);
vendor: 4,960 bytes, line 88
88return o?null:new tv(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof tm&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&tf(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class tg{constructor(e,t){this.attrs=e,this.spec=t||tw}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 tv(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof tg&&tf(this.attrs,e.attrs)&&tf(this.spec,e.spec)}static is(e){return e.type instanceof tg}destroy(){}}class ty{constructor(e,t){this.attrs=e,this.spec=t||tw}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new tv(i.pos-n,o.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(e){return this==e||e instanceof ty&&tf(this.attrs,e.attrs)&&tf(this.spec,e.spec)}destroy(){}}class tv{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new tv(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new tv(e,e,new tm(t,n))}static inline(e,t,n,r){return new tv(e,t,new tg(n,r))}static node(e,t,n,r){return new tv(e,t,new ty(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof tg}get widget(){return this.type instanceof tm}}let tb=[],tw={};class tk{constructor(e,t){this.local=e.length?e:tb,this.children=t.length?t:tb}static create(e,t){return t.length?tT(t,e,0,tw):tx}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==tx||0==e.maps.length?this:this.mapInner(e,t,0,0,n||tw)}mapInner(e,t,n,r,i){let o;for(let s=0;s<this.local.length;s++){let l=this.local[s].map(e,n,r);l&&l.type.valid(t,l)?(o||(o=[])).push(l):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,i,o,s){let l=e.slice();for(let e=0,t=o;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,o)=>{let s=o-i-(n-e);for(let i=0;i<l.length;i+=3){let o=l[i+1];if(o<0||e>o+t-r)continue;let a=l[i]+t-r;n>=a?l[i+1]=e<=a?-2:-1:e>=t&&s&&(l[i]+=s,l[i+1]+=s)}r+=s}),t=n.maps[e].map(t,-1)}let a=!1;for(let t=0;t<l.length;t+=3)if(l[t+1]<0){if(-2==l[t+1]){a=!0,l[t+1]=-1;continue}let d=n.map(e[t]+o),h=d-i;if(h<0||h>=r.content.size){a=!0;continue}let c=n.map(e[t+1]+o,-1)-i,{index:u,offset:p}=r.content.findIndex(h),f=r.maybeChild(u);if(f&&p==h&&p+f.nodeSize==c){let r=l[t+2].mapInner(n,f,d+1,e[t]+o+1,s);r!=tx?(l[t]=h,l[t+1]=c,l[t+2]=r):(l[t+1]=-2,a=!0)}else a=!0}if(a){let a=tT(function(e,t,n,r,i,o,s){for(let l=0;l<e.length;l+=3)-1==e[l+1]&&function e(t,o){for(let e=0;e<t.local.length;e++){let l=t.local[e].map(r,i,o);l?n.push(l):s.onRemove&&s.onRemove(t.local[e].spec)}for(let n=0;n<t.children.length;n+=3)e(t.children[n+2],t.children[n]+o+1)}(e[l+2],t[l]+o+1);return n}(l,e,t,n,i,o,s),r,0,s);t=a.local;for(let e=0;e<l.length;e+=3)l[e+1]<0&&(l.splice(e,3),e-=3);for(let e=0,t=0;e<a.children.length;e+=3){let n=a.children[e];for(;t<l.length&&l[t]<n;)t+=3;l.splice(t,0,a.children[e],a.children[e+1],a.children[e+2])}}return new tk(t.sort(tE),l)}(this.children,o||[],e,t,n,r,i):o?new tk(o.sort(tE),tb):tx}add(e,t){return t.length?this==tx?tk.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach((e,o)=>{let s=o+n,l;if(l=tC(t,e,s)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,l,s+1):r.splice(i,0,o,o+e.nodeSize,tT(l,e,s+1,tw)),i+=3}});let o=tM(i?tO(t):t,-n);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new tk(o.length?this.local.concat(o).sort(tE):this.local,r||this.children)}remove(e){return 0==e.length||this==tx?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let i,o=n[r]+t,s=n[r+1]+t;for(let t=0,n;t<e.length;t++)(n=e[t])&&n.from>o&&n.to<s&&(e[t]=null,(i||(i=[])).push(n));if(!i)continue;n==this.children&&(n=this.children.slice());let l=n[r+2].removeInner(i,o+1);l!=tx?n[r+2]=l:(n.splice(r,3),r-=3)}if(r.length){for(let n=0,i;n<e.length;n++)if(i=e[n])for(let e=0;e<r.length;e++)r[e].eq(i,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1))}return n==this.children&&r==this.local?this:r.length||n.length?new tk(r,n):tx}forChild(e,t){let n,r;if(this==tx)return this;if(t.isLeaf)return tk.empty;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let i=e+1,o=i+t.content.size;
vendor: 4,184 bytes, line 88
88for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>i&&t.type instanceof tg){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new tk(r.sort(tE),tb);return n?new tS([e,n]):e}return n||tx}eq(e){if(this==e)return!0;if(!(e instanceof tk)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return tN(this.localsInner(e))}localsInner(e){if(this==tx)return tb;if(e.inlineContent||!this.local.some(tg.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof tg||t.push(this.local[e]);return t}forEachSet(e){e(this)}}tk.empty=new tk([],[]),tk.removeOverlap=tN;let tx=tk.empty;class tS{constructor(e){this.members=e}map(e,t){let n=this.members.map(n=>n.map(e,t,tw));return tS.from(n)}forChild(e,t){if(t.isLeaf)return tk.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=tx&&(i instanceof tS?n=n.concat(i.members):n.push(i))}return tS.from(n)}eq(e){if(!(e instanceof tS)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?tN(n?t:t.sort(tE)):tb}static from(e){switch(e.length){case 0:return tx;case 1:return e[0];default:return new tS(e.every(e=>e instanceof tk)?e:e.reduce((e,t)=>e.concat(t instanceof tk?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function tM(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new tv(i.from+t,i.to+t,i.type))}return n}function tC(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,o;t<e.length;t++)(o=e[t])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),e[t]=null);return i}function tO(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function tT(e,t,n,r){let i=[],o=!1;t.forEach((t,s)=>{let l=tC(e,t,s+n);if(l){o=!0;let e=tT(l,t,n+s+1,r);e!=tx&&i.push(s,s+t.nodeSize,e)}});let s=tM(o?tO(e):e,-n).sort(tE);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||i.length?new tk(s,i):tx}function tE(e,t){return e.from-t.from||e.to-t.to}function tN(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from==r.from){o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),tA(t,i+1,o.copy(r.to,o.to)));continue}o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),tA(t,i,r.copy(o.from,r.to)));break}}return t}function tA(e,t,n){for(;t<e.length&&tE(n,e[t])>0;)t++;e.splice(t,0,n)}function tD(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=tx&&t.push(r)}),e.cursorWrapper&&t.push(tk.create(e.state.doc,[e.cursorWrapper.deco])),tS.from(t)}let tR={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},tI=M&&C<=11;class tL{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 tP{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new tL,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);M&&C<=11&&t.some(e=>
88"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():A&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),tI&&(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,tR)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(eN(this.view)){if(this.suppressingSelectionUpdates)return ek(this.view);if(M&&C<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&c(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)&&eN(t)&&!this.ignoreSelectionChange(i),s=-1,l=-1,a=!1,d=[];if(t.editable)for(let e=0;e<n.length;e++){let t=this.registerMutation(n[e],d);t&&(s=s<0?t.from:Math.min(t.from,s),l=l<0?t.to:Math.max(t.to,l),t.typeOver&&(a=!0))}if(d.some(e=>"BR"==e.nodeName)&&(8==t.input.lastKeyCode||46==t.input.lastKeyCode||E&&(t.composing||t.input.compositionEndedAt>Date.now()-50)&&n.some(e=>"childList"==e.type&&e.removedNodes.length))){for(let e of d)if("BR"==e.nodeName&&e.parentNode){let t=e.nextSibling;for(;t&&1==t.nodeType;){if("false"==t.contentEditable){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(O&&d.length){let e=d.filter(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 h=null;s<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&g(i)&&(h=eb(t))&&h.eq(r.LN.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,ek(t),this.currentSelection.set(i),t.scrollToSelection()):(s>-1||o)&&(s>-1&&(t.docView.markDirty(s,l),e=t,!tz.has(e)&&(tz.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))&&(e.requiresGeckoHackNode=O,t$||(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."),t$=!0))),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,function(e,t){var n;let{focusNode:r,focusOffset:i}=e.domSelectionRange();for(let o of t)if((null==(n=o.parentNode)?void 0:n.nodeName)=="TR"){let t=o.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||1!=e.nodeType||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e}n.insertBefore(o,n.firstChild),r==o&&e.domSelection().collapse(o,i)}else o.parentNode.removeChild(o)}}(t,d)),this.handleDOMChange(s,l,a,d),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(i)||ek(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"))||
vendor: 2,693 bytes, line 88
88!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),3==r.nodeType&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(M&&C<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||0>Array.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 tz=new WeakMap,t$=!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 c(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}let tj=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function tH(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:eE(e,t.resolve(n.anchor),t.resolve(n.head))}function tF(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}class tV{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 e1,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=tW(this),tK(this),this.nodeViews=tq(this),this.docView=eo(this.state.doc,tU(this),tD(this),this.dom,this),this.domObserver=new tP(this,(e,t,n,o)=>(function(e,t,n,o,s){let l,a,d,h=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);
88if(n&&!e.state.selection.eq(n)){if(E&&L&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,y(13,"Enter"))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),h&&r.setMeta("composition",h),e.dispatch(r)}return}let c=e.state.doc.resolve(t),u=c.sharedDepth(n);t=c.before(u+1),n=e.state.doc.resolve(n).after(u+1);let p=e.state.selection,f=function(e,t,n,r){let o,s,{node:l,fromOffset:a,toOffset:d,from:h,to:c}=e.docView.parseRange(t,n),u=e.domSelectionRange(),p=u.anchorNode;if(p&&e.dom.contains(1==p.nodeType?p:p.parentNode)&&(s=[{node:p,offset:u.anchorOffset}],g(u)||s.push({node:u.focusNode,offset:u.focusOffset})),E&&8===e.input.lastKeyCode)for(let e=d;e>a;e--){let t=l.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){d=e;break}if(!n||n.size)break}let f=e.state.doc,m=e.someProp("domParser")||i.S4.fromSchema(e.state.schema),y=f.resolve(h),v=null,b=m.parse(l,{topNode:y.parent,topMatch:y.parent.contentMatchAt(y.index()),topOpen:!0,from:a,to:d,preserveWhitespace:"pre"!=y.parent.type.whitespace||"full",findPositions:s,ruleFromNode:(o=r,e=>{let t=e.pmViewDesc;if(t)return t.parseRule(o);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}),context:y});if(s&&null!=s[0].pos){let e=s[0].pos,t=s[1]&&s[1].pos;null==t&&(t=e),v={anchor:e+h,head:t+h}}return{doc:b,sel:v,from:h,to:c}}(e,t,n,s),m=e.state.doc,v=m.slice(f.from,f.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(l=e.state.selection.to,a="end"):(l=e.state.selection.from,a="start"),e.input.lastKeyCode=null;let b=function(e,t,n,r,i){let o=e.findDiffStart(t,n),s=n+e.size,l=n+t.size;if(null==o)return null;let{a:a,b:d}=e.findDiffEnd(t,s,l);if("end"==i){let e=Math.max(0,o-Math.min(a,d));r-=a+e-o}if(a<o&&s<l){let e=r<=o&&r>=a?o-r:0;o-=e,d=o+(d-a),a=o}else if(d<o){let e=r<=o&&r>=d?o-r:0;o-=e,a=o+(a-d),d=o}return{start:o,endA:a,endB:d}}(v.content,f.doc.content,f.from,l,a);if(b&&e.input.domChangeCount++,(D&&e.input.lastIOSEnter>Date.now()-225||L)&&s.some(e=>1==e.nodeType&&!tj.test(e.nodeName))&&(!b||b.endA>=b.endB)&&e.someProp("handleKeyDown",t=>t(e,y(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!b)if(o&&p instanceof r.U3&&!p.empty&&p.$head.sameParent(p.$anchor)&&!e.composing&&!(f.sel&&f.sel.anchor!=f.sel.head))b={start:p.from,endA:p.to,endB:p.to};else{if(f.sel){let t=tH(e,e.state.doc,f.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);h&&n.setMeta("composition",h),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&b.start==b.endB&&e.state.selection instanceof r.U3&&(b.start>e.state.selection.from&&b.start<=e.state.selection.from+2&&e.state.selection.from>=f.from?b.start=e.state.selection.from:b.endA<e.state.selection.to&&b.endA>=e.state.selection.to-2&&e.state.selection.to<=f.to&&(b.endB+=e.state.selection.to-b.endA,b.endA=e.state.selection.to)),M&&C<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>f.from&&"  "==f.doc.textBetween(b.start-f.from-1,b.start-f.from+1)&&(b.start--,b.endA--,b.endB--);let w=f.doc.resolveNoCache(b.start-f.from),k=f.doc.resolveNoCache(b.endB-f.from),x=m.resolve(b.start),S=w.sameParent(k)&&w.parent.inlineContent&&x.end()>=b.endA;if((D&&e.input.lastIOSEnter>Date.now()-225&&(!S||s.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!S&&w.pos<f.doc.content.size&&(!w.sameParent(k)||!w.parent.inlineContent)&&w.pos<k.pos&&!/\S/.test(f.doc.textBetween(w.pos,k.pos,"","")))&&e.someProp("handleKeyDown",t=>t(e,y(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>b.start&&function(e,t,n,r,i){if(n-t<=i.pos-r.pos||tF(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(!r.parent.isTextblock){let e=o.nodeAfter;return null!=e&&n==t+e.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(tF(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||tF(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(m,b.start,b.endA,w,k)&&e.someProp("handleKeyDown",t=>t(e,y(8,"Backspace")))){L&&E&&e.domObserver.suppressSelectionUpdates();return}
88E&&b.endB==b.start&&(e.input.lastChromeDelete=Date.now()),L&&!S&&w.start()!=k.start()&&0==k.parentOffset&&w.depth==k.depth&&f.sel&&f.sel.anchor==f.sel.head&&f.sel.head==b.endA&&(b.endB-=2,k=f.doc.resolveNoCache(b.endB-f.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,y(13,"Enter"))})},20));let O=b.start,T=b.endA,N=t=>{let n=t||e.state.tr.replace(O,T,f.doc.slice(b.start-f.from,b.endB-f.from));if(f.sel){let t=tH(e,n.doc,f.sel);t&&!(E&&e.composing&&t.empty&&(b.start!=b.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==O||t.head==n.mapping.map(T)-1)||M&&t.empty&&t.head==O)&&n.setSelection(t)}return h&&n.setMeta("composition",h),n.scrollIntoView()};if(S)if(w.pos==k.pos){M&&C<=11&&0==w.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>ek(e),20));let t=N(e.state.tr.delete(O,T)),n=m.resolve(b.start).marksAcross(m.resolve(b.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(b.endA==b.endB&&(d=function(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,o=n,s=r,l,a,d;for(let e=0;e<r.length;e++)o=r[e].removeFromSet(o);for(let e=0;e<n.length;e++)s=n[e].removeFromSet(s);if(1==o.length&&0==s.length)a=o[0],l="add",d=e=>e.mark(a.addToSet(e.marks));else{if(0!=o.length||1!=s.length)return null;a=s[0],l="remove",d=e=>e.mark(a.removeFromSet(e.marks))}let h=[];for(let e=0;e<t.childCount;e++)h.push(d(t.child(e)));if(i.FK.from(h).eq(e))return{mark:a,type:l}}(w.parent.content.cut(w.parentOffset,k.parentOffset),x.parent.content.cut(x.parentOffset,b.endA-x.start())))){let t=N(e.state.tr);"add"==d.type?t.addMark(O,T,d.mark):t.removeMark(O,T,d.mark),e.dispatch(t)}else if(w.parent.child(w.index()).isText&&w.index()==k.index()-!k.textOffset){let t=w.parent.textBetween(w.parentOffset,k.parentOffset),n=()=>N(e.state.tr.insertText(t,O,T));e.someProp("handleTextInput",r=>r(e,O,T,t,n))||e.dispatch(n())}else e.dispatch(N());else e.dispatch(N())})(this,e,t,n,o)),this.domObserver.start();var n=this;for(let e in eZ){let t=eZ[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=e=>{!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)||e4(n,e)||!n.editable&&e.type in eQ||t(n,e)},e0[e]?{passive:!0}:void 0)}A&&n.dom.addEventListener("input",()=>null),e3(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&&e3(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&&(ts(this),a=!0),this.state=e;let d=o.plugins!=e.plugins||this._props.plugins!=t.plugins;if(d||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=tq(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)}(d||t.handleDOMEvents!=this._props.handleDOMEvents)&&e3(this),this.editable=tW(this),tK(this);let h=tD(this),u=tU(this),p=o.plugins==e.plugins||o.doc.eq(e.doc)?e.scrollToSelection>o.scrollToSelection?"to selection":"preserve":"reset",g=l||!this.docView.matchesNode(e.doc,u,h);(g||!e.selection.eq(o.selection))&&(a=!0);let y="preserve"==p&&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<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(o,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let l=r.getBoundingClientRect();if(l.top>=i-20){t=r,n=l.top;break}}return{refDOM:t,refTop:n,stack:j(e.dom)}}(this);if(a){let t,n,a;this.domObserver.stop();let d=g&&(M||E)&&!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=E?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&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||m(e))return null;t=s(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);
88if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}(this)),(l||!this.docView.update(e.doc,u,h,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=eo(e.doc,u,h,this.dom,this)),!t||this.trackWrites&&this.dom.contains(this.trackWrites)||(d=!0)}let p=this.input.mouseDown;d||!(p&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(t=this.docView.domFromPos(this.state.selection.anchor,0),n=this.domSelectionRange(),c(t.node,t.offset,n.anchorNode,n.anchorOffset))&&p.delaySelUpdate())?ek(this,d):(eO(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),(null==(n=this.dragging)?void 0:n.node)&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),"reset"==p?this.dom.scrollTop=0:"to selection"==p?this.scrollToSelection():y&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;H(n,0==r?0:r-t)}(y)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof r.nh){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&B(this,t.getBoundingClientRect(),e)}else B(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(e,t){let n=e.node,i=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)i=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(i=e)}this.dragging=new tc(e.slice,e.move,i<0?void 0:r.nh.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;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(null!=i&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let o=i[n].props[e];if(null!=o&&(r=t?t(o):o))return r}}hasFocus(){if(M){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(F)return e.focus(F);let t=j(e);e.focus(null==F?{get preventScroll(){return F={preventScroll:!0},!0}}:void 0),F||(F=!1,H(t,0))}(this.dom),ek(this),this.domObserver.start()}get root(){let e=this._root;if(null==e){for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return function(e,t){var n;let r,i,o=e.dom.ownerDocument,s,a=0,h=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);h&&({node:s,offset:a}=h);let c=(e.root.elementFromPoint?e.root:o).elementFromPoint(t.left,t.top);if(!c||!e.dom.contains(1!=c.nodeType?c.parentNode:c)){let n=e.dom.getBoundingClientRect();if(!V(t,n)||!(c=function e(t,n,r){let i=t.childNodes.length;if(i&&r.top<r.bottom)for(let o=Math.max(0,Math.min(i-1,Math.floor(i*(n.top-r.top)/(r.bottom-r.top))-2)),s=o;;){let r=t.childNodes[s];if(1==r.nodeType){let t=r.getClientRects();for(let i=0;i<t.length;i++){let o=t[i];if(V(n,o))return e(r,n,o)}}if((s=(s+1)%i)==o)break}return t}(e.dom,t,n)))return null}if(A)for(let e=c;s&&e;e=l(e))e.draggable&&(s=void 0);if(c=(r=(n=c).parentNode)&&/^li$/i.test(r.nodeName)&&t.left<n.getBoundingClientRect().left?r:n,s){let n;if(O&&1==s.nodeType&&(a=Math.min(a,s.childNodes.length))<s.childNodes.length){let e=s.childNodes[a],n;"IMG"==e.nodeName&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&a++}
88P&&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&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!o&&s.left>r.left||s.top>r.top?i=t.posBefore:(!o&&s.right<r.left||s.bottom<r.top)&&(i=t.posAfter),o=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(s.top+s.bottom)/2:r.left<(s.left+s.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-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,h=n.top,c=n.top;for(let e=t.firstChild,u=0;e;e=e.nextSibling,u++){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=d(e).getClientRects()}for(let d=0;d<t.length;d++){let p=t[d];if(p.top<=h&&p.bottom>=c){h=Math.max(p.bottom,h),c=Math.min(p.top,c);let t=p.left>n.left?p.left-n.left:p.right<n.left?n.left-p.right:0;if(t<s){o=e,s=t,l=t&&3==o.nodeType?{left:p.right<n.left?p.right:p.left,top:n.top}:n,1==e.nodeType&&t&&(a=u+ +(n.left>=(p.left+p.right)/2));continue}}else p.top>n.top&&!r&&p.left<=n.left&&p.right>=n.left&&(r=e,i={left:Math.max(p.left,Math.min(p.right,n.left)),top:p.top});!o&&(n.left>=p.right&&n.top>=p.top||n.left>=p.left&&n.top>=p.bottom)&&(a=u+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(),i;for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let n=K(r,1);if(n.top!=n.bottom&&V(t,n)){i={node:e,offset:o+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{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,c,t));let u=e.docView.nearestDesc(c,!0);return{pos:i,inside:u?u.posAtStart-u.border:-1}}(this,e)}coordsAtPos(e,t=1){return q(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 X==t&&Z==n?Q:(X=t,Z=n,Q="up"==n||"down"==n?(r=t.selection,i="up"==n?r.$from:r.$to,Y(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=q(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=d(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>(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?G.test(r.parent.textContent)&&s.modify?Y(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:o,anchorOffset:l}=e.domSelectionRange(),a=s.caretBidiLevel;s.modify("move",n,"character");let d=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:h,focusOffset:c}=e.domSelectionRange(),u=h&&!d.contains(1==h.nodeType?h:h.parentNode)||t==h&&i==c;try{s.collapse(o,l),t&&(t!=o||i!=l)&&s.extend&&s.extend(t,i)}catch(e){}return null!=a&&(s.caretBidiLevel=a),u}):"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 td(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return td(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return eU(this,e)}destroy(){if(this.docView){for(let e in this.input.mouseDown&&this.input.mouseDown.done(),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,[],tD(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,h()}}get isDestroyed(){return null==this.docView}dispatchEvent(e){!e4(this,e)&&eZ[e.type]&&(this.editable||!(e.type in eQ))&&eZ[e.type](this,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}
88(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function tU(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"),[tv.node(0,e.state.doc.content.size,t)]}function tK(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:tv.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function tW(e){return!e.someProp("editable",t=>!1===t(e.state))}function tq(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")}tV.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))},n.d(t,{Lz:()=>tV,NZ:()=>tv,zF:()=>tk})},wh(e,t,n){n.d(t,{W3:()=>F,Nqh:()=>H,sUD:()=>j,fex:()=>B,lcf:()=>$,Fzf:()=>z,dVq:()=>P,kYU:()=>L,dkH:()=>I,kb3:()=>R,hs0:()=>D,Lmn:()=>A,WQV:()=>N,ug4:()=>E,uXv:()=>T,GPF:()=>C,sDI:()=>O,mz3:()=>S,ZN1:()=>M,I4m:()=>x,UyR:()=>k,O$U:()=>w,qW5:()=>b,vAB:()=>v,M$0:()=>y,FkO:()=>g,jmL:()=>m,wsv:()=>f,Wvp:()=>p,oci:()=>u});var r=n("dx"),i={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},o=r.createContext&&r.createContext(i),s=["attr","size","title"];function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e){return t=>r.createElement(c,l({attr:d({},e.attr)},t),function e(t){return t&&t.map((t,n)=>r.createElement(t.tag,d({key:n},t.attr),e(t.child)))}(e.child))}function c(e){var t=t=>{var n,{attr:i,size:o,title:a}=e,h=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&({}).propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,s),c=o||t.size||"1em";return t.className&&(n=t.className),e.className&&(n=(n?n+" ":"")+e.className),r.createElement("svg",l({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,i,h,{className:n,style:d(d({color:e.color||t.color},t.style),e.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),a&&r.createElement("title",null,a),e.children)};return void 0!==o?r.createElement(o.Consumer,null,e=>t(e)):t(i)}function u(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M6 4v6a6 6 0 0 0 12 0V4"},child:[]},{tag:"line",attr:{x1:"4",x2:"20",y1:"20",y2:"20"},child:[]}]})(e)}function p(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"4 7 4 4 20 4 20 7"},child:[]},{tag:"line",attr:{x1:"9",x2:"15",y1:"20",y2:"20"},child:[]},{tag:"line",attr:{x1:"12",x2:"12",y1:"4",y2:"20"},child:[]}]})(e)}function f(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m4 19 8-8"},child:[]},{tag:"path",attr:{d:"m12 19-8-8"},child:[]},{tag:"path",attr:{d:"M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06"},child:[]}]})(e)}function m(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m4 5 8 8"},child:[]},{tag:"path",attr:{d:"m12 5-8 8"},child:[]},{tag:"path",attr:{d:"M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07"},child:[]}]})(e)}function g(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M16 4H9a3 3 0 0 0-2.83 4"},child:[]},{tag:"path",attr:{d:"M14 12a4 4 0 0 1 0 8H6"},child:[]},{tag:"line",attr:{x1:"4",x2:"20",y1:"12",y2:"12"},child:[]}]})(e)}function y(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 9.5 8 12l2 2.5"},child:[]},{tag:"path",attr:{d:"m14 9.5 2 2.5-2 2.5"},child:[]},{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"3",rx:"2"},child:[]}]})(e)}function v(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"},child:[]},{tag:"path",attr:{d:"M21 3v5h-5"},child:[]}]})(e)}function b(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"},child:[]},{tag:"path",attr:{d:"M3 3v5h5"},child:[]}]})(e)}function w(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z"},child:[]},{tag:"path",attr:{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z"},child:[]}]})(e)}function k(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"},child:[]}]})(e)}function x(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M5 12h14"},child:[]}]})(e)}function S(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3 12h.01"},child:[]},{tag:"path",attr:{d:"M3 18h.01"},child:[]},{tag:"path",attr:{d:"M3 6h.01"},child:[]},{tag:"path",attr:{d:"M8 12h13"}
88,child:[]},{tag:"path",attr:{d:"M8 18h13"},child:[]},{tag:"path",attr:{d:"M8 6h13"},child:[]}]})(e)}function M(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 12h11"},child:[]},{tag:"path",attr:{d:"M10 18h11"},child:[]},{tag:"path",attr:{d:"M10 6h11"},child:[]},{tag:"path",attr:{d:"M4 10h2"},child:[]},{tag:"path",attr:{d:"M4 6h1v4"},child:[]},{tag:"path",attr:{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1"},child:[]}]})(e)}function C(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"},child:[]},{tag:"path",attr:{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"},child:[]}]})(e)}function O(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M9 17H7A5 5 0 0 1 7 7h2"},child:[]},{tag:"path",attr:{d:"M15 7h2a5 5 0 1 1 0 10h-2"},child:[]},{tag:"line",attr:{x1:"8",x2:"16",y1:"12",y2:"12"},child:[]}]})(e)}function T(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"19",x2:"10",y1:"4",y2:"4"},child:[]},{tag:"line",attr:{x1:"14",x2:"5",y1:"20",y2:"20"},child:[]},{tag:"line",attr:{x1:"15",x2:"9",y1:"4",y2:"20"},child:[]}]})(e)}function E(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12H11"},child:[]},{tag:"path",attr:{d:"M21 18H11"},child:[]},{tag:"path",attr:{d:"M21 6H11"},child:[]},{tag:"path",attr:{d:"m3 8 4 4-4 4"},child:[]}]})(e)}function N(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12H11"},child:[]},{tag:"path",attr:{d:"M21 18H11"},child:[]},{tag:"path",attr:{d:"M21 6H11"},child:[]},{tag:"path",attr:{d:"m7 8-4 4 4 4"},child:[]}]})(e)}function A(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"},child:[]},{tag:"circle",attr:{cx:"9",cy:"9",r:"2"},child:[]},{tag:"path",attr:{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"},child:[]}]})(e)}function D(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m9 11-6 6v3h9l3-3"},child:[]},{tag:"path",attr:{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4"},child:[]}]})(e)}function R(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 18V6"},child:[]},{tag:"path",attr:{d:"M17 10v3a1 1 0 0 0 1 1h3"},child:[]},{tag:"path",attr:{d:"M21 10v8"},child:[]},{tag:"path",attr:{d:"M4 12h8"},child:[]},{tag:"path",attr:{d:"M4 18V6"},child:[]}]})(e)}function I(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 12h8"},child:[]},{tag:"path",attr:{d:"M4 18V6"},child:[]},{tag:"path",attr:{d:"M12 18V6"},child:[]},{tag:"path",attr:{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2"},child:[]},{tag:"path",attr:{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2"},child:[]}]})(e)}function L(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 12h8"},child:[]},{tag:"path",attr:{d:"M4 18V6"},child:[]},{tag:"path",attr:{d:"M12 18V6"},child:[]},{tag:"path",attr:{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1"},child:[]}]})(e)}function P(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 12h8"},child:[]},{tag:"path",attr:{d:"M4 18V6"},child:[]},{tag:"path",attr:{d:"M12 18V6"},child:[]},{tag:"path",attr:{d:"m17 12 3-2v8"},child:[]}]})(e)}function z(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"16 18 22 12 16 6"},child:[]},{tag:"polyline",attr:{points:"8 6 2 12 8 18"},child:[]}]})(e)}function $(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8"},child:[]}]})(e)}function B(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12H9"},child:[]},{tag:"path",attr:{d:"M21 18H7"},child:[]},{tag:"path",attr:{d:"M21 6H3"},child:[]}]})(e)}function j(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15 12H3"},child:[]},{tag:"path",attr:{d:"M17 18H3"}
88,child:[]},{tag:"path",attr:{d:"M21 6H3"},child:[]}]})(e)}function H(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3 12h18"},child:[]},{tag:"path",attr:{d:"M3 18h18"},child:[]},{tag:"path",attr:{d:"M3 6h18"},child:[]}]})(e)}function F(e){return h({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M17 12H7"},child:[]},{tag:"path",attr:{d:"M19 18H5"},child:[]},{tag:"path",attr:{d:"M21 6H3"},child:[]}]})(e)}}}]);
89//# sourceMappingURL=a2.f0eda4bb7f.js.map

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