@zipify/wysiwyg 4.12.0-beta.3 → 4.13.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/node.js CHANGED
@@ -1,39 +1,39 @@
1
- "use strict";var jp=require("jsdom");function uE(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const cs=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const pi=()=>{},fE=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),sr=Object.assign,hE=Object.prototype.hasOwnProperty,ru=(n,e)=>hE.call(n,e),Le=Array.isArray,mi=n=>$o(n)==="[object Map]",dE=n=>$o(n)==="[object Set]",Ye=n=>typeof n=="function",In=n=>typeof n=="string",us=n=>typeof n=="symbol",dt=n=>n!==null&&typeof n=="object",pE=n=>(dt(n)||Ye(n))&&Ye(n.then)&&Ye(n.catch),mE=Object.prototype.toString,$o=n=>mE.call(n),Yp=n=>$o(n).slice(8,-1),gE=n=>$o(n)==="[object Object]",iu=n=>In(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,yE=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},bE=yE(n=>n.charAt(0).toUpperCase()+n.slice(1)),or=(n,e)=>!Object.is(n,e);let Xp;const Wo=()=>Xp||(Xp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function su(n){if(Le(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],i=In(r)?xE(r):su(r);if(i)for(const o in i)e[o]=i[o]}return e}else if(In(n)||dt(n))return n}const vE=/;(?![^(]*\))/g,wE=/:([^]+)/,SE=/\/\*[^]*?\*\//g;function xE(n){const e={};return n.replace(SE,"").split(vE).forEach(t=>{if(t){const r=t.split(wE);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function ou(n){let e="";if(In(n))e=n;else if(Le(n))for(let t=0;t<n.length;t++){const r=ou(n[t]);r&&(e+=r+" ")}else if(dt(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}function On(n,...e){console.warn(`[Vue warn] ${n}`,...e)}let ye;const lu=new WeakSet;class EE{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,lu.has(this)&&(lu.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Qp(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,im(this),em(this);const e=ye,t=Qt;ye=this,Qt=!0;try{return this.fn()}finally{process.env.NODE_ENV!=="production"&&ye!==this&&On("Active effect was not restored correctly - this is likely a Vue internal bug."),tm(this),ye=e,Qt=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)fu(e);this.deps=this.depsTail=void 0,im(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?lu.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){uu(this)&&this.run()}get dirty(){return uu(this)}}let Zp=0,fs,hs;function Qp(n,e=!1){if(n.flags|=8,e){n.next=hs,hs=n;return}n.next=fs,fs=n}function au(){Zp++}function cu(){if(--Zp>0)return;if(hs){let e=hs;for(hs=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;fs;){let e=fs;for(fs=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(r){n||(n=r)}e=t}}if(n)throw n}function em(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function tm(n){let e,t=n.depsTail,r=t;for(;r;){const i=r.prevDep;r.version===-1?(r===t&&(t=i),fu(r),kE(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=e,n.depsTail=t}function uu(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(nm(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function nm(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===ds))return;n.globalVersion=ds;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!uu(n)){n.flags&=-3;return}const t=ye,r=Qt;ye=n,Qt=!0;try{em(n);const i=n.fn(n._value);(e.version===0||or(i,n._value))&&(n._value=i,e.version++)}catch(i){throw e.version++,i}finally{ye=t,Qt=r,tm(n),n.flags&=-3}}function fu(n,e=!1){const{dep:t,prevSub:r,nextSub:i}=n;if(r&&(r.nextSub=i,n.prevSub=void 0),i&&(i.prevSub=r,n.nextSub=void 0),process.env.NODE_ENV!=="production"&&t.subsHead===n&&(t.subsHead=i),t.subs===n&&(t.subs=r,!r&&t.computed)){t.computed.flags&=-5;for(let o=t.computed.deps;o;o=o.nextDep)fu(o,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function kE(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let Qt=!0;const rm=[];function Uo(){rm.push(Qt),Qt=!1}function Vo(){const n=rm.pop();Qt=n===void 0?!0:n}function im(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=ye;ye=void 0;try{e()}finally{ye=t}}}let ds=0,_E=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}};class hu{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,process.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(e){if(!ye||!Qt||ye===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==ye)t=this.activeLink=new _E(ye,this),ye.deps?(t.prevDep=ye.depsTail,ye.depsTail.nextDep=t,ye.depsTail=t):ye.deps=ye.depsTail=t,sm(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const r=t.nextDep;r.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=r),t.prevDep=ye.depsTail,t.nextDep=void 0,ye.depsTail.nextDep=t,ye.depsTail=t,ye.deps===t&&(ye.deps=r)}return process.env.NODE_ENV!=="production"&&ye.onTrack&&ye.onTrack(sr({effect:ye},e)),t}trigger(e){this.version++,ds++,this.notify(e)}notify(e){au();try{if(process.env.NODE_ENV!=="production")for(let t=this.subsHead;t;t=t.nextSub)t.sub.onTrigger&&!(t.sub.flags&8)&&t.sub.onTrigger(sr({effect:t.sub},e));for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{cu()}}}function sm(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let r=e.deps;r;r=r.nextDep)sm(r)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),process.env.NODE_ENV!=="production"&&n.dep.subsHead===void 0&&(n.dep.subsHead=n),n.dep.subs=n}}const Ko=new WeakMap,Pr=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),du=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),ps=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function pt(n,e,t){if(Qt&&ye){let r=Ko.get(n);r||Ko.set(n,r=new Map);let i=r.get(t);i||(r.set(t,i=new hu),i.map=r,i.key=t),process.env.NODE_ENV!=="production"?i.track({target:n,type:e,key:t}):i.track()}}function lr(n,e,t,r,i,o){const a=Ko.get(n);if(!a){ds++;return}const c=f=>{f&&(process.env.NODE_ENV!=="production"?f.trigger({target:n,type:e,key:t,newValue:r,oldValue:i,oldTarget:o}):f.trigger())};if(au(),e==="clear")a.forEach(c);else{const f=Le(n),h=f&&iu(t);if(f&&t==="length"){const m=Number(r);a.forEach((p,g)=>{(g==="length"||g===ps||!us(g)&&g>=m)&&c(p)})}else switch((t!==void 0||a.has(void 0))&&c(a.get(t)),h&&c(a.get(ps)),e){case"add":f?h&&c(a.get("length")):(c(a.get(Pr)),mi(n)&&c(a.get(du)));break;case"delete":f||(c(a.get(Pr)),mi(n)&&c(a.get(du)));break;case"set":mi(n)&&c(a.get(Pr));break}}cu()}function TE(n,e){const t=Ko.get(n);return t&&t.get(e)}function gi(n){const e=le(n);return e===n?e:(pt(e,"iterate",ps),mt(n)?e:e.map(it))}function pu(n){return pt(n=le(n),"iterate",ps),n}const CE={__proto__:null,[Symbol.iterator](){return mu(this,Symbol.iterator,it)},concat(...n){return gi(this).concat(...n.map(e=>Le(e)?gi(e):e))},entries(){return mu(this,"entries",n=>(n[1]=it(n[1]),n))},every(n,e){return Nn(this,"every",n,e,void 0,arguments)},filter(n,e){return Nn(this,"filter",n,e,t=>t.map(it),arguments)},find(n,e){return Nn(this,"find",n,e,it,arguments)},findIndex(n,e){return Nn(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return Nn(this,"findLast",n,e,it,arguments)},findLastIndex(n,e){return Nn(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return Nn(this,"forEach",n,e,void 0,arguments)},includes(...n){return gu(this,"includes",n)},indexOf(...n){return gu(this,"indexOf",n)},join(n){return gi(this).join(n)},lastIndexOf(...n){return gu(this,"lastIndexOf",n)},map(n,e){return Nn(this,"map",n,e,void 0,arguments)},pop(){return ms(this,"pop")},push(...n){return ms(this,"push",n)},reduce(n,...e){return om(this,"reduce",n,e)},reduceRight(n,...e){return om(this,"reduceRight",n,e)},shift(){return ms(this,"shift")},some(n,e){return Nn(this,"some",n,e,void 0,arguments)},splice(...n){return ms(this,"splice",n)},toReversed(){return gi(this).toReversed()},toSorted(n){return gi(this).toSorted(n)},toSpliced(...n){return gi(this).toSpliced(...n)},unshift(...n){return ms(this,"unshift",n)},values(){return mu(this,"values",it)}};function mu(n,e,t){const r=pu(n),i=r[e]();return r!==n&&!mt(n)&&(i._next=i.next,i.next=()=>{const o=i._next();return o.value&&(o.value=t(o.value)),o}),i}const ME=Array.prototype;function Nn(n,e,t,r,i,o){const a=pu(n),c=a!==n&&!mt(n),f=a[e];if(f!==ME[e]){const p=f.apply(n,o);return c?it(p):p}let h=t;a!==n&&(c?h=function(p,g){return t.call(this,it(p),g,n)}:t.length>2&&(h=function(p,g){return t.call(this,p,g,n)}));const m=f.call(a,h,r);return c&&i?i(m):m}function om(n,e,t,r){const i=pu(n);let o=t;return i!==n&&(mt(n)?t.length>3&&(o=function(a,c,f){return t.call(this,a,c,f,n)}):o=function(a,c,f){return t.call(this,a,it(c),f,n)}),i[e](o,...r)}function gu(n,e,t){const r=le(n);pt(r,"iterate",ps);const i=r[e](...t);return(i===-1||i===!1)&&qo(t[0])?(t[0]=le(t[0]),r[e](...t)):i}function ms(n,e,t=[]){Uo(),au();const r=le(n)[e].apply(n,t);return cu(),Vo(),r}const AE=uE("__proto__,__v_isRef,__isVue"),lm=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(us));function IE(n){us(n)||(n=String(n));const e=le(this);return pt(e,"has",n),e.hasOwnProperty(n)}class am{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,r){if(t==="__v_skip")return e.__v_skip;const i=this._isReadonly,o=this._isShallow;if(t==="__v_isReactive")return!i;if(t==="__v_isReadonly")return i;if(t==="__v_isShallow")return o;if(t==="__v_raw")return r===(i?o?HE:hm:o?FE:fm).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const a=Le(e);if(!i){let f;if(a&&(f=CE[t]))return f;if(t==="hasOwnProperty")return IE}const c=Reflect.get(e,t,st(e)?e:r);return(us(t)?lm.has(t):AE(t))||(i||pt(e,"get",t),o)?c:st(c)?a&&iu(t)?c:c.value:dt(c)?i?dm(c):bu(c):c}}class OE extends am{constructor(e=!1){super(!1,e)}set(e,t,r,i){let o=e[t];if(!this._isShallow){const f=Rn(o);if(!mt(r)&&!Rn(r)&&(o=le(o),r=le(r)),!Le(e)&&st(o)&&!st(r))return f?!1:(o.value=r,!0)}const a=Le(e)&&iu(t)?Number(t)<e.length:ru(e,t),c=Reflect.set(e,t,r,st(e)?e:i);return e===le(i)&&(a?or(r,o)&&lr(e,"set",t,r,o):lr(e,"add",t,r)),c}deleteProperty(e,t){const r=ru(e,t),i=e[t],o=Reflect.deleteProperty(e,t);return o&&r&&lr(e,"delete",t,void 0,i),o}has(e,t){const r=Reflect.has(e,t);return(!us(t)||!lm.has(t))&&pt(e,"has",t),r}ownKeys(e){return pt(e,"iterate",Le(e)?"length":Pr),Reflect.ownKeys(e)}}class NE extends am{constructor(e=!1){super(!0,e)}set(e,t){return process.env.NODE_ENV!=="production"&&On(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return process.env.NODE_ENV!=="production"&&On(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}}const RE=new OE,LE=new NE,yu=n=>n,Go=n=>Reflect.getPrototypeOf(n);function PE(n,e,t){return function(...r){const i=this.__v_raw,o=le(i),a=mi(o),c=n==="entries"||n===Symbol.iterator&&a,f=n==="keys"&&a,h=i[n](...r),m=t?yu:e?vu:it;return!e&&pt(o,"iterate",f?du:Pr),{next(){const{value:p,done:g}=h.next();return g?{value:p,done:g}:{value:c?[m(p[0]),m(p[1])]:m(p),done:g}},[Symbol.iterator](){return this}}}}function Jo(n){return function(...e){if(process.env.NODE_ENV!=="production"){const t=e[0]?`on key "${e[0]}" `:"";On(`${bE(n)} operation ${t}failed: target is readonly.`,le(this))}return n==="delete"?!1:n==="clear"?void 0:this}}function DE(n,e){const t={get(i){const o=this.__v_raw,a=le(o),c=le(i);n||(or(i,c)&&pt(a,"get",i),pt(a,"get",c));const{has:f}=Go(a),h=e?yu:n?vu:it;if(f.call(a,i))return h(o.get(i));if(f.call(a,c))return h(o.get(c));o!==a&&o.get(i)},get size(){const i=this.__v_raw;return!n&&pt(le(i),"iterate",Pr),Reflect.get(i,"size",i)},has(i){const o=this.__v_raw,a=le(o),c=le(i);return n||(or(i,c)&&pt(a,"has",i),pt(a,"has",c)),i===c?o.has(i):o.has(i)||o.has(c)},forEach(i,o){const a=this,c=a.__v_raw,f=le(c),h=e?yu:n?vu:it;return!n&&pt(f,"iterate",Pr),c.forEach((m,p)=>i.call(o,h(m),h(p),a))}};return sr(t,n?{add:Jo("add"),set:Jo("set"),delete:Jo("delete"),clear:Jo("clear")}:{add(i){!e&&!mt(i)&&!Rn(i)&&(i=le(i));const o=le(this);return Go(o).has.call(o,i)||(o.add(i),lr(o,"add",i,i)),this},set(i,o){!e&&!mt(o)&&!Rn(o)&&(o=le(o));const a=le(this),{has:c,get:f}=Go(a);let h=c.call(a,i);h?process.env.NODE_ENV!=="production"&&um(a,c,i):(i=le(i),h=c.call(a,i));const m=f.call(a,i);return a.set(i,o),h?or(o,m)&&lr(a,"set",i,o,m):lr(a,"add",i,o),this},delete(i){const o=le(this),{has:a,get:c}=Go(o);let f=a.call(o,i);f?process.env.NODE_ENV!=="production"&&um(o,a,i):(i=le(i),f=a.call(o,i));const h=c?c.call(o,i):void 0,m=o.delete(i);return f&&lr(o,"delete",i,void 0,h),m},clear(){const i=le(this),o=i.size!==0,a=process.env.NODE_ENV!=="production"?mi(i)?new Map(i):new Set(i):void 0,c=i.clear();return o&&lr(i,"clear",void 0,void 0,a),c}}),["keys","values","entries",Symbol.iterator].forEach(i=>{t[i]=PE(i,n,e)}),t}function cm(n,e){const t=DE(n,e);return(r,i,o)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(ru(t,i)&&i in r?t:r,i,o)}const BE={get:cm(!1,!1)},zE={get:cm(!0,!1)};function um(n,e,t){const r=le(t);if(r!==t&&e.call(n,r)){const i=Yp(n);On(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const fm=new WeakMap,FE=new WeakMap,hm=new WeakMap,HE=new WeakMap;function $E(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function WE(n){return n.__v_skip||!Object.isExtensible(n)?0:$E(Yp(n))}function bu(n){return Rn(n)?n:pm(n,!1,RE,BE,fm)}function dm(n){return pm(n,!0,LE,zE,hm)}function pm(n,e,t,r,i){if(!dt(n))return process.env.NODE_ENV!=="production"&&On(`value cannot be made ${e?"readonly":"reactive"}: ${String(n)}`),n;if(n.__v_raw&&!(e&&n.__v_isReactive))return n;const o=i.get(n);if(o)return o;const a=WE(n);if(a===0)return n;const c=new Proxy(n,a===2?r:t);return i.set(n,c),c}function gs(n){return Rn(n)?gs(n.__v_raw):!!(n&&n.__v_isReactive)}function Rn(n){return!!(n&&n.__v_isReadonly)}function mt(n){return!!(n&&n.__v_isShallow)}function qo(n){return n?!!n.__v_raw:!1}function le(n){const e=n&&n.__v_raw;return e?le(e):n}const it=n=>dt(n)?bu(n):n,vu=n=>dt(n)?dm(n):n;function st(n){return n?n.__v_isRef===!0:!1}function jo(n){return UE(n,!1)}function UE(n,e){return st(n)?n:new VE(n,e)}class VE{constructor(e,t){this.dep=new hu,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:le(e),this._value=t?e:it(e),this.__v_isShallow=t}get value(){return process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(e){const t=this._rawValue,r=this.__v_isShallow||mt(e)||Rn(e);e=r?e:le(e),or(e,t)&&(this._rawValue=e,this._value=r?e:it(e),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:e,oldValue:t}):this.dep.trigger())}}function z(n){return st(n)?n.value:n}class KE{constructor(e,t,r){this._object=e,this._key=t,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return TE(le(this._object),this._key)}}class GE{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function yi(n,e,t){return st(n)?n:Ye(n)?new GE(n):dt(n)&&arguments.length>1?JE(n,e,t):jo(n)}function JE(n,e,t){const r=n[e];return st(r)?r:new KE(n,e,t)}class qE{constructor(e,t,r){this.fn=e,this.setter=t,this._value=void 0,this.dep=new hu(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ds-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&ye!==this)return Qp(this,!0),!0;process.env.NODE_ENV}get value(){const e=process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return nm(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter?this.setter(e):process.env.NODE_ENV!=="production"&&On("Write operation failed: computed value is readonly")}}function jE(n,e,t=!1){let r,i;Ye(n)?r=n:(r=n.get,i=n.set);const o=new qE(r,i,t);return process.env.NODE_ENV,o}const Yo={},Xo=new WeakMap;let Dr;function YE(n,e=!1,t=Dr){if(t){let r=Xo.get(t);r||Xo.set(t,r=[]),r.push(n)}else process.env.NODE_ENV!=="production"&&!e&&On("onWatcherCleanup() was called when there was no active watcher to associate with.")}function XE(n,e,t=cs){const{immediate:r,deep:i,once:o,scheduler:a,augmentJob:c,call:f}=t,h=$=>{(t.onWarn||On)("Invalid watch source: ",$,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},m=$=>i?$:mt($)||i===!1||i===0?ar($,1):ar($);let p,g,b,S,E=!1,C=!1;if(st(n)?(g=()=>n.value,E=mt(n)):gs(n)?(g=()=>m(n),E=!0):Le(n)?(C=!0,E=n.some($=>gs($)||mt($)),g=()=>n.map($=>{if(st($))return $.value;if(gs($))return m($);if(Ye($))return f?f($,2):$();process.env.NODE_ENV!=="production"&&h($)})):Ye(n)?e?g=f?()=>f(n,2):n:g=()=>{if(b){Uo();try{b()}finally{Vo()}}const $=Dr;Dr=p;try{return f?f(n,3,[S]):n(S)}finally{Dr=$}}:(g=pi,process.env.NODE_ENV!=="production"&&h(n)),e&&i){const $=g,U=i===!0?1/0:i;g=()=>ar($(),U)}const M=()=>{p.stop()};if(o&&e){const $=e;e=(...U)=>{$(...U),M()}}let P=C?new Array(n.length).fill(Yo):Yo;const F=$=>{if(!(!(p.flags&1)||!p.dirty&&!$))if(e){const U=p.run();if(i||E||(C?U.some((ue,he)=>or(ue,P[he])):or(U,P))){b&&b();const ue=Dr;Dr=p;try{const he=[U,P===Yo?void 0:C&&P[0]===Yo?[]:P,S];f?f(e,3,he):e(...he),P=U}finally{Dr=ue}}}else p.run()};return c&&c(F),p=new EE(g),p.scheduler=a?()=>a(F,!1):F,S=$=>YE($,!1,p),b=p.onStop=()=>{const $=Xo.get(p);if($){if(f)f($,4);else for(const U of $)U();Xo.delete(p)}},process.env.NODE_ENV!=="production"&&(p.onTrack=t.onTrack,p.onTrigger=t.onTrigger),e?r?F(!0):P=p.run():a?a(F.bind(null,!0),!0):p.run(),M.pause=p.pause.bind(p),M.resume=p.resume.bind(p),M.stop=M,M}function ar(n,e=1/0,t){if(e<=0||!dt(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,st(n))ar(n.value,e,t);else if(Le(n))for(let r=0;r<n.length;r++)ar(n[r],e,t);else if(dE(n)||mi(n))n.forEach(r=>{ar(r,e,t)});else if(gE(n)){for(const r in n)ar(n[r],e,t);for(const r of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,r)&&ar(n[r],e,t)}return n}const Br=[];function ZE(n){Br.push(n)}function QE(){Br.pop()}let wu=!1;function ot(n,...e){if(wu)return;wu=!0,Uo();const t=Br.length?Br[Br.length-1].component:null,r=t&&t.appContext.config.warnHandler,i=ek();if(r)Zo(r,t,11,[n+e.map(o=>{var a,c;return(c=(a=o.toString)==null?void 0:a.call(o))!=null?c:JSON.stringify(o)}).join(""),t&&t.proxy,i.map(({vnode:o})=>`at <${Nm(t,o.type)}>`).join(`
1
+ "use strict";var jp=require("jsdom");function fE(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const cs=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const pi=()=>{},hE=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),sr=Object.assign,dE=Object.prototype.hasOwnProperty,ru=(n,e)=>dE.call(n,e),Le=Array.isArray,mi=n=>$o(n)==="[object Map]",pE=n=>$o(n)==="[object Set]",Ye=n=>typeof n=="function",In=n=>typeof n=="string",us=n=>typeof n=="symbol",dt=n=>n!==null&&typeof n=="object",mE=n=>(dt(n)||Ye(n))&&Ye(n.then)&&Ye(n.catch),gE=Object.prototype.toString,$o=n=>gE.call(n),Yp=n=>$o(n).slice(8,-1),yE=n=>$o(n)==="[object Object]",iu=n=>In(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,bE=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},vE=bE(n=>n.charAt(0).toUpperCase()+n.slice(1)),or=(n,e)=>!Object.is(n,e);let Xp;const Wo=()=>Xp||(Xp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function su(n){if(Le(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],i=In(r)?EE(r):su(r);if(i)for(const o in i)e[o]=i[o]}return e}else if(In(n)||dt(n))return n}const wE=/;(?![^(]*\))/g,SE=/:([^]+)/,xE=/\/\*[^]*?\*\//g;function EE(n){const e={};return n.replace(xE,"").split(wE).forEach(t=>{if(t){const r=t.split(SE);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function ou(n){let e="";if(In(n))e=n;else if(Le(n))for(let t=0;t<n.length;t++){const r=ou(n[t]);r&&(e+=r+" ")}else if(dt(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}function On(n,...e){console.warn(`[Vue warn] ${n}`,...e)}let ye;const lu=new WeakSet;class kE{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,lu.has(this)&&(lu.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Qp(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,im(this),em(this);const e=ye,t=Qt;ye=this,Qt=!0;try{return this.fn()}finally{process.env.NODE_ENV!=="production"&&ye!==this&&On("Active effect was not restored correctly - this is likely a Vue internal bug."),tm(this),ye=e,Qt=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)fu(e);this.deps=this.depsTail=void 0,im(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?lu.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){uu(this)&&this.run()}get dirty(){return uu(this)}}let Zp=0,fs,hs;function Qp(n,e=!1){if(n.flags|=8,e){n.next=hs,hs=n;return}n.next=fs,fs=n}function au(){Zp++}function cu(){if(--Zp>0)return;if(hs){let e=hs;for(hs=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;fs;){let e=fs;for(fs=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(r){n||(n=r)}e=t}}if(n)throw n}function em(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function tm(n){let e,t=n.depsTail,r=t;for(;r;){const i=r.prevDep;r.version===-1?(r===t&&(t=i),fu(r),_E(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=e,n.depsTail=t}function uu(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(nm(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function nm(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===ds))return;n.globalVersion=ds;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!uu(n)){n.flags&=-3;return}const t=ye,r=Qt;ye=n,Qt=!0;try{em(n);const i=n.fn(n._value);(e.version===0||or(i,n._value))&&(n._value=i,e.version++)}catch(i){throw e.version++,i}finally{ye=t,Qt=r,tm(n),n.flags&=-3}}function fu(n,e=!1){const{dep:t,prevSub:r,nextSub:i}=n;if(r&&(r.nextSub=i,n.prevSub=void 0),i&&(i.prevSub=r,n.nextSub=void 0),process.env.NODE_ENV!=="production"&&t.subsHead===n&&(t.subsHead=i),t.subs===n&&(t.subs=r,!r&&t.computed)){t.computed.flags&=-5;for(let o=t.computed.deps;o;o=o.nextDep)fu(o,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function _E(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let Qt=!0;const rm=[];function Uo(){rm.push(Qt),Qt=!1}function Vo(){const n=rm.pop();Qt=n===void 0?!0:n}function im(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=ye;ye=void 0;try{e()}finally{ye=t}}}let ds=0,TE=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}};class hu{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,process.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(e){if(!ye||!Qt||ye===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==ye)t=this.activeLink=new TE(ye,this),ye.deps?(t.prevDep=ye.depsTail,ye.depsTail.nextDep=t,ye.depsTail=t):ye.deps=ye.depsTail=t,sm(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const r=t.nextDep;r.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=r),t.prevDep=ye.depsTail,t.nextDep=void 0,ye.depsTail.nextDep=t,ye.depsTail=t,ye.deps===t&&(ye.deps=r)}return process.env.NODE_ENV!=="production"&&ye.onTrack&&ye.onTrack(sr({effect:ye},e)),t}trigger(e){this.version++,ds++,this.notify(e)}notify(e){au();try{if(process.env.NODE_ENV!=="production")for(let t=this.subsHead;t;t=t.nextSub)t.sub.onTrigger&&!(t.sub.flags&8)&&t.sub.onTrigger(sr({effect:t.sub},e));for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{cu()}}}function sm(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let r=e.deps;r;r=r.nextDep)sm(r)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),process.env.NODE_ENV!=="production"&&n.dep.subsHead===void 0&&(n.dep.subsHead=n),n.dep.subs=n}}const Ko=new WeakMap,Dr=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),du=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),ps=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function pt(n,e,t){if(Qt&&ye){let r=Ko.get(n);r||Ko.set(n,r=new Map);let i=r.get(t);i||(r.set(t,i=new hu),i.map=r,i.key=t),process.env.NODE_ENV!=="production"?i.track({target:n,type:e,key:t}):i.track()}}function lr(n,e,t,r,i,o){const a=Ko.get(n);if(!a){ds++;return}const c=f=>{f&&(process.env.NODE_ENV!=="production"?f.trigger({target:n,type:e,key:t,newValue:r,oldValue:i,oldTarget:o}):f.trigger())};if(au(),e==="clear")a.forEach(c);else{const f=Le(n),h=f&&iu(t);if(f&&t==="length"){const m=Number(r);a.forEach((p,g)=>{(g==="length"||g===ps||!us(g)&&g>=m)&&c(p)})}else switch((t!==void 0||a.has(void 0))&&c(a.get(t)),h&&c(a.get(ps)),e){case"add":f?h&&c(a.get("length")):(c(a.get(Dr)),mi(n)&&c(a.get(du)));break;case"delete":f||(c(a.get(Dr)),mi(n)&&c(a.get(du)));break;case"set":mi(n)&&c(a.get(Dr));break}}cu()}function CE(n,e){const t=Ko.get(n);return t&&t.get(e)}function gi(n){const e=le(n);return e===n?e:(pt(e,"iterate",ps),mt(n)?e:e.map(it))}function pu(n){return pt(n=le(n),"iterate",ps),n}const ME={__proto__:null,[Symbol.iterator](){return mu(this,Symbol.iterator,it)},concat(...n){return gi(this).concat(...n.map(e=>Le(e)?gi(e):e))},entries(){return mu(this,"entries",n=>(n[1]=it(n[1]),n))},every(n,e){return Nn(this,"every",n,e,void 0,arguments)},filter(n,e){return Nn(this,"filter",n,e,t=>t.map(it),arguments)},find(n,e){return Nn(this,"find",n,e,it,arguments)},findIndex(n,e){return Nn(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return Nn(this,"findLast",n,e,it,arguments)},findLastIndex(n,e){return Nn(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return Nn(this,"forEach",n,e,void 0,arguments)},includes(...n){return gu(this,"includes",n)},indexOf(...n){return gu(this,"indexOf",n)},join(n){return gi(this).join(n)},lastIndexOf(...n){return gu(this,"lastIndexOf",n)},map(n,e){return Nn(this,"map",n,e,void 0,arguments)},pop(){return ms(this,"pop")},push(...n){return ms(this,"push",n)},reduce(n,...e){return om(this,"reduce",n,e)},reduceRight(n,...e){return om(this,"reduceRight",n,e)},shift(){return ms(this,"shift")},some(n,e){return Nn(this,"some",n,e,void 0,arguments)},splice(...n){return ms(this,"splice",n)},toReversed(){return gi(this).toReversed()},toSorted(n){return gi(this).toSorted(n)},toSpliced(...n){return gi(this).toSpliced(...n)},unshift(...n){return ms(this,"unshift",n)},values(){return mu(this,"values",it)}};function mu(n,e,t){const r=pu(n),i=r[e]();return r!==n&&!mt(n)&&(i._next=i.next,i.next=()=>{const o=i._next();return o.value&&(o.value=t(o.value)),o}),i}const AE=Array.prototype;function Nn(n,e,t,r,i,o){const a=pu(n),c=a!==n&&!mt(n),f=a[e];if(f!==AE[e]){const p=f.apply(n,o);return c?it(p):p}let h=t;a!==n&&(c?h=function(p,g){return t.call(this,it(p),g,n)}:t.length>2&&(h=function(p,g){return t.call(this,p,g,n)}));const m=f.call(a,h,r);return c&&i?i(m):m}function om(n,e,t,r){const i=pu(n);let o=t;return i!==n&&(mt(n)?t.length>3&&(o=function(a,c,f){return t.call(this,a,c,f,n)}):o=function(a,c,f){return t.call(this,a,it(c),f,n)}),i[e](o,...r)}function gu(n,e,t){const r=le(n);pt(r,"iterate",ps);const i=r[e](...t);return(i===-1||i===!1)&&qo(t[0])?(t[0]=le(t[0]),r[e](...t)):i}function ms(n,e,t=[]){Uo(),au();const r=le(n)[e].apply(n,t);return cu(),Vo(),r}const IE=fE("__proto__,__v_isRef,__isVue"),lm=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(us));function OE(n){us(n)||(n=String(n));const e=le(this);return pt(e,"has",n),e.hasOwnProperty(n)}class am{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,r){if(t==="__v_skip")return e.__v_skip;const i=this._isReadonly,o=this._isShallow;if(t==="__v_isReactive")return!i;if(t==="__v_isReadonly")return i;if(t==="__v_isShallow")return o;if(t==="__v_raw")return r===(i?o?$E:hm:o?HE:fm).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const a=Le(e);if(!i){let f;if(a&&(f=ME[t]))return f;if(t==="hasOwnProperty")return OE}const c=Reflect.get(e,t,st(e)?e:r);return(us(t)?lm.has(t):IE(t))||(i||pt(e,"get",t),o)?c:st(c)?a&&iu(t)?c:c.value:dt(c)?i?dm(c):bu(c):c}}class NE extends am{constructor(e=!1){super(!1,e)}set(e,t,r,i){let o=e[t];if(!this._isShallow){const f=Rn(o);if(!mt(r)&&!Rn(r)&&(o=le(o),r=le(r)),!Le(e)&&st(o)&&!st(r))return f?!1:(o.value=r,!0)}const a=Le(e)&&iu(t)?Number(t)<e.length:ru(e,t),c=Reflect.set(e,t,r,st(e)?e:i);return e===le(i)&&(a?or(r,o)&&lr(e,"set",t,r,o):lr(e,"add",t,r)),c}deleteProperty(e,t){const r=ru(e,t),i=e[t],o=Reflect.deleteProperty(e,t);return o&&r&&lr(e,"delete",t,void 0,i),o}has(e,t){const r=Reflect.has(e,t);return(!us(t)||!lm.has(t))&&pt(e,"has",t),r}ownKeys(e){return pt(e,"iterate",Le(e)?"length":Dr),Reflect.ownKeys(e)}}class RE extends am{constructor(e=!1){super(!0,e)}set(e,t){return process.env.NODE_ENV!=="production"&&On(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return process.env.NODE_ENV!=="production"&&On(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}}const LE=new NE,PE=new RE,yu=n=>n,Go=n=>Reflect.getPrototypeOf(n);function DE(n,e,t){return function(...r){const i=this.__v_raw,o=le(i),a=mi(o),c=n==="entries"||n===Symbol.iterator&&a,f=n==="keys"&&a,h=i[n](...r),m=t?yu:e?vu:it;return!e&&pt(o,"iterate",f?du:Dr),{next(){const{value:p,done:g}=h.next();return g?{value:p,done:g}:{value:c?[m(p[0]),m(p[1])]:m(p),done:g}},[Symbol.iterator](){return this}}}}function Jo(n){return function(...e){if(process.env.NODE_ENV!=="production"){const t=e[0]?`on key "${e[0]}" `:"";On(`${vE(n)} operation ${t}failed: target is readonly.`,le(this))}return n==="delete"?!1:n==="clear"?void 0:this}}function zE(n,e){const t={get(i){const o=this.__v_raw,a=le(o),c=le(i);n||(or(i,c)&&pt(a,"get",i),pt(a,"get",c));const{has:f}=Go(a),h=e?yu:n?vu:it;if(f.call(a,i))return h(o.get(i));if(f.call(a,c))return h(o.get(c));o!==a&&o.get(i)},get size(){const i=this.__v_raw;return!n&&pt(le(i),"iterate",Dr),Reflect.get(i,"size",i)},has(i){const o=this.__v_raw,a=le(o),c=le(i);return n||(or(i,c)&&pt(a,"has",i),pt(a,"has",c)),i===c?o.has(i):o.has(i)||o.has(c)},forEach(i,o){const a=this,c=a.__v_raw,f=le(c),h=e?yu:n?vu:it;return!n&&pt(f,"iterate",Dr),c.forEach((m,p)=>i.call(o,h(m),h(p),a))}};return sr(t,n?{add:Jo("add"),set:Jo("set"),delete:Jo("delete"),clear:Jo("clear")}:{add(i){!e&&!mt(i)&&!Rn(i)&&(i=le(i));const o=le(this);return Go(o).has.call(o,i)||(o.add(i),lr(o,"add",i,i)),this},set(i,o){!e&&!mt(o)&&!Rn(o)&&(o=le(o));const a=le(this),{has:c,get:f}=Go(a);let h=c.call(a,i);h?process.env.NODE_ENV!=="production"&&um(a,c,i):(i=le(i),h=c.call(a,i));const m=f.call(a,i);return a.set(i,o),h?or(o,m)&&lr(a,"set",i,o,m):lr(a,"add",i,o),this},delete(i){const o=le(this),{has:a,get:c}=Go(o);let f=a.call(o,i);f?process.env.NODE_ENV!=="production"&&um(o,a,i):(i=le(i),f=a.call(o,i));const h=c?c.call(o,i):void 0,m=o.delete(i);return f&&lr(o,"delete",i,void 0,h),m},clear(){const i=le(this),o=i.size!==0,a=process.env.NODE_ENV!=="production"?mi(i)?new Map(i):new Set(i):void 0,c=i.clear();return o&&lr(i,"clear",void 0,void 0,a),c}}),["keys","values","entries",Symbol.iterator].forEach(i=>{t[i]=DE(i,n,e)}),t}function cm(n,e){const t=zE(n,e);return(r,i,o)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(ru(t,i)&&i in r?t:r,i,o)}const BE={get:cm(!1,!1)},FE={get:cm(!0,!1)};function um(n,e,t){const r=le(t);if(r!==t&&e.call(n,r)){const i=Yp(n);On(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const fm=new WeakMap,HE=new WeakMap,hm=new WeakMap,$E=new WeakMap;function WE(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function UE(n){return n.__v_skip||!Object.isExtensible(n)?0:WE(Yp(n))}function bu(n){return Rn(n)?n:pm(n,!1,LE,BE,fm)}function dm(n){return pm(n,!0,PE,FE,hm)}function pm(n,e,t,r,i){if(!dt(n))return process.env.NODE_ENV!=="production"&&On(`value cannot be made ${e?"readonly":"reactive"}: ${String(n)}`),n;if(n.__v_raw&&!(e&&n.__v_isReactive))return n;const o=i.get(n);if(o)return o;const a=UE(n);if(a===0)return n;const c=new Proxy(n,a===2?r:t);return i.set(n,c),c}function gs(n){return Rn(n)?gs(n.__v_raw):!!(n&&n.__v_isReactive)}function Rn(n){return!!(n&&n.__v_isReadonly)}function mt(n){return!!(n&&n.__v_isShallow)}function qo(n){return n?!!n.__v_raw:!1}function le(n){const e=n&&n.__v_raw;return e?le(e):n}const it=n=>dt(n)?bu(n):n,vu=n=>dt(n)?dm(n):n;function st(n){return n?n.__v_isRef===!0:!1}function jo(n){return VE(n,!1)}function VE(n,e){return st(n)?n:new KE(n,e)}class KE{constructor(e,t){this.dep=new hu,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:le(e),this._value=t?e:it(e),this.__v_isShallow=t}get value(){return process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(e){const t=this._rawValue,r=this.__v_isShallow||mt(e)||Rn(e);e=r?e:le(e),or(e,t)&&(this._rawValue=e,this._value=r?e:it(e),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:e,oldValue:t}):this.dep.trigger())}}function B(n){return st(n)?n.value:n}class GE{constructor(e,t,r){this._object=e,this._key=t,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return CE(le(this._object),this._key)}}class JE{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function yi(n,e,t){return st(n)?n:Ye(n)?new JE(n):dt(n)&&arguments.length>1?qE(n,e,t):jo(n)}function qE(n,e,t){const r=n[e];return st(r)?r:new GE(n,e,t)}class jE{constructor(e,t,r){this.fn=e,this.setter=t,this._value=void 0,this.dep=new hu(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ds-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&ye!==this)return Qp(this,!0),!0;process.env.NODE_ENV}get value(){const e=process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return nm(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter?this.setter(e):process.env.NODE_ENV!=="production"&&On("Write operation failed: computed value is readonly")}}function YE(n,e,t=!1){let r,i;Ye(n)?r=n:(r=n.get,i=n.set);const o=new jE(r,i,t);return process.env.NODE_ENV,o}const Yo={},Xo=new WeakMap;let zr;function XE(n,e=!1,t=zr){if(t){let r=Xo.get(t);r||Xo.set(t,r=[]),r.push(n)}else process.env.NODE_ENV!=="production"&&!e&&On("onWatcherCleanup() was called when there was no active watcher to associate with.")}function ZE(n,e,t=cs){const{immediate:r,deep:i,once:o,scheduler:a,augmentJob:c,call:f}=t,h=$=>{(t.onWarn||On)("Invalid watch source: ",$,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},m=$=>i?$:mt($)||i===!1||i===0?ar($,1):ar($);let p,g,b,S,E=!1,C=!1;if(st(n)?(g=()=>n.value,E=mt(n)):gs(n)?(g=()=>m(n),E=!0):Le(n)?(C=!0,E=n.some($=>gs($)||mt($)),g=()=>n.map($=>{if(st($))return $.value;if(gs($))return m($);if(Ye($))return f?f($,2):$();process.env.NODE_ENV!=="production"&&h($)})):Ye(n)?e?g=f?()=>f(n,2):n:g=()=>{if(b){Uo();try{b()}finally{Vo()}}const $=zr;zr=p;try{return f?f(n,3,[S]):n(S)}finally{zr=$}}:(g=pi,process.env.NODE_ENV!=="production"&&h(n)),e&&i){const $=g,U=i===!0?1/0:i;g=()=>ar($(),U)}const M=()=>{p.stop()};if(o&&e){const $=e;e=(...U)=>{$(...U),M()}}let P=C?new Array(n.length).fill(Yo):Yo;const F=$=>{if(!(!(p.flags&1)||!p.dirty&&!$))if(e){const U=p.run();if(i||E||(C?U.some((ue,he)=>or(ue,P[he])):or(U,P))){b&&b();const ue=zr;zr=p;try{const he=[U,P===Yo?void 0:C&&P[0]===Yo?[]:P,S];f?f(e,3,he):e(...he),P=U}finally{zr=ue}}}else p.run()};return c&&c(F),p=new kE(g),p.scheduler=a?()=>a(F,!1):F,S=$=>XE($,!1,p),b=p.onStop=()=>{const $=Xo.get(p);if($){if(f)f($,4);else for(const U of $)U();Xo.delete(p)}},process.env.NODE_ENV!=="production"&&(p.onTrack=t.onTrack,p.onTrigger=t.onTrigger),e?r?F(!0):P=p.run():a?a(F.bind(null,!0),!0):p.run(),M.pause=p.pause.bind(p),M.resume=p.resume.bind(p),M.stop=M,M}function ar(n,e=1/0,t){if(e<=0||!dt(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,st(n))ar(n.value,e,t);else if(Le(n))for(let r=0;r<n.length;r++)ar(n[r],e,t);else if(pE(n)||mi(n))n.forEach(r=>{ar(r,e,t)});else if(yE(n)){for(const r in n)ar(n[r],e,t);for(const r of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,r)&&ar(n[r],e,t)}return n}const Br=[];function QE(n){Br.push(n)}function ek(){Br.pop()}let wu=!1;function ot(n,...e){if(wu)return;wu=!0,Uo();const t=Br.length?Br[Br.length-1].component:null,r=t&&t.appContext.config.warnHandler,i=tk();if(r)Zo(r,t,11,[n+e.map(o=>{var a,c;return(c=(a=o.toString)==null?void 0:a.call(o))!=null?c:JSON.stringify(o)}).join(""),t&&t.proxy,i.map(({vnode:o})=>`at <${Nm(t,o.type)}>`).join(`
2
2
  `),i]);else{const o=[`[Vue warn]: ${n}`,...e];i.length&&o.push(`
3
- `,...tk(i)),console.warn(...o)}Vo(),wu=!1}function ek(){let n=Br[Br.length-1];if(!n)return[];const e=[];for(;n;){const t=e[0];t&&t.vnode===n?t.recurseCount++:e.push({vnode:n,recurseCount:0});const r=n.component&&n.component.parent;n=r&&r.vnode}return e}function tk(n){const e=[];return n.forEach((t,r)=>{e.push(...r===0?[]:[`
4
- `],...nk(t))}),e}function nk({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",r=n.component?n.component.parent==null:!1,i=` at <${Nm(n.component,n.type,r)}`,o=">"+t;return n.props?[i,...rk(n.props),o]:[i+o]}function rk(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(r=>{e.push(...mm(r,n[r]))}),t.length>3&&e.push(" ..."),e}function mm(n,e,t){return In(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:st(e)?(e=mm(n,le(e.value),!0),t?e:[`${n}=Ref<`,e,">"]):Ye(e)?[`${n}=fn${e.name?`<${e.name}>`:""}`]:(e=le(e),t?e:[`${n}=`,e])}const gm={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Zo(n,e,t,r){try{return r?n(...r):n()}catch(i){Su(i,e,t)}}function ym(n,e,t,r){if(Ye(n)){const i=Zo(n,e,t,r);return i&&pE(i)&&i.catch(o=>{Su(o,e,t)}),i}if(Le(n)){const i=[];for(let o=0;o<n.length;o++)i.push(ym(n[o],e,t,r));return i}else process.env.NODE_ENV!=="production"&&ot(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof n}`)}function Su(n,e,t,r=!0){const i=e?e.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:a}=e&&e.appContext.config||cs;if(e){let c=e.parent;const f=e.proxy,h=process.env.NODE_ENV!=="production"?gm[t]:`https://vuejs.org/error-reference/#runtime-${t}`;for(;c;){const m=c.ec;if(m){for(let p=0;p<m.length;p++)if(m[p](n,f,h)===!1)return}c=c.parent}if(o){Uo(),Zo(o,null,10,[n,f,h]),Vo();return}}ik(n,t,i,r,a)}function ik(n,e,t,r=!0,i=!1){if(process.env.NODE_ENV!=="production"){const o=gm[e];if(t&&ZE(t),ot(`Unhandled error${o?` during execution of ${o}`:""}`),t&&QE(),r)throw n;console.error(n)}else{if(i)throw n;console.error(n)}}const Ht=[];let Ln=-1;const bi=[];let cr=null,vi=0;const sk=Promise.resolve();let xu=null;const ok=100;function lk(n){let e=Ln+1,t=Ht.length;for(;e<t;){const r=e+t>>>1,i=Ht[r],o=ys(i);o<n||o===n&&i.flags&2?e=r+1:t=r}return e}function bm(n){if(!(n.flags&1)){const e=ys(n),t=Ht[Ht.length-1];!t||!(n.flags&2)&&e>=ys(t)?Ht.push(n):Ht.splice(lk(e),0,n),n.flags|=1,vm()}}function vm(){xu||(xu=sk.then(Sm))}function wm(n){Le(n)?bi.push(...n):cr&&n.id===-1?cr.splice(vi+1,0,n):n.flags&1||(bi.push(n),n.flags|=1),vm()}function ak(n){if(bi.length){const e=[...new Set(bi)].sort((t,r)=>ys(t)-ys(r));if(bi.length=0,cr){cr.push(...e);return}for(cr=e,process.env.NODE_ENV!=="production"&&(n=n||new Map),vi=0;vi<cr.length;vi++){const t=cr[vi];process.env.NODE_ENV!=="production"&&xm(n,t)||(t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2)}cr=null,vi=0}}const ys=n=>n.id==null?n.flags&2?-1:1/0:n.id;function Sm(n){process.env.NODE_ENV!=="production"&&(n=n||new Map);const e=process.env.NODE_ENV!=="production"?t=>xm(n,t):pi;try{for(Ln=0;Ln<Ht.length;Ln++){const t=Ht[Ln];if(t&&!(t.flags&8)){if(process.env.NODE_ENV!=="production"&&e(t))continue;t.flags&4&&(t.flags&=-2),Zo(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2)}}}finally{for(;Ln<Ht.length;Ln++){const t=Ht[Ln];t&&(t.flags&=-2)}Ln=-1,Ht.length=0,ak(n),xu=null,(Ht.length||bi.length)&&Sm(n)}}function xm(n,e){const t=n.get(e)||0;if(t>ok){const r=e.i,i=r&&Om(r.type);return Su(`Maximum recursive updates exceeded${i?` in component <${i}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return n.set(e,t+1),!1}const Eu=new Map;process.env.NODE_ENV!=="production"&&(Wo().__VUE_HMR_RUNTIME__={createRecord:ku(ck),rerender:ku(uk),reload:ku(fk)});const Qo=new Map;function ck(n,e){return Qo.has(n)?!1:(Qo.set(n,{initialDef:el(e),instances:new Set}),!0)}function el(n){return Rm(n)?n.__vccOpts:n}function uk(n,e){const t=Qo.get(n);t&&(t.initialDef.render=e,[...t.instances].forEach(r=>{e&&(r.render=e,el(r.type).render=e),r.renderCache=[],r.update()}))}function fk(n,e){const t=Qo.get(n);if(!t)return;e=el(e),Em(t.initialDef,e);const r=[...t.instances];for(let i=0;i<r.length;i++){const o=r[i],a=el(o.type);let c=Eu.get(a);c||(a!==t.initialDef&&Em(a,e),Eu.set(a,c=new Set)),c.add(o),o.appContext.propsCache.delete(o.type),o.appContext.emitsCache.delete(o.type),o.appContext.optionsCache.delete(o.type),o.ceReload?(c.add(o),o.ceReload(e.styles),c.delete(o)):o.parent?bm(()=>{o.parent.update(),c.delete(o)}):o.appContext.reload?o.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),o.root.ce&&o!==o.root&&o.root.ce._removeChildStyle(a)}wm(()=>{Eu.clear()})}function Em(n,e){sr(n,e);for(const t in n)t!=="__file"&&!(t in e)&&delete n[t]}function ku(n){return(e,t)=>{try{return n(e,t)}catch(r){console.error(r),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let wi,tl=[];function km(n,e){var t,r;wi=n,wi?(wi.enabled=!0,tl.forEach(({event:i,args:o})=>wi.emit(i,...o)),tl=[]):typeof window<"u"&&window.HTMLElement&&!((r=(t=window.navigator)==null?void 0:t.userAgent)!=null&&r.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(o=>{km(o,e)}),setTimeout(()=>{wi||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,tl=[])},3e3)):tl=[]}let Si=null,hk=null;const dk=n=>n.__isTeleport;function _m(n,e){n.shapeFlag&6&&n.component?(n.transition=e,_m(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}Wo().requestIdleCallback,Wo().cancelIdleCallback;const pk=Symbol.for("v-ndc"),mk={};process.env.NODE_ENV!=="production"&&(mk.ownKeys=n=>(ot("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(n)));let gk=null;function yk(n,e,t=!1){const r=il||Si;if(r||gk){const i=r?r.parent==null?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&n in i)return i[n];if(arguments.length>1)return t&&Ye(e)?e.call(r&&r.proxy):e;process.env.NODE_ENV!=="production"&&ot(`injection "${String(n)}" not found.`)}else process.env.NODE_ENV!=="production"&&ot("inject() can only be used inside setup() or functional components.")}const bk={},Tm=n=>Object.getPrototypeOf(n)===bk,vk=_k,wk=Symbol.for("v-scx"),Sk=()=>{{const n=yk(wk);return n||process.env.NODE_ENV!=="production"&&ot("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),n}};function xk(n,e,t){return process.env.NODE_ENV!=="production"&&!Ye(e)&&ot("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),Ek(n,e,t)}function Ek(n,e,t=cs){const{immediate:r,deep:i,flush:o,once:a}=t;process.env.NODE_ENV!=="production"&&!e&&(r!==void 0&&ot('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&ot('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),a!==void 0&&ot('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const c=sr({},t);process.env.NODE_ENV!=="production"&&(c.onWarn=ot);const f=e&&r||!e&&o!=="post";let h;if(sl){if(o==="sync"){const b=Sk();h=b.__watcherHandles||(b.__watcherHandles=[])}else if(!f){const b=()=>{};return b.stop=pi,b.resume=pi,b.pause=pi,b}}const m=il;c.call=(b,S,E)=>ym(b,m,S,E);let p=!1;o==="post"?c.scheduler=b=>{vk(b,m&&m.suspense)}:o!=="sync"&&(p=!0,c.scheduler=(b,S)=>{S?b():bm(b)}),c.augmentJob=b=>{e&&(b.flags|=4),p&&(b.flags|=2,m&&(b.id=m.uid,b.i=m))};const g=XE(n,e,c);return sl&&(h?h.push(g):f&&g()),g}const kk=n=>n.__isSuspense;function _k(n,e){e&&e.pendingBranch?Le(n)?e.effects.push(...n):e.effects.push(n):wm(n)}const Cm=Symbol.for("v-fgt"),Tk=Symbol.for("v-txt"),Ck=Symbol.for("v-cmt");function Mk(n){return n?n.__v_isVNode===!0:!1}const Ak=(...n)=>Am(...n),Mm=({key:n})=>n??null,nl=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?In(n)||st(n)||Ye(n)?{i:Si,r:n,k:e,f:!!t}:n:null);function Ik(n,e=null,t=null,r=0,i=null,o=n===Cm?0:1,a=!1,c=!1){const f={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&Mm(e),ref:e&&nl(e),scopeId:hk,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Si};return c?(_u(f,t),o&128&&n.normalize(f)):t&&(f.shapeFlag|=In(t)?8:16),process.env.NODE_ENV!=="production"&&f.key!==f.key&&ot("VNode created with invalid key (NaN). VNode type:",f.type),f}const Ok=process.env.NODE_ENV!=="production"?Ak:Am;function Am(n,e=null,t=null,r=0,i=null,o=!1){if((!n||n===pk)&&(process.env.NODE_ENV!=="production"&&!n&&ot(`Invalid vnode type when creating vnode: ${n}.`),n=Ck),Mk(n)){const c=rl(n,e,!0);return t&&_u(c,t),c.patchFlag=-2,c}if(Rm(n)&&(n=n.__vccOpts),e){e=Nk(e);let{class:c,style:f}=e;c&&!In(c)&&(e.class=ou(c)),dt(f)&&(qo(f)&&!Le(f)&&(f=sr({},f)),e.style=su(f))}const a=In(n)?1:kk(n)?128:dk(n)?64:dt(n)?4:Ye(n)?2:0;return process.env.NODE_ENV!=="production"&&a&4&&qo(n)&&(n=le(n),ot("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
5
- Component that was made reactive: `,n)),Ik(n,e,t,r,i,a,o,!0)}function Nk(n){return n?qo(n)||Tm(n)?sr({},n):n:null}function rl(n,e,t=!1,r=!1){const{props:i,ref:o,patchFlag:a,children:c,transition:f}=n,h=e?Lk(i||{},e):i,m={__v_isVNode:!0,__v_skip:!0,type:n.type,props:h,key:h&&Mm(h),ref:e&&e.ref?t&&o?Le(o)?o.concat(nl(e)):[o,nl(e)]:nl(e):o,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:process.env.NODE_ENV!=="production"&&a===-1&&Le(c)?c.map(Im):c,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==Cm?a===-1?16:a|16:a,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:f,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&rl(n.ssContent),ssFallback:n.ssFallback&&rl(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return f&&r&&_m(m,f.clone(m)),m}function Im(n){const e=rl(n);return Le(n.children)&&(e.children=n.children.map(Im)),e}function Rk(n=" ",e=0){return Ok(Tk,null,n,e)}function _u(n,e){let t=0;const{shapeFlag:r}=n;if(e==null)e=null;else if(Le(e))t=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),_u(n,i()),i._c&&(i._d=!0));return}else t=32,!e._&&!Tm(e)&&(e._ctx=Si);else Ye(e)?(e={default:e,_ctx:Si},t=32):(e=String(e),r&64?(t=16,e=[Rk(e)]):t=8);n.children=e,n.shapeFlag|=t}function Lk(...n){const e={};for(let t=0;t<n.length;t++){const r=n[t];for(const i in r)if(i==="class")e.class!==r.class&&(e.class=ou([e.class,r.class]));else if(i==="style")e.style=su([e.style,r.style]);else if(fE(i)){const o=e[i],a=r[i];a&&o!==a&&!(Le(o)&&o.includes(a))&&(e[i]=o?[].concat(o,a):a)}else i!==""&&(e[i]=r[i])}return e}let il=null;const Pk=()=>il||Si;{const n=Wo(),e=(t,r)=>{let i;return(i=n[t])||(i=n[t]=[]),i.push(r),o=>{i.length>1?i.forEach(a=>a(o)):i[0](o)}};e("__VUE_INSTANCE_SETTERS__",t=>il=t),e("__VUE_SSR_SETTERS__",t=>sl=t)}let sl=!1;process.env.NODE_ENV;const Dk=/(?:^|[-_])(\w)/g,Bk=n=>n.replace(Dk,e=>e.toUpperCase()).replace(/[-_]/g,"");function Om(n,e=!0){return Ye(n)?n.displayName||n.name:n.name||e&&n.__name}function Nm(n,e,t=!1){let r=Om(e);if(!r&&e.__file){const i=e.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&n&&n.parent){const i=o=>{for(const a in o)if(o[a]===e)return a};r=i(n.components||n.parent.type.components)||i(n.appContext.components)}return r?Bk(r):t?"App":"Anonymous"}function Rm(n){return Ye(n)&&"__vccOpts"in n}const de=(n,e)=>{const t=jE(n,e,sl);if(process.env.NODE_ENV!=="production"){const r=Pk();r&&r.appContext.config.warnRecursiveComputed&&(t._warnRecursive=!0)}return t};function zk(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const n={style:"color:#3ba776"},e={style:"color:#1677ff"},t={style:"color:#f5222d"},r={style:"color:#eb2f96"},i={__vue_custom_formatter:!0,header(p){return dt(p)?p.__isVue?["div",n,"VueInstance"]:st(p)?["div",{},["span",n,m(p)],"<",c("_value"in p?p._value:p),">"]:gs(p)?["div",{},["span",n,mt(p)?"ShallowReactive":"Reactive"],"<",c(p),`>${Rn(p)?" (readonly)":""}`]:Rn(p)?["div",{},["span",n,mt(p)?"ShallowReadonly":"Readonly"],"<",c(p),">"]:null:null},hasBody(p){return p&&p.__isVue},body(p){if(p&&p.__isVue)return["div",{},...o(p.$)]}};function o(p){const g=[];p.type.props&&p.props&&g.push(a("props",le(p.props))),p.setupState!==cs&&g.push(a("setup",p.setupState)),p.data!==cs&&g.push(a("data",le(p.data)));const b=f(p,"computed");b&&g.push(a("computed",b));const S=f(p,"inject");return S&&g.push(a("injected",S)),g.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:p}]]),g}function a(p,g){return g=sr({},g),Object.keys(g).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},p],["div",{style:"padding-left:1.25em"},...Object.keys(g).map(b=>["div",{},["span",r,b+": "],c(g[b],!1)])]]:["span",{}]}function c(p,g=!0){return typeof p=="number"?["span",e,p]:typeof p=="string"?["span",t,JSON.stringify(p)]:typeof p=="boolean"?["span",r,p]:dt(p)?["object",{object:g?le(p):p}]:["span",t,String(p)]}function f(p,g){const b=p.type;if(Ye(b))return;const S={};for(const E in p.ctx)h(b,E,g)&&(S[E]=p.ctx[E]);return S}function h(p,g,b){const S=p[b];if(Le(S)&&S.includes(g)||dt(S)&&g in S||p.extends&&h(p.extends,g,b)||p.mixins&&p.mixins.some(E=>h(E,g,b)))return!0}function m(p){return mt(p)?"ShallowRef":p.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(i):window.devtoolsFormatters=[i]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function Fk(){zk()}process.env.NODE_ENV!=="production"&&Fk();function Xe(n){this.content=n}Xe.prototype={constructor:Xe,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new Xe(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Xe(t)},addToStart:function(n,e){return new Xe([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Xe(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new Xe(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Xe.from(n),n.size?new Xe(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Xe.from(n),n.size?new Xe(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Xe.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}},Xe.from=function(n){if(n instanceof Xe)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Xe(e)};function Lm(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)t++;return t}if(i.content.size||o.content.size){let a=Lm(i.content,o.content,t+1);if(a!=null)return a}t+=i.nodeSize}}function Pm(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let a=n.child(--i),c=e.child(--o),f=a.nodeSize;if(a==c){t-=f,r-=f;continue}if(!a.sameMarkup(c))return{a:t,b:r};if(a.isText&&a.text!=c.text){let h=0,m=Math.min(a.text.length,c.text.length);for(;h<m&&a.text[a.text.length-h-1]==c.text[c.text.length-h-1];)h++,t--,r--;return{a:t,b:r}}if(a.content.size||c.content.size){let h=Pm(a.content,c.content,t-1,r-1);if(h)return h}t-=f,r-=f}}class L{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let a=0,c=0;c<t;a++){let f=this.content[a],h=c+f.nodeSize;if(h>e&&r(f,i+c,o||null,a)!==!1&&f.content.size){let m=c+1;f.nodesBetween(Math.max(0,e-m),Math.min(f.content.size,t-m),r,i+m)}c=h}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",a=!0;return this.nodesBetween(e,t,(c,f)=>{let h=c.isText?c.text.slice(Math.max(e,f)-f,t-f):c.isLeaf?i?typeof i=="function"?i(c):i:c.type.spec.leafText?c.type.spec.leafText(c):"":"";c.isBlock&&(c.isLeaf&&h||c.isTextblock)&&r&&(a?a=!1:o+=r),o+=h},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new L(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,a=0;a<t;o++){let c=this.content[o],f=a+c.nodeSize;f>e&&((a<e||f>t)&&(c.isText?c=c.cut(Math.max(0,e-a),Math.min(c.text.length,t-a)):c=c.cut(Math.max(0,e-a-1),Math.min(c.content.size,t-a-1))),r.push(c),i+=c.nodeSize),a=f}return new L(r,i)}cutByIndex(e,t){return e==t?L.empty:e==0&&t==this.content.length?this:new L(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new L(i,o)}addToStart(e){return new L([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new L(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return Lm(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Pm(this,e,t,r)}findIndex(e,t=-1){if(e==0)return ol(0,e);if(e==this.size)return ol(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=e)return a==e||t>0?ol(r+1,a):ol(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return L.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new L(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return L.empty;let t,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new L(t||e,r)}static from(e){if(!e)return L.empty;if(e instanceof L)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new L([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}L.empty=new L([],0);const Tu={index:0,offset:0};function ol(n,e){return Tu.index=n,Tu.offset=e,Tu}function ll(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!ll(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!ll(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let _e=class fh{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ll(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=r.create(t.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return fh.none;if(e instanceof fh)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};_e.none=[];class al extends Error{}class W{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Bm(this.content,e+this.openStart,t);return r&&new W(r,this.openStart,this.openEnd)}removeBetween(e,t){return new W(Dm(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return W.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new W(L.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new W(e,r,i)}}W.empty=new W(L.empty,0,0);function Dm(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:a,offset:c}=n.findIndex(t);if(i==e||o.isText){if(c!=t&&!n.child(a).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=a)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(Dm(o.content,e-i-1,t-i-1)))}function Bm(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),a=n.maybeChild(i);if(o==e||a.isText)return n.cut(0,e).append(t).append(n.cut(e));let c=Bm(a.content,e-o-1,t);return c&&n.replaceChild(i,a.copy(c))}function Hk(n,e,t){if(t.openStart>n.depth)throw new al("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new al("Inconsistent open depths");return zm(n,e,t,0)}function zm(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let a=zm(n,e,t,r+1);return o.copy(o.content.replaceChild(i,a))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let a=n.parent,c=a.content;return Fr(a,c.cut(0,n.parentOffset).append(t.content).append(c.cut(e.parentOffset)))}else{let{start:a,end:c}=$k(t,n);return Fr(o,Hm(n,a,c,e,r))}else return Fr(o,cl(n,e,r))}function Fm(n,e){if(!e.type.compatibleContent(n.type))throw new al("Cannot join "+e.type.name+" onto "+n.type.name)}function Cu(n,e,t){let r=n.node(t);return Fm(r,e.node(t)),r}function zr(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function bs(n,e,t,r){let i=(e||n).node(t),o=0,a=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(zr(n.nodeAfter,r),o++));for(let c=o;c<a;c++)zr(i.child(c),r);e&&e.depth==t&&e.textOffset&&zr(e.nodeBefore,r)}function Fr(n,e){return n.type.checkContent(e),n.copy(e)}function Hm(n,e,t,r,i){let o=n.depth>i&&Cu(n,e,i+1),a=r.depth>i&&Cu(t,r,i+1),c=[];return bs(null,n,i,c),o&&a&&e.index(i)==t.index(i)?(Fm(o,a),zr(Fr(o,Hm(n,e,t,r,i+1)),c)):(o&&zr(Fr(o,cl(n,e,i+1)),c),bs(e,t,i,c),a&&zr(Fr(a,cl(t,r,i+1)),c)),bs(r,null,i,c),new L(c)}function cl(n,e,t){let r=[];if(bs(null,n,t,r),n.depth>t){let i=Cu(n,e,t+1);zr(Fr(i,cl(n,e,t+1)),r)}return bs(e,null,t,r),new L(r)}function $k(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(L.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class Vs{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.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,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return _e.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let c=r;r=i,i=c}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new ul(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let a=e;;){let{index:c,offset:f}=a.content.findIndex(o),h=o-f;if(r.push(a,c,i+f),!h||(a=a.child(c),a.isText))break;o=h-1,i+=f+1}return new Vs(t,r,o)}static resolveCached(e,t){let r=$m.get(e);if(r)for(let o=0;o<r.elts.length;o++){let a=r.elts[o];if(a.pos==t)return a}else $m.set(e,r=new Wk);let i=r.elts[r.i]=Vs.resolve(e,t);return r.i=(r.i+1)%Uk,i}}class Wk{constructor(){this.elts=[],this.i=0}}const Uk=12,$m=new WeakMap;class ul{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Vk=Object.create(null);let ur=class hh{constructor(e,t,r,i=_e.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||L.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&ll(this.attrs,t||e.defaultAttrs||Vk)&&_e.sameSet(this.marks,r||_e.none)}copy(e=null){return e==this.content?this:new hh(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new hh(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return W.empty;let i=this.resolve(e),o=this.resolve(t),a=r?0:i.sharedDepth(t),c=i.start(a),h=i.node(a).content.cut(i.pos-c,o.pos-c);return new W(h,i.depth-a,o.depth-a)}replace(e,t,r){return Hk(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return Vs.resolveCached(this,e)}resolveNoCache(e){return Vs.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}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()+")"),Wm(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=L.empty,i=0,o=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,o),c=a&&a.matchFragment(this.content,t);if(!c||!c.validEnd)return!1;for(let f=i;f<o;f++)if(!this.type.allowsMarks(r.child(f).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),a=o&&o.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=_e.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!_e.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=L.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};ur.prototype.text=void 0;class Ma extends ur{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Wm(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Ma(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ma(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Wm(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Yr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Kk(e,t);if(r.next==null)return Yr.empty;let i=Um(r);r.next&&r.err("Unexpected trailing text");let o=Zk(Xk(i));return Qk(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let o=t;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}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:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function o(a,c){let f=a.matchFragment(e,r);if(f&&(!t||f.validEnd))return L.from(c.map(h=>h.createAndFill()));for(let h=0;h<a.next.length;h++){let{type:m,next:p}=a.next[h];if(!(m.isText||m.hasRequiredAttrs())&&i.indexOf(p)==-1){i.push(p);let g=o(p,c.concat(m));if(g)return g}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let a=[];for(let c=i;c.type;c=c.via)a.push(c.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:c,next:f}=o.next[a];!c.isLeaf&&!c.hasRequiredAttrs()&&!(c.name in t)&&(!i.type||f.validEnd)&&(r.push({match:c.contentMatch,type:c,via:i}),t[c.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 t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return o}).join(`
6
- `)}}Yr.empty=new Yr(!0);class Kk{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Um(n){let e=[];do e.push(Gk(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Gk(n){let e=[];do e.push(Jk(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Jk(n){let e=Yk(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=qk(n,e);else break;return e}function Vm(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function qk(n,e){let t=Vm(n),r=t;return n.eat(",")&&(n.next!="}"?r=Vm(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function jk(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let a=t[o];a.isInGroup(e)&&i.push(a)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function Yk(n){if(n.eat("(")){let e=Um(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=jk(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Xk(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(a,c,f){let h={term:f,to:c};return e[a].push(h),h}function i(a,c){a.forEach(f=>f.to=c)}function o(a,c){if(a.type=="choice")return a.exprs.reduce((f,h)=>f.concat(o(h,c)),[]);if(a.type=="seq")for(let f=0;;f++){let h=o(a.exprs[f],c);if(f==a.exprs.length-1)return h;i(h,c=t())}else if(a.type=="star"){let f=t();return r(c,f),i(o(a.expr,f),f),[r(f)]}else if(a.type=="plus"){let f=t();return i(o(a.expr,c),f),i(o(a.expr,f),f),[r(f)]}else{if(a.type=="opt")return[r(c)].concat(o(a.expr,c));if(a.type=="range"){let f=c;for(let h=0;h<a.min;h++){let m=t();i(o(a.expr,f),m),f=m}if(a.max==-1)i(o(a.expr,f),f);else for(let h=a.min;h<a.max;h++){let m=t();r(f,m),i(o(a.expr,f),m),f=m}return[r(f)]}else{if(a.type=="name")return[r(c,void 0,a.value)];throw new Error("Unknown expr type")}}}}function Km(n,e){return e-n}function Gm(n,e){let t=[];return r(e),t.sort(Km);function r(i){let o=n[i];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(i);for(let a=0;a<o.length;a++){let{term:c,to:f}=o[a];!c&&t.indexOf(f)==-1&&r(f)}}}function Zk(n){let e=Object.create(null);return t(Gm(n,0));function t(r){let i=[];r.forEach(a=>{n[a].forEach(({term:c,to:f})=>{if(!c)return;let h;for(let m=0;m<i.length;m++)i[m][0]==c&&(h=i[m][1]);Gm(n,f).forEach(m=>{h||i.push([c,h=[]]),h.indexOf(m)==-1&&h.push(m)})})});let o=e[r.join(",")]=new Yr(r.indexOf(n.length-1)>-1);for(let a=0;a<i.length;a++){let c=i[a][1].sort(Km);o.next.push({type:i[a][0],next:e[c.join(",")]||t(c)})}return o}}function Qk(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],o=!i.validEnd,a=[];for(let c=0;c<i.next.length;c++){let{type:f,next:h}=i.next[c];a.push(f.name),o&&!(f.isText||f.hasRequiredAttrs())&&(o=!1),r.indexOf(h)==-1&&r.push(h)}o&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Jm(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function qm(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let o=n[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=i}return t}function jm(n,e,t,r){for(let i in e)if(!(i in n))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${i}`);for(let i in n){let o=n[i];o.validate&&o.validate(e[i])}}function Ym(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new t_(n,r,e[r]);return t}let Xm=class Ey{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Ym(e,r.attrs),this.defaultAttrs=Jm(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Yr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:qm(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ur(this,this.computeAttrs(e),L.from(t),_e.setFrom(r))}createChecked(e=null,t,r){return t=L.from(t),this.checkContent(t),new ur(this,this.computeAttrs(e),t,_e.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=L.from(t),t.size){let a=this.contentMatch.fillBefore(t);if(!a)return null;t=a.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(L.empty,!0);return o?new ur(this,e,t.append(o),_e.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){jm(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:_e.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,a)=>r[o]=new Ey(o,t,a));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function e_(n,e,t){let r=t.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${o}`)}}class t_{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?e_(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Aa{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Ym(e,i.attrs),this.excluded=null;let o=Jm(this.attrs);this.instance=o?new _e(this,o):null}create(e=null){return!e&&this.instance?this.instance:new _e(this,qm(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,a)=>r[o]=new Aa(o,i++,t,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){jm(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Zm{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Xe.from(e.nodes),t.marks=Xe.from(e.marks||{}),this.nodes=Xm.compile(this.spec.nodes,this),this.marks=Aa.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",c=o.spec.marks;if(o.contentMatch=r[a]||(r[a]=Yr.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=c=="_"?null:c?Qm(this,c.split(" ")):c==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:Qm(this,a.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,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Xm){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(t,r,i)}text(e,t){let r=this.nodes.text;return new Ma(r,r.defaultAttrs,e,_e.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return ur.fromJSON(this,e)}markFromJSON(e){return _e.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Qm(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],o=n.marks[i],a=o;if(o)t.push(o);else for(let c in n.marks){let f=n.marks[c];(i=="_"||f.spec.group&&f.spec.group.split(" ").indexOf(i)>-1)&&t.push(a=f)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function n_(n){return n.tag!=null}function r_(n){return n.style!=null}let vs=class dh{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(n_(i))this.tags.push(i);else if(r_(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,t={}){let r=new rg(this,t,!1);return r.addAll(e,_e.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new rg(this,t,!0);return r.addAll(e,_e.none,t.from,t.to),W.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(o_(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(e);if(a===!1)continue;o.attrs=a||void 0}return o}}}matchStyle(e,t,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],c=a.style;if(!(c.indexOf(e)!=0||a.context&&!r.matchesContext(a.context)||c.length>e.length&&(c.charCodeAt(e.length)!=61||c.slice(e.length+1)!=t))){if(a.getAttrs){let f=a.getAttrs(t);if(f===!1)continue;a.attrs=f||void 0}return a}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,a=0;for(;a<t.length;a++){let c=t[a];if((c.priority==null?50:c.priority)<o)break}t.splice(a,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(a=>{r(a=ig(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=ig(a)),a.node||a.ignore||a.mark||(a.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new dh(e,dh.schemaRules(e)))}};const eg={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},i_={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},tg={ol:!0,ul:!0},ws=1,Mu=2,fl=4;function ng(n,e,t){return e!=null?(e?ws:0)|(e==="full"?Mu:0):n&&n.whitespace=="pre"?ws|Mu:t&-5}class hl{constructor(e,t,r,i,o,a){this.type=e,this.attrs=t,this.marks=r,this.solid=i,this.options=a,this.content=[],this.activeMarks=_e.none,this.match=o||(a&fl?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(L.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ws)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let t=L.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(L.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!eg.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class rg{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=t.topNode,o,a=ng(null,t.preserveWhitespace,0)|(r?fl:0);i?o=new hl(i.type,i.attrs,_e.none,!0,t.topMatch||i.type.contentMatch,a):r?o=new hl(null,null,_e.none,!0,null,a):o=new hl(e.schema.topNodeType,null,_e.none,!0,null,a),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,i=this.top,o=i.options&Mu?"full":this.localPreserveWS||(i.options&ws)>0;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)o!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
7
- `);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],c=e.previousSibling;(!a||c&&c.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),t),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let i=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),c;tg.hasOwnProperty(a)&&this.parser.normalizeLists&&s_(e);let f=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(c=this.parser.matchTag(e,this,r));e:if(f?f.ignore:i_.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!f||f.skip||f.closeParent){f&&f.closeParent?this.open=Math.max(0,this.open-1):f&&f.skip.nodeType&&(e=f.skip);let h,m=this.needsBlock;if(eg.hasOwnProperty(a))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),h=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let p=f&&f.skip?t:this.readStyles(e,t);p&&this.addAll(e,p),h&&this.sync(o),this.needsBlock=m}else{let h=this.readStyles(e,t);h&&this.addElementByRule(e,f,h,f.consuming===!1?c:void 0)}this.localPreserveWS=i}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
8
- `),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],a=r.getPropertyValue(o);if(a)for(let c=void 0;;){let f=this.parser.matchStyle(o,a,this,c);if(!f)break;if(f.ignore)return null;if(f.clearMark?t=t.filter(h=>!f.clearMark(h)):t=t.concat(this.parser.schema.marks[f.mark].create(f.attrs)),f.consuming===!1)c=f;else break}}return t}addElementByRule(e,t,r,i){let o,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),r)||this.leafFallback(e,r);else{let f=this.enter(a,t.attrs||null,r,t.preserveWhitespace);f&&(o=!0,r=f)}else{let f=this.parser.schema.marks[t.mark];r=r.concat(f.create(t.attrs))}let c=this.top;if(a&&a.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(f=>this.insertNode(f,r));else{let f=e;typeof t.contentElement=="string"?f=e.querySelector(t.contentElement):typeof t.contentElement=="function"?f=t.contentElement(e):t.contentElement&&(f=t.contentElement),this.findAround(e,f,!0),this.addAll(f,r),this.findAround(e,f,!1)}o&&this.sync(c)&&this.open--}addAll(e,t,r,i){let o=r||0;for(let a=r?e.childNodes[r]:e.firstChild,c=i==null?null:e.childNodes[i];a!=c;a=a.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(a,t);this.findAtPoint(e,o)}findPlace(e,t){let r,i;for(let o=this.open;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!r||r.length>c.length)&&(r=c,i=a,!c.length)||a.solid)break}if(!r)return null;this.sync(i);for(let o=0;o<r.length;o++)t=this.enterInner(r[o],null,t,!1);return t}insertNode(e,t){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(t=this.enterInner(i,null,t))}let r=this.findPlace(e,t);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=_e.none;for(let a of r.concat(e.marks))(i.type?i.type.allowsMarkType(a.type):sg(a.type,e.type))&&(o=a.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,t,r,i){let o=this.findPlace(e.create(t),r);return o&&(o=this.enterInner(e,t,r,!0,i)),o}enterInner(e,t,r,i=!1,o){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let c=ng(e,o,a.options);a.options&fl&&a.content.length==0&&(c|=fl);let f=_e.none;return r=r.filter(h=>(a.type?a.type.allowsMarkType(h.type):sg(h.type,e))?(f=h.addToSet(f),!1):!0),this.nodes.push(new hl(e,t,f,i,null,c)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=ws)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(c,f)=>{for(;c>=0;c--){let h=t[c];if(h==""){if(c==t.length-1||c==0)continue;for(;f>=o;f--)if(a(c-1,f))return!0;return!1}else{let m=f>0||f==0&&i?this.nodes[f].type:r&&f>=o?r.node(f-o).type:null;if(!m||m.name!=h&&!m.isInGroup(h))return!1;f--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function s_(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&tg.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function o_(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function ig(n){let e={};for(let t in n)e[t]=n[t];return e}function sg(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],a=c=>{o.push(c);for(let f=0;f<c.edgeCount;f++){let{type:h,next:m}=c.edge(f);if(h==e||o.indexOf(m)<0&&a(m))return!0}};if(a(i.contentMatch))return!0}}class Us{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Au(t).createDocumentFragment());let i=r,o=[];return e.forEach(a=>{if(o.length||a.marks.length){let c=0,f=0;for(;c<o.length&&f<a.marks.length;){let h=a.marks[f];if(!this.marks[h.type.name]){f++;continue}if(!h.eq(o[c][0])||h.type.spec.spanning===!1)break;c++,f++}for(;c<o.length;)i=o.pop()[1];for(;f<a.marks.length;){let h=a.marks[f++],m=this.serializeMark(h,a.isInline,t);m&&(o.push([h,i]),i.appendChild(m.dom),i=m.contentDOM||m.dom)}}i.appendChild(this.serializeNodeInner(a,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=dl(Au(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&dl(Au(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return dl(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Us(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=og(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return og(e.marks)}}function og(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Au(n){return n.document||window.document}const lg=new WeakMap;function l_(n){let e=lg.get(n);return e===void 0&&lg.set(n,e=a_(n)),e}function a_(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)t(r[i]);else for(let i in r)t(r[i])}return t(n),e}function dl(n,e,t,r){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=l_(r))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=i.indexOf(" ");a>0&&(t=i.slice(0,a),i=i.slice(a+1));let c,f=t?n.createElementNS(t,i):n.createElement(i),h=e[1],m=1;if(h&&typeof h=="object"&&h.nodeType==null&&!Array.isArray(h)){m=2;for(let p in h)if(h[p]!=null){let g=p.indexOf(" ");g>0?f.setAttributeNS(p.slice(0,g),p.slice(g+1),h[p]):f.setAttribute(p,h[p])}}for(let p=m;p<e.length;p++){let g=e[p];if(g===0){if(p<e.length-1||p>m)throw new RangeError("Content hole must be the only child of its parent node");return{dom:f,contentDOM:f}}else{let{dom:b,contentDOM:S}=dl(n,g,t,r);if(f.appendChild(b),S){if(c)throw new RangeError("Multiple content holes");c=S}}}return{dom:f,contentDOM:c}}const ag=65535,cg=Math.pow(2,16);function c_(n,e){return n+e*cg}function ug(n){return n&ag}function u_(n){return(n-(n&ag))/cg}const fg=1,hg=2,pl=4,dg=8;class Iu{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&dg)>0}get deletedBefore(){return(this.delInfo&(fg|pl))>0}get deletedAfter(){return(this.delInfo&(hg|pl))>0}get deletedAcross(){return(this.delInfo&pl)>0}}class It{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&It.empty)return It.empty}recover(e){let t=0,r=ug(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+u_(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let c=0;c<this.ranges.length;c+=3){let f=this.ranges[c]-(this.inverted?i:0);if(f>e)break;let h=this.ranges[c+o],m=this.ranges[c+a],p=f+h;if(e<=p){let g=h?e==f?-1:e==p?1:t:t,b=f+i+(g<0?0:m);if(r)return b;let S=e==(t<0?f:p)?null:c_(c/3,e-f),E=e==f?hg:e==p?fg:pl;return(t<0?e!=f:e!=p)&&(E|=dg),new Iu(b,E,S)}i+=m-h}return r?e+i:new Iu(e+i,0,null)}touches(e,t){let r=0,i=ug(t),o=this.inverted?2:1,a=this.inverted?1:2;for(let c=0;c<this.ranges.length;c+=3){let f=this.ranges[c]-(this.inverted?r:0);if(f>e)break;let h=this.ranges[c+o],m=f+h;if(e<=m&&c==i*3)return!0;r+=this.ranges[c+a]-h}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],c=a-(this.inverted?o:0),f=a+(this.inverted?0:o),h=this.ranges[i+t],m=this.ranges[i+r];e(c,c+h,f,f+m),o+=m-h}}invert(){return new It(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?It.empty:new It(e<0?[0,-e,0]:[0,0,e])}}It.empty=new It([]);class Bi{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new Bi(this.maps,this.mirror,e,t)}copy(){return new Bi(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new Bi;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o],c=a.mapResult(e,t);if(c.recover!=null){let f=this.getMirror(o);if(f!=null&&f>o&&f<this.to){o=f,e=this.maps[f].recover(c.recover);continue}}i|=c.delInfo,e=c.pos}return r?e:new Iu(e,i,null)}}const Ou=Object.create(null);class $e{getMap(){return It.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Ou[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Ou)throw new RangeError("Duplicate use of step JSON ID "+e);return Ou[e]=t,t.prototype.jsonID=e,t}}class Re{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Re(e,null)}static fail(e){return new Re(null,e)}static fromReplace(e,t,r,i){try{return Re.ok(e.replace(t,r,i))}catch(o){if(o instanceof al)return Re.fail(o.message);throw o}}}function Nu(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(Nu(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return L.fromArray(r)}class kr extends $e{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new W(Nu(t.content,(a,c)=>!a.isAtom||!c.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),t.openStart,t.openEnd);return Re.fromReplace(e,this.from,this.to,o)}invert(){return new yn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new kr(t.pos,r.pos,this.mark)}merge(e){return e instanceof kr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new kr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new kr(t.from,t.to,e.markFromJSON(t.mark))}}$e.jsonID("addMark",kr);class yn extends $e{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new W(Nu(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Re.fromReplace(e,this.from,this.to,r)}invert(){return new kr(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new yn(t.pos,r.pos,this.mark)}merge(e){return e instanceof yn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new yn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new yn(t.from,t.to,e.markFromJSON(t.mark))}}$e.jsonID("removeMark",yn);class _r extends $e{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Re.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Re.fromReplace(e,this.pos,this.pos+1,new W(L.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new _r(this.pos,t.marks[i]);return new _r(this.pos,this.mark)}}return new zi(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new _r(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new _r(t.pos,e.markFromJSON(t.mark))}}$e.jsonID("addNodeMark",_r);class zi extends $e{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Re.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Re.fromReplace(e,this.pos,this.pos+1,new W(L.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new _r(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new zi(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new zi(t.pos,e.markFromJSON(t.mark))}}$e.jsonID("removeNodeMark",zi);class Ge extends $e{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&Ru(e,this.from,this.to)?Re.fail("Structure replace would overwrite content"):Re.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new It([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ge(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new Ge(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Ge)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?W.empty:new W(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ge(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?W.empty:new W(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ge(e.from,this.to,t,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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ge(t.from,t.to,W.fromJSON(e,t.slice),!!t.structure)}}$e.jsonID("replace",Ge);class Ke extends $e{constructor(e,t,r,i,o,a,c=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=c}apply(e){if(this.structure&&(Ru(e,this.from,this.gapFrom)||Ru(e,this.gapTo,this.to)))return Re.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Re.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?Re.fromReplace(e,this.from,this.to,r):Re.fail("Content does not fit in gap")}getMap(){return new It([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Ke(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new Ke(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ke(t.from,t.to,t.gapFrom,t.gapTo,W.fromJSON(e,t.slice),t.insert,!!t.structure)}}$e.jsonID("replaceAround",Ke);function Ru(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function f_(n,e,t,r){let i=[],o=[],a,c;n.doc.nodesBetween(e,t,(f,h,m)=>{if(!f.isInline)return;let p=f.marks;if(!r.isInSet(p)&&m.type.allowsMarkType(r.type)){let g=Math.max(h,e),b=Math.min(h+f.nodeSize,t),S=r.addToSet(p);for(let E=0;E<p.length;E++)p[E].isInSet(S)||(a&&a.to==g&&a.mark.eq(p[E])?a.to=b:i.push(a=new yn(g,b,p[E])));c&&c.to==g?c.to=b:o.push(c=new kr(g,b,r))}}),i.forEach(f=>n.step(f)),o.forEach(f=>n.step(f))}function h_(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(a,c)=>{if(!a.isInline)return;o++;let f=null;if(r instanceof Aa){let h=a.marks,m;for(;m=r.isInSet(h);)(f||(f=[])).push(m),h=m.removeFromSet(h)}else r?r.isInSet(a.marks)&&(f=[r]):f=a.marks;if(f&&f.length){let h=Math.min(c+a.nodeSize,t);for(let m=0;m<f.length;m++){let p=f[m],g;for(let b=0;b<i.length;b++){let S=i[b];S.step==o-1&&p.eq(i[b].style)&&(g=S)}g?(g.to=h,g.step=o):i.push({style:p,from:Math.max(c,e),to:h,step:o})}}}),i.forEach(a=>n.step(new yn(a.from,a.to,a.style)))}function Lu(n,e,t,r=t.contentMatch,i=!0){let o=n.doc.nodeAt(e),a=[],c=e+1;for(let f=0;f<o.childCount;f++){let h=o.child(f),m=c+h.nodeSize,p=r.matchType(h.type);if(!p)a.push(new Ge(c,m,W.empty));else{r=p;for(let g=0;g<h.marks.length;g++)t.allowsMarkType(h.marks[g].type)||n.step(new yn(c,m,h.marks[g]));if(i&&h.isText&&t.whitespace!="pre"){let g,b=/\r?\n|\r/g,S;for(;g=b.exec(h.text);)S||(S=new W(L.from(t.schema.text(" ",t.allowedMarks(h.marks))),0,0)),a.push(new Ge(c+g.index,c+g.index+g[0].length,S))}}c=m}if(!r.validEnd){let f=r.fillBefore(L.empty,!0);n.replace(c,c,new W(f,0,0))}for(let f=a.length-1;f>=0;f--)n.step(a[f])}function d_(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function xi(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),o=n.$from.index(r),a=n.$to.indexAfter(r);if(r<n.depth&&i.canReplace(o,a,t))return r;if(r==0||i.type.spec.isolating||!d_(i,o,a))break}return null}function p_(n,e,t){let{$from:r,$to:i,depth:o}=e,a=r.before(o+1),c=i.after(o+1),f=a,h=c,m=L.empty,p=0;for(let S=o,E=!1;S>t;S--)E||r.index(S)>0?(E=!0,m=L.from(r.node(S).copy(m)),p++):f--;let g=L.empty,b=0;for(let S=o,E=!1;S>t;S--)E||i.after(S+1)<i.end(S)?(E=!0,g=L.from(i.node(S).copy(g)),b++):h++;n.step(new Ke(f,h,a,c,new W(m.append(g),p,b),m.size-p,!0))}function Pu(n,e,t=null,r=n){let i=m_(n,e),o=i&&g_(r,e);return o?i.map(pg).concat({type:e,attrs:t}).concat(o.map(pg)):null}function pg(n){return{type:n,attrs:null}}function m_(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.contentMatchAt(r).findWrapping(e);if(!o)return null;let a=o.length?o[0]:e;return t.canReplaceWith(r,i,a)?o:null}function g_(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.child(r),a=e.contentMatch.findWrapping(o.type);if(!a)return null;let f=(a.length?a[a.length-1]:e).contentMatch;for(let h=r;f&&h<i;h++)f=f.matchType(t.child(h).type);return!f||!f.validEnd?null:a}function y_(n,e,t){let r=L.empty;for(let a=t.length-1;a>=0;a--){if(r.size){let c=t[a].type.contentMatch.matchFragment(r);if(!c||!c.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=L.from(t[a].type.create(t[a].attrs,r))}let i=e.start,o=e.end;n.step(new Ke(i,o,i,o,new W(r,0,0),t.length,!0))}function b_(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(a,c)=>{let f=typeof i=="function"?i(a):i;if(a.isTextblock&&!a.hasMarkup(r,f)&&v_(n.doc,n.mapping.slice(o).map(c),r)){let h=null;if(r.schema.linebreakReplacement){let b=r.whitespace=="pre",S=!!r.contentMatch.matchType(r.schema.linebreakReplacement);b&&!S?h=!1:!b&&S&&(h=!0)}h===!1&&gg(n,a,c,o),Lu(n,n.mapping.slice(o).map(c,1),r,void 0,h===null);let m=n.mapping.slice(o),p=m.map(c,1),g=m.map(c+a.nodeSize,1);return n.step(new Ke(p,g,p+1,g-1,new W(L.from(r.create(f,null,a.marks)),0,0),1,!0)),h===!0&&mg(n,a,c,o),!1}})}function mg(n,e,t,r){e.forEach((i,o)=>{if(i.isText){let a,c=/\r?\n|\r/g;for(;a=c.exec(i.text);){let f=n.mapping.slice(r).map(t+1+o+a.index);n.replaceWith(f,f+1,e.type.schema.linebreakReplacement.create())}}})}function gg(n,e,t,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let a=n.mapping.slice(r).map(t+1+o);n.replaceWith(a,a+1,e.type.schema.text(`
9
- `))}})}function v_(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function w_(n,e,t,r,i){let o=n.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);let a=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,a);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new Ke(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new W(L.from(a),0,0),1,!0))}function Pn(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let h=i.depth-1,m=t-2;h>o;h--,m--){let p=i.node(h),g=i.index(h);if(p.type.spec.isolating)return!1;let b=p.content.cutByIndex(g,p.childCount),S=r&&r[m+1];S&&(b=b.replaceChild(0,S.type.create(S.attrs)));let E=r&&r[m]||p;if(!p.canReplace(g+1,p.childCount)||!E.type.validContent(b))return!1}let c=i.indexAfter(o),f=r&&r[0];return i.node(o).canReplaceWith(c,c,f?f.type:i.node(o+1).type)}function S_(n,e,t=1,r){let i=n.doc.resolve(e),o=L.empty,a=L.empty;for(let c=i.depth,f=i.depth-t,h=t-1;c>f;c--,h--){o=L.from(i.node(c).copy(o));let m=r&&r[h];a=L.from(m?m.type.create(m.attrs,a):i.node(c).copy(a))}n.step(new Ge(e,e,new W(o.append(a),t,t),!0))}function fr(n,e){let t=n.resolve(e),r=t.index();return yg(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function x_(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:r}=n.type.schema;for(let i=0;i<e.childCount;i++){let o=e.child(i),a=o.type==r?n.type.schema.nodes.text:o.type;if(t=t.matchType(a),!t||!n.type.allowsMarks(o.marks))return!1}return t.validEnd}function yg(n,e){return!!(n&&e&&!n.isLeaf&&x_(n,e))}function ml(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let o,a,c=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):t>0?(o=r.node(i+1),c++,a=r.node(i).maybeChild(c)):(o=r.node(i).maybeChild(c-1),a=r.node(i+1)),o&&!o.isTextblock&&yg(o,a)&&r.node(i).canReplace(c,c+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function E_(n,e,t){let r=null,{linebreakReplacement:i}=n.doc.type.schema,o=n.doc.resolve(e-t),a=o.node().type;if(i&&a.inlineContent){let m=a.whitespace=="pre",p=!!a.contentMatch.matchType(i);m&&!p?r=!1:!m&&p&&(r=!0)}let c=n.steps.length;if(r===!1){let m=n.doc.resolve(e+t);gg(n,m.node(),m.before(),c)}a.inlineContent&&Lu(n,e+t-1,a,o.node().contentMatchAt(o.index()),r==null);let f=n.mapping.slice(c),h=f.map(e-t);if(n.step(new Ge(h,f.map(e+t,-1),W.empty,!0)),r===!0){let m=n.doc.resolve(h);mg(n,m.node(),m.before(),n.steps.length)}return n}function k_(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,t))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,t))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function __(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let i=t.content;for(let o=0;o<t.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(t.openStart==0&&t.size?2:1);o++)for(let a=r.depth;a>=0;a--){let c=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,f=r.index(a)+(c>0?1:0),h=r.node(a),m=!1;if(o==1)m=h.canReplace(f,f,i);else{let p=h.contentMatchAt(f).findWrapping(i.firstChild.type);m=p&&h.canReplaceWith(f,f,p[0])}if(m)return c==0?r.pos:c<0?r.before(a+1):r.after(a+1)}return null}function gl(n,e,t=e,r=W.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return bg(i,o,r)?new Ge(e,t,r):new T_(i,o,r).fit()}function bg(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class T_{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=L.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=L.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let h=this.findFittable();h?this.placeNodes(h):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,a=r.depth,c=i.depth;for(;a&&c&&o.childCount==1;)o=o.firstChild.content,a--,c--;let f=new W(o,a,c);return e>-1?new Ke(r.pos,e,this.$to.pos,this.$to.end(),f,t):f.size||r.pos!=this.$to.pos?new Ge(r.pos,i.pos,f):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=t.firstChild;if(t.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}t=o.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=Du(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let a=i.firstChild;for(let c=this.depth;c>=0;c--){let{type:f,match:h}=this.frontier[c],m,p=null;if(t==1&&(a?h.matchType(a.type)||(p=h.fillBefore(L.from(a),!1)):o&&f.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:c,parent:o,inject:p};if(t==2&&a&&(m=h.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:c,parent:o,wrap:m};if(o&&h.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=Du(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new W(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=Du(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new W(Ss(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new W(Ss(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let E=0;E<o.length;E++)this.openFrontierNode(o[E]);let a=this.unplaced,c=r?r.content:a.content,f=a.openStart-e,h=0,m=[],{match:p,type:g}=this.frontier[t];if(i){for(let E=0;E<i.childCount;E++)m.push(i.child(E));p=p.matchFragment(i)}let b=c.size+e-(a.content.size-a.openEnd);for(;h<c.childCount;){let E=c.child(h),C=p.matchType(E.type);if(!C)break;h++,(h>1||f==0||E.content.size)&&(p=C,m.push(vg(E.mark(g.allowedMarks(E.marks)),h==1?f:0,h==c.childCount?b:-1)))}let S=h==c.childCount;S||(b=-1),this.placed=xs(this.placed,t,L.from(m)),this.frontier[t].match=p,S&&b<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let E=0,C=c;E<b;E++){let M=C.lastChild;this.frontier.push({type:M.type,match:M.contentMatchAt(M.childCount)}),C=M.content}this.unplaced=S?e==0?W.empty:new W(Ss(a.content,e-1,1),e-1,b<0?a.openEnd:e-1):new W(Ss(a.content,e,h),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Bu(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=Bu(e,t,i,r,o);if(a){for(let c=t-1;c>=0;c--){let{match:f,type:h}=this.frontier[c],m=Bu(e,c,h,f,!0);if(!m||m.childCount)continue e}return{depth:t,fit:a,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=xs(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=xs(this.placed,this.depth,L.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(L.empty,!0);t.childCount&&(this.placed=xs(this.placed,this.frontier.length,t))}}function Ss(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Ss(n.firstChild.content,e-1,t)))}function xs(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(xs(n.lastChild.content,e-1,t)))}function Du(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function vg(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,vg(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(L.empty,!0)))),n.copy(r)}function Bu(n,e,t,r,i){let o=n.node(e),a=i?n.indexAfter(e):n.index(e);if(a==o.childCount&&!t.compatibleContent(o.type))return null;let c=r.fillBefore(o.content,!0,a);return c&&!C_(t,o.content,a)?c:null}function C_(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function M_(n){return n.spec.defining||n.spec.definingForContent}function A_(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),o=n.doc.resolve(t);if(bg(i,o,r))return n.step(new Ge(e,t,r));let a=Sg(i,n.doc.resolve(t));a[a.length-1]==0&&a.pop();let c=-(i.depth+1);a.unshift(c);for(let g=i.depth,b=i.pos-1;g>0;g--,b--){let S=i.node(g).type.spec;if(S.defining||S.definingAsContext||S.isolating)break;a.indexOf(g)>-1?c=g:i.before(g)==b&&a.splice(1,0,-g)}let f=a.indexOf(c),h=[],m=r.openStart;for(let g=r.content,b=0;;b++){let S=g.firstChild;if(h.push(S),b==r.openStart)break;g=S.content}for(let g=m-1;g>=0;g--){let b=h[g],S=M_(b.type);if(S&&!b.sameMarkup(i.node(Math.abs(c)-1)))m=g;else if(S||!b.type.isTextblock)break}for(let g=r.openStart;g>=0;g--){let b=(g+m+1)%(r.openStart+1),S=h[b];if(S)for(let E=0;E<a.length;E++){let C=a[(E+f)%a.length],M=!0;C<0&&(M=!1,C=-C);let P=i.node(C-1),F=i.index(C-1);if(P.canReplaceWith(F,F,S.type,S.marks))return n.replace(i.before(C),M?o.after(C):t,new W(wg(r.content,0,r.openStart,b),b,r.openEnd))}}let p=n.steps.length;for(let g=a.length-1;g>=0&&(n.replace(e,t,r),!(n.steps.length>p));g--){let b=a[g];b<0||(e=i.before(b),t=o.after(b))}}function wg(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(wg(o.content,e+1,t,r,o)))}if(e>r){let o=i.contentMatchAt(0),a=o.fillBefore(n).append(n);n=a.append(o.matchFragment(a).fillBefore(L.empty,!0))}return n}function I_(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=k_(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new W(L.from(r),0,0))}function O_(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=Sg(r,i);for(let a=0;a<o.length;a++){let c=o[a],f=a==o.length-1;if(f&&c==0||r.node(c).type.contentMatch.validEnd)return n.delete(r.start(c),i.end(c));if(c>0&&(f||r.node(c-1).canReplace(r.index(c-1),i.indexAfter(c-1))))return n.delete(r.before(c),i.after(c))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(e-r.start(a)==r.depth-a&&t>r.end(a)&&i.end(a)-t!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return n.delete(r.before(a),t);n.delete(e,t)}function Sg(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let o=n.start(i);if(o<n.pos-(n.depth-i)||e.end(i)>e.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&t.push(i)}return t}class Fi extends $e{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Re.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Re.fromReplace(e,this.pos,this.pos+1,new W(L.from(i),0,t.isLeaf?0:1))}getMap(){return It.empty}invert(e){return new Fi(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Fi(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Fi(t.pos,t.attr,t.value)}}$e.jsonID("attr",Fi);class Ks extends $e{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return Re.ok(r)}getMap(){return It.empty}invert(e){return new Ks(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Ks(t.attr,t.value)}}$e.jsonID("docAttr",Ks);let Ei=class extends Error{};Ei=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},Ei.prototype=Object.create(Error.prototype),Ei.prototype.constructor=Ei,Ei.prototype.name="TransformError";class N_{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Bi}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ei(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=W.empty){let i=gl(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new W(L.from(r),0,0))}delete(e,t){return this.replace(e,t,W.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return A_(this,e,t,r),this}replaceRangeWith(e,t,r){return I_(this,e,t,r),this}deleteRange(e,t){return O_(this,e,t),this}lift(e,t){return p_(this,e,t),this}join(e,t=1){return E_(this,e,t),this}wrap(e,t){return y_(this,e,t),this}setBlockType(e,t=e,r,i=null){return b_(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return w_(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new Fi(e,t,r)),this}setDocAttribute(e,t){return this.step(new Ks(e,t)),this}addNodeMark(e,t){return this.step(new _r(e,t)),this}removeNodeMark(e,t){if(!(t instanceof _e)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new zi(e,t)),this}split(e,t=1,r){return S_(this,e,t,r),this}addMark(e,t,r){return f_(this,e,t,r),this}removeMark(e,t,r){return h_(this,e,t,r),this}clearIncompatible(e,t,r){return Lu(this,e,t,r),this}}const zu=Object.create(null);class pe{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new R_(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=W.empty){let r=t.content.lastChild,i=null;for(let c=0;c<t.openEnd;c++)i=r,r=r.lastChild;let o=e.steps.length,a=this.ranges;for(let c=0;c<a.length;c++){let{$from:f,$to:h}=a[c],m=e.mapping.slice(o);e.replaceRange(m.map(f.pos),m.map(h.pos),c?W.empty:t),c==0&&kg(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:c}=i[o],f=e.mapping.slice(r),h=f.map(a.pos),m=f.map(c.pos);o?e.deleteRange(h,m):(e.replaceRangeWith(h,m,t),kg(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new ce(e):ki(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let a=t<0?ki(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):ki(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(a)return a}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new At(e.node(0))}static atStart(e){return ki(e,e,0,0,1)||new At(e)}static atEnd(e){return ki(e,e,e.content.size,e.childCount,-1)||new At(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=zu[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in zu)throw new RangeError("Duplicate use of selection JSON ID "+e);return zu[e]=t,t.prototype.jsonID=e,t}getBookmark(){return ce.between(this.$anchor,this.$head).getBookmark()}}pe.prototype.visible=!0;class R_{constructor(e,t){this.$from=e,this.$to=t}}let xg=!1;function Eg(n){!xg&&!n.parent.inlineContent&&(xg=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class ce extends pe{constructor(e,t=e){Eg(e),Eg(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return pe.near(r);let i=e.resolve(t.map(this.anchor));return new ce(i.parent.inlineContent?i:r,r)}replace(e,t=W.empty){if(super.replace(e,t),t==W.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ce&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ia(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ce(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let o=pe.findFrom(t,r,!0)||pe.findFrom(t,-r,!0);if(o)t=o.$head;else return pe.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(pe.findFrom(e,-r,!0)||pe.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new ce(e,t)}}pe.jsonID("text",ce);class Ia{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Ia(e.map(this.anchor),e.map(this.head))}resolve(e){return ce.between(e.resolve(this.anchor),e.resolve(this.head))}}class Y extends pe{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:i}=t.mapResult(this.anchor),o=e.resolve(i);return r?pe.near(o):new Y(o)}content(){return new W(L.from(this.node),0,0)}eq(e){return e instanceof Y&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new ph(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Y(e.resolve(t.anchor))}static create(e,t){return new Y(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Y.prototype.visible=!1,pe.jsonID("node",Y);class ph{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new Ia(r,r):new ph(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&Y.isSelectable(r)?new Y(t):pe.near(t)}}class At extends pe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=W.empty){if(t==W.empty){e.delete(0,e.doc.content.size);let r=pe.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new At(e)}map(e){return new At(e)}eq(e){return e instanceof At}getBookmark(){return L_}}pe.jsonID("all",At);const L_={map(){return this},resolve(n){return new At(n)}};function ki(n,e,t,r,i,o=!1){if(e.inlineContent)return ce.create(n,t);for(let a=r-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){let c=e.child(a);if(c.isAtom){if(!o&&Y.isSelectable(c))return Y.create(n,t-(i<0?c.nodeSize:0))}else{let f=ki(n,c,t+i,i<0?c.childCount:0,i,o);if(f)return f}t+=c.nodeSize*i}return null}function kg(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof Ge||i instanceof Ke))return;let o=n.mapping.maps[r],a;o.forEach((c,f,h,m)=>{a==null&&(a=m)}),n.setSelection(pe.near(n.doc.resolve(a),t))}function _g(n,e){return!e||!n?n:n.bind(e)}class yl{constructor(e,t,r){this.name=e,this.init=_g(t.init,r),this.apply=_g(t.apply,r)}}new yl("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new yl("selection",{init(n,e){return n.selection||pe.atStart(e.doc)},apply(n){return n.selection}}),new yl("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new yl("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}});function Tg(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Tg(i,e,{})),t[r]=i}return t}class lt{constructor(e){this.spec=e,this.props={},e.props&&Tg(e.props,this,this.props),this.key=e.key?e.key.key:Cg("plugin")}getState(e){return e[this.key]}}const Fu=Object.create(null);function Cg(n){return n in Fu?n+"$"+ ++Fu[n]:(Fu[n]=0,n+"$")}class Tt{constructor(e="key"){this.key=Cg(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Hr=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},Mg=function(n,e,t,r){return t&&(Ag(n,e,t,r,-1)||Ag(n,e,t,r,1))},P_=/^(img|br|input|textarea|hr)$/i;function Ag(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:bl(n))){let o=n.parentNode;if(!o||o.nodeType!=1||Hu(n)||P_.test(n.nodeName)||n.contentEditable=="false")return!1;e=Hr(n)+(i<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?bl(n):0}else return!1}}function bl(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function D_(n,e,t){for(let r=e==0,i=e==bl(n);r||i;){if(n==t)return!0;let o=Hr(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==bl(n)}}function Hu(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const Ig=function(n){return n.focusNode&&Mg(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Og(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const fn=typeof navigator<"u"?navigator:null,Ng=typeof document<"u"?document:null,hr=fn&&fn.userAgent||"",$u=/Edge\/(\d+)/.exec(hr),Rg=/MSIE \d/.exec(hr),Wu=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(hr),Es=!!(Rg||Wu||$u),Lg=Rg?document.documentMode:Wu?+Wu[1]:$u?+$u[1]:0,vl=!Es&&/gecko\/(\d+)/i.test(hr);vl&&+(/Firefox\/(\d+)/.exec(hr)||[0,0])[1];const Uu=!Es&&/Chrome\/(\d+)/.exec(hr),dr=!!Uu,Pg=Uu?+Uu[1]:0,$r=!Es&&!!fn&&/Apple Computer/.test(fn.vendor),Vu=$r&&(/Mobile\/\w+/.test(hr)||!!fn&&fn.maxTouchPoints>2),$t=Vu||(fn?/Mac/.test(fn.platform):!1),B_=fn?/Win/.test(fn.platform):!1,ks=/Android \d/.test(hr),Ku=!!Ng&&"webkitFontSmoothing"in Ng.documentElement.style,z_=Ku?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function F_(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),o=i&&i.size==0,a=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(a<0)return null;let c=r.resolve(a),f,h;if(Ig(t)){for(f=a;i&&!i.node;)i=i.parent;let p=i.node;if(i&&p.isAtom&&Y.isSelectable(p)&&i.parent&&!(p.isInline&&D_(t.focusNode,t.focusOffset,i.dom))){let g=i.posBefore;h=new Y(a==g?c:r.resolve(g))}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let p=a,g=a;for(let b=0;b<t.rangeCount;b++){let S=t.getRangeAt(b);p=Math.min(p,n.docView.posFromDOM(S.startContainer,S.startOffset,1)),g=Math.max(g,n.docView.posFromDOM(S.endContainer,S.endOffset,-1))}if(p<0)return null;[f,a]=g==n.state.selection.anchor?[g,p]:[p,g],c=r.resolve(a)}else f=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(f<0)return null}let m=r.resolve(f);if(!h){let p=e=="pointer"||n.state.selection.head<c.pos&&!o?1:-1;h=$g(n,m,c,p)}return h}function Dg(n){return n.editable?n.hasFocus():U_(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function Gu(n,e=!1){let t=n.state.selection;if(W_(n,t),!!Dg(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&dr){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Mg(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)$_(n);else{let{anchor:r,head:i}=t,o,a;Bg&&!(t instanceof ce)&&(t.$from.parent.inlineContent||(o=zg(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(a=zg(n,t.to))),n.docView.setSelection(r,i,n,e),Bg&&(o&&Fg(o),a&&Fg(a)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&H_(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const Bg=$r||dr&&Pg<63;function zg(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=r<t.childNodes.length?t.childNodes[r]:null,o=r?t.childNodes[r-1]:null;if($r&&i&&i.contentEditable=="false")return Ju(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return Ju(i);if(o)return Ju(o)}}function Ju(n){return n.contentEditable="true",$r&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function Fg(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function H_(n){let e=n.dom.ownerDocument;e.removeEventListener("selectionchange",n.input.hideSelectionGuard);let t=n.domSelectionRange(),r=t.anchorNode,i=t.anchorOffset;e.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!Dg(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function $_(n){let e=n.domSelection(),t=document.createRange();if(!e)return;let r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setStart(r.parentNode,Hr(r)+1):t.setStart(r,0),t.collapse(!0),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&Es&&Lg<=11&&(r.disabled=!0,r.disabled=!1)}function W_(n,e){if(e instanceof Y){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(Hg(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else Hg(n)}function Hg(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function $g(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||ce.between(e,t,r)}function U_(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function qu(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),o=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return o&&pe.findFrom(o,e)}function pr(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function Wg(n,e,t){let r=n.state.selection;if(r instanceof ce)if(t.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let a=n.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return pr(n,new ce(r.$anchor,a))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let i=qu(n.state,e);return i&&i instanceof Y?pr(n,i):!1}else if(!($t&&t.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,a;if(!o||o.isText)return!1;let c=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(a=n.docView.descAt(c))&&!a.contentDOM?Y.isSelectable(o)?pr(n,new Y(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):Ku?pr(n,new ce(n.state.doc.resolve(e<0?c:c+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Y&&r.node.isInline)return pr(n,new ce(e>0?r.$to:r.$from));{let i=qu(n.state,e);return i?pr(n,i):!1}}}function wl(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function _s(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function _i(n,e){return e<0?V_(n):K_(n)}function V_(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,a=!1;for(vl&&t.nodeType==1&&r<wl(t)&&_s(t.childNodes[r],-1)&&(a=!0);;)if(r>0){if(t.nodeType!=1)break;{let c=t.childNodes[r-1];if(_s(c,-1))i=t,o=--r;else if(c.nodeType==3)t=c,r=t.nodeValue.length;else break}}else{if(Ug(t))break;{let c=t.previousSibling;for(;c&&_s(c,-1);)i=t.parentNode,o=Hr(c),c=c.previousSibling;if(c)t=c,r=wl(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}a?ju(n,t,r):i&&ju(n,i,o)}function K_(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=wl(t),o,a;for(;;)if(r<i){if(t.nodeType!=1)break;let c=t.childNodes[r];if(_s(c,1))o=t,a=++r;else break}else{if(Ug(t))break;{let c=t.nextSibling;for(;c&&_s(c,1);)o=c.parentNode,a=Hr(c)+1,c=c.nextSibling;if(c)t=c,r=0,i=wl(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}o&&ju(n,o,a)}function Ug(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function G_(n,e){for(;n&&e==n.childNodes.length&&!Hu(n);)e=Hr(n)+1,n=n.parentNode;for(;n&&e<n.childNodes.length;){let t=n.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=0}}function J_(n,e){for(;n&&!e&&!Hu(n);)e=Hr(n),n=n.parentNode;for(;n&&e;){let t=n.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=n.childNodes.length}}function ju(n,e,t){if(e.nodeType!=3){let o,a;(a=G_(e,t))?(e=a,t=0):(o=J_(e,t))&&(e=o,t=o.nodeValue.length)}let r=n.domSelection();if(!r)return;if(Ig(r)){let o=document.createRange();o.setEnd(e,t),o.setStart(e,t),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:i}=n;setTimeout(()=>{n.state==i&&Gu(n)},50)}function Vg(n,e){let t=n.state.doc.resolve(e);if(!(dr||B_)&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let o=n.coordsAtPos(e-1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(e<t.end()){let o=n.coordsAtPos(e+1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function Kg(n,e,t){let r=n.state.selection;if(r instanceof ce&&!r.empty||t.indexOf("s")>-1||$t&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let a=qu(n.state,e);if(a&&a instanceof Y)return pr(n,a)}if(!i.parent.inlineContent){let a=e<0?i:o,c=r instanceof At?pe.near(a,e):pe.findFrom(a,e);return c?pr(n,c):!1}return!1}function Gg(n,e){if(!(n.state.selection instanceof ce))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let a=n.state.tr;return e<0?a.delete(t.pos-o.nodeSize,t.pos):a.delete(t.pos,t.pos+o.nodeSize),n.dispatch(a),!0}return!1}function Jg(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function q_(n){if(!$r||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Jg(n,r,"true"),setTimeout(()=>Jg(n,r,"false"),20)}return!1}function j_(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function Y_(n,e){let t=e.keyCode,r=j_(e);if(t==8||$t&&t==72&&r=="c")return Gg(n,-1)||_i(n,-1);if(t==46&&!e.shiftKey||$t&&t==68&&r=="c")return Gg(n,1)||_i(n,1);if(t==13||t==27)return!0;if(t==37||$t&&t==66&&r=="c"){let i=t==37?Vg(n,n.state.selection.from)=="ltr"?-1:1:-1;return Wg(n,i,r)||_i(n,i)}else if(t==39||$t&&t==70&&r=="c"){let i=t==39?Vg(n,n.state.selection.from)=="ltr"?1:-1:1;return Wg(n,i,r)||_i(n,i)}else{if(t==38||$t&&t==80&&r=="c")return Kg(n,-1,r)||_i(n,-1);if(t==40||$t&&t==78&&r=="c")return q_(n)||Kg(n,1,r)||_i(n,1);if(r==($t?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function qg(n,e){n.someProp("transformCopied",b=>{e=b(e,n)});let t=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let b=r.firstChild;t.push(b.type.name,b.attrs!=b.type.defaultAttrs?b.attrs:null),r=b.content}let a=n.someProp("clipboardSerializer")||Us.fromSchema(n.state.schema),c=n0(),f=c.createElement("div");f.appendChild(a.serializeFragment(r,{document:c}));let h=f.firstChild,m,p=0;for(;h&&h.nodeType==1&&(m=e0[h.nodeName.toLowerCase()]);){for(let b=m.length-1;b>=0;b--){let S=c.createElement(m[b]);for(;f.firstChild;)S.appendChild(f.firstChild);f.appendChild(S),p++}h=f.firstChild}h&&h.nodeType==1&&h.setAttribute("data-pm-slice",`${i} ${o}${p?` -${p}`:""} ${JSON.stringify(t)}`);let g=n.someProp("clipboardTextSerializer",b=>b(e,n))||e.content.textBetween(0,e.content.size,`
3
+ `,...nk(i)),console.warn(...o)}Vo(),wu=!1}function tk(){let n=Br[Br.length-1];if(!n)return[];const e=[];for(;n;){const t=e[0];t&&t.vnode===n?t.recurseCount++:e.push({vnode:n,recurseCount:0});const r=n.component&&n.component.parent;n=r&&r.vnode}return e}function nk(n){const e=[];return n.forEach((t,r)=>{e.push(...r===0?[]:[`
4
+ `],...rk(t))}),e}function rk({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",r=n.component?n.component.parent==null:!1,i=` at <${Nm(n.component,n.type,r)}`,o=">"+t;return n.props?[i,...ik(n.props),o]:[i+o]}function ik(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(r=>{e.push(...mm(r,n[r]))}),t.length>3&&e.push(" ..."),e}function mm(n,e,t){return In(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:st(e)?(e=mm(n,le(e.value),!0),t?e:[`${n}=Ref<`,e,">"]):Ye(e)?[`${n}=fn${e.name?`<${e.name}>`:""}`]:(e=le(e),t?e:[`${n}=`,e])}const gm={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Zo(n,e,t,r){try{return r?n(...r):n()}catch(i){Su(i,e,t)}}function ym(n,e,t,r){if(Ye(n)){const i=Zo(n,e,t,r);return i&&mE(i)&&i.catch(o=>{Su(o,e,t)}),i}if(Le(n)){const i=[];for(let o=0;o<n.length;o++)i.push(ym(n[o],e,t,r));return i}else process.env.NODE_ENV!=="production"&&ot(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof n}`)}function Su(n,e,t,r=!0){const i=e?e.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:a}=e&&e.appContext.config||cs;if(e){let c=e.parent;const f=e.proxy,h=process.env.NODE_ENV!=="production"?gm[t]:`https://vuejs.org/error-reference/#runtime-${t}`;for(;c;){const m=c.ec;if(m){for(let p=0;p<m.length;p++)if(m[p](n,f,h)===!1)return}c=c.parent}if(o){Uo(),Zo(o,null,10,[n,f,h]),Vo();return}}sk(n,t,i,r,a)}function sk(n,e,t,r=!0,i=!1){if(process.env.NODE_ENV!=="production"){const o=gm[e];if(t&&QE(t),ot(`Unhandled error${o?` during execution of ${o}`:""}`),t&&ek(),r)throw n;console.error(n)}else{if(i)throw n;console.error(n)}}const $t=[];let Ln=-1;const bi=[];let cr=null,vi=0;const ok=Promise.resolve();let xu=null;const lk=100;function ak(n){let e=Ln+1,t=$t.length;for(;e<t;){const r=e+t>>>1,i=$t[r],o=ys(i);o<n||o===n&&i.flags&2?e=r+1:t=r}return e}function bm(n){if(!(n.flags&1)){const e=ys(n),t=$t[$t.length-1];!t||!(n.flags&2)&&e>=ys(t)?$t.push(n):$t.splice(ak(e),0,n),n.flags|=1,vm()}}function vm(){xu||(xu=ok.then(Sm))}function wm(n){Le(n)?bi.push(...n):cr&&n.id===-1?cr.splice(vi+1,0,n):n.flags&1||(bi.push(n),n.flags|=1),vm()}function ck(n){if(bi.length){const e=[...new Set(bi)].sort((t,r)=>ys(t)-ys(r));if(bi.length=0,cr){cr.push(...e);return}for(cr=e,process.env.NODE_ENV!=="production"&&(n=n||new Map),vi=0;vi<cr.length;vi++){const t=cr[vi];process.env.NODE_ENV!=="production"&&xm(n,t)||(t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2)}cr=null,vi=0}}const ys=n=>n.id==null?n.flags&2?-1:1/0:n.id;function Sm(n){process.env.NODE_ENV!=="production"&&(n=n||new Map);const e=process.env.NODE_ENV!=="production"?t=>xm(n,t):pi;try{for(Ln=0;Ln<$t.length;Ln++){const t=$t[Ln];if(t&&!(t.flags&8)){if(process.env.NODE_ENV!=="production"&&e(t))continue;t.flags&4&&(t.flags&=-2),Zo(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2)}}}finally{for(;Ln<$t.length;Ln++){const t=$t[Ln];t&&(t.flags&=-2)}Ln=-1,$t.length=0,ck(n),xu=null,($t.length||bi.length)&&Sm(n)}}function xm(n,e){const t=n.get(e)||0;if(t>lk){const r=e.i,i=r&&Om(r.type);return Su(`Maximum recursive updates exceeded${i?` in component <${i}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return n.set(e,t+1),!1}const Eu=new Map;process.env.NODE_ENV!=="production"&&(Wo().__VUE_HMR_RUNTIME__={createRecord:ku(uk),rerender:ku(fk),reload:ku(hk)});const Qo=new Map;function uk(n,e){return Qo.has(n)?!1:(Qo.set(n,{initialDef:el(e),instances:new Set}),!0)}function el(n){return Rm(n)?n.__vccOpts:n}function fk(n,e){const t=Qo.get(n);t&&(t.initialDef.render=e,[...t.instances].forEach(r=>{e&&(r.render=e,el(r.type).render=e),r.renderCache=[],r.update()}))}function hk(n,e){const t=Qo.get(n);if(!t)return;e=el(e),Em(t.initialDef,e);const r=[...t.instances];for(let i=0;i<r.length;i++){const o=r[i],a=el(o.type);let c=Eu.get(a);c||(a!==t.initialDef&&Em(a,e),Eu.set(a,c=new Set)),c.add(o),o.appContext.propsCache.delete(o.type),o.appContext.emitsCache.delete(o.type),o.appContext.optionsCache.delete(o.type),o.ceReload?(c.add(o),o.ceReload(e.styles),c.delete(o)):o.parent?bm(()=>{o.parent.update(),c.delete(o)}):o.appContext.reload?o.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),o.root.ce&&o!==o.root&&o.root.ce._removeChildStyle(a)}wm(()=>{Eu.clear()})}function Em(n,e){sr(n,e);for(const t in n)t!=="__file"&&!(t in e)&&delete n[t]}function ku(n){return(e,t)=>{try{return n(e,t)}catch(r){console.error(r),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let wi,tl=[];function km(n,e){var t,r;wi=n,wi?(wi.enabled=!0,tl.forEach(({event:i,args:o})=>wi.emit(i,...o)),tl=[]):typeof window<"u"&&window.HTMLElement&&!((r=(t=window.navigator)==null?void 0:t.userAgent)!=null&&r.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(o=>{km(o,e)}),setTimeout(()=>{wi||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,tl=[])},3e3)):tl=[]}let Si=null,dk=null;const pk=n=>n.__isTeleport;function _m(n,e){n.shapeFlag&6&&n.component?(n.transition=e,_m(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}Wo().requestIdleCallback,Wo().cancelIdleCallback;const mk=Symbol.for("v-ndc"),gk={};process.env.NODE_ENV!=="production"&&(gk.ownKeys=n=>(ot("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(n)));let yk=null;function bk(n,e,t=!1){const r=il||Si;if(r||yk){const i=r?r.parent==null?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&n in i)return i[n];if(arguments.length>1)return t&&Ye(e)?e.call(r&&r.proxy):e;process.env.NODE_ENV!=="production"&&ot(`injection "${String(n)}" not found.`)}else process.env.NODE_ENV!=="production"&&ot("inject() can only be used inside setup() or functional components.")}const vk={},Tm=n=>Object.getPrototypeOf(n)===vk,wk=Tk,Sk=Symbol.for("v-scx"),xk=()=>{{const n=bk(Sk);return n||process.env.NODE_ENV!=="production"&&ot("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),n}};function Ek(n,e,t){return process.env.NODE_ENV!=="production"&&!Ye(e)&&ot("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),kk(n,e,t)}function kk(n,e,t=cs){const{immediate:r,deep:i,flush:o,once:a}=t;process.env.NODE_ENV!=="production"&&!e&&(r!==void 0&&ot('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&ot('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),a!==void 0&&ot('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const c=sr({},t);process.env.NODE_ENV!=="production"&&(c.onWarn=ot);const f=e&&r||!e&&o!=="post";let h;if(sl){if(o==="sync"){const b=xk();h=b.__watcherHandles||(b.__watcherHandles=[])}else if(!f){const b=()=>{};return b.stop=pi,b.resume=pi,b.pause=pi,b}}const m=il;c.call=(b,S,E)=>ym(b,m,S,E);let p=!1;o==="post"?c.scheduler=b=>{wk(b,m&&m.suspense)}:o!=="sync"&&(p=!0,c.scheduler=(b,S)=>{S?b():bm(b)}),c.augmentJob=b=>{e&&(b.flags|=4),p&&(b.flags|=2,m&&(b.id=m.uid,b.i=m))};const g=ZE(n,e,c);return sl&&(h?h.push(g):f&&g()),g}const _k=n=>n.__isSuspense;function Tk(n,e){e&&e.pendingBranch?Le(n)?e.effects.push(...n):e.effects.push(n):wm(n)}const Cm=Symbol.for("v-fgt"),Ck=Symbol.for("v-txt"),Mk=Symbol.for("v-cmt");function Ak(n){return n?n.__v_isVNode===!0:!1}const Ik=(...n)=>Am(...n),Mm=({key:n})=>n??null,nl=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?In(n)||st(n)||Ye(n)?{i:Si,r:n,k:e,f:!!t}:n:null);function Ok(n,e=null,t=null,r=0,i=null,o=n===Cm?0:1,a=!1,c=!1){const f={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&Mm(e),ref:e&&nl(e),scopeId:dk,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Si};return c?(_u(f,t),o&128&&n.normalize(f)):t&&(f.shapeFlag|=In(t)?8:16),process.env.NODE_ENV!=="production"&&f.key!==f.key&&ot("VNode created with invalid key (NaN). VNode type:",f.type),f}const Nk=process.env.NODE_ENV!=="production"?Ik:Am;function Am(n,e=null,t=null,r=0,i=null,o=!1){if((!n||n===mk)&&(process.env.NODE_ENV!=="production"&&!n&&ot(`Invalid vnode type when creating vnode: ${n}.`),n=Mk),Ak(n)){const c=rl(n,e,!0);return t&&_u(c,t),c.patchFlag=-2,c}if(Rm(n)&&(n=n.__vccOpts),e){e=Rk(e);let{class:c,style:f}=e;c&&!In(c)&&(e.class=ou(c)),dt(f)&&(qo(f)&&!Le(f)&&(f=sr({},f)),e.style=su(f))}const a=In(n)?1:_k(n)?128:pk(n)?64:dt(n)?4:Ye(n)?2:0;return process.env.NODE_ENV!=="production"&&a&4&&qo(n)&&(n=le(n),ot("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
5
+ Component that was made reactive: `,n)),Ok(n,e,t,r,i,a,o,!0)}function Rk(n){return n?qo(n)||Tm(n)?sr({},n):n:null}function rl(n,e,t=!1,r=!1){const{props:i,ref:o,patchFlag:a,children:c,transition:f}=n,h=e?Pk(i||{},e):i,m={__v_isVNode:!0,__v_skip:!0,type:n.type,props:h,key:h&&Mm(h),ref:e&&e.ref?t&&o?Le(o)?o.concat(nl(e)):[o,nl(e)]:nl(e):o,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:process.env.NODE_ENV!=="production"&&a===-1&&Le(c)?c.map(Im):c,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==Cm?a===-1?16:a|16:a,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:f,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&rl(n.ssContent),ssFallback:n.ssFallback&&rl(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return f&&r&&_m(m,f.clone(m)),m}function Im(n){const e=rl(n);return Le(n.children)&&(e.children=n.children.map(Im)),e}function Lk(n=" ",e=0){return Nk(Ck,null,n,e)}function _u(n,e){let t=0;const{shapeFlag:r}=n;if(e==null)e=null;else if(Le(e))t=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),_u(n,i()),i._c&&(i._d=!0));return}else t=32,!e._&&!Tm(e)&&(e._ctx=Si);else Ye(e)?(e={default:e,_ctx:Si},t=32):(e=String(e),r&64?(t=16,e=[Lk(e)]):t=8);n.children=e,n.shapeFlag|=t}function Pk(...n){const e={};for(let t=0;t<n.length;t++){const r=n[t];for(const i in r)if(i==="class")e.class!==r.class&&(e.class=ou([e.class,r.class]));else if(i==="style")e.style=su([e.style,r.style]);else if(hE(i)){const o=e[i],a=r[i];a&&o!==a&&!(Le(o)&&o.includes(a))&&(e[i]=o?[].concat(o,a):a)}else i!==""&&(e[i]=r[i])}return e}let il=null;const Dk=()=>il||Si;{const n=Wo(),e=(t,r)=>{let i;return(i=n[t])||(i=n[t]=[]),i.push(r),o=>{i.length>1?i.forEach(a=>a(o)):i[0](o)}};e("__VUE_INSTANCE_SETTERS__",t=>il=t),e("__VUE_SSR_SETTERS__",t=>sl=t)}let sl=!1;process.env.NODE_ENV;const zk=/(?:^|[-_])(\w)/g,Bk=n=>n.replace(zk,e=>e.toUpperCase()).replace(/[-_]/g,"");function Om(n,e=!0){return Ye(n)?n.displayName||n.name:n.name||e&&n.__name}function Nm(n,e,t=!1){let r=Om(e);if(!r&&e.__file){const i=e.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&n&&n.parent){const i=o=>{for(const a in o)if(o[a]===e)return a};r=i(n.components||n.parent.type.components)||i(n.appContext.components)}return r?Bk(r):t?"App":"Anonymous"}function Rm(n){return Ye(n)&&"__vccOpts"in n}const de=(n,e)=>{const t=YE(n,e,sl);if(process.env.NODE_ENV!=="production"){const r=Dk();r&&r.appContext.config.warnRecursiveComputed&&(t._warnRecursive=!0)}return t};function Fk(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const n={style:"color:#3ba776"},e={style:"color:#1677ff"},t={style:"color:#f5222d"},r={style:"color:#eb2f96"},i={__vue_custom_formatter:!0,header(p){return dt(p)?p.__isVue?["div",n,"VueInstance"]:st(p)?["div",{},["span",n,m(p)],"<",c("_value"in p?p._value:p),">"]:gs(p)?["div",{},["span",n,mt(p)?"ShallowReactive":"Reactive"],"<",c(p),`>${Rn(p)?" (readonly)":""}`]:Rn(p)?["div",{},["span",n,mt(p)?"ShallowReadonly":"Readonly"],"<",c(p),">"]:null:null},hasBody(p){return p&&p.__isVue},body(p){if(p&&p.__isVue)return["div",{},...o(p.$)]}};function o(p){const g=[];p.type.props&&p.props&&g.push(a("props",le(p.props))),p.setupState!==cs&&g.push(a("setup",p.setupState)),p.data!==cs&&g.push(a("data",le(p.data)));const b=f(p,"computed");b&&g.push(a("computed",b));const S=f(p,"inject");return S&&g.push(a("injected",S)),g.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:p}]]),g}function a(p,g){return g=sr({},g),Object.keys(g).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},p],["div",{style:"padding-left:1.25em"},...Object.keys(g).map(b=>["div",{},["span",r,b+": "],c(g[b],!1)])]]:["span",{}]}function c(p,g=!0){return typeof p=="number"?["span",e,p]:typeof p=="string"?["span",t,JSON.stringify(p)]:typeof p=="boolean"?["span",r,p]:dt(p)?["object",{object:g?le(p):p}]:["span",t,String(p)]}function f(p,g){const b=p.type;if(Ye(b))return;const S={};for(const E in p.ctx)h(b,E,g)&&(S[E]=p.ctx[E]);return S}function h(p,g,b){const S=p[b];if(Le(S)&&S.includes(g)||dt(S)&&g in S||p.extends&&h(p.extends,g,b)||p.mixins&&p.mixins.some(E=>h(E,g,b)))return!0}function m(p){return mt(p)?"ShallowRef":p.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(i):window.devtoolsFormatters=[i]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function Hk(){Fk()}process.env.NODE_ENV!=="production"&&Hk();function Xe(n){this.content=n}Xe.prototype={constructor:Xe,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new Xe(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Xe(t)},addToStart:function(n,e){return new Xe([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Xe(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new Xe(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Xe.from(n),n.size?new Xe(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Xe.from(n),n.size?new Xe(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Xe.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}},Xe.from=function(n){if(n instanceof Xe)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Xe(e)};function Lm(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)t++;return t}if(i.content.size||o.content.size){let a=Lm(i.content,o.content,t+1);if(a!=null)return a}t+=i.nodeSize}}function Pm(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let a=n.child(--i),c=e.child(--o),f=a.nodeSize;if(a==c){t-=f,r-=f;continue}if(!a.sameMarkup(c))return{a:t,b:r};if(a.isText&&a.text!=c.text){let h=0,m=Math.min(a.text.length,c.text.length);for(;h<m&&a.text[a.text.length-h-1]==c.text[c.text.length-h-1];)h++,t--,r--;return{a:t,b:r}}if(a.content.size||c.content.size){let h=Pm(a.content,c.content,t-1,r-1);if(h)return h}t-=f,r-=f}}class L{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let a=0,c=0;c<t;a++){let f=this.content[a],h=c+f.nodeSize;if(h>e&&r(f,i+c,o||null,a)!==!1&&f.content.size){let m=c+1;f.nodesBetween(Math.max(0,e-m),Math.min(f.content.size,t-m),r,i+m)}c=h}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",a=!0;return this.nodesBetween(e,t,(c,f)=>{let h=c.isText?c.text.slice(Math.max(e,f)-f,t-f):c.isLeaf?i?typeof i=="function"?i(c):i:c.type.spec.leafText?c.type.spec.leafText(c):"":"";c.isBlock&&(c.isLeaf&&h||c.isTextblock)&&r&&(a?a=!1:o+=r),o+=h},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new L(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,a=0;a<t;o++){let c=this.content[o],f=a+c.nodeSize;f>e&&((a<e||f>t)&&(c.isText?c=c.cut(Math.max(0,e-a),Math.min(c.text.length,t-a)):c=c.cut(Math.max(0,e-a-1),Math.min(c.content.size,t-a-1))),r.push(c),i+=c.nodeSize),a=f}return new L(r,i)}cutByIndex(e,t){return e==t?L.empty:e==0&&t==this.content.length?this:new L(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new L(i,o)}addToStart(e){return new L([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new L(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return Lm(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Pm(this,e,t,r)}findIndex(e,t=-1){if(e==0)return ol(0,e);if(e==this.size)return ol(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=e)return a==e||t>0?ol(r+1,a):ol(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return L.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new L(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return L.empty;let t,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new L(t||e,r)}static from(e){if(!e)return L.empty;if(e instanceof L)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new L([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}L.empty=new L([],0);const Tu={index:0,offset:0};function ol(n,e){return Tu.index=n,Tu.offset=e,Tu}function ll(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!ll(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!ll(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Te=class fh{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ll(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=r.create(t.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return fh.none;if(e instanceof fh)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};Te.none=[];class al extends Error{}class W{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=zm(this.content,e+this.openStart,t);return r&&new W(r,this.openStart,this.openEnd)}removeBetween(e,t){return new W(Dm(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return W.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new W(L.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new W(e,r,i)}}W.empty=new W(L.empty,0,0);function Dm(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:a,offset:c}=n.findIndex(t);if(i==e||o.isText){if(c!=t&&!n.child(a).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=a)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(Dm(o.content,e-i-1,t-i-1)))}function zm(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),a=n.maybeChild(i);if(o==e||a.isText)return n.cut(0,e).append(t).append(n.cut(e));let c=zm(a.content,e-o-1,t);return c&&n.replaceChild(i,a.copy(c))}function $k(n,e,t){if(t.openStart>n.depth)throw new al("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new al("Inconsistent open depths");return Bm(n,e,t,0)}function Bm(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let a=Bm(n,e,t,r+1);return o.copy(o.content.replaceChild(i,a))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let a=n.parent,c=a.content;return Hr(a,c.cut(0,n.parentOffset).append(t.content).append(c.cut(e.parentOffset)))}else{let{start:a,end:c}=Wk(t,n);return Hr(o,Hm(n,a,c,e,r))}else return Hr(o,cl(n,e,r))}function Fm(n,e){if(!e.type.compatibleContent(n.type))throw new al("Cannot join "+e.type.name+" onto "+n.type.name)}function Cu(n,e,t){let r=n.node(t);return Fm(r,e.node(t)),r}function Fr(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function bs(n,e,t,r){let i=(e||n).node(t),o=0,a=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(Fr(n.nodeAfter,r),o++));for(let c=o;c<a;c++)Fr(i.child(c),r);e&&e.depth==t&&e.textOffset&&Fr(e.nodeBefore,r)}function Hr(n,e){return n.type.checkContent(e),n.copy(e)}function Hm(n,e,t,r,i){let o=n.depth>i&&Cu(n,e,i+1),a=r.depth>i&&Cu(t,r,i+1),c=[];return bs(null,n,i,c),o&&a&&e.index(i)==t.index(i)?(Fm(o,a),Fr(Hr(o,Hm(n,e,t,r,i+1)),c)):(o&&Fr(Hr(o,cl(n,e,i+1)),c),bs(e,t,i,c),a&&Fr(Hr(a,cl(t,r,i+1)),c)),bs(r,null,i,c),new L(c)}function cl(n,e,t){let r=[];if(bs(null,n,t,r),n.depth>t){let i=Cu(n,e,t+1);Fr(Hr(i,cl(n,e,t+1)),r)}return bs(e,null,t,r),new L(r)}function Wk(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(L.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class Vs{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.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,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Te.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let c=r;r=i,i=c}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new ul(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let a=e;;){let{index:c,offset:f}=a.content.findIndex(o),h=o-f;if(r.push(a,c,i+f),!h||(a=a.child(c),a.isText))break;o=h-1,i+=f+1}return new Vs(t,r,o)}static resolveCached(e,t){let r=$m.get(e);if(r)for(let o=0;o<r.elts.length;o++){let a=r.elts[o];if(a.pos==t)return a}else $m.set(e,r=new Uk);let i=r.elts[r.i]=Vs.resolve(e,t);return r.i=(r.i+1)%Vk,i}}class Uk{constructor(){this.elts=[],this.i=0}}const Vk=12,$m=new WeakMap;class ul{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Kk=Object.create(null);let ur=class hh{constructor(e,t,r,i=Te.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||L.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&ll(this.attrs,t||e.defaultAttrs||Kk)&&Te.sameSet(this.marks,r||Te.none)}copy(e=null){return e==this.content?this:new hh(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new hh(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return W.empty;let i=this.resolve(e),o=this.resolve(t),a=r?0:i.sharedDepth(t),c=i.start(a),h=i.node(a).content.cut(i.pos-c,o.pos-c);return new W(h,i.depth-a,o.depth-a)}replace(e,t,r){return $k(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return Vs.resolveCached(this,e)}resolveNoCache(e){return Vs.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}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()+")"),Wm(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=L.empty,i=0,o=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,o),c=a&&a.matchFragment(this.content,t);if(!c||!c.validEnd)return!1;for(let f=i;f<o;f++)if(!this.type.allowsMarks(r.child(f).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),a=o&&o.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Te.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Te.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=L.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};ur.prototype.text=void 0;class Ma extends ur{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Wm(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Ma(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ma(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Wm(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Yr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Gk(e,t);if(r.next==null)return Yr.empty;let i=Um(r);r.next&&r.err("Unexpected trailing text");let o=Qk(Zk(i));return e_(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let o=t;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}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:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function o(a,c){let f=a.matchFragment(e,r);if(f&&(!t||f.validEnd))return L.from(c.map(h=>h.createAndFill()));for(let h=0;h<a.next.length;h++){let{type:m,next:p}=a.next[h];if(!(m.isText||m.hasRequiredAttrs())&&i.indexOf(p)==-1){i.push(p);let g=o(p,c.concat(m));if(g)return g}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let a=[];for(let c=i;c.type;c=c.via)a.push(c.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:c,next:f}=o.next[a];!c.isLeaf&&!c.hasRequiredAttrs()&&!(c.name in t)&&(!i.type||f.validEnd)&&(r.push({match:c.contentMatch,type:c,via:i}),t[c.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 t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return o}).join(`
6
+ `)}}Yr.empty=new Yr(!0);class Gk{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Um(n){let e=[];do e.push(Jk(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Jk(n){let e=[];do e.push(qk(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function qk(n){let e=Xk(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=jk(n,e);else break;return e}function Vm(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function jk(n,e){let t=Vm(n),r=t;return n.eat(",")&&(n.next!="}"?r=Vm(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Yk(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let a=t[o];a.isInGroup(e)&&i.push(a)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function Xk(n){if(n.eat("(")){let e=Um(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=Yk(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Zk(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(a,c,f){let h={term:f,to:c};return e[a].push(h),h}function i(a,c){a.forEach(f=>f.to=c)}function o(a,c){if(a.type=="choice")return a.exprs.reduce((f,h)=>f.concat(o(h,c)),[]);if(a.type=="seq")for(let f=0;;f++){let h=o(a.exprs[f],c);if(f==a.exprs.length-1)return h;i(h,c=t())}else if(a.type=="star"){let f=t();return r(c,f),i(o(a.expr,f),f),[r(f)]}else if(a.type=="plus"){let f=t();return i(o(a.expr,c),f),i(o(a.expr,f),f),[r(f)]}else{if(a.type=="opt")return[r(c)].concat(o(a.expr,c));if(a.type=="range"){let f=c;for(let h=0;h<a.min;h++){let m=t();i(o(a.expr,f),m),f=m}if(a.max==-1)i(o(a.expr,f),f);else for(let h=a.min;h<a.max;h++){let m=t();r(f,m),i(o(a.expr,f),m),f=m}return[r(f)]}else{if(a.type=="name")return[r(c,void 0,a.value)];throw new Error("Unknown expr type")}}}}function Km(n,e){return e-n}function Gm(n,e){let t=[];return r(e),t.sort(Km);function r(i){let o=n[i];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(i);for(let a=0;a<o.length;a++){let{term:c,to:f}=o[a];!c&&t.indexOf(f)==-1&&r(f)}}}function Qk(n){let e=Object.create(null);return t(Gm(n,0));function t(r){let i=[];r.forEach(a=>{n[a].forEach(({term:c,to:f})=>{if(!c)return;let h;for(let m=0;m<i.length;m++)i[m][0]==c&&(h=i[m][1]);Gm(n,f).forEach(m=>{h||i.push([c,h=[]]),h.indexOf(m)==-1&&h.push(m)})})});let o=e[r.join(",")]=new Yr(r.indexOf(n.length-1)>-1);for(let a=0;a<i.length;a++){let c=i[a][1].sort(Km);o.next.push({type:i[a][0],next:e[c.join(",")]||t(c)})}return o}}function e_(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],o=!i.validEnd,a=[];for(let c=0;c<i.next.length;c++){let{type:f,next:h}=i.next[c];a.push(f.name),o&&!(f.isText||f.hasRequiredAttrs())&&(o=!1),r.indexOf(h)==-1&&r.push(h)}o&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Jm(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function qm(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let o=n[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=i}return t}function jm(n,e,t,r){for(let i in e)if(!(i in n))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${i}`);for(let i in n){let o=n[i];o.validate&&o.validate(e[i])}}function Ym(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new n_(n,r,e[r]);return t}let Xm=class ky{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Ym(e,r.attrs),this.defaultAttrs=Jm(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Yr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:qm(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ur(this,this.computeAttrs(e),L.from(t),Te.setFrom(r))}createChecked(e=null,t,r){return t=L.from(t),this.checkContent(t),new ur(this,this.computeAttrs(e),t,Te.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=L.from(t),t.size){let a=this.contentMatch.fillBefore(t);if(!a)return null;t=a.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(L.empty,!0);return o?new ur(this,e,t.append(o),Te.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){jm(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:Te.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,a)=>r[o]=new ky(o,t,a));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function t_(n,e,t){let r=t.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${o}`)}}class n_{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?t_(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Aa{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Ym(e,i.attrs),this.excluded=null;let o=Jm(this.attrs);this.instance=o?new Te(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Te(this,qm(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,a)=>r[o]=new Aa(o,i++,t,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){jm(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Zm{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Xe.from(e.nodes),t.marks=Xe.from(e.marks||{}),this.nodes=Xm.compile(this.spec.nodes,this),this.marks=Aa.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",c=o.spec.marks;if(o.contentMatch=r[a]||(r[a]=Yr.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=c=="_"?null:c?Qm(this,c.split(" ")):c==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:Qm(this,a.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,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Xm){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(t,r,i)}text(e,t){let r=this.nodes.text;return new Ma(r,r.defaultAttrs,e,Te.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return ur.fromJSON(this,e)}markFromJSON(e){return Te.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Qm(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],o=n.marks[i],a=o;if(o)t.push(o);else for(let c in n.marks){let f=n.marks[c];(i=="_"||f.spec.group&&f.spec.group.split(" ").indexOf(i)>-1)&&t.push(a=f)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function r_(n){return n.tag!=null}function i_(n){return n.style!=null}let vs=class dh{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(r_(i))this.tags.push(i);else if(i_(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,t={}){let r=new rg(this,t,!1);return r.addAll(e,Te.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new rg(this,t,!0);return r.addAll(e,Te.none,t.from,t.to),W.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(l_(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(e);if(a===!1)continue;o.attrs=a||void 0}return o}}}matchStyle(e,t,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],c=a.style;if(!(c.indexOf(e)!=0||a.context&&!r.matchesContext(a.context)||c.length>e.length&&(c.charCodeAt(e.length)!=61||c.slice(e.length+1)!=t))){if(a.getAttrs){let f=a.getAttrs(t);if(f===!1)continue;a.attrs=f||void 0}return a}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,a=0;for(;a<t.length;a++){let c=t[a];if((c.priority==null?50:c.priority)<o)break}t.splice(a,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(a=>{r(a=ig(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=ig(a)),a.node||a.ignore||a.mark||(a.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new dh(e,dh.schemaRules(e)))}};const eg={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},s_={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},tg={ol:!0,ul:!0},ws=1,Mu=2,fl=4;function ng(n,e,t){return e!=null?(e?ws:0)|(e==="full"?Mu:0):n&&n.whitespace=="pre"?ws|Mu:t&-5}class hl{constructor(e,t,r,i,o,a){this.type=e,this.attrs=t,this.marks=r,this.solid=i,this.options=a,this.content=[],this.activeMarks=Te.none,this.match=o||(a&fl?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(L.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ws)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let t=L.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(L.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!eg.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class rg{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=t.topNode,o,a=ng(null,t.preserveWhitespace,0)|(r?fl:0);i?o=new hl(i.type,i.attrs,Te.none,!0,t.topMatch||i.type.contentMatch,a):r?o=new hl(null,null,Te.none,!0,null,a):o=new hl(e.schema.topNodeType,null,Te.none,!0,null,a),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,i=this.top,o=i.options&Mu?"full":this.localPreserveWS||(i.options&ws)>0;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)o!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
7
+ `);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],c=e.previousSibling;(!a||c&&c.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),t),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let i=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),c;tg.hasOwnProperty(a)&&this.parser.normalizeLists&&o_(e);let f=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(c=this.parser.matchTag(e,this,r));e:if(f?f.ignore:s_.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!f||f.skip||f.closeParent){f&&f.closeParent?this.open=Math.max(0,this.open-1):f&&f.skip.nodeType&&(e=f.skip);let h,m=this.needsBlock;if(eg.hasOwnProperty(a))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),h=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let p=f&&f.skip?t:this.readStyles(e,t);p&&this.addAll(e,p),h&&this.sync(o),this.needsBlock=m}else{let h=this.readStyles(e,t);h&&this.addElementByRule(e,f,h,f.consuming===!1?c:void 0)}this.localPreserveWS=i}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
8
+ `),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],a=r.getPropertyValue(o);if(a)for(let c=void 0;;){let f=this.parser.matchStyle(o,a,this,c);if(!f)break;if(f.ignore)return null;if(f.clearMark?t=t.filter(h=>!f.clearMark(h)):t=t.concat(this.parser.schema.marks[f.mark].create(f.attrs)),f.consuming===!1)c=f;else break}}return t}addElementByRule(e,t,r,i){let o,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),r)||this.leafFallback(e,r);else{let f=this.enter(a,t.attrs||null,r,t.preserveWhitespace);f&&(o=!0,r=f)}else{let f=this.parser.schema.marks[t.mark];r=r.concat(f.create(t.attrs))}let c=this.top;if(a&&a.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(f=>this.insertNode(f,r));else{let f=e;typeof t.contentElement=="string"?f=e.querySelector(t.contentElement):typeof t.contentElement=="function"?f=t.contentElement(e):t.contentElement&&(f=t.contentElement),this.findAround(e,f,!0),this.addAll(f,r),this.findAround(e,f,!1)}o&&this.sync(c)&&this.open--}addAll(e,t,r,i){let o=r||0;for(let a=r?e.childNodes[r]:e.firstChild,c=i==null?null:e.childNodes[i];a!=c;a=a.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(a,t);this.findAtPoint(e,o)}findPlace(e,t){let r,i;for(let o=this.open;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!r||r.length>c.length)&&(r=c,i=a,!c.length)||a.solid)break}if(!r)return null;this.sync(i);for(let o=0;o<r.length;o++)t=this.enterInner(r[o],null,t,!1);return t}insertNode(e,t){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(t=this.enterInner(i,null,t))}let r=this.findPlace(e,t);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=Te.none;for(let a of r.concat(e.marks))(i.type?i.type.allowsMarkType(a.type):sg(a.type,e.type))&&(o=a.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,t,r,i){let o=this.findPlace(e.create(t),r);return o&&(o=this.enterInner(e,t,r,!0,i)),o}enterInner(e,t,r,i=!1,o){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let c=ng(e,o,a.options);a.options&fl&&a.content.length==0&&(c|=fl);let f=Te.none;return r=r.filter(h=>(a.type?a.type.allowsMarkType(h.type):sg(h.type,e))?(f=h.addToSet(f),!1):!0),this.nodes.push(new hl(e,t,f,i,null,c)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=ws)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(c,f)=>{for(;c>=0;c--){let h=t[c];if(h==""){if(c==t.length-1||c==0)continue;for(;f>=o;f--)if(a(c-1,f))return!0;return!1}else{let m=f>0||f==0&&i?this.nodes[f].type:r&&f>=o?r.node(f-o).type:null;if(!m||m.name!=h&&!m.isInGroup(h))return!1;f--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function o_(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&tg.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function l_(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function ig(n){let e={};for(let t in n)e[t]=n[t];return e}function sg(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],a=c=>{o.push(c);for(let f=0;f<c.edgeCount;f++){let{type:h,next:m}=c.edge(f);if(h==e||o.indexOf(m)<0&&a(m))return!0}};if(a(i.contentMatch))return!0}}class Us{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Au(t).createDocumentFragment());let i=r,o=[];return e.forEach(a=>{if(o.length||a.marks.length){let c=0,f=0;for(;c<o.length&&f<a.marks.length;){let h=a.marks[f];if(!this.marks[h.type.name]){f++;continue}if(!h.eq(o[c][0])||h.type.spec.spanning===!1)break;c++,f++}for(;c<o.length;)i=o.pop()[1];for(;f<a.marks.length;){let h=a.marks[f++],m=this.serializeMark(h,a.isInline,t);m&&(o.push([h,i]),i.appendChild(m.dom),i=m.contentDOM||m.dom)}}i.appendChild(this.serializeNodeInner(a,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=dl(Au(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&dl(Au(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return dl(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Us(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=og(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return og(e.marks)}}function og(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Au(n){return n.document||window.document}const lg=new WeakMap;function a_(n){let e=lg.get(n);return e===void 0&&lg.set(n,e=c_(n)),e}function c_(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)t(r[i]);else for(let i in r)t(r[i])}return t(n),e}function dl(n,e,t,r){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=a_(r))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=i.indexOf(" ");a>0&&(t=i.slice(0,a),i=i.slice(a+1));let c,f=t?n.createElementNS(t,i):n.createElement(i),h=e[1],m=1;if(h&&typeof h=="object"&&h.nodeType==null&&!Array.isArray(h)){m=2;for(let p in h)if(h[p]!=null){let g=p.indexOf(" ");g>0?f.setAttributeNS(p.slice(0,g),p.slice(g+1),h[p]):f.setAttribute(p,h[p])}}for(let p=m;p<e.length;p++){let g=e[p];if(g===0){if(p<e.length-1||p>m)throw new RangeError("Content hole must be the only child of its parent node");return{dom:f,contentDOM:f}}else{let{dom:b,contentDOM:S}=dl(n,g,t,r);if(f.appendChild(b),S){if(c)throw new RangeError("Multiple content holes");c=S}}}return{dom:f,contentDOM:c}}const ag=65535,cg=Math.pow(2,16);function u_(n,e){return n+e*cg}function ug(n){return n&ag}function f_(n){return(n-(n&ag))/cg}const fg=1,hg=2,pl=4,dg=8;class Iu{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&dg)>0}get deletedBefore(){return(this.delInfo&(fg|pl))>0}get deletedAfter(){return(this.delInfo&(hg|pl))>0}get deletedAcross(){return(this.delInfo&pl)>0}}class Ot{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Ot.empty)return Ot.empty}recover(e){let t=0,r=ug(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+f_(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let c=0;c<this.ranges.length;c+=3){let f=this.ranges[c]-(this.inverted?i:0);if(f>e)break;let h=this.ranges[c+o],m=this.ranges[c+a],p=f+h;if(e<=p){let g=h?e==f?-1:e==p?1:t:t,b=f+i+(g<0?0:m);if(r)return b;let S=e==(t<0?f:p)?null:u_(c/3,e-f),E=e==f?hg:e==p?fg:pl;return(t<0?e!=f:e!=p)&&(E|=dg),new Iu(b,E,S)}i+=m-h}return r?e+i:new Iu(e+i,0,null)}touches(e,t){let r=0,i=ug(t),o=this.inverted?2:1,a=this.inverted?1:2;for(let c=0;c<this.ranges.length;c+=3){let f=this.ranges[c]-(this.inverted?r:0);if(f>e)break;let h=this.ranges[c+o],m=f+h;if(e<=m&&c==i*3)return!0;r+=this.ranges[c+a]-h}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],c=a-(this.inverted?o:0),f=a+(this.inverted?0:o),h=this.ranges[i+t],m=this.ranges[i+r];e(c,c+h,f,f+m),o+=m-h}}invert(){return new Ot(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Ot.empty:new Ot(e<0?[0,-e,0]:[0,0,e])}}Ot.empty=new Ot([]);class zi{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new zi(this.maps,this.mirror,e,t)}copy(){return new zi(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new zi;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o],c=a.mapResult(e,t);if(c.recover!=null){let f=this.getMirror(o);if(f!=null&&f>o&&f<this.to){o=f,e=this.maps[f].recover(c.recover);continue}}i|=c.delInfo,e=c.pos}return r?e:new Iu(e,i,null)}}const Ou=Object.create(null);class $e{getMap(){return Ot.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Ou[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Ou)throw new RangeError("Duplicate use of step JSON ID "+e);return Ou[e]=t,t.prototype.jsonID=e,t}}class Re{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Re(e,null)}static fail(e){return new Re(null,e)}static fromReplace(e,t,r,i){try{return Re.ok(e.replace(t,r,i))}catch(o){if(o instanceof al)return Re.fail(o.message);throw o}}}function Nu(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(Nu(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return L.fromArray(r)}class _r extends $e{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new W(Nu(t.content,(a,c)=>!a.isAtom||!c.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),t.openStart,t.openEnd);return Re.fromReplace(e,this.from,this.to,o)}invert(){return new yn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new _r(t.pos,r.pos,this.mark)}merge(e){return e instanceof _r&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new _r(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new _r(t.from,t.to,e.markFromJSON(t.mark))}}$e.jsonID("addMark",_r);class yn extends $e{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new W(Nu(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Re.fromReplace(e,this.from,this.to,r)}invert(){return new _r(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new yn(t.pos,r.pos,this.mark)}merge(e){return e instanceof yn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new yn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new yn(t.from,t.to,e.markFromJSON(t.mark))}}$e.jsonID("removeMark",yn);class Tr extends $e{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Re.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Re.fromReplace(e,this.pos,this.pos+1,new W(L.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new Tr(this.pos,t.marks[i]);return new Tr(this.pos,this.mark)}}return new Bi(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Tr(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Tr(t.pos,e.markFromJSON(t.mark))}}$e.jsonID("addNodeMark",Tr);class Bi extends $e{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Re.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Re.fromReplace(e,this.pos,this.pos+1,new W(L.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Tr(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Bi(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Bi(t.pos,e.markFromJSON(t.mark))}}$e.jsonID("removeNodeMark",Bi);class Ge extends $e{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&Ru(e,this.from,this.to)?Re.fail("Structure replace would overwrite content"):Re.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ot([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ge(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new Ge(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Ge)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?W.empty:new W(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ge(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?W.empty:new W(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ge(e.from,this.to,t,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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ge(t.from,t.to,W.fromJSON(e,t.slice),!!t.structure)}}$e.jsonID("replace",Ge);class Ke extends $e{constructor(e,t,r,i,o,a,c=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=c}apply(e){if(this.structure&&(Ru(e,this.from,this.gapFrom)||Ru(e,this.gapTo,this.to)))return Re.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Re.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?Re.fromReplace(e,this.from,this.to,r):Re.fail("Content does not fit in gap")}getMap(){return new Ot([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Ke(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new Ke(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ke(t.from,t.to,t.gapFrom,t.gapTo,W.fromJSON(e,t.slice),t.insert,!!t.structure)}}$e.jsonID("replaceAround",Ke);function Ru(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function h_(n,e,t,r){let i=[],o=[],a,c;n.doc.nodesBetween(e,t,(f,h,m)=>{if(!f.isInline)return;let p=f.marks;if(!r.isInSet(p)&&m.type.allowsMarkType(r.type)){let g=Math.max(h,e),b=Math.min(h+f.nodeSize,t),S=r.addToSet(p);for(let E=0;E<p.length;E++)p[E].isInSet(S)||(a&&a.to==g&&a.mark.eq(p[E])?a.to=b:i.push(a=new yn(g,b,p[E])));c&&c.to==g?c.to=b:o.push(c=new _r(g,b,r))}}),i.forEach(f=>n.step(f)),o.forEach(f=>n.step(f))}function d_(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(a,c)=>{if(!a.isInline)return;o++;let f=null;if(r instanceof Aa){let h=a.marks,m;for(;m=r.isInSet(h);)(f||(f=[])).push(m),h=m.removeFromSet(h)}else r?r.isInSet(a.marks)&&(f=[r]):f=a.marks;if(f&&f.length){let h=Math.min(c+a.nodeSize,t);for(let m=0;m<f.length;m++){let p=f[m],g;for(let b=0;b<i.length;b++){let S=i[b];S.step==o-1&&p.eq(i[b].style)&&(g=S)}g?(g.to=h,g.step=o):i.push({style:p,from:Math.max(c,e),to:h,step:o})}}}),i.forEach(a=>n.step(new yn(a.from,a.to,a.style)))}function Lu(n,e,t,r=t.contentMatch,i=!0){let o=n.doc.nodeAt(e),a=[],c=e+1;for(let f=0;f<o.childCount;f++){let h=o.child(f),m=c+h.nodeSize,p=r.matchType(h.type);if(!p)a.push(new Ge(c,m,W.empty));else{r=p;for(let g=0;g<h.marks.length;g++)t.allowsMarkType(h.marks[g].type)||n.step(new yn(c,m,h.marks[g]));if(i&&h.isText&&t.whitespace!="pre"){let g,b=/\r?\n|\r/g,S;for(;g=b.exec(h.text);)S||(S=new W(L.from(t.schema.text(" ",t.allowedMarks(h.marks))),0,0)),a.push(new Ge(c+g.index,c+g.index+g[0].length,S))}}c=m}if(!r.validEnd){let f=r.fillBefore(L.empty,!0);n.replace(c,c,new W(f,0,0))}for(let f=a.length-1;f>=0;f--)n.step(a[f])}function p_(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function xi(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),o=n.$from.index(r),a=n.$to.indexAfter(r);if(r<n.depth&&i.canReplace(o,a,t))return r;if(r==0||i.type.spec.isolating||!p_(i,o,a))break}return null}function m_(n,e,t){let{$from:r,$to:i,depth:o}=e,a=r.before(o+1),c=i.after(o+1),f=a,h=c,m=L.empty,p=0;for(let S=o,E=!1;S>t;S--)E||r.index(S)>0?(E=!0,m=L.from(r.node(S).copy(m)),p++):f--;let g=L.empty,b=0;for(let S=o,E=!1;S>t;S--)E||i.after(S+1)<i.end(S)?(E=!0,g=L.from(i.node(S).copy(g)),b++):h++;n.step(new Ke(f,h,a,c,new W(m.append(g),p,b),m.size-p,!0))}function Pu(n,e,t=null,r=n){let i=g_(n,e),o=i&&y_(r,e);return o?i.map(pg).concat({type:e,attrs:t}).concat(o.map(pg)):null}function pg(n){return{type:n,attrs:null}}function g_(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.contentMatchAt(r).findWrapping(e);if(!o)return null;let a=o.length?o[0]:e;return t.canReplaceWith(r,i,a)?o:null}function y_(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.child(r),a=e.contentMatch.findWrapping(o.type);if(!a)return null;let f=(a.length?a[a.length-1]:e).contentMatch;for(let h=r;f&&h<i;h++)f=f.matchType(t.child(h).type);return!f||!f.validEnd?null:a}function b_(n,e,t){let r=L.empty;for(let a=t.length-1;a>=0;a--){if(r.size){let c=t[a].type.contentMatch.matchFragment(r);if(!c||!c.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=L.from(t[a].type.create(t[a].attrs,r))}let i=e.start,o=e.end;n.step(new Ke(i,o,i,o,new W(r,0,0),t.length,!0))}function v_(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(a,c)=>{let f=typeof i=="function"?i(a):i;if(a.isTextblock&&!a.hasMarkup(r,f)&&w_(n.doc,n.mapping.slice(o).map(c),r)){let h=null;if(r.schema.linebreakReplacement){let b=r.whitespace=="pre",S=!!r.contentMatch.matchType(r.schema.linebreakReplacement);b&&!S?h=!1:!b&&S&&(h=!0)}h===!1&&gg(n,a,c,o),Lu(n,n.mapping.slice(o).map(c,1),r,void 0,h===null);let m=n.mapping.slice(o),p=m.map(c,1),g=m.map(c+a.nodeSize,1);return n.step(new Ke(p,g,p+1,g-1,new W(L.from(r.create(f,null,a.marks)),0,0),1,!0)),h===!0&&mg(n,a,c,o),!1}})}function mg(n,e,t,r){e.forEach((i,o)=>{if(i.isText){let a,c=/\r?\n|\r/g;for(;a=c.exec(i.text);){let f=n.mapping.slice(r).map(t+1+o+a.index);n.replaceWith(f,f+1,e.type.schema.linebreakReplacement.create())}}})}function gg(n,e,t,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let a=n.mapping.slice(r).map(t+1+o);n.replaceWith(a,a+1,e.type.schema.text(`
9
+ `))}})}function w_(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function S_(n,e,t,r,i){let o=n.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);let a=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,a);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new Ke(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new W(L.from(a),0,0),1,!0))}function Pn(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let h=i.depth-1,m=t-2;h>o;h--,m--){let p=i.node(h),g=i.index(h);if(p.type.spec.isolating)return!1;let b=p.content.cutByIndex(g,p.childCount),S=r&&r[m+1];S&&(b=b.replaceChild(0,S.type.create(S.attrs)));let E=r&&r[m]||p;if(!p.canReplace(g+1,p.childCount)||!E.type.validContent(b))return!1}let c=i.indexAfter(o),f=r&&r[0];return i.node(o).canReplaceWith(c,c,f?f.type:i.node(o+1).type)}function x_(n,e,t=1,r){let i=n.doc.resolve(e),o=L.empty,a=L.empty;for(let c=i.depth,f=i.depth-t,h=t-1;c>f;c--,h--){o=L.from(i.node(c).copy(o));let m=r&&r[h];a=L.from(m?m.type.create(m.attrs,a):i.node(c).copy(a))}n.step(new Ge(e,e,new W(o.append(a),t,t),!0))}function fr(n,e){let t=n.resolve(e),r=t.index();return yg(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function E_(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:r}=n.type.schema;for(let i=0;i<e.childCount;i++){let o=e.child(i),a=o.type==r?n.type.schema.nodes.text:o.type;if(t=t.matchType(a),!t||!n.type.allowsMarks(o.marks))return!1}return t.validEnd}function yg(n,e){return!!(n&&e&&!n.isLeaf&&E_(n,e))}function ml(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let o,a,c=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):t>0?(o=r.node(i+1),c++,a=r.node(i).maybeChild(c)):(o=r.node(i).maybeChild(c-1),a=r.node(i+1)),o&&!o.isTextblock&&yg(o,a)&&r.node(i).canReplace(c,c+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function k_(n,e,t){let r=null,{linebreakReplacement:i}=n.doc.type.schema,o=n.doc.resolve(e-t),a=o.node().type;if(i&&a.inlineContent){let m=a.whitespace=="pre",p=!!a.contentMatch.matchType(i);m&&!p?r=!1:!m&&p&&(r=!0)}let c=n.steps.length;if(r===!1){let m=n.doc.resolve(e+t);gg(n,m.node(),m.before(),c)}a.inlineContent&&Lu(n,e+t-1,a,o.node().contentMatchAt(o.index()),r==null);let f=n.mapping.slice(c),h=f.map(e-t);if(n.step(new Ge(h,f.map(e+t,-1),W.empty,!0)),r===!0){let m=n.doc.resolve(h);mg(n,m.node(),m.before(),n.steps.length)}return n}function __(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,t))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,t))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function T_(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let i=t.content;for(let o=0;o<t.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(t.openStart==0&&t.size?2:1);o++)for(let a=r.depth;a>=0;a--){let c=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,f=r.index(a)+(c>0?1:0),h=r.node(a),m=!1;if(o==1)m=h.canReplace(f,f,i);else{let p=h.contentMatchAt(f).findWrapping(i.firstChild.type);m=p&&h.canReplaceWith(f,f,p[0])}if(m)return c==0?r.pos:c<0?r.before(a+1):r.after(a+1)}return null}function gl(n,e,t=e,r=W.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return bg(i,o,r)?new Ge(e,t,r):new C_(i,o,r).fit()}function bg(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class C_{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=L.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=L.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let h=this.findFittable();h?this.placeNodes(h):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,a=r.depth,c=i.depth;for(;a&&c&&o.childCount==1;)o=o.firstChild.content,a--,c--;let f=new W(o,a,c);return e>-1?new Ke(r.pos,e,this.$to.pos,this.$to.end(),f,t):f.size||r.pos!=this.$to.pos?new Ge(r.pos,i.pos,f):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=t.firstChild;if(t.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}t=o.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=Du(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let a=i.firstChild;for(let c=this.depth;c>=0;c--){let{type:f,match:h}=this.frontier[c],m,p=null;if(t==1&&(a?h.matchType(a.type)||(p=h.fillBefore(L.from(a),!1)):o&&f.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:c,parent:o,inject:p};if(t==2&&a&&(m=h.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:c,parent:o,wrap:m};if(o&&h.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=Du(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new W(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=Du(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new W(Ss(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new W(Ss(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let E=0;E<o.length;E++)this.openFrontierNode(o[E]);let a=this.unplaced,c=r?r.content:a.content,f=a.openStart-e,h=0,m=[],{match:p,type:g}=this.frontier[t];if(i){for(let E=0;E<i.childCount;E++)m.push(i.child(E));p=p.matchFragment(i)}let b=c.size+e-(a.content.size-a.openEnd);for(;h<c.childCount;){let E=c.child(h),C=p.matchType(E.type);if(!C)break;h++,(h>1||f==0||E.content.size)&&(p=C,m.push(vg(E.mark(g.allowedMarks(E.marks)),h==1?f:0,h==c.childCount?b:-1)))}let S=h==c.childCount;S||(b=-1),this.placed=xs(this.placed,t,L.from(m)),this.frontier[t].match=p,S&&b<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let E=0,C=c;E<b;E++){let M=C.lastChild;this.frontier.push({type:M.type,match:M.contentMatchAt(M.childCount)}),C=M.content}this.unplaced=S?e==0?W.empty:new W(Ss(a.content,e-1,1),e-1,b<0?a.openEnd:e-1):new W(Ss(a.content,e,h),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!zu(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=zu(e,t,i,r,o);if(a){for(let c=t-1;c>=0;c--){let{match:f,type:h}=this.frontier[c],m=zu(e,c,h,f,!0);if(!m||m.childCount)continue e}return{depth:t,fit:a,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=xs(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=xs(this.placed,this.depth,L.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(L.empty,!0);t.childCount&&(this.placed=xs(this.placed,this.frontier.length,t))}}function Ss(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Ss(n.firstChild.content,e-1,t)))}function xs(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(xs(n.lastChild.content,e-1,t)))}function Du(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function vg(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,vg(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(L.empty,!0)))),n.copy(r)}function zu(n,e,t,r,i){let o=n.node(e),a=i?n.indexAfter(e):n.index(e);if(a==o.childCount&&!t.compatibleContent(o.type))return null;let c=r.fillBefore(o.content,!0,a);return c&&!M_(t,o.content,a)?c:null}function M_(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function A_(n){return n.spec.defining||n.spec.definingForContent}function I_(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),o=n.doc.resolve(t);if(bg(i,o,r))return n.step(new Ge(e,t,r));let a=Sg(i,n.doc.resolve(t));a[a.length-1]==0&&a.pop();let c=-(i.depth+1);a.unshift(c);for(let g=i.depth,b=i.pos-1;g>0;g--,b--){let S=i.node(g).type.spec;if(S.defining||S.definingAsContext||S.isolating)break;a.indexOf(g)>-1?c=g:i.before(g)==b&&a.splice(1,0,-g)}let f=a.indexOf(c),h=[],m=r.openStart;for(let g=r.content,b=0;;b++){let S=g.firstChild;if(h.push(S),b==r.openStart)break;g=S.content}for(let g=m-1;g>=0;g--){let b=h[g],S=A_(b.type);if(S&&!b.sameMarkup(i.node(Math.abs(c)-1)))m=g;else if(S||!b.type.isTextblock)break}for(let g=r.openStart;g>=0;g--){let b=(g+m+1)%(r.openStart+1),S=h[b];if(S)for(let E=0;E<a.length;E++){let C=a[(E+f)%a.length],M=!0;C<0&&(M=!1,C=-C);let P=i.node(C-1),F=i.index(C-1);if(P.canReplaceWith(F,F,S.type,S.marks))return n.replace(i.before(C),M?o.after(C):t,new W(wg(r.content,0,r.openStart,b),b,r.openEnd))}}let p=n.steps.length;for(let g=a.length-1;g>=0&&(n.replace(e,t,r),!(n.steps.length>p));g--){let b=a[g];b<0||(e=i.before(b),t=o.after(b))}}function wg(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(wg(o.content,e+1,t,r,o)))}if(e>r){let o=i.contentMatchAt(0),a=o.fillBefore(n).append(n);n=a.append(o.matchFragment(a).fillBefore(L.empty,!0))}return n}function O_(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=__(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new W(L.from(r),0,0))}function N_(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=Sg(r,i);for(let a=0;a<o.length;a++){let c=o[a],f=a==o.length-1;if(f&&c==0||r.node(c).type.contentMatch.validEnd)return n.delete(r.start(c),i.end(c));if(c>0&&(f||r.node(c-1).canReplace(r.index(c-1),i.indexAfter(c-1))))return n.delete(r.before(c),i.after(c))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(e-r.start(a)==r.depth-a&&t>r.end(a)&&i.end(a)-t!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return n.delete(r.before(a),t);n.delete(e,t)}function Sg(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let o=n.start(i);if(o<n.pos-(n.depth-i)||e.end(i)>e.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&t.push(i)}return t}class Fi extends $e{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Re.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Re.fromReplace(e,this.pos,this.pos+1,new W(L.from(i),0,t.isLeaf?0:1))}getMap(){return Ot.empty}invert(e){return new Fi(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Fi(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Fi(t.pos,t.attr,t.value)}}$e.jsonID("attr",Fi);class Ks extends $e{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return Re.ok(r)}getMap(){return Ot.empty}invert(e){return new Ks(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Ks(t.attr,t.value)}}$e.jsonID("docAttr",Ks);let Ei=class extends Error{};Ei=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},Ei.prototype=Object.create(Error.prototype),Ei.prototype.constructor=Ei,Ei.prototype.name="TransformError";class R_{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new zi}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ei(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=W.empty){let i=gl(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new W(L.from(r),0,0))}delete(e,t){return this.replace(e,t,W.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return I_(this,e,t,r),this}replaceRangeWith(e,t,r){return O_(this,e,t,r),this}deleteRange(e,t){return N_(this,e,t),this}lift(e,t){return m_(this,e,t),this}join(e,t=1){return k_(this,e,t),this}wrap(e,t){return b_(this,e,t),this}setBlockType(e,t=e,r,i=null){return v_(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return S_(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new Fi(e,t,r)),this}setDocAttribute(e,t){return this.step(new Ks(e,t)),this}addNodeMark(e,t){return this.step(new Tr(e,t)),this}removeNodeMark(e,t){if(!(t instanceof Te)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new Bi(e,t)),this}split(e,t=1,r){return x_(this,e,t,r),this}addMark(e,t,r){return h_(this,e,t,r),this}removeMark(e,t,r){return d_(this,e,t,r),this}clearIncompatible(e,t,r){return Lu(this,e,t,r),this}}const Bu=Object.create(null);class pe{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new L_(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=W.empty){let r=t.content.lastChild,i=null;for(let c=0;c<t.openEnd;c++)i=r,r=r.lastChild;let o=e.steps.length,a=this.ranges;for(let c=0;c<a.length;c++){let{$from:f,$to:h}=a[c],m=e.mapping.slice(o);e.replaceRange(m.map(f.pos),m.map(h.pos),c?W.empty:t),c==0&&kg(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:c}=i[o],f=e.mapping.slice(r),h=f.map(a.pos),m=f.map(c.pos);o?e.deleteRange(h,m):(e.replaceRangeWith(h,m,t),kg(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new ce(e):ki(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let a=t<0?ki(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):ki(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(a)return a}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new It(e.node(0))}static atStart(e){return ki(e,e,0,0,1)||new It(e)}static atEnd(e){return ki(e,e,e.content.size,e.childCount,-1)||new It(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Bu[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Bu)throw new RangeError("Duplicate use of selection JSON ID "+e);return Bu[e]=t,t.prototype.jsonID=e,t}getBookmark(){return ce.between(this.$anchor,this.$head).getBookmark()}}pe.prototype.visible=!0;class L_{constructor(e,t){this.$from=e,this.$to=t}}let xg=!1;function Eg(n){!xg&&!n.parent.inlineContent&&(xg=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class ce extends pe{constructor(e,t=e){Eg(e),Eg(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return pe.near(r);let i=e.resolve(t.map(this.anchor));return new ce(i.parent.inlineContent?i:r,r)}replace(e,t=W.empty){if(super.replace(e,t),t==W.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ce&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ia(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ce(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let o=pe.findFrom(t,r,!0)||pe.findFrom(t,-r,!0);if(o)t=o.$head;else return pe.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(pe.findFrom(e,-r,!0)||pe.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new ce(e,t)}}pe.jsonID("text",ce);class Ia{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Ia(e.map(this.anchor),e.map(this.head))}resolve(e){return ce.between(e.resolve(this.anchor),e.resolve(this.head))}}class Y extends pe{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:i}=t.mapResult(this.anchor),o=e.resolve(i);return r?pe.near(o):new Y(o)}content(){return new W(L.from(this.node),0,0)}eq(e){return e instanceof Y&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new ph(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Y(e.resolve(t.anchor))}static create(e,t){return new Y(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Y.prototype.visible=!1,pe.jsonID("node",Y);class ph{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new Ia(r,r):new ph(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&Y.isSelectable(r)?new Y(t):pe.near(t)}}class It extends pe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=W.empty){if(t==W.empty){e.delete(0,e.doc.content.size);let r=pe.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new It(e)}map(e){return new It(e)}eq(e){return e instanceof It}getBookmark(){return P_}}pe.jsonID("all",It);const P_={map(){return this},resolve(n){return new It(n)}};function ki(n,e,t,r,i,o=!1){if(e.inlineContent)return ce.create(n,t);for(let a=r-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){let c=e.child(a);if(c.isAtom){if(!o&&Y.isSelectable(c))return Y.create(n,t-(i<0?c.nodeSize:0))}else{let f=ki(n,c,t+i,i<0?c.childCount:0,i,o);if(f)return f}t+=c.nodeSize*i}return null}function kg(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof Ge||i instanceof Ke))return;let o=n.mapping.maps[r],a;o.forEach((c,f,h,m)=>{a==null&&(a=m)}),n.setSelection(pe.near(n.doc.resolve(a),t))}function _g(n,e){return!e||!n?n:n.bind(e)}class yl{constructor(e,t,r){this.name=e,this.init=_g(t.init,r),this.apply=_g(t.apply,r)}}new yl("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new yl("selection",{init(n,e){return n.selection||pe.atStart(e.doc)},apply(n){return n.selection}}),new yl("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new yl("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}});function Tg(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Tg(i,e,{})),t[r]=i}return t}class lt{constructor(e){this.spec=e,this.props={},e.props&&Tg(e.props,this,this.props),this.key=e.key?e.key.key:Cg("plugin")}getState(e){return e[this.key]}}const Fu=Object.create(null);function Cg(n){return n in Fu?n+"$"+ ++Fu[n]:(Fu[n]=0,n+"$")}class Ct{constructor(e="key"){this.key=Cg(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const $r=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},Mg=function(n,e,t,r){return t&&(Ag(n,e,t,r,-1)||Ag(n,e,t,r,1))},D_=/^(img|br|input|textarea|hr)$/i;function Ag(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:bl(n))){let o=n.parentNode;if(!o||o.nodeType!=1||Hu(n)||D_.test(n.nodeName)||n.contentEditable=="false")return!1;e=$r(n)+(i<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?bl(n):0}else return!1}}function bl(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function z_(n,e,t){for(let r=e==0,i=e==bl(n);r||i;){if(n==t)return!0;let o=$r(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==bl(n)}}function Hu(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const Ig=function(n){return n.focusNode&&Mg(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Og(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const fn=typeof navigator<"u"?navigator:null,Ng=typeof document<"u"?document:null,hr=fn&&fn.userAgent||"",$u=/Edge\/(\d+)/.exec(hr),Rg=/MSIE \d/.exec(hr),Wu=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(hr),Es=!!(Rg||Wu||$u),Lg=Rg?document.documentMode:Wu?+Wu[1]:$u?+$u[1]:0,vl=!Es&&/gecko\/(\d+)/i.test(hr);vl&&+(/Firefox\/(\d+)/.exec(hr)||[0,0])[1];const Uu=!Es&&/Chrome\/(\d+)/.exec(hr),dr=!!Uu,Pg=Uu?+Uu[1]:0,Wr=!Es&&!!fn&&/Apple Computer/.test(fn.vendor),Vu=Wr&&(/Mobile\/\w+/.test(hr)||!!fn&&fn.maxTouchPoints>2),Wt=Vu||(fn?/Mac/.test(fn.platform):!1),B_=fn?/Win/.test(fn.platform):!1,ks=/Android \d/.test(hr),Ku=!!Ng&&"webkitFontSmoothing"in Ng.documentElement.style,F_=Ku?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function H_(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),o=i&&i.size==0,a=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(a<0)return null;let c=r.resolve(a),f,h;if(Ig(t)){for(f=a;i&&!i.node;)i=i.parent;let p=i.node;if(i&&p.isAtom&&Y.isSelectable(p)&&i.parent&&!(p.isInline&&z_(t.focusNode,t.focusOffset,i.dom))){let g=i.posBefore;h=new Y(a==g?c:r.resolve(g))}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let p=a,g=a;for(let b=0;b<t.rangeCount;b++){let S=t.getRangeAt(b);p=Math.min(p,n.docView.posFromDOM(S.startContainer,S.startOffset,1)),g=Math.max(g,n.docView.posFromDOM(S.endContainer,S.endOffset,-1))}if(p<0)return null;[f,a]=g==n.state.selection.anchor?[g,p]:[p,g],c=r.resolve(a)}else f=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(f<0)return null}let m=r.resolve(f);if(!h){let p=e=="pointer"||n.state.selection.head<c.pos&&!o?1:-1;h=$g(n,m,c,p)}return h}function Dg(n){return n.editable?n.hasFocus():V_(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function Gu(n,e=!1){let t=n.state.selection;if(U_(n,t),!!Dg(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&dr){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Mg(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)W_(n);else{let{anchor:r,head:i}=t,o,a;zg&&!(t instanceof ce)&&(t.$from.parent.inlineContent||(o=Bg(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(a=Bg(n,t.to))),n.docView.setSelection(r,i,n,e),zg&&(o&&Fg(o),a&&Fg(a)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&$_(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const zg=Wr||dr&&Pg<63;function Bg(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=r<t.childNodes.length?t.childNodes[r]:null,o=r?t.childNodes[r-1]:null;if(Wr&&i&&i.contentEditable=="false")return Ju(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return Ju(i);if(o)return Ju(o)}}function Ju(n){return n.contentEditable="true",Wr&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function Fg(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function $_(n){let e=n.dom.ownerDocument;e.removeEventListener("selectionchange",n.input.hideSelectionGuard);let t=n.domSelectionRange(),r=t.anchorNode,i=t.anchorOffset;e.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!Dg(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function W_(n){let e=n.domSelection(),t=document.createRange();if(!e)return;let r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setStart(r.parentNode,$r(r)+1):t.setStart(r,0),t.collapse(!0),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&Es&&Lg<=11&&(r.disabled=!0,r.disabled=!1)}function U_(n,e){if(e instanceof Y){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(Hg(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else Hg(n)}function Hg(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function $g(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||ce.between(e,t,r)}function V_(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function qu(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),o=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return o&&pe.findFrom(o,e)}function pr(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function Wg(n,e,t){let r=n.state.selection;if(r instanceof ce)if(t.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let a=n.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return pr(n,new ce(r.$anchor,a))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let i=qu(n.state,e);return i&&i instanceof Y?pr(n,i):!1}else if(!(Wt&&t.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,a;if(!o||o.isText)return!1;let c=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(a=n.docView.descAt(c))&&!a.contentDOM?Y.isSelectable(o)?pr(n,new Y(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):Ku?pr(n,new ce(n.state.doc.resolve(e<0?c:c+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Y&&r.node.isInline)return pr(n,new ce(e>0?r.$to:r.$from));{let i=qu(n.state,e);return i?pr(n,i):!1}}}function wl(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function _s(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function _i(n,e){return e<0?K_(n):G_(n)}function K_(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,a=!1;for(vl&&t.nodeType==1&&r<wl(t)&&_s(t.childNodes[r],-1)&&(a=!0);;)if(r>0){if(t.nodeType!=1)break;{let c=t.childNodes[r-1];if(_s(c,-1))i=t,o=--r;else if(c.nodeType==3)t=c,r=t.nodeValue.length;else break}}else{if(Ug(t))break;{let c=t.previousSibling;for(;c&&_s(c,-1);)i=t.parentNode,o=$r(c),c=c.previousSibling;if(c)t=c,r=wl(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}a?ju(n,t,r):i&&ju(n,i,o)}function G_(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=wl(t),o,a;for(;;)if(r<i){if(t.nodeType!=1)break;let c=t.childNodes[r];if(_s(c,1))o=t,a=++r;else break}else{if(Ug(t))break;{let c=t.nextSibling;for(;c&&_s(c,1);)o=c.parentNode,a=$r(c)+1,c=c.nextSibling;if(c)t=c,r=0,i=wl(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}o&&ju(n,o,a)}function Ug(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function J_(n,e){for(;n&&e==n.childNodes.length&&!Hu(n);)e=$r(n)+1,n=n.parentNode;for(;n&&e<n.childNodes.length;){let t=n.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=0}}function q_(n,e){for(;n&&!e&&!Hu(n);)e=$r(n),n=n.parentNode;for(;n&&e;){let t=n.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=n.childNodes.length}}function ju(n,e,t){if(e.nodeType!=3){let o,a;(a=J_(e,t))?(e=a,t=0):(o=q_(e,t))&&(e=o,t=o.nodeValue.length)}let r=n.domSelection();if(!r)return;if(Ig(r)){let o=document.createRange();o.setEnd(e,t),o.setStart(e,t),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:i}=n;setTimeout(()=>{n.state==i&&Gu(n)},50)}function Vg(n,e){let t=n.state.doc.resolve(e);if(!(dr||B_)&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let o=n.coordsAtPos(e-1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(e<t.end()){let o=n.coordsAtPos(e+1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function Kg(n,e,t){let r=n.state.selection;if(r instanceof ce&&!r.empty||t.indexOf("s")>-1||Wt&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let a=qu(n.state,e);if(a&&a instanceof Y)return pr(n,a)}if(!i.parent.inlineContent){let a=e<0?i:o,c=r instanceof It?pe.near(a,e):pe.findFrom(a,e);return c?pr(n,c):!1}return!1}function Gg(n,e){if(!(n.state.selection instanceof ce))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let a=n.state.tr;return e<0?a.delete(t.pos-o.nodeSize,t.pos):a.delete(t.pos,t.pos+o.nodeSize),n.dispatch(a),!0}return!1}function Jg(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function j_(n){if(!Wr||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Jg(n,r,"true"),setTimeout(()=>Jg(n,r,"false"),20)}return!1}function Y_(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function X_(n,e){let t=e.keyCode,r=Y_(e);if(t==8||Wt&&t==72&&r=="c")return Gg(n,-1)||_i(n,-1);if(t==46&&!e.shiftKey||Wt&&t==68&&r=="c")return Gg(n,1)||_i(n,1);if(t==13||t==27)return!0;if(t==37||Wt&&t==66&&r=="c"){let i=t==37?Vg(n,n.state.selection.from)=="ltr"?-1:1:-1;return Wg(n,i,r)||_i(n,i)}else if(t==39||Wt&&t==70&&r=="c"){let i=t==39?Vg(n,n.state.selection.from)=="ltr"?1:-1:1;return Wg(n,i,r)||_i(n,i)}else{if(t==38||Wt&&t==80&&r=="c")return Kg(n,-1,r)||_i(n,-1);if(t==40||Wt&&t==78&&r=="c")return j_(n)||Kg(n,1,r)||_i(n,1);if(r==(Wt?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function qg(n,e){n.someProp("transformCopied",b=>{e=b(e,n)});let t=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let b=r.firstChild;t.push(b.type.name,b.attrs!=b.type.defaultAttrs?b.attrs:null),r=b.content}let a=n.someProp("clipboardSerializer")||Us.fromSchema(n.state.schema),c=n0(),f=c.createElement("div");f.appendChild(a.serializeFragment(r,{document:c}));let h=f.firstChild,m,p=0;for(;h&&h.nodeType==1&&(m=e0[h.nodeName.toLowerCase()]);){for(let b=m.length-1;b>=0;b--){let S=c.createElement(m[b]);for(;f.firstChild;)S.appendChild(f.firstChild);f.appendChild(S),p++}h=f.firstChild}h&&h.nodeType==1&&h.setAttribute("data-pm-slice",`${i} ${o}${p?` -${p}`:""} ${JSON.stringify(t)}`);let g=n.someProp("clipboardTextSerializer",b=>b(e,n))||e.content.textBetween(0,e.content.size,`
10
10
 
11
11
  `);return{dom:f,text:g,slice:e}}function jg(n,e,t,r,i){let o=i.parent.type.spec.code,a,c;if(!t&&!e)return null;let f=e&&(r||o||!t);if(f){if(n.someProp("transformPastedText",g=>{e=g(e,o||r,n)}),o)return e?new W(L.from(n.state.schema.text(e.replace(/\r\n?/g,`
12
- `))),0,0):W.empty;let p=n.someProp("clipboardTextParser",g=>g(e,i,r,n));if(p)c=p;else{let g=i.marks(),{schema:b}=n.state,S=Us.fromSchema(b);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(E=>{let C=a.appendChild(document.createElement("p"));E&&C.appendChild(S.serializeNode(b.text(E,g)))})}}else n.someProp("transformPastedHTML",p=>{t=p(t,n)}),a=eT(t),Ku&&tT(a);let h=a&&a.querySelector("[data-pm-slice]"),m=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(m&&m[3])for(let p=+m[3];p>0;p--){let g=a.firstChild;for(;g&&g.nodeType!=1;)g=g.nextSibling;if(!g)break;a=g}if(c||(c=(n.someProp("clipboardParser")||n.someProp("domParser")||vs.fromSchema(n.state.schema)).parseSlice(a,{preserveWhitespace:!!(f||m),context:i,ruleFromNode(g){return g.nodeName=="BR"&&!g.nextSibling&&g.parentNode&&!X_.test(g.parentNode.nodeName)?{ignore:!0}:null}})),m)c=nT(Qg(c,+m[1],+m[2]),m[4]);else if(c=W.maxOpen(Z_(c.content,i),!0),c.openStart||c.openEnd){let p=0,g=0;for(let b=c.content.firstChild;p<c.openStart&&!b.type.spec.isolating;p++,b=b.firstChild);for(let b=c.content.lastChild;g<c.openEnd&&!b.type.spec.isolating;g++,b=b.lastChild);c=Qg(c,p,g)}return n.someProp("transformPasted",p=>{c=p(c,n)}),c}const X_=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Z_(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),o,a=[];if(n.forEach(c=>{if(!a)return;let f=i.findWrapping(c.type),h;if(!f)return a=null;if(h=a.length&&o.length&&Xg(f,o,c,a[a.length-1],0))a[a.length-1]=h;else{a.length&&(a[a.length-1]=Zg(a[a.length-1],o.length));let m=Yg(c,f);a.push(m),i=i.matchType(m.type),o=f}}),a)return L.from(a)}return n}function Yg(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,L.from(n));return n}function Xg(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=Xg(n,e,t,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?t.type:n[i+1]))return r.copy(r.content.append(L.from(Yg(t,n,i+1))))}}function Zg(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,Zg(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(L.empty,!0);return n.copy(t.append(r))}function Yu(n,e,t,r,i,o){let a=e<0?n.firstChild:n.lastChild,c=a.content;return n.childCount>1&&(o=0),i<r-1&&(c=Yu(c,e,t,r,i+1,o)),i>=t&&(c=e<0?a.contentMatchAt(0).fillBefore(c,o<=i).append(c):c.append(a.contentMatchAt(a.childCount).fillBefore(L.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,a.copy(c))}function Qg(n,e,t){return e<n.openStart&&(n=new W(Yu(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new W(Yu(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const e0={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let t0=null;function n0(){return t0||(t0=document.implementation.createHTMLDocument("title"))}let Xu=null;function Q_(n){let e=window.trustedTypes;return e?(Xu||(Xu=e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),Xu.createHTML(n)):n}function eT(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=n0().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&e0[r[1].toLowerCase()])&&(n=i.map(o=>"<"+o+">").join("")+n+i.map(o=>"</"+o+">").reverse().join("")),t.innerHTML=Q_(n),i)for(let o=0;o<i.length;o++)t=t.querySelector(i[o])||t;return t}function tT(n){let e=n.querySelectorAll(dr?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let r=e[t];r.childNodes.length==1&&r.textContent=="\xA0"&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function nT(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return n}let{content:i,openStart:o,openEnd:a}=n;for(let c=r.length-2;c>=0;c-=2){let f=t.nodes[r[c]];if(!f||f.hasRequiredAttrs())break;i=L.from(f.create(r[c+1],i)),o++,a++}return new W(i,o,a)}const en={},Ct={};function mr(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}Ct.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!i0(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(ks&&dr&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),Vu&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,Og(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||Y_(n,t)?t.preventDefault():mr(n,"key")},Ct.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},Ct.keypress=(n,e)=>{let t=e;if(i0(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||$t&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof ce)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i))&&n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function Sl(n){return{left:n.clientX,top:n.clientY}}function rT(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Zu(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let a=o.depth+1;a>0;a--)if(n.someProp(e,c=>a>o.depth?c(n,t,o.nodeAfter,o.before(a),i,!0):c(n,t,o.node(a),o.before(a),i,!1)))return!0;return!1}function Ti(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function iT(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&Y.isSelectable(r)?(Ti(n,new Y(t)),!0):!1}function sT(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof Y&&(r=t.node);let o=n.state.doc.resolve(e);for(let a=o.depth+1;a>0;a--){let c=a>o.depth?o.nodeAfter:o.node(a);if(Y.isSelectable(c)){r&&t.$from.depth>0&&a>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?i=o.before(t.$from.depth):i=o.before(a);break}}return i!=null?(Ti(n,Y.create(n.state.doc,i)),!0):!1}function oT(n,e,t,r,i){return Zu(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?sT(n,t):iT(n,t))}function lT(n,e,t,r){return Zu(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function aT(n,e,t,r){return Zu(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||cT(n,t,r)}function cT(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(Ti(n,ce.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o),c=i.before(o);if(a.inlineContent)Ti(n,ce.create(r,c+1,c+1+a.content.size));else if(Y.isSelectable(a))Ti(n,Y.create(r,c));else continue;return!0}}function Qu(n){return xl(n)}const r0=$t?"metaKey":"ctrlKey";en.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Qu(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&rT(t,n.input.lastClick)&&!t[r0]&&(n.input.lastClick.type=="singleClick"?o="doubleClick":n.input.lastClick.type=="doubleClick"&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o};let a=n.posAtCoords(Sl(t));a&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new uT(n,a,t,!!r)):(o=="doubleClick"?lT:aT)(n,a.pos,a.inside,t)?t.preventDefault():mr(n,"pointer"))};class uT{constructor(e,t,r,i){this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[r0],this.allowDefault=r.shiftKey;let o,a;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),a=t.inside;else{let m=e.state.doc.resolve(t.pos);o=m.parent,a=m.depth?m.before():0}const c=i?null:r.target,f=c?e.docView.nearestDesc(c,!0):null;this.target=f&&f.dom.nodeType==1?f.dom:null;let{selection:h}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||h instanceof Y&&h.from<=a&&h.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&vl&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),mr(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Gu(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Sl(e))),this.updateAllowDefault(e),this.allowDefault||!t?mr(this.view,"pointer"):oT(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||$r&&this.mightDrag&&!this.mightDrag.node.isAtom||dr&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Ti(this.view,pe.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):mr(this.view,"pointer")}move(e){this.updateAllowDefault(e),mr(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}en.touchstart=n=>{n.input.lastTouch=Date.now(),Qu(n),mr(n,"pointer")},en.touchmove=n=>{n.input.lastTouch=Date.now(),mr(n,"pointer")},en.contextmenu=n=>Qu(n);function i0(n,e){return n.composing?!0:$r&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const fT=ks?5e3:-1;Ct.compositionstart=Ct.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof ce&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),xl(n,!0),n.markCursor=null;else if(xl(n,!e.selection.empty),vl&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(a.nodeType==3){let c=n.domSelection();c&&c.collapse(a,a.nodeValue.length);break}else i=a,o=-1}}n.input.composing=!0}s0(n,fT)},Ct.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,s0(n,20))};function s0(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>xl(n),e))}function hT(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=dT());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function dT(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function xl(n,e=!1){if(!(ks&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),hT(n),e||n.docView&&n.docView.dirty){let t=F_(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!n.state.selection.empty?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function pT(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const Ts=Es&&Lg<15||Vu&&z_<604;en.copy=Ct.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=Ts?null:t.clipboardData,a=r.content(),{dom:c,text:f}=qg(n,a);o?(t.preventDefault(),o.clearData(),o.setData("text/html",c.innerHTML),o.setData("text/plain",f)):pT(n,c),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function mT(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function gT(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?ef(n,r.value,null,i,e):ef(n,r.textContent,r.innerHTML,i,e)},50)}function ef(n,e,t,r,i){let o=jg(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",f=>f(n,i,o||W.empty)))return!0;if(!o)return!1;let a=mT(o),c=a?n.state.tr.replaceSelectionWith(a,r):n.state.tr.replaceSelection(o);return n.dispatch(c.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function o0(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Ct.paste=(n,e)=>{let t=e;if(n.composing&&!ks)return;let r=Ts?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&ef(n,o0(r),r.getData("text/html"),i,t)?t.preventDefault():gT(n,t)};class yT{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const l0=$t?"altKey":"ctrlKey";en.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,o=i.empty?null:n.posAtCoords(Sl(t)),a;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof Y?i.to-1:i.to))){if(r&&r.mightDrag)a=Y.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let p=n.docView.nearestDesc(t.target,!0);p&&p.node.type.spec.draggable&&p!=n.docView&&(a=Y.create(n.state.doc,p.posBefore))}}let c=(a||n.state.selection).content(),{dom:f,text:h,slice:m}=qg(n,c);(!t.dataTransfer.files.length||!dr||Pg>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(Ts?"Text":"text/html",f.innerHTML),t.dataTransfer.effectAllowed="copyMove",Ts||t.dataTransfer.setData("text/plain",h),n.dragging=new yT(m,!t[l0],a)},en.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},Ct.dragover=Ct.dragenter=(n,e)=>e.preventDefault(),Ct.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(Sl(t));if(!i)return;let o=n.state.doc.resolve(i.pos),a=r&&r.slice;a?n.someProp("transformPasted",S=>{a=S(a,n)}):a=jg(n,o0(t.dataTransfer),Ts?null:t.dataTransfer.getData("text/html"),!1,o);let c=!!(r&&!t[l0]);if(n.someProp("handleDrop",S=>S(n,t,a||W.empty,c))){t.preventDefault();return}if(!a)return;t.preventDefault();let f=a?__(n.state.doc,o.pos,a):o.pos;f==null&&(f=o.pos);let h=n.state.tr;if(c){let{node:S}=r;S?S.replace(h):h.deleteSelection()}let m=h.mapping.map(f),p=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,g=h.doc;if(p?h.replaceRangeWith(m,m,a.content.firstChild):h.replaceRange(m,m,a),h.doc.eq(g))return;let b=h.doc.resolve(m);if(p&&Y.isSelectable(a.content.firstChild)&&b.nodeAfter&&b.nodeAfter.sameMarkup(a.content.firstChild))h.setSelection(new Y(b));else{let S=h.mapping.map(f);h.mapping.maps[h.mapping.maps.length-1].forEach((E,C,M,P)=>S=P),h.setSelection($g(n,b,h.doc.resolve(S)))}n.focus(),n.dispatch(h.setMeta("uiEvent","drop"))},en.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&Gu(n)},20))},en.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)},en.beforeinput=(n,e)=>{if(dr&&ks&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",o=>o(n,Og(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in Ct)en[n]=Ct[n];function Cs(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class Oa{constructor(e,t){this.toDOM=e,this.spec=t||Wr,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:a}=e.mapResult(t.from+i,this.side<0?-1:1);return a?null:new bn(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Oa&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Cs(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Er{constructor(e,t){this.attrs=e,this.spec=t||Wr}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,a=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=a?null:new bn(o,a,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Er&&Cs(this.attrs,e.attrs)&&Cs(this.spec,e.spec)}static is(e){return e.type instanceof Er}destroy(){}}let bT=class ky{constructor(e,t){this.attrs=e,this.spec=t||Wr}map(e,t,r,i){let o=e.mapResult(t.from+i,1);if(o.deleted)return null;let a=e.mapResult(t.to+i,-1);return a.deleted||a.pos<=o.pos?null:new bn(o.pos-r,a.pos-r,this)}valid(e,t){let{index:r,offset:i}=e.content.findIndex(t.from),o;return i==t.from&&!(o=e.child(r)).isText&&i+o.nodeSize==t.to}eq(e){return this==e||e instanceof ky&&Cs(this.attrs,e.attrs)&&Cs(this.spec,e.spec)}destroy(){}};class bn{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new bn(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new bn(e,e,new Oa(t,r))}static inline(e,t,r,i){return new bn(e,t,new Er(r,i))}static node(e,t,r,i){return new bn(e,t,new bT(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Er}get widget(){return this.type instanceof Oa}}const Ci=[],Wr={};class Je{constructor(e,t){this.local=e.length?e:Ci,this.children=t.length?t:Ci}static create(e,t){return t.length?El(t,e,0,Wr):at}find(e,t,r){let i=[];return this.findInner(e??0,t??1e9,i,0,r),i}findInner(e,t,r,i,o){for(let a=0;a<this.local.length;a++){let c=this.local[a];c.from<=t&&c.to>=e&&(!o||o(c.spec))&&r.push(c.copy(c.from+i,c.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let c=this.children[a]+1;this.children[a+2].findInner(e-c,t-c,r,i+c,o)}}map(e,t,r){return this==at||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Wr)}mapInner(e,t,r,i,o){let a;for(let c=0;c<this.local.length;c++){let f=this.local[c].map(e,r,i);f&&f.type.valid(t,f)?(a||(a=[])).push(f):o.onRemove&&o.onRemove(this.local[c].spec)}return this.children.length?vT(this.children,a||[],e,t,r,i,o):a?new Je(a.sort(Ur),Ci):at}add(e,t){return t.length?this==at?Je.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,o=0;e.forEach((c,f)=>{let h=f+r,m;if(m=c0(t,c,h)){for(i||(i=this.children.slice());o<i.length&&i[o]<f;)o+=3;i[o]==f?i[o+2]=i[o+2].addInner(c,m,h+1):i.splice(o,0,f,f+c.nodeSize,El(m,c,h+1,Wr)),o+=3}});let a=a0(o?u0(t):t,-r);for(let c=0;c<a.length;c++)a[c].type.valid(e,a[c])||a.splice(c--,1);return new Je(a.length?this.local.concat(a).sort(Ur):this.local,i||this.children)}remove(e){return e.length==0||this==at?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let a,c=r[o]+t,f=r[o+1]+t;for(let m=0,p;m<e.length;m++)(p=e[m])&&p.from>c&&p.to<f&&(e[m]=null,(a||(a=[])).push(p));if(!a)continue;r==this.children&&(r=this.children.slice());let h=r[o+2].removeInner(a,c+1);h!=at?r[o+2]=h:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,a;o<e.length;o++)if(a=e[o])for(let c=0;c<i.length;c++)i[c].eq(a,t)&&(i==this.local&&(i=this.local.slice()),i.splice(c--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Je(i,r):at}forChild(e,t){if(this==at)return this;if(t.isLeaf)return Je.empty;let r,i;for(let c=0;c<this.children.length;c+=3)if(this.children[c]>=e){this.children[c]==e&&(r=this.children[c+2]);break}let o=e+1,a=o+t.content.size;for(let c=0;c<this.local.length;c++){let f=this.local[c];if(f.from<a&&f.to>o&&f.type instanceof Er){let h=Math.max(o,f.from)-o,m=Math.min(a,f.to)-o;h<m&&(i||(i=[])).push(f.copy(h,m))}}if(i){let c=new Je(i.sort(Ur),Ci);return r?new Xr([c,r]):c}return r||at}eq(e){if(this==e)return!0;if(!(e instanceof Je)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return tf(this.localsInner(e))}localsInner(e){if(this==at)return Ci;if(e.inlineContent||!this.local.some(Er.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Er||t.push(this.local[r]);return t}forEachSet(e){e(this)}}Je.empty=new Je([],[]),Je.removeOverlap=tf;const at=Je.empty;class Xr{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,Wr));return Xr.from(r)}forChild(e,t){if(t.isLeaf)return Je.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=at&&(o instanceof Xr?r=r.concat(o.members):r.push(o))}return Xr.from(r)}eq(e){if(!(e instanceof Xr)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!t)t=o;else{r&&(t=t.slice(),r=!1);for(let a=0;a<o.length;a++)t.push(o[a])}}return t?tf(r?t:t.sort(Ur)):Ci}static from(e){switch(e.length){case 0:return at;case 1:return e[0];default:return new Xr(e.every(t=>t instanceof Je)?e:e.reduce((t,r)=>t.concat(r instanceof Je?r:r.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function vT(n,e,t,r,i,o,a){let c=n.slice();for(let h=0,m=o;h<t.maps.length;h++){let p=0;t.maps[h].forEach((g,b,S,E)=>{let C=E-S-(b-g);for(let M=0;M<c.length;M+=3){let P=c[M+1];if(P<0||g>P+m-p)continue;let F=c[M]+m-p;b>=F?c[M+1]=g<=F?-2:-1:g>=m&&C&&(c[M]+=C,c[M+1]+=C)}p+=C}),m=t.maps[h].map(m,-1)}let f=!1;for(let h=0;h<c.length;h+=3)if(c[h+1]<0){if(c[h+1]==-2){f=!0,c[h+1]=-1;continue}let m=t.map(n[h]+o),p=m-i;if(p<0||p>=r.content.size){f=!0;continue}let g=t.map(n[h+1]+o,-1),b=g-i,{index:S,offset:E}=r.content.findIndex(p),C=r.maybeChild(S);if(C&&E==p&&E+C.nodeSize==b){let M=c[h+2].mapInner(t,C,m+1,n[h]+o+1,a);M!=at?(c[h]=p,c[h+1]=b,c[h+2]=M):(c[h+1]=-2,f=!0)}else f=!0}if(f){let h=wT(c,n,e,t,i,o,a),m=El(h,r,0,a);e=m.local;for(let p=0;p<c.length;p+=3)c[p+1]<0&&(c.splice(p,3),p-=3);for(let p=0,g=0;p<m.children.length;p+=3){let b=m.children[p];for(;g<c.length&&c[g]<b;)g+=3;c.splice(g,0,m.children[p],m.children[p+1],m.children[p+2])}}return new Je(e.sort(Ur),c)}function a0(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let i=n[r];t.push(new bn(i.from+e,i.to+e,i.type))}return t}function wT(n,e,t,r,i,o,a){function c(f,h){for(let m=0;m<f.local.length;m++){let p=f.local[m].map(r,i,h);p?t.push(p):a.onRemove&&a.onRemove(f.local[m].spec)}for(let m=0;m<f.children.length;m+=3)c(f.children[m+2],f.children[m]+h+1)}for(let f=0;f<n.length;f+=3)n[f+1]==-1&&c(n[f+2],e[f]+o+1);return t}function c0(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let o=0,a;o<n.length;o++)(a=n[o])&&a.from>t&&a.to<r&&((i||(i=[])).push(a),n[o]=null);return i}function u0(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function El(n,e,t,r){let i=[],o=!1;e.forEach((c,f)=>{let h=c0(n,c,f+t);if(h){o=!0;let m=El(h,c,t+f+1,r);m!=at&&i.push(f,f+c.nodeSize,m)}});let a=a0(o?u0(n):n,-t).sort(Ur);for(let c=0;c<a.length;c++)a[c].type.valid(e,a[c])||(r.onRemove&&r.onRemove(a[c].spec),a.splice(c--,1));return a.length||i.length?new Je(a,i):at}function Ur(n,e){return n.from-e.from||n.to-e.to}function tf(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let i=t+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==n&&(e=n.slice()),e[i]=o.copy(o.from,r.to),f0(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,o.from),f0(e,i,r.copy(o.from,r.to)));break}}}return e}function f0(n,e,t){for(;e<n.length&&Ur(t,n[e])>0;)e++;n.splice(e,0,t)}for(var gr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},kl={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},ST=typeof navigator<"u"&&/Mac/.test(navigator.platform),xT=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Ze=0;Ze<10;Ze++)gr[48+Ze]=gr[96+Ze]=String(Ze);for(var Ze=1;Ze<=24;Ze++)gr[Ze+111]="F"+Ze;for(var Ze=65;Ze<=90;Ze++)gr[Ze]=String.fromCharCode(Ze+32),kl[Ze]=String.fromCharCode(Ze);for(var nf in gr)kl.hasOwnProperty(nf)||(kl[nf]=gr[nf]);function ET(n){var e=ST&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||xT&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?kl:gr)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const kT=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function _T(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,o,a;for(let c=0;c<e.length-1;c++){let f=e[c];if(/^(cmd|meta|m)$/i.test(f))a=!0;else if(/^a(lt)?$/i.test(f))r=!0;else if(/^(c|ctrl|control)$/i.test(f))i=!0;else if(/^s(hift)?$/i.test(f))o=!0;else if(/^mod$/i.test(f))kT?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+f)}return r&&(t="Alt-"+t),i&&(t="Ctrl-"+t),a&&(t="Meta-"+t),o&&(t="Shift-"+t),t}function TT(n){let e=Object.create(null);for(let t in n)e[_T(t)]=n[t];return e}function rf(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function CT(n){return new lt({props:{handleKeyDown:MT(n)}})}function MT(n){let e=TT(n);return function(t,r){let i=ET(r),o,a=e[rf(i,r)];if(a&&a(t.state,t.dispatch,t))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let c=e[rf(i,r,!1)];if(c&&c(t.state,t.dispatch,t))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=gr[r.keyCode])&&o!=i){let c=e[rf(o,r)];if(c&&c(t.state,t.dispatch,t))return!0}}return!1}}const sf=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function h0(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const d0=(n,e,t)=>{let r=h0(n,t);if(!r)return!1;let i=of(r);if(!i){let a=r.blockRange(),c=a&&xi(a);return c==null?!1:(e&&e(n.tr.lift(a,c).scrollIntoView()),!0)}let o=i.nodeBefore;if(x0(n,i,e,-1))return!0;if(r.parent.content.size==0&&(Mi(o,"end")||Y.isSelectable(o)))for(let a=r.depth;;a--){let c=gl(n.doc,r.before(a),r.after(a),W.empty);if(c&&c.slice.size<c.to-c.from){if(e){let f=n.tr.step(c);f.setSelection(Mi(o,"end")?pe.findFrom(f.doc.resolve(f.mapping.map(i.pos,-1)),-1):Y.create(f.doc,i.pos-o.nodeSize)),e(f.scrollIntoView())}return!0}if(a==1||r.node(a-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},AT=(n,e,t)=>{let r=h0(n,t);if(!r)return!1;let i=of(r);return i?p0(n,i,e):!1},IT=(n,e,t)=>{let r=g0(n,t);if(!r)return!1;let i=lf(r);return i?p0(n,i,e):!1};function p0(n,e,t){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let m=i.lastChild;if(!m)return!1;i=m}let a=e.nodeAfter,c=a,f=e.pos+1;for(;!c.isTextblock;f++){if(c.type.spec.isolating)return!1;let m=c.firstChild;if(!m)return!1;c=m}let h=gl(n.doc,o,f,W.empty);if(!h||h.from!=o||h instanceof Ge&&h.slice.size>=f-o)return!1;if(t){let m=n.tr.step(h);m.setSelection(ce.create(m.doc,o)),t(m.scrollIntoView())}return!0}function Mi(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}const m0=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=of(r)}let a=o&&o.nodeBefore;return!a||!Y.isSelectable(a)?!1:(e&&e(n.tr.setSelection(Y.create(n.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function of(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function g0(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const y0=(n,e,t)=>{let r=g0(n,t);if(!r)return!1;let i=lf(r);if(!i)return!1;let o=i.nodeAfter;if(x0(n,i,e,1))return!0;if(r.parent.content.size==0&&(Mi(o,"start")||Y.isSelectable(o))){let a=gl(n.doc,r.before(),r.after(),W.empty);if(a&&a.slice.size<a.to-a.from){if(e){let c=n.tr.step(a);c.setSelection(Mi(o,"start")?pe.findFrom(c.doc.resolve(c.mapping.map(i.pos)),1):Y.create(c.doc,c.mapping.map(i.pos))),e(c.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},b0=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;o=lf(r)}let a=o&&o.nodeAfter;return!a||!Y.isSelectable(a)?!1:(e&&e(n.tr.setSelection(Y.create(n.doc,o.pos)).scrollIntoView()),!0)};function lf(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}const OT=(n,e)=>{let t=n.selection,r=t instanceof Y,i;if(r){if(t.node.isTextblock||!fr(n.doc,t.from))return!1;i=t.from}else if(i=ml(n.doc,t.from,-1),i==null)return!1;if(e){let o=n.tr.join(i);r&&o.setSelection(Y.create(o.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},NT=(n,e)=>{let t=n.selection,r;if(t instanceof Y){if(t.node.isTextblock||!fr(n.doc,t.to))return!1;r=t.to}else if(r=ml(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},RT=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&xi(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},v0=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
13
- `).scrollIntoView()),!0)};function af(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const LT=(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),o=t.indexAfter(-1),a=af(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(e){let c=t.after(),f=n.tr.replaceWith(c,c,a.createAndFill());f.setSelection(pe.near(f.doc.resolve(c),1)),e(f.scrollIntoView())}return!0},w0=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof At||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=af(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,c=n.tr.insert(a,o.createAndFill());c.setSelection(ce.create(c.doc,a+1)),e(c.scrollIntoView())}return!0},S0=(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let o=t.before();if(Pn(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&xi(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)};function PT(n){return(e,t)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof Y&&e.selection.node.isBlock)return!r.parentOffset||!Pn(e.doc,r.pos)?!1:(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],a,c,f=!1,h=!1;for(let b=r.depth;;b--)if(r.node(b).isBlock){f=r.end(b)==r.pos+(r.depth-b),h=r.start(b)==r.pos-(r.depth-b),c=af(r.node(b-1).contentMatchAt(r.indexAfter(b-1))),o.unshift(f&&c?{type:c}:null),a=b;break}else{if(b==1)return!1;o.unshift(null)}let m=e.tr;(e.selection instanceof ce||e.selection instanceof At)&&m.deleteSelection();let p=m.mapping.map(r.pos),g=Pn(m.doc,p,o.length,o);if(g||(o[0]=c?{type:c}:null,g=Pn(m.doc,p,o.length,o)),m.split(p,o.length,o),!f&&h&&r.node(a).type!=c){let b=m.mapping.map(r.before(a)),S=m.doc.resolve(b);c&&r.node(a-1).canReplaceWith(S.index(),S.index()+1,c)&&m.setNodeMarkup(m.mapping.map(r.before(a)),c)}return t&&t(m.scrollIntoView()),!0}}const DT=PT(),BT=(n,e)=>{let{$from:t,to:r}=n.selection,i,o=t.sharedDepth(r);return o==0?!1:(i=t.before(o),e&&e(n.tr.setSelection(Y.create(n.doc,i))),!0)};function zT(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||fr(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function x0(n,e,t,r){let i=e.nodeBefore,o=e.nodeAfter,a,c,f=i.type.spec.isolating||o.type.spec.isolating;if(!f&&zT(n,e,t))return!0;let h=!f&&e.parent.canReplace(e.index(),e.index()+1);if(h&&(a=(c=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&c.matchType(a[0]||o.type).validEnd){if(t){let b=e.pos+o.nodeSize,S=L.empty;for(let M=a.length-1;M>=0;M--)S=L.from(a[M].create(null,S));S=L.from(i.copy(S));let E=n.tr.step(new Ke(e.pos-1,b,e.pos,b,new W(S,1,0),a.length,!0)),C=E.doc.resolve(b+2*a.length);C.nodeAfter&&C.nodeAfter.type==i.type&&fr(E.doc,C.pos)&&E.join(C.pos),t(E.scrollIntoView())}return!0}let m=o.type.spec.isolating||r>0&&f?null:pe.findFrom(e,1),p=m&&m.$from.blockRange(m.$to),g=p&&xi(p);if(g!=null&&g>=e.depth)return t&&t(n.tr.lift(p,g).scrollIntoView()),!0;if(h&&Mi(o,"start",!0)&&Mi(i,"end")){let b=i,S=[];for(;S.push(b),!b.isTextblock;)b=b.lastChild;let E=o,C=1;for(;!E.isTextblock;E=E.firstChild)C++;if(b.canReplace(b.childCount,b.childCount,E.content)){if(t){let M=L.empty;for(let F=S.length-1;F>=0;F--)M=L.from(S[F].copy(M));let P=n.tr.step(new Ke(e.pos-S.length,e.pos+o.nodeSize,e.pos+C,e.pos+o.nodeSize-C,new W(M,S.length,0),0,!0));t(P.scrollIntoView())}return!0}}return!1}function E0(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(t&&t(e.tr.setSelection(ce.create(e.doc,n<0?i.start(o):i.end(o)))),!0):!1}}const FT=E0(-1),HT=E0(1);function $T(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o),c=a&&Pu(a,n,e);return c?(r&&r(t.tr.wrap(a,c).scrollIntoView()),!0):!1}}function k0(n,e=null){return function(t,r){let i=!1;for(let o=0;o<t.selection.ranges.length&&!i;o++){let{$from:{pos:a},$to:{pos:c}}=t.selection.ranges[o];t.doc.nodesBetween(a,c,(f,h)=>{if(i)return!1;if(!(!f.isTextblock||f.hasMarkup(n,e)))if(f.type==n)i=!0;else{let m=t.doc.resolve(h),p=m.index();i=m.parent.canReplaceWith(p,p+1,n)}})}if(!i)return!1;if(r){let o=t.tr;for(let a=0;a<t.selection.ranges.length;a++){let{$from:{pos:c},$to:{pos:f}}=t.selection.ranges[a];o.setBlockType(c,f,n,e)}r(o.scrollIntoView())}return!0}}function cf(...n){return function(e,t,r){for(let i=0;i<n.length;i++)if(n[i](e,t,r))return!0;return!1}}cf(sf,d0,m0),cf(sf,y0,b0),cf(v0,w0,S0,DT),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function WT(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o);if(!a)return!1;let c=r?t.tr:null;return UT(c,a,n,e)?(r&&r(c.scrollIntoView()),!0):!1}}function UT(n,e,t,r=null){let i=!1,o=e,a=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let f=a.resolve(e.start-2);o=new ul(f,f,e.depth),e.endIndex<e.parent.childCount&&(e=new ul(e.$from,a.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let c=Pu(o,t,r,e);return c?(n&&VT(n,e,c,i,t),!0):!1}function VT(n,e,t,r,i){let o=L.empty;for(let m=t.length-1;m>=0;m--)o=L.from(t[m].type.create(t[m].attrs,o));n.step(new Ke(e.start-(r?2:0),e.end,e.start,e.end,new W(o,0,0),t.length,!0));let a=0;for(let m=0;m<t.length;m++)t[m].type==i&&(a=m+1);let c=t.length-a,f=e.start+t.length-(r?2:0),h=e.parent;for(let m=e.startIndex,p=e.endIndex,g=!0;m<p;m++,g=!1)!g&&Pn(n.doc,f,c)&&(n.split(f,c),f+=2*c),f+=h.child(m).nodeSize;return n}function KT(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==n);return o?t?r.node(o.depth-1).type==n?GT(e,t,n,o):JT(e,t,o):!0:!1}}function GT(n,e,t,r){let i=n.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new Ke(o-1,a,o,a,new W(L.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new ul(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const c=xi(r);if(c==null)return!1;i.lift(r,c);let f=i.mapping.map(o,-1)-1;return fr(i.doc,f)&&i.join(f),e(i.scrollIntoView()),!0}function JT(n,e,t){let r=n.tr,i=t.parent;for(let b=t.end,S=t.endIndex-1,E=t.startIndex;S>E;S--)b-=i.child(S).nodeSize,r.delete(b-1,b+1);let o=r.doc.resolve(t.start),a=o.nodeAfter;if(r.mapping.map(t.end)!=t.start+o.nodeAfter.nodeSize)return!1;let c=t.startIndex==0,f=t.endIndex==i.childCount,h=o.node(-1),m=o.index(-1);if(!h.canReplace(m+(c?0:1),m+1,a.content.append(f?L.empty:L.from(i))))return!1;let p=o.pos,g=p+a.nodeSize;return r.step(new Ke(p-(c?1:0),g+(f?1:0),p+1,g-1,new W((c?L.empty:L.from(i.copy(L.empty))).append(f?L.empty:L.from(i.copy(L.empty))),c?0:1,f?0:1),c?0:1)),e(r.scrollIntoView()),!0}function qT(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,h=>h.childCount>0&&h.firstChild.type==n);if(!o)return!1;let a=o.startIndex;if(a==0)return!1;let c=o.parent,f=c.child(a-1);if(f.type!=n)return!1;if(t){let h=f.lastChild&&f.lastChild.type==c.type,m=L.from(h?n.create():null),p=new W(L.from(n.create(null,L.from(c.type.create(null,m)))),h?3:1,0),g=o.start,b=o.end;t(e.tr.step(new Ke(g-(h?3:1),b,g,b,p,1,!0)).scrollIntoView())}return!0}}function _l(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:i}=t,{storedMarks:o}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,o=t.storedMarks,t}}}class uf{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:r}=this,{view:i}=t,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([c,f])=>[c,(...m)=>{const p=f(...m)(a);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),p}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,c=[],f=!!e,h=e||o.tr,m=()=>(!f&&t&&!h.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(h),c.every(g=>g===!0)),p={...Object.fromEntries(Object.entries(r).map(([g,b])=>[g,(...E)=>{const C=this.buildProps(h,t),M=b(...E)(C);return c.push(M),p}])),run:m};return p}createCan(e){const{rawCommands:t,state:r}=this,i=!1,o=e||r.tr,a=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(t).map(([f,h])=>[f,(...m)=>h(...m)({...a,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,c={tr:e,editor:i,view:a,state:_l({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([f,h])=>[f,(...m)=>h(...m)(c)]))}};return c}}function K(n,e,t){return n.config[e]===void 0&&n.parent?K(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?K(n.parent,e,t):null}):n.config[e]}function Tl(n){const e=n.filter(i=>i.type==="extension"),t=n.filter(i=>i.type==="node"),r=n.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function _0(n){const e=[],{nodeExtensions:t,markExtensions:r}=Tl(n),i=[...t,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(a=>{const c={name:a.name,options:a.options,storage:a.storage,extensions:i},f=K(a,"addGlobalAttributes",c);if(!f)return;f().forEach(m=>{m.types.forEach(p=>{Object.entries(m.attributes).forEach(([g,b])=>{e.push({type:p,name:g,attribute:{...o,...b}})})})})}),i.forEach(a=>{const c={name:a.name,options:a.options,storage:a.storage},f=K(a,"addAttributes",c);if(!f)return;const h=f();Object.entries(h).forEach(([m,p])=>{const g={...o,...p};typeof g?.default=="function"&&(g.default=g.default()),g?.isRequired&&g?.default===void 0&&delete g.default,e.push({type:a.name,name:m,attribute:g})})}),e}function We(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function Ai(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const c=o?String(o).split(" "):[],f=r[i]?r[i].split(" "):[],h=c.filter(m=>!f.includes(m));r[i]=[...f,...h].join(" ")}else if(i==="style"){const c=o?o.split(";").map(m=>m.trim()).filter(Boolean):[],f=r[i]?r[i].split(";").map(m=>m.trim()).filter(Boolean):[],h=new Map;f.forEach(m=>{const[p,g]=m.split(":").map(b=>b.trim());h.set(p,g)}),c.forEach(m=>{const[p,g]=m.split(":").map(b=>b.trim());h.set(p,g)}),r[i]=Array.from(h.entries()).map(([m,p])=>`${m}: ${p}`).join("; ")}else r[i]=o}),r},{})}function ff(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>Ai(t,r),{})}function jT(n){return typeof n=="function"}function ae(n,e=void 0,...t){return jT(n)?e?n.bind(e)(...t):n(...t):n}function YT(n={}){return Object.keys(n).length===0&&n.constructor===Object}function XT(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function T0(n,e){return"style"in n?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const i=e.reduce((o,a)=>{const c=a.attribute.parseHTML?a.attribute.parseHTML(t):XT(t.getAttribute(a.name));return c==null?o:{...o,[a.name]:c}},{});return{...r,...i}}}}function C0(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&YT(t)?!1:t!=null))}function M0(n,e){var t;const r=_0(n),{nodeExtensions:i,markExtensions:o}=Tl(n),a=(t=i.find(h=>K(h,"topNode")))===null||t===void 0?void 0:t.name,c=Object.fromEntries(i.map(h=>{const m=r.filter(M=>M.type===h.name),p={name:h.name,options:h.options,storage:h.storage,editor:e},g=n.reduce((M,P)=>{const F=K(P,"extendNodeSchema",p);return{...M,...F?F(h):{}}},{}),b=C0({...g,content:ae(K(h,"content",p)),marks:ae(K(h,"marks",p)),group:ae(K(h,"group",p)),inline:ae(K(h,"inline",p)),atom:ae(K(h,"atom",p)),selectable:ae(K(h,"selectable",p)),draggable:ae(K(h,"draggable",p)),code:ae(K(h,"code",p)),whitespace:ae(K(h,"whitespace",p)),linebreakReplacement:ae(K(h,"linebreakReplacement",p)),defining:ae(K(h,"defining",p)),isolating:ae(K(h,"isolating",p)),attrs:Object.fromEntries(m.map(M=>{var P;return[M.name,{default:(P=M?.attribute)===null||P===void 0?void 0:P.default}]}))}),S=ae(K(h,"parseHTML",p));S&&(b.parseDOM=S.map(M=>T0(M,m)));const E=K(h,"renderHTML",p);E&&(b.toDOM=M=>E({node:M,HTMLAttributes:ff(M,m)}));const C=K(h,"renderText",p);return C&&(b.toText=C),[h.name,b]})),f=Object.fromEntries(o.map(h=>{const m=r.filter(C=>C.type===h.name),p={name:h.name,options:h.options,storage:h.storage,editor:e},g=n.reduce((C,M)=>{const P=K(M,"extendMarkSchema",p);return{...C,...P?P(h):{}}},{}),b=C0({...g,inclusive:ae(K(h,"inclusive",p)),excludes:ae(K(h,"excludes",p)),group:ae(K(h,"group",p)),spanning:ae(K(h,"spanning",p)),code:ae(K(h,"code",p)),attrs:Object.fromEntries(m.map(C=>{var M;return[C.name,{default:(M=C?.attribute)===null||M===void 0?void 0:M.default}]}))}),S=ae(K(h,"parseHTML",p));S&&(b.parseDOM=S.map(C=>T0(C,m)));const E=K(h,"renderHTML",p);return E&&(b.toDOM=C=>E({mark:C,HTMLAttributes:ff(C,m)})),[h.name,b]}));return new Zm({topNode:a,nodes:c,marks:f})}function hf(n,e){return e.nodes[n]||e.marks[n]||null}function A0(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}function I0(n,e){const t=Us.fromSchema(e).serializeFragment(n),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}const ZT=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,o,a,c)=>{var f,h;const m=((h=(f=i.type.spec).toText)===null||h===void 0?void 0:h.call(f,{node:i,pos:o,parent:a,index:c}))||i.textContent||"%leaf%";t+=i.isAtom&&!i.isText?m:m.slice(0,Math.max(0,r-o))}),t};function df(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class O0{constructor(e){this.find=e.find,this.handler=e.handler}}const QT=(n,e)=>{if(df(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function Cl(n){var e;const{editor:t,from:r,to:i,text:o,rules:a,plugin:c}=n,{view:f}=t;if(f.composing)return!1;const h=f.state.doc.resolve(r);if(h.parent.type.spec.code||!((e=h.nodeBefore||h.nodeAfter)===null||e===void 0)&&e.marks.find(g=>g.type.spec.code))return!1;let m=!1;const p=ZT(h)+o;return a.forEach(g=>{if(m)return;const b=QT(p,g.find);if(!b)return;const S=f.state.tr,E=_l({state:f.state,transaction:S}),C={from:r-(b[0].length-o.length),to:i},{commands:M,chain:P,can:F}=new uf({editor:t,state:E});g.handler({state:E,range:C,match:b,commands:M,chain:P,can:F})===null||!S.steps.length||(S.setMeta(c,{transform:S,from:r,to:i,text:o}),f.dispatch(S),m=!0)}),m}function eC(n){const{editor:e,rules:t}=n,r=new lt({state:{init(){return null},apply(i,o,a){const c=i.getMeta(r);if(c)return c;const f=i.getMeta("applyInputRules");return!!f&&setTimeout(()=>{let{text:m}=f;typeof m=="string"?m=m:m=I0(L.from(m),a.schema);const{from:p}=f,g=p+m.length;Cl({editor:e,from:p,to:g,text:m,rules:t,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,a,c){return Cl({editor:e,from:o,to:a,text:c,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Cl({editor:e,from:o.pos,to:o.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?Cl({editor:e,from:a.pos,to:a.pos,text:`
14
- `,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function tC(n){return Object.prototype.toString.call(n).slice(8,-1)}function Ml(n){return tC(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function Al(n,e){const t={...n};return Ml(n)&&Ml(e)&&Object.keys(e).forEach(r=>{Ml(e[r])&&Ml(n[r])?t[r]=Al(n[r],e[r]):t[r]=e[r]}),t}class Mt{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ae(K(this,"addOptions",{name:this.name}))),this.storage=ae(K(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Mt(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Al(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new Mt(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ae(K(t,"addOptions",{name:t.name})),t.storage=ae(K(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(h=>h?.type.name===t.name))return!1;const f=a.find(h=>h?.type.name===t.name);return f&&r.removeStoredMark(f),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}function nC(n){return typeof n=="number"}class rC{constructor(e){this.find=e.find,this.handler=e.handler}}const iC=(n,e,t)=>{if(df(e))return[...n.matchAll(e)];const r=e(n,t);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=n,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function sC(n){const{editor:e,state:t,from:r,to:i,rule:o,pasteEvent:a,dropEvent:c}=n,{commands:f,chain:h,can:m}=new uf({editor:e,state:t}),p=[];return t.doc.nodesBetween(r,i,(b,S)=>{if(!b.isTextblock||b.type.spec.code)return;const E=Math.max(r,S),C=Math.min(i,S+b.content.size),M=b.textBetween(E-S,C-S,void 0,"\uFFFC");iC(M,o.find,a).forEach(F=>{if(F.index===void 0)return;const $=E+F.index+1,U=$+F[0].length,ue={from:t.tr.mapping.map($),to:t.tr.mapping.map(U)},he=o.handler({state:t,range:ue,match:F,commands:f,chain:h,can:m,pasteEvent:a,dropEvent:c});p.push(he)})}),p.every(b=>b!==null)}let Il=null;const oC=n=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)===null||e===void 0||e.setData("text/html",n),t};function lC(n){const{editor:e,rules:t}=n;let r=null,i=!1,o=!1,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,c;try{c=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{c=null}const f=({state:m,from:p,to:g,rule:b,pasteEvt:S})=>{const E=m.tr,C=_l({state:m,transaction:E});if(!(!sC({editor:e,state:C,from:Math.max(p-1,0),to:g.b-1,rule:b,pasteEvent:S,dropEvent:c})||!E.steps.length)){try{c=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{c=null}return a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,E}};return t.map(m=>new lt({view(p){const g=S=>{var E;r=!((E=p.dom.parentElement)===null||E===void 0)&&E.contains(S.target)?p.dom.parentElement:null,r&&(Il=e)},b=()=>{Il&&(Il=null)};return window.addEventListener("dragstart",g),window.addEventListener("dragend",b),{destroy(){window.removeEventListener("dragstart",g),window.removeEventListener("dragend",b)}}},props:{handleDOMEvents:{drop:(p,g)=>{if(o=r===p.dom.parentElement,c=g,!o){const b=Il;b&&setTimeout(()=>{const S=b.state.selection;S&&b.commands.deleteRange({from:S.from,to:S.to})},10)}return!1},paste:(p,g)=>{var b;const S=(b=g.clipboardData)===null||b===void 0?void 0:b.getData("text/html");return a=g,i=!!S?.includes("data-pm-slice"),!1}}},appendTransaction:(p,g,b)=>{const S=p[0],E=S.getMeta("uiEvent")==="paste"&&!i,C=S.getMeta("uiEvent")==="drop"&&!o,M=S.getMeta("applyPasteRules"),P=!!M;if(!E&&!C&&!P)return;if(P){let{text:U}=M;typeof U=="string"?U=U:U=I0(L.from(U),b.schema);const{from:ue}=M,he=ue+U.length,be=oC(U);return f({rule:m,state:b,from:ue,to:{b:he},pasteEvt:be})}const F=g.doc.content.findDiffStart(b.doc.content),$=g.doc.content.findDiffEnd(b.doc.content);if(!(!nC(F)||!$||F===$.b))return f({rule:m,state:b,from:F,to:$,pasteEvt:a})}}))}function aC(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return Array.from(new Set(e))}class Di{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=Di.resolve(e),this.schema=M0(this.extensions,t),this.setupExtensions()}static resolve(e){const t=Di.sort(Di.flatten(e)),r=aC(t.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map(t=>{const r={name:t.name,options:t.options,storage:t.storage},i=K(t,"addExtensions",r);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=K(r,"priority")||100,a=K(i,"priority")||100;return o>a?-1:o<a?1:0})}get commands(){return this.extensions.reduce((e,t)=>{const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:hf(t.name,this.schema)},i=K(t,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=Di.sort([...this.extensions].reverse()),r=[],i=[],o=t.map(a=>{const c={name:a.name,options:a.options,storage:a.storage,editor:e,type:hf(a.name,this.schema)},f=[],h=K(a,"addKeyboardShortcuts",c);let m={};if(a.type==="mark"&&K(a,"exitable",c)&&(m.ArrowRight=()=>Mt.handleExit({editor:e,mark:a})),h){const E=Object.fromEntries(Object.entries(h()).map(([C,M])=>[C,()=>M({editor:e})]));m={...m,...E}}const p=CT(m);f.push(p);const g=K(a,"addInputRules",c);A0(a,e.options.enableInputRules)&&g&&r.push(...g());const b=K(a,"addPasteRules",c);A0(a,e.options.enablePasteRules)&&b&&i.push(...b());const S=K(a,"addProseMirrorPlugins",c);if(S){const E=S();f.push(...E)}return f}).flat();return[eC({editor:e,rules:r}),...lC({editor:e,rules:i}),...o]}get attributes(){return _0(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Tl(this.extensions);return Object.fromEntries(t.filter(r=>!!K(r,"addNodeView")).map(r=>{const i=this.attributes.filter(f=>f.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:We(r.name,this.schema)},a=K(r,"addNodeView",o);if(!a)return[];const c=(f,h,m,p,g)=>{const b=ff(f,i);return a()({node:f,view:h,getPos:m,decorations:p,innerDecorations:g,editor:e,extension:r,HTMLAttributes:b})};return[r.name,c]}))}setupExtensions(){this.extensions.forEach(e=>{var t;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:hf(e.name,this.schema)};e.type==="mark"&&(!((t=ae(K(e,"keepOnSplit",r)))!==null&&t!==void 0)||t)&&this.splittableMarks.push(e.name);const i=K(e,"onBeforeCreate",r),o=K(e,"onCreate",r),a=K(e,"onUpdate",r),c=K(e,"onSelectionUpdate",r),f=K(e,"onTransaction",r),h=K(e,"onFocus",r),m=K(e,"onBlur",r),p=K(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),a&&this.editor.on("update",a),c&&this.editor.on("selectionUpdate",c),f&&this.editor.on("transaction",f),h&&this.editor.on("focus",h),m&&this.editor.on("blur",m),p&&this.editor.on("destroy",p)})}}class Ie{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ae(K(this,"addOptions",{name:this.name}))),this.storage=ae(K(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ie(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Al(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new Ie({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ae(K(t,"addOptions",{name:t.name})),t.storage=ae(K(t,"addStorage",{name:t.name,options:t.options})),t}}function cC(n,e,t){const{from:r,to:i}=e,{blockSeparator:o=`
12
+ `))),0,0):W.empty;let p=n.someProp("clipboardTextParser",g=>g(e,i,r,n));if(p)c=p;else{let g=i.marks(),{schema:b}=n.state,S=Us.fromSchema(b);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(E=>{let C=a.appendChild(document.createElement("p"));E&&C.appendChild(S.serializeNode(b.text(E,g)))})}}else n.someProp("transformPastedHTML",p=>{t=p(t,n)}),a=tT(t),Ku&&nT(a);let h=a&&a.querySelector("[data-pm-slice]"),m=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(m&&m[3])for(let p=+m[3];p>0;p--){let g=a.firstChild;for(;g&&g.nodeType!=1;)g=g.nextSibling;if(!g)break;a=g}if(c||(c=(n.someProp("clipboardParser")||n.someProp("domParser")||vs.fromSchema(n.state.schema)).parseSlice(a,{preserveWhitespace:!!(f||m),context:i,ruleFromNode(g){return g.nodeName=="BR"&&!g.nextSibling&&g.parentNode&&!Z_.test(g.parentNode.nodeName)?{ignore:!0}:null}})),m)c=rT(Qg(c,+m[1],+m[2]),m[4]);else if(c=W.maxOpen(Q_(c.content,i),!0),c.openStart||c.openEnd){let p=0,g=0;for(let b=c.content.firstChild;p<c.openStart&&!b.type.spec.isolating;p++,b=b.firstChild);for(let b=c.content.lastChild;g<c.openEnd&&!b.type.spec.isolating;g++,b=b.lastChild);c=Qg(c,p,g)}return n.someProp("transformPasted",p=>{c=p(c,n)}),c}const Z_=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Q_(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),o,a=[];if(n.forEach(c=>{if(!a)return;let f=i.findWrapping(c.type),h;if(!f)return a=null;if(h=a.length&&o.length&&Xg(f,o,c,a[a.length-1],0))a[a.length-1]=h;else{a.length&&(a[a.length-1]=Zg(a[a.length-1],o.length));let m=Yg(c,f);a.push(m),i=i.matchType(m.type),o=f}}),a)return L.from(a)}return n}function Yg(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,L.from(n));return n}function Xg(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=Xg(n,e,t,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?t.type:n[i+1]))return r.copy(r.content.append(L.from(Yg(t,n,i+1))))}}function Zg(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,Zg(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(L.empty,!0);return n.copy(t.append(r))}function Yu(n,e,t,r,i,o){let a=e<0?n.firstChild:n.lastChild,c=a.content;return n.childCount>1&&(o=0),i<r-1&&(c=Yu(c,e,t,r,i+1,o)),i>=t&&(c=e<0?a.contentMatchAt(0).fillBefore(c,o<=i).append(c):c.append(a.contentMatchAt(a.childCount).fillBefore(L.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,a.copy(c))}function Qg(n,e,t){return e<n.openStart&&(n=new W(Yu(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new W(Yu(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const e0={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let t0=null;function n0(){return t0||(t0=document.implementation.createHTMLDocument("title"))}let Xu=null;function eT(n){let e=window.trustedTypes;return e?(Xu||(Xu=e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),Xu.createHTML(n)):n}function tT(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=n0().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&e0[r[1].toLowerCase()])&&(n=i.map(o=>"<"+o+">").join("")+n+i.map(o=>"</"+o+">").reverse().join("")),t.innerHTML=eT(n),i)for(let o=0;o<i.length;o++)t=t.querySelector(i[o])||t;return t}function nT(n){let e=n.querySelectorAll(dr?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let r=e[t];r.childNodes.length==1&&r.textContent=="\xA0"&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function rT(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return n}let{content:i,openStart:o,openEnd:a}=n;for(let c=r.length-2;c>=0;c-=2){let f=t.nodes[r[c]];if(!f||f.hasRequiredAttrs())break;i=L.from(f.create(r[c+1],i)),o++,a++}return new W(i,o,a)}const en={},Mt={};function mr(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}Mt.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!i0(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(ks&&dr&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),Vu&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,Og(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||X_(n,t)?t.preventDefault():mr(n,"key")},Mt.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},Mt.keypress=(n,e)=>{let t=e;if(i0(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Wt&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof ce)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i))&&n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function Sl(n){return{left:n.clientX,top:n.clientY}}function iT(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Zu(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let a=o.depth+1;a>0;a--)if(n.someProp(e,c=>a>o.depth?c(n,t,o.nodeAfter,o.before(a),i,!0):c(n,t,o.node(a),o.before(a),i,!1)))return!0;return!1}function Ti(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function sT(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&Y.isSelectable(r)?(Ti(n,new Y(t)),!0):!1}function oT(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof Y&&(r=t.node);let o=n.state.doc.resolve(e);for(let a=o.depth+1;a>0;a--){let c=a>o.depth?o.nodeAfter:o.node(a);if(Y.isSelectable(c)){r&&t.$from.depth>0&&a>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?i=o.before(t.$from.depth):i=o.before(a);break}}return i!=null?(Ti(n,Y.create(n.state.doc,i)),!0):!1}function lT(n,e,t,r,i){return Zu(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?oT(n,t):sT(n,t))}function aT(n,e,t,r){return Zu(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function cT(n,e,t,r){return Zu(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||uT(n,t,r)}function uT(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(Ti(n,ce.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o),c=i.before(o);if(a.inlineContent)Ti(n,ce.create(r,c+1,c+1+a.content.size));else if(Y.isSelectable(a))Ti(n,Y.create(r,c));else continue;return!0}}function Qu(n){return xl(n)}const r0=Wt?"metaKey":"ctrlKey";en.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Qu(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&iT(t,n.input.lastClick)&&!t[r0]&&(n.input.lastClick.type=="singleClick"?o="doubleClick":n.input.lastClick.type=="doubleClick"&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o};let a=n.posAtCoords(Sl(t));a&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new fT(n,a,t,!!r)):(o=="doubleClick"?aT:cT)(n,a.pos,a.inside,t)?t.preventDefault():mr(n,"pointer"))};class fT{constructor(e,t,r,i){this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[r0],this.allowDefault=r.shiftKey;let o,a;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),a=t.inside;else{let m=e.state.doc.resolve(t.pos);o=m.parent,a=m.depth?m.before():0}const c=i?null:r.target,f=c?e.docView.nearestDesc(c,!0):null;this.target=f&&f.dom.nodeType==1?f.dom:null;let{selection:h}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||h instanceof Y&&h.from<=a&&h.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&vl&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),mr(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Gu(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Sl(e))),this.updateAllowDefault(e),this.allowDefault||!t?mr(this.view,"pointer"):lT(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Wr&&this.mightDrag&&!this.mightDrag.node.isAtom||dr&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Ti(this.view,pe.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):mr(this.view,"pointer")}move(e){this.updateAllowDefault(e),mr(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}en.touchstart=n=>{n.input.lastTouch=Date.now(),Qu(n),mr(n,"pointer")},en.touchmove=n=>{n.input.lastTouch=Date.now(),mr(n,"pointer")},en.contextmenu=n=>Qu(n);function i0(n,e){return n.composing?!0:Wr&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const hT=ks?5e3:-1;Mt.compositionstart=Mt.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof ce&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),xl(n,!0),n.markCursor=null;else if(xl(n,!e.selection.empty),vl&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(a.nodeType==3){let c=n.domSelection();c&&c.collapse(a,a.nodeValue.length);break}else i=a,o=-1}}n.input.composing=!0}s0(n,hT)},Mt.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,s0(n,20))};function s0(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>xl(n),e))}function dT(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=pT());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function pT(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function xl(n,e=!1){if(!(ks&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),dT(n),e||n.docView&&n.docView.dirty){let t=H_(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!n.state.selection.empty?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function mT(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const Ts=Es&&Lg<15||Vu&&F_<604;en.copy=Mt.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=Ts?null:t.clipboardData,a=r.content(),{dom:c,text:f}=qg(n,a);o?(t.preventDefault(),o.clearData(),o.setData("text/html",c.innerHTML),o.setData("text/plain",f)):mT(n,c),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function gT(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function yT(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?ef(n,r.value,null,i,e):ef(n,r.textContent,r.innerHTML,i,e)},50)}function ef(n,e,t,r,i){let o=jg(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",f=>f(n,i,o||W.empty)))return!0;if(!o)return!1;let a=gT(o),c=a?n.state.tr.replaceSelectionWith(a,r):n.state.tr.replaceSelection(o);return n.dispatch(c.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function o0(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Mt.paste=(n,e)=>{let t=e;if(n.composing&&!ks)return;let r=Ts?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&ef(n,o0(r),r.getData("text/html"),i,t)?t.preventDefault():yT(n,t)};class bT{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const l0=Wt?"altKey":"ctrlKey";en.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,o=i.empty?null:n.posAtCoords(Sl(t)),a;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof Y?i.to-1:i.to))){if(r&&r.mightDrag)a=Y.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let p=n.docView.nearestDesc(t.target,!0);p&&p.node.type.spec.draggable&&p!=n.docView&&(a=Y.create(n.state.doc,p.posBefore))}}let c=(a||n.state.selection).content(),{dom:f,text:h,slice:m}=qg(n,c);(!t.dataTransfer.files.length||!dr||Pg>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(Ts?"Text":"text/html",f.innerHTML),t.dataTransfer.effectAllowed="copyMove",Ts||t.dataTransfer.setData("text/plain",h),n.dragging=new bT(m,!t[l0],a)},en.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},Mt.dragover=Mt.dragenter=(n,e)=>e.preventDefault(),Mt.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(Sl(t));if(!i)return;let o=n.state.doc.resolve(i.pos),a=r&&r.slice;a?n.someProp("transformPasted",S=>{a=S(a,n)}):a=jg(n,o0(t.dataTransfer),Ts?null:t.dataTransfer.getData("text/html"),!1,o);let c=!!(r&&!t[l0]);if(n.someProp("handleDrop",S=>S(n,t,a||W.empty,c))){t.preventDefault();return}if(!a)return;t.preventDefault();let f=a?T_(n.state.doc,o.pos,a):o.pos;f==null&&(f=o.pos);let h=n.state.tr;if(c){let{node:S}=r;S?S.replace(h):h.deleteSelection()}let m=h.mapping.map(f),p=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,g=h.doc;if(p?h.replaceRangeWith(m,m,a.content.firstChild):h.replaceRange(m,m,a),h.doc.eq(g))return;let b=h.doc.resolve(m);if(p&&Y.isSelectable(a.content.firstChild)&&b.nodeAfter&&b.nodeAfter.sameMarkup(a.content.firstChild))h.setSelection(new Y(b));else{let S=h.mapping.map(f);h.mapping.maps[h.mapping.maps.length-1].forEach((E,C,M,P)=>S=P),h.setSelection($g(n,b,h.doc.resolve(S)))}n.focus(),n.dispatch(h.setMeta("uiEvent","drop"))},en.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&Gu(n)},20))},en.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)},en.beforeinput=(n,e)=>{if(dr&&ks&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",o=>o(n,Og(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in Mt)en[n]=Mt[n];function Cs(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class Oa{constructor(e,t){this.toDOM=e,this.spec=t||Ur,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:a}=e.mapResult(t.from+i,this.side<0?-1:1);return a?null:new bn(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Oa&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Cs(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class kr{constructor(e,t){this.attrs=e,this.spec=t||Ur}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,a=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=a?null:new bn(o,a,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof kr&&Cs(this.attrs,e.attrs)&&Cs(this.spec,e.spec)}static is(e){return e.type instanceof kr}destroy(){}}let vT=class _y{constructor(e,t){this.attrs=e,this.spec=t||Ur}map(e,t,r,i){let o=e.mapResult(t.from+i,1);if(o.deleted)return null;let a=e.mapResult(t.to+i,-1);return a.deleted||a.pos<=o.pos?null:new bn(o.pos-r,a.pos-r,this)}valid(e,t){let{index:r,offset:i}=e.content.findIndex(t.from),o;return i==t.from&&!(o=e.child(r)).isText&&i+o.nodeSize==t.to}eq(e){return this==e||e instanceof _y&&Cs(this.attrs,e.attrs)&&Cs(this.spec,e.spec)}destroy(){}};class bn{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new bn(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new bn(e,e,new Oa(t,r))}static inline(e,t,r,i){return new bn(e,t,new kr(r,i))}static node(e,t,r,i){return new bn(e,t,new vT(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof kr}get widget(){return this.type instanceof Oa}}const Ci=[],Ur={};class Je{constructor(e,t){this.local=e.length?e:Ci,this.children=t.length?t:Ci}static create(e,t){return t.length?El(t,e,0,Ur):at}find(e,t,r){let i=[];return this.findInner(e??0,t??1e9,i,0,r),i}findInner(e,t,r,i,o){for(let a=0;a<this.local.length;a++){let c=this.local[a];c.from<=t&&c.to>=e&&(!o||o(c.spec))&&r.push(c.copy(c.from+i,c.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let c=this.children[a]+1;this.children[a+2].findInner(e-c,t-c,r,i+c,o)}}map(e,t,r){return this==at||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Ur)}mapInner(e,t,r,i,o){let a;for(let c=0;c<this.local.length;c++){let f=this.local[c].map(e,r,i);f&&f.type.valid(t,f)?(a||(a=[])).push(f):o.onRemove&&o.onRemove(this.local[c].spec)}return this.children.length?wT(this.children,a||[],e,t,r,i,o):a?new Je(a.sort(Vr),Ci):at}add(e,t){return t.length?this==at?Je.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,o=0;e.forEach((c,f)=>{let h=f+r,m;if(m=c0(t,c,h)){for(i||(i=this.children.slice());o<i.length&&i[o]<f;)o+=3;i[o]==f?i[o+2]=i[o+2].addInner(c,m,h+1):i.splice(o,0,f,f+c.nodeSize,El(m,c,h+1,Ur)),o+=3}});let a=a0(o?u0(t):t,-r);for(let c=0;c<a.length;c++)a[c].type.valid(e,a[c])||a.splice(c--,1);return new Je(a.length?this.local.concat(a).sort(Vr):this.local,i||this.children)}remove(e){return e.length==0||this==at?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let a,c=r[o]+t,f=r[o+1]+t;for(let m=0,p;m<e.length;m++)(p=e[m])&&p.from>c&&p.to<f&&(e[m]=null,(a||(a=[])).push(p));if(!a)continue;r==this.children&&(r=this.children.slice());let h=r[o+2].removeInner(a,c+1);h!=at?r[o+2]=h:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,a;o<e.length;o++)if(a=e[o])for(let c=0;c<i.length;c++)i[c].eq(a,t)&&(i==this.local&&(i=this.local.slice()),i.splice(c--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Je(i,r):at}forChild(e,t){if(this==at)return this;if(t.isLeaf)return Je.empty;let r,i;for(let c=0;c<this.children.length;c+=3)if(this.children[c]>=e){this.children[c]==e&&(r=this.children[c+2]);break}let o=e+1,a=o+t.content.size;for(let c=0;c<this.local.length;c++){let f=this.local[c];if(f.from<a&&f.to>o&&f.type instanceof kr){let h=Math.max(o,f.from)-o,m=Math.min(a,f.to)-o;h<m&&(i||(i=[])).push(f.copy(h,m))}}if(i){let c=new Je(i.sort(Vr),Ci);return r?new Xr([c,r]):c}return r||at}eq(e){if(this==e)return!0;if(!(e instanceof Je)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return tf(this.localsInner(e))}localsInner(e){if(this==at)return Ci;if(e.inlineContent||!this.local.some(kr.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof kr||t.push(this.local[r]);return t}forEachSet(e){e(this)}}Je.empty=new Je([],[]),Je.removeOverlap=tf;const at=Je.empty;class Xr{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,Ur));return Xr.from(r)}forChild(e,t){if(t.isLeaf)return Je.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=at&&(o instanceof Xr?r=r.concat(o.members):r.push(o))}return Xr.from(r)}eq(e){if(!(e instanceof Xr)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!t)t=o;else{r&&(t=t.slice(),r=!1);for(let a=0;a<o.length;a++)t.push(o[a])}}return t?tf(r?t:t.sort(Vr)):Ci}static from(e){switch(e.length){case 0:return at;case 1:return e[0];default:return new Xr(e.every(t=>t instanceof Je)?e:e.reduce((t,r)=>t.concat(r instanceof Je?r:r.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function wT(n,e,t,r,i,o,a){let c=n.slice();for(let h=0,m=o;h<t.maps.length;h++){let p=0;t.maps[h].forEach((g,b,S,E)=>{let C=E-S-(b-g);for(let M=0;M<c.length;M+=3){let P=c[M+1];if(P<0||g>P+m-p)continue;let F=c[M]+m-p;b>=F?c[M+1]=g<=F?-2:-1:g>=m&&C&&(c[M]+=C,c[M+1]+=C)}p+=C}),m=t.maps[h].map(m,-1)}let f=!1;for(let h=0;h<c.length;h+=3)if(c[h+1]<0){if(c[h+1]==-2){f=!0,c[h+1]=-1;continue}let m=t.map(n[h]+o),p=m-i;if(p<0||p>=r.content.size){f=!0;continue}let g=t.map(n[h+1]+o,-1),b=g-i,{index:S,offset:E}=r.content.findIndex(p),C=r.maybeChild(S);if(C&&E==p&&E+C.nodeSize==b){let M=c[h+2].mapInner(t,C,m+1,n[h]+o+1,a);M!=at?(c[h]=p,c[h+1]=b,c[h+2]=M):(c[h+1]=-2,f=!0)}else f=!0}if(f){let h=ST(c,n,e,t,i,o,a),m=El(h,r,0,a);e=m.local;for(let p=0;p<c.length;p+=3)c[p+1]<0&&(c.splice(p,3),p-=3);for(let p=0,g=0;p<m.children.length;p+=3){let b=m.children[p];for(;g<c.length&&c[g]<b;)g+=3;c.splice(g,0,m.children[p],m.children[p+1],m.children[p+2])}}return new Je(e.sort(Vr),c)}function a0(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let i=n[r];t.push(new bn(i.from+e,i.to+e,i.type))}return t}function ST(n,e,t,r,i,o,a){function c(f,h){for(let m=0;m<f.local.length;m++){let p=f.local[m].map(r,i,h);p?t.push(p):a.onRemove&&a.onRemove(f.local[m].spec)}for(let m=0;m<f.children.length;m+=3)c(f.children[m+2],f.children[m]+h+1)}for(let f=0;f<n.length;f+=3)n[f+1]==-1&&c(n[f+2],e[f]+o+1);return t}function c0(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let o=0,a;o<n.length;o++)(a=n[o])&&a.from>t&&a.to<r&&((i||(i=[])).push(a),n[o]=null);return i}function u0(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function El(n,e,t,r){let i=[],o=!1;e.forEach((c,f)=>{let h=c0(n,c,f+t);if(h){o=!0;let m=El(h,c,t+f+1,r);m!=at&&i.push(f,f+c.nodeSize,m)}});let a=a0(o?u0(n):n,-t).sort(Vr);for(let c=0;c<a.length;c++)a[c].type.valid(e,a[c])||(r.onRemove&&r.onRemove(a[c].spec),a.splice(c--,1));return a.length||i.length?new Je(a,i):at}function Vr(n,e){return n.from-e.from||n.to-e.to}function tf(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let i=t+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==n&&(e=n.slice()),e[i]=o.copy(o.from,r.to),f0(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,o.from),f0(e,i,r.copy(o.from,r.to)));break}}}return e}function f0(n,e,t){for(;e<n.length&&Vr(t,n[e])>0;)e++;n.splice(e,0,t)}for(var gr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},kl={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},xT=typeof navigator<"u"&&/Mac/.test(navigator.platform),ET=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Ze=0;Ze<10;Ze++)gr[48+Ze]=gr[96+Ze]=String(Ze);for(var Ze=1;Ze<=24;Ze++)gr[Ze+111]="F"+Ze;for(var Ze=65;Ze<=90;Ze++)gr[Ze]=String.fromCharCode(Ze+32),kl[Ze]=String.fromCharCode(Ze);for(var nf in gr)kl.hasOwnProperty(nf)||(kl[nf]=gr[nf]);function kT(n){var e=xT&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||ET&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?kl:gr)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const _T=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function TT(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,o,a;for(let c=0;c<e.length-1;c++){let f=e[c];if(/^(cmd|meta|m)$/i.test(f))a=!0;else if(/^a(lt)?$/i.test(f))r=!0;else if(/^(c|ctrl|control)$/i.test(f))i=!0;else if(/^s(hift)?$/i.test(f))o=!0;else if(/^mod$/i.test(f))_T?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+f)}return r&&(t="Alt-"+t),i&&(t="Ctrl-"+t),a&&(t="Meta-"+t),o&&(t="Shift-"+t),t}function CT(n){let e=Object.create(null);for(let t in n)e[TT(t)]=n[t];return e}function rf(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function MT(n){return new lt({props:{handleKeyDown:AT(n)}})}function AT(n){let e=CT(n);return function(t,r){let i=kT(r),o,a=e[rf(i,r)];if(a&&a(t.state,t.dispatch,t))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let c=e[rf(i,r,!1)];if(c&&c(t.state,t.dispatch,t))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=gr[r.keyCode])&&o!=i){let c=e[rf(o,r)];if(c&&c(t.state,t.dispatch,t))return!0}}return!1}}const sf=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function h0(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const d0=(n,e,t)=>{let r=h0(n,t);if(!r)return!1;let i=of(r);if(!i){let a=r.blockRange(),c=a&&xi(a);return c==null?!1:(e&&e(n.tr.lift(a,c).scrollIntoView()),!0)}let o=i.nodeBefore;if(x0(n,i,e,-1))return!0;if(r.parent.content.size==0&&(Mi(o,"end")||Y.isSelectable(o)))for(let a=r.depth;;a--){let c=gl(n.doc,r.before(a),r.after(a),W.empty);if(c&&c.slice.size<c.to-c.from){if(e){let f=n.tr.step(c);f.setSelection(Mi(o,"end")?pe.findFrom(f.doc.resolve(f.mapping.map(i.pos,-1)),-1):Y.create(f.doc,i.pos-o.nodeSize)),e(f.scrollIntoView())}return!0}if(a==1||r.node(a-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},IT=(n,e,t)=>{let r=h0(n,t);if(!r)return!1;let i=of(r);return i?p0(n,i,e):!1},OT=(n,e,t)=>{let r=g0(n,t);if(!r)return!1;let i=lf(r);return i?p0(n,i,e):!1};function p0(n,e,t){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let m=i.lastChild;if(!m)return!1;i=m}let a=e.nodeAfter,c=a,f=e.pos+1;for(;!c.isTextblock;f++){if(c.type.spec.isolating)return!1;let m=c.firstChild;if(!m)return!1;c=m}let h=gl(n.doc,o,f,W.empty);if(!h||h.from!=o||h instanceof Ge&&h.slice.size>=f-o)return!1;if(t){let m=n.tr.step(h);m.setSelection(ce.create(m.doc,o)),t(m.scrollIntoView())}return!0}function Mi(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}const m0=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=of(r)}let a=o&&o.nodeBefore;return!a||!Y.isSelectable(a)?!1:(e&&e(n.tr.setSelection(Y.create(n.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function of(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function g0(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const y0=(n,e,t)=>{let r=g0(n,t);if(!r)return!1;let i=lf(r);if(!i)return!1;let o=i.nodeAfter;if(x0(n,i,e,1))return!0;if(r.parent.content.size==0&&(Mi(o,"start")||Y.isSelectable(o))){let a=gl(n.doc,r.before(),r.after(),W.empty);if(a&&a.slice.size<a.to-a.from){if(e){let c=n.tr.step(a);c.setSelection(Mi(o,"start")?pe.findFrom(c.doc.resolve(c.mapping.map(i.pos)),1):Y.create(c.doc,c.mapping.map(i.pos))),e(c.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},b0=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;o=lf(r)}let a=o&&o.nodeAfter;return!a||!Y.isSelectable(a)?!1:(e&&e(n.tr.setSelection(Y.create(n.doc,o.pos)).scrollIntoView()),!0)};function lf(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}const NT=(n,e)=>{let t=n.selection,r=t instanceof Y,i;if(r){if(t.node.isTextblock||!fr(n.doc,t.from))return!1;i=t.from}else if(i=ml(n.doc,t.from,-1),i==null)return!1;if(e){let o=n.tr.join(i);r&&o.setSelection(Y.create(o.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},RT=(n,e)=>{let t=n.selection,r;if(t instanceof Y){if(t.node.isTextblock||!fr(n.doc,t.to))return!1;r=t.to}else if(r=ml(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},LT=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&xi(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},v0=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
13
+ `).scrollIntoView()),!0)};function af(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const PT=(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),o=t.indexAfter(-1),a=af(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(e){let c=t.after(),f=n.tr.replaceWith(c,c,a.createAndFill());f.setSelection(pe.near(f.doc.resolve(c),1)),e(f.scrollIntoView())}return!0},w0=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof It||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=af(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,c=n.tr.insert(a,o.createAndFill());c.setSelection(ce.create(c.doc,a+1)),e(c.scrollIntoView())}return!0},S0=(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let o=t.before();if(Pn(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&xi(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)};function DT(n){return(e,t)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof Y&&e.selection.node.isBlock)return!r.parentOffset||!Pn(e.doc,r.pos)?!1:(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],a,c,f=!1,h=!1;for(let b=r.depth;;b--)if(r.node(b).isBlock){f=r.end(b)==r.pos+(r.depth-b),h=r.start(b)==r.pos-(r.depth-b),c=af(r.node(b-1).contentMatchAt(r.indexAfter(b-1))),o.unshift(f&&c?{type:c}:null),a=b;break}else{if(b==1)return!1;o.unshift(null)}let m=e.tr;(e.selection instanceof ce||e.selection instanceof It)&&m.deleteSelection();let p=m.mapping.map(r.pos),g=Pn(m.doc,p,o.length,o);if(g||(o[0]=c?{type:c}:null,g=Pn(m.doc,p,o.length,o)),m.split(p,o.length,o),!f&&h&&r.node(a).type!=c){let b=m.mapping.map(r.before(a)),S=m.doc.resolve(b);c&&r.node(a-1).canReplaceWith(S.index(),S.index()+1,c)&&m.setNodeMarkup(m.mapping.map(r.before(a)),c)}return t&&t(m.scrollIntoView()),!0}}const zT=DT(),BT=(n,e)=>{let{$from:t,to:r}=n.selection,i,o=t.sharedDepth(r);return o==0?!1:(i=t.before(o),e&&e(n.tr.setSelection(Y.create(n.doc,i))),!0)};function FT(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||fr(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function x0(n,e,t,r){let i=e.nodeBefore,o=e.nodeAfter,a,c,f=i.type.spec.isolating||o.type.spec.isolating;if(!f&&FT(n,e,t))return!0;let h=!f&&e.parent.canReplace(e.index(),e.index()+1);if(h&&(a=(c=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&c.matchType(a[0]||o.type).validEnd){if(t){let b=e.pos+o.nodeSize,S=L.empty;for(let M=a.length-1;M>=0;M--)S=L.from(a[M].create(null,S));S=L.from(i.copy(S));let E=n.tr.step(new Ke(e.pos-1,b,e.pos,b,new W(S,1,0),a.length,!0)),C=E.doc.resolve(b+2*a.length);C.nodeAfter&&C.nodeAfter.type==i.type&&fr(E.doc,C.pos)&&E.join(C.pos),t(E.scrollIntoView())}return!0}let m=o.type.spec.isolating||r>0&&f?null:pe.findFrom(e,1),p=m&&m.$from.blockRange(m.$to),g=p&&xi(p);if(g!=null&&g>=e.depth)return t&&t(n.tr.lift(p,g).scrollIntoView()),!0;if(h&&Mi(o,"start",!0)&&Mi(i,"end")){let b=i,S=[];for(;S.push(b),!b.isTextblock;)b=b.lastChild;let E=o,C=1;for(;!E.isTextblock;E=E.firstChild)C++;if(b.canReplace(b.childCount,b.childCount,E.content)){if(t){let M=L.empty;for(let F=S.length-1;F>=0;F--)M=L.from(S[F].copy(M));let P=n.tr.step(new Ke(e.pos-S.length,e.pos+o.nodeSize,e.pos+C,e.pos+o.nodeSize-C,new W(M,S.length,0),0,!0));t(P.scrollIntoView())}return!0}}return!1}function E0(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(t&&t(e.tr.setSelection(ce.create(e.doc,n<0?i.start(o):i.end(o)))),!0):!1}}const HT=E0(-1),$T=E0(1);function WT(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o),c=a&&Pu(a,n,e);return c?(r&&r(t.tr.wrap(a,c).scrollIntoView()),!0):!1}}function k0(n,e=null){return function(t,r){let i=!1;for(let o=0;o<t.selection.ranges.length&&!i;o++){let{$from:{pos:a},$to:{pos:c}}=t.selection.ranges[o];t.doc.nodesBetween(a,c,(f,h)=>{if(i)return!1;if(!(!f.isTextblock||f.hasMarkup(n,e)))if(f.type==n)i=!0;else{let m=t.doc.resolve(h),p=m.index();i=m.parent.canReplaceWith(p,p+1,n)}})}if(!i)return!1;if(r){let o=t.tr;for(let a=0;a<t.selection.ranges.length;a++){let{$from:{pos:c},$to:{pos:f}}=t.selection.ranges[a];o.setBlockType(c,f,n,e)}r(o.scrollIntoView())}return!0}}function cf(...n){return function(e,t,r){for(let i=0;i<n.length;i++)if(n[i](e,t,r))return!0;return!1}}cf(sf,d0,m0),cf(sf,y0,b0),cf(v0,w0,S0,zT),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function UT(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o);if(!a)return!1;let c=r?t.tr:null;return VT(c,a,n,e)?(r&&r(c.scrollIntoView()),!0):!1}}function VT(n,e,t,r=null){let i=!1,o=e,a=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let f=a.resolve(e.start-2);o=new ul(f,f,e.depth),e.endIndex<e.parent.childCount&&(e=new ul(e.$from,a.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let c=Pu(o,t,r,e);return c?(n&&KT(n,e,c,i,t),!0):!1}function KT(n,e,t,r,i){let o=L.empty;for(let m=t.length-1;m>=0;m--)o=L.from(t[m].type.create(t[m].attrs,o));n.step(new Ke(e.start-(r?2:0),e.end,e.start,e.end,new W(o,0,0),t.length,!0));let a=0;for(let m=0;m<t.length;m++)t[m].type==i&&(a=m+1);let c=t.length-a,f=e.start+t.length-(r?2:0),h=e.parent;for(let m=e.startIndex,p=e.endIndex,g=!0;m<p;m++,g=!1)!g&&Pn(n.doc,f,c)&&(n.split(f,c),f+=2*c),f+=h.child(m).nodeSize;return n}function GT(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==n);return o?t?r.node(o.depth-1).type==n?JT(e,t,n,o):qT(e,t,o):!0:!1}}function JT(n,e,t,r){let i=n.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new Ke(o-1,a,o,a,new W(L.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new ul(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const c=xi(r);if(c==null)return!1;i.lift(r,c);let f=i.mapping.map(o,-1)-1;return fr(i.doc,f)&&i.join(f),e(i.scrollIntoView()),!0}function qT(n,e,t){let r=n.tr,i=t.parent;for(let b=t.end,S=t.endIndex-1,E=t.startIndex;S>E;S--)b-=i.child(S).nodeSize,r.delete(b-1,b+1);let o=r.doc.resolve(t.start),a=o.nodeAfter;if(r.mapping.map(t.end)!=t.start+o.nodeAfter.nodeSize)return!1;let c=t.startIndex==0,f=t.endIndex==i.childCount,h=o.node(-1),m=o.index(-1);if(!h.canReplace(m+(c?0:1),m+1,a.content.append(f?L.empty:L.from(i))))return!1;let p=o.pos,g=p+a.nodeSize;return r.step(new Ke(p-(c?1:0),g+(f?1:0),p+1,g-1,new W((c?L.empty:L.from(i.copy(L.empty))).append(f?L.empty:L.from(i.copy(L.empty))),c?0:1,f?0:1),c?0:1)),e(r.scrollIntoView()),!0}function jT(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,h=>h.childCount>0&&h.firstChild.type==n);if(!o)return!1;let a=o.startIndex;if(a==0)return!1;let c=o.parent,f=c.child(a-1);if(f.type!=n)return!1;if(t){let h=f.lastChild&&f.lastChild.type==c.type,m=L.from(h?n.create():null),p=new W(L.from(n.create(null,L.from(c.type.create(null,m)))),h?3:1,0),g=o.start,b=o.end;t(e.tr.step(new Ke(g-(h?3:1),b,g,b,p,1,!0)).scrollIntoView())}return!0}}function _l(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:i}=t,{storedMarks:o}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,o=t.storedMarks,t}}}class uf{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:r}=this,{view:i}=t,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([c,f])=>[c,(...m)=>{const p=f(...m)(a);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),p}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,c=[],f=!!e,h=e||o.tr,m=()=>(!f&&t&&!h.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(h),c.every(g=>g===!0)),p={...Object.fromEntries(Object.entries(r).map(([g,b])=>[g,(...E)=>{const C=this.buildProps(h,t),M=b(...E)(C);return c.push(M),p}])),run:m};return p}createCan(e){const{rawCommands:t,state:r}=this,i=!1,o=e||r.tr,a=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(t).map(([f,h])=>[f,(...m)=>h(...m)({...a,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,c={tr:e,editor:i,view:a,state:_l({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([f,h])=>[f,(...m)=>h(...m)(c)]))}};return c}}function K(n,e,t){return n.config[e]===void 0&&n.parent?K(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?K(n.parent,e,t):null}):n.config[e]}function Tl(n){const e=n.filter(i=>i.type==="extension"),t=n.filter(i=>i.type==="node"),r=n.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function _0(n){const e=[],{nodeExtensions:t,markExtensions:r}=Tl(n),i=[...t,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(a=>{const c={name:a.name,options:a.options,storage:a.storage,extensions:i},f=K(a,"addGlobalAttributes",c);if(!f)return;f().forEach(m=>{m.types.forEach(p=>{Object.entries(m.attributes).forEach(([g,b])=>{e.push({type:p,name:g,attribute:{...o,...b}})})})})}),i.forEach(a=>{const c={name:a.name,options:a.options,storage:a.storage},f=K(a,"addAttributes",c);if(!f)return;const h=f();Object.entries(h).forEach(([m,p])=>{const g={...o,...p};typeof g?.default=="function"&&(g.default=g.default()),g?.isRequired&&g?.default===void 0&&delete g.default,e.push({type:a.name,name:m,attribute:g})})}),e}function We(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function Ai(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const c=o?String(o).split(" "):[],f=r[i]?r[i].split(" "):[],h=c.filter(m=>!f.includes(m));r[i]=[...f,...h].join(" ")}else if(i==="style"){const c=o?o.split(";").map(m=>m.trim()).filter(Boolean):[],f=r[i]?r[i].split(";").map(m=>m.trim()).filter(Boolean):[],h=new Map;f.forEach(m=>{const[p,g]=m.split(":").map(b=>b.trim());h.set(p,g)}),c.forEach(m=>{const[p,g]=m.split(":").map(b=>b.trim());h.set(p,g)}),r[i]=Array.from(h.entries()).map(([m,p])=>`${m}: ${p}`).join("; ")}else r[i]=o}),r},{})}function ff(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>Ai(t,r),{})}function YT(n){return typeof n=="function"}function ae(n,e=void 0,...t){return YT(n)?e?n.bind(e)(...t):n(...t):n}function XT(n={}){return Object.keys(n).length===0&&n.constructor===Object}function ZT(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function T0(n,e){return"style"in n?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const i=e.reduce((o,a)=>{const c=a.attribute.parseHTML?a.attribute.parseHTML(t):ZT(t.getAttribute(a.name));return c==null?o:{...o,[a.name]:c}},{});return{...r,...i}}}}function C0(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&XT(t)?!1:t!=null))}function M0(n,e){var t;const r=_0(n),{nodeExtensions:i,markExtensions:o}=Tl(n),a=(t=i.find(h=>K(h,"topNode")))===null||t===void 0?void 0:t.name,c=Object.fromEntries(i.map(h=>{const m=r.filter(M=>M.type===h.name),p={name:h.name,options:h.options,storage:h.storage,editor:e},g=n.reduce((M,P)=>{const F=K(P,"extendNodeSchema",p);return{...M,...F?F(h):{}}},{}),b=C0({...g,content:ae(K(h,"content",p)),marks:ae(K(h,"marks",p)),group:ae(K(h,"group",p)),inline:ae(K(h,"inline",p)),atom:ae(K(h,"atom",p)),selectable:ae(K(h,"selectable",p)),draggable:ae(K(h,"draggable",p)),code:ae(K(h,"code",p)),whitespace:ae(K(h,"whitespace",p)),linebreakReplacement:ae(K(h,"linebreakReplacement",p)),defining:ae(K(h,"defining",p)),isolating:ae(K(h,"isolating",p)),attrs:Object.fromEntries(m.map(M=>{var P;return[M.name,{default:(P=M?.attribute)===null||P===void 0?void 0:P.default}]}))}),S=ae(K(h,"parseHTML",p));S&&(b.parseDOM=S.map(M=>T0(M,m)));const E=K(h,"renderHTML",p);E&&(b.toDOM=M=>E({node:M,HTMLAttributes:ff(M,m)}));const C=K(h,"renderText",p);return C&&(b.toText=C),[h.name,b]})),f=Object.fromEntries(o.map(h=>{const m=r.filter(C=>C.type===h.name),p={name:h.name,options:h.options,storage:h.storage,editor:e},g=n.reduce((C,M)=>{const P=K(M,"extendMarkSchema",p);return{...C,...P?P(h):{}}},{}),b=C0({...g,inclusive:ae(K(h,"inclusive",p)),excludes:ae(K(h,"excludes",p)),group:ae(K(h,"group",p)),spanning:ae(K(h,"spanning",p)),code:ae(K(h,"code",p)),attrs:Object.fromEntries(m.map(C=>{var M;return[C.name,{default:(M=C?.attribute)===null||M===void 0?void 0:M.default}]}))}),S=ae(K(h,"parseHTML",p));S&&(b.parseDOM=S.map(C=>T0(C,m)));const E=K(h,"renderHTML",p);return E&&(b.toDOM=C=>E({mark:C,HTMLAttributes:ff(C,m)})),[h.name,b]}));return new Zm({topNode:a,nodes:c,marks:f})}function hf(n,e){return e.nodes[n]||e.marks[n]||null}function A0(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}function I0(n,e){const t=Us.fromSchema(e).serializeFragment(n),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}const QT=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,o,a,c)=>{var f,h;const m=((h=(f=i.type.spec).toText)===null||h===void 0?void 0:h.call(f,{node:i,pos:o,parent:a,index:c}))||i.textContent||"%leaf%";t+=i.isAtom&&!i.isText?m:m.slice(0,Math.max(0,r-o))}),t};function df(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class O0{constructor(e){this.find=e.find,this.handler=e.handler}}const eC=(n,e)=>{if(df(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function Cl(n){var e;const{editor:t,from:r,to:i,text:o,rules:a,plugin:c}=n,{view:f}=t;if(f.composing)return!1;const h=f.state.doc.resolve(r);if(h.parent.type.spec.code||!((e=h.nodeBefore||h.nodeAfter)===null||e===void 0)&&e.marks.find(g=>g.type.spec.code))return!1;let m=!1;const p=QT(h)+o;return a.forEach(g=>{if(m)return;const b=eC(p,g.find);if(!b)return;const S=f.state.tr,E=_l({state:f.state,transaction:S}),C={from:r-(b[0].length-o.length),to:i},{commands:M,chain:P,can:F}=new uf({editor:t,state:E});g.handler({state:E,range:C,match:b,commands:M,chain:P,can:F})===null||!S.steps.length||(S.setMeta(c,{transform:S,from:r,to:i,text:o}),f.dispatch(S),m=!0)}),m}function tC(n){const{editor:e,rules:t}=n,r=new lt({state:{init(){return null},apply(i,o,a){const c=i.getMeta(r);if(c)return c;const f=i.getMeta("applyInputRules");return!!f&&setTimeout(()=>{let{text:m}=f;typeof m=="string"?m=m:m=I0(L.from(m),a.schema);const{from:p}=f,g=p+m.length;Cl({editor:e,from:p,to:g,text:m,rules:t,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,a,c){return Cl({editor:e,from:o,to:a,text:c,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Cl({editor:e,from:o.pos,to:o.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?Cl({editor:e,from:a.pos,to:a.pos,text:`
14
+ `,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function nC(n){return Object.prototype.toString.call(n).slice(8,-1)}function Ml(n){return nC(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function Al(n,e){const t={...n};return Ml(n)&&Ml(e)&&Object.keys(e).forEach(r=>{Ml(e[r])&&Ml(n[r])?t[r]=Al(n[r],e[r]):t[r]=e[r]}),t}class yt{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ae(K(this,"addOptions",{name:this.name}))),this.storage=ae(K(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new yt(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Al(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new yt(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ae(K(t,"addOptions",{name:t.name})),t.storage=ae(K(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(h=>h?.type.name===t.name))return!1;const f=a.find(h=>h?.type.name===t.name);return f&&r.removeStoredMark(f),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}function rC(n){return typeof n=="number"}class iC{constructor(e){this.find=e.find,this.handler=e.handler}}const sC=(n,e,t)=>{if(df(e))return[...n.matchAll(e)];const r=e(n,t);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=n,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function oC(n){const{editor:e,state:t,from:r,to:i,rule:o,pasteEvent:a,dropEvent:c}=n,{commands:f,chain:h,can:m}=new uf({editor:e,state:t}),p=[];return t.doc.nodesBetween(r,i,(b,S)=>{if(!b.isTextblock||b.type.spec.code)return;const E=Math.max(r,S),C=Math.min(i,S+b.content.size),M=b.textBetween(E-S,C-S,void 0,"\uFFFC");sC(M,o.find,a).forEach(F=>{if(F.index===void 0)return;const $=E+F.index+1,U=$+F[0].length,ue={from:t.tr.mapping.map($),to:t.tr.mapping.map(U)},he=o.handler({state:t,range:ue,match:F,commands:f,chain:h,can:m,pasteEvent:a,dropEvent:c});p.push(he)})}),p.every(b=>b!==null)}let Il=null;const lC=n=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)===null||e===void 0||e.setData("text/html",n),t};function aC(n){const{editor:e,rules:t}=n;let r=null,i=!1,o=!1,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,c;try{c=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{c=null}const f=({state:m,from:p,to:g,rule:b,pasteEvt:S})=>{const E=m.tr,C=_l({state:m,transaction:E});if(!(!oC({editor:e,state:C,from:Math.max(p-1,0),to:g.b-1,rule:b,pasteEvent:S,dropEvent:c})||!E.steps.length)){try{c=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{c=null}return a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,E}};return t.map(m=>new lt({view(p){const g=S=>{var E;r=!((E=p.dom.parentElement)===null||E===void 0)&&E.contains(S.target)?p.dom.parentElement:null,r&&(Il=e)},b=()=>{Il&&(Il=null)};return window.addEventListener("dragstart",g),window.addEventListener("dragend",b),{destroy(){window.removeEventListener("dragstart",g),window.removeEventListener("dragend",b)}}},props:{handleDOMEvents:{drop:(p,g)=>{if(o=r===p.dom.parentElement,c=g,!o){const b=Il;b&&setTimeout(()=>{const S=b.state.selection;S&&b.commands.deleteRange({from:S.from,to:S.to})},10)}return!1},paste:(p,g)=>{var b;const S=(b=g.clipboardData)===null||b===void 0?void 0:b.getData("text/html");return a=g,i=!!S?.includes("data-pm-slice"),!1}}},appendTransaction:(p,g,b)=>{const S=p[0],E=S.getMeta("uiEvent")==="paste"&&!i,C=S.getMeta("uiEvent")==="drop"&&!o,M=S.getMeta("applyPasteRules"),P=!!M;if(!E&&!C&&!P)return;if(P){let{text:U}=M;typeof U=="string"?U=U:U=I0(L.from(U),b.schema);const{from:ue}=M,he=ue+U.length,be=lC(U);return f({rule:m,state:b,from:ue,to:{b:he},pasteEvt:be})}const F=g.doc.content.findDiffStart(b.doc.content),$=g.doc.content.findDiffEnd(b.doc.content);if(!(!rC(F)||!$||F===$.b))return f({rule:m,state:b,from:F,to:$,pasteEvt:a})}}))}function cC(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return Array.from(new Set(e))}class Di{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=Di.resolve(e),this.schema=M0(this.extensions,t),this.setupExtensions()}static resolve(e){const t=Di.sort(Di.flatten(e)),r=cC(t.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map(t=>{const r={name:t.name,options:t.options,storage:t.storage},i=K(t,"addExtensions",r);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=K(r,"priority")||100,a=K(i,"priority")||100;return o>a?-1:o<a?1:0})}get commands(){return this.extensions.reduce((e,t)=>{const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:hf(t.name,this.schema)},i=K(t,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=Di.sort([...this.extensions].reverse()),r=[],i=[],o=t.map(a=>{const c={name:a.name,options:a.options,storage:a.storage,editor:e,type:hf(a.name,this.schema)},f=[],h=K(a,"addKeyboardShortcuts",c);let m={};if(a.type==="mark"&&K(a,"exitable",c)&&(m.ArrowRight=()=>yt.handleExit({editor:e,mark:a})),h){const E=Object.fromEntries(Object.entries(h()).map(([C,M])=>[C,()=>M({editor:e})]));m={...m,...E}}const p=MT(m);f.push(p);const g=K(a,"addInputRules",c);A0(a,e.options.enableInputRules)&&g&&r.push(...g());const b=K(a,"addPasteRules",c);A0(a,e.options.enablePasteRules)&&b&&i.push(...b());const S=K(a,"addProseMirrorPlugins",c);if(S){const E=S();f.push(...E)}return f}).flat();return[tC({editor:e,rules:r}),...aC({editor:e,rules:i}),...o]}get attributes(){return _0(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Tl(this.extensions);return Object.fromEntries(t.filter(r=>!!K(r,"addNodeView")).map(r=>{const i=this.attributes.filter(f=>f.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:We(r.name,this.schema)},a=K(r,"addNodeView",o);if(!a)return[];const c=(f,h,m,p,g)=>{const b=ff(f,i);return a()({node:f,view:h,getPos:m,decorations:p,innerDecorations:g,editor:e,extension:r,HTMLAttributes:b})};return[r.name,c]}))}setupExtensions(){this.extensions.forEach(e=>{var t;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:hf(e.name,this.schema)};e.type==="mark"&&(!((t=ae(K(e,"keepOnSplit",r)))!==null&&t!==void 0)||t)&&this.splittableMarks.push(e.name);const i=K(e,"onBeforeCreate",r),o=K(e,"onCreate",r),a=K(e,"onUpdate",r),c=K(e,"onSelectionUpdate",r),f=K(e,"onTransaction",r),h=K(e,"onFocus",r),m=K(e,"onBlur",r),p=K(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),a&&this.editor.on("update",a),c&&this.editor.on("selectionUpdate",c),f&&this.editor.on("transaction",f),h&&this.editor.on("focus",h),m&&this.editor.on("blur",m),p&&this.editor.on("destroy",p)})}}class Ie{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ae(K(this,"addOptions",{name:this.name}))),this.storage=ae(K(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ie(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Al(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new Ie({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ae(K(t,"addOptions",{name:t.name})),t.storage=ae(K(t,"addStorage",{name:t.name,options:t.options})),t}}function uC(n,e,t){const{from:r,to:i}=e,{blockSeparator:o=`
15
15
 
16
- `,textSerializers:a={}}=t||{};let c="";return n.nodesBetween(r,i,(f,h,m,p)=>{var g;f.isBlock&&h>r&&(c+=o);const b=a?.[f.type.name];if(b)return m&&(c+=b({node:f,pos:h,parent:m,index:p,range:e})),!1;f.isText&&(c+=(g=f?.text)===null||g===void 0?void 0:g.slice(Math.max(r,h)-h,i-h))}),c}function uC(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}Ie.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new lt({key:new Tt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:o}=i,a=Math.min(...o.map(m=>m.$from.pos)),c=Math.max(...o.map(m=>m.$to.pos)),f=uC(t);return cC(r,{from:a,to:c},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:f})}}})]}});const fC=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),hC=(n=!1)=>({commands:e})=>e.setContent("",n),dC=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:o,$to:a})=>{n.doc.nodesBetween(o.pos,a.pos,(c,f)=>{if(c.type.isText)return;const{doc:h,mapping:m}=e,p=h.resolve(m.map(f)),g=h.resolve(m.map(f+c.nodeSize)),b=p.blockRange(g);if(!b)return;const S=xi(b);if(c.type.isTextblock){const{defaultType:E}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(b.start,E)}(S||S===0)&&e.lift(b,S)})}),!0},pC=n=>e=>n(e),mC=()=>({state:n,dispatch:e})=>w0(n,e),gC=(n,e)=>({editor:t,tr:r})=>{const{state:i}=t,o=i.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const a=r.mapping.map(e);return r.insert(a,o.content),r.setSelection(new ce(r.doc.resolve(a-1))),!0},yC=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const i=n.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const c=i.before(o),f=i.after(o);n.delete(c,f).scrollIntoView()}return!0}return!1},bC=n=>({tr:e,state:t,dispatch:r})=>{const i=We(n,t.schema),o=e.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i){if(r){const f=o.before(a),h=o.after(a);e.delete(f,h).scrollIntoView()}return!0}return!1},vC=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},wC=()=>({state:n,dispatch:e})=>sf(n,e),SC=()=>({commands:n})=>n.keyboardShortcut("Enter"),xC=()=>({state:n,dispatch:e})=>LT(n,e);function Ol(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:df(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function N0(n,e,t={}){return n.find(r=>r.type===e&&Ol(Object.fromEntries(Object.keys(t).map(i=>[i,r.attrs[i]])),t))}function R0(n,e,t={}){return!!N0(n,e,t)}function pf(n,e,t){var r;if(!n||!e)return;let i=n.parent.childAfter(n.parentOffset);if((!i.node||!i.node.marks.some(m=>m.type===e))&&(i=n.parent.childBefore(n.parentOffset)),!i.node||!i.node.marks.some(m=>m.type===e)||(t=t||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!N0([...i.node.marks],e,t)))return;let a=i.index,c=n.start()+i.offset,f=a+1,h=c+i.node.nodeSize;for(;a>0&&R0([...n.parent.child(a-1).marks],e,t);)a-=1,c-=n.parent.child(a).nodeSize;for(;f<n.parent.childCount&&R0([...n.parent.child(f).marks],e,t);)h+=n.parent.child(f).nodeSize,f+=1;return{from:c,to:h}}function hn(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}const EC=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const o=hn(n,r.schema),{doc:a,selection:c}=t,{$from:f,from:h,to:m}=c;if(i){const p=pf(f,o,e);if(p&&p.from<=h&&p.to>=m){const g=ce.create(a,p.from,p.to);t.setSelection(g)}}return!0},kC=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r<t.length;r+=1)if(t[r](e))return!0;return!1};function L0(n){return n instanceof ce}function Vr(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function _C(n,e=null){if(!e)return null;const t=pe.atStart(n),r=pe.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,o=r.to;return e==="all"?ce.create(n,Vr(0,i,o),Vr(n.content.size,i,o)):ce.create(n,Vr(e,i,o),Vr(e,i,o))}function TC(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function mf(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const CC=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const a=()=>{(mf()||TC())&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e?.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(o&&n===null&&!L0(t.state.selection))return a(),!0;const c=_C(i.doc,n)||t.state.selection,f=t.state.selection.eq(c);return o&&(f||i.setSelection(c),f&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},MC=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),AC=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),P0=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const r=e[t];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?n.removeChild(r):r.nodeType===1&&P0(r)}return n};function Nl(n){const e=`<body>${n}</body>`,t=new window.DOMParser().parseFromString(e,"text/html").body;return P0(t)}function Rl(n,e,t){if(n instanceof ur||n instanceof L)return n;t={slice:!0,parseOptions:{},...t};const r=typeof n=="object"&&n!==null,i=typeof n=="string";if(r)try{if(Array.isArray(n)&&n.length>0)return L.fromArray(n.map(c=>e.nodeFromJSON(c)));const a=e.nodeFromJSON(n);return t.errorOnInvalidContent&&a.check(),a}catch(o){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",o),Rl("",e,t)}if(i){if(t.errorOnInvalidContent){let a=!1,c="";const f=new Zm({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:h=>(a=!0,c=typeof h=="string"?h:h.outerHTML,null)}]}})});if(t.slice?vs.fromSchema(f).parseSlice(Nl(n),t.parseOptions):vs.fromSchema(f).parse(Nl(n),t.parseOptions),t.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${c}`)})}const o=vs.fromSchema(e);return t.slice?o.parseSlice(Nl(n),t.parseOptions).content:o.parse(Nl(n),t.parseOptions)}return Rl("",e,t)}function IC(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof Ge||i instanceof Ke))return;const o=n.mapping.maps[r];let a=0;o.forEach((c,f,h,m)=>{a===0&&(a=m)}),n.setSelection(pe.near(n.doc.resolve(a),t))}const OC=n=>!("type"in n),NC=(n,e,t)=>({tr:r,dispatch:i,editor:o})=>{var a;if(i){t={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let c;try{c=Rl(e,o.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions},errorOnInvalidContent:(a=t.errorOnInvalidContent)!==null&&a!==void 0?a:o.options.enableContentCheck})}catch(S){return o.emit("contentError",{editor:o,error:S,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:f,to:h}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},m=!0,p=!0;if((OC(c)?c:[c]).forEach(S=>{S.check(),m=m?S.isText&&S.marks.length===0:!1,p=p?S.isBlock:!1}),f===h&&p){const{parent:S}=r.doc.resolve(f);S.isTextblock&&!S.type.spec.code&&!S.childCount&&(f-=1,h+=1)}let b;if(m){if(Array.isArray(e))b=e.map(S=>S.text||"").join("");else if(e instanceof L){let S="";e.forEach(E=>{E.text&&(S+=E.text)}),b=S}else typeof e=="object"&&e&&e.text?b=e.text:b=e;r.insertText(b,f,h)}else b=c,r.replaceWith(f,h,b);t.updateSelection&&IC(r,r.steps.length-1,-1),t.applyInputRules&&r.setMeta("applyInputRules",{from:f,text:b}),t.applyPasteRules&&r.setMeta("applyPasteRules",{from:f,text:b})}return!0},RC=()=>({state:n,dispatch:e})=>OT(n,e),LC=()=>({state:n,dispatch:e})=>NT(n,e),PC=()=>({state:n,dispatch:e})=>d0(n,e),DC=()=>({state:n,dispatch:e})=>y0(n,e),BC=()=>({state:n,dispatch:e,tr:t})=>{try{const r=ml(n.doc,n.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},zC=()=>({state:n,dispatch:e,tr:t})=>{try{const r=ml(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},FC=()=>({state:n,dispatch:e})=>AT(n,e),HC=()=>({state:n,dispatch:e})=>IT(n,e);function D0(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function $C(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,o,a;for(let c=0;c<e.length-1;c+=1){const f=e[c];if(/^(cmd|meta|m)$/i.test(f))a=!0;else if(/^a(lt)?$/i.test(f))r=!0;else if(/^(c|ctrl|control)$/i.test(f))i=!0;else if(/^s(hift)?$/i.test(f))o=!0;else if(/^mod$/i.test(f))mf()||D0()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${f}`)}return r&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),a&&(t=`Meta-${t}`),o&&(t=`Shift-${t}`),t}const WC=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const o=$C(n).split(/-(?!$)/),a=o.find(h=>!["Alt","Ctrl","Meta","Shift"].includes(h)),c=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),f=e.captureTransaction(()=>{t.someProp("handleKeyDown",h=>h(t,c))});return f?.steps.forEach(h=>{const m=h.map(r.mapping);m&&i&&r.maybeStep(m)}),!0};function gf(n,e,t={}){const{from:r,to:i,empty:o}=n.selection,a=e?We(e,n.schema):null,c=[];n.doc.nodesBetween(r,i,(p,g)=>{if(p.isText)return;const b=Math.max(r,g),S=Math.min(i,g+p.nodeSize);c.push({node:p,from:b,to:S})});const f=i-r,h=c.filter(p=>a?a.name===p.node.type.name:!0).filter(p=>Ol(p.node.attrs,t,{strict:!1}));return o?!!h.length:h.reduce((p,g)=>p+g.to-g.from,0)>=f}const UC=(n,e={})=>({state:t,dispatch:r})=>{const i=We(n,t.schema);return gf(t,i,e)?RT(t,r):!1},VC=()=>({state:n,dispatch:e})=>S0(n,e),KC=n=>({state:e,dispatch:t})=>{const r=We(n,e.schema);return KT(r)(e,t)},GC=()=>({state:n,dispatch:e})=>v0(n,e);function yf(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function B0(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,i)=>(t.includes(i)||(r[i]=n[i]),r),{})}const JC=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const c=yf(typeof n=="string"?n:n.name,r.schema);return c?(c==="node"&&(o=We(n,r.schema)),c==="mark"&&(a=hn(n,r.schema)),i&&t.selection.ranges.forEach(f=>{r.doc.nodesBetween(f.$from.pos,f.$to.pos,(h,m)=>{o&&o===h.type&&t.setNodeMarkup(m,void 0,B0(h.attrs,e)),a&&h.marks.length&&h.marks.forEach(p=>{a===p.type&&t.addMark(m,m+h.nodeSize,a.create(B0(p.attrs,e)))})})}),!0):!1},qC=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),jC=()=>({tr:n,dispatch:e})=>{if(e){const t=new At(n.doc);n.setSelection(t)}return!0},YC=()=>({state:n,dispatch:e})=>m0(n,e),XC=()=>({state:n,dispatch:e})=>b0(n,e),ZC=()=>({state:n,dispatch:e})=>BT(n,e),QC=()=>({state:n,dispatch:e})=>HT(n,e),eM=()=>({state:n,dispatch:e})=>FT(n,e);function tM(n,e,t={},r={}){return Rl(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:r.errorOnInvalidContent})}const nM=(n,e=!1,t={},r={})=>({editor:i,tr:o,dispatch:a,commands:c})=>{var f,h;const{doc:m}=o;if(t.preserveWhitespace!=="full"){const p=tM(n,i.schema,t,{errorOnInvalidContent:(f=r.errorOnInvalidContent)!==null&&f!==void 0?f:i.options.enableContentCheck});return a&&o.replaceWith(0,m.content.size,p).setMeta("preventUpdate",!e),!0}return a&&o.setMeta("preventUpdate",!e),c.insertContentAt({from:0,to:m.content.size},n,{parseOptions:t,errorOnInvalidContent:(h=r.errorOnInvalidContent)!==null&&h!==void 0?h:i.options.enableContentCheck})};function z0(n,e){const t=hn(e,n.schema),{from:r,to:i,empty:o}=n.selection,a=[];o?(n.storedMarks&&a.push(...n.storedMarks),a.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,f=>{a.push(...f.marks)});const c=a.find(f=>f.type.name===t.name);return c?{...c.attrs}:{}}function rM(n,e){const t=new N_(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function iM(n){for(let e=0;e<n.edgeCount;e+=1){const{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function sM(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,o)=>{t(i)&&r.push({node:i,pos:o})}),r}function oM(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function bf(n){return e=>oM(e.$from,n)}function lM(n,e){const t=Di.resolve(n);return M0(t,e)}function aM(n,e){const t=We(e,n.schema),{from:r,to:i}=n.selection,o=[];n.doc.nodesBetween(r,i,c=>{o.push(c)});const a=o.reverse().find(c=>c.type.name===t.name);return a?{...a.attrs}:{}}function cM(n,e){const t=yf(typeof e=="string"?e:e.name,n.schema);return t==="node"?aM(n,e):t==="mark"?z0(n,e):{}}function uM(n,e=JSON.stringify){const t={};return n.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function fM(n){const e=uM(n);return e.length===1?e:e.filter((t,r)=>!e.filter((o,a)=>a!==r).some(o=>t.oldRange.from>=o.oldRange.from&&t.oldRange.to<=o.oldRange.to&&t.newRange.from>=o.newRange.from&&t.newRange.to<=o.newRange.to))}function hM(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,o)=>{const a=[];if(i.ranges.length)i.forEach((c,f)=>{a.push({from:c,to:f})});else{const{from:c,to:f}=t[o];if(c===void 0||f===void 0)return;a.push({from:c,to:f})}a.forEach(({from:c,to:f})=>{const h=e.slice(o).map(c,-1),m=e.slice(o).map(f),p=e.invert().map(h,-1),g=e.invert().map(m);r.push({oldRange:{from:p,to:g},newRange:{from:h,to:m}})})}),fM(r)}function F0(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const o=t.resolve(n),a=pf(o,i.type);a&&r.push({mark:i,...a})}):t.nodesBetween(n,e,(i,o)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(a=>({from:o,to:o+i.nodeSize,mark:a})))}),r}function Ll(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const i=n.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function dM(n,e,t={}){const{empty:r,ranges:i}=n.selection,o=e?hn(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(p=>o?o.name===p.type.name:!0).find(p=>Ol(p.attrs,t,{strict:!1}));let a=0;const c=[];if(i.forEach(({$from:p,$to:g})=>{const b=p.pos,S=g.pos;n.doc.nodesBetween(b,S,(E,C)=>{if(!E.isText&&!E.marks.length)return;const M=Math.max(b,C),P=Math.min(S,C+E.nodeSize),F=P-M;a+=F,c.push(...E.marks.map($=>({mark:$,from:M,to:P})))})}),a===0)return!1;const f=c.filter(p=>o?o.name===p.mark.type.name:!0).filter(p=>Ol(p.mark.attrs,t,{strict:!1})).reduce((p,g)=>p+g.to-g.from,0),h=c.filter(p=>o?p.mark.type!==o&&p.mark.type.excludes(o):!0).reduce((p,g)=>p+g.to-g.from,0);return(f>0?f+h:f)>=a}function H0(n,e){const{nodeExtensions:t}=Tl(e),r=t.find(a=>a.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=ae(K(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function $0(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var r;if(t){if(n.type.name==="hardBreak")return!0;if(n.isText)return/^\s*$/m.test((r=n.text)!==null&&r!==void 0?r:"")}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let i=!0;return n.content.forEach(o=>{i!==!1&&($0(o,{ignoreWhitespace:t,checkChildren:e})||(i=!1))}),i}return!1}function pM(n,e,t){var r;const{selection:i}=e;let o=null;if(L0(i)&&(o=i.$cursor),o){const c=(r=n.storedMarks)!==null&&r!==void 0?r:o.marks();return!!t.isInSet(c)||!c.some(f=>f.type.excludes(t))}const{ranges:a}=i;return a.some(({$from:c,$to:f})=>{let h=c.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(c.pos,f.pos,(m,p,g)=>{if(h)return!1;if(m.isInline){const b=!g||g.type.allowsMarkType(t),S=!!t.isInSet(m.marks)||!m.marks.some(E=>E.type.excludes(t));h=b&&S}return!h}),h})}const mM=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:o}=t,{empty:a,ranges:c}=o,f=hn(n,r.schema);if(i)if(a){const h=z0(r,f);t.addStoredMark(f.create({...h,...e}))}else c.forEach(h=>{const m=h.$from.pos,p=h.$to.pos;r.doc.nodesBetween(m,p,(g,b)=>{const S=Math.max(b,m),E=Math.min(b+g.nodeSize,p);g.marks.find(M=>M.type===f)?g.marks.forEach(M=>{f===M.type&&t.addMark(S,E,f.create({...M.attrs,...e}))}):t.addMark(S,E,f.create(e))})});return pM(r,t,f)},gM=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),yM=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const o=We(n,t.schema);let a;return t.selection.$anchor.sameParent(t.selection.$head)&&(a=t.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:c})=>k0(o,{...a,...e})(t)?!0:c.clearNodes()).command(({state:c})=>k0(o,{...a,...e})(c,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},bM=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=Vr(n,0,r.content.size),o=Y.create(r,i);e.setSelection(o)}return!0},vM=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:o}=typeof n=="number"?{from:n,to:n}:n,a=ce.atStart(r).from,c=ce.atEnd(r).to,f=Vr(i,a,c),h=Vr(o,a,c),m=ce.create(r,f,h);e.setSelection(m)}return!0},wM=n=>({state:e,dispatch:t})=>{const r=We(n,e.schema);return qT(r)(e,t)};function W0(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(i=>e?.includes(i.type.name));n.tr.ensureMarks(r)}}const SM=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:o,doc:a}=e,{$from:c,$to:f}=o,h=i.extensionManager.attributes,m=Ll(h,c.node().type.name,c.node().attrs);if(o instanceof Y&&o.node.isBlock)return!c.parentOffset||!Pn(a,c.pos)?!1:(r&&(n&&W0(t,i.extensionManager.splittableMarks),e.split(c.pos).scrollIntoView()),!0);if(!c.parent.isBlock)return!1;const p=f.parentOffset===f.parent.content.size,g=c.depth===0?void 0:iM(c.node(-1).contentMatchAt(c.indexAfter(-1)));let b=p&&g?[{type:g,attrs:m}]:void 0,S=Pn(e.doc,e.mapping.map(c.pos),1,b);if(!b&&!S&&Pn(e.doc,e.mapping.map(c.pos),1,g?[{type:g}]:void 0)&&(S=!0,b=g?[{type:g,attrs:m}]:void 0),r){if(S&&(o instanceof ce&&e.deleteSelection(),e.split(e.mapping.map(c.pos),1,b),g&&!p&&!c.parentOffset&&c.parent.type!==g)){const E=e.mapping.map(c.before()),C=e.doc.resolve(E);c.node(-1).canReplaceWith(C.index(),C.index()+1,g)&&e.setNodeMarkup(e.mapping.map(c.before()),g)}n&&W0(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return S},xM=(n,e={})=>({tr:t,state:r,dispatch:i,editor:o})=>{var a;const c=We(n,r.schema),{$from:f,$to:h}=r.selection,m=r.selection.node;if(m&&m.isBlock||f.depth<2||!f.sameParent(h))return!1;const p=f.node(-1);if(p.type!==c)return!1;const g=o.extensionManager.attributes;if(f.parent.content.size===0&&f.node(-1).childCount===f.indexAfter(-1)){if(f.depth===2||f.node(-3).type!==c||f.index(-2)!==f.node(-2).childCount-1)return!1;if(i){let M=L.empty;const P=f.index(-1)?1:f.index(-2)?2:3;for(let be=f.depth-P;be>=f.depth-3;be-=1)M=L.from(f.node(be).copy(M));const F=f.indexAfter(-1)<f.node(-2).childCount?1:f.indexAfter(-2)<f.node(-3).childCount?2:3,$={...Ll(g,f.node().type.name,f.node().attrs),...e},U=((a=c.contentMatch.defaultType)===null||a===void 0?void 0:a.createAndFill($))||void 0;M=M.append(L.from(c.createAndFill(null,U)||void 0));const ue=f.before(f.depth-(P-1));t.replace(ue,f.after(-F),new W(M,4-P,0));let he=-1;t.doc.nodesBetween(ue,t.doc.content.size,(be,yt)=>{if(he>-1)return!1;be.isTextblock&&be.content.size===0&&(he=yt+1)}),he>-1&&t.setSelection(ce.near(t.doc.resolve(he))),t.scrollIntoView()}return!0}const b=h.pos===f.end()?p.contentMatchAt(0).defaultType:null,S={...Ll(g,p.type.name,p.attrs),...e},E={...Ll(g,f.node().type.name,f.node().attrs),...e};t.delete(f.pos,h.pos);const C=b?[{type:c,attrs:S},{type:b,attrs:E}]:[{type:c,attrs:S}];if(!Pn(t.doc,f.pos,2))return!1;if(i){const{selection:M,storedMarks:P}=r,{splittableMarks:F}=o.extensionManager,$=P||M.$to.parentOffset&&M.$from.marks();if(t.split(f.pos,2,C).scrollIntoView(),!$||!i)return!0;const U=$.filter(ue=>F.includes(ue.type.name));t.ensureMarks(U)}return!0},vf=(n,e)=>{const t=bf(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===i?.type&&fr(n.doc,t.pos)&&n.join(t.pos),!0},wf=(n,e)=>{const t=bf(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===i?.type&&fr(n.doc,r)&&n.join(r),!0},EM=(n,e,t,r={})=>({editor:i,tr:o,state:a,dispatch:c,chain:f,commands:h,can:m})=>{const{extensions:p,splittableMarks:g}=i.extensionManager,b=We(n,a.schema),S=We(e,a.schema),{selection:E,storedMarks:C}=a,{$from:M,$to:P}=E,F=M.blockRange(P),$=C||E.$to.parentOffset&&E.$from.marks();if(!F)return!1;const U=bf(ue=>H0(ue.type.name,p))(E);if(F.depth>=1&&U&&F.depth-U.depth<=1){if(U.node.type===b)return h.liftListItem(S);if(H0(U.node.type.name,p)&&b.validContent(U.node.content)&&c)return f().command(()=>(o.setNodeMarkup(U.pos,b),!0)).command(()=>vf(o,b)).command(()=>wf(o,b)).run()}return!t||!$||!c?f().command(()=>m().wrapInList(b,r)?!0:h.clearNodes()).wrapInList(b,r).command(()=>vf(o,b)).command(()=>wf(o,b)).run():f().command(()=>{const ue=m().wrapInList(b,r),he=$.filter(be=>g.includes(be.type.name));return o.ensureMarks(he),ue?!0:h.clearNodes()}).wrapInList(b,r).command(()=>vf(o,b)).command(()=>wf(o,b)).run()},kM=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=t,a=hn(n,r.schema);return dM(r,a,e)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,e)},_M=(n,e,t={})=>({state:r,commands:i})=>{const o=We(n,r.schema),a=We(e,r.schema),c=gf(r,o,t);let f;return r.selection.$anchor.sameParent(r.selection.$head)&&(f=r.selection.$anchor.parent.attrs),c?i.setNode(a,f):i.setNode(o,{...f,...t})},TM=(n,e={})=>({state:t,commands:r})=>{const i=We(n,t.schema);return gf(t,i,e)?r.lift(i):r.wrapIn(i,e)},CM=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r<t.length;r+=1){const i=t[r];let o;if(i.spec.isInputRules&&(o=i.getState(n))){if(e){const a=n.tr,c=o.transform;for(let f=c.steps.length-1;f>=0;f-=1)a.step(c.steps[f].invert(c.docs[f]));if(o.text){const f=a.doc.resolve(o.from).marks();a.replaceWith(o.from,o.to,n.schema.text(o.text,f))}else a.delete(o.from,o.to)}return!0}}return!1},MM=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:i}=t;return r||e&&i.forEach(o=>{n.removeMark(o.$from.pos,o.$to.pos)}),!0},AM=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=e,{selection:c}=t,f=hn(n,r.schema),{$from:h,empty:m,ranges:p}=c;if(!i)return!0;if(m&&a){let{from:g,to:b}=c;const S=(o=h.marks().find(C=>C.type===f))===null||o===void 0?void 0:o.attrs,E=pf(h,f,S);E&&(g=E.from,b=E.to),t.removeMark(g,b,f)}else p.forEach(g=>{t.removeMark(g.$from.pos,g.$to.pos,f)});return t.removeStoredMark(f),!0},IM=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const c=yf(typeof n=="string"?n:n.name,r.schema);return c?(c==="node"&&(o=We(n,r.schema)),c==="mark"&&(a=hn(n,r.schema)),i&&t.selection.ranges.forEach(f=>{const h=f.$from.pos,m=f.$to.pos;let p,g,b,S;t.selection.empty?r.doc.nodesBetween(h,m,(E,C)=>{o&&o===E.type&&(b=Math.max(C,h),S=Math.min(C+E.nodeSize,m),p=C,g=E)}):r.doc.nodesBetween(h,m,(E,C)=>{C<h&&o&&o===E.type&&(b=Math.max(C,h),S=Math.min(C+E.nodeSize,m),p=C,g=E),C>=h&&C<=m&&(o&&o===E.type&&t.setNodeMarkup(C,void 0,{...E.attrs,...e}),a&&E.marks.length&&E.marks.forEach(M=>{if(a===M.type){const P=Math.max(C,h),F=Math.min(C+E.nodeSize,m);t.addMark(P,F,a.create({...M.attrs,...e}))}}))}),g&&(p!==void 0&&t.setNodeMarkup(p,void 0,{...g.attrs,...e}),a&&g.marks.length&&g.marks.forEach(E=>{a===E.type&&t.addMark(b,S,a.create({...E.attrs,...e}))}))}),!0):!1},OM=(n,e={})=>({state:t,dispatch:r})=>{const i=We(n,t.schema);return $T(i,e)(t,r)},NM=(n,e={})=>({state:t,dispatch:r})=>{const i=We(n,t.schema);return WT(i,e)(t,r)};var RM=Object.freeze({__proto__:null,blur:fC,clearContent:hC,clearNodes:dC,command:pC,createParagraphNear:mC,cut:gC,deleteCurrentNode:yC,deleteNode:bC,deleteRange:vC,deleteSelection:wC,enter:SC,exitCode:xC,extendMarkRange:EC,first:kC,focus:CC,forEach:MC,insertContent:AC,insertContentAt:NC,joinBackward:PC,joinDown:LC,joinForward:DC,joinItemBackward:BC,joinItemForward:zC,joinTextblockBackward:FC,joinTextblockForward:HC,joinUp:RC,keyboardShortcut:WC,lift:UC,liftEmptyBlock:VC,liftListItem:KC,newlineInCode:GC,resetAttributes:JC,scrollIntoView:qC,selectAll:jC,selectNodeBackward:YC,selectNodeForward:XC,selectParentNode:ZC,selectTextblockEnd:QC,selectTextblockStart:eM,setContent:nM,setMark:mM,setMeta:gM,setNode:yM,setNodeSelection:bM,setTextSelection:vM,sinkListItem:wM,splitBlock:SM,splitListItem:xM,toggleList:EM,toggleMark:kM,toggleNode:_M,toggleWrap:TM,undoInputRule:CM,unsetAllMarks:MM,unsetMark:AM,updateAttributes:IM,wrapIn:OM,wrapInList:NM});Ie.create({name:"commands",addCommands(){return{...RM}}}),Ie.create({name:"drop",addProseMirrorPlugins(){return[new lt({key:new Tt("tiptapDrop"),props:{handleDrop:(n,e,t,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:r})}}})]}}),Ie.create({name:"editable",addProseMirrorPlugins(){return[new lt({key:new Tt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Ie.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new lt({key:new Tt("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Ie.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:c})=>{const{selection:f,doc:h}=c,{empty:m,$anchor:p}=f,{pos:g,parent:b}=p,S=p.parent.isTextblock&&g>0?c.doc.resolve(g-1):p,E=S.parent.type.spec.isolating,C=p.pos-p.parentOffset,M=E&&S.parent.childCount===1?C===p.pos:pe.atStart(h).from===g;return!m||!b.type.isTextblock||b.textContent.length||!M||M&&p.parent.type.name==="paragraph"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return mf()||D0()?o:i},addProseMirrorPlugins(){return[new lt({key:new Tt("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(E=>E.getMeta("composition")))return;const r=n.some(E=>E.docChanged)&&!e.doc.eq(t.doc),i=n.some(E=>E.getMeta("preventClearDocument"));if(!r||i)return;const{empty:o,from:a,to:c}=e.selection,f=pe.atStart(e.doc).from,h=pe.atEnd(e.doc).to;if(o||!(a===f&&c===h)||!$0(t.doc))return;const g=t.tr,b=_l({state:t,transaction:g}),{commands:S}=new uf({editor:this.editor,state:b});if(S.clearNodes(),!!g.steps.length)return g}})]}}),Ie.create({name:"paste",addProseMirrorPlugins(){return[new lt({key:new Tt("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),Ie.create({name:"tabindex",addProseMirrorPlugins(){return[new lt({key:new Tt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});function LM(n){return new O0({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),o=ae(n.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,o)}})}function PM(n){return new O0({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const o=ae(n.getAttributes,void 0,r)||{},a=e.tr.delete(t.from,t.to),f=a.doc.resolve(t.from).blockRange(),h=f&&Pu(f,n.type,o);if(!h)return null;if(a.wrap(f,h),n.keepMarks&&n.editor){const{selection:p,storedMarks:g}=e,{splittableMarks:b}=n.editor.extensionManager,S=g||p.$to.parentOffset&&p.$from.marks();if(S){const E=S.filter(C=>b.includes(C.type.name));a.ensureMarks(E)}}if(n.keepAttributes){const p=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(p,o).run()}const m=a.doc.resolve(t.from-1).nodeBefore;m&&m.type===n.type&&fr(a.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,m))&&a.join(t.from-1)}})}class Gn{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ae(K(this,"addOptions",{name:this.name}))),this.storage=ae(K(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Gn(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Al(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new Gn(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ae(K(t,"addOptions",{name:t.name})),t.storage=ae(K(t,"addStorage",{name:t.name,options:t.options})),t}}function DM(n){return new rC({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const o=ae(n.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:a}=e,c=r[r.length-1],f=r[0];let h=t.to;if(c){const m=f.search(/\S/),p=t.from+f.indexOf(c),g=p+c.length;if(F0(t.from,t.to,e.doc).filter(S=>S.mark.type.excluded.find(C=>C===n.type&&C!==S.mark.type)).filter(S=>S.to>p).length)return null;g<t.to&&a.delete(g,t.to),p>t.from&&a.delete(t.from+m,p),h=t.from+m+c.length,a.addMark(t.from+m,h,n.type.create(o||{})),a.removeStoredMark(n.type)}}})}const BM=Gn.create({name:"text",group:"inline"});var Pl=200,Ue=function(){};Ue.prototype.append=function(e){return e.length?(e=Ue.from(e),!this.length&&e||e.length<Pl&&this.leafAppend(e)||this.length<Pl&&e.leafPrepend(this)||this.appendInner(e)):this},Ue.prototype.prepend=function(e){return e.length?Ue.from(e).append(this):this},Ue.prototype.appendInner=function(e){return new zM(this,e)},Ue.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Ue.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Ue.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ue.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)},Ue.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,a){return i.push(e(o,a))},t,r),i},Ue.from=function(e){return e instanceof Ue?e:e&&e.length?new U0(e):Ue.empty};var U0=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,a,c){for(var f=o;f<a;f++)if(i(this.values[f],c+f)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,a,c){for(var f=o-1;f>=a;f--)if(i(this.values[f],c+f)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Pl)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Pl)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(Ue);Ue.empty=new U0([]);var zM=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,a){var c=this.left.length;if(i<c&&this.left.forEachInner(r,i,Math.min(o,c),a)===!1||o>c&&this.right.forEachInner(r,Math.max(i-c,0),Math.min(this.length,o)-c,a+c)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,a){var c=this.left.length;if(i>c&&this.right.forEachInvertedInner(r,i-c,Math.max(o,c)-c,a+c)===!1||o<c&&this.left.forEachInvertedInner(r,Math.min(i,c),o,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Ue);const FM=500;class rn{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a=e.tr,c,f,h=[],m=[];return this.items.forEach((p,g)=>{if(!p.step){i||(i=this.remapping(r,g+1),o=i.maps.length),o--,m.push(p);return}if(i){m.push(new mn(p.map));let b=p.step.map(i.slice(o)),S;b&&a.maybeStep(b).doc&&(S=a.mapping.maps[a.mapping.maps.length-1],h.push(new mn(S,void 0,void 0,h.length+m.length))),o--,S&&i.appendMap(S,o)}else a.maybeStep(p.step);if(p.selection)return c=i?p.selection.map(i.slice(o)):p.selection,f=new rn(this.items.slice(0,r).append(m.reverse().concat(h)),this.eventCount-1),!1},this.items.length,0),{remaining:f,transform:a,selection:c}}addTransform(e,t,r,i){let o=[],a=this.eventCount,c=this.items,f=!i&&c.length?c.get(c.length-1):null;for(let m=0;m<e.steps.length;m++){let p=e.steps[m].invert(e.docs[m]),g=new mn(e.mapping.maps[m],p,t),b;(b=f&&f.merge(g))&&(g=b,m?o.pop():c=c.slice(0,c.length-1)),o.push(g),t&&(a++,t=void 0),i||(f=g)}let h=a-r.depth;return h>$M&&(c=HM(c,h),a-=h),new rn(c.append(o),a)}remapping(e,t){let r=new Bi;return this.items.forEach((i,o)=>{let a=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,t),r}addMaps(e){return this.eventCount==0?this:new rn(this.items.append(e.map(t=>new mn(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,a=e.steps.length,c=this.eventCount;this.items.forEach(g=>{g.selection&&c--},i);let f=t;this.items.forEach(g=>{let b=o.getMirror(--f);if(b==null)return;a=Math.min(a,b);let S=o.maps[b];if(g.step){let E=e.steps[b].invert(e.docs[b]),C=g.selection&&g.selection.map(o.slice(f+1,b));C&&c++,r.push(new mn(S,E,C))}else r.push(new mn(S))},i);let h=[];for(let g=t;g<a;g++)h.push(new mn(o.maps[g]));let m=this.items.slice(0,i).append(h).append(r),p=new rn(m,c);return p.emptyItemCount()>FM&&(p=p.compress(this.items.length-r.length)),p}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((a,c)=>{if(c>=e)i.push(a),a.selection&&o++;else if(a.step){let f=a.step.map(t.slice(r)),h=f&&f.getMap();if(r--,h&&t.appendMap(h,r),f){let m=a.selection&&a.selection.map(t.slice(r));m&&o++;let p=new mn(h.invert(),f,m),g,b=i.length-1;(g=i.length&&i[b].merge(p))?i[b]=g:i.push(p)}}else a.map&&r--},this.items.length,0),new rn(Ue.from(i.reverse()),o)}}rn.empty=new rn(Ue.empty,0);function HM(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class mn{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new mn(t.getMap().invert(),t,this.selection)}}}class yr{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const $M=20;function WM(n,e,t,r){let i=t.getMeta(Kr),o;if(i)return i.historyState;t.getMeta(KM)&&(n=new yr(n.done,n.undone,null,0,-1));let a=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(a&&a.getMeta(Kr))return a.getMeta(Kr).redo?new yr(n.done.addTransform(t,void 0,r,Dl(e)),n.undone,V0(t.mapping.maps),n.prevTime,n.prevComposition):new yr(n.done,n.undone.addTransform(t,void 0,r,Dl(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let c=t.getMeta("composition"),f=n.prevTime==0||!a&&n.prevComposition!=c&&(n.prevTime<(t.time||0)-r.newGroupDelay||!UM(t,n.prevRanges)),h=a?Sf(n.prevRanges,t.mapping):V0(t.mapping.maps);return new yr(n.done.addTransform(t,f?e.selection.getBookmark():void 0,r,Dl(e)),rn.empty,h,t.time,c??n.prevComposition)}else return(o=t.getMeta("rebased"))?new yr(n.done.rebased(t,o),n.undone.rebased(t,o),Sf(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new yr(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),Sf(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function UM(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(t=!0)}),t}function V0(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,i,o,a)=>e.push(o,a));return e}function Sf(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),o=e.map(n[r+1],-1);i<=o&&t.push(i,o)}return t}function VM(n,e,t){let r=Dl(e),i=Kr.get(e).spec.config,o=(t?n.undone:n.done).popEvent(e,r);if(!o)return null;let a=o.selection.resolve(o.transform.doc),c=(t?n.done:n.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),f=new yr(t?c:o.remaining,t?o.remaining:c,null,0,-1);return o.transform.setSelection(a).setMeta(Kr,{redo:t,historyState:f})}let xf=!1,K0=null;function Dl(n){let e=n.plugins;if(K0!=e){xf=!1,K0=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){xf=!0;break}}return xf}const Kr=new Tt("history"),KM=new Tt("closeHistory");function GM(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new lt({key:Kr,state:{init(){return new yr(rn.empty,rn.empty,null,0,-1)},apply(e,t,r){return WM(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?J0:r=="historyRedo"?q0:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function G0(n,e){return(t,r)=>{let i=Kr.getState(t);if(!i||(n?i.undone:i.done).eventCount==0)return!1;if(r){let o=VM(i,t,n);o&&r(e?o.scrollIntoView():o)}return!0}}const J0=G0(!1,!0),q0=G0(!0,!0),JM=Ie.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>J0(n,e),redo:()=>({state:n,dispatch:e})=>q0(n,e)}},addProseMirrorPlugins(){return[GM(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}});var Dn=(n=>(n.COMMON="common",n.DESKTOP="desktop",n.TABLET="tablet",n.MOBILE="mobile",n.ALL="all",n))(Dn||{});const qM=["common","mobile","tablet","desktop"];var Bl=(n=>(n.UPPERCASE="uppercase",n.LOWERCASE="lowercase",n.CAPITALIZE="capitalize",n))(Bl||{}),br=(n=>(n.LEFT="left",n.CENTER="center",n.RIGHT="right",n.JUSTIFY="justify",n))(br||{});const jM=["left","center","right","justify"];var te=(n=>(n.DOCUMENT="doc",n.PARAGRAPH="paragraph",n.HEADING="heading",n.LIST="list",n.LIST_ITEM="listItem",n.TEXT="text",n))(te||{});const Ef=["paragraph","list","heading"];var tn=(n=>(n.DISC="disc",n.CIRCLE="circle",n.SQUARE="square",n.DECIMAL="decimal",n.ROMAN="roman",n.LATIN="latin",n))(tn||{});const YM=["disc","circle","square","decimal","roman","latin"],XM=["decimal","roman","latin"];var Te=(n=>(n.ALIGNMENT="alignment",n.BACKGROUND_COLOR="background_color",n.FONT_COLOR="font_color",n.FONT_FAMILY="font_family",n.FONT_SIZE="font_size",n.FONT_STYLE="font_style",n.FONT_WEIGHT="font_weight",n.LINE_HEIGHT="line_height",n.TEXT_DECORATION="text_decoration",n.SUPERSCRIPT="superscript",n.MARGIN="margin",n.LINK="link",n.STYLE_PRESET="style_preset",n))(Te||{});const j0=["alignment","line_height","margin"],zl=["line_height"],Y0=["text_decoration","link","superscript","background_color"],X0=["background_color","font_color","font_family","font_size","font_style","font_weight","text_decoration","superscript"];var Wt=(n=>(n.SETTINGS="settings",n.ALL="_",n))(Wt||{}),kf=(n=>(n.BLANK="_blank",n.SELF="_self",n))(kf||{}),Ii=(n=>(n.URL="url",n.BLOCK="block",n))(Ii||{});class _f{static create(e,t){const r=new this(e,t||{});return new lt({key:new Tt(this.name),props:r._buildProps()})}constructor(e,t){this.options=t,this.editor=e}_buildProps(){const t=Object.entries(this.addProps()).map(([r,i])=>[r,i.bind(this)]);return Object.fromEntries(t)}addProps(){return{}}}class ZM extends _f{addProps(){return{transformPastedHTML:this._transformPastedHTML,handlePaste:this._handlePaste}}_transformPastedHTML(e){if(e.includes("data-pm-slice")&&e.includes("zw-style"))return e;const t=Na.build(e);return t.normalizeHTML(),this._removeDeprecatedStyles(t),t.normalizedHTML}_removeDeprecatedStyles(e){const t=e.dom.querySelectorAll('[style*="margin"]');for(const r of Array.from(t))r.style.removeProperty("margin"),r.style.removeProperty("margin-top"),r.style.removeProperty("margin-right"),r.style.removeProperty("margin-bottom"),r.style.removeProperty("margin-left")}_handlePaste(e,t,r){const i=this._insertPastedContent(e,r).scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste");return e.dispatch(i),!0}_insertPastedContent({state:e},t){return this._isFullBlockSelected(e)?e.tr.replaceSelectionWith(t.content,!1):e.tr.replaceSelection(t)}_isFullBlockSelected(e){const t=this._expandSelectionToBlocks(e),r=this._isMatchPosition(t.from,e.selection.from),i=this._isMatchPosition(t.to,e.selection.to);return r&&i}_expandSelectionToBlocks({selection:e,doc:t}){let r=e.from,i=e.to;return t.nodesBetween(r,i,(o,a,c)=>{c.type.name===te.DOCUMENT&&(r=Math.min(r,a+1),i=Math.max(i,a+o.nodeSize-1))}),{from:r,to:i}}_isMatchPosition(e,t){return Math.abs(e-t)<5}}class QM extends _f{addProps(){return{decorations:this._buildDecorations}}_buildDecorations({doc:e}){const t=[];if(!this.editor.isEditable)return null;if(!(e.childCount>1))return e.descendants((r,i)=>{if(!r.childCount){const o=bn.node(i,i+r.nodeSize,{class:"zw-wysiwyg__placeholder","data-placeholder":"Type your text here..."});t.push(o)}return!1}),Je.create(e,t)}}const eA="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",tA="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",Oi=(n,e)=>{for(const t in e)n[t]=e[t];return n},Tf="numeric",Cf="ascii",Mf="alpha",Ms="asciinumeric",As="alphanumeric",Af="domain",Z0="emoji",nA="scheme",rA="slashscheme",If="whitespace";function iA(n,e){return n in e||(e[n]=[]),e[n]}function Gr(n,e,t){e[Tf]&&(e[Ms]=!0,e[As]=!0),e[Cf]&&(e[Ms]=!0,e[Mf]=!0),e[Ms]&&(e[As]=!0),e[Mf]&&(e[As]=!0),e[As]&&(e[Af]=!0),e[Z0]&&(e[Af]=!0);for(const r in e){const i=iA(r,t);i.indexOf(n)<0&&i.push(n)}}function sA(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function gt(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}gt.groups={},gt.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],o=e.jr[r][1];if(o&&i.test(n))return o}return e.jd},has(n,e=!1){return e?n in this.j:!!this.go(n)},ta(n,e,t,r){for(let i=0;i<n.length;i++)this.tt(n[i],e,t,r)},tr(n,e,t,r){r=r||gt.groups;let i;return e&&e.j?i=e:(i=new gt(e),t&&r&&Gr(e,t,r)),this.jr.push([n,i]),i},ts(n,e,t,r){let i=this;const o=n.length;if(!o)return i;for(let a=0;a<o-1;a++)i=i.tt(n[a]);return i.tt(n[o-1],e,t,r)},tt(n,e,t,r){r=r||gt.groups;const i=this;if(e&&e.j)return i.j[n]=e,e;const o=e;let a,c=i.go(n);if(c?(a=new gt,Oi(a.j,c.j),a.jr.push.apply(a.jr,c.jr),a.jd=c.jd,a.t=c.t):a=new gt,o){if(r)if(a.t&&typeof a.t=="string"){const f=Oi(sA(a.t,r),t);Gr(o,f,r)}else t&&Gr(o,t,r);a.t=o}return i.j[n]=a,a}};const ne=(n,e,t,r,i)=>n.ta(e,t,r,i),Ae=(n,e,t,r,i)=>n.tr(e,t,r,i),Q0=(n,e,t,r,i)=>n.ts(e,t,r,i),D=(n,e,t,r,i)=>n.tt(e,t,r,i),Bn="WORD",Of="UWORD",e1="ASCIINUMERICAL",t1="ALPHANUMERICAL",Is="LOCALHOST",Nf="TLD",Rf="UTLD",Fl="SCHEME",Ni="SLASH_SCHEME",Lf="NUM",Pf="WS",Df="NL",Os="OPENBRACE",Ns="CLOSEBRACE",Hl="OPENBRACKET",$l="CLOSEBRACKET",Wl="OPENPAREN",Ul="CLOSEPAREN",Vl="OPENANGLEBRACKET",Kl="CLOSEANGLEBRACKET",Gl="FULLWIDTHLEFTPAREN",Jl="FULLWIDTHRIGHTPAREN",ql="LEFTCORNERBRACKET",jl="RIGHTCORNERBRACKET",Yl="LEFTWHITECORNERBRACKET",Xl="RIGHTWHITECORNERBRACKET",Zl="FULLWIDTHLESSTHAN",Ql="FULLWIDTHGREATERTHAN",ea="AMPERSAND",Bf="APOSTROPHE",ta="ASTERISK",vr="AT",na="BACKSLASH",ra="BACKTICK",ia="CARET",wr="COLON",zf="COMMA",sa="DOLLAR",dn="DOT",oa="EQUALS",Ff="EXCLAMATION",Ut="HYPHEN",Rs="PERCENT",la="PIPE",aa="PLUS",ca="POUND",Ls="QUERY",Hf="QUOTE",n1="FULLWIDTHMIDDLEDOT",$f="SEMI",pn="SLASH",Ps="TILDE",ua="UNDERSCORE",r1="EMOJI",fa="SYM";var i1=Object.freeze({__proto__:null,WORD:Bn,UWORD:Of,ASCIINUMERICAL:e1,ALPHANUMERICAL:t1,LOCALHOST:Is,TLD:Nf,UTLD:Rf,SCHEME:Fl,SLASH_SCHEME:Ni,NUM:Lf,WS:Pf,NL:Df,OPENBRACE:Os,CLOSEBRACE:Ns,OPENBRACKET:Hl,CLOSEBRACKET:$l,OPENPAREN:Wl,CLOSEPAREN:Ul,OPENANGLEBRACKET:Vl,CLOSEANGLEBRACKET:Kl,FULLWIDTHLEFTPAREN:Gl,FULLWIDTHRIGHTPAREN:Jl,LEFTCORNERBRACKET:ql,RIGHTCORNERBRACKET:jl,LEFTWHITECORNERBRACKET:Yl,RIGHTWHITECORNERBRACKET:Xl,FULLWIDTHLESSTHAN:Zl,FULLWIDTHGREATERTHAN:Ql,AMPERSAND:ea,APOSTROPHE:Bf,ASTERISK:ta,AT:vr,BACKSLASH:na,BACKTICK:ra,CARET:ia,COLON:wr,COMMA:zf,DOLLAR:sa,DOT:dn,EQUALS:oa,EXCLAMATION:Ff,HYPHEN:Ut,PERCENT:Rs,PIPE:la,PLUS:aa,POUND:ca,QUERY:Ls,QUOTE:Hf,FULLWIDTHMIDDLEDOT:n1,SEMI:$f,SLASH:pn,TILDE:Ps,UNDERSCORE:ua,EMOJI:r1,SYM:fa});const zn=/[a-z]/,Ds=/\p{L}/u,Wf=/\p{Emoji}/u,Fn=/\d/,Uf=/\s/,s1="\r",Vf=`
17
- `,oA="\uFE0F",lA="\u200D",Kf="\uFFFC";let ha=null,da=null;function aA(n=[]){const e={};gt.groups=e;const t=new gt;ha==null&&(ha=l1(eA)),da==null&&(da=l1(tA)),D(t,"'",Bf),D(t,"{",Os),D(t,"}",Ns),D(t,"[",Hl),D(t,"]",$l),D(t,"(",Wl),D(t,")",Ul),D(t,"<",Vl),D(t,">",Kl),D(t,"\uFF08",Gl),D(t,"\uFF09",Jl),D(t,"\u300C",ql),D(t,"\u300D",jl),D(t,"\u300E",Yl),D(t,"\u300F",Xl),D(t,"\uFF1C",Zl),D(t,"\uFF1E",Ql),D(t,"&",ea),D(t,"*",ta),D(t,"@",vr),D(t,"`",ra),D(t,"^",ia),D(t,":",wr),D(t,",",zf),D(t,"$",sa),D(t,".",dn),D(t,"=",oa),D(t,"!",Ff),D(t,"-",Ut),D(t,"%",Rs),D(t,"|",la),D(t,"+",aa),D(t,"#",ca),D(t,"?",Ls),D(t,'"',Hf),D(t,"/",pn),D(t,";",$f),D(t,"~",Ps),D(t,"_",ua),D(t,"\\",na),D(t,"\u30FB",n1);const r=Ae(t,Fn,Lf,{[Tf]:!0});Ae(r,Fn,r);const i=Ae(r,zn,e1,{[Ms]:!0}),o=Ae(r,Ds,t1,{[As]:!0}),a=Ae(t,zn,Bn,{[Cf]:!0});Ae(a,Fn,i),Ae(a,zn,a),Ae(i,Fn,i),Ae(i,zn,i);const c=Ae(t,Ds,Of,{[Mf]:!0});Ae(c,zn),Ae(c,Fn,o),Ae(c,Ds,c),Ae(o,Fn,o),Ae(o,zn),Ae(o,Ds,o);const f=D(t,Vf,Df,{[If]:!0}),h=D(t,s1,Pf,{[If]:!0}),m=Ae(t,Uf,Pf,{[If]:!0});D(t,Kf,m),D(h,Vf,f),D(h,Kf,m),Ae(h,Uf,m),D(m,s1),D(m,Vf),Ae(m,Uf,m),D(m,Kf,m);const p=Ae(t,Wf,r1,{[Z0]:!0});D(p,"#"),Ae(p,Wf,p),D(p,oA,p);const g=D(p,lA);D(g,"#"),Ae(g,Wf,p);const b=[[zn,a],[Fn,i]],S=[[zn,null],[Ds,c],[Fn,o]];for(let E=0;E<ha.length;E++)Sr(t,ha[E],Nf,Bn,b);for(let E=0;E<da.length;E++)Sr(t,da[E],Rf,Of,S);Gr(Nf,{tld:!0,ascii:!0},e),Gr(Rf,{utld:!0,alpha:!0},e),Sr(t,"file",Fl,Bn,b),Sr(t,"mailto",Fl,Bn,b),Sr(t,"http",Ni,Bn,b),Sr(t,"https",Ni,Bn,b),Sr(t,"ftp",Ni,Bn,b),Sr(t,"ftps",Ni,Bn,b),Gr(Fl,{scheme:!0,ascii:!0},e),Gr(Ni,{slashscheme:!0,ascii:!0},e),n=n.sort((E,C)=>E[0]>C[0]?1:-1);for(let E=0;E<n.length;E++){const C=n[E][0],P=n[E][1]?{[nA]:!0}:{[rA]:!0};C.indexOf("-")>=0?P[Af]=!0:zn.test(C)?Fn.test(C)?P[Ms]=!0:P[Cf]=!0:P[Tf]=!0,Q0(t,C,C,P)}return Q0(t,"localhost",Is,{ascii:!0}),t.jd=new gt(fa),{start:t,tokens:Oi({groups:e},i1)}}function o1(n,e){const t=cA(e.replace(/[A-Z]/g,c=>c.toLowerCase())),r=t.length,i=[];let o=0,a=0;for(;a<r;){let c=n,f=null,h=0,m=null,p=-1,g=-1;for(;a<r&&(f=c.go(t[a]));)c=f,c.accepts()?(p=0,g=0,m=c):p>=0&&(p+=t[a].length,g++),h+=t[a].length,o+=t[a].length,a++;o-=p,a-=g,h-=p,i.push({t:m.t,v:e.slice(o-h,o),s:o-h,e:o})}return i}function cA(n){const e=[],t=n.length;let r=0;for(;r<t;){let i=n.charCodeAt(r),o,a=i<55296||i>56319||r+1===t||(o=n.charCodeAt(r+1))<56320||o>57343?n[r]:n.slice(r,r+2);e.push(a),r+=a.length}return e}function Sr(n,e,t,r,i){let o;const a=e.length;for(let c=0;c<a-1;c++){const f=e[c];n.j[f]?o=n.j[f]:(o=new gt(r),o.jr=i.slice(),n.j[f]=o),n=o}return o=new gt(t),o.jr=i.slice(),n.j[e[a-1]]=o,o}function l1(n){const e=[],t=[];let r=0,i="0123456789";for(;r<n.length;){let o=0;for(;i.indexOf(n[r+o])>=0;)o++;if(o>0){e.push(t.join(""));for(let a=parseInt(n.substring(r,r+o),10);a>0;a--)t.pop();r+=o}else t.push(n[r]),r++}return e}const Bs={defaultProtocol:"http",events:null,format:a1,formatHref:a1,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Gf(n,e=null){let t=Oi({},Bs);n&&(t=Oi(t,n instanceof Gf?n.o:n));const r=t.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=i}Gf.prototype={o:Bs,ignoreTags:[],defaultRender(n){return n},check(n){return this.get("validate",n.toString(),n)},get(n,e,t){const r=e!=null;let i=this.o[n];return i&&(typeof i=="object"?(i=t.t in i?i[t.t]:Bs[n],typeof i=="function"&&r&&(i=i(e,t))):typeof i=="function"&&r&&(i=i(e,t.t,t)),i)},getObj(n,e,t){let r=this.o[n];return typeof r=="function"&&e!=null&&(r=r(e,t.t,t)),r},render(n){const e=n.render(this);return(this.get("render",null,n)||this.defaultRender)(e,n.t,n)}};function a1(n){return n}function c1(n,e){this.t="token",this.v=n,this.tk=e}c1.prototype={isLink:!1,toString(){return this.v},toHref(n){return this.toString()},toFormattedString(n){const e=this.toString(),t=n.get("truncate",e,this),r=n.get("format",e,this);return t&&r.length>t?r.substring(0,t)+"\u2026":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=Bs.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),i=n.get("tagName",t,e),o=this.toFormattedString(n),a={},c=n.get("className",t,e),f=n.get("target",t,e),h=n.get("rel",t,e),m=n.getObj("attributes",t,e),p=n.getObj("events",t,e);return a.href=r,c&&(a.class=c),f&&(a.target=f),h&&(a.rel=h),m&&Oi(a,m),{tagName:i,attributes:a,content:o,eventListeners:p}}};function pa(n,e){class t extends c1{constructor(i,o){super(i,o),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const u1=pa("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),f1=pa("text"),uA=pa("nl"),ma=pa("url",{isLink:!0,toHref(n=Bs.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==Is&&n[1].t===wr}}),Vt=n=>new gt(n);function fA({groups:n}){const e=n.domain.concat([ea,ta,vr,na,ra,ia,sa,oa,Ut,Lf,Rs,la,aa,ca,pn,fa,Ps,ua]),t=[wr,zf,dn,Ff,Rs,Ls,Hf,$f,Vl,Kl,Os,Ns,$l,Hl,Wl,Ul,Gl,Jl,ql,jl,Yl,Xl,Zl,Ql],r=[ea,Bf,ta,na,ra,ia,sa,oa,Ut,Os,Ns,Rs,la,aa,ca,Ls,pn,fa,Ps,ua],i=Vt(),o=D(i,Ps);ne(o,r,o),ne(o,n.domain,o);const a=Vt(),c=Vt(),f=Vt();ne(i,n.domain,a),ne(i,n.scheme,c),ne(i,n.slashscheme,f),ne(a,r,o),ne(a,n.domain,a);const h=D(a,vr);D(o,vr,h),D(c,vr,h),D(f,vr,h);const m=D(o,dn);ne(m,r,o),ne(m,n.domain,o);const p=Vt();ne(h,n.domain,p),ne(p,n.domain,p);const g=D(p,dn);ne(g,n.domain,p);const b=Vt(u1);ne(g,n.tld,b),ne(g,n.utld,b),D(h,Is,b);const S=D(p,Ut);D(S,Ut,S),ne(S,n.domain,p),ne(b,n.domain,p),D(b,dn,g),D(b,Ut,S);const E=D(b,wr);ne(E,n.numeric,u1);const C=D(a,Ut),M=D(a,dn);D(C,Ut,C),ne(C,n.domain,a),ne(M,r,o),ne(M,n.domain,a);const P=Vt(ma);ne(M,n.tld,P),ne(M,n.utld,P),ne(P,n.domain,a),ne(P,r,o),D(P,dn,M),D(P,Ut,C),D(P,vr,h);const F=D(P,wr),$=Vt(ma);ne(F,n.numeric,$);const U=Vt(ma),ue=Vt();ne(U,e,U),ne(U,t,ue),ne(ue,e,U),ne(ue,t,ue),D(P,pn,U),D($,pn,U);const he=D(c,wr),be=D(f,wr),yt=D(be,pn),Jn=D(yt,pn);ne(c,n.domain,a),D(c,dn,M),D(c,Ut,C),ne(f,n.domain,a),D(f,dn,M),D(f,Ut,C),ne(he,n.domain,U),D(he,pn,U),D(he,Ls,U),ne(Jn,n.domain,U),ne(Jn,e,U),D(Jn,pn,U);const sn=[[Os,Ns],[Hl,$l],[Wl,Ul],[Vl,Kl],[Gl,Jl],[ql,jl],[Yl,Xl],[Zl,Ql]];for(let qn=0;qn<sn.length;qn++){const[Zr,on]=sn[qn],vn=D(U,Zr);D(ue,Zr,vn),D(vn,on,U);const Fe=Vt(ma);ne(vn,e,Fe);const bt=Vt();ne(vn,t),ne(Fe,e,Fe),ne(Fe,t,bt),ne(bt,e,Fe),ne(bt,t,bt),D(Fe,on,U),D(bt,on,U)}return D(i,Is,P),D(i,Df,uA),{start:i,tokens:i1}}function hA(n,e,t){let r=t.length,i=0,o=[],a=[];for(;i<r;){let c=n,f=null,h=null,m=0,p=null,g=-1;for(;i<r&&!(f=c.go(t[i].t));)a.push(t[i++]);for(;i<r&&(h=f||c.go(t[i].t));)f=null,c=h,c.accepts()?(g=0,p=c):g>=0&&g++,i++,m++;if(g<0)i-=m,i<r&&(a.push(t[i]),i++);else{a.length>0&&(o.push(Jf(f1,e,a)),a=[]),i-=g,m-=g;const b=p.t,S=t.slice(i-m,i);o.push(Jf(b,e,S))}}return a.length>0&&o.push(Jf(f1,e,a)),o}function Jf(n,e,t){const r=t[0].s,i=t[t.length-1].e,o=e.slice(r,i);return new n(o,t)}const dA=typeof console<"u"&&console&&console.warn||(()=>{}),pA="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Ee={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function mA(){return gt.groups={},Ee.scanner=null,Ee.parser=null,Ee.tokenQueue=[],Ee.pluginQueue=[],Ee.customSchemes=[],Ee.initialized=!1,Ee}function h1(n,e=!1){if(Ee.initialized&&dA(`linkifyjs: already initialized - will not register custom scheme "${n}" ${pA}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.
16
+ `,textSerializers:a={}}=t||{};let c="";return n.nodesBetween(r,i,(f,h,m,p)=>{var g;f.isBlock&&h>r&&(c+=o);const b=a?.[f.type.name];if(b)return m&&(c+=b({node:f,pos:h,parent:m,index:p,range:e})),!1;f.isText&&(c+=(g=f?.text)===null||g===void 0?void 0:g.slice(Math.max(r,h)-h,i-h))}),c}function fC(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}Ie.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new lt({key:new Ct("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:o}=i,a=Math.min(...o.map(m=>m.$from.pos)),c=Math.max(...o.map(m=>m.$to.pos)),f=fC(t);return uC(r,{from:a,to:c},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:f})}}})]}});const hC=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),dC=(n=!1)=>({commands:e})=>e.setContent("",n),pC=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:o,$to:a})=>{n.doc.nodesBetween(o.pos,a.pos,(c,f)=>{if(c.type.isText)return;const{doc:h,mapping:m}=e,p=h.resolve(m.map(f)),g=h.resolve(m.map(f+c.nodeSize)),b=p.blockRange(g);if(!b)return;const S=xi(b);if(c.type.isTextblock){const{defaultType:E}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(b.start,E)}(S||S===0)&&e.lift(b,S)})}),!0},mC=n=>e=>n(e),gC=()=>({state:n,dispatch:e})=>w0(n,e),yC=(n,e)=>({editor:t,tr:r})=>{const{state:i}=t,o=i.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const a=r.mapping.map(e);return r.insert(a,o.content),r.setSelection(new ce(r.doc.resolve(a-1))),!0},bC=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const i=n.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const c=i.before(o),f=i.after(o);n.delete(c,f).scrollIntoView()}return!0}return!1},vC=n=>({tr:e,state:t,dispatch:r})=>{const i=We(n,t.schema),o=e.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i){if(r){const f=o.before(a),h=o.after(a);e.delete(f,h).scrollIntoView()}return!0}return!1},wC=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},SC=()=>({state:n,dispatch:e})=>sf(n,e),xC=()=>({commands:n})=>n.keyboardShortcut("Enter"),EC=()=>({state:n,dispatch:e})=>PT(n,e);function Ol(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:df(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function N0(n,e,t={}){return n.find(r=>r.type===e&&Ol(Object.fromEntries(Object.keys(t).map(i=>[i,r.attrs[i]])),t))}function R0(n,e,t={}){return!!N0(n,e,t)}function pf(n,e,t){var r;if(!n||!e)return;let i=n.parent.childAfter(n.parentOffset);if((!i.node||!i.node.marks.some(m=>m.type===e))&&(i=n.parent.childBefore(n.parentOffset)),!i.node||!i.node.marks.some(m=>m.type===e)||(t=t||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!N0([...i.node.marks],e,t)))return;let a=i.index,c=n.start()+i.offset,f=a+1,h=c+i.node.nodeSize;for(;a>0&&R0([...n.parent.child(a-1).marks],e,t);)a-=1,c-=n.parent.child(a).nodeSize;for(;f<n.parent.childCount&&R0([...n.parent.child(f).marks],e,t);)h+=n.parent.child(f).nodeSize,f+=1;return{from:c,to:h}}function hn(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}const kC=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const o=hn(n,r.schema),{doc:a,selection:c}=t,{$from:f,from:h,to:m}=c;if(i){const p=pf(f,o,e);if(p&&p.from<=h&&p.to>=m){const g=ce.create(a,p.from,p.to);t.setSelection(g)}}return!0},_C=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r<t.length;r+=1)if(t[r](e))return!0;return!1};function L0(n){return n instanceof ce}function Kr(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function TC(n,e=null){if(!e)return null;const t=pe.atStart(n),r=pe.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,o=r.to;return e==="all"?ce.create(n,Kr(0,i,o),Kr(n.content.size,i,o)):ce.create(n,Kr(e,i,o),Kr(e,i,o))}function CC(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function mf(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const MC=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const a=()=>{(mf()||CC())&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e?.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(o&&n===null&&!L0(t.state.selection))return a(),!0;const c=TC(i.doc,n)||t.state.selection,f=t.state.selection.eq(c);return o&&(f||i.setSelection(c),f&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},AC=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),IC=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),P0=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const r=e[t];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?n.removeChild(r):r.nodeType===1&&P0(r)}return n};function Nl(n){const e=`<body>${n}</body>`,t=new window.DOMParser().parseFromString(e,"text/html").body;return P0(t)}function Rl(n,e,t){if(n instanceof ur||n instanceof L)return n;t={slice:!0,parseOptions:{},...t};const r=typeof n=="object"&&n!==null,i=typeof n=="string";if(r)try{if(Array.isArray(n)&&n.length>0)return L.fromArray(n.map(c=>e.nodeFromJSON(c)));const a=e.nodeFromJSON(n);return t.errorOnInvalidContent&&a.check(),a}catch(o){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",o),Rl("",e,t)}if(i){if(t.errorOnInvalidContent){let a=!1,c="";const f=new Zm({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:h=>(a=!0,c=typeof h=="string"?h:h.outerHTML,null)}]}})});if(t.slice?vs.fromSchema(f).parseSlice(Nl(n),t.parseOptions):vs.fromSchema(f).parse(Nl(n),t.parseOptions),t.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${c}`)})}const o=vs.fromSchema(e);return t.slice?o.parseSlice(Nl(n),t.parseOptions).content:o.parse(Nl(n),t.parseOptions)}return Rl("",e,t)}function OC(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof Ge||i instanceof Ke))return;const o=n.mapping.maps[r];let a=0;o.forEach((c,f,h,m)=>{a===0&&(a=m)}),n.setSelection(pe.near(n.doc.resolve(a),t))}const NC=n=>!("type"in n),RC=(n,e,t)=>({tr:r,dispatch:i,editor:o})=>{var a;if(i){t={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let c;try{c=Rl(e,o.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions},errorOnInvalidContent:(a=t.errorOnInvalidContent)!==null&&a!==void 0?a:o.options.enableContentCheck})}catch(S){return o.emit("contentError",{editor:o,error:S,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:f,to:h}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},m=!0,p=!0;if((NC(c)?c:[c]).forEach(S=>{S.check(),m=m?S.isText&&S.marks.length===0:!1,p=p?S.isBlock:!1}),f===h&&p){const{parent:S}=r.doc.resolve(f);S.isTextblock&&!S.type.spec.code&&!S.childCount&&(f-=1,h+=1)}let b;if(m){if(Array.isArray(e))b=e.map(S=>S.text||"").join("");else if(e instanceof L){let S="";e.forEach(E=>{E.text&&(S+=E.text)}),b=S}else typeof e=="object"&&e&&e.text?b=e.text:b=e;r.insertText(b,f,h)}else b=c,r.replaceWith(f,h,b);t.updateSelection&&OC(r,r.steps.length-1,-1),t.applyInputRules&&r.setMeta("applyInputRules",{from:f,text:b}),t.applyPasteRules&&r.setMeta("applyPasteRules",{from:f,text:b})}return!0},LC=()=>({state:n,dispatch:e})=>NT(n,e),PC=()=>({state:n,dispatch:e})=>RT(n,e),DC=()=>({state:n,dispatch:e})=>d0(n,e),zC=()=>({state:n,dispatch:e})=>y0(n,e),BC=()=>({state:n,dispatch:e,tr:t})=>{try{const r=ml(n.doc,n.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},FC=()=>({state:n,dispatch:e,tr:t})=>{try{const r=ml(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},HC=()=>({state:n,dispatch:e})=>IT(n,e),$C=()=>({state:n,dispatch:e})=>OT(n,e);function D0(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function WC(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,o,a;for(let c=0;c<e.length-1;c+=1){const f=e[c];if(/^(cmd|meta|m)$/i.test(f))a=!0;else if(/^a(lt)?$/i.test(f))r=!0;else if(/^(c|ctrl|control)$/i.test(f))i=!0;else if(/^s(hift)?$/i.test(f))o=!0;else if(/^mod$/i.test(f))mf()||D0()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${f}`)}return r&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),a&&(t=`Meta-${t}`),o&&(t=`Shift-${t}`),t}const UC=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const o=WC(n).split(/-(?!$)/),a=o.find(h=>!["Alt","Ctrl","Meta","Shift"].includes(h)),c=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),f=e.captureTransaction(()=>{t.someProp("handleKeyDown",h=>h(t,c))});return f?.steps.forEach(h=>{const m=h.map(r.mapping);m&&i&&r.maybeStep(m)}),!0};function gf(n,e,t={}){const{from:r,to:i,empty:o}=n.selection,a=e?We(e,n.schema):null,c=[];n.doc.nodesBetween(r,i,(p,g)=>{if(p.isText)return;const b=Math.max(r,g),S=Math.min(i,g+p.nodeSize);c.push({node:p,from:b,to:S})});const f=i-r,h=c.filter(p=>a?a.name===p.node.type.name:!0).filter(p=>Ol(p.node.attrs,t,{strict:!1}));return o?!!h.length:h.reduce((p,g)=>p+g.to-g.from,0)>=f}const VC=(n,e={})=>({state:t,dispatch:r})=>{const i=We(n,t.schema);return gf(t,i,e)?LT(t,r):!1},KC=()=>({state:n,dispatch:e})=>S0(n,e),GC=n=>({state:e,dispatch:t})=>{const r=We(n,e.schema);return GT(r)(e,t)},JC=()=>({state:n,dispatch:e})=>v0(n,e);function yf(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function z0(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,i)=>(t.includes(i)||(r[i]=n[i]),r),{})}const qC=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const c=yf(typeof n=="string"?n:n.name,r.schema);return c?(c==="node"&&(o=We(n,r.schema)),c==="mark"&&(a=hn(n,r.schema)),i&&t.selection.ranges.forEach(f=>{r.doc.nodesBetween(f.$from.pos,f.$to.pos,(h,m)=>{o&&o===h.type&&t.setNodeMarkup(m,void 0,z0(h.attrs,e)),a&&h.marks.length&&h.marks.forEach(p=>{a===p.type&&t.addMark(m,m+h.nodeSize,a.create(z0(p.attrs,e)))})})}),!0):!1},jC=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),YC=()=>({tr:n,dispatch:e})=>{if(e){const t=new It(n.doc);n.setSelection(t)}return!0},XC=()=>({state:n,dispatch:e})=>m0(n,e),ZC=()=>({state:n,dispatch:e})=>b0(n,e),QC=()=>({state:n,dispatch:e})=>BT(n,e),eM=()=>({state:n,dispatch:e})=>$T(n,e),tM=()=>({state:n,dispatch:e})=>HT(n,e);function nM(n,e,t={},r={}){return Rl(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:r.errorOnInvalidContent})}const rM=(n,e=!1,t={},r={})=>({editor:i,tr:o,dispatch:a,commands:c})=>{var f,h;const{doc:m}=o;if(t.preserveWhitespace!=="full"){const p=nM(n,i.schema,t,{errorOnInvalidContent:(f=r.errorOnInvalidContent)!==null&&f!==void 0?f:i.options.enableContentCheck});return a&&o.replaceWith(0,m.content.size,p).setMeta("preventUpdate",!e),!0}return a&&o.setMeta("preventUpdate",!e),c.insertContentAt({from:0,to:m.content.size},n,{parseOptions:t,errorOnInvalidContent:(h=r.errorOnInvalidContent)!==null&&h!==void 0?h:i.options.enableContentCheck})};function B0(n,e){const t=hn(e,n.schema),{from:r,to:i,empty:o}=n.selection,a=[];o?(n.storedMarks&&a.push(...n.storedMarks),a.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,f=>{a.push(...f.marks)});const c=a.find(f=>f.type.name===t.name);return c?{...c.attrs}:{}}function iM(n,e){const t=new R_(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function sM(n){for(let e=0;e<n.edgeCount;e+=1){const{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function oM(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,o)=>{t(i)&&r.push({node:i,pos:o})}),r}function lM(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function bf(n){return e=>lM(e.$from,n)}function aM(n,e){const t=Di.resolve(n);return M0(t,e)}function cM(n,e){const t=We(e,n.schema),{from:r,to:i}=n.selection,o=[];n.doc.nodesBetween(r,i,c=>{o.push(c)});const a=o.reverse().find(c=>c.type.name===t.name);return a?{...a.attrs}:{}}function uM(n,e){const t=yf(typeof e=="string"?e:e.name,n.schema);return t==="node"?cM(n,e):t==="mark"?B0(n,e):{}}function fM(n,e=JSON.stringify){const t={};return n.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function hM(n){const e=fM(n);return e.length===1?e:e.filter((t,r)=>!e.filter((o,a)=>a!==r).some(o=>t.oldRange.from>=o.oldRange.from&&t.oldRange.to<=o.oldRange.to&&t.newRange.from>=o.newRange.from&&t.newRange.to<=o.newRange.to))}function dM(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,o)=>{const a=[];if(i.ranges.length)i.forEach((c,f)=>{a.push({from:c,to:f})});else{const{from:c,to:f}=t[o];if(c===void 0||f===void 0)return;a.push({from:c,to:f})}a.forEach(({from:c,to:f})=>{const h=e.slice(o).map(c,-1),m=e.slice(o).map(f),p=e.invert().map(h,-1),g=e.invert().map(m);r.push({oldRange:{from:p,to:g},newRange:{from:h,to:m}})})}),hM(r)}function F0(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const o=t.resolve(n),a=pf(o,i.type);a&&r.push({mark:i,...a})}):t.nodesBetween(n,e,(i,o)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(a=>({from:o,to:o+i.nodeSize,mark:a})))}),r}function Ll(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const i=n.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function pM(n,e,t={}){const{empty:r,ranges:i}=n.selection,o=e?hn(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(p=>o?o.name===p.type.name:!0).find(p=>Ol(p.attrs,t,{strict:!1}));let a=0;const c=[];if(i.forEach(({$from:p,$to:g})=>{const b=p.pos,S=g.pos;n.doc.nodesBetween(b,S,(E,C)=>{if(!E.isText&&!E.marks.length)return;const M=Math.max(b,C),P=Math.min(S,C+E.nodeSize),F=P-M;a+=F,c.push(...E.marks.map($=>({mark:$,from:M,to:P})))})}),a===0)return!1;const f=c.filter(p=>o?o.name===p.mark.type.name:!0).filter(p=>Ol(p.mark.attrs,t,{strict:!1})).reduce((p,g)=>p+g.to-g.from,0),h=c.filter(p=>o?p.mark.type!==o&&p.mark.type.excludes(o):!0).reduce((p,g)=>p+g.to-g.from,0);return(f>0?f+h:f)>=a}function H0(n,e){const{nodeExtensions:t}=Tl(e),r=t.find(a=>a.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=ae(K(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function $0(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var r;if(t){if(n.type.name==="hardBreak")return!0;if(n.isText)return/^\s*$/m.test((r=n.text)!==null&&r!==void 0?r:"")}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let i=!0;return n.content.forEach(o=>{i!==!1&&($0(o,{ignoreWhitespace:t,checkChildren:e})||(i=!1))}),i}return!1}function mM(n,e,t){var r;const{selection:i}=e;let o=null;if(L0(i)&&(o=i.$cursor),o){const c=(r=n.storedMarks)!==null&&r!==void 0?r:o.marks();return!!t.isInSet(c)||!c.some(f=>f.type.excludes(t))}const{ranges:a}=i;return a.some(({$from:c,$to:f})=>{let h=c.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(c.pos,f.pos,(m,p,g)=>{if(h)return!1;if(m.isInline){const b=!g||g.type.allowsMarkType(t),S=!!t.isInSet(m.marks)||!m.marks.some(E=>E.type.excludes(t));h=b&&S}return!h}),h})}const gM=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:o}=t,{empty:a,ranges:c}=o,f=hn(n,r.schema);if(i)if(a){const h=B0(r,f);t.addStoredMark(f.create({...h,...e}))}else c.forEach(h=>{const m=h.$from.pos,p=h.$to.pos;r.doc.nodesBetween(m,p,(g,b)=>{const S=Math.max(b,m),E=Math.min(b+g.nodeSize,p);g.marks.find(M=>M.type===f)?g.marks.forEach(M=>{f===M.type&&t.addMark(S,E,f.create({...M.attrs,...e}))}):t.addMark(S,E,f.create(e))})});return mM(r,t,f)},yM=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),bM=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const o=We(n,t.schema);let a;return t.selection.$anchor.sameParent(t.selection.$head)&&(a=t.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:c})=>k0(o,{...a,...e})(t)?!0:c.clearNodes()).command(({state:c})=>k0(o,{...a,...e})(c,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},vM=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=Kr(n,0,r.content.size),o=Y.create(r,i);e.setSelection(o)}return!0},wM=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:o}=typeof n=="number"?{from:n,to:n}:n,a=ce.atStart(r).from,c=ce.atEnd(r).to,f=Kr(i,a,c),h=Kr(o,a,c),m=ce.create(r,f,h);e.setSelection(m)}return!0},SM=n=>({state:e,dispatch:t})=>{const r=We(n,e.schema);return jT(r)(e,t)};function W0(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(i=>e?.includes(i.type.name));n.tr.ensureMarks(r)}}const xM=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:o,doc:a}=e,{$from:c,$to:f}=o,h=i.extensionManager.attributes,m=Ll(h,c.node().type.name,c.node().attrs);if(o instanceof Y&&o.node.isBlock)return!c.parentOffset||!Pn(a,c.pos)?!1:(r&&(n&&W0(t,i.extensionManager.splittableMarks),e.split(c.pos).scrollIntoView()),!0);if(!c.parent.isBlock)return!1;const p=f.parentOffset===f.parent.content.size,g=c.depth===0?void 0:sM(c.node(-1).contentMatchAt(c.indexAfter(-1)));let b=p&&g?[{type:g,attrs:m}]:void 0,S=Pn(e.doc,e.mapping.map(c.pos),1,b);if(!b&&!S&&Pn(e.doc,e.mapping.map(c.pos),1,g?[{type:g}]:void 0)&&(S=!0,b=g?[{type:g,attrs:m}]:void 0),r){if(S&&(o instanceof ce&&e.deleteSelection(),e.split(e.mapping.map(c.pos),1,b),g&&!p&&!c.parentOffset&&c.parent.type!==g)){const E=e.mapping.map(c.before()),C=e.doc.resolve(E);c.node(-1).canReplaceWith(C.index(),C.index()+1,g)&&e.setNodeMarkup(e.mapping.map(c.before()),g)}n&&W0(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return S},EM=(n,e={})=>({tr:t,state:r,dispatch:i,editor:o})=>{var a;const c=We(n,r.schema),{$from:f,$to:h}=r.selection,m=r.selection.node;if(m&&m.isBlock||f.depth<2||!f.sameParent(h))return!1;const p=f.node(-1);if(p.type!==c)return!1;const g=o.extensionManager.attributes;if(f.parent.content.size===0&&f.node(-1).childCount===f.indexAfter(-1)){if(f.depth===2||f.node(-3).type!==c||f.index(-2)!==f.node(-2).childCount-1)return!1;if(i){let M=L.empty;const P=f.index(-1)?1:f.index(-2)?2:3;for(let be=f.depth-P;be>=f.depth-3;be-=1)M=L.from(f.node(be).copy(M));const F=f.indexAfter(-1)<f.node(-2).childCount?1:f.indexAfter(-2)<f.node(-3).childCount?2:3,$={...Ll(g,f.node().type.name,f.node().attrs),...e},U=((a=c.contentMatch.defaultType)===null||a===void 0?void 0:a.createAndFill($))||void 0;M=M.append(L.from(c.createAndFill(null,U)||void 0));const ue=f.before(f.depth-(P-1));t.replace(ue,f.after(-F),new W(M,4-P,0));let he=-1;t.doc.nodesBetween(ue,t.doc.content.size,(be,bt)=>{if(he>-1)return!1;be.isTextblock&&be.content.size===0&&(he=bt+1)}),he>-1&&t.setSelection(ce.near(t.doc.resolve(he))),t.scrollIntoView()}return!0}const b=h.pos===f.end()?p.contentMatchAt(0).defaultType:null,S={...Ll(g,p.type.name,p.attrs),...e},E={...Ll(g,f.node().type.name,f.node().attrs),...e};t.delete(f.pos,h.pos);const C=b?[{type:c,attrs:S},{type:b,attrs:E}]:[{type:c,attrs:S}];if(!Pn(t.doc,f.pos,2))return!1;if(i){const{selection:M,storedMarks:P}=r,{splittableMarks:F}=o.extensionManager,$=P||M.$to.parentOffset&&M.$from.marks();if(t.split(f.pos,2,C).scrollIntoView(),!$||!i)return!0;const U=$.filter(ue=>F.includes(ue.type.name));t.ensureMarks(U)}return!0},vf=(n,e)=>{const t=bf(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===i?.type&&fr(n.doc,t.pos)&&n.join(t.pos),!0},wf=(n,e)=>{const t=bf(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===i?.type&&fr(n.doc,r)&&n.join(r),!0},kM=(n,e,t,r={})=>({editor:i,tr:o,state:a,dispatch:c,chain:f,commands:h,can:m})=>{const{extensions:p,splittableMarks:g}=i.extensionManager,b=We(n,a.schema),S=We(e,a.schema),{selection:E,storedMarks:C}=a,{$from:M,$to:P}=E,F=M.blockRange(P),$=C||E.$to.parentOffset&&E.$from.marks();if(!F)return!1;const U=bf(ue=>H0(ue.type.name,p))(E);if(F.depth>=1&&U&&F.depth-U.depth<=1){if(U.node.type===b)return h.liftListItem(S);if(H0(U.node.type.name,p)&&b.validContent(U.node.content)&&c)return f().command(()=>(o.setNodeMarkup(U.pos,b),!0)).command(()=>vf(o,b)).command(()=>wf(o,b)).run()}return!t||!$||!c?f().command(()=>m().wrapInList(b,r)?!0:h.clearNodes()).wrapInList(b,r).command(()=>vf(o,b)).command(()=>wf(o,b)).run():f().command(()=>{const ue=m().wrapInList(b,r),he=$.filter(be=>g.includes(be.type.name));return o.ensureMarks(he),ue?!0:h.clearNodes()}).wrapInList(b,r).command(()=>vf(o,b)).command(()=>wf(o,b)).run()},_M=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=t,a=hn(n,r.schema);return pM(r,a,e)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,e)},TM=(n,e,t={})=>({state:r,commands:i})=>{const o=We(n,r.schema),a=We(e,r.schema),c=gf(r,o,t);let f;return r.selection.$anchor.sameParent(r.selection.$head)&&(f=r.selection.$anchor.parent.attrs),c?i.setNode(a,f):i.setNode(o,{...f,...t})},CM=(n,e={})=>({state:t,commands:r})=>{const i=We(n,t.schema);return gf(t,i,e)?r.lift(i):r.wrapIn(i,e)},MM=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r<t.length;r+=1){const i=t[r];let o;if(i.spec.isInputRules&&(o=i.getState(n))){if(e){const a=n.tr,c=o.transform;for(let f=c.steps.length-1;f>=0;f-=1)a.step(c.steps[f].invert(c.docs[f]));if(o.text){const f=a.doc.resolve(o.from).marks();a.replaceWith(o.from,o.to,n.schema.text(o.text,f))}else a.delete(o.from,o.to)}return!0}}return!1},AM=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:i}=t;return r||e&&i.forEach(o=>{n.removeMark(o.$from.pos,o.$to.pos)}),!0},IM=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=e,{selection:c}=t,f=hn(n,r.schema),{$from:h,empty:m,ranges:p}=c;if(!i)return!0;if(m&&a){let{from:g,to:b}=c;const S=(o=h.marks().find(C=>C.type===f))===null||o===void 0?void 0:o.attrs,E=pf(h,f,S);E&&(g=E.from,b=E.to),t.removeMark(g,b,f)}else p.forEach(g=>{t.removeMark(g.$from.pos,g.$to.pos,f)});return t.removeStoredMark(f),!0},OM=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const c=yf(typeof n=="string"?n:n.name,r.schema);return c?(c==="node"&&(o=We(n,r.schema)),c==="mark"&&(a=hn(n,r.schema)),i&&t.selection.ranges.forEach(f=>{const h=f.$from.pos,m=f.$to.pos;let p,g,b,S;t.selection.empty?r.doc.nodesBetween(h,m,(E,C)=>{o&&o===E.type&&(b=Math.max(C,h),S=Math.min(C+E.nodeSize,m),p=C,g=E)}):r.doc.nodesBetween(h,m,(E,C)=>{C<h&&o&&o===E.type&&(b=Math.max(C,h),S=Math.min(C+E.nodeSize,m),p=C,g=E),C>=h&&C<=m&&(o&&o===E.type&&t.setNodeMarkup(C,void 0,{...E.attrs,...e}),a&&E.marks.length&&E.marks.forEach(M=>{if(a===M.type){const P=Math.max(C,h),F=Math.min(C+E.nodeSize,m);t.addMark(P,F,a.create({...M.attrs,...e}))}}))}),g&&(p!==void 0&&t.setNodeMarkup(p,void 0,{...g.attrs,...e}),a&&g.marks.length&&g.marks.forEach(E=>{a===E.type&&t.addMark(b,S,a.create({...E.attrs,...e}))}))}),!0):!1},NM=(n,e={})=>({state:t,dispatch:r})=>{const i=We(n,t.schema);return WT(i,e)(t,r)},RM=(n,e={})=>({state:t,dispatch:r})=>{const i=We(n,t.schema);return UT(i,e)(t,r)};var LM=Object.freeze({__proto__:null,blur:hC,clearContent:dC,clearNodes:pC,command:mC,createParagraphNear:gC,cut:yC,deleteCurrentNode:bC,deleteNode:vC,deleteRange:wC,deleteSelection:SC,enter:xC,exitCode:EC,extendMarkRange:kC,first:_C,focus:MC,forEach:AC,insertContent:IC,insertContentAt:RC,joinBackward:DC,joinDown:PC,joinForward:zC,joinItemBackward:BC,joinItemForward:FC,joinTextblockBackward:HC,joinTextblockForward:$C,joinUp:LC,keyboardShortcut:UC,lift:VC,liftEmptyBlock:KC,liftListItem:GC,newlineInCode:JC,resetAttributes:qC,scrollIntoView:jC,selectAll:YC,selectNodeBackward:XC,selectNodeForward:ZC,selectParentNode:QC,selectTextblockEnd:eM,selectTextblockStart:tM,setContent:rM,setMark:gM,setMeta:yM,setNode:bM,setNodeSelection:vM,setTextSelection:wM,sinkListItem:SM,splitBlock:xM,splitListItem:EM,toggleList:kM,toggleMark:_M,toggleNode:TM,toggleWrap:CM,undoInputRule:MM,unsetAllMarks:AM,unsetMark:IM,updateAttributes:OM,wrapIn:NM,wrapInList:RM});Ie.create({name:"commands",addCommands(){return{...LM}}}),Ie.create({name:"drop",addProseMirrorPlugins(){return[new lt({key:new Ct("tiptapDrop"),props:{handleDrop:(n,e,t,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:r})}}})]}}),Ie.create({name:"editable",addProseMirrorPlugins(){return[new lt({key:new Ct("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Ie.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new lt({key:new Ct("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Ie.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:c})=>{const{selection:f,doc:h}=c,{empty:m,$anchor:p}=f,{pos:g,parent:b}=p,S=p.parent.isTextblock&&g>0?c.doc.resolve(g-1):p,E=S.parent.type.spec.isolating,C=p.pos-p.parentOffset,M=E&&S.parent.childCount===1?C===p.pos:pe.atStart(h).from===g;return!m||!b.type.isTextblock||b.textContent.length||!M||M&&p.parent.type.name==="paragraph"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return mf()||D0()?o:i},addProseMirrorPlugins(){return[new lt({key:new Ct("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(E=>E.getMeta("composition")))return;const r=n.some(E=>E.docChanged)&&!e.doc.eq(t.doc),i=n.some(E=>E.getMeta("preventClearDocument"));if(!r||i)return;const{empty:o,from:a,to:c}=e.selection,f=pe.atStart(e.doc).from,h=pe.atEnd(e.doc).to;if(o||!(a===f&&c===h)||!$0(t.doc))return;const g=t.tr,b=_l({state:t,transaction:g}),{commands:S}=new uf({editor:this.editor,state:b});if(S.clearNodes(),!!g.steps.length)return g}})]}}),Ie.create({name:"paste",addProseMirrorPlugins(){return[new lt({key:new Ct("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),Ie.create({name:"tabindex",addProseMirrorPlugins(){return[new lt({key:new Ct("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});function PM(n){return new O0({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),o=ae(n.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,o)}})}function DM(n){return new O0({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const o=ae(n.getAttributes,void 0,r)||{},a=e.tr.delete(t.from,t.to),f=a.doc.resolve(t.from).blockRange(),h=f&&Pu(f,n.type,o);if(!h)return null;if(a.wrap(f,h),n.keepMarks&&n.editor){const{selection:p,storedMarks:g}=e,{splittableMarks:b}=n.editor.extensionManager,S=g||p.$to.parentOffset&&p.$from.marks();if(S){const E=S.filter(C=>b.includes(C.type.name));a.ensureMarks(E)}}if(n.keepAttributes){const p=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(p,o).run()}const m=a.doc.resolve(t.from-1).nodeBefore;m&&m.type===n.type&&fr(a.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,m))&&a.join(t.from-1)}})}class Gn{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ae(K(this,"addOptions",{name:this.name}))),this.storage=ae(K(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Gn(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Al(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new Gn(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ae(K(t,"addOptions",{name:t.name})),t.storage=ae(K(t,"addStorage",{name:t.name,options:t.options})),t}}function zM(n){return new iC({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const o=ae(n.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:a}=e,c=r[r.length-1],f=r[0];let h=t.to;if(c){const m=f.search(/\S/),p=t.from+f.indexOf(c),g=p+c.length;if(F0(t.from,t.to,e.doc).filter(S=>S.mark.type.excluded.find(C=>C===n.type&&C!==S.mark.type)).filter(S=>S.to>p).length)return null;g<t.to&&a.delete(g,t.to),p>t.from&&a.delete(t.from+m,p),h=t.from+m+c.length,a.addMark(t.from+m,h,n.type.create(o||{})),a.removeStoredMark(n.type)}}})}const BM=Gn.create({name:"text",group:"inline"});var Pl=200,Ue=function(){};Ue.prototype.append=function(e){return e.length?(e=Ue.from(e),!this.length&&e||e.length<Pl&&this.leafAppend(e)||this.length<Pl&&e.leafPrepend(this)||this.appendInner(e)):this},Ue.prototype.prepend=function(e){return e.length?Ue.from(e).append(this):this},Ue.prototype.appendInner=function(e){return new FM(this,e)},Ue.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Ue.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Ue.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ue.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)},Ue.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,a){return i.push(e(o,a))},t,r),i},Ue.from=function(e){return e instanceof Ue?e:e&&e.length?new U0(e):Ue.empty};var U0=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,a,c){for(var f=o;f<a;f++)if(i(this.values[f],c+f)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,a,c){for(var f=o-1;f>=a;f--)if(i(this.values[f],c+f)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Pl)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Pl)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(Ue);Ue.empty=new U0([]);var FM=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,a){var c=this.left.length;if(i<c&&this.left.forEachInner(r,i,Math.min(o,c),a)===!1||o>c&&this.right.forEachInner(r,Math.max(i-c,0),Math.min(this.length,o)-c,a+c)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,a){var c=this.left.length;if(i>c&&this.right.forEachInvertedInner(r,i-c,Math.max(o,c)-c,a+c)===!1||o<c&&this.left.forEachInvertedInner(r,Math.min(i,c),o,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Ue);const HM=500;class rn{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a=e.tr,c,f,h=[],m=[];return this.items.forEach((p,g)=>{if(!p.step){i||(i=this.remapping(r,g+1),o=i.maps.length),o--,m.push(p);return}if(i){m.push(new mn(p.map));let b=p.step.map(i.slice(o)),S;b&&a.maybeStep(b).doc&&(S=a.mapping.maps[a.mapping.maps.length-1],h.push(new mn(S,void 0,void 0,h.length+m.length))),o--,S&&i.appendMap(S,o)}else a.maybeStep(p.step);if(p.selection)return c=i?p.selection.map(i.slice(o)):p.selection,f=new rn(this.items.slice(0,r).append(m.reverse().concat(h)),this.eventCount-1),!1},this.items.length,0),{remaining:f,transform:a,selection:c}}addTransform(e,t,r,i){let o=[],a=this.eventCount,c=this.items,f=!i&&c.length?c.get(c.length-1):null;for(let m=0;m<e.steps.length;m++){let p=e.steps[m].invert(e.docs[m]),g=new mn(e.mapping.maps[m],p,t),b;(b=f&&f.merge(g))&&(g=b,m?o.pop():c=c.slice(0,c.length-1)),o.push(g),t&&(a++,t=void 0),i||(f=g)}let h=a-r.depth;return h>WM&&(c=$M(c,h),a-=h),new rn(c.append(o),a)}remapping(e,t){let r=new zi;return this.items.forEach((i,o)=>{let a=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,t),r}addMaps(e){return this.eventCount==0?this:new rn(this.items.append(e.map(t=>new mn(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,a=e.steps.length,c=this.eventCount;this.items.forEach(g=>{g.selection&&c--},i);let f=t;this.items.forEach(g=>{let b=o.getMirror(--f);if(b==null)return;a=Math.min(a,b);let S=o.maps[b];if(g.step){let E=e.steps[b].invert(e.docs[b]),C=g.selection&&g.selection.map(o.slice(f+1,b));C&&c++,r.push(new mn(S,E,C))}else r.push(new mn(S))},i);let h=[];for(let g=t;g<a;g++)h.push(new mn(o.maps[g]));let m=this.items.slice(0,i).append(h).append(r),p=new rn(m,c);return p.emptyItemCount()>HM&&(p=p.compress(this.items.length-r.length)),p}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((a,c)=>{if(c>=e)i.push(a),a.selection&&o++;else if(a.step){let f=a.step.map(t.slice(r)),h=f&&f.getMap();if(r--,h&&t.appendMap(h,r),f){let m=a.selection&&a.selection.map(t.slice(r));m&&o++;let p=new mn(h.invert(),f,m),g,b=i.length-1;(g=i.length&&i[b].merge(p))?i[b]=g:i.push(p)}}else a.map&&r--},this.items.length,0),new rn(Ue.from(i.reverse()),o)}}rn.empty=new rn(Ue.empty,0);function $M(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class mn{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new mn(t.getMap().invert(),t,this.selection)}}}class yr{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const WM=20;function UM(n,e,t,r){let i=t.getMeta(Gr),o;if(i)return i.historyState;t.getMeta(GM)&&(n=new yr(n.done,n.undone,null,0,-1));let a=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(a&&a.getMeta(Gr))return a.getMeta(Gr).redo?new yr(n.done.addTransform(t,void 0,r,Dl(e)),n.undone,V0(t.mapping.maps),n.prevTime,n.prevComposition):new yr(n.done,n.undone.addTransform(t,void 0,r,Dl(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let c=t.getMeta("composition"),f=n.prevTime==0||!a&&n.prevComposition!=c&&(n.prevTime<(t.time||0)-r.newGroupDelay||!VM(t,n.prevRanges)),h=a?Sf(n.prevRanges,t.mapping):V0(t.mapping.maps);return new yr(n.done.addTransform(t,f?e.selection.getBookmark():void 0,r,Dl(e)),rn.empty,h,t.time,c??n.prevComposition)}else return(o=t.getMeta("rebased"))?new yr(n.done.rebased(t,o),n.undone.rebased(t,o),Sf(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new yr(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),Sf(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function VM(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(t=!0)}),t}function V0(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,i,o,a)=>e.push(o,a));return e}function Sf(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),o=e.map(n[r+1],-1);i<=o&&t.push(i,o)}return t}function KM(n,e,t){let r=Dl(e),i=Gr.get(e).spec.config,o=(t?n.undone:n.done).popEvent(e,r);if(!o)return null;let a=o.selection.resolve(o.transform.doc),c=(t?n.done:n.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),f=new yr(t?c:o.remaining,t?o.remaining:c,null,0,-1);return o.transform.setSelection(a).setMeta(Gr,{redo:t,historyState:f})}let xf=!1,K0=null;function Dl(n){let e=n.plugins;if(K0!=e){xf=!1,K0=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){xf=!0;break}}return xf}const Gr=new Ct("history"),GM=new Ct("closeHistory");function JM(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new lt({key:Gr,state:{init(){return new yr(rn.empty,rn.empty,null,0,-1)},apply(e,t,r){return UM(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?J0:r=="historyRedo"?q0:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function G0(n,e){return(t,r)=>{let i=Gr.getState(t);if(!i||(n?i.undone:i.done).eventCount==0)return!1;if(r){let o=KM(i,t,n);o&&r(e?o.scrollIntoView():o)}return!0}}const J0=G0(!1,!0),q0=G0(!0,!0),qM=Ie.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>J0(n,e),redo:()=>({state:n,dispatch:e})=>q0(n,e)}},addProseMirrorPlugins(){return[JM(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}});var Dn=(n=>(n.COMMON="common",n.DESKTOP="desktop",n.TABLET="tablet",n.MOBILE="mobile",n.ALL="all",n))(Dn||{});const jM=["common","mobile","tablet","desktop"];var zl=(n=>(n.UPPERCASE="uppercase",n.LOWERCASE="lowercase",n.CAPITALIZE="capitalize",n))(zl||{}),br=(n=>(n.LEFT="left",n.CENTER="center",n.RIGHT="right",n.JUSTIFY="justify",n))(br||{});const YM=["left","center","right","justify"];var te=(n=>(n.DOCUMENT="doc",n.PARAGRAPH="paragraph",n.HEADING="heading",n.LIST="list",n.LIST_ITEM="listItem",n.TEXT="text",n))(te||{});const Ef=["paragraph","list","heading"];var tn=(n=>(n.DISC="disc",n.CIRCLE="circle",n.SQUARE="square",n.DECIMAL="decimal",n.ROMAN="roman",n.LATIN="latin",n))(tn||{});const XM=["disc","circle","square","decimal","roman","latin"],ZM=["decimal","roman","latin"];var Ee=(n=>(n.ALIGNMENT="alignment",n.BACKGROUND_COLOR="background_color",n.FONT_COLOR="font_color",n.FONT_FAMILY="font_family",n.FONT_SIZE="font_size",n.FONT_STYLE="font_style",n.FONT_WEIGHT="font_weight",n.LINE_HEIGHT="line_height",n.LETTER_SPACING="letter_spacing",n.TEXT_DECORATION="text_decoration",n.SUPERSCRIPT="superscript",n.MARGIN="margin",n.LINK="link",n.STYLE_PRESET="style_preset",n))(Ee||{});const j0=["alignment","line_height","margin"],Bl=["line_height"],Y0=["text_decoration","link","superscript","background_color"],X0=["background_color","font_color","font_family","font_size","font_style","font_weight","letter_spacing","text_decoration","superscript"];var At=(n=>(n.SETTINGS="settings",n.ALL="_",n))(At||{}),kf=(n=>(n.BLANK="_blank",n.SELF="_self",n))(kf||{}),Ii=(n=>(n.URL="url",n.BLOCK="block",n))(Ii||{});class _f{static create(e,t){const r=new this(e,t||{});return new lt({key:new Ct(this.name),props:r._buildProps()})}constructor(e,t){this.options=t,this.editor=e}_buildProps(){const t=Object.entries(this.addProps()).map(([r,i])=>[r,i.bind(this)]);return Object.fromEntries(t)}addProps(){return{}}}class QM extends _f{addProps(){return{transformPastedHTML:this._transformPastedHTML,handlePaste:this._handlePaste}}_transformPastedHTML(e){if(e.includes("data-pm-slice")&&e.includes("zw-style"))return e;const t=Na.build(e);return t.normalizeHTML(),this._removeDeprecatedStyles(t),t.normalizedHTML}_removeDeprecatedStyles(e){const t=e.dom.querySelectorAll('[style*="margin"]');for(const r of Array.from(t))r.style.removeProperty("margin"),r.style.removeProperty("margin-top"),r.style.removeProperty("margin-right"),r.style.removeProperty("margin-bottom"),r.style.removeProperty("margin-left")}_handlePaste(e,t,r){const i=this._insertPastedContent(e,r).scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste");return e.dispatch(i),!0}_insertPastedContent({state:e},t){return this._isFullBlockSelected(e)?e.tr.replaceSelectionWith(t.content,!1):e.tr.replaceSelection(t)}_isFullBlockSelected(e){const t=this._expandSelectionToBlocks(e),r=this._isMatchPosition(t.from,e.selection.from),i=this._isMatchPosition(t.to,e.selection.to);return r&&i}_expandSelectionToBlocks({selection:e,doc:t}){let r=e.from,i=e.to;return t.nodesBetween(r,i,(o,a,c)=>{c.type.name===te.DOCUMENT&&(r=Math.min(r,a+1),i=Math.max(i,a+o.nodeSize-1))}),{from:r,to:i}}_isMatchPosition(e,t){return Math.abs(e-t)<5}}class eA extends _f{addProps(){return{decorations:this._buildDecorations}}_buildDecorations({doc:e}){const t=[];if(!this.editor.isEditable)return null;if(!(e.childCount>1))return e.descendants((r,i)=>{if(!r.childCount){const o=bn.node(i,i+r.nodeSize,{class:"zw-wysiwyg__placeholder","data-placeholder":"Type your text here..."});t.push(o)}return!1}),Je.create(e,t)}}const tA="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",nA="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",Oi=(n,e)=>{for(const t in e)n[t]=e[t];return n},Tf="numeric",Cf="ascii",Mf="alpha",Ms="asciinumeric",As="alphanumeric",Af="domain",Z0="emoji",rA="scheme",iA="slashscheme",If="whitespace";function sA(n,e){return n in e||(e[n]=[]),e[n]}function Jr(n,e,t){e[Tf]&&(e[Ms]=!0,e[As]=!0),e[Cf]&&(e[Ms]=!0,e[Mf]=!0),e[Ms]&&(e[As]=!0),e[Mf]&&(e[As]=!0),e[As]&&(e[Af]=!0),e[Z0]&&(e[Af]=!0);for(const r in e){const i=sA(r,t);i.indexOf(n)<0&&i.push(n)}}function oA(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function gt(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}gt.groups={},gt.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],o=e.jr[r][1];if(o&&i.test(n))return o}return e.jd},has(n,e=!1){return e?n in this.j:!!this.go(n)},ta(n,e,t,r){for(let i=0;i<n.length;i++)this.tt(n[i],e,t,r)},tr(n,e,t,r){r=r||gt.groups;let i;return e&&e.j?i=e:(i=new gt(e),t&&r&&Jr(e,t,r)),this.jr.push([n,i]),i},ts(n,e,t,r){let i=this;const o=n.length;if(!o)return i;for(let a=0;a<o-1;a++)i=i.tt(n[a]);return i.tt(n[o-1],e,t,r)},tt(n,e,t,r){r=r||gt.groups;const i=this;if(e&&e.j)return i.j[n]=e,e;const o=e;let a,c=i.go(n);if(c?(a=new gt,Oi(a.j,c.j),a.jr.push.apply(a.jr,c.jr),a.jd=c.jd,a.t=c.t):a=new gt,o){if(r)if(a.t&&typeof a.t=="string"){const f=Oi(oA(a.t,r),t);Jr(o,f,r)}else t&&Jr(o,t,r);a.t=o}return i.j[n]=a,a}};const ne=(n,e,t,r,i)=>n.ta(e,t,r,i),Ae=(n,e,t,r,i)=>n.tr(e,t,r,i),Q0=(n,e,t,r,i)=>n.ts(e,t,r,i),D=(n,e,t,r,i)=>n.tt(e,t,r,i),zn="WORD",Of="UWORD",e1="ASCIINUMERICAL",t1="ALPHANUMERICAL",Is="LOCALHOST",Nf="TLD",Rf="UTLD",Fl="SCHEME",Ni="SLASH_SCHEME",Lf="NUM",Pf="WS",Df="NL",Os="OPENBRACE",Ns="CLOSEBRACE",Hl="OPENBRACKET",$l="CLOSEBRACKET",Wl="OPENPAREN",Ul="CLOSEPAREN",Vl="OPENANGLEBRACKET",Kl="CLOSEANGLEBRACKET",Gl="FULLWIDTHLEFTPAREN",Jl="FULLWIDTHRIGHTPAREN",ql="LEFTCORNERBRACKET",jl="RIGHTCORNERBRACKET",Yl="LEFTWHITECORNERBRACKET",Xl="RIGHTWHITECORNERBRACKET",Zl="FULLWIDTHLESSTHAN",Ql="FULLWIDTHGREATERTHAN",ea="AMPERSAND",zf="APOSTROPHE",ta="ASTERISK",vr="AT",na="BACKSLASH",ra="BACKTICK",ia="CARET",wr="COLON",Bf="COMMA",sa="DOLLAR",dn="DOT",oa="EQUALS",Ff="EXCLAMATION",Ut="HYPHEN",Rs="PERCENT",la="PIPE",aa="PLUS",ca="POUND",Ls="QUERY",Hf="QUOTE",n1="FULLWIDTHMIDDLEDOT",$f="SEMI",pn="SLASH",Ps="TILDE",ua="UNDERSCORE",r1="EMOJI",fa="SYM";var i1=Object.freeze({__proto__:null,WORD:zn,UWORD:Of,ASCIINUMERICAL:e1,ALPHANUMERICAL:t1,LOCALHOST:Is,TLD:Nf,UTLD:Rf,SCHEME:Fl,SLASH_SCHEME:Ni,NUM:Lf,WS:Pf,NL:Df,OPENBRACE:Os,CLOSEBRACE:Ns,OPENBRACKET:Hl,CLOSEBRACKET:$l,OPENPAREN:Wl,CLOSEPAREN:Ul,OPENANGLEBRACKET:Vl,CLOSEANGLEBRACKET:Kl,FULLWIDTHLEFTPAREN:Gl,FULLWIDTHRIGHTPAREN:Jl,LEFTCORNERBRACKET:ql,RIGHTCORNERBRACKET:jl,LEFTWHITECORNERBRACKET:Yl,RIGHTWHITECORNERBRACKET:Xl,FULLWIDTHLESSTHAN:Zl,FULLWIDTHGREATERTHAN:Ql,AMPERSAND:ea,APOSTROPHE:zf,ASTERISK:ta,AT:vr,BACKSLASH:na,BACKTICK:ra,CARET:ia,COLON:wr,COMMA:Bf,DOLLAR:sa,DOT:dn,EQUALS:oa,EXCLAMATION:Ff,HYPHEN:Ut,PERCENT:Rs,PIPE:la,PLUS:aa,POUND:ca,QUERY:Ls,QUOTE:Hf,FULLWIDTHMIDDLEDOT:n1,SEMI:$f,SLASH:pn,TILDE:Ps,UNDERSCORE:ua,EMOJI:r1,SYM:fa});const Bn=/[a-z]/,Ds=/\p{L}/u,Wf=/\p{Emoji}/u,Fn=/\d/,Uf=/\s/,s1="\r",Vf=`
17
+ `,lA="\uFE0F",aA="\u200D",Kf="\uFFFC";let ha=null,da=null;function cA(n=[]){const e={};gt.groups=e;const t=new gt;ha==null&&(ha=l1(tA)),da==null&&(da=l1(nA)),D(t,"'",zf),D(t,"{",Os),D(t,"}",Ns),D(t,"[",Hl),D(t,"]",$l),D(t,"(",Wl),D(t,")",Ul),D(t,"<",Vl),D(t,">",Kl),D(t,"\uFF08",Gl),D(t,"\uFF09",Jl),D(t,"\u300C",ql),D(t,"\u300D",jl),D(t,"\u300E",Yl),D(t,"\u300F",Xl),D(t,"\uFF1C",Zl),D(t,"\uFF1E",Ql),D(t,"&",ea),D(t,"*",ta),D(t,"@",vr),D(t,"`",ra),D(t,"^",ia),D(t,":",wr),D(t,",",Bf),D(t,"$",sa),D(t,".",dn),D(t,"=",oa),D(t,"!",Ff),D(t,"-",Ut),D(t,"%",Rs),D(t,"|",la),D(t,"+",aa),D(t,"#",ca),D(t,"?",Ls),D(t,'"',Hf),D(t,"/",pn),D(t,";",$f),D(t,"~",Ps),D(t,"_",ua),D(t,"\\",na),D(t,"\u30FB",n1);const r=Ae(t,Fn,Lf,{[Tf]:!0});Ae(r,Fn,r);const i=Ae(r,Bn,e1,{[Ms]:!0}),o=Ae(r,Ds,t1,{[As]:!0}),a=Ae(t,Bn,zn,{[Cf]:!0});Ae(a,Fn,i),Ae(a,Bn,a),Ae(i,Fn,i),Ae(i,Bn,i);const c=Ae(t,Ds,Of,{[Mf]:!0});Ae(c,Bn),Ae(c,Fn,o),Ae(c,Ds,c),Ae(o,Fn,o),Ae(o,Bn),Ae(o,Ds,o);const f=D(t,Vf,Df,{[If]:!0}),h=D(t,s1,Pf,{[If]:!0}),m=Ae(t,Uf,Pf,{[If]:!0});D(t,Kf,m),D(h,Vf,f),D(h,Kf,m),Ae(h,Uf,m),D(m,s1),D(m,Vf),Ae(m,Uf,m),D(m,Kf,m);const p=Ae(t,Wf,r1,{[Z0]:!0});D(p,"#"),Ae(p,Wf,p),D(p,lA,p);const g=D(p,aA);D(g,"#"),Ae(g,Wf,p);const b=[[Bn,a],[Fn,i]],S=[[Bn,null],[Ds,c],[Fn,o]];for(let E=0;E<ha.length;E++)Sr(t,ha[E],Nf,zn,b);for(let E=0;E<da.length;E++)Sr(t,da[E],Rf,Of,S);Jr(Nf,{tld:!0,ascii:!0},e),Jr(Rf,{utld:!0,alpha:!0},e),Sr(t,"file",Fl,zn,b),Sr(t,"mailto",Fl,zn,b),Sr(t,"http",Ni,zn,b),Sr(t,"https",Ni,zn,b),Sr(t,"ftp",Ni,zn,b),Sr(t,"ftps",Ni,zn,b),Jr(Fl,{scheme:!0,ascii:!0},e),Jr(Ni,{slashscheme:!0,ascii:!0},e),n=n.sort((E,C)=>E[0]>C[0]?1:-1);for(let E=0;E<n.length;E++){const C=n[E][0],P=n[E][1]?{[rA]:!0}:{[iA]:!0};C.indexOf("-")>=0?P[Af]=!0:Bn.test(C)?Fn.test(C)?P[Ms]=!0:P[Cf]=!0:P[Tf]=!0,Q0(t,C,C,P)}return Q0(t,"localhost",Is,{ascii:!0}),t.jd=new gt(fa),{start:t,tokens:Oi({groups:e},i1)}}function o1(n,e){const t=uA(e.replace(/[A-Z]/g,c=>c.toLowerCase())),r=t.length,i=[];let o=0,a=0;for(;a<r;){let c=n,f=null,h=0,m=null,p=-1,g=-1;for(;a<r&&(f=c.go(t[a]));)c=f,c.accepts()?(p=0,g=0,m=c):p>=0&&(p+=t[a].length,g++),h+=t[a].length,o+=t[a].length,a++;o-=p,a-=g,h-=p,i.push({t:m.t,v:e.slice(o-h,o),s:o-h,e:o})}return i}function uA(n){const e=[],t=n.length;let r=0;for(;r<t;){let i=n.charCodeAt(r),o,a=i<55296||i>56319||r+1===t||(o=n.charCodeAt(r+1))<56320||o>57343?n[r]:n.slice(r,r+2);e.push(a),r+=a.length}return e}function Sr(n,e,t,r,i){let o;const a=e.length;for(let c=0;c<a-1;c++){const f=e[c];n.j[f]?o=n.j[f]:(o=new gt(r),o.jr=i.slice(),n.j[f]=o),n=o}return o=new gt(t),o.jr=i.slice(),n.j[e[a-1]]=o,o}function l1(n){const e=[],t=[];let r=0,i="0123456789";for(;r<n.length;){let o=0;for(;i.indexOf(n[r+o])>=0;)o++;if(o>0){e.push(t.join(""));for(let a=parseInt(n.substring(r,r+o),10);a>0;a--)t.pop();r+=o}else t.push(n[r]),r++}return e}const zs={defaultProtocol:"http",events:null,format:a1,formatHref:a1,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Gf(n,e=null){let t=Oi({},zs);n&&(t=Oi(t,n instanceof Gf?n.o:n));const r=t.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=i}Gf.prototype={o:zs,ignoreTags:[],defaultRender(n){return n},check(n){return this.get("validate",n.toString(),n)},get(n,e,t){const r=e!=null;let i=this.o[n];return i&&(typeof i=="object"?(i=t.t in i?i[t.t]:zs[n],typeof i=="function"&&r&&(i=i(e,t))):typeof i=="function"&&r&&(i=i(e,t.t,t)),i)},getObj(n,e,t){let r=this.o[n];return typeof r=="function"&&e!=null&&(r=r(e,t.t,t)),r},render(n){const e=n.render(this);return(this.get("render",null,n)||this.defaultRender)(e,n.t,n)}};function a1(n){return n}function c1(n,e){this.t="token",this.v=n,this.tk=e}c1.prototype={isLink:!1,toString(){return this.v},toHref(n){return this.toString()},toFormattedString(n){const e=this.toString(),t=n.get("truncate",e,this),r=n.get("format",e,this);return t&&r.length>t?r.substring(0,t)+"\u2026":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=zs.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),i=n.get("tagName",t,e),o=this.toFormattedString(n),a={},c=n.get("className",t,e),f=n.get("target",t,e),h=n.get("rel",t,e),m=n.getObj("attributes",t,e),p=n.getObj("events",t,e);return a.href=r,c&&(a.class=c),f&&(a.target=f),h&&(a.rel=h),m&&Oi(a,m),{tagName:i,attributes:a,content:o,eventListeners:p}}};function pa(n,e){class t extends c1{constructor(i,o){super(i,o),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const u1=pa("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),f1=pa("text"),fA=pa("nl"),ma=pa("url",{isLink:!0,toHref(n=zs.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==Is&&n[1].t===wr}}),Vt=n=>new gt(n);function hA({groups:n}){const e=n.domain.concat([ea,ta,vr,na,ra,ia,sa,oa,Ut,Lf,Rs,la,aa,ca,pn,fa,Ps,ua]),t=[wr,Bf,dn,Ff,Rs,Ls,Hf,$f,Vl,Kl,Os,Ns,$l,Hl,Wl,Ul,Gl,Jl,ql,jl,Yl,Xl,Zl,Ql],r=[ea,zf,ta,na,ra,ia,sa,oa,Ut,Os,Ns,Rs,la,aa,ca,Ls,pn,fa,Ps,ua],i=Vt(),o=D(i,Ps);ne(o,r,o),ne(o,n.domain,o);const a=Vt(),c=Vt(),f=Vt();ne(i,n.domain,a),ne(i,n.scheme,c),ne(i,n.slashscheme,f),ne(a,r,o),ne(a,n.domain,a);const h=D(a,vr);D(o,vr,h),D(c,vr,h),D(f,vr,h);const m=D(o,dn);ne(m,r,o),ne(m,n.domain,o);const p=Vt();ne(h,n.domain,p),ne(p,n.domain,p);const g=D(p,dn);ne(g,n.domain,p);const b=Vt(u1);ne(g,n.tld,b),ne(g,n.utld,b),D(h,Is,b);const S=D(p,Ut);D(S,Ut,S),ne(S,n.domain,p),ne(b,n.domain,p),D(b,dn,g),D(b,Ut,S);const E=D(b,wr);ne(E,n.numeric,u1);const C=D(a,Ut),M=D(a,dn);D(C,Ut,C),ne(C,n.domain,a),ne(M,r,o),ne(M,n.domain,a);const P=Vt(ma);ne(M,n.tld,P),ne(M,n.utld,P),ne(P,n.domain,a),ne(P,r,o),D(P,dn,M),D(P,Ut,C),D(P,vr,h);const F=D(P,wr),$=Vt(ma);ne(F,n.numeric,$);const U=Vt(ma),ue=Vt();ne(U,e,U),ne(U,t,ue),ne(ue,e,U),ne(ue,t,ue),D(P,pn,U),D($,pn,U);const he=D(c,wr),be=D(f,wr),bt=D(be,pn),Jn=D(bt,pn);ne(c,n.domain,a),D(c,dn,M),D(c,Ut,C),ne(f,n.domain,a),D(f,dn,M),D(f,Ut,C),ne(he,n.domain,U),D(he,pn,U),D(he,Ls,U),ne(Jn,n.domain,U),ne(Jn,e,U),D(Jn,pn,U);const sn=[[Os,Ns],[Hl,$l],[Wl,Ul],[Vl,Kl],[Gl,Jl],[ql,jl],[Yl,Xl],[Zl,Ql]];for(let qn=0;qn<sn.length;qn++){const[Zr,on]=sn[qn],vn=D(U,Zr);D(ue,Zr,vn),D(vn,on,U);const Fe=Vt(ma);ne(vn,e,Fe);const vt=Vt();ne(vn,t),ne(Fe,e,Fe),ne(Fe,t,vt),ne(vt,e,Fe),ne(vt,t,vt),D(Fe,on,U),D(vt,on,U)}return D(i,Is,P),D(i,Df,fA),{start:i,tokens:i1}}function dA(n,e,t){let r=t.length,i=0,o=[],a=[];for(;i<r;){let c=n,f=null,h=null,m=0,p=null,g=-1;for(;i<r&&!(f=c.go(t[i].t));)a.push(t[i++]);for(;i<r&&(h=f||c.go(t[i].t));)f=null,c=h,c.accepts()?(g=0,p=c):g>=0&&g++,i++,m++;if(g<0)i-=m,i<r&&(a.push(t[i]),i++);else{a.length>0&&(o.push(Jf(f1,e,a)),a=[]),i-=g,m-=g;const b=p.t,S=t.slice(i-m,i);o.push(Jf(b,e,S))}}return a.length>0&&o.push(Jf(f1,e,a)),o}function Jf(n,e,t){const r=t[0].s,i=t[t.length-1].e,o=e.slice(r,i);return new n(o,t)}const pA=typeof console<"u"&&console&&console.warn||(()=>{}),mA="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ke={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function gA(){return gt.groups={},ke.scanner=null,ke.parser=null,ke.tokenQueue=[],ke.pluginQueue=[],ke.customSchemes=[],ke.initialized=!1,ke}function h1(n,e=!1){if(ke.initialized&&pA(`linkifyjs: already initialized - will not register custom scheme "${n}" ${mA}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.
18
18
  1. Must only contain digits, lowercase ASCII letters or "-"
19
19
  2. Cannot start or end with "-"
20
- 3. "-" cannot repeat`);Ee.customSchemes.push([n,e])}function gA(){Ee.scanner=aA(Ee.customSchemes);for(let n=0;n<Ee.tokenQueue.length;n++)Ee.tokenQueue[n][1]({scanner:Ee.scanner});Ee.parser=fA(Ee.scanner.tokens);for(let n=0;n<Ee.pluginQueue.length;n++)Ee.pluginQueue[n][1]({scanner:Ee.scanner,parser:Ee.parser});return Ee.initialized=!0,Ee}function ga(n){return Ee.initialized||gA(),hA(Ee.parser.start,n,o1(Ee.scanner.start,n))}ga.scan=o1;function d1(n,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const r=new Gf(t),i=ga(n),o=[];for(let a=0;a<i.length;a++){const c=i[a];c.isLink&&(!e||c.t===e)&&r.check(c)&&o.push(c.toFormattedObject(r))}return o}function yA(n,e=null){const t=ga(n);return t.length===1&&t[0].isLink&&(!e||t[0].t===e)}class bA extends _f{addProps(){return{handlePaste:this._handlePaste}}_handlePaste(e,t,r){if(e.state.selection.empty)return!1;const i=r.content.textBetween(0,r.content.size).trim(),o=yA(i);if(!i||!o)return!1;const a=this._createLinkAttrs(i,r.content);return this.editor.commands.applyLink(a),!0}_createLinkAttrs(e,t){return yh.query(t,{typeName:te.TEXT,mark:{typeName:Te.LINK},getMark:{typeName:Te.LINK}})?.attrs||{href:e}}}function B(n){return(...e)=>t=>n(t,...e)}function ya(n){const e=Object.entries(n).reduce((t,[r,i])=>{if(!i)return t;const o=r.replace(/_/g,"-");return`${t}--zw-${o}:${i};`},"");return e?{style:e}:null}function Jr(n){const e=ya(n);return["span",e?{...e,class:"zw-style"}:{},0]}function vA(n){return n.toLowerCase().replace(/(?:^|\s)\S/g,e=>e.toUpperCase())}function Kt(n,...e){return({editor:t})=>(t.commands[n](...e),!0)}var wA=Object.defineProperty,SA=(n,e,t)=>e in n?wA(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Hn=(n,e,t)=>SA(n,typeof e!="symbol"?e+"":e,t),p1,m1,g1;function Be(n,e){let t=n.length;Array.isArray(n[0])||(n=[n]),Array.isArray(e[0])||(e=e.map(a=>[a]));let r=e[0].length,i=e[0].map((a,c)=>e.map(f=>f[c])),o=n.map(a=>i.map(c=>{let f=0;if(!Array.isArray(a)){for(let h of c)f+=a*h;return f}for(let h=0;h<a.length;h++)f+=a[h]*(c[h]||0);return f}));return t===1&&(o=o[0]),r===1?o.map(a=>a[0]):o}function y1(n){return zs(n)==="string"}function zs(n){return(Object.prototype.toString.call(n).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function qf(n,{precision:e,unit:t}){return jf(n)?"none":xA(n,e)+(t??"")}function jf(n){return Number.isNaN(n)||n instanceof Number&&n?.none}function xA(n,e){if(n===0)return 0;let t=~~n,r=0;t&&e&&(r=~~Math.log10(Math.abs(t))+1);const i=10**(e-r);return Math.floor(n*i+.5)/i}const EA={deg:1,grad:.9,rad:180/Math.PI,turn:360};function kA(n){if(!n)return;n=n.trim();const e=/^([a-z]+)\((.+?)\)$/i,t=/^-?[\d.]+$/,r=/%|deg|g?rad|turn$/,i=/\/?\s*(none|[-\w.]+(?:%|deg|g?rad|turn)?)/g;let o=n.match(e);if(o){let a=[];return o[2].replace(i,(c,f)=>{let h=f.match(r),m=f;if(h){let p=h[0],g=m.slice(0,-p.length);p==="%"?(m=new Number(g/100),m.type="<percentage>"):(m=new Number(g*EA[p]),m.type="<angle>",m.unit=p)}else t.test(m)?(m=new Number(m),m.type="<number>"):m==="none"&&(m=new Number(NaN),m.none=!0);c.startsWith("/")&&(m=m instanceof Number?m:new Number(m),m.alpha=!0),typeof m=="object"&&m instanceof Number&&(m.raw=f),a.push(m)}),{name:o[1].toLowerCase(),rawName:o[1],rawArgs:o[2],args:a}}}function _A(n){return n[n.length-1]}function b1(n,e,t){return isNaN(n)?e:isNaN(e)?n:n+(e-n)*t}function TA(n,e,t){return(t-n)/(e-n)}function v1(n,e,t){return b1(e[0],e[1],TA(n[0],n[1],t))}function CA(n){return n.map(e=>e.split("|").map(t=>{t=t.trim();let r=t.match(/^(<[a-z]+>)\[(-?[.\d]+),\s*(-?[.\d]+)\]?$/);if(r){let i=new String(r[1]);return i.range=[+r[2],+r[3]],i}return t}))}function MA(n,e,t){return Math.max(Math.min(t,e),n)}function Yf(n,e){return Math.sign(n)===Math.sign(e)?n:-n}function $n(n,e){return Yf(Math.abs(n)**e,n)}function w1(n,e){return e===0?0:n/e}function AA(n,e,t=0,r=n.length){for(;t<r;){const i=t+r>>1;n[i]<e?t=i+1:r=i}return t}class IA{add(e,t,r){if(typeof arguments[0]!="string"){for(var e in arguments[0])this.add(e,arguments[0][e],arguments[1]);return}(Array.isArray(e)?e:[e]).forEach(function(i){this[i]=this[i]||[],t&&this[i][r?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(r){r.call(t&&t.context?t.context:t,t)})}}const ba=new IA,Wn={D50:[.3457/.3585,1,(1-.3457-.3585)/.3585],D65:[.3127/.329,1,(1-.3127-.329)/.329]};function Xf(n){return Array.isArray(n)?n:Wn[n]}function va(n,e,t,r={}){if(n=Xf(n),e=Xf(e),!n||!e)throw new TypeError(`Missing white point to convert ${n?"":"from"}${!n&&!e?"/":""}${e?"":"to"}`);if(n===e)return t;let i={W1:n,W2:e,XYZ:t,options:r};if(ba.run("chromatic-adaptation-start",i),i.M||(i.W1===Wn.D65&&i.W2===Wn.D50?i.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:i.W1===Wn.D50&&i.W2===Wn.D65&&(i.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),ba.run("chromatic-adaptation-end",i),i.M)return Be(i.M,i.XYZ);throw new TypeError("Only Bradford CAT with white points D50 and D65 supported for now.")}const Fs={gamut_mapping:"css",precision:5,deltaE:"76",verbose:((g1=(m1=(p1=globalThis?.process)==null?void 0:p1.env)==null?void 0:m1.NODE_ENV)==null?void 0:g1.toLowerCase())!=="test",warn:function(e){var t,r;this.verbose&&((r=(t=globalThis?.console)==null?void 0:t.warn)==null||r.call(t,e))}},OA=new Set(["<number>","<percentage>","<angle>"]);function S1(n,e,t,r){return Object.entries(n.coords).map(([o,a],c)=>{let f=e.coordGrammar[c],h=r[c],m=h?.type,p;if(h.none?p=f.find(S=>OA.has(S)):p=f.find(S=>S==m),!p){let S=a.name||o;throw new TypeError(`${m??h.raw} not allowed for ${S} in ${t}()`)}let g=p.range;m==="<percentage>"&&(g||(g=[0,1]));let b=a.range||a.refRange;return g&&b&&(r[c]=v1(g,b,r[c])),p})}function x1(n,{meta:e}={}){var t,r,i,o;let a={str:(t=String(n))==null?void 0:t.trim()};if(ba.run("parse-start",a),a.color)return a.color;if(a.parsed=kA(a.str),a.parsed){let c=a.parsed.name;if(c==="color"){let f=a.parsed.args.shift(),h=f.startsWith("--")?f.substring(2):`--${f}`,m=[f,h],p=a.parsed.rawArgs.indexOf("/")>0?a.parsed.args.pop():1;for(let S of re.all){let E=S.getFormat("color");if(E&&(m.includes(E.id)||(r=E.ids)!=null&&r.filter(C=>m.includes(C)).length)){const C=Object.keys(S.coords).map((P,F)=>a.parsed.args[F]||0);let M;return E.coordGrammar&&(M=S1(S,E,"color",C)),e&&Object.assign(e,{formatId:"color",types:M}),E.id.startsWith("--")&&!f.startsWith("--")&&Fs.warn(`${S.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${E.id}) instead of color(${f}).`),f.startsWith("--")&&!E.id.startsWith("--")&&Fs.warn(`${S.name} is a standard space and supported in the CSS spec. Use color(${E.id}) instead of prefixed color(${f}).`),{spaceId:S.id,coords:C,alpha:p}}}let g="",b=f in re.registry?f:h;if(b in re.registry){let S=(o=(i=re.registry[b].formats)==null?void 0:i.color)==null?void 0:o.id;S&&(g=`Did you mean color(${S})?`)}throw new TypeError(`Cannot parse color(${f}). `+(g||"Missing a plugin?"))}else for(let f of re.all){let h=f.getFormat(c);if(h&&h.type==="function"){let m=1;(h.lastAlpha||_A(a.parsed.args).alpha)&&(m=a.parsed.args.pop());let p=a.parsed.args,g;return h.coordGrammar&&(g=S1(f,h,c,p)),e&&Object.assign(e,{formatId:h.name,types:g}),{spaceId:f.id,coords:p,alpha:m}}}}else for(let c of re.all)for(let f in c.formats){let h=c.formats[f];if(h.type!=="custom"||h.test&&!h.test(a.str))continue;let m=h.parse(a.str);if(m)return m.alpha??(m.alpha=1),e&&(e.formatId=f),m}throw new TypeError(`Could not parse ${n} as a color. Missing a plugin?`)}function Ve(n){if(Array.isArray(n))return n.map(Ve);if(!n)throw new TypeError("Empty color reference");y1(n)&&(n=x1(n));let e=n.space||n.spaceId;return e instanceof re||(n.space=re.get(e)),n.alpha===void 0&&(n.alpha=1),n}const NA=75e-6,Zf=class nn{constructor(e){var t;this.id=e.id,this.name=e.name,this.base=e.base?nn.get(e.base):null,this.aliases=e.aliases,this.base&&(this.fromBase=e.fromBase,this.toBase=e.toBase);let r=e.coords??this.base.coords;for(let o in r)"name"in r[o]||(r[o].name=o);this.coords=r;let i=e.white??this.base.white??"D65";this.white=Xf(i),this.formats=e.formats??{};for(let o in this.formats){let a=this.formats[o];a.type||(a.type="function"),a.name||(a.name=o)}(t=this.formats.color)!=null&&t.id||(this.formats.color={...this.formats.color??{},id:e.cssId||this.id}),e.gamutSpace?this.gamutSpace=e.gamutSpace==="self"?this:nn.get(e.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(o,a)=>!0),this.referred=e.referred,Object.defineProperty(this,"path",{value:RA(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),ba.run("colorspace-init-end",this)}inGamut(e,{epsilon:t=NA}={}){if(!this.equals(this.gamutSpace))return e=this.to(this.gamutSpace,e),this.gamutSpace.inGamut(e,{epsilon:t});let r=Object.values(this.coords);return e.every((i,o)=>{let a=r[o];if(a.type!=="angle"&&a.range){if(Number.isNaN(i))return!0;let[c,f]=a.range;return(c===void 0||i>=c-t)&&(f===void 0||i<=f+t)}return!0})}get isUnbounded(){return Object.values(this.coords).every(e=>!("range"in e))}get cssId(){var e,t;return((t=(e=this.formats)==null?void 0:e.color)==null?void 0:t.id)||this.id}get isPolar(){for(let e in this.coords)if(this.coords[e].type==="angle")return!0;return!1}getFormat(e){if(typeof e=="object")return e=E1(e,this),e;let t;return e==="default"?t=Object.values(this.formats)[0]:t=this.formats[e],t?(t=E1(t,this),t):null}equals(e){return e?this===e||this.id===e||this.id===e.id:!1}to(e,t){if(arguments.length===1){const c=Ve(e);[e,t]=[c.space,c.coords]}if(e=nn.get(e),this.equals(e))return t;t=t.map(c=>Number.isNaN(c)?0:c);let r=this.path,i=e.path,o,a;for(let c=0;c<r.length&&r[c].equals(i[c]);c++)o=r[c],a=c;if(!o)throw new Error(`Cannot convert between color spaces ${this} and ${e}: no connection space was found`);for(let c=r.length-1;c>a;c--)t=r[c].toBase(t);for(let c=a+1;c<i.length;c++)t=i[c].fromBase(t);return t}from(e,t){if(arguments.length===1){const r=Ve(e);[e,t]=[r.space,r.coords]}return e=nn.get(e),e.to(this,t)}toString(){return`${this.name} (${this.id})`}getMinCoords(){let e=[];for(let t in this.coords){let r=this.coords[t],i=r.range||r.refRange;e.push(i?.min??0)}return e}static get all(){return[...new Set(Object.values(nn.registry))]}static register(e,t){if(arguments.length===1&&(t=arguments[0],e=t.id),t=this.get(t),this.registry[e]&&this.registry[e]!==t)throw new Error(`Duplicate color space registration: '${e}'`);if(this.registry[e]=t,arguments.length===1&&t.aliases)for(let r of t.aliases)this.register(r,t);return t}static get(e,...t){if(!e||e instanceof nn)return e;if(zs(e)==="string"){let i=nn.registry[e.toLowerCase()];if(!i)throw new TypeError(`No color space found with id = "${e}"`);return i}if(t.length)return nn.get(...t);throw new TypeError(`${e} is not a valid color space`)}static resolveCoord(e,t){var r;let i=zs(e),o,a;if(i==="string"?e.includes(".")?[o,a]=e.split("."):[o,a]=[,e]:Array.isArray(e)?[o,a]=e:(o=e.space,a=e.coordId),o=nn.get(o),o||(o=t),!o)throw new TypeError(`Cannot resolve coordinate reference ${e}: No color space specified and relative references are not allowed here`);if(i=zs(a),i==="number"||i==="string"&&a>=0){let h=Object.entries(o.coords)[a];if(h)return{space:o,id:h[0],index:a,...h[1]}}o=nn.get(o);let c=a.toLowerCase(),f=0;for(let h in o.coords){let m=o.coords[h];if(h.toLowerCase()===c||((r=m.name)==null?void 0:r.toLowerCase())===c)return{space:o,id:h,index:f,...m};f++}throw new TypeError(`No "${a}" coordinate found in ${o.name}. Its coordinates are: ${Object.keys(o.coords).join(", ")}`)}};Hn(Zf,"registry",{}),Hn(Zf,"DEFAULT_FORMAT",{type:"functions",name:"color"});let re=Zf;function RA(n){let e=[n];for(let t=n;t=t.base;)e.push(t);return e}function E1(n,{coords:e}={}){if(n.coords&&!n.coordGrammar){n.type||(n.type="function"),n.name||(n.name="color"),n.coordGrammar=CA(n.coords);let t=Object.entries(e).map(([r,i],o)=>{let a=n.coordGrammar[o][0],c=i.range||i.refRange,f=a.range,h="";return a=="<percentage>"?(f=[0,100],h="%"):a=="<angle>"&&(h="deg"),{fromRange:c,toRange:f,suffix:h}});n.serializeCoords=(r,i)=>r.map((o,a)=>{let{fromRange:c,toRange:f,suffix:h}=t[a];return c&&f&&(o=v1(c,f,o)),o=qf(o,{precision:i,unit:h}),o})}return n}const Un=new re({id:"xyz-d65",name:"XYZ D65",coords:{x:{name:"X"},y:{name:"Y"},z:{name:"Z"}},white:"D65",formats:{color:{ids:["xyz-d65","xyz"]}},aliases:["xyz"]});class k1 extends re{constructor(e){e.coords||(e.coords={r:{range:[0,1],name:"Red"},g:{range:[0,1],name:"Green"},b:{range:[0,1],name:"Blue"}}),e.base||(e.base=Un),e.toXYZ_M&&e.fromXYZ_M&&(e.toBase??(e.toBase=t=>{let r=Be(e.toXYZ_M,t);return this.white!==this.base.white&&(r=va(this.white,this.base.white,r)),r}),e.fromBase??(e.fromBase=t=>(t=va(this.base.white,this.white,t),Be(e.fromXYZ_M,t)))),e.referred??(e.referred="display"),super(e)}}function Qf(n,e){return n=Ve(n),!e||n.space.equals(e)?n.coords.slice():(e=re.get(e),e.from(n))}function Vn(n,e){n=Ve(n);let{space:t,index:r}=re.resolveCoord(e,n.space);return Qf(n,t)[r]}function _1(n,e,t){return n=Ve(n),e=re.get(e),n.coords=e.to(n.space,t),n}_1.returns="color";function eh(n,e,t){if(n=Ve(n),arguments.length===2&&zs(arguments[1])==="object"){let r=arguments[1];for(let i in r)eh(n,i,r[i])}else{typeof t=="function"&&(t=t(Vn(n,e)));let{space:r,index:i}=re.resolveCoord(e,n.space),o=Qf(n,r);o[i]=t,_1(n,r,o)}return n}eh.returns="color";const LA=new re({id:"xyz-d50",name:"XYZ D50",white:"D50",base:Un,fromBase:n=>va(Un.white,"D50",n),toBase:n=>va("D50",Un.white,n)}),PA=216/24389,T1=24/116,wa=24389/27;let th=Wn.D50;const Kn=new re({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:th,base:LA,fromBase(n){let t=n.map((r,i)=>r/th[i]).map(r=>r>PA?Math.cbrt(r):(wa*r+16)/116);return[116*t[1]-16,500*(t[0]-t[1]),200*(t[1]-t[2])]},toBase(n){let e=[];return e[1]=(n[0]+16)/116,e[0]=n[1]/500+e[1],e[2]=e[1]-n[2]/200,[e[0]>T1?Math.pow(e[0],3):(116*e[0]-16)/wa,n[0]>8?Math.pow((n[0]+16)/116,3):n[0]/wa,e[2]>T1?Math.pow(e[2],3):(116*e[2]-16)/wa].map((r,i)=>r*th[i])},formats:{lab:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function xr(n){return(n%360+360)%360}const Sa=new re({id:"lch",name:"LCH",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,150],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:Kn,fromBase(n){let[e,t,r]=n,i;const o=.02;return Math.abs(t)<o&&Math.abs(r)<o?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),xr(i)]},toBase(n){let[e,t,r]=n;return t<0&&(t=0),isNaN(r)&&(r=0),[e,t*Math.cos(r*Math.PI/180),t*Math.sin(r*Math.PI/180)]},formats:{lch:{coords:["<number> | <percentage>","<number> | <percentage>","<number> | <angle>"]}}}),C1=25**7,xa=Math.PI,M1=180/xa,Ri=xa/180;function A1(n){const e=n*n;return e*e*e*n}function I1(n,e,{kL:t=1,kC:r=1,kH:i=1}={}){[n,e]=Ve([n,e]);let[o,a,c]=Kn.from(n),f=Sa.from(Kn,[o,a,c])[1],[h,m,p]=Kn.from(e),g=Sa.from(Kn,[h,m,p])[1];f<0&&(f=0),g<0&&(g=0);let b=(f+g)/2,S=A1(b),E=.5*(1-Math.sqrt(S/(S+C1))),C=(1+E)*a,M=(1+E)*m,P=Math.sqrt(C**2+c**2),F=Math.sqrt(M**2+p**2),$=C===0&&c===0?0:Math.atan2(c,C),U=M===0&&p===0?0:Math.atan2(p,M);$<0&&($+=2*xa),U<0&&(U+=2*xa),$*=M1,U*=M1;let ue=h-o,he=F-P,be=U-$,yt=$+U,Jn=Math.abs(be),sn;P*F===0?sn=0:Jn<=180?sn=be:be>180?sn=be-360:be<-180?sn=be+360:Fs.warn("the unthinkable has happened");let qn=2*Math.sqrt(F*P)*Math.sin(sn*Ri/2),Zr=(o+h)/2,on=(P+F)/2,vn=A1(on),Fe;P*F===0?Fe=yt:Jn<=180?Fe=yt/2:yt<360?Fe=(yt+360)/2:Fe=(yt-360)/2;let bt=(Zr-50)**2,jn=1+.015*bt/Math.sqrt(20+bt),Js=1+.045*on,ln=1;ln-=.17*Math.cos((Fe-30)*Ri),ln+=.24*Math.cos(2*Fe*Ri),ln+=.32*Math.cos((3*Fe+6)*Ri),ln-=.2*Math.cos((4*Fe-63)*Ri);let vt=1+.015*on*ln,Ra=30*Math.exp(-1*((Fe-275)/25)**2),La=2*Math.sqrt(vn/(vn+C1)),Pa=-1*Math.sin(2*Ra*Ri)*La,Gt=(ue/(t*jn))**2;return Gt+=(he/(r*Js))**2,Gt+=(qn/(i*vt))**2,Gt+=Pa*(he/(r*Js))*(qn/(i*vt)),Math.sqrt(Gt)}const DA=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],BA=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],zA=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],FA=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],Hs=new re({id:"oklab",name:"Oklab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:Un,fromBase(n){let t=Be(DA,n).map(r=>Math.cbrt(r));return Be(zA,t)},toBase(n){let t=Be(FA,n).map(r=>r**3);return Be(BA,t)},formats:{oklab:{coords:["<percentage> | <number>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function nh(n,e){[n,e]=Ve([n,e]);let[t,r,i]=Hs.from(n),[o,a,c]=Hs.from(e),f=t-o,h=r-a,m=i-c;return Math.sqrt(f**2+h**2+m**2)}const HA=75e-6;function Li(n,e,{epsilon:t=HA}={}){n=Ve(n),e||(e=n.space),e=re.get(e);let r=n.coords;return e!==n.space&&(r=e.from(n)),e.inGamut(r,{epsilon:t})}function rh(n){return{space:n.space,coords:n.coords.slice(),alpha:n.alpha}}function $A(n,e,t="lab"){t=re.get(t);let r=t.from(n),i=t.from(e);return Math.sqrt(r.reduce((o,a,c)=>{let f=i[c];return isNaN(a)||isNaN(f)?o:o+(f-a)**2},0))}function WA(n,e){return $A(n,e,"lab")}const UA=Math.PI,O1=UA/180;function VA(n,e,{l:t=2,c:r=1}={}){[n,e]=Ve([n,e]);let[i,o,a]=Kn.from(n),[,c,f]=Sa.from(Kn,[i,o,a]),[h,m,p]=Kn.from(e),g=Sa.from(Kn,[h,m,p])[1];c<0&&(c=0),g<0&&(g=0);let b=i-h,S=c-g,E=o-m,C=a-p,M=E**2+C**2-S**2,P=.511;i>=16&&(P=.040975*i/(1+.01765*i));let F=.0638*c/(1+.0131*c)+.638,$;Number.isNaN(f)&&(f=0),f>=164&&f<=345?$=.56+Math.abs(.2*Math.cos((f+168)*O1)):$=.36+Math.abs(.4*Math.cos((f+35)*O1));let U=Math.pow(c,4),ue=Math.sqrt(U/(U+1900)),he=F*(ue*$+1-ue),be=(b/(t*P))**2;return be+=(S/(r*F))**2,be+=M/he**2,Math.sqrt(be)}const N1=203,R1=new re({id:"xyz-abs-d65",cssId:"--xyz-abs-d65",name:"Absolute XYZ D65",coords:{x:{refRange:[0,9504.7],name:"Xa"},y:{refRange:[0,1e4],name:"Ya"},z:{refRange:[0,10888.3],name:"Za"}},base:Un,fromBase(n){return n.map(e=>Math.max(e*N1,0))},toBase(n){return n.map(e=>Math.max(e/N1,0))}}),Ea=1.15,ka=.66,L1=2610/2**14,KA=2**14/2610,P1=3424/2**12,D1=2413/2**7,B1=2392/2**7,GA=1.7*2523/2**5,z1=2**5/(1.7*2523),_a=-.56,ih=16295499532821565e-27,JA=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],qA=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],jA=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],YA=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]],XA=new re({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:R1,fromBase(n){let[e,t,r]=n,i=Ea*e-(Ea-1)*r,o=ka*t-(ka-1)*e,c=Be(JA,[i,o,r]).map(function(g){let b=P1+D1*(g/1e4)**L1,S=1+B1*(g/1e4)**L1;return(b/S)**GA}),[f,h,m]=Be(jA,c);return[(1+_a)*f/(1+_a*f)-ih,h,m]},toBase(n){let[e,t,r]=n,i=(e+ih)/(1+_a-_a*(e+ih)),a=Be(YA,[i,t,r]).map(function(g){let b=P1-g**z1,S=B1*g**z1-D1;return 1e4*(b/S)**KA}),[c,f,h]=Be(qA,a),m=(c+(Ea-1)*h)/Ea,p=(f+(ka-1)*m)/ka;return[m,p,h]},formats:{color:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}}),F1=new re({id:"jzczhz",name:"JzCzHz",coords:{jz:{refRange:[0,1],name:"Jz"},cz:{refRange:[0,1],name:"Chroma"},hz:{refRange:[0,360],type:"angle",name:"Hue"}},base:XA,fromBase(n){let[e,t,r]=n,i;const o=2e-4;return Math.abs(t)<o&&Math.abs(r)<o?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),xr(i)]},toBase(n){return[n[0],n[1]*Math.cos(n[2]*Math.PI/180),n[1]*Math.sin(n[2]*Math.PI/180)]}});function ZA(n,e){[n,e]=Ve([n,e]);let[t,r,i]=F1.from(n),[o,a,c]=F1.from(e),f=t-o,h=r-a;Number.isNaN(i)&&Number.isNaN(c)?(i=0,c=0):Number.isNaN(i)?i=c:Number.isNaN(c)&&(c=i);let m=i-c,p=2*Math.sqrt(r*a)*Math.sin(m/2*(Math.PI/180));return Math.sqrt(f**2+h**2+p**2)}const H1=3424/4096,$1=2413/128,W1=2392/128,U1=2610/16384,QA=2523/32,eI=16384/2610,V1=32/2523,tI=[[.3592832590121217,.6976051147779502,-.035891593232029],[-.1920808463704993,1.100476797037432,.0753748658519118],[.0070797844607479,.0748396662186362,.8433265453898765]],nI=[[2048/4096,2048/4096,0],[6610/4096,-13613/4096,7003/4096],[17933/4096,-17390/4096,-543/4096]],rI=[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],iI=[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]],K1=new re({id:"ictcp",name:"ICTCP",coords:{i:{refRange:[0,1],name:"I"},ct:{refRange:[-.5,.5],name:"CT"},cp:{refRange:[-.5,.5],name:"CP"}},base:R1,fromBase(n){let e=Be(tI,n);return sI(e)},toBase(n){let e=oI(n);return Be(iI,e)}});function sI(n){let e=n.map(function(t){let r=H1+$1*(t/1e4)**U1,i=1+W1*(t/1e4)**U1;return(r/i)**QA});return Be(nI,e)}function oI(n){return Be(rI,n).map(function(r){let i=Math.max(r**V1-H1,0),o=$1-W1*r**V1;return 1e4*(i/o)**eI})}function lI(n,e){[n,e]=Ve([n,e]);let[t,r,i]=K1.from(n),[o,a,c]=K1.from(e);return 720*Math.sqrt((t-o)**2+.25*(r-a)**2+(i-c)**2)}const aI=Wn.D65,G1=.42,J1=1/G1,sh=2*Math.PI,q1=[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],cI=[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],uI=[[460,451,288],[460,-891,-261],[460,-220,-6300]],fI={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},qr={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},hI=180/Math.PI,j1=Math.PI/180;function Y1(n,e){return n.map(r=>{const i=$n(e*Math.abs(r)*.01,G1);return 400*Yf(i,r)/(i+27.13)})}function dI(n,e){const t=100/e*27.13**J1;return n.map(r=>{const i=Math.abs(r);return Yf(t*$n(i/(400-i),J1),r)})}function pI(n){let e=xr(n);e<=qr.h[0]&&(e+=360);const t=AA(qr.h,e)-1,[r,i]=qr.h.slice(t,t+2),[o,a]=qr.e.slice(t,t+2),c=qr.H[t],f=(e-r)/o;return c+100*f/(f+(i-e)/a)}function mI(n){let e=(n%400+400)%400;const t=Math.floor(.01*e);e=e%100;const[r,i]=qr.h.slice(t,t+2),[o,a]=qr.e.slice(t,t+2);return xr((e*(a*r-o*i)-100*r*a)/(e*(a-o)-100*a))}function X1(n,e,t,r,i){const o={};o.discounting=i,o.refWhite=n,o.surround=r;const a=n.map(E=>E*100);o.la=e,o.yb=t;const c=a[1],f=Be(q1,a);r=fI[o.surround];const h=r[0];o.c=r[1],o.nc=r[2];const p=(1/(5*o.la+1))**4;o.fl=p*o.la+.1*(1-p)*(1-p)*Math.cbrt(5*o.la),o.flRoot=o.fl**.25,o.n=o.yb/c,o.z=1.48+Math.sqrt(o.n),o.nbb=.725*o.n**-.2,o.ncb=o.nbb;const g=Math.max(Math.min(h*(1-1/3.6*Math.exp((-o.la-42)/92)),1),0);o.dRgb=f.map(E=>b1(1,c/E,g)),o.dRgbInv=o.dRgb.map(E=>1/E);const b=f.map((E,C)=>E*o.dRgb[C]),S=Y1(b,o.fl);return o.aW=o.nbb*(2*S[0]+S[1]+.05*S[2]),o}const Z1=X1(aI,64/Math.PI*.2,20,"average",!1);function oh(n,e){if(!(n.J!==void 0^n.Q!==void 0))throw new Error("Conversion requires one and only one: 'J' or 'Q'");if(!(n.C!==void 0^n.M!==void 0^n.s!==void 0))throw new Error("Conversion requires one and only one: 'C', 'M' or 's'");if(!(n.h!==void 0^n.H!==void 0))throw new Error("Conversion requires one and only one: 'h' or 'H'");if(n.J===0||n.Q===0)return[0,0,0];let t=0;n.h!==void 0?t=xr(n.h)*j1:t=mI(n.H)*j1;const r=Math.cos(t),i=Math.sin(t);let o=0;n.J!==void 0?o=$n(n.J,1/2)*.1:n.Q!==void 0&&(o=.25*e.c*n.Q/((e.aW+4)*e.flRoot));let a=0;n.C!==void 0?a=n.C/o:n.M!==void 0?a=n.M/e.flRoot/o:n.s!==void 0&&(a=4e-4*n.s**2*(e.aW+4)/e.c);const c=$n(a*Math.pow(1.64-Math.pow(.29,e.n),-.73),10/9),f=.25*(Math.cos(t+2)+3.8),h=e.aW*$n(o,2/e.c/e.z),m=5e4/13*e.nc*e.ncb*f,p=h/e.nbb,g=23*(p+.305)*w1(c,23*m+c*(11*r+108*i)),b=g*r,S=g*i,E=dI(Be(uI,[p,b,S]).map(C=>C*1/1403),e.fl);return Be(cI,E.map((C,M)=>C*e.dRgbInv[M])).map(C=>C/100)}function Q1(n,e){const t=n.map(F=>F*100),r=Y1(Be(q1,t).map((F,$)=>F*e.dRgb[$]),e.fl),i=r[0]+(-12*r[1]+r[2])/11,o=(r[0]+r[1]-2*r[2])/9,a=(Math.atan2(o,i)%sh+sh)%sh,c=.25*(Math.cos(a+2)+3.8),f=5e4/13*e.nc*e.ncb*w1(c*Math.sqrt(i**2+o**2),r[0]+r[1]+1.05*r[2]+.305),h=$n(f,.9)*Math.pow(1.64-Math.pow(.29,e.n),.73),m=e.nbb*(2*r[0]+r[1]+.05*r[2]),p=$n(m/e.aW,.5*e.c*e.z),g=100*$n(p,2),b=4/e.c*p*(e.aW+4)*e.flRoot,S=h*p,E=S*e.flRoot,C=xr(a*hI),M=pI(C),P=50*$n(e.c*h/(e.aW+4),1/2);return{J:g,C:S,h:C,s:P,Q:b,M:E,H:M}}new re({id:"cam16-jmh",cssId:"--cam16-jmh",name:"CAM16-JMh",coords:{j:{refRange:[0,100],name:"J"},m:{refRange:[0,105],name:"Colorfulness"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:Un,fromBase(n){const e=Q1(n,Z1);return[e.J,e.M,e.h]},toBase(n){return oh({J:n[0],M:n[1],h:n[2]},Z1)}});const gI=Wn.D65,yI=216/24389,ey=24389/27;function bI(n){return 116*(n>yI?Math.cbrt(n):(ey*n+16)/116)-16}function lh(n){return n>8?Math.pow((n+16)/116,3):n/ey}function vI(n,e){let[t,r,i]=n,o=[],a=0;if(i===0)return[0,0,0];let c=lh(i);i>0?a=.00379058511492914*i**2+.608983189401032*i+.9155088574762233:a=9514440756550361e-21*i**2+.08693057439788597*i-21.928975842194614;const f=2e-12,h=15;let m=0,p=1/0;for(;m<=h;){o=oh({J:a,C:r,h:t},e);const g=Math.abs(o[1]-c);if(g<p){if(g<=f)return o;p=g}a=a-(o[1]-c)*a/(2*o[1]),m+=1}return oh({J:a,C:r,h:t},e)}function wI(n,e){const t=bI(n[1]);if(t===0)return[0,0,0];const r=Q1(n,ah);return[xr(r.h),r.C,t]}const ah=X1(gI,200/Math.PI*lh(50),lh(50)*100,"average",!1),Ta=new re({id:"hct",name:"HCT",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},c:{refRange:[0,145],name:"Colorfulness"},t:{refRange:[0,100],name:"Tone"}},base:Un,fromBase(n){return wI(n)},toBase(n){return vI(n,ah)},formats:{color:{id:"--hct",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),SI=Math.PI/180,ty=[1,.007,.0228];function ny(n){n[1]<0&&(n=Ta.fromBase(Ta.toBase(n)));const e=Math.log(Math.max(1+ty[2]*n[1]*ah.flRoot,1))/ty[2],t=n[0]*SI,r=e*Math.cos(t),i=e*Math.sin(t);return[n[2],r,i]}function xI(n,e){[n,e]=Ve([n,e]);let[t,r,i]=ny(Ta.from(n)),[o,a,c]=ny(Ta.from(e));return Math.sqrt((t-o)**2+(r-a)**2+(i-c)**2)}const ry={deltaE76:WA,deltaECMC:VA,deltaE2000:I1,deltaEJz:ZA,deltaEITP:lI,deltaEOK:nh,deltaEHCT:xI};function EI(n){const e=n?Math.floor(Math.log10(Math.abs(n))):0;return Math.max(parseFloat(`1e${e-2}`),1e-6)}const iy={hct:{method:"hct.c",jnd:2,deltaEMethod:"hct",blackWhiteClamp:{}},"hct-tonal":{method:"hct.c",jnd:0,deltaEMethod:"hct",blackWhiteClamp:{channel:"hct.t",min:0,max:100}}};function $s(n,{method:e=Fs.gamut_mapping,space:t=void 0,deltaEMethod:r="",jnd:i=2,blackWhiteClamp:o={}}={}){if(n=Ve(n),y1(arguments[1])?t=arguments[1]:t||(t=n.space),t=re.get(t),Li(n,t,{epsilon:0}))return n;let a;if(e==="css")a=kI(n,{space:t});else{if(e!=="clip"&&!Li(n,t)){Object.prototype.hasOwnProperty.call(iy,e)&&({method:e,jnd:i,deltaEMethod:r,blackWhiteClamp:o}=iy[e]);let c=I1;if(r!==""){for(let h in ry)if("deltae"+r.toLowerCase()===h.toLowerCase()){c=ry[h];break}}let f=$s(ze(n,t),{method:"clip",space:t});if(c(n,f)>i){if(Object.keys(o).length===3){let P=re.resolveCoord(o.channel),F=Vn(ze(n,P.space),P.id);if(jf(F)&&(F=0),F>=o.max)return ze({space:"xyz-d65",coords:Wn.D65},n.space);if(F<=o.min)return ze({space:"xyz-d65",coords:[0,0,0]},n.space)}let h=re.resolveCoord(e),m=h.space,p=h.id,g=ze(n,m);g.coords.forEach((P,F)=>{jf(P)&&(g.coords[F]=0)});let S=(h.range||h.refRange)[0],E=EI(i),C=S,M=Vn(g,p);for(;M-C>E;){let P=rh(g);P=$s(P,{space:t,method:"clip"}),c(g,P)-i<E?C=Vn(g,p):M=Vn(g,p),eh(g,p,(C+M)/2)}a=ze(g,t)}else a=f}else a=ze(n,t);if(e==="clip"||!Li(a,t,{epsilon:0})){let c=Object.values(t.coords).map(f=>f.range||[]);a.coords=a.coords.map((f,h)=>{let[m,p]=c[h];return m!==void 0&&(f=Math.max(m,f)),p!==void 0&&(f=Math.min(f,p)),f})}}return t!==n.space&&(a=ze(a,n.space)),n.coords=a.coords,n}$s.returns="color";const sy={WHITE:{space:Hs,coords:[1,0,0]},BLACK:{space:Hs,coords:[0,0,0]}};function kI(n,{space:e}={}){n=Ve(n),e||(e=n.space),e=re.get(e);const i=re.get("oklch");if(e.isUnbounded)return ze(n,e);const o=ze(n,i);let a=o.coords[0];if(a>=1){const S=ze(sy.WHITE,e);return S.alpha=n.alpha,ze(S,e)}if(a<=0){const S=ze(sy.BLACK,e);return S.alpha=n.alpha,ze(S,e)}if(Li(o,e,{epsilon:0}))return ze(o,e);function c(S){const E=ze(S,e),C=Object.values(e.coords);return E.coords=E.coords.map((M,P)=>{if("range"in C[P]){const[F,$]=C[P].range;return MA(F,M,$)}return M}),E}let f=0,h=o.coords[1],m=!0,p=rh(o),g=c(p),b=nh(g,p);if(b<.02)return g;for(;h-f>1e-4;){const S=(f+h)/2;if(p.coords[1]=S,m&&Li(p,e,{epsilon:0}))f=S;else if(g=c(p),b=nh(g,p),b<.02){if(.02-b<1e-4)break;m=!1,f=S}else h=S}return g}function ze(n,e,{inGamut:t}={}){n=Ve(n),e=re.get(e);let r=e.from(n),i={space:e,coords:r,alpha:n.alpha};return t&&(i=$s(i,t===!0?void 0:t)),i}ze.returns="color";function _I(n,{precision:e=Fs.precision,format:t="default",inGamut:r=!0,...i}={}){var o;let a;n=Ve(n);let c=t;t=n.space.getFormat(t)??n.space.getFormat("default")??re.DEFAULT_FORMAT;let f=n.coords.slice();if(r||(r=t.toGamut),r&&!Li(n)&&(f=$s(rh(n),r===!0?void 0:r).coords),t.type==="custom")if(i.precision=e,t.serialize)a=t.serialize(f,n.alpha,i);else throw new TypeError(`format ${c} can only be used to parse colors, not for serialization`);else{let h=t.name||"color";t.serializeCoords?f=t.serializeCoords(f,e):e!==null&&(f=f.map(b=>qf(b,{precision:e})));let m=[...f];if(h==="color"){let b=t.id||((o=t.ids)==null?void 0:o[0])||n.space.id;m.unshift(b)}let p=n.alpha;e!==null&&(p=qf(p,{precision:e}));let g=n.alpha>=1||t.noAlpha?"":`${t.commas?",":" /"} ${p}`;a=`${h}(${m.join(t.commas?", ":" ")}${g})`}return a}const TI=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],CI=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],MI=new k1({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:TI,fromXYZ_M:CI}),oy={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[153/255,50/255,204/255],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,153/255],lightslategrey:[119/255,136/255,153/255],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[102/255,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,204/255],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[102/255,51/255,153/255],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]};let ly=Array(3).fill("<percentage> | <number>[0, 255]"),ay=Array(3).fill("<number>[0, 255]");const cy=new k1({id:"srgb",name:"sRGB",base:MI,fromBase:n=>n.map(e=>{let t=e<0?-1:1,r=e*t;return r>.0031308?t*(1.055*r**(1/2.4)-.055):12.92*e}),toBase:n=>n.map(e=>{let t=e<0?-1:1,r=e*t;return r<=.04045?e/12.92:t*((r+.055)/1.055)**2.4}),formats:{rgb:{coords:ly},rgb_number:{name:"rgb",commas:!0,coords:ay,noAlpha:!0},color:{},rgba:{coords:ly,commas:!0,lastAlpha:!0},rgba_number:{name:"rgba",commas:!0,coords:ay},hex:{type:"custom",toGamut:!0,test:n=>/^#([a-f0-9]{3,4}){1,2}$/i.test(n),parse(n){n.length<=5&&(n=n.replace(/[a-f0-9]/gi,"$&$&"));let e=[];return n.replace(/[a-f0-9]{2}/gi,t=>{e.push(parseInt(t,16)/255)}),{spaceId:"srgb",coords:e.slice(0,3),alpha:e.slice(3)[0]}},serialize:(n,e,{collapse:t=!0}={})=>{e<1&&n.push(e),n=n.map(o=>Math.round(o*255));let r=t&&n.every(o=>o%17===0);return"#"+n.map(o=>r?(o/17).toString(16):o.toString(16).padStart(2,"0")).join("")}},keyword:{type:"custom",test:n=>/^[a-z]+$/i.test(n),parse(n){n=n.toLowerCase();let e={spaceId:"srgb",coords:null,alpha:1};if(n==="transparent"?(e.coords=oy.black,e.alpha=0):e.coords=oy[n],e.coords)return e}}}});function AI(n){return Vn(n,[Un,"y"])}const uy=new re({id:"hsl",name:"HSL",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:cy,fromBase:n=>{let e=Math.max(...n),t=Math.min(...n),[r,i,o]=n,[a,c,f]=[NaN,0,(t+e)/2],h=e-t;if(h!==0){switch(c=f===0||f===1?0:(e-f)/Math.min(f,1-f),e){case r:a=(i-o)/h+(i<o?6:0);break;case i:a=(o-r)/h+2;break;case o:a=(r-i)/h+4}a=a*60}return c<0&&(a+=180,c=Math.abs(c)),a>=360&&(a-=360),[a,c*100,f*100]},toBase:n=>{let[e,t,r]=n;e=e%360,e<0&&(e+=360),t/=100,r/=100;function i(o){let a=(o+e/30)%12,c=t*Math.min(r,1-r);return r-c*Math.max(-1,Math.min(a-3,9-a,1))}return[i(0),i(8),i(4)]},formats:{hsl:{coords:["<number> | <angle>","<percentage>","<percentage>"]},hsla:{coords:["<number> | <angle>","<percentage>","<percentage>"],commas:!0,lastAlpha:!0}}}),II=new re({id:"hsv",name:"HSV",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},v:{range:[0,100],name:"Value"}},base:uy,fromBase(n){let[e,t,r]=n;t/=100,r/=100;let i=r+t*Math.min(r,1-r);return[e,i===0?0:200*(1-r/i),100*i]},toBase(n){let[e,t,r]=n;t/=100,r/=100;let i=r*(1-t/2);return[e,i===0||i===1?0:(r-i)/Math.min(i,1-i)*100,i*100]},formats:{color:{id:"--hsv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),OI=new re({id:"oklch",name:"Oklch",coords:{l:{refRange:[0,1],name:"Lightness"},c:{refRange:[0,.4],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},white:"D65",base:Hs,fromBase(n){let[e,t,r]=n,i;const o=2e-4;return Math.abs(t)<o&&Math.abs(r)<o?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),xr(i)]},toBase(n){let[e,t,r]=n,i,o;return isNaN(r)?(i=0,o=0):(i=t*Math.cos(r*Math.PI/180),o=t*Math.sin(r*Math.PI/180)),[e,i,o]},formats:{oklch:{coords:["<percentage> | <number>","<number> | <percentage>[0,1]","<number> | <angle>"]}}});class Ot{constructor(e){Hn(this,"data"),this.data=ze(e,"srgb")}static fromTransparent(){return new Ot({spaceId:"srgb",coords:[1,1,1],alpha:0})}static fromBlack(){return new Ot({spaceId:"srgb",coords:[0,0,0],alpha:1})}static fromWhite(){return new Ot({spaceId:"srgb",coords:[1,1,1],alpha:1})}get r(){return Math.round(this.data.coords[0]*255)}get g(){return Math.round(this.data.coords[1]*255)}get b(){return Math.round(this.data.coords[2]*255)}get h(){return Vn(this.data,"hsv.h")}get s(){return Vn(this.data,"hsv.s")}get v(){return Vn(this.data,"hsv.v")}get alpha(){return this.data.alpha.valueOf()}get alphaPercent(){return Math.round(this.alpha*100)}get isTransparent(){return this.alpha===0}get isDark(){return AI(this.data)<.5}withAlpha(e){return new Ot({...this.data,alpha:e})}withRgb(e){const t=this.alpha===0?1:this.alpha;return new Ot({spaceId:"srgb",alpha:e.a??t,coords:[e.r?e.r/255:this.data.coords[0],e.g?e.g/255:this.data.coords[1],e.b?e.b/255:this.data.coords[2]]})}withHsv(e){const r=Qf(this.data,"hsv"),i=Math.max(e.s??r[1],1e-5),o=Math.max(e.v??r[2],1e-5),a=this.alpha===0?1:this.alpha;return new Ot({alpha:a,spaceId:"hsv",coords:[e.h??r[0],i,o]})}toString(){return this.alpha===1?this.toHexString():this.toRgbaString()}toHexString(){const e=_I(this.data,{format:"hex"}).toUpperCase();return e.length===4?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:e.slice(0,7)}toRgbaString(){return`rgba(${this.r}, ${this.g}, ${this.b}, ${this.alphaPercent}%)`}clone(){return new Ot(this.data)}}class NI{constructor(e){Hn(this,"_color"),Hn(this,"isEmpty",!1),this.update(e)}get color(){return this._color}setColor(e){this._color=e}setEmpty(e){this.isEmpty=e}toString(){return this.isEmpty?"":this.color.toString()}isEqual(e){return this.toString()===e}update({solidColor:e,isEmpty:t}){this.setColor(e),this.setEmpty(t)}}let fy=999;function RI(){return fy+=1,fy}function LI(n){return n?n.startsWith("linear-gradient("):!1}function PI(){const n=Ot.fromTransparent();return{isEmpty:!0,isGradient:!1,solidColor:n,angle:0,transitions:[{color:n.clone(),offset:0},{color:n.clone(),offset:100}]}}re.register(cy),re.register(II),re.register(uy),re.register(OI);function hy(n){if(!n)return Ot.fromTransparent();try{return new Ot(ze(x1(n),"srgb"))}catch(e){return console.warn(e),Ot.fromBlack()}}function DI(n){const e={"to top":0,"to top right":45,"to right":90,"to bottom right":135,"to bottom":180,"to bottom left":225,"to left":270,"to top left":315};return e[n]?e[n]:n.includes("deg")?Number.parseInt(n.trim().replace("deg","")):0}function BI(n){return n.map(e=>{const[t,r]=e.trim().split(/\s+(?![^(]*\))/);return{color:hy(t),offset:Number.parseFloat(r.replace("%",""))}})}function zI(n){const e=n.indexOf("("),t=n.lastIndexOf(")"),[r,...i]=n.slice(e+1,t).split(/,(?![^(]*\))/),o=BI(i),a=DI(r);return{isEmpty:!1,isGradient:!0,solidColor:o[0].color,angle:a,transitions:o}}function FI(n){const e=hy(n),t=Ot.fromWhite();return{isEmpty:!1,isGradient:!1,solidColor:e,angle:0,transitions:[{color:t,offset:0},{color:e.withAlpha(1),offset:100}]}}function HI(n,e=!0){if(!n)return PI();const t=LI(n)?zI(n):FI(n);return t.isGradient&&!e?{...t,isGradient:!1}:t}class mh{constructor(e,t=0){Hn(this,"id"),this.color=e,this.offset=t,this.id=RI()}setOffset(e){this.offset=e}toString(){return`${this.color.toString()} ${this.offset}%`}clone(e){return new mh(this.color.clone(),e)}}class $I{constructor(e){Hn(this,"isEmpty",!1),Hn(this,"_angle",0),Hn(this,"_transitions",[]),this.update(e)}get transitions(){return this._transitions}get canAddTransition(){return this.transitions.length<5}get canRemoveTransition(){return this.transitions.length>2}get angle(){return this._angle}setAngle(e){this._angle=e}setEmpty(e){this.isEmpty=e}addTransition(e){this.transitions.push(e),this.sortTransitions()}removeTransition(e){this._transitions=this.transitions.filter(({id:t})=>t!==e.id)}sortTransitions(){this._transitions=this.transitions.sort((e,t)=>e.offset-t.offset)}toString(e){if(this.isEmpty)return"";const t=this.transitions.map(r=>r.toString());return`linear-gradient(${e??this.angle}deg, ${t.join(", ")})`}isEqual(e){return this.toString()===e}update(e){this._angle=e.angle,this._transitions=e.transitions.map(({color:t,offset:r})=>new mh(t,r)),this.setEmpty(e.isEmpty)}hasTransition(e){return this.transitions.some(t=>t.id===e.id)}}function WI(n){const e=HI(n);return(e.isGradient?new $I(e):new NI(e)).toString()}function dy(n){return WI(n)}function py(n,e){if(!n.includes("em"))return parseInt(n);const t=Pi.getComputedStyle(e).fontSize,r=parseFloat(n)*parseFloat(t);return Math.round(r)}function UI(n,e){return(n.firstElementChild||n).style.fontSize||Pi.getComputedStyle(e).fontSize}function VI(n,e,t){if(!n.includes("px"))return n;const r=UI(e,t),i=py(r,t);return i?(parseInt(n)/i).toFixed(2):null}const KI={start:br.LEFT,end:br.RIGHT};function GI(n){const e=KI[n]||n;return jM.includes(e)?e:null}const my=(n,e,t,r)=>({from:Math.max(r,n.pos),to:Math.min(r+t.nodeSize,e.pos)});function gy(n,e){return n.resolve(e).depth+1}function JI(n,e,t,r){const i=gy(n,r),o=e.from-i<=r,a=e.to+i>=t.nodeSize+r;return o&&a}const qI=(n,e)=>n.eq(e);function jI(n,e,t,r=qI){const i=n.resolve(e).path.slice().reverse();for(const o of i)if(typeof o!="number"){for(const a of o.marks)if(r(a,t))return!0}return!1}function YI(n,e){const t=typeof e=="string"?e:e.name;return n.find(r=>r.type.name===t)}var Ca=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ws={exports:{}};var XI=Ws.exports,yy;function ZI(){return yy||(yy=1,function(n,e){(function(){var t,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",c="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",h=500,m="__lodash_placeholder__",p=1,g=2,b=4,S=1,E=2,C=1,M=2,P=4,F=8,$=16,U=32,ue=64,he=128,be=256,yt=512,Jn=30,sn="...",qn=800,Zr=16,on=1,vn=2,Fe=3,bt=1/0,jn=9007199254740991,Js=17976931348623157e292,ln=NaN,vt=4294967295,Ra=vt-1,La=vt>>>1,Pa=[["ary",he],["bind",C],["bindKey",M],["curry",F],["curryRight",$],["flip",yt],["partial",U],["partialRight",ue],["rearg",be]],Gt="[object Arguments]",qs="[object Array]",_y="[object AsyncFunction]",Hi="[object Boolean]",$i="[object Date]",Ty="[object DOMException]",js="[object Error]",Ys="[object Function]",bh="[object GeneratorFunction]",Jt="[object Map]",Wi="[object Number]",Cy="[object Null]",wn="[object Object]",vh="[object Promise]",My="[object Proxy]",Ui="[object RegExp]",qt="[object Set]",Vi="[object String]",Xs="[object Symbol]",Ay="[object Undefined]",Ki="[object WeakMap]",Iy="[object WeakSet]",Gi="[object ArrayBuffer]",Qr="[object DataView]",Da="[object Float32Array]",Ba="[object Float64Array]",za="[object Int8Array]",Fa="[object Int16Array]",Ha="[object Int32Array]",$a="[object Uint8Array]",Wa="[object Uint8ClampedArray]",Ua="[object Uint16Array]",Va="[object Uint32Array]",Oy=/\b__p \+= '';/g,Ny=/\b(__p \+=) '' \+/g,Ry=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wh=/&(?:amp|lt|gt|quot|#39);/g,Sh=/[&<>"']/g,Ly=RegExp(wh.source),Py=RegExp(Sh.source),Dy=/<%-([\s\S]+?)%>/g,By=/<%([\s\S]+?)%>/g,xh=/<%=([\s\S]+?)%>/g,zy=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fy=/^\w*$/,Hy=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ka=/[\\^$.*+?()[\]{}|]/g,$y=RegExp(Ka.source),Ga=/^\s+/,Wy=/\s/,Uy=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Vy=/\{\n\/\* \[wrapped with (.+)\] \*/,Ky=/,? & /,Gy=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Jy=/[()=,{}\[\]\/\s]/,qy=/\\(\\)?/g,jy=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Eh=/\w*$/,Yy=/^[-+]0x[0-9a-f]+$/i,Xy=/^0b[01]+$/i,Zy=/^\[object .+?Constructor\]$/,Qy=/^0o[0-7]+$/i,e2=/^(?:0|[1-9]\d*)$/,t2=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zs=/($^)/,n2=/['\n\r\u2028\u2029\\]/g,Qs="\\ud800-\\udfff",r2="\\u0300-\\u036f",i2="\\ufe20-\\ufe2f",s2="\\u20d0-\\u20ff",kh=r2+i2+s2,_h="\\u2700-\\u27bf",Th="a-z\\xdf-\\xf6\\xf8-\\xff",o2="\\xac\\xb1\\xd7\\xf7",l2="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",a2="\\u2000-\\u206f",c2=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ch="A-Z\\xc0-\\xd6\\xd8-\\xde",Mh="\\ufe0e\\ufe0f",Ah=o2+l2+a2+c2,Ja="['\u2019]",u2="["+Qs+"]",Ih="["+Ah+"]",eo="["+kh+"]",Oh="\\d+",f2="["+_h+"]",Nh="["+Th+"]",Rh="[^"+Qs+Ah+Oh+_h+Th+Ch+"]",qa="\\ud83c[\\udffb-\\udfff]",h2="(?:"+eo+"|"+qa+")",Lh="[^"+Qs+"]",ja="(?:\\ud83c[\\udde6-\\uddff]){2}",Ya="[\\ud800-\\udbff][\\udc00-\\udfff]",ei="["+Ch+"]",Ph="\\u200d",Dh="(?:"+Nh+"|"+Rh+")",d2="(?:"+ei+"|"+Rh+")",Bh="(?:"+Ja+"(?:d|ll|m|re|s|t|ve))?",zh="(?:"+Ja+"(?:D|LL|M|RE|S|T|VE))?",Fh=h2+"?",Hh="["+Mh+"]?",p2="(?:"+Ph+"(?:"+[Lh,ja,Ya].join("|")+")"+Hh+Fh+")*",m2="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",g2="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",$h=Hh+Fh+p2,y2="(?:"+[f2,ja,Ya].join("|")+")"+$h,b2="(?:"+[Lh+eo+"?",eo,ja,Ya,u2].join("|")+")",v2=RegExp(Ja,"g"),w2=RegExp(eo,"g"),Xa=RegExp(qa+"(?="+qa+")|"+b2+$h,"g"),S2=RegExp([ei+"?"+Nh+"+"+Bh+"(?="+[Ih,ei,"$"].join("|")+")",d2+"+"+zh+"(?="+[Ih,ei+Dh,"$"].join("|")+")",ei+"?"+Dh+"+"+Bh,ei+"+"+zh,g2,m2,Oh,y2].join("|"),"g"),x2=RegExp("["+Ph+Qs+kh+Mh+"]"),E2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,k2=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],_2=-1,xe={};xe[Da]=xe[Ba]=xe[za]=xe[Fa]=xe[Ha]=xe[$a]=xe[Wa]=xe[Ua]=xe[Va]=!0,xe[Gt]=xe[qs]=xe[Gi]=xe[Hi]=xe[Qr]=xe[$i]=xe[js]=xe[Ys]=xe[Jt]=xe[Wi]=xe[wn]=xe[Ui]=xe[qt]=xe[Vi]=xe[Ki]=!1;var Se={};Se[Gt]=Se[qs]=Se[Gi]=Se[Qr]=Se[Hi]=Se[$i]=Se[Da]=Se[Ba]=Se[za]=Se[Fa]=Se[Ha]=Se[Jt]=Se[Wi]=Se[wn]=Se[Ui]=Se[qt]=Se[Vi]=Se[Xs]=Se[$a]=Se[Wa]=Se[Ua]=Se[Va]=!0,Se[js]=Se[Ys]=Se[Ki]=!1;var T2={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},C2={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},M2={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},A2={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},I2=parseFloat,O2=parseInt,Wh=typeof Ca=="object"&&Ca&&Ca.Object===Object&&Ca,N2=typeof self=="object"&&self&&self.Object===Object&&self,qe=Wh||N2||Function("return this")(),Za=e&&!e.nodeType&&e,Tr=Za&&!0&&n&&!n.nodeType&&n,Uh=Tr&&Tr.exports===Za,Qa=Uh&&Wh.process,Nt=function(){try{var _=Tr&&Tr.require&&Tr.require("util").types;return _||Qa&&Qa.binding&&Qa.binding("util")}catch{}}(),Vh=Nt&&Nt.isArrayBuffer,Kh=Nt&&Nt.isDate,Gh=Nt&&Nt.isMap,Jh=Nt&&Nt.isRegExp,qh=Nt&&Nt.isSet,jh=Nt&&Nt.isTypedArray;function wt(_,I,A){switch(A.length){case 0:return _.call(I);case 1:return _.call(I,A[0]);case 2:return _.call(I,A[0],A[1]);case 3:return _.call(I,A[0],A[1],A[2])}return _.apply(I,A)}function R2(_,I,A,V){for(var X=-1,me=_==null?0:_.length;++X<me;){var Pe=_[X];I(V,Pe,A(Pe),_)}return V}function Rt(_,I){for(var A=-1,V=_==null?0:_.length;++A<V&&I(_[A],A,_)!==!1;);return _}function L2(_,I){for(var A=_==null?0:_.length;A--&&I(_[A],A,_)!==!1;);return _}function Yh(_,I){for(var A=-1,V=_==null?0:_.length;++A<V;)if(!I(_[A],A,_))return!1;return!0}function Yn(_,I){for(var A=-1,V=_==null?0:_.length,X=0,me=[];++A<V;){var Pe=_[A];I(Pe,A,_)&&(me[X++]=Pe)}return me}function to(_,I){var A=_==null?0:_.length;return!!A&&ti(_,I,0)>-1}function ec(_,I,A){for(var V=-1,X=_==null?0:_.length;++V<X;)if(A(I,_[V]))return!0;return!1}function ke(_,I){for(var A=-1,V=_==null?0:_.length,X=Array(V);++A<V;)X[A]=I(_[A],A,_);return X}function Xn(_,I){for(var A=-1,V=I.length,X=_.length;++A<V;)_[X+A]=I[A];return _}function tc(_,I,A,V){var X=-1,me=_==null?0:_.length;for(V&&me&&(A=_[++X]);++X<me;)A=I(A,_[X],X,_);return A}function P2(_,I,A,V){var X=_==null?0:_.length;for(V&&X&&(A=_[--X]);X--;)A=I(A,_[X],X,_);return A}function nc(_,I){for(var A=-1,V=_==null?0:_.length;++A<V;)if(I(_[A],A,_))return!0;return!1}var D2=rc("length");function B2(_){return _.split("")}function z2(_){return _.match(Gy)||[]}function Xh(_,I,A){var V;return A(_,function(X,me,Pe){if(I(X,me,Pe))return V=me,!1}),V}function no(_,I,A,V){for(var X=_.length,me=A+(V?1:-1);V?me--:++me<X;)if(I(_[me],me,_))return me;return-1}function ti(_,I,A){return I===I?Y2(_,I,A):no(_,Zh,A)}function F2(_,I,A,V){for(var X=A-1,me=_.length;++X<me;)if(V(_[X],I))return X;return-1}function Zh(_){return _!==_}function Qh(_,I){var A=_==null?0:_.length;return A?sc(_,I)/A:ln}function rc(_){return function(I){return I==null?t:I[_]}}function ic(_){return function(I){return _==null?t:_[I]}}function ed(_,I,A,V,X){return X(_,function(me,Pe,we){A=V?(V=!1,me):I(A,me,Pe,we)}),A}function H2(_,I){var A=_.length;for(_.sort(I);A--;)_[A]=_[A].value;return _}function sc(_,I){for(var A,V=-1,X=_.length;++V<X;){var me=I(_[V]);me!==t&&(A=A===t?me:A+me)}return A}function oc(_,I){for(var A=-1,V=Array(_);++A<_;)V[A]=I(A);return V}function $2(_,I){return ke(I,function(A){return[A,_[A]]})}function td(_){return _&&_.slice(0,sd(_)+1).replace(Ga,"")}function St(_){return function(I){return _(I)}}function lc(_,I){return ke(I,function(A){return _[A]})}function Ji(_,I){return _.has(I)}function nd(_,I){for(var A=-1,V=_.length;++A<V&&ti(I,_[A],0)>-1;);return A}function rd(_,I){for(var A=_.length;A--&&ti(I,_[A],0)>-1;);return A}function W2(_,I){for(var A=_.length,V=0;A--;)_[A]===I&&++V;return V}var U2=ic(T2),V2=ic(C2);function K2(_){return"\\"+A2[_]}function G2(_,I){return _==null?t:_[I]}function ni(_){return x2.test(_)}function J2(_){return E2.test(_)}function q2(_){for(var I,A=[];!(I=_.next()).done;)A.push(I.value);return A}function ac(_){var I=-1,A=Array(_.size);return _.forEach(function(V,X){A[++I]=[X,V]}),A}function id(_,I){return function(A){return _(I(A))}}function Zn(_,I){for(var A=-1,V=_.length,X=0,me=[];++A<V;){var Pe=_[A];(Pe===I||Pe===m)&&(_[A]=m,me[X++]=A)}return me}function ro(_){var I=-1,A=Array(_.size);return _.forEach(function(V){A[++I]=V}),A}function j2(_){var I=-1,A=Array(_.size);return _.forEach(function(V){A[++I]=[V,V]}),A}function Y2(_,I,A){for(var V=A-1,X=_.length;++V<X;)if(_[V]===I)return V;return-1}function X2(_,I,A){for(var V=A+1;V--;)if(_[V]===I)return V;return V}function ri(_){return ni(_)?Q2(_):D2(_)}function jt(_){return ni(_)?eb(_):B2(_)}function sd(_){for(var I=_.length;I--&&Wy.test(_.charAt(I)););return I}var Z2=ic(M2);function Q2(_){for(var I=Xa.lastIndex=0;Xa.test(_);)++I;return I}function eb(_){return _.match(Xa)||[]}function tb(_){return _.match(S2)||[]}var nb=function _(I){I=I==null?qe:ii.defaults(qe.Object(),I,ii.pick(qe,k2));var A=I.Array,V=I.Date,X=I.Error,me=I.Function,Pe=I.Math,we=I.Object,cc=I.RegExp,rb=I.String,Lt=I.TypeError,io=A.prototype,ib=me.prototype,si=we.prototype,so=I["__core-js_shared__"],oo=ib.toString,ve=si.hasOwnProperty,sb=0,od=function(){var s=/[^.]+$/.exec(so&&so.keys&&so.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),lo=si.toString,ob=oo.call(we),lb=qe._,ab=cc("^"+oo.call(ve).replace(Ka,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ao=Uh?I.Buffer:t,Qn=I.Symbol,co=I.Uint8Array,ld=ao?ao.allocUnsafe:t,uo=id(we.getPrototypeOf,we),ad=we.create,cd=si.propertyIsEnumerable,fo=io.splice,ud=Qn?Qn.isConcatSpreadable:t,qi=Qn?Qn.iterator:t,Cr=Qn?Qn.toStringTag:t,ho=function(){try{var s=Nr(we,"defineProperty");return s({},"",{}),s}catch{}}(),cb=I.clearTimeout!==qe.clearTimeout&&I.clearTimeout,ub=V&&V.now!==qe.Date.now&&V.now,fb=I.setTimeout!==qe.setTimeout&&I.setTimeout,po=Pe.ceil,mo=Pe.floor,uc=we.getOwnPropertySymbols,hb=ao?ao.isBuffer:t,fd=I.isFinite,db=io.join,pb=id(we.keys,we),De=Pe.max,Qe=Pe.min,mb=V.now,gb=I.parseInt,hd=Pe.random,yb=io.reverse,fc=Nr(I,"DataView"),ji=Nr(I,"Map"),hc=Nr(I,"Promise"),oi=Nr(I,"Set"),Yi=Nr(I,"WeakMap"),Xi=Nr(we,"create"),go=Yi&&new Yi,li={},bb=Rr(fc),vb=Rr(ji),wb=Rr(hc),Sb=Rr(oi),xb=Rr(Yi),yo=Qn?Qn.prototype:t,Zi=yo?yo.valueOf:t,dd=yo?yo.toString:t;function v(s){if(Me(s)&&!Z(s)&&!(s instanceof oe)){if(s instanceof Pt)return s;if(ve.call(s,"__wrapped__"))return pp(s)}return new Pt(s)}var ai=function(){function s(){}return function(l){if(!Ce(l))return{};if(ad)return ad(l);s.prototype=l;var u=new s;return s.prototype=t,u}}();function bo(){}function Pt(s,l){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}v.templateSettings={escape:Dy,evaluate:By,interpolate:xh,variable:"",imports:{_:v}},v.prototype=bo.prototype,v.prototype.constructor=v,Pt.prototype=ai(bo.prototype),Pt.prototype.constructor=Pt;function oe(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=vt,this.__views__=[]}function Eb(){var s=new oe(this.__wrapped__);return s.__actions__=ct(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=ct(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=ct(this.__views__),s}function kb(){if(this.__filtered__){var s=new oe(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function _b(){var s=this.__wrapped__.value(),l=this.__dir__,u=Z(s),d=l<0,y=u?s.length:0,w=Bv(0,y,this.__views__),x=w.start,k=w.end,T=k-x,O=d?k:x-1,N=this.__iteratees__,R=N.length,H=0,G=Qe(T,this.__takeCount__);if(!u||!d&&y==T&&G==T)return Bd(s,this.__actions__);var q=[];e:for(;T--&&H<G;){O+=l;for(var ee=-1,j=s[O];++ee<R;){var se=N[ee],fe=se.iteratee,kt=se.type,rt=fe(j);if(kt==vn)j=rt;else if(!rt){if(kt==on)continue e;break e}}q[H++]=j}return q}oe.prototype=ai(bo.prototype),oe.prototype.constructor=oe;function Mr(s){var l=-1,u=s==null?0:s.length;for(this.clear();++l<u;){var d=s[l];this.set(d[0],d[1])}}function Tb(){this.__data__=Xi?Xi(null):{},this.size=0}function Cb(s){var l=this.has(s)&&delete this.__data__[s];return this.size-=l?1:0,l}function Mb(s){var l=this.__data__;if(Xi){var u=l[s];return u===f?t:u}return ve.call(l,s)?l[s]:t}function Ab(s){var l=this.__data__;return Xi?l[s]!==t:ve.call(l,s)}function Ib(s,l){var u=this.__data__;return this.size+=this.has(s)?0:1,u[s]=Xi&&l===t?f:l,this}Mr.prototype.clear=Tb,Mr.prototype.delete=Cb,Mr.prototype.get=Mb,Mr.prototype.has=Ab,Mr.prototype.set=Ib;function Sn(s){var l=-1,u=s==null?0:s.length;for(this.clear();++l<u;){var d=s[l];this.set(d[0],d[1])}}function Ob(){this.__data__=[],this.size=0}function Nb(s){var l=this.__data__,u=vo(l,s);if(u<0)return!1;var d=l.length-1;return u==d?l.pop():fo.call(l,u,1),--this.size,!0}function Rb(s){var l=this.__data__,u=vo(l,s);return u<0?t:l[u][1]}function Lb(s){return vo(this.__data__,s)>-1}function Pb(s,l){var u=this.__data__,d=vo(u,s);return d<0?(++this.size,u.push([s,l])):u[d][1]=l,this}Sn.prototype.clear=Ob,Sn.prototype.delete=Nb,Sn.prototype.get=Rb,Sn.prototype.has=Lb,Sn.prototype.set=Pb;function xn(s){var l=-1,u=s==null?0:s.length;for(this.clear();++l<u;){var d=s[l];this.set(d[0],d[1])}}function Db(){this.size=0,this.__data__={hash:new Mr,map:new(ji||Sn),string:new Mr}}function Bb(s){var l=Oo(this,s).delete(s);return this.size-=l?1:0,l}function zb(s){return Oo(this,s).get(s)}function Fb(s){return Oo(this,s).has(s)}function Hb(s,l){var u=Oo(this,s),d=u.size;return u.set(s,l),this.size+=u.size==d?0:1,this}xn.prototype.clear=Db,xn.prototype.delete=Bb,xn.prototype.get=zb,xn.prototype.has=Fb,xn.prototype.set=Hb;function Ar(s){var l=-1,u=s==null?0:s.length;for(this.__data__=new xn;++l<u;)this.add(s[l])}function $b(s){return this.__data__.set(s,f),this}function Wb(s){return this.__data__.has(s)}Ar.prototype.add=Ar.prototype.push=$b,Ar.prototype.has=Wb;function Yt(s){var l=this.__data__=new Sn(s);this.size=l.size}function Ub(){this.__data__=new Sn,this.size=0}function Vb(s){var l=this.__data__,u=l.delete(s);return this.size=l.size,u}function Kb(s){return this.__data__.get(s)}function Gb(s){return this.__data__.has(s)}function Jb(s,l){var u=this.__data__;if(u instanceof Sn){var d=u.__data__;if(!ji||d.length<i-1)return d.push([s,l]),this.size=++u.size,this;u=this.__data__=new xn(d)}return u.set(s,l),this.size=u.size,this}Yt.prototype.clear=Ub,Yt.prototype.delete=Vb,Yt.prototype.get=Kb,Yt.prototype.has=Gb,Yt.prototype.set=Jb;function pd(s,l){var u=Z(s),d=!u&&Lr(s),y=!u&&!d&&ir(s),w=!u&&!d&&!y&&hi(s),x=u||d||y||w,k=x?oc(s.length,rb):[],T=k.length;for(var O in s)(l||ve.call(s,O))&&!(x&&(O=="length"||y&&(O=="offset"||O=="parent")||w&&(O=="buffer"||O=="byteLength"||O=="byteOffset")||Tn(O,T)))&&k.push(O);return k}function md(s){var l=s.length;return l?s[Ec(0,l-1)]:t}function qb(s,l){return No(ct(s),Ir(l,0,s.length))}function jb(s){return No(ct(s))}function dc(s,l,u){(u!==t&&!Xt(s[l],u)||u===t&&!(l in s))&&En(s,l,u)}function Qi(s,l,u){var d=s[l];(!(ve.call(s,l)&&Xt(d,u))||u===t&&!(l in s))&&En(s,l,u)}function vo(s,l){for(var u=s.length;u--;)if(Xt(s[u][0],l))return u;return-1}function Yb(s,l,u,d){return er(s,function(y,w,x){l(d,y,u(y),x)}),d}function gd(s,l){return s&&cn(l,He(l),s)}function Xb(s,l){return s&&cn(l,ft(l),s)}function En(s,l,u){l=="__proto__"&&ho?ho(s,l,{configurable:!0,enumerable:!0,value:u,writable:!0}):s[l]=u}function pc(s,l){for(var u=-1,d=l.length,y=A(d),w=s==null;++u<d;)y[u]=w?t:qc(s,l[u]);return y}function Ir(s,l,u){return s===s&&(u!==t&&(s=s<=u?s:u),l!==t&&(s=s>=l?s:l)),s}function Dt(s,l,u,d,y,w){var x,k=l&p,T=l&g,O=l&b;if(u&&(x=y?u(s,d,y,w):u(s)),x!==t)return x;if(!Ce(s))return s;var N=Z(s);if(N){if(x=Fv(s),!k)return ct(s,x)}else{var R=et(s),H=R==Ys||R==bh;if(ir(s))return Hd(s,k);if(R==wn||R==Gt||H&&!y){if(x=T||H?{}:sp(s),!k)return T?Mv(s,Xb(x,s)):Cv(s,gd(x,s))}else{if(!Se[R])return y?s:{};x=Hv(s,R,k)}}w||(w=new Yt);var G=w.get(s);if(G)return G;w.set(s,x),Lp(s)?s.forEach(function(j){x.add(Dt(j,l,u,j,s,w))}):Np(s)&&s.forEach(function(j,se){x.set(se,Dt(j,l,u,se,s,w))});var q=O?T?Lc:Rc:T?ft:He,ee=N?t:q(s);return Rt(ee||s,function(j,se){ee&&(se=j,j=s[se]),Qi(x,se,Dt(j,l,u,se,s,w))}),x}function Zb(s){var l=He(s);return function(u){return yd(u,s,l)}}function yd(s,l,u){var d=u.length;if(s==null)return!d;for(s=we(s);d--;){var y=u[d],w=l[y],x=s[y];if(x===t&&!(y in s)||!w(x))return!1}return!0}function bd(s,l,u){if(typeof s!="function")throw new Lt(a);return ls(function(){s.apply(t,u)},l)}function es(s,l,u,d){var y=-1,w=to,x=!0,k=s.length,T=[],O=l.length;if(!k)return T;u&&(l=ke(l,St(u))),d?(w=ec,x=!1):l.length>=i&&(w=Ji,x=!1,l=new Ar(l));e:for(;++y<k;){var N=s[y],R=u==null?N:u(N);if(N=d||N!==0?N:0,x&&R===R){for(var H=O;H--;)if(l[H]===R)continue e;T.push(N)}else w(l,R,d)||T.push(N)}return T}var er=Kd(an),vd=Kd(gc,!0);function Qb(s,l){var u=!0;return er(s,function(d,y,w){return u=!!l(d,y,w),u}),u}function wo(s,l,u){for(var d=-1,y=s.length;++d<y;){var w=s[d],x=l(w);if(x!=null&&(k===t?x===x&&!Et(x):u(x,k)))var k=x,T=w}return T}function ev(s,l,u,d){var y=s.length;for(u=Q(u),u<0&&(u=-u>y?0:y+u),d=d===t||d>y?y:Q(d),d<0&&(d+=y),d=u>d?0:Dp(d);u<d;)s[u++]=l;return s}function wd(s,l){var u=[];return er(s,function(d,y,w){l(d,y,w)&&u.push(d)}),u}function je(s,l,u,d,y){var w=-1,x=s.length;for(u||(u=Wv),y||(y=[]);++w<x;){var k=s[w];l>0&&u(k)?l>1?je(k,l-1,u,d,y):Xn(y,k):d||(y[y.length]=k)}return y}var mc=Gd(),Sd=Gd(!0);function an(s,l){return s&&mc(s,l,He)}function gc(s,l){return s&&Sd(s,l,He)}function So(s,l){return Yn(l,function(u){return Cn(s[u])})}function Or(s,l){l=nr(l,s);for(var u=0,d=l.length;s!=null&&u<d;)s=s[un(l[u++])];return u&&u==d?s:t}function xd(s,l,u){var d=l(s);return Z(s)?d:Xn(d,u(s))}function tt(s){return s==null?s===t?Ay:Cy:Cr&&Cr in we(s)?Dv(s):jv(s)}function yc(s,l){return s>l}function tv(s,l){return s!=null&&ve.call(s,l)}function nv(s,l){return s!=null&&l in we(s)}function rv(s,l,u){return s>=Qe(l,u)&&s<De(l,u)}function bc(s,l,u){for(var d=u?ec:to,y=s[0].length,w=s.length,x=w,k=A(w),T=1/0,O=[];x--;){var N=s[x];x&&l&&(N=ke(N,St(l))),T=Qe(N.length,T),k[x]=!u&&(l||y>=120&&N.length>=120)?new Ar(x&&N):t}N=s[0];var R=-1,H=k[0];e:for(;++R<y&&O.length<T;){var G=N[R],q=l?l(G):G;if(G=u||G!==0?G:0,!(H?Ji(H,q):d(O,q,u))){for(x=w;--x;){var ee=k[x];if(!(ee?Ji(ee,q):d(s[x],q,u)))continue e}H&&H.push(q),O.push(G)}}return O}function iv(s,l,u,d){return an(s,function(y,w,x){l(d,u(y),w,x)}),d}function ts(s,l,u){l=nr(l,s),s=cp(s,l);var d=s==null?s:s[un(zt(l))];return d==null?t:wt(d,s,u)}function Ed(s){return Me(s)&&tt(s)==Gt}function sv(s){return Me(s)&&tt(s)==Gi}function ov(s){return Me(s)&&tt(s)==$i}function ns(s,l,u,d,y){return s===l?!0:s==null||l==null||!Me(s)&&!Me(l)?s!==s&&l!==l:lv(s,l,u,d,ns,y)}function lv(s,l,u,d,y,w){var x=Z(s),k=Z(l),T=x?qs:et(s),O=k?qs:et(l);T=T==Gt?wn:T,O=O==Gt?wn:O;var N=T==wn,R=O==wn,H=T==O;if(H&&ir(s)){if(!ir(l))return!1;x=!0,N=!1}if(H&&!N)return w||(w=new Yt),x||hi(s)?np(s,l,u,d,y,w):Lv(s,l,T,u,d,y,w);if(!(u&S)){var G=N&&ve.call(s,"__wrapped__"),q=R&&ve.call(l,"__wrapped__");if(G||q){var ee=G?s.value():s,j=q?l.value():l;return w||(w=new Yt),y(ee,j,u,d,w)}}return H?(w||(w=new Yt),Pv(s,l,u,d,y,w)):!1}function av(s){return Me(s)&&et(s)==Jt}function vc(s,l,u,d){var y=u.length,w=y,x=!d;if(s==null)return!w;for(s=we(s);y--;){var k=u[y];if(x&&k[2]?k[1]!==s[k[0]]:!(k[0]in s))return!1}for(;++y<w;){k=u[y];var T=k[0],O=s[T],N=k[1];if(x&&k[2]){if(O===t&&!(T in s))return!1}else{var R=new Yt;if(d)var H=d(O,N,T,s,l,R);if(!(H===t?ns(N,O,S|E,d,R):H))return!1}}return!0}function kd(s){if(!Ce(s)||Vv(s))return!1;var l=Cn(s)?ab:Zy;return l.test(Rr(s))}function cv(s){return Me(s)&&tt(s)==Ui}function uv(s){return Me(s)&&et(s)==qt}function fv(s){return Me(s)&&zo(s.length)&&!!xe[tt(s)]}function _d(s){return typeof s=="function"?s:s==null?ht:typeof s=="object"?Z(s)?Md(s[0],s[1]):Cd(s):Jp(s)}function wc(s){if(!ss(s))return pb(s);var l=[];for(var u in we(s))ve.call(s,u)&&u!="constructor"&&l.push(u);return l}function hv(s){if(!Ce(s))return qv(s);var l=ss(s),u=[];for(var d in s)d=="constructor"&&(l||!ve.call(s,d))||u.push(d);return u}function Sc(s,l){return s<l}function Td(s,l){var u=-1,d=ut(s)?A(s.length):[];return er(s,function(y,w,x){d[++u]=l(y,w,x)}),d}function Cd(s){var l=Dc(s);return l.length==1&&l[0][2]?lp(l[0][0],l[0][1]):function(u){return u===s||vc(u,s,l)}}function Md(s,l){return zc(s)&&op(l)?lp(un(s),l):function(u){var d=qc(u,s);return d===t&&d===l?jc(u,s):ns(l,d,S|E)}}function xo(s,l,u,d,y){s!==l&&mc(l,function(w,x){if(y||(y=new Yt),Ce(w))dv(s,l,x,u,xo,d,y);else{var k=d?d(Hc(s,x),w,x+"",s,l,y):t;k===t&&(k=w),dc(s,x,k)}},ft)}function dv(s,l,u,d,y,w,x){var k=Hc(s,u),T=Hc(l,u),O=x.get(T);if(O){dc(s,u,O);return}var N=w?w(k,T,u+"",s,l,x):t,R=N===t;if(R){var H=Z(T),G=!H&&ir(T),q=!H&&!G&&hi(T);N=T,H||G||q?Z(k)?N=k:Oe(k)?N=ct(k):G?(R=!1,N=Hd(T,!0)):q?(R=!1,N=$d(T,!0)):N=[]:as(T)||Lr(T)?(N=k,Lr(k)?N=Bp(k):(!Ce(k)||Cn(k))&&(N=sp(T))):R=!1}R&&(x.set(T,N),y(N,T,d,w,x),x.delete(T)),dc(s,u,N)}function Ad(s,l){var u=s.length;if(u)return l+=l<0?u:0,Tn(l,u)?s[l]:t}function Id(s,l,u){l.length?l=ke(l,function(w){return Z(w)?function(x){return Or(x,w.length===1?w[0]:w)}:w}):l=[ht];var d=-1;l=ke(l,St(J()));var y=Td(s,function(w,x,k){var T=ke(l,function(O){return O(w)});return{criteria:T,index:++d,value:w}});return H2(y,function(w,x){return Tv(w,x,u)})}function pv(s,l){return Od(s,l,function(u,d){return jc(s,d)})}function Od(s,l,u){for(var d=-1,y=l.length,w={};++d<y;){var x=l[d],k=Or(s,x);u(k,x)&&rs(w,nr(x,s),k)}return w}function mv(s){return function(l){return Or(l,s)}}function xc(s,l,u,d){var y=d?F2:ti,w=-1,x=l.length,k=s;for(s===l&&(l=ct(l)),u&&(k=ke(s,St(u)));++w<x;)for(var T=0,O=l[w],N=u?u(O):O;(T=y(k,N,T,d))>-1;)k!==s&&fo.call(k,T,1),fo.call(s,T,1);return s}function Nd(s,l){for(var u=s?l.length:0,d=u-1;u--;){var y=l[u];if(u==d||y!==w){var w=y;Tn(y)?fo.call(s,y,1):Tc(s,y)}}return s}function Ec(s,l){return s+mo(hd()*(l-s+1))}function gv(s,l,u,d){for(var y=-1,w=De(po((l-s)/(u||1)),0),x=A(w);w--;)x[d?w:++y]=s,s+=u;return x}function kc(s,l){var u="";if(!s||l<1||l>jn)return u;do l%2&&(u+=s),l=mo(l/2),l&&(s+=s);while(l);return u}function ie(s,l){return $c(ap(s,l,ht),s+"")}function yv(s){return md(di(s))}function bv(s,l){var u=di(s);return No(u,Ir(l,0,u.length))}function rs(s,l,u,d){if(!Ce(s))return s;l=nr(l,s);for(var y=-1,w=l.length,x=w-1,k=s;k!=null&&++y<w;){var T=un(l[y]),O=u;if(T==="__proto__"||T==="constructor"||T==="prototype")return s;if(y!=x){var N=k[T];O=d?d(N,T,k):t,O===t&&(O=Ce(N)?N:Tn(l[y+1])?[]:{})}Qi(k,T,O),k=k[T]}return s}var Rd=go?function(s,l){return go.set(s,l),s}:ht,vv=ho?function(s,l){return ho(s,"toString",{configurable:!0,enumerable:!1,value:Xc(l),writable:!0})}:ht;function wv(s){return No(di(s))}function Bt(s,l,u){var d=-1,y=s.length;l<0&&(l=-l>y?0:y+l),u=u>y?y:u,u<0&&(u+=y),y=l>u?0:u-l>>>0,l>>>=0;for(var w=A(y);++d<y;)w[d]=s[d+l];return w}function Sv(s,l){var u;return er(s,function(d,y,w){return u=l(d,y,w),!u}),!!u}function Eo(s,l,u){var d=0,y=s==null?d:s.length;if(typeof l=="number"&&l===l&&y<=La){for(;d<y;){var w=d+y>>>1,x=s[w];x!==null&&!Et(x)&&(u?x<=l:x<l)?d=w+1:y=w}return y}return _c(s,l,ht,u)}function _c(s,l,u,d){var y=0,w=s==null?0:s.length;if(w===0)return 0;l=u(l);for(var x=l!==l,k=l===null,T=Et(l),O=l===t;y<w;){var N=mo((y+w)/2),R=u(s[N]),H=R!==t,G=R===null,q=R===R,ee=Et(R);if(x)var j=d||q;else O?j=q&&(d||H):k?j=q&&H&&(d||!G):T?j=q&&H&&!G&&(d||!ee):G||ee?j=!1:j=d?R<=l:R<l;j?y=N+1:w=N}return Qe(w,Ra)}function Ld(s,l){for(var u=-1,d=s.length,y=0,w=[];++u<d;){var x=s[u],k=l?l(x):x;if(!u||!Xt(k,T)){var T=k;w[y++]=x===0?0:x}}return w}function Pd(s){return typeof s=="number"?s:Et(s)?ln:+s}function xt(s){if(typeof s=="string")return s;if(Z(s))return ke(s,xt)+"";if(Et(s))return dd?dd.call(s):"";var l=s+"";return l=="0"&&1/s==-1/0?"-0":l}function tr(s,l,u){var d=-1,y=to,w=s.length,x=!0,k=[],T=k;if(u)x=!1,y=ec;else if(w>=i){var O=l?null:Nv(s);if(O)return ro(O);x=!1,y=Ji,T=new Ar}else T=l?[]:k;e:for(;++d<w;){var N=s[d],R=l?l(N):N;if(N=u||N!==0?N:0,x&&R===R){for(var H=T.length;H--;)if(T[H]===R)continue e;l&&T.push(R),k.push(N)}else y(T,R,u)||(T!==k&&T.push(R),k.push(N))}return k}function Tc(s,l){return l=nr(l,s),s=cp(s,l),s==null||delete s[un(zt(l))]}function Dd(s,l,u,d){return rs(s,l,u(Or(s,l)),d)}function ko(s,l,u,d){for(var y=s.length,w=d?y:-1;(d?w--:++w<y)&&l(s[w],w,s););return u?Bt(s,d?0:w,d?w+1:y):Bt(s,d?w+1:0,d?y:w)}function Bd(s,l){var u=s;return u instanceof oe&&(u=u.value()),tc(l,function(d,y){return y.func.apply(y.thisArg,Xn([d],y.args))},u)}function Cc(s,l,u){var d=s.length;if(d<2)return d?tr(s[0]):[];for(var y=-1,w=A(d);++y<d;)for(var x=s[y],k=-1;++k<d;)k!=y&&(w[y]=es(w[y]||x,s[k],l,u));return tr(je(w,1),l,u)}function zd(s,l,u){for(var d=-1,y=s.length,w=l.length,x={};++d<y;){var k=d<w?l[d]:t;u(x,s[d],k)}return x}function Mc(s){return Oe(s)?s:[]}function Ac(s){return typeof s=="function"?s:ht}function nr(s,l){return Z(s)?s:zc(s,l)?[s]:dp(ge(s))}var xv=ie;function rr(s,l,u){var d=s.length;return u=u===t?d:u,!l&&u>=d?s:Bt(s,l,u)}var Fd=cb||function(s){return qe.clearTimeout(s)};function Hd(s,l){if(l)return s.slice();var u=s.length,d=ld?ld(u):new s.constructor(u);return s.copy(d),d}function Ic(s){var l=new s.constructor(s.byteLength);return new co(l).set(new co(s)),l}function Ev(s,l){var u=l?Ic(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.byteLength)}function kv(s){var l=new s.constructor(s.source,Eh.exec(s));return l.lastIndex=s.lastIndex,l}function _v(s){return Zi?we(Zi.call(s)):{}}function $d(s,l){var u=l?Ic(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.length)}function Wd(s,l){if(s!==l){var u=s!==t,d=s===null,y=s===s,w=Et(s),x=l!==t,k=l===null,T=l===l,O=Et(l);if(!k&&!O&&!w&&s>l||w&&x&&T&&!k&&!O||d&&x&&T||!u&&T||!y)return 1;if(!d&&!w&&!O&&s<l||O&&u&&y&&!d&&!w||k&&u&&y||!x&&y||!T)return-1}return 0}function Tv(s,l,u){for(var d=-1,y=s.criteria,w=l.criteria,x=y.length,k=u.length;++d<x;){var T=Wd(y[d],w[d]);if(T){if(d>=k)return T;var O=u[d];return T*(O=="desc"?-1:1)}}return s.index-l.index}function Ud(s,l,u,d){for(var y=-1,w=s.length,x=u.length,k=-1,T=l.length,O=De(w-x,0),N=A(T+O),R=!d;++k<T;)N[k]=l[k];for(;++y<x;)(R||y<w)&&(N[u[y]]=s[y]);for(;O--;)N[k++]=s[y++];return N}function Vd(s,l,u,d){for(var y=-1,w=s.length,x=-1,k=u.length,T=-1,O=l.length,N=De(w-k,0),R=A(N+O),H=!d;++y<N;)R[y]=s[y];for(var G=y;++T<O;)R[G+T]=l[T];for(;++x<k;)(H||y<w)&&(R[G+u[x]]=s[y++]);return R}function ct(s,l){var u=-1,d=s.length;for(l||(l=A(d));++u<d;)l[u]=s[u];return l}function cn(s,l,u,d){var y=!u;u||(u={});for(var w=-1,x=l.length;++w<x;){var k=l[w],T=d?d(u[k],s[k],k,u,s):t;T===t&&(T=s[k]),y?En(u,k,T):Qi(u,k,T)}return u}function Cv(s,l){return cn(s,Bc(s),l)}function Mv(s,l){return cn(s,rp(s),l)}function _o(s,l){return function(u,d){var y=Z(u)?R2:Yb,w=l?l():{};return y(u,s,J(d,2),w)}}function ci(s){return ie(function(l,u){var d=-1,y=u.length,w=y>1?u[y-1]:t,x=y>2?u[2]:t;for(w=s.length>3&&typeof w=="function"?(y--,w):t,x&&nt(u[0],u[1],x)&&(w=y<3?t:w,y=1),l=we(l);++d<y;){var k=u[d];k&&s(l,k,d,w)}return l})}function Kd(s,l){return function(u,d){if(u==null)return u;if(!ut(u))return s(u,d);for(var y=u.length,w=l?y:-1,x=we(u);(l?w--:++w<y)&&d(x[w],w,x)!==!1;);return u}}function Gd(s){return function(l,u,d){for(var y=-1,w=we(l),x=d(l),k=x.length;k--;){var T=x[s?k:++y];if(u(w[T],T,w)===!1)break}return l}}function Av(s,l,u){var d=l&C,y=is(s);function w(){var x=this&&this!==qe&&this instanceof w?y:s;return x.apply(d?u:this,arguments)}return w}function Jd(s){return function(l){l=ge(l);var u=ni(l)?jt(l):t,d=u?u[0]:l.charAt(0),y=u?rr(u,1).join(""):l.slice(1);return d[s]()+y}}function ui(s){return function(l){return tc(Kp(Vp(l).replace(v2,"")),s,"")}}function is(s){return function(){var l=arguments;switch(l.length){case 0:return new s;case 1:return new s(l[0]);case 2:return new s(l[0],l[1]);case 3:return new s(l[0],l[1],l[2]);case 4:return new s(l[0],l[1],l[2],l[3]);case 5:return new s(l[0],l[1],l[2],l[3],l[4]);case 6:return new s(l[0],l[1],l[2],l[3],l[4],l[5]);case 7:return new s(l[0],l[1],l[2],l[3],l[4],l[5],l[6])}var u=ai(s.prototype),d=s.apply(u,l);return Ce(d)?d:u}}function Iv(s,l,u){var d=is(s);function y(){for(var w=arguments.length,x=A(w),k=w,T=fi(y);k--;)x[k]=arguments[k];var O=w<3&&x[0]!==T&&x[w-1]!==T?[]:Zn(x,T);if(w-=O.length,w<u)return Zd(s,l,To,y.placeholder,t,x,O,t,t,u-w);var N=this&&this!==qe&&this instanceof y?d:s;return wt(N,this,x)}return y}function qd(s){return function(l,u,d){var y=we(l);if(!ut(l)){var w=J(u,3);l=He(l),u=function(k){return w(y[k],k,y)}}var x=s(l,u,d);return x>-1?y[w?l[x]:x]:t}}function jd(s){return _n(function(l){var u=l.length,d=u,y=Pt.prototype.thru;for(s&&l.reverse();d--;){var w=l[d];if(typeof w!="function")throw new Lt(a);if(y&&!x&&Io(w)=="wrapper")var x=new Pt([],!0)}for(d=x?d:u;++d<u;){w=l[d];var k=Io(w),T=k=="wrapper"?Pc(w):t;T&&Fc(T[0])&&T[1]==(he|F|U|be)&&!T[4].length&&T[9]==1?x=x[Io(T[0])].apply(x,T[3]):x=w.length==1&&Fc(w)?x[k]():x.thru(w)}return function(){var O=arguments,N=O[0];if(x&&O.length==1&&Z(N))return x.plant(N).value();for(var R=0,H=u?l[R].apply(this,O):N;++R<u;)H=l[R].call(this,H);return H}})}function To(s,l,u,d,y,w,x,k,T,O){var N=l&he,R=l&C,H=l&M,G=l&(F|$),q=l&yt,ee=H?t:is(s);function j(){for(var se=arguments.length,fe=A(se),kt=se;kt--;)fe[kt]=arguments[kt];if(G)var rt=fi(j),_t=W2(fe,rt);if(d&&(fe=Ud(fe,d,y,G)),w&&(fe=Vd(fe,w,x,G)),se-=_t,G&&se<O){var Ne=Zn(fe,rt);return Zd(s,l,To,j.placeholder,u,fe,Ne,k,T,O-se)}var Zt=R?u:this,An=H?Zt[s]:s;return se=fe.length,k?fe=Yv(fe,k):q&&se>1&&fe.reverse(),N&&T<se&&(fe.length=T),this&&this!==qe&&this instanceof j&&(An=ee||is(An)),An.apply(Zt,fe)}return j}function Yd(s,l){return function(u,d){return iv(u,s,l(d),{})}}function Co(s,l){return function(u,d){var y;if(u===t&&d===t)return l;if(u!==t&&(y=u),d!==t){if(y===t)return d;typeof u=="string"||typeof d=="string"?(u=xt(u),d=xt(d)):(u=Pd(u),d=Pd(d)),y=s(u,d)}return y}}function Oc(s){return _n(function(l){return l=ke(l,St(J())),ie(function(u){var d=this;return s(l,function(y){return wt(y,d,u)})})})}function Mo(s,l){l=l===t?" ":xt(l);var u=l.length;if(u<2)return u?kc(l,s):l;var d=kc(l,po(s/ri(l)));return ni(l)?rr(jt(d),0,s).join(""):d.slice(0,s)}function Ov(s,l,u,d){var y=l&C,w=is(s);function x(){for(var k=-1,T=arguments.length,O=-1,N=d.length,R=A(N+T),H=this&&this!==qe&&this instanceof x?w:s;++O<N;)R[O]=d[O];for(;T--;)R[O++]=arguments[++k];return wt(H,y?u:this,R)}return x}function Xd(s){return function(l,u,d){return d&&typeof d!="number"&&nt(l,u,d)&&(u=d=t),l=Mn(l),u===t?(u=l,l=0):u=Mn(u),d=d===t?l<u?1:-1:Mn(d),gv(l,u,d,s)}}function Ao(s){return function(l,u){return typeof l=="string"&&typeof u=="string"||(l=Ft(l),u=Ft(u)),s(l,u)}}function Zd(s,l,u,d,y,w,x,k,T,O){var N=l&F,R=N?x:t,H=N?t:x,G=N?w:t,q=N?t:w;l|=N?U:ue,l&=~(N?ue:U),l&P||(l&=-4);var ee=[s,l,y,G,R,q,H,k,T,O],j=u.apply(t,ee);return Fc(s)&&up(j,ee),j.placeholder=d,fp(j,s,l)}function Nc(s){var l=Pe[s];return function(u,d){if(u=Ft(u),d=d==null?0:Qe(Q(d),292),d&&fd(u)){var y=(ge(u)+"e").split("e"),w=l(y[0]+"e"+(+y[1]+d));return y=(ge(w)+"e").split("e"),+(y[0]+"e"+(+y[1]-d))}return l(u)}}var Nv=oi&&1/ro(new oi([,-0]))[1]==bt?function(s){return new oi(s)}:eu;function Qd(s){return function(l){var u=et(l);return u==Jt?ac(l):u==qt?j2(l):$2(l,s(l))}}function kn(s,l,u,d,y,w,x,k){var T=l&M;if(!T&&typeof s!="function")throw new Lt(a);var O=d?d.length:0;if(O||(l&=-97,d=y=t),x=x===t?x:De(Q(x),0),k=k===t?k:Q(k),O-=y?y.length:0,l&ue){var N=d,R=y;d=y=t}var H=T?t:Pc(s),G=[s,l,u,d,y,N,R,w,x,k];if(H&&Jv(G,H),s=G[0],l=G[1],u=G[2],d=G[3],y=G[4],k=G[9]=G[9]===t?T?0:s.length:De(G[9]-O,0),!k&&l&(F|$)&&(l&=-25),!l||l==C)var q=Av(s,l,u);else l==F||l==$?q=Iv(s,l,k):(l==U||l==(C|U))&&!y.length?q=Ov(s,l,u,d):q=To.apply(t,G);var ee=H?Rd:up;return fp(ee(q,G),s,l)}function ep(s,l,u,d){return s===t||Xt(s,si[u])&&!ve.call(d,u)?l:s}function tp(s,l,u,d,y,w){return Ce(s)&&Ce(l)&&(w.set(l,s),xo(s,l,t,tp,w),w.delete(l)),s}function Rv(s){return as(s)?t:s}function np(s,l,u,d,y,w){var x=u&S,k=s.length,T=l.length;if(k!=T&&!(x&&T>k))return!1;var O=w.get(s),N=w.get(l);if(O&&N)return O==l&&N==s;var R=-1,H=!0,G=u&E?new Ar:t;for(w.set(s,l),w.set(l,s);++R<k;){var q=s[R],ee=l[R];if(d)var j=x?d(ee,q,R,l,s,w):d(q,ee,R,s,l,w);if(j!==t){if(j)continue;H=!1;break}if(G){if(!nc(l,function(se,fe){if(!Ji(G,fe)&&(q===se||y(q,se,u,d,w)))return G.push(fe)})){H=!1;break}}else if(!(q===ee||y(q,ee,u,d,w))){H=!1;break}}return w.delete(s),w.delete(l),H}function Lv(s,l,u,d,y,w,x){switch(u){case Qr:if(s.byteLength!=l.byteLength||s.byteOffset!=l.byteOffset)return!1;s=s.buffer,l=l.buffer;case Gi:return!(s.byteLength!=l.byteLength||!w(new co(s),new co(l)));case Hi:case $i:case Wi:return Xt(+s,+l);case js:return s.name==l.name&&s.message==l.message;case Ui:case Vi:return s==l+"";case Jt:var k=ac;case qt:var T=d&S;if(k||(k=ro),s.size!=l.size&&!T)return!1;var O=x.get(s);if(O)return O==l;d|=E,x.set(s,l);var N=np(k(s),k(l),d,y,w,x);return x.delete(s),N;case Xs:if(Zi)return Zi.call(s)==Zi.call(l)}return!1}function Pv(s,l,u,d,y,w){var x=u&S,k=Rc(s),T=k.length,O=Rc(l),N=O.length;if(T!=N&&!x)return!1;for(var R=T;R--;){var H=k[R];if(!(x?H in l:ve.call(l,H)))return!1}var G=w.get(s),q=w.get(l);if(G&&q)return G==l&&q==s;var ee=!0;w.set(s,l),w.set(l,s);for(var j=x;++R<T;){H=k[R];var se=s[H],fe=l[H];if(d)var kt=x?d(fe,se,H,l,s,w):d(se,fe,H,s,l,w);if(!(kt===t?se===fe||y(se,fe,u,d,w):kt)){ee=!1;break}j||(j=H=="constructor")}if(ee&&!j){var rt=s.constructor,_t=l.constructor;rt!=_t&&"constructor"in s&&"constructor"in l&&!(typeof rt=="function"&&rt instanceof rt&&typeof _t=="function"&&_t instanceof _t)&&(ee=!1)}return w.delete(s),w.delete(l),ee}function _n(s){return $c(ap(s,t,yp),s+"")}function Rc(s){return xd(s,He,Bc)}function Lc(s){return xd(s,ft,rp)}var Pc=go?function(s){return go.get(s)}:eu;function Io(s){for(var l=s.name+"",u=li[l],d=ve.call(li,l)?u.length:0;d--;){var y=u[d],w=y.func;if(w==null||w==s)return y.name}return l}function fi(s){var l=ve.call(v,"placeholder")?v:s;return l.placeholder}function J(){var s=v.iteratee||Zc;return s=s===Zc?_d:s,arguments.length?s(arguments[0],arguments[1]):s}function Oo(s,l){var u=s.__data__;return Uv(l)?u[typeof l=="string"?"string":"hash"]:u.map}function Dc(s){for(var l=He(s),u=l.length;u--;){var d=l[u],y=s[d];l[u]=[d,y,op(y)]}return l}function Nr(s,l){var u=G2(s,l);return kd(u)?u:t}function Dv(s){var l=ve.call(s,Cr),u=s[Cr];try{s[Cr]=t;var d=!0}catch{}var y=lo.call(s);return d&&(l?s[Cr]=u:delete s[Cr]),y}var Bc=uc?function(s){return s==null?[]:(s=we(s),Yn(uc(s),function(l){return cd.call(s,l)}))}:tu,rp=uc?function(s){for(var l=[];s;)Xn(l,Bc(s)),s=uo(s);return l}:tu,et=tt;(fc&&et(new fc(new ArrayBuffer(1)))!=Qr||ji&&et(new ji)!=Jt||hc&&et(hc.resolve())!=vh||oi&&et(new oi)!=qt||Yi&&et(new Yi)!=Ki)&&(et=function(s){var l=tt(s),u=l==wn?s.constructor:t,d=u?Rr(u):"";if(d)switch(d){case bb:return Qr;case vb:return Jt;case wb:return vh;case Sb:return qt;case xb:return Ki}return l});function Bv(s,l,u){for(var d=-1,y=u.length;++d<y;){var w=u[d],x=w.size;switch(w.type){case"drop":s+=x;break;case"dropRight":l-=x;break;case"take":l=Qe(l,s+x);break;case"takeRight":s=De(s,l-x);break}}return{start:s,end:l}}function zv(s){var l=s.match(Vy);return l?l[1].split(Ky):[]}function ip(s,l,u){l=nr(l,s);for(var d=-1,y=l.length,w=!1;++d<y;){var x=un(l[d]);if(!(w=s!=null&&u(s,x)))break;s=s[x]}return w||++d!=y?w:(y=s==null?0:s.length,!!y&&zo(y)&&Tn(x,y)&&(Z(s)||Lr(s)))}function Fv(s){var l=s.length,u=new s.constructor(l);return l&&typeof s[0]=="string"&&ve.call(s,"index")&&(u.index=s.index,u.input=s.input),u}function sp(s){return typeof s.constructor=="function"&&!ss(s)?ai(uo(s)):{}}function Hv(s,l,u){var d=s.constructor;switch(l){case Gi:return Ic(s);case Hi:case $i:return new d(+s);case Qr:return Ev(s,u);case Da:case Ba:case za:case Fa:case Ha:case $a:case Wa:case Ua:case Va:return $d(s,u);case Jt:return new d;case Wi:case Vi:return new d(s);case Ui:return kv(s);case qt:return new d;case Xs:return _v(s)}}function $v(s,l){var u=l.length;if(!u)return s;var d=u-1;return l[d]=(u>1?"& ":"")+l[d],l=l.join(u>2?", ":" "),s.replace(Uy,`{
20
+ 3. "-" cannot repeat`);ke.customSchemes.push([n,e])}function yA(){ke.scanner=cA(ke.customSchemes);for(let n=0;n<ke.tokenQueue.length;n++)ke.tokenQueue[n][1]({scanner:ke.scanner});ke.parser=hA(ke.scanner.tokens);for(let n=0;n<ke.pluginQueue.length;n++)ke.pluginQueue[n][1]({scanner:ke.scanner,parser:ke.parser});return ke.initialized=!0,ke}function ga(n){return ke.initialized||yA(),dA(ke.parser.start,n,o1(ke.scanner.start,n))}ga.scan=o1;function d1(n,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const r=new Gf(t),i=ga(n),o=[];for(let a=0;a<i.length;a++){const c=i[a];c.isLink&&(!e||c.t===e)&&r.check(c)&&o.push(c.toFormattedObject(r))}return o}function bA(n,e=null){const t=ga(n);return t.length===1&&t[0].isLink&&(!e||t[0].t===e)}class vA extends _f{addProps(){return{handlePaste:this._handlePaste}}_handlePaste(e,t,r){if(e.state.selection.empty)return!1;const i=r.content.textBetween(0,r.content.size).trim(),o=bA(i);if(!i||!o)return!1;const a=this._createLinkAttrs(i,r.content);return this.editor.commands.applyLink(a),!0}_createLinkAttrs(e,t){return yh.query(t,{typeName:te.TEXT,mark:{typeName:Ee.LINK},getMark:{typeName:Ee.LINK}})?.attrs||{href:e}}}function z(n){return(...e)=>t=>n(t,...e)}function ya(n){const e=Object.entries(n).reduce((t,[r,i])=>{if(!i)return t;const o=r.replace(/_/g,"-");return`${t}--zw-${o}:${i};`},"");return e?{style:e}:null}function xr(n){const e=ya(n);return["span",e?{...e,class:"zw-style"}:{},0]}function wA(n){return n.toLowerCase().replace(/(?:^|\s)\S/g,e=>e.toUpperCase())}function Kt(n,...e){return({editor:t})=>(t.commands[n](...e),!0)}var SA=Object.defineProperty,xA=(n,e,t)=>e in n?SA(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Hn=(n,e,t)=>xA(n,typeof e!="symbol"?e+"":e,t),p1,m1,g1;function ze(n,e){let t=n.length;Array.isArray(n[0])||(n=[n]),Array.isArray(e[0])||(e=e.map(a=>[a]));let r=e[0].length,i=e[0].map((a,c)=>e.map(f=>f[c])),o=n.map(a=>i.map(c=>{let f=0;if(!Array.isArray(a)){for(let h of c)f+=a*h;return f}for(let h=0;h<a.length;h++)f+=a[h]*(c[h]||0);return f}));return t===1&&(o=o[0]),r===1?o.map(a=>a[0]):o}function y1(n){return Bs(n)==="string"}function Bs(n){return(Object.prototype.toString.call(n).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function qf(n,{precision:e,unit:t}){return jf(n)?"none":EA(n,e)+(t??"")}function jf(n){return Number.isNaN(n)||n instanceof Number&&n?.none}function EA(n,e){if(n===0)return 0;let t=~~n,r=0;t&&e&&(r=~~Math.log10(Math.abs(t))+1);const i=10**(e-r);return Math.floor(n*i+.5)/i}const kA={deg:1,grad:.9,rad:180/Math.PI,turn:360};function _A(n){if(!n)return;n=n.trim();const e=/^([a-z]+)\((.+?)\)$/i,t=/^-?[\d.]+$/,r=/%|deg|g?rad|turn$/,i=/\/?\s*(none|[-\w.]+(?:%|deg|g?rad|turn)?)/g;let o=n.match(e);if(o){let a=[];return o[2].replace(i,(c,f)=>{let h=f.match(r),m=f;if(h){let p=h[0],g=m.slice(0,-p.length);p==="%"?(m=new Number(g/100),m.type="<percentage>"):(m=new Number(g*kA[p]),m.type="<angle>",m.unit=p)}else t.test(m)?(m=new Number(m),m.type="<number>"):m==="none"&&(m=new Number(NaN),m.none=!0);c.startsWith("/")&&(m=m instanceof Number?m:new Number(m),m.alpha=!0),typeof m=="object"&&m instanceof Number&&(m.raw=f),a.push(m)}),{name:o[1].toLowerCase(),rawName:o[1],rawArgs:o[2],args:a}}}function TA(n){return n[n.length-1]}function b1(n,e,t){return isNaN(n)?e:isNaN(e)?n:n+(e-n)*t}function CA(n,e,t){return(t-n)/(e-n)}function v1(n,e,t){return b1(e[0],e[1],CA(n[0],n[1],t))}function MA(n){return n.map(e=>e.split("|").map(t=>{t=t.trim();let r=t.match(/^(<[a-z]+>)\[(-?[.\d]+),\s*(-?[.\d]+)\]?$/);if(r){let i=new String(r[1]);return i.range=[+r[2],+r[3]],i}return t}))}function AA(n,e,t){return Math.max(Math.min(t,e),n)}function Yf(n,e){return Math.sign(n)===Math.sign(e)?n:-n}function $n(n,e){return Yf(Math.abs(n)**e,n)}function w1(n,e){return e===0?0:n/e}function IA(n,e,t=0,r=n.length){for(;t<r;){const i=t+r>>1;n[i]<e?t=i+1:r=i}return t}class OA{add(e,t,r){if(typeof arguments[0]!="string"){for(var e in arguments[0])this.add(e,arguments[0][e],arguments[1]);return}(Array.isArray(e)?e:[e]).forEach(function(i){this[i]=this[i]||[],t&&this[i][r?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(r){r.call(t&&t.context?t.context:t,t)})}}const ba=new OA,Wn={D50:[.3457/.3585,1,(1-.3457-.3585)/.3585],D65:[.3127/.329,1,(1-.3127-.329)/.329]};function Xf(n){return Array.isArray(n)?n:Wn[n]}function va(n,e,t,r={}){if(n=Xf(n),e=Xf(e),!n||!e)throw new TypeError(`Missing white point to convert ${n?"":"from"}${!n&&!e?"/":""}${e?"":"to"}`);if(n===e)return t;let i={W1:n,W2:e,XYZ:t,options:r};if(ba.run("chromatic-adaptation-start",i),i.M||(i.W1===Wn.D65&&i.W2===Wn.D50?i.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:i.W1===Wn.D50&&i.W2===Wn.D65&&(i.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),ba.run("chromatic-adaptation-end",i),i.M)return ze(i.M,i.XYZ);throw new TypeError("Only Bradford CAT with white points D50 and D65 supported for now.")}const Fs={gamut_mapping:"css",precision:5,deltaE:"76",verbose:((g1=(m1=(p1=globalThis?.process)==null?void 0:p1.env)==null?void 0:m1.NODE_ENV)==null?void 0:g1.toLowerCase())!=="test",warn:function(e){var t,r;this.verbose&&((r=(t=globalThis?.console)==null?void 0:t.warn)==null||r.call(t,e))}},NA=new Set(["<number>","<percentage>","<angle>"]);function S1(n,e,t,r){return Object.entries(n.coords).map(([o,a],c)=>{let f=e.coordGrammar[c],h=r[c],m=h?.type,p;if(h.none?p=f.find(S=>NA.has(S)):p=f.find(S=>S==m),!p){let S=a.name||o;throw new TypeError(`${m??h.raw} not allowed for ${S} in ${t}()`)}let g=p.range;m==="<percentage>"&&(g||(g=[0,1]));let b=a.range||a.refRange;return g&&b&&(r[c]=v1(g,b,r[c])),p})}function x1(n,{meta:e}={}){var t,r,i,o;let a={str:(t=String(n))==null?void 0:t.trim()};if(ba.run("parse-start",a),a.color)return a.color;if(a.parsed=_A(a.str),a.parsed){let c=a.parsed.name;if(c==="color"){let f=a.parsed.args.shift(),h=f.startsWith("--")?f.substring(2):`--${f}`,m=[f,h],p=a.parsed.rawArgs.indexOf("/")>0?a.parsed.args.pop():1;for(let S of re.all){let E=S.getFormat("color");if(E&&(m.includes(E.id)||(r=E.ids)!=null&&r.filter(C=>m.includes(C)).length)){const C=Object.keys(S.coords).map((P,F)=>a.parsed.args[F]||0);let M;return E.coordGrammar&&(M=S1(S,E,"color",C)),e&&Object.assign(e,{formatId:"color",types:M}),E.id.startsWith("--")&&!f.startsWith("--")&&Fs.warn(`${S.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${E.id}) instead of color(${f}).`),f.startsWith("--")&&!E.id.startsWith("--")&&Fs.warn(`${S.name} is a standard space and supported in the CSS spec. Use color(${E.id}) instead of prefixed color(${f}).`),{spaceId:S.id,coords:C,alpha:p}}}let g="",b=f in re.registry?f:h;if(b in re.registry){let S=(o=(i=re.registry[b].formats)==null?void 0:i.color)==null?void 0:o.id;S&&(g=`Did you mean color(${S})?`)}throw new TypeError(`Cannot parse color(${f}). `+(g||"Missing a plugin?"))}else for(let f of re.all){let h=f.getFormat(c);if(h&&h.type==="function"){let m=1;(h.lastAlpha||TA(a.parsed.args).alpha)&&(m=a.parsed.args.pop());let p=a.parsed.args,g;return h.coordGrammar&&(g=S1(f,h,c,p)),e&&Object.assign(e,{formatId:h.name,types:g}),{spaceId:f.id,coords:p,alpha:m}}}}else for(let c of re.all)for(let f in c.formats){let h=c.formats[f];if(h.type!=="custom"||h.test&&!h.test(a.str))continue;let m=h.parse(a.str);if(m)return m.alpha??(m.alpha=1),e&&(e.formatId=f),m}throw new TypeError(`Could not parse ${n} as a color. Missing a plugin?`)}function Ve(n){if(Array.isArray(n))return n.map(Ve);if(!n)throw new TypeError("Empty color reference");y1(n)&&(n=x1(n));let e=n.space||n.spaceId;return e instanceof re||(n.space=re.get(e)),n.alpha===void 0&&(n.alpha=1),n}const RA=75e-6,Zf=class nn{constructor(e){var t;this.id=e.id,this.name=e.name,this.base=e.base?nn.get(e.base):null,this.aliases=e.aliases,this.base&&(this.fromBase=e.fromBase,this.toBase=e.toBase);let r=e.coords??this.base.coords;for(let o in r)"name"in r[o]||(r[o].name=o);this.coords=r;let i=e.white??this.base.white??"D65";this.white=Xf(i),this.formats=e.formats??{};for(let o in this.formats){let a=this.formats[o];a.type||(a.type="function"),a.name||(a.name=o)}(t=this.formats.color)!=null&&t.id||(this.formats.color={...this.formats.color??{},id:e.cssId||this.id}),e.gamutSpace?this.gamutSpace=e.gamutSpace==="self"?this:nn.get(e.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(o,a)=>!0),this.referred=e.referred,Object.defineProperty(this,"path",{value:LA(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),ba.run("colorspace-init-end",this)}inGamut(e,{epsilon:t=RA}={}){if(!this.equals(this.gamutSpace))return e=this.to(this.gamutSpace,e),this.gamutSpace.inGamut(e,{epsilon:t});let r=Object.values(this.coords);return e.every((i,o)=>{let a=r[o];if(a.type!=="angle"&&a.range){if(Number.isNaN(i))return!0;let[c,f]=a.range;return(c===void 0||i>=c-t)&&(f===void 0||i<=f+t)}return!0})}get isUnbounded(){return Object.values(this.coords).every(e=>!("range"in e))}get cssId(){var e,t;return((t=(e=this.formats)==null?void 0:e.color)==null?void 0:t.id)||this.id}get isPolar(){for(let e in this.coords)if(this.coords[e].type==="angle")return!0;return!1}getFormat(e){if(typeof e=="object")return e=E1(e,this),e;let t;return e==="default"?t=Object.values(this.formats)[0]:t=this.formats[e],t?(t=E1(t,this),t):null}equals(e){return e?this===e||this.id===e||this.id===e.id:!1}to(e,t){if(arguments.length===1){const c=Ve(e);[e,t]=[c.space,c.coords]}if(e=nn.get(e),this.equals(e))return t;t=t.map(c=>Number.isNaN(c)?0:c);let r=this.path,i=e.path,o,a;for(let c=0;c<r.length&&r[c].equals(i[c]);c++)o=r[c],a=c;if(!o)throw new Error(`Cannot convert between color spaces ${this} and ${e}: no connection space was found`);for(let c=r.length-1;c>a;c--)t=r[c].toBase(t);for(let c=a+1;c<i.length;c++)t=i[c].fromBase(t);return t}from(e,t){if(arguments.length===1){const r=Ve(e);[e,t]=[r.space,r.coords]}return e=nn.get(e),e.to(this,t)}toString(){return`${this.name} (${this.id})`}getMinCoords(){let e=[];for(let t in this.coords){let r=this.coords[t],i=r.range||r.refRange;e.push(i?.min??0)}return e}static get all(){return[...new Set(Object.values(nn.registry))]}static register(e,t){if(arguments.length===1&&(t=arguments[0],e=t.id),t=this.get(t),this.registry[e]&&this.registry[e]!==t)throw new Error(`Duplicate color space registration: '${e}'`);if(this.registry[e]=t,arguments.length===1&&t.aliases)for(let r of t.aliases)this.register(r,t);return t}static get(e,...t){if(!e||e instanceof nn)return e;if(Bs(e)==="string"){let i=nn.registry[e.toLowerCase()];if(!i)throw new TypeError(`No color space found with id = "${e}"`);return i}if(t.length)return nn.get(...t);throw new TypeError(`${e} is not a valid color space`)}static resolveCoord(e,t){var r;let i=Bs(e),o,a;if(i==="string"?e.includes(".")?[o,a]=e.split("."):[o,a]=[,e]:Array.isArray(e)?[o,a]=e:(o=e.space,a=e.coordId),o=nn.get(o),o||(o=t),!o)throw new TypeError(`Cannot resolve coordinate reference ${e}: No color space specified and relative references are not allowed here`);if(i=Bs(a),i==="number"||i==="string"&&a>=0){let h=Object.entries(o.coords)[a];if(h)return{space:o,id:h[0],index:a,...h[1]}}o=nn.get(o);let c=a.toLowerCase(),f=0;for(let h in o.coords){let m=o.coords[h];if(h.toLowerCase()===c||((r=m.name)==null?void 0:r.toLowerCase())===c)return{space:o,id:h,index:f,...m};f++}throw new TypeError(`No "${a}" coordinate found in ${o.name}. Its coordinates are: ${Object.keys(o.coords).join(", ")}`)}};Hn(Zf,"registry",{}),Hn(Zf,"DEFAULT_FORMAT",{type:"functions",name:"color"});let re=Zf;function LA(n){let e=[n];for(let t=n;t=t.base;)e.push(t);return e}function E1(n,{coords:e}={}){if(n.coords&&!n.coordGrammar){n.type||(n.type="function"),n.name||(n.name="color"),n.coordGrammar=MA(n.coords);let t=Object.entries(e).map(([r,i],o)=>{let a=n.coordGrammar[o][0],c=i.range||i.refRange,f=a.range,h="";return a=="<percentage>"?(f=[0,100],h="%"):a=="<angle>"&&(h="deg"),{fromRange:c,toRange:f,suffix:h}});n.serializeCoords=(r,i)=>r.map((o,a)=>{let{fromRange:c,toRange:f,suffix:h}=t[a];return c&&f&&(o=v1(c,f,o)),o=qf(o,{precision:i,unit:h}),o})}return n}const Un=new re({id:"xyz-d65",name:"XYZ D65",coords:{x:{name:"X"},y:{name:"Y"},z:{name:"Z"}},white:"D65",formats:{color:{ids:["xyz-d65","xyz"]}},aliases:["xyz"]});class k1 extends re{constructor(e){e.coords||(e.coords={r:{range:[0,1],name:"Red"},g:{range:[0,1],name:"Green"},b:{range:[0,1],name:"Blue"}}),e.base||(e.base=Un),e.toXYZ_M&&e.fromXYZ_M&&(e.toBase??(e.toBase=t=>{let r=ze(e.toXYZ_M,t);return this.white!==this.base.white&&(r=va(this.white,this.base.white,r)),r}),e.fromBase??(e.fromBase=t=>(t=va(this.base.white,this.white,t),ze(e.fromXYZ_M,t)))),e.referred??(e.referred="display"),super(e)}}function Qf(n,e){return n=Ve(n),!e||n.space.equals(e)?n.coords.slice():(e=re.get(e),e.from(n))}function Vn(n,e){n=Ve(n);let{space:t,index:r}=re.resolveCoord(e,n.space);return Qf(n,t)[r]}function _1(n,e,t){return n=Ve(n),e=re.get(e),n.coords=e.to(n.space,t),n}_1.returns="color";function eh(n,e,t){if(n=Ve(n),arguments.length===2&&Bs(arguments[1])==="object"){let r=arguments[1];for(let i in r)eh(n,i,r[i])}else{typeof t=="function"&&(t=t(Vn(n,e)));let{space:r,index:i}=re.resolveCoord(e,n.space),o=Qf(n,r);o[i]=t,_1(n,r,o)}return n}eh.returns="color";const PA=new re({id:"xyz-d50",name:"XYZ D50",white:"D50",base:Un,fromBase:n=>va(Un.white,"D50",n),toBase:n=>va("D50",Un.white,n)}),DA=216/24389,T1=24/116,wa=24389/27;let th=Wn.D50;const Kn=new re({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:th,base:PA,fromBase(n){let t=n.map((r,i)=>r/th[i]).map(r=>r>DA?Math.cbrt(r):(wa*r+16)/116);return[116*t[1]-16,500*(t[0]-t[1]),200*(t[1]-t[2])]},toBase(n){let e=[];return e[1]=(n[0]+16)/116,e[0]=n[1]/500+e[1],e[2]=e[1]-n[2]/200,[e[0]>T1?Math.pow(e[0],3):(116*e[0]-16)/wa,n[0]>8?Math.pow((n[0]+16)/116,3):n[0]/wa,e[2]>T1?Math.pow(e[2],3):(116*e[2]-16)/wa].map((r,i)=>r*th[i])},formats:{lab:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function Er(n){return(n%360+360)%360}const Sa=new re({id:"lch",name:"LCH",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,150],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:Kn,fromBase(n){let[e,t,r]=n,i;const o=.02;return Math.abs(t)<o&&Math.abs(r)<o?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),Er(i)]},toBase(n){let[e,t,r]=n;return t<0&&(t=0),isNaN(r)&&(r=0),[e,t*Math.cos(r*Math.PI/180),t*Math.sin(r*Math.PI/180)]},formats:{lch:{coords:["<number> | <percentage>","<number> | <percentage>","<number> | <angle>"]}}}),C1=25**7,xa=Math.PI,M1=180/xa,Ri=xa/180;function A1(n){const e=n*n;return e*e*e*n}function I1(n,e,{kL:t=1,kC:r=1,kH:i=1}={}){[n,e]=Ve([n,e]);let[o,a,c]=Kn.from(n),f=Sa.from(Kn,[o,a,c])[1],[h,m,p]=Kn.from(e),g=Sa.from(Kn,[h,m,p])[1];f<0&&(f=0),g<0&&(g=0);let b=(f+g)/2,S=A1(b),E=.5*(1-Math.sqrt(S/(S+C1))),C=(1+E)*a,M=(1+E)*m,P=Math.sqrt(C**2+c**2),F=Math.sqrt(M**2+p**2),$=C===0&&c===0?0:Math.atan2(c,C),U=M===0&&p===0?0:Math.atan2(p,M);$<0&&($+=2*xa),U<0&&(U+=2*xa),$*=M1,U*=M1;let ue=h-o,he=F-P,be=U-$,bt=$+U,Jn=Math.abs(be),sn;P*F===0?sn=0:Jn<=180?sn=be:be>180?sn=be-360:be<-180?sn=be+360:Fs.warn("the unthinkable has happened");let qn=2*Math.sqrt(F*P)*Math.sin(sn*Ri/2),Zr=(o+h)/2,on=(P+F)/2,vn=A1(on),Fe;P*F===0?Fe=bt:Jn<=180?Fe=bt/2:bt<360?Fe=(bt+360)/2:Fe=(bt-360)/2;let vt=(Zr-50)**2,jn=1+.015*vt/Math.sqrt(20+vt),Js=1+.045*on,ln=1;ln-=.17*Math.cos((Fe-30)*Ri),ln+=.24*Math.cos(2*Fe*Ri),ln+=.32*Math.cos((3*Fe+6)*Ri),ln-=.2*Math.cos((4*Fe-63)*Ri);let wt=1+.015*on*ln,Ra=30*Math.exp(-1*((Fe-275)/25)**2),La=2*Math.sqrt(vn/(vn+C1)),Pa=-1*Math.sin(2*Ra*Ri)*La,Gt=(ue/(t*jn))**2;return Gt+=(he/(r*Js))**2,Gt+=(qn/(i*wt))**2,Gt+=Pa*(he/(r*Js))*(qn/(i*wt)),Math.sqrt(Gt)}const zA=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],BA=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],FA=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],HA=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],Hs=new re({id:"oklab",name:"Oklab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:Un,fromBase(n){let t=ze(zA,n).map(r=>Math.cbrt(r));return ze(FA,t)},toBase(n){let t=ze(HA,n).map(r=>r**3);return ze(BA,t)},formats:{oklab:{coords:["<percentage> | <number>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function nh(n,e){[n,e]=Ve([n,e]);let[t,r,i]=Hs.from(n),[o,a,c]=Hs.from(e),f=t-o,h=r-a,m=i-c;return Math.sqrt(f**2+h**2+m**2)}const $A=75e-6;function Li(n,e,{epsilon:t=$A}={}){n=Ve(n),e||(e=n.space),e=re.get(e);let r=n.coords;return e!==n.space&&(r=e.from(n)),e.inGamut(r,{epsilon:t})}function rh(n){return{space:n.space,coords:n.coords.slice(),alpha:n.alpha}}function WA(n,e,t="lab"){t=re.get(t);let r=t.from(n),i=t.from(e);return Math.sqrt(r.reduce((o,a,c)=>{let f=i[c];return isNaN(a)||isNaN(f)?o:o+(f-a)**2},0))}function UA(n,e){return WA(n,e,"lab")}const VA=Math.PI,O1=VA/180;function KA(n,e,{l:t=2,c:r=1}={}){[n,e]=Ve([n,e]);let[i,o,a]=Kn.from(n),[,c,f]=Sa.from(Kn,[i,o,a]),[h,m,p]=Kn.from(e),g=Sa.from(Kn,[h,m,p])[1];c<0&&(c=0),g<0&&(g=0);let b=i-h,S=c-g,E=o-m,C=a-p,M=E**2+C**2-S**2,P=.511;i>=16&&(P=.040975*i/(1+.01765*i));let F=.0638*c/(1+.0131*c)+.638,$;Number.isNaN(f)&&(f=0),f>=164&&f<=345?$=.56+Math.abs(.2*Math.cos((f+168)*O1)):$=.36+Math.abs(.4*Math.cos((f+35)*O1));let U=Math.pow(c,4),ue=Math.sqrt(U/(U+1900)),he=F*(ue*$+1-ue),be=(b/(t*P))**2;return be+=(S/(r*F))**2,be+=M/he**2,Math.sqrt(be)}const N1=203,R1=new re({id:"xyz-abs-d65",cssId:"--xyz-abs-d65",name:"Absolute XYZ D65",coords:{x:{refRange:[0,9504.7],name:"Xa"},y:{refRange:[0,1e4],name:"Ya"},z:{refRange:[0,10888.3],name:"Za"}},base:Un,fromBase(n){return n.map(e=>Math.max(e*N1,0))},toBase(n){return n.map(e=>Math.max(e/N1,0))}}),Ea=1.15,ka=.66,L1=2610/2**14,GA=2**14/2610,P1=3424/2**12,D1=2413/2**7,z1=2392/2**7,JA=1.7*2523/2**5,B1=2**5/(1.7*2523),_a=-.56,ih=16295499532821565e-27,qA=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],jA=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],YA=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],XA=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]],ZA=new re({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:R1,fromBase(n){let[e,t,r]=n,i=Ea*e-(Ea-1)*r,o=ka*t-(ka-1)*e,c=ze(qA,[i,o,r]).map(function(g){let b=P1+D1*(g/1e4)**L1,S=1+z1*(g/1e4)**L1;return(b/S)**JA}),[f,h,m]=ze(YA,c);return[(1+_a)*f/(1+_a*f)-ih,h,m]},toBase(n){let[e,t,r]=n,i=(e+ih)/(1+_a-_a*(e+ih)),a=ze(XA,[i,t,r]).map(function(g){let b=P1-g**B1,S=z1*g**B1-D1;return 1e4*(b/S)**GA}),[c,f,h]=ze(jA,a),m=(c+(Ea-1)*h)/Ea,p=(f+(ka-1)*m)/ka;return[m,p,h]},formats:{color:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}}),F1=new re({id:"jzczhz",name:"JzCzHz",coords:{jz:{refRange:[0,1],name:"Jz"},cz:{refRange:[0,1],name:"Chroma"},hz:{refRange:[0,360],type:"angle",name:"Hue"}},base:ZA,fromBase(n){let[e,t,r]=n,i;const o=2e-4;return Math.abs(t)<o&&Math.abs(r)<o?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),Er(i)]},toBase(n){return[n[0],n[1]*Math.cos(n[2]*Math.PI/180),n[1]*Math.sin(n[2]*Math.PI/180)]}});function QA(n,e){[n,e]=Ve([n,e]);let[t,r,i]=F1.from(n),[o,a,c]=F1.from(e),f=t-o,h=r-a;Number.isNaN(i)&&Number.isNaN(c)?(i=0,c=0):Number.isNaN(i)?i=c:Number.isNaN(c)&&(c=i);let m=i-c,p=2*Math.sqrt(r*a)*Math.sin(m/2*(Math.PI/180));return Math.sqrt(f**2+h**2+p**2)}const H1=3424/4096,$1=2413/128,W1=2392/128,U1=2610/16384,eI=2523/32,tI=16384/2610,V1=32/2523,nI=[[.3592832590121217,.6976051147779502,-.035891593232029],[-.1920808463704993,1.100476797037432,.0753748658519118],[.0070797844607479,.0748396662186362,.8433265453898765]],rI=[[2048/4096,2048/4096,0],[6610/4096,-13613/4096,7003/4096],[17933/4096,-17390/4096,-543/4096]],iI=[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],sI=[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]],K1=new re({id:"ictcp",name:"ICTCP",coords:{i:{refRange:[0,1],name:"I"},ct:{refRange:[-.5,.5],name:"CT"},cp:{refRange:[-.5,.5],name:"CP"}},base:R1,fromBase(n){let e=ze(nI,n);return oI(e)},toBase(n){let e=lI(n);return ze(sI,e)}});function oI(n){let e=n.map(function(t){let r=H1+$1*(t/1e4)**U1,i=1+W1*(t/1e4)**U1;return(r/i)**eI});return ze(rI,e)}function lI(n){return ze(iI,n).map(function(r){let i=Math.max(r**V1-H1,0),o=$1-W1*r**V1;return 1e4*(i/o)**tI})}function aI(n,e){[n,e]=Ve([n,e]);let[t,r,i]=K1.from(n),[o,a,c]=K1.from(e);return 720*Math.sqrt((t-o)**2+.25*(r-a)**2+(i-c)**2)}const cI=Wn.D65,G1=.42,J1=1/G1,sh=2*Math.PI,q1=[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],uI=[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],fI=[[460,451,288],[460,-891,-261],[460,-220,-6300]],hI={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},qr={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},dI=180/Math.PI,j1=Math.PI/180;function Y1(n,e){return n.map(r=>{const i=$n(e*Math.abs(r)*.01,G1);return 400*Yf(i,r)/(i+27.13)})}function pI(n,e){const t=100/e*27.13**J1;return n.map(r=>{const i=Math.abs(r);return Yf(t*$n(i/(400-i),J1),r)})}function mI(n){let e=Er(n);e<=qr.h[0]&&(e+=360);const t=IA(qr.h,e)-1,[r,i]=qr.h.slice(t,t+2),[o,a]=qr.e.slice(t,t+2),c=qr.H[t],f=(e-r)/o;return c+100*f/(f+(i-e)/a)}function gI(n){let e=(n%400+400)%400;const t=Math.floor(.01*e);e=e%100;const[r,i]=qr.h.slice(t,t+2),[o,a]=qr.e.slice(t,t+2);return Er((e*(a*r-o*i)-100*r*a)/(e*(a-o)-100*a))}function X1(n,e,t,r,i){const o={};o.discounting=i,o.refWhite=n,o.surround=r;const a=n.map(E=>E*100);o.la=e,o.yb=t;const c=a[1],f=ze(q1,a);r=hI[o.surround];const h=r[0];o.c=r[1],o.nc=r[2];const p=(1/(5*o.la+1))**4;o.fl=p*o.la+.1*(1-p)*(1-p)*Math.cbrt(5*o.la),o.flRoot=o.fl**.25,o.n=o.yb/c,o.z=1.48+Math.sqrt(o.n),o.nbb=.725*o.n**-.2,o.ncb=o.nbb;const g=Math.max(Math.min(h*(1-1/3.6*Math.exp((-o.la-42)/92)),1),0);o.dRgb=f.map(E=>b1(1,c/E,g)),o.dRgbInv=o.dRgb.map(E=>1/E);const b=f.map((E,C)=>E*o.dRgb[C]),S=Y1(b,o.fl);return o.aW=o.nbb*(2*S[0]+S[1]+.05*S[2]),o}const Z1=X1(cI,64/Math.PI*.2,20,"average",!1);function oh(n,e){if(!(n.J!==void 0^n.Q!==void 0))throw new Error("Conversion requires one and only one: 'J' or 'Q'");if(!(n.C!==void 0^n.M!==void 0^n.s!==void 0))throw new Error("Conversion requires one and only one: 'C', 'M' or 's'");if(!(n.h!==void 0^n.H!==void 0))throw new Error("Conversion requires one and only one: 'h' or 'H'");if(n.J===0||n.Q===0)return[0,0,0];let t=0;n.h!==void 0?t=Er(n.h)*j1:t=gI(n.H)*j1;const r=Math.cos(t),i=Math.sin(t);let o=0;n.J!==void 0?o=$n(n.J,1/2)*.1:n.Q!==void 0&&(o=.25*e.c*n.Q/((e.aW+4)*e.flRoot));let a=0;n.C!==void 0?a=n.C/o:n.M!==void 0?a=n.M/e.flRoot/o:n.s!==void 0&&(a=4e-4*n.s**2*(e.aW+4)/e.c);const c=$n(a*Math.pow(1.64-Math.pow(.29,e.n),-.73),10/9),f=.25*(Math.cos(t+2)+3.8),h=e.aW*$n(o,2/e.c/e.z),m=5e4/13*e.nc*e.ncb*f,p=h/e.nbb,g=23*(p+.305)*w1(c,23*m+c*(11*r+108*i)),b=g*r,S=g*i,E=pI(ze(fI,[p,b,S]).map(C=>C*1/1403),e.fl);return ze(uI,E.map((C,M)=>C*e.dRgbInv[M])).map(C=>C/100)}function Q1(n,e){const t=n.map(F=>F*100),r=Y1(ze(q1,t).map((F,$)=>F*e.dRgb[$]),e.fl),i=r[0]+(-12*r[1]+r[2])/11,o=(r[0]+r[1]-2*r[2])/9,a=(Math.atan2(o,i)%sh+sh)%sh,c=.25*(Math.cos(a+2)+3.8),f=5e4/13*e.nc*e.ncb*w1(c*Math.sqrt(i**2+o**2),r[0]+r[1]+1.05*r[2]+.305),h=$n(f,.9)*Math.pow(1.64-Math.pow(.29,e.n),.73),m=e.nbb*(2*r[0]+r[1]+.05*r[2]),p=$n(m/e.aW,.5*e.c*e.z),g=100*$n(p,2),b=4/e.c*p*(e.aW+4)*e.flRoot,S=h*p,E=S*e.flRoot,C=Er(a*dI),M=mI(C),P=50*$n(e.c*h/(e.aW+4),1/2);return{J:g,C:S,h:C,s:P,Q:b,M:E,H:M}}new re({id:"cam16-jmh",cssId:"--cam16-jmh",name:"CAM16-JMh",coords:{j:{refRange:[0,100],name:"J"},m:{refRange:[0,105],name:"Colorfulness"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:Un,fromBase(n){const e=Q1(n,Z1);return[e.J,e.M,e.h]},toBase(n){return oh({J:n[0],M:n[1],h:n[2]},Z1)}});const yI=Wn.D65,bI=216/24389,ey=24389/27;function vI(n){return 116*(n>bI?Math.cbrt(n):(ey*n+16)/116)-16}function lh(n){return n>8?Math.pow((n+16)/116,3):n/ey}function wI(n,e){let[t,r,i]=n,o=[],a=0;if(i===0)return[0,0,0];let c=lh(i);i>0?a=.00379058511492914*i**2+.608983189401032*i+.9155088574762233:a=9514440756550361e-21*i**2+.08693057439788597*i-21.928975842194614;const f=2e-12,h=15;let m=0,p=1/0;for(;m<=h;){o=oh({J:a,C:r,h:t},e);const g=Math.abs(o[1]-c);if(g<p){if(g<=f)return o;p=g}a=a-(o[1]-c)*a/(2*o[1]),m+=1}return oh({J:a,C:r,h:t},e)}function SI(n,e){const t=vI(n[1]);if(t===0)return[0,0,0];const r=Q1(n,ah);return[Er(r.h),r.C,t]}const ah=X1(yI,200/Math.PI*lh(50),lh(50)*100,"average",!1),Ta=new re({id:"hct",name:"HCT",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},c:{refRange:[0,145],name:"Colorfulness"},t:{refRange:[0,100],name:"Tone"}},base:Un,fromBase(n){return SI(n)},toBase(n){return wI(n,ah)},formats:{color:{id:"--hct",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),xI=Math.PI/180,ty=[1,.007,.0228];function ny(n){n[1]<0&&(n=Ta.fromBase(Ta.toBase(n)));const e=Math.log(Math.max(1+ty[2]*n[1]*ah.flRoot,1))/ty[2],t=n[0]*xI,r=e*Math.cos(t),i=e*Math.sin(t);return[n[2],r,i]}function EI(n,e){[n,e]=Ve([n,e]);let[t,r,i]=ny(Ta.from(n)),[o,a,c]=ny(Ta.from(e));return Math.sqrt((t-o)**2+(r-a)**2+(i-c)**2)}const ry={deltaE76:UA,deltaECMC:KA,deltaE2000:I1,deltaEJz:QA,deltaEITP:aI,deltaEOK:nh,deltaEHCT:EI};function kI(n){const e=n?Math.floor(Math.log10(Math.abs(n))):0;return Math.max(parseFloat(`1e${e-2}`),1e-6)}const iy={hct:{method:"hct.c",jnd:2,deltaEMethod:"hct",blackWhiteClamp:{}},"hct-tonal":{method:"hct.c",jnd:0,deltaEMethod:"hct",blackWhiteClamp:{channel:"hct.t",min:0,max:100}}};function $s(n,{method:e=Fs.gamut_mapping,space:t=void 0,deltaEMethod:r="",jnd:i=2,blackWhiteClamp:o={}}={}){if(n=Ve(n),y1(arguments[1])?t=arguments[1]:t||(t=n.space),t=re.get(t),Li(n,t,{epsilon:0}))return n;let a;if(e==="css")a=_I(n,{space:t});else{if(e!=="clip"&&!Li(n,t)){Object.prototype.hasOwnProperty.call(iy,e)&&({method:e,jnd:i,deltaEMethod:r,blackWhiteClamp:o}=iy[e]);let c=I1;if(r!==""){for(let h in ry)if("deltae"+r.toLowerCase()===h.toLowerCase()){c=ry[h];break}}let f=$s(Be(n,t),{method:"clip",space:t});if(c(n,f)>i){if(Object.keys(o).length===3){let P=re.resolveCoord(o.channel),F=Vn(Be(n,P.space),P.id);if(jf(F)&&(F=0),F>=o.max)return Be({space:"xyz-d65",coords:Wn.D65},n.space);if(F<=o.min)return Be({space:"xyz-d65",coords:[0,0,0]},n.space)}let h=re.resolveCoord(e),m=h.space,p=h.id,g=Be(n,m);g.coords.forEach((P,F)=>{jf(P)&&(g.coords[F]=0)});let S=(h.range||h.refRange)[0],E=kI(i),C=S,M=Vn(g,p);for(;M-C>E;){let P=rh(g);P=$s(P,{space:t,method:"clip"}),c(g,P)-i<E?C=Vn(g,p):M=Vn(g,p),eh(g,p,(C+M)/2)}a=Be(g,t)}else a=f}else a=Be(n,t);if(e==="clip"||!Li(a,t,{epsilon:0})){let c=Object.values(t.coords).map(f=>f.range||[]);a.coords=a.coords.map((f,h)=>{let[m,p]=c[h];return m!==void 0&&(f=Math.max(m,f)),p!==void 0&&(f=Math.min(f,p)),f})}}return t!==n.space&&(a=Be(a,n.space)),n.coords=a.coords,n}$s.returns="color";const sy={WHITE:{space:Hs,coords:[1,0,0]},BLACK:{space:Hs,coords:[0,0,0]}};function _I(n,{space:e}={}){n=Ve(n),e||(e=n.space),e=re.get(e);const i=re.get("oklch");if(e.isUnbounded)return Be(n,e);const o=Be(n,i);let a=o.coords[0];if(a>=1){const S=Be(sy.WHITE,e);return S.alpha=n.alpha,Be(S,e)}if(a<=0){const S=Be(sy.BLACK,e);return S.alpha=n.alpha,Be(S,e)}if(Li(o,e,{epsilon:0}))return Be(o,e);function c(S){const E=Be(S,e),C=Object.values(e.coords);return E.coords=E.coords.map((M,P)=>{if("range"in C[P]){const[F,$]=C[P].range;return AA(F,M,$)}return M}),E}let f=0,h=o.coords[1],m=!0,p=rh(o),g=c(p),b=nh(g,p);if(b<.02)return g;for(;h-f>1e-4;){const S=(f+h)/2;if(p.coords[1]=S,m&&Li(p,e,{epsilon:0}))f=S;else if(g=c(p),b=nh(g,p),b<.02){if(.02-b<1e-4)break;m=!1,f=S}else h=S}return g}function Be(n,e,{inGamut:t}={}){n=Ve(n),e=re.get(e);let r=e.from(n),i={space:e,coords:r,alpha:n.alpha};return t&&(i=$s(i,t===!0?void 0:t)),i}Be.returns="color";function TI(n,{precision:e=Fs.precision,format:t="default",inGamut:r=!0,...i}={}){var o;let a;n=Ve(n);let c=t;t=n.space.getFormat(t)??n.space.getFormat("default")??re.DEFAULT_FORMAT;let f=n.coords.slice();if(r||(r=t.toGamut),r&&!Li(n)&&(f=$s(rh(n),r===!0?void 0:r).coords),t.type==="custom")if(i.precision=e,t.serialize)a=t.serialize(f,n.alpha,i);else throw new TypeError(`format ${c} can only be used to parse colors, not for serialization`);else{let h=t.name||"color";t.serializeCoords?f=t.serializeCoords(f,e):e!==null&&(f=f.map(b=>qf(b,{precision:e})));let m=[...f];if(h==="color"){let b=t.id||((o=t.ids)==null?void 0:o[0])||n.space.id;m.unshift(b)}let p=n.alpha;e!==null&&(p=qf(p,{precision:e}));let g=n.alpha>=1||t.noAlpha?"":`${t.commas?",":" /"} ${p}`;a=`${h}(${m.join(t.commas?", ":" ")}${g})`}return a}const CI=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],MI=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],AI=new k1({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:CI,fromXYZ_M:MI}),oy={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[153/255,50/255,204/255],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,153/255],lightslategrey:[119/255,136/255,153/255],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[102/255,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,204/255],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[102/255,51/255,153/255],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]};let ly=Array(3).fill("<percentage> | <number>[0, 255]"),ay=Array(3).fill("<number>[0, 255]");const cy=new k1({id:"srgb",name:"sRGB",base:AI,fromBase:n=>n.map(e=>{let t=e<0?-1:1,r=e*t;return r>.0031308?t*(1.055*r**(1/2.4)-.055):12.92*e}),toBase:n=>n.map(e=>{let t=e<0?-1:1,r=e*t;return r<=.04045?e/12.92:t*((r+.055)/1.055)**2.4}),formats:{rgb:{coords:ly},rgb_number:{name:"rgb",commas:!0,coords:ay,noAlpha:!0},color:{},rgba:{coords:ly,commas:!0,lastAlpha:!0},rgba_number:{name:"rgba",commas:!0,coords:ay},hex:{type:"custom",toGamut:!0,test:n=>/^#([a-f0-9]{3,4}){1,2}$/i.test(n),parse(n){n.length<=5&&(n=n.replace(/[a-f0-9]/gi,"$&$&"));let e=[];return n.replace(/[a-f0-9]{2}/gi,t=>{e.push(parseInt(t,16)/255)}),{spaceId:"srgb",coords:e.slice(0,3),alpha:e.slice(3)[0]}},serialize:(n,e,{collapse:t=!0}={})=>{e<1&&n.push(e),n=n.map(o=>Math.round(o*255));let r=t&&n.every(o=>o%17===0);return"#"+n.map(o=>r?(o/17).toString(16):o.toString(16).padStart(2,"0")).join("")}},keyword:{type:"custom",test:n=>/^[a-z]+$/i.test(n),parse(n){n=n.toLowerCase();let e={spaceId:"srgb",coords:null,alpha:1};if(n==="transparent"?(e.coords=oy.black,e.alpha=0):e.coords=oy[n],e.coords)return e}}}});function II(n){return Vn(n,[Un,"y"])}const uy=new re({id:"hsl",name:"HSL",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:cy,fromBase:n=>{let e=Math.max(...n),t=Math.min(...n),[r,i,o]=n,[a,c,f]=[NaN,0,(t+e)/2],h=e-t;if(h!==0){switch(c=f===0||f===1?0:(e-f)/Math.min(f,1-f),e){case r:a=(i-o)/h+(i<o?6:0);break;case i:a=(o-r)/h+2;break;case o:a=(r-i)/h+4}a=a*60}return c<0&&(a+=180,c=Math.abs(c)),a>=360&&(a-=360),[a,c*100,f*100]},toBase:n=>{let[e,t,r]=n;e=e%360,e<0&&(e+=360),t/=100,r/=100;function i(o){let a=(o+e/30)%12,c=t*Math.min(r,1-r);return r-c*Math.max(-1,Math.min(a-3,9-a,1))}return[i(0),i(8),i(4)]},formats:{hsl:{coords:["<number> | <angle>","<percentage>","<percentage>"]},hsla:{coords:["<number> | <angle>","<percentage>","<percentage>"],commas:!0,lastAlpha:!0}}}),OI=new re({id:"hsv",name:"HSV",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},v:{range:[0,100],name:"Value"}},base:uy,fromBase(n){let[e,t,r]=n;t/=100,r/=100;let i=r+t*Math.min(r,1-r);return[e,i===0?0:200*(1-r/i),100*i]},toBase(n){let[e,t,r]=n;t/=100,r/=100;let i=r*(1-t/2);return[e,i===0||i===1?0:(r-i)/Math.min(i,1-i)*100,i*100]},formats:{color:{id:"--hsv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),NI=new re({id:"oklch",name:"Oklch",coords:{l:{refRange:[0,1],name:"Lightness"},c:{refRange:[0,.4],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},white:"D65",base:Hs,fromBase(n){let[e,t,r]=n,i;const o=2e-4;return Math.abs(t)<o&&Math.abs(r)<o?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),Er(i)]},toBase(n){let[e,t,r]=n,i,o;return isNaN(r)?(i=0,o=0):(i=t*Math.cos(r*Math.PI/180),o=t*Math.sin(r*Math.PI/180)),[e,i,o]},formats:{oklch:{coords:["<percentage> | <number>","<number> | <percentage>[0,1]","<number> | <angle>"]}}});class Nt{constructor(e){Hn(this,"data"),this.data=Be(e,"srgb")}static fromTransparent(){return new Nt({spaceId:"srgb",coords:[1,1,1],alpha:0})}static fromBlack(){return new Nt({spaceId:"srgb",coords:[0,0,0],alpha:1})}static fromWhite(){return new Nt({spaceId:"srgb",coords:[1,1,1],alpha:1})}get r(){return Math.round(this.data.coords[0]*255)}get g(){return Math.round(this.data.coords[1]*255)}get b(){return Math.round(this.data.coords[2]*255)}get h(){return Vn(this.data,"hsv.h")}get s(){return Vn(this.data,"hsv.s")}get v(){return Vn(this.data,"hsv.v")}get alpha(){return this.data.alpha.valueOf()}get alphaPercent(){return Math.round(this.alpha*100)}get isTransparent(){return this.alpha===0}get isDark(){return II(this.data)<.5}withAlpha(e){return new Nt({...this.data,alpha:e})}withRgb(e){const t=this.alpha===0?1:this.alpha;return new Nt({spaceId:"srgb",alpha:e.a??t,coords:[e.r?e.r/255:this.data.coords[0],e.g?e.g/255:this.data.coords[1],e.b?e.b/255:this.data.coords[2]]})}withHsv(e){const r=Qf(this.data,"hsv"),i=Math.max(e.s??r[1],1e-5),o=Math.max(e.v??r[2],1e-5),a=this.alpha===0?1:this.alpha;return new Nt({alpha:a,spaceId:"hsv",coords:[e.h??r[0],i,o]})}toString(){return this.alpha===1?this.toHexString():this.toRgbaString()}toHexString(){const e=TI(this.data,{format:"hex"}).toUpperCase();return e.length===4?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:e.slice(0,7)}toRgbaString(){return`rgba(${this.r}, ${this.g}, ${this.b}, ${this.alphaPercent}%)`}clone(){return new Nt(this.data)}}class RI{constructor(e){Hn(this,"_color"),Hn(this,"isEmpty",!1),this.update(e)}get color(){return this._color}setColor(e){this._color=e}setEmpty(e){this.isEmpty=e}toString(){return this.isEmpty?"":this.color.toString()}isEqual(e){return this.toString()===e}update({solidColor:e,isEmpty:t}){this.setColor(e),this.setEmpty(t)}}let fy=999;function LI(){return fy+=1,fy}function PI(n){return n?n.startsWith("linear-gradient("):!1}function DI(){const n=Nt.fromTransparent();return{isEmpty:!0,isGradient:!1,solidColor:n,angle:0,transitions:[{color:n.clone(),offset:0},{color:n.clone(),offset:100}]}}re.register(cy),re.register(OI),re.register(uy),re.register(NI);function hy(n){if(!n)return Nt.fromTransparent();try{return new Nt(Be(x1(n),"srgb"))}catch(e){return console.warn(e),Nt.fromBlack()}}function zI(n){const e={"to top":0,"to top right":45,"to right":90,"to bottom right":135,"to bottom":180,"to bottom left":225,"to left":270,"to top left":315};return e[n]?e[n]:n.includes("deg")?Number.parseInt(n.trim().replace("deg","")):0}function BI(n){return n.map(e=>{const[t,r]=e.trim().split(/\s+(?![^(]*\))/);return{color:hy(t),offset:Number.parseFloat(r.replace("%",""))}})}function FI(n){const e=n.indexOf("("),t=n.lastIndexOf(")"),[r,...i]=n.slice(e+1,t).split(/,(?![^(]*\))/),o=BI(i),a=zI(r);return{isEmpty:!1,isGradient:!0,solidColor:o[0].color,angle:a,transitions:o}}function HI(n){const e=hy(n),t=Nt.fromWhite();return{isEmpty:!1,isGradient:!1,solidColor:e,angle:0,transitions:[{color:t,offset:0},{color:e.withAlpha(1),offset:100}]}}function $I(n,e=!0){if(!n)return DI();const t=PI(n)?FI(n):HI(n);return t.isGradient&&!e?{...t,isGradient:!1}:t}class mh{constructor(e,t=0){Hn(this,"id"),this.color=e,this.offset=t,this.id=LI()}setOffset(e){this.offset=e}toString(){return`${this.color.toString()} ${this.offset}%`}clone(e){return new mh(this.color.clone(),e)}}class WI{constructor(e){Hn(this,"isEmpty",!1),Hn(this,"_angle",0),Hn(this,"_transitions",[]),this.update(e)}get transitions(){return this._transitions}get canAddTransition(){return this.transitions.length<5}get canRemoveTransition(){return this.transitions.length>2}get angle(){return this._angle}setAngle(e){this._angle=e}setEmpty(e){this.isEmpty=e}addTransition(e){this.transitions.push(e),this.sortTransitions()}removeTransition(e){this._transitions=this.transitions.filter(({id:t})=>t!==e.id)}sortTransitions(){this._transitions=this.transitions.sort((e,t)=>e.offset-t.offset)}toString(e){if(this.isEmpty)return"";const t=this.transitions.map(r=>r.toString());return`linear-gradient(${e??this.angle}deg, ${t.join(", ")})`}isEqual(e){return this.toString()===e}update(e){this._angle=e.angle,this._transitions=e.transitions.map(({color:t,offset:r})=>new mh(t,r)),this.setEmpty(e.isEmpty)}hasTransition(e){return this.transitions.some(t=>t.id===e.id)}}function UI(n){const e=$I(n);return(e.isGradient?new WI(e):new RI(e)).toString()}function dy(n){return UI(n)}function py(n,e){const t=Pi.getComputedStyle(e).fontSize,r=parseFloat(n)*parseFloat(t);return Math.round(r*10)/10}function my(n,e){return String(n).includes("em")?Math.round(py(n,e)):parseInt(n)}function VI(n,e){return(n.firstElementChild||n).style.fontSize||Pi.getComputedStyle(e).fontSize}function KI(n,e,t){if(!n.includes("px"))return n;const r=VI(e,t),i=my(r,t);return i?(parseInt(n)/i).toFixed(2):null}function GI(n,e){return String(n).includes("em")?py(n,e):parseFloat(n)}const JI={start:br.LEFT,end:br.RIGHT};function qI(n){const e=JI[n]||n;return YM.includes(e)?e:null}const gy=(n,e,t,r)=>({from:Math.max(r,n.pos),to:Math.min(r+t.nodeSize,e.pos)});function yy(n,e){return n.resolve(e).depth+1}function jI(n,e,t,r){const i=yy(n,r),o=e.from-i<=r,a=e.to+i>=t.nodeSize+r;return o&&a}const YI=(n,e)=>n.eq(e);function XI(n,e,t,r=YI){const i=n.resolve(e).path.slice().reverse();for(const o of i)if(typeof o!="number"){for(const a of o.marks)if(r(a,t))return!0}return!1}function ZI(n,e){const t=typeof e=="string"?e:e.name;return n.find(r=>r.type.name===t)}var Ca=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ws={exports:{}};var QI=Ws.exports,by;function eO(){return by||(by=1,function(n,e){(function(){var t,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",c="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",h=500,m="__lodash_placeholder__",p=1,g=2,b=4,S=1,E=2,C=1,M=2,P=4,F=8,$=16,U=32,ue=64,he=128,be=256,bt=512,Jn=30,sn="...",qn=800,Zr=16,on=1,vn=2,Fe=3,vt=1/0,jn=9007199254740991,Js=17976931348623157e292,ln=NaN,wt=4294967295,Ra=wt-1,La=wt>>>1,Pa=[["ary",he],["bind",C],["bindKey",M],["curry",F],["curryRight",$],["flip",bt],["partial",U],["partialRight",ue],["rearg",be]],Gt="[object Arguments]",qs="[object Array]",Ty="[object AsyncFunction]",Hi="[object Boolean]",$i="[object Date]",Cy="[object DOMException]",js="[object Error]",Ys="[object Function]",bh="[object GeneratorFunction]",Jt="[object Map]",Wi="[object Number]",My="[object Null]",wn="[object Object]",vh="[object Promise]",Ay="[object Proxy]",Ui="[object RegExp]",qt="[object Set]",Vi="[object String]",Xs="[object Symbol]",Iy="[object Undefined]",Ki="[object WeakMap]",Oy="[object WeakSet]",Gi="[object ArrayBuffer]",Qr="[object DataView]",Da="[object Float32Array]",za="[object Float64Array]",Ba="[object Int8Array]",Fa="[object Int16Array]",Ha="[object Int32Array]",$a="[object Uint8Array]",Wa="[object Uint8ClampedArray]",Ua="[object Uint16Array]",Va="[object Uint32Array]",Ny=/\b__p \+= '';/g,Ry=/\b(__p \+=) '' \+/g,Ly=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wh=/&(?:amp|lt|gt|quot|#39);/g,Sh=/[&<>"']/g,Py=RegExp(wh.source),Dy=RegExp(Sh.source),zy=/<%-([\s\S]+?)%>/g,By=/<%([\s\S]+?)%>/g,xh=/<%=([\s\S]+?)%>/g,Fy=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Hy=/^\w*$/,$y=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ka=/[\\^$.*+?()[\]{}|]/g,Wy=RegExp(Ka.source),Ga=/^\s+/,Uy=/\s/,Vy=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ky=/\{\n\/\* \[wrapped with (.+)\] \*/,Gy=/,? & /,Jy=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,qy=/[()=,{}\[\]\/\s]/,jy=/\\(\\)?/g,Yy=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Eh=/\w*$/,Xy=/^[-+]0x[0-9a-f]+$/i,Zy=/^0b[01]+$/i,Qy=/^\[object .+?Constructor\]$/,eb=/^0o[0-7]+$/i,tb=/^(?:0|[1-9]\d*)$/,nb=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zs=/($^)/,rb=/['\n\r\u2028\u2029\\]/g,Qs="\\ud800-\\udfff",ib="\\u0300-\\u036f",sb="\\ufe20-\\ufe2f",ob="\\u20d0-\\u20ff",kh=ib+sb+ob,_h="\\u2700-\\u27bf",Th="a-z\\xdf-\\xf6\\xf8-\\xff",lb="\\xac\\xb1\\xd7\\xf7",ab="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",cb="\\u2000-\\u206f",ub=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ch="A-Z\\xc0-\\xd6\\xd8-\\xde",Mh="\\ufe0e\\ufe0f",Ah=lb+ab+cb+ub,Ja="['\u2019]",fb="["+Qs+"]",Ih="["+Ah+"]",eo="["+kh+"]",Oh="\\d+",hb="["+_h+"]",Nh="["+Th+"]",Rh="[^"+Qs+Ah+Oh+_h+Th+Ch+"]",qa="\\ud83c[\\udffb-\\udfff]",db="(?:"+eo+"|"+qa+")",Lh="[^"+Qs+"]",ja="(?:\\ud83c[\\udde6-\\uddff]){2}",Ya="[\\ud800-\\udbff][\\udc00-\\udfff]",ei="["+Ch+"]",Ph="\\u200d",Dh="(?:"+Nh+"|"+Rh+")",pb="(?:"+ei+"|"+Rh+")",zh="(?:"+Ja+"(?:d|ll|m|re|s|t|ve))?",Bh="(?:"+Ja+"(?:D|LL|M|RE|S|T|VE))?",Fh=db+"?",Hh="["+Mh+"]?",mb="(?:"+Ph+"(?:"+[Lh,ja,Ya].join("|")+")"+Hh+Fh+")*",gb="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",yb="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",$h=Hh+Fh+mb,bb="(?:"+[hb,ja,Ya].join("|")+")"+$h,vb="(?:"+[Lh+eo+"?",eo,ja,Ya,fb].join("|")+")",wb=RegExp(Ja,"g"),Sb=RegExp(eo,"g"),Xa=RegExp(qa+"(?="+qa+")|"+vb+$h,"g"),xb=RegExp([ei+"?"+Nh+"+"+zh+"(?="+[Ih,ei,"$"].join("|")+")",pb+"+"+Bh+"(?="+[Ih,ei+Dh,"$"].join("|")+")",ei+"?"+Dh+"+"+zh,ei+"+"+Bh,yb,gb,Oh,bb].join("|"),"g"),Eb=RegExp("["+Ph+Qs+kh+Mh+"]"),kb=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,_b=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Tb=-1,xe={};xe[Da]=xe[za]=xe[Ba]=xe[Fa]=xe[Ha]=xe[$a]=xe[Wa]=xe[Ua]=xe[Va]=!0,xe[Gt]=xe[qs]=xe[Gi]=xe[Hi]=xe[Qr]=xe[$i]=xe[js]=xe[Ys]=xe[Jt]=xe[Wi]=xe[wn]=xe[Ui]=xe[qt]=xe[Vi]=xe[Ki]=!1;var Se={};Se[Gt]=Se[qs]=Se[Gi]=Se[Qr]=Se[Hi]=Se[$i]=Se[Da]=Se[za]=Se[Ba]=Se[Fa]=Se[Ha]=Se[Jt]=Se[Wi]=Se[wn]=Se[Ui]=Se[qt]=Se[Vi]=Se[Xs]=Se[$a]=Se[Wa]=Se[Ua]=Se[Va]=!0,Se[js]=Se[Ys]=Se[Ki]=!1;var Cb={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Mb={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ab={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Ib={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ob=parseFloat,Nb=parseInt,Wh=typeof Ca=="object"&&Ca&&Ca.Object===Object&&Ca,Rb=typeof self=="object"&&self&&self.Object===Object&&self,qe=Wh||Rb||Function("return this")(),Za=e&&!e.nodeType&&e,Cr=Za&&!0&&n&&!n.nodeType&&n,Uh=Cr&&Cr.exports===Za,Qa=Uh&&Wh.process,Rt=function(){try{var _=Cr&&Cr.require&&Cr.require("util").types;return _||Qa&&Qa.binding&&Qa.binding("util")}catch{}}(),Vh=Rt&&Rt.isArrayBuffer,Kh=Rt&&Rt.isDate,Gh=Rt&&Rt.isMap,Jh=Rt&&Rt.isRegExp,qh=Rt&&Rt.isSet,jh=Rt&&Rt.isTypedArray;function St(_,I,A){switch(A.length){case 0:return _.call(I);case 1:return _.call(I,A[0]);case 2:return _.call(I,A[0],A[1]);case 3:return _.call(I,A[0],A[1],A[2])}return _.apply(I,A)}function Lb(_,I,A,V){for(var X=-1,me=_==null?0:_.length;++X<me;){var Pe=_[X];I(V,Pe,A(Pe),_)}return V}function Lt(_,I){for(var A=-1,V=_==null?0:_.length;++A<V&&I(_[A],A,_)!==!1;);return _}function Pb(_,I){for(var A=_==null?0:_.length;A--&&I(_[A],A,_)!==!1;);return _}function Yh(_,I){for(var A=-1,V=_==null?0:_.length;++A<V;)if(!I(_[A],A,_))return!1;return!0}function Yn(_,I){for(var A=-1,V=_==null?0:_.length,X=0,me=[];++A<V;){var Pe=_[A];I(Pe,A,_)&&(me[X++]=Pe)}return me}function to(_,I){var A=_==null?0:_.length;return!!A&&ti(_,I,0)>-1}function ec(_,I,A){for(var V=-1,X=_==null?0:_.length;++V<X;)if(A(I,_[V]))return!0;return!1}function _e(_,I){for(var A=-1,V=_==null?0:_.length,X=Array(V);++A<V;)X[A]=I(_[A],A,_);return X}function Xn(_,I){for(var A=-1,V=I.length,X=_.length;++A<V;)_[X+A]=I[A];return _}function tc(_,I,A,V){var X=-1,me=_==null?0:_.length;for(V&&me&&(A=_[++X]);++X<me;)A=I(A,_[X],X,_);return A}function Db(_,I,A,V){var X=_==null?0:_.length;for(V&&X&&(A=_[--X]);X--;)A=I(A,_[X],X,_);return A}function nc(_,I){for(var A=-1,V=_==null?0:_.length;++A<V;)if(I(_[A],A,_))return!0;return!1}var zb=rc("length");function Bb(_){return _.split("")}function Fb(_){return _.match(Jy)||[]}function Xh(_,I,A){var V;return A(_,function(X,me,Pe){if(I(X,me,Pe))return V=me,!1}),V}function no(_,I,A,V){for(var X=_.length,me=A+(V?1:-1);V?me--:++me<X;)if(I(_[me],me,_))return me;return-1}function ti(_,I,A){return I===I?Xb(_,I,A):no(_,Zh,A)}function Hb(_,I,A,V){for(var X=A-1,me=_.length;++X<me;)if(V(_[X],I))return X;return-1}function Zh(_){return _!==_}function Qh(_,I){var A=_==null?0:_.length;return A?sc(_,I)/A:ln}function rc(_){return function(I){return I==null?t:I[_]}}function ic(_){return function(I){return _==null?t:_[I]}}function ed(_,I,A,V,X){return X(_,function(me,Pe,we){A=V?(V=!1,me):I(A,me,Pe,we)}),A}function $b(_,I){var A=_.length;for(_.sort(I);A--;)_[A]=_[A].value;return _}function sc(_,I){for(var A,V=-1,X=_.length;++V<X;){var me=I(_[V]);me!==t&&(A=A===t?me:A+me)}return A}function oc(_,I){for(var A=-1,V=Array(_);++A<_;)V[A]=I(A);return V}function Wb(_,I){return _e(I,function(A){return[A,_[A]]})}function td(_){return _&&_.slice(0,sd(_)+1).replace(Ga,"")}function xt(_){return function(I){return _(I)}}function lc(_,I){return _e(I,function(A){return _[A]})}function Ji(_,I){return _.has(I)}function nd(_,I){for(var A=-1,V=_.length;++A<V&&ti(I,_[A],0)>-1;);return A}function rd(_,I){for(var A=_.length;A--&&ti(I,_[A],0)>-1;);return A}function Ub(_,I){for(var A=_.length,V=0;A--;)_[A]===I&&++V;return V}var Vb=ic(Cb),Kb=ic(Mb);function Gb(_){return"\\"+Ib[_]}function Jb(_,I){return _==null?t:_[I]}function ni(_){return Eb.test(_)}function qb(_){return kb.test(_)}function jb(_){for(var I,A=[];!(I=_.next()).done;)A.push(I.value);return A}function ac(_){var I=-1,A=Array(_.size);return _.forEach(function(V,X){A[++I]=[X,V]}),A}function id(_,I){return function(A){return _(I(A))}}function Zn(_,I){for(var A=-1,V=_.length,X=0,me=[];++A<V;){var Pe=_[A];(Pe===I||Pe===m)&&(_[A]=m,me[X++]=A)}return me}function ro(_){var I=-1,A=Array(_.size);return _.forEach(function(V){A[++I]=V}),A}function Yb(_){var I=-1,A=Array(_.size);return _.forEach(function(V){A[++I]=[V,V]}),A}function Xb(_,I,A){for(var V=A-1,X=_.length;++V<X;)if(_[V]===I)return V;return-1}function Zb(_,I,A){for(var V=A+1;V--;)if(_[V]===I)return V;return V}function ri(_){return ni(_)?e2(_):zb(_)}function jt(_){return ni(_)?t2(_):Bb(_)}function sd(_){for(var I=_.length;I--&&Uy.test(_.charAt(I)););return I}var Qb=ic(Ab);function e2(_){for(var I=Xa.lastIndex=0;Xa.test(_);)++I;return I}function t2(_){return _.match(Xa)||[]}function n2(_){return _.match(xb)||[]}var r2=function _(I){I=I==null?qe:ii.defaults(qe.Object(),I,ii.pick(qe,_b));var A=I.Array,V=I.Date,X=I.Error,me=I.Function,Pe=I.Math,we=I.Object,cc=I.RegExp,i2=I.String,Pt=I.TypeError,io=A.prototype,s2=me.prototype,si=we.prototype,so=I["__core-js_shared__"],oo=s2.toString,ve=si.hasOwnProperty,o2=0,od=function(){var s=/[^.]+$/.exec(so&&so.keys&&so.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),lo=si.toString,l2=oo.call(we),a2=qe._,c2=cc("^"+oo.call(ve).replace(Ka,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ao=Uh?I.Buffer:t,Qn=I.Symbol,co=I.Uint8Array,ld=ao?ao.allocUnsafe:t,uo=id(we.getPrototypeOf,we),ad=we.create,cd=si.propertyIsEnumerable,fo=io.splice,ud=Qn?Qn.isConcatSpreadable:t,qi=Qn?Qn.iterator:t,Mr=Qn?Qn.toStringTag:t,ho=function(){try{var s=Rr(we,"defineProperty");return s({},"",{}),s}catch{}}(),u2=I.clearTimeout!==qe.clearTimeout&&I.clearTimeout,f2=V&&V.now!==qe.Date.now&&V.now,h2=I.setTimeout!==qe.setTimeout&&I.setTimeout,po=Pe.ceil,mo=Pe.floor,uc=we.getOwnPropertySymbols,d2=ao?ao.isBuffer:t,fd=I.isFinite,p2=io.join,m2=id(we.keys,we),De=Pe.max,Qe=Pe.min,g2=V.now,y2=I.parseInt,hd=Pe.random,b2=io.reverse,fc=Rr(I,"DataView"),ji=Rr(I,"Map"),hc=Rr(I,"Promise"),oi=Rr(I,"Set"),Yi=Rr(I,"WeakMap"),Xi=Rr(we,"create"),go=Yi&&new Yi,li={},v2=Lr(fc),w2=Lr(ji),S2=Lr(hc),x2=Lr(oi),E2=Lr(Yi),yo=Qn?Qn.prototype:t,Zi=yo?yo.valueOf:t,dd=yo?yo.toString:t;function v(s){if(Me(s)&&!Z(s)&&!(s instanceof oe)){if(s instanceof Dt)return s;if(ve.call(s,"__wrapped__"))return pp(s)}return new Dt(s)}var ai=function(){function s(){}return function(l){if(!Ce(l))return{};if(ad)return ad(l);s.prototype=l;var u=new s;return s.prototype=t,u}}();function bo(){}function Dt(s,l){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}v.templateSettings={escape:zy,evaluate:By,interpolate:xh,variable:"",imports:{_:v}},v.prototype=bo.prototype,v.prototype.constructor=v,Dt.prototype=ai(bo.prototype),Dt.prototype.constructor=Dt;function oe(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=wt,this.__views__=[]}function k2(){var s=new oe(this.__wrapped__);return s.__actions__=ct(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=ct(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=ct(this.__views__),s}function _2(){if(this.__filtered__){var s=new oe(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function T2(){var s=this.__wrapped__.value(),l=this.__dir__,u=Z(s),d=l<0,y=u?s.length:0,w=Bv(0,y,this.__views__),x=w.start,k=w.end,T=k-x,O=d?k:x-1,N=this.__iteratees__,R=N.length,H=0,G=Qe(T,this.__takeCount__);if(!u||!d&&y==T&&G==T)return zd(s,this.__actions__);var q=[];e:for(;T--&&H<G;){O+=l;for(var ee=-1,j=s[O];++ee<R;){var se=N[ee],fe=se.iteratee,_t=se.type,rt=fe(j);if(_t==vn)j=rt;else if(!rt){if(_t==on)continue e;break e}}q[H++]=j}return q}oe.prototype=ai(bo.prototype),oe.prototype.constructor=oe;function Ar(s){var l=-1,u=s==null?0:s.length;for(this.clear();++l<u;){var d=s[l];this.set(d[0],d[1])}}function C2(){this.__data__=Xi?Xi(null):{},this.size=0}function M2(s){var l=this.has(s)&&delete this.__data__[s];return this.size-=l?1:0,l}function A2(s){var l=this.__data__;if(Xi){var u=l[s];return u===f?t:u}return ve.call(l,s)?l[s]:t}function I2(s){var l=this.__data__;return Xi?l[s]!==t:ve.call(l,s)}function O2(s,l){var u=this.__data__;return this.size+=this.has(s)?0:1,u[s]=Xi&&l===t?f:l,this}Ar.prototype.clear=C2,Ar.prototype.delete=M2,Ar.prototype.get=A2,Ar.prototype.has=I2,Ar.prototype.set=O2;function Sn(s){var l=-1,u=s==null?0:s.length;for(this.clear();++l<u;){var d=s[l];this.set(d[0],d[1])}}function N2(){this.__data__=[],this.size=0}function R2(s){var l=this.__data__,u=vo(l,s);if(u<0)return!1;var d=l.length-1;return u==d?l.pop():fo.call(l,u,1),--this.size,!0}function L2(s){var l=this.__data__,u=vo(l,s);return u<0?t:l[u][1]}function P2(s){return vo(this.__data__,s)>-1}function D2(s,l){var u=this.__data__,d=vo(u,s);return d<0?(++this.size,u.push([s,l])):u[d][1]=l,this}Sn.prototype.clear=N2,Sn.prototype.delete=R2,Sn.prototype.get=L2,Sn.prototype.has=P2,Sn.prototype.set=D2;function xn(s){var l=-1,u=s==null?0:s.length;for(this.clear();++l<u;){var d=s[l];this.set(d[0],d[1])}}function z2(){this.size=0,this.__data__={hash:new Ar,map:new(ji||Sn),string:new Ar}}function B2(s){var l=Oo(this,s).delete(s);return this.size-=l?1:0,l}function F2(s){return Oo(this,s).get(s)}function H2(s){return Oo(this,s).has(s)}function $2(s,l){var u=Oo(this,s),d=u.size;return u.set(s,l),this.size+=u.size==d?0:1,this}xn.prototype.clear=z2,xn.prototype.delete=B2,xn.prototype.get=F2,xn.prototype.has=H2,xn.prototype.set=$2;function Ir(s){var l=-1,u=s==null?0:s.length;for(this.__data__=new xn;++l<u;)this.add(s[l])}function W2(s){return this.__data__.set(s,f),this}function U2(s){return this.__data__.has(s)}Ir.prototype.add=Ir.prototype.push=W2,Ir.prototype.has=U2;function Yt(s){var l=this.__data__=new Sn(s);this.size=l.size}function V2(){this.__data__=new Sn,this.size=0}function K2(s){var l=this.__data__,u=l.delete(s);return this.size=l.size,u}function G2(s){return this.__data__.get(s)}function J2(s){return this.__data__.has(s)}function q2(s,l){var u=this.__data__;if(u instanceof Sn){var d=u.__data__;if(!ji||d.length<i-1)return d.push([s,l]),this.size=++u.size,this;u=this.__data__=new xn(d)}return u.set(s,l),this.size=u.size,this}Yt.prototype.clear=V2,Yt.prototype.delete=K2,Yt.prototype.get=G2,Yt.prototype.has=J2,Yt.prototype.set=q2;function pd(s,l){var u=Z(s),d=!u&&Pr(s),y=!u&&!d&&ir(s),w=!u&&!d&&!y&&hi(s),x=u||d||y||w,k=x?oc(s.length,i2):[],T=k.length;for(var O in s)(l||ve.call(s,O))&&!(x&&(O=="length"||y&&(O=="offset"||O=="parent")||w&&(O=="buffer"||O=="byteLength"||O=="byteOffset")||Tn(O,T)))&&k.push(O);return k}function md(s){var l=s.length;return l?s[Ec(0,l-1)]:t}function j2(s,l){return No(ct(s),Or(l,0,s.length))}function Y2(s){return No(ct(s))}function dc(s,l,u){(u!==t&&!Xt(s[l],u)||u===t&&!(l in s))&&En(s,l,u)}function Qi(s,l,u){var d=s[l];(!(ve.call(s,l)&&Xt(d,u))||u===t&&!(l in s))&&En(s,l,u)}function vo(s,l){for(var u=s.length;u--;)if(Xt(s[u][0],l))return u;return-1}function X2(s,l,u,d){return er(s,function(y,w,x){l(d,y,u(y),x)}),d}function gd(s,l){return s&&cn(l,He(l),s)}function Z2(s,l){return s&&cn(l,ft(l),s)}function En(s,l,u){l=="__proto__"&&ho?ho(s,l,{configurable:!0,enumerable:!0,value:u,writable:!0}):s[l]=u}function pc(s,l){for(var u=-1,d=l.length,y=A(d),w=s==null;++u<d;)y[u]=w?t:qc(s,l[u]);return y}function Or(s,l,u){return s===s&&(u!==t&&(s=s<=u?s:u),l!==t&&(s=s>=l?s:l)),s}function zt(s,l,u,d,y,w){var x,k=l&p,T=l&g,O=l&b;if(u&&(x=y?u(s,d,y,w):u(s)),x!==t)return x;if(!Ce(s))return s;var N=Z(s);if(N){if(x=Hv(s),!k)return ct(s,x)}else{var R=et(s),H=R==Ys||R==bh;if(ir(s))return Hd(s,k);if(R==wn||R==Gt||H&&!y){if(x=T||H?{}:sp(s),!k)return T?Av(s,Z2(x,s)):Mv(s,gd(x,s))}else{if(!Se[R])return y?s:{};x=$v(s,R,k)}}w||(w=new Yt);var G=w.get(s);if(G)return G;w.set(s,x),Lp(s)?s.forEach(function(j){x.add(zt(j,l,u,j,s,w))}):Np(s)&&s.forEach(function(j,se){x.set(se,zt(j,l,u,se,s,w))});var q=O?T?Lc:Rc:T?ft:He,ee=N?t:q(s);return Lt(ee||s,function(j,se){ee&&(se=j,j=s[se]),Qi(x,se,zt(j,l,u,se,s,w))}),x}function Q2(s){var l=He(s);return function(u){return yd(u,s,l)}}function yd(s,l,u){var d=u.length;if(s==null)return!d;for(s=we(s);d--;){var y=u[d],w=l[y],x=s[y];if(x===t&&!(y in s)||!w(x))return!1}return!0}function bd(s,l,u){if(typeof s!="function")throw new Pt(a);return ls(function(){s.apply(t,u)},l)}function es(s,l,u,d){var y=-1,w=to,x=!0,k=s.length,T=[],O=l.length;if(!k)return T;u&&(l=_e(l,xt(u))),d?(w=ec,x=!1):l.length>=i&&(w=Ji,x=!1,l=new Ir(l));e:for(;++y<k;){var N=s[y],R=u==null?N:u(N);if(N=d||N!==0?N:0,x&&R===R){for(var H=O;H--;)if(l[H]===R)continue e;T.push(N)}else w(l,R,d)||T.push(N)}return T}var er=Kd(an),vd=Kd(gc,!0);function ev(s,l){var u=!0;return er(s,function(d,y,w){return u=!!l(d,y,w),u}),u}function wo(s,l,u){for(var d=-1,y=s.length;++d<y;){var w=s[d],x=l(w);if(x!=null&&(k===t?x===x&&!kt(x):u(x,k)))var k=x,T=w}return T}function tv(s,l,u,d){var y=s.length;for(u=Q(u),u<0&&(u=-u>y?0:y+u),d=d===t||d>y?y:Q(d),d<0&&(d+=y),d=u>d?0:Dp(d);u<d;)s[u++]=l;return s}function wd(s,l){var u=[];return er(s,function(d,y,w){l(d,y,w)&&u.push(d)}),u}function je(s,l,u,d,y){var w=-1,x=s.length;for(u||(u=Uv),y||(y=[]);++w<x;){var k=s[w];l>0&&u(k)?l>1?je(k,l-1,u,d,y):Xn(y,k):d||(y[y.length]=k)}return y}var mc=Gd(),Sd=Gd(!0);function an(s,l){return s&&mc(s,l,He)}function gc(s,l){return s&&Sd(s,l,He)}function So(s,l){return Yn(l,function(u){return Cn(s[u])})}function Nr(s,l){l=nr(l,s);for(var u=0,d=l.length;s!=null&&u<d;)s=s[un(l[u++])];return u&&u==d?s:t}function xd(s,l,u){var d=l(s);return Z(s)?d:Xn(d,u(s))}function tt(s){return s==null?s===t?Iy:My:Mr&&Mr in we(s)?zv(s):Yv(s)}function yc(s,l){return s>l}function nv(s,l){return s!=null&&ve.call(s,l)}function rv(s,l){return s!=null&&l in we(s)}function iv(s,l,u){return s>=Qe(l,u)&&s<De(l,u)}function bc(s,l,u){for(var d=u?ec:to,y=s[0].length,w=s.length,x=w,k=A(w),T=1/0,O=[];x--;){var N=s[x];x&&l&&(N=_e(N,xt(l))),T=Qe(N.length,T),k[x]=!u&&(l||y>=120&&N.length>=120)?new Ir(x&&N):t}N=s[0];var R=-1,H=k[0];e:for(;++R<y&&O.length<T;){var G=N[R],q=l?l(G):G;if(G=u||G!==0?G:0,!(H?Ji(H,q):d(O,q,u))){for(x=w;--x;){var ee=k[x];if(!(ee?Ji(ee,q):d(s[x],q,u)))continue e}H&&H.push(q),O.push(G)}}return O}function sv(s,l,u,d){return an(s,function(y,w,x){l(d,u(y),w,x)}),d}function ts(s,l,u){l=nr(l,s),s=cp(s,l);var d=s==null?s:s[un(Ft(l))];return d==null?t:St(d,s,u)}function Ed(s){return Me(s)&&tt(s)==Gt}function ov(s){return Me(s)&&tt(s)==Gi}function lv(s){return Me(s)&&tt(s)==$i}function ns(s,l,u,d,y){return s===l?!0:s==null||l==null||!Me(s)&&!Me(l)?s!==s&&l!==l:av(s,l,u,d,ns,y)}function av(s,l,u,d,y,w){var x=Z(s),k=Z(l),T=x?qs:et(s),O=k?qs:et(l);T=T==Gt?wn:T,O=O==Gt?wn:O;var N=T==wn,R=O==wn,H=T==O;if(H&&ir(s)){if(!ir(l))return!1;x=!0,N=!1}if(H&&!N)return w||(w=new Yt),x||hi(s)?np(s,l,u,d,y,w):Pv(s,l,T,u,d,y,w);if(!(u&S)){var G=N&&ve.call(s,"__wrapped__"),q=R&&ve.call(l,"__wrapped__");if(G||q){var ee=G?s.value():s,j=q?l.value():l;return w||(w=new Yt),y(ee,j,u,d,w)}}return H?(w||(w=new Yt),Dv(s,l,u,d,y,w)):!1}function cv(s){return Me(s)&&et(s)==Jt}function vc(s,l,u,d){var y=u.length,w=y,x=!d;if(s==null)return!w;for(s=we(s);y--;){var k=u[y];if(x&&k[2]?k[1]!==s[k[0]]:!(k[0]in s))return!1}for(;++y<w;){k=u[y];var T=k[0],O=s[T],N=k[1];if(x&&k[2]){if(O===t&&!(T in s))return!1}else{var R=new Yt;if(d)var H=d(O,N,T,s,l,R);if(!(H===t?ns(N,O,S|E,d,R):H))return!1}}return!0}function kd(s){if(!Ce(s)||Kv(s))return!1;var l=Cn(s)?c2:Qy;return l.test(Lr(s))}function uv(s){return Me(s)&&tt(s)==Ui}function fv(s){return Me(s)&&et(s)==qt}function hv(s){return Me(s)&&Bo(s.length)&&!!xe[tt(s)]}function _d(s){return typeof s=="function"?s:s==null?ht:typeof s=="object"?Z(s)?Md(s[0],s[1]):Cd(s):Jp(s)}function wc(s){if(!ss(s))return m2(s);var l=[];for(var u in we(s))ve.call(s,u)&&u!="constructor"&&l.push(u);return l}function dv(s){if(!Ce(s))return jv(s);var l=ss(s),u=[];for(var d in s)d=="constructor"&&(l||!ve.call(s,d))||u.push(d);return u}function Sc(s,l){return s<l}function Td(s,l){var u=-1,d=ut(s)?A(s.length):[];return er(s,function(y,w,x){d[++u]=l(y,w,x)}),d}function Cd(s){var l=Dc(s);return l.length==1&&l[0][2]?lp(l[0][0],l[0][1]):function(u){return u===s||vc(u,s,l)}}function Md(s,l){return Bc(s)&&op(l)?lp(un(s),l):function(u){var d=qc(u,s);return d===t&&d===l?jc(u,s):ns(l,d,S|E)}}function xo(s,l,u,d,y){s!==l&&mc(l,function(w,x){if(y||(y=new Yt),Ce(w))pv(s,l,x,u,xo,d,y);else{var k=d?d(Hc(s,x),w,x+"",s,l,y):t;k===t&&(k=w),dc(s,x,k)}},ft)}function pv(s,l,u,d,y,w,x){var k=Hc(s,u),T=Hc(l,u),O=x.get(T);if(O){dc(s,u,O);return}var N=w?w(k,T,u+"",s,l,x):t,R=N===t;if(R){var H=Z(T),G=!H&&ir(T),q=!H&&!G&&hi(T);N=T,H||G||q?Z(k)?N=k:Oe(k)?N=ct(k):G?(R=!1,N=Hd(T,!0)):q?(R=!1,N=$d(T,!0)):N=[]:as(T)||Pr(T)?(N=k,Pr(k)?N=zp(k):(!Ce(k)||Cn(k))&&(N=sp(T))):R=!1}R&&(x.set(T,N),y(N,T,d,w,x),x.delete(T)),dc(s,u,N)}function Ad(s,l){var u=s.length;if(u)return l+=l<0?u:0,Tn(l,u)?s[l]:t}function Id(s,l,u){l.length?l=_e(l,function(w){return Z(w)?function(x){return Nr(x,w.length===1?w[0]:w)}:w}):l=[ht];var d=-1;l=_e(l,xt(J()));var y=Td(s,function(w,x,k){var T=_e(l,function(O){return O(w)});return{criteria:T,index:++d,value:w}});return $b(y,function(w,x){return Cv(w,x,u)})}function mv(s,l){return Od(s,l,function(u,d){return jc(s,d)})}function Od(s,l,u){for(var d=-1,y=l.length,w={};++d<y;){var x=l[d],k=Nr(s,x);u(k,x)&&rs(w,nr(x,s),k)}return w}function gv(s){return function(l){return Nr(l,s)}}function xc(s,l,u,d){var y=d?Hb:ti,w=-1,x=l.length,k=s;for(s===l&&(l=ct(l)),u&&(k=_e(s,xt(u)));++w<x;)for(var T=0,O=l[w],N=u?u(O):O;(T=y(k,N,T,d))>-1;)k!==s&&fo.call(k,T,1),fo.call(s,T,1);return s}function Nd(s,l){for(var u=s?l.length:0,d=u-1;u--;){var y=l[u];if(u==d||y!==w){var w=y;Tn(y)?fo.call(s,y,1):Tc(s,y)}}return s}function Ec(s,l){return s+mo(hd()*(l-s+1))}function yv(s,l,u,d){for(var y=-1,w=De(po((l-s)/(u||1)),0),x=A(w);w--;)x[d?w:++y]=s,s+=u;return x}function kc(s,l){var u="";if(!s||l<1||l>jn)return u;do l%2&&(u+=s),l=mo(l/2),l&&(s+=s);while(l);return u}function ie(s,l){return $c(ap(s,l,ht),s+"")}function bv(s){return md(di(s))}function vv(s,l){var u=di(s);return No(u,Or(l,0,u.length))}function rs(s,l,u,d){if(!Ce(s))return s;l=nr(l,s);for(var y=-1,w=l.length,x=w-1,k=s;k!=null&&++y<w;){var T=un(l[y]),O=u;if(T==="__proto__"||T==="constructor"||T==="prototype")return s;if(y!=x){var N=k[T];O=d?d(N,T,k):t,O===t&&(O=Ce(N)?N:Tn(l[y+1])?[]:{})}Qi(k,T,O),k=k[T]}return s}var Rd=go?function(s,l){return go.set(s,l),s}:ht,wv=ho?function(s,l){return ho(s,"toString",{configurable:!0,enumerable:!1,value:Xc(l),writable:!0})}:ht;function Sv(s){return No(di(s))}function Bt(s,l,u){var d=-1,y=s.length;l<0&&(l=-l>y?0:y+l),u=u>y?y:u,u<0&&(u+=y),y=l>u?0:u-l>>>0,l>>>=0;for(var w=A(y);++d<y;)w[d]=s[d+l];return w}function xv(s,l){var u;return er(s,function(d,y,w){return u=l(d,y,w),!u}),!!u}function Eo(s,l,u){var d=0,y=s==null?d:s.length;if(typeof l=="number"&&l===l&&y<=La){for(;d<y;){var w=d+y>>>1,x=s[w];x!==null&&!kt(x)&&(u?x<=l:x<l)?d=w+1:y=w}return y}return _c(s,l,ht,u)}function _c(s,l,u,d){var y=0,w=s==null?0:s.length;if(w===0)return 0;l=u(l);for(var x=l!==l,k=l===null,T=kt(l),O=l===t;y<w;){var N=mo((y+w)/2),R=u(s[N]),H=R!==t,G=R===null,q=R===R,ee=kt(R);if(x)var j=d||q;else O?j=q&&(d||H):k?j=q&&H&&(d||!G):T?j=q&&H&&!G&&(d||!ee):G||ee?j=!1:j=d?R<=l:R<l;j?y=N+1:w=N}return Qe(w,Ra)}function Ld(s,l){for(var u=-1,d=s.length,y=0,w=[];++u<d;){var x=s[u],k=l?l(x):x;if(!u||!Xt(k,T)){var T=k;w[y++]=x===0?0:x}}return w}function Pd(s){return typeof s=="number"?s:kt(s)?ln:+s}function Et(s){if(typeof s=="string")return s;if(Z(s))return _e(s,Et)+"";if(kt(s))return dd?dd.call(s):"";var l=s+"";return l=="0"&&1/s==-1/0?"-0":l}function tr(s,l,u){var d=-1,y=to,w=s.length,x=!0,k=[],T=k;if(u)x=!1,y=ec;else if(w>=i){var O=l?null:Rv(s);if(O)return ro(O);x=!1,y=Ji,T=new Ir}else T=l?[]:k;e:for(;++d<w;){var N=s[d],R=l?l(N):N;if(N=u||N!==0?N:0,x&&R===R){for(var H=T.length;H--;)if(T[H]===R)continue e;l&&T.push(R),k.push(N)}else y(T,R,u)||(T!==k&&T.push(R),k.push(N))}return k}function Tc(s,l){return l=nr(l,s),s=cp(s,l),s==null||delete s[un(Ft(l))]}function Dd(s,l,u,d){return rs(s,l,u(Nr(s,l)),d)}function ko(s,l,u,d){for(var y=s.length,w=d?y:-1;(d?w--:++w<y)&&l(s[w],w,s););return u?Bt(s,d?0:w,d?w+1:y):Bt(s,d?w+1:0,d?y:w)}function zd(s,l){var u=s;return u instanceof oe&&(u=u.value()),tc(l,function(d,y){return y.func.apply(y.thisArg,Xn([d],y.args))},u)}function Cc(s,l,u){var d=s.length;if(d<2)return d?tr(s[0]):[];for(var y=-1,w=A(d);++y<d;)for(var x=s[y],k=-1;++k<d;)k!=y&&(w[y]=es(w[y]||x,s[k],l,u));return tr(je(w,1),l,u)}function Bd(s,l,u){for(var d=-1,y=s.length,w=l.length,x={};++d<y;){var k=d<w?l[d]:t;u(x,s[d],k)}return x}function Mc(s){return Oe(s)?s:[]}function Ac(s){return typeof s=="function"?s:ht}function nr(s,l){return Z(s)?s:Bc(s,l)?[s]:dp(ge(s))}var Ev=ie;function rr(s,l,u){var d=s.length;return u=u===t?d:u,!l&&u>=d?s:Bt(s,l,u)}var Fd=u2||function(s){return qe.clearTimeout(s)};function Hd(s,l){if(l)return s.slice();var u=s.length,d=ld?ld(u):new s.constructor(u);return s.copy(d),d}function Ic(s){var l=new s.constructor(s.byteLength);return new co(l).set(new co(s)),l}function kv(s,l){var u=l?Ic(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.byteLength)}function _v(s){var l=new s.constructor(s.source,Eh.exec(s));return l.lastIndex=s.lastIndex,l}function Tv(s){return Zi?we(Zi.call(s)):{}}function $d(s,l){var u=l?Ic(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.length)}function Wd(s,l){if(s!==l){var u=s!==t,d=s===null,y=s===s,w=kt(s),x=l!==t,k=l===null,T=l===l,O=kt(l);if(!k&&!O&&!w&&s>l||w&&x&&T&&!k&&!O||d&&x&&T||!u&&T||!y)return 1;if(!d&&!w&&!O&&s<l||O&&u&&y&&!d&&!w||k&&u&&y||!x&&y||!T)return-1}return 0}function Cv(s,l,u){for(var d=-1,y=s.criteria,w=l.criteria,x=y.length,k=u.length;++d<x;){var T=Wd(y[d],w[d]);if(T){if(d>=k)return T;var O=u[d];return T*(O=="desc"?-1:1)}}return s.index-l.index}function Ud(s,l,u,d){for(var y=-1,w=s.length,x=u.length,k=-1,T=l.length,O=De(w-x,0),N=A(T+O),R=!d;++k<T;)N[k]=l[k];for(;++y<x;)(R||y<w)&&(N[u[y]]=s[y]);for(;O--;)N[k++]=s[y++];return N}function Vd(s,l,u,d){for(var y=-1,w=s.length,x=-1,k=u.length,T=-1,O=l.length,N=De(w-k,0),R=A(N+O),H=!d;++y<N;)R[y]=s[y];for(var G=y;++T<O;)R[G+T]=l[T];for(;++x<k;)(H||y<w)&&(R[G+u[x]]=s[y++]);return R}function ct(s,l){var u=-1,d=s.length;for(l||(l=A(d));++u<d;)l[u]=s[u];return l}function cn(s,l,u,d){var y=!u;u||(u={});for(var w=-1,x=l.length;++w<x;){var k=l[w],T=d?d(u[k],s[k],k,u,s):t;T===t&&(T=s[k]),y?En(u,k,T):Qi(u,k,T)}return u}function Mv(s,l){return cn(s,zc(s),l)}function Av(s,l){return cn(s,rp(s),l)}function _o(s,l){return function(u,d){var y=Z(u)?Lb:X2,w=l?l():{};return y(u,s,J(d,2),w)}}function ci(s){return ie(function(l,u){var d=-1,y=u.length,w=y>1?u[y-1]:t,x=y>2?u[2]:t;for(w=s.length>3&&typeof w=="function"?(y--,w):t,x&&nt(u[0],u[1],x)&&(w=y<3?t:w,y=1),l=we(l);++d<y;){var k=u[d];k&&s(l,k,d,w)}return l})}function Kd(s,l){return function(u,d){if(u==null)return u;if(!ut(u))return s(u,d);for(var y=u.length,w=l?y:-1,x=we(u);(l?w--:++w<y)&&d(x[w],w,x)!==!1;);return u}}function Gd(s){return function(l,u,d){for(var y=-1,w=we(l),x=d(l),k=x.length;k--;){var T=x[s?k:++y];if(u(w[T],T,w)===!1)break}return l}}function Iv(s,l,u){var d=l&C,y=is(s);function w(){var x=this&&this!==qe&&this instanceof w?y:s;return x.apply(d?u:this,arguments)}return w}function Jd(s){return function(l){l=ge(l);var u=ni(l)?jt(l):t,d=u?u[0]:l.charAt(0),y=u?rr(u,1).join(""):l.slice(1);return d[s]()+y}}function ui(s){return function(l){return tc(Kp(Vp(l).replace(wb,"")),s,"")}}function is(s){return function(){var l=arguments;switch(l.length){case 0:return new s;case 1:return new s(l[0]);case 2:return new s(l[0],l[1]);case 3:return new s(l[0],l[1],l[2]);case 4:return new s(l[0],l[1],l[2],l[3]);case 5:return new s(l[0],l[1],l[2],l[3],l[4]);case 6:return new s(l[0],l[1],l[2],l[3],l[4],l[5]);case 7:return new s(l[0],l[1],l[2],l[3],l[4],l[5],l[6])}var u=ai(s.prototype),d=s.apply(u,l);return Ce(d)?d:u}}function Ov(s,l,u){var d=is(s);function y(){for(var w=arguments.length,x=A(w),k=w,T=fi(y);k--;)x[k]=arguments[k];var O=w<3&&x[0]!==T&&x[w-1]!==T?[]:Zn(x,T);if(w-=O.length,w<u)return Zd(s,l,To,y.placeholder,t,x,O,t,t,u-w);var N=this&&this!==qe&&this instanceof y?d:s;return St(N,this,x)}return y}function qd(s){return function(l,u,d){var y=we(l);if(!ut(l)){var w=J(u,3);l=He(l),u=function(k){return w(y[k],k,y)}}var x=s(l,u,d);return x>-1?y[w?l[x]:x]:t}}function jd(s){return _n(function(l){var u=l.length,d=u,y=Dt.prototype.thru;for(s&&l.reverse();d--;){var w=l[d];if(typeof w!="function")throw new Pt(a);if(y&&!x&&Io(w)=="wrapper")var x=new Dt([],!0)}for(d=x?d:u;++d<u;){w=l[d];var k=Io(w),T=k=="wrapper"?Pc(w):t;T&&Fc(T[0])&&T[1]==(he|F|U|be)&&!T[4].length&&T[9]==1?x=x[Io(T[0])].apply(x,T[3]):x=w.length==1&&Fc(w)?x[k]():x.thru(w)}return function(){var O=arguments,N=O[0];if(x&&O.length==1&&Z(N))return x.plant(N).value();for(var R=0,H=u?l[R].apply(this,O):N;++R<u;)H=l[R].call(this,H);return H}})}function To(s,l,u,d,y,w,x,k,T,O){var N=l&he,R=l&C,H=l&M,G=l&(F|$),q=l&bt,ee=H?t:is(s);function j(){for(var se=arguments.length,fe=A(se),_t=se;_t--;)fe[_t]=arguments[_t];if(G)var rt=fi(j),Tt=Ub(fe,rt);if(d&&(fe=Ud(fe,d,y,G)),w&&(fe=Vd(fe,w,x,G)),se-=Tt,G&&se<O){var Ne=Zn(fe,rt);return Zd(s,l,To,j.placeholder,u,fe,Ne,k,T,O-se)}var Zt=R?u:this,An=H?Zt[s]:s;return se=fe.length,k?fe=Xv(fe,k):q&&se>1&&fe.reverse(),N&&T<se&&(fe.length=T),this&&this!==qe&&this instanceof j&&(An=ee||is(An)),An.apply(Zt,fe)}return j}function Yd(s,l){return function(u,d){return sv(u,s,l(d),{})}}function Co(s,l){return function(u,d){var y;if(u===t&&d===t)return l;if(u!==t&&(y=u),d!==t){if(y===t)return d;typeof u=="string"||typeof d=="string"?(u=Et(u),d=Et(d)):(u=Pd(u),d=Pd(d)),y=s(u,d)}return y}}function Oc(s){return _n(function(l){return l=_e(l,xt(J())),ie(function(u){var d=this;return s(l,function(y){return St(y,d,u)})})})}function Mo(s,l){l=l===t?" ":Et(l);var u=l.length;if(u<2)return u?kc(l,s):l;var d=kc(l,po(s/ri(l)));return ni(l)?rr(jt(d),0,s).join(""):d.slice(0,s)}function Nv(s,l,u,d){var y=l&C,w=is(s);function x(){for(var k=-1,T=arguments.length,O=-1,N=d.length,R=A(N+T),H=this&&this!==qe&&this instanceof x?w:s;++O<N;)R[O]=d[O];for(;T--;)R[O++]=arguments[++k];return St(H,y?u:this,R)}return x}function Xd(s){return function(l,u,d){return d&&typeof d!="number"&&nt(l,u,d)&&(u=d=t),l=Mn(l),u===t?(u=l,l=0):u=Mn(u),d=d===t?l<u?1:-1:Mn(d),yv(l,u,d,s)}}function Ao(s){return function(l,u){return typeof l=="string"&&typeof u=="string"||(l=Ht(l),u=Ht(u)),s(l,u)}}function Zd(s,l,u,d,y,w,x,k,T,O){var N=l&F,R=N?x:t,H=N?t:x,G=N?w:t,q=N?t:w;l|=N?U:ue,l&=~(N?ue:U),l&P||(l&=-4);var ee=[s,l,y,G,R,q,H,k,T,O],j=u.apply(t,ee);return Fc(s)&&up(j,ee),j.placeholder=d,fp(j,s,l)}function Nc(s){var l=Pe[s];return function(u,d){if(u=Ht(u),d=d==null?0:Qe(Q(d),292),d&&fd(u)){var y=(ge(u)+"e").split("e"),w=l(y[0]+"e"+(+y[1]+d));return y=(ge(w)+"e").split("e"),+(y[0]+"e"+(+y[1]-d))}return l(u)}}var Rv=oi&&1/ro(new oi([,-0]))[1]==vt?function(s){return new oi(s)}:eu;function Qd(s){return function(l){var u=et(l);return u==Jt?ac(l):u==qt?Yb(l):Wb(l,s(l))}}function kn(s,l,u,d,y,w,x,k){var T=l&M;if(!T&&typeof s!="function")throw new Pt(a);var O=d?d.length:0;if(O||(l&=-97,d=y=t),x=x===t?x:De(Q(x),0),k=k===t?k:Q(k),O-=y?y.length:0,l&ue){var N=d,R=y;d=y=t}var H=T?t:Pc(s),G=[s,l,u,d,y,N,R,w,x,k];if(H&&qv(G,H),s=G[0],l=G[1],u=G[2],d=G[3],y=G[4],k=G[9]=G[9]===t?T?0:s.length:De(G[9]-O,0),!k&&l&(F|$)&&(l&=-25),!l||l==C)var q=Iv(s,l,u);else l==F||l==$?q=Ov(s,l,k):(l==U||l==(C|U))&&!y.length?q=Nv(s,l,u,d):q=To.apply(t,G);var ee=H?Rd:up;return fp(ee(q,G),s,l)}function ep(s,l,u,d){return s===t||Xt(s,si[u])&&!ve.call(d,u)?l:s}function tp(s,l,u,d,y,w){return Ce(s)&&Ce(l)&&(w.set(l,s),xo(s,l,t,tp,w),w.delete(l)),s}function Lv(s){return as(s)?t:s}function np(s,l,u,d,y,w){var x=u&S,k=s.length,T=l.length;if(k!=T&&!(x&&T>k))return!1;var O=w.get(s),N=w.get(l);if(O&&N)return O==l&&N==s;var R=-1,H=!0,G=u&E?new Ir:t;for(w.set(s,l),w.set(l,s);++R<k;){var q=s[R],ee=l[R];if(d)var j=x?d(ee,q,R,l,s,w):d(q,ee,R,s,l,w);if(j!==t){if(j)continue;H=!1;break}if(G){if(!nc(l,function(se,fe){if(!Ji(G,fe)&&(q===se||y(q,se,u,d,w)))return G.push(fe)})){H=!1;break}}else if(!(q===ee||y(q,ee,u,d,w))){H=!1;break}}return w.delete(s),w.delete(l),H}function Pv(s,l,u,d,y,w,x){switch(u){case Qr:if(s.byteLength!=l.byteLength||s.byteOffset!=l.byteOffset)return!1;s=s.buffer,l=l.buffer;case Gi:return!(s.byteLength!=l.byteLength||!w(new co(s),new co(l)));case Hi:case $i:case Wi:return Xt(+s,+l);case js:return s.name==l.name&&s.message==l.message;case Ui:case Vi:return s==l+"";case Jt:var k=ac;case qt:var T=d&S;if(k||(k=ro),s.size!=l.size&&!T)return!1;var O=x.get(s);if(O)return O==l;d|=E,x.set(s,l);var N=np(k(s),k(l),d,y,w,x);return x.delete(s),N;case Xs:if(Zi)return Zi.call(s)==Zi.call(l)}return!1}function Dv(s,l,u,d,y,w){var x=u&S,k=Rc(s),T=k.length,O=Rc(l),N=O.length;if(T!=N&&!x)return!1;for(var R=T;R--;){var H=k[R];if(!(x?H in l:ve.call(l,H)))return!1}var G=w.get(s),q=w.get(l);if(G&&q)return G==l&&q==s;var ee=!0;w.set(s,l),w.set(l,s);for(var j=x;++R<T;){H=k[R];var se=s[H],fe=l[H];if(d)var _t=x?d(fe,se,H,l,s,w):d(se,fe,H,s,l,w);if(!(_t===t?se===fe||y(se,fe,u,d,w):_t)){ee=!1;break}j||(j=H=="constructor")}if(ee&&!j){var rt=s.constructor,Tt=l.constructor;rt!=Tt&&"constructor"in s&&"constructor"in l&&!(typeof rt=="function"&&rt instanceof rt&&typeof Tt=="function"&&Tt instanceof Tt)&&(ee=!1)}return w.delete(s),w.delete(l),ee}function _n(s){return $c(ap(s,t,yp),s+"")}function Rc(s){return xd(s,He,zc)}function Lc(s){return xd(s,ft,rp)}var Pc=go?function(s){return go.get(s)}:eu;function Io(s){for(var l=s.name+"",u=li[l],d=ve.call(li,l)?u.length:0;d--;){var y=u[d],w=y.func;if(w==null||w==s)return y.name}return l}function fi(s){var l=ve.call(v,"placeholder")?v:s;return l.placeholder}function J(){var s=v.iteratee||Zc;return s=s===Zc?_d:s,arguments.length?s(arguments[0],arguments[1]):s}function Oo(s,l){var u=s.__data__;return Vv(l)?u[typeof l=="string"?"string":"hash"]:u.map}function Dc(s){for(var l=He(s),u=l.length;u--;){var d=l[u],y=s[d];l[u]=[d,y,op(y)]}return l}function Rr(s,l){var u=Jb(s,l);return kd(u)?u:t}function zv(s){var l=ve.call(s,Mr),u=s[Mr];try{s[Mr]=t;var d=!0}catch{}var y=lo.call(s);return d&&(l?s[Mr]=u:delete s[Mr]),y}var zc=uc?function(s){return s==null?[]:(s=we(s),Yn(uc(s),function(l){return cd.call(s,l)}))}:tu,rp=uc?function(s){for(var l=[];s;)Xn(l,zc(s)),s=uo(s);return l}:tu,et=tt;(fc&&et(new fc(new ArrayBuffer(1)))!=Qr||ji&&et(new ji)!=Jt||hc&&et(hc.resolve())!=vh||oi&&et(new oi)!=qt||Yi&&et(new Yi)!=Ki)&&(et=function(s){var l=tt(s),u=l==wn?s.constructor:t,d=u?Lr(u):"";if(d)switch(d){case v2:return Qr;case w2:return Jt;case S2:return vh;case x2:return qt;case E2:return Ki}return l});function Bv(s,l,u){for(var d=-1,y=u.length;++d<y;){var w=u[d],x=w.size;switch(w.type){case"drop":s+=x;break;case"dropRight":l-=x;break;case"take":l=Qe(l,s+x);break;case"takeRight":s=De(s,l-x);break}}return{start:s,end:l}}function Fv(s){var l=s.match(Ky);return l?l[1].split(Gy):[]}function ip(s,l,u){l=nr(l,s);for(var d=-1,y=l.length,w=!1;++d<y;){var x=un(l[d]);if(!(w=s!=null&&u(s,x)))break;s=s[x]}return w||++d!=y?w:(y=s==null?0:s.length,!!y&&Bo(y)&&Tn(x,y)&&(Z(s)||Pr(s)))}function Hv(s){var l=s.length,u=new s.constructor(l);return l&&typeof s[0]=="string"&&ve.call(s,"index")&&(u.index=s.index,u.input=s.input),u}function sp(s){return typeof s.constructor=="function"&&!ss(s)?ai(uo(s)):{}}function $v(s,l,u){var d=s.constructor;switch(l){case Gi:return Ic(s);case Hi:case $i:return new d(+s);case Qr:return kv(s,u);case Da:case za:case Ba:case Fa:case Ha:case $a:case Wa:case Ua:case Va:return $d(s,u);case Jt:return new d;case Wi:case Vi:return new d(s);case Ui:return _v(s);case qt:return new d;case Xs:return Tv(s)}}function Wv(s,l){var u=l.length;if(!u)return s;var d=u-1;return l[d]=(u>1?"& ":"")+l[d],l=l.join(u>2?", ":" "),s.replace(Vy,`{
21
21
  /* [wrapped with `+l+`] */
22
- `)}function Wv(s){return Z(s)||Lr(s)||!!(ud&&s&&s[ud])}function Tn(s,l){var u=typeof s;return l=l??jn,!!l&&(u=="number"||u!="symbol"&&e2.test(s))&&s>-1&&s%1==0&&s<l}function nt(s,l,u){if(!Ce(u))return!1;var d=typeof l;return(d=="number"?ut(u)&&Tn(l,u.length):d=="string"&&l in u)?Xt(u[l],s):!1}function zc(s,l){if(Z(s))return!1;var u=typeof s;return u=="number"||u=="symbol"||u=="boolean"||s==null||Et(s)?!0:Fy.test(s)||!zy.test(s)||l!=null&&s in we(l)}function Uv(s){var l=typeof s;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?s!=="__proto__":s===null}function Fc(s){var l=Io(s),u=v[l];if(typeof u!="function"||!(l in oe.prototype))return!1;if(s===u)return!0;var d=Pc(u);return!!d&&s===d[0]}function Vv(s){return!!od&&od in s}var Kv=so?Cn:nu;function ss(s){var l=s&&s.constructor,u=typeof l=="function"&&l.prototype||si;return s===u}function op(s){return s===s&&!Ce(s)}function lp(s,l){return function(u){return u==null?!1:u[s]===l&&(l!==t||s in we(u))}}function Gv(s){var l=Do(s,function(d){return u.size===h&&u.clear(),d}),u=l.cache;return l}function Jv(s,l){var u=s[1],d=l[1],y=u|d,w=y<(C|M|he),x=d==he&&u==F||d==he&&u==be&&s[7].length<=l[8]||d==(he|be)&&l[7].length<=l[8]&&u==F;if(!(w||x))return s;d&C&&(s[2]=l[2],y|=u&C?0:P);var k=l[3];if(k){var T=s[3];s[3]=T?Ud(T,k,l[4]):k,s[4]=T?Zn(s[3],m):l[4]}return k=l[5],k&&(T=s[5],s[5]=T?Vd(T,k,l[6]):k,s[6]=T?Zn(s[5],m):l[6]),k=l[7],k&&(s[7]=k),d&he&&(s[8]=s[8]==null?l[8]:Qe(s[8],l[8])),s[9]==null&&(s[9]=l[9]),s[0]=l[0],s[1]=y,s}function qv(s){var l=[];if(s!=null)for(var u in we(s))l.push(u);return l}function jv(s){return lo.call(s)}function ap(s,l,u){return l=De(l===t?s.length-1:l,0),function(){for(var d=arguments,y=-1,w=De(d.length-l,0),x=A(w);++y<w;)x[y]=d[l+y];y=-1;for(var k=A(l+1);++y<l;)k[y]=d[y];return k[l]=u(x),wt(s,this,k)}}function cp(s,l){return l.length<2?s:Or(s,Bt(l,0,-1))}function Yv(s,l){for(var u=s.length,d=Qe(l.length,u),y=ct(s);d--;){var w=l[d];s[d]=Tn(w,u)?y[w]:t}return s}function Hc(s,l){if(!(l==="constructor"&&typeof s[l]=="function")&&l!="__proto__")return s[l]}var up=hp(Rd),ls=fb||function(s,l){return qe.setTimeout(s,l)},$c=hp(vv);function fp(s,l,u){var d=l+"";return $c(s,$v(d,Xv(zv(d),u)))}function hp(s){var l=0,u=0;return function(){var d=mb(),y=Zr-(d-u);if(u=d,y>0){if(++l>=qn)return arguments[0]}else l=0;return s.apply(t,arguments)}}function No(s,l){var u=-1,d=s.length,y=d-1;for(l=l===t?d:l;++u<l;){var w=Ec(u,y),x=s[w];s[w]=s[u],s[u]=x}return s.length=l,s}var dp=Gv(function(s){var l=[];return s.charCodeAt(0)===46&&l.push(""),s.replace(Hy,function(u,d,y,w){l.push(y?w.replace(qy,"$1"):d||u)}),l});function un(s){if(typeof s=="string"||Et(s))return s;var l=s+"";return l=="0"&&1/s==-1/0?"-0":l}function Rr(s){if(s!=null){try{return oo.call(s)}catch{}try{return s+""}catch{}}return""}function Xv(s,l){return Rt(Pa,function(u){var d="_."+u[0];l&u[1]&&!to(s,d)&&s.push(d)}),s.sort()}function pp(s){if(s instanceof oe)return s.clone();var l=new Pt(s.__wrapped__,s.__chain__);return l.__actions__=ct(s.__actions__),l.__index__=s.__index__,l.__values__=s.__values__,l}function Zv(s,l,u){(u?nt(s,l,u):l===t)?l=1:l=De(Q(l),0);var d=s==null?0:s.length;if(!d||l<1)return[];for(var y=0,w=0,x=A(po(d/l));y<d;)x[w++]=Bt(s,y,y+=l);return x}function Qv(s){for(var l=-1,u=s==null?0:s.length,d=0,y=[];++l<u;){var w=s[l];w&&(y[d++]=w)}return y}function ew(){var s=arguments.length;if(!s)return[];for(var l=A(s-1),u=arguments[0],d=s;d--;)l[d-1]=arguments[d];return Xn(Z(u)?ct(u):[u],je(l,1))}var tw=ie(function(s,l){return Oe(s)?es(s,je(l,1,Oe,!0)):[]}),nw=ie(function(s,l){var u=zt(l);return Oe(u)&&(u=t),Oe(s)?es(s,je(l,1,Oe,!0),J(u,2)):[]}),rw=ie(function(s,l){var u=zt(l);return Oe(u)&&(u=t),Oe(s)?es(s,je(l,1,Oe,!0),t,u):[]});function iw(s,l,u){var d=s==null?0:s.length;return d?(l=u||l===t?1:Q(l),Bt(s,l<0?0:l,d)):[]}function sw(s,l,u){var d=s==null?0:s.length;return d?(l=u||l===t?1:Q(l),l=d-l,Bt(s,0,l<0?0:l)):[]}function ow(s,l){return s&&s.length?ko(s,J(l,3),!0,!0):[]}function lw(s,l){return s&&s.length?ko(s,J(l,3),!0):[]}function aw(s,l,u,d){var y=s==null?0:s.length;return y?(u&&typeof u!="number"&&nt(s,l,u)&&(u=0,d=y),ev(s,l,u,d)):[]}function mp(s,l,u){var d=s==null?0:s.length;if(!d)return-1;var y=u==null?0:Q(u);return y<0&&(y=De(d+y,0)),no(s,J(l,3),y)}function gp(s,l,u){var d=s==null?0:s.length;if(!d)return-1;var y=d-1;return u!==t&&(y=Q(u),y=u<0?De(d+y,0):Qe(y,d-1)),no(s,J(l,3),y,!0)}function yp(s){var l=s==null?0:s.length;return l?je(s,1):[]}function cw(s){var l=s==null?0:s.length;return l?je(s,bt):[]}function uw(s,l){var u=s==null?0:s.length;return u?(l=l===t?1:Q(l),je(s,l)):[]}function fw(s){for(var l=-1,u=s==null?0:s.length,d={};++l<u;){var y=s[l];d[y[0]]=y[1]}return d}function bp(s){return s&&s.length?s[0]:t}function hw(s,l,u){var d=s==null?0:s.length;if(!d)return-1;var y=u==null?0:Q(u);return y<0&&(y=De(d+y,0)),ti(s,l,y)}function dw(s){var l=s==null?0:s.length;return l?Bt(s,0,-1):[]}var pw=ie(function(s){var l=ke(s,Mc);return l.length&&l[0]===s[0]?bc(l):[]}),mw=ie(function(s){var l=zt(s),u=ke(s,Mc);return l===zt(u)?l=t:u.pop(),u.length&&u[0]===s[0]?bc(u,J(l,2)):[]}),gw=ie(function(s){var l=zt(s),u=ke(s,Mc);return l=typeof l=="function"?l:t,l&&u.pop(),u.length&&u[0]===s[0]?bc(u,t,l):[]});function yw(s,l){return s==null?"":db.call(s,l)}function zt(s){var l=s==null?0:s.length;return l?s[l-1]:t}function bw(s,l,u){var d=s==null?0:s.length;if(!d)return-1;var y=d;return u!==t&&(y=Q(u),y=y<0?De(d+y,0):Qe(y,d-1)),l===l?X2(s,l,y):no(s,Zh,y,!0)}function vw(s,l){return s&&s.length?Ad(s,Q(l)):t}var ww=ie(vp);function vp(s,l){return s&&s.length&&l&&l.length?xc(s,l):s}function Sw(s,l,u){return s&&s.length&&l&&l.length?xc(s,l,J(u,2)):s}function xw(s,l,u){return s&&s.length&&l&&l.length?xc(s,l,t,u):s}var Ew=_n(function(s,l){var u=s==null?0:s.length,d=pc(s,l);return Nd(s,ke(l,function(y){return Tn(y,u)?+y:y}).sort(Wd)),d});function kw(s,l){var u=[];if(!(s&&s.length))return u;var d=-1,y=[],w=s.length;for(l=J(l,3);++d<w;){var x=s[d];l(x,d,s)&&(u.push(x),y.push(d))}return Nd(s,y),u}function Wc(s){return s==null?s:yb.call(s)}function _w(s,l,u){var d=s==null?0:s.length;return d?(u&&typeof u!="number"&&nt(s,l,u)?(l=0,u=d):(l=l==null?0:Q(l),u=u===t?d:Q(u)),Bt(s,l,u)):[]}function Tw(s,l){return Eo(s,l)}function Cw(s,l,u){return _c(s,l,J(u,2))}function Mw(s,l){var u=s==null?0:s.length;if(u){var d=Eo(s,l);if(d<u&&Xt(s[d],l))return d}return-1}function Aw(s,l){return Eo(s,l,!0)}function Iw(s,l,u){return _c(s,l,J(u,2),!0)}function Ow(s,l){var u=s==null?0:s.length;if(u){var d=Eo(s,l,!0)-1;if(Xt(s[d],l))return d}return-1}function Nw(s){return s&&s.length?Ld(s):[]}function Rw(s,l){return s&&s.length?Ld(s,J(l,2)):[]}function Lw(s){var l=s==null?0:s.length;return l?Bt(s,1,l):[]}function Pw(s,l,u){return s&&s.length?(l=u||l===t?1:Q(l),Bt(s,0,l<0?0:l)):[]}function Dw(s,l,u){var d=s==null?0:s.length;return d?(l=u||l===t?1:Q(l),l=d-l,Bt(s,l<0?0:l,d)):[]}function Bw(s,l){return s&&s.length?ko(s,J(l,3),!1,!0):[]}function zw(s,l){return s&&s.length?ko(s,J(l,3)):[]}var Fw=ie(function(s){return tr(je(s,1,Oe,!0))}),Hw=ie(function(s){var l=zt(s);return Oe(l)&&(l=t),tr(je(s,1,Oe,!0),J(l,2))}),$w=ie(function(s){var l=zt(s);return l=typeof l=="function"?l:t,tr(je(s,1,Oe,!0),t,l)});function Ww(s){return s&&s.length?tr(s):[]}function Uw(s,l){return s&&s.length?tr(s,J(l,2)):[]}function Vw(s,l){return l=typeof l=="function"?l:t,s&&s.length?tr(s,t,l):[]}function Uc(s){if(!(s&&s.length))return[];var l=0;return s=Yn(s,function(u){if(Oe(u))return l=De(u.length,l),!0}),oc(l,function(u){return ke(s,rc(u))})}function wp(s,l){if(!(s&&s.length))return[];var u=Uc(s);return l==null?u:ke(u,function(d){return wt(l,t,d)})}var Kw=ie(function(s,l){return Oe(s)?es(s,l):[]}),Gw=ie(function(s){return Cc(Yn(s,Oe))}),Jw=ie(function(s){var l=zt(s);return Oe(l)&&(l=t),Cc(Yn(s,Oe),J(l,2))}),qw=ie(function(s){var l=zt(s);return l=typeof l=="function"?l:t,Cc(Yn(s,Oe),t,l)}),jw=ie(Uc);function Yw(s,l){return zd(s||[],l||[],Qi)}function Xw(s,l){return zd(s||[],l||[],rs)}var Zw=ie(function(s){var l=s.length,u=l>1?s[l-1]:t;return u=typeof u=="function"?(s.pop(),u):t,wp(s,u)});function Sp(s){var l=v(s);return l.__chain__=!0,l}function Qw(s,l){return l(s),s}function Ro(s,l){return l(s)}var eS=_n(function(s){var l=s.length,u=l?s[0]:0,d=this.__wrapped__,y=function(w){return pc(w,s)};return l>1||this.__actions__.length||!(d instanceof oe)||!Tn(u)?this.thru(y):(d=d.slice(u,+u+(l?1:0)),d.__actions__.push({func:Ro,args:[y],thisArg:t}),new Pt(d,this.__chain__).thru(function(w){return l&&!w.length&&w.push(t),w}))});function tS(){return Sp(this)}function nS(){return new Pt(this.value(),this.__chain__)}function rS(){this.__values__===t&&(this.__values__=Pp(this.value()));var s=this.__index__>=this.__values__.length,l=s?t:this.__values__[this.__index__++];return{done:s,value:l}}function iS(){return this}function sS(s){for(var l,u=this;u instanceof bo;){var d=pp(u);d.__index__=0,d.__values__=t,l?y.__wrapped__=d:l=d;var y=d;u=u.__wrapped__}return y.__wrapped__=s,l}function oS(){var s=this.__wrapped__;if(s instanceof oe){var l=s;return this.__actions__.length&&(l=new oe(this)),l=l.reverse(),l.__actions__.push({func:Ro,args:[Wc],thisArg:t}),new Pt(l,this.__chain__)}return this.thru(Wc)}function lS(){return Bd(this.__wrapped__,this.__actions__)}var aS=_o(function(s,l,u){ve.call(s,u)?++s[u]:En(s,u,1)});function cS(s,l,u){var d=Z(s)?Yh:Qb;return u&&nt(s,l,u)&&(l=t),d(s,J(l,3))}function uS(s,l){var u=Z(s)?Yn:wd;return u(s,J(l,3))}var fS=qd(mp),hS=qd(gp);function dS(s,l){return je(Lo(s,l),1)}function pS(s,l){return je(Lo(s,l),bt)}function mS(s,l,u){return u=u===t?1:Q(u),je(Lo(s,l),u)}function xp(s,l){var u=Z(s)?Rt:er;return u(s,J(l,3))}function Ep(s,l){var u=Z(s)?L2:vd;return u(s,J(l,3))}var gS=_o(function(s,l,u){ve.call(s,u)?s[u].push(l):En(s,u,[l])});function yS(s,l,u,d){s=ut(s)?s:di(s),u=u&&!d?Q(u):0;var y=s.length;return u<0&&(u=De(y+u,0)),Fo(s)?u<=y&&s.indexOf(l,u)>-1:!!y&&ti(s,l,u)>-1}var bS=ie(function(s,l,u){var d=-1,y=typeof l=="function",w=ut(s)?A(s.length):[];return er(s,function(x){w[++d]=y?wt(l,x,u):ts(x,l,u)}),w}),vS=_o(function(s,l,u){En(s,u,l)});function Lo(s,l){var u=Z(s)?ke:Td;return u(s,J(l,3))}function wS(s,l,u,d){return s==null?[]:(Z(l)||(l=l==null?[]:[l]),u=d?t:u,Z(u)||(u=u==null?[]:[u]),Id(s,l,u))}var SS=_o(function(s,l,u){s[u?0:1].push(l)},function(){return[[],[]]});function xS(s,l,u){var d=Z(s)?tc:ed,y=arguments.length<3;return d(s,J(l,4),u,y,er)}function ES(s,l,u){var d=Z(s)?P2:ed,y=arguments.length<3;return d(s,J(l,4),u,y,vd)}function kS(s,l){var u=Z(s)?Yn:wd;return u(s,Bo(J(l,3)))}function _S(s){var l=Z(s)?md:yv;return l(s)}function TS(s,l,u){(u?nt(s,l,u):l===t)?l=1:l=Q(l);var d=Z(s)?qb:bv;return d(s,l)}function CS(s){var l=Z(s)?jb:wv;return l(s)}function MS(s){if(s==null)return 0;if(ut(s))return Fo(s)?ri(s):s.length;var l=et(s);return l==Jt||l==qt?s.size:wc(s).length}function AS(s,l,u){var d=Z(s)?nc:Sv;return u&&nt(s,l,u)&&(l=t),d(s,J(l,3))}var IS=ie(function(s,l){if(s==null)return[];var u=l.length;return u>1&&nt(s,l[0],l[1])?l=[]:u>2&&nt(l[0],l[1],l[2])&&(l=[l[0]]),Id(s,je(l,1),[])}),Po=ub||function(){return qe.Date.now()};function OS(s,l){if(typeof l!="function")throw new Lt(a);return s=Q(s),function(){if(--s<1)return l.apply(this,arguments)}}function kp(s,l,u){return l=u?t:l,l=s&&l==null?s.length:l,kn(s,he,t,t,t,t,l)}function _p(s,l){var u;if(typeof l!="function")throw new Lt(a);return s=Q(s),function(){return--s>0&&(u=l.apply(this,arguments)),s<=1&&(l=t),u}}var Vc=ie(function(s,l,u){var d=C;if(u.length){var y=Zn(u,fi(Vc));d|=U}return kn(s,d,l,u,y)}),Tp=ie(function(s,l,u){var d=C|M;if(u.length){var y=Zn(u,fi(Tp));d|=U}return kn(l,d,s,u,y)});function Cp(s,l,u){l=u?t:l;var d=kn(s,F,t,t,t,t,t,l);return d.placeholder=Cp.placeholder,d}function Mp(s,l,u){l=u?t:l;var d=kn(s,$,t,t,t,t,t,l);return d.placeholder=Mp.placeholder,d}function Ap(s,l,u){var d,y,w,x,k,T,O=0,N=!1,R=!1,H=!0;if(typeof s!="function")throw new Lt(a);l=Ft(l)||0,Ce(u)&&(N=!!u.leading,R="maxWait"in u,w=R?De(Ft(u.maxWait)||0,l):w,H="trailing"in u?!!u.trailing:H);function G(Ne){var Zt=d,An=y;return d=y=t,O=Ne,x=s.apply(An,Zt),x}function q(Ne){return O=Ne,k=ls(se,l),N?G(Ne):x}function ee(Ne){var Zt=Ne-T,An=Ne-O,qp=l-Zt;return R?Qe(qp,w-An):qp}function j(Ne){var Zt=Ne-T,An=Ne-O;return T===t||Zt>=l||Zt<0||R&&An>=w}function se(){var Ne=Po();if(j(Ne))return fe(Ne);k=ls(se,ee(Ne))}function fe(Ne){return k=t,H&&d?G(Ne):(d=y=t,x)}function kt(){k!==t&&Fd(k),O=0,d=T=y=k=t}function rt(){return k===t?x:fe(Po())}function _t(){var Ne=Po(),Zt=j(Ne);if(d=arguments,y=this,T=Ne,Zt){if(k===t)return q(T);if(R)return Fd(k),k=ls(se,l),G(T)}return k===t&&(k=ls(se,l)),x}return _t.cancel=kt,_t.flush=rt,_t}var NS=ie(function(s,l){return bd(s,1,l)}),RS=ie(function(s,l,u){return bd(s,Ft(l)||0,u)});function LS(s){return kn(s,yt)}function Do(s,l){if(typeof s!="function"||l!=null&&typeof l!="function")throw new Lt(a);var u=function(){var d=arguments,y=l?l.apply(this,d):d[0],w=u.cache;if(w.has(y))return w.get(y);var x=s.apply(this,d);return u.cache=w.set(y,x)||w,x};return u.cache=new(Do.Cache||xn),u}Do.Cache=xn;function Bo(s){if(typeof s!="function")throw new Lt(a);return function(){var l=arguments;switch(l.length){case 0:return!s.call(this);case 1:return!s.call(this,l[0]);case 2:return!s.call(this,l[0],l[1]);case 3:return!s.call(this,l[0],l[1],l[2])}return!s.apply(this,l)}}function PS(s){return _p(2,s)}var DS=xv(function(s,l){l=l.length==1&&Z(l[0])?ke(l[0],St(J())):ke(je(l,1),St(J()));var u=l.length;return ie(function(d){for(var y=-1,w=Qe(d.length,u);++y<w;)d[y]=l[y].call(this,d[y]);return wt(s,this,d)})}),Kc=ie(function(s,l){var u=Zn(l,fi(Kc));return kn(s,U,t,l,u)}),Ip=ie(function(s,l){var u=Zn(l,fi(Ip));return kn(s,ue,t,l,u)}),BS=_n(function(s,l){return kn(s,be,t,t,t,l)});function zS(s,l){if(typeof s!="function")throw new Lt(a);return l=l===t?l:Q(l),ie(s,l)}function FS(s,l){if(typeof s!="function")throw new Lt(a);return l=l==null?0:De(Q(l),0),ie(function(u){var d=u[l],y=rr(u,0,l);return d&&Xn(y,d),wt(s,this,y)})}function HS(s,l,u){var d=!0,y=!0;if(typeof s!="function")throw new Lt(a);return Ce(u)&&(d="leading"in u?!!u.leading:d,y="trailing"in u?!!u.trailing:y),Ap(s,l,{leading:d,maxWait:l,trailing:y})}function $S(s){return kp(s,1)}function WS(s,l){return Kc(Ac(l),s)}function US(){if(!arguments.length)return[];var s=arguments[0];return Z(s)?s:[s]}function VS(s){return Dt(s,b)}function KS(s,l){return l=typeof l=="function"?l:t,Dt(s,b,l)}function GS(s){return Dt(s,p|b)}function JS(s,l){return l=typeof l=="function"?l:t,Dt(s,p|b,l)}function qS(s,l){return l==null||yd(s,l,He(l))}function Xt(s,l){return s===l||s!==s&&l!==l}var jS=Ao(yc),YS=Ao(function(s,l){return s>=l}),Lr=Ed(function(){return arguments}())?Ed:function(s){return Me(s)&&ve.call(s,"callee")&&!cd.call(s,"callee")},Z=A.isArray,XS=Vh?St(Vh):sv;function ut(s){return s!=null&&zo(s.length)&&!Cn(s)}function Oe(s){return Me(s)&&ut(s)}function ZS(s){return s===!0||s===!1||Me(s)&&tt(s)==Hi}var ir=hb||nu,QS=Kh?St(Kh):ov;function e5(s){return Me(s)&&s.nodeType===1&&!as(s)}function t5(s){if(s==null)return!0;if(ut(s)&&(Z(s)||typeof s=="string"||typeof s.splice=="function"||ir(s)||hi(s)||Lr(s)))return!s.length;var l=et(s);if(l==Jt||l==qt)return!s.size;if(ss(s))return!wc(s).length;for(var u in s)if(ve.call(s,u))return!1;return!0}function n5(s,l){return ns(s,l)}function r5(s,l,u){u=typeof u=="function"?u:t;var d=u?u(s,l):t;return d===t?ns(s,l,t,u):!!d}function Gc(s){if(!Me(s))return!1;var l=tt(s);return l==js||l==Ty||typeof s.message=="string"&&typeof s.name=="string"&&!as(s)}function i5(s){return typeof s=="number"&&fd(s)}function Cn(s){if(!Ce(s))return!1;var l=tt(s);return l==Ys||l==bh||l==_y||l==My}function Op(s){return typeof s=="number"&&s==Q(s)}function zo(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=jn}function Ce(s){var l=typeof s;return s!=null&&(l=="object"||l=="function")}function Me(s){return s!=null&&typeof s=="object"}var Np=Gh?St(Gh):av;function s5(s,l){return s===l||vc(s,l,Dc(l))}function o5(s,l,u){return u=typeof u=="function"?u:t,vc(s,l,Dc(l),u)}function l5(s){return Rp(s)&&s!=+s}function a5(s){if(Kv(s))throw new X(o);return kd(s)}function c5(s){return s===null}function u5(s){return s==null}function Rp(s){return typeof s=="number"||Me(s)&&tt(s)==Wi}function as(s){if(!Me(s)||tt(s)!=wn)return!1;var l=uo(s);if(l===null)return!0;var u=ve.call(l,"constructor")&&l.constructor;return typeof u=="function"&&u instanceof u&&oo.call(u)==ob}var Jc=Jh?St(Jh):cv;function f5(s){return Op(s)&&s>=-9007199254740991&&s<=jn}var Lp=qh?St(qh):uv;function Fo(s){return typeof s=="string"||!Z(s)&&Me(s)&&tt(s)==Vi}function Et(s){return typeof s=="symbol"||Me(s)&&tt(s)==Xs}var hi=jh?St(jh):fv;function h5(s){return s===t}function d5(s){return Me(s)&&et(s)==Ki}function p5(s){return Me(s)&&tt(s)==Iy}var m5=Ao(Sc),g5=Ao(function(s,l){return s<=l});function Pp(s){if(!s)return[];if(ut(s))return Fo(s)?jt(s):ct(s);if(qi&&s[qi])return q2(s[qi]());var l=et(s),u=l==Jt?ac:l==qt?ro:di;return u(s)}function Mn(s){if(!s)return s===0?s:0;if(s=Ft(s),s===bt||s===-1/0){var l=s<0?-1:1;return l*Js}return s===s?s:0}function Q(s){var l=Mn(s),u=l%1;return l===l?u?l-u:l:0}function Dp(s){return s?Ir(Q(s),0,vt):0}function Ft(s){if(typeof s=="number")return s;if(Et(s))return ln;if(Ce(s)){var l=typeof s.valueOf=="function"?s.valueOf():s;s=Ce(l)?l+"":l}if(typeof s!="string")return s===0?s:+s;s=td(s);var u=Xy.test(s);return u||Qy.test(s)?O2(s.slice(2),u?2:8):Yy.test(s)?ln:+s}function Bp(s){return cn(s,ft(s))}function y5(s){return s?Ir(Q(s),-9007199254740991,jn):s===0?s:0}function ge(s){return s==null?"":xt(s)}var b5=ci(function(s,l){if(ss(l)||ut(l)){cn(l,He(l),s);return}for(var u in l)ve.call(l,u)&&Qi(s,u,l[u])}),zp=ci(function(s,l){cn(l,ft(l),s)}),Ho=ci(function(s,l,u,d){cn(l,ft(l),s,d)}),v5=ci(function(s,l,u,d){cn(l,He(l),s,d)}),w5=_n(pc);function S5(s,l){var u=ai(s);return l==null?u:gd(u,l)}var x5=ie(function(s,l){s=we(s);var u=-1,d=l.length,y=d>2?l[2]:t;for(y&&nt(l[0],l[1],y)&&(d=1);++u<d;)for(var w=l[u],x=ft(w),k=-1,T=x.length;++k<T;){var O=x[k],N=s[O];(N===t||Xt(N,si[O])&&!ve.call(s,O))&&(s[O]=w[O])}return s}),E5=ie(function(s){return s.push(t,tp),wt(Fp,t,s)});function k5(s,l){return Xh(s,J(l,3),an)}function _5(s,l){return Xh(s,J(l,3),gc)}function T5(s,l){return s==null?s:mc(s,J(l,3),ft)}function C5(s,l){return s==null?s:Sd(s,J(l,3),ft)}function M5(s,l){return s&&an(s,J(l,3))}function A5(s,l){return s&&gc(s,J(l,3))}function I5(s){return s==null?[]:So(s,He(s))}function O5(s){return s==null?[]:So(s,ft(s))}function qc(s,l,u){var d=s==null?t:Or(s,l);return d===t?u:d}function N5(s,l){return s!=null&&ip(s,l,tv)}function jc(s,l){return s!=null&&ip(s,l,nv)}var R5=Yd(function(s,l,u){l!=null&&typeof l.toString!="function"&&(l=lo.call(l)),s[l]=u},Xc(ht)),L5=Yd(function(s,l,u){l!=null&&typeof l.toString!="function"&&(l=lo.call(l)),ve.call(s,l)?s[l].push(u):s[l]=[u]},J),P5=ie(ts);function He(s){return ut(s)?pd(s):wc(s)}function ft(s){return ut(s)?pd(s,!0):hv(s)}function D5(s,l){var u={};return l=J(l,3),an(s,function(d,y,w){En(u,l(d,y,w),d)}),u}function B5(s,l){var u={};return l=J(l,3),an(s,function(d,y,w){En(u,y,l(d,y,w))}),u}var z5=ci(function(s,l,u){xo(s,l,u)}),Fp=ci(function(s,l,u,d){xo(s,l,u,d)}),F5=_n(function(s,l){var u={};if(s==null)return u;var d=!1;l=ke(l,function(w){return w=nr(w,s),d||(d=w.length>1),w}),cn(s,Lc(s),u),d&&(u=Dt(u,p|g|b,Rv));for(var y=l.length;y--;)Tc(u,l[y]);return u});function H5(s,l){return Hp(s,Bo(J(l)))}var $5=_n(function(s,l){return s==null?{}:pv(s,l)});function Hp(s,l){if(s==null)return{};var u=ke(Lc(s),function(d){return[d]});return l=J(l),Od(s,u,function(d,y){return l(d,y[0])})}function W5(s,l,u){l=nr(l,s);var d=-1,y=l.length;for(y||(y=1,s=t);++d<y;){var w=s==null?t:s[un(l[d])];w===t&&(d=y,w=u),s=Cn(w)?w.call(s):w}return s}function U5(s,l,u){return s==null?s:rs(s,l,u)}function V5(s,l,u,d){return d=typeof d=="function"?d:t,s==null?s:rs(s,l,u,d)}var $p=Qd(He),Wp=Qd(ft);function K5(s,l,u){var d=Z(s),y=d||ir(s)||hi(s);if(l=J(l,4),u==null){var w=s&&s.constructor;y?u=d?new w:[]:Ce(s)?u=Cn(w)?ai(uo(s)):{}:u={}}return(y?Rt:an)(s,function(x,k,T){return l(u,x,k,T)}),u}function G5(s,l){return s==null?!0:Tc(s,l)}function J5(s,l,u){return s==null?s:Dd(s,l,Ac(u))}function q5(s,l,u,d){return d=typeof d=="function"?d:t,s==null?s:Dd(s,l,Ac(u),d)}function di(s){return s==null?[]:lc(s,He(s))}function j5(s){return s==null?[]:lc(s,ft(s))}function Y5(s,l,u){return u===t&&(u=l,l=t),u!==t&&(u=Ft(u),u=u===u?u:0),l!==t&&(l=Ft(l),l=l===l?l:0),Ir(Ft(s),l,u)}function X5(s,l,u){return l=Mn(l),u===t?(u=l,l=0):u=Mn(u),s=Ft(s),rv(s,l,u)}function Z5(s,l,u){if(u&&typeof u!="boolean"&&nt(s,l,u)&&(l=u=t),u===t&&(typeof l=="boolean"?(u=l,l=t):typeof s=="boolean"&&(u=s,s=t)),s===t&&l===t?(s=0,l=1):(s=Mn(s),l===t?(l=s,s=0):l=Mn(l)),s>l){var d=s;s=l,l=d}if(u||s%1||l%1){var y=hd();return Qe(s+y*(l-s+I2("1e-"+((y+"").length-1))),l)}return Ec(s,l)}var Q5=ui(function(s,l,u){return l=l.toLowerCase(),s+(u?Up(l):l)});function Up(s){return Yc(ge(s).toLowerCase())}function Vp(s){return s=ge(s),s&&s.replace(t2,U2).replace(w2,"")}function ex(s,l,u){s=ge(s),l=xt(l);var d=s.length;u=u===t?d:Ir(Q(u),0,d);var y=u;return u-=l.length,u>=0&&s.slice(u,y)==l}function tx(s){return s=ge(s),s&&Py.test(s)?s.replace(Sh,V2):s}function nx(s){return s=ge(s),s&&$y.test(s)?s.replace(Ka,"\\$&"):s}var rx=ui(function(s,l,u){return s+(u?"-":"")+l.toLowerCase()}),ix=ui(function(s,l,u){return s+(u?" ":"")+l.toLowerCase()}),sx=Jd("toLowerCase");function ox(s,l,u){s=ge(s),l=Q(l);var d=l?ri(s):0;if(!l||d>=l)return s;var y=(l-d)/2;return Mo(mo(y),u)+s+Mo(po(y),u)}function lx(s,l,u){s=ge(s),l=Q(l);var d=l?ri(s):0;return l&&d<l?s+Mo(l-d,u):s}function ax(s,l,u){s=ge(s),l=Q(l);var d=l?ri(s):0;return l&&d<l?Mo(l-d,u)+s:s}function cx(s,l,u){return u||l==null?l=0:l&&(l=+l),gb(ge(s).replace(Ga,""),l||0)}function ux(s,l,u){return(u?nt(s,l,u):l===t)?l=1:l=Q(l),kc(ge(s),l)}function fx(){var s=arguments,l=ge(s[0]);return s.length<3?l:l.replace(s[1],s[2])}var hx=ui(function(s,l,u){return s+(u?"_":"")+l.toLowerCase()});function dx(s,l,u){return u&&typeof u!="number"&&nt(s,l,u)&&(l=u=t),u=u===t?vt:u>>>0,u?(s=ge(s),s&&(typeof l=="string"||l!=null&&!Jc(l))&&(l=xt(l),!l&&ni(s))?rr(jt(s),0,u):s.split(l,u)):[]}var px=ui(function(s,l,u){return s+(u?" ":"")+Yc(l)});function mx(s,l,u){return s=ge(s),u=u==null?0:Ir(Q(u),0,s.length),l=xt(l),s.slice(u,u+l.length)==l}function gx(s,l,u){var d=v.templateSettings;u&&nt(s,l,u)&&(l=t),s=ge(s),l=Ho({},l,d,ep);var y=Ho({},l.imports,d.imports,ep),w=He(y),x=lc(y,w),k,T,O=0,N=l.interpolate||Zs,R="__p += '",H=cc((l.escape||Zs).source+"|"+N.source+"|"+(N===xh?jy:Zs).source+"|"+(l.evaluate||Zs).source+"|$","g"),G="//# sourceURL="+(ve.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++_2+"]")+`
23
- `;s.replace(H,function(j,se,fe,kt,rt,_t){return fe||(fe=kt),R+=s.slice(O,_t).replace(n2,K2),se&&(k=!0,R+=`' +
22
+ `)}function Uv(s){return Z(s)||Pr(s)||!!(ud&&s&&s[ud])}function Tn(s,l){var u=typeof s;return l=l??jn,!!l&&(u=="number"||u!="symbol"&&tb.test(s))&&s>-1&&s%1==0&&s<l}function nt(s,l,u){if(!Ce(u))return!1;var d=typeof l;return(d=="number"?ut(u)&&Tn(l,u.length):d=="string"&&l in u)?Xt(u[l],s):!1}function Bc(s,l){if(Z(s))return!1;var u=typeof s;return u=="number"||u=="symbol"||u=="boolean"||s==null||kt(s)?!0:Hy.test(s)||!Fy.test(s)||l!=null&&s in we(l)}function Vv(s){var l=typeof s;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?s!=="__proto__":s===null}function Fc(s){var l=Io(s),u=v[l];if(typeof u!="function"||!(l in oe.prototype))return!1;if(s===u)return!0;var d=Pc(u);return!!d&&s===d[0]}function Kv(s){return!!od&&od in s}var Gv=so?Cn:nu;function ss(s){var l=s&&s.constructor,u=typeof l=="function"&&l.prototype||si;return s===u}function op(s){return s===s&&!Ce(s)}function lp(s,l){return function(u){return u==null?!1:u[s]===l&&(l!==t||s in we(u))}}function Jv(s){var l=Do(s,function(d){return u.size===h&&u.clear(),d}),u=l.cache;return l}function qv(s,l){var u=s[1],d=l[1],y=u|d,w=y<(C|M|he),x=d==he&&u==F||d==he&&u==be&&s[7].length<=l[8]||d==(he|be)&&l[7].length<=l[8]&&u==F;if(!(w||x))return s;d&C&&(s[2]=l[2],y|=u&C?0:P);var k=l[3];if(k){var T=s[3];s[3]=T?Ud(T,k,l[4]):k,s[4]=T?Zn(s[3],m):l[4]}return k=l[5],k&&(T=s[5],s[5]=T?Vd(T,k,l[6]):k,s[6]=T?Zn(s[5],m):l[6]),k=l[7],k&&(s[7]=k),d&he&&(s[8]=s[8]==null?l[8]:Qe(s[8],l[8])),s[9]==null&&(s[9]=l[9]),s[0]=l[0],s[1]=y,s}function jv(s){var l=[];if(s!=null)for(var u in we(s))l.push(u);return l}function Yv(s){return lo.call(s)}function ap(s,l,u){return l=De(l===t?s.length-1:l,0),function(){for(var d=arguments,y=-1,w=De(d.length-l,0),x=A(w);++y<w;)x[y]=d[l+y];y=-1;for(var k=A(l+1);++y<l;)k[y]=d[y];return k[l]=u(x),St(s,this,k)}}function cp(s,l){return l.length<2?s:Nr(s,Bt(l,0,-1))}function Xv(s,l){for(var u=s.length,d=Qe(l.length,u),y=ct(s);d--;){var w=l[d];s[d]=Tn(w,u)?y[w]:t}return s}function Hc(s,l){if(!(l==="constructor"&&typeof s[l]=="function")&&l!="__proto__")return s[l]}var up=hp(Rd),ls=h2||function(s,l){return qe.setTimeout(s,l)},$c=hp(wv);function fp(s,l,u){var d=l+"";return $c(s,Wv(d,Zv(Fv(d),u)))}function hp(s){var l=0,u=0;return function(){var d=g2(),y=Zr-(d-u);if(u=d,y>0){if(++l>=qn)return arguments[0]}else l=0;return s.apply(t,arguments)}}function No(s,l){var u=-1,d=s.length,y=d-1;for(l=l===t?d:l;++u<l;){var w=Ec(u,y),x=s[w];s[w]=s[u],s[u]=x}return s.length=l,s}var dp=Jv(function(s){var l=[];return s.charCodeAt(0)===46&&l.push(""),s.replace($y,function(u,d,y,w){l.push(y?w.replace(jy,"$1"):d||u)}),l});function un(s){if(typeof s=="string"||kt(s))return s;var l=s+"";return l=="0"&&1/s==-1/0?"-0":l}function Lr(s){if(s!=null){try{return oo.call(s)}catch{}try{return s+""}catch{}}return""}function Zv(s,l){return Lt(Pa,function(u){var d="_."+u[0];l&u[1]&&!to(s,d)&&s.push(d)}),s.sort()}function pp(s){if(s instanceof oe)return s.clone();var l=new Dt(s.__wrapped__,s.__chain__);return l.__actions__=ct(s.__actions__),l.__index__=s.__index__,l.__values__=s.__values__,l}function Qv(s,l,u){(u?nt(s,l,u):l===t)?l=1:l=De(Q(l),0);var d=s==null?0:s.length;if(!d||l<1)return[];for(var y=0,w=0,x=A(po(d/l));y<d;)x[w++]=Bt(s,y,y+=l);return x}function ew(s){for(var l=-1,u=s==null?0:s.length,d=0,y=[];++l<u;){var w=s[l];w&&(y[d++]=w)}return y}function tw(){var s=arguments.length;if(!s)return[];for(var l=A(s-1),u=arguments[0],d=s;d--;)l[d-1]=arguments[d];return Xn(Z(u)?ct(u):[u],je(l,1))}var nw=ie(function(s,l){return Oe(s)?es(s,je(l,1,Oe,!0)):[]}),rw=ie(function(s,l){var u=Ft(l);return Oe(u)&&(u=t),Oe(s)?es(s,je(l,1,Oe,!0),J(u,2)):[]}),iw=ie(function(s,l){var u=Ft(l);return Oe(u)&&(u=t),Oe(s)?es(s,je(l,1,Oe,!0),t,u):[]});function sw(s,l,u){var d=s==null?0:s.length;return d?(l=u||l===t?1:Q(l),Bt(s,l<0?0:l,d)):[]}function ow(s,l,u){var d=s==null?0:s.length;return d?(l=u||l===t?1:Q(l),l=d-l,Bt(s,0,l<0?0:l)):[]}function lw(s,l){return s&&s.length?ko(s,J(l,3),!0,!0):[]}function aw(s,l){return s&&s.length?ko(s,J(l,3),!0):[]}function cw(s,l,u,d){var y=s==null?0:s.length;return y?(u&&typeof u!="number"&&nt(s,l,u)&&(u=0,d=y),tv(s,l,u,d)):[]}function mp(s,l,u){var d=s==null?0:s.length;if(!d)return-1;var y=u==null?0:Q(u);return y<0&&(y=De(d+y,0)),no(s,J(l,3),y)}function gp(s,l,u){var d=s==null?0:s.length;if(!d)return-1;var y=d-1;return u!==t&&(y=Q(u),y=u<0?De(d+y,0):Qe(y,d-1)),no(s,J(l,3),y,!0)}function yp(s){var l=s==null?0:s.length;return l?je(s,1):[]}function uw(s){var l=s==null?0:s.length;return l?je(s,vt):[]}function fw(s,l){var u=s==null?0:s.length;return u?(l=l===t?1:Q(l),je(s,l)):[]}function hw(s){for(var l=-1,u=s==null?0:s.length,d={};++l<u;){var y=s[l];d[y[0]]=y[1]}return d}function bp(s){return s&&s.length?s[0]:t}function dw(s,l,u){var d=s==null?0:s.length;if(!d)return-1;var y=u==null?0:Q(u);return y<0&&(y=De(d+y,0)),ti(s,l,y)}function pw(s){var l=s==null?0:s.length;return l?Bt(s,0,-1):[]}var mw=ie(function(s){var l=_e(s,Mc);return l.length&&l[0]===s[0]?bc(l):[]}),gw=ie(function(s){var l=Ft(s),u=_e(s,Mc);return l===Ft(u)?l=t:u.pop(),u.length&&u[0]===s[0]?bc(u,J(l,2)):[]}),yw=ie(function(s){var l=Ft(s),u=_e(s,Mc);return l=typeof l=="function"?l:t,l&&u.pop(),u.length&&u[0]===s[0]?bc(u,t,l):[]});function bw(s,l){return s==null?"":p2.call(s,l)}function Ft(s){var l=s==null?0:s.length;return l?s[l-1]:t}function vw(s,l,u){var d=s==null?0:s.length;if(!d)return-1;var y=d;return u!==t&&(y=Q(u),y=y<0?De(d+y,0):Qe(y,d-1)),l===l?Zb(s,l,y):no(s,Zh,y,!0)}function ww(s,l){return s&&s.length?Ad(s,Q(l)):t}var Sw=ie(vp);function vp(s,l){return s&&s.length&&l&&l.length?xc(s,l):s}function xw(s,l,u){return s&&s.length&&l&&l.length?xc(s,l,J(u,2)):s}function Ew(s,l,u){return s&&s.length&&l&&l.length?xc(s,l,t,u):s}var kw=_n(function(s,l){var u=s==null?0:s.length,d=pc(s,l);return Nd(s,_e(l,function(y){return Tn(y,u)?+y:y}).sort(Wd)),d});function _w(s,l){var u=[];if(!(s&&s.length))return u;var d=-1,y=[],w=s.length;for(l=J(l,3);++d<w;){var x=s[d];l(x,d,s)&&(u.push(x),y.push(d))}return Nd(s,y),u}function Wc(s){return s==null?s:b2.call(s)}function Tw(s,l,u){var d=s==null?0:s.length;return d?(u&&typeof u!="number"&&nt(s,l,u)?(l=0,u=d):(l=l==null?0:Q(l),u=u===t?d:Q(u)),Bt(s,l,u)):[]}function Cw(s,l){return Eo(s,l)}function Mw(s,l,u){return _c(s,l,J(u,2))}function Aw(s,l){var u=s==null?0:s.length;if(u){var d=Eo(s,l);if(d<u&&Xt(s[d],l))return d}return-1}function Iw(s,l){return Eo(s,l,!0)}function Ow(s,l,u){return _c(s,l,J(u,2),!0)}function Nw(s,l){var u=s==null?0:s.length;if(u){var d=Eo(s,l,!0)-1;if(Xt(s[d],l))return d}return-1}function Rw(s){return s&&s.length?Ld(s):[]}function Lw(s,l){return s&&s.length?Ld(s,J(l,2)):[]}function Pw(s){var l=s==null?0:s.length;return l?Bt(s,1,l):[]}function Dw(s,l,u){return s&&s.length?(l=u||l===t?1:Q(l),Bt(s,0,l<0?0:l)):[]}function zw(s,l,u){var d=s==null?0:s.length;return d?(l=u||l===t?1:Q(l),l=d-l,Bt(s,l<0?0:l,d)):[]}function Bw(s,l){return s&&s.length?ko(s,J(l,3),!1,!0):[]}function Fw(s,l){return s&&s.length?ko(s,J(l,3)):[]}var Hw=ie(function(s){return tr(je(s,1,Oe,!0))}),$w=ie(function(s){var l=Ft(s);return Oe(l)&&(l=t),tr(je(s,1,Oe,!0),J(l,2))}),Ww=ie(function(s){var l=Ft(s);return l=typeof l=="function"?l:t,tr(je(s,1,Oe,!0),t,l)});function Uw(s){return s&&s.length?tr(s):[]}function Vw(s,l){return s&&s.length?tr(s,J(l,2)):[]}function Kw(s,l){return l=typeof l=="function"?l:t,s&&s.length?tr(s,t,l):[]}function Uc(s){if(!(s&&s.length))return[];var l=0;return s=Yn(s,function(u){if(Oe(u))return l=De(u.length,l),!0}),oc(l,function(u){return _e(s,rc(u))})}function wp(s,l){if(!(s&&s.length))return[];var u=Uc(s);return l==null?u:_e(u,function(d){return St(l,t,d)})}var Gw=ie(function(s,l){return Oe(s)?es(s,l):[]}),Jw=ie(function(s){return Cc(Yn(s,Oe))}),qw=ie(function(s){var l=Ft(s);return Oe(l)&&(l=t),Cc(Yn(s,Oe),J(l,2))}),jw=ie(function(s){var l=Ft(s);return l=typeof l=="function"?l:t,Cc(Yn(s,Oe),t,l)}),Yw=ie(Uc);function Xw(s,l){return Bd(s||[],l||[],Qi)}function Zw(s,l){return Bd(s||[],l||[],rs)}var Qw=ie(function(s){var l=s.length,u=l>1?s[l-1]:t;return u=typeof u=="function"?(s.pop(),u):t,wp(s,u)});function Sp(s){var l=v(s);return l.__chain__=!0,l}function eS(s,l){return l(s),s}function Ro(s,l){return l(s)}var tS=_n(function(s){var l=s.length,u=l?s[0]:0,d=this.__wrapped__,y=function(w){return pc(w,s)};return l>1||this.__actions__.length||!(d instanceof oe)||!Tn(u)?this.thru(y):(d=d.slice(u,+u+(l?1:0)),d.__actions__.push({func:Ro,args:[y],thisArg:t}),new Dt(d,this.__chain__).thru(function(w){return l&&!w.length&&w.push(t),w}))});function nS(){return Sp(this)}function rS(){return new Dt(this.value(),this.__chain__)}function iS(){this.__values__===t&&(this.__values__=Pp(this.value()));var s=this.__index__>=this.__values__.length,l=s?t:this.__values__[this.__index__++];return{done:s,value:l}}function sS(){return this}function oS(s){for(var l,u=this;u instanceof bo;){var d=pp(u);d.__index__=0,d.__values__=t,l?y.__wrapped__=d:l=d;var y=d;u=u.__wrapped__}return y.__wrapped__=s,l}function lS(){var s=this.__wrapped__;if(s instanceof oe){var l=s;return this.__actions__.length&&(l=new oe(this)),l=l.reverse(),l.__actions__.push({func:Ro,args:[Wc],thisArg:t}),new Dt(l,this.__chain__)}return this.thru(Wc)}function aS(){return zd(this.__wrapped__,this.__actions__)}var cS=_o(function(s,l,u){ve.call(s,u)?++s[u]:En(s,u,1)});function uS(s,l,u){var d=Z(s)?Yh:ev;return u&&nt(s,l,u)&&(l=t),d(s,J(l,3))}function fS(s,l){var u=Z(s)?Yn:wd;return u(s,J(l,3))}var hS=qd(mp),dS=qd(gp);function pS(s,l){return je(Lo(s,l),1)}function mS(s,l){return je(Lo(s,l),vt)}function gS(s,l,u){return u=u===t?1:Q(u),je(Lo(s,l),u)}function xp(s,l){var u=Z(s)?Lt:er;return u(s,J(l,3))}function Ep(s,l){var u=Z(s)?Pb:vd;return u(s,J(l,3))}var yS=_o(function(s,l,u){ve.call(s,u)?s[u].push(l):En(s,u,[l])});function bS(s,l,u,d){s=ut(s)?s:di(s),u=u&&!d?Q(u):0;var y=s.length;return u<0&&(u=De(y+u,0)),Fo(s)?u<=y&&s.indexOf(l,u)>-1:!!y&&ti(s,l,u)>-1}var vS=ie(function(s,l,u){var d=-1,y=typeof l=="function",w=ut(s)?A(s.length):[];return er(s,function(x){w[++d]=y?St(l,x,u):ts(x,l,u)}),w}),wS=_o(function(s,l,u){En(s,u,l)});function Lo(s,l){var u=Z(s)?_e:Td;return u(s,J(l,3))}function SS(s,l,u,d){return s==null?[]:(Z(l)||(l=l==null?[]:[l]),u=d?t:u,Z(u)||(u=u==null?[]:[u]),Id(s,l,u))}var xS=_o(function(s,l,u){s[u?0:1].push(l)},function(){return[[],[]]});function ES(s,l,u){var d=Z(s)?tc:ed,y=arguments.length<3;return d(s,J(l,4),u,y,er)}function kS(s,l,u){var d=Z(s)?Db:ed,y=arguments.length<3;return d(s,J(l,4),u,y,vd)}function _S(s,l){var u=Z(s)?Yn:wd;return u(s,zo(J(l,3)))}function TS(s){var l=Z(s)?md:bv;return l(s)}function CS(s,l,u){(u?nt(s,l,u):l===t)?l=1:l=Q(l);var d=Z(s)?j2:vv;return d(s,l)}function MS(s){var l=Z(s)?Y2:Sv;return l(s)}function AS(s){if(s==null)return 0;if(ut(s))return Fo(s)?ri(s):s.length;var l=et(s);return l==Jt||l==qt?s.size:wc(s).length}function IS(s,l,u){var d=Z(s)?nc:xv;return u&&nt(s,l,u)&&(l=t),d(s,J(l,3))}var OS=ie(function(s,l){if(s==null)return[];var u=l.length;return u>1&&nt(s,l[0],l[1])?l=[]:u>2&&nt(l[0],l[1],l[2])&&(l=[l[0]]),Id(s,je(l,1),[])}),Po=f2||function(){return qe.Date.now()};function NS(s,l){if(typeof l!="function")throw new Pt(a);return s=Q(s),function(){if(--s<1)return l.apply(this,arguments)}}function kp(s,l,u){return l=u?t:l,l=s&&l==null?s.length:l,kn(s,he,t,t,t,t,l)}function _p(s,l){var u;if(typeof l!="function")throw new Pt(a);return s=Q(s),function(){return--s>0&&(u=l.apply(this,arguments)),s<=1&&(l=t),u}}var Vc=ie(function(s,l,u){var d=C;if(u.length){var y=Zn(u,fi(Vc));d|=U}return kn(s,d,l,u,y)}),Tp=ie(function(s,l,u){var d=C|M;if(u.length){var y=Zn(u,fi(Tp));d|=U}return kn(l,d,s,u,y)});function Cp(s,l,u){l=u?t:l;var d=kn(s,F,t,t,t,t,t,l);return d.placeholder=Cp.placeholder,d}function Mp(s,l,u){l=u?t:l;var d=kn(s,$,t,t,t,t,t,l);return d.placeholder=Mp.placeholder,d}function Ap(s,l,u){var d,y,w,x,k,T,O=0,N=!1,R=!1,H=!0;if(typeof s!="function")throw new Pt(a);l=Ht(l)||0,Ce(u)&&(N=!!u.leading,R="maxWait"in u,w=R?De(Ht(u.maxWait)||0,l):w,H="trailing"in u?!!u.trailing:H);function G(Ne){var Zt=d,An=y;return d=y=t,O=Ne,x=s.apply(An,Zt),x}function q(Ne){return O=Ne,k=ls(se,l),N?G(Ne):x}function ee(Ne){var Zt=Ne-T,An=Ne-O,qp=l-Zt;return R?Qe(qp,w-An):qp}function j(Ne){var Zt=Ne-T,An=Ne-O;return T===t||Zt>=l||Zt<0||R&&An>=w}function se(){var Ne=Po();if(j(Ne))return fe(Ne);k=ls(se,ee(Ne))}function fe(Ne){return k=t,H&&d?G(Ne):(d=y=t,x)}function _t(){k!==t&&Fd(k),O=0,d=T=y=k=t}function rt(){return k===t?x:fe(Po())}function Tt(){var Ne=Po(),Zt=j(Ne);if(d=arguments,y=this,T=Ne,Zt){if(k===t)return q(T);if(R)return Fd(k),k=ls(se,l),G(T)}return k===t&&(k=ls(se,l)),x}return Tt.cancel=_t,Tt.flush=rt,Tt}var RS=ie(function(s,l){return bd(s,1,l)}),LS=ie(function(s,l,u){return bd(s,Ht(l)||0,u)});function PS(s){return kn(s,bt)}function Do(s,l){if(typeof s!="function"||l!=null&&typeof l!="function")throw new Pt(a);var u=function(){var d=arguments,y=l?l.apply(this,d):d[0],w=u.cache;if(w.has(y))return w.get(y);var x=s.apply(this,d);return u.cache=w.set(y,x)||w,x};return u.cache=new(Do.Cache||xn),u}Do.Cache=xn;function zo(s){if(typeof s!="function")throw new Pt(a);return function(){var l=arguments;switch(l.length){case 0:return!s.call(this);case 1:return!s.call(this,l[0]);case 2:return!s.call(this,l[0],l[1]);case 3:return!s.call(this,l[0],l[1],l[2])}return!s.apply(this,l)}}function DS(s){return _p(2,s)}var zS=Ev(function(s,l){l=l.length==1&&Z(l[0])?_e(l[0],xt(J())):_e(je(l,1),xt(J()));var u=l.length;return ie(function(d){for(var y=-1,w=Qe(d.length,u);++y<w;)d[y]=l[y].call(this,d[y]);return St(s,this,d)})}),Kc=ie(function(s,l){var u=Zn(l,fi(Kc));return kn(s,U,t,l,u)}),Ip=ie(function(s,l){var u=Zn(l,fi(Ip));return kn(s,ue,t,l,u)}),BS=_n(function(s,l){return kn(s,be,t,t,t,l)});function FS(s,l){if(typeof s!="function")throw new Pt(a);return l=l===t?l:Q(l),ie(s,l)}function HS(s,l){if(typeof s!="function")throw new Pt(a);return l=l==null?0:De(Q(l),0),ie(function(u){var d=u[l],y=rr(u,0,l);return d&&Xn(y,d),St(s,this,y)})}function $S(s,l,u){var d=!0,y=!0;if(typeof s!="function")throw new Pt(a);return Ce(u)&&(d="leading"in u?!!u.leading:d,y="trailing"in u?!!u.trailing:y),Ap(s,l,{leading:d,maxWait:l,trailing:y})}function WS(s){return kp(s,1)}function US(s,l){return Kc(Ac(l),s)}function VS(){if(!arguments.length)return[];var s=arguments[0];return Z(s)?s:[s]}function KS(s){return zt(s,b)}function GS(s,l){return l=typeof l=="function"?l:t,zt(s,b,l)}function JS(s){return zt(s,p|b)}function qS(s,l){return l=typeof l=="function"?l:t,zt(s,p|b,l)}function jS(s,l){return l==null||yd(s,l,He(l))}function Xt(s,l){return s===l||s!==s&&l!==l}var YS=Ao(yc),XS=Ao(function(s,l){return s>=l}),Pr=Ed(function(){return arguments}())?Ed:function(s){return Me(s)&&ve.call(s,"callee")&&!cd.call(s,"callee")},Z=A.isArray,ZS=Vh?xt(Vh):ov;function ut(s){return s!=null&&Bo(s.length)&&!Cn(s)}function Oe(s){return Me(s)&&ut(s)}function QS(s){return s===!0||s===!1||Me(s)&&tt(s)==Hi}var ir=d2||nu,e5=Kh?xt(Kh):lv;function t5(s){return Me(s)&&s.nodeType===1&&!as(s)}function n5(s){if(s==null)return!0;if(ut(s)&&(Z(s)||typeof s=="string"||typeof s.splice=="function"||ir(s)||hi(s)||Pr(s)))return!s.length;var l=et(s);if(l==Jt||l==qt)return!s.size;if(ss(s))return!wc(s).length;for(var u in s)if(ve.call(s,u))return!1;return!0}function r5(s,l){return ns(s,l)}function i5(s,l,u){u=typeof u=="function"?u:t;var d=u?u(s,l):t;return d===t?ns(s,l,t,u):!!d}function Gc(s){if(!Me(s))return!1;var l=tt(s);return l==js||l==Cy||typeof s.message=="string"&&typeof s.name=="string"&&!as(s)}function s5(s){return typeof s=="number"&&fd(s)}function Cn(s){if(!Ce(s))return!1;var l=tt(s);return l==Ys||l==bh||l==Ty||l==Ay}function Op(s){return typeof s=="number"&&s==Q(s)}function Bo(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=jn}function Ce(s){var l=typeof s;return s!=null&&(l=="object"||l=="function")}function Me(s){return s!=null&&typeof s=="object"}var Np=Gh?xt(Gh):cv;function o5(s,l){return s===l||vc(s,l,Dc(l))}function l5(s,l,u){return u=typeof u=="function"?u:t,vc(s,l,Dc(l),u)}function a5(s){return Rp(s)&&s!=+s}function c5(s){if(Gv(s))throw new X(o);return kd(s)}function u5(s){return s===null}function f5(s){return s==null}function Rp(s){return typeof s=="number"||Me(s)&&tt(s)==Wi}function as(s){if(!Me(s)||tt(s)!=wn)return!1;var l=uo(s);if(l===null)return!0;var u=ve.call(l,"constructor")&&l.constructor;return typeof u=="function"&&u instanceof u&&oo.call(u)==l2}var Jc=Jh?xt(Jh):uv;function h5(s){return Op(s)&&s>=-9007199254740991&&s<=jn}var Lp=qh?xt(qh):fv;function Fo(s){return typeof s=="string"||!Z(s)&&Me(s)&&tt(s)==Vi}function kt(s){return typeof s=="symbol"||Me(s)&&tt(s)==Xs}var hi=jh?xt(jh):hv;function d5(s){return s===t}function p5(s){return Me(s)&&et(s)==Ki}function m5(s){return Me(s)&&tt(s)==Oy}var g5=Ao(Sc),y5=Ao(function(s,l){return s<=l});function Pp(s){if(!s)return[];if(ut(s))return Fo(s)?jt(s):ct(s);if(qi&&s[qi])return jb(s[qi]());var l=et(s),u=l==Jt?ac:l==qt?ro:di;return u(s)}function Mn(s){if(!s)return s===0?s:0;if(s=Ht(s),s===vt||s===-1/0){var l=s<0?-1:1;return l*Js}return s===s?s:0}function Q(s){var l=Mn(s),u=l%1;return l===l?u?l-u:l:0}function Dp(s){return s?Or(Q(s),0,wt):0}function Ht(s){if(typeof s=="number")return s;if(kt(s))return ln;if(Ce(s)){var l=typeof s.valueOf=="function"?s.valueOf():s;s=Ce(l)?l+"":l}if(typeof s!="string")return s===0?s:+s;s=td(s);var u=Zy.test(s);return u||eb.test(s)?Nb(s.slice(2),u?2:8):Xy.test(s)?ln:+s}function zp(s){return cn(s,ft(s))}function b5(s){return s?Or(Q(s),-9007199254740991,jn):s===0?s:0}function ge(s){return s==null?"":Et(s)}var v5=ci(function(s,l){if(ss(l)||ut(l)){cn(l,He(l),s);return}for(var u in l)ve.call(l,u)&&Qi(s,u,l[u])}),Bp=ci(function(s,l){cn(l,ft(l),s)}),Ho=ci(function(s,l,u,d){cn(l,ft(l),s,d)}),w5=ci(function(s,l,u,d){cn(l,He(l),s,d)}),S5=_n(pc);function x5(s,l){var u=ai(s);return l==null?u:gd(u,l)}var E5=ie(function(s,l){s=we(s);var u=-1,d=l.length,y=d>2?l[2]:t;for(y&&nt(l[0],l[1],y)&&(d=1);++u<d;)for(var w=l[u],x=ft(w),k=-1,T=x.length;++k<T;){var O=x[k],N=s[O];(N===t||Xt(N,si[O])&&!ve.call(s,O))&&(s[O]=w[O])}return s}),k5=ie(function(s){return s.push(t,tp),St(Fp,t,s)});function _5(s,l){return Xh(s,J(l,3),an)}function T5(s,l){return Xh(s,J(l,3),gc)}function C5(s,l){return s==null?s:mc(s,J(l,3),ft)}function M5(s,l){return s==null?s:Sd(s,J(l,3),ft)}function A5(s,l){return s&&an(s,J(l,3))}function I5(s,l){return s&&gc(s,J(l,3))}function O5(s){return s==null?[]:So(s,He(s))}function N5(s){return s==null?[]:So(s,ft(s))}function qc(s,l,u){var d=s==null?t:Nr(s,l);return d===t?u:d}function R5(s,l){return s!=null&&ip(s,l,nv)}function jc(s,l){return s!=null&&ip(s,l,rv)}var L5=Yd(function(s,l,u){l!=null&&typeof l.toString!="function"&&(l=lo.call(l)),s[l]=u},Xc(ht)),P5=Yd(function(s,l,u){l!=null&&typeof l.toString!="function"&&(l=lo.call(l)),ve.call(s,l)?s[l].push(u):s[l]=[u]},J),D5=ie(ts);function He(s){return ut(s)?pd(s):wc(s)}function ft(s){return ut(s)?pd(s,!0):dv(s)}function z5(s,l){var u={};return l=J(l,3),an(s,function(d,y,w){En(u,l(d,y,w),d)}),u}function B5(s,l){var u={};return l=J(l,3),an(s,function(d,y,w){En(u,y,l(d,y,w))}),u}var F5=ci(function(s,l,u){xo(s,l,u)}),Fp=ci(function(s,l,u,d){xo(s,l,u,d)}),H5=_n(function(s,l){var u={};if(s==null)return u;var d=!1;l=_e(l,function(w){return w=nr(w,s),d||(d=w.length>1),w}),cn(s,Lc(s),u),d&&(u=zt(u,p|g|b,Lv));for(var y=l.length;y--;)Tc(u,l[y]);return u});function $5(s,l){return Hp(s,zo(J(l)))}var W5=_n(function(s,l){return s==null?{}:mv(s,l)});function Hp(s,l){if(s==null)return{};var u=_e(Lc(s),function(d){return[d]});return l=J(l),Od(s,u,function(d,y){return l(d,y[0])})}function U5(s,l,u){l=nr(l,s);var d=-1,y=l.length;for(y||(y=1,s=t);++d<y;){var w=s==null?t:s[un(l[d])];w===t&&(d=y,w=u),s=Cn(w)?w.call(s):w}return s}function V5(s,l,u){return s==null?s:rs(s,l,u)}function K5(s,l,u,d){return d=typeof d=="function"?d:t,s==null?s:rs(s,l,u,d)}var $p=Qd(He),Wp=Qd(ft);function G5(s,l,u){var d=Z(s),y=d||ir(s)||hi(s);if(l=J(l,4),u==null){var w=s&&s.constructor;y?u=d?new w:[]:Ce(s)?u=Cn(w)?ai(uo(s)):{}:u={}}return(y?Lt:an)(s,function(x,k,T){return l(u,x,k,T)}),u}function J5(s,l){return s==null?!0:Tc(s,l)}function q5(s,l,u){return s==null?s:Dd(s,l,Ac(u))}function j5(s,l,u,d){return d=typeof d=="function"?d:t,s==null?s:Dd(s,l,Ac(u),d)}function di(s){return s==null?[]:lc(s,He(s))}function Y5(s){return s==null?[]:lc(s,ft(s))}function X5(s,l,u){return u===t&&(u=l,l=t),u!==t&&(u=Ht(u),u=u===u?u:0),l!==t&&(l=Ht(l),l=l===l?l:0),Or(Ht(s),l,u)}function Z5(s,l,u){return l=Mn(l),u===t?(u=l,l=0):u=Mn(u),s=Ht(s),iv(s,l,u)}function Q5(s,l,u){if(u&&typeof u!="boolean"&&nt(s,l,u)&&(l=u=t),u===t&&(typeof l=="boolean"?(u=l,l=t):typeof s=="boolean"&&(u=s,s=t)),s===t&&l===t?(s=0,l=1):(s=Mn(s),l===t?(l=s,s=0):l=Mn(l)),s>l){var d=s;s=l,l=d}if(u||s%1||l%1){var y=hd();return Qe(s+y*(l-s+Ob("1e-"+((y+"").length-1))),l)}return Ec(s,l)}var ex=ui(function(s,l,u){return l=l.toLowerCase(),s+(u?Up(l):l)});function Up(s){return Yc(ge(s).toLowerCase())}function Vp(s){return s=ge(s),s&&s.replace(nb,Vb).replace(Sb,"")}function tx(s,l,u){s=ge(s),l=Et(l);var d=s.length;u=u===t?d:Or(Q(u),0,d);var y=u;return u-=l.length,u>=0&&s.slice(u,y)==l}function nx(s){return s=ge(s),s&&Dy.test(s)?s.replace(Sh,Kb):s}function rx(s){return s=ge(s),s&&Wy.test(s)?s.replace(Ka,"\\$&"):s}var ix=ui(function(s,l,u){return s+(u?"-":"")+l.toLowerCase()}),sx=ui(function(s,l,u){return s+(u?" ":"")+l.toLowerCase()}),ox=Jd("toLowerCase");function lx(s,l,u){s=ge(s),l=Q(l);var d=l?ri(s):0;if(!l||d>=l)return s;var y=(l-d)/2;return Mo(mo(y),u)+s+Mo(po(y),u)}function ax(s,l,u){s=ge(s),l=Q(l);var d=l?ri(s):0;return l&&d<l?s+Mo(l-d,u):s}function cx(s,l,u){s=ge(s),l=Q(l);var d=l?ri(s):0;return l&&d<l?Mo(l-d,u)+s:s}function ux(s,l,u){return u||l==null?l=0:l&&(l=+l),y2(ge(s).replace(Ga,""),l||0)}function fx(s,l,u){return(u?nt(s,l,u):l===t)?l=1:l=Q(l),kc(ge(s),l)}function hx(){var s=arguments,l=ge(s[0]);return s.length<3?l:l.replace(s[1],s[2])}var dx=ui(function(s,l,u){return s+(u?"_":"")+l.toLowerCase()});function px(s,l,u){return u&&typeof u!="number"&&nt(s,l,u)&&(l=u=t),u=u===t?wt:u>>>0,u?(s=ge(s),s&&(typeof l=="string"||l!=null&&!Jc(l))&&(l=Et(l),!l&&ni(s))?rr(jt(s),0,u):s.split(l,u)):[]}var mx=ui(function(s,l,u){return s+(u?" ":"")+Yc(l)});function gx(s,l,u){return s=ge(s),u=u==null?0:Or(Q(u),0,s.length),l=Et(l),s.slice(u,u+l.length)==l}function yx(s,l,u){var d=v.templateSettings;u&&nt(s,l,u)&&(l=t),s=ge(s),l=Ho({},l,d,ep);var y=Ho({},l.imports,d.imports,ep),w=He(y),x=lc(y,w),k,T,O=0,N=l.interpolate||Zs,R="__p += '",H=cc((l.escape||Zs).source+"|"+N.source+"|"+(N===xh?Yy:Zs).source+"|"+(l.evaluate||Zs).source+"|$","g"),G="//# sourceURL="+(ve.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Tb+"]")+`
23
+ `;s.replace(H,function(j,se,fe,_t,rt,Tt){return fe||(fe=_t),R+=s.slice(O,Tt).replace(rb,Gb),se&&(k=!0,R+=`' +
24
24
  __e(`+se+`) +
25
25
  '`),rt&&(T=!0,R+=`';
26
26
  `+rt+`;
27
27
  __p += '`),fe&&(R+=`' +
28
28
  ((__t = (`+fe+`)) == null ? '' : __t) +
29
- '`),O=_t+j.length,j}),R+=`';
29
+ '`),O=Tt+j.length,j}),R+=`';
30
30
  `;var q=ve.call(l,"variable")&&l.variable;if(!q)R=`with (obj) {
31
31
  `+R+`
32
32
  }
33
- `;else if(Jy.test(q))throw new X(c);R=(T?R.replace(Oy,""):R).replace(Ny,"$1").replace(Ry,"$1;"),R="function("+(q||"obj")+`) {
33
+ `;else if(qy.test(q))throw new X(c);R=(T?R.replace(Ny,""):R).replace(Ry,"$1").replace(Ly,"$1;"),R="function("+(q||"obj")+`) {
34
34
  `+(q?"":`obj || (obj = {});
35
35
  `)+"var __t, __p = ''"+(k?", __e = _.escape":"")+(T?`, __j = Array.prototype.join;
36
36
  function print() { __p += __j.call(arguments, '') }
37
37
  `:`;
38
38
  `)+R+`return __p
39
- }`;var ee=Gp(function(){return me(w,G+"return "+R).apply(t,x)});if(ee.source=R,Gc(ee))throw ee;return ee}function yx(s){return ge(s).toLowerCase()}function bx(s){return ge(s).toUpperCase()}function vx(s,l,u){if(s=ge(s),s&&(u||l===t))return td(s);if(!s||!(l=xt(l)))return s;var d=jt(s),y=jt(l),w=nd(d,y),x=rd(d,y)+1;return rr(d,w,x).join("")}function wx(s,l,u){if(s=ge(s),s&&(u||l===t))return s.slice(0,sd(s)+1);if(!s||!(l=xt(l)))return s;var d=jt(s),y=rd(d,jt(l))+1;return rr(d,0,y).join("")}function Sx(s,l,u){if(s=ge(s),s&&(u||l===t))return s.replace(Ga,"");if(!s||!(l=xt(l)))return s;var d=jt(s),y=nd(d,jt(l));return rr(d,y).join("")}function xx(s,l){var u=Jn,d=sn;if(Ce(l)){var y="separator"in l?l.separator:y;u="length"in l?Q(l.length):u,d="omission"in l?xt(l.omission):d}s=ge(s);var w=s.length;if(ni(s)){var x=jt(s);w=x.length}if(u>=w)return s;var k=u-ri(d);if(k<1)return d;var T=x?rr(x,0,k).join(""):s.slice(0,k);if(y===t)return T+d;if(x&&(k+=T.length-k),Jc(y)){if(s.slice(k).search(y)){var O,N=T;for(y.global||(y=cc(y.source,ge(Eh.exec(y))+"g")),y.lastIndex=0;O=y.exec(N);)var R=O.index;T=T.slice(0,R===t?k:R)}}else if(s.indexOf(xt(y),k)!=k){var H=T.lastIndexOf(y);H>-1&&(T=T.slice(0,H))}return T+d}function Ex(s){return s=ge(s),s&&Ly.test(s)?s.replace(wh,Z2):s}var kx=ui(function(s,l,u){return s+(u?" ":"")+l.toUpperCase()}),Yc=Jd("toUpperCase");function Kp(s,l,u){return s=ge(s),l=u?t:l,l===t?J2(s)?tb(s):z2(s):s.match(l)||[]}var Gp=ie(function(s,l){try{return wt(s,t,l)}catch(u){return Gc(u)?u:new X(u)}}),_x=_n(function(s,l){return Rt(l,function(u){u=un(u),En(s,u,Vc(s[u],s))}),s});function Tx(s){var l=s==null?0:s.length,u=J();return s=l?ke(s,function(d){if(typeof d[1]!="function")throw new Lt(a);return[u(d[0]),d[1]]}):[],ie(function(d){for(var y=-1;++y<l;){var w=s[y];if(wt(w[0],this,d))return wt(w[1],this,d)}})}function Cx(s){return Zb(Dt(s,p))}function Xc(s){return function(){return s}}function Mx(s,l){return s==null||s!==s?l:s}var Ax=jd(),Ix=jd(!0);function ht(s){return s}function Zc(s){return _d(typeof s=="function"?s:Dt(s,p))}function Ox(s){return Cd(Dt(s,p))}function Nx(s,l){return Md(s,Dt(l,p))}var Rx=ie(function(s,l){return function(u){return ts(u,s,l)}}),Lx=ie(function(s,l){return function(u){return ts(s,u,l)}});function Qc(s,l,u){var d=He(l),y=So(l,d);u==null&&!(Ce(l)&&(y.length||!d.length))&&(u=l,l=s,s=this,y=So(l,He(l)));var w=!(Ce(u)&&"chain"in u)||!!u.chain,x=Cn(s);return Rt(y,function(k){var T=l[k];s[k]=T,x&&(s.prototype[k]=function(){var O=this.__chain__;if(w||O){var N=s(this.__wrapped__),R=N.__actions__=ct(this.__actions__);return R.push({func:T,args:arguments,thisArg:s}),N.__chain__=O,N}return T.apply(s,Xn([this.value()],arguments))})}),s}function Px(){return qe._===this&&(qe._=lb),this}function eu(){}function Dx(s){return s=Q(s),ie(function(l){return Ad(l,s)})}var Bx=Oc(ke),zx=Oc(Yh),Fx=Oc(nc);function Jp(s){return zc(s)?rc(un(s)):mv(s)}function Hx(s){return function(l){return s==null?t:Or(s,l)}}var $x=Xd(),Wx=Xd(!0);function tu(){return[]}function nu(){return!1}function Ux(){return{}}function Vx(){return""}function Kx(){return!0}function Gx(s,l){if(s=Q(s),s<1||s>jn)return[];var u=vt,d=Qe(s,vt);l=J(l),s-=vt;for(var y=oc(d,l);++u<s;)l(u);return y}function Jx(s){return Z(s)?ke(s,un):Et(s)?[s]:ct(dp(ge(s)))}function qx(s){var l=++sb;return ge(s)+l}var jx=Co(function(s,l){return s+l},0),Yx=Nc("ceil"),Xx=Co(function(s,l){return s/l},1),Zx=Nc("floor");function Qx(s){return s&&s.length?wo(s,ht,yc):t}function eE(s,l){return s&&s.length?wo(s,J(l,2),yc):t}function tE(s){return Qh(s,ht)}function nE(s,l){return Qh(s,J(l,2))}function rE(s){return s&&s.length?wo(s,ht,Sc):t}function iE(s,l){return s&&s.length?wo(s,J(l,2),Sc):t}var sE=Co(function(s,l){return s*l},1),oE=Nc("round"),lE=Co(function(s,l){return s-l},0);function aE(s){return s&&s.length?sc(s,ht):0}function cE(s,l){return s&&s.length?sc(s,J(l,2)):0}return v.after=OS,v.ary=kp,v.assign=b5,v.assignIn=zp,v.assignInWith=Ho,v.assignWith=v5,v.at=w5,v.before=_p,v.bind=Vc,v.bindAll=_x,v.bindKey=Tp,v.castArray=US,v.chain=Sp,v.chunk=Zv,v.compact=Qv,v.concat=ew,v.cond=Tx,v.conforms=Cx,v.constant=Xc,v.countBy=aS,v.create=S5,v.curry=Cp,v.curryRight=Mp,v.debounce=Ap,v.defaults=x5,v.defaultsDeep=E5,v.defer=NS,v.delay=RS,v.difference=tw,v.differenceBy=nw,v.differenceWith=rw,v.drop=iw,v.dropRight=sw,v.dropRightWhile=ow,v.dropWhile=lw,v.fill=aw,v.filter=uS,v.flatMap=dS,v.flatMapDeep=pS,v.flatMapDepth=mS,v.flatten=yp,v.flattenDeep=cw,v.flattenDepth=uw,v.flip=LS,v.flow=Ax,v.flowRight=Ix,v.fromPairs=fw,v.functions=I5,v.functionsIn=O5,v.groupBy=gS,v.initial=dw,v.intersection=pw,v.intersectionBy=mw,v.intersectionWith=gw,v.invert=R5,v.invertBy=L5,v.invokeMap=bS,v.iteratee=Zc,v.keyBy=vS,v.keys=He,v.keysIn=ft,v.map=Lo,v.mapKeys=D5,v.mapValues=B5,v.matches=Ox,v.matchesProperty=Nx,v.memoize=Do,v.merge=z5,v.mergeWith=Fp,v.method=Rx,v.methodOf=Lx,v.mixin=Qc,v.negate=Bo,v.nthArg=Dx,v.omit=F5,v.omitBy=H5,v.once=PS,v.orderBy=wS,v.over=Bx,v.overArgs=DS,v.overEvery=zx,v.overSome=Fx,v.partial=Kc,v.partialRight=Ip,v.partition=SS,v.pick=$5,v.pickBy=Hp,v.property=Jp,v.propertyOf=Hx,v.pull=ww,v.pullAll=vp,v.pullAllBy=Sw,v.pullAllWith=xw,v.pullAt=Ew,v.range=$x,v.rangeRight=Wx,v.rearg=BS,v.reject=kS,v.remove=kw,v.rest=zS,v.reverse=Wc,v.sampleSize=TS,v.set=U5,v.setWith=V5,v.shuffle=CS,v.slice=_w,v.sortBy=IS,v.sortedUniq=Nw,v.sortedUniqBy=Rw,v.split=dx,v.spread=FS,v.tail=Lw,v.take=Pw,v.takeRight=Dw,v.takeRightWhile=Bw,v.takeWhile=zw,v.tap=Qw,v.throttle=HS,v.thru=Ro,v.toArray=Pp,v.toPairs=$p,v.toPairsIn=Wp,v.toPath=Jx,v.toPlainObject=Bp,v.transform=K5,v.unary=$S,v.union=Fw,v.unionBy=Hw,v.unionWith=$w,v.uniq=Ww,v.uniqBy=Uw,v.uniqWith=Vw,v.unset=G5,v.unzip=Uc,v.unzipWith=wp,v.update=J5,v.updateWith=q5,v.values=di,v.valuesIn=j5,v.without=Kw,v.words=Kp,v.wrap=WS,v.xor=Gw,v.xorBy=Jw,v.xorWith=qw,v.zip=jw,v.zipObject=Yw,v.zipObjectDeep=Xw,v.zipWith=Zw,v.entries=$p,v.entriesIn=Wp,v.extend=zp,v.extendWith=Ho,Qc(v,v),v.add=jx,v.attempt=Gp,v.camelCase=Q5,v.capitalize=Up,v.ceil=Yx,v.clamp=Y5,v.clone=VS,v.cloneDeep=GS,v.cloneDeepWith=JS,v.cloneWith=KS,v.conformsTo=qS,v.deburr=Vp,v.defaultTo=Mx,v.divide=Xx,v.endsWith=ex,v.eq=Xt,v.escape=tx,v.escapeRegExp=nx,v.every=cS,v.find=fS,v.findIndex=mp,v.findKey=k5,v.findLast=hS,v.findLastIndex=gp,v.findLastKey=_5,v.floor=Zx,v.forEach=xp,v.forEachRight=Ep,v.forIn=T5,v.forInRight=C5,v.forOwn=M5,v.forOwnRight=A5,v.get=qc,v.gt=jS,v.gte=YS,v.has=N5,v.hasIn=jc,v.head=bp,v.identity=ht,v.includes=yS,v.indexOf=hw,v.inRange=X5,v.invoke=P5,v.isArguments=Lr,v.isArray=Z,v.isArrayBuffer=XS,v.isArrayLike=ut,v.isArrayLikeObject=Oe,v.isBoolean=ZS,v.isBuffer=ir,v.isDate=QS,v.isElement=e5,v.isEmpty=t5,v.isEqual=n5,v.isEqualWith=r5,v.isError=Gc,v.isFinite=i5,v.isFunction=Cn,v.isInteger=Op,v.isLength=zo,v.isMap=Np,v.isMatch=s5,v.isMatchWith=o5,v.isNaN=l5,v.isNative=a5,v.isNil=u5,v.isNull=c5,v.isNumber=Rp,v.isObject=Ce,v.isObjectLike=Me,v.isPlainObject=as,v.isRegExp=Jc,v.isSafeInteger=f5,v.isSet=Lp,v.isString=Fo,v.isSymbol=Et,v.isTypedArray=hi,v.isUndefined=h5,v.isWeakMap=d5,v.isWeakSet=p5,v.join=yw,v.kebabCase=rx,v.last=zt,v.lastIndexOf=bw,v.lowerCase=ix,v.lowerFirst=sx,v.lt=m5,v.lte=g5,v.max=Qx,v.maxBy=eE,v.mean=tE,v.meanBy=nE,v.min=rE,v.minBy=iE,v.stubArray=tu,v.stubFalse=nu,v.stubObject=Ux,v.stubString=Vx,v.stubTrue=Kx,v.multiply=sE,v.nth=vw,v.noConflict=Px,v.noop=eu,v.now=Po,v.pad=ox,v.padEnd=lx,v.padStart=ax,v.parseInt=cx,v.random=Z5,v.reduce=xS,v.reduceRight=ES,v.repeat=ux,v.replace=fx,v.result=W5,v.round=oE,v.runInContext=_,v.sample=_S,v.size=MS,v.snakeCase=hx,v.some=AS,v.sortedIndex=Tw,v.sortedIndexBy=Cw,v.sortedIndexOf=Mw,v.sortedLastIndex=Aw,v.sortedLastIndexBy=Iw,v.sortedLastIndexOf=Ow,v.startCase=px,v.startsWith=mx,v.subtract=lE,v.sum=aE,v.sumBy=cE,v.template=gx,v.times=Gx,v.toFinite=Mn,v.toInteger=Q,v.toLength=Dp,v.toLower=yx,v.toNumber=Ft,v.toSafeInteger=y5,v.toString=ge,v.toUpper=bx,v.trim=vx,v.trimEnd=wx,v.trimStart=Sx,v.truncate=xx,v.unescape=Ex,v.uniqueId=qx,v.upperCase=kx,v.upperFirst=Yc,v.each=xp,v.eachRight=Ep,v.first=bp,Qc(v,function(){var s={};return an(v,function(l,u){ve.call(v.prototype,u)||(s[u]=l)}),s}(),{chain:!1}),v.VERSION=r,Rt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){v[s].placeholder=v}),Rt(["drop","take"],function(s,l){oe.prototype[s]=function(u){u=u===t?1:De(Q(u),0);var d=this.__filtered__&&!l?new oe(this):this.clone();return d.__filtered__?d.__takeCount__=Qe(u,d.__takeCount__):d.__views__.push({size:Qe(u,vt),type:s+(d.__dir__<0?"Right":"")}),d},oe.prototype[s+"Right"]=function(u){return this.reverse()[s](u).reverse()}}),Rt(["filter","map","takeWhile"],function(s,l){var u=l+1,d=u==on||u==Fe;oe.prototype[s]=function(y){var w=this.clone();return w.__iteratees__.push({iteratee:J(y,3),type:u}),w.__filtered__=w.__filtered__||d,w}}),Rt(["head","last"],function(s,l){var u="take"+(l?"Right":"");oe.prototype[s]=function(){return this[u](1).value()[0]}}),Rt(["initial","tail"],function(s,l){var u="drop"+(l?"":"Right");oe.prototype[s]=function(){return this.__filtered__?new oe(this):this[u](1)}}),oe.prototype.compact=function(){return this.filter(ht)},oe.prototype.find=function(s){return this.filter(s).head()},oe.prototype.findLast=function(s){return this.reverse().find(s)},oe.prototype.invokeMap=ie(function(s,l){return typeof s=="function"?new oe(this):this.map(function(u){return ts(u,s,l)})}),oe.prototype.reject=function(s){return this.filter(Bo(J(s)))},oe.prototype.slice=function(s,l){s=Q(s);var u=this;return u.__filtered__&&(s>0||l<0)?new oe(u):(s<0?u=u.takeRight(-s):s&&(u=u.drop(s)),l!==t&&(l=Q(l),u=l<0?u.dropRight(-l):u.take(l-s)),u)},oe.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},oe.prototype.toArray=function(){return this.take(vt)},an(oe.prototype,function(s,l){var u=/^(?:filter|find|map|reject)|While$/.test(l),d=/^(?:head|last)$/.test(l),y=v[d?"take"+(l=="last"?"Right":""):l],w=d||/^find/.test(l);y&&(v.prototype[l]=function(){var x=this.__wrapped__,k=d?[1]:arguments,T=x instanceof oe,O=k[0],N=T||Z(x),R=function(se){var fe=y.apply(v,Xn([se],k));return d&&H?fe[0]:fe};N&&u&&typeof O=="function"&&O.length!=1&&(T=N=!1);var H=this.__chain__,G=!!this.__actions__.length,q=w&&!H,ee=T&&!G;if(!w&&N){x=ee?x:new oe(this);var j=s.apply(x,k);return j.__actions__.push({func:Ro,args:[R],thisArg:t}),new Pt(j,H)}return q&&ee?s.apply(this,k):(j=this.thru(R),q?d?j.value()[0]:j.value():j)})}),Rt(["pop","push","shift","sort","splice","unshift"],function(s){var l=io[s],u=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",d=/^(?:pop|shift)$/.test(s);v.prototype[s]=function(){var y=arguments;if(d&&!this.__chain__){var w=this.value();return l.apply(Z(w)?w:[],y)}return this[u](function(x){return l.apply(Z(x)?x:[],y)})}}),an(oe.prototype,function(s,l){var u=v[l];if(u){var d=u.name+"";ve.call(li,d)||(li[d]=[]),li[d].push({name:l,func:u})}}),li[To(t,M).name]=[{name:"wrapper",func:t}],oe.prototype.clone=Eb,oe.prototype.reverse=kb,oe.prototype.value=_b,v.prototype.at=eS,v.prototype.chain=tS,v.prototype.commit=nS,v.prototype.next=rS,v.prototype.plant=sS,v.prototype.reverse=oS,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=lS,v.prototype.first=v.prototype.head,qi&&(v.prototype[qi]=iS),v},ii=nb();Tr?((Tr.exports=ii)._=ii,Za._=ii):qe._=ii}).call(XI)}(Ws,Ws.exports)),Ws.exports}var by=ZI();function ch(n){return n.type.create(by.cloneDeep(n.attrs))}function QI(n){return JSON.parse(JSON.stringify(n))}function uh({tr:n,node:e,position:t,mark:r}){return e.isText?n.removeMark(t,t+e.nodeSize,r):n.removeNodeMark(t,r)}const eO=Ie.create({name:"node_processor",addCommands(){return{setBlockAttributes:B(({commands:n,state:e},t,r,i={})=>{const o=QI(r),a=z(n.getBlockAttributes(t))??{},{doc:c,tr:f}=e,{from:h,to:m}=f.selection;c.nodesBetween(h,m,(p,g)=>{Ef.includes(p.type.name)&&f.setNodeAttribute(g,t,{...i,...a,...o})})}),getBlockAttributes:B(({editor:n},e,t)=>de(()=>{let r=Object.assign({},t||{});for(const i of Ef)Object.assign(r,n.getAttributes(i)?.[e]||{});return Object.keys(r).length?r:null})),removeBlockAttributes:B(({commands:n},e)=>{for(const t of Ef)n.resetAttributes(t,e)}),applyMark:B(({state:n,commands:e},t,r,i={})=>{const{tr:o,doc:a,schema:c}=n,{$from:f,$to:h}=o.selection,m=hn(Te.LINK,c),p=hn(t,c);if(!(p.spec.group||"").includes(Wt.SETTINGS))return e.setMark(t,r);if(f.pos===h.pos)return;const b=S=>{if(!i.onAppliedToParent||i.onAppliedToParent(S)===!1){const{tr:E,node:C,position:M,mark:P}=S;uh({tr:E,node:C,position:M,mark:P.type})}};a.nodesBetween(f.pos,h.pos,(S,E)=>{if(S.type.name===te.LIST)return;const C=YI(S.marks,t),M=p.create({...C?.attrs||{},...r}),P=my(f,h,S,E);if(!m.isInSet(S.marks)&&jI(o.doc,E,M,i.isAppliedToParent))return b({tr:o,node:S,position:E,mark:M});if(S.isText){o.addMark(P.from,P.to,M);return}JI(o.doc,o.selection,S,E)&&o.addNodeMark(E,M)})}),getMarks:B(({editor:n},e)=>{const t=yi(n,"state");return de(()=>{const{selection:r,doc:i}=z(t),{from:o,to:a}=z(r),c=[];return i.nodesBetween(o,a,f=>{for(const h of f.marks)h.type.name===e&&c.unshift(h.attrs)}),c})}),getMark:B(({commands:n},e)=>{const t=n.getMarks(e);return de(()=>z(t)[0]??null)}),hasMark:B(({commands:n},e)=>{const t=n.getMark(e);return de(()=>!!z(t))}),getCommonSettingMark:B(({commands:n},e,t)=>{const r=n.getMark(e);return de(()=>z(r)?.value??z(t))}),getDeviceSettingMark:B(({commands:n},e,t)=>{const r=n.getMarks(e),i=n.getDevice();return de(()=>{for(const o of z(r)){const a=o[z(i)];if(a)return a}return z(t)})}),removeAllMarks:B(({state:n})=>{const{tr:e,doc:t}=n,{from:r,to:i}=e.selection;t.nodesBetween(r,i,(o,a)=>{for(const c of o.marks)uh({tr:e,node:o,position:a,mark:c})})}),removeMarks:B(({state:n},e)=>{const{tr:t,doc:r}=n,{from:i,to:o}=t.selection;r.nodesBetween(i,o,(a,c)=>{const f=a.marks.filter(h=>e.includes(h.type.name));for(const h of f)uh({tr:t,node:a,position:c,mark:h})})})}}}),tO=Ie.create({name:"text_processor",addCommands(){return{getSelectedText:B(({state:n})=>{const{from:e,to:t}=n.selection;return n.doc.textBetween(e,t," ")}),transformText:B(({state:n},e)=>{const{$from:t,$to:r}=n.tr.selection;t.pos!==r.pos&&n.doc.nodesBetween(t.pos,r.pos,(i,o)=>{if(!i.isText)return;const a=my(t,r,i,o),c=Math.max(0,t.pos-o),f=Math.max(0,r.pos-o),h=e({text:i.textContent.substring(c,f)}),m=n.schema.text(h,i.marks);n.tr.replaceWith(a.from,a.to,m)})})}}}),nO=Ie.create({name:"selection_processor",addStorage:()=>({selection:null}),addCommands(){return{storeSelection:B(({state:n})=>{this.storage.selection=n.selection}),restoreSelection:B(({commands:n})=>{this.storage.selection&&n.setTextSelection(this.storage.selection)}),expandSelection:B(({tr:n,commands:e},t)=>{let r=n.selection.from,i=n.selection.to;return n.doc.nodesBetween(r,i,(o,a,c)=>{if(t({node:o,parent:c})){const f=o.isText?0:gy(n.doc,a);r=Math.min(r,a+f),i=Math.max(i,a+o.nodeSize-f)}}),e.setTextSelection({from:r,to:i})}),expandSelectionToBlock:B(({commands:n})=>n.expandSelection(({parent:e})=>e.type.name===te.DOCUMENT))}}}),rO=Gn.create({name:"doc",topNode:!0,content:"block+"});class Gs extends $e{constructor(e,t,r,i="SetDocAttr"){super(),this.key=e,this.value=t,this.schema=r,this.stepType=i}apply(e){this.prevValue=e.attrs.meta[this.key];const t=ur.fromJSON(this.schema,e.toJSON());return t.attrs.meta[this.key]=this.value,Re.ok(t)}invert(){return new Gs(this.key,this.prevValue,this.schema,"revertSetDocAttr")}map(){return null}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}static fromJSON(e){return new Gs(e.key,e.value,e.stepType)}}$e.jsonID("setDocAttr",Gs);const iO=rO.extend({marks:Wt.SETTINGS,addAttributes:()=>({meta:{default:{}}}),onCreate(){this.editor.view.dom.addEventListener("click",n=>{n.target.closest("a")&&n.preventDefault()})},addCommands(){return{setDocMetaAttributes:B(({state:n},e,t)=>{n.tr.step(new Gs(e,t,n.schema))})}}}),sO=Gn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Ai(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),oO=sO.extend({marks:Wt.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),lO=Gn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,Ai(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>LM({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),aO=lO.extend({marks:Wt.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),cO=Ie.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[ZM.create(this.editor),QM.create(this.editor)]}}),uO=()=>[iO,oO,aO,BM,JM,eO,tO,nO,cO],fO=Mt.create({name:Te.FONT_FAMILY,group:Wt.SETTINGS,addOptions:()=>({fonts:[]}),addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontFamily:B(({commands:n},e)=>{n.applyMark(this.name,{value:e});const t=n.findFontByName(e);let r=z(n.getFontWeight());t.isWeightSupported(r)||(r=t.findClosestWeight(r),n.applyFontWeight(r));const i=n.isSettingCustomized(Te.FONT_STYLE).value;t.isItalicOnly?n.applyItalic():!t.isItalicSupported(r)&&i&&n.removeItalic()}),getFont:B(({commands:n})=>{const e=z(this.options.defaultPreset),t=n.findFontByName(e.common.font_family),r=n.getFontFamily();return de(()=>n.findFontByName(z(r))||t)}),findFontByName:B((n,e)=>z(this.options.fonts).find(t=>t.name===e)??this.options.defaultFont),getFontFamily:B(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontFamily())),getDefaultFontFamily:B(({commands:n})=>{const e=n.getPreset();return de(()=>z(e).common.font_family)})}},parseHTML(){const n=e=>({value:e.replace(/["']/g,"")});return[{style:"--zw-font-family",getAttrs:n},{style:"font-family",getAttrs:n}]},renderHTML({HTMLAttributes:n}){const e=n.value?`"${n.value}"`:null;return Jr({font_family:e})}}),hO=Ie.create({name:Te.STYLE_PRESET,addGlobalAttributes(){return[{types:[te.PARAGRAPH,te.HEADING],attributes:{preset:{isRequired:!1,default:{id:z(this.options.defaultId)},parseHTML:n=>{const e=z(this.options.presets);if(n.parentElement.tagName==="LI")return null;for(const{id:t,node:r,fallbackClass:i}of e){if(i&&n.classList.contains(i))return{id:t};const o=z(this.options.styleRenderer).makePresetCssClass({id:t});if(n.matches(o))return{id:t};if(n.tagName===`H${r?.level}`)return{id:t}}return n.tagName==="P"?{id:z(this.options.defaultId)}:null},renderHTML:n=>n.preset?{class:z(this.options.styleRenderer).makePresetHtmlClass(n.preset)}:null}}}]},addCommands(){function n(t,r){return t.find(i=>r===i.id)}function e(t,r){const i={};for(const o of Object.keys(t)){const a=t[o],c=r[o],f=!c||c.toLowerCase()==="inherit";i[o]=f?a:c}return i}return{getPresetList:B(()=>de(()=>z(this.options.presets).filter(t=>!t.hidden))),getPreset:B(({commands:t})=>{const r=t.getBlockAttributes("preset",{id:z(this.options.defaultId)}),i=t.getPresetList(),o=t.isLink(),a=t.getLinkPreset();return de(()=>{const c=n(z(i),z(r).id);if(!z(o))return c;const f=z(a);return{id:c.id,common:e(c.common,f.common),mobile:e(c.mobile,f.mobile),tablet:e(c.tablet,f.tablet),desktop:e(c.desktop,f.desktop)}})}),applyPreset:B(({commands:t,chain:r},i)=>{const o=z(t.getPresetList()),a=n(o,i),c=a.node?.type??te.PARAGRAPH,f={preset:{id:i}};a.node&&(f.level=a.node.level);for(const h of j0)f[h]=z(t.getBlockAttributes(h));r().removeList().setNode(c,f).run()}),applyDefaultPreset:B(({commands:t})=>{t.applyPreset(z(this.options.defaultId))}),removePreset:B(({commands:t})=>{t.setNode(te.PARAGRAPH,{preset:null})}),getPresetCustomization:B(({editor:t,commands:r})=>{const i=yi(t,"state");return de(()=>{const{selection:o,doc:a}=z(i),{from:c,to:f}=o;return r._getSettingCustomization(a,c,f)})}),isSettingCustomized:B(({commands:t},r)=>{const i=t.getPresetCustomization(),o=zl.includes(r)?"attributes":"marks";return de(()=>z(i)[o]?.includes(r)??!1)}),getContentCustomization:B(({editor:t,commands:r})=>{const i=yi(t,"state");return de(()=>{const{doc:o}=z(i);return r._getSettingCustomization(o,0,o.content.size)})}),_getSettingCustomization:B((t,r,i,o)=>{const a=new Set,c=new Set;return r.nodesBetween(i,o,f=>{for(const[h,m]of Object.entries(f.attrs))zl.includes(h)&&m&&c.add(h);for(const{type:h}of f.marks)X0.includes(h.name)&&a.add(h.name)}),{attributes:Array.from(c),marks:Array.from(a)}}),removePresetCustomization:B(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(X0).resetAttributes(te.PARAGRAPH,zl).resetAttributes(te.HEADING,zl).restoreSelection().run()}),removeFormat:B(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeAllMarks().applyDefaultPreset().restoreSelection().run()})}},onCreate(){this.options.styleRenderer.inject(Pi.head,z(this.options.presets))}}),dO=Mt.create({name:Te.FONT_WEIGHT,group:Wt.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:B(({commands:n},e)=>{n.applyMark(this.name,{value:e}),z(n.getFont()).isItalicSupported(e)||n.removeItalic()}),toggleBold:B(({commands:n})=>{const e=z(n.getFontWeight()),t=z(n.getFont()),i=Number(e)>=600?"400":"700",o=t.findClosestWeight(i);n.applyFontWeight(o)}),getFontWeight:B(({commands:n})=>{const e=n.getCommonSettingMark(this.name,n.getDefaultFontWeight()),t=n.getFont();return de(()=>{const r=z(e),i=z(t);return i.isWeightSupported(r)?r:i.findClosestWeight(r)})}),getDefaultFontWeight:B(({commands:n})=>{const e=n.getPreset();return de(()=>z(e).common.font_weight)})}},addKeyboardShortcuts:()=>({"Mod-b":Kt("toggleBold"),"Mod-B":Kt("toggleBold")}),parseHTML(){const n=e=>e==="bold"?{value:"700"}:Number(e)?{value:e}:!1;return[{style:"--zw-font-weight",getAttrs:n},{style:"font-weight",getAttrs:n},{tag:"b",attrs:{value:"700"}},{tag:"strong",attrs:{value:"700"}}]},renderHTML({HTMLAttributes:n}){return Jr({font_weight:n.value})}}),pO=Mt.create({name:Te.FONT_SIZE,group:Wt.SETTINGS,addOptions:()=>({minSize:1,maxSize:100}),addAttributes(){return{mobile:{default:null},tablet:{default:null},desktop:{default:null}}},addCommands(){return{getFontSize:B(({commands:n})=>n.getDeviceSettingMark(this.name,n.getDefaultFontSize())),getDefaultFontSize:B(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return de(()=>z(t)[z(e)].font_size.replace("px",""))}),applyFontSize:B(({commands:n},e)=>{const t=n.getTargetDevices(),r=Object.fromEntries(t.map(i=>[i,e]));n.applyMark(this.name,r,{isAppliedToParent:(i,o)=>i.type.name!==o.type.name?!1:t.every(a=>i.attrs[a]===o.attrs[a]),onAppliedToParent:({tr:i,node:o,position:a,mark:c})=>{const f={...c.attrs};if(t.forEach(p=>{f[p]=null}),!Object.values(f).some(p=>!!p))return!1;const m=c.type.create(f);if(o.isText){i.addMark(a,a+o.nodeSize,m);return}i.addNodeMark(a,m)}})}),increaseFontSize:B(({commands:n})=>{const e=Number(z(n.getFontSize())),t=Math.min(e+1,z(this.options.maxSize));n.applyFontSize(String(t))}),decreaseFontSize:B(({commands:n})=>{const e=Number(z(n.getFontSize())),t=Math.max(e-1,z(this.options.minSize));n.applyFontSize(String(t))})}},addKeyboardShortcuts:()=>({"Mod-Shift-=":Kt("increaseFontSize"),"Mod-Shift--":Kt("decreaseFontSize")}),parseHTML(){const n=e=>{if(!e)return null;const t=z(this.options.wrapperRef),r=py(e,t);return String(r)};return[{tag:'[style*="--zw-font-size"]',getAttrs:({style:e})=>({mobile:n(e.getPropertyValue("--zw-font-size-mobile")),tablet:n(e.getPropertyValue("--zw-font-size-tablet")),desktop:n(e.getPropertyValue("--zw-font-size-desktop"))})},{style:"font-size",getAttrs:e=>{const t=n(e);return{desktop:t,tablet:t,mobile:null}}}]},renderHTML({HTMLAttributes:n}){const e=t=>t?`${t}px`:null;return Jr({font_size_mobile:e(n.mobile),font_size_tablet:e(n.tablet),font_size_desktop:e(n.desktop)})}}),mO=Mt.create({name:Te.FONT_COLOR,group:Wt.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getFontColor:B(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontColor())),getDefaultFontColor:B(({commands:n})=>{const e=n.getPreset();return de(()=>z(e).common.color)}),applyFontColor:B(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:dy(e)});return[{style:"--zw-font-color",getAttrs:n},{style:"color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Jr({font_color:n.value})}}),gO=Mt.create({name:Te.BACKGROUND_COLOR,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getBackgroundColor:B(({commands:n})=>n.getCommonSettingMark(this.name,"rgba(255, 255, 255, 0%)")),applyBackgroundColor:B(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:dy(e)});return[{style:"--zw-background-color",getAttrs:n},{style:"background-color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Jr({background_color:n.value})}}),yO=Ie.create({name:"device_manager",addCommands(){return{getDevice:B(()=>{const n=yi(this.options,"device");return de(()=>{const e=z(n);return e===Dn.ALL?Dn.DESKTOP:e})}),getTargetDevices:B(()=>{const n=z(this.options.device);return n===Dn.ALL?[Dn.DESKTOP,Dn.TABLET,Dn.MOBILE]:[n]})}}}),bO=Mt.create({name:Te.FONT_STYLE,group:Wt.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:B(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultFontStyle();return de(()=>z(e)?.italic??z(t).italic)}),isItalicAvailable:B(({commands:n})=>{const e=n.getFont(),t=n.getFontWeight();return de(()=>{const r=z(e),i=z(t);return r.isItalicSupported(i)&&!r.isWeightItalicOnly(i)})}),getDefaultFontStyle:B(({commands:n})=>{const e=n.getPreset();return de(()=>({italic:z(e).common.font_style==="italic"}))}),toggleItalic:B(({commands:n})=>{z(n.isItalicAvailable())&&(z(n.isItalic())?n.removeItalic():n.applyItalic())}),applyItalic:B(({commands:n})=>{n.applyMark(this.name,{italic:!0})}),removeItalic:B(({commands:n})=>{n.applyMark(this.name,{italic:!1})})}},addKeyboardShortcuts:()=>({"Mod-i":Kt("toggleItalic"),"Mod-I":Kt("toggleItalic")}),parseHTML(){const n=e=>({italic:e.includes("italic")});return[{tag:"i",attrs:{italic:!0}},{style:"--zw-font-style",getAttrs:n},{style:"font-style",getAttrs:n}]},renderHTML({HTMLAttributes:n}){const e=n.italic?"italic":"normal";return Jr({font_style:e})}}),vO=Mt.create({name:Te.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:B(({commands:n})=>{const e=n.getTextDecoration();return de(()=>z(e).underline)}),isStrikeThrough:B(({commands:n})=>{const e=n.getTextDecoration();return de(()=>z(e).strike_through)}),getTextDecoration:B(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultTextDecoration();return de(()=>{const r=z(e)??{},i=z(t);return{underline:r.underline||i.underline,strike_through:r.strike_through||i.strike_through}})}),isUnderlineCustomized:B(({commands:n})=>{const e=n.isUnderline(),t=n.getDefaultTextDecoration();return de(()=>z(e)!==z(t).underline)}),getDefaultTextDecoration:B(({commands:n})=>{const e=n.getPreset();return de(()=>{const{text_decoration:t}=z(e).common;return{underline:t.includes("underline"),strike_through:t.includes("line-through")}})}),toggleUnderline:B(({commands:n})=>{n.toggleTextDecoration("underline")}),toggleStrikeThrough:B(({commands:n})=>{n.toggleTextDecoration("strike_through")}),toggleTextDecoration:B(({commands:n},e,t=null)=>{const r=z(n.getTextDecoration()),i=t??!r[e];n.applyMark(this.name,{[e]:i})}),applyTextDecoration:B(({commands:n},e)=>{n.toggleTextDecoration(e,!0)}),removeTextDecoration:B(({commands:n},e)=>{n.toggleTextDecoration(e,!1)})}},addKeyboardShortcuts:()=>({"Mod-u":Kt("toggleUnderline"),"Mod-U":Kt("toggleUnderline")}),parseHTML(){const n=e=>{const t=e.includes("underline"),r=e.includes("line-through");return!t&&!r?!1:{underline:t,strike_through:r}};return[{style:"--zw-text-decoration",getAttrs:n},{style:"text-decoration-line",getAttrs:n},{style:"text-decoration",getAttrs:n},{tag:"s",attrs:{underline:!1,strike_through:!0}},{tag:"u",attrs:{underline:!0,strike_through:!1}}]},renderHTML({HTMLAttributes:n}){const e=[];return n.underline&&e.push("underline"),n.strike_through&&e.push("line-through"),e.length||e.push("none"),Jr({text_decoration:e.join(" ")})}}),wO=Ie.create({name:"case_style",addCommands(){return{applyCaseStyle:B(({commands:n},e)=>{switch(e){case Bl.CAPITALIZE:return n.applyCapitalize();case Bl.LOWERCASE:return n.applyLowerCase();case Bl.UPPERCASE:return n.applyUpperCase()}}),applyCapitalize:B(({commands:n})=>{n.transformText(({text:e})=>vA(e))}),applyLowerCase:B(({commands:n})=>{n.transformText(({text:e})=>e.toLowerCase())}),applyUpperCase:B(({commands:n})=>{n.transformText(({text:e})=>e.toUpperCase())})}}}),vy={mobile:null,tablet:null,desktop:null},SO=Ie.create({name:Te.ALIGNMENT,addGlobalAttributes:()=>[{types:[te.PARAGRAPH,te.HEADING],attributes:{[Te.ALIGNMENT]:{isRequired:!1,parseHTML({style:n}){const e=GI(n.textAlign);if(e)return{desktop:e,tablet:e,mobile:e};const t=n.getPropertyValue("--zw-alignment-mobile")||null,r=n.getPropertyValue("--zw-alignment-tablet")||null,i=n.getPropertyValue("--zw-alignment-desktop")||null;return!t&&!r&&!i?null:{desktop:i,tablet:r,mobile:t}},renderHTML(n){return n.alignment?ya({alignment_mobile:n.alignment.mobile,alignment_tablet:n.alignment.tablet,alignment_desktop:n.alignment.desktop}):null}}}}],addCommands(){return{applyAlignment:B(({commands:n},e)=>{const t=n.getTargetDevices(),r=Object.fromEntries(t.map(i=>[i,e]));n.setBlockAttributes(this.name,r,vy)}),removeAlignment:B(({commands:n})=>n.removeBlockAttributes(this.name)),getAlignment:B(({commands:n})=>{const e=n.getBlockAttributes(this.name,vy),t=n.getDevice(),r=n.getDefaultAlignment();return de(()=>z(e)?.[z(t)]??z(r))}),getDefaultAlignment:B(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return de(()=>z(t)[z(e)].alignment??br.LEFT)})}},addKeyboardShortcuts:()=>({"Mod-Shift-l":Kt("applyAlignment",br.LEFT),"Mod-Shift-e":Kt("applyAlignment",br.CENTER),"Mod-Shift-r":Kt("applyAlignment",br.RIGHT),"Mod-Shift-j":Kt("applyAlignment",br.JUSTIFY)})}),wy={mobile:null,tablet:null,desktop:null},xO=Ie.create({name:Te.LINE_HEIGHT,addGlobalAttributes(){return[{types:[te.PARAGRAPH,te.HEADING],attributes:{[Te.LINE_HEIGHT]:{isRequired:!1,parseHTML:n=>{if(n.matches('[style*="--zw-line-height"]')){const o=n.style.getPropertyValue("--zw-line-height-tablet")||null,a=n.style.getPropertyValue("--zw-line-height-desktop")||null;return{mobile:null,tablet:o,desktop:a}}const e=n.style.lineHeight;if(!e)return null;const t=z(this.options.wrapperRef),r=VI(e,n,t);return r?{desktop:r,tablet:r,mobile:null}:null},renderHTML(n){return n.line_height?ya({line_height_mobile:n.line_height.mobile,line_height_tablet:n.line_height.tablet,line_height_desktop:n.line_height.desktop}):null}}}}]},addCommands(){return{getLineHeight:B(({commands:n})=>{const e=n.getBlockAttributes(this.name,wy),t=n.getDevice(),r=n.getDefaultLineHeight();return de(()=>z(e)?.[z(t)]??z(r))}),getDefaultLineHeight:B(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return de(()=>z(t)[z(e)].line_height)}),applyLineHeight:B(({commands:n},e)=>{const t=n.getTargetDevices(),r=Object.fromEntries(t.map(i=>[i,e]));n.setBlockAttributes(this.name,r,wy)})}}}),EO=Gn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Ai(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),kO=EO.extend({name:te.LIST_ITEM,marks:Wt.SETTINGS,addCommands(){const n=({selection:e})=>e.$cursor.before(e.$cursor.depth-1);return{listItemNewline:B(({commands:e,tr:t})=>{const r=t.doc.nodeAt(n(t));if(!t.selection.$cursor.node().textContent)return!1;e.splitListItem(this.name);const o=n(t);for(const a of r.marks)t.addNodeMark(o,ch(a));return!0})}},addOptions:()=>({HTMLAttributes:{class:"zw-style"}}),addKeyboardShortcuts:()=>({Enter:n=>{const{state:e,commands:t}=n.editor;if(e.selection.$cursor?.path.some(i=>i.type?.name===te.LIST))return t.listItemNewline()}})});function _O(n,e){if(Y0.includes(e.type)||e.type.isInSet(n.marks))return!1;for(const t of n.content.content)if(t.childCount&&(!t.marks||!e.isInSet(t.marks)))return!1;return!0}function TO(n){const e=n.selection.$from.start(),t=n.selection.$to.end();n.doc.nodesBetween(e,t,(r,i)=>{if(r.type.name===te.LIST)return;if(r.type.name!==te.LIST_ITEM)return!1;const o=[];return r.forEach(a=>{for(const c of a.marks){if(c.isInSet(o)){n.removeNodeMark(i+1,c);continue}_O(r,c)&&(n.removeNodeMark(i+1,c),n.addNodeMark(i,ch(c)),o.push(c))}}),!1})}const CO=Gn.create({name:te.LIST,content:`${te.LIST_ITEM}+`,group:"block list",marks:Wt.SETTINGS,addExtensions:()=>[kO],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:tn.DISC}}}),parseHTML(){const n={a:tn.ROMAN,i:tn.LATIN,1:tn.DECIMAL},e=t=>{for(const r of YM){const i=`.${z(this.options.baseClass)}${r}`;if(t.matches(i)||n[t.type.toLowerCase()]===r)return r}};return[{tag:"ol",getAttrs:t=>({bullet:{type:e(t)||tn.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||tn.DISC}})}]},renderHTML({HTMLAttributes:n}){const e=[z(this.options.baseClass)+n.bullet.type,z(this.options.presetClass)];return[XM.includes(n.bullet.type)?"ol":"ul",{class:e.join(" ")},0]},addCommands(){return{getListType:B(({commands:n})=>{const e=n.getBlockAttributes("bullet",{type:null});return de(()=>z(e).type??null)}),applyList:B(({commands:n,chain:e},t)=>z(n.getListType())===t?n.removeList():e().applyDefaultPreset().toggleList(te.LIST,te.LIST_ITEM).setBlockAttributes("bullet",{type:t}).command(({tr:i})=>TO(i)).run()),removeList:B(({chain:n})=>n().expandSelection(({parent:e})=>e.type.name===te.LIST).command(({tr:e})=>{const t=e.selection.$from.start(),r=e.selection.$to.end();return e.doc.nodesBetween(t,r,(i,o,a)=>{if([te.LIST,te.LIST_ITEM].includes(i.type.name))return;if(a.type.name!==te.LIST_ITEM)return!1;const c=a.marks.filter(f=>!f.type.isInSet(i.marks));for(const f of c)e.addNodeMark(o,ch(f));return!1}),!0}).liftListItem(te.LIST_ITEM).run())}},addInputRules(){const n=(e,t)=>PM({find:t,type:this.type,getAttributes:{bullet:{type:e}},joinPredicate:(r,{attrs:i})=>i.bullet.type===e});return[n(tn.DISC,/^\s*([-+*])\s$/),n(tn.DECIMAL,/^(\d+)\.\s$/),n(tn.LATIN,/^([ivx]{1,3})\.\s$/i),n(tn.ROMAN,/^([a-z])\.\s$/i)]}});function MO(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function AO(n){return new lt({key:new Tt("autolink"),appendTransaction:(e,t,r)=>{const i=e.some(h=>h.docChanged)&&!t.doc.eq(r.doc),o=e.some(h=>h.getMeta("preventAutolink"));if(!i||o)return;const{tr:a}=r,c=rM(t.doc,[...e]);if(hM(c).forEach(({newRange:h})=>{const m=sM(r.doc,h,b=>b.isTextblock);let p,g;if(m.length>1?(p=m[0],g=r.doc.textBetween(p.pos,p.pos+p.node.nodeSize,void 0," ")):m.length&&r.doc.textBetween(h.from,h.to," "," ").endsWith(" ")&&(p=m[0],g=r.doc.textBetween(p.pos,h.to,void 0," ")),p&&g){const b=g.split(" ").filter(M=>M!=="");if(b.length<=0)return!1;const S=b[b.length-1],E=p.pos+g.lastIndexOf(S);if(!S)return!1;const C=ga(S).map(M=>M.toObject(n.defaultProtocol));if(!MO(C))return!1;C.filter(M=>M.isLink).map(M=>({...M,from:E+M.start+1,to:E+M.end+1})).filter(M=>r.schema.marks.code?!r.doc.rangeHasMark(M.from,M.to,r.schema.marks.code):!0).filter(M=>n.validate(M.value)).filter(M=>n.shouldAutoLink(M.value)).forEach(M=>{F0(M.from,M.to,r.doc).some(P=>P.mark.type===n.type)||a.addMark(M.from,M.to,n.type.create({href:M.href}))})}}),!!a.steps.length)return a}})}function IO(n){return new lt({key:new Tt("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,o;if(r.button!==0||!e.editable)return!1;let a=r.target;const c=[];for(;a.nodeName!=="DIV";)c.push(a),a=a.parentNode;if(!c.find(g=>g.nodeName==="A"))return!1;const f=cM(e.state,n.type.name),h=r.target,m=(i=h?.href)!==null&&i!==void 0?i:f.href,p=(o=h?.target)!==null&&o!==void 0?o:f.target;return h&&m?(window.open(m,p),!0):!1}}})}function OO(n){return new lt({key:new Tt("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{state:i}=e,{selection:o}=i,{empty:a}=o;if(a)return!1;let c="";r.content.forEach(h=>{c+=h.textContent});const f=d1(c,{defaultProtocol:n.defaultProtocol}).find(h=>h.isLink&&h.value===c);return!c||!f?!1:n.editor.commands.setMark(n.type,{href:f.href})}}})}const NO=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function jr(n,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&t.push(i)}),!n||n.replace(NO,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const RO=Mt.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(n=>{if(typeof n=="string"){h1(n);return}h1(n.scheme,n.optionalSlashes)})},onDestroy(){mA()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,e)=>!!jr(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>!!n}},addAttributes(){return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{const e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!jr(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!jr(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Ai(this.options.HTMLAttributes,n),0]:["a",Ai(this.options.HTMLAttributes,{...n,href:""}),0]},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!jr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!jr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[DM({find:n=>{const e=[];if(n){const{protocols:t,defaultProtocol:r}=this.options,i=d1(n).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:a=>!!jr(a,t),protocols:t,defaultProtocol:r}));i.length&&i.forEach(o=>e.push({text:o.value,data:{href:o.href},index:o.start}))}return e},type:this.type,getAttributes:n=>{var e;return{href:(e=n.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push(AO({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!jr(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&n.push(IO({type:this.type})),this.options.linkOnPaste&&n.push(OO({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),n}}),LO=RO.extend({name:Te.LINK,addOptions(){return{...this.parent?.(),openOnClick:!1,linkOnPaste:!1}},addAttributes(){return{href:{default:null,parseHTML:n=>{const e=n.getAttribute("href");return e.startsWith("#")?parseFloat(n.getAttribute("href").replace("#","")):e}},target:{default:kf.SELF,parseHTML:n=>n.getAttribute("target")||kf.SELF},destination:{default:Ii.URL,parseHTML:n=>{const e=n.getAttribute("href");if(!e.startsWith("#"))return Ii.URL;const t=e.replace("#","");return z(this.options.pageBlocks).find(o=>o.id===parseInt(t))?Ii.BLOCK:Ii.URL}}}},addCommands(){const{unsetLink:n}=this.parent();return{removeLink:n,applyLink:B(({commands:e,chain:t},r)=>(e.setMeta("preventAutolink",!0),e.getSelectedText()?t().applyMark(this.name,r).expandSelectionToLink().command(({tr:i})=>(r.text&&i.insertText(r.text,i.selection.from,i.selection.to),!0)).run():e.insertContent(xy.text(r.text,[xy.mark(Te.LINK,r)])))),expandSelectionToLink:B(({commands:e})=>{e.expandSelection(({node:t})=>this.type.isInSet(t.marks))}),isLink:B(({commands:e})=>e.hasMark(this.name)),getLinkPreset:B(()=>de(()=>z(this.options.preset)))}},addProseMirrorPlugins(){return[...this.parent(),bA.create(this.editor)]},renderHTML({HTMLAttributes:n}){const e=n.destination===Ii.BLOCK?`#${n.href}`:n.href,t=z(this.options.basePresetClass)+z(this.options.preset).id;return["a",{href:e,target:n.target,class:`${t} zw-style`},0]}}),PO=Mt.create({name:Te.SUPERSCRIPT,addCommands(){return{applySuperscript:B(({commands:n})=>{n.setMark(this.name)}),removeSuperscript:B(({commands:n})=>{n.unsetMark(this.name)}),toggleSuperscript:B(({commands:n})=>{z(n.isSuperscript())?n.removeSuperscript():n.applySuperscript()}),isSuperscript:B(({commands:n})=>{const e=n.getMark(this.name);return de(()=>!!z(e))})}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs:n=>n!=="super"?!1:null}]},renderHTML(){return["sup",{class:"zw-superscript"},0]}}),DO=Ie.create({name:Te.MARGIN,addGlobalAttributes:()=>[{types:[te.PARAGRAPH,te.HEADING],attributes:{[Te.MARGIN]:{isRequired:!1,parseHTML(n){const{margin:e,marginTop:t,marginRight:r,marginBottom:i,marginLeft:o}=n.style;return[e,t,r,i,o].some(f=>!!f)?e?{value:e}:{value:[t||0,r||0,i||0,o||0].join(" ")}:null},renderHTML(n){return n.margin?ya({margin:n.margin.value}):null}}}}]});function BO(n){const e=r=>n.presetsRef.value.find(i=>i.id===r),t=bu({default:null,link:null});return xk(n.presetsRef,()=>{t.default=e(n.defaultPresetId),t.link=e(n.linkPresetId)},{immediate:!0,deep:!0}),uO().concat([hO.configure({presets:n.presetsRef,defaultId:n.defaultPresetId,styleRenderer:new WO({baseClass:n.basePresetClass,makeVariable:n.makePresetVariable,linkPresetId:n.linkPresetId})}),CO.configure({baseClass:n.baseListClass,presetClass:n.basePresetClass+n.defaultPresetId}),yO.configure({device:n.deviceRef}),pO.configure({minSize:n.minFontSize,maxSize:n.maxFontSize,wrapperRef:n.wrapperRef}),fO.configure({fonts:n.fonts,defaultPreset:yi(t,"default"),defaultFont:n.defaultFont}),dO,mO,gO,bO,vO,wO,PO,SO,xO.configure({wrapperRef:n.wrapperRef}),LO.configure({preset:yi(t,"link"),basePresetClass:n.basePresetClass,pageBlocks:n.pageBlocksRef}),DO])}class zO{_domParser=new DOMParser;types=window;parse(e){return this._domParser.parseFromString(e,"text/html")}}class Sy{content;constructor({content:e}){this.content=e}normalize(){throw new Error("Implement abstract method")}}class gn extends Sy{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=gn.BLOCK_NODE_NAMES.concat("UL","OL");static BLOCK_STYLES=["text-align","line-height","margin","margin-top","margin-bottom","margin-left","margin-right"];_parser;constructor({content:e,parser:t}){super({content:e}),this._parser=t,this.dom=null}normalize(){return this.normalizeHTML(),this.normalizedHTML}normalizeHTML(){this.dom=this._parser.parse(this.content.replace(/(\r)?\n/g,"")),this._removeComments(),this._normalizeRootTags(),this._iterateNodes(this._normalizeBreakLines,e=>e.tagName==="BR"),this._iterateNodes(this._removeEmptyNodes,this._isBlockNode),this._iterateNodes(this._normalizeListItems,e=>e.tagName==="LI"),this._normalizeBlockTextDecoration(),this._normalizeBlockBackgroundColor()}get normalizedHTML(){return this.dom.body.innerHTML}get _NodeFilter(){return this._parser.types.NodeFilter}get _Node(){return this._parser.types.Node}_removeComments(){const e=this._createNodeIterator(this._NodeFilter.SHOW_COMMENT);this._runIterator(e,t=>t.remove())}_normalizeRootTags(){const e=Array.from(this.dom.body.childNodes),t=this.dom.createDocumentFragment();let r;for(const i of e){if(this._isRootNode(i)){t.append(i),r=null;continue}r||(r=this.dom.createElement("p"),t.append(r)),r.append(i)}this.dom.body.innerHTML="",this.dom.body.append(t)}_createNodeIterator(e,t){return this.dom.createNodeIterator(this.dom.body,e,t)}_iterateNodes(e,t=()=>!0){const r=o=>o.tagName!=="BODY"&&t.call(this,o),i=this._createNodeIterator(this._NodeFilter.SHOW_ELEMENT,{acceptNode:o=>r(o)?this._NodeFilter.FILTER_ACCEPT:this._NodeFilter.FILTER_REJECT});this._runIterator(i,e)}_runIterator(e,t){let r=e.nextNode();for(;r;)t.call(this,r),r=e.nextNode()}_removeEmptyNodes(e){e.innerHTML.trim()||e.remove()}_normalizeListItems(e){const t=this.dom.createDocumentFragment(),r=Array.from(e.childNodes);let i,o;const a=c=>{this._assignElementProperties(c,e,gn.BLOCK_STYLES),t.append(c)};this._assignElementProperties(e,e.parentElement,gn.BLOCK_STYLES);for(const c of r){if(this._isBlockNode(c)){a(c),i=null,o=c;continue}if(c.tagName==="BR"&&o&&o?.tagName!=="BR"){c.remove(),o=c;continue}if(c.tagName==="BR"){const f=this.dom.createElement("p");f.append(c),a(f),i=null,o=c;continue}i||(i=this.dom.createElement("p"),a(i)),i.append(c),o=c}e.append(t),this._removeStyleProperties(e,gn.BLOCK_STYLES),this._removeStyleProperties(e.parentElement,gn.BLOCK_STYLES),this._assignElementProperties(e,e.parentElement),e.parentElement.lastElementChild===e&&this._removeStyleProperties(e.parentElement)}_isBlockNode(e){return gn.BLOCK_NODE_NAMES.includes(e.tagName)}_isRootNode(e){return gn.ROOT_NODE_NAMES.includes(e.tagName)}_assignElementProperties(e,t,r=Array.from(t.style)){for(const i of r){const o=t.style.getPropertyValue(i);o&&!e.style.getPropertyValue(i)&&e.style.setProperty(i,o)}}_removeStyleProperties(e,t=Array.from(e.style)){for(const r of t)e.style.removeProperty(r);e.style.length===0&&e.removeAttribute("style")}_normalizeBreakLines({parentElement:e}){if(!this._isBlockNode(e)||!e.textContent)return;const t=this.dom.createDocumentFragment(),r=Array.from(e.childNodes),i=e.cloneNode(!0);i.innerHTML="";let o=i.cloneNode();const a=c=>{this._assignElementProperties(c,e,gn.BLOCK_STYLES),t.append(c)};for(const c of r){if(c.tagName==="BR"){a(o),o=i.cloneNode();continue}o.append(c)}t.append(o),e.replaceWith(t)}_normalizeBlockTextDecoration(){const e=this.dom.querySelectorAll('[style*="text-decoration"]:where(p, h1, h2, h3, h4, li)');for(const t of e)this._moveTextDecorationToChildren(t)}_moveTextDecorationToChildren(e){const t=this._parseTextDecoration(e);if(e.style.removeProperty("text-decoration-line"),e.style.removeProperty("text-decoration"),e.style.cssText||e.removeAttribute("style"),!t.none)for(const r of e.childNodes){const i=this._wrapTextNode(e,r),o=this._parseTextDecoration(i),a={underline:o.underline||t.underline,line_through:o.line_through||t.line_through};i.style.removeProperty("text-decoration-line"),i.style.removeProperty("text-decoration"),i.style.textDecoration=Object.entries(a).filter(([,c])=>c).map(([c])=>c.replace("_","-")).join(" ")}}_parseTextDecoration(e){const{textDecoration:t,textDecorationLine:r}=e.style,i=t||r||"";return{none:i.includes("none"),underline:i.includes("underline"),line_through:i.includes("line-through")}}_normalizeBlockBackgroundColor(){const e=this.dom.querySelectorAll('[style*="background-color"]:where(p, h1, h2, h3, h4, li)');for(const t of e)this._moveBackgroundColorToChildren(t)}_moveBackgroundColorToChildren(e){const t=e.style.backgroundColor;e.style.removeProperty("background-color"),e.style.cssText||e.removeAttribute("style");for(const r of e.childNodes){const i=this._wrapTextNode(e,r),o=i.style.backgroundColor||t;i.style.backgroundColor=o}}_wrapTextNode(e,t){if(t.nodeType!==this._Node.TEXT_NODE)return t;const r=this.dom.createElement("span");return r.append(t.cloneNode()),e.replaceChild(r,t),r}}class FO extends Sy{normalize(){return this._iterateNodes(this._bubbleMarks),this.content}_iterateNodes(e){this._iterateChildNodes(this.content,e)}_iterateChildNodes(e,t){for(const r of e.content)r.content&&this._iterateChildNodes(r,t),t.call(this,r)}_bubbleMarks(e){if(e.content&&e.type!==te.LIST){for(const t of e.content)if(!this._isLink(t)&&t.marks)for(const r of t.marks.slice()){if(this._includesMark(e,r)){this._removeMark(t,r);continue}this._canBubbleMark(e,r)&&(this._removeMark(t,r),this._addMark(e,r))}}}_canBubbleMark(e,t){if(Y0.includes(t.type)||this._includesMarkType(e,t.type))return!1;for(const r of e.content)if(!(!r.content&&e.type===te.LIST_ITEM)&&(!r.marks||!this._includesMark(r,t)))return!1;return!0}_includesMark(e,t){return e.marks?.some(r=>by.isEqual(r,t))??!1}_includesMarkType(e,t){return e.marks?.some(r=>r.type===t)??!1}_isLink(e){return e.type===te.TEXT&&this._includesMarkType(e,Te.LINK)}_removeMark(e,t){if(!e.marks)return;const r=this._findMarkIndexByType(e,t.type);r>=0&&e.marks.splice(r,1),e.marks.length||delete e.marks}_addMark(e,t){this._removeMark(e,t),e.marks??=[],e.marks.push(t)}_findMarkIndexByType(e,t){return e.marks?.findIndex(r=>r.type===t)??null}}class Na{static build(e,t={}){return typeof e=="string"?this._buildHtml(e,t):this._buildJson(e)}static _buildHtml(e,t){return new gn({content:e,parser:t.parser||new zO})}static _buildJson(e){return new FO({content:e})}static normalize(e,t={}){return Na.build(e,t).normalize()}}class Pi{static window=globalThis.window;static use(e){this.window=e}static get document(){return this.window.document}static get body(){return this.document.body}static get head(){return this.document.head}static getComputedStyle(e){return this.window.getComputedStyle(e)}}class gh{static build({config:e,nodeDomParser:t}){const r=BO({fonts:e.fonts,minFontSize:0,maxFontSize:0,presetsRef:jo(e.presets),defaultPresetId:e.defaultPresetId,linkPresetId:e.linkPresetId,makePresetVariable:()=>"",basePresetClass:e.basePresetClass,baseListClass:e.baseListClass,deviceRef:jo(Dn.DESKTOP),pageBlocksRef:jo([]),wrapperRef:Pi.document.createElement("p")}),i=lM(r);return new gh({schema:i,domParser:vs.fromSchema(i),nodeDomParser:t})}_schema;_domParser;_nodeDomParser;constructor({schema:e,domParser:t,nodeDomParser:r}){this._schema=e,this._domParser=t,this._nodeDomParser=r}toJSON(e){const t=Na.build(e,{parser:this._nodeDomParser});return t.normalizeHTML(),this._domParser.parse(t.dom.body).toJSON()}}function HO(n,e){return n.type===e}function $O(n){return typeof n=="string"}class xy{static doc(e){return{type:te.DOCUMENT,content:e}}static list(e,t){return{type:te.LIST,attrs:{bullet:{type:e}},content:t.map(r=>HO(r,te.LIST_ITEM)?r:this.listItem([r].flat()))}}static listItem(...e){const{attrs:t,content:r,marks:i}=this.normalizeTextBlockArgs(e);return{type:te.LIST_ITEM,...t?{attrs:t}:{},...i?{marks:i}:{},content:[r].flat().map(o=>$O(o)?this.paragraph(o):o)}}static heading(e,...t){const r=this.textBlock(t);return r.attrs??={},r.attrs.level=e,{type:te.HEADING,...r}}static paragraph(...e){return{type:te.PARAGRAPH,...this.textBlock(e)}}static textBlock(e){const{attrs:t,content:r,marks:i}=this.normalizeTextBlockArgs(e);return{content:typeof r=="string"?[this.text(r)]:[r].flat(),...t?{attrs:t}:{},...i?{marks:i}:{}}}static normalizeTextBlockArgs(e){return e.length===1?{attrs:null,marks:null,content:e[0]}:e.length===2?{attrs:e[0],marks:null,content:e[1]}:{attrs:e[0],marks:e[1],content:e[2]}}static text(e,t){return{type:te.TEXT,...t?{marks:t}:{},text:e}}static link(e,t,r=[]){return this.text(e,[this.mark(Te.LINK,t),...r])}static mark(e,t){return{type:e,attrs:t}}static populateAllDevices(e){return{mobile:e,tablet:e,desktop:e}}}class WO{_baseClass;_makeVariable;_linkPresetId;constructor({baseClass:e,makeVariable:t,linkPresetId:r}){this._baseClass=e,this._makeVariable=t,this._linkPresetId=r}inject(e,t){let r=e.querySelector("[data-zw-styles]");r||(r=Pi.document.createElement("style"),r.dataset.zwStyles="",r.innerHTML=this.render(t),e.append(r))}render(e){let t="";for(const r of e){const i=r.id===this._linkPresetId,o=this.makePresetCssClass(r);t+=` ${o} {`;for(const a of qM)for(const c of Object.keys(r[a])){const f=this._makeVariable({device:a,preset:r,property:c}),h=this._makeInternalVariableName(c,a);if(t+=`${h}: var(${f}, inherit);`,i&&!j0.includes(c)){const m=h.replace("preset-","");t+=`${m}: var(${h});`}}t+="}"}return t}_makeInternalVariableName(e,t){const r=e==="color"?"font-color":e.replace(/_/i,"-"),i=t===Dn.COMMON?"":`-${t}`;return`--zw-preset-${r}${i}`}makePresetHtmlClass(e){return this._baseClass+e.id}makePresetCssClass(e){return this.makePresetHtmlClass(e).split(" ").map(t=>`.${t}`).join("")}}class yh{static _instance;static get instance(){return this._instance??=new yh,this._instance}static query(e,t){return this.instance.query(e,t)}query(e,t){let r=null;return e.descendants(i=>{if(r)return!1;if(this.matchNode(i,t))return r=i,!1}),r?t.getMark?this.getMark(r,t.getMark):r:null}matchNode(e,t){return!(t.typeName&&t.typeName!==e.type.name||t.mark&&!this.getMark(e,t.mark))}getMark(e,t){return e.marks.find(r=>this.matchMark(r,t))||null}matchMark(e,t){return e.type.name===t.typeName}}class UO{static createWindow(){return new jp.JSDOM().window}types;parse(e){const{window:t}=new jp.JSDOM(e);return this.types=t,t.document}}exports.ContentSerializer=gh,exports.ContextWindow=Pi,exports.NodeDomParser=UO;
39
+ }`;var ee=Gp(function(){return me(w,G+"return "+R).apply(t,x)});if(ee.source=R,Gc(ee))throw ee;return ee}function bx(s){return ge(s).toLowerCase()}function vx(s){return ge(s).toUpperCase()}function wx(s,l,u){if(s=ge(s),s&&(u||l===t))return td(s);if(!s||!(l=Et(l)))return s;var d=jt(s),y=jt(l),w=nd(d,y),x=rd(d,y)+1;return rr(d,w,x).join("")}function Sx(s,l,u){if(s=ge(s),s&&(u||l===t))return s.slice(0,sd(s)+1);if(!s||!(l=Et(l)))return s;var d=jt(s),y=rd(d,jt(l))+1;return rr(d,0,y).join("")}function xx(s,l,u){if(s=ge(s),s&&(u||l===t))return s.replace(Ga,"");if(!s||!(l=Et(l)))return s;var d=jt(s),y=nd(d,jt(l));return rr(d,y).join("")}function Ex(s,l){var u=Jn,d=sn;if(Ce(l)){var y="separator"in l?l.separator:y;u="length"in l?Q(l.length):u,d="omission"in l?Et(l.omission):d}s=ge(s);var w=s.length;if(ni(s)){var x=jt(s);w=x.length}if(u>=w)return s;var k=u-ri(d);if(k<1)return d;var T=x?rr(x,0,k).join(""):s.slice(0,k);if(y===t)return T+d;if(x&&(k+=T.length-k),Jc(y)){if(s.slice(k).search(y)){var O,N=T;for(y.global||(y=cc(y.source,ge(Eh.exec(y))+"g")),y.lastIndex=0;O=y.exec(N);)var R=O.index;T=T.slice(0,R===t?k:R)}}else if(s.indexOf(Et(y),k)!=k){var H=T.lastIndexOf(y);H>-1&&(T=T.slice(0,H))}return T+d}function kx(s){return s=ge(s),s&&Py.test(s)?s.replace(wh,Qb):s}var _x=ui(function(s,l,u){return s+(u?" ":"")+l.toUpperCase()}),Yc=Jd("toUpperCase");function Kp(s,l,u){return s=ge(s),l=u?t:l,l===t?qb(s)?n2(s):Fb(s):s.match(l)||[]}var Gp=ie(function(s,l){try{return St(s,t,l)}catch(u){return Gc(u)?u:new X(u)}}),Tx=_n(function(s,l){return Lt(l,function(u){u=un(u),En(s,u,Vc(s[u],s))}),s});function Cx(s){var l=s==null?0:s.length,u=J();return s=l?_e(s,function(d){if(typeof d[1]!="function")throw new Pt(a);return[u(d[0]),d[1]]}):[],ie(function(d){for(var y=-1;++y<l;){var w=s[y];if(St(w[0],this,d))return St(w[1],this,d)}})}function Mx(s){return Q2(zt(s,p))}function Xc(s){return function(){return s}}function Ax(s,l){return s==null||s!==s?l:s}var Ix=jd(),Ox=jd(!0);function ht(s){return s}function Zc(s){return _d(typeof s=="function"?s:zt(s,p))}function Nx(s){return Cd(zt(s,p))}function Rx(s,l){return Md(s,zt(l,p))}var Lx=ie(function(s,l){return function(u){return ts(u,s,l)}}),Px=ie(function(s,l){return function(u){return ts(s,u,l)}});function Qc(s,l,u){var d=He(l),y=So(l,d);u==null&&!(Ce(l)&&(y.length||!d.length))&&(u=l,l=s,s=this,y=So(l,He(l)));var w=!(Ce(u)&&"chain"in u)||!!u.chain,x=Cn(s);return Lt(y,function(k){var T=l[k];s[k]=T,x&&(s.prototype[k]=function(){var O=this.__chain__;if(w||O){var N=s(this.__wrapped__),R=N.__actions__=ct(this.__actions__);return R.push({func:T,args:arguments,thisArg:s}),N.__chain__=O,N}return T.apply(s,Xn([this.value()],arguments))})}),s}function Dx(){return qe._===this&&(qe._=a2),this}function eu(){}function zx(s){return s=Q(s),ie(function(l){return Ad(l,s)})}var Bx=Oc(_e),Fx=Oc(Yh),Hx=Oc(nc);function Jp(s){return Bc(s)?rc(un(s)):gv(s)}function $x(s){return function(l){return s==null?t:Nr(s,l)}}var Wx=Xd(),Ux=Xd(!0);function tu(){return[]}function nu(){return!1}function Vx(){return{}}function Kx(){return""}function Gx(){return!0}function Jx(s,l){if(s=Q(s),s<1||s>jn)return[];var u=wt,d=Qe(s,wt);l=J(l),s-=wt;for(var y=oc(d,l);++u<s;)l(u);return y}function qx(s){return Z(s)?_e(s,un):kt(s)?[s]:ct(dp(ge(s)))}function jx(s){var l=++o2;return ge(s)+l}var Yx=Co(function(s,l){return s+l},0),Xx=Nc("ceil"),Zx=Co(function(s,l){return s/l},1),Qx=Nc("floor");function eE(s){return s&&s.length?wo(s,ht,yc):t}function tE(s,l){return s&&s.length?wo(s,J(l,2),yc):t}function nE(s){return Qh(s,ht)}function rE(s,l){return Qh(s,J(l,2))}function iE(s){return s&&s.length?wo(s,ht,Sc):t}function sE(s,l){return s&&s.length?wo(s,J(l,2),Sc):t}var oE=Co(function(s,l){return s*l},1),lE=Nc("round"),aE=Co(function(s,l){return s-l},0);function cE(s){return s&&s.length?sc(s,ht):0}function uE(s,l){return s&&s.length?sc(s,J(l,2)):0}return v.after=NS,v.ary=kp,v.assign=v5,v.assignIn=Bp,v.assignInWith=Ho,v.assignWith=w5,v.at=S5,v.before=_p,v.bind=Vc,v.bindAll=Tx,v.bindKey=Tp,v.castArray=VS,v.chain=Sp,v.chunk=Qv,v.compact=ew,v.concat=tw,v.cond=Cx,v.conforms=Mx,v.constant=Xc,v.countBy=cS,v.create=x5,v.curry=Cp,v.curryRight=Mp,v.debounce=Ap,v.defaults=E5,v.defaultsDeep=k5,v.defer=RS,v.delay=LS,v.difference=nw,v.differenceBy=rw,v.differenceWith=iw,v.drop=sw,v.dropRight=ow,v.dropRightWhile=lw,v.dropWhile=aw,v.fill=cw,v.filter=fS,v.flatMap=pS,v.flatMapDeep=mS,v.flatMapDepth=gS,v.flatten=yp,v.flattenDeep=uw,v.flattenDepth=fw,v.flip=PS,v.flow=Ix,v.flowRight=Ox,v.fromPairs=hw,v.functions=O5,v.functionsIn=N5,v.groupBy=yS,v.initial=pw,v.intersection=mw,v.intersectionBy=gw,v.intersectionWith=yw,v.invert=L5,v.invertBy=P5,v.invokeMap=vS,v.iteratee=Zc,v.keyBy=wS,v.keys=He,v.keysIn=ft,v.map=Lo,v.mapKeys=z5,v.mapValues=B5,v.matches=Nx,v.matchesProperty=Rx,v.memoize=Do,v.merge=F5,v.mergeWith=Fp,v.method=Lx,v.methodOf=Px,v.mixin=Qc,v.negate=zo,v.nthArg=zx,v.omit=H5,v.omitBy=$5,v.once=DS,v.orderBy=SS,v.over=Bx,v.overArgs=zS,v.overEvery=Fx,v.overSome=Hx,v.partial=Kc,v.partialRight=Ip,v.partition=xS,v.pick=W5,v.pickBy=Hp,v.property=Jp,v.propertyOf=$x,v.pull=Sw,v.pullAll=vp,v.pullAllBy=xw,v.pullAllWith=Ew,v.pullAt=kw,v.range=Wx,v.rangeRight=Ux,v.rearg=BS,v.reject=_S,v.remove=_w,v.rest=FS,v.reverse=Wc,v.sampleSize=CS,v.set=V5,v.setWith=K5,v.shuffle=MS,v.slice=Tw,v.sortBy=OS,v.sortedUniq=Rw,v.sortedUniqBy=Lw,v.split=px,v.spread=HS,v.tail=Pw,v.take=Dw,v.takeRight=zw,v.takeRightWhile=Bw,v.takeWhile=Fw,v.tap=eS,v.throttle=$S,v.thru=Ro,v.toArray=Pp,v.toPairs=$p,v.toPairsIn=Wp,v.toPath=qx,v.toPlainObject=zp,v.transform=G5,v.unary=WS,v.union=Hw,v.unionBy=$w,v.unionWith=Ww,v.uniq=Uw,v.uniqBy=Vw,v.uniqWith=Kw,v.unset=J5,v.unzip=Uc,v.unzipWith=wp,v.update=q5,v.updateWith=j5,v.values=di,v.valuesIn=Y5,v.without=Gw,v.words=Kp,v.wrap=US,v.xor=Jw,v.xorBy=qw,v.xorWith=jw,v.zip=Yw,v.zipObject=Xw,v.zipObjectDeep=Zw,v.zipWith=Qw,v.entries=$p,v.entriesIn=Wp,v.extend=Bp,v.extendWith=Ho,Qc(v,v),v.add=Yx,v.attempt=Gp,v.camelCase=ex,v.capitalize=Up,v.ceil=Xx,v.clamp=X5,v.clone=KS,v.cloneDeep=JS,v.cloneDeepWith=qS,v.cloneWith=GS,v.conformsTo=jS,v.deburr=Vp,v.defaultTo=Ax,v.divide=Zx,v.endsWith=tx,v.eq=Xt,v.escape=nx,v.escapeRegExp=rx,v.every=uS,v.find=hS,v.findIndex=mp,v.findKey=_5,v.findLast=dS,v.findLastIndex=gp,v.findLastKey=T5,v.floor=Qx,v.forEach=xp,v.forEachRight=Ep,v.forIn=C5,v.forInRight=M5,v.forOwn=A5,v.forOwnRight=I5,v.get=qc,v.gt=YS,v.gte=XS,v.has=R5,v.hasIn=jc,v.head=bp,v.identity=ht,v.includes=bS,v.indexOf=dw,v.inRange=Z5,v.invoke=D5,v.isArguments=Pr,v.isArray=Z,v.isArrayBuffer=ZS,v.isArrayLike=ut,v.isArrayLikeObject=Oe,v.isBoolean=QS,v.isBuffer=ir,v.isDate=e5,v.isElement=t5,v.isEmpty=n5,v.isEqual=r5,v.isEqualWith=i5,v.isError=Gc,v.isFinite=s5,v.isFunction=Cn,v.isInteger=Op,v.isLength=Bo,v.isMap=Np,v.isMatch=o5,v.isMatchWith=l5,v.isNaN=a5,v.isNative=c5,v.isNil=f5,v.isNull=u5,v.isNumber=Rp,v.isObject=Ce,v.isObjectLike=Me,v.isPlainObject=as,v.isRegExp=Jc,v.isSafeInteger=h5,v.isSet=Lp,v.isString=Fo,v.isSymbol=kt,v.isTypedArray=hi,v.isUndefined=d5,v.isWeakMap=p5,v.isWeakSet=m5,v.join=bw,v.kebabCase=ix,v.last=Ft,v.lastIndexOf=vw,v.lowerCase=sx,v.lowerFirst=ox,v.lt=g5,v.lte=y5,v.max=eE,v.maxBy=tE,v.mean=nE,v.meanBy=rE,v.min=iE,v.minBy=sE,v.stubArray=tu,v.stubFalse=nu,v.stubObject=Vx,v.stubString=Kx,v.stubTrue=Gx,v.multiply=oE,v.nth=ww,v.noConflict=Dx,v.noop=eu,v.now=Po,v.pad=lx,v.padEnd=ax,v.padStart=cx,v.parseInt=ux,v.random=Q5,v.reduce=ES,v.reduceRight=kS,v.repeat=fx,v.replace=hx,v.result=U5,v.round=lE,v.runInContext=_,v.sample=TS,v.size=AS,v.snakeCase=dx,v.some=IS,v.sortedIndex=Cw,v.sortedIndexBy=Mw,v.sortedIndexOf=Aw,v.sortedLastIndex=Iw,v.sortedLastIndexBy=Ow,v.sortedLastIndexOf=Nw,v.startCase=mx,v.startsWith=gx,v.subtract=aE,v.sum=cE,v.sumBy=uE,v.template=yx,v.times=Jx,v.toFinite=Mn,v.toInteger=Q,v.toLength=Dp,v.toLower=bx,v.toNumber=Ht,v.toSafeInteger=b5,v.toString=ge,v.toUpper=vx,v.trim=wx,v.trimEnd=Sx,v.trimStart=xx,v.truncate=Ex,v.unescape=kx,v.uniqueId=jx,v.upperCase=_x,v.upperFirst=Yc,v.each=xp,v.eachRight=Ep,v.first=bp,Qc(v,function(){var s={};return an(v,function(l,u){ve.call(v.prototype,u)||(s[u]=l)}),s}(),{chain:!1}),v.VERSION=r,Lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){v[s].placeholder=v}),Lt(["drop","take"],function(s,l){oe.prototype[s]=function(u){u=u===t?1:De(Q(u),0);var d=this.__filtered__&&!l?new oe(this):this.clone();return d.__filtered__?d.__takeCount__=Qe(u,d.__takeCount__):d.__views__.push({size:Qe(u,wt),type:s+(d.__dir__<0?"Right":"")}),d},oe.prototype[s+"Right"]=function(u){return this.reverse()[s](u).reverse()}}),Lt(["filter","map","takeWhile"],function(s,l){var u=l+1,d=u==on||u==Fe;oe.prototype[s]=function(y){var w=this.clone();return w.__iteratees__.push({iteratee:J(y,3),type:u}),w.__filtered__=w.__filtered__||d,w}}),Lt(["head","last"],function(s,l){var u="take"+(l?"Right":"");oe.prototype[s]=function(){return this[u](1).value()[0]}}),Lt(["initial","tail"],function(s,l){var u="drop"+(l?"":"Right");oe.prototype[s]=function(){return this.__filtered__?new oe(this):this[u](1)}}),oe.prototype.compact=function(){return this.filter(ht)},oe.prototype.find=function(s){return this.filter(s).head()},oe.prototype.findLast=function(s){return this.reverse().find(s)},oe.prototype.invokeMap=ie(function(s,l){return typeof s=="function"?new oe(this):this.map(function(u){return ts(u,s,l)})}),oe.prototype.reject=function(s){return this.filter(zo(J(s)))},oe.prototype.slice=function(s,l){s=Q(s);var u=this;return u.__filtered__&&(s>0||l<0)?new oe(u):(s<0?u=u.takeRight(-s):s&&(u=u.drop(s)),l!==t&&(l=Q(l),u=l<0?u.dropRight(-l):u.take(l-s)),u)},oe.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},oe.prototype.toArray=function(){return this.take(wt)},an(oe.prototype,function(s,l){var u=/^(?:filter|find|map|reject)|While$/.test(l),d=/^(?:head|last)$/.test(l),y=v[d?"take"+(l=="last"?"Right":""):l],w=d||/^find/.test(l);y&&(v.prototype[l]=function(){var x=this.__wrapped__,k=d?[1]:arguments,T=x instanceof oe,O=k[0],N=T||Z(x),R=function(se){var fe=y.apply(v,Xn([se],k));return d&&H?fe[0]:fe};N&&u&&typeof O=="function"&&O.length!=1&&(T=N=!1);var H=this.__chain__,G=!!this.__actions__.length,q=w&&!H,ee=T&&!G;if(!w&&N){x=ee?x:new oe(this);var j=s.apply(x,k);return j.__actions__.push({func:Ro,args:[R],thisArg:t}),new Dt(j,H)}return q&&ee?s.apply(this,k):(j=this.thru(R),q?d?j.value()[0]:j.value():j)})}),Lt(["pop","push","shift","sort","splice","unshift"],function(s){var l=io[s],u=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",d=/^(?:pop|shift)$/.test(s);v.prototype[s]=function(){var y=arguments;if(d&&!this.__chain__){var w=this.value();return l.apply(Z(w)?w:[],y)}return this[u](function(x){return l.apply(Z(x)?x:[],y)})}}),an(oe.prototype,function(s,l){var u=v[l];if(u){var d=u.name+"";ve.call(li,d)||(li[d]=[]),li[d].push({name:l,func:u})}}),li[To(t,M).name]=[{name:"wrapper",func:t}],oe.prototype.clone=k2,oe.prototype.reverse=_2,oe.prototype.value=T2,v.prototype.at=tS,v.prototype.chain=nS,v.prototype.commit=rS,v.prototype.next=iS,v.prototype.plant=oS,v.prototype.reverse=lS,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=aS,v.prototype.first=v.prototype.head,qi&&(v.prototype[qi]=sS),v},ii=r2();Cr?((Cr.exports=ii)._=ii,Za._=ii):qe._=ii}).call(QI)}(Ws,Ws.exports)),Ws.exports}var vy=eO();function ch(n){return n.type.create(vy.cloneDeep(n.attrs))}function tO(n){return JSON.parse(JSON.stringify(n))}function uh({tr:n,node:e,position:t,mark:r}){return e.isText?n.removeMark(t,t+e.nodeSize,r):n.removeNodeMark(t,r)}const nO=Ie.create({name:"node_processor",addCommands(){return{setBlockAttributes:z(({commands:n,state:e},t,r,i={})=>{const o=tO(r),a=B(n.getBlockAttributes(t))??{},{doc:c,tr:f}=e,{from:h,to:m}=f.selection;c.nodesBetween(h,m,(p,g)=>{Ef.includes(p.type.name)&&f.setNodeAttribute(g,t,{...i,...a,...o})})}),getBlockAttributes:z(({editor:n},e,t)=>de(()=>{let r=Object.assign({},t||{});for(const i of Ef)Object.assign(r,n.getAttributes(i)?.[e]||{});return Object.keys(r).length?r:null})),removeBlockAttributes:z(({commands:n},e)=>{for(const t of Ef)n.resetAttributes(t,e)}),applyMark:z(({state:n,commands:e},t,r,i={})=>{const{tr:o,doc:a,schema:c}=n,{$from:f,$to:h}=o.selection,m=hn(Ee.LINK,c),p=hn(t,c);if(!(p.spec.group||"").includes(At.SETTINGS))return e.setMark(t,r);if(f.pos===h.pos)return;const b=S=>{if(!i.onAppliedToParent||i.onAppliedToParent(S)===!1){const{tr:E,node:C,position:M,mark:P}=S;uh({tr:E,node:C,position:M,mark:P.type})}};a.nodesBetween(f.pos,h.pos,(S,E)=>{if(S.type.name===te.LIST)return;const C=ZI(S.marks,t),M=p.create({...C?.attrs||{},...r}),P=gy(f,h,S,E);if(!m.isInSet(S.marks)&&XI(o.doc,E,M,i.isAppliedToParent))return b({tr:o,node:S,position:E,mark:M});if(S.isText){o.addMark(P.from,P.to,M);return}jI(o.doc,o.selection,S,E)&&o.addNodeMark(E,M)})}),getMarks:z(({editor:n},e)=>{const t=yi(n,"state");return de(()=>{const{selection:r,doc:i}=B(t),{from:o,to:a}=B(r),c=[];return i.nodesBetween(o,a,f=>{for(const h of f.marks)h.type.name===e&&c.unshift(h.attrs)}),c})}),getMark:z(({commands:n},e)=>{const t=n.getMarks(e);return de(()=>B(t)[0]??null)}),hasMark:z(({commands:n},e)=>{const t=n.getMark(e);return de(()=>!!B(t))}),getCommonSettingMark:z(({commands:n},e,t)=>{const r=n.getMark(e);return de(()=>B(r)?.value??B(t))}),getDeviceSettingMark:z(({commands:n},e,t)=>{const r=n.getMarks(e),i=n.getDevice();return de(()=>{for(const o of B(r)){const a=o[B(i)];if(a||a===0)return a}return B(t)})}),removeAllMarks:z(({state:n})=>{const{tr:e,doc:t}=n,{from:r,to:i}=e.selection;t.nodesBetween(r,i,(o,a)=>{for(const c of o.marks)uh({tr:e,node:o,position:a,mark:c})})}),removeMarks:z(({state:n},e)=>{const{tr:t,doc:r}=n,{from:i,to:o}=t.selection;r.nodesBetween(i,o,(a,c)=>{const f=a.marks.filter(h=>e.includes(h.type.name));for(const h of f)uh({tr:t,node:a,position:c,mark:h})})})}}}),rO=Ie.create({name:"text_processor",addCommands(){return{getSelectedText:z(({state:n})=>{const{from:e,to:t}=n.selection;return n.doc.textBetween(e,t," ")}),transformText:z(({state:n},e)=>{const{$from:t,$to:r}=n.tr.selection;t.pos!==r.pos&&n.doc.nodesBetween(t.pos,r.pos,(i,o)=>{if(!i.isText)return;const a=gy(t,r,i,o),c=Math.max(0,t.pos-o),f=Math.max(0,r.pos-o),h=e({text:i.textContent.substring(c,f)}),m=n.schema.text(h,i.marks);n.tr.replaceWith(a.from,a.to,m)})})}}}),iO=Ie.create({name:"selection_processor",addStorage:()=>({selection:null}),addCommands(){return{storeSelection:z(({state:n})=>{this.storage.selection=n.selection}),restoreSelection:z(({commands:n})=>{this.storage.selection&&n.setTextSelection(this.storage.selection)}),expandSelection:z(({tr:n,commands:e},t)=>{let r=n.selection.from,i=n.selection.to;return n.doc.nodesBetween(r,i,(o,a,c)=>{if(t({node:o,parent:c})){const f=o.isText?0:yy(n.doc,a);r=Math.min(r,a+f),i=Math.max(i,a+o.nodeSize-f)}}),e.setTextSelection({from:r,to:i})}),expandSelectionToBlock:z(({commands:n})=>n.expandSelection(({parent:e})=>e.type.name===te.DOCUMENT))}}}),sO=Gn.create({name:"doc",topNode:!0,content:"block+"});class Gs extends $e{constructor(e,t,r,i="SetDocAttr"){super(),this.key=e,this.value=t,this.schema=r,this.stepType=i}apply(e){this.prevValue=e.attrs.meta[this.key];const t=ur.fromJSON(this.schema,e.toJSON());return t.attrs.meta[this.key]=this.value,Re.ok(t)}invert(){return new Gs(this.key,this.prevValue,this.schema,"revertSetDocAttr")}map(){return null}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}static fromJSON(e){return new Gs(e.key,e.value,e.stepType)}}$e.jsonID("setDocAttr",Gs);const oO=sO.extend({marks:At.SETTINGS,addAttributes:()=>({meta:{default:{}}}),onCreate(){this.editor.view.dom.addEventListener("click",n=>{n.target.closest("a")&&n.preventDefault()})},addCommands(){return{setDocMetaAttributes:z(({state:n},e,t)=>{n.tr.step(new Gs(e,t,n.schema))})}}}),lO=Gn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Ai(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),aO=lO.extend({marks:At.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),cO=Gn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,Ai(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>PM({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),uO=cO.extend({marks:At.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),fO=Ie.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[QM.create(this.editor),eA.create(this.editor)]}}),hO=()=>[oO,aO,uO,BM,qM,nO,rO,iO,fO],dO=yt.create({name:Ee.FONT_FAMILY,group:At.SETTINGS,addOptions:()=>({fonts:[]}),addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontFamily:z(({commands:n},e)=>{n.applyMark(this.name,{value:e});const t=n.findFontByName(e);let r=B(n.getFontWeight());t.isWeightSupported(r)||(r=t.findClosestWeight(r),n.applyFontWeight(r));const i=n.isSettingCustomized(Ee.FONT_STYLE).value;t.isItalicOnly?n.applyItalic():!t.isItalicSupported(r)&&i&&n.removeItalic()}),getFont:z(({commands:n})=>{const e=B(this.options.defaultPreset),t=n.findFontByName(e.common.font_family),r=n.getFontFamily();return de(()=>n.findFontByName(B(r))||t)}),findFontByName:z((n,e)=>B(this.options.fonts).find(t=>t.name===e)??this.options.defaultFont),getFontFamily:z(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontFamily())),getDefaultFontFamily:z(({commands:n})=>{const e=n.getPreset();return de(()=>B(e).common.font_family)})}},parseHTML(){const n=e=>({value:e.replace(/["']/g,"")});return[{style:"--zw-font-family",getAttrs:n},{style:"font-family",getAttrs:n}]},renderHTML({HTMLAttributes:n}){const e=n.value?`"${n.value}"`:null;return xr({font_family:e})}}),pO=Ie.create({name:Ee.STYLE_PRESET,addGlobalAttributes(){return[{types:[te.PARAGRAPH,te.HEADING],attributes:{preset:{isRequired:!1,default:{id:B(this.options.defaultId)},parseHTML:n=>{const e=B(this.options.presets);if(n.parentElement.tagName==="LI")return null;for(const{id:t,node:r,fallbackClass:i}of e){if(i&&n.classList.contains(i))return{id:t};const o=B(this.options.styleRenderer).makePresetCssClass({id:t});if(n.matches(o))return{id:t};if(n.tagName===`H${r?.level}`)return{id:t}}return n.tagName==="P"?{id:B(this.options.defaultId)}:null},renderHTML:n=>n.preset?{class:B(this.options.styleRenderer).makePresetHtmlClass(n.preset)}:null}}}]},addCommands(){function n(t,r){return t.find(i=>r===i.id)}function e(t,r){const i={};for(const o of Object.keys(t)){const a=t[o],c=r[o],f=!c||c.toLowerCase()==="inherit";i[o]=f?a:c}return i}return{getPresetList:z(()=>de(()=>B(this.options.presets).filter(t=>!t.hidden))),getPreset:z(({commands:t})=>{const r=t.getBlockAttributes("preset",{id:B(this.options.defaultId)}),i=t.getPresetList(),o=t.isLink(),a=t.getLinkPreset();return de(()=>{const c=n(B(i),B(r).id);if(!B(o))return c;const f=B(a);return{id:c.id,common:e(c.common,f.common),mobile:e(c.mobile,f.mobile),tablet:e(c.tablet,f.tablet),desktop:e(c.desktop,f.desktop)}})}),applyPreset:z(({commands:t,chain:r},i)=>{const o=B(t.getPresetList()),a=n(o,i),c=a.node?.type??te.PARAGRAPH,f={preset:{id:i}};a.node&&(f.level=a.node.level);for(const h of j0)f[h]=B(t.getBlockAttributes(h));r().removeList().setNode(c,f).run()}),applyDefaultPreset:z(({commands:t})=>{t.applyPreset(B(this.options.defaultId))}),removePreset:z(({commands:t})=>{t.setNode(te.PARAGRAPH,{preset:null})}),getPresetCustomization:z(({editor:t,commands:r})=>{const i=yi(t,"state");return de(()=>{const{selection:o,doc:a}=B(i),{from:c,to:f}=o;return r._getSettingCustomization(a,c,f)})}),isSettingCustomized:z(({commands:t},r)=>{const i=t.getPresetCustomization(),o=Bl.includes(r)?"attributes":"marks";return de(()=>B(i)[o]?.includes(r)??!1)}),getContentCustomization:z(({editor:t,commands:r})=>{const i=yi(t,"state");return de(()=>{const{doc:o}=B(i);return r._getSettingCustomization(o,0,o.content.size)})}),_getSettingCustomization:z((t,r,i,o)=>{const a=new Set,c=new Set;return r.nodesBetween(i,o,f=>{for(const[h,m]of Object.entries(f.attrs))Bl.includes(h)&&m&&c.add(h);for(const{type:h}of f.marks)X0.includes(h.name)&&a.add(h.name)}),{attributes:Array.from(c),marks:Array.from(a)}}),removePresetCustomization:z(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(X0).resetAttributes(te.PARAGRAPH,Bl).resetAttributes(te.HEADING,Bl).restoreSelection().run()}),removeFormat:z(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeAllMarks().applyDefaultPreset().restoreSelection().run()})}},onCreate(){this.options.styleRenderer.inject(Pi.head,B(this.options.presets))}}),mO=yt.create({name:Ee.FONT_WEIGHT,group:At.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:z(({commands:n},e)=>{n.applyMark(this.name,{value:e}),B(n.getFont()).isItalicSupported(e)||n.removeItalic()}),toggleBold:z(({commands:n})=>{const e=B(n.getFontWeight()),t=B(n.getFont()),i=Number(e)>=600?"400":"700",o=t.findClosestWeight(i);n.applyFontWeight(o)}),getFontWeight:z(({commands:n})=>{const e=n.getCommonSettingMark(this.name,n.getDefaultFontWeight()),t=n.getFont();return de(()=>{const r=B(e),i=B(t);return i.isWeightSupported(r)?r:i.findClosestWeight(r)})}),getDefaultFontWeight:z(({commands:n})=>{const e=n.getPreset();return de(()=>B(e).common.font_weight)})}},addKeyboardShortcuts:()=>({"Mod-b":Kt("toggleBold"),"Mod-B":Kt("toggleBold")}),parseHTML(){const n=e=>e==="bold"?{value:"700"}:Number(e)?{value:e}:!1;return[{style:"--zw-font-weight",getAttrs:n},{style:"font-weight",getAttrs:n},{tag:"b",attrs:{value:"700"}},{tag:"strong",attrs:{value:"700"}}]},renderHTML({HTMLAttributes:n}){return xr({font_weight:n.value})}}),gO=yt.create({name:Ee.FONT_SIZE,group:At.SETTINGS,addOptions:()=>({minSize:1,maxSize:100}),addAttributes(){return{mobile:{default:null},tablet:{default:null},desktop:{default:null}}},addCommands(){return{getFontSize:z(({commands:n})=>n.getDeviceSettingMark(this.name,n.getDefaultFontSize())),getDefaultFontSize:z(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return de(()=>B(t)[B(e)].font_size.replace("px",""))}),applyFontSize:z(({commands:n},e)=>{const t=n.getTargetDevices(),r=Object.fromEntries(t.map(i=>[i,e]));n.applyMark(this.name,r,{isAppliedToParent:(i,o)=>i.type.name!==o.type.name?!1:t.every(a=>i.attrs[a]===o.attrs[a]),onAppliedToParent:({tr:i,node:o,position:a,mark:c})=>{const f={...c.attrs};if(t.forEach(p=>{f[p]=null}),!Object.values(f).some(p=>!!p))return!1;const m=c.type.create(f);if(o.isText){i.addMark(a,a+o.nodeSize,m);return}i.addNodeMark(a,m)}})}),increaseFontSize:z(({commands:n})=>{const e=Number(B(n.getFontSize())),t=Math.min(e+1,B(this.options.maxSize));n.applyFontSize(String(t))}),decreaseFontSize:z(({commands:n})=>{const e=Number(B(n.getFontSize())),t=Math.max(e-1,B(this.options.minSize));n.applyFontSize(String(t))})}},addKeyboardShortcuts:()=>({"Mod-Shift-=":Kt("increaseFontSize"),"Mod-Shift--":Kt("decreaseFontSize")}),parseHTML(){const n=e=>{if(!e)return null;const t=B(this.options.wrapperRef),r=my(e,t);return String(r)};return[{tag:'[style*="--zw-font-size"]',getAttrs:({style:e})=>({mobile:n(e.getPropertyValue("--zw-font-size-mobile")),tablet:n(e.getPropertyValue("--zw-font-size-tablet")),desktop:n(e.getPropertyValue("--zw-font-size-desktop"))})},{style:"font-size",getAttrs:e=>{const t=n(e);return{desktop:t,tablet:t,mobile:null}}}]},renderHTML({HTMLAttributes:n}){const e=t=>t?`${t}px`:null;return xr({font_size_mobile:e(n.mobile),font_size_tablet:e(n.tablet),font_size_desktop:e(n.desktop)})}}),yO=yt.create({name:Ee.FONT_COLOR,group:At.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getFontColor:z(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontColor())),getDefaultFontColor:z(({commands:n})=>{const e=n.getPreset();return de(()=>B(e).common.color)}),applyFontColor:z(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:dy(e)});return[{style:"--zw-font-color",getAttrs:n},{style:"color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return xr({font_color:n.value})}}),bO=yt.create({name:Ee.BACKGROUND_COLOR,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getBackgroundColor:z(({commands:n})=>n.getCommonSettingMark(this.name,"rgba(255, 255, 255, 0%)")),applyBackgroundColor:z(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:dy(e)});return[{style:"--zw-background-color",getAttrs:n},{style:"background-color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return xr({background_color:n.value})}}),vO=Ie.create({name:"device_manager",addCommands(){return{getDevice:z(()=>{const n=yi(this.options,"device");return de(()=>{const e=B(n);return e===Dn.ALL?Dn.DESKTOP:e})}),getTargetDevices:z(()=>{const n=B(this.options.device);return n===Dn.ALL?[Dn.DESKTOP,Dn.TABLET,Dn.MOBILE]:[n]})}}}),wO=yt.create({name:Ee.FONT_STYLE,group:At.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:z(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultFontStyle();return de(()=>B(e)?.italic??B(t).italic)}),isItalicAvailable:z(({commands:n})=>{const e=n.getFont(),t=n.getFontWeight();return de(()=>{const r=B(e),i=B(t);return r.isItalicSupported(i)&&!r.isWeightItalicOnly(i)})}),getDefaultFontStyle:z(({commands:n})=>{const e=n.getPreset();return de(()=>({italic:B(e).common.font_style==="italic"}))}),toggleItalic:z(({commands:n})=>{B(n.isItalicAvailable())&&(B(n.isItalic())?n.removeItalic():n.applyItalic())}),applyItalic:z(({commands:n})=>{n.applyMark(this.name,{italic:!0})}),removeItalic:z(({commands:n})=>{n.applyMark(this.name,{italic:!1})})}},addKeyboardShortcuts:()=>({"Mod-i":Kt("toggleItalic"),"Mod-I":Kt("toggleItalic")}),parseHTML(){const n=e=>({italic:e.includes("italic")});return[{tag:"i",attrs:{italic:!0}},{style:"--zw-font-style",getAttrs:n},{style:"font-style",getAttrs:n}]},renderHTML({HTMLAttributes:n}){const e=n.italic?"italic":"normal";return xr({font_style:e})}}),SO=yt.create({name:Ee.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:z(({commands:n})=>{const e=n.getTextDecoration();return de(()=>B(e).underline)}),isStrikeThrough:z(({commands:n})=>{const e=n.getTextDecoration();return de(()=>B(e).strike_through)}),getTextDecoration:z(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultTextDecoration();return de(()=>{const r=B(e)??{},i=B(t);return{underline:r.underline||i.underline,strike_through:r.strike_through||i.strike_through}})}),isUnderlineCustomized:z(({commands:n})=>{const e=n.isUnderline(),t=n.getDefaultTextDecoration();return de(()=>B(e)!==B(t).underline)}),getDefaultTextDecoration:z(({commands:n})=>{const e=n.getPreset();return de(()=>{const{text_decoration:t}=B(e).common;return{underline:t.includes("underline"),strike_through:t.includes("line-through")}})}),toggleUnderline:z(({commands:n})=>{n.toggleTextDecoration("underline")}),toggleStrikeThrough:z(({commands:n})=>{n.toggleTextDecoration("strike_through")}),toggleTextDecoration:z(({commands:n},e,t=null)=>{const r=B(n.getTextDecoration()),i=t??!r[e];n.applyMark(this.name,{[e]:i})}),applyTextDecoration:z(({commands:n},e)=>{n.toggleTextDecoration(e,!0)}),removeTextDecoration:z(({commands:n},e)=>{n.toggleTextDecoration(e,!1)})}},addKeyboardShortcuts:()=>({"Mod-u":Kt("toggleUnderline"),"Mod-U":Kt("toggleUnderline")}),parseHTML(){const n=e=>{const t=e.includes("underline"),r=e.includes("line-through");return!t&&!r?!1:{underline:t,strike_through:r}};return[{style:"--zw-text-decoration",getAttrs:n},{style:"text-decoration-line",getAttrs:n},{style:"text-decoration",getAttrs:n},{tag:"s",attrs:{underline:!1,strike_through:!0}},{tag:"u",attrs:{underline:!0,strike_through:!1}}]},renderHTML({HTMLAttributes:n}){const e=[];return n.underline&&e.push("underline"),n.strike_through&&e.push("line-through"),e.length||e.push("none"),xr({text_decoration:e.join(" ")})}}),xO=Ie.create({name:"case_style",addCommands(){return{applyCaseStyle:z(({commands:n},e)=>{switch(e){case zl.CAPITALIZE:return n.applyCapitalize();case zl.LOWERCASE:return n.applyLowerCase();case zl.UPPERCASE:return n.applyUpperCase()}}),applyCapitalize:z(({commands:n})=>{n.transformText(({text:e})=>wA(e))}),applyLowerCase:z(({commands:n})=>{n.transformText(({text:e})=>e.toLowerCase())}),applyUpperCase:z(({commands:n})=>{n.transformText(({text:e})=>e.toUpperCase())})}}}),wy={mobile:null,tablet:null,desktop:null},EO=Ie.create({name:Ee.ALIGNMENT,addGlobalAttributes:()=>[{types:[te.PARAGRAPH,te.HEADING],attributes:{[Ee.ALIGNMENT]:{isRequired:!1,parseHTML({style:n}){const e=qI(n.textAlign);if(e)return{desktop:e,tablet:e,mobile:e};const t=n.getPropertyValue("--zw-alignment-mobile")||null,r=n.getPropertyValue("--zw-alignment-tablet")||null,i=n.getPropertyValue("--zw-alignment-desktop")||null;return!t&&!r&&!i?null:{desktop:i,tablet:r,mobile:t}},renderHTML(n){return n.alignment?ya({alignment_mobile:n.alignment.mobile,alignment_tablet:n.alignment.tablet,alignment_desktop:n.alignment.desktop}):null}}}}],addCommands(){return{applyAlignment:z(({commands:n},e)=>{const t=n.getTargetDevices(),r=Object.fromEntries(t.map(i=>[i,e]));n.setBlockAttributes(this.name,r,wy)}),removeAlignment:z(({commands:n})=>n.removeBlockAttributes(this.name)),getAlignment:z(({commands:n})=>{const e=n.getBlockAttributes(this.name,wy),t=n.getDevice(),r=n.getDefaultAlignment();return de(()=>B(e)?.[B(t)]??B(r))}),getDefaultAlignment:z(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return de(()=>B(t)[B(e)].alignment??br.LEFT)})}},addKeyboardShortcuts:()=>({"Mod-Shift-l":Kt("applyAlignment",br.LEFT),"Mod-Shift-e":Kt("applyAlignment",br.CENTER),"Mod-Shift-r":Kt("applyAlignment",br.RIGHT),"Mod-Shift-j":Kt("applyAlignment",br.JUSTIFY)})}),Sy={mobile:null,tablet:null,desktop:null},kO=Ie.create({name:Ee.LINE_HEIGHT,addGlobalAttributes(){return[{types:[te.PARAGRAPH,te.HEADING],attributes:{[Ee.LINE_HEIGHT]:{isRequired:!1,parseHTML:n=>{if(n.matches('[style*="--zw-line-height"]')){const o=n.style.getPropertyValue("--zw-line-height-tablet")||null,a=n.style.getPropertyValue("--zw-line-height-desktop")||null;return{mobile:null,tablet:o,desktop:a}}const e=n.style.lineHeight;if(!e)return null;const t=B(this.options.wrapperRef),r=KI(e,n,t);return r?{desktop:r,tablet:r,mobile:null}:null},renderHTML(n){return n.line_height?ya({line_height_mobile:n.line_height.mobile,line_height_tablet:n.line_height.tablet,line_height_desktop:n.line_height.desktop}):null}}}}]},addCommands(){return{getLineHeight:z(({commands:n})=>{const e=n.getBlockAttributes(this.name,Sy),t=n.getDevice(),r=n.getDefaultLineHeight();return de(()=>B(e)?.[B(t)]??B(r))}),getDefaultLineHeight:z(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return de(()=>B(t)[B(e)].line_height)}),applyLineHeight:z(({commands:n},e)=>{const t=n.getTargetDevices(),r=Object.fromEntries(t.map(i=>[i,e]));n.setBlockAttributes(this.name,r,Sy)})}}}),_O=yt.create({name:Ee.LETTER_SPACING,group:At.SETTINGS,addAttributes:()=>({mobile:{default:null},tablet:{default:null},desktop:{default:null}}),addCommands(){return{getLetterSpacing:z(({commands:n})=>n.getDeviceSettingMark(this.name,n.getDefaultLetterSpacing())),getDefaultLetterSpacing:z(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return de(()=>B(t)[B(e)].letter_spacing??null)}),applyLetterSpacing:z(({commands:n},e)=>{const t=n.getTargetDevices(),r=Object.fromEntries(t.map(i=>[i,e]));n.applyMark(this.name,r)})}},parseHTML(){const n=e=>{if(!e)return null;const t=B(this.options.wrapperRef);return`${GI(e,t)}px`};return[{tag:'[style*="--zw-letter-spacing"]',getAttrs:({style:e})=>({mobile:n(e.getPropertyValue("--zw-letter-spacing-mobile")),tablet:n(e.getPropertyValue("--zw-letter-spacing-tablet")),desktop:n(e.getPropertyValue("--zw-letter-spacing-desktop"))})},{style:"letter-spacing",getAttrs:e=>{const t=n(e);return{desktop:t,tablet:t,mobile:t}}}]},renderHTML({HTMLAttributes:n}){const e=t=>t?`${t}px`:null;return xr({letter_spacing_mobile:e(n.mobile),letter_spacing_tablet:e(n.tablet),letter_spacing_desktop:e(n.desktop)})}}),TO=Gn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Ai(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),CO=TO.extend({name:te.LIST_ITEM,marks:At.SETTINGS,addCommands(){const n=({selection:e})=>e.$cursor.before(e.$cursor.depth-1);return{listItemNewline:z(({commands:e,tr:t})=>{const r=t.doc.nodeAt(n(t));if(!t.selection.$cursor.node().textContent)return!1;e.splitListItem(this.name);const o=n(t);for(const a of r.marks)t.addNodeMark(o,ch(a));return!0})}},addOptions:()=>({HTMLAttributes:{class:"zw-style"}}),addKeyboardShortcuts:()=>({Enter:n=>{const{state:e,commands:t}=n.editor;if(e.selection.$cursor?.path.some(i=>i.type?.name===te.LIST))return t.listItemNewline()}})});function MO(n,e){if(Y0.includes(e.type)||e.type.isInSet(n.marks))return!1;for(const t of n.content.content)if(t.childCount&&(!t.marks||!e.isInSet(t.marks)))return!1;return!0}function AO(n){const e=n.selection.$from.start(),t=n.selection.$to.end();n.doc.nodesBetween(e,t,(r,i)=>{if(r.type.name===te.LIST)return;if(r.type.name!==te.LIST_ITEM)return!1;const o=[];return r.forEach(a=>{for(const c of a.marks){if(c.isInSet(o)){n.removeNodeMark(i+1,c);continue}MO(r,c)&&(n.removeNodeMark(i+1,c),n.addNodeMark(i,ch(c)),o.push(c))}}),!1})}const IO=Gn.create({name:te.LIST,content:`${te.LIST_ITEM}+`,group:"block list",marks:At.SETTINGS,addExtensions:()=>[CO],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:tn.DISC}}}),parseHTML(){const n={a:tn.ROMAN,i:tn.LATIN,1:tn.DECIMAL},e=t=>{for(const r of XM){const i=`.${B(this.options.baseClass)}${r}`;if(t.matches(i)||n[t.type.toLowerCase()]===r)return r}};return[{tag:"ol",getAttrs:t=>({bullet:{type:e(t)||tn.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||tn.DISC}})}]},renderHTML({HTMLAttributes:n}){const e=[B(this.options.baseClass)+n.bullet.type,B(this.options.presetClass)];return[ZM.includes(n.bullet.type)?"ol":"ul",{class:e.join(" ")},0]},addCommands(){return{getListType:z(({commands:n})=>{const e=n.getBlockAttributes("bullet",{type:null});return de(()=>B(e).type??null)}),applyList:z(({commands:n,chain:e},t)=>B(n.getListType())===t?n.removeList():e().applyDefaultPreset().toggleList(te.LIST,te.LIST_ITEM).setBlockAttributes("bullet",{type:t}).command(({tr:i})=>AO(i)).run()),removeList:z(({chain:n})=>n().expandSelection(({parent:e})=>e.type.name===te.LIST).command(({tr:e})=>{const t=e.selection.$from.start(),r=e.selection.$to.end();return e.doc.nodesBetween(t,r,(i,o,a)=>{if([te.LIST,te.LIST_ITEM].includes(i.type.name))return;if(a.type.name!==te.LIST_ITEM)return!1;const c=a.marks.filter(f=>!f.type.isInSet(i.marks));for(const f of c)e.addNodeMark(o,ch(f));return!1}),!0}).liftListItem(te.LIST_ITEM).run())}},addInputRules(){const n=(e,t)=>DM({find:t,type:this.type,getAttributes:{bullet:{type:e}},joinPredicate:(r,{attrs:i})=>i.bullet.type===e});return[n(tn.DISC,/^\s*([-+*])\s$/),n(tn.DECIMAL,/^(\d+)\.\s$/),n(tn.LATIN,/^([ivx]{1,3})\.\s$/i),n(tn.ROMAN,/^([a-z])\.\s$/i)]}});function OO(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function NO(n){return new lt({key:new Ct("autolink"),appendTransaction:(e,t,r)=>{const i=e.some(h=>h.docChanged)&&!t.doc.eq(r.doc),o=e.some(h=>h.getMeta("preventAutolink"));if(!i||o)return;const{tr:a}=r,c=iM(t.doc,[...e]);if(dM(c).forEach(({newRange:h})=>{const m=oM(r.doc,h,b=>b.isTextblock);let p,g;if(m.length>1?(p=m[0],g=r.doc.textBetween(p.pos,p.pos+p.node.nodeSize,void 0," ")):m.length&&r.doc.textBetween(h.from,h.to," "," ").endsWith(" ")&&(p=m[0],g=r.doc.textBetween(p.pos,h.to,void 0," ")),p&&g){const b=g.split(" ").filter(M=>M!=="");if(b.length<=0)return!1;const S=b[b.length-1],E=p.pos+g.lastIndexOf(S);if(!S)return!1;const C=ga(S).map(M=>M.toObject(n.defaultProtocol));if(!OO(C))return!1;C.filter(M=>M.isLink).map(M=>({...M,from:E+M.start+1,to:E+M.end+1})).filter(M=>r.schema.marks.code?!r.doc.rangeHasMark(M.from,M.to,r.schema.marks.code):!0).filter(M=>n.validate(M.value)).filter(M=>n.shouldAutoLink(M.value)).forEach(M=>{F0(M.from,M.to,r.doc).some(P=>P.mark.type===n.type)||a.addMark(M.from,M.to,n.type.create({href:M.href}))})}}),!!a.steps.length)return a}})}function RO(n){return new lt({key:new Ct("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,o;if(r.button!==0||!e.editable)return!1;let a=r.target;const c=[];for(;a.nodeName!=="DIV";)c.push(a),a=a.parentNode;if(!c.find(g=>g.nodeName==="A"))return!1;const f=uM(e.state,n.type.name),h=r.target,m=(i=h?.href)!==null&&i!==void 0?i:f.href,p=(o=h?.target)!==null&&o!==void 0?o:f.target;return h&&m?(window.open(m,p),!0):!1}}})}function LO(n){return new lt({key:new Ct("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{state:i}=e,{selection:o}=i,{empty:a}=o;if(a)return!1;let c="";r.content.forEach(h=>{c+=h.textContent});const f=d1(c,{defaultProtocol:n.defaultProtocol}).find(h=>h.isLink&&h.value===c);return!c||!f?!1:n.editor.commands.setMark(n.type,{href:f.href})}}})}const PO=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function jr(n,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&t.push(i)}),!n||n.replace(PO,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const DO=yt.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(n=>{if(typeof n=="string"){h1(n);return}h1(n.scheme,n.optionalSlashes)})},onDestroy(){gA()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,e)=>!!jr(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>!!n}},addAttributes(){return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{const e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!jr(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!jr(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Ai(this.options.HTMLAttributes,n),0]:["a",Ai(this.options.HTMLAttributes,{...n,href:""}),0]},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!jr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!jr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[zM({find:n=>{const e=[];if(n){const{protocols:t,defaultProtocol:r}=this.options,i=d1(n).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:a=>!!jr(a,t),protocols:t,defaultProtocol:r}));i.length&&i.forEach(o=>e.push({text:o.value,data:{href:o.href},index:o.start}))}return e},type:this.type,getAttributes:n=>{var e;return{href:(e=n.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push(NO({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!jr(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&n.push(RO({type:this.type})),this.options.linkOnPaste&&n.push(LO({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),n}}),zO=DO.extend({name:Ee.LINK,addOptions(){return{...this.parent?.(),openOnClick:!1,linkOnPaste:!1}},addAttributes(){return{href:{default:null,parseHTML:n=>{const e=n.getAttribute("href");return e.startsWith("#")?parseFloat(n.getAttribute("href").replace("#","")):e}},target:{default:kf.SELF,parseHTML:n=>n.getAttribute("target")||kf.SELF},destination:{default:Ii.URL,parseHTML:n=>{const e=n.getAttribute("href");if(!e.startsWith("#"))return Ii.URL;const t=e.replace("#","");return B(this.options.pageBlocks).find(o=>o.id===parseInt(t))?Ii.BLOCK:Ii.URL}}}},addCommands(){const{unsetLink:n}=this.parent();return{removeLink:n,applyLink:z(({commands:e,chain:t},r)=>(e.setMeta("preventAutolink",!0),e.getSelectedText()?t().applyMark(this.name,r).expandSelectionToLink().command(({tr:i})=>(r.text&&i.insertText(r.text,i.selection.from,i.selection.to),!0)).run():e.insertContent(Ey.text(r.text,[Ey.mark(Ee.LINK,r)])))),expandSelectionToLink:z(({commands:e})=>{e.expandSelection(({node:t})=>this.type.isInSet(t.marks))}),isLink:z(({commands:e})=>e.hasMark(this.name)),getLinkPreset:z(()=>de(()=>B(this.options.preset)))}},addProseMirrorPlugins(){return[...this.parent(),vA.create(this.editor)]},renderHTML({HTMLAttributes:n}){const e=n.destination===Ii.BLOCK?`#${n.href}`:n.href,t=B(this.options.basePresetClass)+B(this.options.preset).id;return["a",{href:e,target:n.target,class:`${t} zw-style`},0]}}),BO=yt.create({name:Ee.SUPERSCRIPT,addCommands(){return{applySuperscript:z(({commands:n})=>{n.setMark(this.name)}),removeSuperscript:z(({commands:n})=>{n.unsetMark(this.name)}),toggleSuperscript:z(({commands:n})=>{B(n.isSuperscript())?n.removeSuperscript():n.applySuperscript()}),isSuperscript:z(({commands:n})=>{const e=n.getMark(this.name);return de(()=>!!B(e))})}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs:n=>n!=="super"?!1:null}]},renderHTML(){return["sup",{class:"zw-superscript"},0]}}),FO=Ie.create({name:Ee.MARGIN,addGlobalAttributes:()=>[{types:[te.PARAGRAPH,te.HEADING],attributes:{[Ee.MARGIN]:{isRequired:!1,parseHTML(n){const{margin:e,marginTop:t,marginRight:r,marginBottom:i,marginLeft:o}=n.style;return[e,t,r,i,o].some(f=>!!f)?e?{value:e}:{value:[t||0,r||0,i||0,o||0].join(" ")}:null},renderHTML(n){return n.margin?ya({margin:n.margin.value}):null}}}}]});function HO(n){const e=r=>n.presetsRef.value.find(i=>i.id===r),t=bu({default:null,link:null});return Ek(n.presetsRef,()=>{t.default=e(n.defaultPresetId),t.link=e(n.linkPresetId)},{immediate:!0,deep:!0}),hO().concat([pO.configure({presets:n.presetsRef,defaultId:n.defaultPresetId,styleRenderer:new KO({baseClass:n.basePresetClass,makeVariable:n.makePresetVariable,linkPresetId:n.linkPresetId})}),IO.configure({baseClass:n.baseListClass,presetClass:n.basePresetClass+n.defaultPresetId}),vO.configure({device:n.deviceRef}),gO.configure({minSize:n.minFontSize,maxSize:n.maxFontSize,wrapperRef:n.wrapperRef}),dO.configure({fonts:n.fonts,defaultPreset:yi(t,"default"),defaultFont:n.defaultFont}),mO,yO,bO,wO,SO,xO,BO,EO,kO.configure({wrapperRef:n.wrapperRef}),_O,zO.configure({preset:yi(t,"link"),basePresetClass:n.basePresetClass,pageBlocks:n.pageBlocksRef}),FO])}class $O{_domParser=new DOMParser;types=window;parse(e){return this._domParser.parseFromString(e,"text/html")}}class xy{content;constructor({content:e}){this.content=e}normalize(){throw new Error("Implement abstract method")}}class gn extends xy{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=gn.BLOCK_NODE_NAMES.concat("UL","OL");static BLOCK_STYLES=["text-align","line-height","margin","margin-top","margin-bottom","margin-left","margin-right"];_parser;constructor({content:e,parser:t}){super({content:e}),this._parser=t,this.dom=null}normalize(){return this.normalizeHTML(),this.normalizedHTML}normalizeHTML(){this.dom=this._parser.parse(this.content.replace(/(\r)?\n/g,"")),this._removeComments(),this._normalizeRootTags(),this._iterateNodes(this._normalizeBreakLines,e=>e.tagName==="BR"),this._iterateNodes(this._removeEmptyNodes,this._isBlockNode),this._iterateNodes(this._normalizeListItems,e=>e.tagName==="LI"),this._normalizeBlockTextDecoration(),this._normalizeBlockBackgroundColor()}get normalizedHTML(){return this.dom.body.innerHTML}get _NodeFilter(){return this._parser.types.NodeFilter}get _Node(){return this._parser.types.Node}_removeComments(){const e=this._createNodeIterator(this._NodeFilter.SHOW_COMMENT);this._runIterator(e,t=>t.remove())}_normalizeRootTags(){const e=Array.from(this.dom.body.childNodes),t=this.dom.createDocumentFragment();let r;for(const i of e){if(this._isRootNode(i)){t.append(i),r=null;continue}r||(r=this.dom.createElement("p"),t.append(r)),r.append(i)}this.dom.body.innerHTML="",this.dom.body.append(t)}_createNodeIterator(e,t){return this.dom.createNodeIterator(this.dom.body,e,t)}_iterateNodes(e,t=()=>!0){const r=o=>o.tagName!=="BODY"&&t.call(this,o),i=this._createNodeIterator(this._NodeFilter.SHOW_ELEMENT,{acceptNode:o=>r(o)?this._NodeFilter.FILTER_ACCEPT:this._NodeFilter.FILTER_REJECT});this._runIterator(i,e)}_runIterator(e,t){let r=e.nextNode();for(;r;)t.call(this,r),r=e.nextNode()}_removeEmptyNodes(e){e.innerHTML.trim()||e.remove()}_normalizeListItems(e){const t=this.dom.createDocumentFragment(),r=Array.from(e.childNodes);let i,o;const a=c=>{this._assignElementProperties(c,e,gn.BLOCK_STYLES),t.append(c)};this._assignElementProperties(e,e.parentElement,gn.BLOCK_STYLES);for(const c of r){if(this._isBlockNode(c)){a(c),i=null,o=c;continue}if(c.tagName==="BR"&&o&&o?.tagName!=="BR"){c.remove(),o=c;continue}if(c.tagName==="BR"){const f=this.dom.createElement("p");f.append(c),a(f),i=null,o=c;continue}i||(i=this.dom.createElement("p"),a(i)),i.append(c),o=c}e.append(t),this._removeStyleProperties(e,gn.BLOCK_STYLES),this._removeStyleProperties(e.parentElement,gn.BLOCK_STYLES),this._assignElementProperties(e,e.parentElement),e.parentElement.lastElementChild===e&&this._removeStyleProperties(e.parentElement)}_isBlockNode(e){return gn.BLOCK_NODE_NAMES.includes(e.tagName)}_isRootNode(e){return gn.ROOT_NODE_NAMES.includes(e.tagName)}_assignElementProperties(e,t,r=Array.from(t.style)){for(const i of r){const o=t.style.getPropertyValue(i);o&&!e.style.getPropertyValue(i)&&e.style.setProperty(i,o)}}_removeStyleProperties(e,t=Array.from(e.style)){for(const r of t)e.style.removeProperty(r);e.style.length===0&&e.removeAttribute("style")}_normalizeBreakLines({parentElement:e}){if(!this._isBlockNode(e)||!e.textContent)return;const t=this.dom.createDocumentFragment(),r=Array.from(e.childNodes),i=e.cloneNode(!0);i.innerHTML="";let o=i.cloneNode();const a=c=>{this._assignElementProperties(c,e,gn.BLOCK_STYLES),t.append(c)};for(const c of r){if(c.tagName==="BR"){a(o),o=i.cloneNode();continue}o.append(c)}t.append(o),e.replaceWith(t)}_normalizeBlockTextDecoration(){const e=this.dom.querySelectorAll('[style*="text-decoration"]:where(p, h1, h2, h3, h4, li)');for(const t of e)this._moveTextDecorationToChildren(t)}_moveTextDecorationToChildren(e){const t=this._parseTextDecoration(e);if(e.style.removeProperty("text-decoration-line"),e.style.removeProperty("text-decoration"),e.style.cssText||e.removeAttribute("style"),!t.none)for(const r of e.childNodes){const i=this._wrapTextNode(e,r),o=this._parseTextDecoration(i),a={underline:o.underline||t.underline,line_through:o.line_through||t.line_through};i.style.removeProperty("text-decoration-line"),i.style.removeProperty("text-decoration"),i.style.textDecoration=Object.entries(a).filter(([,c])=>c).map(([c])=>c.replace("_","-")).join(" ")}}_parseTextDecoration(e){const{textDecoration:t,textDecorationLine:r}=e.style,i=t||r||"";return{none:i.includes("none"),underline:i.includes("underline"),line_through:i.includes("line-through")}}_normalizeBlockBackgroundColor(){const e=this.dom.querySelectorAll('[style*="background-color"]:where(p, h1, h2, h3, h4, li)');for(const t of e)this._moveBackgroundColorToChildren(t)}_moveBackgroundColorToChildren(e){const t=e.style.backgroundColor;e.style.removeProperty("background-color"),e.style.cssText||e.removeAttribute("style");for(const r of e.childNodes){const i=this._wrapTextNode(e,r),o=i.style.backgroundColor||t;i.style.backgroundColor=o}}_wrapTextNode(e,t){if(t.nodeType!==this._Node.TEXT_NODE)return t;const r=this.dom.createElement("span");return r.append(t.cloneNode()),e.replaceChild(r,t),r}}class WO extends xy{normalize(){return this._iterateNodes(this._bubbleMarks),this.content}_iterateNodes(e){this._iterateChildNodes(this.content,e)}_iterateChildNodes(e,t){for(const r of e.content)r.content&&this._iterateChildNodes(r,t),t.call(this,r)}_bubbleMarks(e){if(e.content&&e.type!==te.LIST){for(const t of e.content)if(!this._isLink(t)&&t.marks)for(const r of t.marks.slice()){if(this._includesMark(e,r)){this._removeMark(t,r);continue}this._canBubbleMark(e,r)&&(this._removeMark(t,r),this._addMark(e,r))}}}_canBubbleMark(e,t){if(Y0.includes(t.type)||this._includesMarkType(e,t.type))return!1;for(const r of e.content)if(!(!r.content&&e.type===te.LIST_ITEM)&&(!r.marks||!this._includesMark(r,t)))return!1;return!0}_includesMark(e,t){return e.marks?.some(r=>vy.isEqual(r,t))??!1}_includesMarkType(e,t){return e.marks?.some(r=>r.type===t)??!1}_isLink(e){return e.type===te.TEXT&&this._includesMarkType(e,Ee.LINK)}_removeMark(e,t){if(!e.marks)return;const r=this._findMarkIndexByType(e,t.type);r>=0&&e.marks.splice(r,1),e.marks.length||delete e.marks}_addMark(e,t){this._removeMark(e,t),e.marks??=[],e.marks.push(t)}_findMarkIndexByType(e,t){return e.marks?.findIndex(r=>r.type===t)??null}}class Na{static build(e,t={}){return typeof e=="string"?this._buildHtml(e,t):this._buildJson(e)}static _buildHtml(e,t){return new gn({content:e,parser:t.parser||new $O})}static _buildJson(e){return new WO({content:e})}static normalize(e,t={}){return Na.build(e,t).normalize()}}class Pi{static window=globalThis.window;static use(e){this.window=e}static get document(){return this.window.document}static get body(){return this.document.body}static get head(){return this.document.head}static getComputedStyle(e){return this.window.getComputedStyle(e)}}class gh{static build({config:e,nodeDomParser:t}){const r=HO({fonts:e.fonts,minFontSize:0,maxFontSize:0,presetsRef:jo(e.presets),defaultPresetId:e.defaultPresetId,linkPresetId:e.linkPresetId,makePresetVariable:()=>"",basePresetClass:e.basePresetClass,baseListClass:e.baseListClass,deviceRef:jo(Dn.DESKTOP),pageBlocksRef:jo([]),wrapperRef:Pi.document.createElement("p")}),i=aM(r);return new gh({schema:i,domParser:vs.fromSchema(i),nodeDomParser:t})}_schema;_domParser;_nodeDomParser;constructor({schema:e,domParser:t,nodeDomParser:r}){this._schema=e,this._domParser=t,this._nodeDomParser=r}toJSON(e){const t=Na.build(e,{parser:this._nodeDomParser});return t.normalizeHTML(),this._domParser.parse(t.dom.body).toJSON()}}function UO(n,e){return n.type===e}function VO(n){return typeof n=="string"}class Ey{static doc(e){return{type:te.DOCUMENT,content:e}}static list(e,t){return{type:te.LIST,attrs:{bullet:{type:e}},content:t.map(r=>UO(r,te.LIST_ITEM)?r:this.listItem([r].flat()))}}static listItem(...e){const{attrs:t,content:r,marks:i}=this.normalizeTextBlockArgs(e);return{type:te.LIST_ITEM,...t?{attrs:t}:{},...i?{marks:i}:{},content:[r].flat().map(o=>VO(o)?this.paragraph(o):o)}}static heading(e,...t){const r=this.textBlock(t);return r.attrs??={},r.attrs.level=e,{type:te.HEADING,...r}}static paragraph(...e){return{type:te.PARAGRAPH,...this.textBlock(e)}}static textBlock(e){const{attrs:t,content:r,marks:i}=this.normalizeTextBlockArgs(e);return{content:typeof r=="string"?[this.text(r)]:[r].flat(),...t?{attrs:t}:{},...i?{marks:i}:{}}}static normalizeTextBlockArgs(e){return e.length===1?{attrs:null,marks:null,content:e[0]}:e.length===2?{attrs:e[0],marks:null,content:e[1]}:{attrs:e[0],marks:e[1],content:e[2]}}static text(e,t){return{type:te.TEXT,...t?{marks:t}:{},text:e}}static link(e,t,r=[]){return this.text(e,[this.mark(Ee.LINK,t),...r])}static mark(e,t){return{type:e,attrs:t}}static populateAllDevices(e){return{mobile:e,tablet:e,desktop:e}}}class KO{_baseClass;_makeVariable;_linkPresetId;constructor({baseClass:e,makeVariable:t,linkPresetId:r}){this._baseClass=e,this._makeVariable=t,this._linkPresetId=r}inject(e,t){let r=e.querySelector("[data-zw-styles]");r||(r=Pi.document.createElement("style"),r.dataset.zwStyles="",r.innerHTML=this.render(t),e.append(r))}render(e){let t="";for(const r of e){const i=r.id===this._linkPresetId,o=this.makePresetCssClass(r);t+=` ${o} {`;for(const a of jM)for(const c of Object.keys(r[a])){const f=this._makeVariable({device:a,preset:r,property:c}),h=this._makeInternalVariableName(c,a);if(t+=`${h}: var(${f}, inherit);`,i&&!j0.includes(c)){const m=h.replace("preset-","");t+=`${m}: var(${h});`}}t+="}"}return t}_makeInternalVariableName(e,t){const r=e==="color"?"font-color":e.replace(/_/i,"-"),i=t===Dn.COMMON?"":`-${t}`;return`--zw-preset-${r}${i}`}makePresetHtmlClass(e){return this._baseClass+e.id}makePresetCssClass(e){return this.makePresetHtmlClass(e).split(" ").map(t=>`.${t}`).join("")}}class yh{static _instance;static get instance(){return this._instance??=new yh,this._instance}static query(e,t){return this.instance.query(e,t)}query(e,t){let r=null;return e.descendants(i=>{if(r)return!1;if(this.matchNode(i,t))return r=i,!1}),r?t.getMark?this.getMark(r,t.getMark):r:null}matchNode(e,t){return!(t.typeName&&t.typeName!==e.type.name||t.mark&&!this.getMark(e,t.mark))}getMark(e,t){return e.marks.find(r=>this.matchMark(r,t))||null}matchMark(e,t){return e.type.name===t.typeName}}class GO{static createWindow(){return new jp.JSDOM().window}types;parse(e){const{window:t}=new jp.JSDOM(e);return this.types=t,t.document}}exports.ContentSerializer=gh,exports.ContextWindow=Pi,exports.NodeDomParser=GO;