1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5374],{91910:(t,e,n)=>{n.d(e,{A:()=>s});var r=n(95155),i=n(2691);let o=(0,n(97771).n9)({name:{MenuDivider:s}})(t=>({root:{height:18,margin:t.spacing(0,.5)}}));function s(t){let{classes:e,cx:n}=o();return(0,r.jsx)(i.default,{orientation:"vertical",...t,className:n(e.root,t.className)})}},40531:(t,e,n)=>{n.d(e,{A:()=>o});var r=n(95155),i=n(42781);function o({editor:t,children:e}){return(0,r.jsx)(i.G.Provider,{value:t,children:e})}},99160:(t,e,n)=>{n.d(e,{A:()=>M});var r=n(95155),i=n(97771),o=n(88592);let s=(0,o.hD)("FieldContainer",["root","outlined","standard","focused","disabled","notchedOutline"]),l=(0,i.n9)({name:{FieldContainer:a},uniqId:"Os7ZPW"})((t,e,n)=>({root:{},outlined:{borderRadius:t.shape.borderRadius,padding:1,position:"relative",[`&:hover .${n.notchedOutline}`]:{borderColor:t.palette.text.primary},[`&.${n.focused} .${n.notchedOutline}`]:{borderColor:t.palette.primary.main,borderWidth:2},[`&.${n.disabled} .${n.notchedOutline}`]:{borderColor:t.palette.action.disabled}},standard:{},focused:{},disabled:{},notchedOutline:{position:"absolute",inset:0,borderRadius:"inherit",borderColor:"light"===t.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)",borderStyle:"solid",borderWidth:1,pointerEvents:"none",overflow:"hidden",zIndex:o.oi.NOTCHED_OUTLINE}}));function a({variant:t="outlined",children:e,focused:n,disabled:i,classes:o={},className:a}){let{classes:h,cx:c}=l(void 0,{props:{classes:o}});return(0,r.jsxs)("div",{className:c(s.root,h.root,"outlined"===t?[s.outlined,h.outlined]:[s.standard,h.standard],n&&[s.focused,h.focused],i&&[s.disabled,h.disabled],a),children:[e,"outlined"===t&&(0,r.jsx)("div",{className:c(s.notchedOutline,h.notchedOutline),"aria-hidden":!0})]})}var h=n(50823);let c=(0,o.hD)("MenuBar",["root","sticky","nonSticky","content"]),d=(0,i.n9)({name:{MenuBar:p}})((t,{stickyOffset:e})=>({root:{borderBottomColor:t.palette.divider,borderBottomStyle:"solid",borderBottomWidth:1},sticky:{position:"sticky",top:null!=e?e:0,zIndex:o.oi.MENU_BAR,background:t.palette.background.default},nonSticky:{},content:{}}));function p({hide:t,disableSticky:e,stickyOffset:n,children:i,className:o,classes:s}){let{classes:l,cx:a}=d({stickyOffset:n},{props:{classes:s}});return(0,r.jsx)(h.A,{in:!t,unmountOnExit:!0,className:a(c.root,l.root,e?[c.nonSticky,l.nonSticky]:[c.sticky,l.sticky],o),children:(0,r.jsx)("div",{className:l.content,children:i})})}var u=n(17922),f=n(3512),m=n(12115),g=n(42781);let y=(0,o.hD)("RichTextContent",["root","readonly","editable"]),v=(0,i.n9)({name:{RichTextContent:b}})(t=>({root:{"& .ProseMirror":{...(0,o.Ku)(t)}},readonly:{},editable:{}}));function b({className:t,classes:e={}}){let{classes:n,cx:i}=v(void 0,{props:{classes:e}}),o=(0,g.P)(),s=(0,m.useMemo)(()=>i(y.root,t,n.root,(null==o?void 0:o.isEditable)?[y.editable,n.editable]:[y.readonly,n.readonly]),[t,n,i,null==o?void 0:o.isEditable]);return(0,r.jsx)(u.default,{className:s,component:f.$Z,editor:o})}var k=n(70719),x=n.n(k),w=n(74999);let S=(0,o.hD)("RichTextField",["root","standard","outlined","menuBar","menuBarContent","content"]),C=(0,i.n9)({name:{RichTextField:M},uniqId:"E2Alw3"})((t,e,n)=>({root:{},standard:{[`& .${n.content}`]:{padding:t.spacing(1.5,0)},[`& .${n.menuBarContent}`]:{padding:t.spacing(1,0)}},outlined:{[`& .${n.content}`]:{padding:t.spacing(1.5)},[`& .${n.menuBarContent}`]:{padding:t.spacing(1,1.5)}},menuBar:{},menuBarContent:{},content:{}}));function M({variant:t="outlined",controls:e,disableDebounceRenderControls:n=!1,disabled:i,className:o,classes:s={},footer:l,MenuBarProps:h,RichTextContentProps:c}){var d,u;let{classes:f,cx:y}=C(void 0,{props:{classes:s}}),v=function({editor:t,wait:e=250}){let[n,r]=(0,m.useState)(!!(null==t?void 0:t.isFocused)),i=(0,m.useMemo)(()=>x()(t=>{r(t)},e),[e]);return(0,m.useEffect)(()=>{let e=!!(null==t?void 0:t.isFocused);return i(e),e&&i.flush(),()=>{i.cancel()}},[null==t?void 0:t.isFocused,i]),n}({editor:(0,g.P)()});return(0,r.jsxs)(a,{variant:t,focused:!i&&v,disabled:i,className:y(S.root,f.root,"outlined"===t?[S.outlined,f.outlined]:[S.standard,f.standard],o),children:[e&&(0,r.jsx)(p,{...h,classes:{...null==h?void 0:h.classes,root:y(S.menuBar,f.menuBar,null===(d=null==h?void 0:h.classes)||void 0===d?void 0:d.root),content:y(S.content,f.menuBarContent,null===(u=null==h?void 0:h.classes)||void 0===u?void 0:u.content)},children:n?e:(0,r.jsx)(w.A,{children:e})}),(0,r.jsx)(b,{...c,className:y(S.content,f.content,null==c?void 0:c.className)}),l]})}},42781:(t,e,n)=>{n.d(e,{G:()=>i,P:()=>o});var r=n(12115);let i=(0,r.createContext)(void 0);function o(){let t=(0,r.useContext)(i);if(void 0===t)throw Error("Tiptap editor not found in component context. Be sure to use <RichTextEditorProvider editor={editor} />!");return t}},85325:(t,e,n)=>{n.d(e,{A:()=>O});var r=n(95155),i=n(16255),o=n(43847);function s(t){return(0,o.Ay)("MuiToggleButton",t)}let l=(0,i.A)("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]);var a=n(12115),h=n(43463),c=n(57721),d=n(11509),p=n(77707),u=n(67737),f=n(51204),m=n(59596),g=n(2550),y=n(57638),v=n(37033);let b=a.createContext({}),k=a.createContext(void 0),x=t=>{let{classes:e,fullWidth:n,selected:r,disabled:i,size:o,color:l}=t,a={root:["root",r&&"selected",i&&"disabled",n&&"fullWidth","size".concat((0,f.A)(o)),l]};return(0,d.A)(a,s,e)},w=(0,m.Ay)(u.A,{name:"MuiToggleButton",slot:"Root",overridesResolver:(t,e)=>{let{ownerState:n}=t;return[e.root,e["size".concat((0,f.A)(n.size))]]}})((0,g.A)(t=>{let{theme:e}=t;return{...e.typography.button,borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:"1px solid ".concat((e.vars||e).palette.divider),color:(e.vars||e).palette.action.active,["&.".concat(l.disabled)]:{color:(e.vars||e).palette.action.disabled,border:"1px solid ".concat((e.vars||e).palette.action.disabledBackgroun
1d)},"&:hover":{textDecoration:"none",backgroundColor:e.vars?"rgba(".concat(e.vars.palette.text.primaryChannel," / ").concat(e.vars.palette.action.hoverOpacity,")"):(0,p.X4)(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{color:"standard"},style:{["&.".concat(l.selected)]:{color:(e.vars||e).palette.text.primary,backgroundColor:e.vars?"rgba(".concat(e.vars.palette.text.primaryChannel," / ").concat(e.vars.palette.action.selectedOpacity,")"):(0,p.X4)(e.palette.text.primary,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?"rgba(".concat(e.vars.palette.text.primaryChannel," / calc(").concat(e.vars.palette.action.selectedOpacity," + ").concat(e.vars.palette.action.hoverOpacity,"))"):(0,p.X4)(e.palette.text.primary,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?"rgba(".concat(e.vars.palette.text.primaryChannel," / ").concat(e.vars.palette.action.selectedOpacity,")"):(0,p.X4)(e.palette.text.primary,e.palette.action.selectedOpacity)}}}}},...Object.entries(e.palette).filter((0,y.A)()).map(t=>{let[n]=t;return{props:{color:n},style:{["&.".concat(l.selected)]:{color:(e.vars||e).palette[n].main,backgroundColor:e.vars?"rgba(".concat(e.vars.palette[n].mainChannel," / ").concat(e.vars.palette.action.selectedOpacity,")"):(0,p.X4)(e.palette[n].main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?"rgba(".concat(e.vars.palette[n].mainChannel," / calc(").concat(e.vars.palette.action.selectedOpacity," + ").concat(e.vars.palette.action.hoverOpacity,"))"):(0,p.X4)(e.palette[n].main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?"rgba(".concat(e.vars.palette[n].mainChannel," / ").concat(e.vars.palette.action.selectedOpacity,")"):(0,p.X4)(e.palette[n].main,e.palette.action.selectedOpacity)}}}}}}),{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{padding:7,fontSize:e.typography.pxToRem(13)}},{props:{size:"large"},style:{padding:15,fontSize:e.typography.pxToRem(15)}}]}})),S=a.forwardRef(function(t,e){var n;let{value:i,...o}=a.useContext(b),s=a.useContext(k),l=(0,c.A)({...o,selected:(n=t.value,void 0!==i&&void 0!==n&&(Array.isArray(i)?i.includes(n):n===i))},t),d=(0,v.b)({props:l,name:"MuiToggleButton"}),{children:p,className:u,color:f="standard",disabled:m=!1,disableFocusRipple:g=!1,fullWidth:y=!1,onChange:S,onClick:C,selected:M,size:A="medium",value:O,...E}=d,T={...d,color:f,disabled:m,disableFocusRipple:g,fullWidth:y,size:A},N=x(T);return(0,r.jsx)(w,{className:(0,h.A)(o.className,N.root,u,s||""),disabled:m,focusRipple:!g,ref:e,onClick:t=>{C&&(C(t,O),t.defaultPrevented)||!S||S(t,O)},onChange:S,value:O,ownerState:T,"aria-pressed":M,...E,children:p})});var C=n(97771),M=n(14190);let A=(0,C.n9)({name:{MenuButton:O}})({root:{[`&& .${l.root}`]:{border:"none",padding:5}},menuButtonIcon:{fontSize:"1.25rem"}});function O({tooltipLabel:t,tooltipShortcutKeys:e,IconComponent:n,buttonRef:i,children:o,...s}){let{classes:l}=A();return(0,r.jsx)("span",{className:l.root,children:(0,r.jsx)(M.A,{label:t,shortcutKeys:e,children:(0,r.jsx)(S,{ref:i,size:"small",value:t,...s,children:null!=o?o:n&&(0,r.jsx)(n,{className:l.menuButtonIcon})})})})}},1779:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(95155);let i=(0,n(31141).A)((0,r.jsx)("path",{d:"M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"}),"FormatQuote");var o=n(42781),s=n(85325);function l(t){var e;let n=(0,o.P)();return(0,r.jsx)(s.A,{tooltipLabel:"Blockquote",tooltipShortcutKeys:["mod","Shift","B"],IconComponent:i,selected:null!==(e=null==n?void 0:n.isActive("blockquote"))&&void 0!==e&&e,disabled:!(null==n?void 0:n.isEditable)||!n.can().toggleBlockquote(),onClick:()=>null==n?void 0:n.chain().focus().toggleBlockquote().run(),...t})}},65687:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(95155);let i=(0,n(31141).A)((0,r.jsx)("path",{d:"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42M10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5"}),"FormatBold");var o=n(42781),s=n(85325);function l(t){var e;let n=(0,o.P)();return(0,r.jsx)(s.A,{tooltipLabel:"Bold",tooltipShortcutKeys:["mod","B"],IconComponent:i,selected:null!==(e=null==n?void 0:n.isActive("bold"))&&void 0!==e&&e,disabled:!(null==n?void 0:n.isEditable)||!n.can().toggleBold(),onClick:()=>null==n?void 0:n.chain().focus().toggleBold().run(),...t})}},71085:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(95155);let i=(0,n(31141).A)((0,r.jsx)("path",{d:"M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5m0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5m0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5M7 19h14v-2H7zm0-6h14v-2H7zm0-8v2h14V5z"}),"FormatListBulleted");var o=n(42781),s=n(85325);function l(t){var e;let n=(0,o.P)();return(0,r.jsx)(s.A,{tooltipLabel:"Bulleted list",tooltipShortcutKeys:["mod","Shift","8"],IconComponent:i,selected:null!==(e=null==n?void 0:n.isActive("bulletList"))&&void 0!==e&&e,disabled:!(null==n?void 0:n.isEditable)||!n.can().toggleBulletList(),onClick:()=>null==n?void 0:n.chain().focus().toggleBulletList().run(),...t})}},36665:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(95155);let i=(0,n(31141).A)((0,r.jsx)("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"}),"Code");var o=n(42781),s=n(85325);function l(t){var e;let n=(0,o.P)();return(0,r.jsx)(s.A,{tooltipLabel:"Code",tooltipShortcutKeys:["mod","E"],IconComponent:i,selected:null!==(e=null==n?void 0:n.isActive("code"))&&void 0!==e&&e,disabled:!(null==n?void 0:n.isEditable)||!n.can().toggleCode(),onClick:()=>null==n?void 0:n.chain().focus().toggleCode().run(),...t})}},74091:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(95155);let i=(0,n(31141).A)((0,r.jsx)("path",{fillRule:"evenodd",d:"M4 11h16v2H4z"}),"HorizontalRule");var o=n(42781),s=n(85325);function l(t){let e=(0,o.P)();return(0,r.jsx)(s.A,{tooltipLabel:"Insert horizontal line",IconComponent:i,disabled:!(null==e?void 0:e.isEditable)||!e.can().setHorizontalRule(),onClick:()=>null==e?void 0:e.chain().focus().setHorizontalRule().run(),...t})}},4259:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(95155);let i=(0,n(31141).A)((0,r.jsx)("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"}),"FormatItalic");var o=n(42781),s=n(85325);function l(t){var e;let n=(0,o.P)();return(0,r.jsx)(s.A,{tooltipLabel:"Italic",tooltipShortcutKeys:["mod","I"],IconComponent:i,selected:null!==(e=null==n?void 0:n.isActive("italic"))&&void 0!==e&&e,disabled:!(null==n?void 0:n.isEditable)||!n.can().toggleItalic(),onClick:()=>null==n?void 0:n.chain().focus().toggleItalic().run(),...t})}},26574:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(95155);let i=(0,n(31141).A)((0,r.jsx)("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2zm1-9h1V4H2v1h1zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2zm5-6v2h14V5zm0 14h14v-2H7zm0-6h14v-2H7z"}),"FormatListNumbered");var o=n(42781),s=n(85325);function l(t){var e;let n=(0,o.P)();return(0,r.jsx)(s.A,{tooltipLabel:"Ordered list",tooltipShortcutKeys:["mod","Shift","7"],IconComponent:i,selected:null!==(e=null==n?void 0:n.isActive("orderedList"))&&void 0!==e&&e,disabled:!(null==n?void 0:n.isEditable)||!n.can().toggleOrderedList(),onClick:()=>null==n?void 0:n.chain().focus().toggleOrderedList().run(),...t})}},90969:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(95155);let i=(0,n(31141).A)((0,r.jsx)("path",{d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7z"}),"Redo");var o=n(42781),s=n(85325);function l(t){let e=(0,o.P)();return(0,r.jsx)(s.A,{tooltipLabel:"Redo",tooltipShortcutKeys:["mod","Shift","Z"],IconComponent:i,disabled:!(null==e?void 0:e.isEditable)||!e.can().redo(),onClick:()=>null==e?void 0:e.chain().focus().redo().run(),...t})}},58738:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(95155);let i=(0,n(31141).A)((0,r.jsx)("path",{d:"M3.27 5 2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21 18 19.73 3.55 5.27zM6 5v.18L8.82 8h2.4l-.72 1.68 2.1 2.1L14.21 8H20V5z"}),"FormatClear");var o=n(42781),s=n(85325);function l(t){let e=(0,o.P)();return(0,r.jsx)(s.A,{tooltipLabel:"Remove inline formatting",IconComponent:i,disabled:!(null==e?void 0:e.isEditable)||!e.can().unsetAllMarks(),onClick:()=>null==e?void 0:e.chain().focus().unsetAllMarks().run(),...t})}},49946:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(95155);let i=(0,n(31141).A)((0,r.jsx)("path",{d:"M6.85 7.08C6.85 4.37 9.45 3 12.24 3c1.64 0 3 .49 3.9 1.28.77.65 1.46 1.73 1.46 3.24h-3.01c0-.31-.05-.59-.15-.85-.29-.86-1.2-1.28-2.25-1.28-1.86 0-2.34 1.02-2.34 1.7 0 .48.25.88.74 1.21.38.25.77.48 1.41.7H7.39c-.21-.34-.54-.89-.54-1.92M21 12v-2H3v2h9.62c1.15.45 1.96.75 1.96 1.97 0 1-.81 1.67-2.28 1.67-1.54 0-2.93-.54-2.93-2.51H6.4c0 .55.08 1.13.24 1.58.81 2.29 3.29 3.3 5.67 3.3 2.27 0 5.3-.89 5.3-4.05 0-.3-.01-1.16-.48-1.94H21z"}),"StrikethroughS");var o=n(42781),s=n(85325);function l(t){var e;let n=(0,o.P)();
1return(0,r.jsx)(s.A,{tooltipLabel:"Strikethrough",tooltipShortcutKeys:["mod","Shift","S"],IconComponent:i,selected:null!==(e=null==n?void 0:n.isActive("strike"))&&void 0!==e&&e,disabled:!(null==n?void 0:n.isEditable)||!n.can().toggleStrike(),onClick:()=>null==n?void 0:n.chain().focus().toggleStrike().run(),...t})}},14190:(t,e,n)=>{let r;n.d(e,{A:()=>h});var i=n(95155),o=n(77707),s=n(83523),l=n(48699);let a=(0,n(97771).n9)({name:{MenuButtonTooltip:h}})(t=>({titleContainer:{textAlign:"center"},label:{fontSize:t.typography.pxToRem(13)},shortcutKey:{fontSize:t.typography.pxToRem(12),border:`1px solid ${(0,o.X4)(t.palette.text.secondary,.2)}`,backgroundColor:(0,o.X4)(t.palette.background.paper,.3),height:"19px",lineHeight:"19px",padding:"0 4px",minWidth:17,borderRadius:t.shape.borderRadius,display:"inline-block","&:not(:first-of-type)":{marginLeft:1}}}));function h({label:t,shortcutKeys:e,placement:n="top",contentWrapperClassName:o,children:h,...c}){let{classes:d}=a();return(0,i.jsx)(s.default,{title:t||e&&e.length>0?(0,i.jsxs)("div",{className:d.titleContainer,children:[(0,i.jsx)("div",{className:d.label,children:t}),e&&e.length>0&&(0,i.jsx)(l.default,{variant:"body2",component:"div",children:e.map((t,e)=>(0,i.jsx)("span",{className:d.shortcutKey,children:"mod"===t?(void 0===r&&(r=navigator.platform.includes("Mac")),r)?"â":"Ctrl":t},e))})]}):"",placement:n,arrow:!0,...c,children:(0,i.jsx)("span",{className:o,children:h})})}},52667:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(95155);let i=(0,n(31141).A)((0,r.jsx)("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8"}),"Undo");var o=n(42781),s=n(85325);function l(t){let e=(0,o.P)();return(0,r.jsx)(s.A,{tooltipLabel:"Undo",tooltipShortcutKeys:["mod","Z"],IconComponent:i,disabled:!(null==e?void 0:e.isEditable)||!e.can().undo(),onClick:()=>null==e?void 0:e.chain().focus().undo().run(),...t})}},91431:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(95155),i=n(97771),o=n(74999);let s=(0,i.n9)({name:{MenuControlsContainer:l}})(t=>({root:{display:"flex",rowGap:t.spacing(.3),columnGap:t.spacing(.3),alignItems:"center",flexWrap:"wrap"}}));function l({children:t,className:e,debounced:n,DebounceProps:i}){let{classes:l,cx:a}=s(),h=(0,r.jsx)("div",{className:a(l.root,e),children:t});return n?(0,r.jsx)(o.A,{...i,children:h}):h}},66816:(t,e,n)=>{n.d(e,{A:()=>x});var r=n(95155),i=n(83671),o=n(12115),s=n(97771),l=n(42781),a=n(88592),h=n(19346),c=n(14190),d=n(81541),p=n(12377),u=n(5727),f=n(94744);let m=(0,s.n9)({name:{MenuSelect:g}})(t=>({rootTooltipWrapper:{display:"inline-flex"},selectRoot:{[`&:not(:hover):not(.${d.A.focused}) .${d.A.notchedOutline}`]:{borderWidth:0},[`& .${p.A.root}`]:{color:t.palette.action.active},[`&.${u.A.disabled} .${p.A.root}`]:{color:t.palette.action.disabled}},select:{"&&&":{paddingLeft:t.spacing(1),paddingRight:t.spacing(3)}},selectDropdownIcon:{right:1},input:{paddingTop:"3px",paddingBottom:"3px",fontSize:"0.9em"}}));function g({tooltipTitle:t,...e}){var n,i,s;let{classes:l,cx:a}=m(),[h,d]=(0,o.useState)(!1),p=(0,r.jsx)(f.A,{margin:"none",variant:"outlined",size:"small",...e,onMouseEnter:(...t)=>{var n;d(!0),null===(n=e.onMouseEnter)||void 0===n||n.call(e,...t)},onMouseLeave:(...t)=>{var n;d(!1),null===(n=e.onMouseLeave)||void 0===n||n.call(e,...t)},onClick:(...t)=>{var n;d(!1),null===(n=e.onClick)||void 0===n||n.call(e,...t)},onOpen:(...t)=>{var n;d(!1),null===(n=e.onOpen)||void 0===n||n.call(e,...t)},inputProps:{...e.inputProps,className:a(l.input,null===(n=e.inputProps)||void 0===n?void 0:n.className)},MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},...e.MenuProps},className:a(l.selectRoot,e.className),classes:{...e.classes,select:a(l.select,null===(i=e.classes)||void 0===i?void 0:i.select),icon:a(l.selectDropdownIcon,null===(s=e.classes)||void 0===s?void 0:s.icon)}});return t?(0,r.jsx)(c.A,{label:t,contentWrapperClassName:l.rootTooltipWrapper,open:h,children:p}):p}let y=(0,s.n9)({name:{MenuSelectHeading:x}})(t=>{let e=(0,a.Ku)(t);return{selectInput:{width:77},menuOption:{display:"block",width:"100%"},headingOption:{marginBlockStart:0,marginBlockEnd:0,fontWeight:"bold"},headingOption1:{fontSize:e["& h1"].fontSize},headingOption2:{fontSize:e["& h2"].fontSize},headingOption3:{fontSize:e["& h3"].fontSize},headingOption4:{fontSize:e["& h4"].fontSize},headingOption5:{fontSize:e["& h5"].fontSize},headingOption6:{fontSize:e["& h6"].fontSize}}}),v={Paragraph:"Paragraph",Heading1:"Heading 1",Heading2:"Heading 2",Heading3:"Heading 3",Heading4:"Heading 4",Heading5:"Heading 5",Heading6:"Heading 6"},b={[v.Heading1]:1,[v.Heading2]:2,[v.Heading3]:3,[v.Heading4]:4,[v.Heading5]:5,[v.Heading6]:6},k={1:v.Heading1,2:v.Heading2,3:v.Heading3,4:v.Heading4,5:v.Heading5,6:v.Heading6};function x({labels:t,hideShortcuts:e=!1,...n}){var s,a,d,p,u,f,m,x;let w;let{classes:S,cx:C}=y(),M=(0,l.P)(),A=(0,o.useCallback)(t=>{let e=t.target.value;e===v.Paragraph?null==M||M.chain().setParagraph().focus().run():e in b&&(null==M||M.chain().setHeading({level:b[e]}).focus().run())},[M]),O="";if(null==M?void 0:M.isActive("paragraph"))O=v.Paragraph;else if(null==M?void 0:M.isActive("heading")){let t=(function(t,e){let n=(0,h.Lt)("string"==typeof e?e:e.name,t.sc
1hema);return"node"===n?function(t,e){let n=(0,h.Pg)(e,t.schema),{from:r,to:i}=t.selection,o=[];return t.doc.nodesBetween(r,i,t=>{o.push(t)}),o.reverse().filter(t=>t.type.name===n.name).map(t=>({...t.attrs}))}(t,e):"mark"===n?function(t,e){let n=(0,h.I2)(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];return o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,t=>{s.push(...t.marks)}),s.filter(t=>t.type.name===n.name).map(t=>({...t.attrs}))}(t,e):[]})(M.state,"heading").map(t=>t.level);(w=1===new Set(t).size?t[0]:void 0)&&w in k&&(O=k[w])}let E=""!==O,T=!!(null==M?void 0:M.can().setParagraph()),N=(0,o.useMemo)(()=>{var t;let e=null==M?void 0:M.extensionManager.extensions.find(t=>"heading"==t.name);return new Set(null!==(t=null==e?void 0:e.options.levels)&&void 0!==t?t:[])},[M]),I=N.values().next(),R=I.done?void 0:I.value,z=void 0!==R&&(w===R||!!(null==M?void 0:M.can().setHeading({level:R})));return(0,r.jsxs)(g,{onChange:A,disabled:!(null==M?void 0:M.isEditable)||!E&&!T&&!z,displayEmpty:!0,renderValue:e=>{var n,i;let o;return""===e?o=null!==(i=null!==(n=null==t?void 0:t.emptyValue)&&void 0!==n?n:null==t?void 0:t.empty)&&void 0!==i?i:(0,r.jsx)("em",{children:"Change toâ¦"}):e===v.Paragraph?o=null==t?void 0:t.paragraph:e===v.Heading1?o=null==t?void 0:t.heading1:e===v.Heading2?o=null==t?void 0:t.heading2:e===v.Heading3?o=null==t?void 0:t.heading3:e===v.Heading4?o=null==t?void 0:t.heading4:e===v.Heading5?o=null==t?void 0:t.heading5:e===v.Heading6&&(o=null==t?void 0:t.heading6),null!=o?o:e},"aria-label":"Text headings",tooltipTitle:"Styles",...n,value:O,inputProps:{...n.inputProps,className:C(S.selectInput,null===(s=n.inputProps)||void 0===s?void 0:s.className)},children:[(0,r.jsx)(i.A,{value:v.Paragraph,disabled:!E&&!T,children:(0,r.jsx)(c.A,{label:"",shortcutKeys:e?void 0:["mod","alt","0"],placement:"right",contentWrapperClassName:S.menuOption,children:null!==(a=null==t?void 0:t.paragraph)&&void 0!==a?a:v.Paragraph})}),N.has(1)&&(0,r.jsx)(i.A,{value:v.Heading1,disabled:!z,children:(0,r.jsx)(c.A,{label:"",shortcutKeys:e?void 0:["mod","alt","1"],placement:"right",contentWrapperClassName:C(S.menuOption,S.headingOption,S.headingOption1),children:null!==(d=null==t?void 0:t.heading1)&&void 0!==d?d:v.Heading1})}),N.has(2)&&(0,r.jsx)(i.A,{value:v.Heading2,disabled:!z,children:(0,r.jsx)(c.A,{label:"",shortcutKeys:e?void 0:["mod","alt","2"],placement:"right",contentWrapperClassName:C(S.menuOption,S.headingOption,S.headingOption2),children:null!==(p=null==t?void 0:t.heading2)&&void 0!==p?p:v.Heading2})}),N.has(3)&&(0,r.jsx)(i.A,{value:v.Heading3,disabled:!z,children:(0,r.jsx)(c.A,{label:"",shortcutKeys:e?void 0:["mod","alt","3"],placement:"right",contentWrapperClassName:C(S.menuOption,S.headingOption,S.headingOption3),children:null!==(u=null==t?void 0:t.heading3)&&void 0!==u?u:v.Heading3})}),N.has(4)&&(0,r.jsx)(i.A,{value:v.Heading4,disabled:!z,children:(0,r.jsx)(c.A,{label:"",shortcutKeys:e?void 0:["mod","alt","4"],placement:"right",contentWrapperClassName:C(S.menuOption,S.headingOption,S.headingOption4),children:null!==(f=null==t?void 0:t.heading4)&&void 0!==f?f:v.Heading4})}),N.has(5)&&(0,r.jsx)(i.A,{value:v.Heading5,disabled:!z,children:(0,r.jsx)(c.A,{label:"",shortcutKeys:e?void 0:["mod","alt","5"],placement:"right",contentWrapperClassName:C(S.menuOption,S.headingOption,S.headingOption5),children:null!==(m=null==t?void 0:t.heading5)&&void 0!==m?m:v.Heading5})}),N.has(6)&&(0,r.jsx)(i.A,{value:v.Heading6,disabled:!z,children:(0,r.jsx)(c.A,{label:"",shortcutKeys:e?void 0:["mod","alt","6"],placement:"right",contentWrapperClassName:C(S.menuOption,S.headingOption,S.headingOption6),children:null!==(x=null==t?void 0:t.heading6)&&void 0!==x?x:v.Heading6})})]})}},88592:(t,e,n)=>{n.d(e,{Ku:()=>a,hD:()=>h,oi:()=>l});var r=n(77707),i=n(31561),o=n.n(i),s=n(92840);let l={TABLE_ELEMENT:1,MENU_BAR:2,NOTCHED_OUTLINE:2};function a(t){let e=Object.keys(t.typography.h1).some(t=>t.includes("@media")),n=(0,s.i7)` 2 0%, 95% { 3 opacity: 1; 4 } 5 100% { 6 opacity: 0; 7 } 8 `;return{...o()(t.typography.body1,["lineHeight"]),"&:focus":{outline:"none"},"& h1":{fontFamily:t.typography.h3.fontFamily,fontWeight:"bold",...e?{fontSize:"1.8750rem",[t.breakpoints.up("sm")]:{fontSize:"2.1863rem"},[t.breakpoints.up("md")]:{fontSize:"2.4292rem"},[t.breakpoints.up("lg")]:{fontSize:"2.4292rem"}}:{fontSize:"2.4292rem"}},"& h2":{...o()(t.typography.h4,["lineHeight"]),fontWeight:500},"& h3":{...o()(t.typography.h5,["lineHeight"]),fontWeight:500},"& h4":{...o()(t.typography.h6,["lineHeight"]),fontWeight:500},"& h5":{...o()(t.typography.subtitle1,["lineHeight"]),fontWeight:500},"& h6":{...o()(t.typography.subtitle2,["lineHeight"]),fontWeight:500},"& h1, & h2, & h3, & h4, & h5, & h6, & p":{marginBlockStart:0,marginBlockEnd:0},'& a:not([data-type="mention"])':{color:t.palette.primary.main,textDecoration:"none","&:hover":{textDecoration:"underline"}},"& ul, & ol":{marginBlockStart:0,marginBlockEnd:0},"& ol":{listStyleType:"decimal","& ol":{listStyleType:"lower-alpha","& ol":{listStyleType:"lower-roman","& ol":{listStyleType:"decimal","& ol":{listStyleType:"lower-alpha","& ol":{listStyleType:"lower-roman"}}}}}},"& ul":{listStyleType:"disc","& ul":{listStyleType:"circle","& ul":{listStyleType:"square","& ul":{listStyleType:"disc","& ul":{listStyleType:"circle","& ul":{listStyleType:"square"}}}}}},'& ul[data-type="taskList"]':{listStyle:"none",padding:0,"& li":{display:"flex","& > label":{flex:"0 0 auto",marginRight:"0.5rem",userSelect:"none"},"& > div":{flex:"1 1 auto"}}},"& blockquote":{paddingLeft:"1rem",marginInlineStart:t.spacing(1),marginInlineEnd:t.spacing(1),position:"relative","&:before":{position:"absolute",top:0,bottom:0,left:0,display:"block",width:4,borderRadius:t.shape.borderRadius,background:t.palette.text.disabled,content:'""'}},"& :not(pre) > code":{padding:"2px 3px 1px",borderWidth:1,borderStyle:"solid",borderColor:t.palette.divider,borderRadius:3,backgroundColor:t.palette.action.hover,color:"dark"===t.palette.mode?t.palette.secondary.main:(0,r.e$)(t.palette.secondary.dark,.1)},"& pre":{marginTop:t.spacing(.5),marginBottom:t.spacing(.5),padding:t.spacing(1),borderWidth:1,borderStyle:"solid",borderColor:t.palette.divider,borderRadius:t.shape.borderRadius,background:t.palette.action.hover,lineHeight:1.4,overflowX:"auto",whiteSpace:"pre !important"},'& [data-type="mention"]':{padding:"0 0.25rem",lineHeight:"1.3em",borderRadius:t.shape.borderRadius,color:t.palette.primary.main,background:"dark"===t.palette.mode?(0,r.X4)((0,r.e$)(t.palette.primary.dark,.7),.5):(0,r.X4)((0,r.a)(t.palette.primary.light,.6),.3),textDecoration:"none"},"& img:not(.ProseMirror-separator)":{maxWidth:"100%",height:"auto",display:"inline-flex",...function(t){if("dark"!==t.palette.mode)return{};let e=t.palette.grey[200];return{backgroundColor:e,color:t.palette.getContrastText(e)}}(t),"&.ProseMirror-selectednode":{outline:`3px solid ${t.palette.primary.main}`}},"& hr":{borderWidth:0,borderTopWidth:"thin",borderStyle:"solid",borderColor:t.palette.text.secondary,"&.ProseMirror-selectednode":{borderColor:t.palette.primary.main}},"& table":{borderCollapse:"collapse",tableLayout:"fixed",margin:0,overflowY:"hidden",overflowX:"auto",display:"block","& td, th":{minWidth:"1em",borderWidth:1,borderStyle:"solid",borderColor:"dark"===t.palette.mode?t.palette.grey[500]:t.palette.grey[400],padding:"3px 5px",verticalAlign:"top",boxSizing:"border-box",position:"relative","& > *":{marginBottom:0}},"& th":{fontWeight:500,textAlign:"left",backgroundColor:t.palette.action.selected}},"& .tableWrapper":{overflowX:"auto","& table":{overflow:"hidden",display:"table"}},"& .selectedCell:after":{zIndex:l.TABLE_ELEMENT,position:"absolute",content:'""',left:0,right:0,top:0,bottom:0,background:"rgba(200, 200, 255, 0.4)",pointerEvents:"none"},'&[contenteditable="true"]':{"& .column-resize-handle":{position:"absolute",right:-2,top:-1,bottom:-2,width:4,zIndex:l.TABLE_ELEMENT,backgroundColor:t.palette.primary.light,pointerEvents:"none"},"&.resize-cursor":{cursor:"col-resize"}},'&[contenteditable="false"]':{"& .column-resize-handle":{display:"none"},"&.resize-cursor":{pointerEvents:"none"}},"& p.is-editor-empty:first-of-type::before":{color:t.palette.text.disabled,content:"attr(data-placeholder)",float:"left",height:0,pointerEvents:"none"},"& .ProseMirror-gapcursor:after":{borderColor:t.palette.text.primary},"& .collaboration-cursor__caret":{borderLeft:"1px solid #0d0d0d",borderRight:"1px solid #0d0d0d",marginLeft:"-1px",marginRight:"-1px",position:"relative",wordBreak:"normal",cursor:"text","&:after":{position:"absolute",content:'""',left:-3,right:0,top:-2,borderWidth:3,borderStyle:"solid",borderColor:"inherit"},"&:hover .collaboration-cursor__label":{opacity:1,transition:t.transitions.create("opacity",{delay:0,duration:100,easing:"linear"})}},"& .collaboration-cursor__label":{borderRadius:"3px 3px 3px 0",color:"#0d0d0d",fontSize:12,fontStyle:"normal",fontWeight:600,fontFamily:t.typography.body1.fontFamily,left
8:-1,lineHeight:"normal",padding:"0.1rem 0.3rem",position:"absolute",top:"-1.4em",userSelect:"none",whiteSpace:"nowrap",pointerEvents:"none",opacity:0,transition:t.transitions.create("opacity",{delay:500,duration:100,easing:"linear"}),animation:`${n} 3s linear 1`}}}function h(t,e){let n={};return e.forEach(e=>{n[e]=`MuiTiptap-${t}-${e}`}),n}},74999:(t,e,n)=>{n.d(e,{A:()=>s});var r=n(70719),i=n.n(r),o=n(12115);class s extends o.Component{constructor(t){var e,n;super(t),this.updateDebounced=i()(this.forceUpdate,null!==(e=t.wait)&&void 0!==e?e:170,null!==(n=t.options)&&void 0!==n?n:{leading:!0,trailing:!0,maxWait:300})}shouldComponentUpdate(){return this.updateDebounced(),!1}componentWillUnmount(){this.updateDebounced.cancel()}render(){return this.props.children}}},41459:(t,e,n)=>{n.d(e,{n:()=>c});var r=n(77405),i=n(97916);let o=t=>{let e=t.length,n=0,s="";for(;n<e;n++){let e;let l=t[n];if(null!=l){switch(typeof l){case"boolean":break;case"object":if(Array.isArray(l))e=o(l);else for(let t in(0,r.v)(!(0,i.E)(l,!1)),e="",l)l[t]&&t&&(e&&(e+=" "),e+=t);break;default:e=l}e&&(s&&(s+=" "),s+=e)}}return s};var s=n(46778),l=n(87667),a=n(12115);let{createCssAndCx:h}={createCssAndCx:function(t){let{cache:e}=t,n=(...t)=>{let n=(0,s.J)(t,e.registered);(0,l.sk)(e,n,!1);let r=`${e.key}-${n.name}`;t:{let n=t[0];if(!(n instanceof Object&&!("styles"in n)&&!("length"in n)&&!("__emotion_styles"in n)))break t;d.saveClassNameCSSObjectMapping(e,r,n)}return r};return{css:n,cx:(...t)=>{let r=o(t),i=d.fixClassName(e,r,n);return function(t,e,n){let r=[],i=(0,l.Rk)(t,r,n);return r.length<2?n:i+e(r)}(e.registered,n,i)}}}};function c(t){let{useCache:e}=t;return{useCssAndCx:function(){let t=e(),{css:n,cx:r}=function(t,e){var n;let r=(0,a.useRef)();return(!r.current||e.length!==(null===(n=r.current.prevDeps)||void 0===n?void 0:n.length)||r.current.prevDeps.map((t,n)=>t===e[n]).indexOf(!1)>=0)&&(r.current={v:t(),prevDeps:[...e]}),r.current.v}(()=>h({cache:t}),[t]);return{css:n,cx:r}}}}let d=(()=>{let t=new WeakMap;return{saveClassNameCSSObjectMapping:(e,n,r)=>{let i=t.get(e);void 0===i&&(i=new Map,t.set(e,i)),i.set(n,r)},fixClassName:(e,n,r)=>{let i=t.get(e);return o((function(t){let e=!1;return t.map(([t,n])=>{let r;if(void 0===n)return t;if(e)r={"&&":n};else for(let i in r=t,n)if(i.startsWith("@media")){e=!0;break}return r})})(n.split(" ").map(t=>[t,null==i?void 0:i.get(t)])).map(t=>"string"==typeof t?t:r(t)))}}})()},92840:(t,e,n)=>{n.d(e,{Q2:()=>p,i7:()=>d.i7});var r=n(915),i=n(12115);function o(t){return t.charAt(0).toUpperCase()+t.slice(1)}let s=new WeakMap,l="getClasses should only be used in conjunction with withStyles";function a(t){let e=t.classes;if(void 0===e)throw Error(l);let n=s.get(e);if(void 0===n)throw Error(l);return n}function h(t){let e={},n={};return Object.keys(t).forEach(r=>(r.startsWith("@media")?n:e)[r]=t[r]),Object.keys(n).forEach(t=>{let r=n[t];Object.keys(r).forEach(n=>{var i;return e[n]={...null!==(i=e[n])&&void 0!==i?i:{},[t]:r[n]}})}),e}var c=n(49862),d=n(71987);function p(t){return{...(0,r.x6)(t),...function(t){let{useTheme:e,cache:n}=t,{makeStyles:l}=(0,r.x6)({useTheme:e,cache:n});function c(t,e,n){let r="string"==typeof t?(()=>{let e=function({children:e,...n}){return(0,i.createElement)(t,n,e)};return Object.defineProperty(e,"name",{value:o(t)}),e})():t,a=(()=>{let t;{let{name:t}=null!=n?n:{};if(void 0!==t)return"object"!=typeof t?t:Object.keys(t)[0]}e:{let e=r.displayName;if("string"!=typeof e||""===e)break e;t=e}n:if(void 0===t){let e=r.name;if("string"!=typeof e||""===e)break n;t=e}if(void 0!==t)return(t=(t=t.replace(/\$/g,"usd")).replace(/\(/g,"_").replace(/\)/g,"_")).replace(/[^a-zA-Z0-9-_]/g,"_")})(),c=l({...n,name:a})("function"==typeof e?(t,n,r)=>h(e(t,n,r)):h(e)),d=(0,i.forwardRef)(function(e,n){let{className:o,classes:l,...a}=e,{classes:h,cx:d}=c(e,{props:e}),p=d(h.root,o);return s.set(h,{...h,root:p}),i.createElement(r,{ref:n,className:!function(t){for(let e in t)if("root"!==e)return!0;return!1}(h)?p:o,..."string"==typeof t?{}:{classes:h},...a})});return void 0!==a&&(d.displayName=`${o(a)}WithStyles`,Object.defineProperty(d,"name",{value:d.displayName})),d}return c.getClasses=a,{withStyles:c}}(t)}}let{tss:u}=(0,c.d)({useContext:()=>({})});u.create({})},915:(t,e,n)=>{n.d(e,{QS:()=>g,x6:()=>f});var r=n(12115),i=n(57883),o=n(27756),s=n(41459),l=n(68022),a=n(97916),h=n(77405),c=n(64727),d=n(92535),p=n(30896);let u=0;function f(t){let{useTheme:e,cache:n}=t,{useCache:p}=g({cacheProvidedAtInception:n}),{useCssAndCx:f}=(0,s.n)({useCache:p});return{makeStyles:function(t){let{name:n,uniqId:s="".concat(u++)}=null!=t?t:{},m="object"!=typeof n?n:Object.keys(n)[0];return function(t){let n="function"==typeof t?t:()=>t;return function(t,u){let g=e(),{css:y,cx:v}=f(),b=p(),k=(0,r.useMemo)(()=>{let e={},r=n(g,t,"undefined"!=typeof Proxy&&new Proxy({},{get:(t,n)=>("symbol"==typeof n&&(0,h.v)(!1),e[n]="".concat(b.key,"-").concat(s).concat(void 0!==m?"-".concat(m):"","-").concat(n,"-ref"))})||{}),l=(0,i.M)((0,o.u)(r).map(t=>{let n=r[t];return n.label||(n.label="".concat(void 0!==m?"".concat(m,"-"):"").concat(t)),[t,"".concat(y(n)).concat((0,a.E)(t,t in e)?" ".concat(e[t]):"")]}));return(0,o.u)(e).forEach(t=>{t in l||(l[t]=e[t])}),l},[b,y,v,g,(0,l.o)(t)]);{let t=null==u?void 0:u.props.classes;k=(0,r.useMemo)(()=>(0,c.z)(k,t,v),[k,(0,l.o)(t),v])}{let t=(0,d.L)({classes:k,css:y,cx:v,name:null!=m?m:"makeStyle no name",idOfUseStyles:s,muiStyleOverridesParams:u,theme:g});void 0!==t.classes&&(k=t.classes),void 0!==t.css&&(y=t.css),void 0!==t.cx&&(v=t.cx)}return{classes:k,theme:g,css:y,cx:v}}}},useStyles:function(){let t=e(),{css:n,cx:r}=f();return{theme:t,css:n,cx:r}}}}let m=(0,r.createContext)(void 0),{createUseCache:g}={createUseCache:function(t){let{cacheProvidedAtInception:e}=t;return{useCache:function(){var t;let n=(0,p._)(),i=(0,r.useContext)(m),o=null!==(t=null!=e?e:i)&&void 0!==t?t:n;if(null===o)throw Error("In order to get SSR working with tss-react you need to explicitly provide an Emotion cache.\nMUI users be aware: This is not an error strictly related to tss-react, with or without tss-react,\nMUI needs an Emotion cache to be provided for SSR to work.\nHere is the MUI documentation related to SSR setup: https://mui.com/material-ui/guides/server-rendering/\nTSS provides helper that makes the process of setting up SSR easier: https://docs.tss-react.dev/ssr");return o}}}}},64727:(t,e,n)=>{n.d(e,{z:()=>i});var r=n(27756);function i(t,e,n){if(!(e instanceof Object))return t;let i={};return(0,r.u)(t).forEach(r=>i[r]=n(t[r],e[r])),(0,r.u)(e).forEach(n=>{if(n in t)return;let r=e[n];"string"==typeof r&&(i[n]=r)}),i}},97771:(t,e,n)=>{n.d(e,{n9:()=>l});var r=n(69847),i=n(92840),o=n(49862),s=n(92535);let{makeStyles:l,withStyles:a}=(0,i.Q2)({useTheme:r.A}),{tss:h}=(0,o.d)({useContext:function(){return{theme:(0,r.A)()}},usePlugin:s.L});h.create({})},92535:(t,e,n)=>{n.d(e,{L:()=>s});var r=n(12115),i=n(68022),o=n(64727);let s=({classes:t,theme:e,muiStyleOverridesParams:n,css:s,cx:l,name:a})=>{var h,c;let d;r:{if("makeStyle no name"===a){a=void 0;break r}if(void 0!==n&&void 0===a)throw Error("To use muiStyleOverridesParams, you must specify a name using .withName('MyComponent')")}try{d=void 0===a?void 0:(null===(c=null===(h=e.components)||void 0===h?void 0:h[a])||void 0===c?void 0:c.styleOverrides)||void 0}catch(t){}let p=(0,r.useMemo)(()=>
8{if(void 0===d)return;let t={};for(let r in d){let i=d[r];i instanceof Object&&(t[r]=s("function"==typeof i?i({theme:e,ownerState:null==n?void 0:n.ownerState,...null==n?void 0:n.props}):i))}return t},[d,(0,i.o)(null==n?void 0:n.props),(0,i.o)(null==n?void 0:n.ownerState),s]);return{classes:t=(0,r.useMemo)(()=>(0,o.z)(t,p,l),[t,p,l])}}},77405:(t,e,n)=>{n.d(e,{v:()=>r});function r(t,e){if(!t)throw Error(e)}},68022:(t,e,n)=>{n.d(e,{o:()=>r});function r(t){if(!(t instanceof Object)||"function"==typeof t)return t;let e=[];for(let n in t){let r=t[n],i=typeof r;if(!("string"===i||"number"===i&&!isNaN(r)||"boolean"===i||null==r))return t;e.push(`${n}:${i}_${r}`)}return"xSqLiJdLMd9s"+e.join("|")}},27756:(t,e,n)=>{n.d(e,{u:()=>r});function r(t){return Object.keys(t)}},57883:(t,e,n)=>{n.d(e,{M:()=>r});let r=Object.fromEntries?Object.fromEntries:t=>{if(!t||!t[Symbol.iterator])throw Error("Object.fromEntries() requires a single iterable argument");let e={};return Object.keys(t).forEach(n=>{let[r,i]=t[n];e[r]=i}),e}},97916:(t,e,n)=>{n.d(e,{E:()=>r});function r(t,e){return e}},49862:(t,e,n)=>{n.d(e,{d:()=>p});var r=n(915),i=n(41459),o=n(77405),s=n(57883),l=n(27756),a=n(97916),h=n(68022),c=n(64727);let d=(()=>{let t="object"==typeof document&&"function"==typeof(null==document?void 0:document.getElementById),e="undefined"!=typeof jest,n="undefined"!=typeof mocha,r="undefined"!=typeof __vitest_worker__;return!t&&!e&&!n&&!r})();function p(t){u=0,f.splice(0,f.length);let{useContext:e,usePlugin:n,cache:p}=t,{useCache:g}=(0,r.QS)({cacheProvidedAtInception:p}),{useCssAndCx:y}=(0,i.n)({useCache:g});return{tss:function t(e){let{useContext:n,useCache:r,useCssAndCx:i,usePlugin:p,name:g,doesUseNestedSelectors:y}=e;return{withParams:()=>t({...e}),withName:n=>t({...e,name:"object"!=typeof n?n:Object.keys(n)[0]}),withNestedSelectors:()=>t({...e,doesUseNestedSelectors:!0}),create:t=>{let e=`x${u++}`;if(void 0!==g)for(;;){let t=f.find(t=>t.name===g);if(void 0===t)break;f.splice(f.indexOf(t),1)}let v="function"==typeof t?t:()=>t;return function(u){var b,k,x;let{classesOverrides:w,...S}=null!=u?u:{},C=n(),{css:M,cx:A}=i(),O=r(),E=function(t){let{cache:e,cssObjectByRuleNameOrGetCssObjectByRuleName:n,classesOverridesRef:r,paramsAndPluginParamsRef:i,idOfUseStyles:s,context:a,getClasses:c}=t;i:{let t=m.get(e);if(void 0===t)break i;let o=t.get(n);if(void 0===o)break i;let c=o.get(r);if(void 0===c)break i;let d=c.get(i);if(void 0===d)break i;let p=d.find(({context:t})=>{if(t===a)return!0;if((0,l.u)(t).length!==(0,l.u)(a).length)return!1;for(let e in t)if((0,h.o)(t[e])!==(0,h.o)(a[e]))return!1;return!0});if(void 0===p)break i;if((null==p?void 0:p.idOfUseStyles)!==s){d.splice(d.indexOf(p),1);break i}return p.result}let d=c();{m.has(e)||m.set(e,new WeakMap);let t=m.get(e);(0,o.v)(void 0!==t),t.has(n)||t.set(n,new Map);let l=t.get(n);(0,o.v)(void 0!==l),l.has(r)||(l.size>200&&l.clear(),l.set(r,new Map));let h=l.get(r);if((0,o.v)(void 0!==h),!h.has(i)){o:{let t="string"==typeof i?257:5;if(h.size<t)break o;h.clear()}h.set(i,[])}let c=h.get(i);(0,o.v)(void 0!==c),c.length>5&&(c=[]),c.push({idOfUseStyles:s,context:a,result:d})}return d}({cache:O,cssObjectByRuleNameOrGetCssObjectByRuleName:t,classesOverridesRef:(0,h.o)(w),paramsAndPluginParamsRef:(0,h.o)(S),idOfUseStyles:e,context:C,getClasses:()=>{let t={},n=v({...u,...C,...y?{classes:"undefined"==typeof Proxy?{}:new Proxy({},{get:(n,r)=>{if("symbol"==typeof r&&(0,o.v)(!1),d&&void 0===g)throw Error('tss-react: In SSR setups, in order to use nested selectors, you must also give a unique name to the useStyle function.\nSolution: Use tss.withName("ComponentName").withNestedSelectors<...>()... to set a name.');if(void 0!==g){let t=f.find(t=>t.name===g&&t.idOfUseStyles===e);void 0===t&&f.push(t={name:g,idOfUseStyles:e,nestedSelectorRuleNames:new Set}),t.nestedSelectorRuleNames.add(r)}if(void 0!==g&&void 0!==f.find(t=>t.name===g&&t.idOfUseStyles!==e&&t.nestedSelectorRuleNames.has(r)))throw Error(`tss-react: There are in your codebase two different useStyles named "${g}" that both use use the nested selector ${r}. 9 This may lead to CSS class name collisions, causing nested selectors to target elements outside of the intended scope. 10 Solution: Ensure each useStyles using nested selectors has a unique name. 11 Use: tss.withName("UniqueName").withNestedSelectors<...>()...`);return t[r]=`${O.key}-${void 0!==g?g:e}-${r}-ref`}})}:{}}),r=(0,s.M)((0,l.u)(n).map(e=>{let r=n[e];return r.label||(r.label=`${void 0!==g?`${g}-`:""}${e}`),[e,`${M(r)}${(0,a.E)(e,e in t)?` ${t[e]}`:""}`]}));
11return(0,l.u)(t).forEach(e=>{e in r||(r[e]=t[e])}),r=(0,c.z)(r,w,A)}}),T=p({classes:E,css:M,cx:A,idOfUseStyles:e,name:g,...C,...S});return{classes:null!==(b=T.classes)&&void 0!==b?b:E,css:null!==(k=T.css)&&void 0!==k?k:M,cx:null!==(x=T.cx)&&void 0!==x?x:A,...C}}}}}({useContext:e,useCache:g,useCssAndCx:y,usePlugin:null!=n?n:({classes:t,cx:e,css:n})=>({classes:t,cx:e,css:n}),name:void 0,doesUseNestedSelectors:!1})}}let u=0,f=[],m=new WeakMap},50823:(t,e,n)=>{n.d(e,{A:()=>C});var r=n(12115),i=n(43463),o=n(16506),s=n(23537),l=n(11509),a=n(59596),h=n(69847),c=n(2550),d=n(37033),p=n(76645),u=n(33114),f=n(76566),m=n(16255),g=n(43847);function y(t){return(0,g.Ay)("MuiCollapse",t)}(0,m.A)("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);var v=n(95155);let b=t=>{let{orientation:e,classes:n}=t;return(0,l.A)({root:["root","".concat(e)],entered:["entered"],hidden:["hidden"],wrapper:["wrapper","".concat(e)],wrapperInner:["wrapperInner","".concat(e)]},y,n)},k=(0,a.Ay)("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(t,e)=>{let{ownerState:n}=t;return[e.root,e[n.orientation],"entered"===n.state&&e.entered,"exited"===n.state&&!n.in&&"0px"===n.collapsedSize&&e.hidden]}})((0,c.A)(t=>{let{theme:e}=t;return{height:0,overflow:"hidden",transition:e.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:e.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:t=>{let{ownerState:e}=t;return"exited"===e.state&&!e.in&&"0px"===e.collapsedSize},style:{visibility:"hidden"}}]}})),x=(0,a.Ay)("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),w=(0,a.Ay)("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(t,e)=>e.wrapperInner})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),S=r.forwardRef(function(t,e){let n=(0,d.b)({props:t,name:"MuiCollapse"}),{addEndListener:l,children:a,className:c,collapsedSize:m="0px",component:g,easing:y,in:S,onEnter:C,onEntered:M,onEntering:A,onExit:O,onExited:E,onExiting:T,orientation:N="vertical",style:I,timeout:R=p.p0.standard,TransitionComponent:z=o.Ay,...L}=n,B={...n,orientation:N,collapsedSize:m},$=b(B),F=(0,h.A)(),j=(0,s.A)(),J=r.useRef(null),P=r.useRef(),D="number"==typeof m?"".concat(m,"px"):m,H="horizontal"===N,K=H?"width":"height",W=r.useRef(null),_=(0,f.A)(e,W),V=t=>e=>{if(t){let n=W.current;void 0===e?t(n):t(n,e)}},U=()=>J.current?J.current[H?"clientWidth":"clientHeight"]:0,q=V((t,e)=>{J.current&&H&&(J.current.style.position="absolute"),t.style[K]=D,C&&C(t,e)}),G=V((t,e)=>{let n=U();J.current&&H&&(J.current.style.position="");let{duration:r,easing:i}=(0,u.c)({style:I,timeout:R,easing:y},{mode:"enter"});if("auto"===R){let e=F.transitions.getAutoHeightDuration(n);t.style.transitionDuration="".concat(e,"ms"),P.current=e}else t.style.transitionDuration="string"==typeof r?r:"".concat(r,"ms");t.style[K]="".concat(n,"px"),t.style.transitionTimingFunction=i,A&&A(t,e)}),X=V((t,e)=>{t.style[K]="auto",M&&M(t,e)}),Z=V(t=>{t.style[K]="".concat(U(),"px"),O&&O(t)}),Y=V(E),Q=V(t=>{let e=U(),{duration:n,easing:r}=(0,u.c)({style:I,timeout:R,easing:y},{mode:"exit"});if("auto"===R){let n=F.transitions.getAutoHeightDuration(e);t.style.transitionDuration="".concat(n,"ms"),P.current=n}else t.style.transitionDuration="string"==typeof n?n:"".concat(n,"ms");t.style[K]=D,t.style.transitionTimingFunction=r,T&&T(t)});return(0,v.jsx)(z,{in:S,onEnter:q,onEntered:X,onEntering:G,onExit:Z,onExited:Y,onExiting:Q,addEndListener:t=>{"auto"===R&&j.start(P.current||0,t),l&&l(W.current,t)},nodeRef:W,timeout:"auto"===R?null:R,...L,children:(t,e)=>{let{ownerState:n,...r}=e;return(0,v.jsx)(k,{as:g,className:(0,i.A)($.root,c,{entered:$.entered,exited:!S&&"0px"===D&&$.hidden}[t]),style:{[H?"minWidth":"minHeight"]:D,...I},ref:_,ownerState:{...B,state:t},...r,children:(0,v.jsx)(x,{ownerState:{...B,state:t},className:$.wrapper,ref:J,children:(0,v.jsx)(w,{ownerState:{...B,state:t},className:$.wrapperInner,children:a})})})}})});
11S&&(S.muiSupportAuto=!0);let C=S},3512:(t,e,n)=>{n.d(e,{$Z:()=>m,hG:()=>M});var r,i,o=n(12115),s=n(47650),l=n(19346),a={exports:{}},h={};a.exports=function(){if(r)return h;r=1;var t="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},e=o.useState,n=o.useEffect,i=o.useLayoutEffect,s=o.useDebugValue;function l(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!t(e,r)}catch(t){return!0}}var a="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,r){var o=r(),a=e({inst:{value:o,getSnapshot:r}}),h=a[0].inst,c=a[1];return i(function(){h.value=o,h.getSnapshot=r,l(h)&&c({inst:h})},[t,o,r]),n(function(){return l(h)&&c({inst:h}),t(function(){l(h)&&c({inst:h})})},[t]),s(o),o};return h.useSyncExternalStore=void 0!==o.useSyncExternalStore?o.useSyncExternalStore:a,h}();var c=a.exports;let d=(...t)=>e=>{t.forEach(t=>{"function"==typeof t?t(e):t&&(t.current=e)})},p=({contentComponent:t})=>{let e=c.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return o.createElement(o.Fragment,null,Object.values(e))};class u extends o.Component{constructor(t){var e;super(t),this.editorContentRef=o.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(null===(e=t.editor)||void 0===e?void 0:e.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let t=this.props.editor;if(t&&!t.isDestroyed&&t.options.element){if(t.contentComponent)return;let e=this.editorContentRef.current;e.append(...t.options.element.childNodes),t.setOptions({element:e}),t.contentComponent=function(){let t=new Set,e={};return{subscribe:e=>(t.add(e),()=>{t.delete(e)}),getSnapshot:()=>e,getServerSnapshot:()=>e,setRenderer(n,r){e={...e,[n]:s.createPortal(r.reactElement,r.element,n)},t.forEach(t=>t())},removeRenderer(n){let r={...e};delete r[n],e=r,t.forEach(t=>t())}}}(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(t=>t.hasContentComponentInitialized?t:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){let t=this.props.editor;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null,!t.options.element.firstChild))return;let e=document.createElement("div");e.append(...t.options.element.childNodes),t.setOptions({element:e})}render(){let{editor:t,innerRef:e,...n}=this.props;return o.createElement(o.Fragment,null,o.createElement("div",{ref:d(e,this.editorContentRef),...n}),(null==t?void 0:t.contentComponent)&&o.createElement(p,{contentComponent:t.contentComponent}))}}let f=(0,o.forwardRef)((t,e)=>{let n=o.useMemo(()=>Math.floor(0xffffffff*Math.random()).toString(),[t.editor]);return o.createElement(u,{key:n,innerRef:e,...t})}),m=o.memo(f);var g=function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}(function t(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){if(e.constructor!==n.constructor)return!1;if(Array.isArray(e)){if((r=e.length)!=n.length)return!1;for(i=r;0!=i--;)if(!t(e[i],n[i]))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(i of e.entries())if(!n.has(i[0]))return!1;for(i of e.entries())if(!t(i[1],n.get(i[0])))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(i of e.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if((r=e.length)!=n.length)return!1;for(i=r;0!=i--;)if(e[i]!==n[i])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((r=(o=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){var r,i,o,s=o[i];if(("_owner"!==s||!e.$$typeof)&&!t(e[s],n[s]))return!1}return!0}return e!=e&&n!=n}),y={exports:{}},v={};y.exports=function(){if(i)return v;i=1;var t="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e}
11,e=c.useSyncExternalStore,n=o.useRef,r=o.useEffect,s=o.useMemo,l=o.useDebugValue;return v.useSyncExternalStoreWithSelector=function(i,o,a,h,c){var d=n(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;var u=e(i,(d=s(function(){function e(e){if(!i){if(i=!0,n=e,e=h(e),void 0!==c&&p.hasValue){var o=p.value;if(c(o,e))return r=o}return r=e}if(o=r,t(n,e))return o;var s=h(e);return void 0!==c&&c(o,s)?o:(n=e,r=s)}var n,r,i=!1,s=void 0===a?null:a;return[function(){return e(o())},null===s?void 0:function(){return e(s())}]},[o,a,h,c]))[0],d[1]);return r(function(){p.hasValue=!0,p.value=u},[u]),l(u),u},v}();var b=y.exports;let k="undefined"!=typeof window?o.useLayoutEffect:o.useEffect;class x{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){let t=()=>{this.transactionNumber+=1,this.subscribers.forEach(t=>t())},e=this.editor;return e.on("transaction",t),()=>{e.off("transaction",t)}}}}let w="undefined"==typeof window,S=w||!!("undefined"!=typeof window&&window.next);class C{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(t=>t())}getInitialEditor(){return void 0===this.options.current.immediatelyRender?w||S?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){let t={...this.options.current,onBeforeCreate:(...t)=>{var e,n;return null===(n=(e=this.options.current).onBeforeCreate)||void 0===n?void 0:n.call(e,...t)},onBlur:(...t)=>{var e,n;return null===(n=(e=this.options.current).onBlur)||void 0===n?void 0:n.call(e,...t)},onCreate:(...t)=>{var e,n;return null===(n=(e=this.options.current).onCreate)||void 0===n?void 0:n.call(e,...t)},onDestroy:(...t)=>{var e,n;return null===(n=(e=this.options.current).onDestroy)||void 0===n?void 0:n.call(e,...t)},onFocus:(...t)=>{var e,n;return null===(n=(e=this.options.current).onFocus)||void 0===n?void 0:n.call(e,...t)},onSelectionUpdate:(...t)=>{var e,n;return null===(n=(e=this.options.current).onSelectionUpdate)||void 0===n?void 0:n.call(e,...t)},onTransaction:(...t)=>{var e,n;return null===(n=(e=this.options.current).onTransaction)||void 0===n?void 0:n.call(e,...t)}
11,onUpdate:(...t)=>{var e,n;return null===(n=(e=this.options.current).onUpdate)||void 0===n?void 0:n.call(e,...t)},onContentError:(...t)=>{var e,n;return null===(n=(e=this.options.current).onContentError)||void 0===n?void 0:n.call(e,...t)},onDrop:(...t)=>{var e,n;return null===(n=(e=this.options.current).onDrop)||void 0===n?void 0:n.call(e,...t)},onPaste:(...t)=>{var e,n;return null===(n=(e=this.options.current).onPaste)||void 0===n?void 0:n.call(e,...t)}};return new l.KE(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}static compareOptions(t,e){return Object.keys(t).every(n=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&t.extensions&&e.extensions?t.extensions.length===e.extensions.length&&t.extensions.every((t,n)=>{var r;return t===(null===(r=e.extensions)||void 0===r?void 0:r[n])}):t[n]===e[n]))}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===t.length?C.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(t){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps){this.previousDeps=t;return}if(this.previousDeps.length===t.length&&this.previousDeps.every((e,n)=>e===t[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){let t=this.instanceId,e=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===t){e&&e.setOptions(this.options.current);return}e&&!e.isDestroyed&&(e.destroy(),this.instanceId===t&&this.setEditor(null))},1)}}function M(t={},e=[]){let n=(0,o.useRef)(t);n.current=t;let[r]=(0,o.useState)(()=>new C(n)),i=c.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,o.useDebugValue)(i),(0,o.useEffect)(r.onRender(e)),!function(t){var e;let[n]=(0,o.useState)(()=>new x(t.editor)),r=b.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,null!==(e=t.equalityFn)&&void 0!==e?e:g);k(()=>n.watch(t.editor),[t.editor,n]),(0,o.useDebugValue)(r)}({editor:i,selector:({transactionNumber:e})=>!1===t.shouldRerenderOnTransaction?null:t.immediatelyRender&&0===e?0:e+1}),i}let A=((0,o.createContext)({editor:null}).Consumer,(0,o.createContext)({onDragStart:void 0})),O=()=>(0,o.useContext)(A);o.forwardRef((t,e)=>{let{onDragStart:n}=O(),r=t.as||"div";return o.createElement(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})})},27386:(t,e,n)=>{n.d(e,{A:()=>ty});var r=n(19346);let i=/^\s*>\s$/,o=r.bP.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:t}){return["blockquote",(0,r.KV)(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}}
11,addInputRules(){return[(0,r.tG)({find:i,type:this.type})]}}),s=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,l=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,a=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,h=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,c=r.CU.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",(0,r.KV)(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[(0,r.OX)({find:s,type:this.type}),(0,r.OX)({find:a,type:this.t
11ype})]},addPasteRules(){return[(0,r.Zc)({find:l,type:this.type}),(0,r.Zc)({find:h,type:this.type})]}}),d="textStyle",p=/^\s*([-+*])\s$/,u=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:t}){return["ul",(0,r.KV)(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(d)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=(0,r.tG)({find:p,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=(0,r.tG)({find:p,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(d),editor:this.editor})),[t]}}),f=/(^|[^`])`([^`]+)`(?!`)/,m=/(^|[^`])`([^`]+)`(?!`)/g,g=r.CU.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:t}){return["code",(0,r.KV)(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[(0,r.OX)({find:f,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:m,type:this.type})]}});var y=n(55526);let v=/^```([a-z]+)?[\s\n]$/,b=/^~~~([a-z]+)?[\s\n]$/,k=r.bP.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;let{languageClassPrefix:n}=this.options;return[...(null===(e=t.firstElementChild)||void 0===e?void 0:e.classList)||[]].filter(t=>t.startsWith(n)).map(t=>t.replace(n,""))[0]||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:t,HTMLAttributes:e}){return["pre",(0,r.KV)(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:e}=this.editor.state.selection,n=1===e.pos;return!!t&&e.parent.type.name===this.name&&(!!n||!e.parent.textContent.length)&&this.editor.commands.clearNodes()},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:e}=t,{selection:n}=e,{$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&&t.chain().command(({tr:t})=>(t.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;let{state:e}=t,{selection:n,doc:r}=e,{$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)?t.commands.command(({tr:t})=>(t.setSelection(y.LN.near(r.resolve(s))),!0)):t.commands.exitCode())}}},addInputRules(){return[(0,r.JJ)({find:v,type:this.type,getAttributes:t=>({language:t[1]})}),(0,r.JJ)({find:b,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new y.k_({key:new y.hs("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;let n=e.clipboardData.getData("text/plain"),r=e.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}=t.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(y.U3.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),x=r.bP.create({name:"doc",topNode:!0,content:"block+"});var w=n(72093);class S{constructor(t,e){var n;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=e.width)&&void 0!==n?n:1,this.color=!1===e.color?void 0:e.color||"black",this.class=e.class,this.handlers=["dragover","dragend","drop","dragleave"].map(e=>{let n=t=>{this[e](t)};return t.dom.addEventListener(e,n),{name:e,handler:n}})}
11destroy(){this.handlers.forEach(({name:t,handler:e})=>this.editorView.dom.removeEventListener(t,e))}update(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t,e,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 t=n.nodeBefore,e=n.nodeAfter;if(t||e){let n=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(n){let r=n.getBoundingClientRect(),o=t?r.bottom:r.top;t&&e&&(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 t=this.editorView.coordsAtPos(this.cursorPos),e=this.width/2*l;i={left:t.left-e,right:t.left+e,top:t.top,bottom:t.bottom}}let h=this.editorView.dom.offsetParent;if(!this.element&&(this.element=h.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),h&&(h!=document.body||"static"!=getComputedStyle(h).position)){let n=h.getBoundingClientRect(),r=n.width/h.offsetWidth,i=n.height/h.offsetHeight;t=n.left-h.scrollLeft*r,e=n.top-h.scrollTop*i}else t=-pageXOffset,e=-pageYOffset;this.element.style.left=(i.left-t)/l+"px",this.element.style.top=(i.top-e)/a+"px",this.element.style.width=(i.right-i.left)/l+"px",this.element.style.height=(i.bottom-i.top)/a+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),n=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,e,t):r;if(e&&!i){let t=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=(0,w.Um)(this.editorView.state.doc,t,this.editorView.dragging.slice);null!=e&&(t=e)}this.setCursor(t),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}let C=r.YY.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[function(t={}){return new y.k_({view:e=>new S(e,t)})}(this.options)]}});var M=n(74936),A=n(98836),O=n(27296);class E extends y.LN{constructor(t){super(t,t)}map(t,e){let n=t.resolve(e.map(this.head));return E.valid(n)?new E(n):y.LN.near(n)}content(){return A.Ji.empty}eq(t){return t instanceof E&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,e){if("number"!=typeof e.pos)throw RangeError("Invalid input for GapCursor.fromJSON");return new E(t.resolve(e.pos))}getBookmark(){return new T(this.anchor)}static valid(t){let e=t.parent;if(e.isTextblock||!function(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(0==n){if(r.type.spec.isolating)return!0;continue}for(let t=r.child(n-1);;t=t.lastChild){if(0==t.childCount&&!t.inlineContent||t.isAtom||t.type.spec.isolating)return!0;if(t.inlineContent)return!1}}return!0}(t)||!function(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let t=r.child(n);;t=t.firstChild){if(0==t.childCount&&!t.inlineContent||t.isAtom||t.type.spec.isolating)return!0;if(t.inlineContent)return!1}}return!0}(t))return!1;let n=e.type.spec.allowGapCursor;if(null!=n)return n;let r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,e,n=!1){s:for(;;){if(!n&&E.valid(t))return t;let r=t.pos,i=null;for(let n=t.depth;;n--){let o=t.node(n);if(e>0?t.indexAfter(n)<o.childCount:t.index(n)>0){i=o.child(e>0?t.indexAfter(n):t.index(n)-1);break}if(0==n)return null;r+=e;let s=t.doc.resolve(r);if(E.valid(s))return s}for(;;){let o=e>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!y.nh.isSelectable(i)){t=t.doc.resolve(r+i.nodeSize*e),n=!1;continue s}break}i=o,r+=e;let s=t.doc.resolve(r);if(E.valid(s))return s}return null}}}E.prototype.visible=!1,E.findFrom=E.findGapCursorFrom,y.LN.jsonID("gapcursor",E);class T{constructor(t){this.pos=t}map(t){return new T(t.map(this.pos))}resolve(t){let e=t.resolve(this.pos);return E.valid(e)?new E(e):y.LN.near(e)}}let N=(0,M.K)({ArrowLeft:I("horiz",-1),ArrowRight:I("horiz",1),ArrowUp:I("vert",-1),ArrowDown:I("vert",1)});function I(t,e){let n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,r,i){let o=t.selection,s=e>0?o.$to:o.$from,l=o.empty;if(o instanceof y.U3){if(!i.endOfTextblock(n)||0==s.depth)return!1;l=!1,s=t.doc.resolve(e>0?s.after():s.before())}let a=E.findGapCursorFrom(s,e,l);return!!a&&(r&&r(t.tr.setSelection(new E(a))),!0)}}function R(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!E.valid(r))return!1;
11let i=t.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&y.nh.isSelectable(t.state.doc.nodeAt(i.inside)))&&(t.dispatch(t.state.tr.setSelection(new E(r))),!0)}function z(t,e){if("insertCompositionText"!=e.inputType||!(t.state.selection instanceof E))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=A.FK.empty;for(let t=r.length-1;t>=0;t--)i=A.FK.from(r[t].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new A.Ji(i,0,0));return o.setSelection(y.U3.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function L(t){if(!(t.selection instanceof E))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",O.zF.create(t.doc,[O.NZ.widget(t.selection.head,e,{key:"gapcursor"})])}let B=r.YY.create({name:"gapCursor",addProseMirrorPlugins:()=>[new y.k_({props:{decorations:L,createSelectionBetween:(t,e,n)=>e.pos==n.pos&&E.valid(n)?new E(n):null,handleClick:R,handleKeyDown:N,handleDOMEvents:{beforeinput
11:z}}})],extendNodeSchema(t){var e;let n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:null!==(e=(0,r.gk)((0,r.iI)(t,"allowGapCursor",n)))&&void 0!==e?e:null}}}),$=r.bP.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:t}){return["br",(0,r.KV)(this.options.HTMLAttributes,t)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:t,storedMarks:i}=n;if(t.$from.parent.type.spec.isolating)return!1;let{keepMarks:o}=this.options,{splittableMarks:s}=r.extensionManager,l=i||t.$to.parentOffset&&t.$from.marks();return e().insertContent({type:this.name}).command(({tr:t,dispatch:e})=>{if(e&&l&&o){let e=l.filter(t=>s.includes(t.type.name));t.ensureMarks(e)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),F=r.bP.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){let n=this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0];return[`h${n}`,(0,r.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.setNode(this.name,t),toggleHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>(0,r.JJ)({find:RegExp(`^(#{${Math.min(...this.options.levels)},${t}}
11)\\s$`),type:this.type,getAttributes:{level:t}}))}});var j=function(){};j.prototype.append=function(t){return t.length?(t=j.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},j.prototype.prepend=function(t){return t.length?j.from(t).append(this):this},j.prototype.appendInner=function(t){return new P(this,t)},j.prototype.slice=function(t,e){return(void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e)?j.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},j.prototype.get=function(t){if(!(t<0)&&!(t>=this.length))return this.getInner(t)},j.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},j.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(e,n){return r.push(t(e,n))},e,n),r},j.from=function(t){return t instanceof j?t:t&&t.length?new J(t):j.empty};var J=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var i=e;i<n;i++)if(!1===t(this.values[i],r+i))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var i=e-1;i>=n;i--)if(!1===t(this.values[i],r+i))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=200)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=200)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(j);j.empty=new J([]);var P=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var i=this.left.length;if(e<i&&!1===this.left.forEachInner(t,e,Math.min(n,i),r)||n>i&&!1===this.right.forEachInner(t,Math.max(e-i,0),Math.min(this.length,n)-i,r+i))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){var i=this.left.length;if(e>i&&!1===this.right.forEachInvertedInner(t,e-i,Math.max(n,i)-i,r+i)||n<i&&!1===this.left.forEachInvertedInner(t,Math.min(e,i),n,r))return!1},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(j);class D{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){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}e&&(r=(n=this.remapping(s,this.items.length)).maps.length);let l=t.tr,a=[],h=[];return this.items.forEach((t,e)=>{if(!t.step){n||(r=(n=this.remapping(s,e+1)).maps.length),r--,h.push(t);return}if(n){h.push(new H(t.map));let e=t.step.map(n.slice(r)),i;e&&l.maybeStep(e).doc&&(i=l.mapping.maps[l.mapping.maps.length-1],a.push(new H(i,void 0,void 0,a.length+h.length))),r--,i&&n.appendMap(i,r)}else l.maybeStep(t.step);if(t.selection)return i=n?t.selection.map(n.slice(r)):t.selection,o=new D(this.items.slice(0,s).append(h.reverse().concat(a)),this.eventCount-1),!1},this.items.length,0),{remaining:o,transform:l,selection:i}}addTransform(t,e,n,r){var i,o;let s,l=[],a=this.eventCount,h=this.items,c=!r&&h.length?h.get(h.length-1):null;for(let n=0;n<t.steps.length;n++){let i=t.steps[n].invert(t.docs[n]),o=new H(t.mapping.maps[n],i,e),s;(s=c&&c.merge(o))&&(o=s,n?l.pop():h=h.slice(0,h.length-1)),l.push(o),e&&(a++,e=void 0),r||(c=o)}let d=a-n.depth;return d>
11W&&(i=h,o=d,i.forEach((t,e)=>{if(t.selection&&0==o--)return s=e,!1}),h=i.slice(s),a-=d),new D(h.append(l),a)}remapping(t,e){let n=new w.X9;return this.items.forEach((e,r)=>{let i=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,i)},t,e),n}addMaps(t){return 0==this.eventCount?this:new D(this.items.append(t.map(t=>new H(t))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),i=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(t=>{t.selection&&s--},r);let l=e;this.items.forEach(e=>{let r=i.getMirror(--l);if(null==r)return;o=Math.min(o,r);let a=i.maps[r];if(e.step){let o=t.steps[r].invert(t.docs[r]),h=e.selection&&e.selection.map(i.slice(l+1,r));h&&s++,n.push(new H(a,o,h))}else n.push(new H(a))},r);let a=[];for(let t=e;t<o;t++)a.push(new H(i.maps[t]));let h=new D(this.items.slice(0,r).append(a).append(n),s);return h.emptyItemCount()>500&&(h=h.compress(this.items.length-n.length)),h}emptyItemCount(){let t=0;return this.items.forEach(e=>{!e.step&&t++}),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,r=[],i=0;return this.items.forEach((o,s)=>{if(s>=t)r.push(o),o.selection&&i++;else if(o.step){let t=o.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let l=o.selection&&o.selection.map(e.slice(n));l&&i++;let a=new H(s.invert(),t,l),h,c=r.length-1;(h=r.length&&r[c].merge(a))?r[c]=h:r.push(a)}}else o.map&&n--},this.items.length,0),new D(j.from(r.reverse()),i)}}D.empty=new D(j.empty,0);class H{constructor(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new H(e.getMap().invert(),e,this.selection)}}}class K{constructor(t,e,n,r,i){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}let W=20;function _(t){let e=[];for(let n=t.length-1;n>=0&&0==e.length;n--)t[n].forEach((t,n,r,i)=>e.push(r,i));return e}function V(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}let U=!1,q=null;function G(t){let e=t.plugins;if(q!=e){U=!1,q=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){U=!0;break}}return U}let X=new y.hs("history"),Z=new y.hs("closeHistory");function Y(t,e){return(n,r)=>{let i=X.getState(n);if(!i||0==(t?i.undone:i.done).eventCount)return!1;if(r){let o=function(t,e,n){let r=G(e),i=X.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),l=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),a=new K(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(s).setMeta(X,{redo:n,historyState:a})}(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}let Q=Y(!1,!0),tt=Y(!0,!0);Y(!1,!1),Y(!0,!1);let te=r.YY.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:e})=>Q(t,e),redo:()=>({state:t,dispatch:e})=>tt(t,e)}),addProseMirrorPlugins(){return[function(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new y.k_({key:X,state:{init:()=>new K(D.empty,D.empty,null,0,-1),apply:(e,n,r)=>(function(t,e,n,r){let i=n.getMeta(X),o;if(i)return i.historyState;n.getMeta(Z)&&(t=new K(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(X))return s.getMeta(X).redo?new K(t.done.addTransform(n,void 0,r,G(e)),t.undone,_(n.mapping.maps),t.prevTime,t.prevComposition):new K(t.done,t.undone.addTransform(n,void 0,r,G(e)),null,t.prevTime,t.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new K(t.done.rebased(n,o),t.undone.rebased(n,o),V(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new K(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),V(t.prevRanges,n.mapping),t.prevTime,t.prevComposition);{let i=n.getMeta("composition"),o=0==t.prevTime||!s&&t.prevComposition!=i&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;
11return t.mapping.maps[0].forEach((t,r)=>{for(let i=0;i<e.length;i+=2)t<=e[i+1]&&r>=e[i]&&(n=!0)}),n}(n,t.prevRanges)),l=s?V(t.prevRanges,n.mapping):_(n.mapping.maps);return new K(t.done.addTransform(n,o?e.selection.getBookmark():void 0,r,G(e)),D.empty,l,n.time,null==i?t.prevComposition:i)}})(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?Q:"historyRedo"==n?tt:null;return!!r&&(e.preventDefault(),r(t.state,t.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()}}}),tn=r.bP.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:t}){return["hr",(0,r.KV)(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{let{selection:n}=e,{$from:i,$to:o}=n,s=t();return 0===i.parentOffset?s.insertContentAt({from:Math.max(i.pos-1,0),to:o.pos},{type:this.name}):(0,r.BQ)(n)?s.insertContentAt(o.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({tr:t,dispatch:e})=>{var n;if(e){let{$to:e}=t.selection,r=e.end();if(e.nodeAfter)e.nodeAfter.isTextblock?t.setSelection(y.U3.create(t.doc,e.pos+1)):e.nodeAfter.isBlock?t.setSelection(y.nh.create(t.doc,e.pos)):t.setSelection(y.U3.create(t.doc,e.pos));else{let i=null===(n=e.parent.type.contentMatch.defaultType)||void 0===n?void 0:n.create();i&&(t.insert(r,i),t.setSelection(y.U3.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[(0,r.jT)({find:/^(?:---|â-|___\s|\*\*\*\s)$/,type:this.t
11ype})]}}),tr=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,ti=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,to=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,ts=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,tl=r.CU.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>"normal"!==t.style.fontStyle&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",(0,r.KV)(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[(0,r.OX)({find:tr,type:this.type}),(0,r.OX)({find:to,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:ti,type:this.type}),(0,r.Zc)({find:ts,type:this.type})]}}),ta=r.bP.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",(0,r.KV)(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),th="textStyle",tc=/^(\d+)\.\s$/,td=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:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:t}){let{start:e,...n}=t;return 1===e?["ol",(0,r.KV)(this.options.HTMLAttributes,n),0]:["ol",(0,r.KV)(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(th)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}}
11,addInputRules(){let t=(0,r.tG)({find:tc,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=(0,r.tG)({find:tc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(th)}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1],editor:this.editor})),[t]}}),tp=r.bP.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",(0,r.KV)(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),tu=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,tf=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,tm=r.CU.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("line-through")&&{}}],renderHTML({HTMLAttributes:t}){return["s",(0,r.KV)(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[(0,r.OX)({find:tu,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:tf,type:this.type})]}}),tg=r.bP.create({name:"text",group:"inline"}),ty=r.YY.create({name:"starterKit",addExtensions(){let t=[];return!1!==this.options.bold&&t.push(c.configure(this.options.bold)),!1!==this.options.blockquote&&t.push(o.configure(this.options.blockquote)),!1!==this.options.bulletList&&t.push(u.configure(this.options.bulletList)),!1!==this.options.code&&t.push(g.configure(this.options.code)),!1!==this.options.codeBlock&&t.push(k.configure(this.options.codeBlock)),!1!==this.options.document&&t.push(x.configure(this.options.document)),!1!==this.options.dropcursor&&t.push(C.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&t.push(B.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&t.push($.configure(this.options.hardBreak)),!1!==this.options.heading&&t.push(F.configure(this.options.heading)),!1!==this.options.history&&t.push(te.configure(this.options.history)),!1!==this.options.horizontalRule&&t.push(tn.configure(this.options.horizontalRule)),!1!==this.options.italic&&t.push(tl.configure(this.options.italic)),!1!==this.options.listItem&&t.push(ta.configure(this.options.listItem)),!1!==this.options.orderedList&&t.push(td.configure(this.options.orderedList)),!1!==this.options.paragraph&&t.push(tp.configure(this.options.paragraph)),!1!==this.options.strike&&t.push(tm.configure(this.options.strike)),!1!==this.options.text&&t.push(tg.configure(this.options.text)),t}})},93221:(t,e,n)=>{n.d(e,{$f:()=>N,G2:()=>b,I$:()=>C,Im:()=>R,Qv:()=>a,Sd:()=>y,Z1:()=>M,_G:()=>c,_e:()=>u,bh:()=>k,eB:()=>h,eT:()=>g,ec:()=>I,hy:()=>O,ic:()=>s,iz:()=>A,pC:()=>w,yY:()=>x,y_:()=>z});var r=n(72093),i=n(98836),o=n(55526);let s=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function l(t,e){let{$cursor:n}=t.selection;return n&&(e?e.endOfTextblock("backward",t):!(n.parentOffset>0))?n:null}let a=(t,e,n)=>{let s=l(t,n);if(!s)return!1;let a=f(s);if(!a){let n=s.blockRange(),i=n&&(0,r.jP)(n);return null!=i&&(e&&e(t.tr.lift(n,i).scrollIntoView()),!0)}let h=a.nodeBefore;if(E(t,a,e,-1))return!0;if(0==s.parent.content.size&&(p(h,"end")||o.nh.isSelectable(h)))for(let n=s.depth;;n--){let l=(0,r.$L)(t.doc,s.before(n),s.after(n),i.Ji.empty);if(l&&l.slice.size<l.to-l.from){if(e){let n=t.tr.step(l);n.setSelection(p(h,"end")?o.LN.findFrom(n.doc.resolve(n.mapping.map(a.pos,-1)),-1):o.nh.create(n.doc,a.pos-h.nodeSize)),e(n.scrollIntoView())}return!0}if(1==n||s.node(n-1).childCount>1)break}return!!h.isAtom&&a.depth==s.depth-1&&(e&&e(t.tr.delete(a.pos-h.nodeSize,a.pos).scrollIntoView()),!0)},h=(t,e,n)=>{let r=l(t,n);if(!r)return!1;let i=f(r);return!!i&&d(t,i,e)},c=(t,e,n)=>{let r=m(t,n);if(!r)return!1;let i=v(r);return!!i&&d(t,i,e)};function d(t,e,n){let s=e.nodeBefore,l=e.pos-1;for(;!s.isTextblock;l--){if(s.type.spec.isolating)return!1;let t=s.lastChild;if(!t)return!1;s=t}let a=e.nodeAfter,h=e.pos+1;for(;!a.isTextblock;h++){if(a.type.spec.isolating)return!1;let t=a.firstChild;if(!t)return!1;a=t}let c=(0,r.$L)(t.doc,l,h,i.Ji.empty);if(!c||c.from!=l||c instanceof r.Ln&&c.slice.size>=h-l)return!1;if(n){let e=t.tr.step(c);e.setSelection(o.U3.create(e.doc,l)),n(e.scrollIntoView())}return!0}function p(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;
11if(n&&1!=r.childCount)break}return!1}let u=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=f(r)}let l=s&&s.nodeBefore;return!!(l&&o.nh.isSelectable(l))&&(e&&e(t.tr.setSelection(o.nh.create(t.doc,s.pos-l.nodeSize)).scrollIntoView()),!0)};function f(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function m(t,e){let{$cursor:n}=t.selection;return n&&(e?e.endOfTextblock("forward",t):!(n.parentOffset<n.parent.content.size))?n:null}let g=(t,e,n)=>{let s=m(t,n);if(!s)return!1;let l=v(s);if(!l)return!1;let a=l.nodeAfter;if(E(t,l,e,1))return!0;if(0==s.parent.content.size&&(p(a,"start")||o.nh.isSelectable(a))){let n=(0,r.$L)(t.doc,s.before(),s.after(),i.Ji.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(p(a,"start")?o.LN.findFrom(r.doc.resolve(r.mapping.map(l.pos)),1):o.nh.create(r.doc,r.mapping.map(l.pos))),e(r.scrollIntoView())}return!0}}return!!a.isAtom&&l.depth==s.depth-1&&(e&&e(t.tr.delete(l.pos,l.pos+a.nodeSize).scrollIntoView()),!0)},y=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;s=v(r)}let l=s&&s.nodeAfter;return!!(l&&o.nh.isSelectable(l))&&(e&&e(t.tr.setSelection(o.nh.create(t.doc,s.pos)).scrollIntoView()),!0)};function v(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}let b=(t,e)=>{let n=t.selection,i=n instanceof o.nh,s;if(i){if(n.node.isTextblock||!(0,r.n9)(t.doc,n.from))return!1;s=n.from}else if(null==(s=(0,r.N0)(t.doc,n.from,-1)))return!1;if(e){let n=t.tr.join(s);i&&n.setSelection(o.nh.create(n.doc,s-t.doc.resolve(s).nodeBefore.nodeSize)),e(n.scrollIntoView())}return!0},k=(t,e)=>{let n=t.selection,i;if(n instanceof o.nh){if(n.node.isTextblock||!(0,r.n9)(t.doc,n.to))return!1;i=n.to}else if(null==(i=(0,r.N0)(t.doc,n.to,1)))return!1;return e&&e(t.tr.join(i).scrollIntoView()),!0},x=(t,e)=>{let{$from:n,$to:i}=t.selection,o=n.blockRange(i),s=o&&(0,r.jP)(o);return null!=s&&(e&&e(t.tr.lift(o,s).scrollIntoView()),!0)},w=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!!(n.parent.type.spec.code&&n.sameParent(r))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)};function S(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}let C=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),l=S(i.contentMatchAt(s));if(!l||!i.canReplaceWith(s,s,l))return!1;if(e){let r=n.after(),i=t.tr.replaceWith(r,r,l.createAndFill());i.setSelection(o.LN.near(i.doc.resolve(r),1)),e(i.scrollIntoView())}return!0},M=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof o.i5||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=S(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,l=t.tr.insert(n,s.createAndFill());l.setSelection(o.U3.create(l.doc,n+1)),e(l.scrollIntoView())}return!0},A=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if((0,r.zy)(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let i=n.blockRange(),o=i&&(0,r.jP)(i);return null!=o&&(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},O=(t,e)=>{let{$from:n,to:r}=t.selection,i,s=n.sharedDepth(r);return 0!=s&&(i=n.before(s),e&&e(t.tr.setSelection(o.nh.create(t.doc,i))),!0)};function E(t,e,n,s){let l,a,h,c=e.nodeBefore,d=e.nodeAfter,u,f,m=c.type.spec.isolating||d.type.spec.isolating;if(!m&&(l=e.nodeBefore,a=e.nodeAfter,h=e.index(),l&&a&&l.type.compatibleContent(a.type)&&(!l.content.size&&e.parent.canReplace(h-1,h)?(n&&n(t.tr.delete(e.pos-l.nodeSize,e.pos).scrollIntoView()),!0):!!(e.parent.canReplace(h,h+1)&&(a.isTextblock||(0,r.n9)(t.doc,e.pos)))&&(n&&n(t.tr.join(e.pos).scrollIntoView()),!0))))return!0;let g=!m&&e.parent.canReplace(e.index(),e.index()+1);if(g&&(u=(f=c.contentMatchAt(c.childCount)).findWrapping(d.type))&&f.matchType(u[0]||d.type).validEnd){if(n){let o=e.pos+d.nodeSize,s=i.FK.empty;for(let t=u.length-1;t>=0;t--)s=i.FK.from(u[t].create(null,s));s=i.FK.from(c.copy(s));let l=t.tr.step(new r.Wg(e.pos-1,o,e.pos,o,new i.Ji(s,1,0),u.length,!0)),a=l.doc.resolve(o+2*u.length);a.nodeAfter&&a.nodeAfter.type==c.type&&(0,r.n9)(l.doc,a.pos)&&l.join(a.pos),n(l.scrollIntoView())}return!0}let y=d.type.spec.isolating||s>0&&m?null:o.LN.findFrom(e,1),v=y&&y.$from.blockRange(y.$to),b=v&&(0,r.jP)(v);if(null!=b&&b>=e.depth)return n&&n(t.tr.lift(v,b).scrollIntoView()),!0;if(g&&p(d,"start",!0)&&p(c,"end")){let o=c,s=[];for(;s.push(o),!o.isTextblock;)o=o.lastChild;let l=d,a=1;for(;!l.isTextblock;l=l.firstChild)a++;
11if(o.canReplace(o.childCount,o.childCount,l.content)){if(n){let o=i.FK.empty;for(let t=s.length-1;t>=0;t--)o=i.FK.from(s[t].copy(o));n(t.tr.step(new r.Wg(e.pos-s.length,e.pos+d.nodeSize,e.pos+a,e.pos+d.nodeSize-a,new i.Ji(o,s.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function T(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return!!i.node(s).isTextblock&&(n&&n(e.tr.setSelection(o.U3.create(e.doc,t<0?i.start(s):i.end(s)))),!0)}}let N=T(-1),I=T(1);function R(t,e=null){return function(n,i){let{$from:o,$to:s}=n.selection,l=o.blockRange(s),a=l&&(0,r.oM)(l,t,e);return!!a&&(i&&i(n.tr.wrap(l,a).scrollIntoView()),!0)}}function z(t,e=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(t,e))){if(r.type==t)i=!0;else{let e=n.doc.resolve(o),r=e.index();i=e.parent.canReplaceWith(r,r+1,t)}}})}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,t,e)}r(i.scrollIntoView())}return!0}}function L(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}let B=L(s,a,u),$=L(s,g,y),F={Enter:L(w,M,A,(t,e)=>{let{$from:n,$to:i}=t.selection;if(t.selection instanceof o.nh&&t.selection.node.isBlock)return!!(n.parentOffset&&(0,r.zy)(t.doc,n.pos))&&(e&&e(t.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let s=[],l,a,h=!1,c=!1;for(let t=n.depth;;t--){if(n.node(t).isBlock){let e;h=n.end(t)==n.pos+(n.depth-t),c=n.start(t)==n.pos-(n.depth-t),a=S(n.node(t-1).contentMatchAt(n.indexAfter(t-1))),s.unshift(e||(h&&a?{type:a}:null)),l=t;break}if(1==t)return!1;s.unshift(null)}let d=t.tr;(t.selection instanceof o.U3||t.selection instanceof o.i5)&&d.deleteSelection();let p=d.mapping.map(n.pos),u=(0,r.zy)(d.doc,p,s.length,s);if(u||(s[0]=a?{type:a}:null,u=(0,r.zy)(d.doc,p,s.length,s)),!u)return!1;if(d.split(p,s.length,s),!h&&c&&n.node(l).type!=a){let t=d.mapping.map(n.before(l)),e=d.doc.resolve(t);a&&n.node(l-1).canReplaceWith(e.index(),e.index()+1,a)&&d.setNodeMarkup(d.mapping.map(n.before(l)),a)}return e&&e(d.scrollIntoView()),!0}),"Mod-Enter":C,Backspace:B,"Mod-Backspace":B,"Shift-Backspace":B,Delete:$,"Mod-Delete":$,"Mod-a":(t,e)=>(e&&e(t.tr.setSelection(new o.i5(t.doc))),!0)},j={"Ctrl-h":F.Backspace,"Alt-Backspace":F["Mod-Backspace"],"Ctrl-d":F.Delete,"Ctrl-Alt-Backspace":F["Mod-Delete"],"Alt-Delete":F["Mod-Delete"],"Alt-d":F["Mod-Delete"],"Ctrl-a":N,"Ctrl-e":I};for(let t in F)j[t]=F[t];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform()},74936:(t,e,n)=>{n.d(e,{K:()=>u,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="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),s="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),l=0;l<10;l++)r[48+l]=r[96+l]=String(l);for(var l=1;l<=24;l++)r[l+111]="F"+l;for(var l=65;l<=90;l++)r[l]=String.fromCharCode(l+32),i[l]=String.fromCharCode(l);for(var a in r)i.hasOwnProperty(a)||(i[a]=r[a]);var h=n(55526);let c="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);
vendor: 4,501 bytes, line 11
11function d(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function p(t){return new h.k_({props:{handleKeyDown:u(t)}})}function u(t){let e=function(t){let e=Object.create(null);for(let n in t)e[function(t){let e,n,r,i,o=t.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let t=0;t<o.length-1;t++){let s=o[t];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))c?i=!0:n=!0;else throw Error("Unrecognized modifier name: "+s)}return e&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}(n)]=t[n];return e}(t);return function(t,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),h,c=e[d(a,n)];if(c&&c(t.state,t.dispatch,t))return!0;if(1==a.length&&" "!=a){if(n.shiftKey){let r=e[d(a,n,!1)];if(r&&r(t.state,t.dispatch,t))return!0}if((n.shiftKey||n.altKey||n.metaKey||a.charCodeAt(0)>127)&&(h=r[n.keyCode])&&h!=a){let r=e[d(h,n)];if(r&&r(t.state,t.dispatch,t))return!0}}return!1}}},98836:(t,e,n)=>{function r(t){this.content=t}n.d(e,{S4:()=>P,ZF:()=>G,FK:()=>i,CU:()=>a,sX:()=>F,bP:()=>S,u$:()=>x,vI:()=>h,Sj:()=>j,Ji:()=>c}),r.prototype={constructor:r,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return -1},get:function(t){var e=this.find(t);return -1==e?void 0:this.content[e+1]},update:function(t,e,n){var i=n&&n!=t?this.remove(n):this,o=i.find(t),s=i.content.slice();return -1==o?s.push(n||t,e):(s[o+1]=e,n&&(s[o]=n)),new r(s)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new r(n)},addToStart:function(t,e){return new r([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new r(n)},addBefore:function(t,e,n){var i=this.remove(e),o=i.content.slice(),s=i.find(t);return o.splice(-1==s?o.length:s,0,e,n),new r(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=r.from(t)).size?new r(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=r.from(t)).size?new r(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=r.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},r.from=function(t){if(t instanceof r)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new r(e)};class i{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let e=0;e<t.length;e++)this.size+=t[e].nodeSize}nodesBetween(t,e,n,r=0,i){for(let o=0,s=0;s<e;o++){let l=this.content[o],a=s+l.nodeSize;if(a>t&&!1!==n(l,r+s,i||null,o)&&l.content.size){let i=s+1;l.nodesBetween(Math.max(0,t-i),Math.min(l.content.size,e-i),n,r+i)}s=a}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let i="",o=!0;return this.nodesBetween(t,e,(s,l)=>{let a=s.isText?s.text.slice(Math.max(t,l)-l,e-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(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);o<t.content.length;o++)r.push(t.content[o]);return new i(r,this.size+t.size)}cut(t,e=this.size){if(0==t&&e==this.size)return this;let n=[],r=0;if(e>t)for(let i=0,o=0;o<e;i++){let s=this.content[i],l=o+s.nodeSize;l>t&&((o<t||l>e)&&(s=s.isText?s.cut(Math.max(0,t-o),Math.min(s.text.length,e-o)):s.cut(Math.max(0,t-o-1),Math.min(s.content.size,e-o-1))),n.push(s),r+=s.nodeSize),o=l}return new i(n,r)}cutByIndex(t,e){return t==e?i.empty:0==t&&e==this.content.length?this:new i(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new i(r,o)}addToStart(t){return new i([t].concat(this.content),this.size+t.no
11deSize)}addToEnd(t){return new i(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let e=this.content[t];if(!e)throw RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,n=0;e<this.content.length;e++){let r=this.content[e];t(r,n,e),n+=r.nodeSize}}findDiffStart(t,e=0){return function t(e,n,r){for(let i=0;;i++){if(i==e.childCount||i==n.childCount)return e.childCount==n.childCount?null:r;let o=e.child(i),s=n.child(i);if(o==s){r+=o.nodeSize;continue}if(!o.sameMarkup(s))return r;if(o.isText&&o.text!=s.text){for(let t=0;o.text[t]==s.text[t];t++)r++;return r}if(o.content.size||s.content.size){let e=t(o.content,s.content,r+1);if(null!=e)return e}r+=o.nodeSize}}(this,t,e)}findDiffEnd(t,e=this.size,n=t.size){return function t(e,n,r,i){for(let o=e.childCount,s=n.childCount;;){if(0==o||0==s)return o==s?null:{a:r,b:i};let l=e.child(--o),a=n.child(--s),h=l.nodeSize;if(l==a){r-=h,i-=h;continue}if(!l.sameMarkup(a))return{a:r,b:i};if(l.isText&&l.text!=a.text){let t=0,e=Math.min(l.text.length,a.text.length);for(;t<e&&l.text[l.text.length-t-1]==a.text[a.text.length-t-1];)t++,r--,i--;return{a:r,b:i}}if(l.content.size||a.content.size){let e=t(l.content,a.content,r-1,i-1);if(e)return e}r-=h,i-=h}}(this,t,e,n)}findIndex(t,e=-1){if(0==t)return s(0,t);if(t==this.size)return s(this.content.length,t);if(t>this.size||t<0)throw RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=t){if(i==t||e>0)return s(n+1,i);return s(n,r)}r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,e){if(!e)return i.empty;if(!Array.isArray(e))throw RangeError("Invalid input for Fragment.fromJSON");return new i(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return i.empty;let e,n=0;for(let r=0;r<t.length;r++){let i=t[r];n+=i.nodeSize,r&&i.isText&&t[r-1].sameMarkup(i)?(e||(e=t.slice(0,r)),e[e.length-1]=i.withText(e[e.length-1].text+i.text)):e&&e.push(i)}return new i(e||t,n)}static from(t){if(!t)return i.empty;if(t instanceof i)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new i([t],t.nodeSize);throw RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}i.empty=new i([],0);let o={index:0,offset:0};function s(t,e){return o.index=t,o.offset=e,o}function l(t,e){if(t===e)return!0;if(!(t&&"object"==typeof t)||!(e&&"object"==typeof e))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!l(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!l(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}class a{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,n=!1;for(let r=0;r<t.length;r++){let i=t[r];if(this.eq(i))return t;if(this.type.excludes(i.type))e||(e=t.slice(0,r));else{if(i.type.excludes(this.type))return t;!n&&i.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&l(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw RangeError("Invalid input for Mark.fromJSON");let n=t.marks[e.type];if(!n)throw RangeError(`There is no mark type ${e.type} in this schema`);let r=n.create(e.attrs);return n.checkAttrs(r.attrs),r}static sameSet(t,e){if(t==e)return!0;
vendor: 5,543 bytes, line 11
11if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&0==t.length)return a.none;if(t instanceof a)return[t];let e=t.slice();return e.sort((t,e)=>t.type.rank-e.type.rank),e}}a.none=[];class h extends Error{}class c{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=function t(e,n,r,i){let{index:o,offset:s}=e.findIndex(n),l=e.maybeChild(o);if(s==n||l.isText)return i&&!i.canReplace(o,o,r)?null:e.cut(0,n).append(r).append(e.cut(n));let a=t(l.content,n-s-1,r);return a&&e.replaceChild(o,l.copy(a))}(this.content,t+this.openStart,e);return n&&new c(n,this.openStart,this.openEnd)}removeBetween(t,e){return new c(function t(e,n,r){let{index:i,offset:o}=e.findIndex(n),s=e.maybeChild(i),{index:l,offset:a}=e.findIndex(r);if(o==n||s.isText){if(a!=r&&!e.child(l).isText)throw RangeError("Removing non-flat range");return e.cut(0,n).append(e.cut(r))}if(i!=l)throw RangeError("Removing non-flat range");return e.replaceChild(i,s.copy(t(s.content,n-o-1,r-o-1)))}(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return c.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw RangeError("Invalid input for Slice.fromJSON");return new c(i.fromJSON(t,e.content),n,r)}static maxOpen(t,e=!0){let n=0,r=0;for(let r=t.firstChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=t.lastChild;n&&!n.isLeaf&&(e||!n.type.spec.isolating);n=n.lastChild)r++;return new c(t,n,r)}}function d(t,e){if(!e.type.compatibleContent(t.type))throw new h("Cannot join "+e.type.name+" onto "+t.type.name)}function p(t,e,n){let r=t.node(n);return d(r,e.node(n)),r}function u(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function f(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(u(t.nodeAfter,r),o++));for(let t=o;t<s;t++)u(i.child(t),r);e&&e.depth==n&&e.textOffset&&u(e.nodeBefore,r)}function m(t,e){return t.type.checkContent(e),t.copy(e)}function g(t,e,n){let r=[];return f(null,t,n,r),t.depth>n&&u(m(p(t,e,n+1),g(t,e,n+1)),r),f(e,null,n,r),new i(r)}c.empty=new c(i.empty,0,0);class y{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let e=0;e<t;e++)r+=n.child(e).nodeSize;return r}marks(){let t=this.parent,e=this.index();if(0==t.content.size)return a.none;if(this.textOffset)return t.child(e).marks;let n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){let t=n;n=r,r=t}let 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(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let n=e.marks,r=t.parent.maybeChild(t.index());for(var 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(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos<this.pos)return t.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new x(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw RangeError("Position "+e+" out of range");let n=[],r=0,i=e;for(let e=t;;){let{index:t,offset:o}=e.content.findIndex(i),s=i-o;if(n.push(e,t,r+o),!s||(e=e.child(t)).isText)break;
11i=s-1,r+=o+1}return new y(e,n,i)}static resolveCached(t,e){let n=k.get(t);if(n)for(let t=0;t<n.elts.length;t++){let r=n.elts[t];if(r.pos==e)return r}else k.set(t,n=new v);let r=n.elts[n.i]=y.resolve(t,e);return n.i=(n.i+1)%b,r}}class v{constructor(){this.elts=[],this.i=0}}let b=12,k=new WeakMap;class x{constructor(t,e,n){this.$from=t,this.$to=e,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}let w=Object.create(null);class S{constructor(t,e,n,r=a.none){this.type=t,this.attrs=e,this.marks=r,this.content=n||i.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,e,n,r=0){this.content.nodesBetween(t,e,n,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,e,n,r){return this.content.textBetween(t,e,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,e,n){return this.type==t&&l(this.attrs,e||t.defaultAttrs||w)&&a.sameSet(this.marks,n||a.none)}copy(t=null){return t==this.content?this:new S(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new S(this.type,this.attrs,this.content,t)}cut(t,e=this.content.size){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t,e=this.content.size,n=!1){if(t==e)return c.empty;let r=this.resolve(t),i=this.resolve(e),o=n?0:r.sharedDepth(e),s=r.start(o);return new c(r.node(o).content.cut(r.pos-s,i.pos-s),r.depth-o,i.depth-o)}replace(t,e,n){return function(t,e,n){if(n.openStart>t.depth)throw new h("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new h("Inconsistent open depths");return function t(e,n,r,o){let s=e.index(o),l=e.node(o);if(s==n.index(o)&&o<e.depth-r.openStart){let i=t(e,n,r,o+1);return l.copy(l.content.replaceChild(s,i))}if(!r.content.size)return m(l,g(e,n,o));if(r.openStart||r.openEnd||e.depth!=o||n.depth!=o){let{start:t,end:s}=function(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let t=n-1;t>=0;t--)r=e.node(t).copy(i.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(r,e);return m(l,function t(e,n,r,o,s){let l=e.depth>s&&p(e,n,s+1),a=o.depth>s&&p(r,o,s+1),h=[];return f(null,e,s,h),l&&a&&n.index(s)==r.index(s)?(d(l,a),u(m(l,t(e,n,r,o,s+1)),h)):(l&&u(m(l,g(e,n,s+1)),h),f(n,r,s,h),a&&u(m(a,g(r,o,s+1)),h)),f(o,null,s,h),new i(h)}(e,t,s,n,o))}{let t=e.parent,i=t.content;return m(t,i.cut(0,e.parentOffset).append(r.content).append(i.cut(n.parentOffset)))}}(t,e,n,0)}(this.resolve(t),this.resolve(e),n)}nodeAt(t){for(let e=this;;){let{index:n,offset:r}=e.content.findIndex(t);if(!(e=e.maybeChild(n)))return null;if(r==t||e.isText)return e;t-=r+1}}childAfter(t){let{index:e,offset:n}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:n}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:e,offset:n}=this.content.findIndex(t);if(n<t)return{node:this.content.child(e),index:e,offset:n};let r=this.content.child(e-1);return{node:r,index:e-1,offset:n-r.nodeSize}}resolve(t){return y.resolveCached(this,t)}resolveNoCache(t){return y.resolve(this,t)}rangeHasMark(t,e,n){let r=!1;return e>t&&this.nodesBetween(t,e,t=>(n.isInSet(t.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}
11toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),M(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=i.empty,r=0,o=n.childCount){let s=this.contentMatchAt(t).matchFragment(n,r,o),l=s&&s.matchFragment(this.content,e);if(!l||!l.validEnd)return!1;for(let t=r;t<o;t++)if(!this.type.allowsMarks(n.child(t).marks))return!1;return!0}canReplaceWith(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(t).matchType(n),o=i&&i.matchFragment(this.content,e);return!!o&&o.validEnd}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=a.none;for(let e=0;e<this.marks.length;e++){let n=this.marks[e];n.type.checkAttrs(n.attrs),t=n.addToSet(t)}if(!a.sameSet(t,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(t=>t.toJSON())),t}static fromJSON(t,e){let n;if(!e)throw RangeError("Invalid input for Node.fromJSON");if(e.marks){if(!Array.isArray(e.marks))throw RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=i.fromJSON(t,e.content),o=t.nodeType(e.type).create(e.attrs,r,n);return o.type.checkAttrs(o.attrs),o}}S.prototype.text=void 0;class C extends S{constructor(t,e,n,r){if(super(t,e,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):M(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new C(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new C(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function M(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class A{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){var n;let r,i=new O(t,e);if(null==i.next)return A.empty;let o=function t(e){let n=[];do n.push(function(e){let n=[];do n.push(function(e){let n=function(e){if(e.eat("(")){let n=t(e);return e.eat(")")||e.err("Missing closing paren"),n}if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=(function(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let t in n){let r=n[t];r.isInGroup(e)&&i.push(r)}return 0==i.length&&t.err("No node type or group '"+e+"' found"),i})(e,e.next).map(t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}}(e);for(;;)if(e.eat("+"))n={type:"plus",expr:n};else if(e.eat("*"))n={type:"star",expr:n};else if(e.eat("?"))n={type:"opt",expr:n};else if(e.eat("{"))n=function(t,e){let n=E(t),r=n;return t.eat(",")&&(r="}"!=t.next?E(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}(e,n);else break;return n}(e));while(e.next&&")"!=e.next&&"|"!=e.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}(e));while(e.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}(i);i.next&&i.err("Unexpected trailing text");let s=(n=function(t){let e=[[]];return i(function t(e,o){if("choice"==e.type)return e.exprs.reduce((e,n)=>e.concat(t(n,o)),[]);if("seq"==e.type)for(let r=0;;r++){let s=t(e.exprs[r],o);if(r==e.exprs.length-1)return s;i(s,o=n())}else if("star"==e.type){let s=n();return r(o,s),i(t(e.expr,s),s),[r(s)]}else if("plus"==e.type){let s=n();return i(t(e.expr,o),s),i(t(e.expr,s),s),[r(s)]}else if("opt"==e.type)return[r(o)].concat(t(e.expr,o));else if("range"==e.type){let s=o;for(let r=0;r<e.min;r++){let r=n();i(t(e.expr,s),r),s=r}if(-1==e.max)i(t(e.expr,s),s);else for(let o=e.min;o<e.max;o++){let o=n();r(s,o),i(t(e.expr,s),o),s=o}return[r(s)]}else if("name"==e.type)return[r(o,void 0,e.value)];else throw Error("Unknown expr type")}(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){let i={term:r,to:n};return e[t].push(i),i}function i(t,e){t.forEach(t=>t.to=e)}}(o),r=Object.create(null),function t(e){let i=[];e.forEach(t=>{n[t].forEach(({term:t,to:e})=>{let r;if(t){for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);
vendor: 6,202 bytes, line 11
11N(n,e).forEach(e=>{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)})}})});let o=r[e.join(",")]=new A(e.indexOf(n.length-1)>-1);for(let e=0;e<i.length;e++){let n=i[e][1].sort(T);o.next.push({type:i[e][0],next:r[n.join(",")]||t(n)})}return o}(N(n,0)));return function(t,e){for(let n=0,r=[t];n<r.length;n++){let t=r[n],i=!t.validEnd,o=[];for(let e=0;e<t.next.length;e++){let{type:n,next:s}=t.next[e];o.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(s,i),s}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t,e=0,n=t.childCount){let r=this;for(let i=e;r&&i<n;i++)r=r.matchType(t.child(i).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!(e.isText||e.hasRequiredAttrs()))return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}fillBefore(t,e=!1,n=0){let r=[this];return function o(s,l){let a=s.matchFragment(t,n);if(a&&(!e||a.validEnd))return i.from(l.map(t=>t.createAndFill()));for(let t=0;t<s.next.length;t++){let{type:e,next:n}=s.next[t];if(!(e.isText||e.hasRequiredAttrs())&&-1==r.indexOf(n)){r.push(n);let t=o(n,l.concat(e));if(t)return t}}return null}(this,[])}findWrapping(t){for(let e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(t)){let t=[];for(let e=r;e.type;e=e.via)t.push(e.type);return t.reverse()}for(let t=0;t<i.next.length;t++){let{type:o,next:s}=i.next[t];o.isLeaf||o.hasRequiredAttrs()||o.name in e||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),e[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return!function e(n){t.push(n);for(let r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)}(this),t.map((e,n)=>{let r=n+(e.validEnd?"*":" ")+" ";for(let n=0;n<e.next.length;n++)r+=(n?", ":"")+e.next[n].type.name+"->"+t.indexOf(e.next[n].next);return r}).join("\n")}}A.empty=new A(!0);class O{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.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(t){return this.next==t&&(this.pos++||!0)}err(t){throw SyntaxError(t+" (in content expression '"+this.string+"')")}}function E(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function T(t,e){return e-t}function N(t,e){let n=[];return function e(r){let i=t[r];if(1==i.length&&!i[0].term)return e(i[0].to);n.push(r);for(let t=0;t<i.length;t++){let{term:r,to:o}=i[t];r||-1!=n.indexOf(o)||e(o)}}(e),n.sort(T)}function I(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function R(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(void 0===i){let e=t[r];if(e.hasDefault)i=e.default;else throw RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function z(t,e,n,r){for(let r in e)if(!(r in t))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in t){let r=t[n];r.validate&&r.validate(e[n])}}function L(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new $(t,r,e[r]);return n}class B{constructor(t,e,n){this.name=t,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=L(t,n.attrs),this.defaultAttrs=I(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==A.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:R(this.attrs,t)}create(t=null,e,n){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new S(this,this.computeAttrs(t),i.from(e),a.setFrom(n))}createChecked(t=null,e,n){return e=i.from(e),this.checkContent(e),new S(this,this.computeAttrs(t),e,a.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),(e=i.from(e)).size){let t=this.contentMatch.fillBefore(e);if(!t)return null;e=t.append(e)}let r=this.contentMatch.matchFragment(e),o=r&&r.fillBefore(i.empty,!0);return o?new S(this,t,e.append(o),a.setFrom(n)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let e=0;e<t.childCount;e++)if(!this.allowsMarks(t.child(e).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){z(this.attrs,t,"node",this.name)}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){let e;if(null==this.markSet)return t;for(let n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:a.none:t}static compile(t,e){let n=Object.create(null);t.forEach((t,r)=>n[t]=new B(t,e,r));let r=e.spec.topNode||"doc";if(!n[r])throw RangeError("Schema is missing its top node type ('"+r+"')");
11if(!n.text)throw RangeError("Every schema needs a 'text' type");for(let t in n.text.attrs)throw RangeError("The text node type should not have attributes");return n}}class ${constructor(t,e,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(t,e,n){let r=n.split("|");return n=>{let i=null===n?"null":typeof n;if(0>r.indexOf(i))throw RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}(t,e,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class F{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=L(t,r.attrs),this.excluded=null;let i=I(this.attrs);this.instance=i?new a(this,i):null}create(t=null){return!t&&this.instance?this.instance:new a(this,R(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach((t,i)=>n[t]=new F(t,r++,e,i)),n}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}checkAttrs(t){z(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class j{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let e=this.spec={};for(let n in t)e[n]=t[n];e.nodes=r.from(t.nodes),e.marks=r.from(t.marks||{}),this.nodes=B.compile(this.spec.nodes,this),this.marks=F.compile(this.spec.marks,this);let n=Object.create(null);for(let t in this.nodes){if(t in this.marks)throw RangeError(t+" can not be both a node and a mark");let e=this.nodes[t],r=e.spec.content||"",i=e.spec.marks;if(e.contentMatch=n[r]||(n[r]=A.parse(r,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!e.isInline||!e.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=e}e.markSet="_"==i?null:i?J(this,i.split(" ")):""!=i&&e.inlineContent?null:[]}for(let t in this.marks){let e=this.marks[t],n=e.spec.excludes;e.excluded=null==n?[e]:""==n?[]:J(this,n.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else if(t instanceof B){if(t.schema!=this)throw RangeError("Node type from different schema used ("+t.name+")")}else throw RangeError("Invalid node type: "+t);return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new C(n,n.defaultAttrs,t,a.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return S.fromJSON(this,t)}markFromJSON(t){return a.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw RangeError("Unknown node type: "+t);return e}}function J(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let e in t.marks){let r=t.marks[e];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class P{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[];let n=this.matchedStyles=[];e.forEach(t=>{if(null!=t.tag)this.tags.push(t);else if(null!=t.style){let e=/[^=]*/.exec(t.style)[0];0>n.indexOf(e)&&n.push(e),this.styles.push(t)}}),this.normalizeLists=!this.tags.some(e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)})}parse(t,e={}){let n=new V(this,e,!1);return n.addAll(t,a.none,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new V(this,e,!0);return n.addAll(t,a.none,e.from,e.to),c.maxOpen(n.finish())}matchTag(t,e,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){var r;let n=this.tags[i];if(r=n.tag,(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,r)&&(void 0===n.namespace||t.namespaceURI==n.namespace)&&(!n.context||e.matchesContext(n.context))){if(n.getAttrs
11){let e=n.getAttrs(t);if(!1===e)continue;n.attrs=e||void 0}return n}}}matchStyle(t,e,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(t)&&(!r.context||n.matchesContext(r.context))&&(!(o.length>t.length)||61==o.charCodeAt(t.length)&&o.slice(t.length+1)==e)){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r<e.length;r++){let t=e[r];if((null==t.priority?50:t.priority)<n)break}e.splice(r,0,t)}for(let e in t.marks){let r=t.marks[e].spec.parseDOM;r&&r.forEach(t=>{n(t=U(t)),t.mark||t.ignore||t.clearMark||(t.mark=e)})}for(let e in t.nodes){let r=t.nodes[e].spec.parseDOM;r&&r.forEach(t=>{n(t=U(t)),t.node||t.ignore||t.mark||(t.node=e)})}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new P(t,P.schemaRules(t)))}}let D={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},H={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},K={ol:!0,ul:!0};function W(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class _{constructor(t,e,n,r,i,o){this.type=t,this.attrs=e,this.marks=n,this.solid=r,this.options=o,this.content=[],this.activeMarks=a.none,this.match=i||(4&o?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(i.from(t));if(e)this.match=this.type.contentMatch.matchFragment(e);else{let e=this.type.contentMatch,n;
11return(n=e.findWrapping(t.type))?(this.match=e,n):null}}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t=this.content[this.content.length-1],e;t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))&&(t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=t.withText(t.text.slice(0,t.text.length-e[0].length)))}let e=i.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(i.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!D.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class V{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=e.topNode,i,o=W(null,e.preserveWhitespace,0)|(n?4:0);i=r?new _(r.type,r.attrs,a.none,!0,e.topMatch||r.type.contentMatch,o):n?new _(null,null,a.none,!0,null,o):new _(t.schema.topNodeType,null,a.none,!0,null,o),this.nodes=[i],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,e){3==t.nodeType?this.addTextNode(t,e):1==t.nodeType&&this.addElement(t,e)}addTextNode(t,e){let n=t.nodeValue,r=this.top,i=2&r.options?"full":this.localPreserveWS||(1&r.options)>0;if("full"===i||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(i)n="full"!==i?n.replace(/\r?\n|\r/g," "):n.replace(/\r\n?/g,"\n");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let e=r.content[r.content.length-1],i=t.previousSibling;
vendor: 6,009 bytes, line 11
11(!e||i&&"BR"==i.nodeName||e.isText&&/[ \t\r\n\u000c]$/.test(e.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),e,!/\S/.test(n)),this.findInText(t)}else this.findInside(t)}addElement(t,e,n){let r=this.localPreserveWS,i=this.top;("PRE"==t.tagName||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let o=t.nodeName.toLowerCase(),s;K.hasOwnProperty(o)&&this.parser.normalizeLists&&function(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let t=1==e.nodeType?e.nodeName.toLowerCase():null;t&&K.hasOwnProperty(t)&&n?(n.appendChild(e),e=n):"li"==t?n=e:t&&(n=null)}}(t);let l=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(s=this.parser.matchTag(t,this,n));l:if(l?l.ignore:H.hasOwnProperty(o))this.findInside(t),this.ignoreFallback(t,e);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(t=l.skip);let n,r=this.needsBlock;if(D.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(!t.firstChild){this.leafFallback(t,e);break l}let s=l&&l.skip?e:this.readStyles(t,e);s&&this.addAll(t,s),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(t,e);n&&this.addElementByRule(t,l,n,!1===l.consuming?s:void 0)}this.localPreserveWS=r}leafFallback(t,e){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"),e)}ignoreFallback(t,e){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),e,!0)}readStyles(t,e){let n=t.style;if(n&&n.length)for(let t=0;t<this.parser.matchedStyles.length;t++){let r=this.parser.matchedStyles[t],i=n.getPropertyValue(r);if(i)for(let t;;){let n=this.parser.matchStyle(r,i,this,t);if(!n)break;if(n.ignore)return null;if(e=n.clearMark?e.filter(t=>!n.clearMark(t)):e.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1===n.consuming)t=n;else break}}return e}addElementByRule(t,e,n,r){let i,o;if(e.node){if((o=this.parser.schema.nodes[e.node]).isLeaf)this.insertNode(o.create(e.attrs),n,"BR"==t.nodeName)||this.leafFallback(t,n);else{let t=this.enter(o,e.attrs||null,n,e.preserveWhitespace);t&&(i=!0,n=t)}}else{let t=this.parser.schema.marks[e.mark];n=n.concat(t.create(e.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,n,r);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach(t=>this.insertNode(t,n,!1));else{let r=t;"string"==typeof e.contentElement?r=t.querySelector(e.contentElement):"function"==typeof e.contentElement?r=e.contentElement(t):e.contentElement&&(r=e.contentElement),this.findAround(t,r,!0),this.addAll(r,n),this.findAround(t,r,!1)}i&&this.sync(s)&&this.open--}addAll(t,e,n,r){let i=n||0;for(let o=n?t.childNodes[n]:t.firstChild,s=null==r?null:t.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(o,e);this.findAtPoint(t,i)}findPlace(t,e,n){let r,i;for(let e=this.open,o=0;e>=0;e--){let s=this.nodes[e],l=s.findWrapping(t);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 t=0;t<r.length;t++)e=this.enterInner(r[t],null,e,!1);return e}insertNode(t,e,n){if(t.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&(e=this.enterInner(t,null,e))}let r=this.findPlace(t,e,n);if(r){this.closeExtra();let e=this.top;e.match&&(e.match=e.match.matchType(t.type));let n=a.none;for(let i of r.concat(t.marks))(e.type?e.type.allowsMarkType(i.type):q(i.type,t.type))&&(n=i.addToSet(n));return e.content.push(t.mark(n)),!0}return!1}enter(t,e,n,r){let i=this.findPlace(t.create(e),n,!1);return i&&(i=this.enterInner(t,e,n,!0,r)),i}enterInner(t,e,n,r=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(t);let s=W(t,i,o.options);4&o.options&&0==o.content.length&&(s|=4);let l=a.none;return n=n.filter(e=>(o.type?!o.type.allowsMarkType(e.type):!q(e.type,t))||(l=e.addToSet(l),!1)),this.nodes.push(new _(t,e,l,r,null,s)),this.open++,n}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let e=this.open;e>=0;e--){if(this.nodes[e]==t)return this.open=e,!0;this.localPreserveWS&&(this.nodes[e].options|=1)}return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,n){if(t!=e&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)&&e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(t,s)=>{for(;t>=0;t--){let l=e[t];if(""==l){if(t==e.length-1||0==t)continue;for(;s>=i;s--)if(o(t-1,s))return!0;return!1}{let t=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!t||t.name!=l&&!t.isInGroup(l))return!1;s--}}return!0};return o(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;
11if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}}function U(t){let e={};for(let n in t)e[n]=t[n];return e}function q(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=t=>{o.push(t);for(let n=0;n<t.edgeCount;n++){let{type:r,next:i}=t.edge(n);if(r==e||0>o.indexOf(i)&&s(i))return!0}};if(s(i.contentMatch))return!0}}class G{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},n){n||(n=Z(e).createDocumentFragment());let r=n,i=[];return t.forEach(t=>{if(i.length||t.marks.length){let n=0,o=0;for(;n<i.length&&o<t.marks.length;){let e=t.marks[o];if(!this.marks[e.type.name]){o++;continue}if(!e.eq(i[n][0])||!1===e.type.spec.spanning)break;n++,o++}for(;n<i.length;)r=i.pop()[1];for(;o<t.marks.length;){let n=t.marks[o++],s=this.serializeMark(n,t.isInline,e);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(t,e))}),n}serializeNodeInner(t,e){let{dom:n,contentDOM:r}=Q(Z(e),this.nodes[t.type.name](t),null,t.attrs);if(r){if(t.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,r)}return n}serializeNode(t,e={}){let n=this.serializeNodeInner(t,e);for(let r=t.marks.length-1;r>=0;r--){let i=this.serializeMark(t.marks[r],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&Q(Z(n),r(t,e),null,t.attrs)}static renderSpec(t,e,n=null,r){return Q(t,e,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new G(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=X(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return X(t.marks)}}function X(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Z(t){return t.document||window.document}let Y=new WeakMap;function Q(t,e,n,r){let i,o,s;if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let l=e[0],a;if("string"!=typeof l)throw RangeError("Invalid array passed to renderSpec");if(r&&(void 0===(o=Y.get(r))&&Y.set(r,(s=null,function t(e){if(e&&"object"==typeof e){if(Array.isArray(e)){if("string"==typeof e[0])s||(s=[]),s.push(e);else for(let n=0;n<e.length;n++)t(e[n])}else for(let n in e)t(e[n])}}(r),o=s)),a=o)&&a.indexOf(e)>-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let h=l.indexOf(" ");h>0&&(n=l.slice(0,h),l=l.slice(h+1));let c=n?t.createElementNS(n,l):t.createElement(l),d=e[1],p=1;if(d&&"object"==typeof d&&null==d.nodeType&&!Array.isArray(d)){for(let t in p=2,d)if(null!=d[t]){let e=t.indexOf(" ");e>0?c.setAttributeNS(t.slice(0,e),t.slice(e+1),d[t]):c.setAttribute(t,d[t])}}for(let o=p;o<e.length;o++){let s=e[o];if(0===s){if(o<e.length-1||o>p)throw RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}{let{dom:e,contentDOM:o}=Q(t,s,n,r);if(c.appendChild(e),o){if(i)throw RangeError("Multiple content holes");i=o}}}return{dom:c,contentDOM:i}}},94199:(t,e,n)=>{n.d(e,{$B:()=>l,Sd:()=>o,T2:()=>s});var r=n(72093),i=n(98836);function o(t,e=null){return function(n,o){let{$from:s,$to:l}=n.selection,a=s.blockRange(l);if(!a)return!1;let h=o?n.tr:null;return!!function(t,e,n,o=null){let s=!1,l=e,a=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&0==e.startIndex){if(0==e.$from.index(e.depth-1))return!1;let t=a.resolve(e.start-2);l=new i.u$(t,t,e.depth),e.endIndex<e.parent.childCount&&(e=new i.u$(e.$from,a.resolve(e.$to.end(e.depth)),e.depth)),s=!0}let h=(0,r.oM)(l,n,o,e);return!!h&&(t&&function(t,e,n,o,s){let l=i.FK.empty;for(let t=n.length-1;t>=0;t--)l=i.FK.from(n[t].type.create(n[t].attrs,l));t.step(new r.Wg(e.start-(o?2:0),e.end,e.start,e.end,new i.Ji(l,0,0),n.length,!0));let a=0;for(let t=0;t<n.length;t++)n[t].type==s&&(a=t+1);let h=n.length-a,c=e.start+n.length-(o?2:0),d=e.parent;for(let n=e.startIndex,i=e.endIndex,o=!0;n<i;n++,o=!1)!o&&(0,r.zy)(t.doc,c,h)&&(t.split(c,h),c+=2*h),c+=d.child(n).nodeSize}(t,e,h,s,n),!0)}(h,a,t,e)&&(o&&o(h.scrollIntoView()),!0)}}function s(t){return function(e,n){let{$from:o,$to:s}=e.selection,l=o.blockRange(s,e=>e.childCount>0&&e.firstChild.type==t);return!!l&&(!n||(o.node(l.depth-1).type==t?function(t,e,n,o){let s=t.tr,l=o.end,a=o.$to.end(o.depth);l<a&&(s.step(new r.Wg(l-1,a,l,a,new i.Ji(i.FK.from(n.create(null,o.parent.copy())),1,0),1,!0)),o=new i.u$(s.doc.resolve(o.$from.pos),s.doc.resolve(a),o.depth));let h=(0,r.jP)(o);if(null==h)return!1;s.lift(o,h);let c=s.doc.resolve(s.mapping.map(l,-1)-1);return(0,r.n9)(s.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&s.join(c.pos),e(s.scrollIntoView()),!0}(e,n,t,l):function(t,e,n){let o=t.tr,s=n.parent;for(let t=n.end,e=n.endIndex-1,r=n.startIndex;e>r;e--)t-=s.child(e).nodeSize,o.delete(t-1,t+1);
11let l=o.doc.resolve(n.start),a=l.nodeAfter;if(o.mapping.map(n.end)!=n.start+l.nodeAfter.nodeSize)return!1;let h=0==n.startIndex,c=n.endIndex==s.childCount,d=l.node(-1),p=l.index(-1);if(!d.canReplace(p+(h?0:1),p+1,a.content.append(c?i.FK.empty:i.FK.from(s))))return!1;let u=l.pos,f=u+a.nodeSize;return o.step(new r.Wg(u-(h?1:0),f+(c?1:0),u+1,f-1,new i.Ji((h?i.FK.empty:i.FK.from(s.copy(i.FK.empty))).append(c?i.FK.empty:i.FK.from(s.copy(i.FK.empty))),h?0:1,c?0:1),h?0:1)),e(o.scrollIntoView()),!0}(e,n,l)))}}function l(t){return function(e,n){let{$from:o,$to:s}=e.selection,l=o.blockRange(s,e=>e.childCount>0&&e.firstChild.type==t);if(!l)return!1;let a=l.startIndex;if(0==a)return!1;let h=l.parent,c=h.child(a-1);if(c.type!=t)return!1;if(n){let o=c.lastChild&&c.lastChild.type==h.type,s=i.FK.from(o?t.create():null),a=new i.Ji(i.FK.from(t.create(null,i.FK.from(h.type.create(null,s)))),o?3:1,0),d=l.start,p=l.end;n(e.tr.step(new r.Wg(d-(o?3:1),p,d,p,a,1,!0)).scrollIntoView())}return!0}}},55526:(t,e,n)=>{n.d(e,{$t:()=>S,LN:()=>s,U3:()=>c,hs:()=>O,i5:()=>f,k_:()=>C,nh:()=>p});var r=n(98836),i=n(72093);let o=Object.create(null);class s{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new l(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,e=r.Ji.empty){let n=e.content.lastChild,i=null;for(let t=0;t<e.openEnd;t++)i=n,n=n.lastChild;let o=t.steps.length,s=this.ranges;for(let l=0;l<s.length;l++){let{$from:a,$to:h}=s[l],c=t.mapping.slice(o);t.replaceRange(c.map(a.pos),c.map(h.pos),l?r.Ji.empty:e),0==l&&y(t,o,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,e){let n=t.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],l=t.mapping.slice(n),a=l.map(o.pos),h=l.map(s.pos);i?t.deleteRange(a,h):(t.replaceRangeWith(a,h,e),y(t,n,e.isInline?-1:1))}}static findFrom(t,e,n=!1){let r=t.parent.inlineContent?new c(t):g(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(let r=t.depth-1;r>=0;r--){let i=e<0?g(t.node(0),t.node(r),t.before(r+1),t.index(r),e,n):g(t.node(0),t.node(r),t.after(r+1),t.index(r)+1,e,n);if(i)return i}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new f(t.node(0))}static atStart(t){return g(t,t,0,0,1)||new f(t)}static atEnd(t){return g(t,t,t.content.size,t.childCount,-1)||new f(t)}static fromJSON(t,e){if(!e||!e.type)throw RangeError("Invalid input for Selection.fromJSON");let n=o[e.type];if(!n)throw RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in o)throw RangeError("Duplicate use of selection JSON ID "+t);return o[t]=e,e.prototype.jsonID=t,e}getBookmark(){return c.between(this.$anchor,this.$head).getBookmark()}}s.prototype.visible=!0;class l{constructor(t,e){this.$from=t,this.$to=e}}let a=!1;function h(t){a||t.parent.inlineContent||(a=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class c extends s{constructor(t,e=t){h(t),h(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return s.near(n);let r=t.resolve(e.map(this.anchor));return new c(r.parent.inlineContent?r:n,n)}replace(t,e=r.Ji.empty){if(super.replace(t,e),e==r.Ji.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof c&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new d(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new c(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}static between(t,e,n){let r=t.pos-e.pos;if((!n||r)&&(n=r>=0?1:-1),!e.parent.inlineContent){let t=s.findFrom(e,n,!0)||s.findFrom(e,-n,!0);if(!t)return s.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r?t=e:(t=(s.findFrom(t,-n,!0)||s.findFrom(t,n,!0)).$anchor).pos<e.pos==r<0||(t=e)),new c(t,e)}}s.jsonID("text",c);class d{constructor(t,e){this.anchor=t,this.head=e}map(t){return new d(t.map(this.anchor),t.map(this.head))}resolve(t){return c.between(t.resolve(this.anchor),t.resolve(this.head))}}class p extends s{constructor(t){let e=t.nodeAfter;super(t,t.node(0).resolve(t.pos+e.nodeSize)),this.node=e}map(t,e){let{deleted:n,pos:r}=e.mapResult(this.anchor),i=t.resolve(r);return n?s.near(i):new p(i)}content(){return new r.Ji(r.FK.from(this.node),0,0)}eq(t){return t instanceof p&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new u(this.anchor)}static fromJSON(t,e){if("number"!=typeof e.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new p(t.resolve(e.anchor))}static create(t,e){return new p(t.resolve(e))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}p.prototype.visible=!1,s.jsonID("node",p);class u{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:n}=t.mapResult(this.anchor);return e?new d(n,n):new u(n)}resolve(t){let e=t.resolve(this.anchor),n=e.nodeAfter;return n&&p.isSelectable(n)?new p(e):s.near(e)}}class f extends s{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}
vendor: 6,153 bytes, line 11
11replace(t,e=r.Ji.empty){if(e==r.Ji.empty){t.delete(0,t.doc.content.size);let e=s.atStart(t.doc);e.eq(t.selection)||t.setSelection(e)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new f(t)}map(t){return new f(t)}eq(t){return t instanceof f}getBookmark(){return m}}s.jsonID("all",f);let m={map(){return this},resolve:t=>new f(t)};function g(t,e,n,r,i,o=!1){if(e.inlineContent)return c.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let r=e.child(s);if(r.isAtom){if(!o&&p.isSelectable(r))return p.create(t,n-(i<0?r.nodeSize:0))}else{let e=g(t,r,n+i,i<0?r.childCount:0,i,o);if(e)return e}n+=r.nodeSize*i}return null}function y(t,e,n){let r,o=t.steps.length-1;if(o<e)return;let l=t.steps[o];(l instanceof i.Ln||l instanceof i.Wg)&&(t.mapping.maps[o].forEach((t,e,n,i)=>{null==r&&(r=i)}),t.setSelection(s.near(t.doc.resolve(r),n)))}class v extends i.dL{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return r.CU.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(t,e){super.addStep(t,e),this.updated=-3&this.updated,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.CU.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,n){let r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();{if(null==n&&(n=e),n=null==n?e:n,!t)return this.deleteRange(e,n);let i=this.storedMarks;if(!i){let t=this.doc.resolve(e);i=n==e?t.marks():t.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,i)),this.selection.empty||this.setSelection(s.near(this.selection.$to)),this}}setMeta(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function b(t,e){return e&&t?t.bind(e):t}class k{constructor(t,e,n){this.name=t,this.init=b(e.init,n),this.apply=b(e.apply,n)}}let x=[new k("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new k("selection",{init:(t,e)=>t.selection||s.atStart(e.doc),apply:t=>t.selection}),new k("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new k("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})];class w{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=x.slice(),e&&e.forEach(t=>{if(this.pluginsByKey[t.key])throw RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new k(t.key,t.spec.state,t))})}}class S{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,e=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=e){let e=this.config.plugins[n];if(e.spec.filterTransaction&&!e.spec.filterTransaction.call(e,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let e=[t],n=this.applyInner(t),r=null;for(;;){let 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,h=l<e.length&&s.spec.appendTransaction.call(s,l?e.slice(l):e,a,n);if(h&&n.filterTransaction(h,o)){if(h.setMeta("appendedTransaction",t),!r){r=[];for(let t=0;t<this.config.plugins.length;t++)r.push(t<o?{state:n,n:e.length}:{state:this,n:0})}e.push(h),n=n.applyInner(h),i=!0}r&&(r[o]={state:n,n:e.length})}}if(!i)return{state:n,transactions:e}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let e=new S(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];e[i.name]=i.apply(t,this[i.name],this,e)}return e}get tr(){return new v(this)}static create(t){let e=new w(t.doc?t.doc.type.schema:t.schema,t.plugins),n=new S(e);for(let r=0;r<e.fields.length;r++)n[e.fields[r].name]=e.fields[r].init(t,n);return n}reconfigure(t){let e=new w(this.schema,t.plugins),n=e.fields,r=new S(e);for(let e=0;e<n.length;e++){let i=n[e].name;r[i]=this.hasOwnProperty(i)?this[i]:n[e].init(t,r)}return r}toJSON(t){let e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map(t=>t.toJSON())),t&&"object"==typeof t)for(let n in t){if("doc"==n||"selection"==n)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=t[n],i=r.spec.state;i&&i.toJSON&&(e[n]=i.toJSON.call(r,this[r.key]))}return e}static fromJSON(t,e,n){if(!e)throw RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw RangeError("Required config field 'schema' missing");let i=new w(t.schema,t.plugins),o=new S(i);return i.fields.forEach(i=>
11{if("doc"==i.name)o.doc=r.bP.fromJSON(t.schema,e.doc);else if("selection"==i.name)o.selection=s.fromJSON(o.doc,e.selection);else if("storedMarks"==i.name)e.storedMarks&&(o.storedMarks=e.storedMarks.map(t.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(e,r)){o[i.name]=l.fromJSON.call(s,t,e[r],o);return}}o[i.name]=i.init(t,o)}}),o}}class C{constructor(t){this.spec=t,this.props={},t.props&&function t(e,n,r){for(let i in e){let o=e[i];o instanceof Function?o=o.bind(n):"handleDOMEvents"==i&&(o=t(o,n,{})),r[i]=o}return r}(t.props,this,this.props),this.key=t.key?t.key.key:A("plugin")}getState(t){return t[this.key]}}let M=Object.create(null);function A(t){return t in M?t+"$"+ ++M[t]:(M[t]=0,t+"$")}class O{constructor(t="key"){this.key=A(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}},72093:(t,e,n)=>{n.d(e,{$L:()=>T,Ln:()=>m,N0:()=>O,Um:()=>E,Wg:()=>g,X9:()=>s,dL:()=>P,jP:()=>b,n9:()=>M,oM:()=>k,zy:()=>C});var r=n(98836);class i{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class o{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&o.empty)return o.empty}recover(t){let e=0,n=65535&t;if(!this.inverted)for(let t=0;t<n;t++)e+=this.ranges[3*t+2]-this.ranges[3*t+1];return this.ranges[3*n]+e+(t-(65535&t))/65536}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,n){let r=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>t)break;let h=this.ranges[l+o],c=this.ranges[l+s],d=a+h;if(t<=d){let o=h?t==a?-1:t==d?1:e:e,s=a+r+(o<0?0:c);if(n)return s;let p=t==(e<0?a:d)?null:l/3+(t-a)*65536,u=t==a?2:t==d?1:4;return(e<0?t!=a:t!=d)&&(u|=8),new i(s,u,p)}r+=c-h}return n?t+r:new i(t+r,0,null)}touches(t,e){let n=0,r=65535&e,i=this.inverted?2:1,o=this.inverted?1:2;for(let e=0;e<this.ranges.length;e+=3){let s=this.ranges[e]-(this.inverted?n:0);if(s>t)break;let l=this.ranges[e+i];if(t<=s+l&&e==3*r)return!0;n+=this.ranges[e+o]-l}return!1}forEach(t){let e=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+e],h=this.ranges[r+n];t(s,s+a,l,l+h),i+=h-a}}invert(){return new o(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?o.empty:new o(t<0?[0,-t,0]:[0,0,t])}}o.empty=new o([]);class s{constructor(t,e,n=0,r=t?t.length:0){this.mirror=e,this.from=n,this.to=r,this._maps=t||[],this.ownData=!(t||e)}get maps(){return this._maps}slice(t=0,e=this.maps.length){return new s(this._maps,this.mirror,t,e)}appendMap(t,e){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),null!=e&&this.setMirror(this._maps.length-1,e)}appendMapping(t){for(let e=0,n=this._maps.length;e<t._maps.length;e++){let r=t.getMirror(e);this.appendMap(t._maps[e],null!=r&&r<e?n+r:void 0)}}getMirror(t){if(this.mirror){for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}}setMirror(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}appendMappingInverted(t){for(let e=t.maps.length-1,n=this._maps.length+t._maps.length;e>=0;e--){let r=t.getMirror(e);this.appendMap(t._maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}invert(){let t=new s;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;n<this.to;n++)t=this._maps[n].map(t,e);return t}mapResult(t,e=1){return this._map(t,e,!1)}_map(t,e,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(t,e);if(null!=i.recover){let e=this.getMirror(n);if(null!=e&&e>n&&e<this.to){n=e,t=this._maps[e].recover(i.recover);continue}}r|=i.delInfo,t=i.pos}return n?t:new i(t,r,null)}}let l=Object.create(null);class a{getMap(){return o.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw RangeError("Invalid input for Step.fromJSON");let n=l[e.stepType];if(!n)throw RangeError(`No step type ${e.stepType} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in l)throw RangeError("Duplicate use of step JSON ID "+t);return l[t]=e,e.prototype.jsonID=t,e}}class h{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new h(t,null)}static fail(t){return new h(null,t)}
vendor: 7,245 bytes, line 11
11static fromReplace(t,e,n,i){try{return h.ok(t.replace(e,n,i))}catch(t){if(t instanceof r.vI)return h.fail(t.message);throw t}}}function c(t,e,n){let i=[];for(let r=0;r<t.childCount;r++){let o=t.child(r);o.content.size&&(o=o.copy(c(o.content,e,o))),o.isInline&&(o=e(o,n,r)),i.push(o)}return r.FK.fromArray(i)}class d extends a{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=t.resolve(this.from),i=n.node(n.sharedDepth(this.to)),o=new r.Ji(c(e.content,(t,e)=>t.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t,i),e.openStart,e.openEnd);return h.fromReplace(t,this.from,this.to,o)}invert(){return new p(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new d(e.pos,n.pos,this.mark)}merge(t){return t instanceof d&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new d(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new d(e.from,e.to,t.markFromJSON(e.mark))}}a.jsonID("addMark",d);class p extends a{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new r.Ji(c(e.content,t=>t.mark(this.mark.removeFromSet(t.marks)),t),e.openStart,e.openEnd);return h.fromReplace(t,this.from,this.to,n)}invert(){return new d(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new p(e.pos,n.pos,this.mark)}merge(t){return t instanceof p&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new p(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new p(e.from,e.to,t.markFromJSON(e.mark))}}a.jsonID("removeMark",p);class u extends a{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return h.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return h.fromReplace(t,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;n<e.marks.length;n++)if(!e.marks[n].isInSet(t))return new u(this.pos,e.marks[n]);return new u(this.pos,this.mark)}}return new f(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new u(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new u(e.pos,t.markFromJSON(e.mark))}}a.jsonID("addNodeMark",u);class f extends a{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return h.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return h.fromReplace(t,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new u(this.pos,this.mark):this}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new f(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new f(e.pos,t.markFromJSON(e.mark))}}a.jsonID("removeNodeMark",f);class m extends a{constructor(t,e,n,r=!1){super(),this.from=t,this.to=e,this.slice=n,this.structure=r}apply(t){return this.structure&&y(t,this.from,this.to)?h.fail("Structure replace would overwrite content"):h.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new o([this.from,this.to-this.from,this.slice.size])}invert(t){return new m(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deletedAcross&&n.deletedAcross?null:new m(e.pos,Math.max(e.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof m)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let e=this.slice.size+t.slice.size==0?r.Ji.empty:new r.Ji(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new m(t.from,this.to,e,this.structure)}}{let e=this.slice.size+t.slice.size==0?r.Ji.empty:new r.Ji(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new m(this.from,this.to+(t.to-t.from),e,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new m(e.from,e.to,r.Ji.fromJSON(t,e.slice),!!e.structure)}}a.jsonID("replace",m);class g extends a{constructor(t,e,n,r,i,o,s=!1){super(),this.from=t,this.to=e,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(t){if(this.structure&&(y(t,this.from,this.gapFrom)||y(t,this.gapTo,this.to)))return h.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return h.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,e.content);return n?h.fromReplace(t,this.from,this.to,n):h.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(t){let e=this.gapTo-this.gapFrom;return new g(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1),r=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:t.map(this.gapTo,1);return e.deletedAcross&&n.deletedAcross||r<e.pos||i>n.pos?null:new g(e.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new g(e.from,e.to,e.gapFrom,e.gapTo,r.Ji.fromJSON(t,e.slice),e.insert,!!e.structure)}}function y(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>
110&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let t=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,i--}}return!1}function v(t,e,n,i=n.contentMatch,o=!0){let s=t.doc.nodeAt(e),l=[],a=e+1;for(let e=0;e<s.childCount;e++){let h=s.child(e),c=a+h.nodeSize,d=i.matchType(h.type);if(d){i=d;for(let e=0;e<h.marks.length;e++)n.allowsMarkType(h.marks[e].type)||t.step(new p(a,c,h.marks[e]));if(o&&h.isText&&"pre"!=n.whitespace){let t,e=/\r?\n|\r/g,i;for(;t=e.exec(h.text);)i||(i=new r.Ji(r.FK.from(n.schema.text(" ",n.allowedMarks(h.marks))),0,0)),l.push(new m(a+t.index,a+t.index+t[0].length,i))}}else l.push(new m(a,c,r.Ji.empty));a=c}if(!i.validEnd){let e=i.fillBefore(r.FK.empty,!0);t.replace(a,a,new r.Ji(e,0,0))}for(let e=l.length-1;e>=0;e--)t.step(l[e])}function b(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),i=t.$from.index(n),o=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(i,o,e))return n;if(0==n||r.type.spec.isolating||!((0==i||r.canReplace(i,r.childCount))&&(o==r.childCount||r.canReplace(0,o))))break}return null}function k(t,e,n=null,r=t){let i=function(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}(t,e),o=i&&function(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let t=r;l&&t<i;t++)l=l.matchType(n.child(t).type);return l&&l.validEnd?s:null}(r,e);return o?i.map(x).concat({type:e,attrs:n}).concat(o.map(x)):null}function x(t){return{type:t,attrs:null}}function w(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let i=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(i,i+1,e.type.schema.linebreakReplacement.create())}}})}function S(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let i=t.mapping.slice(r).map(n+1+o);t.replaceWith(i,i+1,e.type.schema.text("\n"))}})}function C(t,e,n=1,r){let i=t.resolve(e),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 t=i.depth-1,e=n-2;t>o;t--,e--){let n=i.node(t),o=i.index(t);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),l=r&&r[e+1];l&&(s=s.replaceChild(0,l.type.create(l.attrs)));let a=r&&r[e]||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 M(t,e){let n=t.resolve(e),r=n.index();return A(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function A(t,e){return!!(t&&e&&!t.isLeaf&&function(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let o=e.child(i),s=o.type==r?t.type.schema.nodes.text:o.type;if(!(n=n.matchType(s))||!t.type.allowsMarks(o.marks))return!1}return n.validEnd}(t,e))}function O(t,e,n=-1){let r=t.resolve(e);for(let t=r.depth;;t--){let i,o,s=r.index(t);if(t==r.depth?(i=r.nodeBefore,o=r.nodeAfter):n>0?(i=r.node(t+1),s++,o=r.node(t).maybeChild(s)):(i=r.node(t).maybeChild(s-1),o=r.node(t+1)),i&&!i.isTextblock&&A(i,o)&&r.node(t).canReplace(s,s+1))return e;if(0==t)break;e=n<0?r.before(t):r.after(t)}}function E(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let t=0;t<n.openStart;t++)i=i.firstChild.content;for(let t=1;t<=(0==n.openStart&&n.size?2:1);t++)for(let e=r.depth;e>=0;e--){let n=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,o=r.index(e)+(n>0?1:0),s=r.node(e),l=!1;if(1==t)l=s.canReplace(o,o,i);else{let t=s.contentMatchAt(o).findWrapping(i.firstChild.type);l=t&&s.canReplaceWith(o,o,t[0])}if(l)return 0==n?r.pos:n<0?r.before(e+1):r.after(e+1)}return null}function T(t,e,n=e,i=r.Ji.empty){if(e==n&&!i.size)return null;let o=t.resolve(e),s=t.resolve(n);return N(o,s,i)?new m(e,n,i):new I(o,s,i).fit()}function N(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}a.jsonID("replaceAround",g);class I{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=r.FK.empty;for(let e=0;e<=t.depth;e++){let n=t.node(e);this.frontier.push({type:n.type,match:n.contentMatchAt(t.indexAfter(e))})}for(let e=t.depth;e>0;e--)this.placed=r.FK.from(t.node(e).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(t<0?this.$to:n.doc.resolve(t));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 t>-1?new g(n.pos,t,this.$to.pos,this.$to.end(),a,e):a.size||n.pos!=this.$to.pos?new m(n.pos,i.pos,a):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<t;n++){let i=e.firstChild;if(e.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){t=n;break}e=i.content}for(let e=1;e<=2;e++)for(let n=1==e?t:this.unplaced.openStart;n>=0;n--){let t=null,i=(n?(t=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,h=null;if(1==e&&(i?l.matchType(i.type)||(h=l.fillBefore(r.FK.from(i),!1)):t&&s.compatibleContent(t.type)))return{sliceDepth:n,frontierDepth:o,parent:t,inject:h};
11if(2==e&&i&&(a=l.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:o,parent:t,wrap:a};if(t&&l.matchType(t.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,i=L(t,e);return!!i.childCount&&!i.firstChild.isLeaf&&(this.unplaced=new r.Ji(t,e+1,Math.max(n,i.size+e>=t.size-n?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,i=L(t,e);if(i.childCount<=1&&e>0){let o=t.size-e<=e+i.size;this.unplaced=new r.Ji(R(t,e-1,1),e-1,o?e-1:n)}else this.unplaced=new r.Ji(R(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:i,wrap:o}){for(;this.depth>e;)this.closeFrontierNode();if(o)for(let t=0;t<o.length;t++)this.openFrontierNode(o[t]);let s=this.unplaced,l=n?n.content:s.content,a=s.openStart-t,h=0,c=[],{match:d,type:p}=this.frontier[e];if(i){for(let t=0;t<i.childCount;t++)c.push(i.child(t));d=d.matchFragment(i)}let u=l.size+t-(s.content.size-s.openEnd);for(;h<l.childCount;){let t=l.child(h),e=d.matchType(t.type);if(!e)break;(++h>1||0==a||t.content.size)&&(d=e,c.push(function t(e,n,i){if(n<=0)return e;let o=e.content;return n>1&&(o=o.replaceChild(0,t(o.firstChild,n-1,1==o.childCount?i-1:0))),n>0&&(o=e.type.contentMatch.fillBefore(o).append(o),i<=0&&(o=o.append(e.type.contentMatch.matchFragment(o).fillBefore(r.FK.empty,!0)))),e.copy(o)}(t.mark(p.allowedMarks(t.marks)),1==h?a:0,h==l.childCount?u:-1)))}let f=h==l.childCount;f||(u=-1),this.placed=z(this.placed,e,r.FK.from(c)),this.frontier[e].match=d,f&&u<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let t=0,e=l;t<u;t++){let t=e.lastChild;this.frontier.push({type:t.type,match:t.contentMatchAt(t.childCount)}),e=t.content}this.unplaced=f?0==t?r.Ji.empty:new r.Ji(R(s.content,t-1,1),t-1,u<0?s.openEnd:t-1):new r.Ji(R(s.content,t,h),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let t=this.frontier[this.depth],e;if(!t.type.isTextblock||!B(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return -1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(t){a:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],i=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),o=B(t,e,r,n,i);if(o){for(let n=e-1;n>=0;n--){let{match:e,type:r}=this.frontier[n],i=B(t,n,r,e,!0);if(!i||i.childCount)continue a}return{depth:e,fit:o,move:i?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=z(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),r=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,r)}return t}openFrontierNode(t,e=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=z(this.placed,this.depth,r.FK.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(r.FK.empty,!0);t.childCount&&(this.placed=z(this.placed,this.frontier.length,t))}}function R(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(R(t.firstChild.content,e-1,n)))}function z(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(z(t.lastChild.content,e-1,n)))}function L(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function B(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!function(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,o.content,s)?l:null}function $(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let r=t.start(i);if(r<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(r==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==r-1)&&n.push(i)}return n}class F extends a{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return h.fail("No node at attribute step's position");let n=Object.create(null);for(let t in e.attrs)n[t]=e.attrs[t];n[this.attr]=this.value;let i=e.type.create(n,null,e.marks);return h.fromReplace(t,this.pos,this.pos+1,new r.Ji(r.FK.from(i),0,e.isLeaf?0:1))}getMap(){return o.empty}invert(t){return new F(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new F(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new F(e.pos,e.attr,e.value)}}a.jsonID("attr",F);
11class j extends a{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let n in t.attrs)e[n]=t.attrs[n];e[this.attr]=this.value;let n=t.type.create(e,t.content,t.marks);return h.ok(n)}getMap(){return o.empty}invert(t){return new j(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,e){if("string"!=typeof e.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new j(e.attr,e.value)}}a.jsonID("docAttr",j);let J=class extends Error{};(J=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n}).prototype=Object.create(Error.prototype),J.prototype.constructor=J,J.prototype.name="TransformError";class P{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new s}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new J(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=r.Ji.empty){let i=T(this.doc,t,e,n);return i&&this.step(i),this}replaceWith(t,e,n){return this.replace(t,e,new r.Ji(r.FK.from(n),0,0))}delete(t,e){return this.replace(t,e,r.Ji.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return!function(t,e,n,i){if(!i.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),s=t.doc.resolve(n);if(N(o,s,i))return t.step(new m(e,n,i));let l=$(o,t.doc.resolve(n));0==l[l.length-1]&&l.pop();let a=-(o.depth+1);l.unshift(a);for(let t=o.depth,e=o.pos-1;t>0;t--,e--){let n=o.node(t).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;l.indexOf(t)>-1?a=t:o.before(t)==e&&l.splice(1,0,-t)}let h=l.indexOf(a),c=[],d=i.openStart;for(let t=i.content,e=0;;e++){let n=t.firstChild;if(c.push(n),e==i.openStart)break;t=n.content}for(let t=d-1;t>=0;t--){var p;let e=c[t],n=(p=e.type).spec.defining||p.spec.definingForContent;if(n&&!e.sameMarkup(o.node(Math.abs(a)-1)))d=t;else if(n||!e.type.isTextblock)break}for(let e=i.openStart;e>=0;e--){let a=(e+d+1)%(i.openStart+1),p=c[a];if(p)for(let e=0;e<l.length;e++){let c=l[(e+h)%l.length],d=!0;c<0&&(d=!1,c=-c);let u=o.node(c-1),f=o.index(c-1);if(u.canReplaceWith(f,f,p.type,p.marks))return t.replace(o.before(c),d?s.after(c):n,new r.Ji(function t(e,n,i,o,s){if(n<i){let r=e.firstChild;e=e.replaceChild(0,r.copy(t(r.content,n+1,i,o,r)))}if(n>o){let t=s.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(r.FK.empty,!0))}return e}(i.content,0,i.openStart,a),a,i.openEnd))}}let u=t.steps.length;for(let r=l.length-1;r>=0&&(t.replace(e,n,i),!(t.steps.length>u));r--){let t=l[r];t<0||(e=o.before(t),n=s.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){return!function(t,e,n,i){if(!i.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let r=function(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(let t=r.depth-1;t>=0;t--){let e=r.index(t);if(r.node(t).canReplaceWith(e,e,n))return r.before(t+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let t=r.depth-1;t>=0;t--){let e=r.indexAfter(t);if(r.node(t).canReplaceWith(e,e,n))return r.after(t+1);if(e<r.node(t).childCount)break}return null}(t.doc,e,i.type);null!=r&&(e=n=r)}t.replaceRange(e,n,new r.Ji(r.FK.from(i),0,0))}(this,t,e,n),this}deleteRange(t,e){return!function(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=$(r,i);for(let e=0;e<o.length;e++){let n=o[e],s=e==o.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return t.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 t.delete(r.before(n),i.after(n))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(e-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 t.delete(r.before(o),n);t.delete(e,n)}(this,t,e),this}lift(t,e){return!function(t,e,n){let{$from:i,$to:o,depth:s}=e,l=i.before(s+1),a=o.after(s+1),h=l,c=a,d=r.FK.empty,p=0;for(let t=s,e=!1;t>n;t--)e||i.index(t)>0?(e=!0,d=r.FK.from(i.node(t).copy(d)),p++):h--;let u=r.FK.empty,f=0;for(let t=s,e=!1;t>n;t--)e||o.after(t+1)<o.end(t)?(e=!0,u=r.FK.from(o.node(t).copy(u)),f++):c++;t.step(new g(h,c,l,a,new r.Ji(d.append(u),p,f),d.size-p,!0))}(this,t,e),this}join(t,e=1){return!function(t,e,n){let i=null,{linebreakReplacement:o}=t.doc.type.schema,s=t.doc.resolve(e-n),l=s.node().type;if(o&&l.inlineContent){let t="pre"==l.whitespace,e=!!l.contentMatch.matchType(o);t&&!e?i=!1:!t&&e&&(i=!0)}let a=t.steps.length;if(!1===i){let r=t.doc.resolve(e+n);S(t,r.node(),r.before(),a)}l.inlineContent&&v(t,e+n-1,l,s.node().contentMatchAt(s.index()),null==i);let h=t.mapping.slice(a),c=h.map(e-n);if(t.step(new m(c,h.map(e+n,-1),r.Ji.empty,!0)),!0===i){let e=t.doc.resolve(c);w(t,e.node(),e.before(),t.steps.length)}}(this,t,e),this}wrap(t,e){return!function(t,e,n){let i=r.FK.empty;for(let t=n.length-1;t>=0;t--){if(i.size){let e=n[t].type.contentMatch.matchFragment(i);if(!e||!e.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=r.FK.from(n[t].type.create(n[t].attrs,i))}let o=e.start,s=e.end;t.step(new g(o,s,o,s,new r.Ji(i,0,0),n.length,!0))}(this,t,e),this}setBlockType(t,e=t,n,i=null){return!function(t,e,n,i,o){if(!i.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(e,n)=>{var l,a;let h,c,d="function"==typeof o?o(e):o;if(e.isTextblock&&!e.hasMarkup(i,d)&&(l=t.doc,a=t.mapping.slice(s).map(n),c=(h=l.resolve(a)).index(),h.parent.canReplaceWith(c,c+1,i))){let o=null;if(i.schema.linebreakReplacement){let t="pre"==i.whitespace,e=!!i.contentMatch.matchType(i.schema.linebreakReplacement);t&&!e?o=!1:!t&&e&&(o=!0)}!1===o&&S(t,e,n,s),v(t,t.mapping.slice(s).map(n,1),i,void 0,null===o);let l=t.mapping.slice(s),a=l.map(n,1),h=l.map(n+e.nodeSize,1);return t.step(new g(a,h,a+1,h-1,new r.Ji(r.FK.from(i.create(d,null,e.marks)),0,0),1,!0)),!0===o&&w(t,e,n,s),!1}})}(this,t,e,n,i),this}setNodeMarkup(t,e,n=null,i){return!function(t,e,n,i,o){let s=t.doc.nodeAt(e);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 t.replaceWith(e,e+s.nodeSize,l);if(!n.validContent(s.content))throw RangeError("Invalid content for node type "+n.name);t.step(new g(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new r.Ji(r.FK.from(l),0,0),1,!0))}(this,t,e,n,i),this}setNodeAttribute(t,e,n){return this.step(new F(t,e,n)),this}setDocAttribute(t,e){return this.step(new j(t,e)),this}addNodeMark(t,e){return this.step(new u(t,e)),this}
11removeNodeMark(t,e){let n=this.doc.nodeAt(t);if(!n)throw RangeError("No node at position "+t);if(e instanceof r.CU)e.isInSet(n.marks)&&this.step(new f(t,e));else{let r=n.marks,i,o=[];for(;i=e.isInSet(r);)o.push(new f(t,i)),r=i.removeFromSet(r);for(let t=o.length-1;t>=0;t--)this.step(o[t])}return this}split(t,e=1,n){return!function(t,e,n=1,i){let o=t.doc.resolve(e),s=r.FK.empty,l=r.FK.empty;for(let t=o.depth,e=o.depth-n,a=n-1;t>e;t--,a--){s=r.FK.from(o.node(t).copy(s));let e=i&&i[a];l=r.FK.from(e?e.type.create(e.attrs,l):o.node(t).copy(l))}t.step(new m(e,e,new r.Ji(s.append(l),n,n),!0))}(this,t,e,n),this}addMark(t,e,n){var r;let i,o,s,l;return r=this,s=[],l=[],r.doc.nodesBetween(t,e,(r,a,h)=>{if(!r.isInline)return;let c=r.marks;if(!n.isInSet(c)&&h.type.allowsMarkType(n.type)){let h=Math.max(a,t),u=Math.min(a+r.nodeSize,e),f=n.addToSet(c);for(let t=0;t<c.length;t++)c[t].isInSet(f)||(i&&i.to==h&&i.mark.eq(c[t])?i.to=u:s.push(i=new p(h,u,c[t])));o&&o.to==h?o.to=u:l.push(o=new d(h,u,n))}}),s.forEach(t=>r.step(t)),l.forEach(t=>r.step(t)),this}removeMark(t,e,n){var i;let o,s;return i=this,o=[],s=0,i.doc.nodesBetween(t,e,(i,l)=>{if(!i.isInline)return;s++;let a=null;if(n instanceof r.sX){let t=i.marks,e;for(;e=n.isInSet(t);)(a||(a=[])).push(e),t=e.removeFromSet(t)}else n?n.isInSet(i.marks)&&(a=[n]):a=i.marks;if(a&&a.length){let n=Math.min(l+i.nodeSize,e);for(let e=0;e<a.length;e++){let r=a[e],i;for(let t=0;t<o.length;t++){let e=o[t];e.step==s-1&&r.eq(o[t].style)&&(i=e)}i?(i.to=n,i.step=s):o.push({style:r,from:Math.max(l,t),to:n,step:s})}}}),o.forEach(t=>i.step(new p(t.from,t.to,t.style))),this}clearIncompatible(t,e,n){return v(this,t,e,n),this}}}}]);
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.