@simoncomputing/mui-bueno-v2 0.32.2 → 0.32.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +578 -565
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -77,7 +77,7 @@ theme.transitions = createTransitions(theme.transitions || {});
|
|
|
77
77
|
|
|
78
78
|
export default theme;`}function Hm(t={},...e){const{breakpoints:n,mixins:r={},spacing:o,palette:i={},transitions:s={},typography:a={},shape:l,...u}=t;if(t.vars&&t.generateThemeVars===void 0)throw new Error(process.env.NODE_ENV!=="production"?"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.":Lo(20));const f=Vm(i),p=vd(t);let m=Bn(p,{mixins:fL(p.breakpoints,r),palette:f,shadows:bL.slice(),typography:hL(f,a),transitions:wL(s),zIndex:{...SL}});if(m=Bn(m,u),m=e.reduce((b,v)=>Bn(b,v),m),process.env.NODE_ENV!=="production"){const b=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],v=(y,x)=>{let S;for(S in y){const k=y[S];if(b.includes(S)&&Object.keys(k).length>0){if(process.env.NODE_ENV!=="production"){const T=Ke("",S);console.error([`MUI: The \`${x}\` component increases the CSS specificity of the \`${S}\` internal state.`,"You can not override it like this: ",JSON.stringify(y,null,2),"",`Instead, you need to use the '&.${T}' syntax:`,JSON.stringify({root:{[`&.${T}`]:k}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
|
|
79
79
|
`))}y[S]={}}}};Object.keys(m.components).forEach(y=>{const x=m.components[y].styleOverrides;x&&y.startsWith("Mui")&&v(x,y)})}return m.unstable_sxConfig={...oc,...u==null?void 0:u.unstable_sxConfig},m.unstable_sx=function(v){return Rs({sx:v,theme:this})},m.toRuntimeSource=nw,m}function Wm(t){let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,Math.round(e*10)/1e3}const TL=[...Array(25)].map((t,e)=>{if(e===0)return"none";const n=Wm(e);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function rw(t){return{inputPlaceholder:t==="dark"?.5:.42,inputUnderline:t==="dark"?.7:.42,switchTrackDisabled:t==="dark"?.2:.12,switchTrack:t==="dark"?.3:.38}}function ow(t){return t==="dark"?TL:[]}function kL(t){const{palette:e={mode:"light"},opacity:n,overlays:r,...o}=t,i=Vm(e);return{palette:i,opacity:{...rw(i.mode),...n},overlays:r||ow(i.mode),...o}}function EL(t){var e;return!!t[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!t[0].match(/sxConfig$/)||t[0]==="palette"&&!!((e=t[1])!=null&&e.match(/(mode|contrastThreshold|tonalOffset)/))}const OL=t=>[...[...Array(25)].map((e,n)=>`--${t?`${t}-`:""}overlays-${n}`),`--${t?`${t}-`:""}palette-AppBar-darkBg`,`--${t?`${t}-`:""}palette-AppBar-darkColor`],ML=t=>(e,n)=>{const r=t.rootSelector||":root",o=t.colorSchemeSelector;let i=o;if(o==="class"&&(i=".%s"),o==="data"&&(i="[data-%s]"),o!=null&&o.startsWith("data-")&&!o.includes("%s")&&(i=`[${o}="%s"]`),t.defaultColorScheme===e){if(e==="dark"){const s={};return OL(t.cssVarPrefix).forEach(a=>{s[a]=n[a],delete n[a]}),i==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:s}}:i?{[i.replace("%s",e)]:s,[`${r}, ${i.replace("%s",e)}`]:n}:{[r]:{...n,...s}}}if(i&&i!=="media")return`${r}, ${i.replace("%s",String(e))}`}else if(e){if(i==="media")return{[`@media (prefers-color-scheme: ${String(e)})`]:{[r]:n}};if(i)return i.replace("%s",String(e))}return r};function _L(t,e){e.forEach(n=>{t[n]||(t[n]={})})}function xe(t,e,n){!t[e]&&n&&(t[e]=n)}function lc(t){return typeof t!="string"||!t.startsWith("hsl")?t:jx(t)}function fi(t,e){`${e}Channel`in t||(t[`${e}Channel`]=ic(lc(t[e]),`MUI: Can't create \`palette.${e}Channel\` because \`palette.${e}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
|
|
80
|
-
To suppress this warning, you need to explicitly provide the \`palette.${e}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function IL(t){return typeof t=="number"?`${t}px`:typeof t=="string"||typeof t=="function"||Array.isArray(t)?t:"8px"}const Fo=t=>{try{return t()}catch{}},DL=(t="mui")=>U$(t);function jm(t,e,n,r){if(!e)return;e=e===!0?{}:e;const o=r==="dark"?"dark":"light";if(!n){t[r]=kL({...e,palette:{mode:o,...e==null?void 0:e.palette}});return}const{palette:i,...s}=Hm({...n,palette:{mode:o,...e==null?void 0:e.palette}});return t[r]={...e,palette:i,opacity:{...rw(o),...e==null?void 0:e.opacity},overlays:(e==null?void 0:e.overlays)||ow(o)},s}function AL(t={},...e){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:o=!1,cssVarPrefix:i="mui",shouldSkipGeneratingVar:s=EL,colorSchemeSelector:a=n.light&&n.dark?"media":void 0,rootSelector:l=":root",...u}=t,f=Object.keys(n)[0],p=r||(n.light&&f!=="light"?"light":f),m=DL(i),{[p]:b,light:v,dark:y,...x}=n,S={...x};let k=b;if((p==="dark"&&!("dark"in n)||p==="light"&&!("light"in n))&&(k=!0),!k)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${p}\` option is either missing or invalid.`:Lo(21,p));const T=jm(S,k,u,p);v&&!S.light&&jm(S,v,void 0,"light"),y&&!S.dark&&jm(S,y,void 0,"dark");let C={defaultColorScheme:p,...T,cssVarPrefix:i,colorSchemeSelector:a,rootSelector:l,getCssVar:m,colorSchemes:S,font:{...dL(T.typography),...T.font},spacing:IL(u.spacing)};Object.keys(C.colorSchemes).forEach(V=>{const M=C.colorSchemes[V].palette,B=H=>{const F=H.split("-"),P=F[1],_=F[2];return m(H,M[P][_])};if(M.mode==="light"&&(xe(M.common,"background","#fff"),xe(M.common,"onBackground","#000")),M.mode==="dark"&&(xe(M.common,"background","#000"),xe(M.common,"onBackground","#fff")),_L(M,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),M.mode==="light"){xe(M.Alert,"errorColor",Ft(M.error.light,.6)),xe(M.Alert,"infoColor",Ft(M.info.light,.6)),xe(M.Alert,"successColor",Ft(M.success.light,.6)),xe(M.Alert,"warningColor",Ft(M.warning.light,.6)),xe(M.Alert,"errorFilledBg",B("palette-error-main")),xe(M.Alert,"infoFilledBg",B("palette-info-main")),xe(M.Alert,"successFilledBg",B("palette-success-main")),xe(M.Alert,"warningFilledBg",B("palette-warning-main")),xe(M.Alert,"errorFilledColor",Fo(()=>M.getContrastText(M.error.main))),xe(M.Alert,"infoFilledColor",Fo(()=>M.getContrastText(M.info.main))),xe(M.Alert,"successFilledColor",Fo(()=>M.getContrastText(M.success.main))),xe(M.Alert,"warningFilledColor",Fo(()=>M.getContrastText(M.warning.main))),xe(M.Alert,"errorStandardBg",Rt(M.error.light,.9)),xe(M.Alert,"infoStandardBg",Rt(M.info.light,.9)),xe(M.Alert,"successStandardBg",Rt(M.success.light,.9)),xe(M.Alert,"warningStandardBg",Rt(M.warning.light,.9)),xe(M.Alert,"errorIconColor",B("palette-error-main")),xe(M.Alert,"infoIconColor",B("palette-info-main")),xe(M.Alert,"successIconColor",B("palette-success-main")),xe(M.Alert,"warningIconColor",B("palette-warning-main")),xe(M.AppBar,"defaultBg",B("palette-grey-100")),xe(M.Avatar,"defaultBg",B("palette-grey-400")),xe(M.Button,"inheritContainedBg",B("palette-grey-300")),xe(M.Button,"inheritContainedHoverBg",B("palette-grey-A100")),xe(M.Chip,"defaultBorder",B("palette-grey-400")),xe(M.Chip,"defaultAvatarColor",B("palette-grey-700")),xe(M.Chip,"defaultIconColor",B("palette-grey-700")),xe(M.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),xe(M.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),xe(M.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),xe(M.LinearProgress,"primaryBg",Rt(M.primary.main,.62)),xe(M.LinearProgress,"secondaryBg",Rt(M.secondary.main,.62)),xe(M.LinearProgress,"errorBg",Rt(M.error.main,.62)),xe(M.LinearProgress,"infoBg",Rt(M.info.main,.62)),xe(M.LinearProgress,"successBg",Rt(M.success.main,.62)),xe(M.LinearProgress,"warningBg",Rt(M.warning.main,.62)),xe(M.Skeleton,"bg",`rgba(${B("palette-text-primaryChannel")} / 0.11)`),xe(M.Slider,"primaryTrack",Rt(M.primary.main,.62)),xe(M.Slider,"secondaryTrack",Rt(M.secondary.main,.62)),xe(M.Slider,"errorTrack",Rt(M.error.main,.62)),xe(M.Slider,"infoTrack",Rt(M.info.main,.62)),xe(M.Slider,"successTrack",Rt(M.success.main,.62)),xe(M.Slider,"warningTrack",Rt(M.warning.main,.62));const H=Td(M.background.default,.8);xe(M.SnackbarContent,"bg",H),xe(M.SnackbarContent,"color",Fo(()=>M.getContrastText(H))),xe(M.SpeedDialAction,"fabHoverBg",Td(M.background.paper,.15)),xe(M.StepConnector,"border",B("palette-grey-400")),xe(M.StepContent,"border",B("palette-grey-400")),xe(M.Switch,"defaultColor",B("palette-common-white")),xe(M.Switch,"defaultDisabledColor",B("palette-grey-100")),xe(M.Switch,"primaryDisabledColor",Rt(M.primary.main,.62)),xe(M.Switch,"secondaryDisabledColor",Rt(M.secondary.main,.62)),xe(M.Switch,"errorDisabledColor",Rt(M.error.main,.62)),xe(M.Switch,"infoDisabledColor",Rt(M.info.main,.62)),xe(M.Switch,"successDisabledColor",Rt(M.success.main,.62)),xe(M.Switch,"warningDisabledColor",Rt(M.warning.main,.62)),xe(M.TableCell,"border",Rt(Cd(M.divider,1),.88)),xe(M.Tooltip,"bg",Cd(M.grey[700],.92))}if(M.mode==="dark"){xe(M.Alert,"errorColor",Rt(M.error.light,.6)),xe(M.Alert,"infoColor",Rt(M.info.light,.6)),xe(M.Alert,"successColor",Rt(M.success.light,.6)),xe(M.Alert,"warningColor",Rt(M.warning.light,.6)),xe(M.Alert,"errorFilledBg",B("palette-error-dark")),xe(M.Alert,"infoFilledBg",B("palette-info-dark")),xe(M.Alert,"successFilledBg",B("palette-success-dark")),xe(M.Alert,"warningFilledBg",B("palette-warning-dark")),xe(M.Alert,"errorFilledColor",Fo(()=>M.getContrastText(M.error.dark))),xe(M.Alert,"infoFilledColor",Fo(()=>M.getContrastText(M.info.dark))),xe(M.Alert,"successFilledColor",Fo(()=>M.getContrastText(M.success.dark))),xe(M.Alert,"warningFilledColor",Fo(()=>M.getContrastText(M.warning.dark))),xe(M.Alert,"errorStandardBg",Ft(M.error.light,.9)),xe(M.Alert,"infoStandardBg",Ft(M.info.light,.9)),xe(M.Alert,"successStandardBg",Ft(M.success.light,.9)),xe(M.Alert,"warningStandardBg",Ft(M.warning.light,.9)),xe(M.Alert,"errorIconColor",B("palette-error-main")),xe(M.Alert,"infoIconColor",B("palette-info-main")),xe(M.Alert,"successIconColor",B("palette-success-main")),xe(M.Alert,"warningIconColor",B("palette-warning-main")),xe(M.AppBar,"defaultBg",B("palette-grey-900")),xe(M.AppBar,"darkBg",B("palette-background-paper")),xe(M.AppBar,"darkColor",B("palette-text-primary")),xe(M.Avatar,"defaultBg",B("palette-grey-600")),xe(M.Button,"inheritContainedBg",B("palette-grey-800")),xe(M.Button,"inheritContainedHoverBg",B("palette-grey-700")),xe(M.Chip,"defaultBorder",B("palette-grey-700")),xe(M.Chip,"defaultAvatarColor",B("palette-grey-300")),xe(M.Chip,"defaultIconColor",B("palette-grey-300")),xe(M.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),xe(M.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),xe(M.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),xe(M.LinearProgress,"primaryBg",Ft(M.primary.main,.5)),xe(M.LinearProgress,"secondaryBg",Ft(M.secondary.main,.5)),xe(M.LinearProgress,"errorBg",Ft(M.error.main,.5)),xe(M.LinearProgress,"infoBg",Ft(M.info.main,.5)),xe(M.LinearProgress,"successBg",Ft(M.success.main,.5)),xe(M.LinearProgress,"warningBg",Ft(M.warning.main,.5)),xe(M.Skeleton,"bg",`rgba(${B("palette-text-primaryChannel")} / 0.13)`),xe(M.Slider,"primaryTrack",Ft(M.primary.main,.5)),xe(M.Slider,"secondaryTrack",Ft(M.secondary.main,.5)),xe(M.Slider,"errorTrack",Ft(M.error.main,.5)),xe(M.Slider,"infoTrack",Ft(M.info.main,.5)),xe(M.Slider,"successTrack",Ft(M.success.main,.5)),xe(M.Slider,"warningTrack",Ft(M.warning.main,.5));const H=Td(M.background.default,.98);xe(M.SnackbarContent,"bg",H),xe(M.SnackbarContent,"color",Fo(()=>M.getContrastText(H))),xe(M.SpeedDialAction,"fabHoverBg",Td(M.background.paper,.15)),xe(M.StepConnector,"border",B("palette-grey-600")),xe(M.StepContent,"border",B("palette-grey-600")),xe(M.Switch,"defaultColor",B("palette-grey-300")),xe(M.Switch,"defaultDisabledColor",B("palette-grey-600")),xe(M.Switch,"primaryDisabledColor",Ft(M.primary.main,.55)),xe(M.Switch,"secondaryDisabledColor",Ft(M.secondary.main,.55)),xe(M.Switch,"errorDisabledColor",Ft(M.error.main,.55)),xe(M.Switch,"infoDisabledColor",Ft(M.info.main,.55)),xe(M.Switch,"successDisabledColor",Ft(M.success.main,.55)),xe(M.Switch,"warningDisabledColor",Ft(M.warning.main,.55)),xe(M.TableCell,"border",Ft(Cd(M.divider,1),.68)),xe(M.Tooltip,"bg",Cd(M.grey[700],.92))}fi(M.background,"default"),fi(M.background,"paper"),fi(M.common,"background"),fi(M.common,"onBackground"),fi(M,"divider"),Object.keys(M).forEach(H=>{const F=M[H];H!=="tonalOffset"&&F&&typeof F=="object"&&(F.main&&xe(M[H],"mainChannel",ic(lc(F.main))),F.light&&xe(M[H],"lightChannel",ic(lc(F.light))),F.dark&&xe(M[H],"darkChannel",ic(lc(F.dark))),F.contrastText&&xe(M[H],"contrastTextChannel",ic(lc(F.contrastText))),H==="text"&&(fi(M[H],"primary"),fi(M[H],"secondary")),H==="action"&&(F.active&&fi(M[H],"active"),F.selected&&fi(M[H],"selected")))})}),C=e.reduce((V,M)=>Bn(V,M),C);const O={prefix:i,disableCssColorScheme:o,shouldSkipGeneratingVar:s,getSelector:ML(C)},{vars:I,generateThemeVars:N,generateStyleSheets:L}=Y$(C,O);return C.vars=I,Object.entries(C.colorSchemes[C.defaultColorScheme]).forEach(([V,M])=>{C[V]=M}),C.generateThemeVars=N,C.generateStyleSheets=L,C.generateSpacing=function(){return Px(u.spacing,fd(this))},C.getColorSchemeSelector=G$(a),C.spacing=C.generateSpacing(),C.shouldSkipGeneratingVar=s,C.unstable_sxConfig={...oc,...u==null?void 0:u.unstable_sxConfig},C.unstable_sx=function(M){return Rs({sx:M,theme:this})},C.toRuntimeSource=nw,C}function iw(t,e,n){t.colorSchemes&&n&&(t.colorSchemes[e]={...n!==!0&&n,palette:Vm({...n===!0?{}:n.palette,mode:e})})}function sw(t={},...e){const{palette:n,cssVariables:r=!1,colorSchemes:o=n?void 0:{light:!0},defaultColorScheme:i=n==null?void 0:n.mode,...s}=t,a=i||"light",l=o==null?void 0:o[a],u={...o,...n?{[a]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in t))return Hm(t,...e);let f=n;"palette"in t||u[a]&&(u[a]!==!0?f=u[a].palette:a==="dark"&&(f={mode:"dark"}));const p=Hm({...t,palette:f},...e);return p.defaultColorScheme=a,p.colorSchemes=u,p.palette.mode==="light"&&(p.colorSchemes.light={...u.light!==!0&&u.light,palette:p.palette},iw(p,"dark",u.dark)),p.palette.mode==="dark"&&(p.colorSchemes.dark={...u.dark!==!0&&u.dark,palette:p.palette},iw(p,"light",u.light)),p}return!n&&!("light"in u)&&a==="light"&&(u.light=!0),AL({...s,colorSchemes:u,defaultColorScheme:a,...typeof r!="boolean"&&r},...e)}const kd=sw(),Ya="$$material";function So(){const t=xd(kd);return process.env.NODE_ENV!=="production"&&A.useDebugValue(t),t[Ya]||t}function aw(t){return g.jsx($x,{...t,defaultTheme:kd,themeId:Ya})}process.env.NODE_ENV!=="production"&&(aw.propTypes={styles:c.oneOfType([c.array,c.func,c.number,c.object,c.string,c.bool])});function lw(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const Kr=t=>lw(t)&&t!=="classes",te=Fx({themeId:Ya,defaultTheme:kd,rootShouldForwardProp:Kr});function PL(t){return function(n){return g.jsx(aw,{styles:typeof t=="function"?r=>t({theme:r,...n}):t})}}function NL(){return Pm}const bt=j$;process.env.NODE_ENV!=="production"&&(c.node,c.object.isRequired);function mt(t){return W$(t)}function $L(t){return Ke("MuiSvgIcon",t)}const cw=je("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]),LL=t=>{const{color:e,fontSize:n,classes:r}=t,o={root:["root",e!=="inherit"&&`color${Ne(e)}`,`fontSize${Ne(n)}`]};return qe(o,$L,r)},BL=te("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="inherit"&&e[`color${Ne(n.color)}`],e[`fontSize${Ne(n.fontSize)}`]]}})(bt(({theme:t})=>{var e,n,r,o,i,s,a,l,u,f,p,m,b,v;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(o=(e=t.transitions)==null?void 0:e.create)==null?void 0:o.call(e,"fill",{duration:(r=(n=(t.vars??t).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:y=>!y.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((s=(i=t.typography)==null?void 0:i.pxToRem)==null?void 0:s.call(i,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((l=(a=t.typography)==null?void 0:a.pxToRem)==null?void 0:l.call(a,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((f=(u=t.typography)==null?void 0:u.pxToRem)==null?void 0:f.call(u,35))||"2.1875rem"}},...Object.entries((t.vars??t).palette).filter(([,y])=>y&&y.main).map(([y])=>{var x,S;return{props:{color:y},style:{color:(S=(x=(t.vars??t).palette)==null?void 0:x[y])==null?void 0:S.main}}}),{props:{color:"action"},style:{color:(m=(p=(t.vars??t).palette)==null?void 0:p.action)==null?void 0:m.active}},{props:{color:"disabled"},style:{color:(v=(b=(t.vars??t).palette)==null?void 0:b.action)==null?void 0:v.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),Ed=A.forwardRef(function(e,n){const r=mt({props:e,name:"MuiSvgIcon"}),{children:o,className:i,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:u,inheritViewBox:f=!1,titleAccess:p,viewBox:m="0 0 24 24",...b}=r,v=A.isValidElement(o)&&o.type==="svg",y={...r,color:s,component:a,fontSize:l,instanceFontSize:e.fontSize,inheritViewBox:f,viewBox:m,hasSvgAsChild:v},x={};f||(x.viewBox=m);const S=LL(y);return g.jsxs(BL,{as:a,className:ge(S.root,i),focusable:"false",color:u,"aria-hidden":p?void 0:!0,role:p?"img":void 0,ref:n,...x,...b,...v&&o.props,ownerState:y,children:[v?o.props.children:o,p?g.jsx("title",{children:p}):null]})});process.env.NODE_ENV!=="production"&&(Ed.propTypes={children:c.node,classes:c.object,className:c.string,color:c.oneOfType([c.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),c.string]),component:c.elementType,fontSize:c.oneOfType([c.oneOf(["inherit","large","medium","small"]),c.string]),htmlColor:c.string,inheritViewBox:c.bool,shapeRendering:c.string,sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),titleAccess:c.string,viewBox:c.string}),Ed.muiName="SvgIcon";function Le(t,e){function n(r,o){return g.jsx(Ed,{"data-testid":`${e}Icon`,ref:o,...r,children:t})}return process.env.NODE_ENV!=="production"&&(n.displayName=`${e}Icon`),n.muiName=Ed.muiName,A.memo(A.forwardRef(n))}function FL(t,e){if(!t)return e;if(typeof t=="function"||typeof e=="function")return o=>{const i=typeof e=="function"?e(o):e,s=typeof t=="function"?t({...o,...i}):t,a=ge(o==null?void 0:o.className,i==null?void 0:i.className,s==null?void 0:s.className);return{...i,...s,...!!a&&{className:a},...(i==null?void 0:i.style)&&(s==null?void 0:s.style)&&{style:{...i.style,...s.style}},...(i==null?void 0:i.sx)&&(s==null?void 0:s.sx)&&{sx:[...Array.isArray(i.sx)?i.sx:[i.sx],...Array.isArray(s.sx)?s.sx:[s.sx]]}}};const n=e,r=ge(n==null?void 0:n.className,t==null?void 0:t.className);return{...e,...t,...!!r&&{className:r},...(n==null?void 0:n.style)&&(t==null?void 0:t.style)&&{style:{...n.style,...t.style}},...(n==null?void 0:n.sx)&&(t==null?void 0:t.sx)&&{sx:[...Array.isArray(n.sx)?n.sx:[n.sx],...Array.isArray(t.sx)?t.sx:[t.sx]]}}}const uw=Le(g.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error"),Um=({icon:t,offset:e=".2rem",...n})=>g.jsx(z.Box,{component:"span",sx:{display:"inline-flex",alignItems:"center",position:"relative",mr:.5,top:e},children:g.jsx(t,{fontSize:"inherit",...n})}),br=t=>{const{name:e,id:n,className:r,errorMode:o="normal"}=t,[i,s,a]=Ht.useField(e),{error:l}=s;if(o!=="hidden"&&!(o==="collapse"&&!l))return g.jsxs(z.Typography,{id:n,"data-testid":`test-${n}`,variant:"caption",display:"block",color:"error",style:{visibility:l?"visible":"hidden"},className:r,fontSize:".9rem",children:[g.jsx(Um,{icon:uw,offset:".15rem"}),l]})},dw=J.createContext(!1),fw=({readOnly:t=!0,children:e})=>g.jsx(dw.Provider,{value:t,children:e}),Hs=()=>J.useContext(dw),pw=J.createContext({showDiff:!1,getPreviousValue:()=>{},getCurrentValue:()=>{}}),hw=({showDiff:t=!0,previousSnapshot:e=null,currentSnapshot:n=null,children:r})=>{const o=(s,a)=>mw(e,s,a),i=(s,a)=>mw(n,s,a);return g.jsx(pw.Provider,{value:{showDiff:t,getPreviousValue:o,getCurrentValue:i},children:g.jsx(fw,{children:r})})},mw=(t,e,n)=>(e?e.replace(/\[(\d+)\]/g,".$1").split(".").reduce((r,o)=>r==null?void 0:r[o],t):t)??n,Ws=()=>J.useContext(pw);function qn(t){this.content=t}qn.prototype={constructor:qn,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 e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return o==-1?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new qn(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new qn(n)},addToStart:function(t,e){return new qn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new qn(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(i==-1?o.length:i,0,e,n),new qn(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=qn.from(t),t.size?new qn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=qn.from(t),t.size?new qn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=qn.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}},qn.from=function(t){if(t instanceof qn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new qn(e)};function gw(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=gw(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function yw(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let u=0,f=Math.min(s.text.length,a.text.length);for(;u<f&&s.text[s.text.length-u-1]==a.text[a.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let u=yw(s.content,a.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class Oe{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,i){for(let s=0,a=0;a<n;s++){let l=this.content[s],u=a+l.nodeSize;if(u>e&&r(l,o+a,i||null,s)!==!1&&l.content.size){let f=a+1;l.nodesBetween(Math.max(0,e-f),Math.min(l.content.size,n-f),r,o+f)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let i="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(s?s=!1:i+=r),i+=u},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)o.push(e.content[i]);return new Oe(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let i=0,s=0;s<n;i++){let a=this.content[i],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),o+=a.nodeSize),s=l}return new Oe(r,o)}cutByIndex(e,n){return e==n?Oe.empty:e==0&&n==this.content.length?this:new Oe(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new Oe(o,i)}addToStart(e){return new Oe([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Oe(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return gw(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return yw(this,e,n,r)}findIndex(e){if(e==0)return Od(0,e);if(e==this.size)return Od(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=this.child(n),i=r+o.nodeSize;if(i>=e)return i==e?Od(n+1,i):Od(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return Oe.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Oe(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Oe.empty;let n,r=0;for(let o=0;o<e.length;o++){let i=e[o];r+=i.nodeSize,o&&i.isText&&e[o-1].sameMarkup(i)?(n||(n=e.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new Oe(n||e,r)}static from(e){if(!e)return Oe.empty;if(e instanceof Oe)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Oe([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Oe.empty=new Oe([],0);const qm={index:0,offset:0};function Od(t,e){return qm.index=t,qm.offset=e,qm}function Md(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))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 r=0;r<t.length;r++)if(!Md(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Md(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let zt=class D1{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let i=e[o];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,o));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Md(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return D1.none;if(e instanceof D1)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};zt.none=[];class _d extends Error{}class Fe{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=vw(this.content,e+this.openStart,n);return r&&new Fe(r,this.openStart,this.openEnd)}removeBetween(e,n){return new Fe(bw(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return Fe.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Fe(Oe.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new Fe(e,r,o)}}Fe.empty=new Fe(Oe.empty,0,0);function bw(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(bw(i.content,e-o-1,n-o-1)))}function vw(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=vw(s.content,e-i-1,n,s);return a&&t.replaceChild(o,s.copy(a))}function RL(t,e,n){if(n.openStart>t.depth)throw new _d("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new _d("Inconsistent open depths");return xw(t,e,n,0)}function xw(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=xw(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return Us(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=zL(n,t);return Us(i,Sw(t,s,a,e,r))}else return Us(i,Id(t,e,r))}function ww(t,e){if(!e.type.compatibleContent(t.type))throw new _d("Cannot join "+e.type.name+" onto "+t.type.name)}function Km(t,e,n){let r=t.node(n);return ww(r,e.node(n)),r}function js(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 cc(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(js(t.nodeAfter,r),i++));for(let a=i;a<s;a++)js(o.child(a),r);e&&e.depth==n&&e.textOffset&&js(e.nodeBefore,r)}function Us(t,e){return t.type.checkContent(e),t.copy(e)}function Sw(t,e,n,r,o){let i=t.depth>o&&Km(t,e,o+1),s=r.depth>o&&Km(n,r,o+1),a=[];return cc(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(ww(i,s),js(Us(i,Sw(t,e,n,r,o+1)),a)):(i&&js(Us(i,Id(t,e,o+1)),a),cc(e,n,o,a),s&&js(Us(s,Id(n,r,o+1)),a)),cc(r,null,o,a),new Oe(a)}function Id(t,e,n){let r=[];if(cc(null,t,n,r),t.depth>n){let o=Km(t,e,n+1);js(Us(o,Id(t,e,n+1)),r)}return cc(e,null,n,r),new Oe(r)}function zL(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)o=e.node(i).copy(Oe.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class uc{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)o+=r.child(i).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return zt.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let a=r;r=o,o=a}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!o||!i[s].isInSet(o.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Dd(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(i),u=i-l;if(r.push(s,a,o+l),!u||(s=s.child(a),s.isText))break;i=u-1,o+=l+1}return new uc(n,r,i)}static resolveCached(e,n){let r=Cw.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==n)return s}else Cw.set(e,r=new VL);let o=r.elts[r.i]=uc.resolve(e,n);return r.i=(r.i+1)%HL,o}}class VL{constructor(){this.elts=[],this.i=0}}const HL=12,Cw=new WeakMap;class Dd{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const WL=Object.create(null);let pi=class A1{constructor(e,n,r,o=zt.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||Oe.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,o=0){this.content.nodesBetween(e,n,r,o,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,o){return this.content.textBetween(e,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Md(this.attrs,n||e.defaultAttrs||WL)&&zt.sameSet(this.marks,r||zt.none)}copy(e=null){return e==this.content?this:new A1(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new A1(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return Fe.empty;let o=this.resolve(e),i=this.resolve(n),s=r?0:o.sharedDepth(n),a=o.start(s),u=o.node(s).content.cut(o.pos-a,i.pos-a);return new Fe(u,o.depth-s,i.depth-s)}replace(e,n,r){return RL(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return uc.resolveCached(this,e)}resolveNoCache(e){return uc.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Tw(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=Oe.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=o;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=zt.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!zt.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=Oe.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};pi.prototype.text=void 0;class Ad extends pi{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Tw(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Ad(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ad(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Tw(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class qs{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new jL(e,n);if(r.next==null)return qs.empty;let o=kw(r);r.next&&r.err("Unexpected trailing text");let i=XL(JL(o));return ZL(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let i=n;o&&i<r;i++)o=o.matchType(e.child(i).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function i(s,a){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return Oe.from(a.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:f,next:p}=s.next[u];if(!(f.isText||f.hasRequiredAttrs())&&o.indexOf(p)==-1){o.push(p);let m=i(p,a.concat(f));if(m)return m}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(e)){let s=[];for(let a=o;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:a,next:l}=i.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!o.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:o}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
|
|
80
|
+
To suppress this warning, you need to explicitly provide the \`palette.${e}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function IL(t){return typeof t=="number"?`${t}px`:typeof t=="string"||typeof t=="function"||Array.isArray(t)?t:"8px"}const Fo=t=>{try{return t()}catch{}},DL=(t="mui")=>U$(t);function jm(t,e,n,r){if(!e)return;e=e===!0?{}:e;const o=r==="dark"?"dark":"light";if(!n){t[r]=kL({...e,palette:{mode:o,...e==null?void 0:e.palette}});return}const{palette:i,...s}=Hm({...n,palette:{mode:o,...e==null?void 0:e.palette}});return t[r]={...e,palette:i,opacity:{...rw(o),...e==null?void 0:e.opacity},overlays:(e==null?void 0:e.overlays)||ow(o)},s}function AL(t={},...e){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:o=!1,cssVarPrefix:i="mui",shouldSkipGeneratingVar:s=EL,colorSchemeSelector:a=n.light&&n.dark?"media":void 0,rootSelector:l=":root",...u}=t,f=Object.keys(n)[0],p=r||(n.light&&f!=="light"?"light":f),m=DL(i),{[p]:b,light:v,dark:y,...x}=n,S={...x};let k=b;if((p==="dark"&&!("dark"in n)||p==="light"&&!("light"in n))&&(k=!0),!k)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${p}\` option is either missing or invalid.`:Lo(21,p));const T=jm(S,k,u,p);v&&!S.light&&jm(S,v,void 0,"light"),y&&!S.dark&&jm(S,y,void 0,"dark");let C={defaultColorScheme:p,...T,cssVarPrefix:i,colorSchemeSelector:a,rootSelector:l,getCssVar:m,colorSchemes:S,font:{...dL(T.typography),...T.font},spacing:IL(u.spacing)};Object.keys(C.colorSchemes).forEach(V=>{const M=C.colorSchemes[V].palette,B=H=>{const F=H.split("-"),P=F[1],_=F[2];return m(H,M[P][_])};if(M.mode==="light"&&(xe(M.common,"background","#fff"),xe(M.common,"onBackground","#000")),M.mode==="dark"&&(xe(M.common,"background","#000"),xe(M.common,"onBackground","#fff")),_L(M,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),M.mode==="light"){xe(M.Alert,"errorColor",Ft(M.error.light,.6)),xe(M.Alert,"infoColor",Ft(M.info.light,.6)),xe(M.Alert,"successColor",Ft(M.success.light,.6)),xe(M.Alert,"warningColor",Ft(M.warning.light,.6)),xe(M.Alert,"errorFilledBg",B("palette-error-main")),xe(M.Alert,"infoFilledBg",B("palette-info-main")),xe(M.Alert,"successFilledBg",B("palette-success-main")),xe(M.Alert,"warningFilledBg",B("palette-warning-main")),xe(M.Alert,"errorFilledColor",Fo(()=>M.getContrastText(M.error.main))),xe(M.Alert,"infoFilledColor",Fo(()=>M.getContrastText(M.info.main))),xe(M.Alert,"successFilledColor",Fo(()=>M.getContrastText(M.success.main))),xe(M.Alert,"warningFilledColor",Fo(()=>M.getContrastText(M.warning.main))),xe(M.Alert,"errorStandardBg",Rt(M.error.light,.9)),xe(M.Alert,"infoStandardBg",Rt(M.info.light,.9)),xe(M.Alert,"successStandardBg",Rt(M.success.light,.9)),xe(M.Alert,"warningStandardBg",Rt(M.warning.light,.9)),xe(M.Alert,"errorIconColor",B("palette-error-main")),xe(M.Alert,"infoIconColor",B("palette-info-main")),xe(M.Alert,"successIconColor",B("palette-success-main")),xe(M.Alert,"warningIconColor",B("palette-warning-main")),xe(M.AppBar,"defaultBg",B("palette-grey-100")),xe(M.Avatar,"defaultBg",B("palette-grey-400")),xe(M.Button,"inheritContainedBg",B("palette-grey-300")),xe(M.Button,"inheritContainedHoverBg",B("palette-grey-A100")),xe(M.Chip,"defaultBorder",B("palette-grey-400")),xe(M.Chip,"defaultAvatarColor",B("palette-grey-700")),xe(M.Chip,"defaultIconColor",B("palette-grey-700")),xe(M.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),xe(M.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),xe(M.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),xe(M.LinearProgress,"primaryBg",Rt(M.primary.main,.62)),xe(M.LinearProgress,"secondaryBg",Rt(M.secondary.main,.62)),xe(M.LinearProgress,"errorBg",Rt(M.error.main,.62)),xe(M.LinearProgress,"infoBg",Rt(M.info.main,.62)),xe(M.LinearProgress,"successBg",Rt(M.success.main,.62)),xe(M.LinearProgress,"warningBg",Rt(M.warning.main,.62)),xe(M.Skeleton,"bg",`rgba(${B("palette-text-primaryChannel")} / 0.11)`),xe(M.Slider,"primaryTrack",Rt(M.primary.main,.62)),xe(M.Slider,"secondaryTrack",Rt(M.secondary.main,.62)),xe(M.Slider,"errorTrack",Rt(M.error.main,.62)),xe(M.Slider,"infoTrack",Rt(M.info.main,.62)),xe(M.Slider,"successTrack",Rt(M.success.main,.62)),xe(M.Slider,"warningTrack",Rt(M.warning.main,.62));const H=Td(M.background.default,.8);xe(M.SnackbarContent,"bg",H),xe(M.SnackbarContent,"color",Fo(()=>M.getContrastText(H))),xe(M.SpeedDialAction,"fabHoverBg",Td(M.background.paper,.15)),xe(M.StepConnector,"border",B("palette-grey-400")),xe(M.StepContent,"border",B("palette-grey-400")),xe(M.Switch,"defaultColor",B("palette-common-white")),xe(M.Switch,"defaultDisabledColor",B("palette-grey-100")),xe(M.Switch,"primaryDisabledColor",Rt(M.primary.main,.62)),xe(M.Switch,"secondaryDisabledColor",Rt(M.secondary.main,.62)),xe(M.Switch,"errorDisabledColor",Rt(M.error.main,.62)),xe(M.Switch,"infoDisabledColor",Rt(M.info.main,.62)),xe(M.Switch,"successDisabledColor",Rt(M.success.main,.62)),xe(M.Switch,"warningDisabledColor",Rt(M.warning.main,.62)),xe(M.TableCell,"border",Rt(Cd(M.divider,1),.88)),xe(M.Tooltip,"bg",Cd(M.grey[700],.92))}if(M.mode==="dark"){xe(M.Alert,"errorColor",Rt(M.error.light,.6)),xe(M.Alert,"infoColor",Rt(M.info.light,.6)),xe(M.Alert,"successColor",Rt(M.success.light,.6)),xe(M.Alert,"warningColor",Rt(M.warning.light,.6)),xe(M.Alert,"errorFilledBg",B("palette-error-dark")),xe(M.Alert,"infoFilledBg",B("palette-info-dark")),xe(M.Alert,"successFilledBg",B("palette-success-dark")),xe(M.Alert,"warningFilledBg",B("palette-warning-dark")),xe(M.Alert,"errorFilledColor",Fo(()=>M.getContrastText(M.error.dark))),xe(M.Alert,"infoFilledColor",Fo(()=>M.getContrastText(M.info.dark))),xe(M.Alert,"successFilledColor",Fo(()=>M.getContrastText(M.success.dark))),xe(M.Alert,"warningFilledColor",Fo(()=>M.getContrastText(M.warning.dark))),xe(M.Alert,"errorStandardBg",Ft(M.error.light,.9)),xe(M.Alert,"infoStandardBg",Ft(M.info.light,.9)),xe(M.Alert,"successStandardBg",Ft(M.success.light,.9)),xe(M.Alert,"warningStandardBg",Ft(M.warning.light,.9)),xe(M.Alert,"errorIconColor",B("palette-error-main")),xe(M.Alert,"infoIconColor",B("palette-info-main")),xe(M.Alert,"successIconColor",B("palette-success-main")),xe(M.Alert,"warningIconColor",B("palette-warning-main")),xe(M.AppBar,"defaultBg",B("palette-grey-900")),xe(M.AppBar,"darkBg",B("palette-background-paper")),xe(M.AppBar,"darkColor",B("palette-text-primary")),xe(M.Avatar,"defaultBg",B("palette-grey-600")),xe(M.Button,"inheritContainedBg",B("palette-grey-800")),xe(M.Button,"inheritContainedHoverBg",B("palette-grey-700")),xe(M.Chip,"defaultBorder",B("palette-grey-700")),xe(M.Chip,"defaultAvatarColor",B("palette-grey-300")),xe(M.Chip,"defaultIconColor",B("palette-grey-300")),xe(M.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),xe(M.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),xe(M.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),xe(M.LinearProgress,"primaryBg",Ft(M.primary.main,.5)),xe(M.LinearProgress,"secondaryBg",Ft(M.secondary.main,.5)),xe(M.LinearProgress,"errorBg",Ft(M.error.main,.5)),xe(M.LinearProgress,"infoBg",Ft(M.info.main,.5)),xe(M.LinearProgress,"successBg",Ft(M.success.main,.5)),xe(M.LinearProgress,"warningBg",Ft(M.warning.main,.5)),xe(M.Skeleton,"bg",`rgba(${B("palette-text-primaryChannel")} / 0.13)`),xe(M.Slider,"primaryTrack",Ft(M.primary.main,.5)),xe(M.Slider,"secondaryTrack",Ft(M.secondary.main,.5)),xe(M.Slider,"errorTrack",Ft(M.error.main,.5)),xe(M.Slider,"infoTrack",Ft(M.info.main,.5)),xe(M.Slider,"successTrack",Ft(M.success.main,.5)),xe(M.Slider,"warningTrack",Ft(M.warning.main,.5));const H=Td(M.background.default,.98);xe(M.SnackbarContent,"bg",H),xe(M.SnackbarContent,"color",Fo(()=>M.getContrastText(H))),xe(M.SpeedDialAction,"fabHoverBg",Td(M.background.paper,.15)),xe(M.StepConnector,"border",B("palette-grey-600")),xe(M.StepContent,"border",B("palette-grey-600")),xe(M.Switch,"defaultColor",B("palette-grey-300")),xe(M.Switch,"defaultDisabledColor",B("palette-grey-600")),xe(M.Switch,"primaryDisabledColor",Ft(M.primary.main,.55)),xe(M.Switch,"secondaryDisabledColor",Ft(M.secondary.main,.55)),xe(M.Switch,"errorDisabledColor",Ft(M.error.main,.55)),xe(M.Switch,"infoDisabledColor",Ft(M.info.main,.55)),xe(M.Switch,"successDisabledColor",Ft(M.success.main,.55)),xe(M.Switch,"warningDisabledColor",Ft(M.warning.main,.55)),xe(M.TableCell,"border",Ft(Cd(M.divider,1),.68)),xe(M.Tooltip,"bg",Cd(M.grey[700],.92))}fi(M.background,"default"),fi(M.background,"paper"),fi(M.common,"background"),fi(M.common,"onBackground"),fi(M,"divider"),Object.keys(M).forEach(H=>{const F=M[H];H!=="tonalOffset"&&F&&typeof F=="object"&&(F.main&&xe(M[H],"mainChannel",ic(lc(F.main))),F.light&&xe(M[H],"lightChannel",ic(lc(F.light))),F.dark&&xe(M[H],"darkChannel",ic(lc(F.dark))),F.contrastText&&xe(M[H],"contrastTextChannel",ic(lc(F.contrastText))),H==="text"&&(fi(M[H],"primary"),fi(M[H],"secondary")),H==="action"&&(F.active&&fi(M[H],"active"),F.selected&&fi(M[H],"selected")))})}),C=e.reduce((V,M)=>Bn(V,M),C);const O={prefix:i,disableCssColorScheme:o,shouldSkipGeneratingVar:s,getSelector:ML(C)},{vars:I,generateThemeVars:N,generateStyleSheets:L}=Y$(C,O);return C.vars=I,Object.entries(C.colorSchemes[C.defaultColorScheme]).forEach(([V,M])=>{C[V]=M}),C.generateThemeVars=N,C.generateStyleSheets=L,C.generateSpacing=function(){return Px(u.spacing,fd(this))},C.getColorSchemeSelector=G$(a),C.spacing=C.generateSpacing(),C.shouldSkipGeneratingVar=s,C.unstable_sxConfig={...oc,...u==null?void 0:u.unstable_sxConfig},C.unstable_sx=function(M){return Rs({sx:M,theme:this})},C.toRuntimeSource=nw,C}function iw(t,e,n){t.colorSchemes&&n&&(t.colorSchemes[e]={...n!==!0&&n,palette:Vm({...n===!0?{}:n.palette,mode:e})})}function sw(t={},...e){const{palette:n,cssVariables:r=!1,colorSchemes:o=n?void 0:{light:!0},defaultColorScheme:i=n==null?void 0:n.mode,...s}=t,a=i||"light",l=o==null?void 0:o[a],u={...o,...n?{[a]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in t))return Hm(t,...e);let f=n;"palette"in t||u[a]&&(u[a]!==!0?f=u[a].palette:a==="dark"&&(f={mode:"dark"}));const p=Hm({...t,palette:f},...e);return p.defaultColorScheme=a,p.colorSchemes=u,p.palette.mode==="light"&&(p.colorSchemes.light={...u.light!==!0&&u.light,palette:p.palette},iw(p,"dark",u.dark)),p.palette.mode==="dark"&&(p.colorSchemes.dark={...u.dark!==!0&&u.dark,palette:p.palette},iw(p,"light",u.light)),p}return!n&&!("light"in u)&&a==="light"&&(u.light=!0),AL({...s,colorSchemes:u,defaultColorScheme:a,...typeof r!="boolean"&&r},...e)}const kd=sw(),Ya="$$material";function So(){const t=xd(kd);return process.env.NODE_ENV!=="production"&&A.useDebugValue(t),t[Ya]||t}function aw(t){return g.jsx($x,{...t,defaultTheme:kd,themeId:Ya})}process.env.NODE_ENV!=="production"&&(aw.propTypes={styles:c.oneOfType([c.array,c.func,c.number,c.object,c.string,c.bool])});function lw(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const Kr=t=>lw(t)&&t!=="classes",te=Fx({themeId:Ya,defaultTheme:kd,rootShouldForwardProp:Kr});function PL(t){return function(n){return g.jsx(aw,{styles:typeof t=="function"?r=>t({theme:r,...n}):t})}}function NL(){return Pm}const bt=j$;process.env.NODE_ENV!=="production"&&(c.node,c.object.isRequired);function mt(t){return W$(t)}function $L(t){return Ke("MuiSvgIcon",t)}const cw=je("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]),LL=t=>{const{color:e,fontSize:n,classes:r}=t,o={root:["root",e!=="inherit"&&`color${Ne(e)}`,`fontSize${Ne(n)}`]};return qe(o,$L,r)},BL=te("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="inherit"&&e[`color${Ne(n.color)}`],e[`fontSize${Ne(n.fontSize)}`]]}})(bt(({theme:t})=>{var e,n,r,o,i,s,a,l,u,f,p,m,b,v;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(o=(e=t.transitions)==null?void 0:e.create)==null?void 0:o.call(e,"fill",{duration:(r=(n=(t.vars??t).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:y=>!y.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((s=(i=t.typography)==null?void 0:i.pxToRem)==null?void 0:s.call(i,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((l=(a=t.typography)==null?void 0:a.pxToRem)==null?void 0:l.call(a,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((f=(u=t.typography)==null?void 0:u.pxToRem)==null?void 0:f.call(u,35))||"2.1875rem"}},...Object.entries((t.vars??t).palette).filter(([,y])=>y&&y.main).map(([y])=>{var x,S;return{props:{color:y},style:{color:(S=(x=(t.vars??t).palette)==null?void 0:x[y])==null?void 0:S.main}}}),{props:{color:"action"},style:{color:(m=(p=(t.vars??t).palette)==null?void 0:p.action)==null?void 0:m.active}},{props:{color:"disabled"},style:{color:(v=(b=(t.vars??t).palette)==null?void 0:b.action)==null?void 0:v.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),Ed=A.forwardRef(function(e,n){const r=mt({props:e,name:"MuiSvgIcon"}),{children:o,className:i,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:u,inheritViewBox:f=!1,titleAccess:p,viewBox:m="0 0 24 24",...b}=r,v=A.isValidElement(o)&&o.type==="svg",y={...r,color:s,component:a,fontSize:l,instanceFontSize:e.fontSize,inheritViewBox:f,viewBox:m,hasSvgAsChild:v},x={};f||(x.viewBox=m);const S=LL(y);return g.jsxs(BL,{as:a,className:ge(S.root,i),focusable:"false",color:u,"aria-hidden":p?void 0:!0,role:p?"img":void 0,ref:n,...x,...b,...v&&o.props,ownerState:y,children:[v?o.props.children:o,p?g.jsx("title",{children:p}):null]})});process.env.NODE_ENV!=="production"&&(Ed.propTypes={children:c.node,classes:c.object,className:c.string,color:c.oneOfType([c.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),c.string]),component:c.elementType,fontSize:c.oneOfType([c.oneOf(["inherit","large","medium","small"]),c.string]),htmlColor:c.string,inheritViewBox:c.bool,shapeRendering:c.string,sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),titleAccess:c.string,viewBox:c.string}),Ed.muiName="SvgIcon";function Le(t,e){function n(r,o){return g.jsx(Ed,{"data-testid":`${e}Icon`,ref:o,...r,children:t})}return process.env.NODE_ENV!=="production"&&(n.displayName=`${e}Icon`),n.muiName=Ed.muiName,A.memo(A.forwardRef(n))}function FL(t,e){if(!t)return e;if(typeof t=="function"||typeof e=="function")return o=>{const i=typeof e=="function"?e(o):e,s=typeof t=="function"?t({...o,...i}):t,a=ge(o==null?void 0:o.className,i==null?void 0:i.className,s==null?void 0:s.className);return{...i,...s,...!!a&&{className:a},...(i==null?void 0:i.style)&&(s==null?void 0:s.style)&&{style:{...i.style,...s.style}},...(i==null?void 0:i.sx)&&(s==null?void 0:s.sx)&&{sx:[...Array.isArray(i.sx)?i.sx:[i.sx],...Array.isArray(s.sx)?s.sx:[s.sx]]}}};const n=e,r=ge(n==null?void 0:n.className,t==null?void 0:t.className);return{...e,...t,...!!r&&{className:r},...(n==null?void 0:n.style)&&(t==null?void 0:t.style)&&{style:{...n.style,...t.style}},...(n==null?void 0:n.sx)&&(t==null?void 0:t.sx)&&{sx:[...Array.isArray(n.sx)?n.sx:[n.sx],...Array.isArray(t.sx)?t.sx:[t.sx]]}}}const uw=Le(g.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error"),Um=({icon:t,offset:e=".2rem",...n})=>g.jsx(z.Box,{component:"span",sx:{display:"inline-flex",alignItems:"center",position:"relative",mr:.5,top:e},children:g.jsx(t,{fontSize:"inherit",...n})}),br=t=>{const{name:e,id:n,className:r,errorMode:o="normal"}=t,[i,s,a]=Ht.useField(e),{error:l}=s;if(o!=="hidden"&&!(o==="collapse"&&!l))return g.jsxs(z.Typography,{id:n,"data-testid":`test-${n}`,variant:"caption",display:"block",color:"error",style:{visibility:l?"visible":"hidden"},className:r,fontSize:".9rem",children:[g.jsx(Um,{icon:uw,offset:".15rem"}),l]})},dw=J.createContext(!1),fw=({readOnly:t=!0,children:e})=>g.jsx(dw.Provider,{value:t,children:e}),Hs=()=>J.useContext(dw),pw=J.createContext({showDiff:!1,getPreviousValue:()=>{},getCurrentValue:()=>{}}),hw=({showDiff:t=!0,previousSnapshot:e=null,currentSnapshot:n=null,children:r})=>{const o=J.useCallback((a,l)=>mw(e,a,l),[e]),i=J.useCallback((a,l)=>mw(n,a,l),[n]),s=J.useMemo(()=>({showDiff:t,getPreviousValue:o,getCurrentValue:i}),[t,o,i]);return g.jsx(pw.Provider,{value:s,children:g.jsx(fw,{children:r})})},mw=(t,e,n)=>(e?e.replace(/\[(\d+)\]/g,".$1").split(".").reduce((r,o)=>r==null?void 0:r[o],t):t)??n,Ws=()=>J.useContext(pw);function qn(t){this.content=t}qn.prototype={constructor:qn,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 e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return o==-1?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new qn(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new qn(n)},addToStart:function(t,e){return new qn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new qn(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(i==-1?o.length:i,0,e,n),new qn(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=qn.from(t),t.size?new qn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=qn.from(t),t.size?new qn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=qn.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}},qn.from=function(t){if(t instanceof qn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new qn(e)};function gw(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=gw(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function yw(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let u=0,f=Math.min(s.text.length,a.text.length);for(;u<f&&s.text[s.text.length-u-1]==a.text[a.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let u=yw(s.content,a.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class Oe{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,i){for(let s=0,a=0;a<n;s++){let l=this.content[s],u=a+l.nodeSize;if(u>e&&r(l,o+a,i||null,s)!==!1&&l.content.size){let f=a+1;l.nodesBetween(Math.max(0,e-f),Math.min(l.content.size,n-f),r,o+f)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let i="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(s?s=!1:i+=r),i+=u},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)o.push(e.content[i]);return new Oe(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let i=0,s=0;s<n;i++){let a=this.content[i],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),o+=a.nodeSize),s=l}return new Oe(r,o)}cutByIndex(e,n){return e==n?Oe.empty:e==0&&n==this.content.length?this:new Oe(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new Oe(o,i)}addToStart(e){return new Oe([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Oe(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return gw(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return yw(this,e,n,r)}findIndex(e){if(e==0)return Od(0,e);if(e==this.size)return Od(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=this.child(n),i=r+o.nodeSize;if(i>=e)return i==e?Od(n+1,i):Od(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return Oe.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Oe(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Oe.empty;let n,r=0;for(let o=0;o<e.length;o++){let i=e[o];r+=i.nodeSize,o&&i.isText&&e[o-1].sameMarkup(i)?(n||(n=e.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new Oe(n||e,r)}static from(e){if(!e)return Oe.empty;if(e instanceof Oe)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Oe([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Oe.empty=new Oe([],0);const qm={index:0,offset:0};function Od(t,e){return qm.index=t,qm.offset=e,qm}function Md(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))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 r=0;r<t.length;r++)if(!Md(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Md(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let zt=class D1{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let i=e[o];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,o));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Md(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return D1.none;if(e instanceof D1)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};zt.none=[];class _d extends Error{}class Fe{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=vw(this.content,e+this.openStart,n);return r&&new Fe(r,this.openStart,this.openEnd)}removeBetween(e,n){return new Fe(bw(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return Fe.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Fe(Oe.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new Fe(e,r,o)}}Fe.empty=new Fe(Oe.empty,0,0);function bw(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(bw(i.content,e-o-1,n-o-1)))}function vw(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=vw(s.content,e-i-1,n,s);return a&&t.replaceChild(o,s.copy(a))}function RL(t,e,n){if(n.openStart>t.depth)throw new _d("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new _d("Inconsistent open depths");return xw(t,e,n,0)}function xw(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=xw(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return Us(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=zL(n,t);return Us(i,Sw(t,s,a,e,r))}else return Us(i,Id(t,e,r))}function ww(t,e){if(!e.type.compatibleContent(t.type))throw new _d("Cannot join "+e.type.name+" onto "+t.type.name)}function Km(t,e,n){let r=t.node(n);return ww(r,e.node(n)),r}function js(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 cc(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(js(t.nodeAfter,r),i++));for(let a=i;a<s;a++)js(o.child(a),r);e&&e.depth==n&&e.textOffset&&js(e.nodeBefore,r)}function Us(t,e){return t.type.checkContent(e),t.copy(e)}function Sw(t,e,n,r,o){let i=t.depth>o&&Km(t,e,o+1),s=r.depth>o&&Km(n,r,o+1),a=[];return cc(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(ww(i,s),js(Us(i,Sw(t,e,n,r,o+1)),a)):(i&&js(Us(i,Id(t,e,o+1)),a),cc(e,n,o,a),s&&js(Us(s,Id(n,r,o+1)),a)),cc(r,null,o,a),new Oe(a)}function Id(t,e,n){let r=[];if(cc(null,t,n,r),t.depth>n){let o=Km(t,e,n+1);js(Us(o,Id(t,e,n+1)),r)}return cc(e,null,n,r),new Oe(r)}function zL(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)o=e.node(i).copy(Oe.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class uc{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)o+=r.child(i).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return zt.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let a=r;r=o,o=a}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!o||!i[s].isInSet(o.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Dd(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(i),u=i-l;if(r.push(s,a,o+l),!u||(s=s.child(a),s.isText))break;i=u-1,o+=l+1}return new uc(n,r,i)}static resolveCached(e,n){let r=Cw.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==n)return s}else Cw.set(e,r=new VL);let o=r.elts[r.i]=uc.resolve(e,n);return r.i=(r.i+1)%HL,o}}class VL{constructor(){this.elts=[],this.i=0}}const HL=12,Cw=new WeakMap;class Dd{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const WL=Object.create(null);let pi=class A1{constructor(e,n,r,o=zt.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||Oe.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,o=0){this.content.nodesBetween(e,n,r,o,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,o){return this.content.textBetween(e,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Md(this.attrs,n||e.defaultAttrs||WL)&&zt.sameSet(this.marks,r||zt.none)}copy(e=null){return e==this.content?this:new A1(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new A1(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return Fe.empty;let o=this.resolve(e),i=this.resolve(n),s=r?0:o.sharedDepth(n),a=o.start(s),u=o.node(s).content.cut(o.pos-a,i.pos-a);return new Fe(u,o.depth-s,i.depth-s)}replace(e,n,r){return RL(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return uc.resolveCached(this,e)}resolveNoCache(e){return uc.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Tw(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=Oe.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=o;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=zt.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!zt.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=Oe.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};pi.prototype.text=void 0;class Ad extends pi{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Tw(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Ad(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ad(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Tw(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class qs{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new jL(e,n);if(r.next==null)return qs.empty;let o=kw(r);r.next&&r.err("Unexpected trailing text");let i=XL(JL(o));return ZL(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let i=n;o&&i<r;i++)o=o.matchType(e.child(i).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function i(s,a){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return Oe.from(a.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:f,next:p}=s.next[u];if(!(f.isText||f.hasRequiredAttrs())&&o.indexOf(p)==-1){o.push(p);let m=i(p,a.concat(f));if(m)return m}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(e)){let s=[];for(let a=o;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:a,next:l}=i.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!o.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:o}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
|
|
81
81
|
`)}}qs.empty=new qs(!0);class jL{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function kw(t){let e=[];do e.push(UL(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function UL(t){let e=[];do e.push(qL(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function qL(t){let e=GL(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=KL(t,e);else break;return e}function Ew(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function KL(t,e){let n=Ew(t),r=n;return t.eat(",")&&(t.next!="}"?r=Ew(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function YL(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.isInGroup(e)&&o.push(s)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function GL(t){if(t.eat("(")){let e=kw(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=YL(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function JL(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let u={term:l,to:a};return e[s].push(u),u}function o(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,u)=>l.concat(i(u,a)),[]);if(s.type=="seq")for(let l=0;;l++){let u=i(s.exprs[l],a);if(l==s.exprs.length-1)return u;o(u,a=n())}else if(s.type=="star"){let l=n();return r(a,l),o(i(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return o(i(s.expr,a),l),o(i(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let u=0;u<s.min;u++){let f=n();o(i(s.expr,l),f),l=f}if(s.max==-1)o(i(s.expr,l),l);else for(let u=s.min;u<s.max;u++){let f=n();r(l,f),o(i(s.expr,l),f),l=f}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Ow(t,e){return e-t}function Mw(t,e){let n=[];return r(e),n.sort(Ow);function r(o){let i=t[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let s=0;s<i.length;s++){let{term:a,to:l}=i[s];!a&&n.indexOf(l)==-1&&r(l)}}}function XL(t){let e=Object.create(null);return n(Mw(t,0));function n(r){let o=[];r.forEach(s=>{t[s].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let f=0;f<o.length;f++)o[f][0]==a&&(u=o[f][1]);Mw(t,l).forEach(f=>{u||o.push([a,u=[]]),u.indexOf(f)==-1&&u.push(f)})})});let i=e[r.join(",")]=new qs(r.indexOf(t.length-1)>-1);for(let s=0;s<o.length;s++){let a=o[s][1].sort(Ow);i.next.push({type:o[s][0],next:e[a.join(",")]||n(a)})}return i}}function ZL(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],i=!o.validEnd,s=[];for(let a=0;a<o.next.length;a++){let{type:l,next:u}=o.next[a];s.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(u)==-1&&r.push(u)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function _w(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 Iw(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let i=t[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function Dw(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${o}`);for(let o in t){let i=t[o];i.validate&&i.validate(e[o])}}function Aw(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new eB(t,r,e[r]);return n}let Pw=class BP{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Aw(e,r.attrs),this.defaultAttrs=_w(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==qs.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Iw(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new pi(this,this.computeAttrs(e),Oe.from(n),zt.setFrom(r))}createChecked(e=null,n,r){return n=Oe.from(n),this.checkContent(n),new pi(this,this.computeAttrs(e),n,zt.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=Oe.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let o=this.contentMatch.matchFragment(n),i=o&&o.fillBefore(Oe.empty,!0);return i?new pi(this,e,n.append(i),zt.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Dw(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:zt.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,s)=>r[i]=new BP(i,n,s));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function QL(t,e,n){let r=n.split("|");return o=>{let i=o===null?"null":typeof o;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class eB{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?QL(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Pd{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=Aw(e,o.attrs),this.excluded=null;let i=_w(this.attrs);this.instance=i?new zt(this,i):null}create(e=null){return!e&&this.instance?this.instance:new zt(this,Iw(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((i,s)=>r[i]=new Pd(i,o++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){Dw(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}let Nw=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=qn.from(e.nodes),n.marks=qn.from(e.marks||{}),this.nodes=Pw.compile(this.spec.nodes,this),this.marks=Pd.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;if(i.contentMatch=r[s]||(r[s]=qs.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=a=="_"?null:a?$w(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:$w(this,s.split(" "))}this.nodeFromJSON=o=>pi.fromJSON(this,o),this.markFromJSON=o=>zt.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Pw){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,o)}text(e,n){let r=this.nodes.text;return new Ad(r,r.defaultAttrs,e,zt.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function $w(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(let a in t.marks){let l=t.marks[a];(o=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function tB(t){return t.tag!=null}function nB(t){return t.style!=null}class Ji{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(tB(o))this.tags.push(o);else if(nB(o)){let i=/[^=]*/.exec(o.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let i=e.nodes[o.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new Rw(this,n,!1);return r.addAll(e,zt.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Rw(this,n,!0);return r.addAll(e,zt.none,n.from,n.to),Fe.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(iB(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(e,n,r,o){for(let i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){let s=this.styles[i],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<i)break}n.splice(s,0,o)}for(let o in e.marks){let i=e.marks[o].spec.parseDOM;i&&i.forEach(s=>{r(s=zw(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in e.nodes){let i=e.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=zw(s)),s.node||s.ignore||s.mark||(s.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Ji(e,Ji.schemaRules(e)))}}const Lw={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},rB={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Bw={ol:!0,ul:!0},dc=1,Ym=2,fc=4;function Fw(t,e,n){return e!=null?(e?dc:0)|(e==="full"?Ym:0):t&&t.whitespace=="pre"?dc|Ym:n&~fc}class Nd{constructor(e,n,r,o,i,s){this.type=e,this.attrs=n,this.marks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=zt.none,this.match=i||(s&fc?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Oe.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&dc)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=Oe.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(Oe.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Lw.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Rw{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=n.topNode,i,s=Fw(null,n.preserveWhitespace,0)|(r?fc:0);o?i=new Nd(o.type,o.attrs,zt.none,!0,n.topMatch||o.type.contentMatch,s):r?i=new Nd(null,null,zt.none,!0,null,s):i=new Nd(e.schema.topNodeType,null,zt.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,o=this.top,i=o.options&Ym?"full":this.localPreserveWS||(o.options&dc)>0,{schema:s}=this.parser;if(i==="full"||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
|
|
82
82
|
`);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(s.linebreakReplacement.create(),n,!0),a[l]&&this.insertNode(s.text(a[l]),n,!/\S/.test(a[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=o.content[o.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),a;Bw.hasOwnProperty(s)&&this.parser.normalizeLists&&oB(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:rB.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let u,f=this.needsBlock;if(Lw.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),u=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let p=l&&l.skip?n:this.readStyles(e,n);p&&this.addAll(e,p),u&&this.sync(i),this.needsBlock=f}else{let u=this.readStyles(e,n);u&&this.addElementByRule(e,l,u,l.consuming===!1?a:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
83
83
|
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let i=this.parser.matchedStyles[o],s=r.getPropertyValue(i);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(i,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,o){let i,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}i&&this.sync(a)&&this.open--}addAll(e,n,r,o){let i=r||0;for(let s=r?e.childNodes[r]:e.firstChild,a=o==null?null:e.childNodes[o];s!=a;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,n);this.findAtPoint(e,i)}findPlace(e,n,r){let o,i;for(let s=this.open,a=0;s>=0;s--){let l=this.nodes[s],u=l.findWrapping(e);if(u&&(!o||o.length>u.length+a)&&(o=u,i=l,!u.length))break;if(l.solid){if(r)break;a+=2}}if(!o)return null;this.sync(i);for(let s=0;s<o.length;s++)n=this.enterInner(o[s],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let o=this.findPlace(e,n,r);if(o){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=zt.none;for(let a of o.concat(e.marks))(i.type?i.type.allowsMarkType(a.type):Vw(a.type,e.type))&&(s=a.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,n,r,o){let i=this.findPlace(e.create(n),r,!1);return i&&(i=this.enterInner(e,n,r,!0,o)),i}enterInner(e,n,r,o=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let a=Fw(e,i,s.options);s.options&fc&&s.content.length==0&&(a|=fc);let l=zt.none;return r=r.filter(u=>(s.type?s.type.allowsMarkType(u.type):Vw(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new Nd(e,n,l,o,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=dc)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let f=l>0||l==0&&o?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!f||f.name!=u&&!f.isInGroup(u))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function oB(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Bw.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function iB(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function zw(t){let e={};for(let n in t)e[n]=t[n];return e}function Vw(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=a=>{i.push(a);for(let l=0;l<a.edgeCount;l++){let{type:u,next:f}=a.edge(l);if(u==e||i.indexOf(f)<0&&s(f))return!0}};if(s(o.contentMatch))return!0}}class Ks{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Gm(n).createDocumentFragment());let o=r,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let a=0,l=0;for(;a<i.length&&l<s.marks.length;){let u=s.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(i[a][0])||u.type.spec.spanning===!1)break;a++,l++}for(;a<i.length;)o=i.pop()[1];for(;l<s.marks.length;){let u=s.marks[l++],f=this.serializeMark(u,s.isInline,n);f&&(i.push([u,o]),o.appendChild(f.dom),o=f.contentDOM||f.dom)}}o.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=$d(Gm(n),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let i=this.serializeMark(e.marks[o],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&$d(Gm(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return $d(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ks(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Hw(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Hw(e.marks)}}function Hw(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Gm(t){return t.document||window.document}const Ww=new WeakMap;function sB(t){let e=Ww.get(t);return e===void 0&&Ww.set(t,e=aB(t)),e}function aB(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o<r.length;o++)n(r[o]);else for(let o in r)n(r[o])}return n(t),e}function $d(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let o=e[0],i;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=sB(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=o.indexOf(" ");s>0&&(n=o.slice(0,s),o=o.slice(s+1));let a,l=n?t.createElementNS(n,o):t.createElement(o),u=e[1],f=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){f=2;for(let p in u)if(u[p]!=null){let m=p.indexOf(" ");m>0?l.setAttributeNS(p.slice(0,m),p.slice(m+1),u[p]):p=="style"&&l.style?l.style.cssText=u[p]:l.setAttribute(p,u[p])}}for(let p=f;p<e.length;p++){let m=e[p];if(m===0){if(p<e.length-1||p>f)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:b,contentDOM:v}=$d(t,m,n,r);if(l.appendChild(b),v){if(a)throw new RangeError("Multiple content holes");a=v}}}return{dom:l,contentDOM:a}}const jw=65535,Uw=Math.pow(2,16);function lB(t,e){return t+e*Uw}function qw(t){return t&jw}function cB(t){return(t-(t&jw))/Uw}const Kw=1,Yw=2,Ld=4,Gw=8;class Jm{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Gw)>0}get deletedBefore(){return(this.delInfo&(Kw|Ld))>0}get deletedAfter(){return(this.delInfo&(Yw|Ld))>0}get deletedAcross(){return(this.delInfo&Ld)>0}}class Ar{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Ar.empty)return Ar.empty}recover(e){let n=0,r=qw(e);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+cB(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?o:0);if(l>e)break;let u=this.ranges[a+i],f=this.ranges[a+s],p=l+u;if(e<=p){let m=u?e==l?-1:e==p?1:n:n,b=l+o+(m<0?0:f);if(r)return b;let v=e==(n<0?l:p)?null:lB(a/3,e-l),y=e==l?Yw:e==p?Kw:Ld;return(n<0?e!=l:e!=p)&&(y|=Gw),new Jm(b,y,v)}o+=f-u}return r?e+o:new Jm(e+o,0,null)}touches(e,n){let r=0,o=qw(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+i],f=l+u;if(e<=f&&a==o*3)return!0;r+=this.ranges[a+s]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o<this.ranges.length;o+=3){let s=this.ranges[o],a=s-(this.inverted?i:0),l=s+(this.inverted?0:i),u=this.ranges[o+n],f=this.ranges[o+r];e(a,a+u,l,l+f),i+=f-u}}invert(){return new Ar(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Ar.empty:new Ar(e<0?[0,-e,0]:[0,0,e])}}Ar.empty=new Ar([]);class pc{constructor(e,n,r=0,o=e?e.length:0){this.mirror=n,this.from=r,this.to=o,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new pc(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let o=e.getMirror(n);this.appendMap(e._maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e._maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new pc;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let i=this.from;i<this.to;i++){let s=this._maps[i],a=s.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,e=this._maps[l].recover(a.recover);continue}}o|=a.delInfo,e=a.pos}return r?e:new Jm(e,o,null)}}const Xm=Object.create(null);class nr{getMap(){return Ar.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Xm[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Xm)throw new RangeError("Duplicate use of step JSON ID "+e);return Xm[e]=n,n.prototype.jsonID=e,n}}class En{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new En(e,null)}static fail(e){return new En(null,e)}static fromReplace(e,n,r,o){try{return En.ok(e.replace(n,r,o))}catch(i){if(i instanceof _d)return En.fail(i.message);throw i}}}function Zm(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(Zm(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return Oe.fromArray(r)}class Xi extends nr{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new Fe(Zm(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return En.fromReplace(e,this.from,this.to,i)}invert(){return new Ro(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Xi(n.pos,r.pos,this.mark)}merge(e){return e instanceof Xi&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Xi(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Xi(n.from,n.to,e.markFromJSON(n.mark))}}nr.jsonID("addMark",Xi);class Ro extends nr{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new Fe(Zm(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return En.fromReplace(e,this.from,this.to,r)}invert(){return new Xi(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ro(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ro&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ro(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ro(n.from,n.to,e.markFromJSON(n.mark))}}nr.jsonID("removeMark",Ro);class Zi extends nr{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return En.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return En.fromReplace(e,this.pos,this.pos+1,new Fe(Oe.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new Zi(this.pos,n.marks[o]);return new Zi(this.pos,this.mark)}}return new Ys(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Zi(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Zi(n.pos,e.markFromJSON(n.mark))}}nr.jsonID("addNodeMark",Zi);class Ys extends nr{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return En.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return En.fromReplace(e,this.pos,this.pos+1,new Fe(Oe.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Zi(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Ys(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ys(n.pos,e.markFromJSON(n.mark))}}nr.jsonID("removeNodeMark",Ys);class Fn extends nr{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&Qm(e,this.from,this.to)?En.fail("Structure replace would overwrite content"):En.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ar([this.from,this.to-this.from,this.slice.size])}invert(e){return new Fn(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Fn(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Fn)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?Fe.empty:new Fe(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Fn(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?Fe.empty:new Fe(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Fn(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Fn(n.from,n.to,Fe.fromJSON(e,n.slice),!!n.structure)}}nr.jsonID("replace",Fn);class Rn extends nr{constructor(e,n,r,o,i,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Qm(e,this.from,this.gapFrom)||Qm(e,this.gapTo,this.to)))return En.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return En.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?En.fromReplace(e,this.from,this.to,r):En.fail("Content does not fit in gap")}getMap(){return new Ar([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Rn(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new Rn(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Rn(n.from,n.to,n.gapFrom,n.gapTo,Fe.fromJSON(e,n.slice),n.insert,!!n.structure)}}nr.jsonID("replaceAround",Rn);function Qm(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function uB(t,e,n,r){let o=[],i=[],s,a;t.doc.nodesBetween(e,n,(l,u,f)=>{if(!l.isInline)return;let p=l.marks;if(!r.isInSet(p)&&f.type.allowsMarkType(r.type)){let m=Math.max(u,e),b=Math.min(u+l.nodeSize,n),v=r.addToSet(p);for(let y=0;y<p.length;y++)p[y].isInSet(v)||(s&&s.to==m&&s.mark.eq(p[y])?s.to=b:o.push(s=new Ro(m,b,p[y])));a&&a.to==m?a.to=b:i.push(a=new Xi(m,b,r))}}),o.forEach(l=>t.step(l)),i.forEach(l=>t.step(l))}function dB(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof Pd){let u=s.marks,f;for(;f=r.isInSet(u);)(l||(l=[])).push(f),u=f.removeFromSet(u)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let u=Math.min(a+s.nodeSize,n);for(let f=0;f<l.length;f++){let p=l[f],m;for(let b=0;b<o.length;b++){let v=o[b];v.step==i-1&&p.eq(o[b].style)&&(m=v)}m?(m.to=u,m.step=i):o.push({style:p,from:Math.max(a,e),to:u,step:i})}}}),o.forEach(s=>t.step(new Ro(s.from,s.to,s.style)))}function eg(t,e,n,r=n.contentMatch,o=!0){let i=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l<i.childCount;l++){let u=i.child(l),f=a+u.nodeSize,p=r.matchType(u.type);if(!p)s.push(new Fn(a,f,Fe.empty));else{r=p;for(let m=0;m<u.marks.length;m++)n.allowsMarkType(u.marks[m].type)||t.step(new Ro(a,f,u.marks[m]));if(o&&u.isText&&n.whitespace!="pre"){let m,b=/\r?\n|\r/g,v;for(;m=b.exec(u.text);)v||(v=new Fe(Oe.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),s.push(new Fn(a+m.index,a+m.index+m[0].length,v))}}a=f}if(!r.validEnd){let l=r.fillBefore(Oe.empty,!0);t.replace(a,a,new Fe(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function fB(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Ga(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,o=0,i=0;;--r){let s=t.$from.node(r),a=t.$from.index(r)+o,l=t.$to.indexAfter(r)-i;if(r<t.depth&&s.canReplace(a,l,n))return r;if(r==0||s.type.spec.isolating||!fB(s,a,l))break;a&&(o=1),l<s.childCount&&(i=1)}return null}function pB(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),l=s,u=a,f=Oe.empty,p=0;for(let v=i,y=!1;v>n;v--)y||r.index(v)>0?(y=!0,f=Oe.from(r.node(v).copy(f)),p++):l--;let m=Oe.empty,b=0;for(let v=i,y=!1;v>n;v--)y||o.after(v+1)<o.end(v)?(y=!0,m=Oe.from(o.node(v).copy(m)),b++):u++;t.step(new Rn(l,u,s,a,new Fe(f.append(m),p,b),f.size-p,!0))}function tg(t,e,n=null,r=t){let o=hB(t,e),i=o&&mB(r,e);return i?o.map(Jw).concat({type:e,attrs:n}).concat(i.map(Jw)):null}function Jw(t){return{type:t,attrs:null}}function hB(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}function mB(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let u=r;l&&u<o;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:s}function gB(t,e,n){let r=Oe.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Oe.from(n[s].type.create(n[s].attrs,r))}let o=e.start,i=e.end;t.step(new Rn(o,i,o,i,new Fe(r,0,0),n.length,!0))}function yB(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{let l=typeof o=="function"?o(s):o;if(s.isTextblock&&!s.hasMarkup(r,l)&&bB(t.doc,t.mapping.slice(i).map(a),r)){let u=null;if(r.schema.linebreakReplacement){let b=r.whitespace=="pre",v=!!r.contentMatch.matchType(r.schema.linebreakReplacement);b&&!v?u=!1:!b&&v&&(u=!0)}u===!1&&Zw(t,s,a,i),eg(t,t.mapping.slice(i).map(a,1),r,void 0,u===null);let f=t.mapping.slice(i),p=f.map(a,1),m=f.map(a+s.nodeSize,1);return t.step(new Rn(p,m,p+1,m-1,new Fe(Oe.from(r.create(l,null,s.marks)),0,0),1,!0)),u===!0&&Xw(t,s,a,i),!1}})}function Xw(t,e,n,r){e.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let l=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function Zw(t,e,n,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+i);t.replaceWith(s,s+1,e.type.schema.text(`
|