ablok-components 0.1.176 → 0.1.177

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.
@@ -1077,7 +1077,7 @@ const fT = { class: "radio-buttons" }, dT = ["for"], X$ = /* @__PURE__ */ SA({
1077
1077
  "option-label": ct((a) => [
1078
1078
  k("label", {
1079
1079
  for: `${t.id}-${a.index}`,
1080
- class: "d-block btn btn-outline-dark p-3 fw-bold",
1080
+ class: "d-block btn btn-outline-primary p-3 fw-bold",
1081
1081
  role: "button"
1082
1082
  }, Ie(a.option.text), 9, dT)
1083
1083
  ]),
@@ -2,7 +2,7 @@
2
2
  `,ZE={class:"input-group input__input-group"},jE=["id","name","placeholder","pattern","disabled","read-only","required","aria-label"],eQ=["for","innerHTML"],AQ=h.defineComponent({__name:"input-datetime",props:{modelValue:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"text"},name:{type:String,default:()=>ze()},id:{type:String,default:()=>ze()},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}},emits:["update:modelValue"],setup(t,{emit:e}){const A=t,n=e,r=h.computed({get(){const i=A.modelValue&&new Date(`${A.modelValue}Z`),s=i&&new Date(i.getTime()+new Date().getTimezoneOffset()*-60*1e3).toISOString();return s&&s.replace("Z","")},set(i){const s=i&&new Date(i);i=s&&s.toISOString(),n("update:modelValue",i&&i.replace("Z",""))}});return(i,s)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["input",`input--${t.type}`])},[h.createElementVNode("div",ZE,[h.renderSlot(i.$slots,"input-prepend",{slotScope:"props"}),h.withDirectives(h.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=a=>r.value=a),type:"datetime-local",id:t.id,name:t.name,placeholder:t.placeholder,pattern:t.pattern,disabled:t.disabled,"read-only":t.readOnly,required:t.required,class:"form-control","aria-label":t.label},null,8,jE),[[h.vModelText,r.value]]),h.renderSlot(i.$slots,"input-append",{slotScope:"props"})]),h.renderSlot(i.$slots,"label",{},()=>[t.label?(h.openBlock(),h.createElementBlock("label",{key:0,for:t.id,class:"input__label",innerHTML:`${t.label}${t.required?" *":""}`},null,8,eQ)):h.createCommentVNode("",!0)])],2))}}),tQ={class:"input-group input__input-group"},nQ=h.defineComponent({__name:"input-password",props:{modelValue:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"text"},name:{type:String,default:()=>ze()},id:{type:String,default:()=>ze()},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 A=t,n=e,r=h.computed({get(){return A.modelValue},set(i){(A.password===i||!A.password)&&n("update:modelValue",i)}});return(i,s)=>{const a=h.resolveComponent("svg-icon"),c=h.resolveComponent("base-input");return h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["input","input-password"])},[h.createElementVNode("div",tQ,[h.createVNode(c,{modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=u=>r.value=u),type:"password",placeholder:t.placeholder,disabled:t.disabled,readonly:t.readOnly,required:t.required,label:t.label},{"input-prepend":h.withCtx(u=>[h.renderSlot(i.$slots,"input-prepend",{slotScope:"props"})]),"input-append":h.withCtx(u=>[h.renderSlot(i.$slots,"input-append",{slotScope:"props"},()=>[t.confirm&&t.modelValue===t.password?(h.openBlock(),h.createBlock(a,{key:0,symbol:"check",class:"ms-2"})):h.createCommentVNode("",!0)])]),_:3},8,["modelValue","placeholder","disabled","readonly","required","label"])])])}}}),rQ={class:"check-group"},iQ=["id","name","value","disabled","read-only","required"],sQ=["for","innerHTML"],oQ=h.defineComponent({__name:"check-group",props:{modelValue:{type:null,default:()=>[]},options:{type:Array,required:!0},name:{type:String,default:()=>ze()},id:{type:String,default:()=>ze()},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 A=t,n=e;h.ref([]);const r=h.computed({get(){return A.modelValue},set(s){n("update:modelValue",s)}}),i=h.computed(()=>A.options&&A.options.map(s=>(s=typeof s=="string"?{text:s,value:s}:s,{...s,active:A.modelValue&&A.modelValue.includes(s.value)})));return(s,a)=>(h.openBlock(),h.createElementBlock("div",rQ,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.value,(c,u)=>(h.openBlock(),h.createElementBlock("div",{key:u,class:"form-check"},[h.withDirectives(h.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:c.value||c,disabled:t.disabled,"read-only":t.readOnly,required:t.required},null,8,iQ),[[h.vModelCheckbox,r.value]]),h.createElementVNode("label",{class:"form-check-label",for:`${t.id}-${u}`,innerHTML:c.text},null,8,sQ)]))),128))]))}}),p$="",aQ={class:"input radio-group"},lQ=["id","name","value","checked","disabled","read-only","required","onChange"],cQ=["for","innerHTML"],uQ=["for"],Ho=h.defineComponent({__name:"radio-group",props:{modelValue:{type:null},options:{type:Array,default:[]},name:{type:String,default:()=>ze()},id:{type:String,default:()=>ze()},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 A=e;function n(r){A("update:modelValue",r)}return(r,i)=>(h.openBlock(),h.createElementBlock("div",aQ,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(t.options,(s,a)=>{var c,u;return h.openBlock(),h.createElementBlock("div",{key:a,class:h.normalizeClass(["form-check",t.itemClass])},[h.createElementVNode("input",{type:"radio",id:`${t.id}-${a}`,name:t.name,class:h.normalizeClass(["form-check-input",`
3
3
  ${a===t.keyOption||s.key?"form-check-input--key":""}
4
4
  ${(a===t.keyOption||s.key)&&s.value===((c=t.modelValue)==null?void 0:c.value)?"form-check-input--match":""}
5
- `]),value:s.value||s,checked:s.value?s.value===((u=t.modelValue)==null?void 0:u.value):s===t.modelValue,disabled:t.disabled,"read-only":t.readOnly,required:t.required,onChange:f=>n(s)},null,42,lQ),h.renderSlot(r.$slots,"option-label",{option:s,index:a},()=>[h.createElementVNode("label",{class:"form-check-label",for:`${t.id}-${a}`,innerHTML:s.text},null,8,cQ)])],2)}),128)),h.renderSlot(r.$slots,"label",{},()=>[t.label?(h.openBlock(),h.createElementBlock("label",{key:0,for:t.id},h.toDisplayString(t.label),9,uQ)):h.createCommentVNode("",!0)])]))}}),g$="",fQ={class:"radio-buttons"},dQ=["for"],hQ=h.defineComponent({__name:"radio-buttons",props:{modelValue:{type:null,default:""},options:{type:Array,default:[]},name:{type:String,default:()=>ze()},id:{type:String,default:()=>ze()},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 A=t,n=e,r=h.computed({get(){return A.modelValue},set(i){n("update:modelValue",i)}});return(i,s)=>(h.openBlock(),h.createElementBlock("div",fQ,[h.createVNode(Ho,{modelValue:r.value,"onUpdate:modelValue":s[0]||(s[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":h.withCtx(a=>[h.createElementVNode("label",{for:`${t.id}-${a.index}`,class:"d-block btn btn-outline-dark p-3 fw-bold",role:"button"},h.toDisplayString(a.option.text),9,dQ)]),_:1},8,["modelValue","options","name","id","disabled","required"])]))}}),m$="",pQ=["id","name","multiple","accept","disabled"],gQ={class:"input__input-group input-group"},mQ=["value","id","name","disabled"],BQ=["for","disabled"],wQ=h.createElementVNode("span",{class:"btn btn-outline-dark"},"Select File",-1),CQ=["for"],yQ=["innerHTML"],EQ=h.defineComponent({__name:"input-file",props:{modelValue:{type:Array,default:[]},name:{type:String,default:()=>ze()},id:{type:String,default:()=>ze()},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}},emits:["update:modelValue"],setup(t,{emit:e}){const A=t,n=e;function r(c){const u=c.target&&c.target.files;u&&(s.splice(0,s.length),Array.from(u).forEach(f=>{s.push(f)}))}const i=h.ref(),s=h.reactive([]),a=h.computed(()=>s&&s.map(c=>c.name));return h.computed(()=>s.map(c=>URL.createObjectURL(c))),h.watch(()=>A.modelValue,(c,u)=>{c.length===0&&(i.value.value=null)},{deep:!0}),h.watch(()=>s,(c,u)=>{n("update:modelValue",c)},{deep:!0}),(c,u)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["input input-file","input-file--primary"])},[h.createElementVNode("input",{ref_key:"input",ref:i,type:"file",id:t.id,name:t.name,class:"d-none",onChange:r,multiple:t.multiple,accept:t.accept,disabled:t.disabled},null,40,pQ),h.createElementVNode("div",gQ,[h.renderSlot(c.$slots,"input-prepend"),h.createElementVNode("input",{type:"text",value:a.value,id:t.id,name:t.name,class:"form-control",disabled:t.disabled},null,8,mQ),h.renderSlot(c.$slots,"input-append",{},()=>[h.createElementVNode("label",{for:t.id,disabled:t.disabled},[h.renderSlot(c.$slots,"button",{},()=>[wQ])],8,BQ)])]),h.createElementVNode("label",{for:t.id},[h.renderSlot(c.$slots,"label",{},()=>[h.createElementVNode("span",{class:"input__label",innerHTML:`${t.label}${t.required?" *":""}`},null,8,yQ)])],8,CQ)]))}}),QQ={class:"select-media"},FQ=["for"],bQ=h.defineComponent({__name:"select-media",props:{modelValue:{type:null,default:""},assets:{type:Array,default:[]},name:{type:String,default:()=>ze()},id:{type:String,default:()=>ze()},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 A=t,n=e,r=h.computed({get(){return A.modelValue},set(i){const s=A.assets.find(a=>a.id===i);n("update:modelValue",A.emitKey?s[A.emitKey]:s),A.emitKey&&A.emitKey!=="id"&&n("update:selection",s.id)}});return(i,s)=>{const a=h.resolveComponent("base-image");return h.openBlock(),h.createElementBlock("div",QQ,[h.createVNode(Ho,{modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=c=>r.value=c),options:t.assets.map(c=>c.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":h.withCtx(c=>[h.createElementVNode("label",{for:`${t.id}-${c.index}`,class:h.normalizeClass(["w-100",{"is-active":t.assets[c.index].id===r.value}]),role:"button"},[t.assets[c.index].thumbnail?(h.openBlock(),h.createBlock(a,{key:0,src:t.assets[c.index].thumbnail,alt:t.assets[c.index].id},null,8,["src","alt"])):h.createCommentVNode("",!0)],10,FQ)]),_:1},8,["modelValue","options","name","id","disabled","required"])])}}}),B$="";function MA(t){this.content=t}MA.prototype={constructor:MA,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,A){var n=A&&A!=t?this.remove(A):this,r=n.find(t),i=n.content.slice();return r==-1?i.push(A||t,e):(i[r+1]=e,A&&(i[r]=A)),new MA(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var A=this.content.slice();return A.splice(e,2),new MA(A)},addToStart:function(t,e){return new MA([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var A=this.remove(t).content.slice();return A.push(t,e),new MA(A)},addBefore:function(t,e,A){var n=this.remove(e),r=n.content.slice(),i=n.find(t);return r.splice(i==-1?r.length:i,0,e,A),new MA(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=MA.from(t),t.size?new MA(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=MA.from(t),t.size?new MA(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=MA.from(t);for(var A=0;A<t.content.length;A+=2)e=e.remove(t.content[A]);return e},toObject:function(){var t={};return this.forEach(function(e,A){t[e]=A}),t},get size(){return this.content.length>>1}},MA.from=function(t){if(t instanceof MA)return t;var e=[];if(t)for(var A in t)e.push(A,t[A]);return new MA(e)};function dh(t,e,A){for(let n=0;;n++){if(n==t.childCount||n==e.childCount)return t.childCount==e.childCount?null:A;let r=t.child(n),i=e.child(n);if(r==i){A+=r.nodeSize;continue}if(!r.sameMarkup(i))return A;if(r.isText&&r.text!=i.text){for(let s=0;r.text[s]==i.text[s];s++)A++;return A}if(r.content.size||i.content.size){let s=dh(r.content,i.content,A+1);if(s!=null)return s}A+=r.nodeSize}}function hh(t,e,A,n){for(let r=t.childCount,i=e.childCount;;){if(r==0||i==0)return r==i?null:{a:A,b:n};let s=t.child(--r),a=e.child(--i),c=s.nodeSize;if(s==a){A-=c,n-=c;continue}if(!s.sameMarkup(a))return{a:A,b:n};if(s.isText&&s.text!=a.text){let u=0,f=Math.min(s.text.length,a.text.length);for(;u<f&&s.text[s.text.length-u-1]==a.text[a.text.length-u-1];)u++,A--,n--;return{a:A,b:n}}if(s.content.size||a.content.size){let u=hh(s.content,a.content,A-1,n-1);if(u)return u}A-=c,n-=c}}class Y{constructor(e,A){if(this.content=e,this.size=A||0,A==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,A,n,r=0,i){for(let s=0,a=0;a<A;s++){let c=this.content[s],u=a+c.nodeSize;if(u>e&&n(c,r+a,i||null,s)!==!1&&c.content.size){let f=a+1;c.nodesBetween(Math.max(0,e-f),Math.min(c.content.size,A-f),n,r+f)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,A,n,r){let i="",s=!0;return this.nodesBetween(e,A,(a,c)=>{let u=a.isText?a.text.slice(Math.max(e,c)-c,A-c):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)&&n&&(s?s=!1:i+=n),i+=u},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let A=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(A.isText&&A.sameMarkup(n)&&(r[r.length-1]=A.withText(A.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new Y(r,this.size+e.size)}cut(e,A=this.size){if(e==0&&A==this.size)return this;let n=[],r=0;if(A>e)for(let i=0,s=0;s<A;i++){let a=this.content[i],c=s+a.nodeSize;c>e&&((s<e||c>A)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,A-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,A-s-1))),n.push(a),r+=a.nodeSize),s=c}return new Y(n,r)}cutByIndex(e,A){return e==A?Y.empty:e==0&&A==this.content.length?this:new Y(this.content.slice(e,A))}replaceChild(e,A){let n=this.content[e];if(n==A)return this;let r=this.content.slice(),i=this.size+A.nodeSize-n.nodeSize;return r[e]=A,new Y(r,i)}addToStart(e){return new Y([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Y(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let A=0;A<this.content.length;A++)if(!this.content[A].eq(e.content[A]))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 A=this.content[e];if(!A)throw new RangeError("Index "+e+" out of range for "+this);return A}maybeChild(e){return this.content[e]||null}forEach(e){for(let A=0,n=0;A<this.content.length;A++){let r=this.content[A];e(r,n,A),n+=r.nodeSize}}findDiffStart(e,A=0){return dh(this,e,A)}findDiffEnd(e,A=this.size,n=e.size){return hh(this,e,A,n)}findIndex(e,A=-1){if(e==0)return No(0,e);if(e==this.size)return No(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e||A>0?No(n+1,s):No(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,A){if(!A)return Y.empty;if(!Array.isArray(A))throw new RangeError("Invalid input for Fragment.fromJSON");return new Y(A.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Y.empty;let A,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(A||(A=e.slice(0,r)),A[A.length-1]=i.withText(A[A.length-1].text+i.text)):A&&A.push(i)}return new Y(A||e,n)}static from(e){if(!e)return Y.empty;if(e instanceof Y)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Y([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Y.empty=new Y([],0);const mc={index:0,offset:0};function No(t,e){return mc.index=t,mc.offset=e,mc}function Do(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let A=Array.isArray(t);if(Array.isArray(e)!=A)return!1;if(A){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!Do(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!Do(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}let je=class lh{constructor(e,A){this.type=e,this.attrs=A}addToSet(e){let A,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))A||(A=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(A||(A=e.slice(0,r)),A.push(this),n=!0),A&&A.push(i)}}return A||(A=e.slice()),n||A.push(this),A}removeFromSet(e){for(let A=0;A<e.length;A++)if(this.eq(e[A]))return e.slice(0,A).concat(e.slice(A+1));return e}isInSet(e){for(let A=0;A<e.length;A++)if(this.eq(e[A]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Do(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let A in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,A){if(!A)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[A.type];if(!n)throw new RangeError(`There is no mark type ${A.type} in this schema`);return n.create(A.attrs)}static sameSet(e,A){if(e==A)return!0;if(e.length!=A.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(A[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return lh.none;if(e instanceof lh)return[e];let A=e.slice();return A.sort((n,r)=>n.type.rank-r.type.rank),A}};je.none=[];class Mo extends Error{}class j{constructor(e,A,n){this.content=e,this.openStart=A,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,A){let n=gh(this.content,e+this.openStart,A);return n&&new j(n,this.openStart,this.openEnd)}removeBetween(e,A){return new j(ph(this.content,e+this.openStart,A+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,A){if(!A)return j.empty;let n=A.openStart||0,r=A.openEnd||0;if(typeof n!="number"||typeof r!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new j(Y.fromJSON(e,A.content),n,r)}static maxOpen(e,A=!0){let n=0,r=0;for(let i=e.firstChild;i&&!i.isLeaf&&(A||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=e.lastChild;i&&!i.isLeaf&&(A||!i.type.spec.isolating);i=i.lastChild)r++;return new j(e,n,r)}}j.empty=new j(Y.empty,0,0);function ph(t,e,A){let{index:n,offset:r}=t.findIndex(e),i=t.maybeChild(n),{index:s,offset:a}=t.findIndex(A);if(r==e||i.isText){if(a!=A&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(A))}if(n!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(n,i.copy(ph(i.content,e-r-1,A-r-1)))}function gh(t,e,A,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r);if(i==e||s.isText)return n&&!n.canReplace(r,r,A)?null:t.cut(0,e).append(A).append(t.cut(e));let a=gh(s.content,e-i-1,A);return a&&t.replaceChild(r,s.copy(a))}function UQ(t,e,A){if(A.openStart>t.depth)throw new Mo("Inserted content deeper than insertion position");if(t.depth-A.openStart!=e.depth-A.openEnd)throw new Mo("Inconsistent open depths");return mh(t,e,A,0)}function mh(t,e,A,n){let r=t.index(n),i=t.node(n);if(r==e.index(n)&&n<t.depth-A.openStart){let s=mh(t,e,A,n+1);return i.copy(i.content.replaceChild(r,s))}else if(A.content.size)if(!A.openStart&&!A.openEnd&&t.depth==n&&e.depth==n){let s=t.parent,a=s.content;return Gr(s,a.cut(0,t.parentOffset).append(A.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=vQ(A,t);return Gr(i,wh(t,s,a,e,n))}else return Gr(i,Ro(t,e,n))}function Bh(t,e){if(!e.type.compatibleContent(t.type))throw new Mo("Cannot join "+e.type.name+" onto "+t.type.name)}function Bc(t,e,A){let n=t.node(A);return Bh(n,e.node(A)),n}function Pr(t,e){let A=e.length-1;A>=0&&t.isText&&t.sameMarkup(e[A])?e[A]=t.withText(e[A].text+t.text):e.push(t)}function Qs(t,e,A,n){let r=(e||t).node(A),i=0,s=e?e.index(A):r.childCount;t&&(i=t.index(A),t.depth>A?i++:t.textOffset&&(Pr(t.nodeAfter,n),i++));for(let a=i;a<s;a++)Pr(r.child(a),n);e&&e.depth==A&&e.textOffset&&Pr(e.nodeBefore,n)}function Gr(t,e){return t.type.checkContent(e),t.copy(e)}function wh(t,e,A,n,r){let i=t.depth>r&&Bc(t,e,r+1),s=n.depth>r&&Bc(A,n,r+1),a=[];return Qs(null,t,r,a),i&&s&&e.index(r)==A.index(r)?(Bh(i,s),Pr(Gr(i,wh(t,e,A,n,r+1)),a)):(i&&Pr(Gr(i,Ro(t,e,r+1)),a),Qs(e,A,r,a),s&&Pr(Gr(s,Ro(A,n,r+1)),a)),Qs(n,null,r,a),new Y(a)}function Ro(t,e,A){let n=[];if(Qs(null,t,A,n),t.depth>A){let r=Bc(t,e,A+1);Pr(Gr(r,Ro(t,e,A+1)),n)}return Qs(e,null,A,n),new Y(n)}function vQ(t,e){let A=e.depth-t.openStart,r=e.node(A).copy(t.content);for(let i=A-1;i>=0;i--)r=e.node(i).copy(Y.from(r));return{start:r.resolveNoCache(t.openStart+A),end:r.resolveNoCache(r.content.size-t.openEnd-A)}}class Fs{constructor(e,A,n){this.pos=e,this.path=A,this.parentOffset=n,this.depth=A.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,A=this.index(this.depth);if(A==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(A);return n?e.child(A).cut(n):r}get nodeBefore(){let e=this.index(this.depth),A=this.pos-this.path[this.path.length-1];return A?this.parent.child(e).cut(0,A):e==0?null:this.parent.child(e-1)}posAtIndex(e,A){A=this.resolveDepth(A);let n=this.path[A*3],r=A==0?0:this.path[A*3-1]+1;for(let i=0;i<e;i++)r+=n.child(i).nodeSize;return r}marks(){let e=this.parent,A=this.index();if(e.content.size==0)return je.none;if(this.textOffset)return e.child(A).marks;let n=e.maybeChild(A-1),r=e.maybeChild(A);if(!n){let a=n;n=r,r=a}let i=n.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!r||!i[s].isInSet(r.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let A=this.parent.maybeChild(this.index());if(!A||!A.isInline)return null;let n=A.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let A=this.depth;A>0;A--)if(this.start(A)<=e&&this.end(A)>=e)return A;return 0}blockRange(e=this,A){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!A||A(this.node(n))))return new Ko(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let A=1;A<=this.depth;A++)e+=(e?"/":"")+this.node(A).type.name+"_"+this.index(A-1);return e+":"+this.parentOffset}static resolve(e,A){if(!(A>=0&&A<=e.content.size))throw new RangeError("Position "+A+" out of range");let n=[],r=0,i=A;for(let s=e;;){let{index:a,offset:c}=s.content.findIndex(i),u=i-c;if(n.push(s,a,r+c),!u||(s=s.child(a),s.isText))break;i=u-1,r+=c+1}return new Fs(A,n,i)}static resolveCached(e,A){for(let r=0;r<wc.length;r++){let i=wc[r];if(i.pos==A&&i.doc==e)return i}let n=wc[Cc]=Fs.resolve(e,A);return Cc=(Cc+1)%IQ,n}}let wc=[],Cc=0,IQ=12;class Ko{constructor(e,A,n){this.$from=e,this.$to=A,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const SQ=Object.create(null);let $r=class ch{constructor(e,A,n,r=je.none){this.type=e,this.attrs=A,this.marks=r,this.content=n||Y.empty}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,A,n,r=0){this.content.nodesBetween(e,A,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,A,n,r){return this.content.textBetween(e,A,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,A,n){return this.type==e&&Do(this.attrs,A||e.defaultAttrs||SQ)&&je.sameSet(this.marks,n||je.none)}copy(e=null){return e==this.content?this:new ch(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ch(this.type,this.attrs,this.content,e)}cut(e,A=this.content.size){return e==0&&A==this.content.size?this:this.copy(this.content.cut(e,A))}slice(e,A=this.content.size,n=!1){if(e==A)return j.empty;let r=this.resolve(e),i=this.resolve(A),s=n?0:r.sharedDepth(A),a=r.start(s),u=r.node(s).content.cut(r.pos-a,i.pos-a);return new j(u,r.depth-s,i.depth-s)}replace(e,A,n){return UQ(this.resolve(e),this.resolve(A),n)}nodeAt(e){for(let A=this;;){let{index:n,offset:r}=A.content.findIndex(e);if(A=A.maybeChild(n),!A)return null;if(r==e||A.isText)return A;e-=r+1}}childAfter(e){let{index:A,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(A),index:A,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:A,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(A),index:A,offset:n};let r=this.content.child(A-1);return{node:r,index:A-1,offset:n-r.nodeSize}}resolve(e){return Fs.resolveCached(this,e)}resolveNoCache(e){return Fs.resolve(this,e)}rangeHasMark(e,A,n){let r=!1;return A>e&&this.nodesBetween(e,A,i=>(n.isInSet(i.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()+")"),Ch(this.marks,e)}contentMatchAt(e){let A=this.type.contentMatch.matchFragment(this.content,0,e);if(!A)throw new Error("Called contentMatchAt on a node with invalid content");return A}canReplace(e,A,n=Y.empty,r=0,i=n.childCount){let s=this.contentMatchAt(e).matchFragment(n,r,i),a=s&&s.matchFragment(this.content,A);if(!a||!a.validEnd)return!1;for(let c=r;c<i;c++)if(!this.type.allowsMarks(n.child(c).marks))return!1;return!0}canReplaceWith(e,A,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),s=i&&i.matchFragment(this.content,A);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=je.none;for(let A=0;A<this.marks.length;A++)e=this.marks[A].addToSet(e);if(!je.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(A=>A.type.name)}`);this.content.forEach(A=>A.check())}toJSON(){let e={type:this.type.name};for(let A 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(A=>A.toJSON())),e}static fromJSON(e,A){if(!A)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(A.marks){if(!Array.isArray(A.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=A.marks.map(e.markFromJSON)}if(A.type=="text"){if(typeof A.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(A.text,n)}let r=Y.fromJSON(e,A.content);return e.nodeType(A.type).create(A.attrs,r,n)}};$r.prototype.text=void 0;class Vo extends $r{constructor(e,A,n,r){if(super(e,A,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ch(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,A){return this.text.slice(e,A)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Vo(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Vo(this.type,this.attrs,e,this.marks)}cut(e=0,A=this.text.length){return e==0&&A==this.text.length?this:this.withText(this.text.slice(e,A))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Ch(t,e){for(let A=t.length-1;A>=0;A--)e=t[A].type.name+"("+e+")";return e}class Wr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,A){let n=new TQ(e,A);if(n.next==null)return Wr.empty;let r=yh(n);n.next&&n.err("Unexpected trailing text");let i=NQ(HQ(r));return DQ(i,n),i}matchType(e){for(let A=0;A<this.next.length;A++)if(this.next[A].type==e)return this.next[A].next;return null}matchFragment(e,A=0,n=e.childCount){let r=this;for(let i=A;r&&i<n;i++)r=r.matchType(e.child(i).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:A}=this.next[e];if(!(A.isText||A.hasRequiredAttrs()))return A}return null}compatible(e){for(let A=0;A<this.next.length;A++)for(let n=0;n<e.next.length;n++)if(this.next[A].type==e.next[n].type)return!0;return!1}fillBefore(e,A=!1,n=0){let r=[this];function i(s,a){let c=s.matchFragment(e,n);if(c&&(!A||c.validEnd))return Y.from(a.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:f,next:p}=s.next[u];if(!(f.isText||f.hasRequiredAttrs())&&r.indexOf(p)==-1){r.push(p);let g=i(p,a.concat(f));if(g)return g}}return null}return i(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let A=this.computeWrapping(e);return this.wrapCache.push(e,A),A}computeWrapping(e){let A=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let s=[];for(let a=r;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:a,next:c}=i.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in A)&&(!r.type||c.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),A[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 A(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&A(n.next[r].next)}return A(this),e.map((n,r)=>{let i=r+(n.validEnd?"*":" ")+" ";for(let s=0;s<n.next.length;s++)i+=(s?", ":"")+n.next[s].type.name+"->"+e.indexOf(n.next[s].next);return i}).join(`
5
+ `]),value:s.value||s,checked:s.value?s.value===((u=t.modelValue)==null?void 0:u.value):s===t.modelValue,disabled:t.disabled,"read-only":t.readOnly,required:t.required,onChange:f=>n(s)},null,42,lQ),h.renderSlot(r.$slots,"option-label",{option:s,index:a},()=>[h.createElementVNode("label",{class:"form-check-label",for:`${t.id}-${a}`,innerHTML:s.text},null,8,cQ)])],2)}),128)),h.renderSlot(r.$slots,"label",{},()=>[t.label?(h.openBlock(),h.createElementBlock("label",{key:0,for:t.id},h.toDisplayString(t.label),9,uQ)):h.createCommentVNode("",!0)])]))}}),g$="",fQ={class:"radio-buttons"},dQ=["for"],hQ=h.defineComponent({__name:"radio-buttons",props:{modelValue:{type:null,default:""},options:{type:Array,default:[]},name:{type:String,default:()=>ze()},id:{type:String,default:()=>ze()},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 A=t,n=e,r=h.computed({get(){return A.modelValue},set(i){n("update:modelValue",i)}});return(i,s)=>(h.openBlock(),h.createElementBlock("div",fQ,[h.createVNode(Ho,{modelValue:r.value,"onUpdate:modelValue":s[0]||(s[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":h.withCtx(a=>[h.createElementVNode("label",{for:`${t.id}-${a.index}`,class:"d-block btn btn-outline-primary p-3 fw-bold",role:"button"},h.toDisplayString(a.option.text),9,dQ)]),_:1},8,["modelValue","options","name","id","disabled","required"])]))}}),m$="",pQ=["id","name","multiple","accept","disabled"],gQ={class:"input__input-group input-group"},mQ=["value","id","name","disabled"],BQ=["for","disabled"],wQ=h.createElementVNode("span",{class:"btn btn-outline-dark"},"Select File",-1),CQ=["for"],yQ=["innerHTML"],EQ=h.defineComponent({__name:"input-file",props:{modelValue:{type:Array,default:[]},name:{type:String,default:()=>ze()},id:{type:String,default:()=>ze()},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}},emits:["update:modelValue"],setup(t,{emit:e}){const A=t,n=e;function r(c){const u=c.target&&c.target.files;u&&(s.splice(0,s.length),Array.from(u).forEach(f=>{s.push(f)}))}const i=h.ref(),s=h.reactive([]),a=h.computed(()=>s&&s.map(c=>c.name));return h.computed(()=>s.map(c=>URL.createObjectURL(c))),h.watch(()=>A.modelValue,(c,u)=>{c.length===0&&(i.value.value=null)},{deep:!0}),h.watch(()=>s,(c,u)=>{n("update:modelValue",c)},{deep:!0}),(c,u)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["input input-file","input-file--primary"])},[h.createElementVNode("input",{ref_key:"input",ref:i,type:"file",id:t.id,name:t.name,class:"d-none",onChange:r,multiple:t.multiple,accept:t.accept,disabled:t.disabled},null,40,pQ),h.createElementVNode("div",gQ,[h.renderSlot(c.$slots,"input-prepend"),h.createElementVNode("input",{type:"text",value:a.value,id:t.id,name:t.name,class:"form-control",disabled:t.disabled},null,8,mQ),h.renderSlot(c.$slots,"input-append",{},()=>[h.createElementVNode("label",{for:t.id,disabled:t.disabled},[h.renderSlot(c.$slots,"button",{},()=>[wQ])],8,BQ)])]),h.createElementVNode("label",{for:t.id},[h.renderSlot(c.$slots,"label",{},()=>[h.createElementVNode("span",{class:"input__label",innerHTML:`${t.label}${t.required?" *":""}`},null,8,yQ)])],8,CQ)]))}}),QQ={class:"select-media"},FQ=["for"],bQ=h.defineComponent({__name:"select-media",props:{modelValue:{type:null,default:""},assets:{type:Array,default:[]},name:{type:String,default:()=>ze()},id:{type:String,default:()=>ze()},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 A=t,n=e,r=h.computed({get(){return A.modelValue},set(i){const s=A.assets.find(a=>a.id===i);n("update:modelValue",A.emitKey?s[A.emitKey]:s),A.emitKey&&A.emitKey!=="id"&&n("update:selection",s.id)}});return(i,s)=>{const a=h.resolveComponent("base-image");return h.openBlock(),h.createElementBlock("div",QQ,[h.createVNode(Ho,{modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=c=>r.value=c),options:t.assets.map(c=>c.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":h.withCtx(c=>[h.createElementVNode("label",{for:`${t.id}-${c.index}`,class:h.normalizeClass(["w-100",{"is-active":t.assets[c.index].id===r.value}]),role:"button"},[t.assets[c.index].thumbnail?(h.openBlock(),h.createBlock(a,{key:0,src:t.assets[c.index].thumbnail,alt:t.assets[c.index].id},null,8,["src","alt"])):h.createCommentVNode("",!0)],10,FQ)]),_:1},8,["modelValue","options","name","id","disabled","required"])])}}}),B$="";function MA(t){this.content=t}MA.prototype={constructor:MA,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,A){var n=A&&A!=t?this.remove(A):this,r=n.find(t),i=n.content.slice();return r==-1?i.push(A||t,e):(i[r+1]=e,A&&(i[r]=A)),new MA(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var A=this.content.slice();return A.splice(e,2),new MA(A)},addToStart:function(t,e){return new MA([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var A=this.remove(t).content.slice();return A.push(t,e),new MA(A)},addBefore:function(t,e,A){var n=this.remove(e),r=n.content.slice(),i=n.find(t);return r.splice(i==-1?r.length:i,0,e,A),new MA(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=MA.from(t),t.size?new MA(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=MA.from(t),t.size?new MA(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=MA.from(t);for(var A=0;A<t.content.length;A+=2)e=e.remove(t.content[A]);return e},toObject:function(){var t={};return this.forEach(function(e,A){t[e]=A}),t},get size(){return this.content.length>>1}},MA.from=function(t){if(t instanceof MA)return t;var e=[];if(t)for(var A in t)e.push(A,t[A]);return new MA(e)};function dh(t,e,A){for(let n=0;;n++){if(n==t.childCount||n==e.childCount)return t.childCount==e.childCount?null:A;let r=t.child(n),i=e.child(n);if(r==i){A+=r.nodeSize;continue}if(!r.sameMarkup(i))return A;if(r.isText&&r.text!=i.text){for(let s=0;r.text[s]==i.text[s];s++)A++;return A}if(r.content.size||i.content.size){let s=dh(r.content,i.content,A+1);if(s!=null)return s}A+=r.nodeSize}}function hh(t,e,A,n){for(let r=t.childCount,i=e.childCount;;){if(r==0||i==0)return r==i?null:{a:A,b:n};let s=t.child(--r),a=e.child(--i),c=s.nodeSize;if(s==a){A-=c,n-=c;continue}if(!s.sameMarkup(a))return{a:A,b:n};if(s.isText&&s.text!=a.text){let u=0,f=Math.min(s.text.length,a.text.length);for(;u<f&&s.text[s.text.length-u-1]==a.text[a.text.length-u-1];)u++,A--,n--;return{a:A,b:n}}if(s.content.size||a.content.size){let u=hh(s.content,a.content,A-1,n-1);if(u)return u}A-=c,n-=c}}class Y{constructor(e,A){if(this.content=e,this.size=A||0,A==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,A,n,r=0,i){for(let s=0,a=0;a<A;s++){let c=this.content[s],u=a+c.nodeSize;if(u>e&&n(c,r+a,i||null,s)!==!1&&c.content.size){let f=a+1;c.nodesBetween(Math.max(0,e-f),Math.min(c.content.size,A-f),n,r+f)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,A,n,r){let i="",s=!0;return this.nodesBetween(e,A,(a,c)=>{let u=a.isText?a.text.slice(Math.max(e,c)-c,A-c):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)&&n&&(s?s=!1:i+=n),i+=u},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let A=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(A.isText&&A.sameMarkup(n)&&(r[r.length-1]=A.withText(A.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new Y(r,this.size+e.size)}cut(e,A=this.size){if(e==0&&A==this.size)return this;let n=[],r=0;if(A>e)for(let i=0,s=0;s<A;i++){let a=this.content[i],c=s+a.nodeSize;c>e&&((s<e||c>A)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,A-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,A-s-1))),n.push(a),r+=a.nodeSize),s=c}return new Y(n,r)}cutByIndex(e,A){return e==A?Y.empty:e==0&&A==this.content.length?this:new Y(this.content.slice(e,A))}replaceChild(e,A){let n=this.content[e];if(n==A)return this;let r=this.content.slice(),i=this.size+A.nodeSize-n.nodeSize;return r[e]=A,new Y(r,i)}addToStart(e){return new Y([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Y(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let A=0;A<this.content.length;A++)if(!this.content[A].eq(e.content[A]))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 A=this.content[e];if(!A)throw new RangeError("Index "+e+" out of range for "+this);return A}maybeChild(e){return this.content[e]||null}forEach(e){for(let A=0,n=0;A<this.content.length;A++){let r=this.content[A];e(r,n,A),n+=r.nodeSize}}findDiffStart(e,A=0){return dh(this,e,A)}findDiffEnd(e,A=this.size,n=e.size){return hh(this,e,A,n)}findIndex(e,A=-1){if(e==0)return No(0,e);if(e==this.size)return No(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e||A>0?No(n+1,s):No(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,A){if(!A)return Y.empty;if(!Array.isArray(A))throw new RangeError("Invalid input for Fragment.fromJSON");return new Y(A.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Y.empty;let A,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(A||(A=e.slice(0,r)),A[A.length-1]=i.withText(A[A.length-1].text+i.text)):A&&A.push(i)}return new Y(A||e,n)}static from(e){if(!e)return Y.empty;if(e instanceof Y)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Y([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Y.empty=new Y([],0);const mc={index:0,offset:0};function No(t,e){return mc.index=t,mc.offset=e,mc}function Do(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let A=Array.isArray(t);if(Array.isArray(e)!=A)return!1;if(A){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!Do(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!Do(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}let je=class lh{constructor(e,A){this.type=e,this.attrs=A}addToSet(e){let A,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))A||(A=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(A||(A=e.slice(0,r)),A.push(this),n=!0),A&&A.push(i)}}return A||(A=e.slice()),n||A.push(this),A}removeFromSet(e){for(let A=0;A<e.length;A++)if(this.eq(e[A]))return e.slice(0,A).concat(e.slice(A+1));return e}isInSet(e){for(let A=0;A<e.length;A++)if(this.eq(e[A]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Do(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let A in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,A){if(!A)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[A.type];if(!n)throw new RangeError(`There is no mark type ${A.type} in this schema`);return n.create(A.attrs)}static sameSet(e,A){if(e==A)return!0;if(e.length!=A.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(A[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return lh.none;if(e instanceof lh)return[e];let A=e.slice();return A.sort((n,r)=>n.type.rank-r.type.rank),A}};je.none=[];class Mo extends Error{}class j{constructor(e,A,n){this.content=e,this.openStart=A,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,A){let n=gh(this.content,e+this.openStart,A);return n&&new j(n,this.openStart,this.openEnd)}removeBetween(e,A){return new j(ph(this.content,e+this.openStart,A+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,A){if(!A)return j.empty;let n=A.openStart||0,r=A.openEnd||0;if(typeof n!="number"||typeof r!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new j(Y.fromJSON(e,A.content),n,r)}static maxOpen(e,A=!0){let n=0,r=0;for(let i=e.firstChild;i&&!i.isLeaf&&(A||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=e.lastChild;i&&!i.isLeaf&&(A||!i.type.spec.isolating);i=i.lastChild)r++;return new j(e,n,r)}}j.empty=new j(Y.empty,0,0);function ph(t,e,A){let{index:n,offset:r}=t.findIndex(e),i=t.maybeChild(n),{index:s,offset:a}=t.findIndex(A);if(r==e||i.isText){if(a!=A&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(A))}if(n!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(n,i.copy(ph(i.content,e-r-1,A-r-1)))}function gh(t,e,A,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r);if(i==e||s.isText)return n&&!n.canReplace(r,r,A)?null:t.cut(0,e).append(A).append(t.cut(e));let a=gh(s.content,e-i-1,A);return a&&t.replaceChild(r,s.copy(a))}function UQ(t,e,A){if(A.openStart>t.depth)throw new Mo("Inserted content deeper than insertion position");if(t.depth-A.openStart!=e.depth-A.openEnd)throw new Mo("Inconsistent open depths");return mh(t,e,A,0)}function mh(t,e,A,n){let r=t.index(n),i=t.node(n);if(r==e.index(n)&&n<t.depth-A.openStart){let s=mh(t,e,A,n+1);return i.copy(i.content.replaceChild(r,s))}else if(A.content.size)if(!A.openStart&&!A.openEnd&&t.depth==n&&e.depth==n){let s=t.parent,a=s.content;return Gr(s,a.cut(0,t.parentOffset).append(A.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=vQ(A,t);return Gr(i,wh(t,s,a,e,n))}else return Gr(i,Ro(t,e,n))}function Bh(t,e){if(!e.type.compatibleContent(t.type))throw new Mo("Cannot join "+e.type.name+" onto "+t.type.name)}function Bc(t,e,A){let n=t.node(A);return Bh(n,e.node(A)),n}function Pr(t,e){let A=e.length-1;A>=0&&t.isText&&t.sameMarkup(e[A])?e[A]=t.withText(e[A].text+t.text):e.push(t)}function Qs(t,e,A,n){let r=(e||t).node(A),i=0,s=e?e.index(A):r.childCount;t&&(i=t.index(A),t.depth>A?i++:t.textOffset&&(Pr(t.nodeAfter,n),i++));for(let a=i;a<s;a++)Pr(r.child(a),n);e&&e.depth==A&&e.textOffset&&Pr(e.nodeBefore,n)}function Gr(t,e){return t.type.checkContent(e),t.copy(e)}function wh(t,e,A,n,r){let i=t.depth>r&&Bc(t,e,r+1),s=n.depth>r&&Bc(A,n,r+1),a=[];return Qs(null,t,r,a),i&&s&&e.index(r)==A.index(r)?(Bh(i,s),Pr(Gr(i,wh(t,e,A,n,r+1)),a)):(i&&Pr(Gr(i,Ro(t,e,r+1)),a),Qs(e,A,r,a),s&&Pr(Gr(s,Ro(A,n,r+1)),a)),Qs(n,null,r,a),new Y(a)}function Ro(t,e,A){let n=[];if(Qs(null,t,A,n),t.depth>A){let r=Bc(t,e,A+1);Pr(Gr(r,Ro(t,e,A+1)),n)}return Qs(e,null,A,n),new Y(n)}function vQ(t,e){let A=e.depth-t.openStart,r=e.node(A).copy(t.content);for(let i=A-1;i>=0;i--)r=e.node(i).copy(Y.from(r));return{start:r.resolveNoCache(t.openStart+A),end:r.resolveNoCache(r.content.size-t.openEnd-A)}}class Fs{constructor(e,A,n){this.pos=e,this.path=A,this.parentOffset=n,this.depth=A.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,A=this.index(this.depth);if(A==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(A);return n?e.child(A).cut(n):r}get nodeBefore(){let e=this.index(this.depth),A=this.pos-this.path[this.path.length-1];return A?this.parent.child(e).cut(0,A):e==0?null:this.parent.child(e-1)}posAtIndex(e,A){A=this.resolveDepth(A);let n=this.path[A*3],r=A==0?0:this.path[A*3-1]+1;for(let i=0;i<e;i++)r+=n.child(i).nodeSize;return r}marks(){let e=this.parent,A=this.index();if(e.content.size==0)return je.none;if(this.textOffset)return e.child(A).marks;let n=e.maybeChild(A-1),r=e.maybeChild(A);if(!n){let a=n;n=r,r=a}let i=n.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!r||!i[s].isInSet(r.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let A=this.parent.maybeChild(this.index());if(!A||!A.isInline)return null;let n=A.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let A=this.depth;A>0;A--)if(this.start(A)<=e&&this.end(A)>=e)return A;return 0}blockRange(e=this,A){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!A||A(this.node(n))))return new Ko(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let A=1;A<=this.depth;A++)e+=(e?"/":"")+this.node(A).type.name+"_"+this.index(A-1);return e+":"+this.parentOffset}static resolve(e,A){if(!(A>=0&&A<=e.content.size))throw new RangeError("Position "+A+" out of range");let n=[],r=0,i=A;for(let s=e;;){let{index:a,offset:c}=s.content.findIndex(i),u=i-c;if(n.push(s,a,r+c),!u||(s=s.child(a),s.isText))break;i=u-1,r+=c+1}return new Fs(A,n,i)}static resolveCached(e,A){for(let r=0;r<wc.length;r++){let i=wc[r];if(i.pos==A&&i.doc==e)return i}let n=wc[Cc]=Fs.resolve(e,A);return Cc=(Cc+1)%IQ,n}}let wc=[],Cc=0,IQ=12;class Ko{constructor(e,A,n){this.$from=e,this.$to=A,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const SQ=Object.create(null);let $r=class ch{constructor(e,A,n,r=je.none){this.type=e,this.attrs=A,this.marks=r,this.content=n||Y.empty}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,A,n,r=0){this.content.nodesBetween(e,A,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,A,n,r){return this.content.textBetween(e,A,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,A,n){return this.type==e&&Do(this.attrs,A||e.defaultAttrs||SQ)&&je.sameSet(this.marks,n||je.none)}copy(e=null){return e==this.content?this:new ch(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ch(this.type,this.attrs,this.content,e)}cut(e,A=this.content.size){return e==0&&A==this.content.size?this:this.copy(this.content.cut(e,A))}slice(e,A=this.content.size,n=!1){if(e==A)return j.empty;let r=this.resolve(e),i=this.resolve(A),s=n?0:r.sharedDepth(A),a=r.start(s),u=r.node(s).content.cut(r.pos-a,i.pos-a);return new j(u,r.depth-s,i.depth-s)}replace(e,A,n){return UQ(this.resolve(e),this.resolve(A),n)}nodeAt(e){for(let A=this;;){let{index:n,offset:r}=A.content.findIndex(e);if(A=A.maybeChild(n),!A)return null;if(r==e||A.isText)return A;e-=r+1}}childAfter(e){let{index:A,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(A),index:A,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:A,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(A),index:A,offset:n};let r=this.content.child(A-1);return{node:r,index:A-1,offset:n-r.nodeSize}}resolve(e){return Fs.resolveCached(this,e)}resolveNoCache(e){return Fs.resolve(this,e)}rangeHasMark(e,A,n){let r=!1;return A>e&&this.nodesBetween(e,A,i=>(n.isInSet(i.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()+")"),Ch(this.marks,e)}contentMatchAt(e){let A=this.type.contentMatch.matchFragment(this.content,0,e);if(!A)throw new Error("Called contentMatchAt on a node with invalid content");return A}canReplace(e,A,n=Y.empty,r=0,i=n.childCount){let s=this.contentMatchAt(e).matchFragment(n,r,i),a=s&&s.matchFragment(this.content,A);if(!a||!a.validEnd)return!1;for(let c=r;c<i;c++)if(!this.type.allowsMarks(n.child(c).marks))return!1;return!0}canReplaceWith(e,A,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),s=i&&i.matchFragment(this.content,A);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=je.none;for(let A=0;A<this.marks.length;A++)e=this.marks[A].addToSet(e);if(!je.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(A=>A.type.name)}`);this.content.forEach(A=>A.check())}toJSON(){let e={type:this.type.name};for(let A 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(A=>A.toJSON())),e}static fromJSON(e,A){if(!A)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(A.marks){if(!Array.isArray(A.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=A.marks.map(e.markFromJSON)}if(A.type=="text"){if(typeof A.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(A.text,n)}let r=Y.fromJSON(e,A.content);return e.nodeType(A.type).create(A.attrs,r,n)}};$r.prototype.text=void 0;class Vo extends $r{constructor(e,A,n,r){if(super(e,A,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ch(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,A){return this.text.slice(e,A)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Vo(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Vo(this.type,this.attrs,e,this.marks)}cut(e=0,A=this.text.length){return e==0&&A==this.text.length?this:this.withText(this.text.slice(e,A))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Ch(t,e){for(let A=t.length-1;A>=0;A--)e=t[A].type.name+"("+e+")";return e}class Wr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,A){let n=new TQ(e,A);if(n.next==null)return Wr.empty;let r=yh(n);n.next&&n.err("Unexpected trailing text");let i=NQ(HQ(r));return DQ(i,n),i}matchType(e){for(let A=0;A<this.next.length;A++)if(this.next[A].type==e)return this.next[A].next;return null}matchFragment(e,A=0,n=e.childCount){let r=this;for(let i=A;r&&i<n;i++)r=r.matchType(e.child(i).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:A}=this.next[e];if(!(A.isText||A.hasRequiredAttrs()))return A}return null}compatible(e){for(let A=0;A<this.next.length;A++)for(let n=0;n<e.next.length;n++)if(this.next[A].type==e.next[n].type)return!0;return!1}fillBefore(e,A=!1,n=0){let r=[this];function i(s,a){let c=s.matchFragment(e,n);if(c&&(!A||c.validEnd))return Y.from(a.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:f,next:p}=s.next[u];if(!(f.isText||f.hasRequiredAttrs())&&r.indexOf(p)==-1){r.push(p);let g=i(p,a.concat(f));if(g)return g}}return null}return i(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let A=this.computeWrapping(e);return this.wrapCache.push(e,A),A}computeWrapping(e){let A=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let s=[];for(let a=r;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:a,next:c}=i.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in A)&&(!r.type||c.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),A[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 A(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&A(n.next[r].next)}return A(this),e.map((n,r)=>{let i=r+(n.validEnd?"*":" ")+" ";for(let s=0;s<n.next.length;s++)i+=(s?", ":"")+n.next[s].type.name+"->"+e.indexOf(n.next[s].next);return i}).join(`
6
6
  `)}}Wr.empty=new Wr(!0);class TQ{constructor(e,A){this.string=e,this.nodeTypes=A,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 yh(t){let e=[];do e.push(_Q(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function _Q(t){let e=[];do e.push(xQ(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function xQ(t){let e=kQ(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=OQ(t,e);else break;return e}function Eh(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function OQ(t,e){let A=Eh(t),n=A;return t.eat(",")&&(t.next!="}"?n=Eh(t):n=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:A,max:n,expr:e}}function LQ(t,e){let A=t.nodeTypes,n=A[e];if(n)return[n];let r=[];for(let i in A){let s=A[i];s.groups.indexOf(e)>-1&&r.push(s)}return r.length==0&&t.err("No node type or group '"+e+"' found"),r}function kQ(t){if(t.eat("(")){let e=yh(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=LQ(t,t.next).map(A=>(t.inline==null?t.inline=A.isInline:t.inline!=A.isInline&&t.err("Mixing inline and block content"),{type:"name",value:A}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function HQ(t){let e=[[]];return r(i(t,0),A()),e;function A(){return e.push([])-1}function n(s,a,c){let u={term:c,to:a};return e[s].push(u),u}function r(s,a){s.forEach(c=>c.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((c,u)=>c.concat(i(u,a)),[]);if(s.type=="seq")for(let c=0;;c++){let u=i(s.exprs[c],a);if(c==s.exprs.length-1)return u;r(u,a=A())}else if(s.type=="star"){let c=A();return n(a,c),r(i(s.expr,c),c),[n(c)]}else if(s.type=="plus"){let c=A();return r(i(s.expr,a),c),r(i(s.expr,c),c),[n(c)]}else{if(s.type=="opt")return[n(a)].concat(i(s.expr,a));if(s.type=="range"){let c=a;for(let u=0;u<s.min;u++){let f=A();r(i(s.expr,c),f),c=f}if(s.max==-1)r(i(s.expr,c),c);else for(let u=s.min;u<s.max;u++){let f=A();n(c,f),r(i(s.expr,c),f),c=f}return[n(c)]}else{if(s.type=="name")return[n(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Qh(t,e){return e-t}function Fh(t,e){let A=[];return n(e),A.sort(Qh);function n(r){let i=t[r];if(i.length==1&&!i[0].term)return n(i[0].to);A.push(r);for(let s=0;s<i.length;s++){let{term:a,to:c}=i[s];!a&&A.indexOf(c)==-1&&n(c)}}}function NQ(t){let e=Object.create(null);return A(Fh(t,0));function A(n){let r=[];n.forEach(s=>{t[s].forEach(({term:a,to:c})=>{if(!a)return;let u;for(let f=0;f<r.length;f++)r[f][0]==a&&(u=r[f][1]);Fh(t,c).forEach(f=>{u||r.push([a,u=[]]),u.indexOf(f)==-1&&u.push(f)})})});let i=e[n.join(",")]=new Wr(n.indexOf(t.length-1)>-1);for(let s=0;s<r.length;s++){let a=r[s][1].sort(Qh);i.next.push({type:r[s][0],next:e[a.join(",")]||A(a)})}return i}}function DQ(t,e){for(let A=0,n=[t];A<n.length;A++){let r=n[A],i=!r.validEnd,s=[];for(let a=0;a<r.next.length;a++){let{type:c,next:u}=r.next[a];s.push(c.name),i&&!(c.isText||c.hasRequiredAttrs())&&(i=!1),n.indexOf(u)==-1&&n.push(u)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function bh(t){let e=Object.create(null);for(let A in t){let n=t[A];if(!n.hasDefault)return null;e[A]=n.default}return e}function Uh(t,e){let A=Object.create(null);for(let n in t){let r=e&&e[n];if(r===void 0){let i=t[n];if(i.hasDefault)r=i.default;else throw new RangeError("No value supplied for attribute "+n)}A[n]=r}return A}function vh(t){let e=Object.create(null);if(t)for(let A in t)e[A]=new MQ(t[A]);return e}let Ih=class fE{constructor(e,A,n){this.name=e,this.schema=A,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=vh(n.attrs),this.defaultAttrs=bh(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Wr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}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:Uh(this.attrs,e)}create(e=null,A,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new $r(this,this.computeAttrs(e),Y.from(A),je.setFrom(n))}createChecked(e=null,A,n){return A=Y.from(A),this.checkContent(A),new $r(this,this.computeAttrs(e),A,je.setFrom(n))}createAndFill(e=null,A,n){if(e=this.computeAttrs(e),A=Y.from(A),A.size){let s=this.contentMatch.fillBefore(A);if(!s)return null;A=s.append(A)}let r=this.contentMatch.matchFragment(A),i=r&&r.fillBefore(Y.empty,!0);return i?new $r(this,e,A.append(i),je.setFrom(n)):null}validContent(e){let A=this.contentMatch.matchFragment(e);if(!A||!A.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).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)}`)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let A=0;A<e.length;A++)if(!this.allowsMarkType(e[A].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let A;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?A&&A.push(e[n]):A||(A=e.slice(0,n));return A?A.length?A:je.none:e}static compile(e,A){let n=Object.create(null);e.forEach((i,s)=>n[i]=new fE(i,A,s));let r=A.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let i in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};class MQ{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Po{constructor(e,A,n,r){this.name=e,this.rank=A,this.schema=n,this.spec=r,this.attrs=vh(r.attrs),this.excluded=null;let i=bh(this.attrs);this.instance=i?new je(this,i):null}create(e=null){return!e&&this.instance?this.instance:new je(this,Uh(this.attrs,e))}static compile(e,A){let n=Object.create(null),r=0;return e.forEach((i,s)=>n[i]=new Po(i,r++,A,s)),n}removeFromSet(e){for(var A=0;A<e.length;A++)e[A].type==this&&(e=e.slice(0,A).concat(e.slice(A+1)),A--);return e}isInSet(e){for(let A=0;A<e.length;A++)if(e[A].type==this)return e[A]}excludes(e){return this.excluded.indexOf(e)>-1}}class RQ{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let A=this.spec={};for(let r in e)A[r]=e[r];A.nodes=MA.from(e.nodes),A.marks=MA.from(e.marks||{}),this.nodes=Ih.compile(this.spec.nodes,this),this.marks=Po.compile(this.spec.marks,this);let n=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 i=this.nodes[r],s=i.spec.content||"",a=i.spec.marks;if(i.contentMatch=n[s]||(n[s]=Wr.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=a=="_"?null:a?Sh(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let r in this.marks){let i=this.marks[r],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:Sh(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,A=null,n,r){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Ih){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(A,n,r)}text(e,A){let n=this.nodes.text;return new Vo(n,n.defaultAttrs,e,je.setFrom(A))}mark(e,A){return typeof e=="string"&&(e=this.marks[e]),e.create(A)}nodeFromJSON(e){return $r.fromJSON(this,e)}markFromJSON(e){return je.fromJSON(this,e)}nodeType(e){let A=this.nodes[e];if(!A)throw new RangeError("Unknown node type: "+e);return A}}function Sh(t,e){let A=[];for(let n=0;n<e.length;n++){let r=e[n],i=t.marks[r],s=i;if(i)A.push(i);else for(let a in t.marks){let c=t.marks[a];(r=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(r)>-1)&&A.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return A}function KQ(t){return t.tag!=null}function VQ(t){return t.style!=null}class Fi{constructor(e,A){this.schema=e,this.rules=A,this.tags=[],this.styles=[],A.forEach(n=>{KQ(n)?this.tags.push(n):VQ(n)&&this.styles.push(n)}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let r=e.nodes[n.node];return r.contentMatch.matchType(r)})}parse(e,A={}){let n=new Oh(this,A,!1);return n.addAll(e,A.from,A.to),n.finish()}parseSlice(e,A={}){let n=new Oh(this,A,!0);return n.addAll(e,A.from,A.to),j.maxOpen(n.finish())}matchTag(e,A,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let i=this.tags[r];if($Q(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||A.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(e,A,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let s=this.styles[i],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!n.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=A))){if(s.getAttrs){let c=s.getAttrs(A);if(c===!1)continue;s.attrs=c||void 0}return s}}}static schemaRules(e){let A=[];function n(r){let i=r.priority==null?50:r.priority,s=0;for(;s<A.length;s++){let a=A[s];if((a.priority==null?50:a.priority)<i)break}A.splice(s,0,r)}for(let r in e.marks){let i=e.marks[r].spec.parseDOM;i&&i.forEach(s=>{n(s=Lh(s)),s.mark||s.ignore||s.clearMark||(s.mark=r)})}for(let r in e.nodes){let i=e.nodes[r].spec.parseDOM;i&&i.forEach(s=>{n(s=Lh(s)),s.node||s.ignore||s.mark||(s.node=r)})}return A}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Fi(e,Fi.schemaRules(e)))}}const Th={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},PQ={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},_h={ol:!0,ul:!0},Go=1,$o=2,bs=4;function xh(t,e,A){return e!=null?(e?Go:0)|(e==="full"?$o:0):t&&t.whitespace=="pre"?Go|$o:A&~bs}class Wo{constructor(e,A,n,r,i,s,a){this.type=e,this.attrs=A,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=a,this.content=[],this.activeMarks=je.none,this.stashMarks=[],this.match=s||(a&bs?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let A=this.type.contentMatch.fillBefore(Y.from(e));if(A)this.match=this.type.contentMatch.matchFragment(A);else{let n=this.type.contentMatch,r;return(r=n.findWrapping(e.type))?(this.match=n,r):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Go)){let n=this.content[this.content.length-1],r;if(n&&n.isText&&(r=/[ \t\r\n\u000c]+$/.exec(n.text))){let i=n;n.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-r[0].length))}}let A=Y.from(this.content);return!e&&this.match&&(A=A.append(this.match.fillBefore(Y.empty,!0))),this.type?this.type.create(this.attrs,A,this.marks):A}popFromStashMark(e){for(let A=this.stashMarks.length-1;A>=0;A--)if(e.eq(this.stashMarks[A]))return this.stashMarks.splice(A,1)[0]}applyPending(e){for(let A=0,n=this.pendingMarks;A<n.length;A++){let r=n[A];(this.type?this.type.allowsMarkType(r.type):WQ(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Th.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Oh{constructor(e,A,n){this.parser=e,this.options=A,this.isOpen=n,this.open=0;let r=A.topNode,i,s=xh(null,A.preserveWhitespace,0)|(n?bs:0);r?i=new Wo(r.type,r.attrs,je.none,je.none,!0,A.topMatch||r.type.contentMatch,s):n?i=new Wo(null,null,je.none,je.none,!0,null,s):i=new Wo(e.schema.topNodeType,null,je.none,je.none,!0,null,s),this.nodes=[i],this.find=A.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){e.nodeType==3?this.addTextNode(e):e.nodeType==1&&this.addElement(e)}withStyleRules(e,A){let n=e.style;if(!n||!n.length)return A();let r=this.readStyles(e.style);if(!r)return;let[i,s]=r,a=this.top;for(let c=0;c<s.length;c++)this.removePendingMark(s[c],a);for(let c=0;c<i.length;c++)this.addPendingMark(i[c]);A();for(let c=0;c<i.length;c++)this.removePendingMark(i[c],a);for(let c=0;c<s.length;c++)this.addPendingMark(s[c])}addTextNode(e){let A=e.nodeValue,n=this.top;if(n.options&$o||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(A)){if(n.options&Go)n.options&$o?A=A.replace(/\r\n?/g,`
7
7
  `):A=A.replace(/\r?\n|\r/g," ");else if(A=A.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(A)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],i=e.previousSibling;(!r||i&&i.nodeName=="BR"||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(A=A.slice(1))}A&&this.insertNode(this.parser.schema.text(A)),this.findInText(e)}else this.findInside(e)}addElement(e,A){let n=e.nodeName.toLowerCase(),r;_h.hasOwnProperty(n)&&this.parser.normalizeLists&&GQ(e);let i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(r=this.parser.matchTag(e,this,A));if(i?i.ignore:PQ.hasOwnProperty(n))this.findInside(e),this.ignoreFallback(e);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);let s,a=this.top,c=this.needsBlock;if(Th.hasOwnProperty(n))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),s=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}i&&i.skip?this.addAll(e):this.withStyleRules(e,()=>this.addAll(e)),s&&this.sync(a),this.needsBlock=c}else this.withStyleRules(e,()=>{this.addElementByRule(e,i,i.consuming===!1?r:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
8
8
  `))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let A=je.none,n=je.none;for(let r=0,i=e.length;r<i;r++){let s=e.item(r);for(let a=void 0;;){let c=this.parser.matchStyle(s,e.getPropertyValue(s),this,a);if(!c)break;if(c.ignore)return null;if(c.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(u=>{c.clearMark(u)&&(n=u.addToSet(n))}):A=this.parser.schema.marks[c.mark].create(c.attrs).addToSet(A),c.consuming===!1)a=c;else break}}return[A,n]}addElementByRule(e,A,n){let r,i,s;A.node?(i=this.parser.schema.nodes[A.node],i.isLeaf?this.insertNode(i.create(A.attrs))||this.leafFallback(e):r=this.enter(i,A.attrs||null,A.preserveWhitespace)):(s=this.parser.schema.marks[A.mark].create(A.attrs),this.addPendingMark(s));let a=this.top;if(i&&i.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(A.getContent)this.findInside(e),A.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c));else{let c=e;typeof A.contentElement=="string"?c=e.querySelector(A.contentElement):typeof A.contentElement=="function"?c=A.contentElement(e):A.contentElement&&(c=A.contentElement),this.findAround(e,c,!0),this.addAll(c)}r&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(e,A,n){let r=A||0;for(let i=A?e.childNodes[A]:e.firstChild,s=n==null?null:e.childNodes[n];i!=s;i=i.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(i);this.findAtPoint(e,r)}findPlace(e){let A,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],s=i.findWrapping(e);if(s&&(!A||A.length>s.length)&&(A=s,n=i,!s.length)||i.solid)break}if(!A)return!1;this.sync(n);for(let r=0;r<A.length;r++)this.enterInner(A[r],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let A=this.textblockFromContext();A&&this.enterInner(A)}if(this.findPlace(e)){this.closeExtra();let A=this.top;A.applyPending(e.type),A.match&&(A.match=A.match.matchType(e.type));let n=A.activeMarks;for(let r=0;r<e.marks.length;r++)(!A.type||A.type.allowsMarkType(e.marks[r].type))&&(n=e.marks[r].addToSet(n));return A.content.push(e.mark(n)),!0}return!1}enter(e,A,n){let r=this.findPlace(e.create(A));return r&&this.enterInner(e,A,!0,n),r}enterInner(e,A=null,n=!1,r){this.closeExtra();let i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);let s=xh(e,r,i.options);i.options&bs&&i.content.length==0&&(s|=bs),this.nodes.push(new Wo(e,A,i.activeMarks,i.pendingMarks,n,null,s)),this.open++}closeExtra(e=!1){let A=this.nodes.length-1;if(A>this.open){for(;A>this.open;A--)this.nodes[A-1].content.push(this.nodes[A].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 A=this.open;A>=0;A--)if(this.nodes[A]==e)return this.open=A,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let A=this.open;A>=0;A--){let n=this.nodes[A].content;for(let r=n.length-1;r>=0;r--)e+=n[r].nodeSize;A&&e++}return e}findAtPoint(e,A){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==A&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let A=0;A<this.find.length;A++)this.find[A].pos==null&&e.nodeType==1&&e.contains(this.find[A].node)&&(this.find[A].pos=this.currentPos)}findAround(e,A,n){if(e!=A&&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)&&A.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let A=0;A<this.find.length;A++)this.find[A].node==e&&(this.find[A].pos=this.currentPos-(e.nodeValue.length-this.find[A].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let A=e.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),s=(a,c)=>{for(;a>=0;a--){let u=A[a];if(u==""){if(a==A.length-1||a==0)continue;for(;c>=i;c--)if(s(a-1,c))return!0;return!1}else{let f=c>0||c==0&&r?this.nodes[c].type:n&&c>=i?n.node(c-i).type:null;if(!f||f.name!=u&&f.groups.indexOf(u)==-1)return!1;c--}}return!0};return s(A.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let A=e.depth;A>=0;A--){let n=e.node(A).contentMatchAt(e.indexAfter(A)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let A in this.parser.schema.nodes){let n=this.parser.schema.nodes[A];if(n.isTextblock&&n.defaultAttrs)return n}}addPendingMark(e){let A=JQ(e,this.top.pendingMarks);A&&this.top.stashMarks.push(A),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,A){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);let s=r.popFromStashMark(e);s&&r.type&&r.type.allowsMarkType(s.type)&&(r.activeMarks=s.addToSet(r.activeMarks))}if(r==A)break}}}function GQ(t){for(let e=t.firstChild,A=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&_h.hasOwnProperty(n)&&A?(A.appendChild(e),e=A):n=="li"?A=e:n&&(A=null)}}function $Q(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Lh(t){let e={};for(let A in t)e[A]=t[A];return e}function WQ(t,e){let A=e.schema.nodes;for(let n in A){let r=A[n];if(!r.allowsMarkType(t))continue;let i=[],s=a=>{i.push(a);for(let c=0;c<a.edgeCount;c++){let{type:u,next:f}=a.edge(c);if(u==e||i.indexOf(f)<0&&s(f))return!0}};if(s(r.contentMatch))return!0}}function JQ(t,e){for(let A=0;A<e.length;A++)if(t.eq(e[A]))return e[A]}class mn{constructor(e,A){this.nodes=e,this.marks=A}serializeFragment(e,A={},n){n||(n=yc(A).createDocumentFragment());let r=n,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let a=0,c=0;for(;a<i.length&&c<s.marks.length;){let u=s.marks[c];if(!this.marks[u.type.name]){c++;continue}if(!u.eq(i[a][0])||u.type.spec.spanning===!1)break;a++,c++}for(;a<i.length;)r=i.pop()[1];for(;c<s.marks.length;){let u=s.marks[c++],f=this.serializeMark(u,s.isInline,A);f&&(i.push([u,r]),r.appendChild(f.dom),r=f.contentDOM||f.dom)}}r.appendChild(this.serializeNodeInner(s,A))}),n}serializeNodeInner(e,A){let{dom:n,contentDOM:r}=mn.renderSpec(yc(A),this.nodes[e.type.name](e));if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,A,r)}return n}serializeNode(e,A={}){let n=this.serializeNodeInner(e,A);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,A);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,A,n={}){let r=this.marks[e.type.name];return r&&mn.renderSpec(yc(n),r(e,A))}static renderSpec(e,A,n=null){if(typeof A=="string")return{dom:e.createTextNode(A)};if(A.nodeType!=null)return{dom:A};if(A.dom&&A.dom.nodeType!=null)return A;let r=A[0],i=r.indexOf(" ");i>0&&(n=r.slice(0,i),r=r.slice(i+1));let s,a=n?e.createElementNS(n,r):e.createElement(r),c=A[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let f in c)if(c[f]!=null){let p=f.indexOf(" ");p>0?a.setAttributeNS(f.slice(0,p),f.slice(p+1),c[f]):a.setAttribute(f,c[f])}}for(let f=u;f<A.length;f++){let p=A[f];if(p===0){if(f<A.length-1||f>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:g,contentDOM:B}=mn.renderSpec(e,p,n);if(a.appendChild(g),B){if(s)throw new RangeError("Multiple content holes");s=B}}}return{dom:a,contentDOM:s}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new mn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let A=kh(e.nodes);return A.text||(A.text=n=>n.text),A}static marksFromSchema(e){return kh(e.marks)}}function kh(t){let e={};for(let A in t){let n=t[A].spec.toDOM;n&&(e[A]=n)}return e}function yc(t){return t.document||window.document}const Hh=65535,Nh=Math.pow(2,16);function XQ(t,e){return t+e*Nh}function Dh(t){return t&Hh}function YQ(t){return(t-(t&Hh))/Nh}const Mh=1,Rh=2,Jo=4,Kh=8;class Ec{constructor(e,A,n){this.pos=e,this.delInfo=A,this.recover=n}get deleted(){return(this.delInfo&Kh)>0}get deletedBefore(){return(this.delInfo&(Mh|Jo))>0}get deletedAfter(){return(this.delInfo&(Rh|Jo))>0}get deletedAcross(){return(this.delInfo&Jo)>0}}class Ut{constructor(e,A=!1){if(this.ranges=e,this.inverted=A,!e.length&&Ut.empty)return Ut.empty}recover(e){let A=0,n=Dh(e);if(!this.inverted)for(let r=0;r<n;r++)A+=this.ranges[r*3+2]-this.ranges[r*3+1];return this.ranges[n*3]+A+YQ(e)}mapResult(e,A=1){return this._map(e,A,!1)}map(e,A=1){return this._map(e,A,!0)}_map(e,A,n){let r=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let c=this.ranges[a]-(this.inverted?r:0);if(c>e)break;let u=this.ranges[a+i],f=this.ranges[a+s],p=c+u;if(e<=p){let g=u?e==c?-1:e==p?1:A:A,B=c+r+(g<0?0:f);if(n)return B;let w=e==(A<0?c:p)?null:XQ(a/3,e-c),Q=e==c?Rh:e==p?Mh:Jo;return(A<0?e!=c:e!=p)&&(Q|=Kh),new Ec(B,Q,w)}r+=f-u}return n?e+r:new Ec(e+r,0,null)}touches(e,A){let n=0,r=Dh(A),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let c=this.ranges[a]-(this.inverted?n:0);if(c>e)break;let u=this.ranges[a+i],f=c+u;if(e<=f&&a==r*3)return!0;n+=this.ranges[a+s]-u}return!1}forEach(e){let A=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let s=this.ranges[r],a=s-(this.inverted?i:0),c=s+(this.inverted?0:i),u=this.ranges[r+A],f=this.ranges[r+n];e(a,a+u,c,c+f),i+=f-u}}invert(){return new Ut(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Ut.empty:new Ut(e<0?[0,-e,0]:[0,0,e])}}Ut.empty=new Ut([]);class bi{constructor(e=[],A,n=0,r=e.length){this.maps=e,this.mirror=A,this.from=n,this.to=r}slice(e=0,A=this.maps.length){return new bi(this.maps,this.mirror,e,A)}copy(){return new bi(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,A){this.to=this.maps.push(e),A!=null&&this.setMirror(this.maps.length-1,A)}appendMapping(e){for(let A=0,n=this.maps.length;A<e.maps.length;A++){let r=e.getMirror(A);this.appendMap(e.maps[A],r!=null&&r<A?n+r:void 0)}}getMirror(e){if(this.mirror){for(let A=0;A<this.mirror.length;A++)if(this.mirror[A]==e)return this.mirror[A+(A%2?-1:1)]}}setMirror(e,A){this.mirror||(this.mirror=[]),this.mirror.push(e,A)}appendMappingInverted(e){for(let A=e.maps.length-1,n=this.maps.length+e.maps.length;A>=0;A--){let r=e.getMirror(A);this.appendMap(e.maps[A].invert(),r!=null&&r>A?n-r-1:void 0)}}invert(){let e=new bi;return e.appendMappingInverted(this),e}map(e,A=1){if(this.mirror)return this._map(e,A,!0);for(let n=this.from;n<this.to;n++)e=this.maps[n].map(e,A);return e}mapResult(e,A=1){return this._map(e,A,!1)}_map(e,A,n){let r=0;for(let i=this.from;i<this.to;i++){let s=this.maps[i],a=s.mapResult(e,A);if(a.recover!=null){let c=this.getMirror(i);if(c!=null&&c>i&&c<this.to){i=c,e=this.maps[c].recover(a.recover);continue}}r|=a.delInfo,e=a.pos}return n?e:new Ec(e,r,null)}}const Qc=Object.create(null);class JA{getMap(){return Ut.empty}merge(e){return null}static fromJSON(e,A){if(!A||!A.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Qc[A.stepType];if(!n)throw new RangeError(`No step type ${A.stepType} defined`);return n.fromJSON(e,A)}static jsonID(e,A){if(e in Qc)throw new RangeError("Duplicate use of step JSON ID "+e);return Qc[e]=A,A.prototype.jsonID=e,A}}class QA{constructor(e,A){this.doc=e,this.failed=A}static ok(e){return new QA(e,null)}static fail(e){return new QA(null,e)}static fromReplace(e,A,n,r){try{return QA.ok(e.replace(A,n,r))}catch(i){if(i instanceof Mo)return QA.fail(i.message);throw i}}}function Fc(t,e,A){let n=[];for(let r=0;r<t.childCount;r++){let i=t.child(r);i.content.size&&(i=i.copy(Fc(i.content,e,i))),i.isInline&&(i=e(i,A,r)),n.push(i)}return Y.fromArray(n)}class sr extends JA{constructor(e,A,n){super(),this.from=e,this.to=A,this.mark=n}apply(e){let A=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new j(Fc(A.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),r),A.openStart,A.openEnd);return QA.fromReplace(e,this.from,this.to,i)}invert(){return new Bn(this.from,this.to,this.mark)}map(e){let A=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return A.deleted&&n.deleted||A.pos>=n.pos?null:new sr(A.pos,n.pos,this.mark)}merge(e){return e instanceof sr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new sr(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,A){if(typeof A.from!="number"||typeof A.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new sr(A.from,A.to,e.markFromJSON(A.mark))}}JA.jsonID("addMark",sr);class Bn extends JA{constructor(e,A,n){super(),this.from=e,this.to=A,this.mark=n}apply(e){let A=e.slice(this.from,this.to),n=new j(Fc(A.content,r=>r.mark(this.mark.removeFromSet(r.marks)),e),A.openStart,A.openEnd);return QA.fromReplace(e,this.from,this.to,n)}invert(){return new sr(this.from,this.to,this.mark)}map(e){let A=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return A.deleted&&n.deleted||A.pos>=n.pos?null:new Bn(A.pos,n.pos,this.mark)}merge(e){return e instanceof Bn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Bn(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,A){if(typeof A.from!="number"||typeof A.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Bn(A.from,A.to,e.markFromJSON(A.mark))}}JA.jsonID("removeMark",Bn);class or extends JA{constructor(e,A){super(),this.pos=e,this.mark=A}apply(e){let A=e.nodeAt(this.pos);if(!A)return QA.fail("No node at mark step's position");let n=A.type.create(A.attrs,null,this.mark.addToSet(A.marks));return QA.fromReplace(e,this.pos,this.pos+1,new j(Y.from(n),0,A.isLeaf?0:1))}invert(e){let A=e.nodeAt(this.pos);if(A){let n=this.mark.addToSet(A.marks);if(n.length==A.marks.length){for(let r=0;r<A.marks.length;r++)if(!A.marks[r].isInSet(n))return new or(this.pos,A.marks[r]);return new or(this.pos,this.mark)}}return new Ui(this.pos,this.mark)}map(e){let A=e.mapResult(this.pos,1);return A.deletedAfter?null:new or(A.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,A){if(typeof A.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new or(A.pos,e.markFromJSON(A.mark))}}JA.jsonID("addNodeMark",or);class Ui extends JA{constructor(e,A){super(),this.pos=e,this.mark=A}apply(e){let A=e.nodeAt(this.pos);if(!A)return QA.fail("No node at mark step's position");let n=A.type.create(A.attrs,null,this.mark.removeFromSet(A.marks));return QA.fromReplace(e,this.pos,this.pos+1,new j(Y.from(n),0,A.isLeaf?0:1))}invert(e){let A=e.nodeAt(this.pos);return!A||!this.mark.isInSet(A.marks)?this:new or(this.pos,this.mark)}map(e){let A=e.mapResult(this.pos,1);return A.deletedAfter?null:new Ui(A.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,A){if(typeof A.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ui(A.pos,e.markFromJSON(A.mark))}}JA.jsonID("removeNodeMark",Ui);class xA extends JA{constructor(e,A,n,r=!1){super(),this.from=e,this.to=A,this.slice=n,this.structure=r}apply(e){return this.structure&&bc(e,this.from,this.to)?QA.fail("Structure replace would overwrite content"):QA.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ut([this.from,this.to-this.from,this.slice.size])}invert(e){return new xA(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let A=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return A.deletedAcross&&n.deletedAcross?null:new xA(A.pos,Math.max(A.pos,n.pos),this.slice)}merge(e){if(!(e instanceof xA)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let A=this.slice.size+e.slice.size==0?j.empty:new j(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new xA(this.from,this.to+(e.to-e.from),A,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let A=this.slice.size+e.slice.size==0?j.empty:new j(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new xA(e.from,this.to,A,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,A){if(typeof A.from!="number"||typeof A.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new xA(A.from,A.to,j.fromJSON(e,A.slice),!!A.structure)}}JA.jsonID("replace",xA);class OA extends JA{constructor(e,A,n,r,i,s,a=!1){super(),this.from=e,this.to=A,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=s,this.structure=a}apply(e){if(this.structure&&(bc(e,this.from,this.gapFrom)||bc(e,this.gapTo,this.to)))return QA.fail("Structure gap-replace would overwrite content");let A=e.slice(this.gapFrom,this.gapTo);if(A.openStart||A.openEnd)return QA.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,A.content);return n?QA.fromReplace(e,this.from,this.to,n):QA.fail("Content does not fit in gap")}getMap(){return new Ut([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let A=this.gapTo-this.gapFrom;return new OA(this.from,this.from+this.slice.size+A,this.from+this.insert,this.from+this.insert+A,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let A=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?A.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return A.deletedAcross&&n.deletedAcross||r<A.pos||i>n.pos?null:new OA(A.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,A){if(typeof A.from!="number"||typeof A.to!="number"||typeof A.gapFrom!="number"||typeof A.gapTo!="number"||typeof A.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new OA(A.from,A.to,A.gapFrom,A.gapTo,j.fromJSON(e,A.slice),A.insert,!!A.structure)}}JA.jsonID("replaceAround",OA);function bc(t,e,A){let n=t.resolve(e),r=A-e,i=n.depth;for(;r>0&&i>0&&n.indexAfter(i)==n.node(i).childCount;)i--,r--;if(r>0){let s=n.node(i).maybeChild(n.indexAfter(i));for(;r>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,r--}}return!1}function zQ(t,e,A,n){let r=[],i=[],s,a;t.doc.nodesBetween(e,A,(c,u,f)=>{if(!c.isInline)return;let p=c.marks;if(!n.isInSet(p)&&f.type.allowsMarkType(n.type)){let g=Math.max(u,e),B=Math.min(u+c.nodeSize,A),w=n.addToSet(p);for(let Q=0;Q<p.length;Q++)p[Q].isInSet(w)||(s&&s.to==g&&s.mark.eq(p[Q])?s.to=B:r.push(s=new Bn(g,B,p[Q])));a&&a.to==g?a.to=B:i.push(a=new sr(g,B,n))}}),r.forEach(c=>t.step(c)),i.forEach(c=>t.step(c))}function qQ(t,e,A,n){let r=[],i=0;t.doc.nodesBetween(e,A,(s,a)=>{if(!s.isInline)return;i++;let c=null;if(n instanceof Po){let u=s.marks,f;for(;f=n.isInSet(u);)(c||(c=[])).push(f),u=f.removeFromSet(u)}else n?n.isInSet(s.marks)&&(c=[n]):c=s.marks;if(c&&c.length){let u=Math.min(a+s.nodeSize,A);for(let f=0;f<c.length;f++){let p=c[f],g;for(let B=0;B<r.length;B++){let w=r[B];w.step==i-1&&p.eq(r[B].style)&&(g=w)}g?(g.to=u,g.step=i):r.push({style:p,from:Math.max(a,e),to:u,step:i})}}}),r.forEach(s=>t.step(new Bn(s.from,s.to,s.style)))}function Vh(t,e,A,n=A.contentMatch,r=!0){let i=t.doc.nodeAt(e),s=[],a=e+1;for(let c=0;c<i.childCount;c++){let u=i.child(c),f=a+u.nodeSize,p=n.matchType(u.type);if(!p)s.push(new xA(a,f,j.empty));else{n=p;for(let g=0;g<u.marks.length;g++)A.allowsMarkType(u.marks[g].type)||t.step(new Bn(a,f,u.marks[g]));if(r&&u.isText&&A.whitespace!="pre"){let g,B=/\r?\n|\r/g,w;for(;g=B.exec(u.text);)w||(w=new j(Y.from(A.schema.text(" ",A.allowedMarks(u.marks))),0,0)),s.push(new xA(a+g.index,a+g.index+g[0].length,w))}}a=f}if(!n.validEnd){let c=n.fillBefore(Y.empty,!0);t.replace(a,a,new j(c,0,0))}for(let c=s.length-1;c>=0;c--)t.step(s[c])}function ZQ(t,e,A){return(e==0||t.canReplace(e,t.childCount))&&(A==t.childCount||t.canReplace(0,A))}function vi(t){let A=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),i=t.$from.index(n),s=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(i,s,A))return n;if(n==0||r.type.spec.isolating||!ZQ(r,i,s))break}return null}function jQ(t,e,A){let{$from:n,$to:r,depth:i}=e,s=n.before(i+1),a=r.after(i+1),c=s,u=a,f=Y.empty,p=0;for(let w=i,Q=!1;w>A;w--)Q||n.index(w)>0?(Q=!0,f=Y.from(n.node(w).copy(f)),p++):c--;let g=Y.empty,B=0;for(let w=i,Q=!1;w>A;w--)Q||r.after(w+1)<r.end(w)?(Q=!0,g=Y.from(r.node(w).copy(g)),B++):u++;t.step(new OA(c,u,s,a,new j(f.append(g),p,B),f.size-p,!0))}function Uc(t,e,A=null,n=t){let r=eF(t,e),i=r&&AF(n,e);return i?r.map(Ph).concat({type:e,attrs:A}).concat(i.map(Ph)):null}function Ph(t){return{type:t,attrs:null}}function eF(t,e){let{parent:A,startIndex:n,endIndex:r}=t,i=A.contentMatchAt(n).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return A.canReplaceWith(n,r,s)?i:null}function AF(t,e){let{parent:A,startIndex:n,endIndex:r}=t,i=A.child(n),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let c=(s.length?s[s.length-1]:e).contentMatch;for(let u=n;c&&u<r;u++)c=c.matchType(A.child(u).type);return!c||!c.validEnd?null:s}function tF(t,e,A){let n=Y.empty;for(let s=A.length-1;s>=0;s--){if(n.size){let a=A[s].type.contentMatch.matchFragment(n);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=Y.from(A[s].type.create(A[s].attrs,n))}let r=e.start,i=e.end;t.step(new OA(r,i,r,i,new j(n,0,0),A.length,!0))}function nF(t,e,A,n,r){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,A,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(n,r)&&sF(t.doc,t.mapping.slice(i).map(a),n)){let c=null;if(n.schema.linebreakReplacement){let g=n.whitespace=="pre",B=!!n.contentMatch.matchType(n.schema.linebreakReplacement);g&&!B?c=!1:!g&&B&&(c=!0)}c===!1&&iF(t,s,a,i),Vh(t,t.mapping.slice(i).map(a,1),n,void 0,c===null);let u=t.mapping.slice(i),f=u.map(a,1),p=u.map(a+s.nodeSize,1);return t.step(new OA(f,p,f+1,p-1,new j(Y.from(n.create(r,null,s.marks)),0,0),1,!0)),c===!0&&rF(t,s,a,i),!1}})}function rF(t,e,A,n){e.forEach((r,i)=>{if(r.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(r.text);){let c=t.mapping.slice(n).map(A+1+i+s.index);t.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function iF(t,e,A,n){e.forEach((r,i)=>{if(r.type==r.type.schema.linebreakReplacement){let s=t.mapping.slice(n).map(A+1+i);t.replaceWith(s,s+1,e.type.schema.text(`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ablok-components",
3
3
  "private": false,
4
- "version": "0.1.176",
4
+ "version": "0.1.177",
5
5
  "scripts": {
6
6
  "dev": "vite --host",
7
7
  "build": "vue-tsc --noEmit && vite build",