ablok-components 0.2.48 → 0.2.49
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/dist/ablok-components.es.js +803 -805
- package/dist/ablok-components.umd.js +1 -1
- package/package.json +1 -1
|
@@ -22,7 +22,7 @@ ${u}`:l)}else throw i},onCacheKey:i=>bN(e,n,i)}}function iH(t){if(Re(t))return t
|
|
|
22
22
|
About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guide/advanced/composition.html`,[Jr.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE]:"'v-t' has been deprecated in v11. Use translate APIs ('t' or '$t') instead.",[Jr.DUPLICATE_USE_I18N_CALLING]:"Duplicate `useI18n` calling by local scope. Please don't call it on local scope, due to it does not work properly in component."};function mu(t,...e){return ou(dH[t],...e)}function vl(t){if(!vt(t)||Qr(t))return t;for(const e in t)if(Fr(t,e))if(!e.includes("."))vt(t[e])&&vl(t[e]);else{const n=e.split("."),A=n.length-1;let r=t,o=!1;for(let i=0;i<A;i++){if(n[i]==="__proto__")throw new Error(`unsafe key: ${n[i]}`);if(n[i]in r||(r[n[i]]=Ot()),!vt(r[n[i]])){process.env.NODE_ENV!=="production"&&jr(mu(Jr.IGNORE_OBJ_FLATTEN,{key:n[i]})),o=!0;break}r=r[n[i]]}if(o||(Qr(r)?hC.includes(n[A])||delete t[e]:(r[n[A]]=t[e],delete t[e])),!Qr(r)){const i=r[n[A]];vt(i)&&vl(i)}}return t}function KC(t,e){const{messages:n,__i18n:A,messageResolver:r,flatJson:o}=e,i=Et(n)?n:pn(A)?Ot():{[t]:Ot()};if(pn(A)&&A.forEach(a=>{if("locale"in a&&"resource"in a){const{locale:l,resource:u}=a;l?(i[l]=i[l]||Ot(),lu(u,i[l])):lu(u,i)}else Re(a)&&lu(JSON.parse(a),i)}),r==null&&o)for(const a in i)Fr(i,a)&&vl(i[a]);return i}function zC(t){return t.type}function fH(t,e,n){let A=vt(e.messages)?e.messages:Ot();"__i18nGlobal"in n&&(A=KC(t.locale.value,{messages:A,__i18n:n.__i18nGlobal}));const r=Object.keys(A);r.length&&r.forEach(o=>{t.mergeLocaleMessage(o,A[o])});{if(vt(e.datetimeFormats)){const o=Object.keys(e.datetimeFormats);o.length&&o.forEach(i=>{t.mergeDateTimeFormat(i,e.datetimeFormats[i])})}if(vt(e.numberFormats)){const o=Object.keys(e.numberFormats);o.length&&o.forEach(i=>{t.mergeNumberFormat(i,e.numberFormats[i])})}}}function WC(t){return s.createVNode(s.Text,null,t,0)}const GC="__INTLIFY_META__",YC=()=>[],hH=()=>!1;let jC=0;function qC(t){return((e,n,A,r)=>t(n,A,s.getCurrentInstance()||void 0,r))}const pH=()=>{const t=s.getCurrentInstance();let e=null;return t&&(e=zC(t)[GC])?{[GC]:e}:null};function mH(t={}){const{__root:e,__injectWithOption:n}=t,A=e===void 0,r=t.flatJson,o=bo?s.ref:s.shallowRef;let i=mn(t.inheritLocale)?t.inheritLocale:!0;const a=o(e&&i?e.locale.value:Re(t.locale)?t.locale:fu),l=o(e&&i?e.fallbackLocale.value:Re(t.fallbackLocale)||pn(t.fallbackLocale)||Et(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:a.value),u=o(KC(a.value,t)),f=o(Et(t.datetimeFormats)?t.datetimeFormats:{[a.value]:{}}),h=o(Et(t.numberFormats)?t.numberFormats:{[a.value]:{}});let p=e?e.missingWarn:mn(t.missingWarn)||iu(t.missingWarn)?t.missingWarn:!0,g=e?e.fallbackWarn:mn(t.fallbackWarn)||iu(t.fallbackWarn)?t.fallbackWarn:!0,B=e?e.fallbackRoot:mn(t.fallbackRoot)?t.fallbackRoot:!0,y=!!t.fallbackFormat,C=qt(t.missing)?t.missing:null,w=qt(t.missing)?qC(t.missing):null,F=qt(t.postTranslation)?t.postTranslation:null,_=e?e.warnHtmlMessage:mn(t.warnHtmlMessage)?t.warnHtmlMessage:!0,D=!!t.escapeParameter;const P=e?e.modifiers:Et(t.modifiers)?t.modifiers:{};let T=t.pluralRules||e&&e.pluralRules,H;H=(()=>{A&&SC(null);const se={version:aH,locale:a.value,fallbackLocale:l.value,messages:u.value,modifiers:P,pluralRules:T,missing:w===null?void 0:w,missingWarn:p,fallbackWarn:g,fallbackFormat:y,unresolving:!0,postTranslation:F===null?void 0:F,warnHtmlMessage:_,escapeParameter:D,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};se.datetimeFormats=f.value,se.numberFormats=h.value,se.__datetimeFormatters=Et(H)?H.__datetimeFormatters:void 0,se.__numberFormatters=Et(H)?H.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&(se.__v_emitter=Et(H)?H.__v_emitter:void 0);const he=G2(se);return A&&SC(he),he})(),Cl(H,a.value,l.value);function Z(){return[a.value,l.value,u.value,f.value,h.value]}const ne=s.computed({get:()=>a.value,set:se=>{H.locale=se,a.value=se}}),pe=s.computed({get:()=>l.value,set:se=>{H.fallbackLocale=se,l.value=se,Cl(H,a.value,se)}}),Be=s.computed(()=>u.value),we=s.computed(()=>f.value),R=s.computed(()=>h.value);function K(){return qt(F)?F:null}function N(se){F=se,H.postTranslation=se}function k(){return C}function E(se){se!==null&&(w=qC(se)),C=se,H.missing=w}function I(se,he){return se!=="translate"||!he.resolvedMessage}const Q=(se,he,Ue,ke,Ye,Ve)=>{Z();let Ct;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,A||(H.fallbackContext=e?W2():void 0),Ct=se(H)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,A||(H.fallbackContext=void 0)}if(Ue!=="translate exists"&&Mn(Ct)&&Ct===du||Ue==="translate exists"&&!Ct){const[wt,Nt]=he();if(process.env.NODE_ENV!=="production"&&e&&Re(wt)&&I(Ue,Nt)&&(B&&(pu(g,wt)||QC(p,wt))&&jr(mu(Jr.FALLBACK_TO_ROOT,{key:wt,type:Ue})),process.env.NODE_ENV!=="production")){const{__v_emitter:wA}=H;wA&&B&&wA.emit("fallback",{type:Ue,key:wt,to:"global",groupId:`${Ue}:${wt}`})}return e&&B?ke(e):Ye(wt)}else{if(Ve(Ct))return Ct;throw bl(Kn.UNEXPECTED_RETURN_TYPE)}};function v(...se){return Q(he=>Reflect.apply(PC,null,[he,...se]),()=>Vp(...se),"translate",he=>Reflect.apply(he.t,he,[...se]),he=>he,he=>Re(he))}function W(...se){const[he,Ue,ke]=se;if(ke&&!vt(ke))throw bl(Kn.INVALID_ARGUMENT);return v(he,Ue,On({resolvedMessage:!0},ke||{}))}function M(...se){return Q(he=>Reflect.apply(_C,null,[he,...se]),()=>Pp(...se),"datetime format",he=>Reflect.apply(he.d,he,[...se]),()=>hu,he=>Re(he)||pn(he))}function $(...se){return Q(he=>Reflect.apply(MC,null,[he,...se]),()=>Rp(...se),"number format",he=>Reflect.apply(he.n,he,[...se]),()=>hu,he=>Re(he)||pn(he))}function J(se){return se.map(he=>Re(he)||Mn(he)||mn(he)?WC(String(he)):he)}const S={normalize:J,interpolate:se=>se,type:"vnode"};function G(...se){return Q(he=>{let Ue;const ke=he;try{ke.processor=S,Ue=Reflect.apply(PC,null,[ke,...se])}finally{ke.processor=null}return Ue},()=>Vp(...se),"translate",he=>he[$p](...se),he=>[WC(he)],he=>pn(he))}function ue(...se){return Q(he=>Reflect.apply(MC,null,[he,...se]),()=>Rp(...se),"number format",he=>he[zp](...se),YC,he=>Re(he)||pn(he))}function xe(...se){return Q(he=>Reflect.apply(_C,null,[he,...se]),()=>Pp(...se),"datetime format",he=>he[Kp](...se),YC,he=>Re(he)||pn(he))}function Ae(se){T=se,H.pluralRules=T}function X(se,he){return Q(()=>{if(!se)return!1;const Ue=Re(he)?he:a.value,ke=U(Ue),Ye=H.messageResolver(ke,se);return Qr(Ye)||tr(Ye)||Re(Ye)},()=>[se],"translate exists",Ue=>Reflect.apply(Ue.te,Ue,[se,he]),hH,Ue=>mn(Ue))}function q(se){let he=null;const Ue=gC(H,l.value,a.value);for(let ke=0;ke<Ue.length;ke++){const Ye=u.value[Ue[ke]]||{},Ve=H.messageResolver(Ye,se);if(Ve!=null){he=Ve;break}}return he}function z(se){const he=q(se);return he??(e?e.tm(se)||{}:{})}function U(se){return u.value[se]||{}}function re(se,he){if(r){const Ue={[se]:he};for(const ke in Ue)Fr(Ue,ke)&&vl(Ue[ke]);he=Ue[se]}u.value[se]=he,H.messages=u.value}function de(se,he){u.value[se]=u.value[se]||{};const Ue={[se]:he};if(r)for(const ke in Ue)Fr(Ue,ke)&&vl(Ue[ke]);he=Ue[se],lu(he,u.value[se]),H.messages=u.value}function L(se){return f.value[se]||{}}function Y(se,he){f.value[se]=he,H.datetimeFormats=f.value,DC(H,se,he)}function ae(se,he){f.value[se]=On(f.value[se]||{},he),H.datetimeFormats=f.value,DC(H,se,he)}function ye(se){return h.value[se]||{}}function Te(se,he){h.value[se]=he,H.numberFormats=h.value,LC(H,se,he)}function ie(se,he){h.value[se]=On(h.value[se]||{},he),H.numberFormats=h.value,LC(H,se,he)}jC++,e&&bo&&(s.watch(e.locale,se=>{i&&(a.value=se,H.locale=se,Cl(H,a.value,l.value))}),s.watch(e.fallbackLocale,se=>{i&&(l.value=se,H.fallbackLocale=se,Cl(H,a.value,l.value))}));const ge={id:jC,locale:ne,fallbackLocale:pe,get inheritLocale(){return i},set inheritLocale(se){i=se,se&&e&&(a.value=e.locale.value,l.value=e.fallbackLocale.value,Cl(H,a.value,l.value))},get availableLocales(){return Object.keys(u.value).sort()},messages:Be,get modifiers(){return P},get pluralRules(){return T||{}},get isGlobal(){return A},get missingWarn(){return p},set missingWarn(se){p=se,H.missingWarn=p},get fallbackWarn(){return g},set fallbackWarn(se){g=se,H.fallbackWarn=g},get fallbackRoot(){return B},set fallbackRoot(se){B=se},get fallbackFormat(){return y},set fallbackFormat(se){y=se,H.fallbackFormat=y},get warnHtmlMessage(){return _},set warnHtmlMessage(se){_=se,H.warnHtmlMessage=se},get escapeParameter(){return D},set escapeParameter(se){D=se,H.escapeParameter=se},t:v,getLocaleMessage:U,setLocaleMessage:re,mergeLocaleMessage:de,getPostTranslationHandler:K,setPostTranslationHandler:N,getMissingHandler:k,setMissingHandler:E,[uH]:Ae};return ge.datetimeFormats=we,ge.numberFormats=R,ge.rt=W,ge.te=X,ge.tm=z,ge.d=M,ge.n=$,ge.getDateTimeFormat=L,ge.setDateTimeFormat=Y,ge.mergeDateTimeFormat=ae,ge.getNumberFormat=ye,ge.setNumberFormat=Te,ge.mergeNumberFormat=ie,ge[$C]=n,ge[$p]=G,ge[Kp]=xe,ge[zp]=ue,process.env.NODE_ENV!=="production"&&(ge[Wp]=se=>{H.__v_emitter=se},ge[Gp]=()=>{H.__v_emitter=void 0}),ge}function JC(t,e){}const jp={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function gH({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((A,r)=>[...A,...r.type===s.Fragment?r.children:[r]],[]):e.reduce((n,A)=>{const r=t[A];return r&&(n[A]=r()),n},Ot())}function XC(){return s.Fragment}On({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>Mn(t)||!isNaN(t)}},jp);function BH(t){return pn(t)&&!Re(t[0])}function ZC(t,e,n,A){const{slots:r,attrs:o}=e;return()=>{const i={part:!0};let a=Ot();t.locale&&(i.locale=t.locale),Re(t.format)?i.key=t.format:vt(t.format)&&(Re(t.format.key)&&(i.key=t.format.key),a=Object.keys(t.format).reduce((p,g)=>n.includes(g)?On(Ot(),p,{[g]:t.format[g]}):p,Ot()));const l=A(t.value,i,a);let u=[i.key];pn(l)?u=l.map((p,g)=>{const B=r[p.type],y=B?B({[p.type]:p.value,index:g,parts:l}):[p.value];return BH(y)&&(y[0].key=`${p.type}-${g}`),y}):Re(l)&&(u=[l]);const f=On(Ot(),o),h=Re(t.tag)||vt(t.tag)?t.tag:XC();return s.h(h,f,u)}}On({value:{type:Number,required:!0},format:{type:[String,Object]}},jp);const yH=vo("global-vue-i18n");function El(t={}){const e=s.getCurrentInstance();if(e==null)throw bl(Kn.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw bl(Kn.NOT_INSTALLED);const n=wH(e),A=bH(n),r=zC(e),o=CH(t,r);if(o==="global")return fH(A,t,r),A;if(o==="parent"){let l=vH(n,e,t.__useComponent);return l==null&&(process.env.NODE_ENV!=="production"&&jr(mu(Jr.NOT_FOUND_PARENT_SCOPE)),l=A),l}const i=n;let a=i.__getInstance(e);if(a==null){const l=On({},t);"__i18n"in r&&(l.__i18n=r.__i18n),A&&(l.__root=A),a=mH(l),i.__composerExtend&&(a[Yp]=i.__composerExtend(a)),kH(i,e,a),i.__setInstance(e,a)}else process.env.NODE_ENV!=="production"&&o==="local"&&jr(mu(Jr.DUPLICATE_USE_I18N_CALLING));return a}function wH(t){const e=s.inject(t.isCE?yH:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw bl(t.isCE?Kn.NOT_INSTALLED_WITH_PROVIDE:Kn.UNEXPECTED_ERROR);return e}function CH(t,e){return su(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function bH(t){return t.mode==="composition"?t.global:t.global.__composer}function vH(t,e,n=!1){let A=null;const r=e.root;let o=EH(e,n);for(;o!=null;){const i=t;if(t.mode==="composition")A=i.__getInstance(o);else if(__VUE_I18N_LEGACY_API__){const a=i.__getInstance(o);a!=null&&(A=a.__composer,n&&A&&!A[$C]&&(A=null))}if(A!=null||r===o)break;o=o.parent}return A}function EH(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function kH(t,e,n){let A=null;s.onMounted(()=>{if(process.env.NODE_ENV!=="production"&&e.vnode.el){e.vnode.el.__VUE_I18N__=n,A=IN();const r=n;r[Wp]&&r[Wp](A),A.on("*",JC)}},e),s.onUnmounted(()=>{const r=n;process.env.NODE_ENV!=="production"&&e.vnode.el&&e.vnode.el.__VUE_I18N__&&(A&&A.off("*",JC),r[Gp]&&r[Gp](),delete e.vnode.el.__VUE_I18N__),t.__deleteInstance(e);const o=r[Yp];o&&(o(),delete r[Yp])},e)}if(On({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},jp),lH(),R2(y2),V2(O2),$2(gC),process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const t=As();t.__INTLIFY__=!0,w2(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}process.env.NODE_ENV;const SH={class:"row"},FH={class:"col-12"},QH=["for","innerHTML"],xH={key:0},UH={class:"input-group justify-content-center"},IH={key:0,class:"row"},_H={class:"col-12 col-md-6"},TH={class:"col-12 col-md-6"},DH={key:1,class:"row"},MH={class:"col-12"},OH=s.defineComponent({__name:"input-datepicker",props:{modelValue:{type:null,default:""},from:{type:[String,Number,Boolean,Date],default:""},to:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"datetime-local"},name:{type:String,default:()=>bt()},id:{type:String,default:()=>bt()},label:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},range:{type:Boolean,default:!1},textRange:{type:Boolean,default:!1},inline:{type:Boolean,default:!1},textInput:{type:Boolean,default:!0},picker:{type:Boolean,default:!0},locale:{type:String,default:"en"},utcStore:{type:Boolean,default:!1}},emits:["update:modelValue","update:from","update:to"],setup(t,{emit:e}){const n=t,A=e,{t:r,locale:o}=El(),i=s.computed(()=>n.locale||o.value),a=s.computed(()=>n.inline||!n.picker?{openMenu:!1,format:i.value}:!0),l=s.computed({get(){if(n.range){let y=n.from||(Array.isArray(n.modelValue)?n.modelValue[0]:null),C=n.to||(Array.isArray(n.modelValue)?n.modelValue[1]:null);return n.utcStore?(y=y?p(y):null,C=C?p(C):null):(y=y?new Date(`${y}Z`).toISOString().replace("Z",""):null,C=C?new Date(`${C}Z`).toISOString().replace("Z",""):null),[...y?[y]:[],...C?[C]:[]]}else{if(n.utcStore){const w=n.modelValue;return w&&p(w)||""}const y=n.modelValue?new Date(`${n.modelValue}Z`):null,C=y&&y.toISOString();return C&&C.replace("Z","")}},set(y){if(n.range&&Array.isArray(y)){let[C,w]=y;n.utcStore?(C=g(C)||null,w=g(w)||null):(C=C&&new Date(C),C?.setUTCHours(C.getHours()),C=C?.toISOString()?.replace("Z",""),w=w&&new Date(w),w?.setUTCHours(w.getHours()),w=w?.toISOString()?.replace("Z","")),A("update:modelValue",[C,w]),A("update:from",C),A("update:to",w)}else if(n.utcStore){const C=g(y);A("update:modelValue",C)}else{const C=y&&new Date(y);C?.setUTCHours(C?.getHours()),y=C&&C.toISOString(),A("update:modelValue",y&&y.replace("Z",""))}}}),u=s.computed({get(){return Array.isArray(l.value)?l.value[0]:l.value},set(y){l.value=Array.isArray(l.value)?[y,l.value[0]]:y}}),f=s.computed({get(){return Array.isArray(l.value)?l.value[1]:l.value},set(y){l.value=Array.isArray(l.value)?[l.value[0],y]:y}});s.watch(()=>[u.value,f.value],(y,C)=>{n.range&&y.some(w=>w===void 0)&&C.every(Boolean)&&(l.value=[])});function h(y){if(!y)return;const C=y.getDate(),w=y.getMonth()+1,F=y.getFullYear(),_=y.getMinutes(),D=y.getHours();switch(i.value){case"de":return`${C}.${w}.${F} ${D<10?"0"+D:D}:${_<10?"0"+_:_}`;case"fr":return`${C}/${w}/${F} ${D<10?"0"+D:D}:${_<10?"0"+_:_}`;case"en":default:return`${w}/${C}/${F} ${D<10?"0"+D:D}:${_<10?"0"+_:_}`}}function p(y){if(!y)return null;const C=y instanceof Date?new Date(y):new Date(`${y}Z`),w=C.getFullYear(),F=String(C.getMonth()+1).padStart(2,"0"),_=String(C.getDate()).padStart(2,"0"),D=String(C.getHours()).padStart(2,"0"),P=String(C.getMinutes()).padStart(2,"0"),T=String(C.getSeconds()).padStart(2,"0");return`${w}-${F}-${_}T${D}:${P}:${T}`}function g(y){return y?(y instanceof Date?new Date(y):new Date(String(y))).toISOString().split(".")[0]:null}const B=y=>(Array.isArray(y)?y=y.map(C=>h(C)).join(" - "):y=h(y),y);return(y,C)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["input","input--datepicker"])},[s.renderSlot(y.$slots,"label",{},()=>[s.createElementVNode("div",SH,[s.createElementVNode("div",FH,[t.label?(s.openBlock(),s.createElementBlock("label",{key:0,for:t.id,class:"input__label",innerHTML:`${t.label}${t.required?" *":""}`},null,8,QH)):s.createCommentVNode("",!0)])])]),t.textInput?(s.openBlock(),s.createElementBlock("div",xH,[s.createElementVNode("div",UH,[s.renderSlot(y.$slots,"input-prepend",{slotScope:"props"}),t.range&&!t.textRange?(s.openBlock(),s.createElementBlock("div",IH,[s.createElementVNode("div",_H,[s.createVNode(s.unref(ra),{uid:`${t.id}-from`,modelValue:u.value,"onUpdate:modelValue":C[0]||(C[0]=w=>u.value=w),locale:i.value,format:B,"text-input":a.value,disabled:t.disabled,"ready-only":t.readOnly,required:t.required,"auto-apply":!0},null,8,["uid","modelValue","locale","text-input","disabled","ready-only","required"])]),s.createElementVNode("div",TH,[s.createVNode(s.unref(ra),{uid:`${t.id}-to`,modelValue:f.value,"onUpdate:modelValue":C[1]||(C[1]=w=>f.value=w),locale:i.value,format:B,"text-input":a.value,disabled:t.disabled,"ready-only":t.readOnly,required:t.required,"auto-apply":!0},null,8,["uid","modelValue","locale","text-input","disabled","ready-only","required"])])])):(s.openBlock(),s.createBlock(s.unref(ra),{key:1,uid:`${t.id}-input-to`,modelValue:l.value,"onUpdate:modelValue":C[2]||(C[2]=w=>l.value=w),format:B,locale:i.value,range:t.textRange,"text-input":a.value,disabled:t.disabled,"ready-only":t.readOnly,required:t.required,"auto-apply":!0},null,8,["uid","modelValue","locale","range","text-input","disabled","ready-only","required"])),s.renderSlot(y.$slots,"input-append",{slotScope:"props"})])])):s.createCommentVNode("",!0),t.inline?(s.openBlock(),s.createElementBlock("div",DH,[s.createElementVNode("div",MH,[s.createVNode(s.unref(ra),{uid:`${t.id}-inline`,modelValue:l.value,"onUpdate:modelValue":C[3]||(C[3]=w=>l.value=w),locale:i.value,cancelText:"abbrechen",selectText:"auswählen",range:t.range,"multi-calendars":t.range,inline:{input:!1},"auto-apply":!0,"partial-range":t.range,"partial-flow":!0,"start-time":{hours:0,minutes:0},class:"justify-content-center",disabled:t.disabled,"ready-only":t.readOnly,required:t.required,"month-name-format":"long"},null,8,["uid","modelValue","locale","range","multi-calendars","partial-range","disabled","ready-only","required"])])])):s.createCommentVNode("",!0)]))}}),LH={class:"input-group input__input-group"},NH=s.defineComponent({__name:"input-password",props:{modelValue:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"text"},name:{type:String,default:()=>bt()},id:{type:String,default:()=>bt()},label:{type:String,default:""},placeholder:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},maxlength:{type:Number},pattern:{type:String,default:null},role:{type:String,default:"presentation"},autocomplete:{type:String,default:"off"},password:{type:String,default:""},confirm:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,A=e,r=s.computed({get(){return n.modelValue},set(o){(n.password===o||!n.password)&&A("update:modelValue",o)}});return(o,i)=>{const a=s.resolveComponent("svg-icon"),l=s.resolveComponent("base-input");return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["input","input-password"])},[s.createElementVNode("div",LH,[s.createVNode(l,{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=u=>r.value=u),type:"password",placeholder:t.placeholder,disabled:t.disabled,readonly:t.readOnly,required:t.required,label:t.label},{"input-prepend":s.withCtx(u=>[s.renderSlot(o.$slots,"input-prepend",{slotScope:"props"})]),"input-append":s.withCtx(u=>[s.renderSlot(o.$slots,"input-append",{slotScope:"props"},()=>[t.confirm&&t.modelValue===t.password?(s.openBlock(),s.createBlock(a,{key:0,symbol:"check",class:"ms-2"})):s.createCommentVNode("",!0)])]),_:3},8,["modelValue","placeholder","disabled","readonly","required","label"])])])}}}),HH={class:"check-group"},PH=["id","name","value","disabled","read-only","required"],RH=["for","innerHTML"],VH=s.defineComponent({__name:"check-group",props:{modelValue:{type:null,default:()=>[]},options:{type:Array,required:!0},name:{type:String,default:()=>bt()},id:{type:String,default:()=>bt()},label:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,A=e;s.ref([]);const r=s.computed({get(){return n.modelValue},set(i){A("update:modelValue",i)}}),o=s.computed(()=>n.options&&n.options.map(i=>(i=typeof i=="string"?{text:i,value:i}:i,{...i,active:n.modelValue&&n.modelValue.includes(i.value)})));return(i,a)=>(s.openBlock(),s.createElementBlock("div",HH,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(o.value,(l,u)=>(s.openBlock(),s.createElementBlock("div",{key:u,class:"form-check"},[s.withDirectives(s.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":a[0]||(a[0]=f=>r.value=f),id:`${t.id}-${u}`,name:t.name,class:"form-check-input",value:l.value||l,disabled:t.disabled,"read-only":t.readOnly,required:t.required},null,8,PH),[[s.vModelCheckbox,r.value]]),s.createElementVNode("label",{class:"form-check-label",for:`${t.id}-${u}`,innerHTML:l.text},null,8,RH)]))),128))]))}}),$H={class:"input radio-group"},KH=["id","name","value","checked","disabled","read-only","required","onChange"],zH=["for","innerHTML"],WH=["for"],gu=s.defineComponent({__name:"radio-group",props:{modelValue:{type:null},options:{type:Array,default:[]},name:{type:String,default:()=>bt()},id:{type:String,default:()=>bt()},label:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},keyOption:{type:null},itemClass:{type:String,default:""}},emits:["change","update:modelValue"],setup(t,{emit:e}){const n=e;function A(r){n("update:modelValue",r)}return(r,o)=>(s.openBlock(),s.createElementBlock("div",$H,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.options,(i,a)=>(s.openBlock(),s.createElementBlock("div",{key:a,class:s.normalizeClass(["form-check",t.itemClass])},[s.createElementVNode("input",{type:"radio",id:`${t.id}-${a}`,name:t.name,class:s.normalizeClass(["form-check-input",`
|
|
23
23
|
${a===t.keyOption||i.key?"form-check-input--key":""}
|
|
24
24
|
${(a===t.keyOption||i.key)&&i.value===t.modelValue?.value?"form-check-input--match":""}
|
|
25
|
-
`]),value:i.value||i,checked:i.value?i.value===t.modelValue?.value:i===t.modelValue,disabled:t.disabled,"read-only":t.readOnly,required:t.required,onChange:l=>A(i)},null,42,KH),s.renderSlot(r.$slots,"option-label",{option:i,index:a},()=>[s.createElementVNode("label",{class:"form-check-label",for:`${t.id}-${a}`,innerHTML:i.text},null,8,zH)])],2))),128)),s.renderSlot(r.$slots,"label",{},()=>[t.label?(s.openBlock(),s.createElementBlock("label",{key:0,for:t.id},s.toDisplayString(t.label),9,WH)):s.createCommentVNode("",!0)])]))}}),GH={class:"radio-buttons"},YH=["for"],jH=s.defineComponent({__name:"radio-buttons",props:{modelValue:{type:null,default:""},options:{type:Array,default:[]},name:{type:String,default:()=>bt()},id:{type:String,default:()=>bt()},label:{type:String},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},keyOption:{type:null},itemClass:{type:String,default:""}},emits:["update:modelValue","update:selection"],setup(t,{emit:e}){const n=t,A=e,r=s.computed({get(){return n.modelValue},set(o){A("update:modelValue",o)}});return(o,i)=>(s.openBlock(),s.createElementBlock("div",GH,[s.createVNode(gu,{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=a=>r.value=a),options:t.options,name:t.name,id:t.id,disabled:t.disabled,required:t.required,class:"d-flex flex-column gap-3 justify-content-center"},{"option-label":s.withCtx(a=>[s.createElementVNode("label",{for:`${t.id}-${a.index}`,class:"d-block btn btn-outline-primary p-3 fw-bold",role:"button"},s.toDisplayString(a.option.text),9,YH)]),_:1},8,["modelValue","options","name","id","disabled","required"])]))}}),qH=["id","name","multiple","accept","disabled"],JH={class:"input__input-group input-group"},XH=["value","id","name","disabled"],ZH=["for","disabled"],eP={class:"btn btn-outline-contrast"},tP=["for"],nP=["innerHTML"],AP=s.defineComponent({__name:"input-file",props:{modelValue:{type:Array,default:[]},name:{type:String,default:()=>bt()},id:{type:String,default:()=>bt()},label:{type:String,default:""},placeholder:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},pattern:{type:String,default:null},multiple:{type:Boolean,default:!1},accept:{type:String},maxFileSize:{type:Number,default:0},dropzone:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,A=e;function r(l){const u=l.target&&l.target.files;u&&(i.splice(0,i.length),Array.from(u).forEach(f=>{if(n.maxFileSize&&f.size>n.maxFileSize){console.warn(`File ${f.name} exceeds the ${n.maxFileSize} bytes size limit and will not be added.`);return}i.push(f)}))}const o=s.ref(),i=s.reactive([]),a=s.computed(()=>i&&i.map(l=>l.name));return s.watch(()=>n.modelValue,(l,u)=>{l.length===0&&(o.value.value=null)},{deep:!0}),s.watch(()=>i,(l,u)=>{A("update:modelValue",l)},{deep:!0}),(l,u)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["input input-file","input-file--primary"])},[s.createElementVNode("input",{ref_key:"input",ref:o,type:"file",id:t.id,name:t.name,class:"d-none",onChange:r,multiple:t.multiple,accept:t.accept,disabled:t.disabled},null,40,qH),s.createElementVNode("div",JH,[s.renderSlot(l.$slots,"input-prepend"),s.createElementVNode("input",{type:"text",value:a.value,id:t.id,name:t.name,class:"form-control",disabled:t.disabled},null,8,XH),s.renderSlot(l.$slots,"input-append",{},()=>[s.createElementVNode("label",{for:t.id,disabled:t.disabled},[s.renderSlot(l.$slots,"button",{},()=>[s.createElementVNode("span",eP,s.toDisplayString(l.$t("common.selectFile")),1)])],8,ZH)])]),s.createElementVNode("label",{for:t.id},[s.renderSlot(l.$slots,"label",{},()=>[s.createElementVNode("span",{class:"input__label",innerHTML:`${t.label}${t.required?" *":""}`},null,8,nP)])],8,tP)]))}}),rP={class:"custom-html"},oP=["innerHTML"],iP=s.defineComponent({__name:"custom-html",props:{content:{}},setup(t){return(e,n)=>{const A=s.resolveComponent("client-only");return s.openBlock(),s.createBlock(A,null,{default:s.withCtx(()=>[s.createElementVNode("div",rP,[s.renderSlot(e.$slots,"default",{},()=>[s.createElementVNode("span",{class:"custom-html__content",innerHTML:e.content},null,8,oP)])])]),_:3})}}}),sP={class:"select-media"},aP=["for"],lP=s.defineComponent({__name:"select-media",props:{modelValue:{type:null,default:""},assets:{type:Array,default:[]},name:{type:String,default:()=>bt()},id:{type:String,default:()=>bt()},label:{type:String},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},emitKey:{type:String,default:"src"}},emits:["update:modelValue","update:selection"],setup(t,{emit:e}){const n=t,A=e,r=s.computed({get(){return n.modelValue},set(o){const i=n.assets.find(a=>a.id===o);A("update:modelValue",n.emitKey?i[n.emitKey]:i),n.emitKey&&n.emitKey!=="id"&&A("update:selection",i.id)}});return(o,i)=>{const a=s.resolveComponent("base-image");return s.openBlock(),s.createElementBlock("div",sP,[s.createVNode(gu,{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=l=>r.value=l),options:t.assets.map(l=>l.id),name:t.name,id:t.id,disabled:t.disabled,required:t.required,class:"d-flex flex-wrap flex-row justify-content-center",itemClass:"col-6 p-2"},{"option-label":s.withCtx(l=>[s.createElementVNode("label",{for:`${t.id}-${l.index}`,class:s.normalizeClass(["w-100",{"is-active":t.assets[l.index].id===r.value}]),role:"button"},[t.assets[l.index].thumbnail?(s.openBlock(),s.createBlock(a,{key:0,src:t.assets[l.index].thumbnail,alt:t.assets[l.index].id},null,8,["src","alt"])):s.createCommentVNode("",!0)],10,aP)]),_:1},8,["modelValue","options","name","id","disabled","required"])])}}});function zn(t){this.content=t}zn.prototype={constructor:zn,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 A=n&&n!=t?this.remove(n):this,r=A.find(t),o=A.content.slice();return r==-1?o.push(n||t,e):(o[r+1]=e,n&&(o[r]=n)),new zn(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new zn(n)},addToStart:function(t,e){return new zn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new zn(n)},addBefore:function(t,e,n){var A=this.remove(e),r=A.content.slice(),o=A.find(t);return r.splice(o==-1?r.length:o,0,e,n),new zn(r)},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=zn.from(t),t.size?new zn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=zn.from(t),t.size?new zn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=zn.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}},zn.from=function(t){if(t instanceof zn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new zn(e)};function eb(t,e,n){for(let A=0;;A++){if(A==t.childCount||A==e.childCount)return t.childCount==e.childCount?null:n;let r=t.child(A),o=e.child(A);if(r==o){n+=r.nodeSize;continue}if(!r.sameMarkup(o))return n;if(r.isText&&r.text!=o.text){for(let i=0;r.text[i]==o.text[i];i++)n++;return n}if(r.content.size||o.content.size){let i=eb(r.content,o.content,n+1);if(i!=null)return i}n+=r.nodeSize}}function tb(t,e,n,A){for(let r=t.childCount,o=e.childCount;;){if(r==0||o==0)return r==o?null:{a:n,b:A};let i=t.child(--r),a=e.child(--o),l=i.nodeSize;if(i==a){n-=l,A-=l;continue}if(!i.sameMarkup(a))return{a:n,b:A};if(i.isText&&i.text!=a.text){let u=0,f=Math.min(i.text.length,a.text.length);for(;u<f&&i.text[i.text.length-u-1]==a.text[a.text.length-u-1];)u++,n--,A--;return{a:n,b:A}}if(i.content.size||a.content.size){let u=tb(i.content,a.content,n-1,A-1);if(u)return u}n-=l,A-=l}}class Qe{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let A=0;A<e.length;A++)this.size+=e[A].nodeSize}nodesBetween(e,n,A,r=0,o){for(let i=0,a=0;a<n;i++){let l=this.content[i],u=a+l.nodeSize;if(u>e&&A(l,r+a,o||null,i)!==!1&&l.content.size){let f=a+1;l.nodesBetween(Math.max(0,e-f),Math.min(l.content.size,n-f),A,r+f)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,A,r){let o="",i=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?r?typeof r=="function"?r(a):r:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&A&&(i?i=!1:o+=A),o+=u},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,A=e.firstChild,r=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(A)&&(r[r.length-1]=n.withText(n.text+A.text),o=1);o<e.content.length;o++)r.push(e.content[o]);return new Qe(r,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let A=[],r=0;if(n>e)for(let o=0,i=0;i<n;o++){let a=this.content[o],l=i+a.nodeSize;l>e&&((i<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-i),Math.min(a.text.length,n-i)):a=a.cut(Math.max(0,e-i-1),Math.min(a.content.size,n-i-1))),A.push(a),r+=a.nodeSize),i=l}return new Qe(A,r)}cutByIndex(e,n){return e==n?Qe.empty:e==0&&n==this.content.length?this:new Qe(this.content.slice(e,n))}replaceChild(e,n){let A=this.content[e];if(A==n)return this;let r=this.content.slice(),o=this.size+n.nodeSize-A.nodeSize;return r[e]=n,new Qe(r,o)}addToStart(e){return new Qe([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Qe(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,A=0;n<this.content.length;n++){let r=this.content[n];e(r,A,n),A+=r.nodeSize}}findDiffStart(e,n=0){return eb(this,e,n)}findDiffEnd(e,n=this.size,A=e.size){return tb(this,e,n,A)}findIndex(e){if(e==0)return Bu(0,e);if(e==this.size)return Bu(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,A=0;;n++){let r=this.child(n),o=A+r.nodeSize;if(o>=e)return o==e?Bu(n+1,o):Bu(n,A);A=o}}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 Qe.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Qe(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Qe.empty;let n,A=0;for(let r=0;r<e.length;r++){let o=e[r];A+=o.nodeSize,r&&o.isText&&e[r-1].sameMarkup(o)?(n||(n=e.slice(0,r)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new Qe(n||e,A)}static from(e){if(!e)return Qe.empty;if(e instanceof Qe)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Qe([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Qe.empty=new Qe([],0);const qp={index:0,offset:0};function Bu(t,e){return qp.index=t,qp.offset=e,qp}function yu(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 A=0;A<t.length;A++)if(!yu(t[A],e[A]))return!1}else{for(let A in t)if(!(A in e)||!yu(t[A],e[A]))return!1;for(let A in e)if(!(A in t))return!1}return!0}let Ht=class N0{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,A=!1;for(let r=0;r<e.length;r++){let o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!A&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,r)),n.push(this),A=!0),n&&n.push(o)}}return n||(n=e.slice()),A||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&&yu(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 A=e.marks[n.type];if(!A)throw new RangeError(`There is no mark type ${n.type} in this schema`);let r=A.create(n.attrs);return A.checkAttrs(r.attrs),r}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let A=0;A<e.length;A++)if(!e[A].eq(n[A]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return N0.none;if(e instanceof N0)return[e];let n=e.slice();return n.sort((A,r)=>A.type.rank-r.type.rank),n}};Ht.none=[];class wu extends Error{}class Ne{constructor(e,n,A){this.content=e,this.openStart=n,this.openEnd=A}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let A=Ab(this.content,e+this.openStart,n);return A&&new Ne(A,this.openStart,this.openEnd)}removeBetween(e,n){return new Ne(nb(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 Ne.empty;let A=n.openStart||0,r=n.openEnd||0;if(typeof A!="number"||typeof r!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Ne(Qe.fromJSON(e,n.content),A,r)}static maxOpen(e,n=!0){let A=0,r=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)A++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)r++;return new Ne(e,A,r)}}Ne.empty=new Ne(Qe.empty,0,0);function nb(t,e,n){let{index:A,offset:r}=t.findIndex(e),o=t.maybeChild(A),{index:i,offset:a}=t.findIndex(n);if(r==e||o.isText){if(a!=n&&!t.child(i).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(A!=i)throw new RangeError("Removing non-flat range");return t.replaceChild(A,o.copy(nb(o.content,e-r-1,n-r-1)))}function Ab(t,e,n,A){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r);if(o==e||i.isText)return A&&!A.canReplace(r,r,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=Ab(i.content,e-o-1,n,i);return a&&t.replaceChild(r,i.copy(a))}function cP(t,e,n){if(n.openStart>t.depth)throw new wu("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new wu("Inconsistent open depths");return rb(t,e,n,0)}function rb(t,e,n,A){let r=t.index(A),o=t.node(A);if(r==e.index(A)&&A<t.depth-n.openStart){let i=rb(t,e,n,A+1);return o.copy(o.content.replaceChild(r,i))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==A&&e.depth==A){let i=t.parent,a=i.content;return ss(i,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:i,end:a}=uP(n,t);return ss(o,ib(t,i,a,e,A))}else return ss(o,Cu(t,e,A))}function ob(t,e){if(!e.type.compatibleContent(t.type))throw new wu("Cannot join "+e.type.name+" onto "+t.type.name)}function Jp(t,e,n){let A=t.node(n);return ob(A,e.node(n)),A}function is(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 kl(t,e,n,A){let r=(e||t).node(n),o=0,i=e?e.index(n):r.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(is(t.nodeAfter,A),o++));for(let a=o;a<i;a++)is(r.child(a),A);e&&e.depth==n&&e.textOffset&&is(e.nodeBefore,A)}function ss(t,e){return t.type.checkContent(e),t.copy(e)}function ib(t,e,n,A,r){let o=t.depth>r&&Jp(t,e,r+1),i=A.depth>r&&Jp(n,A,r+1),a=[];return kl(null,t,r,a),o&&i&&e.index(r)==n.index(r)?(ob(o,i),is(ss(o,ib(t,e,n,A,r+1)),a)):(o&&is(ss(o,Cu(t,e,r+1)),a),kl(e,n,r,a),i&&is(ss(i,Cu(n,A,r+1)),a)),kl(A,null,r,a),new Qe(a)}function Cu(t,e,n){let A=[];if(kl(null,t,n,A),t.depth>n){let r=Jp(t,e,n+1);is(ss(r,Cu(t,e,n+1)),A)}return kl(e,null,n,A),new Qe(A)}function uP(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)r=e.node(o).copy(Qe.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}class Sl{constructor(e,n,A){this.pos=e,this.path=n,this.parentOffset=A,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 A=this.pos-this.path[this.path.length-1],r=e.child(n);return A?e.child(n).cut(A):r}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 A=this.path[n*3],r=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)r+=A.child(o).nodeSize;return r}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Ht.none;if(this.textOffset)return e.child(n).marks;let A=e.maybeChild(n-1),r=e.maybeChild(n);if(!A){let a=A;A=r,r=a}let o=A.marks;for(var i=0;i<o.length;i++)o[i].type.spec.inclusive===!1&&(!r||!o[i].isInSet(r.marks))&&(o=o[i--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let A=n.marks,r=e.parent.maybeChild(e.index());for(var o=0;o<A.length;o++)A[o].type.spec.inclusive===!1&&(!r||!A[o].isInSet(r.marks))&&(A=A[o--].removeFromSet(A));return A}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 A=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);A>=0;A--)if(e.pos<=this.end(A)&&(!n||n(this.node(A))))return new bu(this,e,A);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 A=[],r=0,o=n;for(let i=e;;){let{index:a,offset:l}=i.content.findIndex(o),u=o-l;if(A.push(i,a,r+l),!u||(i=i.child(a),i.isText))break;o=u-1,r+=l+1}return new Sl(n,A,o)}static resolveCached(e,n){let A=sb.get(e);if(A)for(let o=0;o<A.elts.length;o++){let i=A.elts[o];if(i.pos==n)return i}else sb.set(e,A=new dP);let r=A.elts[A.i]=Sl.resolve(e,n);return A.i=(A.i+1)%fP,r}}class dP{constructor(){this.elts=[],this.i=0}}const fP=12,sb=new WeakMap;class bu{constructor(e,n,A){this.$from=e,this.$to=n,this.depth=A}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 hP=Object.create(null);let ii=class H0{constructor(e,n,A,r=Ht.none){this.type=e,this.attrs=n,this.marks=r,this.content=A||Qe.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,A,r=0){this.content.nodesBetween(e,n,A,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,A,r){return this.content.textBetween(e,n,A,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,A){return this.type==e&&yu(this.attrs,n||e.defaultAttrs||hP)&&Ht.sameSet(this.marks,A||Ht.none)}copy(e=null){return e==this.content?this:new H0(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new H0(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,A=!1){if(e==n)return Ne.empty;let r=this.resolve(e),o=this.resolve(n),i=A?0:r.sharedDepth(n),a=r.start(i),u=r.node(i).content.cut(r.pos-a,o.pos-a);return new Ne(u,r.depth-i,o.depth-i)}replace(e,n,A){return cP(this.resolve(e),this.resolve(n),A)}nodeAt(e){for(let n=this;;){let{index:A,offset:r}=n.content.findIndex(e);if(n=n.maybeChild(A),!n)return null;if(r==e||n.isText)return n;e-=r+1}}childAfter(e){let{index:n,offset:A}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:A}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:A}=this.content.findIndex(e);if(A<e)return{node:this.content.child(n),index:n,offset:A};let r=this.content.child(n-1);return{node:r,index:n-1,offset:A-r.nodeSize}}resolve(e){return Sl.resolveCached(this,e)}resolveNoCache(e){return Sl.resolve(this,e)}rangeHasMark(e,n,A){let r=!1;return n>e&&this.nodesBetween(e,n,o=>(A.isInSet(o.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),ab(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,A=Qe.empty,r=0,o=A.childCount){let i=this.contentMatchAt(e).matchFragment(A,r,o),a=i&&i.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=r;l<o;l++)if(!this.type.allowsMarks(A.child(l).marks))return!1;return!0}canReplaceWith(e,n,A,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(e).matchType(A),i=o&&o.matchFragment(this.content,n);return i?i.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=Ht.none;for(let n=0;n<this.marks.length;n++){let A=this.marks[n];A.type.checkAttrs(A.attrs),e=A.addToSet(e)}if(!Ht.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 A;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");A=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,A)}let r=Qe.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,r,A);return o.type.checkAttrs(o.attrs),o}};ii.prototype.text=void 0;class vu extends ii{constructor(e,n,A,r){if(super(e,n,null,r),!A)throw new RangeError("Empty text nodes are not allowed");this.text=A}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ab(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 vu(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new vu(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 ab(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class as{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let A=new pP(e,n);if(A.next==null)return as.empty;let r=lb(A);A.next&&A.err("Unexpected trailing text");let o=bP(CP(r));return vP(o,A),o}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,A=e.childCount){let r=this;for(let o=n;r&&o<A;o++)r=r.matchType(e.child(o).type);return r}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 A=0;A<e.next.length;A++)if(this.next[n].type==e.next[A].type)return!0;return!1}fillBefore(e,n=!1,A=0){let r=[this];function o(i,a){let l=i.matchFragment(e,A);if(l&&(!n||l.validEnd))return Qe.from(a.map(u=>u.createAndFill()));for(let u=0;u<i.next.length;u++){let{type:f,next:h}=i.next[u];if(!(f.isText||f.hasRequiredAttrs())&&r.indexOf(h)==-1){r.push(h);let p=o(h,a.concat(f));if(p)return p}}return null}return o(this,[])}findWrapping(e){for(let A=0;A<this.wrapCache.length;A+=2)if(this.wrapCache[A]==e)return this.wrapCache[A+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),A=[{match:this,type:null,via:null}];for(;A.length;){let r=A.shift(),o=r.match;if(o.matchType(e)){let i=[];for(let a=r;a.type;a=a.via)i.push(a.type);return i.reverse()}for(let i=0;i<o.next.length;i++){let{type:a,next:l}=o.next[i];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!r.type||l.validEnd)&&(A.push({match:a.contentMatch,type:a,via:r}),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(A){e.push(A);for(let r=0;r<A.next.length;r++)e.indexOf(A.next[r].next)==-1&&n(A.next[r].next)}return n(this),e.map((A,r)=>{let o=r+(A.validEnd?"*":" ")+" ";for(let i=0;i<A.next.length;i++)o+=(i?", ":"")+A.next[i].type.name+"->"+e.indexOf(A.next[i].next);return o}).join(`
|
|
25
|
+
`]),value:i.value||i,checked:i.value?i.value===t.modelValue?.value:i===t.modelValue,disabled:t.disabled,"read-only":t.readOnly,required:t.required,onChange:l=>A(i)},null,42,KH),s.renderSlot(r.$slots,"option-label",{option:i,index:a},()=>[s.createElementVNode("label",{class:"form-check-label",for:`${t.id}-${a}`,innerHTML:i.text},null,8,zH)])],2))),128)),s.renderSlot(r.$slots,"label",{},()=>[t.label?(s.openBlock(),s.createElementBlock("label",{key:0,for:t.id},s.toDisplayString(t.label),9,WH)):s.createCommentVNode("",!0)])]))}}),GH={class:"radio-buttons"},YH=["for"],jH=s.defineComponent({__name:"radio-buttons",props:{modelValue:{type:null,default:""},options:{type:Array,default:[]},name:{type:String,default:()=>bt()},id:{type:String,default:()=>bt()},label:{type:String},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},keyOption:{type:null},itemClass:{type:String,default:""}},emits:["update:modelValue","update:selection"],setup(t,{emit:e}){const n=t,A=e,r=s.computed({get(){return n.modelValue},set(o){A("update:modelValue",o)}});return(o,i)=>(s.openBlock(),s.createElementBlock("div",GH,[s.createVNode(gu,{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=a=>r.value=a),options:t.options,name:t.name,id:t.id,disabled:t.disabled,required:t.required,class:"d-flex flex-column gap-3 justify-content-center"},{"option-label":s.withCtx(a=>[s.createElementVNode("label",{for:`${t.id}-${a.index}`,class:"d-block btn btn-outline-primary p-3 fw-bold",role:"button"},s.toDisplayString(a.option.text),9,YH)]),_:1},8,["modelValue","options","name","id","disabled","required"])]))}}),qH=["id","name","multiple","accept","disabled"],JH={class:"input__input-group input-group"},XH=["value","id","name","disabled"],ZH=["for","disabled"],eP={class:"btn btn-outline-contrast"},tP=["for"],nP=["innerHTML"],AP=s.defineComponent({__name:"input-file",props:{modelValue:{type:Array,default:[]},name:{type:String,default:()=>bt()},id:{type:String,default:()=>bt()},label:{type:String,default:""},placeholder:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},pattern:{type:String,default:null},multiple:{type:Boolean,default:!1},accept:{type:String},maxFileSize:{type:Number,default:0},dropzone:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,A=e;function r(l){const u=l.target&&l.target.files;u&&(i.splice(0,i.length),Array.from(u).forEach(f=>{if(n.maxFileSize&&f.size>n.maxFileSize){console.warn(`File ${f.name} exceeds the ${n.maxFileSize} bytes size limit and will not be added.`);return}i.push(f)}))}const o=s.ref(),i=s.reactive([]),a=s.computed(()=>i&&i.map(l=>l.name));return s.watch(()=>n.modelValue,(l,u)=>{l.length===0&&(o.value.value=null)},{deep:!0}),s.watch(()=>i,(l,u)=>{A("update:modelValue",l)},{deep:!0}),(l,u)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["input input-file","input-file--primary"])},[s.createElementVNode("input",{ref_key:"input",ref:o,type:"file",id:t.id,name:t.name,class:"d-none",onChange:r,multiple:t.multiple,accept:t.accept,disabled:t.disabled},null,40,qH),s.createElementVNode("div",JH,[s.renderSlot(l.$slots,"input-prepend"),s.createElementVNode("input",{type:"text",value:a.value,id:t.id,name:t.name,class:"form-control",disabled:t.disabled},null,8,XH),s.renderSlot(l.$slots,"input-append",{},()=>[s.createElementVNode("label",{for:t.id,disabled:t.disabled},[s.renderSlot(l.$slots,"button",{},()=>[s.createElementVNode("span",eP,s.toDisplayString(l.$t("common.selectFile")),1)])],8,ZH)])]),s.createElementVNode("label",{for:t.id},[s.renderSlot(l.$slots,"label",{},()=>[s.createElementVNode("span",{class:"input__label",innerHTML:`${t.label}${t.required?" *":""}`},null,8,nP)])],8,tP)]))}}),rP={key:0,class:"custom-html"},oP=["innerHTML"],iP=s.defineComponent({__name:"custom-html",props:{content:{}},setup(t){const e=s.ref(!1);return s.onMounted(()=>{window!==void 0&&(e.value=!0)}),(n,A)=>e.value?(s.openBlock(),s.createElementBlock("div",rP,[s.renderSlot(n.$slots,"default",{},()=>[s.createElementVNode("span",{class:"custom-html__content",innerHTML:n.content},null,8,oP)])])):s.createCommentVNode("",!0)}}),sP={class:"select-media"},aP=["for"],lP=s.defineComponent({__name:"select-media",props:{modelValue:{type:null,default:""},assets:{type:Array,default:[]},name:{type:String,default:()=>bt()},id:{type:String,default:()=>bt()},label:{type:String},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},emitKey:{type:String,default:"src"}},emits:["update:modelValue","update:selection"],setup(t,{emit:e}){const n=t,A=e,r=s.computed({get(){return n.modelValue},set(o){const i=n.assets.find(a=>a.id===o);A("update:modelValue",n.emitKey?i[n.emitKey]:i),n.emitKey&&n.emitKey!=="id"&&A("update:selection",i.id)}});return(o,i)=>{const a=s.resolveComponent("base-image");return s.openBlock(),s.createElementBlock("div",sP,[s.createVNode(gu,{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=l=>r.value=l),options:t.assets.map(l=>l.id),name:t.name,id:t.id,disabled:t.disabled,required:t.required,class:"d-flex flex-wrap flex-row justify-content-center",itemClass:"col-6 p-2"},{"option-label":s.withCtx(l=>[s.createElementVNode("label",{for:`${t.id}-${l.index}`,class:s.normalizeClass(["w-100",{"is-active":t.assets[l.index].id===r.value}]),role:"button"},[t.assets[l.index].thumbnail?(s.openBlock(),s.createBlock(a,{key:0,src:t.assets[l.index].thumbnail,alt:t.assets[l.index].id},null,8,["src","alt"])):s.createCommentVNode("",!0)],10,aP)]),_:1},8,["modelValue","options","name","id","disabled","required"])])}}});function zn(t){this.content=t}zn.prototype={constructor:zn,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 A=n&&n!=t?this.remove(n):this,r=A.find(t),o=A.content.slice();return r==-1?o.push(n||t,e):(o[r+1]=e,n&&(o[r]=n)),new zn(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new zn(n)},addToStart:function(t,e){return new zn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new zn(n)},addBefore:function(t,e,n){var A=this.remove(e),r=A.content.slice(),o=A.find(t);return r.splice(o==-1?r.length:o,0,e,n),new zn(r)},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=zn.from(t),t.size?new zn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=zn.from(t),t.size?new zn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=zn.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}},zn.from=function(t){if(t instanceof zn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new zn(e)};function eb(t,e,n){for(let A=0;;A++){if(A==t.childCount||A==e.childCount)return t.childCount==e.childCount?null:n;let r=t.child(A),o=e.child(A);if(r==o){n+=r.nodeSize;continue}if(!r.sameMarkup(o))return n;if(r.isText&&r.text!=o.text){for(let i=0;r.text[i]==o.text[i];i++)n++;return n}if(r.content.size||o.content.size){let i=eb(r.content,o.content,n+1);if(i!=null)return i}n+=r.nodeSize}}function tb(t,e,n,A){for(let r=t.childCount,o=e.childCount;;){if(r==0||o==0)return r==o?null:{a:n,b:A};let i=t.child(--r),a=e.child(--o),l=i.nodeSize;if(i==a){n-=l,A-=l;continue}if(!i.sameMarkup(a))return{a:n,b:A};if(i.isText&&i.text!=a.text){let u=0,f=Math.min(i.text.length,a.text.length);for(;u<f&&i.text[i.text.length-u-1]==a.text[a.text.length-u-1];)u++,n--,A--;return{a:n,b:A}}if(i.content.size||a.content.size){let u=tb(i.content,a.content,n-1,A-1);if(u)return u}n-=l,A-=l}}class Qe{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let A=0;A<e.length;A++)this.size+=e[A].nodeSize}nodesBetween(e,n,A,r=0,o){for(let i=0,a=0;a<n;i++){let l=this.content[i],u=a+l.nodeSize;if(u>e&&A(l,r+a,o||null,i)!==!1&&l.content.size){let f=a+1;l.nodesBetween(Math.max(0,e-f),Math.min(l.content.size,n-f),A,r+f)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,A,r){let o="",i=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?r?typeof r=="function"?r(a):r:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&A&&(i?i=!1:o+=A),o+=u},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,A=e.firstChild,r=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(A)&&(r[r.length-1]=n.withText(n.text+A.text),o=1);o<e.content.length;o++)r.push(e.content[o]);return new Qe(r,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let A=[],r=0;if(n>e)for(let o=0,i=0;i<n;o++){let a=this.content[o],l=i+a.nodeSize;l>e&&((i<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-i),Math.min(a.text.length,n-i)):a=a.cut(Math.max(0,e-i-1),Math.min(a.content.size,n-i-1))),A.push(a),r+=a.nodeSize),i=l}return new Qe(A,r)}cutByIndex(e,n){return e==n?Qe.empty:e==0&&n==this.content.length?this:new Qe(this.content.slice(e,n))}replaceChild(e,n){let A=this.content[e];if(A==n)return this;let r=this.content.slice(),o=this.size+n.nodeSize-A.nodeSize;return r[e]=n,new Qe(r,o)}addToStart(e){return new Qe([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Qe(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,A=0;n<this.content.length;n++){let r=this.content[n];e(r,A,n),A+=r.nodeSize}}findDiffStart(e,n=0){return eb(this,e,n)}findDiffEnd(e,n=this.size,A=e.size){return tb(this,e,n,A)}findIndex(e){if(e==0)return Bu(0,e);if(e==this.size)return Bu(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,A=0;;n++){let r=this.child(n),o=A+r.nodeSize;if(o>=e)return o==e?Bu(n+1,o):Bu(n,A);A=o}}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 Qe.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Qe(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Qe.empty;let n,A=0;for(let r=0;r<e.length;r++){let o=e[r];A+=o.nodeSize,r&&o.isText&&e[r-1].sameMarkup(o)?(n||(n=e.slice(0,r)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new Qe(n||e,A)}static from(e){if(!e)return Qe.empty;if(e instanceof Qe)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Qe([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Qe.empty=new Qe([],0);const qp={index:0,offset:0};function Bu(t,e){return qp.index=t,qp.offset=e,qp}function yu(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 A=0;A<t.length;A++)if(!yu(t[A],e[A]))return!1}else{for(let A in t)if(!(A in e)||!yu(t[A],e[A]))return!1;for(let A in e)if(!(A in t))return!1}return!0}let Ht=class N0{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,A=!1;for(let r=0;r<e.length;r++){let o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!A&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,r)),n.push(this),A=!0),n&&n.push(o)}}return n||(n=e.slice()),A||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&&yu(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 A=e.marks[n.type];if(!A)throw new RangeError(`There is no mark type ${n.type} in this schema`);let r=A.create(n.attrs);return A.checkAttrs(r.attrs),r}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let A=0;A<e.length;A++)if(!e[A].eq(n[A]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return N0.none;if(e instanceof N0)return[e];let n=e.slice();return n.sort((A,r)=>A.type.rank-r.type.rank),n}};Ht.none=[];class wu extends Error{}class Ne{constructor(e,n,A){this.content=e,this.openStart=n,this.openEnd=A}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let A=Ab(this.content,e+this.openStart,n);return A&&new Ne(A,this.openStart,this.openEnd)}removeBetween(e,n){return new Ne(nb(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 Ne.empty;let A=n.openStart||0,r=n.openEnd||0;if(typeof A!="number"||typeof r!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Ne(Qe.fromJSON(e,n.content),A,r)}static maxOpen(e,n=!0){let A=0,r=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)A++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)r++;return new Ne(e,A,r)}}Ne.empty=new Ne(Qe.empty,0,0);function nb(t,e,n){let{index:A,offset:r}=t.findIndex(e),o=t.maybeChild(A),{index:i,offset:a}=t.findIndex(n);if(r==e||o.isText){if(a!=n&&!t.child(i).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(A!=i)throw new RangeError("Removing non-flat range");return t.replaceChild(A,o.copy(nb(o.content,e-r-1,n-r-1)))}function Ab(t,e,n,A){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r);if(o==e||i.isText)return A&&!A.canReplace(r,r,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=Ab(i.content,e-o-1,n,i);return a&&t.replaceChild(r,i.copy(a))}function cP(t,e,n){if(n.openStart>t.depth)throw new wu("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new wu("Inconsistent open depths");return rb(t,e,n,0)}function rb(t,e,n,A){let r=t.index(A),o=t.node(A);if(r==e.index(A)&&A<t.depth-n.openStart){let i=rb(t,e,n,A+1);return o.copy(o.content.replaceChild(r,i))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==A&&e.depth==A){let i=t.parent,a=i.content;return ss(i,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:i,end:a}=uP(n,t);return ss(o,ib(t,i,a,e,A))}else return ss(o,Cu(t,e,A))}function ob(t,e){if(!e.type.compatibleContent(t.type))throw new wu("Cannot join "+e.type.name+" onto "+t.type.name)}function Jp(t,e,n){let A=t.node(n);return ob(A,e.node(n)),A}function is(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 kl(t,e,n,A){let r=(e||t).node(n),o=0,i=e?e.index(n):r.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(is(t.nodeAfter,A),o++));for(let a=o;a<i;a++)is(r.child(a),A);e&&e.depth==n&&e.textOffset&&is(e.nodeBefore,A)}function ss(t,e){return t.type.checkContent(e),t.copy(e)}function ib(t,e,n,A,r){let o=t.depth>r&&Jp(t,e,r+1),i=A.depth>r&&Jp(n,A,r+1),a=[];return kl(null,t,r,a),o&&i&&e.index(r)==n.index(r)?(ob(o,i),is(ss(o,ib(t,e,n,A,r+1)),a)):(o&&is(ss(o,Cu(t,e,r+1)),a),kl(e,n,r,a),i&&is(ss(i,Cu(n,A,r+1)),a)),kl(A,null,r,a),new Qe(a)}function Cu(t,e,n){let A=[];if(kl(null,t,n,A),t.depth>n){let r=Jp(t,e,n+1);is(ss(r,Cu(t,e,n+1)),A)}return kl(e,null,n,A),new Qe(A)}function uP(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)r=e.node(o).copy(Qe.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}class Sl{constructor(e,n,A){this.pos=e,this.path=n,this.parentOffset=A,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 A=this.pos-this.path[this.path.length-1],r=e.child(n);return A?e.child(n).cut(A):r}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 A=this.path[n*3],r=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)r+=A.child(o).nodeSize;return r}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Ht.none;if(this.textOffset)return e.child(n).marks;let A=e.maybeChild(n-1),r=e.maybeChild(n);if(!A){let a=A;A=r,r=a}let o=A.marks;for(var i=0;i<o.length;i++)o[i].type.spec.inclusive===!1&&(!r||!o[i].isInSet(r.marks))&&(o=o[i--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let A=n.marks,r=e.parent.maybeChild(e.index());for(var o=0;o<A.length;o++)A[o].type.spec.inclusive===!1&&(!r||!A[o].isInSet(r.marks))&&(A=A[o--].removeFromSet(A));return A}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 A=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);A>=0;A--)if(e.pos<=this.end(A)&&(!n||n(this.node(A))))return new bu(this,e,A);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 A=[],r=0,o=n;for(let i=e;;){let{index:a,offset:l}=i.content.findIndex(o),u=o-l;if(A.push(i,a,r+l),!u||(i=i.child(a),i.isText))break;o=u-1,r+=l+1}return new Sl(n,A,o)}static resolveCached(e,n){let A=sb.get(e);if(A)for(let o=0;o<A.elts.length;o++){let i=A.elts[o];if(i.pos==n)return i}else sb.set(e,A=new dP);let r=A.elts[A.i]=Sl.resolve(e,n);return A.i=(A.i+1)%fP,r}}class dP{constructor(){this.elts=[],this.i=0}}const fP=12,sb=new WeakMap;class bu{constructor(e,n,A){this.$from=e,this.$to=n,this.depth=A}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 hP=Object.create(null);let ii=class H0{constructor(e,n,A,r=Ht.none){this.type=e,this.attrs=n,this.marks=r,this.content=A||Qe.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,A,r=0){this.content.nodesBetween(e,n,A,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,A,r){return this.content.textBetween(e,n,A,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,A){return this.type==e&&yu(this.attrs,n||e.defaultAttrs||hP)&&Ht.sameSet(this.marks,A||Ht.none)}copy(e=null){return e==this.content?this:new H0(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new H0(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,A=!1){if(e==n)return Ne.empty;let r=this.resolve(e),o=this.resolve(n),i=A?0:r.sharedDepth(n),a=r.start(i),u=r.node(i).content.cut(r.pos-a,o.pos-a);return new Ne(u,r.depth-i,o.depth-i)}replace(e,n,A){return cP(this.resolve(e),this.resolve(n),A)}nodeAt(e){for(let n=this;;){let{index:A,offset:r}=n.content.findIndex(e);if(n=n.maybeChild(A),!n)return null;if(r==e||n.isText)return n;e-=r+1}}childAfter(e){let{index:n,offset:A}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:A}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:A}=this.content.findIndex(e);if(A<e)return{node:this.content.child(n),index:n,offset:A};let r=this.content.child(n-1);return{node:r,index:n-1,offset:A-r.nodeSize}}resolve(e){return Sl.resolveCached(this,e)}resolveNoCache(e){return Sl.resolve(this,e)}rangeHasMark(e,n,A){let r=!1;return n>e&&this.nodesBetween(e,n,o=>(A.isInSet(o.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),ab(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,A=Qe.empty,r=0,o=A.childCount){let i=this.contentMatchAt(e).matchFragment(A,r,o),a=i&&i.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=r;l<o;l++)if(!this.type.allowsMarks(A.child(l).marks))return!1;return!0}canReplaceWith(e,n,A,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(e).matchType(A),i=o&&o.matchFragment(this.content,n);return i?i.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=Ht.none;for(let n=0;n<this.marks.length;n++){let A=this.marks[n];A.type.checkAttrs(A.attrs),e=A.addToSet(e)}if(!Ht.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 A;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");A=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,A)}let r=Qe.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,r,A);return o.type.checkAttrs(o.attrs),o}};ii.prototype.text=void 0;class vu extends ii{constructor(e,n,A,r){if(super(e,n,null,r),!A)throw new RangeError("Empty text nodes are not allowed");this.text=A}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ab(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 vu(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new vu(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 ab(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class as{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let A=new pP(e,n);if(A.next==null)return as.empty;let r=lb(A);A.next&&A.err("Unexpected trailing text");let o=bP(CP(r));return vP(o,A),o}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,A=e.childCount){let r=this;for(let o=n;r&&o<A;o++)r=r.matchType(e.child(o).type);return r}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 A=0;A<e.next.length;A++)if(this.next[n].type==e.next[A].type)return!0;return!1}fillBefore(e,n=!1,A=0){let r=[this];function o(i,a){let l=i.matchFragment(e,A);if(l&&(!n||l.validEnd))return Qe.from(a.map(u=>u.createAndFill()));for(let u=0;u<i.next.length;u++){let{type:f,next:h}=i.next[u];if(!(f.isText||f.hasRequiredAttrs())&&r.indexOf(h)==-1){r.push(h);let p=o(h,a.concat(f));if(p)return p}}return null}return o(this,[])}findWrapping(e){for(let A=0;A<this.wrapCache.length;A+=2)if(this.wrapCache[A]==e)return this.wrapCache[A+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),A=[{match:this,type:null,via:null}];for(;A.length;){let r=A.shift(),o=r.match;if(o.matchType(e)){let i=[];for(let a=r;a.type;a=a.via)i.push(a.type);return i.reverse()}for(let i=0;i<o.next.length;i++){let{type:a,next:l}=o.next[i];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!r.type||l.validEnd)&&(A.push({match:a.contentMatch,type:a,via:r}),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(A){e.push(A);for(let r=0;r<A.next.length;r++)e.indexOf(A.next[r].next)==-1&&n(A.next[r].next)}return n(this),e.map((A,r)=>{let o=r+(A.validEnd?"*":" ")+" ";for(let i=0;i<A.next.length;i++)o+=(i?", ":"")+A.next[i].type.name+"->"+e.indexOf(A.next[i].next);return o}).join(`
|
|
26
26
|
`)}}as.empty=new as(!0);class pP{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 lb(t){let e=[];do e.push(mP(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function mP(t){let e=[];do e.push(gP(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function gP(t){let e=wP(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=BP(t,e);else break;return e}function cb(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function BP(t,e){let n=cb(t),A=n;return t.eat(",")&&(t.next!="}"?A=cb(t):A=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:A,expr:e}}function yP(t,e){let n=t.nodeTypes,A=n[e];if(A)return[A];let r=[];for(let o in n){let i=n[o];i.isInGroup(e)&&r.push(i)}return r.length==0&&t.err("No node type or group '"+e+"' found"),r}function wP(t){if(t.eat("(")){let e=lb(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=yP(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 CP(t){let e=[[]];return r(o(t,0),n()),e;function n(){return e.push([])-1}function A(i,a,l){let u={term:l,to:a};return e[i].push(u),u}function r(i,a){i.forEach(l=>l.to=a)}function o(i,a){if(i.type=="choice")return i.exprs.reduce((l,u)=>l.concat(o(u,a)),[]);if(i.type=="seq")for(let l=0;;l++){let u=o(i.exprs[l],a);if(l==i.exprs.length-1)return u;r(u,a=n())}else if(i.type=="star"){let l=n();return A(a,l),r(o(i.expr,l),l),[A(l)]}else if(i.type=="plus"){let l=n();return r(o(i.expr,a),l),r(o(i.expr,l),l),[A(l)]}else{if(i.type=="opt")return[A(a)].concat(o(i.expr,a));if(i.type=="range"){let l=a;for(let u=0;u<i.min;u++){let f=n();r(o(i.expr,l),f),l=f}if(i.max==-1)r(o(i.expr,l),l);else for(let u=i.min;u<i.max;u++){let f=n();A(l,f),r(o(i.expr,l),f),l=f}return[A(l)]}else{if(i.type=="name")return[A(a,void 0,i.value)];throw new Error("Unknown expr type")}}}}function ub(t,e){return e-t}function db(t,e){let n=[];return A(e),n.sort(ub);function A(r){let o=t[r];if(o.length==1&&!o[0].term)return A(o[0].to);n.push(r);for(let i=0;i<o.length;i++){let{term:a,to:l}=o[i];!a&&n.indexOf(l)==-1&&A(l)}}}function bP(t){let e=Object.create(null);return n(db(t,0));function n(A){let r=[];A.forEach(i=>{t[i].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let f=0;f<r.length;f++)r[f][0]==a&&(u=r[f][1]);db(t,l).forEach(f=>{u||r.push([a,u=[]]),u.indexOf(f)==-1&&u.push(f)})})});let o=e[A.join(",")]=new as(A.indexOf(t.length-1)>-1);for(let i=0;i<r.length;i++){let a=r[i][1].sort(ub);o.next.push({type:r[i][0],next:e[a.join(",")]||n(a)})}return o}}function vP(t,e){for(let n=0,A=[t];n<A.length;n++){let r=A[n],o=!r.validEnd,i=[];for(let a=0;a<r.next.length;a++){let{type:l,next:u}=r.next[a];i.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),A.indexOf(u)==-1&&A.push(u)}o&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function fb(t){let e=Object.create(null);for(let n in t){let A=t[n];if(!A.hasDefault)return null;e[n]=A.default}return e}function hb(t,e){let n=Object.create(null);for(let A in t){let r=e&&e[A];if(r===void 0){let o=t[A];if(o.hasDefault)r=o.default;else throw new RangeError("No value supplied for attribute "+A)}n[A]=r}return n}function pb(t,e,n,A){for(let r in e)if(!(r in t))throw new RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let r in t){let o=t[r];o.validate&&o.validate(e[r])}}function mb(t,e){let n=Object.create(null);if(e)for(let A in e)n[A]=new kP(t,A,e[A]);return n}let gb=class wT{constructor(e,n,A){this.name=e,this.schema=n,this.spec=A,this.markSet=null,this.groups=A.group?A.group.split(" "):[],this.attrs=mb(e,A.attrs),this.defaultAttrs=fb(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(A.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==as.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:hb(this.attrs,e)}create(e=null,n,A){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ii(this,this.computeAttrs(e),Qe.from(n),Ht.setFrom(A))}createChecked(e=null,n,A){return n=Qe.from(n),this.checkContent(n),new ii(this,this.computeAttrs(e),n,Ht.setFrom(A))}createAndFill(e=null,n,A){if(e=this.computeAttrs(e),n=Qe.from(n),n.size){let i=this.contentMatch.fillBefore(n);if(!i)return null;n=i.append(n)}let r=this.contentMatch.matchFragment(n),o=r&&r.fillBefore(Qe.empty,!0);return o?new ii(this,e,n.append(o),Ht.setFrom(A)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let A=0;A<e.childCount;A++)if(!this.allowsMarks(e.child(A).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){pb(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 A=0;A<e.length;A++)this.allowsMarkType(e[A].type)?n&&n.push(e[A]):n||(n=e.slice(0,A));return n?n.length?n:Ht.none:e}static compile(e,n){let A=Object.create(null);e.forEach((o,i)=>A[o]=new wT(o,n,i));let r=n.spec.topNode||"doc";if(!A[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!A.text)throw new RangeError("Every schema needs a 'text' type");for(let o in A.text.attrs)throw new RangeError("The text node type should not have attributes");return A}};function EP(t,e,n){let A=n.split("|");return r=>{let o=r===null?"null":typeof r;if(A.indexOf(o)<0)throw new RangeError(`Expected value of type ${A} for attribute ${e} on type ${t}, got ${o}`)}}class kP{constructor(e,n,A){this.hasDefault=Object.prototype.hasOwnProperty.call(A,"default"),this.default=A.default,this.validate=typeof A.validate=="string"?EP(e,n,A.validate):A.validate}get isRequired(){return!this.hasDefault}}class Eu{constructor(e,n,A,r){this.name=e,this.rank=n,this.schema=A,this.spec=r,this.attrs=mb(e,r.attrs),this.excluded=null;let o=fb(this.attrs);this.instance=o?new Ht(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Ht(this,hb(this.attrs,e))}static compile(e,n){let A=Object.create(null),r=0;return e.forEach((o,i)=>A[o]=new Eu(o,r++,n,i)),A}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){pb(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Bb{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let r in e)n[r]=e[r];n.nodes=zn.from(e.nodes),n.marks=zn.from(e.marks||{}),this.nodes=gb.compile(this.spec.nodes,this),this.marks=Eu.compile(this.spec.marks,this);let A=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let o=this.nodes[r],i=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=A[i]||(A[i]=as.parse(i,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?yb(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let r in this.marks){let o=this.marks[r],i=o.spec.excludes;o.excluded=i==null?[o]:i==""?[]:yb(this,i.split(" "))}this.nodeFromJSON=r=>ii.fromJSON(this,r),this.markFromJSON=r=>Ht.fromJSON(this,r),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,A,r){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof gb){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,A,r)}text(e,n){let A=this.nodes.text;return new vu(A,A.defaultAttrs,e,Ht.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 yb(t,e){let n=[];for(let A=0;A<e.length;A++){let r=e[A],o=t.marks[r],i=o;if(o)n.push(o);else for(let a in t.marks){let l=t.marks[a];(r=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(r)>-1)&&n.push(i=l)}if(!i)throw new SyntaxError("Unknown mark type: '"+e[A]+"'")}return n}function SP(t){return t.tag!=null}function FP(t){return t.style!=null}class si{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let A=this.matchedStyles=[];n.forEach(r=>{if(SP(r))this.tags.push(r);else if(FP(r)){let o=/[^=]*/.exec(r.style)[0];A.indexOf(o)<0&&A.push(o),this.styles.push(r)}}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let o=e.nodes[r.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let A=new vb(this,n,!1);return A.addAll(e,Ht.none,n.from,n.to),A.finish()}parseSlice(e,n={}){let A=new vb(this,n,!0);return A.addAll(e,Ht.none,n.from,n.to),Ne.maxOpen(A.finish())}matchTag(e,n,A){for(let r=A?this.tags.indexOf(A)+1:0;r<this.tags.length;r++){let o=this.tags[r];if(UP(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let i=o.getAttrs(e);if(i===!1)continue;o.attrs=i||void 0}return o}}}matchStyle(e,n,A,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let i=this.styles[o],a=i.style;if(!(a.indexOf(e)!=0||i.context&&!A.matchesContext(i.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(i.getAttrs){let l=i.getAttrs(n);if(l===!1)continue;i.attrs=l||void 0}return i}}}static schemaRules(e){let n=[];function A(r){let o=r.priority==null?50:r.priority,i=0;for(;i<n.length;i++){let a=n[i];if((a.priority==null?50:a.priority)<o)break}n.splice(i,0,r)}for(let r in e.marks){let o=e.marks[r].spec.parseDOM;o&&o.forEach(i=>{A(i=Eb(i)),i.mark||i.ignore||i.clearMark||(i.mark=r)})}for(let r in e.nodes){let o=e.nodes[r].spec.parseDOM;o&&o.forEach(i=>{A(i=Eb(i)),i.node||i.ignore||i.mark||(i.node=r)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new si(e,si.schemaRules(e)))}}const wb={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},QP={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Cb={ol:!0,ul:!0},Fl=1,Xp=2,Ql=4;function bb(t,e,n){return e!=null?(e?Fl:0)|(e==="full"?Xp:0):t&&t.whitespace=="pre"?Fl|Xp:n&~Ql}class ku{constructor(e,n,A,r,o,i){this.type=e,this.attrs=n,this.marks=A,this.solid=r,this.options=i,this.content=[],this.activeMarks=Ht.none,this.match=o||(i&Ql?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Qe.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let A=this.type.contentMatch,r;return(r=A.findWrapping(e.type))?(this.match=A,r):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Fl)){let A=this.content[this.content.length-1],r;if(A&&A.isText&&(r=/[ \t\r\n\u000c]+$/.exec(A.text))){let o=A;A.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-r[0].length))}}let n=Qe.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(Qe.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&&!wb.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class vb{constructor(e,n,A){this.parser=e,this.options=n,this.isOpen=A,this.open=0,this.localPreserveWS=!1;let r=n.topNode,o,i=bb(null,n.preserveWhitespace,0)|(A?Ql:0);r?o=new ku(r.type,r.attrs,Ht.none,!0,n.topMatch||r.type.contentMatch,i):A?o=new ku(null,null,Ht.none,!0,null,i):o=new ku(e.schema.topNodeType,null,Ht.none,!0,null,i),this.nodes=[o],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 A=e.nodeValue,r=this.top,o=r.options&Xp?"full":this.localPreserveWS||(r.options&Fl)>0;if(o==="full"||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(A)){if(o)o!=="full"?A=A.replace(/\r?\n|\r/g," "):A=A.replace(/\r\n?/g,`
|
|
27
27
|
`);else if(A=A.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(A)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],a=e.previousSibling;(!i||a&&a.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(A=A.slice(1))}A&&this.insertNode(this.parser.schema.text(A),n,!/\S/.test(A)),this.findInText(e)}else this.findInside(e)}addElement(e,n,A){let r=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let i=e.nodeName.toLowerCase(),a;Cb.hasOwnProperty(i)&&this.parser.normalizeLists&&xP(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,A));e:if(l?l.ignore:QP.hasOwnProperty(i))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(wb.hasOwnProperty(i))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),u=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let h=l&&l.skip?n:this.readStyles(e,n);h&&this.addAll(e,h),u&&this.sync(o),this.needsBlock=f}else{let u=this.readStyles(e,n);u&&this.addElementByRule(e,l,u,l.consuming===!1?a:void 0)}this.localPreserveWS=r}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
28
28
|
`),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 A=e.style;if(A&&A.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let o=this.parser.matchedStyles[r],i=A.getPropertyValue(o);if(i)for(let a=void 0;;){let l=this.parser.matchStyle(o,i,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,A,r){let o,i;if(n.node)if(i=this.parser.schema.nodes[n.node],i.isLeaf)this.insertNode(i.create(n.attrs),A,e.nodeName=="BR")||this.leafFallback(e,A);else{let l=this.enter(i,n.attrs||null,A,n.preserveWhitespace);l&&(o=!0,A=l)}else{let l=this.parser.schema.marks[n.mark];A=A.concat(l.create(n.attrs))}let a=this.top;if(i&&i.isLeaf)this.findInside(e);else if(r)this.addElement(e,A,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,A,!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,A),this.findAround(e,l,!1)}o&&this.sync(a)&&this.open--}addAll(e,n,A,r){let o=A||0;for(let i=A?e.childNodes[A]:e.firstChild,a=r==null?null:e.childNodes[r];i!=a;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i,n);this.findAtPoint(e,o)}findPlace(e,n,A){let r,o;for(let i=this.open,a=0;i>=0;i--){let l=this.nodes[i],u=l.findWrapping(e);if(u&&(!r||r.length>u.length+a)&&(r=u,o=l,!u.length))break;if(l.solid){if(A)break;a+=2}}if(!r)return null;this.sync(o);for(let i=0;i<r.length;i++)n=this.enterInner(r[i],null,n,!1);return n}insertNode(e,n,A){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let r=this.findPlace(e,n,A);if(r){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let i=Ht.none;for(let a of r.concat(e.marks))(o.type?o.type.allowsMarkType(a.type):kb(a.type,e.type))&&(i=a.addToSet(i));return o.content.push(e.mark(i)),!0}return!1}enter(e,n,A,r){let o=this.findPlace(e.create(n),A,!1);return o&&(o=this.enterInner(e,n,A,!0,r)),o}enterInner(e,n,A,r=!1,o){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(e);let a=bb(e,o,i.options);i.options&Ql&&i.content.length==0&&(a|=Ql);let l=Ht.none;return A=A.filter(u=>(i.type?i.type.allowsMarkType(u.type):kb(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new ku(e,n,l,r,null,a)),this.open++,A}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|=Fl)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let A=this.nodes[n].content;for(let r=A.length-1;r>=0;r--)e+=A[r].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let A=0;A<this.find.length;A++)this.find[A].node==e&&this.find[A].offset==n&&(this.find[A].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,A){if(e!=n&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&n.compareDocumentPosition(this.find[r].node)&(A?2:4)&&(this.find[r].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("/"),A=this.options.context,r=!this.isOpen&&(!A||A.parent.type==this.nodes[0].type),o=-(A?A.depth+1:0)+(r?0:1),i=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(i(a-1,l))return!0;return!1}else{let f=l>0||l==0&&r?this.nodes[l].type:A&&l>=o?A.node(l-o).type:null;if(!f||f.name!=u&&!f.isInGroup(u))return!1;l--}}return!0};return i(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let A=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(A&&A.isTextblock&&A.defaultAttrs)return A}for(let n in this.parser.schema.nodes){let A=this.parser.schema.nodes[n];if(A.isTextblock&&A.defaultAttrs)return A}}}function xP(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let A=e.nodeType==1?e.nodeName.toLowerCase():null;A&&Cb.hasOwnProperty(A)&&n?(n.appendChild(e),e=n):A=="li"?n=e:A&&(n=null)}}function UP(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Eb(t){let e={};for(let n in t)e[n]=t[n];return e}function kb(t,e){let n=e.schema.nodes;for(let A in n){let r=n[A];if(!r.allowsMarkType(t))continue;let o=[],i=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:u,next:f}=a.edge(l);if(u==e||o.indexOf(f)<0&&i(f))return!0}};if(i(r.contentMatch))return!0}}class ls{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},A){A||(A=Zp(n).createDocumentFragment());let r=A,o=[];return e.forEach(i=>{if(o.length||i.marks.length){let a=0,l=0;for(;a<o.length&&l<i.marks.length;){let u=i.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(o[a][0])||u.type.spec.spanning===!1)break;a++,l++}for(;a<o.length;)r=o.pop()[1];for(;l<i.marks.length;){let u=i.marks[l++],f=this.serializeMark(u,i.isInline,n);f&&(o.push([u,r]),r.appendChild(f.dom),r=f.contentDOM||f.dom)}}r.appendChild(this.serializeNodeInner(i,n))}),A}serializeNodeInner(e,n){let{dom:A,contentDOM:r}=Su(Zp(n),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,r)}return A}serializeNode(e,n={}){let A=this.serializeNodeInner(e,n);for(let r=e.marks.length-1;r>=0;r--){let o=this.serializeMark(e.marks[r],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(A),A=o.dom)}return A}serializeMark(e,n,A={}){let r=this.marks[e.type.name];return r&&Su(Zp(A),r(e,n),null,e.attrs)}static renderSpec(e,n,A=null,r){return Su(e,n,A,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ls(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Sb(e.nodes);return n.text||(n.text=A=>A.text),n}static marksFromSchema(e){return Sb(e.marks)}}function Sb(t){let e={};for(let n in t){let A=t[n].spec.toDOM;A&&(e[n]=A)}return e}function Zp(t){return t.document||window.document}const Fb=new WeakMap;function IP(t){let e=Fb.get(t);return e===void 0&&Fb.set(t,e=_P(t)),e}function _P(t){let e=null;function n(A){if(A&&typeof A=="object")if(Array.isArray(A))if(typeof A[0]=="string")e||(e=[]),e.push(A);else for(let r=0;r<A.length;r++)n(A[r]);else for(let r in A)n(A[r])}return n(t),e}function Su(t,e,n,A){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 r=e[0],o;if(typeof r!="string")throw new RangeError("Invalid array passed to renderSpec");if(A&&(o=IP(A))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let i=r.indexOf(" ");i>0&&(n=r.slice(0,i),r=r.slice(i+1));let a,l=n?t.createElementNS(n,r):t.createElement(r),u=e[1],f=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){f=2;for(let h in u)if(u[h]!=null){let p=h.indexOf(" ");p>0?l.setAttributeNS(h.slice(0,p),h.slice(p+1),u[h]):h=="style"&&l.style?l.style.cssText=u[h]:l.setAttribute(h,u[h])}}for(let h=f;h<e.length;h++){let p=e[h];if(p===0){if(h<e.length-1||h>f)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:g,contentDOM:B}=Su(t,p,n,A);if(l.appendChild(g),B){if(a)throw new RangeError("Multiple content holes");a=B}}}return{dom:l,contentDOM:a}}const Qb=65535,xb=Math.pow(2,16);function TP(t,e){return t+e*xb}function Ub(t){return t&Qb}function DP(t){return(t-(t&Qb))/xb}const Ib=1,_b=2,Fu=4,Tb=8;class em{constructor(e,n,A){this.pos=e,this.delInfo=n,this.recover=A}get deleted(){return(this.delInfo&Tb)>0}get deletedBefore(){return(this.delInfo&(Ib|Fu))>0}get deletedAfter(){return(this.delInfo&(_b|Fu))>0}get deletedAcross(){return(this.delInfo&Fu)>0}}class NA{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&NA.empty)return NA.empty}recover(e){let n=0,A=Ub(e);if(!this.inverted)for(let r=0;r<A;r++)n+=this.ranges[r*3+2]-this.ranges[r*3+1];return this.ranges[A*3]+n+DP(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,A){let r=0,o=this.inverted?2:1,i=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+o],f=this.ranges[a+i],h=l+u;if(e<=h){let p=u?e==l?-1:e==h?1:n:n,g=l+r+(p<0?0:f);if(A)return g;let B=e==(n<0?l:h)?null:TP(a/3,e-l),y=e==l?_b:e==h?Ib:Fu;return(n<0?e!=l:e!=h)&&(y|=Tb),new em(g,y,B)}r+=f-u}return A?e+r:new em(e+r,0,null)}touches(e,n){let A=0,r=Ub(n),o=this.inverted?2:1,i=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?A:0);if(l>e)break;let u=this.ranges[a+o],f=l+u;if(e<=f&&a==r*3)return!0;A+=this.ranges[a+i]-u}return!1}forEach(e){let n=this.inverted?2:1,A=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],a=i-(this.inverted?o:0),l=i+(this.inverted?0:o),u=this.ranges[r+n],f=this.ranges[r+A];e(a,a+u,l,l+f),o+=f-u}}invert(){return new NA(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?NA.empty:new NA(e<0?[0,-e,0]:[0,0,e])}}NA.empty=new NA([]);class xl{constructor(e,n,A=0,r=e?e.length:0){this.mirror=n,this.from=A,this.to=r,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new xl(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,A=this._maps.length;n<e._maps.length;n++){let r=e.getMirror(n);this.appendMap(e._maps[n],r!=null&&r<n?A+r: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,A=this._maps.length+e._maps.length;n>=0;n--){let r=e.getMirror(n);this.appendMap(e._maps[n].invert(),r!=null&&r>n?A-r-1:void 0)}}invert(){let e=new xl;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let A=this.from;A<this.to;A++)e=this._maps[A].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,A){let r=0;for(let o=this.from;o<this.to;o++){let i=this._maps[o],a=i.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,e=this._maps[l].recover(a.recover);continue}}r|=a.delInfo,e=a.pos}return A?e:new em(e,r,null)}}const tm=Object.create(null);class tA{getMap(){return NA.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let A=tm[n.stepType];if(!A)throw new RangeError(`No step type ${n.stepType} defined`);return A.fromJSON(e,n)}static jsonID(e,n){if(e in tm)throw new RangeError("Duplicate use of step JSON ID "+e);return tm[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,A,r){try{return En.ok(e.replace(n,A,r))}catch(o){if(o instanceof wu)return En.fail(o.message);throw o}}}function nm(t,e,n){let A=[];for(let r=0;r<t.childCount;r++){let o=t.child(r);o.content.size&&(o=o.copy(nm(o.content,e,o))),o.isInline&&(o=e(o,n,r)),A.push(o)}return Qe.fromArray(A)}class ai extends tA{constructor(e,n,A){super(),this.from=e,this.to=n,this.mark=A}apply(e){let n=e.slice(this.from,this.to),A=e.resolve(this.from),r=A.node(A.sharedDepth(this.to)),o=new Ne(nm(n.content,(i,a)=>!i.isAtom||!a.type.allowsMarkType(this.mark.type)?i:i.mark(this.mark.addToSet(i.marks)),r),n.openStart,n.openEnd);return En.fromReplace(e,this.from,this.to,o)}invert(){return new xr(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),A=e.mapResult(this.to,-1);return n.deleted&&A.deleted||n.pos>=A.pos?null:new ai(n.pos,A.pos,this.mark)}merge(e){return e instanceof ai&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ai(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 ai(n.from,n.to,e.markFromJSON(n.mark))}}tA.jsonID("addMark",ai);class xr extends tA{constructor(e,n,A){super(),this.from=e,this.to=n,this.mark=A}apply(e){let n=e.slice(this.from,this.to),A=new Ne(nm(n.content,r=>r.mark(this.mark.removeFromSet(r.marks)),e),n.openStart,n.openEnd);return En.fromReplace(e,this.from,this.to,A)}invert(){return new ai(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),A=e.mapResult(this.to,-1);return n.deleted&&A.deleted||n.pos>=A.pos?null:new xr(n.pos,A.pos,this.mark)}merge(e){return e instanceof xr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new xr(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 xr(n.from,n.to,e.markFromJSON(n.mark))}}tA.jsonID("removeMark",xr);class li extends tA{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 A=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return En.fromReplace(e,this.pos,this.pos+1,new Ne(Qe.from(A),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let A=this.mark.addToSet(n.marks);if(A.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(A))return new li(this.pos,n.marks[r]);return new li(this.pos,this.mark)}}return new cs(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new li(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 li(n.pos,e.markFromJSON(n.mark))}}tA.jsonID("addNodeMark",li);class cs extends tA{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 A=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return En.fromReplace(e,this.pos,this.pos+1,new Ne(Qe.from(A),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new li(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new cs(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 cs(n.pos,e.markFromJSON(n.mark))}}tA.jsonID("removeNodeMark",cs);class Ln extends tA{constructor(e,n,A,r=!1){super(),this.from=e,this.to=n,this.slice=A,this.structure=r}apply(e){return this.structure&&Am(e,this.from,this.to)?En.fail("Structure replace would overwrite content"):En.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new NA([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ln(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),A=e.mapResult(this.to,-1);return n.deletedAcross&&A.deletedAcross?null:new Ln(n.pos,Math.max(n.pos,A.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Ln)||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?Ne.empty:new Ne(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ln(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?Ne.empty:new Ne(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ln(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 Ln(n.from,n.to,Ne.fromJSON(e,n.slice),!!n.structure)}}tA.jsonID("replace",Ln);class Nn extends tA{constructor(e,n,A,r,o,i,a=!1){super(),this.from=e,this.to=n,this.gapFrom=A,this.gapTo=r,this.slice=o,this.insert=i,this.structure=a}apply(e){if(this.structure&&(Am(e,this.from,this.gapFrom)||Am(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 A=this.slice.insertAt(this.insert,n.content);return A?En.fromReplace(e,this.from,this.to,A):En.fail("Content does not fit in gap")}getMap(){return new NA([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 Nn(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),A=e.mapResult(this.to,-1),r=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?A.pos:e.map(this.gapTo,1);return n.deletedAcross&&A.deletedAcross||r<n.pos||o>A.pos?null:new Nn(n.pos,A.pos,r,o,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 Nn(n.from,n.to,n.gapFrom,n.gapTo,Ne.fromJSON(e,n.slice),n.insert,!!n.structure)}}tA.jsonID("replaceAround",Nn);function Am(t,e,n){let A=t.resolve(e),r=n-e,o=A.depth;for(;r>0&&o>0&&A.indexAfter(o)==A.node(o).childCount;)o--,r--;if(r>0){let i=A.node(o).maybeChild(A.indexAfter(o));for(;r>0;){if(!i||i.isLeaf)return!0;i=i.firstChild,r--}}return!1}function MP(t,e,n,A){let r=[],o=[],i,a;t.doc.nodesBetween(e,n,(l,u,f)=>{if(!l.isInline)return;let h=l.marks;if(!A.isInSet(h)&&f.type.allowsMarkType(A.type)){let p=Math.max(u,e),g=Math.min(u+l.nodeSize,n),B=A.addToSet(h);for(let y=0;y<h.length;y++)h[y].isInSet(B)||(i&&i.to==p&&i.mark.eq(h[y])?i.to=g:r.push(i=new xr(p,g,h[y])));a&&a.to==p?a.to=g:o.push(a=new ai(p,g,A))}}),r.forEach(l=>t.step(l)),o.forEach(l=>t.step(l))}function OP(t,e,n,A){let r=[],o=0;t.doc.nodesBetween(e,n,(i,a)=>{if(!i.isInline)return;o++;let l=null;if(A instanceof Eu){let u=i.marks,f;for(;f=A.isInSet(u);)(l||(l=[])).push(f),u=f.removeFromSet(u)}else A?A.isInSet(i.marks)&&(l=[A]):l=i.marks;if(l&&l.length){let u=Math.min(a+i.nodeSize,n);for(let f=0;f<l.length;f++){let h=l[f],p;for(let g=0;g<r.length;g++){let B=r[g];B.step==o-1&&h.eq(r[g].style)&&(p=B)}p?(p.to=u,p.step=o):r.push({style:h,from:Math.max(a,e),to:u,step:o})}}}),r.forEach(i=>t.step(new xr(i.from,i.to,i.style)))}function rm(t,e,n,A=n.contentMatch,r=!0){let o=t.doc.nodeAt(e),i=[],a=e+1;for(let l=0;l<o.childCount;l++){let u=o.child(l),f=a+u.nodeSize,h=A.matchType(u.type);if(!h)i.push(new Ln(a,f,Ne.empty));else{A=h;for(let p=0;p<u.marks.length;p++)n.allowsMarkType(u.marks[p].type)||t.step(new xr(a,f,u.marks[p]));if(r&&u.isText&&n.whitespace!="pre"){let p,g=/\r?\n|\r/g,B;for(;p=g.exec(u.text);)B||(B=new Ne(Qe.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),i.push(new Ln(a+p.index,a+p.index+p[0].length,B))}}a=f}if(!A.validEnd){let l=A.fillBefore(Qe.empty,!0);t.replace(a,a,new Ne(l,0,0))}for(let l=i.length-1;l>=0;l--)t.step(i[l])}function LP(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function aa(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let A=t.depth;;--A){let r=t.$from.node(A),o=t.$from.index(A),i=t.$to.indexAfter(A);if(A<t.depth&&r.canReplace(o,i,n))return A;if(A==0||r.type.spec.isolating||!LP(r,o,i))break}return null}function NP(t,e,n){let{$from:A,$to:r,depth:o}=e,i=A.before(o+1),a=r.after(o+1),l=i,u=a,f=Qe.empty,h=0;for(let B=o,y=!1;B>n;B--)y||A.index(B)>0?(y=!0,f=Qe.from(A.node(B).copy(f)),h++):l--;let p=Qe.empty,g=0;for(let B=o,y=!1;B>n;B--)y||r.after(B+1)<r.end(B)?(y=!0,p=Qe.from(r.node(B).copy(p)),g++):u++;t.step(new Nn(l,u,i,a,new Ne(f.append(p),h,g),f.size-h,!0))}function om(t,e,n=null,A=t){let r=HP(t,e),o=r&&PP(A,e);return o?r.map(Db).concat({type:e,attrs:n}).concat(o.map(Db)):null}function Db(t){return{type:t,attrs:null}}function HP(t,e){let{parent:n,startIndex:A,endIndex:r}=t,o=n.contentMatchAt(A).findWrapping(e);if(!o)return null;let i=o.length?o[0]:e;return n.canReplaceWith(A,r,i)?o:null}function PP(t,e){let{parent:n,startIndex:A,endIndex:r}=t,o=n.child(A),i=e.contentMatch.findWrapping(o.type);if(!i)return null;let l=(i.length?i[i.length-1]:e).contentMatch;for(let u=A;l&&u<r;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:i}function RP(t,e,n){let A=Qe.empty;for(let i=n.length-1;i>=0;i--){if(A.size){let a=n[i].type.contentMatch.matchFragment(A);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}A=Qe.from(n[i].type.create(n[i].attrs,A))}let r=e.start,o=e.end;t.step(new Nn(r,o,r,o,new Ne(A,0,0),n.length,!0))}function VP(t,e,n,A,r){if(!A.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(i,a)=>{let l=typeof r=="function"?r(i):r;if(i.isTextblock&&!i.hasMarkup(A,l)&&$P(t.doc,t.mapping.slice(o).map(a),A)){let u=null;if(A.schema.linebreakReplacement){let g=A.whitespace=="pre",B=!!A.contentMatch.matchType(A.schema.linebreakReplacement);g&&!B?u=!1:!g&&B&&(u=!0)}u===!1&&Ob(t,i,a,o),rm(t,t.mapping.slice(o).map(a,1),A,void 0,u===null);let f=t.mapping.slice(o),h=f.map(a,1),p=f.map(a+i.nodeSize,1);return t.step(new Nn(h,p,h+1,p-1,new Ne(Qe.from(A.create(l,null,i.marks)),0,0),1,!0)),u===!0&&Mb(t,i,a,o),!1}})}function Mb(t,e,n,A){e.forEach((r,o)=>{if(r.isText){let i,a=/\r?\n|\r/g;for(;i=a.exec(r.text);){let l=t.mapping.slice(A).map(n+1+o+i.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function Ob(t,e,n,A){e.forEach((r,o)=>{if(r.type==r.type.schema.linebreakReplacement){let i=t.mapping.slice(A).map(n+1+o);t.replaceWith(i,i+1,e.type.schema.text(`
|