@zipify/wysiwyg 4.11.1 → 4.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/node.js CHANGED
@@ -1,39 +1,43 @@
1
- "use strict";var jp=require("jsdom");function uk(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const as=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const di=()=>{},fk=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),ir=Object.assign,hk=Object.prototype.hasOwnProperty,nu=(n,e)=>hk.call(n,e),Le=Array.isArray,pi=n=>Ho(n)==="[object Map]",dk=n=>Ho(n)==="[object Set]",Ye=n=>typeof n=="function",In=n=>typeof n=="string",cs=n=>typeof n=="symbol",dt=n=>n!==null&&typeof n=="object",pk=n=>(dt(n)||Ye(n))&&Ye(n.then)&&Ye(n.catch),mk=Object.prototype.toString,Ho=n=>mk.call(n),Yp=n=>Ho(n).slice(8,-1),gk=n=>Ho(n)==="[object Object]",ru=n=>In(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,yk=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},bk=yk(n=>n.charAt(0).toUpperCase()+n.slice(1)),sr=(n,e)=>!Object.is(n,e);let Xp;const $o=()=>Xp||(Xp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function iu(n){if(Le(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],i=In(r)?xk(r):iu(r);if(i)for(const o in i)e[o]=i[o]}return e}else if(In(n)||dt(n))return n}const wk=/;(?![^(]*\))/g,vk=/:([^]+)/,Sk=/\/\*[^]*?\*\//g;function xk(n){const e={};return n.replace(Sk,"").split(wk).forEach(t=>{if(t){const r=t.split(vk);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function su(n){let e="";if(In(n))e=n;else if(Le(n))for(let t=0;t<n.length;t++){const r=su(n[t]);r&&(e+=r+" ")}else if(dt(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}function Nn(n,...e){console.warn(`[Vue warn] ${n}`,...e)}let ye;const ou=new WeakSet;class kk{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,ou.has(this)&&(ou.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&&Nn("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)uu(e);this.deps=this.depsTail=void 0,im(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ou.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){cu(this)&&this.run()}get dirty(){return cu(this)}}let Zp=0,us,fs;function Qp(n,e=!1){if(n.flags|=8,e){n.next=fs,fs=n;return}n.next=us,us=n}function lu(){Zp++}function au(){if(--Zp>0)return;if(fs){let e=fs;for(fs=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;us;){let e=us;for(us=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),uu(r),Ek(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=e,n.depsTail=t}function cu(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===hs))return;n.globalVersion=hs;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!cu(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||sr(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 uu(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)uu(o,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function Ek(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 Wo(){rm.push(Qt),Qt=!1}function Uo(){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 hs=0,_k=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 fu{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 _k(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(ir({effect:ye},e)),t}trigger(e){this.version++,hs++,this.notify(e)}notify(e){lu();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(ir({effect:t.sub},e));for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{au()}}}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 Vo=new WeakMap,Lr=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),hu=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),ds=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function pt(n,e,t){if(Qt&&ye){let r=Vo.get(n);r||Vo.set(n,r=new Map);let i=r.get(t);i||(r.set(t,i=new fu),i.map=r,i.key=t),process.env.NODE_ENV!=="production"?i.track({target:n,type:e,key:t}):i.track()}}function or(n,e,t,r,i,o){const a=Vo.get(n);if(!a){hs++;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(lu(),e==="clear")a.forEach(c);else{const f=Le(n),h=f&&ru(t);if(f&&t==="length"){const m=Number(r);a.forEach((p,g)=>{(g==="length"||g===ds||!cs(g)&&g>=m)&&c(p)})}else switch((t!==void 0||a.has(void 0))&&c(a.get(t)),h&&c(a.get(ds)),e){case"add":f?h&&c(a.get("length")):(c(a.get(Lr)),pi(n)&&c(a.get(hu)));break;case"delete":f||(c(a.get(Lr)),pi(n)&&c(a.get(hu)));break;case"set":pi(n)&&c(a.get(Lr));break}}au()}function Ck(n,e){const t=Vo.get(n);return t&&t.get(e)}function mi(n){const e=le(n);return e===n?e:(pt(e,"iterate",ds),mt(n)?e:e.map(it))}function du(n){return pt(n=le(n),"iterate",ds),n}const Tk={__proto__:null,[Symbol.iterator](){return pu(this,Symbol.iterator,it)},concat(...n){return mi(this).concat(...n.map(e=>Le(e)?mi(e):e))},entries(){return pu(this,"entries",n=>(n[1]=it(n[1]),n))},every(n,e){return On(this,"every",n,e,void 0,arguments)},filter(n,e){return On(this,"filter",n,e,t=>t.map(it),arguments)},find(n,e){return On(this,"find",n,e,it,arguments)},findIndex(n,e){return On(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return On(this,"findLast",n,e,it,arguments)},findLastIndex(n,e){return On(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return On(this,"forEach",n,e,void 0,arguments)},includes(...n){return mu(this,"includes",n)},indexOf(...n){return mu(this,"indexOf",n)},join(n){return mi(this).join(n)},lastIndexOf(...n){return mu(this,"lastIndexOf",n)},map(n,e){return On(this,"map",n,e,void 0,arguments)},pop(){return ps(this,"pop")},push(...n){return ps(this,"push",n)},reduce(n,...e){return om(this,"reduce",n,e)},reduceRight(n,...e){return om(this,"reduceRight",n,e)},shift(){return ps(this,"shift")},some(n,e){return On(this,"some",n,e,void 0,arguments)},splice(...n){return ps(this,"splice",n)},toReversed(){return mi(this).toReversed()},toSorted(n){return mi(this).toSorted(n)},toSpliced(...n){return mi(this).toSpliced(...n)},unshift(...n){return ps(this,"unshift",n)},values(){return pu(this,"values",it)}};function pu(n,e,t){const r=du(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 Mk=Array.prototype;function On(n,e,t,r,i,o){const a=du(n),c=a!==n&&!mt(n),f=a[e];if(f!==Mk[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=du(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 mu(n,e,t){const r=le(n);pt(r,"iterate",ds);const i=r[e](...t);return(i===-1||i===!1)&&Jo(t[0])?(t[0]=le(t[0]),r[e](...t)):i}function ps(n,e,t=[]){Wo(),lu();const r=le(n)[e].apply(n,t);return au(),Uo(),r}const Ak=uk("__proto__,__v_isRef,__isVue"),lm=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(cs));function Ik(n){cs(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?Hk:hm:o?Fk:fm).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const a=Le(e);if(!i){let f;if(a&&(f=Tk[t]))return f;if(t==="hasOwnProperty")return Ik}const c=Reflect.get(e,t,st(e)?e:r);return(cs(t)?lm.has(t):Ak(t))||(i||pt(e,"get",t),o)?c:st(c)?a&&ru(t)?c:c.value:dt(c)?i?dm(c):yu(c):c}}class Nk 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)&&ru(t)?Number(t)<e.length:nu(e,t),c=Reflect.set(e,t,r,st(e)?e:i);return e===le(i)&&(a?sr(r,o)&&or(e,"set",t,r,o):or(e,"add",t,r)),c}deleteProperty(e,t){const r=nu(e,t),i=e[t],o=Reflect.deleteProperty(e,t);return o&&r&&or(e,"delete",t,void 0,i),o}has(e,t){const r=Reflect.has(e,t);return(!cs(t)||!lm.has(t))&&pt(e,"has",t),r}ownKeys(e){return pt(e,"iterate",Le(e)?"length":Lr),Reflect.ownKeys(e)}}class Ok extends am{constructor(e=!1){super(!0,e)}set(e,t){return process.env.NODE_ENV!=="production"&&Nn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return process.env.NODE_ENV!=="production"&&Nn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}}const Rk=new Nk,Lk=new Ok,gu=n=>n,Ko=n=>Reflect.getPrototypeOf(n);function Pk(n,e,t){return function(...r){const i=this.__v_raw,o=le(i),a=pi(o),c=n==="entries"||n===Symbol.iterator&&a,f=n==="keys"&&a,h=i[n](...r),m=t?gu:e?bu:it;return!e&&pt(o,"iterate",f?hu:Lr),{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 Go(n){return function(...e){if(process.env.NODE_ENV!=="production"){const t=e[0]?`on key "${e[0]}" `:"";Nn(`${bk(n)} operation ${t}failed: target is readonly.`,le(this))}return n==="delete"?!1:n==="clear"?void 0:this}}function Dk(n,e){const t={get(i){const o=this.__v_raw,a=le(o),c=le(i);n||(sr(i,c)&&pt(a,"get",i),pt(a,"get",c));const{has:f}=Ko(a),h=e?gu:n?bu: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",Lr),Reflect.get(i,"size",i)},has(i){const o=this.__v_raw,a=le(o),c=le(i);return n||(sr(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?gu:n?bu:it;return!n&&pt(f,"iterate",Lr),c.forEach((m,p)=>i.call(o,h(m),h(p),a))}};return ir(t,n?{add:Go("add"),set:Go("set"),delete:Go("delete"),clear:Go("clear")}:{add(i){!e&&!mt(i)&&!Rn(i)&&(i=le(i));const o=le(this);return Ko(o).has.call(o,i)||(o.add(i),or(o,"add",i,i)),this},set(i,o){!e&&!mt(o)&&!Rn(o)&&(o=le(o));const a=le(this),{has:c,get:f}=Ko(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?sr(o,m)&&or(a,"set",i,o,m):or(a,"add",i,o),this},delete(i){const o=le(this),{has:a,get:c}=Ko(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&&or(o,"delete",i,void 0,h),m},clear(){const i=le(this),o=i.size!==0,a=process.env.NODE_ENV!=="production"?pi(i)?new Map(i):new Set(i):void 0,c=i.clear();return o&&or(i,"clear",void 0,void 0,a),c}}),["keys","values","entries",Symbol.iterator].forEach(i=>{t[i]=Pk(i,n,e)}),t}function cm(n,e){const t=Dk(n,e);return(r,i,o)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(nu(t,i)&&i in r?t:r,i,o)}const Bk={get:cm(!1,!1)},zk={get:cm(!0,!1)};function um(n,e,t){const r=le(t);if(r!==t&&e.call(n,r)){const i=Yp(n);Nn(`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,Fk=new WeakMap,hm=new WeakMap,Hk=new WeakMap;function $k(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Wk(n){return n.__v_skip||!Object.isExtensible(n)?0:$k(Yp(n))}function yu(n){return Rn(n)?n:pm(n,!1,Rk,Bk,fm)}function dm(n){return pm(n,!0,Lk,zk,hm)}function pm(n,e,t,r,i){if(!dt(n))return process.env.NODE_ENV!=="production"&&Nn(`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=Wk(n);if(a===0)return n;const c=new Proxy(n,a===2?r:t);return i.set(n,c),c}function ms(n){return Rn(n)?ms(n.__v_raw):!!(n&&n.__v_isReactive)}function Rn(n){return!!(n&&n.__v_isReadonly)}function mt(n){return!!(n&&n.__v_isShallow)}function Jo(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)?yu(n):n,bu=n=>dt(n)?dm(n):n;function st(n){return n?n.__v_isRef===!0:!1}function qo(n){return Uk(n,!1)}function Uk(n,e){return st(n)?n:new Vk(n,e)}class Vk{constructor(e,t){this.dep=new fu,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),sr(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 Kk{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 Ck(le(this._object),this._key)}}class Gk{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 gi(n,e,t){return st(n)?n:Ye(n)?new Gk(n):dt(n)&&arguments.length>1?Jk(n,e,t):qo(n)}function Jk(n,e,t){const r=n[e];return st(r)?r:new Kk(n,e,t)}class qk{constructor(e,t,r){this.fn=e,this.setter=t,this._value=void 0,this.dep=new fu(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=hs-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"&&Nn("Write operation failed: computed value is readonly")}}function jk(n,e,t=!1){let r,i;Ye(n)?r=n:(r=n.get,i=n.set);const o=new qk(r,i,t);return process.env.NODE_ENV,o}const jo={},Yo=new WeakMap;let Pr;function Yk(n,e=!1,t=Pr){if(t){let r=Yo.get(t);r||Yo.set(t,r=[]),r.push(n)}else process.env.NODE_ENV!=="production"&&!e&&Nn("onWatcherCleanup() was called when there was no active watcher to associate with.")}function Xk(n,e,t=as){const{immediate:r,deep:i,once:o,scheduler:a,augmentJob:c,call:f}=t,h=$=>{(t.onWarn||Nn)("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?lr($,1):lr($);let p,g,b,S,k=!1,T=!1;if(st(n)?(g=()=>n.value,k=mt(n)):ms(n)?(g=()=>m(n),k=!0):Le(n)?(T=!0,k=n.some($=>ms($)||mt($)),g=()=>n.map($=>{if(st($))return $.value;if(ms($))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){Wo();try{b()}finally{Uo()}}const $=Pr;Pr=p;try{return f?f(n,3,[S]):n(S)}finally{Pr=$}}:(g=di,process.env.NODE_ENV!=="production"&&h(n)),e&&i){const $=g,U=i===!0?1/0:i;g=()=>lr($(),U)}const M=()=>{p.stop()};if(o&&e){const $=e;e=(...U)=>{$(...U),M()}}let P=T?new Array(n.length).fill(jo):jo;const F=$=>{if(!(!(p.flags&1)||!p.dirty&&!$))if(e){const U=p.run();if(i||k||(T?U.some((ue,he)=>sr(ue,P[he])):sr(U,P))){b&&b();const ue=Pr;Pr=p;try{const he=[U,P===jo?void 0:T&&P[0]===jo?[]:P,S];f?f(e,3,he):e(...he),P=U}finally{Pr=ue}}}else p.run()};return c&&c(F),p=new kk(g),p.scheduler=a?()=>a(F,!1):F,S=$=>Yk($,!1,p),b=p.onStop=()=>{const $=Yo.get(p);if($){if(f)f($,4);else for(const U of $)U();Yo.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 lr(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))lr(n.value,e,t);else if(Le(n))for(let r=0;r<n.length;r++)lr(n[r],e,t);else if(dk(n)||pi(n))n.forEach(r=>{lr(r,e,t)});else if(gk(n)){for(const r in n)lr(n[r],e,t);for(const r of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,r)&&lr(n[r],e,t)}return n}const Dr=[];function Zk(n){Dr.push(n)}function Qk(){Dr.pop()}let wu=!1;function ot(n,...e){if(wu)return;wu=!0,Wo();const t=Dr.length?Dr[Dr.length-1].component:null,r=t&&t.appContext.config.warnHandler,i=eE();if(r)Xo(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 <${Om(t,o.type)}>`).join(`
1
+ "use strict";var Nm=require("jsdom");function dE(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const _s=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const xi=()=>{},hE=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),ar=Object.assign,pE=Object.prototype.hasOwnProperty,ku=(n,e)=>pE.call(n,e),Le=Array.isArray,Ei=n=>tl(n)==="[object Map]",mE=n=>tl(n)==="[object Set]",Ye=n=>typeof n=="function",Rn=n=>typeof n=="string",xs=n=>typeof n=="symbol",pt=n=>n!==null&&typeof n=="object",gE=n=>(pt(n)||Ye(n))&&Ye(n.then)&&Ye(n.catch),yE=Object.prototype.toString,tl=n=>yE.call(n),Om=n=>tl(n).slice(8,-1),bE=n=>tl(n)==="[object Object]",Cu=n=>Rn(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,wE=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},SE=wE(n=>n.charAt(0).toUpperCase()+n.slice(1)),cr=(n,e)=>!Object.is(n,e);let Rm;const nl=()=>Rm||(Rm=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Tu(n){if(Le(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],i=Rn(r)?EE(r):Tu(r);if(i)for(const o in i)e[o]=i[o]}return e}else if(Rn(n)||pt(n))return n}const vE=/;(?![^(]*\))/g,_E=/:([^]+)/,xE=/\/\*[^]*?\*\//g;function EE(n){const e={};return n.replace(xE,"").split(vE).forEach(t=>{if(t){const r=t.split(_E);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function Mu(n){let e="";if(Rn(n))e=n;else if(Le(n))for(let t=0;t<n.length;t++){const r=Mu(n[t]);r&&(e+=r+" ")}else if(pt(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}function Ln(n,...e){console.warn(`[Vue warn] ${n}`,...e)}let ye;const Au=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,Au.has(this)&&(Au.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Pm(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,$m(this),Dm(this);const e=ye,t=tn;ye=this,tn=!0;try{return this.fn()}finally{process.env.NODE_ENV!=="production"&&ye!==this&&Ln("Active effect was not restored correctly - this is likely a Vue internal bug."),Fm(this),ye=e,tn=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Ru(e);this.deps=this.depsTail=void 0,$m(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Au.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ou(this)&&this.run()}get dirty(){return Ou(this)}}let Lm=0,Es,ks;function Pm(n,e=!1){if(n.flags|=8,e){n.next=ks,ks=n;return}n.next=Es,Es=n}function Iu(){Lm++}function Nu(){if(--Lm>0)return;if(ks){let e=ks;for(ks=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;Es;){let e=Es;for(Es=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 Dm(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Fm(n){let e,t=n.depsTail,r=t;for(;r;){const i=r.prevDep;r.version===-1?(r===t&&(t=i),Ru(r),CE(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=e,n.depsTail=t}function Ou(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(zm(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function zm(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===Cs))return;n.globalVersion=Cs;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!Ou(n)){n.flags&=-3;return}const t=ye,r=tn;ye=n,tn=!0;try{Dm(n);const i=n.fn(n._value);(e.version===0||cr(i,n._value))&&(n._value=i,e.version++)}catch(i){throw e.version++,i}finally{ye=t,tn=r,Fm(n),n.flags&=-3}}function Ru(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)Ru(o,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function CE(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let tn=!0;const Bm=[];function rl(){Bm.push(tn),tn=!1}function il(){const n=Bm.pop();tn=n===void 0?!0:n}function $m(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=ye;ye=void 0;try{e()}finally{ye=t}}}let Cs=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 Lu{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||!tn||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,Hm(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(ar({effect:ye},e)),t}trigger(e){this.version++,Cs++,this.notify(e)}notify(e){Iu();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(ar({effect:t.sub},e));for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{Nu()}}}function Hm(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)Hm(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 sl=new WeakMap,$r=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),Pu=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),Ts=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function mt(n,e,t){if(tn&&ye){let r=sl.get(n);r||sl.set(n,r=new Map);let i=r.get(t);i||(r.set(t,i=new Lu),i.map=r,i.key=t),process.env.NODE_ENV!=="production"?i.track({target:n,type:e,key:t}):i.track()}}function ur(n,e,t,r,i,o){const a=sl.get(n);if(!a){Cs++;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(Iu(),e==="clear")a.forEach(c);else{const f=Le(n),d=f&&Cu(t);if(f&&t==="length"){const m=Number(r);a.forEach((h,g)=>{(g==="length"||g===Ts||!xs(g)&&g>=m)&&c(h)})}else switch((t!==void 0||a.has(void 0))&&c(a.get(t)),d&&c(a.get(Ts)),e){case"add":f?d&&c(a.get("length")):(c(a.get($r)),Ei(n)&&c(a.get(Pu)));break;case"delete":f||(c(a.get($r)),Ei(n)&&c(a.get(Pu)));break;case"set":Ei(n)&&c(a.get($r));break}}Nu()}function ME(n,e){const t=sl.get(n);return t&&t.get(e)}function ki(n){const e=le(n);return e===n?e:(mt(e,"iterate",Ts),gt(n)?e:e.map(it))}function Du(n){return mt(n=le(n),"iterate",Ts),n}const AE={__proto__:null,[Symbol.iterator](){return Fu(this,Symbol.iterator,it)},concat(...n){return ki(this).concat(...n.map(e=>Le(e)?ki(e):e))},entries(){return Fu(this,"entries",n=>(n[1]=it(n[1]),n))},every(n,e){return Pn(this,"every",n,e,void 0,arguments)},filter(n,e){return Pn(this,"filter",n,e,t=>t.map(it),arguments)},find(n,e){return Pn(this,"find",n,e,it,arguments)},findIndex(n,e){return Pn(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return Pn(this,"findLast",n,e,it,arguments)},findLastIndex(n,e){return Pn(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return Pn(this,"forEach",n,e,void 0,arguments)},includes(...n){return zu(this,"includes",n)},indexOf(...n){return zu(this,"indexOf",n)},join(n){return ki(this).join(n)},lastIndexOf(...n){return zu(this,"lastIndexOf",n)},map(n,e){return Pn(this,"map",n,e,void 0,arguments)},pop(){return Ms(this,"pop")},push(...n){return Ms(this,"push",n)},reduce(n,...e){return Wm(this,"reduce",n,e)},reduceRight(n,...e){return Wm(this,"reduceRight",n,e)},shift(){return Ms(this,"shift")},some(n,e){return Pn(this,"some",n,e,void 0,arguments)},splice(...n){return Ms(this,"splice",n)},toReversed(){return ki(this).toReversed()},toSorted(n){return ki(this).toSorted(n)},toSpliced(...n){return ki(this).toSpliced(...n)},unshift(...n){return Ms(this,"unshift",n)},values(){return Fu(this,"values",it)}};function Fu(n,e,t){const r=Du(n),i=r[e]();return r!==n&&!gt(n)&&(i._next=i.next,i.next=()=>{const o=i._next();return o.value&&(o.value=t(o.value)),o}),i}const IE=Array.prototype;function Pn(n,e,t,r,i,o){const a=Du(n),c=a!==n&&!gt(n),f=a[e];if(f!==IE[e]){const h=f.apply(n,o);return c?it(h):h}let d=t;a!==n&&(c?d=function(h,g){return t.call(this,it(h),g,n)}:t.length>2&&(d=function(h,g){return t.call(this,h,g,n)}));const m=f.call(a,d,r);return c&&i?i(m):m}function Wm(n,e,t,r){const i=Du(n);let o=t;return i!==n&&(gt(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 zu(n,e,t){const r=le(n);mt(r,"iterate",Ts);const i=r[e](...t);return(i===-1||i===!1)&&al(t[0])?(t[0]=le(t[0]),r[e](...t)):i}function Ms(n,e,t=[]){rl(),Iu();const r=le(n)[e].apply(n,t);return Nu(),il(),r}const NE=dE("__proto__,__v_isRef,__isVue"),Vm=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(xs));function OE(n){xs(n)||(n=String(n));const e=le(this);return mt(e,"has",n),e.hasOwnProperty(n)}class Um{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?WE:qm:o?HE:Gm).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const a=Le(e);if(!i){let f;if(a&&(f=AE[t]))return f;if(t==="hasOwnProperty")return OE}const c=Reflect.get(e,t,st(e)?e:r);return(xs(t)?Vm.has(t):NE(t))||(i||mt(e,"get",t),o)?c:st(c)?a&&Cu(t)?c:c.value:pt(c)?i?jm(c):$u(c):c}}class RE extends Um{constructor(e=!1){super(!1,e)}set(e,t,r,i){let o=e[t];if(!this._isShallow){const f=Dn(o);if(!gt(r)&&!Dn(r)&&(o=le(o),r=le(r)),!Le(e)&&st(o)&&!st(r))return f?!1:(o.value=r,!0)}const a=Le(e)&&Cu(t)?Number(t)<e.length:ku(e,t),c=Reflect.set(e,t,r,st(e)?e:i);return e===le(i)&&(a?cr(r,o)&&ur(e,"set",t,r,o):ur(e,"add",t,r)),c}deleteProperty(e,t){const r=ku(e,t),i=e[t],o=Reflect.deleteProperty(e,t);return o&&r&&ur(e,"delete",t,void 0,i),o}has(e,t){const r=Reflect.has(e,t);return(!xs(t)||!Vm.has(t))&&mt(e,"has",t),r}ownKeys(e){return mt(e,"iterate",Le(e)?"length":$r),Reflect.ownKeys(e)}}class LE extends Um{constructor(e=!1){super(!0,e)}set(e,t){return process.env.NODE_ENV!=="production"&&Ln(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return process.env.NODE_ENV!=="production"&&Ln(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}}const PE=new RE,DE=new LE,Bu=n=>n,ol=n=>Reflect.getPrototypeOf(n);function FE(n,e,t){return function(...r){const i=this.__v_raw,o=le(i),a=Ei(o),c=n==="entries"||n===Symbol.iterator&&a,f=n==="keys"&&a,d=i[n](...r),m=t?Bu:e?Hu:it;return!e&&mt(o,"iterate",f?Pu:$r),{next(){const{value:h,done:g}=d.next();return g?{value:h,done:g}:{value:c?[m(h[0]),m(h[1])]:m(h),done:g}},[Symbol.iterator](){return this}}}}function ll(n){return function(...e){if(process.env.NODE_ENV!=="production"){const t=e[0]?`on key "${e[0]}" `:"";Ln(`${SE(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||(cr(i,c)&&mt(a,"get",i),mt(a,"get",c));const{has:f}=ol(a),d=e?Bu:n?Hu:it;if(f.call(a,i))return d(o.get(i));if(f.call(a,c))return d(o.get(c));o!==a&&o.get(i)},get size(){const i=this.__v_raw;return!n&&mt(le(i),"iterate",$r),Reflect.get(i,"size",i)},has(i){const o=this.__v_raw,a=le(o),c=le(i);return n||(cr(i,c)&&mt(a,"has",i),mt(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),d=e?Bu:n?Hu:it;return!n&&mt(f,"iterate",$r),c.forEach((m,h)=>i.call(o,d(m),d(h),a))}};return ar(t,n?{add:ll("add"),set:ll("set"),delete:ll("delete"),clear:ll("clear")}:{add(i){!e&&!gt(i)&&!Dn(i)&&(i=le(i));const o=le(this);return ol(o).has.call(o,i)||(o.add(i),ur(o,"add",i,i)),this},set(i,o){!e&&!gt(o)&&!Dn(o)&&(o=le(o));const a=le(this),{has:c,get:f}=ol(a);let d=c.call(a,i);d?process.env.NODE_ENV!=="production"&&Jm(a,c,i):(i=le(i),d=c.call(a,i));const m=f.call(a,i);return a.set(i,o),d?cr(o,m)&&ur(a,"set",i,o,m):ur(a,"add",i,o),this},delete(i){const o=le(this),{has:a,get:c}=ol(o);let f=a.call(o,i);f?process.env.NODE_ENV!=="production"&&Jm(o,a,i):(i=le(i),f=a.call(o,i));const d=c?c.call(o,i):void 0,m=o.delete(i);return f&&ur(o,"delete",i,void 0,d),m},clear(){const i=le(this),o=i.size!==0,a=process.env.NODE_ENV!=="production"?Ei(i)?new Map(i):new Set(i):void 0,c=i.clear();return o&&ur(i,"clear",void 0,void 0,a),c}}),["keys","values","entries",Symbol.iterator].forEach(i=>{t[i]=FE(i,n,e)}),t}function Km(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(ku(t,i)&&i in r?t:r,i,o)}const BE={get:Km(!1,!1)},$E={get:Km(!0,!1)};function Jm(n,e,t){const r=le(t);if(r!==t&&e.call(n,r)){const i=Om(n);Ln(`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 Gm=new WeakMap,HE=new WeakMap,qm=new WeakMap,WE=new WeakMap;function VE(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:VE(Om(n))}function $u(n){return Dn(n)?n:Ym(n,!1,PE,BE,Gm)}function jm(n){return Ym(n,!0,DE,$E,qm)}function Ym(n,e,t,r,i){if(!pt(n))return process.env.NODE_ENV!=="production"&&Ln(`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 As(n){return Dn(n)?As(n.__v_raw):!!(n&&n.__v_isReactive)}function Dn(n){return!!(n&&n.__v_isReadonly)}function gt(n){return!!(n&&n.__v_isShallow)}function al(n){return n?!!n.__v_raw:!1}function le(n){const e=n&&n.__v_raw;return e?le(e):n}const it=n=>pt(n)?$u(n):n,Hu=n=>pt(n)?jm(n):n;function st(n){return n?n.__v_isRef===!0:!1}function cl(n){return KE(n,!1)}function KE(n,e){return st(n)?n:new JE(n,e)}class JE{constructor(e,t){this.dep=new Lu,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||gt(e)||Dn(e);e=r?e:le(e),cr(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 F(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 ME(le(this._object),this._key)}}class qE{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 Ci(n,e,t){return st(n)?n:Ye(n)?new qE(n):pt(n)&&arguments.length>1?jE(n,e,t):cl(n)}function jE(n,e,t){const r=n[e];return st(r)?r:new GE(n,e,t)}class YE{constructor(e,t,r){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Lu(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Cs-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 Pm(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 zm(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter?this.setter(e):process.env.NODE_ENV!=="production"&&Ln("Write operation failed: computed value is readonly")}}function XE(n,e,t=!1){let r,i;Ye(n)?r=n:(r=n.get,i=n.set);const o=new YE(r,i,t);return process.env.NODE_ENV,o}const ul={},fl=new WeakMap;let Hr;function ZE(n,e=!1,t=Hr){if(t){let r=fl.get(t);r||fl.set(t,r=[]),r.push(n)}else process.env.NODE_ENV!=="production"&&!e&&Ln("onWatcherCleanup() was called when there was no active watcher to associate with.")}function QE(n,e,t=_s){const{immediate:r,deep:i,once:o,scheduler:a,augmentJob:c,call:f}=t,d=H=>{(t.onWarn||Ln)("Invalid watch source: ",H,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},m=H=>i?H:gt(H)||i===!1||i===0?fr(H,1):fr(H);let h,g,b,v,x=!1,T=!1;if(st(n)?(g=()=>n.value,x=gt(n)):As(n)?(g=()=>m(n),x=!0):Le(n)?(T=!0,x=n.some(H=>As(H)||gt(H)),g=()=>n.map(H=>{if(st(H))return H.value;if(As(H))return m(H);if(Ye(H))return f?f(H,2):H();process.env.NODE_ENV!=="production"&&d(H)})):Ye(n)?e?g=f?()=>f(n,2):n:g=()=>{if(b){rl();try{b()}finally{il()}}const H=Hr;Hr=h;try{return f?f(n,3,[v]):n(v)}finally{Hr=H}}:(g=xi,process.env.NODE_ENV!=="production"&&d(n)),e&&i){const H=g,V=i===!0?1/0:i;g=()=>fr(H(),V)}const M=()=>{h.stop()};if(o&&e){const H=e;e=(...V)=>{H(...V),M()}}let L=T?new Array(n.length).fill(ul):ul;const B=H=>{if(!(!(h.flags&1)||!h.dirty&&!H))if(e){const V=h.run();if(i||x||(T?V.some((ue,de)=>cr(ue,L[de])):cr(V,L))){b&&b();const ue=Hr;Hr=h;try{const de=[V,L===ul?void 0:T&&L[0]===ul?[]:L,v];f?f(e,3,de):e(...de),L=V}finally{Hr=ue}}}else h.run()};return c&&c(B),h=new kE(g),h.scheduler=a?()=>a(B,!1):B,v=H=>ZE(H,!1,h),b=h.onStop=()=>{const H=fl.get(h);if(H){if(f)f(H,4);else for(const V of H)V();fl.delete(h)}},process.env.NODE_ENV!=="production"&&(h.onTrack=t.onTrack,h.onTrigger=t.onTrigger),e?r?B(!0):L=h.run():a?a(B.bind(null,!0),!0):h.run(),M.pause=h.pause.bind(h),M.resume=h.resume.bind(h),M.stop=M,M}function fr(n,e=1/0,t){if(e<=0||!pt(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,st(n))fr(n.value,e,t);else if(Le(n))for(let r=0;r<n.length;r++)fr(n[r],e,t);else if(mE(n)||Ei(n))n.forEach(r=>{fr(r,e,t)});else if(bE(n)){for(const r in n)fr(n[r],e,t);for(const r of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,r)&&fr(n[r],e,t)}return n}const Wr=[];function ek(n){Wr.push(n)}function tk(){Wr.pop()}let Wu=!1;function ot(n,...e){if(Wu)return;Wu=!0,rl();const t=Wr.length?Wr[Wr.length-1].component:null,r=t&&t.appContext.config.warnHandler,i=nk();if(r)dl(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 <${pg(t,o.type)}>`).join(`
2
2
  `),i]);else{const o=[`[Vue warn]: ${n}`,...e];i.length&&o.push(`
3
- `,...tE(i)),console.warn(...o)}Uo(),wu=!1}function eE(){let n=Dr[Dr.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 tE(n){const e=[];return n.forEach((t,r)=>{e.push(...r===0?[]:[`
4
- `],...nE(t))}),e}function nE({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",r=n.component?n.component.parent==null:!1,i=` at <${Om(n.component,n.type,r)}`,o=">"+t;return n.props?[i,...rE(n.props),o]:[i+o]}function rE(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 Xo(n,e,t,r){try{return r?n(...r):n()}catch(i){vu(i,e,t)}}function ym(n,e,t,r){if(Ye(n)){const i=Xo(n,e,t,r);return i&&pk(i)&&i.catch(o=>{vu(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 vu(n,e,t,r=!0){const i=e?e.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:a}=e&&e.appContext.config||as;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){Wo(),Xo(o,null,10,[n,f,h]),Uo();return}}iE(n,t,i,r,a)}function iE(n,e,t,r=!0,i=!1){if(process.env.NODE_ENV!=="production"){const o=gm[e];if(t&&Zk(t),ot(`Unhandled error${o?` during execution of ${o}`:""}`),t&&Qk(),r)throw n;console.error(n)}else{if(i)throw n;console.error(n)}}const Ht=[];let Ln=-1;const yi=[];let ar=null,bi=0;const sE=Promise.resolve();let Su=null;const oE=100;function lE(n){let e=Ln+1,t=Ht.length;for(;e<t;){const r=e+t>>>1,i=Ht[r],o=gs(i);o<n||o===n&&i.flags&2?e=r+1:t=r}return e}function bm(n){if(!(n.flags&1)){const e=gs(n),t=Ht[Ht.length-1];!t||!(n.flags&2)&&e>=gs(t)?Ht.push(n):Ht.splice(lE(e),0,n),n.flags|=1,wm()}}function wm(){Su||(Su=sE.then(Sm))}function vm(n){Le(n)?yi.push(...n):ar&&n.id===-1?ar.splice(bi+1,0,n):n.flags&1||(yi.push(n),n.flags|=1),wm()}function aE(n){if(yi.length){const e=[...new Set(yi)].sort((t,r)=>gs(t)-gs(r));if(yi.length=0,ar){ar.push(...e);return}for(ar=e,process.env.NODE_ENV!=="production"&&(n=n||new Map),bi=0;bi<ar.length;bi++){const t=ar[bi];process.env.NODE_ENV!=="production"&&xm(n,t)||(t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2)}ar=null,bi=0}}const gs=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):di;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),Xo(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,aE(n),Su=null,(Ht.length||yi.length)&&Sm(n)}}function xm(n,e){const t=n.get(e)||0;if(t>oE){const r=e.i,i=r&&Nm(r.type);return vu(`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 xu=new Map;process.env.NODE_ENV!=="production"&&($o().__VUE_HMR_RUNTIME__={createRecord:ku(cE),rerender:ku(uE),reload:ku(fE)});const Zo=new Map;function cE(n,e){return Zo.has(n)?!1:(Zo.set(n,{initialDef:Qo(e),instances:new Set}),!0)}function Qo(n){return Rm(n)?n.__vccOpts:n}function uE(n,e){const t=Zo.get(n);t&&(t.initialDef.render=e,[...t.instances].forEach(r=>{e&&(r.render=e,Qo(r.type).render=e),r.renderCache=[],r.update()}))}function fE(n,e){const t=Zo.get(n);if(!t)return;e=Qo(e),km(t.initialDef,e);const r=[...t.instances];for(let i=0;i<r.length;i++){const o=r[i],a=Qo(o.type);let c=xu.get(a);c||(a!==t.initialDef&&km(a,e),xu.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)}vm(()=>{xu.clear()})}function km(n,e){ir(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,el=[];function Em(n,e){var t,r;wi=n,wi?(wi.enabled=!0,el.forEach(({event:i,args:o})=>wi.emit(i,...o)),el=[]):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=>{Em(o,e)}),setTimeout(()=>{wi||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,el=[])},3e3)):el=[]}let vi=null,hE=null;const dE=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}$o().requestIdleCallback,$o().cancelIdleCallback;const pE=Symbol.for("v-ndc"),mE={};process.env.NODE_ENV!=="production"&&(mE.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 gE=null;function yE(n,e,t=!1){const r=rl||vi;if(r||gE){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 bE={},Cm=n=>Object.getPrototypeOf(n)===bE,wE=_E,vE=Symbol.for("v-scx"),SE=()=>{{const n=yE(vE);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 xE(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."),kE(n,e,t)}function kE(n,e,t=as){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=ir({},t);process.env.NODE_ENV!=="production"&&(c.onWarn=ot);const f=e&&r||!e&&o!=="post";let h;if(il){if(o==="sync"){const b=SE();h=b.__watcherHandles||(b.__watcherHandles=[])}else if(!f){const b=()=>{};return b.stop=di,b.resume=di,b.pause=di,b}}const m=rl;c.call=(b,S,k)=>ym(b,m,S,k);let p=!1;o==="post"?c.scheduler=b=>{wE(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=Xk(n,e,c);return il&&(h?h.push(g):f&&g()),g}const EE=n=>n.__isSuspense;function _E(n,e){e&&e.pendingBranch?Le(n)?e.effects.push(...n):e.effects.push(n):vm(n)}const Tm=Symbol.for("v-fgt"),CE=Symbol.for("v-txt"),TE=Symbol.for("v-cmt");function ME(n){return n?n.__v_isVNode===!0:!1}const AE=(...n)=>Am(...n),Mm=({key:n})=>n??null,tl=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?In(n)||st(n)||Ye(n)?{i:vi,r:n,k:e,f:!!t}:n:null);function IE(n,e=null,t=null,r=0,i=null,o=n===Tm?0:1,a=!1,c=!1){const f={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&Mm(e),ref:e&&tl(e),scopeId:hE,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:vi};return c?(Eu(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 NE=process.env.NODE_ENV!=="production"?AE:Am;function Am(n,e=null,t=null,r=0,i=null,o=!1){if((!n||n===pE)&&(process.env.NODE_ENV!=="production"&&!n&&ot(`Invalid vnode type when creating vnode: ${n}.`),n=TE),ME(n)){const c=nl(n,e,!0);return t&&Eu(c,t),c.patchFlag=-2,c}if(Rm(n)&&(n=n.__vccOpts),e){e=OE(e);let{class:c,style:f}=e;c&&!In(c)&&(e.class=su(c)),dt(f)&&(Jo(f)&&!Le(f)&&(f=ir({},f)),e.style=iu(f))}const a=In(n)?1:EE(n)?128:dE(n)?64:dt(n)?4:Ye(n)?2:0;return process.env.NODE_ENV!=="production"&&a&4&&Jo(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)),IE(n,e,t,r,i,a,o,!0)}function OE(n){return n?Jo(n)||Cm(n)?ir({},n):n:null}function nl(n,e,t=!1,r=!1){const{props:i,ref:o,patchFlag:a,children:c,transition:f}=n,h=e?LE(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(tl(e)):[o,tl(e)]:tl(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!==Tm?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&&nl(n.ssContent),ssFallback:n.ssFallback&&nl(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=nl(n);return Le(n.children)&&(e.children=n.children.map(Im)),e}function RE(n=" ",e=0){return NE(CE,null,n,e)}function Eu(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),Eu(n,i()),i._c&&(i._d=!0));return}else t=32,!e._&&!Cm(e)&&(e._ctx=vi);else Ye(e)?(e={default:e,_ctx:vi},t=32):(e=String(e),r&64?(t=16,e=[RE(e)]):t=8);n.children=e,n.shapeFlag|=t}function LE(...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=su([e.class,r.class]));else if(i==="style")e.style=iu([e.style,r.style]);else if(fk(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 rl=null;const PE=()=>rl||vi;{const n=$o(),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=>rl=t),e("__VUE_SSR_SETTERS__",t=>il=t)}let il=!1;process.env.NODE_ENV;const DE=/(?:^|[-_])(\w)/g,BE=n=>n.replace(DE,e=>e.toUpperCase()).replace(/[-_]/g,"");function Nm(n,e=!0){return Ye(n)?n.displayName||n.name:n.name||e&&n.__name}function Om(n,e,t=!1){let r=Nm(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?BE(r):t?"App":"Anonymous"}function Rm(n){return Ye(n)&&"__vccOpts"in n}const de=(n,e)=>{const t=jk(n,e,il);if(process.env.NODE_ENV!=="production"){const r=PE();r&&r.appContext.config.warnRecursiveComputed&&(t._warnRecursive=!0)}return t};function zE(){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),">"]:ms(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!==as&&g.push(a("setup",p.setupState)),p.data!==as&&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=ir({},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 k in p.ctx)h(b,k,g)&&(S[k]=p.ctx[k]);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(k=>h(k,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 FE(){zE()}process.env.NODE_ENV!=="production"&&FE();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 sl(0,e);if(e==this.size)return sl(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?sl(r+1,a):sl(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 _u={index:0,offset:0};function sl(n,e){return _u.index=n,_u.offset=e,_u}function ol(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(!ol(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!ol(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&&ol(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 ll 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 HE(n,e,t){if(t.openStart>n.depth)throw new ll("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new ll("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 zr(a,c.cut(0,n.parentOffset).append(t.content).append(c.cut(e.parentOffset)))}else{let{start:a,end:c}=$E(t,n);return zr(o,Hm(n,a,c,e,r))}else return zr(o,al(n,e,r))}function Fm(n,e){if(!e.type.compatibleContent(n.type))throw new ll("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 Br(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 ys(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&&(Br(n.nodeAfter,r),o++));for(let c=o;c<a;c++)Br(i.child(c),r);e&&e.depth==t&&e.textOffset&&Br(e.nodeBefore,r)}function zr(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 ys(null,n,i,c),o&&a&&e.index(i)==t.index(i)?(Fm(o,a),Br(zr(o,Hm(n,e,t,r,i+1)),c)):(o&&Br(zr(o,al(n,e,i+1)),c),ys(e,t,i,c),a&&Br(zr(a,al(t,r,i+1)),c)),ys(r,null,i,c),new L(c)}function al(n,e,t){let r=[];if(ys(null,n,t,r),n.depth>t){let i=Cu(n,e,t+1);Br(zr(i,al(n,e,t+1)),r)}return ys(e,null,t,r),new L(r)}function $E(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 Us{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 cl(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 Us(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 WE);let i=r.elts[r.i]=Us.resolve(e,t);return r.i=(r.i+1)%UE,i}}class WE{constructor(){this.elts=[],this.i=0}}const UE=12,$m=new WeakMap;class cl{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 VE=Object.create(null);let cr=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&&ol(this.attrs,t||e.defaultAttrs||VE)&&_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 HE(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 Us.resolveCached(this,e)}resolveNoCache(e){return Us.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}};cr.prototype.text=void 0;class Ta extends cr{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 Ta(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ta(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 jr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new KE(e,t);if(r.next==null)return jr.empty;let i=Um(r);r.next&&r.err("Unexpected trailing text");let o=ZE(XE(i));return QE(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
- `)}}jr.empty=new jr(!0);class KE{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(GE(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function GE(n){let e=[];do e.push(JE(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function JE(n){let e=YE(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=qE(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 qE(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 jE(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 YE(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=jE(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 XE(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 ZE(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 jr(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 QE(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 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==jr.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 cr(this,this.computeAttrs(e),L.from(t),_e.setFrom(r))}createChecked(e=null,t,r){return t=L.from(t),this.checkContent(t),new cr(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 cr(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 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 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 Ma{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 Ma(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=Ma.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]=jr.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 Ta(r,r.defaultAttrs,e,_e.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return cr.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 bs=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,Tu=2,ul=4;function ng(n,e,t){return e!=null?(e?ws:0)|(e==="full"?Tu:0):n&&n.whitespace=="pre"?ws|Tu:t&-5}class fl{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&ul?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?ul:0);i?o=new fl(i.type,i.attrs,_e.none,!0,t.topMatch||i.type.contentMatch,a):r?o=new fl(null,null,_e.none,!0,null,a):o=new fl(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&Tu?"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&ul&&a.content.length==0&&(c|=ul);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 fl(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 Ws{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Mu(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}=hl(Mu(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&&hl(Mu(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return hl(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ws(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 Mu(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 hl(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}=hl(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,dl=4,dg=8;class Au{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|dl))>0}get deletedAfter(){return(this.delInfo&(hg|dl))>0}get deletedAcross(){return(this.delInfo&dl)>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),k=e==f?hg:e==p?fg:dl;return(t<0?e!=f:e!=p)&&(k|=dg),new Au(b,k,S)}i+=m-h}return r?e+i:new Au(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 Di{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 Di(this.maps,this.mirror,e,t)}copy(){return new Di(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 Di;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 Au(e,i,null)}}const Iu=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=Iu[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 Iu)throw new RangeError("Duplicate use of step JSON ID "+e);return Iu[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 ll)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 Er 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 Er(this.pos,t.marks[i]);return new Er(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 Er(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 Er(t.pos,e.markFromJSON(t.mark))}}$e.jsonID("addNodeMark",Er);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 Er(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&&Ou(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&&(Ou(e,this.from,this.gapFrom)||Ou(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 Ou(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 k=0;k<p.length;k++)p[k].isInSet(S)||(a&&a.to==g&&a.mark.eq(p[k])?a.to=b:i.push(a=new yn(g,b,p[k])));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 Ma){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 Ru(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 Si(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,k=!1;S>t;S--)k||r.index(S)>0?(k=!0,m=L.from(r.node(S).copy(m)),p++):f--;let g=L.empty,b=0;for(let S=o,k=!1;S>t;S--)k||i.after(S+1)<i.end(S)?(k=!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 Lu(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)&&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),Ru(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 v_(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 k=r&&r[m]||p;if(!p.canReplace(g+1,p.childCount)||!k.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 ur(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 pl(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&&Ru(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 E_(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 ml(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=Pu(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=Pu(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=Pu(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new W(vs(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new W(vs(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 k=0;k<o.length;k++)this.openFrontierNode(o[k]);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 k=0;k<i.childCount;k++)m.push(i.child(k));p=p.matchFragment(i)}let b=c.size+e-(a.content.size-a.openEnd);for(;h<c.childCount;){let k=c.child(h),T=p.matchType(k.type);if(!T)break;h++,(h>1||f==0||k.content.size)&&(p=T,m.push(wg(k.mark(g.allowedMarks(k.marks)),h==1?f:0,h==c.childCount?b:-1)))}let S=h==c.childCount;S||(b=-1),this.placed=Ss(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 k=0,T=c;k<b;k++){let M=T.lastChild;this.frontier.push({type:M.type,match:M.contentMatchAt(M.childCount)}),T=M.content}this.unplaced=S?e==0?W.empty:new W(vs(a.content,e-1,1),e-1,b<0?a.openEnd:e-1):new W(vs(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||!Du(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=Du(e,t,i,r,o);if(a){for(let c=t-1;c>=0;c--){let{match:f,type:h}=this.frontier[c],m=Du(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=Ss(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=Ss(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=Ss(this.placed,this.frontier.length,t))}}function vs(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(vs(n.firstChild.content,e-1,t)))}function Ss(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Ss(n.lastChild.content,e-1,t)))}function Pu(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function wg(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,wg(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 Du(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&&!T_(t,o.content,a)?c:null}function T_(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 k=0;k<a.length;k++){let T=a[(k+f)%a.length],M=!0;T<0&&(M=!1,T=-T);let P=i.node(T-1),F=i.index(T-1);if(P.canReplaceWith(F,F,S.type,S.marks))return n.replace(i.before(T),M?o.after(T):t,new W(vg(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 vg(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(vg(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=E_(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 zi 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 zi(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 zi(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 zi(t.pos,t.attr,t.value)}}$e.jsonID("attr",zi);class Vs 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 Vs(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 Vs(t.attr,t.value)}}$e.jsonID("docAttr",Vs);let xi=class extends Error{};xi=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},xi.prototype=Object.create(Error.prototype),xi.prototype.constructor=xi,xi.prototype.name="TransformError";class O_{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Di}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new xi(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=ml(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 N_(this,e,t),this}lift(e,t){return p_(this,e,t),this}join(e,t=1){return k_(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 v_(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new zi(e,t,r)),this}setDocAttribute(e,t){return this.step(new Vs(e,t)),this}addNodeMark(e,t){return this.step(new Er(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 Bi(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 Ru(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 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&&Eg(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),Eg(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=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 R_{constructor(e,t){this.$from=e,this.$to=t}}let xg=!1;function kg(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){kg(e),kg(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 Aa(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 Aa{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Aa(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 Aa(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 Eg(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 gl{constructor(e,t,r){this.name=e,this.init=_g(t.init,r),this.apply=_g(t.apply,r)}}new gl("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new gl("selection",{init(n,e){return n.selection||pe.atStart(e.doc)},apply(n){return n.selection}}),new gl("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new gl("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}});function Cg(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Cg(i,e,{})),t[r]=i}return t}class lt{constructor(e){this.spec=e,this.props={},e.props&&Cg(e.props,this,this.props),this.key=e.key?e.key.key:Tg("plugin")}getState(e){return e[this.key]}}const zu=Object.create(null);function Tg(n){return n in zu?n+"$"+ ++zu[n]:(zu[n]=0,n+"$")}class Ct{constructor(e="key"){this.key=Tg(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Fr=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:yl(n))){let o=n.parentNode;if(!o||o.nodeType!=1||Fu(n)||P_.test(n.nodeName)||n.contentEditable=="false")return!1;e=Fr(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?yl(n):0}else return!1}}function yl(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function D_(n,e,t){for(let r=e==0,i=e==yl(n);r||i;){if(n==t)return!0;let o=Fr(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==yl(n)}}function Fu(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 Ng(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,Og=typeof document<"u"?document:null,fr=fn&&fn.userAgent||"",Hu=/Edge\/(\d+)/.exec(fr),Rg=/MSIE \d/.exec(fr),$u=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(fr),xs=!!(Rg||$u||Hu),Lg=Rg?document.documentMode:$u?+$u[1]:Hu?+Hu[1]:0,bl=!xs&&/gecko\/(\d+)/i.test(fr);bl&&+(/Firefox\/(\d+)/.exec(fr)||[0,0])[1];const Wu=!xs&&/Chrome\/(\d+)/.exec(fr),hr=!!Wu,Pg=Wu?+Wu[1]:0,Hr=!xs&&!!fn&&/Apple Computer/.test(fn.vendor),Uu=Hr&&(/Mobile\/\w+/.test(fr)||!!fn&&fn.maxTouchPoints>2),$t=Uu||(fn?/Mac/.test(fn.platform):!1),B_=fn?/Win/.test(fn.platform):!1,ks=/Android \d/.test(fr),Vu=!!Og&&"webkitFontSmoothing"in Og.documentElement.style,z_=Vu?+(/\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 Ku(n,e=!1){let t=n.state.selection;if(W_(n,t),!!Dg(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&hr){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=Hr||hr&&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(Hr&&i&&i.contentEditable=="false")return Gu(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return Gu(i);if(o)return Gu(o)}}function Gu(n){return n.contentEditable="true",Hr&&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,Fr(r)+1):t.setStart(r,0),t.collapse(!0),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&xs&&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 Ju(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 dr(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 dr(n,new ce(r.$anchor,a))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let i=Ju(n.state,e);return i&&i instanceof Y?dr(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)?dr(n,new Y(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):Vu?dr(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 dr(n,new ce(e>0?r.$to:r.$from));{let i=Ju(n.state,e);return i?dr(n,i):!1}}}function wl(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Es(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function Ei(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(bl&&t.nodeType==1&&r<wl(t)&&Es(t.childNodes[r],-1)&&(a=!0);;)if(r>0){if(t.nodeType!=1)break;{let c=t.childNodes[r-1];if(Es(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&&Es(c,-1);)i=t.parentNode,o=Fr(c),c=c.previousSibling;if(c)t=c,r=wl(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}a?qu(n,t,r):i&&qu(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(Es(c,1))o=t,a=++r;else break}else{if(Ug(t))break;{let c=t.nextSibling;for(;c&&Es(c,1);)o=c.parentNode,a=Fr(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&&qu(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&&!Fu(n);)e=Fr(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&&!Fu(n);)e=Fr(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 qu(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&&Ku(n)},50)}function Vg(n,e){let t=n.state.doc.resolve(e);if(!(hr||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=Ju(n.state,e);if(a&&a instanceof Y)return dr(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?dr(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(!Hr||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)||Ei(n,-1);if(t==46&&!e.shiftKey||$t&&t==68&&r=="c")return Gg(n,1)||Ei(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)||Ei(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)||Ei(n,i)}else{if(t==38||$t&&t==80&&r=="c")return Kg(n,-1,r)||Ei(n,-1);if(t==40||$t&&t==78&&r=="c")return q_(n)||Kg(n,1,r)||Ei(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")||Ws.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
+ `,...rk(i)),console.warn(...o)}il(),Wu=!1}function nk(){let n=Wr[Wr.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 rk(n){const e=[];return n.forEach((t,r)=>{e.push(...r===0?[]:[`
4
+ `],...ik(t))}),e}function ik({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",r=n.component?n.component.parent==null:!1,i=` at <${pg(n.component,n.type,r)}`,o=">"+t;return n.props?[i,...sk(n.props),o]:[i+o]}function sk(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(r=>{e.push(...Xm(r,n[r]))}),t.length>3&&e.push(" ..."),e}function Xm(n,e,t){return Rn(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:st(e)?(e=Xm(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 Zm={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 dl(n,e,t,r){try{return r?n(...r):n()}catch(i){Vu(i,e,t)}}function Qm(n,e,t,r){if(Ye(n)){const i=dl(n,e,t,r);return i&&gE(i)&&i.catch(o=>{Vu(o,e,t)}),i}if(Le(n)){const i=[];for(let o=0;o<n.length;o++)i.push(Qm(n[o],e,t,r));return i}else process.env.NODE_ENV!=="production"&&ot(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof n}`)}function Vu(n,e,t,r=!0){const i=e?e.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:a}=e&&e.appContext.config||_s;if(e){let c=e.parent;const f=e.proxy,d=process.env.NODE_ENV!=="production"?Zm[t]:`https://vuejs.org/error-reference/#runtime-${t}`;for(;c;){const m=c.ec;if(m){for(let h=0;h<m.length;h++)if(m[h](n,f,d)===!1)return}c=c.parent}if(o){rl(),dl(o,null,10,[n,f,d]),il();return}}ok(n,t,i,r,a)}function ok(n,e,t,r=!0,i=!1){if(process.env.NODE_ENV!=="production"){const o=Zm[e];if(t&&ek(t),ot(`Unhandled error${o?` during execution of ${o}`:""}`),t&&tk(),r)throw n;console.error(n)}else{if(i)throw n;console.error(n)}}const Ht=[];let Fn=-1;const Ti=[];let dr=null,Mi=0;const lk=Promise.resolve();let Uu=null;const ak=100;function ck(n){let e=Fn+1,t=Ht.length;for(;e<t;){const r=e+t>>>1,i=Ht[r],o=Is(i);o<n||o===n&&i.flags&2?e=r+1:t=r}return e}function eg(n){if(!(n.flags&1)){const e=Is(n),t=Ht[Ht.length-1];!t||!(n.flags&2)&&e>=Is(t)?Ht.push(n):Ht.splice(ck(e),0,n),n.flags|=1,tg()}}function tg(){Uu||(Uu=lk.then(rg))}function ng(n){Le(n)?Ti.push(...n):dr&&n.id===-1?dr.splice(Mi+1,0,n):n.flags&1||(Ti.push(n),n.flags|=1),tg()}function uk(n){if(Ti.length){const e=[...new Set(Ti)].sort((t,r)=>Is(t)-Is(r));if(Ti.length=0,dr){dr.push(...e);return}for(dr=e,process.env.NODE_ENV!=="production"&&(n=n||new Map),Mi=0;Mi<dr.length;Mi++){const t=dr[Mi];process.env.NODE_ENV!=="production"&&ig(n,t)||(t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2)}dr=null,Mi=0}}const Is=n=>n.id==null?n.flags&2?-1:1/0:n.id;function rg(n){process.env.NODE_ENV!=="production"&&(n=n||new Map);const e=process.env.NODE_ENV!=="production"?t=>ig(n,t):xi;try{for(Fn=0;Fn<Ht.length;Fn++){const t=Ht[Fn];if(t&&!(t.flags&8)){if(process.env.NODE_ENV!=="production"&&e(t))continue;t.flags&4&&(t.flags&=-2),dl(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2)}}}finally{for(;Fn<Ht.length;Fn++){const t=Ht[Fn];t&&(t.flags&=-2)}Fn=-1,Ht.length=0,uk(n),Uu=null,(Ht.length||Ti.length)&&rg(n)}}function ig(n,e){const t=n.get(e)||0;if(t>ak){const r=e.i,i=r&&hg(r.type);return Vu(`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 Ku=new Map;process.env.NODE_ENV!=="production"&&(nl().__VUE_HMR_RUNTIME__={createRecord:Ju(fk),rerender:Ju(dk),reload:Ju(hk)});const hl=new Map;function fk(n,e){return hl.has(n)?!1:(hl.set(n,{initialDef:pl(e),instances:new Set}),!0)}function pl(n){return mg(n)?n.__vccOpts:n}function dk(n,e){const t=hl.get(n);t&&(t.initialDef.render=e,[...t.instances].forEach(r=>{e&&(r.render=e,pl(r.type).render=e),r.renderCache=[],r.update()}))}function hk(n,e){const t=hl.get(n);if(!t)return;e=pl(e),sg(t.initialDef,e);const r=[...t.instances];for(let i=0;i<r.length;i++){const o=r[i],a=pl(o.type);let c=Ku.get(a);c||(a!==t.initialDef&&sg(a,e),Ku.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?eg(()=>{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)}ng(()=>{Ku.clear()})}function sg(n,e){ar(n,e);for(const t in n)t!=="__file"&&!(t in e)&&delete n[t]}function Ju(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 Ai,ml=[];function og(n,e){var t,r;Ai=n,Ai?(Ai.enabled=!0,ml.forEach(({event:i,args:o})=>Ai.emit(i,...o)),ml=[]):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=>{og(o,e)}),setTimeout(()=>{Ai||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,ml=[])},3e3)):ml=[]}let Ii=null,pk=null;const mk=n=>n.__isTeleport;function lg(n,e){n.shapeFlag&6&&n.component?(n.transition=e,lg(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}nl().requestIdleCallback,nl().cancelIdleCallback;const gk=Symbol.for("v-ndc"),yk={};process.env.NODE_ENV!=="production"&&(yk.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 bk=null;function wk(n,e,t=!1){const r=bl||Ii;if(r||bk){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 Sk={},ag=n=>Object.getPrototypeOf(n)===Sk,vk=Tk,_k=Symbol.for("v-scx"),xk=()=>{{const n=wk(_k);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=_s){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=ar({},t);process.env.NODE_ENV!=="production"&&(c.onWarn=ot);const f=e&&r||!e&&o!=="post";let d;if(wl){if(o==="sync"){const b=xk();d=b.__watcherHandles||(b.__watcherHandles=[])}else if(!f){const b=()=>{};return b.stop=xi,b.resume=xi,b.pause=xi,b}}const m=bl;c.call=(b,v,x)=>Qm(b,m,v,x);let h=!1;o==="post"?c.scheduler=b=>{vk(b,m&&m.suspense)}:o!=="sync"&&(h=!0,c.scheduler=(b,v)=>{v?b():eg(b)}),c.augmentJob=b=>{e&&(b.flags|=4),h&&(b.flags|=2,m&&(b.id=m.uid,b.i=m))};const g=QE(n,e,c);return wl&&(d?d.push(g):f&&g()),g}const Ck=n=>n.__isSuspense;function Tk(n,e){e&&e.pendingBranch?Le(n)?e.effects.push(...n):e.effects.push(n):ng(n)}const cg=Symbol.for("v-fgt"),Mk=Symbol.for("v-txt"),Ak=Symbol.for("v-cmt");function Ik(n){return n?n.__v_isVNode===!0:!1}const Nk=(...n)=>fg(...n),ug=({key:n})=>n??null,gl=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?Rn(n)||st(n)||Ye(n)?{i:Ii,r:n,k:e,f:!!t}:n:null);function Ok(n,e=null,t=null,r=0,i=null,o=n===cg?0:1,a=!1,c=!1){const f={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&ug(e),ref:e&&gl(e),scopeId:pk,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:Ii};return c?(Gu(f,t),o&128&&n.normalize(f)):t&&(f.shapeFlag|=Rn(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 Rk=process.env.NODE_ENV!=="production"?Nk:fg;function fg(n,e=null,t=null,r=0,i=null,o=!1){if((!n||n===gk)&&(process.env.NODE_ENV!=="production"&&!n&&ot(`Invalid vnode type when creating vnode: ${n}.`),n=Ak),Ik(n)){const c=yl(n,e,!0);return t&&Gu(c,t),c.patchFlag=-2,c}if(mg(n)&&(n=n.__vccOpts),e){e=Lk(e);let{class:c,style:f}=e;c&&!Rn(c)&&(e.class=Mu(c)),pt(f)&&(al(f)&&!Le(f)&&(f=ar({},f)),e.style=Tu(f))}const a=Rn(n)?1:Ck(n)?128:mk(n)?64:pt(n)?4:Ye(n)?2:0;return process.env.NODE_ENV!=="production"&&a&4&&al(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 Lk(n){return n?al(n)||ag(n)?ar({},n):n:null}function yl(n,e,t=!1,r=!1){const{props:i,ref:o,patchFlag:a,children:c,transition:f}=n,d=e?Dk(i||{},e):i,m={__v_isVNode:!0,__v_skip:!0,type:n.type,props:d,key:d&&ug(d),ref:e&&e.ref?t&&o?Le(o)?o.concat(gl(e)):[o,gl(e)]:gl(e):o,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:process.env.NODE_ENV!=="production"&&a===-1&&Le(c)?c.map(dg):c,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==cg?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&&yl(n.ssContent),ssFallback:n.ssFallback&&yl(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return f&&r&&lg(m,f.clone(m)),m}function dg(n){const e=yl(n);return Le(n.children)&&(e.children=n.children.map(dg)),e}function Pk(n=" ",e=0){return Rk(Mk,null,n,e)}function Gu(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),Gu(n,i()),i._c&&(i._d=!0));return}else t=32,!e._&&!ag(e)&&(e._ctx=Ii);else Ye(e)?(e={default:e,_ctx:Ii},t=32):(e=String(e),r&64?(t=16,e=[Pk(e)]):t=8);n.children=e,n.shapeFlag|=t}function Dk(...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=Mu([e.class,r.class]));else if(i==="style")e.style=Tu([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 bl=null;const Fk=()=>bl||Ii;{const n=nl(),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=>bl=t),e("__VUE_SSR_SETTERS__",t=>wl=t)}let wl=!1;process.env.NODE_ENV;const zk=/(?:^|[-_])(\w)/g,Bk=n=>n.replace(zk,e=>e.toUpperCase()).replace(/[-_]/g,"");function hg(n,e=!0){return Ye(n)?n.displayName||n.name:n.name||e&&n.__name}function pg(n,e,t=!1){let r=hg(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 mg(n){return Ye(n)&&"__vccOpts"in n}const he=(n,e)=>{const t=XE(n,e,wl);if(process.env.NODE_ENV!=="production"){const r=Fk();r&&r.appContext.config.warnRecursiveComputed&&(t._warnRecursive=!0)}return t};function $k(){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(h){return pt(h)?h.__isVue?["div",n,"VueInstance"]:st(h)?["div",{},["span",n,m(h)],"<",c("_value"in h?h._value:h),">"]:As(h)?["div",{},["span",n,gt(h)?"ShallowReactive":"Reactive"],"<",c(h),`>${Dn(h)?" (readonly)":""}`]:Dn(h)?["div",{},["span",n,gt(h)?"ShallowReadonly":"Readonly"],"<",c(h),">"]:null:null},hasBody(h){return h&&h.__isVue},body(h){if(h&&h.__isVue)return["div",{},...o(h.$)]}};function o(h){const g=[];h.type.props&&h.props&&g.push(a("props",le(h.props))),h.setupState!==_s&&g.push(a("setup",h.setupState)),h.data!==_s&&g.push(a("data",le(h.data)));const b=f(h,"computed");b&&g.push(a("computed",b));const v=f(h,"inject");return v&&g.push(a("injected",v)),g.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:h}]]),g}function a(h,g){return g=ar({},g),Object.keys(g).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},h],["div",{style:"padding-left:1.25em"},...Object.keys(g).map(b=>["div",{},["span",r,b+": "],c(g[b],!1)])]]:["span",{}]}function c(h,g=!0){return typeof h=="number"?["span",e,h]:typeof h=="string"?["span",t,JSON.stringify(h)]:typeof h=="boolean"?["span",r,h]:pt(h)?["object",{object:g?le(h):h}]:["span",t,String(h)]}function f(h,g){const b=h.type;if(Ye(b))return;const v={};for(const x in h.ctx)d(b,x,g)&&(v[x]=h.ctx[x]);return v}function d(h,g,b){const v=h[b];if(Le(v)&&v.includes(g)||pt(v)&&g in v||h.extends&&d(h.extends,g,b)||h.mixins&&h.mixins.some(x=>d(x,g,b)))return!0}function m(h){return gt(h)?"ShallowRef":h.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(){$k()}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 gg(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=gg(i.content,o.content,t+1);if(a!=null)return a}t+=i.nodeSize}}function yg(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 d=0,m=Math.min(a.text.length,c.text.length);for(;d<m&&a.text[a.text.length-d-1]==c.text[c.text.length-d-1];)d++,t--,r--;return{a:t,b:r}}if(a.content.size||c.content.size){let d=yg(a.content,c.content,t-1,r-1);if(d)return d}t-=f,r-=f}}let z=class ct{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],d=c+f.nodeSize;if(d>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=d}}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 d=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&&d||c.isTextblock)&&r&&(a?a=!1:o+=r),o+=d},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 ct(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 ct(r,i)}cutByIndex(e,t){return e==t?ct.empty:e==0&&t==this.content.length?this:new ct(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 ct(i,o)}addToStart(e){return new ct([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ct(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 gg(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return yg(this,e,t,r)}findIndex(e,t=-1){if(e==0)return Sl(0,e);if(e==this.size)return Sl(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?Sl(r+1,a):Sl(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 ct.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new ct(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ct.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 ct(t||e,r)}static from(e){if(!e)return ct.empty;if(e instanceof ct)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new ct([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};z.empty=new z([],0);const qu={index:0,offset:0};function Sl(n,e){return qu.index=n,qu.offset=e,qu}function vl(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(!vl(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!vl(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let ke=class Gd{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&&vl(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 Gd.none;if(e instanceof Gd)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};ke.none=[];class _l 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=wg(this.content,e+this.openStart,t);return r&&new W(r,this.openStart,this.openEnd)}removeBetween(e,t){return new W(bg(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(z.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(z.empty,0,0);function bg(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(bg(o.content,e-i-1,t-i-1)))}function wg(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=wg(a.content,e-o-1,t);return c&&n.replaceChild(i,a.copy(c))}function Wk(n,e,t){if(t.openStart>n.depth)throw new _l("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new _l("Inconsistent open depths");return Sg(n,e,t,0)}function Sg(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=Sg(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 Ur(a,c.cut(0,n.parentOffset).append(t.content).append(c.cut(e.parentOffset)))}else{let{start:a,end:c}=Vk(t,n);return Ur(o,_g(n,a,c,e,r))}else return Ur(o,xl(n,e,r))}function vg(n,e){if(!e.type.compatibleContent(n.type))throw new _l("Cannot join "+e.type.name+" onto "+n.type.name)}function ju(n,e,t){let r=n.node(t);return vg(r,e.node(t)),r}function Vr(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 Ns(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&&(Vr(n.nodeAfter,r),o++));for(let c=o;c<a;c++)Vr(i.child(c),r);e&&e.depth==t&&e.textOffset&&Vr(e.nodeBefore,r)}function Ur(n,e){return n.type.checkContent(e),n.copy(e)}function _g(n,e,t,r,i){let o=n.depth>i&&ju(n,e,i+1),a=r.depth>i&&ju(t,r,i+1),c=[];return Ns(null,n,i,c),o&&a&&e.index(i)==t.index(i)?(vg(o,a),Vr(Ur(o,_g(n,e,t,r,i+1)),c)):(o&&Vr(Ur(o,xl(n,e,i+1)),c),Ns(e,t,i,c),a&&Vr(Ur(a,xl(t,r,i+1)),c)),Ns(r,null,i,c),new z(c)}function xl(n,e,t){let r=[];if(Ns(null,n,t,r),n.depth>t){let i=ju(n,e,t+1);Vr(Ur(i,xl(n,e,t+1)),r)}return Ns(e,null,t,r),new z(r)}function Vk(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(z.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class io{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 ke.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 El(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),d=o-f;if(r.push(a,c,i+f),!d||(a=a.child(c),a.isText))break;o=d-1,i+=f+1}return new io(t,r,o)}static resolveCached(e,t){let r=xg.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 xg.set(e,r=new Uk);let i=r.elts[r.i]=io.resolve(e,t);return r.i=(r.i+1)%Kk,i}}class Uk{constructor(){this.elts=[],this.i=0}}const Kk=12,xg=new WeakMap;class El{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 Jk=Object.create(null);let hr=class qd{constructor(e,t,r,i=ke.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||z.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&&vl(this.attrs,t||e.defaultAttrs||Jk)&&ke.sameSet(this.marks,r||ke.none)}copy(e=null){return e==this.content?this:new qd(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new qd(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),d=i.node(a).content.cut(i.pos-c,o.pos-c);return new W(d,i.depth-a,o.depth-a)}replace(e,t,r){return Wk(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 io.resolveCached(this,e)}resolveNoCache(e){return io.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()+")"),Eg(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=z.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=ke.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(!ke.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=z.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};hr.prototype.text=void 0;class Ya extends hr{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):Eg(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 Ya(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ya(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 Eg(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class si{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Gk(e,t);if(r.next==null)return si.empty;let i=kg(r);r.next&&r.err("Unexpected trailing text");let o=eC(Qk(i));return tC(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 z.from(c.map(d=>d.createAndFill()));for(let d=0;d<a.next.length;d++){let{type:m,next:h}=a.next[d];if(!(m.isText||m.hasRequiredAttrs())&&i.indexOf(h)==-1){i.push(h);let g=o(h,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
+ `)}}si.empty=new si(!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 kg(n){let e=[];do e.push(qk(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function qk(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=Zk(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=Yk(n,e);else break;return e}function Cg(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function Yk(n,e){let t=Cg(n),r=t;return n.eat(",")&&(n.next!="}"?r=Cg(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Xk(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 Zk(n){if(n.eat("(")){let e=kg(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=Xk(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 Qk(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(a,c,f){let d={term:f,to:c};return e[a].push(d),d}function i(a,c){a.forEach(f=>f.to=c)}function o(a,c){if(a.type=="choice")return a.exprs.reduce((f,d)=>f.concat(o(d,c)),[]);if(a.type=="seq")for(let f=0;;f++){let d=o(a.exprs[f],c);if(f==a.exprs.length-1)return d;i(d,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 d=0;d<a.min;d++){let m=t();i(o(a.expr,f),m),f=m}if(a.max==-1)i(o(a.expr,f),f);else for(let d=a.min;d<a.max;d++){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 Tg(n,e){return e-n}function Mg(n,e){let t=[];return r(e),t.sort(Tg);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 eC(n){let e=Object.create(null);return t(Mg(n,0));function t(r){let i=[];r.forEach(a=>{n[a].forEach(({term:c,to:f})=>{if(!c)return;let d;for(let m=0;m<i.length;m++)i[m][0]==c&&(d=i[m][1]);Mg(n,f).forEach(m=>{d||i.push([c,d=[]]),d.indexOf(m)==-1&&d.push(m)})})});let o=e[r.join(",")]=new si(r.indexOf(n.length-1)>-1);for(let a=0;a<i.length;a++){let c=i[a][1].sort(Tg);o.next.push({type:i[a][0],next:e[c.join(",")]||t(c)})}return o}}function tC(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:d}=i.next[c];a.push(f.name),o&&!(f.isText||f.hasRequiredAttrs())&&(o=!1),r.indexOf(d)==-1&&r.push(d)}o&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Ag(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 Ig(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 Ng(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 Og(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new rC(n,r,e[r]);return t}let Rg=class kb{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=Og(e,r.attrs),this.defaultAttrs=Ag(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==si.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:Ig(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new hr(this,this.computeAttrs(e),z.from(t),ke.setFrom(r))}createChecked(e=null,t,r){return t=z.from(t),this.checkContent(t),new hr(this,this.computeAttrs(e),t,ke.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=z.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(z.empty,!0);return o?new hr(this,e,t.append(o),ke.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){Ng(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:ke.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,a)=>r[o]=new kb(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 nC(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 rC{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?nC(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Xa{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Og(e,i.attrs),this.excluded=null;let o=Ag(this.attrs);this.instance=o?new ke(this,o):null}create(e=null){return!e&&this.instance?this.instance:new ke(this,Ig(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,a)=>r[o]=new Xa(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){Ng(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Lg{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=Rg.compile(this.spec.nodes,this),this.marks=Xa.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]=si.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?Pg(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==""?[]:Pg(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 Rg){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 Ya(r,r.defaultAttrs,e,ke.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return hr.fromJSON(this,e)}markFromJSON(e){return ke.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Pg(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 iC(n){return n.tag!=null}function sC(n){return n.style!=null}let Os=class jd{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(iC(i))this.tags.push(i);else if(sC(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 Bg(this,t,!1);return r.addAll(e,ke.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Bg(this,t,!0);return r.addAll(e,ke.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(aC(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=$g(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=$g(a)),a.node||a.ignore||a.mark||(a.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new jd(e,jd.schemaRules(e)))}};const Dg={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},oC={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Fg={ol:!0,ul:!0},Rs=1,Yu=2,kl=4;function zg(n,e,t){return e!=null?(e?Rs:0)|(e==="full"?Yu:0):n&&n.whitespace=="pre"?Rs|Yu:t&-5}class Cl{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=ke.none,this.match=o||(a&kl?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(z.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&Rs)){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=z.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(z.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&&!Dg.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Bg{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=zg(null,t.preserveWhitespace,0)|(r?kl:0);i?o=new Cl(i.type,i.attrs,ke.none,!0,t.topMatch||i.type.contentMatch,a):r?o=new Cl(null,null,ke.none,!0,null,a):o=new Cl(e.schema.topNodeType,null,ke.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&Yu?"full":this.localPreserveWS||(i.options&Rs)>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;Fg.hasOwnProperty(a)&&this.parser.normalizeLists&&lC(e);let f=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(c=this.parser.matchTag(e,this,r));e:if(f?f.ignore:oC.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 d,m=this.needsBlock;if(Dg.hasOwnProperty(a))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),d=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let h=f&&f.skip?t:this.readStyles(e,t);h&&this.addAll(e,h),d&&this.sync(o),this.needsBlock=m}else{let d=this.readStyles(e,t);d&&this.addElementByRule(e,f,d,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(d=>!f.clearMark(d)):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=ke.none;for(let a of r.concat(e.marks))(i.type?i.type.allowsMarkType(a.type):Hg(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=zg(e,o,a.options);a.options&kl&&a.content.length==0&&(c|=kl);let f=ke.none;return r=r.filter(d=>(a.type?a.type.allowsMarkType(d.type):Hg(d.type,e))?(f=d.addToSet(f),!1):!0),this.nodes.push(new Cl(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|=Rs)}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 d=t[c];if(d==""){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!=d&&!m.isInGroup(d))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 lC(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Fg.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function aC(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function $g(n){let e={};for(let t in n)e[t]=n[t];return e}function Hg(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:d,next:m}=c.edge(f);if(d==e||o.indexOf(m)<0&&a(m))return!0}};if(a(i.contentMatch))return!0}}class ro{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Xu(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 d=a.marks[f];if(!this.marks[d.type.name]){f++;continue}if(!d.eq(o[c][0])||d.type.spec.spanning===!1)break;c++,f++}for(;c<o.length;)i=o.pop()[1];for(;f<a.marks.length;){let d=a.marks[f++],m=this.serializeMark(d,a.isInline,t);m&&(o.push([d,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}=Tl(Xu(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&&Tl(Xu(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return Tl(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ro(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Wg(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Wg(e.marks)}}function Wg(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Xu(n){return n.document||window.document}const Vg=new WeakMap;function cC(n){let e=Vg.get(n);return e===void 0&&Vg.set(n,e=uC(n)),e}function uC(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 Tl(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=cC(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),d=e[1],m=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){m=2;for(let h in d)if(d[h]!=null){let g=h.indexOf(" ");g>0?f.setAttributeNS(h.slice(0,g),h.slice(g+1),d[h]):f.setAttribute(h,d[h])}}for(let h=m;h<e.length;h++){let g=e[h];if(g===0){if(h<e.length-1||h>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:v}=Tl(n,g,t,r);if(f.appendChild(b),v){if(c)throw new RangeError("Multiple content holes");c=v}}}return{dom:f,contentDOM:c}}const Ug=65535,Kg=Math.pow(2,16);function fC(n,e){return n+e*Kg}function Jg(n){return n&Ug}function dC(n){return(n-(n&Ug))/Kg}const Gg=1,qg=2,Ml=4,jg=8;class Zu{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&jg)>0}get deletedBefore(){return(this.delInfo&(Gg|Ml))>0}get deletedAfter(){return(this.delInfo&(qg|Ml))>0}get deletedAcross(){return(this.delInfo&Ml)>0}}class Nt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Nt.empty)return Nt.empty}recover(e){let t=0,r=Jg(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+dC(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 d=this.ranges[c+o],m=this.ranges[c+a],h=f+d;if(e<=h){let g=d?e==f?-1:e==h?1:t:t,b=f+i+(g<0?0:m);if(r)return b;let v=e==(t<0?f:h)?null:fC(c/3,e-f),x=e==f?qg:e==h?Gg:Ml;return(t<0?e!=f:e!=h)&&(x|=jg),new Zu(b,x,v)}i+=m-d}return r?e+i:new Zu(e+i,0,null)}touches(e,t){let r=0,i=Jg(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 d=this.ranges[c+o],m=f+d;if(e<=m&&c==i*3)return!0;r+=this.ranges[c+a]-d}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),d=this.ranges[i+t],m=this.ranges[i+r];e(c,c+d,f,f+m),o+=m-d}}invert(){return new Nt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Nt.empty:new Nt(e<0?[0,-e,0]:[0,0,e])}}Nt.empty=new Nt([]);class Yi{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 Yi(this.maps,this.mirror,e,t)}copy(){return new Yi(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 Yi;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 Zu(e,i,null)}}const Qu=Object.create(null);class He{getMap(){return Nt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Qu[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 Qu)throw new RangeError("Duplicate use of step JSON ID "+e);return Qu[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 _l)return Re.fail(o.message);throw o}}}function ef(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(ef(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return z.fromArray(r)}class Ar extends He{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(ef(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 Sn(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 Ar(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ar&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ar(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 Ar(t.from,t.to,e.markFromJSON(t.mark))}}He.jsonID("addMark",Ar);class Sn extends He{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(ef(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 Ar(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 Sn(t.pos,r.pos,this.mark)}merge(e){return e instanceof Sn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Sn(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 Sn(t.from,t.to,e.markFromJSON(t.mark))}}He.jsonID("removeMark",Sn);class Ir extends He{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(z.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 Ir(this.pos,t.marks[i]);return new Ir(this.pos,this.mark)}}return new Xi(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ir(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 Ir(t.pos,e.markFromJSON(t.mark))}}He.jsonID("addNodeMark",Ir);class Xi extends He{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(z.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Ir(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Xi(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 Xi(t.pos,e.markFromJSON(t.mark))}}He.jsonID("removeNodeMark",Xi);class Je extends He{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&tf(e,this.from,this.to)?Re.fail("Structure replace would overwrite content"):Re.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Nt([this.from,this.to-this.from,this.slice.size])}invert(e){return new Je(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 Je(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Je)||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 Je(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 Je(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 Je(t.from,t.to,W.fromJSON(e,t.slice),!!t.structure)}}He.jsonID("replace",Je);class Ke extends He{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&&(tf(e,this.from,this.gapFrom)||tf(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 Nt([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)}}He.jsonID("replaceAround",Ke);function tf(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 hC(n,e,t,r){let i=[],o=[],a,c;n.doc.nodesBetween(e,t,(f,d,m)=>{if(!f.isInline)return;let h=f.marks;if(!r.isInSet(h)&&m.type.allowsMarkType(r.type)){let g=Math.max(d,e),b=Math.min(d+f.nodeSize,t),v=r.addToSet(h);for(let x=0;x<h.length;x++)h[x].isInSet(v)||(a&&a.to==g&&a.mark.eq(h[x])?a.to=b:i.push(a=new Sn(g,b,h[x])));c&&c.to==g?c.to=b:o.push(c=new Ar(g,b,r))}}),i.forEach(f=>n.step(f)),o.forEach(f=>n.step(f))}function pC(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 Xa){let d=a.marks,m;for(;m=r.isInSet(d);)(f||(f=[])).push(m),d=m.removeFromSet(d)}else r?r.isInSet(a.marks)&&(f=[r]):f=a.marks;if(f&&f.length){let d=Math.min(c+a.nodeSize,t);for(let m=0;m<f.length;m++){let h=f[m],g;for(let b=0;b<i.length;b++){let v=i[b];v.step==o-1&&h.eq(i[b].style)&&(g=v)}g?(g.to=d,g.step=o):i.push({style:h,from:Math.max(c,e),to:d,step:o})}}}),i.forEach(a=>n.step(new Sn(a.from,a.to,a.style)))}function nf(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 d=o.child(f),m=c+d.nodeSize,h=r.matchType(d.type);if(!h)a.push(new Je(c,m,W.empty));else{r=h;for(let g=0;g<d.marks.length;g++)t.allowsMarkType(d.marks[g].type)||n.step(new Sn(c,m,d.marks[g]));if(i&&d.isText&&t.whitespace!="pre"){let g,b=/\r?\n|\r/g,v;for(;g=b.exec(d.text);)v||(v=new W(z.from(t.schema.text(" ",t.allowedMarks(d.marks))),0,0)),a.push(new Je(c+g.index,c+g.index+g[0].length,v))}}c=m}if(!r.validEnd){let f=r.fillBefore(z.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 mC(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Ni(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||!mC(i,o,a))break}return null}function gC(n,e,t){let{$from:r,$to:i,depth:o}=e,a=r.before(o+1),c=i.after(o+1),f=a,d=c,m=z.empty,h=0;for(let v=o,x=!1;v>t;v--)x||r.index(v)>0?(x=!0,m=z.from(r.node(v).copy(m)),h++):f--;let g=z.empty,b=0;for(let v=o,x=!1;v>t;v--)x||i.after(v+1)<i.end(v)?(x=!0,g=z.from(i.node(v).copy(g)),b++):d++;n.step(new Ke(f,d,a,c,new W(m.append(g),h,b),m.size-h,!0))}function rf(n,e,t=null,r=n){let i=yC(n,e),o=i&&bC(r,e);return o?i.map(Yg).concat({type:e,attrs:t}).concat(o.map(Yg)):null}function Yg(n){return{type:n,attrs:null}}function yC(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 bC(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 d=r;f&&d<i;d++)f=f.matchType(t.child(d).type);return!f||!f.validEnd?null:a}function wC(n,e,t){let r=z.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=z.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 SC(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)&&vC(n.doc,n.mapping.slice(o).map(c),r)){let d=null;if(r.schema.linebreakReplacement){let b=r.whitespace=="pre",v=!!r.contentMatch.matchType(r.schema.linebreakReplacement);b&&!v?d=!1:!b&&v&&(d=!0)}d===!1&&Zg(n,a,c,o),nf(n,n.mapping.slice(o).map(c,1),r,void 0,d===null);let m=n.mapping.slice(o),h=m.map(c,1),g=m.map(c+a.nodeSize,1);return n.step(new Ke(h,g,h+1,g-1,new W(z.from(r.create(f,null,a.marks)),0,0),1,!0)),d===!0&&Xg(n,a,c,o),!1}})}function Xg(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 Zg(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 vC(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function _C(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(z.from(a),0,0),1,!0))}function zn(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 d=i.depth-1,m=t-2;d>o;d--,m--){let h=i.node(d),g=i.index(d);if(h.type.spec.isolating)return!1;let b=h.content.cutByIndex(g,h.childCount),v=r&&r[m+1];v&&(b=b.replaceChild(0,v.type.create(v.attrs)));let x=r&&r[m]||h;if(!h.canReplace(g+1,h.childCount)||!x.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 xC(n,e,t=1,r){let i=n.doc.resolve(e),o=z.empty,a=z.empty;for(let c=i.depth,f=i.depth-t,d=t-1;c>f;c--,d--){o=z.from(i.node(c).copy(o));let m=r&&r[d];a=z.from(m?m.type.create(m.attrs,a):i.node(c).copy(a))}n.step(new Je(e,e,new W(o.append(a),t,t),!0))}function pr(n,e){let t=n.resolve(e),r=t.index();return Qg(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function EC(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 Qg(n,e){return!!(n&&e&&!n.isLeaf&&EC(n,e))}function Al(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&&Qg(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 kC(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",h=!!a.contentMatch.matchType(i);m&&!h?r=!1:!m&&h&&(r=!0)}let c=n.steps.length;if(r===!1){let m=n.doc.resolve(e+t);Zg(n,m.node(),m.before(),c)}a.inlineContent&&nf(n,e+t-1,a,o.node().contentMatchAt(o.index()),r==null);let f=n.mapping.slice(c),d=f.map(e-t);if(n.step(new Je(d,f.map(e+t,-1),W.empty,!0)),r===!0){let m=n.doc.resolve(d);Xg(n,m.node(),m.before(),n.steps.length)}return n}function CC(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 TC(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),d=r.node(a),m=!1;if(o==1)m=d.canReplace(f,f,i);else{let h=d.contentMatchAt(f).findWrapping(i.firstChild.type);m=h&&d.canReplaceWith(f,f,h[0])}if(m)return c==0?r.pos:c<0?r.before(a+1):r.after(a+1)}return null}function Il(n,e,t=e,r=W.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return e0(i,o,r)?new Je(e,t,r):new MC(i,o,r).fit()}function e0(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class MC{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=z.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=z.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):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 Je(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=sf(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:d}=this.frontier[c],m,h=null;if(t==1&&(a?d.matchType(a.type)||(h=d.fillBefore(z.from(a),!1)):o&&f.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:c,parent:o,inject:h};if(t==2&&a&&(m=d.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:c,parent:o,wrap:m};if(o&&d.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=sf(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=sf(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new W(Ls(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new W(Ls(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 x=0;x<o.length;x++)this.openFrontierNode(o[x]);let a=this.unplaced,c=r?r.content:a.content,f=a.openStart-e,d=0,m=[],{match:h,type:g}=this.frontier[t];if(i){for(let x=0;x<i.childCount;x++)m.push(i.child(x));h=h.matchFragment(i)}let b=c.size+e-(a.content.size-a.openEnd);for(;d<c.childCount;){let x=c.child(d),T=h.matchType(x.type);if(!T)break;d++,(d>1||f==0||x.content.size)&&(h=T,m.push(t0(x.mark(g.allowedMarks(x.marks)),d==1?f:0,d==c.childCount?b:-1)))}let v=d==c.childCount;v||(b=-1),this.placed=Ps(this.placed,t,z.from(m)),this.frontier[t].match=h,v&&b<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let x=0,T=c;x<b;x++){let M=T.lastChild;this.frontier.push({type:M.type,match:M.contentMatchAt(M.childCount)}),T=M.content}this.unplaced=v?e==0?W.empty:new W(Ls(a.content,e-1,1),e-1,b<0?a.openEnd:e-1):new W(Ls(a.content,e,d),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!of(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=of(e,t,i,r,o);if(a){for(let c=t-1;c>=0;c--){let{match:f,type:d}=this.frontier[c],m=of(e,c,d,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=Ps(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=Ps(this.placed,this.depth,z.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(z.empty,!0);t.childCount&&(this.placed=Ps(this.placed,this.frontier.length,t))}}function Ls(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Ls(n.firstChild.content,e-1,t)))}function Ps(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Ps(n.lastChild.content,e-1,t)))}function sf(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function t0(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,t0(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(z.empty,!0)))),n.copy(r)}function of(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&&!AC(t,o.content,a)?c:null}function AC(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function IC(n){return n.spec.defining||n.spec.definingForContent}function NC(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),o=n.doc.resolve(t);if(e0(i,o,r))return n.step(new Je(e,t,r));let a=r0(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 v=i.node(g).type.spec;if(v.defining||v.definingAsContext||v.isolating)break;a.indexOf(g)>-1?c=g:i.before(g)==b&&a.splice(1,0,-g)}let f=a.indexOf(c),d=[],m=r.openStart;for(let g=r.content,b=0;;b++){let v=g.firstChild;if(d.push(v),b==r.openStart)break;g=v.content}for(let g=m-1;g>=0;g--){let b=d[g],v=IC(b.type);if(v&&!b.sameMarkup(i.node(Math.abs(c)-1)))m=g;else if(v||!b.type.isTextblock)break}for(let g=r.openStart;g>=0;g--){let b=(g+m+1)%(r.openStart+1),v=d[b];if(v)for(let x=0;x<a.length;x++){let T=a[(x+f)%a.length],M=!0;T<0&&(M=!1,T=-T);let L=i.node(T-1),B=i.index(T-1);if(L.canReplaceWith(B,B,v.type,v.marks))return n.replace(i.before(T),M?o.after(T):t,new W(n0(r.content,0,r.openStart,b),b,r.openEnd))}}let h=n.steps.length;for(let g=a.length-1;g>=0&&(n.replace(e,t,r),!(n.steps.length>h));g--){let b=a[g];b<0||(e=i.before(b),t=o.after(b))}}function n0(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(n0(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(z.empty,!0))}return n}function OC(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=CC(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new W(z.from(r),0,0))}function RC(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=r0(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 r0(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 Zi extends He{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(z.from(i),0,t.isLeaf?0:1))}getMap(){return Nt.empty}invert(e){return new Zi(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 Zi(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 Zi(t.pos,t.attr,t.value)}}He.jsonID("attr",Zi);class so extends He{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 Nt.empty}invert(e){return new so(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 so(t.attr,t.value)}}He.jsonID("docAttr",so);let Oi=class extends Error{};Oi=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},Oi.prototype=Object.create(Error.prototype),Oi.prototype.constructor=Oi,Oi.prototype.name="TransformError";class LC{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Yi}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Oi(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=Il(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new W(z.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 NC(this,e,t,r),this}replaceRangeWith(e,t,r){return OC(this,e,t,r),this}deleteRange(e,t){return RC(this,e,t),this}lift(e,t){return gC(this,e,t),this}join(e,t=1){return kC(this,e,t),this}wrap(e,t){return wC(this,e,t),this}setBlockType(e,t=e,r,i=null){return SC(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return _C(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new Zi(e,t,r)),this}setDocAttribute(e,t){return this.step(new so(e,t)),this}addNodeMark(e,t){return this.step(new Ir(e,t)),this}removeNodeMark(e,t){if(!(t instanceof ke)){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 Xi(e,t)),this}split(e,t=1,r){return xC(this,e,t,r),this}addMark(e,t,r){return hC(this,e,t,r),this}removeMark(e,t,r){return pC(this,e,t,r),this}clearIncompatible(e,t,r){return nf(this,e,t,r),this}}const lf=Object.create(null);class pe{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new PC(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:d}=a[c],m=e.mapping.slice(o);e.replaceRange(m.map(f.pos),m.map(d.pos),c?W.empty:t),c==0&&o0(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),d=f.map(a.pos),m=f.map(c.pos);o?e.deleteRange(d,m):(e.replaceRangeWith(d,m,t),o0(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new ce(e):Ri(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?Ri(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):Ri(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 Ri(e,e,0,0,1)||new It(e)}static atEnd(e){return Ri(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=lf[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 lf)throw new RangeError("Duplicate use of selection JSON ID "+e);return lf[e]=t,t.prototype.jsonID=e,t}getBookmark(){return ce.between(this.$anchor,this.$head).getBookmark()}}pe.prototype.visible=!0;class PC{constructor(e,t){this.$from=e,this.$to=t}}let i0=!1;function s0(n){!i0&&!n.parent.inlineContent&&(i0=!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){s0(e),s0(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 Za(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 Za{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Za(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(z.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 Yd(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 Yd{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new Za(r,r):new Yd(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 DC}}pe.jsonID("all",It);const DC={map(){return this},resolve(n){return new It(n)}};function Ri(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=Ri(n,c,t+i,i<0?c.childCount:0,i,o);if(f)return f}t+=c.nodeSize*i}return null}function o0(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof Je||i instanceof Ke))return;let o=n.mapping.maps[r],a;o.forEach((c,f,d,m)=>{a==null&&(a=m)}),n.setSelection(pe.near(n.doc.resolve(a),t))}function l0(n,e){return!e||!n?n:n.bind(e)}class Nl{constructor(e,t,r){this.name=e,this.init=l0(t.init,r),this.apply=l0(t.apply,r)}}new Nl("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Nl("selection",{init(n,e){return n.selection||pe.atStart(e.doc)},apply(n){return n.selection}}),new Nl("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Nl("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}});function a0(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=a0(i,e,{})),t[r]=i}return t}class lt{constructor(e){this.spec=e,this.props={},e.props&&a0(e.props,this,this.props),this.key=e.key?e.key.key:c0("plugin")}getState(e){return e[this.key]}}const af=Object.create(null);function c0(n){return n in af?n+"$"+ ++af[n]:(af[n]=0,n+"$")}class Tt{constructor(e="key"){this.key=c0(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Kr=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},u0=function(n,e,t,r){return t&&(f0(n,e,t,r,-1)||f0(n,e,t,r,1))},FC=/^(img|br|input|textarea|hr)$/i;function f0(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:Ol(n))){let o=n.parentNode;if(!o||o.nodeType!=1||cf(n)||FC.test(n.nodeName)||n.contentEditable=="false")return!1;e=Kr(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?Ol(n):0}else return!1}}function Ol(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function zC(n,e,t){for(let r=e==0,i=e==Ol(n);r||i;){if(n==t)return!0;let o=Kr(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==Ol(n)}}function cf(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 d0=function(n){return n.focusNode&&u0(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function h0(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const hn=typeof navigator<"u"?navigator:null,p0=typeof document<"u"?document:null,mr=hn&&hn.userAgent||"",uf=/Edge\/(\d+)/.exec(mr),m0=/MSIE \d/.exec(mr),ff=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(mr),Ds=!!(m0||ff||uf),g0=m0?document.documentMode:ff?+ff[1]:uf?+uf[1]:0,Rl=!Ds&&/gecko\/(\d+)/i.test(mr);Rl&&+(/Firefox\/(\d+)/.exec(mr)||[0,0])[1];const df=!Ds&&/Chrome\/(\d+)/.exec(mr),gr=!!df,y0=df?+df[1]:0,Jr=!Ds&&!!hn&&/Apple Computer/.test(hn.vendor),hf=Jr&&(/Mobile\/\w+/.test(mr)||!!hn&&hn.maxTouchPoints>2),Wt=hf||(hn?/Mac/.test(hn.platform):!1),BC=hn?/Win/.test(hn.platform):!1,Fs=/Android \d/.test(mr),pf=!!p0&&"webkitFontSmoothing"in p0.documentElement.style,$C=pf?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function HC(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,d;if(d0(t)){for(f=a;i&&!i.node;)i=i.parent;let h=i.node;if(i&&h.isAtom&&Y.isSelectable(h)&&i.parent&&!(h.isInline&&zC(t.focusNode,t.focusOffset,i.dom))){let g=i.posBefore;d=new Y(a==g?c:r.resolve(g))}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let h=a,g=a;for(let b=0;b<t.rangeCount;b++){let v=t.getRangeAt(b);h=Math.min(h,n.docView.posFromDOM(v.startContainer,v.startOffset,1)),g=Math.max(g,n.docView.posFromDOM(v.endContainer,v.endOffset,-1))}if(h<0)return null;[f,a]=g==n.state.selection.anchor?[g,h]:[h,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(!d){let h=e=="pointer"||n.state.selection.head<c.pos&&!o?1:-1;d=x0(n,m,c,h)}return d}function b0(n){return n.editable?n.hasFocus():KC(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function mf(n,e=!1){let t=n.state.selection;if(UC(n,t),!!b0(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&gr){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&u0(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)VC(n);else{let{anchor:r,head:i}=t,o,a;w0&&!(t instanceof ce)&&(t.$from.parent.inlineContent||(o=S0(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(a=S0(n,t.to))),n.docView.setSelection(r,i,n,e),w0&&(o&&v0(o),a&&v0(a)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&WC(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const w0=Jr||gr&&y0<63;function S0(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(Jr&&i&&i.contentEditable=="false")return gf(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return gf(i);if(o)return gf(o)}}function gf(n){return n.contentEditable="true",Jr&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function v0(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function WC(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(()=>{(!b0(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function VC(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,Kr(r)+1):t.setStart(r,0),t.collapse(!0),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&Ds&&g0<=11&&(r.disabled=!0,r.disabled=!1)}function UC(n,e){if(e instanceof Y){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(_0(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else _0(n)}function _0(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function x0(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||ce.between(e,t,r)}function KC(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 yf(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 yr(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function E0(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 yr(n,new ce(r.$anchor,a))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let i=yf(n.state,e);return i&&i instanceof Y?yr(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)?yr(n,new Y(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):pf?yr(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 yr(n,new ce(e>0?r.$to:r.$from));{let i=yf(n.state,e);return i?yr(n,i):!1}}}function Ll(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function zs(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function Li(n,e){return e<0?JC(n):GC(n)}function JC(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,a=!1;for(Rl&&t.nodeType==1&&r<Ll(t)&&zs(t.childNodes[r],-1)&&(a=!0);;)if(r>0){if(t.nodeType!=1)break;{let c=t.childNodes[r-1];if(zs(c,-1))i=t,o=--r;else if(c.nodeType==3)t=c,r=t.nodeValue.length;else break}}else{if(k0(t))break;{let c=t.previousSibling;for(;c&&zs(c,-1);)i=t.parentNode,o=Kr(c),c=c.previousSibling;if(c)t=c,r=Ll(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}a?bf(n,t,r):i&&bf(n,i,o)}function GC(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=Ll(t),o,a;for(;;)if(r<i){if(t.nodeType!=1)break;let c=t.childNodes[r];if(zs(c,1))o=t,a=++r;else break}else{if(k0(t))break;{let c=t.nextSibling;for(;c&&zs(c,1);)o=c.parentNode,a=Kr(c)+1,c=c.nextSibling;if(c)t=c,r=0,i=Ll(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}o&&bf(n,o,a)}function k0(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function qC(n,e){for(;n&&e==n.childNodes.length&&!cf(n);)e=Kr(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 jC(n,e){for(;n&&!e&&!cf(n);)e=Kr(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 bf(n,e,t){if(e.nodeType!=3){let o,a;(a=qC(e,t))?(e=a,t=0):(o=jC(e,t))&&(e=o,t=o.nodeValue.length)}let r=n.domSelection();if(!r)return;if(d0(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&&mf(n)},50)}function C0(n,e){let t=n.state.doc.resolve(e);if(!(gr||BC)&&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 T0(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=yf(n.state,e);if(a&&a instanceof Y)return yr(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?yr(n,c):!1}return!1}function M0(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 A0(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function YC(n){if(!Jr||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;A0(n,r,"true"),setTimeout(()=>A0(n,r,"false"),20)}return!1}function XC(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function ZC(n,e){let t=e.keyCode,r=XC(e);if(t==8||Wt&&t==72&&r=="c")return M0(n,-1)||Li(n,-1);if(t==46&&!e.shiftKey||Wt&&t==68&&r=="c")return M0(n,1)||Li(n,1);if(t==13||t==27)return!0;if(t==37||Wt&&t==66&&r=="c"){let i=t==37?C0(n,n.state.selection.from)=="ltr"?-1:1:-1;return E0(n,i,r)||Li(n,i)}else if(t==39||Wt&&t==70&&r=="c"){let i=t==39?C0(n,n.state.selection.from)=="ltr"?1:-1:1;return E0(n,i,r)||Li(n,i)}else{if(t==38||Wt&&t==80&&r=="c")return T0(n,-1,r)||Li(n,-1);if(t==40||Wt&&t==78&&r=="c")return YC(n)||T0(n,1,r)||Li(n,1);if(r==(Wt?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function I0(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")||ro.fromSchema(n.state.schema),c=z0(),f=c.createElement("div");f.appendChild(a.serializeFragment(r,{document:c}));let d=f.firstChild,m,h=0;for(;d&&d.nodeType==1&&(m=D0[d.nodeName.toLowerCase()]);){for(let b=m.length-1;b>=0;b--){let v=c.createElement(m[b]);for(;f.firstChild;)v.appendChild(f.firstChild);f.appendChild(v),h++}d=f.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${h?` -${h}`:""} ${JSON.stringify(t)}`);let g=n.someProp("clipboardTextSerializer",b=>b(e,n))||e.content.textBetween(0,e.content.size,`
10
10
 
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=Ws.fromSchema(b);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(k=>{let T=a.appendChild(document.createElement("p"));k&&T.appendChild(S.serializeNode(b.text(k,g)))})}}else n.someProp("transformPastedHTML",p=>{t=p(t,n)}),a=eC(t),Vu&&tC(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")||bs.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=nC(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 ju(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=ju(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(ju(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new W(ju(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 Yu=null;function Q_(n){let e=window.trustedTypes;return e?(Yu||(Yu=e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),Yu.createHTML(n)):n}function eC(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 tC(n){let e=n.querySelectorAll(hr?"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 nC(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={},Tt={};function pr(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}Tt.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&&hr&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),Uu&&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,Ng(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||Y_(n,t)?t.preventDefault():pr(n,"key")},Tt.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},Tt.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 vl(n){return{left:n.clientX,top:n.clientY}}function rC(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Xu(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 _i(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 iC(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&Y.isSelectable(r)?(_i(n,new Y(t)),!0):!1}function sC(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?(_i(n,Y.create(n.state.doc,i)),!0):!1}function oC(n,e,t,r,i){return Xu(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?sC(n,t):iC(n,t))}function lC(n,e,t,r){return Xu(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function aC(n,e,t,r){return Xu(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||cC(n,t,r)}function cC(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(_i(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)_i(n,ce.create(r,c+1,c+1+a.content.size));else if(Y.isSelectable(a))_i(n,Y.create(r,c));else continue;return!0}}function Zu(n){return Sl(n)}const r0=$t?"metaKey":"ctrlKey";en.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Zu(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&rC(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(vl(t));a&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new uC(n,a,t,!!r)):(o=="doubleClick"?lC:aC)(n,a.pos,a.inside,t)?t.preventDefault():pr(n,"pointer"))};class uC{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&&bl&&!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)),pr(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(()=>Ku(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(vl(e))),this.updateAllowDefault(e),this.allowDefault||!t?pr(this.view,"pointer"):oC(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Hr&&this.mightDrag&&!this.mightDrag.node.isAtom||hr&&!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)?(_i(this.view,pe.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):pr(this.view,"pointer")}move(e){this.updateAllowDefault(e),pr(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(),Zu(n),pr(n,"pointer")},en.touchmove=n=>{n.input.lastTouch=Date.now(),pr(n,"pointer")},en.contextmenu=n=>Zu(n);function i0(n,e){return n.composing?!0:Hr&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const fC=ks?5e3:-1;Tt.compositionstart=Tt.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(),Sl(n,!0),n.markCursor=null;else if(Sl(n,!e.selection.empty),bl&&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,fC)},Tt.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(()=>Sl(n),e))}function hC(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=dC());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function dC(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function Sl(n,e=!1){if(!(ks&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),hC(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 pC(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 _s=xs&&Lg<15||Uu&&z_<604;en.copy=Tt.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=_s?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)):pC(n,c),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function mC(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function gC(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?Qu(n,r.value,null,i,e):Qu(n,r.textContent,r.innerHTML,i,e)},50)}function Qu(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=mC(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," "):""}Tt.paste=(n,e)=>{let t=e;if(n.composing&&!ks)return;let r=_s?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&Qu(n,o0(r),r.getData("text/html"),i,t)?t.preventDefault():gC(n,t)};class yC{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(vl(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||!hr||Pg>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(_s?"Text":"text/html",f.innerHTML),t.dataTransfer.effectAllowed="copyMove",_s||t.dataTransfer.setData("text/plain",h),n.dragging=new yC(m,!t[l0],a)},en.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},Tt.dragover=Tt.dragenter=(n,e)=>e.preventDefault(),Tt.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(vl(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),_s?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((k,T,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())&&Ku(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(hr&&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,Ng(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 Tt)en[n]=Tt[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 Ia{constructor(e,t){this.toDOM=e,this.spec=t||$r,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 Ia&&(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 xr{constructor(e,t){this.attrs=e,this.spec=t||$r}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 xr&&Cs(this.attrs,e.attrs)&&Cs(this.spec,e.spec)}static is(e){return e.type instanceof xr}destroy(){}}let bC=class Ey{constructor(e,t){this.attrs=e,this.spec=t||$r}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 Ey&&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 Ia(t,r))}static inline(e,t,r,i){return new bn(e,t,new xr(r,i))}static node(e,t,r,i){return new bn(e,t,new bC(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof xr}get widget(){return this.type instanceof Ia}}const Ci=[],$r={};class Je{constructor(e,t){this.local=e.length?e:Ci,this.children=t.length?t:Ci}static create(e,t){return t.length?xl(t,e,0,$r):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||$r)}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?wC(this.children,a||[],e,t,r,i,o):a?new Je(a.sort(Wr),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,xl(m,c,h+1,$r)),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(Wr):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 xr){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(Wr),Ci);return r?new Yr([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 ef(this.localsInner(e))}localsInner(e){if(this==at)return Ci;if(e.inlineContent||!this.local.some(xr.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof xr||t.push(this.local[r]);return t}forEachSet(e){e(this)}}Je.empty=new Je([],[]),Je.removeOverlap=ef;const at=Je.empty;class Yr{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,$r));return Yr.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 Yr?r=r.concat(o.members):r.push(o))}return Yr.from(r)}eq(e){if(!(e instanceof Yr)||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?ef(r?t:t.sort(Wr)):Ci}static from(e){switch(e.length){case 0:return at;case 1:return e[0];default:return new Yr(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 wC(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,k)=>{let T=k-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&&T&&(c[M]+=T,c[M+1]+=T)}p+=T}),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:k}=r.content.findIndex(p),T=r.maybeChild(S);if(T&&k==p&&k+T.nodeSize==b){let M=c[h+2].mapInner(t,T,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=vC(c,n,e,t,i,o,a),m=xl(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(Wr),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 vC(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 xl(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=xl(h,c,t+f+1,r);m!=at&&i.push(f,f+c.nodeSize,m)}});let a=a0(o?u0(n):n,-t).sort(Wr);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 Wr(n,e){return n.from-e.from||n.to-e.to}function ef(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&&Wr(t,n[e])>0;)e++;n.splice(e,0,t)}for(var mr={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:'"'},SC=typeof navigator<"u"&&/Mac/.test(navigator.platform),xC=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Ze=0;Ze<10;Ze++)mr[48+Ze]=mr[96+Ze]=String(Ze);for(var Ze=1;Ze<=24;Ze++)mr[Ze+111]="F"+Ze;for(var Ze=65;Ze<=90;Ze++)mr[Ze]=String.fromCharCode(Ze+32),kl[Ze]=String.fromCharCode(Ze);for(var tf in mr)kl.hasOwnProperty(tf)||(kl[tf]=mr[tf]);function kC(n){var e=SC&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||xC&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?kl:mr)[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 EC=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function _C(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))EC?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 CC(n){let e=Object.create(null);for(let t in n)e[_C(t)]=n[t];return e}function nf(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 TC(n){return new lt({props:{handleKeyDown:MC(n)}})}function MC(n){let e=CC(n);return function(t,r){let i=kC(r),o,a=e[nf(i,r)];if(a&&a(t.state,t.dispatch,t))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let c=e[nf(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=mr[r.keyCode])&&o!=i){let c=e[nf(o,r)];if(c&&c(t.state,t.dispatch,t))return!0}}return!1}}const rf=(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=sf(r);if(!i){let a=r.blockRange(),c=a&&Si(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&&(Ti(o,"end")||Y.isSelectable(o)))for(let a=r.depth;;a--){let c=ml(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(Ti(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},AC=(n,e,t)=>{let r=h0(n,t);if(!r)return!1;let i=sf(r);return i?p0(n,i,e):!1},IC=(n,e,t)=>{let r=g0(n,t);if(!r)return!1;let i=of(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=ml(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 Ti(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=sf(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 sf(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=of(r);if(!i)return!1;let o=i.nodeAfter;if(x0(n,i,e,1))return!0;if(r.parent.content.size==0&&(Ti(o,"start")||Y.isSelectable(o))){let a=ml(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(Ti(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=of(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 of(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 NC=(n,e)=>{let t=n.selection,r=t instanceof Y,i;if(r){if(t.node.isTextblock||!ur(n.doc,t.from))return!1;i=t.from}else if(i=pl(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},OC=(n,e)=>{let t=n.selection,r;if(t instanceof Y){if(t.node.isTextblock||!ur(n.doc,t.to))return!1;r=t.to}else if(r=pl(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},RC=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&Si(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},w0=(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 lf(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 LC=(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=lf(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},v0=(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=lf(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&&Si(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)};function PC(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=lf(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 DC=PC(),BC=(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 zC(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||ur(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&&zC(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 k=n.tr.step(new Ke(e.pos-1,b,e.pos,b,new W(S,1,0),a.length,!0)),T=k.doc.resolve(b+2*a.length);T.nodeAfter&&T.nodeAfter.type==i.type&&ur(k.doc,T.pos)&&k.join(T.pos),t(k.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&&Si(p);if(g!=null&&g>=e.depth)return t&&t(n.tr.lift(p,g).scrollIntoView()),!0;if(h&&Ti(o,"start",!0)&&Ti(i,"end")){let b=i,S=[];for(;S.push(b),!b.isTextblock;)b=b.lastChild;let k=o,T=1;for(;!k.isTextblock;k=k.firstChild)T++;if(b.canReplace(b.childCount,b.childCount,k.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+T,e.pos+o.nodeSize-T,new W(M,S.length,0),0,!0));t(P.scrollIntoView())}return!0}}return!1}function k0(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 FC=k0(-1),HC=k0(1);function $C(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o),c=a&&Lu(a,n,e);return c?(r&&r(t.tr.wrap(a,c).scrollIntoView()),!0):!1}}function E0(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 af(...n){return function(e,t,r){for(let i=0;i<n.length;i++)if(n[i](e,t,r))return!0;return!1}}af(rf,d0,m0),af(rf,y0,b0),af(w0,v0,S0,DC),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function WC(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 UC(c,a,n,e)?(r&&r(c.scrollIntoView()),!0):!1}}function UC(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 cl(f,f,e.depth),e.endIndex<e.parent.childCount&&(e=new cl(e.$from,a.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let c=Lu(o,t,r,e);return c?(n&&VC(n,e,c,i,t),!0):!1}function VC(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 KC(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?GC(e,t,n,o):JC(e,t,o):!0:!1}}function GC(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 cl(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const c=Si(r);if(c==null)return!1;i.lift(r,c);let f=i.mapping.map(o,-1)-1;return ur(i.doc,f)&&i.join(f),e(i.scrollIntoView()),!0}function JC(n,e,t){let r=n.tr,i=t.parent;for(let b=t.end,S=t.endIndex-1,k=t.startIndex;S>k;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 qC(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 El(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 cf{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,(...k)=>{const T=this.buildProps(h,t),M=b(...k)(T);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:El({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 _l(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}=_l(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 Mi(...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 uf(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)=>Mi(t,r),{})}function jC(n){return typeof n=="function"}function ae(n,e=void 0,...t){return jC(n)?e?n.bind(e)(...t):n(...t):n}function YC(n={}){return Object.keys(n).length===0&&n.constructor===Object}function XC(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function C0(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):XC(t.getAttribute(a.name));return c==null?o:{...o,[a.name]:c}},{});return{...r,...i}}}}function T0(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&YC(t)?!1:t!=null))}function M0(n,e){var t;const r=_0(n),{nodeExtensions:i,markExtensions:o}=_l(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=T0({...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=>C0(M,m)));const k=K(h,"renderHTML",p);k&&(b.toDOM=M=>k({node:M,HTMLAttributes:uf(M,m)}));const T=K(h,"renderText",p);return T&&(b.toText=T),[h.name,b]})),f=Object.fromEntries(o.map(h=>{const m=r.filter(T=>T.type===h.name),p={name:h.name,options:h.options,storage:h.storage,editor:e},g=n.reduce((T,M)=>{const P=K(M,"extendMarkSchema",p);return{...T,...P?P(h):{}}},{}),b=T0({...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(T=>{var M;return[T.name,{default:(M=T?.attribute)===null||M===void 0?void 0:M.default}]}))}),S=ae(K(h,"parseHTML",p));S&&(b.parseDOM=S.map(T=>C0(T,m)));const k=K(h,"renderHTML",p);return k&&(b.toDOM=T=>k({mark:T,HTMLAttributes:uf(T,m)})),[h.name,b]}));return new Zm({topNode:a,nodes:c,marks:f})}function ff(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=Ws.fromSchema(e).serializeFragment(n),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}const ZC=(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 hf(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class N0{constructor(e){this.find=e.find,this.handler=e.handler}}const QC=(n,e)=>{if(hf(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=ZC(h)+o;return a.forEach(g=>{if(m)return;const b=QC(p,g.find);if(!b)return;const S=f.state.tr,k=El({state:f.state,transaction:S}),T={from:r-(b[0].length-o.length),to:i},{commands:M,chain:P,can:F}=new cf({editor:t,state:k});g.handler({state:k,range:T,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 eT(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 tT(n){return Object.prototype.toString.call(n).slice(8,-1)}function Tl(n){return tT(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function Ml(n,e){const t={...n};return Tl(n)&&Tl(e)&&Object.keys(e).forEach(r=>{Tl(e[r])&&Tl(n[r])?t[r]=Ml(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:()=>Ml(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 nT(n){return typeof n=="number"}class rT{constructor(e){this.find=e.find,this.handler=e.handler}}const iT=(n,e,t)=>{if(hf(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 sT(n){const{editor:e,state:t,from:r,to:i,rule:o,pasteEvent:a,dropEvent:c}=n,{commands:f,chain:h,can:m}=new cf({editor:e,state:t}),p=[];return t.doc.nodesBetween(r,i,(b,S)=>{if(!b.isTextblock||b.type.spec.code)return;const k=Math.max(r,S),T=Math.min(i,S+b.content.size),M=b.textBetween(k-S,T-S,void 0,"\uFFFC");iT(M,o.find,a).forEach(F=>{if(F.index===void 0)return;const $=k+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 Al=null;const oT=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 lT(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 k=m.tr,T=El({state:m,transaction:k});if(!(!sT({editor:e,state:T,from:Math.max(p-1,0),to:g.b-1,rule:b,pasteEvent:S,dropEvent:c})||!k.steps.length)){try{c=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{c=null}return a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,k}};return t.map(m=>new lt({view(p){const g=S=>{var k;r=!((k=p.dom.parentElement)===null||k===void 0)&&k.contains(S.target)?p.dom.parentElement:null,r&&(Al=e)},b=()=>{Al&&(Al=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=Al;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],k=S.getMeta("uiEvent")==="paste"&&!i,T=S.getMeta("uiEvent")==="drop"&&!o,M=S.getMeta("applyPasteRules"),P=!!M;if(!k&&!T&&!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=oT(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(!(!nT(F)||!$||F===$.b))return f({rule:m,state:b,from:F,to:$,pasteEvt:a})}}))}function aT(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return Array.from(new Set(e))}class Pi{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=Pi.resolve(e),this.schema=M0(this.extensions,t),this.setupExtensions()}static resolve(e){const t=Pi.sort(Pi.flatten(e)),r=aT(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:ff(t.name,this.schema)},i=K(t,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=Pi.sort([...this.extensions].reverse()),r=[],i=[],o=t.map(a=>{const c={name:a.name,options:a.options,storage:a.storage,editor:e,type:ff(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 k=Object.fromEntries(Object.entries(h()).map(([T,M])=>[T,()=>M({editor:e})]));m={...m,...k}}const p=TC(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 k=S();f.push(...k)}return f}).flat();return[eT({editor:e,rules:r}),...lT({editor:e,rules:i}),...o]}get attributes(){return _0(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=_l(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=uf(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:ff(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:()=>Ml(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 cT(n,e,t){const{from:r,to:i}=e,{blockSeparator:o=`
11
+ `);return{dom:f,text:g,slice:e}}function N0(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(z.from(n.state.schema.text(e.replace(/\r\n?/g,`
12
+ `))),0,0):W.empty;let h=n.someProp("clipboardTextParser",g=>g(e,i,r,n));if(h)c=h;else{let g=i.marks(),{schema:b}=n.state,v=ro.fromSchema(b);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(x=>{let T=a.appendChild(document.createElement("p"));x&&T.appendChild(v.serializeNode(b.text(x,g)))})}}else n.someProp("transformPastedHTML",h=>{t=h(t,n)}),a=nT(t),pf&&rT(a);let d=a&&a.querySelector("[data-pm-slice]"),m=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(m&&m[3])for(let h=+m[3];h>0;h--){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")||Os.fromSchema(n.state.schema)).parseSlice(a,{preserveWhitespace:!!(f||m),context:i,ruleFromNode(g){return g.nodeName=="BR"&&!g.nextSibling&&g.parentNode&&!QC.test(g.parentNode.nodeName)?{ignore:!0}:null}})),m)c=iT(P0(c,+m[1],+m[2]),m[4]);else if(c=W.maxOpen(eT(c.content,i),!0),c.openStart||c.openEnd){let h=0,g=0;for(let b=c.content.firstChild;h<c.openStart&&!b.type.spec.isolating;h++,b=b.firstChild);for(let b=c.content.lastChild;g<c.openEnd&&!b.type.spec.isolating;g++,b=b.lastChild);c=P0(c,h,g)}return n.someProp("transformPasted",h=>{c=h(c,n)}),c}const QC=/^(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 eT(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),d;if(!f)return a=null;if(d=a.length&&o.length&&R0(f,o,c,a[a.length-1],0))a[a.length-1]=d;else{a.length&&(a[a.length-1]=L0(a[a.length-1],o.length));let m=O0(c,f);a.push(m),i=i.matchType(m.type),o=f}}),a)return z.from(a)}return n}function O0(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,z.from(n));return n}function R0(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=R0(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(z.from(O0(t,n,i+1))))}}function L0(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,L0(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(z.empty,!0);return n.copy(t.append(r))}function wf(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=wf(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(z.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,a.copy(c))}function P0(n,e,t){return e<n.openStart&&(n=new W(wf(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new W(wf(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const D0={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 F0=null;function z0(){return F0||(F0=document.implementation.createHTMLDocument("title"))}let Sf=null;function tT(n){let e=window.trustedTypes;return e?(Sf||(Sf=e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),Sf.createHTML(n)):n}function nT(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=z0().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&D0[r[1].toLowerCase()])&&(n=i.map(o=>"<"+o+">").join("")+n+i.map(o=>"</"+o+">").reverse().join("")),t.innerHTML=tT(n),i)for(let o=0;o<i.length;o++)t=t.querySelector(i[o])||t;return t}function rT(n){let e=n.querySelectorAll(gr?"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 iT(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=z.from(f.create(r[c+1],i)),o++,a++}return new W(i,o,a)}const nn={},Mt={};function br(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,!$0(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Fs&&gr&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),hf&&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,h0(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||ZC(n,t)?t.preventDefault():br(n,"key")},Mt.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},Mt.keypress=(n,e)=>{let t=e;if($0(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 Pl(n){return{left:n.clientX,top:n.clientY}}function sT(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function vf(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 Pi(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 oT(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&Y.isSelectable(r)?(Pi(n,new Y(t)),!0):!1}function lT(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?(Pi(n,Y.create(n.state.doc,i)),!0):!1}function aT(n,e,t,r,i){return vf(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?lT(n,t):oT(n,t))}function cT(n,e,t,r){return vf(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function uT(n,e,t,r){return vf(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||fT(n,t,r)}function fT(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(Pi(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)Pi(n,ce.create(r,c+1,c+1+a.content.size));else if(Y.isSelectable(a))Pi(n,Y.create(r,c));else continue;return!0}}function _f(n){return Dl(n)}const B0=Wt?"metaKey":"ctrlKey";nn.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=_f(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&sT(t,n.input.lastClick)&&!t[B0]&&(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(Pl(t));a&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new dT(n,a,t,!!r)):(o=="doubleClick"?cT:uT)(n,a.pos,a.inside,t)?t.preventDefault():br(n,"pointer"))};class dT{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[B0],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:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof Y&&d.from<=a&&d.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Rl&&!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)),br(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(()=>mf(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(Pl(e))),this.updateAllowDefault(e),this.allowDefault||!t?br(this.view,"pointer"):aT(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Jr&&this.mightDrag&&!this.mightDrag.node.isAtom||gr&&!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)?(Pi(this.view,pe.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):br(this.view,"pointer")}move(e){this.updateAllowDefault(e),br(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)}}nn.touchstart=n=>{n.input.lastTouch=Date.now(),_f(n),br(n,"pointer")},nn.touchmove=n=>{n.input.lastTouch=Date.now(),br(n,"pointer")},nn.contextmenu=n=>_f(n);function $0(n,e){return n.composing?!0:Jr&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const hT=Fs?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(),Dl(n,!0),n.markCursor=null;else if(Dl(n,!e.selection.empty),Rl&&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}H0(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++,H0(n,20))};function H0(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>Dl(n),e))}function pT(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=mT());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function mT(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function Dl(n,e=!1){if(!(Fs&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),pT(n),e||n.docView&&n.docView.dirty){let t=HC(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 gT(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 Bs=Ds&&g0<15||hf&&$C<604;nn.copy=Mt.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=Bs?null:t.clipboardData,a=r.content(),{dom:c,text:f}=I0(n,a);o?(t.preventDefault(),o.clearData(),o.setData("text/html",c.innerHTML),o.setData("text/plain",f)):gT(n,c),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function yT(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function bT(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?xf(n,r.value,null,i,e):xf(n,r.textContent,r.innerHTML,i,e)},50)}function xf(n,e,t,r,i){let o=N0(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=yT(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 W0(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&&!Fs)return;let r=Bs?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&xf(n,W0(r),r.getData("text/html"),i,t)?t.preventDefault():bT(n,t)};class wT{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const V0=Wt?"altKey":"ctrlKey";nn.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(Pl(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 h=n.docView.nearestDesc(t.target,!0);h&&h.node.type.spec.draggable&&h!=n.docView&&(a=Y.create(n.state.doc,h.posBefore))}}let c=(a||n.state.selection).content(),{dom:f,text:d,slice:m}=I0(n,c);(!t.dataTransfer.files.length||!gr||y0>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(Bs?"Text":"text/html",f.innerHTML),t.dataTransfer.effectAllowed="copyMove",Bs||t.dataTransfer.setData("text/plain",d),n.dragging=new wT(m,!t[V0],a)},nn.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(Pl(t));if(!i)return;let o=n.state.doc.resolve(i.pos),a=r&&r.slice;a?n.someProp("transformPasted",v=>{a=v(a,n)}):a=N0(n,W0(t.dataTransfer),Bs?null:t.dataTransfer.getData("text/html"),!1,o);let c=!!(r&&!t[V0]);if(n.someProp("handleDrop",v=>v(n,t,a||W.empty,c))){t.preventDefault();return}if(!a)return;t.preventDefault();let f=a?TC(n.state.doc,o.pos,a):o.pos;f==null&&(f=o.pos);let d=n.state.tr;if(c){let{node:v}=r;v?v.replace(d):d.deleteSelection()}let m=d.mapping.map(f),h=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,g=d.doc;if(h?d.replaceRangeWith(m,m,a.content.firstChild):d.replaceRange(m,m,a),d.doc.eq(g))return;let b=d.doc.resolve(m);if(h&&Y.isSelectable(a.content.firstChild)&&b.nodeAfter&&b.nodeAfter.sameMarkup(a.content.firstChild))d.setSelection(new Y(b));else{let v=d.mapping.map(f);d.mapping.maps[d.mapping.maps.length-1].forEach((x,T,M,L)=>v=L),d.setSelection(x0(n,b,d.doc.resolve(v)))}n.focus(),n.dispatch(d.setMeta("uiEvent","drop"))},nn.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())&&mf(n)},20))},nn.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)},nn.beforeinput=(n,e)=>{if(gr&&Fs&&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,h0(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)nn[n]=Mt[n];function $s(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 Qa{constructor(e,t){this.toDOM=e,this.spec=t||Gr,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 vn(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Qa&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&$s(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Mr{constructor(e,t){this.attrs=e,this.spec=t||Gr}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 vn(o,a,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Mr&&$s(this.attrs,e.attrs)&&$s(this.spec,e.spec)}static is(e){return e.type instanceof Mr}destroy(){}}let ST=class Cb{constructor(e,t){this.attrs=e,this.spec=t||Gr}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 vn(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 Cb&&$s(this.attrs,e.attrs)&&$s(this.spec,e.spec)}destroy(){}};class vn{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new vn(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 vn(e,e,new Qa(t,r))}static inline(e,t,r,i){return new vn(e,t,new Mr(r,i))}static node(e,t,r,i){return new vn(e,t,new ST(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Mr}get widget(){return this.type instanceof Qa}}const Di=[],Gr={};class Ge{constructor(e,t){this.local=e.length?e:Di,this.children=t.length?t:Di}static create(e,t){return t.length?Fl(t,e,0,Gr):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||Gr)}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 Ge(a.sort(qr),Di):at}add(e,t){return t.length?this==at?Ge.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,o=0;e.forEach((c,f)=>{let d=f+r,m;if(m=K0(t,c,d)){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,d+1):i.splice(o,0,f,f+c.nodeSize,Fl(m,c,d+1,Gr)),o+=3}});let a=U0(o?J0(t):t,-r);for(let c=0;c<a.length;c++)a[c].type.valid(e,a[c])||a.splice(c--,1);return new Ge(a.length?this.local.concat(a).sort(qr):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,h;m<e.length;m++)(h=e[m])&&h.from>c&&h.to<f&&(e[m]=null,(a||(a=[])).push(h));if(!a)continue;r==this.children&&(r=this.children.slice());let d=r[o+2].removeInner(a,c+1);d!=at?r[o+2]=d:(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 Ge(i,r):at}forChild(e,t){if(this==at)return this;if(t.isLeaf)return Ge.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 Mr){let d=Math.max(o,f.from)-o,m=Math.min(a,f.to)-o;d<m&&(i||(i=[])).push(f.copy(d,m))}}if(i){let c=new Ge(i.sort(qr),Di);return r?new oi([c,r]):c}return r||at}eq(e){if(this==e)return!0;if(!(e instanceof Ge)||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 Ef(this.localsInner(e))}localsInner(e){if(this==at)return Di;if(e.inlineContent||!this.local.some(Mr.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Mr||t.push(this.local[r]);return t}forEachSet(e){e(this)}}Ge.empty=new Ge([],[]),Ge.removeOverlap=Ef;const at=Ge.empty;class oi{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,Gr));return oi.from(r)}forChild(e,t){if(t.isLeaf)return Ge.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=at&&(o instanceof oi?r=r.concat(o.members):r.push(o))}return oi.from(r)}eq(e){if(!(e instanceof oi)||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?Ef(r?t:t.sort(qr)):Di}static from(e){switch(e.length){case 0:return at;case 1:return e[0];default:return new oi(e.every(t=>t instanceof Ge)?e:e.reduce((t,r)=>t.concat(r instanceof Ge?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 d=0,m=o;d<t.maps.length;d++){let h=0;t.maps[d].forEach((g,b,v,x)=>{let T=x-v-(b-g);for(let M=0;M<c.length;M+=3){let L=c[M+1];if(L<0||g>L+m-h)continue;let B=c[M]+m-h;b>=B?c[M+1]=g<=B?-2:-1:g>=m&&T&&(c[M]+=T,c[M+1]+=T)}h+=T}),m=t.maps[d].map(m,-1)}let f=!1;for(let d=0;d<c.length;d+=3)if(c[d+1]<0){if(c[d+1]==-2){f=!0,c[d+1]=-1;continue}let m=t.map(n[d]+o),h=m-i;if(h<0||h>=r.content.size){f=!0;continue}let g=t.map(n[d+1]+o,-1),b=g-i,{index:v,offset:x}=r.content.findIndex(h),T=r.maybeChild(v);if(T&&x==h&&x+T.nodeSize==b){let M=c[d+2].mapInner(t,T,m+1,n[d]+o+1,a);M!=at?(c[d]=h,c[d+1]=b,c[d+2]=M):(c[d+1]=-2,f=!0)}else f=!0}if(f){let d=_T(c,n,e,t,i,o,a),m=Fl(d,r,0,a);e=m.local;for(let h=0;h<c.length;h+=3)c[h+1]<0&&(c.splice(h,3),h-=3);for(let h=0,g=0;h<m.children.length;h+=3){let b=m.children[h];for(;g<c.length&&c[g]<b;)g+=3;c.splice(g,0,m.children[h],m.children[h+1],m.children[h+2])}}return new Ge(e.sort(qr),c)}function U0(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 vn(i.from+e,i.to+e,i.type))}return t}function _T(n,e,t,r,i,o,a){function c(f,d){for(let m=0;m<f.local.length;m++){let h=f.local[m].map(r,i,d);h?t.push(h):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]+d+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 K0(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 J0(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function Fl(n,e,t,r){let i=[],o=!1;e.forEach((c,f)=>{let d=K0(n,c,f+t);if(d){o=!0;let m=Fl(d,c,t+f+1,r);m!=at&&i.push(f,f+c.nodeSize,m)}});let a=U0(o?J0(n):n,-t).sort(qr);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 Ge(a,i):at}function qr(n,e){return n.from-e.from||n.to-e.to}function Ef(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),G0(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),G0(e,i,r.copy(o.from,r.to)));break}}}return e}function G0(n,e,t){for(;e<n.length&&qr(t,n[e])>0;)e++;n.splice(e,0,t)}for(var wr={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:"'"},zl={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++)wr[48+Ze]=wr[96+Ze]=String(Ze);for(var Ze=1;Ze<=24;Ze++)wr[Ze+111]="F"+Ze;for(var Ze=65;Ze<=90;Ze++)wr[Ze]=String.fromCharCode(Ze+32),zl[Ze]=String.fromCharCode(Ze);for(var kf in wr)zl.hasOwnProperty(kf)||(zl[kf]=wr[kf]);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?zl:wr)[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 CT=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))CT?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 MT(n){let e=Object.create(null);for(let t in n)e[TT(t)]=n[t];return e}function Cf(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 AT(n){return new lt({props:{handleKeyDown:IT(n)}})}function IT(n){let e=MT(n);return function(t,r){let i=kT(r),o,a=e[Cf(i,r)];if(a&&a(t.state,t.dispatch,t))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let c=e[Cf(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=wr[r.keyCode])&&o!=i){let c=e[Cf(o,r)];if(c&&c(t.state,t.dispatch,t))return!0}}return!1}}const Tf=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function q0(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const j0=(n,e,t)=>{let r=q0(n,t);if(!r)return!1;let i=Mf(r);if(!i){let a=r.blockRange(),c=a&&Ni(a);return c==null?!1:(e&&e(n.tr.lift(a,c).scrollIntoView()),!0)}let o=i.nodeBefore;if(i1(n,i,e,-1))return!0;if(r.parent.content.size==0&&(Fi(o,"end")||Y.isSelectable(o)))for(let a=r.depth;;a--){let c=Il(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(Fi(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},NT=(n,e,t)=>{let r=q0(n,t);if(!r)return!1;let i=Mf(r);return i?Y0(n,i,e):!1},OT=(n,e,t)=>{let r=Z0(n,t);if(!r)return!1;let i=Af(r);return i?Y0(n,i,e):!1};function Y0(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 d=Il(n.doc,o,f,W.empty);if(!d||d.from!=o||d instanceof Je&&d.slice.size>=f-o)return!1;if(t){let m=n.tr.step(d);m.setSelection(ce.create(m.doc,o)),t(m.scrollIntoView())}return!0}function Fi(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 X0=(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=Mf(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 Mf(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 Z0(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const Q0=(n,e,t)=>{let r=Z0(n,t);if(!r)return!1;let i=Af(r);if(!i)return!1;let o=i.nodeAfter;if(i1(n,i,e,1))return!0;if(r.parent.content.size==0&&(Fi(o,"start")||Y.isSelectable(o))){let a=Il(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(Fi(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},e1=(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=Af(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 Af(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 RT=(n,e)=>{let t=n.selection,r=t instanceof Y,i;if(r){if(t.node.isTextblock||!pr(n.doc,t.from))return!1;i=t.from}else if(i=Al(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},LT=(n,e)=>{let t=n.selection,r;if(t instanceof Y){if(t.node.isTextblock||!pr(n.doc,t.to))return!1;r=t.to}else if(r=Al(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},PT=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&Ni(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},t1=(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 If(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 DT=(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=If(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},n1=(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=If(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},r1=(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(zn(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&Ni(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)};function FT(n){return(e,t)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof Y&&e.selection.node.isBlock)return!r.parentOffset||!zn(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,d=!1;for(let b=r.depth;;b--)if(r.node(b).isBlock){f=r.end(b)==r.pos+(r.depth-b),d=r.start(b)==r.pos-(r.depth-b),c=If(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 h=m.mapping.map(r.pos),g=zn(m.doc,h,o.length,o);if(g||(o[0]=c?{type:c}:null,g=zn(m.doc,h,o.length,o)),m.split(h,o.length,o),!f&&d&&r.node(a).type!=c){let b=m.mapping.map(r.before(a)),v=m.doc.resolve(b);c&&r.node(a-1).canReplaceWith(v.index(),v.index()+1,c)&&m.setNodeMarkup(m.mapping.map(r.before(a)),c)}return t&&t(m.scrollIntoView()),!0}}const zT=FT(),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 $T(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||pr(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function i1(n,e,t,r){let i=e.nodeBefore,o=e.nodeAfter,a,c,f=i.type.spec.isolating||o.type.spec.isolating;if(!f&&$T(n,e,t))return!0;let d=!f&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(a=(c=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&c.matchType(a[0]||o.type).validEnd){if(t){let b=e.pos+o.nodeSize,v=z.empty;for(let M=a.length-1;M>=0;M--)v=z.from(a[M].create(null,v));v=z.from(i.copy(v));let x=n.tr.step(new Ke(e.pos-1,b,e.pos,b,new W(v,1,0),a.length,!0)),T=x.doc.resolve(b+2*a.length);T.nodeAfter&&T.nodeAfter.type==i.type&&pr(x.doc,T.pos)&&x.join(T.pos),t(x.scrollIntoView())}return!0}let m=o.type.spec.isolating||r>0&&f?null:pe.findFrom(e,1),h=m&&m.$from.blockRange(m.$to),g=h&&Ni(h);if(g!=null&&g>=e.depth)return t&&t(n.tr.lift(h,g).scrollIntoView()),!0;if(d&&Fi(o,"start",!0)&&Fi(i,"end")){let b=i,v=[];for(;v.push(b),!b.isTextblock;)b=b.lastChild;let x=o,T=1;for(;!x.isTextblock;x=x.firstChild)T++;if(b.canReplace(b.childCount,b.childCount,x.content)){if(t){let M=z.empty;for(let B=v.length-1;B>=0;B--)M=z.from(v[B].copy(M));let L=n.tr.step(new Ke(e.pos-v.length,e.pos+o.nodeSize,e.pos+T,e.pos+o.nodeSize-T,new W(M,v.length,0),0,!0));t(L.scrollIntoView())}return!0}}return!1}function s1(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=s1(-1),WT=s1(1);function VT(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o),c=a&&rf(a,n,e);return c?(r&&r(t.tr.wrap(a,c).scrollIntoView()),!0):!1}}function o1(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,d)=>{if(i)return!1;if(!(!f.isTextblock||f.hasMarkup(n,e)))if(f.type==n)i=!0;else{let m=t.doc.resolve(d),h=m.index();i=m.parent.canReplaceWith(h,h+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 Nf(...n){return function(e,t,r){for(let i=0;i<n.length;i++)if(n[i](e,t,r))return!0;return!1}}Nf(Tf,j0,X0),Nf(Tf,Q0,e1),Nf(t1,n1,r1,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 KT(c,a,n,e)?(r&&r(c.scrollIntoView()),!0):!1}}function KT(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 El(f,f,e.depth),e.endIndex<e.parent.childCount&&(e=new El(e.$from,a.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let c=rf(o,t,r,e);return c?(n&&JT(n,e,c,i,t),!0):!1}function JT(n,e,t,r,i){let o=z.empty;for(let m=t.length-1;m>=0;m--)o=z.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),d=e.parent;for(let m=e.startIndex,h=e.endIndex,g=!0;m<h;m++,g=!1)!g&&zn(n.doc,f,c)&&(n.split(f,c),f+=2*c),f+=d.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?qT(e,t,n,o):jT(e,t,o):!0:!1}}function qT(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(z.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new El(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const c=Ni(r);if(c==null)return!1;i.lift(r,c);let f=i.mapping.map(o,-1)-1;return pr(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,v=t.endIndex-1,x=t.startIndex;v>x;v--)b-=i.child(v).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,d=o.node(-1),m=o.index(-1);if(!d.canReplace(m+(c?0:1),m+1,a.content.append(f?z.empty:z.from(i))))return!1;let h=o.pos,g=h+a.nodeSize;return r.step(new Ke(h-(c?1:0),g+(f?1:0),h+1,g-1,new W((c?z.empty:z.from(i.copy(z.empty))).append(f?z.empty:z.from(i.copy(z.empty))),c?0:1,f?0:1),c?0:1)),e(r.scrollIntoView()),!0}function YT(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,d=>d.childCount>0&&d.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 d=f.lastChild&&f.lastChild.type==c.type,m=z.from(d?n.create():null),h=new W(z.from(n.create(null,z.from(c.type.create(null,m)))),d?3:1,0),g=o.start,b=o.end;t(e.tr.step(new Ke(g-(d?3:1),b,g,b,h,1,!0)).scrollIntoView())}return!0}}function Bl(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 Of{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 h=f(...m)(a);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),h}]))}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,d=e||o.tr,m=()=>(!f&&t&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(d),c.every(g=>g===!0)),h={...Object.fromEntries(Object.entries(r).map(([g,b])=>[g,(...x)=>{const T=this.buildProps(d,t),M=b(...x)(T);return c.push(M),h}])),run:m};return h}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,d])=>[f,(...m)=>d(...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:Bl({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,d])=>[f,(...m)=>d(...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 $l(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 l1(n){const e=[],{nodeExtensions:t,markExtensions:r}=$l(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(h=>{Object.entries(m.attributes).forEach(([g,b])=>{e.push({type:h,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 d=f();Object.entries(d).forEach(([m,h])=>{const g={...o,...h};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 zi(...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(" "):[],d=c.filter(m=>!f.includes(m));r[i]=[...f,...d].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):[],d=new Map;f.forEach(m=>{const[h,g]=m.split(":").map(b=>b.trim());d.set(h,g)}),c.forEach(m=>{const[h,g]=m.split(":").map(b=>b.trim());d.set(h,g)}),r[i]=Array.from(d.entries()).map(([m,h])=>`${m}: ${h}`).join("; ")}else r[i]=o}),r},{})}function Rf(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)=>zi(t,r),{})}function XT(n){return typeof n=="function"}function ae(n,e=void 0,...t){return XT(n)?e?n.bind(e)(...t):n(...t):n}function ZT(n={}){return Object.keys(n).length===0&&n.constructor===Object}function QT(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function a1(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):QT(t.getAttribute(a.name));return c==null?o:{...o,[a.name]:c}},{});return{...r,...i}}}}function c1(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&ZT(t)?!1:t!=null))}function u1(n,e){var t;const r=l1(n),{nodeExtensions:i,markExtensions:o}=$l(n),a=(t=i.find(d=>K(d,"topNode")))===null||t===void 0?void 0:t.name,c=Object.fromEntries(i.map(d=>{const m=r.filter(M=>M.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:e},g=n.reduce((M,L)=>{const B=K(L,"extendNodeSchema",h);return{...M,...B?B(d):{}}},{}),b=c1({...g,content:ae(K(d,"content",h)),marks:ae(K(d,"marks",h)),group:ae(K(d,"group",h)),inline:ae(K(d,"inline",h)),atom:ae(K(d,"atom",h)),selectable:ae(K(d,"selectable",h)),draggable:ae(K(d,"draggable",h)),code:ae(K(d,"code",h)),whitespace:ae(K(d,"whitespace",h)),linebreakReplacement:ae(K(d,"linebreakReplacement",h)),defining:ae(K(d,"defining",h)),isolating:ae(K(d,"isolating",h)),attrs:Object.fromEntries(m.map(M=>{var L;return[M.name,{default:(L=M?.attribute)===null||L===void 0?void 0:L.default}]}))}),v=ae(K(d,"parseHTML",h));v&&(b.parseDOM=v.map(M=>a1(M,m)));const x=K(d,"renderHTML",h);x&&(b.toDOM=M=>x({node:M,HTMLAttributes:Rf(M,m)}));const T=K(d,"renderText",h);return T&&(b.toText=T),[d.name,b]})),f=Object.fromEntries(o.map(d=>{const m=r.filter(T=>T.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:e},g=n.reduce((T,M)=>{const L=K(M,"extendMarkSchema",h);return{...T,...L?L(d):{}}},{}),b=c1({...g,inclusive:ae(K(d,"inclusive",h)),excludes:ae(K(d,"excludes",h)),group:ae(K(d,"group",h)),spanning:ae(K(d,"spanning",h)),code:ae(K(d,"code",h)),attrs:Object.fromEntries(m.map(T=>{var M;return[T.name,{default:(M=T?.attribute)===null||M===void 0?void 0:M.default}]}))}),v=ae(K(d,"parseHTML",h));v&&(b.parseDOM=v.map(T=>a1(T,m)));const x=K(d,"renderHTML",h);return x&&(b.toDOM=T=>x({mark:T,HTMLAttributes:Rf(T,m)})),[d.name,b]}));return new Lg({topNode:a,nodes:c,marks:f})}function Lf(n,e){return e.nodes[n]||e.marks[n]||null}function f1(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}function d1(n,e){const t=ro.fromSchema(e).serializeFragment(n),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}const eM=(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,d;const m=((d=(f=i.type.spec).toText)===null||d===void 0?void 0:d.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 Pf(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class h1{constructor(e){this.find=e.find,this.handler=e.handler}}const tM=(n,e)=>{if(Pf(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 Hl(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 d=f.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(g=>g.type.spec.code))return!1;let m=!1;const h=eM(d)+o;return a.forEach(g=>{if(m)return;const b=tM(h,g.find);if(!b)return;const v=f.state.tr,x=Bl({state:f.state,transaction:v}),T={from:r-(b[0].length-o.length),to:i},{commands:M,chain:L,can:B}=new Of({editor:t,state:x});g.handler({state:x,range:T,match:b,commands:M,chain:L,can:B})===null||!v.steps.length||(v.setMeta(c,{transform:v,from:r,to:i,text:o}),f.dispatch(v),m=!0)}),m}function nM(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=d1(z.from(m),a.schema);const{from:h}=f,g=h+m.length;Hl({editor:e,from:h,to:g,text:m,rules:t,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,a,c){return Hl({editor:e,from:o,to:a,text:c,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Hl({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?Hl({editor:e,from:a.pos,to:a.pos,text:`
14
+ `,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function rM(n){return Object.prototype.toString.call(n).slice(8,-1)}function Wl(n){return rM(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function Vl(n,e){const t={...n};return Wl(n)&&Wl(e)&&Object.keys(e).forEach(r=>{Wl(e[r])&&Wl(n[r])?t[r]=Vl(n[r],e[r]):t[r]=e[r]}),t}class At{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 At(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Vl(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new At(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(d=>d?.type.name===t.name))return!1;const f=a.find(d=>d?.type.name===t.name);return f&&r.removeStoredMark(f),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}function iM(n){return typeof n=="number"}class sM{constructor(e){this.find=e.find,this.handler=e.handler}}const oM=(n,e,t)=>{if(Pf(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 lM(n){const{editor:e,state:t,from:r,to:i,rule:o,pasteEvent:a,dropEvent:c}=n,{commands:f,chain:d,can:m}=new Of({editor:e,state:t}),h=[];return t.doc.nodesBetween(r,i,(b,v)=>{if(!b.isTextblock||b.type.spec.code)return;const x=Math.max(r,v),T=Math.min(i,v+b.content.size),M=b.textBetween(x-v,T-v,void 0,"\uFFFC");oM(M,o.find,a).forEach(B=>{if(B.index===void 0)return;const H=x+B.index+1,V=H+B[0].length,ue={from:t.tr.mapping.map(H),to:t.tr.mapping.map(V)},de=o.handler({state:t,range:ue,match:B,commands:f,chain:d,can:m,pasteEvent:a,dropEvent:c});h.push(de)})}),h.every(b=>b!==null)}let Ul=null;const aM=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 cM(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:h,to:g,rule:b,pasteEvt:v})=>{const x=m.tr,T=Bl({state:m,transaction:x});if(!(!lM({editor:e,state:T,from:Math.max(h-1,0),to:g.b-1,rule:b,pasteEvent:v,dropEvent:c})||!x.steps.length)){try{c=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{c=null}return a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,x}};return t.map(m=>new lt({view(h){const g=v=>{var x;r=!((x=h.dom.parentElement)===null||x===void 0)&&x.contains(v.target)?h.dom.parentElement:null,r&&(Ul=e)},b=()=>{Ul&&(Ul=null)};return window.addEventListener("dragstart",g),window.addEventListener("dragend",b),{destroy(){window.removeEventListener("dragstart",g),window.removeEventListener("dragend",b)}}},props:{handleDOMEvents:{drop:(h,g)=>{if(o=r===h.dom.parentElement,c=g,!o){const b=Ul;b&&setTimeout(()=>{const v=b.state.selection;v&&b.commands.deleteRange({from:v.from,to:v.to})},10)}return!1},paste:(h,g)=>{var b;const v=(b=g.clipboardData)===null||b===void 0?void 0:b.getData("text/html");return a=g,i=!!v?.includes("data-pm-slice"),!1}}},appendTransaction:(h,g,b)=>{const v=h[0],x=v.getMeta("uiEvent")==="paste"&&!i,T=v.getMeta("uiEvent")==="drop"&&!o,M=v.getMeta("applyPasteRules"),L=!!M;if(!x&&!T&&!L)return;if(L){let{text:V}=M;typeof V=="string"?V=V:V=d1(z.from(V),b.schema);const{from:ue}=M,de=ue+V.length,be=aM(V);return f({rule:m,state:b,from:ue,to:{b:de},pasteEvt:be})}const B=g.doc.content.findDiffStart(b.doc.content),H=g.doc.content.findDiffEnd(b.doc.content);if(!(!iM(B)||!H||B===H.b))return f({rule:m,state:b,from:B,to:H,pasteEvt:a})}}))}function uM(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return Array.from(new Set(e))}class ji{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=ji.resolve(e),this.schema=u1(this.extensions,t),this.setupExtensions()}static resolve(e){const t=ji.sort(ji.flatten(e)),r=uM(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:Lf(t.name,this.schema)},i=K(t,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=ji.sort([...this.extensions].reverse()),r=[],i=[],o=t.map(a=>{const c={name:a.name,options:a.options,storage:a.storage,editor:e,type:Lf(a.name,this.schema)},f=[],d=K(a,"addKeyboardShortcuts",c);let m={};if(a.type==="mark"&&K(a,"exitable",c)&&(m.ArrowRight=()=>At.handleExit({editor:e,mark:a})),d){const x=Object.fromEntries(Object.entries(d()).map(([T,M])=>[T,()=>M({editor:e})]));m={...m,...x}}const h=AT(m);f.push(h);const g=K(a,"addInputRules",c);f1(a,e.options.enableInputRules)&&g&&r.push(...g());const b=K(a,"addPasteRules",c);f1(a,e.options.enablePasteRules)&&b&&i.push(...b());const v=K(a,"addProseMirrorPlugins",c);if(v){const x=v();f.push(...x)}return f}).flat();return[nM({editor:e,rules:r}),...cM({editor:e,rules:i}),...o]}get attributes(){return l1(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=$l(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,d,m,h,g)=>{const b=Rf(f,i);return a()({node:f,view:d,getPos:m,decorations:h,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:Lf(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),d=K(e,"onFocus",r),m=K(e,"onBlur",r),h=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),d&&this.editor.on("focus",d),m&&this.editor.on("blur",m),h&&this.editor.on("destroy",h)})}}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:()=>Vl(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 fM(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 uT(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=uT(t);return cT(r,{from:a,to:c},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:f})}}})]}});const fT=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),hT=(n=!1)=>({commands:e})=>e.setContent("",n),dT=()=>({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=Si(b);if(c.type.isTextblock){const{defaultType:k}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(b.start,k)}(S||S===0)&&e.lift(b,S)})}),!0},pT=n=>e=>n(e),mT=()=>({state:n,dispatch:e})=>v0(n,e),gT=(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},yT=()=>({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},bT=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},wT=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},vT=()=>({state:n,dispatch:e})=>rf(n,e),ST=()=>({commands:n})=>n.keyboardShortcut("Enter"),xT=()=>({state:n,dispatch:e})=>LC(n,e);function Il(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:hf(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function O0(n,e,t={}){return n.find(r=>r.type===e&&Il(Object.fromEntries(Object.keys(t).map(i=>[i,r.attrs[i]])),t))}function R0(n,e,t={}){return!!O0(n,e,t)}function df(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),!O0([...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 kT=(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=df(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},ET=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 Ur(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function _T(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,Ur(0,i,o),Ur(n.content.size,i,o)):ce.create(n,Ur(e,i,o),Ur(e,i,o))}function CT(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function pf(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const TT=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const a=()=>{(pf()||CT())&&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=_T(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},MT=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),AT=(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 Ol(n,e,t){if(n instanceof cr||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),Ol("",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?bs.fromSchema(f).parseSlice(Nl(n),t.parseOptions):bs.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=bs.fromSchema(e);return t.slice?o.parseSlice(Nl(n),t.parseOptions).content:o.parse(Nl(n),t.parseOptions)}return Ol("",e,t)}function IT(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 NT=n=>!("type"in n),OT=(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=Ol(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((NT(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(k=>{k.text&&(S+=k.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&&IT(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},RT=()=>({state:n,dispatch:e})=>NC(n,e),LT=()=>({state:n,dispatch:e})=>OC(n,e),PT=()=>({state:n,dispatch:e})=>d0(n,e),DT=()=>({state:n,dispatch:e})=>y0(n,e),BT=()=>({state:n,dispatch:e,tr:t})=>{try{const r=pl(n.doc,n.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},zT=()=>({state:n,dispatch:e,tr:t})=>{try{const r=pl(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},FT=()=>({state:n,dispatch:e})=>AC(n,e),HT=()=>({state:n,dispatch:e})=>IC(n,e);function D0(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function $T(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))pf()||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 WT=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const o=$T(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 mf(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=>Il(p.node.attrs,t,{strict:!1}));return o?!!h.length:h.reduce((p,g)=>p+g.to-g.from,0)>=f}const UT=(n,e={})=>({state:t,dispatch:r})=>{const i=We(n,t.schema);return mf(t,i,e)?RC(t,r):!1},VT=()=>({state:n,dispatch:e})=>S0(n,e),KT=n=>({state:e,dispatch:t})=>{const r=We(n,e.schema);return KC(r)(e,t)},GT=()=>({state:n,dispatch:e})=>w0(n,e);function gf(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 JT=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const c=gf(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},qT=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),jT=()=>({tr:n,dispatch:e})=>{if(e){const t=new At(n.doc);n.setSelection(t)}return!0},YT=()=>({state:n,dispatch:e})=>m0(n,e),XT=()=>({state:n,dispatch:e})=>b0(n,e),ZT=()=>({state:n,dispatch:e})=>BC(n,e),QT=()=>({state:n,dispatch:e})=>HC(n,e),eM=()=>({state:n,dispatch:e})=>FC(n,e);function tM(n,e,t={},r={}){return Ol(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 O_(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 yf(n){return e=>oM(e.$from,n)}function lM(n,e){const t=Pi.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=gf(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=df(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 Rl(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=>Il(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,(k,T)=>{if(!k.isText&&!k.marks.length)return;const M=Math.max(b,T),P=Math.min(S,T+k.nodeSize),F=P-M;a+=F,c.push(...k.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=>Il(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}=_l(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(k=>k.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),k=Math.min(b+g.nodeSize,p);g.marks.find(M=>M.type===f)?g.marks.forEach(M=>{f===M.type&&t.addMark(S,k,f.create({...M.attrs,...e}))}):t.addMark(S,k,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})=>E0(o,{...a,...e})(t)?!0:c.clearNodes()).command(({state:c})=>E0(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=Ur(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=Ur(i,a,c),h=Ur(o,a,c),m=ce.create(r,f,h);e.setSelection(m)}return!0},vM=n=>({state:e,dispatch:t})=>{const r=We(n,e.schema);return qC(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=Rl(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 k=e.mapping.map(c.before()),T=e.doc.resolve(k);c.node(-1).canReplaceWith(T.index(),T.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,$={...Rl(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={...Rl(g,p.type.name,p.attrs),...e},k={...Rl(g,f.node().type.name,f.node().attrs),...e};t.delete(f.pos,h.pos);const T=b?[{type:c,attrs:S},{type:b,attrs:k}]:[{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,T).scrollIntoView(),!$||!i)return!0;const U=$.filter(ue=>F.includes(ue.type.name));t.ensureMarks(U)}return!0},bf=(n,e)=>{const t=yf(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&&ur(n.doc,t.pos)&&n.join(t.pos),!0},wf=(n,e)=>{const t=yf(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&&ur(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:k,storedMarks:T}=a,{$from:M,$to:P}=k,F=M.blockRange(P),$=T||k.$to.parentOffset&&k.$from.marks();if(!F)return!1;const U=yf(ue=>H0(ue.type.name,p))(k);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(()=>bf(o,b)).command(()=>wf(o,b)).run()}return!t||!$||!c?f().command(()=>m().wrapInList(b,r)?!0:h.clearNodes()).wrapInList(b,r).command(()=>bf(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(()=>bf(o,b)).command(()=>wf(o,b)).run()},EM=(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=mf(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 mf(t,i,e)?r.lift(i):r.wrapIn(i,e)},TM=()=>({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(T=>T.type===f))===null||o===void 0?void 0:o.attrs,k=df(h,f,S);k&&(g=k.from,b=k.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=gf(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,(k,T)=>{o&&o===k.type&&(b=Math.max(T,h),S=Math.min(T+k.nodeSize,m),p=T,g=k)}):r.doc.nodesBetween(h,m,(k,T)=>{T<h&&o&&o===k.type&&(b=Math.max(T,h),S=Math.min(T+k.nodeSize,m),p=T,g=k),T>=h&&T<=m&&(o&&o===k.type&&t.setNodeMarkup(T,void 0,{...k.attrs,...e}),a&&k.marks.length&&k.marks.forEach(M=>{if(a===M.type){const P=Math.max(T,h),F=Math.min(T+k.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(k=>{a===k.type&&t.addMark(b,S,a.create({...k.attrs,...e}))}))}),!0):!1},NM=(n,e={})=>({state:t,dispatch:r})=>{const i=We(n,t.schema);return $C(i,e)(t,r)},OM=(n,e={})=>({state:t,dispatch:r})=>{const i=We(n,t.schema);return WC(i,e)(t,r)};var RM=Object.freeze({__proto__:null,blur:fT,clearContent:hT,clearNodes:dT,command:pT,createParagraphNear:mT,cut:gT,deleteCurrentNode:yT,deleteNode:bT,deleteRange:wT,deleteSelection:vT,enter:ST,exitCode:xT,extendMarkRange:kT,first:ET,focus:TT,forEach:MT,insertContent:AT,insertContentAt:OT,joinBackward:PT,joinDown:LT,joinForward:DT,joinItemBackward:BT,joinItemForward:zT,joinTextblockBackward:FT,joinTextblockForward:HT,joinUp:RT,keyboardShortcut:WT,lift:UT,liftEmptyBlock:VT,liftListItem:KT,newlineInCode:GT,resetAttributes:JT,scrollIntoView:qT,selectAll:jT,selectNodeBackward:YT,selectNodeForward:XT,selectParentNode:ZT,selectTextblockEnd:QT,selectTextblockStart:eM,setContent:nM,setMark:mM,setMeta:gM,setNode:yM,setNodeSelection:bM,setTextSelection:wM,sinkListItem:vM,splitBlock:SM,splitListItem:xM,toggleList:kM,toggleMark:EM,toggleNode:_M,toggleWrap:CM,undoInputRule:TM,unsetAllMarks:MM,unsetMark:AM,updateAttributes:IM,wrapIn:NM,wrapInList:OM});Ie.create({name:"commands",addCommands(){return{...RM}}}),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,k=S.parent.type.spec.isolating,T=p.pos-p.parentOffset,M=k&&S.parent.childCount===1?T===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 pf()||D0()?o:i},addProseMirrorPlugins(){return[new lt({key:new Ct("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(k=>k.getMeta("composition")))return;const r=n.some(k=>k.docChanged)&&!e.doc.eq(t.doc),i=n.some(k=>k.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=El({state:t,transaction:g}),{commands:S}=new cf({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 LM(n){return new N0({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 N0({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&&Lu(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 k=S.filter(T=>b.includes(T.type.name));a.ensureMarks(k)}}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&&ur(a.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,m))&&a.join(t.from-1)}})}class Kn{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 Kn(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Ml(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new Kn(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 rT({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(T=>T===n.type&&T!==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=Kn.create({name:"text",group:"inline"});var Ll=200,Ue=function(){};Ue.prototype.append=function(e){return e.length?(e=Ue.from(e),!this.length&&e||e.length<Ll&&this.leafAppend(e)||this.length<Ll&&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<=Ll)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Ll)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 Di;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 k=e.steps[b].invert(e.docs[b]),T=g.selection&&g.selection.map(o.slice(f+1,b));T&&c++,r.push(new mn(S,k,T))}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 gr{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(Vr),o;if(i)return i.historyState;t.getMeta(KM)&&(n=new gr(n.done,n.undone,null,0,-1));let a=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(a&&a.getMeta(Vr))return a.getMeta(Vr).redo?new gr(n.done.addTransform(t,void 0,r,Pl(e)),n.undone,V0(t.mapping.maps),n.prevTime,n.prevComposition):new gr(n.done,n.undone.addTransform(t,void 0,r,Pl(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?vf(n.prevRanges,t.mapping):V0(t.mapping.maps);return new gr(n.done.addTransform(t,f?e.selection.getBookmark():void 0,r,Pl(e)),rn.empty,h,t.time,c??n.prevComposition)}else return(o=t.getMeta("rebased"))?new gr(n.done.rebased(t,o),n.undone.rebased(t,o),vf(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new gr(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),vf(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 vf(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=Pl(e),i=Vr.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 gr(t?c:o.remaining,t?o.remaining:c,null,0,-1);return o.transform.setSelection(a).setMeta(Vr,{redo:t,historyState:f})}let Sf=!1,K0=null;function Pl(n){let e=n.plugins;if(K0!=e){Sf=!1,K0=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Sf=!0;break}}return Sf}const Vr=new Ct("history"),KM=new Ct("closeHistory");function GM(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new lt({key:Vr,state:{init(){return new gr(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=Vr.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 xf=(n=>(n.COMMON="common",n.DESKTOP="desktop",n.TABLET="tablet",n.MOBILE="mobile",n))(xf||{});const qM=["common","mobile","tablet","desktop"];var Dl=(n=>(n.UPPERCASE="uppercase",n.LOWERCASE="lowercase",n.CAPITALIZE="capitalize",n))(Dl||{}),yr=(n=>(n.LEFT="left",n.CENTER="center",n.RIGHT="right",n.JUSTIFY="justify",n))(yr||{});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 kf=["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 Ce=(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))(Ce||{});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","text_decoration","superscript"];var Wt=(n=>(n.SETTINGS="settings",n.ALL="_",n))(Wt||{}),Ef=(n=>(n.BLANK="_blank",n.SELF="_self",n))(Ef||{}),Ai=(n=>(n.URL="url",n.BLOCK="block",n))(Ai||{});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 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",Ii=(n,e)=>{for(const t in e)n[t]=e[t];return n},Cf="numeric",Tf="ascii",Mf="alpha",Ts="asciinumeric",Ms="alphanumeric",Af="domain",Z0="emoji",nA="scheme",rA="slashscheme",If="whitespace";function iA(n,e){return n in e||(e[n]=[]),e[n]}function Kr(n,e,t){e[Cf]&&(e[Ts]=!0,e[Ms]=!0),e[Tf]&&(e[Ts]=!0,e[Mf]=!0),e[Ts]&&(e[Ms]=!0),e[Mf]&&(e[Ms]=!0),e[Ms]&&(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&&Kr(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,Ii(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=Ii(sA(a.t,r),t);Kr(o,f,r)}else t&&Kr(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),Dn="WORD",Nf="UWORD",e1="ASCIINUMERICAL",t1="ALPHANUMERICAL",As="LOCALHOST",Of="TLD",Rf="UTLD",zl="SCHEME",Ni="SLASH_SCHEME",Lf="NUM",Pf="WS",Df="NL",Is="OPENBRACE",Ns="CLOSEBRACE",Fl="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",Bf="APOSTROPHE",ea="ASTERISK",br="AT",ta="BACKSLASH",na="BACKTICK",ra="CARET",wr="COLON",zf="COMMA",ia="DOLLAR",dn="DOT",sa="EQUALS",Ff="EXCLAMATION",Ut="HYPHEN",Os="PERCENT",oa="PIPE",la="PLUS",aa="POUND",Rs="QUERY",Hf="QUOTE",n1="FULLWIDTHMIDDLEDOT",$f="SEMI",pn="SLASH",Ls="TILDE",ca="UNDERSCORE",r1="EMOJI",ua="SYM";var i1=Object.freeze({__proto__:null,WORD:Dn,UWORD:Nf,ASCIINUMERICAL:e1,ALPHANUMERICAL:t1,LOCALHOST:As,TLD:Of,UTLD:Rf,SCHEME:zl,SLASH_SCHEME:Ni,NUM:Lf,WS:Pf,NL:Df,OPENBRACE:Is,CLOSEBRACE:Ns,OPENBRACKET:Fl,CLOSEBRACKET:Hl,OPENPAREN:$l,CLOSEPAREN:Wl,OPENANGLEBRACKET:Ul,CLOSEANGLEBRACKET:Vl,FULLWIDTHLEFTPAREN:Kl,FULLWIDTHRIGHTPAREN:Gl,LEFTCORNERBRACKET:Jl,RIGHTCORNERBRACKET:ql,LEFTWHITECORNERBRACKET:jl,RIGHTWHITECORNERBRACKET:Yl,FULLWIDTHLESSTHAN:Xl,FULLWIDTHGREATERTHAN:Zl,AMPERSAND:Ql,APOSTROPHE:Bf,ASTERISK:ea,AT:br,BACKSLASH:ta,BACKTICK:na,CARET:ra,COLON:wr,COMMA:zf,DOLLAR:ia,DOT:dn,EQUALS:sa,EXCLAMATION:Ff,HYPHEN:Ut,PERCENT:Os,PIPE:oa,PLUS:la,POUND:aa,QUERY:Rs,QUOTE:Hf,FULLWIDTHMIDDLEDOT:n1,SEMI:$f,SLASH:pn,TILDE:Ls,UNDERSCORE:ca,EMOJI:r1,SYM:ua});const Bn=/[a-z]/,Ps=/\p{L}/u,Wf=/\p{Emoji}/u,zn=/\d/,Uf=/\s/,s1="\r",Vf=`
17
- `,oA="\uFE0F",lA="\u200D",Kf="\uFFFC";let fa=null,ha=null;function aA(n=[]){const e={};gt.groups=e;const t=new gt;fa==null&&(fa=l1(eA)),ha==null&&(ha=l1(tA)),D(t,"'",Bf),D(t,"{",Is),D(t,"}",Ns),D(t,"[",Fl),D(t,"]",Hl),D(t,"(",$l),D(t,")",Wl),D(t,"<",Ul),D(t,">",Vl),D(t,"\uFF08",Kl),D(t,"\uFF09",Gl),D(t,"\u300C",Jl),D(t,"\u300D",ql),D(t,"\u300E",jl),D(t,"\u300F",Yl),D(t,"\uFF1C",Xl),D(t,"\uFF1E",Zl),D(t,"&",Ql),D(t,"*",ea),D(t,"@",br),D(t,"`",na),D(t,"^",ra),D(t,":",wr),D(t,",",zf),D(t,"$",ia),D(t,".",dn),D(t,"=",sa),D(t,"!",Ff),D(t,"-",Ut),D(t,"%",Os),D(t,"|",oa),D(t,"+",la),D(t,"#",aa),D(t,"?",Rs),D(t,'"',Hf),D(t,"/",pn),D(t,";",$f),D(t,"~",Ls),D(t,"_",ca),D(t,"\\",ta),D(t,"\u30FB",n1);const r=Ae(t,zn,Lf,{[Cf]:!0});Ae(r,zn,r);const i=Ae(r,Bn,e1,{[Ts]:!0}),o=Ae(r,Ps,t1,{[Ms]:!0}),a=Ae(t,Bn,Dn,{[Tf]:!0});Ae(a,zn,i),Ae(a,Bn,a),Ae(i,zn,i),Ae(i,Bn,i);const c=Ae(t,Ps,Nf,{[Mf]:!0});Ae(c,Bn),Ae(c,zn,o),Ae(c,Ps,c),Ae(o,zn,o),Ae(o,Bn),Ae(o,Ps,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=[[Bn,a],[zn,i]],S=[[Bn,null],[Ps,c],[zn,o]];for(let k=0;k<fa.length;k++)vr(t,fa[k],Of,Dn,b);for(let k=0;k<ha.length;k++)vr(t,ha[k],Rf,Nf,S);Kr(Of,{tld:!0,ascii:!0},e),Kr(Rf,{utld:!0,alpha:!0},e),vr(t,"file",zl,Dn,b),vr(t,"mailto",zl,Dn,b),vr(t,"http",Ni,Dn,b),vr(t,"https",Ni,Dn,b),vr(t,"ftp",Ni,Dn,b),vr(t,"ftps",Ni,Dn,b),Kr(zl,{scheme:!0,ascii:!0},e),Kr(Ni,{slashscheme:!0,ascii:!0},e),n=n.sort((k,T)=>k[0]>T[0]?1:-1);for(let k=0;k<n.length;k++){const T=n[k][0],P=n[k][1]?{[nA]:!0}:{[rA]:!0};T.indexOf("-")>=0?P[Af]=!0:Bn.test(T)?zn.test(T)?P[Ts]=!0:P[Tf]=!0:P[Cf]=!0,Q0(t,T,T,P)}return Q0(t,"localhost",As,{ascii:!0}),t.jd=new gt(ua),{start:t,tokens:Ii({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 vr(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 Ds={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=Ii({},Ds);n&&(t=Ii(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:Ds,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]:Ds[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=Ds.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&&Ii(a,m),{tagName:i,attributes:a,content:o,eventListeners:p}}};function da(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=da("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),f1=da("text"),uA=da("nl"),pa=da("url",{isLink:!0,toHref(n=Ds.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==As&&n[1].t===wr}}),Vt=n=>new gt(n);function fA({groups:n}){const e=n.domain.concat([Ql,ea,br,ta,na,ra,ia,sa,Ut,Lf,Os,oa,la,aa,pn,ua,Ls,ca]),t=[wr,zf,dn,Ff,Os,Rs,Hf,$f,Ul,Vl,Is,Ns,Hl,Fl,$l,Wl,Kl,Gl,Jl,ql,jl,Yl,Xl,Zl],r=[Ql,Bf,ea,ta,na,ra,ia,sa,Ut,Is,Ns,Os,oa,la,aa,Rs,pn,ua,Ls,ca],i=Vt(),o=D(i,Ls);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,br);D(o,br,h),D(c,br,h),D(f,br,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,As,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 k=D(b,wr);ne(k,n.numeric,u1);const T=D(a,Ut),M=D(a,dn);D(T,Ut,T),ne(T,n.domain,a),ne(M,r,o),ne(M,n.domain,a);const P=Vt(pa);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,T),D(P,br,h);const F=D(P,wr),$=Vt(pa);ne(F,n.numeric,$);const U=Vt(pa),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),Gn=D(yt,pn);ne(c,n.domain,a),D(c,dn,M),D(c,Ut,T),ne(f,n.domain,a),D(f,dn,M),D(f,Ut,T),ne(he,n.domain,U),D(he,pn,U),D(he,Rs,U),ne(Gn,n.domain,U),ne(Gn,e,U),D(Gn,pn,U);const sn=[[Is,Ns],[Fl,Hl],[$l,Wl],[Ul,Vl],[Kl,Gl],[Jl,ql],[jl,Yl],[Xl,Zl]];for(let Jn=0;Jn<sn.length;Jn++){const[Xr,on]=sn[Jn],wn=D(U,Xr);D(ue,Xr,wn),D(wn,on,U);const Fe=Vt(pa);ne(wn,e,Fe);const bt=Vt();ne(wn,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,As,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.",ke={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function mA(){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&&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,d,m,h)=>{var g;f.isBlock&&d>r&&(c+=o);const b=a?.[f.type.name];if(b)return m&&(c+=b({node:f,pos:d,parent:m,index:h,range:e})),!1;f.isText&&(c+=(g=f?.text)===null||g===void 0?void 0:g.slice(Math.max(r,d)-d,i-d))}),c}function dM(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=dM(t);return fM(r,{from:a,to:c},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:f})}}})]}});const hM=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),pM=(n=!1)=>({commands:e})=>e.setContent("",n),mM=()=>({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:d,mapping:m}=e,h=d.resolve(m.map(f)),g=d.resolve(m.map(f+c.nodeSize)),b=h.blockRange(g);if(!b)return;const v=Ni(b);if(c.type.isTextblock){const{defaultType:x}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(b.start,x)}(v||v===0)&&e.lift(b,v)})}),!0},gM=n=>e=>n(e),yM=()=>({state:n,dispatch:e})=>n1(n,e),bM=(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},wM=()=>({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},SM=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),d=o.after(a);e.delete(f,d).scrollIntoView()}return!0}return!1},vM=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},_M=()=>({state:n,dispatch:e})=>Tf(n,e),xM=()=>({commands:n})=>n.keyboardShortcut("Enter"),EM=()=>({state:n,dispatch:e})=>DT(n,e);function Kl(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:Pf(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function p1(n,e,t={}){return n.find(r=>r.type===e&&Kl(Object.fromEntries(Object.keys(t).map(i=>[i,r.attrs[i]])),t))}function m1(n,e,t={}){return!!p1(n,e,t)}function Df(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),!p1([...i.node.marks],e,t)))return;let a=i.index,c=n.start()+i.offset,f=a+1,d=c+i.node.nodeSize;for(;a>0&&m1([...n.parent.child(a-1).marks],e,t);)a-=1,c-=n.parent.child(a).nodeSize;for(;f<n.parent.childCount&&m1([...n.parent.child(f).marks],e,t);)d+=n.parent.child(f).nodeSize,f+=1;return{from:c,to:d}}function pn(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 kM=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const o=pn(n,r.schema),{doc:a,selection:c}=t,{$from:f,from:d,to:m}=c;if(i){const h=Df(f,o,e);if(h&&h.from<=d&&h.to>=m){const g=ce.create(a,h.from,h.to);t.setSelection(g)}}return!0},CM=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 g1(n){return n instanceof ce}function jr(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function TM(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,jr(0,i,o),jr(n.content.size,i,o)):ce.create(n,jr(e,i,o),jr(e,i,o))}function MM(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Ff(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const AM=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const a=()=>{(Ff()||MM())&&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&&!g1(t.state.selection))return a(),!0;const c=TM(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},IM=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),NM=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),y1=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&&y1(r)}return n};function Jl(n){const e=`<body>${n}</body>`,t=new window.DOMParser().parseFromString(e,"text/html").body;return y1(t)}function Gl(n,e,t){if(n instanceof hr||n instanceof z)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 z.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),Gl("",e,t)}if(i){if(t.errorOnInvalidContent){let a=!1,c="";const f=new Lg({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:d=>(a=!0,c=typeof d=="string"?d:d.outerHTML,null)}]}})});if(t.slice?Os.fromSchema(f).parseSlice(Jl(n),t.parseOptions):Os.fromSchema(f).parse(Jl(n),t.parseOptions),t.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${c}`)})}const o=Os.fromSchema(e);return t.slice?o.parseSlice(Jl(n),t.parseOptions).content:o.parse(Jl(n),t.parseOptions)}return Gl("",e,t)}function OM(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof Je||i instanceof Ke))return;const o=n.mapping.maps[r];let a=0;o.forEach((c,f,d,m)=>{a===0&&(a=m)}),n.setSelection(pe.near(n.doc.resolve(a),t))}const RM=n=>!("type"in n),LM=(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=Gl(e,o.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions},errorOnInvalidContent:(a=t.errorOnInvalidContent)!==null&&a!==void 0?a:o.options.enableContentCheck})}catch(v){return o.emit("contentError",{editor:o,error:v,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:f,to:d}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},m=!0,h=!0;if((RM(c)?c:[c]).forEach(v=>{v.check(),m=m?v.isText&&v.marks.length===0:!1,h=h?v.isBlock:!1}),f===d&&h){const{parent:v}=r.doc.resolve(f);v.isTextblock&&!v.type.spec.code&&!v.childCount&&(f-=1,d+=1)}let b;if(m){if(Array.isArray(e))b=e.map(v=>v.text||"").join("");else if(e instanceof z){let v="";e.forEach(x=>{x.text&&(v+=x.text)}),b=v}else typeof e=="object"&&e&&e.text?b=e.text:b=e;r.insertText(b,f,d)}else b=c,r.replaceWith(f,d,b);t.updateSelection&&OM(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},PM=()=>({state:n,dispatch:e})=>RT(n,e),DM=()=>({state:n,dispatch:e})=>LT(n,e),FM=()=>({state:n,dispatch:e})=>j0(n,e),zM=()=>({state:n,dispatch:e})=>Q0(n,e),BM=()=>({state:n,dispatch:e,tr:t})=>{try{const r=Al(n.doc,n.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},$M=()=>({state:n,dispatch:e,tr:t})=>{try{const r=Al(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},HM=()=>({state:n,dispatch:e})=>NT(n,e),WM=()=>({state:n,dispatch:e})=>OT(n,e);function b1(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function VM(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))Ff()||b1()?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 UM=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const o=VM(n).split(/-(?!$)/),a=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),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",d=>d(t,c))});return f?.steps.forEach(d=>{const m=d.map(r.mapping);m&&i&&r.maybeStep(m)}),!0};function zf(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,(h,g)=>{if(h.isText)return;const b=Math.max(r,g),v=Math.min(i,g+h.nodeSize);c.push({node:h,from:b,to:v})});const f=i-r,d=c.filter(h=>a?a.name===h.node.type.name:!0).filter(h=>Kl(h.node.attrs,t,{strict:!1}));return o?!!d.length:d.reduce((h,g)=>h+g.to-g.from,0)>=f}const KM=(n,e={})=>({state:t,dispatch:r})=>{const i=We(n,t.schema);return zf(t,i,e)?PT(t,r):!1},JM=()=>({state:n,dispatch:e})=>r1(n,e),GM=n=>({state:e,dispatch:t})=>{const r=We(n,e.schema);return GT(r)(e,t)},qM=()=>({state:n,dispatch:e})=>t1(n,e);function Bf(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function w1(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 jM=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const c=Bf(typeof n=="string"?n:n.name,r.schema);return c?(c==="node"&&(o=We(n,r.schema)),c==="mark"&&(a=pn(n,r.schema)),i&&t.selection.ranges.forEach(f=>{r.doc.nodesBetween(f.$from.pos,f.$to.pos,(d,m)=>{o&&o===d.type&&t.setNodeMarkup(m,void 0,w1(d.attrs,e)),a&&d.marks.length&&d.marks.forEach(h=>{a===h.type&&t.addMark(m,m+d.nodeSize,a.create(w1(h.attrs,e)))})})}),!0):!1},YM=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),XM=()=>({tr:n,dispatch:e})=>{if(e){const t=new It(n.doc);n.setSelection(t)}return!0},ZM=()=>({state:n,dispatch:e})=>X0(n,e),QM=()=>({state:n,dispatch:e})=>e1(n,e),eA=()=>({state:n,dispatch:e})=>BT(n,e),tA=()=>({state:n,dispatch:e})=>WT(n,e),nA=()=>({state:n,dispatch:e})=>HT(n,e);function rA(n,e,t={},r={}){return Gl(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:r.errorOnInvalidContent})}const iA=(n,e=!1,t={},r={})=>({editor:i,tr:o,dispatch:a,commands:c})=>{var f,d;const{doc:m}=o;if(t.preserveWhitespace!=="full"){const h=rA(n,i.schema,t,{errorOnInvalidContent:(f=r.errorOnInvalidContent)!==null&&f!==void 0?f:i.options.enableContentCheck});return a&&o.replaceWith(0,m.content.size,h).setMeta("preventUpdate",!e),!0}return a&&o.setMeta("preventUpdate",!e),c.insertContentAt({from:0,to:m.content.size},n,{parseOptions:t,errorOnInvalidContent:(d=r.errorOnInvalidContent)!==null&&d!==void 0?d:i.options.enableContentCheck})};function S1(n,e){const t=pn(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 sA(n,e){const t=new LC(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function oA(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 lA(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,o)=>{t(i)&&r.push({node:i,pos:o})}),r}function aA(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 $f(n){return e=>aA(e.$from,n)}function cA(n,e){const t=ji.resolve(n);return u1(t,e)}function uA(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 fA(n,e){const t=Bf(typeof e=="string"?e:e.name,n.schema);return t==="node"?uA(n,e):t==="mark"?S1(n,e):{}}function dA(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 hA(n){const e=dA(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 pA(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 d=e.slice(o).map(c,-1),m=e.slice(o).map(f),h=e.invert().map(d,-1),g=e.invert().map(m);r.push({oldRange:{from:h,to:g},newRange:{from:d,to:m}})})}),hA(r)}function v1(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const o=t.resolve(n),a=Df(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 ql(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 mA(n,e,t={}){const{empty:r,ranges:i}=n.selection,o=e?pn(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(h=>o?o.name===h.type.name:!0).find(h=>Kl(h.attrs,t,{strict:!1}));let a=0;const c=[];if(i.forEach(({$from:h,$to:g})=>{const b=h.pos,v=g.pos;n.doc.nodesBetween(b,v,(x,T)=>{if(!x.isText&&!x.marks.length)return;const M=Math.max(b,T),L=Math.min(v,T+x.nodeSize),B=L-M;a+=B,c.push(...x.marks.map(H=>({mark:H,from:M,to:L})))})}),a===0)return!1;const f=c.filter(h=>o?o.name===h.mark.type.name:!0).filter(h=>Kl(h.mark.attrs,t,{strict:!1})).reduce((h,g)=>h+g.to-g.from,0),d=c.filter(h=>o?h.mark.type!==o&&h.mark.type.excludes(o):!0).reduce((h,g)=>h+g.to-g.from,0);return(f>0?f+d:f)>=a}function _1(n,e){const{nodeExtensions:t}=$l(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 x1(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&&(x1(o,{ignoreWhitespace:t,checkChildren:e})||(i=!1))}),i}return!1}function gA(n,e,t){var r;const{selection:i}=e;let o=null;if(g1(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 d=c.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(c.pos,f.pos,(m,h,g)=>{if(d)return!1;if(m.isInline){const b=!g||g.type.allowsMarkType(t),v=!!t.isInSet(m.marks)||!m.marks.some(x=>x.type.excludes(t));d=b&&v}return!d}),d})}const yA=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:o}=t,{empty:a,ranges:c}=o,f=pn(n,r.schema);if(i)if(a){const d=S1(r,f);t.addStoredMark(f.create({...d,...e}))}else c.forEach(d=>{const m=d.$from.pos,h=d.$to.pos;r.doc.nodesBetween(m,h,(g,b)=>{const v=Math.max(b,m),x=Math.min(b+g.nodeSize,h);g.marks.find(M=>M.type===f)?g.marks.forEach(M=>{f===M.type&&t.addMark(v,x,f.create({...M.attrs,...e}))}):t.addMark(v,x,f.create(e))})});return gA(r,t,f)},bA=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),wA=(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})=>o1(o,{...a,...e})(t)?!0:c.clearNodes()).command(({state:c})=>o1(o,{...a,...e})(c,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},SA=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=jr(n,0,r.content.size),o=Y.create(r,i);e.setSelection(o)}return!0},vA=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=jr(i,a,c),d=jr(o,a,c),m=ce.create(r,f,d);e.setSelection(m)}return!0},_A=n=>({state:e,dispatch:t})=>{const r=We(n,e.schema);return YT(r)(e,t)};function E1(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 xA=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:o,doc:a}=e,{$from:c,$to:f}=o,d=i.extensionManager.attributes,m=ql(d,c.node().type.name,c.node().attrs);if(o instanceof Y&&o.node.isBlock)return!c.parentOffset||!zn(a,c.pos)?!1:(r&&(n&&E1(t,i.extensionManager.splittableMarks),e.split(c.pos).scrollIntoView()),!0);if(!c.parent.isBlock)return!1;const h=f.parentOffset===f.parent.content.size,g=c.depth===0?void 0:oA(c.node(-1).contentMatchAt(c.indexAfter(-1)));let b=h&&g?[{type:g,attrs:m}]:void 0,v=zn(e.doc,e.mapping.map(c.pos),1,b);if(!b&&!v&&zn(e.doc,e.mapping.map(c.pos),1,g?[{type:g}]:void 0)&&(v=!0,b=g?[{type:g,attrs:m}]:void 0),r){if(v&&(o instanceof ce&&e.deleteSelection(),e.split(e.mapping.map(c.pos),1,b),g&&!h&&!c.parentOffset&&c.parent.type!==g)){const x=e.mapping.map(c.before()),T=e.doc.resolve(x);c.node(-1).canReplaceWith(T.index(),T.index()+1,g)&&e.setNodeMarkup(e.mapping.map(c.before()),g)}n&&E1(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return v},EA=(n,e={})=>({tr:t,state:r,dispatch:i,editor:o})=>{var a;const c=We(n,r.schema),{$from:f,$to:d}=r.selection,m=r.selection.node;if(m&&m.isBlock||f.depth<2||!f.sameParent(d))return!1;const h=f.node(-1);if(h.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=z.empty;const L=f.index(-1)?1:f.index(-2)?2:3;for(let be=f.depth-L;be>=f.depth-3;be-=1)M=z.from(f.node(be).copy(M));const B=f.indexAfter(-1)<f.node(-2).childCount?1:f.indexAfter(-2)<f.node(-3).childCount?2:3,H={...ql(g,f.node().type.name,f.node().attrs),...e},V=((a=c.contentMatch.defaultType)===null||a===void 0?void 0:a.createAndFill(H))||void 0;M=M.append(z.from(c.createAndFill(null,V)||void 0));const ue=f.before(f.depth-(L-1));t.replace(ue,f.after(-B),new W(M,4-L,0));let de=-1;t.doc.nodesBetween(ue,t.doc.content.size,(be,bt)=>{if(de>-1)return!1;be.isTextblock&&be.content.size===0&&(de=bt+1)}),de>-1&&t.setSelection(ce.near(t.doc.resolve(de))),t.scrollIntoView()}return!0}const b=d.pos===f.end()?h.contentMatchAt(0).defaultType:null,v={...ql(g,h.type.name,h.attrs),...e},x={...ql(g,f.node().type.name,f.node().attrs),...e};t.delete(f.pos,d.pos);const T=b?[{type:c,attrs:v},{type:b,attrs:x}]:[{type:c,attrs:v}];if(!zn(t.doc,f.pos,2))return!1;if(i){const{selection:M,storedMarks:L}=r,{splittableMarks:B}=o.extensionManager,H=L||M.$to.parentOffset&&M.$from.marks();if(t.split(f.pos,2,T).scrollIntoView(),!H||!i)return!0;const V=H.filter(ue=>B.includes(ue.type.name));t.ensureMarks(V)}return!0},Hf=(n,e)=>{const t=$f(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&&pr(n.doc,t.pos)&&n.join(t.pos),!0},Wf=(n,e)=>{const t=$f(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&&pr(n.doc,r)&&n.join(r),!0},kA=(n,e,t,r={})=>({editor:i,tr:o,state:a,dispatch:c,chain:f,commands:d,can:m})=>{const{extensions:h,splittableMarks:g}=i.extensionManager,b=We(n,a.schema),v=We(e,a.schema),{selection:x,storedMarks:T}=a,{$from:M,$to:L}=x,B=M.blockRange(L),H=T||x.$to.parentOffset&&x.$from.marks();if(!B)return!1;const V=$f(ue=>_1(ue.type.name,h))(x);if(B.depth>=1&&V&&B.depth-V.depth<=1){if(V.node.type===b)return d.liftListItem(v);if(_1(V.node.type.name,h)&&b.validContent(V.node.content)&&c)return f().command(()=>(o.setNodeMarkup(V.pos,b),!0)).command(()=>Hf(o,b)).command(()=>Wf(o,b)).run()}return!t||!H||!c?f().command(()=>m().wrapInList(b,r)?!0:d.clearNodes()).wrapInList(b,r).command(()=>Hf(o,b)).command(()=>Wf(o,b)).run():f().command(()=>{const ue=m().wrapInList(b,r),de=H.filter(be=>g.includes(be.type.name));return o.ensureMarks(de),ue?!0:d.clearNodes()}).wrapInList(b,r).command(()=>Hf(o,b)).command(()=>Wf(o,b)).run()},CA=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=t,a=pn(n,r.schema);return mA(r,a,e)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,e)},TA=(n,e,t={})=>({state:r,commands:i})=>{const o=We(n,r.schema),a=We(e,r.schema),c=zf(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})},MA=(n,e={})=>({state:t,commands:r})=>{const i=We(n,t.schema);return zf(t,i,e)?r.lift(i):r.wrapIn(i,e)},AA=()=>({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},IA=()=>({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},NA=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=e,{selection:c}=t,f=pn(n,r.schema),{$from:d,empty:m,ranges:h}=c;if(!i)return!0;if(m&&a){let{from:g,to:b}=c;const v=(o=d.marks().find(T=>T.type===f))===null||o===void 0?void 0:o.attrs,x=Df(d,f,v);x&&(g=x.from,b=x.to),t.removeMark(g,b,f)}else h.forEach(g=>{t.removeMark(g.$from.pos,g.$to.pos,f)});return t.removeStoredMark(f),!0},OA=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const c=Bf(typeof n=="string"?n:n.name,r.schema);return c?(c==="node"&&(o=We(n,r.schema)),c==="mark"&&(a=pn(n,r.schema)),i&&t.selection.ranges.forEach(f=>{const d=f.$from.pos,m=f.$to.pos;let h,g,b,v;t.selection.empty?r.doc.nodesBetween(d,m,(x,T)=>{o&&o===x.type&&(b=Math.max(T,d),v=Math.min(T+x.nodeSize,m),h=T,g=x)}):r.doc.nodesBetween(d,m,(x,T)=>{T<d&&o&&o===x.type&&(b=Math.max(T,d),v=Math.min(T+x.nodeSize,m),h=T,g=x),T>=d&&T<=m&&(o&&o===x.type&&t.setNodeMarkup(T,void 0,{...x.attrs,...e}),a&&x.marks.length&&x.marks.forEach(M=>{if(a===M.type){const L=Math.max(T,d),B=Math.min(T+x.nodeSize,m);t.addMark(L,B,a.create({...M.attrs,...e}))}}))}),g&&(h!==void 0&&t.setNodeMarkup(h,void 0,{...g.attrs,...e}),a&&g.marks.length&&g.marks.forEach(x=>{a===x.type&&t.addMark(b,v,a.create({...x.attrs,...e}))}))}),!0):!1},RA=(n,e={})=>({state:t,dispatch:r})=>{const i=We(n,t.schema);return VT(i,e)(t,r)},LA=(n,e={})=>({state:t,dispatch:r})=>{const i=We(n,t.schema);return UT(i,e)(t,r)};var PA=Object.freeze({__proto__:null,blur:hM,clearContent:pM,clearNodes:mM,command:gM,createParagraphNear:yM,cut:bM,deleteCurrentNode:wM,deleteNode:SM,deleteRange:vM,deleteSelection:_M,enter:xM,exitCode:EM,extendMarkRange:kM,first:CM,focus:AM,forEach:IM,insertContent:NM,insertContentAt:LM,joinBackward:FM,joinDown:DM,joinForward:zM,joinItemBackward:BM,joinItemForward:$M,joinTextblockBackward:HM,joinTextblockForward:WM,joinUp:PM,keyboardShortcut:UM,lift:KM,liftEmptyBlock:JM,liftListItem:GM,newlineInCode:qM,resetAttributes:jM,scrollIntoView:YM,selectAll:XM,selectNodeBackward:ZM,selectNodeForward:QM,selectParentNode:eA,selectTextblockEnd:tA,selectTextblockStart:nA,setContent:iA,setMark:yA,setMeta:bA,setNode:wA,setNodeSelection:SA,setTextSelection:vA,sinkListItem:_A,splitBlock:xA,splitListItem:EA,toggleList:kA,toggleMark:CA,toggleNode:TA,toggleWrap:MA,undoInputRule:AA,unsetAllMarks:IA,unsetMark:NA,updateAttributes:OA,wrapIn:RA,wrapInList:LA});Ie.create({name:"commands",addCommands(){return{...PA}}}),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:d}=c,{empty:m,$anchor:h}=f,{pos:g,parent:b}=h,v=h.parent.isTextblock&&g>0?c.doc.resolve(g-1):h,x=v.parent.type.spec.isolating,T=h.pos-h.parentOffset,M=x&&v.parent.childCount===1?T===h.pos:pe.atStart(d).from===g;return!m||!b.type.isTextblock||b.textContent.length||!M||M&&h.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 Ff()||b1()?o:i},addProseMirrorPlugins(){return[new lt({key:new Tt("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(x=>x.getMeta("composition")))return;const r=n.some(x=>x.docChanged)&&!e.doc.eq(t.doc),i=n.some(x=>x.getMeta("preventClearDocument"));if(!r||i)return;const{empty:o,from:a,to:c}=e.selection,f=pe.atStart(e.doc).from,d=pe.atEnd(e.doc).to;if(o||!(a===f&&c===d)||!x1(t.doc))return;const g=t.tr,b=Bl({state:t,transaction:g}),{commands:v}=new Of({editor:this.editor,state:b});if(v.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 DA(n){return new h1({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 FA(n){return new h1({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(),d=f&&rf(f,n.type,o);if(!d)return null;if(a.wrap(f,d),n.keepMarks&&n.editor){const{selection:h,storedMarks:g}=e,{splittableMarks:b}=n.editor.extensionManager,v=g||h.$to.parentOffset&&h.$from.marks();if(v){const x=v.filter(T=>b.includes(T.type.name));a.ensureMarks(x)}}if(n.keepAttributes){const h=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(h,o).run()}const m=a.doc.resolve(t.from-1).nodeBefore;m&&m.type===n.type&&pr(a.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,m))&&a.join(t.from-1)}})}class jn{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 jn(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Vl(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new jn(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 zA(n){return new sM({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 d=t.to;if(c){const m=f.search(/\S/),h=t.from+f.indexOf(c),g=h+c.length;if(v1(t.from,t.to,e.doc).filter(v=>v.mark.type.excluded.find(T=>T===n.type&&T!==v.mark.type)).filter(v=>v.to>h).length)return null;g<t.to&&a.delete(g,t.to),h>t.from&&a.delete(t.from+m,h),d=t.from+m+c.length,a.addMark(t.from+m,d,n.type.create(o||{})),a.removeStoredMark(n.type)}}})}const BA=jn.create({name:"text",group:"inline"});var jl=200,Ve=function(){};Ve.prototype.append=function(e){return e.length?(e=Ve.from(e),!this.length&&e||e.length<jl&&this.leafAppend(e)||this.length<jl&&e.leafPrepend(this)||this.appendInner(e)):this},Ve.prototype.prepend=function(e){return e.length?Ve.from(e).append(this):this},Ve.prototype.appendInner=function(e){return new $A(this,e)},Ve.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Ve.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Ve.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ve.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)},Ve.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},Ve.from=function(e){return e instanceof Ve?e:e&&e.length?new k1(e):Ve.empty};var k1=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<=jl)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=jl)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}(Ve);Ve.empty=new k1([]);var $A=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}(Ve);const HA=500;class on{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,d=[],m=[];return this.items.forEach((h,g)=>{if(!h.step){i||(i=this.remapping(r,g+1),o=i.maps.length),o--,m.push(h);return}if(i){m.push(new bn(h.map));let b=h.step.map(i.slice(o)),v;b&&a.maybeStep(b).doc&&(v=a.mapping.maps[a.mapping.maps.length-1],d.push(new bn(v,void 0,void 0,d.length+m.length))),o--,v&&i.appendMap(v,o)}else a.maybeStep(h.step);if(h.selection)return c=i?h.selection.map(i.slice(o)):h.selection,f=new on(this.items.slice(0,r).append(m.reverse().concat(d)),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 h=e.steps[m].invert(e.docs[m]),g=new bn(e.mapping.maps[m],h,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 d=a-r.depth;return d>VA&&(c=WA(c,d),a-=d),new on(c.append(o),a)}remapping(e,t){let r=new Yi;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 on(this.items.append(e.map(t=>new bn(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 v=o.maps[b];if(g.step){let x=e.steps[b].invert(e.docs[b]),T=g.selection&&g.selection.map(o.slice(f+1,b));T&&c++,r.push(new bn(v,x,T))}else r.push(new bn(v))},i);let d=[];for(let g=t;g<a;g++)d.push(new bn(o.maps[g]));let m=this.items.slice(0,i).append(d).append(r),h=new on(m,c);return h.emptyItemCount()>HA&&(h=h.compress(this.items.length-r.length)),h}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)),d=f&&f.getMap();if(r--,d&&t.appendMap(d,r),f){let m=a.selection&&a.selection.map(t.slice(r));m&&o++;let h=new bn(d.invert(),f,m),g,b=i.length-1;(g=i.length&&i[b].merge(h))?i[b]=g:i.push(h)}}else a.map&&r--},this.items.length,0),new on(Ve.from(i.reverse()),o)}}on.empty=new on(Ve.empty,0);function WA(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class bn{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 bn(t.getMap().invert(),t,this.selection)}}}class Sr{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const VA=20;function UA(n,e,t,r){let i=t.getMeta(Yr),o;if(i)return i.historyState;t.getMeta(GA)&&(n=new Sr(n.done,n.undone,null,0,-1));let a=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(a&&a.getMeta(Yr))return a.getMeta(Yr).redo?new Sr(n.done.addTransform(t,void 0,r,Yl(e)),n.undone,C1(t.mapping.maps),n.prevTime,n.prevComposition):new Sr(n.done,n.undone.addTransform(t,void 0,r,Yl(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||!KA(t,n.prevRanges)),d=a?Vf(n.prevRanges,t.mapping):C1(t.mapping.maps);return new Sr(n.done.addTransform(t,f?e.selection.getBookmark():void 0,r,Yl(e)),on.empty,d,t.time,c??n.prevComposition)}else return(o=t.getMeta("rebased"))?new Sr(n.done.rebased(t,o),n.undone.rebased(t,o),Vf(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new Sr(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),Vf(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function KA(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 C1(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 Vf(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 JA(n,e,t){let r=Yl(e),i=Yr.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 Sr(t?c:o.remaining,t?o.remaining:c,null,0,-1);return o.transform.setSelection(a).setMeta(Yr,{redo:t,historyState:f})}let Uf=!1,T1=null;function Yl(n){let e=n.plugins;if(T1!=e){Uf=!1,T1=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Uf=!0;break}}return Uf}const Yr=new Tt("history"),GA=new Tt("closeHistory");function qA(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new lt({key:Yr,state:{init(){return new Sr(on.empty,on.empty,null,0,-1)},apply(e,t,r){return UA(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?A1:r=="historyRedo"?I1:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function M1(n,e){return(t,r)=>{let i=Yr.getState(t);if(!i||(n?i.undone:i.done).eventCount==0)return!1;if(r){let o=JA(i,t,n);o&&r(e?o.scrollIntoView():o)}return!0}}const A1=M1(!1,!0),I1=M1(!0,!0),jA=Ie.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>A1(n,e),redo:()=>({state:n,dispatch:e})=>I1(n,e)}},addProseMirrorPlugins(){return[qA(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 Kf=(n=>(n.COMMON="common",n.DESKTOP="desktop",n.TABLET="tablet",n.MOBILE="mobile",n))(Kf||{});const YA=["common","mobile","tablet","desktop"];var Xl=(n=>(n.UPPERCASE="uppercase",n.LOWERCASE="lowercase",n.CAPITALIZE="capitalize",n))(Xl||{}),vr=(n=>(n.LEFT="left",n.CENTER="center",n.RIGHT="right",n.JUSTIFY="justify",n))(vr||{});const XA=["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 Jf=["paragraph","list","heading"];var rn=(n=>(n.DISC="disc",n.CIRCLE="circle",n.SQUARE="square",n.DECIMAL="decimal",n.ROMAN="roman",n.LATIN="latin",n))(rn||{});const ZA=["disc","circle","square","decimal","roman","latin"],QA=["decimal","roman","latin"];var Ce=(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))(Ce||{});const N1=["alignment","line_height","margin"],Zl=["line_height"],O1=["text_decoration","link","superscript","background_color"],R1=["background_color","font_color","font_family","font_size","font_style","font_weight","text_decoration","superscript"];var Vt=(n=>(n.SETTINGS="settings",n.ALL="_",n))(Vt||{}),Gf=(n=>(n.BLANK="_blank",n.SELF="_self",n))(Gf||{}),Bi=(n=>(n.URL="url",n.BLOCK="block",n))(Bi||{});class qf{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 eI extends qf{addProps(){return{transformPastedHTML:this._transformPastedHTML,handlePaste:this._handlePaste}}_transformPastedHTML(e){if(e.includes("data-pm-slice")&&e.includes("zw-style"))return e;const t=ec.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 tI extends qf{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=vn.node(i,i+r.nodeSize,{class:"zw-wysiwyg__placeholder","data-placeholder":"Type your text here..."});t.push(o)}return!1}),Ge.create(e,t)}}const nI="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",rI="\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",$i=(n,e)=>{for(const t in e)n[t]=e[t];return n},jf="numeric",Yf="ascii",Xf="alpha",Hs="asciinumeric",Ws="alphanumeric",Zf="domain",L1="emoji",iI="scheme",sI="slashscheme",Qf="whitespace";function oI(n,e){return n in e||(e[n]=[]),e[n]}function Xr(n,e,t){e[jf]&&(e[Hs]=!0,e[Ws]=!0),e[Yf]&&(e[Hs]=!0,e[Xf]=!0),e[Hs]&&(e[Ws]=!0),e[Xf]&&(e[Ws]=!0),e[Ws]&&(e[Zf]=!0),e[L1]&&(e[Zf]=!0);for(const r in e){const i=oI(r,t);i.indexOf(n)<0&&i.push(n)}}function lI(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function yt(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}yt.groups={},yt.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||yt.groups;let i;return e&&e.j?i=e:(i=new yt(e),t&&r&&Xr(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||yt.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 yt,$i(a.j,c.j),a.jr.push.apply(a.jr,c.jr),a.jd=c.jd,a.t=c.t):a=new yt,o){if(r)if(a.t&&typeof a.t=="string"){const f=$i(lI(a.t,r),t);Xr(o,f,r)}else t&&Xr(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),P1=(n,e,t,r,i)=>n.ts(e,t,r,i),P=(n,e,t,r,i)=>n.tt(e,t,r,i),Bn="WORD",ed="UWORD",D1="ASCIINUMERICAL",F1="ALPHANUMERICAL",Vs="LOCALHOST",td="TLD",nd="UTLD",Ql="SCHEME",Hi="SLASH_SCHEME",rd="NUM",id="WS",sd="NL",Us="OPENBRACE",Ks="CLOSEBRACE",ea="OPENBRACKET",ta="CLOSEBRACKET",na="OPENPAREN",ra="CLOSEPAREN",ia="OPENANGLEBRACKET",sa="CLOSEANGLEBRACKET",oa="FULLWIDTHLEFTPAREN",la="FULLWIDTHRIGHTPAREN",aa="LEFTCORNERBRACKET",ca="RIGHTCORNERBRACKET",ua="LEFTWHITECORNERBRACKET",fa="RIGHTWHITECORNERBRACKET",da="FULLWIDTHLESSTHAN",ha="FULLWIDTHGREATERTHAN",pa="AMPERSAND",od="APOSTROPHE",ma="ASTERISK",_r="AT",ga="BACKSLASH",ya="BACKTICK",ba="CARET",xr="COLON",ld="COMMA",wa="DOLLAR",mn="DOT",Sa="EQUALS",ad="EXCLAMATION",Ut="HYPHEN",Js="PERCENT",va="PIPE",_a="PLUS",xa="POUND",Gs="QUERY",cd="QUOTE",z1="FULLWIDTHMIDDLEDOT",ud="SEMI",gn="SLASH",qs="TILDE",Ea="UNDERSCORE",B1="EMOJI",ka="SYM";var $1=Object.freeze({__proto__:null,WORD:Bn,UWORD:ed,ASCIINUMERICAL:D1,ALPHANUMERICAL:F1,LOCALHOST:Vs,TLD:td,UTLD:nd,SCHEME:Ql,SLASH_SCHEME:Hi,NUM:rd,WS:id,NL:sd,OPENBRACE:Us,CLOSEBRACE:Ks,OPENBRACKET:ea,CLOSEBRACKET:ta,OPENPAREN:na,CLOSEPAREN:ra,OPENANGLEBRACKET:ia,CLOSEANGLEBRACKET:sa,FULLWIDTHLEFTPAREN:oa,FULLWIDTHRIGHTPAREN:la,LEFTCORNERBRACKET:aa,RIGHTCORNERBRACKET:ca,LEFTWHITECORNERBRACKET:ua,RIGHTWHITECORNERBRACKET:fa,FULLWIDTHLESSTHAN:da,FULLWIDTHGREATERTHAN:ha,AMPERSAND:pa,APOSTROPHE:od,ASTERISK:ma,AT:_r,BACKSLASH:ga,BACKTICK:ya,CARET:ba,COLON:xr,COMMA:ld,DOLLAR:wa,DOT:mn,EQUALS:Sa,EXCLAMATION:ad,HYPHEN:Ut,PERCENT:Js,PIPE:va,PLUS:_a,POUND:xa,QUERY:Gs,QUOTE:cd,FULLWIDTHMIDDLEDOT:z1,SEMI:ud,SLASH:gn,TILDE:qs,UNDERSCORE:Ea,EMOJI:B1,SYM:ka});const $n=/[a-z]/,js=/\p{L}/u,fd=/\p{Emoji}/u,Hn=/\d/,dd=/\s/,H1="\r",hd=`
17
+ `,aI="\uFE0F",cI="\u200D",pd="\uFFFC";let Ca=null,Ta=null;function uI(n=[]){const e={};yt.groups=e;const t=new yt;Ca==null&&(Ca=V1(nI)),Ta==null&&(Ta=V1(rI)),P(t,"'",od),P(t,"{",Us),P(t,"}",Ks),P(t,"[",ea),P(t,"]",ta),P(t,"(",na),P(t,")",ra),P(t,"<",ia),P(t,">",sa),P(t,"\uFF08",oa),P(t,"\uFF09",la),P(t,"\u300C",aa),P(t,"\u300D",ca),P(t,"\u300E",ua),P(t,"\u300F",fa),P(t,"\uFF1C",da),P(t,"\uFF1E",ha),P(t,"&",pa),P(t,"*",ma),P(t,"@",_r),P(t,"`",ya),P(t,"^",ba),P(t,":",xr),P(t,",",ld),P(t,"$",wa),P(t,".",mn),P(t,"=",Sa),P(t,"!",ad),P(t,"-",Ut),P(t,"%",Js),P(t,"|",va),P(t,"+",_a),P(t,"#",xa),P(t,"?",Gs),P(t,'"',cd),P(t,"/",gn),P(t,";",ud),P(t,"~",qs),P(t,"_",Ea),P(t,"\\",ga),P(t,"\u30FB",z1);const r=Ae(t,Hn,rd,{[jf]:!0});Ae(r,Hn,r);const i=Ae(r,$n,D1,{[Hs]:!0}),o=Ae(r,js,F1,{[Ws]:!0}),a=Ae(t,$n,Bn,{[Yf]:!0});Ae(a,Hn,i),Ae(a,$n,a),Ae(i,Hn,i),Ae(i,$n,i);const c=Ae(t,js,ed,{[Xf]:!0});Ae(c,$n),Ae(c,Hn,o),Ae(c,js,c),Ae(o,Hn,o),Ae(o,$n),Ae(o,js,o);const f=P(t,hd,sd,{[Qf]:!0}),d=P(t,H1,id,{[Qf]:!0}),m=Ae(t,dd,id,{[Qf]:!0});P(t,pd,m),P(d,hd,f),P(d,pd,m),Ae(d,dd,m),P(m,H1),P(m,hd),Ae(m,dd,m),P(m,pd,m);const h=Ae(t,fd,B1,{[L1]:!0});P(h,"#"),Ae(h,fd,h),P(h,aI,h);const g=P(h,cI);P(g,"#"),Ae(g,fd,h);const b=[[$n,a],[Hn,i]],v=[[$n,null],[js,c],[Hn,o]];for(let x=0;x<Ca.length;x++)Er(t,Ca[x],td,Bn,b);for(let x=0;x<Ta.length;x++)Er(t,Ta[x],nd,ed,v);Xr(td,{tld:!0,ascii:!0},e),Xr(nd,{utld:!0,alpha:!0},e),Er(t,"file",Ql,Bn,b),Er(t,"mailto",Ql,Bn,b),Er(t,"http",Hi,Bn,b),Er(t,"https",Hi,Bn,b),Er(t,"ftp",Hi,Bn,b),Er(t,"ftps",Hi,Bn,b),Xr(Ql,{scheme:!0,ascii:!0},e),Xr(Hi,{slashscheme:!0,ascii:!0},e),n=n.sort((x,T)=>x[0]>T[0]?1:-1);for(let x=0;x<n.length;x++){const T=n[x][0],L=n[x][1]?{[iI]:!0}:{[sI]:!0};T.indexOf("-")>=0?L[Zf]=!0:$n.test(T)?Hn.test(T)?L[Hs]=!0:L[Yf]=!0:L[jf]=!0,P1(t,T,T,L)}return P1(t,"localhost",Vs,{ascii:!0}),t.jd=new yt(ka),{start:t,tokens:$i({groups:e},$1)}}function W1(n,e){const t=fI(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,d=0,m=null,h=-1,g=-1;for(;a<r&&(f=c.go(t[a]));)c=f,c.accepts()?(h=0,g=0,m=c):h>=0&&(h+=t[a].length,g++),d+=t[a].length,o+=t[a].length,a++;o-=h,a-=g,d-=h,i.push({t:m.t,v:e.slice(o-d,o),s:o-d,e:o})}return i}function fI(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 Er(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 yt(r),o.jr=i.slice(),n.j[f]=o),n=o}return o=new yt(t),o.jr=i.slice(),n.j[e[a-1]]=o,o}function V1(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 Ys={defaultProtocol:"http",events:null,format:U1,formatHref:U1,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function md(n,e=null){let t=$i({},Ys);n&&(t=$i(t,n instanceof md?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}md.prototype={o:Ys,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]:Ys[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 U1(n){return n}function K1(n,e){this.t="token",this.v=n,this.tk=e}K1.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=Ys.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),d=n.get("rel",t,e),m=n.getObj("attributes",t,e),h=n.getObj("events",t,e);return a.href=r,c&&(a.class=c),f&&(a.target=f),d&&(a.rel=d),m&&$i(a,m),{tagName:i,attributes:a,content:o,eventListeners:h}}};function Ma(n,e){class t extends K1{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 J1=Ma("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),G1=Ma("text"),dI=Ma("nl"),Aa=Ma("url",{isLink:!0,toHref(n=Ys.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==Vs&&n[1].t===xr}}),Kt=n=>new yt(n);function hI({groups:n}){const e=n.domain.concat([pa,ma,_r,ga,ya,ba,wa,Sa,Ut,rd,Js,va,_a,xa,gn,ka,qs,Ea]),t=[xr,ld,mn,ad,Js,Gs,cd,ud,ia,sa,Us,Ks,ta,ea,na,ra,oa,la,aa,ca,ua,fa,da,ha],r=[pa,od,ma,ga,ya,ba,wa,Sa,Ut,Us,Ks,Js,va,_a,xa,Gs,gn,ka,qs,Ea],i=Kt(),o=P(i,qs);ne(o,r,o),ne(o,n.domain,o);const a=Kt(),c=Kt(),f=Kt();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 d=P(a,_r);P(o,_r,d),P(c,_r,d),P(f,_r,d);const m=P(o,mn);ne(m,r,o),ne(m,n.domain,o);const h=Kt();ne(d,n.domain,h),ne(h,n.domain,h);const g=P(h,mn);ne(g,n.domain,h);const b=Kt(J1);ne(g,n.tld,b),ne(g,n.utld,b),P(d,Vs,b);const v=P(h,Ut);P(v,Ut,v),ne(v,n.domain,h),ne(b,n.domain,h),P(b,mn,g),P(b,Ut,v);const x=P(b,xr);ne(x,n.numeric,J1);const T=P(a,Ut),M=P(a,mn);P(T,Ut,T),ne(T,n.domain,a),ne(M,r,o),ne(M,n.domain,a);const L=Kt(Aa);ne(M,n.tld,L),ne(M,n.utld,L),ne(L,n.domain,a),ne(L,r,o),P(L,mn,M),P(L,Ut,T),P(L,_r,d);const B=P(L,xr),H=Kt(Aa);ne(B,n.numeric,H);const V=Kt(Aa),ue=Kt();ne(V,e,V),ne(V,t,ue),ne(ue,e,V),ne(ue,t,ue),P(L,gn,V),P(H,gn,V);const de=P(c,xr),be=P(f,xr),bt=P(be,gn),Yn=P(bt,gn);ne(c,n.domain,a),P(c,mn,M),P(c,Ut,T),ne(f,n.domain,a),P(f,mn,M),P(f,Ut,T),ne(de,n.domain,V),P(de,gn,V),P(de,Gs,V),ne(Yn,n.domain,V),ne(Yn,e,V),P(Yn,gn,V);const ln=[[Us,Ks],[ea,ta],[na,ra],[ia,sa],[oa,la],[aa,ca],[ua,fa],[da,ha]];for(let Xn=0;Xn<ln.length;Xn++){const[li,an]=ln[Xn],_n=P(V,li);P(ue,li,_n),P(_n,an,V);const Be=Kt(Aa);ne(_n,e,Be);const wt=Kt();ne(_n,t),ne(Be,e,Be),ne(Be,t,wt),ne(wt,e,Be),ne(wt,t,wt),P(Be,an,V),P(wt,an,V)}return P(i,Vs,L),P(i,sd,dI),{start:i,tokens:$1}}function pI(n,e,t){let r=t.length,i=0,o=[],a=[];for(;i<r;){let c=n,f=null,d=null,m=0,h=null,g=-1;for(;i<r&&!(f=c.go(t[i].t));)a.push(t[i++]);for(;i<r&&(d=f||c.go(t[i].t));)f=null,c=d,c.accepts()?(g=0,h=c):g>=0&&g++,i++,m++;if(g<0)i-=m,i<r&&(a.push(t[i]),i++);else{a.length>0&&(o.push(gd(G1,e,a)),a=[]),i-=g,m-=g;const b=h.t,v=t.slice(i-m,i);o.push(gd(b,e,v))}}return a.length>0&&o.push(gd(G1,e,a)),o}function gd(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 mI=typeof console<"u"&&console&&console.warn||(()=>{}),gI="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",xe={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function yI(){return yt.groups={},xe.scanner=null,xe.parser=null,xe.tokenQueue=[],xe.pluginQueue=[],xe.customSchemes=[],xe.initialized=!1,xe}function q1(n,e=!1){if(xe.initialized&&mI(`linkifyjs: already initialized - will not register custom scheme "${n}" ${gI}`),!/^[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`);ke.customSchemes.push([n,e])}function gA(){ke.scanner=aA(ke.customSchemes);for(let n=0;n<ke.tokenQueue.length;n++)ke.tokenQueue[n][1]({scanner:ke.scanner});ke.parser=fA(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 ma(n){return ke.initialized||gA(),hA(ke.parser.start,n,o1(ke.scanner.start,n))}ma.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=ma(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=ma(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:Ce.LINK},getMark:{typeName:Ce.LINK}})?.attrs||{href:e}}}function B(n){return(...e)=>t=>n(t,...e)}function ga(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 Gr(n){const e=ga(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 vA=Object.defineProperty,SA=(n,e,t)=>e in n?vA(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Fn=(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 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":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 kA={deg:1,grad:.9,rad:180/Math.PI,turn:360};function EA(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 _A(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 w1(n,e,t){return b1(e[0],e[1],CA(n[0],n[1],t))}function TA(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 Hn(n,e){return Yf(Math.abs(n)**e,n)}function v1(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 ya=new IA,$n={D50:[.3457/.3585,1,(1-.3457-.3585)/.3585],D65:[.3127/.329,1,(1-.3127-.329)/.329]};function Xf(n){return Array.isArray(n)?n:$n[n]}function ba(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(ya.run("chromatic-adaptation-start",i),i.M||(i.W1===$n.D65&&i.W2===$n.D50?i.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:i.W1===$n.D50&&i.W2===$n.D65&&(i.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),ya.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 zs={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]=w1(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(ya.run("parse-start",a),a.color)return a.color;if(a.parsed=EA(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 k=S.getFormat("color");if(k&&(m.includes(k.id)||(r=k.ids)!=null&&r.filter(T=>m.includes(T)).length)){const T=Object.keys(S.coords).map((P,F)=>a.parsed.args[F]||0);let M;return k.coordGrammar&&(M=S1(S,k,"color",T)),e&&Object.assign(e,{formatId:"color",types:M}),k.id.startsWith("--")&&!f.startsWith("--")&&zs.warn(`${S.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${k.id}) instead of color(${f}).`),f.startsWith("--")&&!k.id.startsWith("--")&&zs.warn(`${S.name} is a standard space and supported in the CSS spec. Use color(${k.id}) instead of prefixed color(${f}).`),{spaceId:S.id,coords:T,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 OA=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}),ya.run("colorspace-init-end",this)}inGamut(e,{epsilon:t=OA}={}){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=k1(e,this),e;let t;return e==="default"?t=Object.values(this.formats)[0]:t=this.formats[e],t?(t=k1(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(", ")}`)}};Fn(Zf,"registry",{}),Fn(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 k1(n,{coords:e}={}){if(n.coords&&!n.coordGrammar){n.type||(n.type="function"),n.name||(n.name="color"),n.coordGrammar=TA(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=w1(c,f,o)),o=qf(o,{precision:i,unit:h}),o})}return n}const Wn=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 E1 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=Wn),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=ba(this.white,this.base.white,r)),r}),e.fromBase??(e.fromBase=t=>(t=ba(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 Un(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(Un(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:Wn,fromBase:n=>ba(Wn.white,"D50",n),toBase:n=>ba("D50",Wn.white,n)}),PA=216/24389,C1=24/116,wa=24389/27;let th=$n.D50;const Vn=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]>C1?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]>C1?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 Sr(n){return(n%360+360)%360}const va=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:Vn,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),Sr(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>"]}}}),T1=25**7,Sa=Math.PI,M1=180/Sa,Oi=Sa/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]=Vn.from(n),f=va.from(Vn,[o,a,c])[1],[h,m,p]=Vn.from(e),g=va.from(Vn,[h,m,p])[1];f<0&&(f=0),g<0&&(g=0);let b=(f+g)/2,S=A1(b),k=.5*(1-Math.sqrt(S/(S+T1))),T=(1+k)*a,M=(1+k)*m,P=Math.sqrt(T**2+c**2),F=Math.sqrt(M**2+p**2),$=T===0&&c===0?0:Math.atan2(c,T),U=M===0&&p===0?0:Math.atan2(p,M);$<0&&($+=2*Sa),U<0&&(U+=2*Sa),$*=M1,U*=M1;let ue=h-o,he=F-P,be=U-$,yt=$+U,Gn=Math.abs(be),sn;P*F===0?sn=0:Gn<=180?sn=be:be>180?sn=be-360:be<-180?sn=be+360:zs.warn("the unthinkable has happened");let Jn=2*Math.sqrt(F*P)*Math.sin(sn*Oi/2),Xr=(o+h)/2,on=(P+F)/2,wn=A1(on),Fe;P*F===0?Fe=yt:Gn<=180?Fe=yt/2:yt<360?Fe=(yt+360)/2:Fe=(yt-360)/2;let bt=(Xr-50)**2,qn=1+.015*bt/Math.sqrt(20+bt),Gs=1+.045*on,ln=1;ln-=.17*Math.cos((Fe-30)*Oi),ln+=.24*Math.cos(2*Fe*Oi),ln+=.32*Math.cos((3*Fe+6)*Oi),ln-=.2*Math.cos((4*Fe-63)*Oi);let wt=1+.015*on*ln,Oa=30*Math.exp(-1*((Fe-275)/25)**2),Ra=2*Math.sqrt(wn/(wn+T1)),La=-1*Math.sin(2*Oa*Oi)*Ra,Gt=(ue/(t*qn))**2;return Gt+=(he/(r*Gs))**2,Gt+=(Jn/(i*wt))**2,Gt+=La*(he/(r*Gs))*(Jn/(i*wt)),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]],Fs=new re({id:"oklab",name:"Oklab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:Wn,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]=Fs.from(n),[o,a,c]=Fs.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 Ri(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,N1=UA/180;function VA(n,e,{l:t=2,c:r=1}={}){[n,e]=Ve([n,e]);let[i,o,a]=Vn.from(n),[,c,f]=va.from(Vn,[i,o,a]),[h,m,p]=Vn.from(e),g=va.from(Vn,[h,m,p])[1];c<0&&(c=0),g<0&&(g=0);let b=i-h,S=c-g,k=o-m,T=a-p,M=k**2+T**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)*N1)):$=.36+Math.abs(.4*Math.cos((f+35)*N1));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 O1=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:Wn,fromBase(n){return n.map(e=>Math.max(e*O1,0))},toBase(n){return n.map(e=>Math.max(e/O1,0))}}),xa=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),Ea=-.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=xa*e-(xa-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+Ea)*f/(1+Ea*f)-ih,h,m]},toBase(n){let[e,t,r]=n,i=(e+ih)/(1+Ea-Ea*(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+(xa-1)*h)/xa,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),Sr(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=$n.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]},Jr={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=Hn(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*Hn(i/(400-i),J1),r)})}function pI(n){let e=Sr(n);e<=Jr.h[0]&&(e+=360);const t=AA(Jr.h,e)-1,[r,i]=Jr.h.slice(t,t+2),[o,a]=Jr.e.slice(t,t+2),c=Jr.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]=Jr.h.slice(t,t+2),[o,a]=Jr.e.slice(t,t+2);return Sr((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(k=>k*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(k=>b1(1,c/k,g)),o.dRgbInv=o.dRgb.map(k=>1/k);const b=f.map((k,T)=>k*o.dRgb[T]),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=Sr(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=Hn(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=Hn(a*Math.pow(1.64-Math.pow(.29,e.n),-.73),10/9),f=.25*(Math.cos(t+2)+3.8),h=e.aW*Hn(o,2/e.c/e.z),m=5e4/13*e.nc*e.ncb*f,p=h/e.nbb,g=23*(p+.305)*v1(c,23*m+c*(11*r+108*i)),b=g*r,S=g*i,k=dI(Be(uI,[p,b,S]).map(T=>T*1/1403),e.fl);return Be(cI,k.map((T,M)=>T*e.dRgbInv[M])).map(T=>T/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*v1(c*Math.sqrt(i**2+o**2),r[0]+r[1]+1.05*r[2]+.305),h=Hn(f,.9)*Math.pow(1.64-Math.pow(.29,e.n),.73),m=e.nbb*(2*r[0]+r[1]+.05*r[2]),p=Hn(m/e.aW,.5*e.c*e.z),g=100*Hn(p,2),b=4/e.c*p*(e.aW+4)*e.flRoot,S=h*p,k=S*e.flRoot,T=Sr(a*hI),M=pI(T),P=50*Hn(e.c*h/(e.aW+4),1/2);return{J:g,C:S,h:T,s:P,Q:b,M:k,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:Wn,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=$n.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 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 vI(n,e){const t=bI(n[1]);if(t===0)return[0,0,0];const r=Q1(n,ah);return[Sr(r.h),r.C,t]}const ah=X1(gI,200/Math.PI*lh(50),lh(50)*100,"average",!1),_a=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:Wn,fromBase(n){return vI(n)},toBase(n){return wI(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=_a.fromBase(_a.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(_a.from(n)),[o,a,c]=ny(_a.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 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 Hs(n,{method:e=zs.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),Ri(n,t,{epsilon:0}))return n;let a;if(e==="css")a=EI(n,{space:t});else{if(e!=="clip"&&!Ri(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=Hs(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=Un(ze(n,P.space),P.id);if(jf(F)&&(F=0),F>=o.max)return ze({space:"xyz-d65",coords:$n.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],k=kI(i),T=S,M=Un(g,p);for(;M-T>k;){let P=rh(g);P=Hs(P,{space:t,method:"clip"}),c(g,P)-i<k?T=Un(g,p):M=Un(g,p),eh(g,p,(T+M)/2)}a=ze(g,t)}else a=f}else a=ze(n,t);if(e==="clip"||!Ri(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}Hs.returns="color";const sy={WHITE:{space:Fs,coords:[1,0,0]},BLACK:{space:Fs,coords:[0,0,0]}};function EI(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(Ri(o,e,{epsilon:0}))return ze(o,e);function c(S){const k=ze(S,e),T=Object.values(e.coords);return k.coords=k.coords.map((M,P)=>{if("range"in T[P]){const[F,$]=T[P].range;return MA(F,M,$)}return M}),k}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&&Ri(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=Hs(i,t===!0?void 0:t)),i}ze.returns="color";function _I(n,{precision:e=zs.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&&!Ri(n)&&(f=Hs(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]],TI=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],MI=new E1({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:CI,fromXYZ_M:TI}),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 E1({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 Un(n,[Wn,"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>"]}}}),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:Fs,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),Sr(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){Fn(this,"data"),this.data=ze(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 Un(this.data,"hsv.h")}get s(){return Un(this.data,"hsv.s")}get v(){return Un(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 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=_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 Nt(this.data)}}class OI{constructor(e){Fn(this,"_color"),Fn(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=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(II),re.register(uy),re.register(NI);function hy(n){if(!n)return Nt.fromTransparent();try{return new Nt(ze(x1(n),"srgb"))}catch(e){return console.warn(e),Nt.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=Nt.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){Fn(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){Fn(this,"isEmpty",!1),Fn(this,"_angle",0),Fn(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 OI(e)).toString()}function dy(n){return WI(n)}function py(n,e){if(!n.includes("em"))return parseInt(n);const t=Li.getComputedStyle(e).fontSize,r=parseFloat(n)*parseFloat(t);return Math.round(r)}function UI(n,e){return(n.firstElementChild||n).style.fontSize||Li.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:yr.LEFT,end:yr.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:{},$s={exports:{}};var XI=$s.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,k=2,T=1,M=2,P=4,F=8,$=16,U=32,ue=64,he=128,be=256,yt=512,Gn=30,sn="...",Jn=800,Xr=16,on=1,wn=2,Fe=3,bt=1/0,qn=9007199254740991,Gs=17976931348623157e292,ln=NaN,wt=4294967295,Oa=wt-1,Ra=wt>>>1,La=[["ary",he],["bind",T],["bindKey",M],["curry",F],["curryRight",$],["flip",yt],["partial",U],["partialRight",ue],["rearg",be]],Gt="[object Arguments]",Js="[object Array]",_y="[object AsyncFunction]",Fi="[object Boolean]",Hi="[object Date]",Cy="[object DOMException]",qs="[object Error]",js="[object Function]",bh="[object GeneratorFunction]",Jt="[object Map]",$i="[object Number]",Ty="[object Null]",vn="[object Object]",wh="[object Promise]",My="[object Proxy]",Wi="[object RegExp]",qt="[object Set]",Ui="[object String]",Ys="[object Symbol]",Ay="[object Undefined]",Vi="[object WeakMap]",Iy="[object WeakSet]",Ki="[object ArrayBuffer]",Zr="[object DataView]",Pa="[object Float32Array]",Da="[object Float64Array]",Ba="[object Int8Array]",za="[object Int16Array]",Fa="[object Int32Array]",Ha="[object Uint8Array]",$a="[object Uint8ClampedArray]",Wa="[object Uint16Array]",Ua="[object Uint32Array]",Ny=/\b__p \+= '';/g,Oy=/\b(__p \+=) '' \+/g,Ry=/(__e\(.*?\)|\b__t\)) \+\n'';/g,vh=/&(?:amp|lt|gt|quot|#39);/g,Sh=/[&<>"']/g,Ly=RegExp(vh.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,Va=/[\\^$.*+?()[\]{}|]/g,$y=RegExp(Va.source),Ka=/^\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,kh=/\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,Xs=/($^)/,n2=/['\n\r\u2028\u2029\\]/g,Zs="\\ud800-\\udfff",r2="\\u0300-\\u036f",i2="\\ufe20-\\ufe2f",s2="\\u20d0-\\u20ff",Eh=r2+i2+s2,_h="\\u2700-\\u27bf",Ch="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",Th="A-Z\\xc0-\\xd6\\xd8-\\xde",Mh="\\ufe0e\\ufe0f",Ah=o2+l2+a2+c2,Ga="['\u2019]",u2="["+Zs+"]",Ih="["+Ah+"]",Qs="["+Eh+"]",Nh="\\d+",f2="["+_h+"]",Oh="["+Ch+"]",Rh="[^"+Zs+Ah+Nh+_h+Ch+Th+"]",Ja="\\ud83c[\\udffb-\\udfff]",h2="(?:"+Qs+"|"+Ja+")",Lh="[^"+Zs+"]",qa="(?:\\ud83c[\\udde6-\\uddff]){2}",ja="[\\ud800-\\udbff][\\udc00-\\udfff]",Qr="["+Th+"]",Ph="\\u200d",Dh="(?:"+Oh+"|"+Rh+")",d2="(?:"+Qr+"|"+Rh+")",Bh="(?:"+Ga+"(?:d|ll|m|re|s|t|ve))?",zh="(?:"+Ga+"(?:D|LL|M|RE|S|T|VE))?",Fh=h2+"?",Hh="["+Mh+"]?",p2="(?:"+Ph+"(?:"+[Lh,qa,ja].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,qa,ja].join("|")+")"+$h,b2="(?:"+[Lh+Qs+"?",Qs,qa,ja,u2].join("|")+")",w2=RegExp(Ga,"g"),v2=RegExp(Qs,"g"),Ya=RegExp(Ja+"(?="+Ja+")|"+b2+$h,"g"),S2=RegExp([Qr+"?"+Oh+"+"+Bh+"(?="+[Ih,Qr,"$"].join("|")+")",d2+"+"+zh+"(?="+[Ih,Qr+Dh,"$"].join("|")+")",Qr+"?"+Dh+"+"+Bh,Qr+"+"+zh,g2,m2,Nh,y2].join("|"),"g"),x2=RegExp("["+Ph+Zs+Eh+Mh+"]"),k2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,E2=["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[Pa]=xe[Da]=xe[Ba]=xe[za]=xe[Fa]=xe[Ha]=xe[$a]=xe[Wa]=xe[Ua]=!0,xe[Gt]=xe[Js]=xe[Ki]=xe[Fi]=xe[Zr]=xe[Hi]=xe[qs]=xe[js]=xe[Jt]=xe[$i]=xe[vn]=xe[Wi]=xe[qt]=xe[Ui]=xe[Vi]=!1;var Se={};Se[Gt]=Se[Js]=Se[Ki]=Se[Zr]=Se[Fi]=Se[Hi]=Se[Pa]=Se[Da]=Se[Ba]=Se[za]=Se[Fa]=Se[Jt]=Se[$i]=Se[vn]=Se[Wi]=Se[qt]=Se[Ui]=Se[Ys]=Se[Ha]=Se[$a]=Se[Wa]=Se[Ua]=!0,Se[qs]=Se[js]=Se[Vi]=!1;var C2={\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"},T2={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},M2={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},A2={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},I2=parseFloat,N2=parseInt,Wh=typeof Ca=="object"&&Ca&&Ca.Object===Object&&Ca,O2=typeof self=="object"&&self&&self.Object===Object&&self,qe=Wh||O2||Function("return this")(),Xa=e&&!e.nodeType&&e,_r=Xa&&!0&&n&&!n.nodeType&&n,Uh=_r&&_r.exports===Xa,Za=Uh&&Wh.process,Ot=function(){try{var _=_r&&_r.require&&_r.require("util").types;return _||Za&&Za.binding&&Za.binding("util")}catch{}}(),Vh=Ot&&Ot.isArrayBuffer,Kh=Ot&&Ot.isDate,Gh=Ot&&Ot.isMap,Jh=Ot&&Ot.isRegExp,qh=Ot&&Ot.isSet,jh=Ot&&Ot.isTypedArray;function vt(_,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 jn(_,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 eo(_,I){var A=_==null?0:_.length;return!!A&&ei(_,I,0)>-1}function Qa(_,I,A){for(var V=-1,X=_==null?0:_.length;++V<X;)if(A(I,_[V]))return!0;return!1}function Ee(_,I){for(var A=-1,V=_==null?0:_.length,X=Array(V);++A<V;)X[A]=I(_[A],A,_);return X}function Yn(_,I){for(var A=-1,V=I.length,X=_.length;++A<V;)_[X+A]=I[A];return _}function ec(_,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 tc(_,I){for(var A=-1,V=_==null?0:_.length;++A<V;)if(I(_[A],A,_))return!0;return!1}var D2=nc("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 to(_,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 ei(_,I,A){return I===I?Y2(_,I,A):to(_,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?ic(_,I)/A:ln}function nc(_){return function(I){return I==null?t:I[_]}}function rc(_){return function(I){return _==null?t:_[I]}}function ed(_,I,A,V,X){return X(_,function(me,Pe,ve){A=V?(V=!1,me):I(A,me,Pe,ve)}),A}function H2(_,I){var A=_.length;for(_.sort(I);A--;)_[A]=_[A].value;return _}function ic(_,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 sc(_,I){for(var A=-1,V=Array(_);++A<_;)V[A]=I(A);return V}function $2(_,I){return Ee(I,function(A){return[A,_[A]]})}function td(_){return _&&_.slice(0,sd(_)+1).replace(Ka,"")}function St(_){return function(I){return _(I)}}function oc(_,I){return Ee(I,function(A){return _[A]})}function Gi(_,I){return _.has(I)}function nd(_,I){for(var A=-1,V=_.length;++A<V&&ei(I,_[A],0)>-1;);return A}function rd(_,I){for(var A=_.length;A--&&ei(I,_[A],0)>-1;);return A}function W2(_,I){for(var A=_.length,V=0;A--;)_[A]===I&&++V;return V}var U2=rc(C2),V2=rc(T2);function K2(_){return"\\"+A2[_]}function G2(_,I){return _==null?t:_[I]}function ti(_){return x2.test(_)}function J2(_){return k2.test(_)}function q2(_){for(var I,A=[];!(I=_.next()).done;)A.push(I.value);return A}function lc(_){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 Xn(_,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 no(_){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 ni(_){return ti(_)?Q2(_):D2(_)}function jt(_){return ti(_)?eb(_):B2(_)}function sd(_){for(var I=_.length;I--&&Wy.test(_.charAt(I)););return I}var Z2=rc(M2);function Q2(_){for(var I=Ya.lastIndex=0;Ya.test(_);)++I;return I}function eb(_){return _.match(Ya)||[]}function tb(_){return _.match(S2)||[]}var nb=function _(I){I=I==null?qe:ri.defaults(qe.Object(),I,ri.pick(qe,E2));var A=I.Array,V=I.Date,X=I.Error,me=I.Function,Pe=I.Math,ve=I.Object,ac=I.RegExp,rb=I.String,Lt=I.TypeError,ro=A.prototype,ib=me.prototype,ii=ve.prototype,io=I["__core-js_shared__"],so=ib.toString,we=ii.hasOwnProperty,sb=0,od=function(){var s=/[^.]+$/.exec(io&&io.keys&&io.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),oo=ii.toString,ob=so.call(ve),lb=qe._,ab=ac("^"+so.call(we).replace(Va,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),lo=Uh?I.Buffer:t,Zn=I.Symbol,ao=I.Uint8Array,ld=lo?lo.allocUnsafe:t,co=id(ve.getPrototypeOf,ve),ad=ve.create,cd=ii.propertyIsEnumerable,uo=ro.splice,ud=Zn?Zn.isConcatSpreadable:t,Ji=Zn?Zn.iterator:t,Cr=Zn?Zn.toStringTag:t,fo=function(){try{var s=Nr(ve,"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,ho=Pe.ceil,po=Pe.floor,cc=ve.getOwnPropertySymbols,hb=lo?lo.isBuffer:t,fd=I.isFinite,db=ro.join,pb=id(ve.keys,ve),De=Pe.max,Qe=Pe.min,mb=V.now,gb=I.parseInt,hd=Pe.random,yb=ro.reverse,uc=Nr(I,"DataView"),qi=Nr(I,"Map"),fc=Nr(I,"Promise"),si=Nr(I,"Set"),ji=Nr(I,"WeakMap"),Yi=Nr(ve,"create"),mo=ji&&new ji,oi={},bb=Or(uc),wb=Or(qi),vb=Or(fc),Sb=Or(si),xb=Or(ji),go=Zn?Zn.prototype:t,Xi=go?go.valueOf:t,dd=go?go.toString:t;function w(s){if(Me(s)&&!Z(s)&&!(s instanceof oe)){if(s instanceof Pt)return s;if(we.call(s,"__wrapped__"))return pp(s)}return new Pt(s)}var li=function(){function s(){}return function(l){if(!Te(l))return{};if(ad)return ad(l);s.prototype=l;var u=new s;return s.prototype=t,u}}();function yo(){}function Pt(s,l){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}w.templateSettings={escape:Dy,evaluate:By,interpolate:xh,variable:"",imports:{_:w}},w.prototype=yo.prototype,w.prototype.constructor=w,Pt.prototype=li(yo.prototype),Pt.prototype.constructor=Pt;function oe(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=wt,this.__views__=[]}function kb(){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 Eb(){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,v=Bw(0,y,this.__views__),x=v.start,E=v.end,C=E-x,N=d?E:x-1,O=this.__iteratees__,R=O.length,H=0,G=Qe(C,this.__takeCount__);if(!u||!d&&y==C&&G==C)return Bd(s,this.__actions__);var q=[];e:for(;C--&&H<G;){N+=l;for(var ee=-1,j=s[N];++ee<R;){var se=O[ee],fe=se.iteratee,Et=se.type,rt=fe(j);if(Et==wn)j=rt;else if(!rt){if(Et==on)continue e;break e}}q[H++]=j}return q}oe.prototype=li(yo.prototype),oe.prototype.constructor=oe;function Tr(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 Cb(){this.__data__=Yi?Yi(null):{},this.size=0}function Tb(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(Yi){var u=l[s];return u===f?t:u}return we.call(l,s)?l[s]:t}function Ab(s){var l=this.__data__;return Yi?l[s]!==t:we.call(l,s)}function Ib(s,l){var u=this.__data__;return this.size+=this.has(s)?0:1,u[s]=Yi&&l===t?f:l,this}Tr.prototype.clear=Cb,Tr.prototype.delete=Tb,Tr.prototype.get=Mb,Tr.prototype.has=Ab,Tr.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 Nb(){this.__data__=[],this.size=0}function Ob(s){var l=this.__data__,u=bo(l,s);if(u<0)return!1;var d=l.length-1;return u==d?l.pop():uo.call(l,u,1),--this.size,!0}function Rb(s){var l=this.__data__,u=bo(l,s);return u<0?t:l[u][1]}function Lb(s){return bo(this.__data__,s)>-1}function Pb(s,l){var u=this.__data__,d=bo(u,s);return d<0?(++this.size,u.push([s,l])):u[d][1]=l,this}Sn.prototype.clear=Nb,Sn.prototype.delete=Ob,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 Tr,map:new(qi||Sn),string:new Tr}}function Bb(s){var l=Io(this,s).delete(s);return this.size-=l?1:0,l}function zb(s){return Io(this,s).get(s)}function Fb(s){return Io(this,s).has(s)}function Hb(s,l){var u=Io(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 Mr(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)}Mr.prototype.add=Mr.prototype.push=$b,Mr.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(!qi||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&&Rr(s),y=!u&&!d&&rr(s),v=!u&&!d&&!y&&fi(s),x=u||d||y||v,E=x?sc(s.length,rb):[],C=E.length;for(var N in s)(l||we.call(s,N))&&!(x&&(N=="length"||y&&(N=="offset"||N=="parent")||v&&(N=="buffer"||N=="byteLength"||N=="byteOffset")||Cn(N,C)))&&E.push(N);return E}function md(s){var l=s.length;return l?s[xc(0,l-1)]:t}function qb(s,l){return No(ct(s),Ar(l,0,s.length))}function jb(s){return No(ct(s))}function hc(s,l,u){(u!==t&&!Xt(s[l],u)||u===t&&!(l in s))&&kn(s,l,u)}function Zi(s,l,u){var d=s[l];(!(we.call(s,l)&&Xt(d,u))||u===t&&!(l in s))&&kn(s,l,u)}function bo(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 Qn(s,function(y,v,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 kn(s,l,u){l=="__proto__"&&fo?fo(s,l,{configurable:!0,enumerable:!0,value:u,writable:!0}):s[l]=u}function dc(s,l){for(var u=-1,d=l.length,y=A(d),v=s==null;++u<d;)y[u]=v?t:Jc(s,l[u]);return y}function Ar(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,v){var x,E=l&p,C=l&g,N=l&b;if(u&&(x=y?u(s,d,y,v):u(s)),x!==t)return x;if(!Te(s))return s;var O=Z(s);if(O){if(x=Fw(s),!E)return ct(s,x)}else{var R=et(s),H=R==js||R==bh;if(rr(s))return Hd(s,E);if(R==vn||R==Gt||H&&!y){if(x=C||H?{}:sp(s),!E)return C?Mw(s,Xb(x,s)):Tw(s,gd(x,s))}else{if(!Se[R])return y?s:{};x=Hw(s,R,E)}}v||(v=new Yt);var G=v.get(s);if(G)return G;v.set(s,x),Lp(s)?s.forEach(function(j){x.add(Dt(j,l,u,j,s,v))}):Op(s)&&s.forEach(function(j,se){x.set(se,Dt(j,l,u,se,s,v))});var q=N?C?Rc:Oc:C?ft:He,ee=O?t:q(s);return Rt(ee||s,function(j,se){ee&&(se=j,j=s[se]),Zi(x,se,Dt(j,l,u,se,s,v))}),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=ve(s);d--;){var y=u[d],v=l[y],x=s[y];if(x===t&&!(y in s)||!v(x))return!1}return!0}function bd(s,l,u){if(typeof s!="function")throw new Lt(a);return ss(function(){s.apply(t,u)},l)}function Qi(s,l,u,d){var y=-1,v=eo,x=!0,E=s.length,C=[],N=l.length;if(!E)return C;u&&(l=Ee(l,St(u))),d?(v=Qa,x=!1):l.length>=i&&(v=Gi,x=!1,l=new Mr(l));e:for(;++y<E;){var O=s[y],R=u==null?O:u(O);if(O=d||O!==0?O:0,x&&R===R){for(var H=N;H--;)if(l[H]===R)continue e;C.push(O)}else v(l,R,d)||C.push(O)}return C}var Qn=Kd(an),wd=Kd(mc,!0);function Qb(s,l){var u=!0;return Qn(s,function(d,y,v){return u=!!l(d,y,v),u}),u}function wo(s,l,u){for(var d=-1,y=s.length;++d<y;){var v=s[d],x=l(v);if(x!=null&&(E===t?x===x&&!kt(x):u(x,E)))var E=x,C=v}return C}function ew(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 vd(s,l){var u=[];return Qn(s,function(d,y,v){l(d,y,v)&&u.push(d)}),u}function je(s,l,u,d,y){var v=-1,x=s.length;for(u||(u=Ww),y||(y=[]);++v<x;){var E=s[v];l>0&&u(E)?l>1?je(E,l-1,u,d,y):Yn(y,E):d||(y[y.length]=E)}return y}var pc=Gd(),Sd=Gd(!0);function an(s,l){return s&&pc(s,l,He)}function mc(s,l){return s&&Sd(s,l,He)}function vo(s,l){return jn(l,function(u){return Tn(s[u])})}function Ir(s,l){l=tr(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:Yn(d,u(s))}function tt(s){return s==null?s===t?Ay:Ty:Cr&&Cr in ve(s)?Dw(s):jw(s)}function gc(s,l){return s>l}function tw(s,l){return s!=null&&we.call(s,l)}function nw(s,l){return s!=null&&l in ve(s)}function rw(s,l,u){return s>=Qe(l,u)&&s<De(l,u)}function yc(s,l,u){for(var d=u?Qa:eo,y=s[0].length,v=s.length,x=v,E=A(v),C=1/0,N=[];x--;){var O=s[x];x&&l&&(O=Ee(O,St(l))),C=Qe(O.length,C),E[x]=!u&&(l||y>=120&&O.length>=120)?new Mr(x&&O):t}O=s[0];var R=-1,H=E[0];e:for(;++R<y&&N.length<C;){var G=O[R],q=l?l(G):G;if(G=u||G!==0?G:0,!(H?Gi(H,q):d(N,q,u))){for(x=v;--x;){var ee=E[x];if(!(ee?Gi(ee,q):d(s[x],q,u)))continue e}H&&H.push(q),N.push(G)}}return N}function iw(s,l,u,d){return an(s,function(y,v,x){l(d,u(y),v,x)}),d}function es(s,l,u){l=tr(l,s),s=cp(s,l);var d=s==null?s:s[un(zt(l))];return d==null?t:vt(d,s,u)}function kd(s){return Me(s)&&tt(s)==Gt}function sw(s){return Me(s)&&tt(s)==Ki}function ow(s){return Me(s)&&tt(s)==Hi}function ts(s,l,u,d,y){return s===l?!0:s==null||l==null||!Me(s)&&!Me(l)?s!==s&&l!==l:lw(s,l,u,d,ts,y)}function lw(s,l,u,d,y,v){var x=Z(s),E=Z(l),C=x?Js:et(s),N=E?Js:et(l);C=C==Gt?vn:C,N=N==Gt?vn:N;var O=C==vn,R=N==vn,H=C==N;if(H&&rr(s)){if(!rr(l))return!1;x=!0,O=!1}if(H&&!O)return v||(v=new Yt),x||fi(s)?np(s,l,u,d,y,v):Lw(s,l,C,u,d,y,v);if(!(u&S)){var G=O&&we.call(s,"__wrapped__"),q=R&&we.call(l,"__wrapped__");if(G||q){var ee=G?s.value():s,j=q?l.value():l;return v||(v=new Yt),y(ee,j,u,d,v)}}return H?(v||(v=new Yt),Pw(s,l,u,d,y,v)):!1}function aw(s){return Me(s)&&et(s)==Jt}function bc(s,l,u,d){var y=u.length,v=y,x=!d;if(s==null)return!v;for(s=ve(s);y--;){var E=u[y];if(x&&E[2]?E[1]!==s[E[0]]:!(E[0]in s))return!1}for(;++y<v;){E=u[y];var C=E[0],N=s[C],O=E[1];if(x&&E[2]){if(N===t&&!(C in s))return!1}else{var R=new Yt;if(d)var H=d(N,O,C,s,l,R);if(!(H===t?ts(O,N,S|k,d,R):H))return!1}}return!0}function Ed(s){if(!Te(s)||Vw(s))return!1;var l=Tn(s)?ab:Zy;return l.test(Or(s))}function cw(s){return Me(s)&&tt(s)==Wi}function uw(s){return Me(s)&&et(s)==qt}function fw(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]):Td(s):Jp(s)}function wc(s){if(!is(s))return pb(s);var l=[];for(var u in ve(s))we.call(s,u)&&u!="constructor"&&l.push(u);return l}function hw(s){if(!Te(s))return qw(s);var l=is(s),u=[];for(var d in s)d=="constructor"&&(l||!we.call(s,d))||u.push(d);return u}function vc(s,l){return s<l}function Cd(s,l){var u=-1,d=ut(s)?A(s.length):[];return Qn(s,function(y,v,x){d[++u]=l(y,v,x)}),d}function Td(s){var l=Pc(s);return l.length==1&&l[0][2]?lp(l[0][0],l[0][1]):function(u){return u===s||bc(u,s,l)}}function Md(s,l){return Bc(s)&&op(l)?lp(un(s),l):function(u){var d=Jc(u,s);return d===t&&d===l?qc(u,s):ts(l,d,S|k)}}function So(s,l,u,d,y){s!==l&&pc(l,function(v,x){if(y||(y=new Yt),Te(v))dw(s,l,x,u,So,d,y);else{var E=d?d(Fc(s,x),v,x+"",s,l,y):t;E===t&&(E=v),hc(s,x,E)}},ft)}function dw(s,l,u,d,y,v,x){var E=Fc(s,u),C=Fc(l,u),N=x.get(C);if(N){hc(s,u,N);return}var O=v?v(E,C,u+"",s,l,x):t,R=O===t;if(R){var H=Z(C),G=!H&&rr(C),q=!H&&!G&&fi(C);O=C,H||G||q?Z(E)?O=E:Ne(E)?O=ct(E):G?(R=!1,O=Hd(C,!0)):q?(R=!1,O=$d(C,!0)):O=[]:ls(C)||Rr(C)?(O=E,Rr(E)?O=Bp(E):(!Te(E)||Tn(E))&&(O=sp(C))):R=!1}R&&(x.set(C,O),y(O,C,d,v,x),x.delete(C)),hc(s,u,O)}function Ad(s,l){var u=s.length;if(u)return l+=l<0?u:0,Cn(l,u)?s[l]:t}function Id(s,l,u){l.length?l=Ee(l,function(v){return Z(v)?function(x){return Ir(x,v.length===1?v[0]:v)}:v}):l=[ht];var d=-1;l=Ee(l,St(J()));var y=Cd(s,function(v,x,E){var C=Ee(l,function(N){return N(v)});return{criteria:C,index:++d,value:v}});return H2(y,function(v,x){return Cw(v,x,u)})}function pw(s,l){return Nd(s,l,function(u,d){return qc(s,d)})}function Nd(s,l,u){for(var d=-1,y=l.length,v={};++d<y;){var x=l[d],E=Ir(s,x);u(E,x)&&ns(v,tr(x,s),E)}return v}function mw(s){return function(l){return Ir(l,s)}}function Sc(s,l,u,d){var y=d?F2:ei,v=-1,x=l.length,E=s;for(s===l&&(l=ct(l)),u&&(E=Ee(s,St(u)));++v<x;)for(var C=0,N=l[v],O=u?u(N):N;(C=y(E,O,C,d))>-1;)E!==s&&uo.call(E,C,1),uo.call(s,C,1);return s}function Od(s,l){for(var u=s?l.length:0,d=u-1;u--;){var y=l[u];if(u==d||y!==v){var v=y;Cn(y)?uo.call(s,y,1):_c(s,y)}}return s}function xc(s,l){return s+po(hd()*(l-s+1))}function gw(s,l,u,d){for(var y=-1,v=De(ho((l-s)/(u||1)),0),x=A(v);v--;)x[d?v:++y]=s,s+=u;return x}function kc(s,l){var u="";if(!s||l<1||l>qn)return u;do l%2&&(u+=s),l=po(l/2),l&&(s+=s);while(l);return u}function ie(s,l){return Hc(ap(s,l,ht),s+"")}function yw(s){return md(hi(s))}function bw(s,l){var u=hi(s);return No(u,Ar(l,0,u.length))}function ns(s,l,u,d){if(!Te(s))return s;l=tr(l,s);for(var y=-1,v=l.length,x=v-1,E=s;E!=null&&++y<v;){var C=un(l[y]),N=u;if(C==="__proto__"||C==="constructor"||C==="prototype")return s;if(y!=x){var O=E[C];N=d?d(O,C,E):t,N===t&&(N=Te(O)?O:Cn(l[y+1])?[]:{})}Zi(E,C,N),E=E[C]}return s}var Rd=mo?function(s,l){return mo.set(s,l),s}:ht,ww=fo?function(s,l){return fo(s,"toString",{configurable:!0,enumerable:!1,value:Yc(l),writable:!0})}:ht;function vw(s){return No(hi(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 v=A(y);++d<y;)v[d]=s[d+l];return v}function Sw(s,l){var u;return Qn(s,function(d,y,v){return u=l(d,y,v),!u}),!!u}function xo(s,l,u){var d=0,y=s==null?d:s.length;if(typeof l=="number"&&l===l&&y<=Ra){for(;d<y;){var v=d+y>>>1,x=s[v];x!==null&&!kt(x)&&(u?x<=l:x<l)?d=v+1:y=v}return y}return Ec(s,l,ht,u)}function Ec(s,l,u,d){var y=0,v=s==null?0:s.length;if(v===0)return 0;l=u(l);for(var x=l!==l,E=l===null,C=kt(l),N=l===t;y<v;){var O=po((y+v)/2),R=u(s[O]),H=R!==t,G=R===null,q=R===R,ee=kt(R);if(x)var j=d||q;else N?j=q&&(d||H):E?j=q&&H&&(d||!G):C?j=q&&H&&!G&&(d||!ee):G||ee?j=!1:j=d?R<=l:R<l;j?y=O+1:v=O}return Qe(v,Oa)}function Ld(s,l){for(var u=-1,d=s.length,y=0,v=[];++u<d;){var x=s[u],E=l?l(x):x;if(!u||!Xt(E,C)){var C=E;v[y++]=x===0?0:x}}return v}function Pd(s){return typeof s=="number"?s:kt(s)?ln:+s}function xt(s){if(typeof s=="string")return s;if(Z(s))return Ee(s,xt)+"";if(kt(s))return dd?dd.call(s):"";var l=s+"";return l=="0"&&1/s==-1/0?"-0":l}function er(s,l,u){var d=-1,y=eo,v=s.length,x=!0,E=[],C=E;if(u)x=!1,y=Qa;else if(v>=i){var N=l?null:Ow(s);if(N)return no(N);x=!1,y=Gi,C=new Mr}else C=l?[]:E;e:for(;++d<v;){var O=s[d],R=l?l(O):O;if(O=u||O!==0?O:0,x&&R===R){for(var H=C.length;H--;)if(C[H]===R)continue e;l&&C.push(R),E.push(O)}else y(C,R,u)||(C!==E&&C.push(R),E.push(O))}return E}function _c(s,l){return l=tr(l,s),s=cp(s,l),s==null||delete s[un(zt(l))]}function Dd(s,l,u,d){return ns(s,l,u(Ir(s,l)),d)}function ko(s,l,u,d){for(var y=s.length,v=d?y:-1;(d?v--:++v<y)&&l(s[v],v,s););return u?Bt(s,d?0:v,d?v+1:y):Bt(s,d?v+1:0,d?y:v)}function Bd(s,l){var u=s;return u instanceof oe&&(u=u.value()),ec(l,function(d,y){return y.func.apply(y.thisArg,Yn([d],y.args))},u)}function Cc(s,l,u){var d=s.length;if(d<2)return d?er(s[0]):[];for(var y=-1,v=A(d);++y<d;)for(var x=s[y],E=-1;++E<d;)E!=y&&(v[y]=Qi(v[y]||x,s[E],l,u));return er(je(v,1),l,u)}function zd(s,l,u){for(var d=-1,y=s.length,v=l.length,x={};++d<y;){var E=d<v?l[d]:t;u(x,s[d],E)}return x}function Tc(s){return Ne(s)?s:[]}function Mc(s){return typeof s=="function"?s:ht}function tr(s,l){return Z(s)?s:Bc(s,l)?[s]:dp(ge(s))}var xw=ie;function nr(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 Ac(s){var l=new s.constructor(s.byteLength);return new ao(l).set(new ao(s)),l}function kw(s,l){var u=l?Ac(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.byteLength)}function Ew(s){var l=new s.constructor(s.source,kh.exec(s));return l.lastIndex=s.lastIndex,l}function _w(s){return Xi?ve(Xi.call(s)):{}}function $d(s,l){var u=l?Ac(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,v=kt(s),x=l!==t,E=l===null,C=l===l,N=kt(l);if(!E&&!N&&!v&&s>l||v&&x&&C&&!E&&!N||d&&x&&C||!u&&C||!y)return 1;if(!d&&!v&&!N&&s<l||N&&u&&y&&!d&&!v||E&&u&&y||!x&&y||!C)return-1}return 0}function Cw(s,l,u){for(var d=-1,y=s.criteria,v=l.criteria,x=y.length,E=u.length;++d<x;){var C=Wd(y[d],v[d]);if(C){if(d>=E)return C;var N=u[d];return C*(N=="desc"?-1:1)}}return s.index-l.index}function Ud(s,l,u,d){for(var y=-1,v=s.length,x=u.length,E=-1,C=l.length,N=De(v-x,0),O=A(C+N),R=!d;++E<C;)O[E]=l[E];for(;++y<x;)(R||y<v)&&(O[u[y]]=s[y]);for(;N--;)O[E++]=s[y++];return O}function Vd(s,l,u,d){for(var y=-1,v=s.length,x=-1,E=u.length,C=-1,N=l.length,O=De(v-E,0),R=A(O+N),H=!d;++y<O;)R[y]=s[y];for(var G=y;++C<N;)R[G+C]=l[C];for(;++x<E;)(H||y<v)&&(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 v=-1,x=l.length;++v<x;){var E=l[v],C=d?d(u[E],s[E],E,u,s):t;C===t&&(C=s[E]),y?kn(u,E,C):Zi(u,E,C)}return u}function Tw(s,l){return cn(s,Dc(s),l)}function Mw(s,l){return cn(s,rp(s),l)}function Eo(s,l){return function(u,d){var y=Z(u)?R2:Yb,v=l?l():{};return y(u,s,J(d,2),v)}}function ai(s){return ie(function(l,u){var d=-1,y=u.length,v=y>1?u[y-1]:t,x=y>2?u[2]:t;for(v=s.length>3&&typeof v=="function"?(y--,v):t,x&&nt(u[0],u[1],x)&&(v=y<3?t:v,y=1),l=ve(l);++d<y;){var E=u[d];E&&s(l,E,d,v)}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,v=l?y:-1,x=ve(u);(l?v--:++v<y)&&d(x[v],v,x)!==!1;);return u}}function Gd(s){return function(l,u,d){for(var y=-1,v=ve(l),x=d(l),E=x.length;E--;){var C=x[s?E:++y];if(u(v[C],C,v)===!1)break}return l}}function Aw(s,l,u){var d=l&T,y=rs(s);function v(){var x=this&&this!==qe&&this instanceof v?y:s;return x.apply(d?u:this,arguments)}return v}function Jd(s){return function(l){l=ge(l);var u=ti(l)?jt(l):t,d=u?u[0]:l.charAt(0),y=u?nr(u,1).join(""):l.slice(1);return d[s]()+y}}function ci(s){return function(l){return ec(Kp(Vp(l).replace(w2,"")),s,"")}}function rs(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=li(s.prototype),d=s.apply(u,l);return Te(d)?d:u}}function Iw(s,l,u){var d=rs(s);function y(){for(var v=arguments.length,x=A(v),E=v,C=ui(y);E--;)x[E]=arguments[E];var N=v<3&&x[0]!==C&&x[v-1]!==C?[]:Xn(x,C);if(v-=N.length,v<u)return Zd(s,l,_o,y.placeholder,t,x,N,t,t,u-v);var O=this&&this!==qe&&this instanceof y?d:s;return vt(O,this,x)}return y}function qd(s){return function(l,u,d){var y=ve(l);if(!ut(l)){var v=J(u,3);l=He(l),u=function(E){return v(y[E],E,y)}}var x=s(l,u,d);return x>-1?y[v?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 v=l[d];if(typeof v!="function")throw new Lt(a);if(y&&!x&&Ao(v)=="wrapper")var x=new Pt([],!0)}for(d=x?d:u;++d<u;){v=l[d];var E=Ao(v),C=E=="wrapper"?Lc(v):t;C&&zc(C[0])&&C[1]==(he|F|U|be)&&!C[4].length&&C[9]==1?x=x[Ao(C[0])].apply(x,C[3]):x=v.length==1&&zc(v)?x[E]():x.thru(v)}return function(){var N=arguments,O=N[0];if(x&&N.length==1&&Z(O))return x.plant(O).value();for(var R=0,H=u?l[R].apply(this,N):O;++R<u;)H=l[R].call(this,H);return H}})}function _o(s,l,u,d,y,v,x,E,C,N){var O=l&he,R=l&T,H=l&M,G=l&(F|$),q=l&yt,ee=H?t:rs(s);function j(){for(var se=arguments.length,fe=A(se),Et=se;Et--;)fe[Et]=arguments[Et];if(G)var rt=ui(j),_t=W2(fe,rt);if(d&&(fe=Ud(fe,d,y,G)),v&&(fe=Vd(fe,v,x,G)),se-=_t,G&&se<N){var Oe=Xn(fe,rt);return Zd(s,l,_o,j.placeholder,u,fe,Oe,E,C,N-se)}var Zt=R?u:this,An=H?Zt[s]:s;return se=fe.length,E?fe=Yw(fe,E):q&&se>1&&fe.reverse(),O&&C<se&&(fe.length=C),this&&this!==qe&&this instanceof j&&(An=ee||rs(An)),An.apply(Zt,fe)}return j}function Yd(s,l){return function(u,d){return iw(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 Ic(s){return _n(function(l){return l=Ee(l,St(J())),ie(function(u){var d=this;return s(l,function(y){return vt(y,d,u)})})})}function To(s,l){l=l===t?" ":xt(l);var u=l.length;if(u<2)return u?kc(l,s):l;var d=kc(l,ho(s/ni(l)));return ti(l)?nr(jt(d),0,s).join(""):d.slice(0,s)}function Nw(s,l,u,d){var y=l&T,v=rs(s);function x(){for(var E=-1,C=arguments.length,N=-1,O=d.length,R=A(O+C),H=this&&this!==qe&&this instanceof x?v:s;++N<O;)R[N]=d[N];for(;C--;)R[N++]=arguments[++E];return vt(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),gw(l,u,d,s)}}function Mo(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,v,x,E,C,N){var O=l&F,R=O?x:t,H=O?t:x,G=O?v:t,q=O?t:v;l|=O?U:ue,l&=~(O?ue:U),l&P||(l&=-4);var ee=[s,l,y,G,R,q,H,E,C,N],j=u.apply(t,ee);return zc(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"),v=l(y[0]+"e"+(+y[1]+d));return y=(ge(v)+"e").split("e"),+(y[0]+"e"+(+y[1]-d))}return l(u)}}var Ow=si&&1/no(new si([,-0]))[1]==bt?function(s){return new si(s)}:Qc;function Qd(s){return function(l){var u=et(l);return u==Jt?lc(l):u==qt?j2(l):$2(l,s(l))}}function En(s,l,u,d,y,v,x,E){var C=l&M;if(!C&&typeof s!="function")throw new Lt(a);var N=d?d.length:0;if(N||(l&=-97,d=y=t),x=x===t?x:De(Q(x),0),E=E===t?E:Q(E),N-=y?y.length:0,l&ue){var O=d,R=y;d=y=t}var H=C?t:Lc(s),G=[s,l,u,d,y,O,R,v,x,E];if(H&&Jw(G,H),s=G[0],l=G[1],u=G[2],d=G[3],y=G[4],E=G[9]=G[9]===t?C?0:s.length:De(G[9]-N,0),!E&&l&(F|$)&&(l&=-25),!l||l==T)var q=Aw(s,l,u);else l==F||l==$?q=Iw(s,l,E):(l==U||l==(T|U))&&!y.length?q=Nw(s,l,u,d):q=_o.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,ii[u])&&!we.call(d,u)?l:s}function tp(s,l,u,d,y,v){return Te(s)&&Te(l)&&(v.set(l,s),So(s,l,t,tp,v),v.delete(l)),s}function Rw(s){return ls(s)?t:s}function np(s,l,u,d,y,v){var x=u&S,E=s.length,C=l.length;if(E!=C&&!(x&&C>E))return!1;var N=v.get(s),O=v.get(l);if(N&&O)return N==l&&O==s;var R=-1,H=!0,G=u&k?new Mr:t;for(v.set(s,l),v.set(l,s);++R<E;){var q=s[R],ee=l[R];if(d)var j=x?d(ee,q,R,l,s,v):d(q,ee,R,s,l,v);if(j!==t){if(j)continue;H=!1;break}if(G){if(!tc(l,function(se,fe){if(!Gi(G,fe)&&(q===se||y(q,se,u,d,v)))return G.push(fe)})){H=!1;break}}else if(!(q===ee||y(q,ee,u,d,v))){H=!1;break}}return v.delete(s),v.delete(l),H}function Lw(s,l,u,d,y,v,x){switch(u){case Zr:if(s.byteLength!=l.byteLength||s.byteOffset!=l.byteOffset)return!1;s=s.buffer,l=l.buffer;case Ki:return!(s.byteLength!=l.byteLength||!v(new ao(s),new ao(l)));case Fi:case Hi:case $i:return Xt(+s,+l);case qs:return s.name==l.name&&s.message==l.message;case Wi:case Ui:return s==l+"";case Jt:var E=lc;case qt:var C=d&S;if(E||(E=no),s.size!=l.size&&!C)return!1;var N=x.get(s);if(N)return N==l;d|=k,x.set(s,l);var O=np(E(s),E(l),d,y,v,x);return x.delete(s),O;case Ys:if(Xi)return Xi.call(s)==Xi.call(l)}return!1}function Pw(s,l,u,d,y,v){var x=u&S,E=Oc(s),C=E.length,N=Oc(l),O=N.length;if(C!=O&&!x)return!1;for(var R=C;R--;){var H=E[R];if(!(x?H in l:we.call(l,H)))return!1}var G=v.get(s),q=v.get(l);if(G&&q)return G==l&&q==s;var ee=!0;v.set(s,l),v.set(l,s);for(var j=x;++R<C;){H=E[R];var se=s[H],fe=l[H];if(d)var Et=x?d(fe,se,H,l,s,v):d(se,fe,H,s,l,v);if(!(Et===t?se===fe||y(se,fe,u,d,v):Et)){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 v.delete(s),v.delete(l),ee}function _n(s){return Hc(ap(s,t,yp),s+"")}function Oc(s){return xd(s,He,Dc)}function Rc(s){return xd(s,ft,rp)}var Lc=mo?function(s){return mo.get(s)}:Qc;function Ao(s){for(var l=s.name+"",u=oi[l],d=we.call(oi,l)?u.length:0;d--;){var y=u[d],v=y.func;if(v==null||v==s)return y.name}return l}function ui(s){var l=we.call(w,"placeholder")?w:s;return l.placeholder}function J(){var s=w.iteratee||Xc;return s=s===Xc?_d:s,arguments.length?s(arguments[0],arguments[1]):s}function Io(s,l){var u=s.__data__;return Uw(l)?u[typeof l=="string"?"string":"hash"]:u.map}function Pc(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 Ed(u)?u:t}function Dw(s){var l=we.call(s,Cr),u=s[Cr];try{s[Cr]=t;var d=!0}catch{}var y=oo.call(s);return d&&(l?s[Cr]=u:delete s[Cr]),y}var Dc=cc?function(s){return s==null?[]:(s=ve(s),jn(cc(s),function(l){return cd.call(s,l)}))}:eu,rp=cc?function(s){for(var l=[];s;)Yn(l,Dc(s)),s=co(s);return l}:eu,et=tt;(uc&&et(new uc(new ArrayBuffer(1)))!=Zr||qi&&et(new qi)!=Jt||fc&&et(fc.resolve())!=wh||si&&et(new si)!=qt||ji&&et(new ji)!=Vi)&&(et=function(s){var l=tt(s),u=l==vn?s.constructor:t,d=u?Or(u):"";if(d)switch(d){case bb:return Zr;case wb:return Jt;case vb:return wh;case Sb:return qt;case xb:return Vi}return l});function Bw(s,l,u){for(var d=-1,y=u.length;++d<y;){var v=u[d],x=v.size;switch(v.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 zw(s){var l=s.match(Vy);return l?l[1].split(Ky):[]}function ip(s,l,u){l=tr(l,s);for(var d=-1,y=l.length,v=!1;++d<y;){var x=un(l[d]);if(!(v=s!=null&&u(s,x)))break;s=s[x]}return v||++d!=y?v:(y=s==null?0:s.length,!!y&&Bo(y)&&Cn(x,y)&&(Z(s)||Rr(s)))}function Fw(s){var l=s.length,u=new s.constructor(l);return l&&typeof s[0]=="string"&&we.call(s,"index")&&(u.index=s.index,u.input=s.input),u}function sp(s){return typeof s.constructor=="function"&&!is(s)?li(co(s)):{}}function Hw(s,l,u){var d=s.constructor;switch(l){case Ki:return Ac(s);case Fi:case Hi:return new d(+s);case Zr:return kw(s,u);case Pa:case Da:case Ba:case za:case Fa:case Ha:case $a:case Wa:case Ua:return $d(s,u);case Jt:return new d;case $i:case Ui:return new d(s);case Wi:return Ew(s);case qt:return new d;case Ys:return _w(s)}}function $w(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`);xe.customSchemes.push([n,e])}function bI(){xe.scanner=uI(xe.customSchemes);for(let n=0;n<xe.tokenQueue.length;n++)xe.tokenQueue[n][1]({scanner:xe.scanner});xe.parser=hI(xe.scanner.tokens);for(let n=0;n<xe.pluginQueue.length;n++)xe.pluginQueue[n][1]({scanner:xe.scanner,parser:xe.parser});return xe.initialized=!0,xe}function Ia(n){return xe.initialized||bI(),pI(xe.parser.start,n,W1(xe.scanner.start,n))}Ia.scan=W1;function j1(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 md(t),i=Ia(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 wI(n,e=null){const t=Ia(n);return t.length===1&&t[0].isLink&&(!e||t[0].t===e)}class SI extends qf{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=wI(i);if(!i||!o)return!1;const a=this._createLinkAttrs(i,r.content);return this.editor.commands.applyLink(a),!0}_createLinkAttrs(e,t){return Qd.query(t,{typeName:te.TEXT,mark:{typeName:Ce.LINK},getMark:{typeName:Ce.LINK}})?.attrs||{href:e}}}function D(n){return(...e)=>t=>n(t,...e)}function Na(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 Zr(n){const e=Na(n);return["span",e?{...e,class:"zw-style"}:{},0]}function vI(n){return n.toLowerCase().replace(/(?:^|\s)\S/g,e=>e.toUpperCase())}function Jt(n,...e){return({editor:t})=>(t.commands[n](...e),!0)}const yd=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Y1=()=>{},_I=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),Oa=Object.assign,yn=Array.isArray,Qr=n=>typeof n=="function",kr=n=>typeof n=="string",xI=n=>typeof n=="symbol",ei=n=>n!==null&&typeof n=="object";let X1;const Ra=()=>X1||(X1=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function bd(n){if(yn(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],i=kr(r)?TI(r):bd(r);if(i)for(const o in i)e[o]=i[o]}return e}else if(kr(n)||ei(n))return n}const EI=/;(?![^(]*\))/g,kI=/:([^]+)/,CI=/\/\*[^]*?\*\//g;function TI(n){const e={};return n.replace(CI,"").split(EI).forEach(t=>{if(t){const r=t.split(kI);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function wd(n){let e="";if(kr(n))e=n;else if(yn(n))for(let t=0;t<n.length;t++){const r=wd(n[t]);r&&(e+=r+" ")}else if(ei(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),Symbol(process.env.NODE_ENV!=="production"?"Array iterate":""),new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(xI));function Z1(n){return Sd(n)?Z1(n.__v_raw):!!(n&&n.__v_isReactive)}function Sd(n){return!!(n&&n.__v_isReadonly)}function vd(n){return!!(n&&n.__v_isShallow)}function _d(n){return n?!!n.__v_raw:!1}function ti(n){const e=n&&n.__v_raw;return e?ti(e):n}function xd(n){return n?n.__v_isRef===!0:!1}const ni=[];function MI(n){ni.push(n)}function AI(){ni.pop()}let Ed=!1;function Wi(n,...e){if(Ed)return;Ed=!0;const t=ni.length?ni[ni.length-1].component:null,r=t&&t.appContext.config.warnHandler,i=II();if(r)kd(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 <${py(t,o.type)}>`).join(`
21
+ `),i]);else{const o=[`[Vue warn]: ${n}`,...e];i.length&&o.push(`
22
+ `,...NI(i)),console.warn(...o)}Ed=!1}function II(){let n=ni[ni.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 NI(n){const e=[];return n.forEach((t,r)=>{e.push(...r===0?[]:[`
23
+ `],...OI(t))}),e}function OI({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",r=n.component?n.component.parent==null:!1,i=` at <${py(n.component,n.type,r)}`,o=">"+t;return n.props?[i,...RI(n.props),o]:[i+o]}function RI(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(r=>{e.push(...Q1(r,n[r]))}),t.length>3&&e.push(" ..."),e}function Q1(n,e,t){return kr(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:xd(e)?(e=Q1(n,ti(e.value),!0),t?e:[`${n}=Ref<`,e,">"]):Qr(e)?[`${n}=fn${e.name?`<${e.name}>`:""}`]:(e=ti(e),t?e:[`${n}=`,e])}const ey={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 kd(n,e,t,r){try{return r?n(...r):n()}catch(i){ty(i,e,t)}}function ty(n,e,t,r=!0){const i=e?e.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:a}=e&&e.appContext.config||yd;if(e){let c=e.parent;const f=e.proxy,d=process.env.NODE_ENV!=="production"?ey[t]:`https://vuejs.org/error-reference/#runtime-${t}`;for(;c;){const m=c.ec;if(m){for(let h=0;h<m.length;h++)if(m[h](n,f,d)===!1)return}c=c.parent}if(o){kd(o,null,10,[n,f,d]);return}}LI(n,t,i,r,a)}function LI(n,e,t,r=!0,i=!1){if(process.env.NODE_ENV!=="production"){const o=ey[e];if(t&&MI(t),Wi(`Unhandled error${o?` during execution of ${o}`:""}`),t&&AI(),r)throw n;console.error(n)}else{if(i)throw n;console.error(n)}}const Gt=[];let Wn=-1;const Vi=[];let Cr=null,Ui=0;const PI=Promise.resolve();let Cd=null;const DI=100;function FI(n){let e=Wn+1,t=Gt.length;for(;e<t;){const r=e+t>>>1,i=Gt[r],o=Xs(i);o<n||o===n&&i.flags&2?e=r+1:t=r}return e}function zI(n){if(!(n.flags&1)){const e=Xs(n),t=Gt[Gt.length-1];!t||!(n.flags&2)&&e>=Xs(t)?Gt.push(n):Gt.splice(FI(e),0,n),n.flags|=1,ny()}}function ny(){Cd||(Cd=PI.then(ry))}function BI(n){yn(n)?Vi.push(...n):Cr&&n.id===-1?Cr.splice(Ui+1,0,n):n.flags&1||(Vi.push(n),n.flags|=1),ny()}function $I(n){if(Vi.length){const e=[...new Set(Vi)].sort((t,r)=>Xs(t)-Xs(r));if(Vi.length=0,Cr){Cr.push(...e);return}for(Cr=e,process.env.NODE_ENV!=="production"&&(n=n||new Map),Ui=0;Ui<Cr.length;Ui++){const t=Cr[Ui];process.env.NODE_ENV!=="production"&&iy(n,t)||(t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2)}Cr=null,Ui=0}}const Xs=n=>n.id==null?n.flags&2?-1:1/0:n.id;function ry(n){process.env.NODE_ENV!=="production"&&(n=n||new Map);const e=process.env.NODE_ENV!=="production"?t=>iy(n,t):Y1;try{for(Wn=0;Wn<Gt.length;Wn++){const t=Gt[Wn];if(t&&!(t.flags&8)){if(process.env.NODE_ENV!=="production"&&e(t))continue;t.flags&4&&(t.flags&=-2),kd(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2)}}}finally{for(;Wn<Gt.length;Wn++){const t=Gt[Wn];t&&(t.flags&=-2)}Wn=-1,Gt.length=0,$I(n),Cd=null,(Gt.length||Vi.length)&&ry(n)}}function iy(n,e){const t=n.get(e)||0;if(t>DI){const r=e.i,i=r&&hy(r.type);return ty(`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 Td=new Map;process.env.NODE_ENV!=="production"&&(Ra().__VUE_HMR_RUNTIME__={createRecord:Md(HI),rerender:Md(WI),reload:Md(VI)});const La=new Map;function HI(n,e){return La.has(n)?!1:(La.set(n,{initialDef:Pa(e),instances:new Set}),!0)}function Pa(n){return my(n)?n.__vccOpts:n}function WI(n,e){const t=La.get(n);t&&(t.initialDef.render=e,[...t.instances].forEach(r=>{e&&(r.render=e,Pa(r.type).render=e),r.renderCache=[],r.job.flags&8||r.update()}))}function VI(n,e){const t=La.get(n);if(!t)return;e=Pa(e),sy(t.initialDef,e);const r=[...t.instances];for(let i=0;i<r.length;i++){const o=r[i],a=Pa(o.type);let c=Td.get(a);c||(a!==t.initialDef&&sy(a,e),Td.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?zI(()=>{o.job.flags&8||(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)}BI(()=>{Td.clear()})}function sy(n,e){Oa(n,e);for(const t in n)t!=="__file"&&!(t in e)&&delete n[t]}function Md(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 Ki,Da=[];function oy(n,e){var t,r;Ki=n,Ki?(Ki.enabled=!0,Da.forEach(({event:i,args:o})=>Ki.emit(i,...o)),Da=[]):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=>{oy(o,e)}),setTimeout(()=>{Ki||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Da=[])},3e3)):Da=[]}let Fa=null,UI=null;const KI=n=>n.__isTeleport;function ly(n,e){n.shapeFlag&6&&n.component?(n.transition=e,ly(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}Ra().requestIdleCallback,Ra().cancelIdleCallback;const JI=Symbol.for("v-ndc"),GI={};process.env.NODE_ENV!=="production"&&(GI.ownKeys=n=>(Wi("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)));const qI={},ay=n=>Object.getPrototypeOf(n)===qI,jI=n=>n.__isSuspense,cy=Symbol.for("v-fgt"),YI=Symbol.for("v-txt"),XI=Symbol.for("v-cmt");function ZI(n){return n?n.__v_isVNode===!0:!1}const QI=(...n)=>fy(...n),uy=({key:n})=>n??null,za=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?kr(n)||xd(n)||Qr(n)?{i:Fa,r:n,k:e,f:!!t}:n:null);function eN(n,e=null,t=null,r=0,i=null,o=n===cy?0:1,a=!1,c=!1){const f={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&uy(e),ref:e&&za(e),scopeId:UI,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:Fa};return c?(Ad(f,t),o&128&&n.normalize(f)):t&&(f.shapeFlag|=kr(t)?8:16),process.env.NODE_ENV!=="production"&&f.key!==f.key&&Wi("VNode created with invalid key (NaN). VNode type:",f.type),f}const tN=process.env.NODE_ENV!=="production"?QI:fy;function fy(n,e=null,t=null,r=0,i=null,o=!1){if((!n||n===JI)&&(process.env.NODE_ENV!=="production"&&!n&&Wi(`Invalid vnode type when creating vnode: ${n}.`),n=XI),ZI(n)){const c=Ba(n,e,!0);return t&&Ad(c,t),c.patchFlag=-2,c}if(my(n)&&(n=n.__vccOpts),e){e=nN(e);let{class:c,style:f}=e;c&&!kr(c)&&(e.class=wd(c)),ei(f)&&(_d(f)&&!yn(f)&&(f=Oa({},f)),e.style=bd(f))}const a=kr(n)?1:jI(n)?128:KI(n)?64:ei(n)?4:Qr(n)?2:0;return process.env.NODE_ENV!=="production"&&a&4&&_d(n)&&(n=ti(n),Wi("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`.",`
24
+ Component that was made reactive: `,n)),eN(n,e,t,r,i,a,o,!0)}function nN(n){return n?_d(n)||ay(n)?Oa({},n):n:null}function Ba(n,e,t=!1,r=!1){const{props:i,ref:o,patchFlag:a,children:c,transition:f}=n,d=e?iN(i||{},e):i,m={__v_isVNode:!0,__v_skip:!0,type:n.type,props:d,key:d&&uy(d),ref:e&&e.ref?t&&o?yn(o)?o.concat(za(e)):[o,za(e)]:za(e):o,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:process.env.NODE_ENV!=="production"&&a===-1&&yn(c)?c.map(dy):c,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==cy?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&&Ba(n.ssContent),ssFallback:n.ssFallback&&Ba(n.ssFallback),placeholder:n.placeholder,el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return f&&r&&ly(m,f.clone(m)),m}function dy(n){const e=Ba(n);return yn(n.children)&&(e.children=n.children.map(dy)),e}function rN(n=" ",e=0){return tN(YI,null,n,e)}function Ad(n,e){let t=0;const{shapeFlag:r}=n;if(e==null)e=null;else if(yn(e))t=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),Ad(n,i()),i._c&&(i._d=!0));return}else t=32,!e._&&!ay(e)&&(e._ctx=Fa);else Qr(e)?(e={default:e,_ctx:Fa},t=32):(e=String(e),r&64?(t=16,e=[rN(e)]):t=8);n.children=e,n.shapeFlag|=t}function iN(...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=wd([e.class,r.class]));else if(i==="style")e.style=bd([e.style,r.style]);else if(_I(i)){const o=e[i],a=r[i];a&&o!==a&&!(yn(o)&&o.includes(a))&&(e[i]=o?[].concat(o,a):a)}else i!==""&&(e[i]=r[i])}return e}{const n=Ra(),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=>t),e("__VUE_SSR_SETTERS__",t=>t)}process.env.NODE_ENV;const sN=/(?:^|[-_])\w/g,oN=n=>n.replace(sN,e=>e.toUpperCase()).replace(/[-_]/g,"");function hy(n,e=!0){return Qr(n)?n.displayName||n.name:n.name||e&&n.__name}function py(n,e,t=!1){let r=hy(e);if(!r&&e.__file){const i=e.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&n){const i=o=>{for(const a in o)if(o[a]===e)return a};r=i(n.components)||n.parent&&i(n.parent.type.components)||i(n.appContext.components)}return r?oN(r):t?"App":"Anonymous"}function my(n){return Qr(n)&&"__vccOpts"in n}function lN(){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(h){if(!ei(h))return null;if(h.__isVue)return["div",n,"VueInstance"];if(xd(h)){const g=h.value;return["div",{},["span",n,m(h)],"<",c(g),">"]}else{if(Z1(h))return["div",{},["span",n,vd(h)?"ShallowReactive":"Reactive"],"<",c(h),`>${Sd(h)?" (readonly)":""}`];if(Sd(h))return["div",{},["span",n,vd(h)?"ShallowReadonly":"Readonly"],"<",c(h),">"]}return null},hasBody(h){return h&&h.__isVue},body(h){if(h&&h.__isVue)return["div",{},...o(h.$)]}};function o(h){const g=[];h.type.props&&h.props&&g.push(a("props",ti(h.props))),h.setupState!==yd&&g.push(a("setup",h.setupState)),h.data!==yd&&g.push(a("data",ti(h.data)));const b=f(h,"computed");b&&g.push(a("computed",b));const v=f(h,"inject");return v&&g.push(a("injected",v)),g.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:h}]]),g}function a(h,g){return g=Oa({},g),Object.keys(g).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},h],["div",{style:"padding-left:1.25em"},...Object.keys(g).map(b=>["div",{},["span",r,b+": "],c(g[b],!1)])]]:["span",{}]}function c(h,g=!0){return typeof h=="number"?["span",e,h]:typeof h=="string"?["span",t,JSON.stringify(h)]:typeof h=="boolean"?["span",r,h]:ei(h)?["object",{object:g?ti(h):h}]:["span",t,String(h)]}function f(h,g){const b=h.type;if(Qr(b))return;const v={};for(const x in h.ctx)d(b,x,g)&&(v[x]=h.ctx[x]);return v}function d(h,g,b){const v=h[b];if(yn(v)&&v.includes(g)||ei(v)&&g in v||h.extends&&d(h.extends,g,b)||h.mixins&&h.mixins.some(x=>d(x,g,b)))return!0}function m(h){return vd(h)?"ShallowRef":h.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 aN(){lN()}process.env.NODE_ENV!=="production"&&aN();var cN=Object.defineProperty,uN=(n,e,t)=>e in n?cN(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Vn=(n,e,t)=>uN(n,typeof e!="symbol"?e+"":e,t),gy,yy,by;function Fe(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 d of c)f+=a*d;return f}for(let d=0;d<a.length;d++)f+=a[d]*(c[d]||0);return f}));return t===1&&(o=o[0]),r===1?o.map(a=>a[0]):o}function wy(n){return Zs(n)==="string"}function Zs(n){return(Object.prototype.toString.call(n).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function Id(n,{precision:e,unit:t}){return Nd(n)?"none":fN(n,e)+(t??"")}function Nd(n){return Number.isNaN(n)||n instanceof Number&&n?.none}function fN(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 dN={deg:1,grad:.9,rad:180/Math.PI,turn:360};function hN(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 d=f.match(r),m=f;if(d){let h=d[0],g=m.slice(0,-h.length);h==="%"?(m=new Number(g/100),m.type="<percentage>"):(m=new Number(g*dN[h]),m.type="<angle>",m.unit=h)}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 pN(n){return n[n.length-1]}function Sy(n,e,t){return isNaN(n)?e:isNaN(e)?n:n+(e-n)*t}function mN(n,e,t){return(t-n)/(e-n)}function vy(n,e,t){return Sy(e[0],e[1],mN(n[0],n[1],t))}function gN(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 yN(n,e,t){return Math.max(Math.min(t,e),n)}function Od(n,e){return Math.sign(n)===Math.sign(e)?n:-n}function Un(n,e){return Od(Math.abs(n)**e,n)}function _y(n,e){return e===0?0:n/e}function bN(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 wN{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 $a=new wN,Kn={D50:[.3457/.3585,1,(1-.3457-.3585)/.3585],D65:[.3127/.329,1,(1-.3127-.329)/.329]};function Rd(n){return Array.isArray(n)?n:Kn[n]}function Ha(n,e,t,r={}){if(n=Rd(n),e=Rd(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($a.run("chromatic-adaptation-start",i),i.M||(i.W1===Kn.D65&&i.W2===Kn.D50?i.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:i.W1===Kn.D50&&i.W2===Kn.D65&&(i.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),$a.run("chromatic-adaptation-end",i),i.M)return Fe(i.M,i.XYZ);throw new TypeError("Only Bradford CAT with white points D50 and D65 supported for now.")}const Qs={gamut_mapping:"css",precision:5,deltaE:"76",verbose:((by=(yy=(gy=globalThis?.process)==null?void 0:gy.env)==null?void 0:yy.NODE_ENV)==null?void 0:by.toLowerCase())!=="test",warn:function(e){var t,r;this.verbose&&((r=(t=globalThis?.console)==null?void 0:t.warn)==null||r.call(t,e))}},SN=new Set(["<number>","<percentage>","<angle>"]);function xy(n,e,t,r){return Object.entries(n.coords).map(([o,a],c)=>{let f=e.coordGrammar[c],d=r[c],m=d?.type,h;if(d.none?h=f.find(v=>SN.has(v)):h=f.find(v=>v==m),!h){let v=a.name||o;throw new TypeError(`${m??d.raw} not allowed for ${v} in ${t}()`)}let g=h.range;m==="<percentage>"&&(g||(g=[0,1]));let b=a.range||a.refRange;return g&&b&&(r[c]=vy(g,b,r[c])),h})}function Ey(n,{meta:e}={}){var t,r,i,o;let a={str:(t=String(n))==null?void 0:t.trim()};if($a.run("parse-start",a),a.color)return a.color;if(a.parsed=hN(a.str),a.parsed){let c=a.parsed.name;if(c==="color"){let f=a.parsed.args.shift(),d=f.startsWith("--")?f.substring(2):`--${f}`,m=[f,d],h=a.parsed.rawArgs.indexOf("/")>0?a.parsed.args.pop():1;for(let v of re.all){let x=v.getFormat("color");if(x&&(m.includes(x.id)||(r=x.ids)!=null&&r.filter(T=>m.includes(T)).length)){const T=Object.keys(v.coords).map((L,B)=>a.parsed.args[B]||0);let M;return x.coordGrammar&&(M=xy(v,x,"color",T)),e&&Object.assign(e,{formatId:"color",types:M}),x.id.startsWith("--")&&!f.startsWith("--")&&Qs.warn(`${v.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${x.id}) instead of color(${f}).`),f.startsWith("--")&&!x.id.startsWith("--")&&Qs.warn(`${v.name} is a standard space and supported in the CSS spec. Use color(${x.id}) instead of prefixed color(${f}).`),{spaceId:v.id,coords:T,alpha:h}}}let g="",b=f in re.registry?f:d;if(b in re.registry){let v=(o=(i=re.registry[b].formats)==null?void 0:i.color)==null?void 0:o.id;v&&(g=`Did you mean color(${v})?`)}throw new TypeError(`Cannot parse color(${f}). `+(g||"Missing a plugin?"))}else for(let f of re.all){let d=f.getFormat(c);if(d&&d.type==="function"){let m=1;(d.lastAlpha||pN(a.parsed.args).alpha)&&(m=a.parsed.args.pop());let h=a.parsed.args,g;return d.coordGrammar&&(g=xy(f,d,c,h)),e&&Object.assign(e,{formatId:d.name,types:g}),{spaceId:f.id,coords:h,alpha:m}}}}else for(let c of re.all)for(let f in c.formats){let d=c.formats[f];if(d.type!=="custom"||d.test&&!d.test(a.str))continue;let m=d.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 Ue(n){if(Array.isArray(n))return n.map(Ue);if(!n)throw new TypeError("Empty color reference");wy(n)&&(n=Ey(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 vN=75e-6,Ld=class sn{constructor(e){var t;this.id=e.id,this.name=e.name,this.base=e.base?sn.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=Rd(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:sn.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:_N(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),$a.run("colorspace-init-end",this)}inGamut(e,{epsilon:t=vN}={}){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=ky(e,this),e;let t;return e==="default"?t=Object.values(this.formats)[0]:t=this.formats[e],t?(t=ky(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=Ue(e);[e,t]=[c.space,c.coords]}if(e=sn.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=Ue(e);[e,t]=[r.space,r.coords]}return e=sn.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(sn.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 sn)return e;if(Zs(e)==="string"){let i=sn.registry[e.toLowerCase()];if(!i)throw new TypeError(`No color space found with id = "${e}"`);return i}if(t.length)return sn.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=sn.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 d=Object.entries(o.coords)[a];if(d)return{space:o,id:d[0],index:a,...d[1]}}o=sn.get(o);let c=a.toLowerCase(),f=0;for(let d in o.coords){let m=o.coords[d];if(d.toLowerCase()===c||((r=m.name)==null?void 0:r.toLowerCase())===c)return{space:o,id:d,index:f,...m};f++}throw new TypeError(`No "${a}" coordinate found in ${o.name}. Its coordinates are: ${Object.keys(o.coords).join(", ")}`)}};Vn(Ld,"registry",{}),Vn(Ld,"DEFAULT_FORMAT",{type:"functions",name:"color"});let re=Ld;function _N(n){let e=[n];for(let t=n;t=t.base;)e.push(t);return e}function ky(n,{coords:e}={}){if(n.coords&&!n.coordGrammar){n.type||(n.type="function"),n.name||(n.name="color"),n.coordGrammar=gN(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,d="";return a=="<percentage>"?(f=[0,100],d="%"):a=="<angle>"&&(d="deg"),{fromRange:c,toRange:f,suffix:d}});n.serializeCoords=(r,i)=>r.map((o,a)=>{let{fromRange:c,toRange:f,suffix:d}=t[a];return c&&f&&(o=vy(c,f,o)),o=Id(o,{precision:i,unit:d}),o})}return n}const Jn=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 Cy 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=Jn),e.toXYZ_M&&e.fromXYZ_M&&(e.toBase??(e.toBase=t=>{let r=Fe(e.toXYZ_M,t);return this.white!==this.base.white&&(r=Ha(this.white,this.base.white,r)),r}),e.fromBase??(e.fromBase=t=>(t=Ha(this.base.white,this.white,t),Fe(e.fromXYZ_M,t)))),e.referred??(e.referred="display"),super(e)}}function Pd(n,e){return n=Ue(n),!e||n.space.equals(e)?n.coords.slice():(e=re.get(e),e.from(n))}function Gn(n,e){n=Ue(n);let{space:t,index:r}=re.resolveCoord(e,n.space);return Pd(n,t)[r]}function Ty(n,e,t){return n=Ue(n),e=re.get(e),n.coords=e.to(n.space,t),n}Ty.returns="color";function Dd(n,e,t){if(n=Ue(n),arguments.length===2&&Zs(arguments[1])==="object"){let r=arguments[1];for(let i in r)Dd(n,i,r[i])}else{typeof t=="function"&&(t=t(Gn(n,e)));let{space:r,index:i}=re.resolveCoord(e,n.space),o=Pd(n,r);o[i]=t,Ty(n,r,o)}return n}Dd.returns="color";const xN=new re({id:"xyz-d50",name:"XYZ D50",white:"D50",base:Jn,fromBase:n=>Ha(Jn.white,"D50",n),toBase:n=>Ha("D50",Jn.white,n)}),EN=216/24389,My=24/116,Wa=24389/27;let Fd=Kn.D50;const qn=new re({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:Fd,base:xN,fromBase(n){let t=n.map((r,i)=>r/Fd[i]).map(r=>r>EN?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]>My?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]>My?Math.pow(e[2],3):(116*e[2]-16)/Wa].map((r,i)=>r*Fd[i])},formats:{lab:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function Tr(n){return(n%360+360)%360}const Va=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:qn,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),Tr(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>"]}}}),Ay=25**7,Ua=Math.PI,Iy=180/Ua,Ji=Ua/180;function Ny(n){const e=n*n;return e*e*e*n}function Oy(n,e,{kL:t=1,kC:r=1,kH:i=1}={}){[n,e]=Ue([n,e]);let[o,a,c]=qn.from(n),f=Va.from(qn,[o,a,c])[1],[d,m,h]=qn.from(e),g=Va.from(qn,[d,m,h])[1];f<0&&(f=0),g<0&&(g=0);let b=(f+g)/2,v=Ny(b),x=.5*(1-Math.sqrt(v/(v+Ay))),T=(1+x)*a,M=(1+x)*m,L=Math.sqrt(T**2+c**2),B=Math.sqrt(M**2+h**2),H=T===0&&c===0?0:Math.atan2(c,T),V=M===0&&h===0?0:Math.atan2(h,M);H<0&&(H+=2*Ua),V<0&&(V+=2*Ua),H*=Iy,V*=Iy;let ue=d-o,de=B-L,be=V-H,bt=H+V,Yn=Math.abs(be),ln;L*B===0?ln=0:Yn<=180?ln=be:be>180?ln=be-360:be<-180?ln=be+360:Qs.warn("the unthinkable has happened");let Xn=2*Math.sqrt(B*L)*Math.sin(ln*Ji/2),li=(o+d)/2,an=(L+B)/2,_n=Ny(an),Be;L*B===0?Be=bt:Yn<=180?Be=bt/2:bt<360?Be=(bt+360)/2:Be=(bt-360)/2;let wt=(li-50)**2,Zn=1+.015*wt/Math.sqrt(20+wt),lo=1+.045*an,cn=1;cn-=.17*Math.cos((Be-30)*Ji),cn+=.24*Math.cos(2*Be*Ji),cn+=.32*Math.cos((3*Be+6)*Ji),cn-=.2*Math.cos((4*Be-63)*Ji);let St=1+.015*an*cn,tc=30*Math.exp(-1*((Be-275)/25)**2),nc=2*Math.sqrt(_n/(_n+Ay)),rc=-1*Math.sin(2*tc*Ji)*nc,qt=(ue/(t*Zn))**2;return qt+=(de/(r*lo))**2,qt+=(Xn/(i*St))**2,qt+=rc*(de/(r*lo))*(Xn/(i*St)),Math.sqrt(qt)}const kN=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],CN=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],TN=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],MN=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],eo=new re({id:"oklab",name:"Oklab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:Jn,fromBase(n){let t=Fe(kN,n).map(r=>Math.cbrt(r));return Fe(TN,t)},toBase(n){let t=Fe(MN,n).map(r=>r**3);return Fe(CN,t)},formats:{oklab:{coords:["<percentage> | <number>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function zd(n,e){[n,e]=Ue([n,e]);let[t,r,i]=eo.from(n),[o,a,c]=eo.from(e),f=t-o,d=r-a,m=i-c;return Math.sqrt(f**2+d**2+m**2)}const AN=75e-6;function Gi(n,e,{epsilon:t=AN}={}){n=Ue(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 Bd(n){return{space:n.space,coords:n.coords.slice(),alpha:n.alpha}}function IN(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 NN(n,e){return IN(n,e,"lab")}const ON=Math.PI,Ry=ON/180;function RN(n,e,{l:t=2,c:r=1}={}){[n,e]=Ue([n,e]);let[i,o,a]=qn.from(n),[,c,f]=Va.from(qn,[i,o,a]),[d,m,h]=qn.from(e),g=Va.from(qn,[d,m,h])[1];c<0&&(c=0),g<0&&(g=0);let b=i-d,v=c-g,x=o-m,T=a-h,M=x**2+T**2-v**2,L=.511;i>=16&&(L=.040975*i/(1+.01765*i));let B=.0638*c/(1+.0131*c)+.638,H;Number.isNaN(f)&&(f=0),f>=164&&f<=345?H=.56+Math.abs(.2*Math.cos((f+168)*Ry)):H=.36+Math.abs(.4*Math.cos((f+35)*Ry));let V=Math.pow(c,4),ue=Math.sqrt(V/(V+1900)),de=B*(ue*H+1-ue),be=(b/(t*L))**2;return be+=(v/(r*B))**2,be+=M/de**2,Math.sqrt(be)}const Ly=203,Py=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:Jn,fromBase(n){return n.map(e=>Math.max(e*Ly,0))},toBase(n){return n.map(e=>Math.max(e/Ly,0))}}),Ka=1.15,Ja=.66,Dy=2610/2**14,LN=2**14/2610,Fy=3424/2**12,zy=2413/2**7,By=2392/2**7,PN=1.7*2523/2**5,$y=2**5/(1.7*2523),Ga=-.56,$d=16295499532821565e-27,DN=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],FN=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],zN=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],BN=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]],$N=new re({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:Py,fromBase(n){let[e,t,r]=n,i=Ka*e-(Ka-1)*r,o=Ja*t-(Ja-1)*e,c=Fe(DN,[i,o,r]).map(function(g){let b=Fy+zy*(g/1e4)**Dy,v=1+By*(g/1e4)**Dy;return(b/v)**PN}),[f,d,m]=Fe(zN,c);return[(1+Ga)*f/(1+Ga*f)-$d,d,m]},toBase(n){let[e,t,r]=n,i=(e+$d)/(1+Ga-Ga*(e+$d)),a=Fe(BN,[i,t,r]).map(function(g){let b=Fy-g**$y,v=By*g**$y-zy;return 1e4*(b/v)**LN}),[c,f,d]=Fe(FN,a),m=(c+(Ka-1)*d)/Ka,h=(f+(Ja-1)*m)/Ja;return[m,h,d]},formats:{color:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}}),Hy=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:$N,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),Tr(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 HN(n,e){[n,e]=Ue([n,e]);let[t,r,i]=Hy.from(n),[o,a,c]=Hy.from(e),f=t-o,d=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,h=2*Math.sqrt(r*a)*Math.sin(m/2*(Math.PI/180));return Math.sqrt(f**2+d**2+h**2)}const Wy=3424/4096,Vy=2413/128,Uy=2392/128,Ky=2610/16384,WN=2523/32,VN=16384/2610,Jy=32/2523,UN=[[.3592832590121217,.6976051147779502,-.035891593232029],[-.1920808463704993,1.100476797037432,.0753748658519118],[.0070797844607479,.0748396662186362,.8433265453898765]],KN=[[2048/4096,2048/4096,0],[6610/4096,-13613/4096,7003/4096],[17933/4096,-17390/4096,-543/4096]],JN=[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],GN=[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]],Gy=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:Py,fromBase(n){let e=Fe(UN,n);return qN(e)},toBase(n){let e=jN(n);return Fe(GN,e)}});function qN(n){let e=n.map(function(t){let r=Wy+Vy*(t/1e4)**Ky,i=1+Uy*(t/1e4)**Ky;return(r/i)**WN});return Fe(KN,e)}function jN(n){return Fe(JN,n).map(function(r){let i=Math.max(r**Jy-Wy,0),o=Vy-Uy*r**Jy;return 1e4*(i/o)**VN})}function YN(n,e){[n,e]=Ue([n,e]);let[t,r,i]=Gy.from(n),[o,a,c]=Gy.from(e);return 720*Math.sqrt((t-o)**2+.25*(r-a)**2+(i-c)**2)}const XN=Kn.D65,qy=.42,jy=1/qy,Hd=2*Math.PI,Yy=[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],ZN=[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],QN=[[460,451,288],[460,-891,-261],[460,-220,-6300]],eO={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},ri={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},tO=180/Math.PI,Xy=Math.PI/180;function Zy(n,e){return n.map(r=>{const i=Un(e*Math.abs(r)*.01,qy);return 400*Od(i,r)/(i+27.13)})}function nO(n,e){const t=100/e*27.13**jy;return n.map(r=>{const i=Math.abs(r);return Od(t*Un(i/(400-i),jy),r)})}function rO(n){let e=Tr(n);e<=ri.h[0]&&(e+=360);const t=bN(ri.h,e)-1,[r,i]=ri.h.slice(t,t+2),[o,a]=ri.e.slice(t,t+2),c=ri.H[t],f=(e-r)/o;return c+100*f/(f+(i-e)/a)}function iO(n){let e=(n%400+400)%400;const t=Math.floor(.01*e);e=e%100;const[r,i]=ri.h.slice(t,t+2),[o,a]=ri.e.slice(t,t+2);return Tr((e*(a*r-o*i)-100*r*a)/(e*(a-o)-100*a))}function Qy(n,e,t,r,i){const o={};o.discounting=i,o.refWhite=n,o.surround=r;const a=n.map(x=>x*100);o.la=e,o.yb=t;const c=a[1],f=Fe(Yy,a);r=eO[o.surround];const d=r[0];o.c=r[1],o.nc=r[2];const h=(1/(5*o.la+1))**4;o.fl=h*o.la+.1*(1-h)*(1-h)*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(d*(1-1/3.6*Math.exp((-o.la-42)/92)),1),0);o.dRgb=f.map(x=>Sy(1,c/x,g)),o.dRgbInv=o.dRgb.map(x=>1/x);const b=f.map((x,T)=>x*o.dRgb[T]),v=Zy(b,o.fl);return o.aW=o.nbb*(2*v[0]+v[1]+.05*v[2]),o}const eb=Qy(XN,64/Math.PI*.2,20,"average",!1);function Wd(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=Tr(n.h)*Xy:t=iO(n.H)*Xy;const r=Math.cos(t),i=Math.sin(t);let o=0;n.J!==void 0?o=Un(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=Un(a*Math.pow(1.64-Math.pow(.29,e.n),-.73),10/9),f=.25*(Math.cos(t+2)+3.8),d=e.aW*Un(o,2/e.c/e.z),m=5e4/13*e.nc*e.ncb*f,h=d/e.nbb,g=23*(h+.305)*_y(c,23*m+c*(11*r+108*i)),b=g*r,v=g*i,x=nO(Fe(QN,[h,b,v]).map(T=>T*1/1403),e.fl);return Fe(ZN,x.map((T,M)=>T*e.dRgbInv[M])).map(T=>T/100)}function tb(n,e){const t=n.map(B=>B*100),r=Zy(Fe(Yy,t).map((B,H)=>B*e.dRgb[H]),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)%Hd+Hd)%Hd,c=.25*(Math.cos(a+2)+3.8),f=5e4/13*e.nc*e.ncb*_y(c*Math.sqrt(i**2+o**2),r[0]+r[1]+1.05*r[2]+.305),d=Un(f,.9)*Math.pow(1.64-Math.pow(.29,e.n),.73),m=e.nbb*(2*r[0]+r[1]+.05*r[2]),h=Un(m/e.aW,.5*e.c*e.z),g=100*Un(h,2),b=4/e.c*h*(e.aW+4)*e.flRoot,v=d*h,x=v*e.flRoot,T=Tr(a*tO),M=rO(T),L=50*Un(e.c*d/(e.aW+4),1/2);return{J:g,C:v,h:T,s:L,Q:b,M:x,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:Jn,fromBase(n){const e=tb(n,eb);return[e.J,e.M,e.h]},toBase(n){return Wd({J:n[0],M:n[1],h:n[2]},eb)}});const sO=Kn.D65,oO=216/24389,nb=24389/27;function lO(n){return 116*(n>oO?Math.cbrt(n):(nb*n+16)/116)-16}function Vd(n){return n>8?Math.pow((n+16)/116,3):n/nb}function aO(n,e){let[t,r,i]=n,o=[],a=0;if(i===0)return[0,0,0];let c=Vd(i);i>0?a=.00379058511492914*i**2+.608983189401032*i+.9155088574762233:a=9514440756550361e-21*i**2+.08693057439788597*i-21.928975842194614;const f=2e-12,d=15;let m=0,h=1/0;for(;m<=d;){o=Wd({J:a,C:r,h:t},e);const g=Math.abs(o[1]-c);if(g<h){if(g<=f)return o;h=g}a=a-(o[1]-c)*a/(2*o[1]),m+=1}return Wd({J:a,C:r,h:t},e)}function cO(n,e){const t=lO(n[1]);if(t===0)return[0,0,0];const r=tb(n,Ud);return[Tr(r.h),r.C,t]}const Ud=Qy(sO,200/Math.PI*Vd(50),Vd(50)*100,"average",!1),qa=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:Jn,fromBase(n){return cO(n)},toBase(n){return aO(n,Ud)},formats:{color:{id:"--hct",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),uO=Math.PI/180,rb=[1,.007,.0228];function ib(n){n[1]<0&&(n=qa.fromBase(qa.toBase(n)));const e=Math.log(Math.max(1+rb[2]*n[1]*Ud.flRoot,1))/rb[2],t=n[0]*uO,r=e*Math.cos(t),i=e*Math.sin(t);return[n[2],r,i]}function fO(n,e){[n,e]=Ue([n,e]);let[t,r,i]=ib(qa.from(n)),[o,a,c]=ib(qa.from(e));return Math.sqrt((t-o)**2+(r-a)**2+(i-c)**2)}const sb={deltaE76:NN,deltaECMC:RN,deltaE2000:Oy,deltaEJz:HN,deltaEITP:YN,deltaEOK:zd,deltaEHCT:fO};function dO(n){const e=n?Math.floor(Math.log10(Math.abs(n))):0;return Math.max(parseFloat(`1e${e-2}`),1e-6)}const ob={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 to(n,{method:e=Qs.gamut_mapping,space:t=void 0,deltaEMethod:r="",jnd:i=2,blackWhiteClamp:o={}}={}){if(n=Ue(n),wy(arguments[1])?t=arguments[1]:t||(t=n.space),t=re.get(t),Gi(n,t,{epsilon:0}))return n;let a;if(e==="css")a=hO(n,{space:t});else{if(e!=="clip"&&!Gi(n,t)){Object.prototype.hasOwnProperty.call(ob,e)&&({method:e,jnd:i,deltaEMethod:r,blackWhiteClamp:o}=ob[e]);let c=Oy;if(r!==""){for(let d in sb)if("deltae"+r.toLowerCase()===d.toLowerCase()){c=sb[d];break}}let f=to(ze(n,t),{method:"clip",space:t});if(c(n,f)>i){if(Object.keys(o).length===3){let L=re.resolveCoord(o.channel),B=Gn(ze(n,L.space),L.id);if(Nd(B)&&(B=0),B>=o.max)return ze({space:"xyz-d65",coords:Kn.D65},n.space);if(B<=o.min)return ze({space:"xyz-d65",coords:[0,0,0]},n.space)}let d=re.resolveCoord(e),m=d.space,h=d.id,g=ze(n,m);g.coords.forEach((L,B)=>{Nd(L)&&(g.coords[B]=0)});let v=(d.range||d.refRange)[0],x=dO(i),T=v,M=Gn(g,h);for(;M-T>x;){let L=Bd(g);L=to(L,{space:t,method:"clip"}),c(g,L)-i<x?T=Gn(g,h):M=Gn(g,h),Dd(g,h,(T+M)/2)}a=ze(g,t)}else a=f}else a=ze(n,t);if(e==="clip"||!Gi(a,t,{epsilon:0})){let c=Object.values(t.coords).map(f=>f.range||[]);a.coords=a.coords.map((f,d)=>{let[m,h]=c[d];return m!==void 0&&(f=Math.max(m,f)),h!==void 0&&(f=Math.min(f,h)),f})}}return t!==n.space&&(a=ze(a,n.space)),n.coords=a.coords,n}to.returns="color";const lb={WHITE:{space:eo,coords:[1,0,0]},BLACK:{space:eo,coords:[0,0,0]}};function hO(n,{space:e}={}){n=Ue(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 v=ze(lb.WHITE,e);return v.alpha=n.alpha,ze(v,e)}if(a<=0){const v=ze(lb.BLACK,e);return v.alpha=n.alpha,ze(v,e)}if(Gi(o,e,{epsilon:0}))return ze(o,e);function c(v){const x=ze(v,e),T=Object.values(e.coords);return x.coords=x.coords.map((M,L)=>{if("range"in T[L]){const[B,H]=T[L].range;return yN(B,M,H)}return M}),x}let f=0,d=o.coords[1],m=!0,h=Bd(o),g=c(h),b=zd(g,h);if(b<.02)return g;for(;d-f>1e-4;){const v=(f+d)/2;if(h.coords[1]=v,m&&Gi(h,e,{epsilon:0}))f=v;else if(g=c(h),b=zd(g,h),b<.02){if(.02-b<1e-4)break;m=!1,f=v}else d=v}return g}function ze(n,e,{inGamut:t}={}){n=Ue(n),e=re.get(e);let r=e.from(n),i={space:e,coords:r,alpha:n.alpha};return t&&(i=to(i,t===!0?void 0:t)),i}ze.returns="color";function pO(n,{precision:e=Qs.precision,format:t="default",inGamut:r=!0,...i}={}){var o;let a;n=Ue(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&&!Gi(n)&&(f=to(Bd(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 d=t.name||"color";t.serializeCoords?f=t.serializeCoords(f,e):e!==null&&(f=f.map(b=>Id(b,{precision:e})));let m=[...f];if(d==="color"){let b=t.id||((o=t.ids)==null?void 0:o[0])||n.space.id;m.unshift(b)}let h=n.alpha;e!==null&&(h=Id(h,{precision:e}));let g=n.alpha>=1||t.noAlpha?"":`${t.commas?",":" /"} ${h}`;a=`${d}(${m.join(t.commas?", ":" ")}${g})`}return a}const mO=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],gO=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],yO=new Cy({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:mO,fromXYZ_M:gO}),ab={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 cb=Array(3).fill("<percentage> | <number>[0, 255]"),ub=Array(3).fill("<number>[0, 255]");const fb=new Cy({id:"srgb",name:"sRGB",base:yO,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:cb},rgb_number:{name:"rgb",commas:!0,coords:ub,noAlpha:!0},color:{},rgba:{coords:cb,commas:!0,lastAlpha:!0},rgba_number:{name:"rgba",commas:!0,coords:ub},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=ab.black,e.alpha=0):e.coords=ab[n],e.coords)return e}}}});function bO(n){return Gn(n,[Jn,"y"])}const db=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:fb,fromBase:n=>{let e=Math.max(...n),t=Math.min(...n),[r,i,o]=n,[a,c,f]=[NaN,0,(t+e)/2],d=e-t;if(d!==0){switch(c=f===0||f===1?0:(e-f)/Math.min(f,1-f),e){case r:a=(i-o)/d+(i<o?6:0);break;case i:a=(o-r)/d+2;break;case o:a=(r-i)/d+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}}}),wO=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:db,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>"]}}}),SO=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:eo,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),Tr(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){Vn(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 Gn(this.data,"hsv.h")}get s(){return Gn(this.data,"hsv.s")}get v(){return Gn(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 bO(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=Pd(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=pO(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 vO{constructor(e){Vn(this,"_color"),Vn(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 hb=999;function _O(){return hb+=1,hb}function xO(n){return n?n.startsWith("linear-gradient("):!1}function EO(){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(fb),re.register(wO),re.register(db),re.register(SO);function pb(n){if(!n)return Ot.fromTransparent();try{return new Ot(ze(Ey(n),"srgb"))}catch(e){return console.warn(e),Ot.fromBlack()}}function kO(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 CO(n){return n.map(e=>{const[t,r]=e.trim().split(/\s+(?![^(]*\))/);return{color:pb(t),offset:Number.parseFloat(r.replace("%",""))}})}function TO(n){const e=n.indexOf("("),t=n.lastIndexOf(")"),[r,...i]=n.slice(e+1,t).split(/,(?![^(]*\))/),o=CO(i),a=kO(r);return{isEmpty:!1,isGradient:!0,solidColor:o[0].color,angle:a,transitions:o}}function MO(n){const e=pb(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 AO(n,e=!0){if(!n)return EO();const t=xO(n)?TO(n):MO(n);return t.isGradient&&!e?{...t,isGradient:!1}:t}class Xd{constructor(e,t=0){Vn(this,"id"),this.color=e,this.offset=t,this.id=_O()}setOffset(e){this.offset=e}toString(){return`${this.color.toString()} ${this.offset}%`}clone(e){return new Xd(this.color.clone(),e)}}class IO{constructor(e){Vn(this,"isEmpty",!1),Vn(this,"_angle",0),Vn(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 Xd(t,r)),this.setEmpty(e.isEmpty)}hasTransition(e){return this.transitions.some(t=>t.id===e.id)}}function NO(n){const e=AO(n);return(e.isGradient?new IO(e):new vO(e)).toString()}function mb(n){return NO(n)}function gb(n,e){if(!n.includes("em"))return parseInt(n);const t=qi.getComputedStyle(e).fontSize,r=parseFloat(n)*parseFloat(t);return Math.round(r)}function OO(n,e){return(n.firstElementChild||n).style.fontSize||qi.getComputedStyle(e).fontSize}function RO(n,e,t){if(!n.includes("px"))return n;const r=OO(e,t),i=gb(r,t);return i?(parseInt(n)/i).toFixed(2):null}const LO={start:vr.LEFT,end:vr.RIGHT};function PO(n){const e=LO[n]||n;return XA.includes(e)?e:null}const yb=(n,e,t,r)=>({from:Math.max(r,n.pos),to:Math.min(r+t.nodeSize,e.pos)});function bb(n,e){return n.resolve(e).depth+1}function DO(n,e,t,r){const i=bb(n,r),o=e.from-i<=r,a=e.to+i>=t.nodeSize+r;return o&&a}const FO=(n,e)=>n.eq(e);function zO(n,e,t,r=FO){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 BO(n,e){const t=typeof e=="string"?e:e.name;return n.find(r=>r.type.name===t)}var ja=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},no={exports:{}};var $O=no.exports,wb;function HO(){return wb||(wb=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__",d=500,m="__lodash_placeholder__",h=1,g=2,b=4,v=1,x=2,T=1,M=2,L=4,B=8,H=16,V=32,ue=64,de=128,be=256,bt=512,Yn=30,ln="...",Xn=800,li=16,an=1,_n=2,Be=3,wt=1/0,Zn=9007199254740991,lo=17976931348623157e292,cn=NaN,St=4294967295,tc=St-1,nc=St>>>1,rc=[["ary",de],["bind",T],["bindKey",M],["curry",B],["curryRight",H],["flip",bt],["partial",V],["partialRight",ue],["rearg",be]],qt="[object Arguments]",ao="[object Array]",Tb="[object AsyncFunction]",Qi="[object Boolean]",es="[object Date]",Mb="[object DOMException]",co="[object Error]",uo="[object Function]",eh="[object GeneratorFunction]",jt="[object Map]",ts="[object Number]",Ab="[object Null]",xn="[object Object]",th="[object Promise]",Ib="[object Proxy]",ns="[object RegExp]",Yt="[object Set]",rs="[object String]",fo="[object Symbol]",Nb="[object Undefined]",is="[object WeakMap]",Ob="[object WeakSet]",ss="[object ArrayBuffer]",ai="[object DataView]",ic="[object Float32Array]",sc="[object Float64Array]",oc="[object Int8Array]",lc="[object Int16Array]",ac="[object Int32Array]",cc="[object Uint8Array]",uc="[object Uint8ClampedArray]",fc="[object Uint16Array]",dc="[object Uint32Array]",Rb=/\b__p \+= '';/g,Lb=/\b(__p \+=) '' \+/g,Pb=/(__e\(.*?\)|\b__t\)) \+\n'';/g,nh=/&(?:amp|lt|gt|quot|#39);/g,rh=/[&<>"']/g,Db=RegExp(nh.source),Fb=RegExp(rh.source),zb=/<%-([\s\S]+?)%>/g,Bb=/<%([\s\S]+?)%>/g,ih=/<%=([\s\S]+?)%>/g,$b=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Hb=/^\w*$/,Wb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,hc=/[\\^$.*+?()[\]{}|]/g,Vb=RegExp(hc.source),pc=/^\s+/,Ub=/\s/,Kb=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Jb=/\{\n\/\* \[wrapped with (.+)\] \*/,Gb=/,? & /,qb=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,jb=/[()=,{}\[\]\/\s]/,Yb=/\\(\\)?/g,Xb=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,sh=/\w*$/,Zb=/^[-+]0x[0-9a-f]+$/i,Qb=/^0b[01]+$/i,e2=/^\[object .+?Constructor\]$/,t2=/^0o[0-7]+$/i,n2=/^(?:0|[1-9]\d*)$/,r2=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ho=/($^)/,i2=/['\n\r\u2028\u2029\\]/g,po="\\ud800-\\udfff",s2="\\u0300-\\u036f",o2="\\ufe20-\\ufe2f",l2="\\u20d0-\\u20ff",oh=s2+o2+l2,lh="\\u2700-\\u27bf",ah="a-z\\xdf-\\xf6\\xf8-\\xff",a2="\\xac\\xb1\\xd7\\xf7",c2="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",u2="\\u2000-\\u206f",f2=" \\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",uh="\\ufe0e\\ufe0f",fh=a2+c2+u2+f2,mc="['\u2019]",d2="["+po+"]",dh="["+fh+"]",mo="["+oh+"]",hh="\\d+",h2="["+lh+"]",ph="["+ah+"]",mh="[^"+po+fh+hh+lh+ah+ch+"]",gc="\\ud83c[\\udffb-\\udfff]",p2="(?:"+mo+"|"+gc+")",gh="[^"+po+"]",yc="(?:\\ud83c[\\udde6-\\uddff]){2}",bc="[\\ud800-\\udbff][\\udc00-\\udfff]",ci="["+ch+"]",yh="\\u200d",bh="(?:"+ph+"|"+mh+")",m2="(?:"+ci+"|"+mh+")",wh="(?:"+mc+"(?:d|ll|m|re|s|t|ve))?",Sh="(?:"+mc+"(?:D|LL|M|RE|S|T|VE))?",vh=p2+"?",_h="["+uh+"]?",g2="(?:"+yh+"(?:"+[gh,yc,bc].join("|")+")"+_h+vh+")*",y2="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",b2="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",xh=_h+vh+g2,w2="(?:"+[h2,yc,bc].join("|")+")"+xh,S2="(?:"+[gh+mo+"?",mo,yc,bc,d2].join("|")+")",v2=RegExp(mc,"g"),_2=RegExp(mo,"g"),wc=RegExp(gc+"(?="+gc+")|"+S2+xh,"g"),x2=RegExp([ci+"?"+ph+"+"+wh+"(?="+[dh,ci,"$"].join("|")+")",m2+"+"+Sh+"(?="+[dh,ci+bh,"$"].join("|")+")",ci+"?"+bh+"+"+wh,ci+"+"+Sh,b2,y2,hh,w2].join("|"),"g"),E2=RegExp("["+yh+po+oh+uh+"]"),k2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,C2=["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"],T2=-1,_e={};_e[ic]=_e[sc]=_e[oc]=_e[lc]=_e[ac]=_e[cc]=_e[uc]=_e[fc]=_e[dc]=!0,_e[qt]=_e[ao]=_e[ss]=_e[Qi]=_e[ai]=_e[es]=_e[co]=_e[uo]=_e[jt]=_e[ts]=_e[xn]=_e[ns]=_e[Yt]=_e[rs]=_e[is]=!1;var ve={};ve[qt]=ve[ao]=ve[ss]=ve[ai]=ve[Qi]=ve[es]=ve[ic]=ve[sc]=ve[oc]=ve[lc]=ve[ac]=ve[jt]=ve[ts]=ve[xn]=ve[ns]=ve[Yt]=ve[rs]=ve[fo]=ve[cc]=ve[uc]=ve[fc]=ve[dc]=!0,ve[co]=ve[uo]=ve[is]=!1;var M2={\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"},A2={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},I2={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},N2={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},O2=parseFloat,R2=parseInt,Eh=typeof ja=="object"&&ja&&ja.Object===Object&&ja,L2=typeof self=="object"&&self&&self.Object===Object&&self,qe=Eh||L2||Function("return this")(),Sc=e&&!e.nodeType&&e,Nr=Sc&&!0&&n&&!n.nodeType&&n,kh=Nr&&Nr.exports===Sc,vc=kh&&Eh.process,Rt=function(){try{var k=Nr&&Nr.require&&Nr.require("util").types;return k||vc&&vc.binding&&vc.binding("util")}catch{}}(),Ch=Rt&&Rt.isArrayBuffer,Th=Rt&&Rt.isDate,Mh=Rt&&Rt.isMap,Ah=Rt&&Rt.isRegExp,Ih=Rt&&Rt.isSet,Nh=Rt&&Rt.isTypedArray;function vt(k,I,A){switch(A.length){case 0:return k.call(I);case 1:return k.call(I,A[0]);case 2:return k.call(I,A[0],A[1]);case 3:return k.call(I,A[0],A[1],A[2])}return k.apply(I,A)}function P2(k,I,A,U){for(var X=-1,me=k==null?0:k.length;++X<me;){var Pe=k[X];I(U,Pe,A(Pe),k)}return U}function Lt(k,I){for(var A=-1,U=k==null?0:k.length;++A<U&&I(k[A],A,k)!==!1;);return k}function D2(k,I){for(var A=k==null?0:k.length;A--&&I(k[A],A,k)!==!1;);return k}function Oh(k,I){for(var A=-1,U=k==null?0:k.length;++A<U;)if(!I(k[A],A,k))return!1;return!0}function Qn(k,I){for(var A=-1,U=k==null?0:k.length,X=0,me=[];++A<U;){var Pe=k[A];I(Pe,A,k)&&(me[X++]=Pe)}return me}function go(k,I){var A=k==null?0:k.length;return!!A&&ui(k,I,0)>-1}function _c(k,I,A){for(var U=-1,X=k==null?0:k.length;++U<X;)if(A(I,k[U]))return!0;return!1}function Ee(k,I){for(var A=-1,U=k==null?0:k.length,X=Array(U);++A<U;)X[A]=I(k[A],A,k);return X}function er(k,I){for(var A=-1,U=I.length,X=k.length;++A<U;)k[X+A]=I[A];return k}function xc(k,I,A,U){var X=-1,me=k==null?0:k.length;for(U&&me&&(A=k[++X]);++X<me;)A=I(A,k[X],X,k);return A}function F2(k,I,A,U){var X=k==null?0:k.length;for(U&&X&&(A=k[--X]);X--;)A=I(A,k[X],X,k);return A}function Ec(k,I){for(var A=-1,U=k==null?0:k.length;++A<U;)if(I(k[A],A,k))return!0;return!1}var z2=kc("length");function B2(k){return k.split("")}function $2(k){return k.match(qb)||[]}function Rh(k,I,A){var U;return A(k,function(X,me,Pe){if(I(X,me,Pe))return U=me,!1}),U}function yo(k,I,A,U){for(var X=k.length,me=A+(U?1:-1);U?me--:++me<X;)if(I(k[me],me,k))return me;return-1}function ui(k,I,A){return I===I?Z2(k,I,A):yo(k,Lh,A)}function H2(k,I,A,U){for(var X=A-1,me=k.length;++X<me;)if(U(k[X],I))return X;return-1}function Lh(k){return k!==k}function Ph(k,I){var A=k==null?0:k.length;return A?Tc(k,I)/A:cn}function kc(k){return function(I){return I==null?t:I[k]}}function Cc(k){return function(I){return k==null?t:k[I]}}function Dh(k,I,A,U,X){return X(k,function(me,Pe,Se){A=U?(U=!1,me):I(A,me,Pe,Se)}),A}function W2(k,I){var A=k.length;for(k.sort(I);A--;)k[A]=k[A].value;return k}function Tc(k,I){for(var A,U=-1,X=k.length;++U<X;){var me=I(k[U]);me!==t&&(A=A===t?me:A+me)}return A}function Mc(k,I){for(var A=-1,U=Array(k);++A<k;)U[A]=I(A);return U}function V2(k,I){return Ee(I,function(A){return[A,k[A]]})}function Fh(k){return k&&k.slice(0,Hh(k)+1).replace(pc,"")}function _t(k){return function(I){return k(I)}}function Ac(k,I){return Ee(I,function(A){return k[A]})}function ls(k,I){return k.has(I)}function zh(k,I){for(var A=-1,U=k.length;++A<U&&ui(I,k[A],0)>-1;);return A}function Bh(k,I){for(var A=k.length;A--&&ui(I,k[A],0)>-1;);return A}function U2(k,I){for(var A=k.length,U=0;A--;)k[A]===I&&++U;return U}var K2=Cc(M2),J2=Cc(A2);function G2(k){return"\\"+N2[k]}function q2(k,I){return k==null?t:k[I]}function fi(k){return E2.test(k)}function j2(k){return k2.test(k)}function Y2(k){for(var I,A=[];!(I=k.next()).done;)A.push(I.value);return A}function Ic(k){var I=-1,A=Array(k.size);return k.forEach(function(U,X){A[++I]=[X,U]}),A}function $h(k,I){return function(A){return k(I(A))}}function tr(k,I){for(var A=-1,U=k.length,X=0,me=[];++A<U;){var Pe=k[A];(Pe===I||Pe===m)&&(k[A]=m,me[X++]=A)}return me}function bo(k){var I=-1,A=Array(k.size);return k.forEach(function(U){A[++I]=U}),A}function X2(k){var I=-1,A=Array(k.size);return k.forEach(function(U){A[++I]=[U,U]}),A}function Z2(k,I,A){for(var U=A-1,X=k.length;++U<X;)if(k[U]===I)return U;return-1}function Q2(k,I,A){for(var U=A+1;U--;)if(k[U]===I)return U;return U}function di(k){return fi(k)?tw(k):z2(k)}function Xt(k){return fi(k)?nw(k):B2(k)}function Hh(k){for(var I=k.length;I--&&Ub.test(k.charAt(I)););return I}var ew=Cc(I2);function tw(k){for(var I=wc.lastIndex=0;wc.test(k);)++I;return I}function nw(k){return k.match(wc)||[]}function rw(k){return k.match(x2)||[]}var iw=function k(I){I=I==null?qe:hi.defaults(qe.Object(),I,hi.pick(qe,C2));var A=I.Array,U=I.Date,X=I.Error,me=I.Function,Pe=I.Math,Se=I.Object,Nc=I.RegExp,sw=I.String,Pt=I.TypeError,wo=A.prototype,ow=me.prototype,pi=Se.prototype,So=I["__core-js_shared__"],vo=ow.toString,we=pi.hasOwnProperty,lw=0,Wh=function(){var s=/[^.]+$/.exec(So&&So.keys&&So.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),_o=pi.toString,aw=vo.call(Se),cw=qe._,uw=Nc("^"+vo.call(we).replace(hc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xo=kh?I.Buffer:t,nr=I.Symbol,Eo=I.Uint8Array,Vh=xo?xo.allocUnsafe:t,ko=$h(Se.getPrototypeOf,Se),Uh=Se.create,Kh=pi.propertyIsEnumerable,Co=wo.splice,Jh=nr?nr.isConcatSpreadable:t,as=nr?nr.iterator:t,Or=nr?nr.toStringTag:t,To=function(){try{var s=Fr(Se,"defineProperty");return s({},"",{}),s}catch{}}(),fw=I.clearTimeout!==qe.clearTimeout&&I.clearTimeout,dw=U&&U.now!==qe.Date.now&&U.now,hw=I.setTimeout!==qe.setTimeout&&I.setTimeout,Mo=Pe.ceil,Ao=Pe.floor,Oc=Se.getOwnPropertySymbols,pw=xo?xo.isBuffer:t,Gh=I.isFinite,mw=wo.join,gw=$h(Se.keys,Se),De=Pe.max,Qe=Pe.min,yw=U.now,bw=I.parseInt,qh=Pe.random,ww=wo.reverse,Rc=Fr(I,"DataView"),cs=Fr(I,"Map"),Lc=Fr(I,"Promise"),mi=Fr(I,"Set"),us=Fr(I,"WeakMap"),fs=Fr(Se,"create"),Io=us&&new us,gi={},Sw=zr(Rc),vw=zr(cs),_w=zr(Lc),xw=zr(mi),Ew=zr(us),No=nr?nr.prototype:t,ds=No?No.valueOf:t,jh=No?No.toString:t;function w(s){if(Me(s)&&!Z(s)&&!(s instanceof oe)){if(s instanceof Dt)return s;if(we.call(s,"__wrapped__"))return Yp(s)}return new Dt(s)}var yi=function(){function s(){}return function(l){if(!Te(l))return{};if(Uh)return Uh(l);s.prototype=l;var u=new s;return s.prototype=t,u}}();function Oo(){}function Dt(s,l){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}w.templateSettings={escape:zb,evaluate:Bb,interpolate:ih,variable:"",imports:{_:w}},w.prototype=Oo.prototype,w.prototype.constructor=w,Dt.prototype=yi(Oo.prototype),Dt.prototype.constructor=Dt;function oe(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=St,this.__views__=[]}function kw(){var s=new oe(this.__wrapped__);return s.__actions__=ut(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=ut(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=ut(this.__views__),s}function Cw(){if(this.__filtered__){var s=new oe(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function Tw(){var s=this.__wrapped__.value(),l=this.__dir__,u=Z(s),p=l<0,y=u?s.length:0,S=BS(0,y,this.__views__),_=S.start,E=S.end,C=E-_,N=p?E:_-1,O=this.__iteratees__,R=O.length,$=0,J=Qe(C,this.__takeCount__);if(!u||!p&&y==C&&J==C)return wp(s,this.__actions__);var q=[];e:for(;C--&&$<J;){N+=l;for(var ee=-1,j=s[N];++ee<R;){var se=O[ee],fe=se.iteratee,kt=se.type,rt=fe(j);if(kt==_n)j=rt;else if(!rt){if(kt==an)continue e;break e}}q[$++]=j}return q}oe.prototype=yi(Oo.prototype),oe.prototype.constructor=oe;function Rr(s){var l=-1,u=s==null?0:s.length;for(this.clear();++l<u;){var p=s[l];this.set(p[0],p[1])}}function Mw(){this.__data__=fs?fs(null):{},this.size=0}function Aw(s){var l=this.has(s)&&delete this.__data__[s];return this.size-=l?1:0,l}function Iw(s){var l=this.__data__;if(fs){var u=l[s];return u===f?t:u}return we.call(l,s)?l[s]:t}function Nw(s){var l=this.__data__;return fs?l[s]!==t:we.call(l,s)}function Ow(s,l){var u=this.__data__;return this.size+=this.has(s)?0:1,u[s]=fs&&l===t?f:l,this}Rr.prototype.clear=Mw,Rr.prototype.delete=Aw,Rr.prototype.get=Iw,Rr.prototype.has=Nw,Rr.prototype.set=Ow;function En(s){var l=-1,u=s==null?0:s.length;for(this.clear();++l<u;){var p=s[l];this.set(p[0],p[1])}}function Rw(){this.__data__=[],this.size=0}function Lw(s){var l=this.__data__,u=Ro(l,s);if(u<0)return!1;var p=l.length-1;return u==p?l.pop():Co.call(l,u,1),--this.size,!0}function Pw(s){var l=this.__data__,u=Ro(l,s);return u<0?t:l[u][1]}function Dw(s){return Ro(this.__data__,s)>-1}function Fw(s,l){var u=this.__data__,p=Ro(u,s);return p<0?(++this.size,u.push([s,l])):u[p][1]=l,this}En.prototype.clear=Rw,En.prototype.delete=Lw,En.prototype.get=Pw,En.prototype.has=Dw,En.prototype.set=Fw;function kn(s){var l=-1,u=s==null?0:s.length;for(this.clear();++l<u;){var p=s[l];this.set(p[0],p[1])}}function zw(){this.size=0,this.__data__={hash:new Rr,map:new(cs||En),string:new Rr}}function Bw(s){var l=Ko(this,s).delete(s);return this.size-=l?1:0,l}function $w(s){return Ko(this,s).get(s)}function Hw(s){return Ko(this,s).has(s)}function Ww(s,l){var u=Ko(this,s),p=u.size;return u.set(s,l),this.size+=u.size==p?0:1,this}kn.prototype.clear=zw,kn.prototype.delete=Bw,kn.prototype.get=$w,kn.prototype.has=Hw,kn.prototype.set=Ww;function Lr(s){var l=-1,u=s==null?0:s.length;for(this.__data__=new kn;++l<u;)this.add(s[l])}function Vw(s){return this.__data__.set(s,f),this}function Uw(s){return this.__data__.has(s)}Lr.prototype.add=Lr.prototype.push=Vw,Lr.prototype.has=Uw;function Zt(s){var l=this.__data__=new En(s);this.size=l.size}function Kw(){this.__data__=new En,this.size=0}function Jw(s){var l=this.__data__,u=l.delete(s);return this.size=l.size,u}function Gw(s){return this.__data__.get(s)}function qw(s){return this.__data__.has(s)}function jw(s,l){var u=this.__data__;if(u instanceof En){var p=u.__data__;if(!cs||p.length<i-1)return p.push([s,l]),this.size=++u.size,this;u=this.__data__=new kn(p)}return u.set(s,l),this.size=u.size,this}Zt.prototype.clear=Kw,Zt.prototype.delete=Jw,Zt.prototype.get=Gw,Zt.prototype.has=qw,Zt.prototype.set=jw;function Yh(s,l){var u=Z(s),p=!u&&Br(s),y=!u&&!p&&lr(s),S=!u&&!p&&!y&&vi(s),_=u||p||y||S,E=_?Mc(s.length,sw):[],C=E.length;for(var N in s)(l||we.call(s,N))&&!(_&&(N=="length"||y&&(N=="offset"||N=="parent")||S&&(N=="buffer"||N=="byteLength"||N=="byteOffset")||An(N,C)))&&E.push(N);return E}function Xh(s){var l=s.length;return l?s[Kc(0,l-1)]:t}function Yw(s,l){return Jo(ut(s),Pr(l,0,s.length))}function Xw(s){return Jo(ut(s))}function Pc(s,l,u){(u!==t&&!Qt(s[l],u)||u===t&&!(l in s))&&Cn(s,l,u)}function hs(s,l,u){var p=s[l];(!(we.call(s,l)&&Qt(p,u))||u===t&&!(l in s))&&Cn(s,l,u)}function Ro(s,l){for(var u=s.length;u--;)if(Qt(s[u][0],l))return u;return-1}function Zw(s,l,u,p){return rr(s,function(y,S,_){l(p,y,u(y),_)}),p}function Zh(s,l){return s&&fn(l,$e(l),s)}function Qw(s,l){return s&&fn(l,dt(l),s)}function Cn(s,l,u){l=="__proto__"&&To?To(s,l,{configurable:!0,enumerable:!0,value:u,writable:!0}):s[l]=u}function Dc(s,l){for(var u=-1,p=l.length,y=A(p),S=s==null;++u<p;)y[u]=S?t:gu(s,l[u]);return y}function Pr(s,l,u){return s===s&&(u!==t&&(s=s<=u?s:u),l!==t&&(s=s>=l?s:l)),s}function Ft(s,l,u,p,y,S){var _,E=l&h,C=l&g,N=l&b;if(u&&(_=y?u(s,p,y,S):u(s)),_!==t)return _;if(!Te(s))return s;var O=Z(s);if(O){if(_=HS(s),!E)return ut(s,_)}else{var R=et(s),$=R==uo||R==eh;if(lr(s))return _p(s,E);if(R==xn||R==qt||$&&!y){if(_=C||$?{}:Hp(s),!E)return C?IS(s,Qw(_,s)):AS(s,Zh(_,s))}else{if(!ve[R])return y?s:{};_=WS(s,R,E)}}S||(S=new Zt);var J=S.get(s);if(J)return J;S.set(s,_),gm(s)?s.forEach(function(j){_.add(Ft(j,l,u,j,s,S))}):pm(s)&&s.forEach(function(j,se){_.set(se,Ft(j,l,u,se,s,S))});var q=N?C?nu:tu:C?dt:$e,ee=O?t:q(s);return Lt(ee||s,function(j,se){ee&&(se=j,j=s[se]),hs(_,se,Ft(j,l,u,se,s,S))}),_}function eS(s){var l=$e(s);return function(u){return Qh(u,s,l)}}function Qh(s,l,u){var p=u.length;if(s==null)return!p;for(s=Se(s);p--;){var y=u[p],S=l[y],_=s[y];if(_===t&&!(y in s)||!S(_))return!1}return!0}function ep(s,l,u){if(typeof s!="function")throw new Pt(a);return Ss(function(){s.apply(t,u)},l)}function ps(s,l,u,p){var y=-1,S=go,_=!0,E=s.length,C=[],N=l.length;if(!E)return C;u&&(l=Ee(l,_t(u))),p?(S=_c,_=!1):l.length>=i&&(S=ls,_=!1,l=new Lr(l));e:for(;++y<E;){var O=s[y],R=u==null?O:u(O);if(O=p||O!==0?O:0,_&&R===R){for(var $=N;$--;)if(l[$]===R)continue e;C.push(O)}else S(l,R,p)||C.push(O)}return C}var rr=Tp(un),tp=Tp(zc,!0);function tS(s,l){var u=!0;return rr(s,function(p,y,S){return u=!!l(p,y,S),u}),u}function Lo(s,l,u){for(var p=-1,y=s.length;++p<y;){var S=s[p],_=l(S);if(_!=null&&(E===t?_===_&&!Et(_):u(_,E)))var E=_,C=S}return C}function nS(s,l,u,p){var y=s.length;for(u=Q(u),u<0&&(u=-u>y?0:y+u),p=p===t||p>y?y:Q(p),p<0&&(p+=y),p=u>p?0:bm(p);u<p;)s[u++]=l;return s}function np(s,l){var u=[];return rr(s,function(p,y,S){l(p,y,S)&&u.push(p)}),u}function je(s,l,u,p,y){var S=-1,_=s.length;for(u||(u=US),y||(y=[]);++S<_;){var E=s[S];l>0&&u(E)?l>1?je(E,l-1,u,p,y):er(y,E):p||(y[y.length]=E)}return y}var Fc=Mp(),rp=Mp(!0);function un(s,l){return s&&Fc(s,l,$e)}function zc(s,l){return s&&rp(s,l,$e)}function Po(s,l){return Qn(l,function(u){return In(s[u])})}function Dr(s,l){l=sr(l,s);for(var u=0,p=l.length;s!=null&&u<p;)s=s[dn(l[u++])];return u&&u==p?s:t}function ip(s,l,u){var p=l(s);return Z(s)?p:er(p,u(s))}function tt(s){return s==null?s===t?Nb:Ab:Or&&Or in Se(s)?zS(s):XS(s)}function Bc(s,l){return s>l}function rS(s,l){return s!=null&&we.call(s,l)}function iS(s,l){return s!=null&&l in Se(s)}function sS(s,l,u){return s>=Qe(l,u)&&s<De(l,u)}function $c(s,l,u){for(var p=u?_c:go,y=s[0].length,S=s.length,_=S,E=A(S),C=1/0,N=[];_--;){var O=s[_];_&&l&&(O=Ee(O,_t(l))),C=Qe(O.length,C),E[_]=!u&&(l||y>=120&&O.length>=120)?new Lr(_&&O):t}O=s[0];var R=-1,$=E[0];e:for(;++R<y&&N.length<C;){var J=O[R],q=l?l(J):J;if(J=u||J!==0?J:0,!($?ls($,q):p(N,q,u))){for(_=S;--_;){var ee=E[_];if(!(ee?ls(ee,q):p(s[_],q,u)))continue e}$&&$.push(q),N.push(J)}}return N}function oS(s,l,u,p){return un(s,function(y,S,_){l(p,u(y),S,_)}),p}function ms(s,l,u){l=sr(l,s),s=Kp(s,l);var p=s==null?s:s[dn(Bt(l))];return p==null?t:vt(p,s,u)}function sp(s){return Me(s)&&tt(s)==qt}function lS(s){return Me(s)&&tt(s)==ss}function aS(s){return Me(s)&&tt(s)==es}function gs(s,l,u,p,y){return s===l?!0:s==null||l==null||!Me(s)&&!Me(l)?s!==s&&l!==l:cS(s,l,u,p,gs,y)}function cS(s,l,u,p,y,S){var _=Z(s),E=Z(l),C=_?ao:et(s),N=E?ao:et(l);C=C==qt?xn:C,N=N==qt?xn:N;var O=C==xn,R=N==xn,$=C==N;if($&&lr(s)){if(!lr(l))return!1;_=!0,O=!1}if($&&!O)return S||(S=new Zt),_||vi(s)?zp(s,l,u,p,y,S):DS(s,l,C,u,p,y,S);if(!(u&v)){var J=O&&we.call(s,"__wrapped__"),q=R&&we.call(l,"__wrapped__");if(J||q){var ee=J?s.value():s,j=q?l.value():l;return S||(S=new Zt),y(ee,j,u,p,S)}}return $?(S||(S=new Zt),FS(s,l,u,p,y,S)):!1}function uS(s){return Me(s)&&et(s)==jt}function Hc(s,l,u,p){var y=u.length,S=y,_=!p;if(s==null)return!S;for(s=Se(s);y--;){var E=u[y];if(_&&E[2]?E[1]!==s[E[0]]:!(E[0]in s))return!1}for(;++y<S;){E=u[y];var C=E[0],N=s[C],O=E[1];if(_&&E[2]){if(N===t&&!(C in s))return!1}else{var R=new Zt;if(p)var $=p(N,O,C,s,l,R);if(!($===t?gs(O,N,v|x,p,R):$))return!1}}return!0}function op(s){if(!Te(s)||JS(s))return!1;var l=In(s)?uw:e2;return l.test(zr(s))}function fS(s){return Me(s)&&tt(s)==ns}function dS(s){return Me(s)&&et(s)==Yt}function hS(s){return Me(s)&&Zo(s.length)&&!!_e[tt(s)]}function lp(s){return typeof s=="function"?s:s==null?ht:typeof s=="object"?Z(s)?up(s[0],s[1]):cp(s):Am(s)}function Wc(s){if(!ws(s))return gw(s);var l=[];for(var u in Se(s))we.call(s,u)&&u!="constructor"&&l.push(u);return l}function pS(s){if(!Te(s))return YS(s);var l=ws(s),u=[];for(var p in s)p=="constructor"&&(l||!we.call(s,p))||u.push(p);return u}function Vc(s,l){return s<l}function ap(s,l){var u=-1,p=ft(s)?A(s.length):[];return rr(s,function(y,S,_){p[++u]=l(y,S,_)}),p}function cp(s){var l=iu(s);return l.length==1&&l[0][2]?Vp(l[0][0],l[0][1]):function(u){return u===s||Hc(u,s,l)}}function up(s,l){return ou(s)&&Wp(l)?Vp(dn(s),l):function(u){var p=gu(u,s);return p===t&&p===l?yu(u,s):gs(l,p,v|x)}}function Do(s,l,u,p,y){s!==l&&Fc(l,function(S,_){if(y||(y=new Zt),Te(S))mS(s,l,_,u,Do,p,y);else{var E=p?p(au(s,_),S,_+"",s,l,y):t;E===t&&(E=S),Pc(s,_,E)}},dt)}function mS(s,l,u,p,y,S,_){var E=au(s,u),C=au(l,u),N=_.get(C);if(N){Pc(s,u,N);return}var O=S?S(E,C,u+"",s,l,_):t,R=O===t;if(R){var $=Z(C),J=!$&&lr(C),q=!$&&!J&&vi(C);O=C,$||J||q?Z(E)?O=E:Ne(E)?O=ut(E):J?(R=!1,O=_p(C,!0)):q?(R=!1,O=xp(C,!0)):O=[]:vs(C)||Br(C)?(O=E,Br(E)?O=wm(E):(!Te(E)||In(E))&&(O=Hp(C))):R=!1}R&&(_.set(C,O),y(O,C,p,S,_),_.delete(C)),Pc(s,u,O)}function fp(s,l){var u=s.length;if(u)return l+=l<0?u:0,An(l,u)?s[l]:t}function dp(s,l,u){l.length?l=Ee(l,function(S){return Z(S)?function(_){return Dr(_,S.length===1?S[0]:S)}:S}):l=[ht];var p=-1;l=Ee(l,_t(G()));var y=ap(s,function(S,_,E){var C=Ee(l,function(N){return N(S)});return{criteria:C,index:++p,value:S}});return W2(y,function(S,_){return MS(S,_,u)})}function gS(s,l){return hp(s,l,function(u,p){return yu(s,p)})}function hp(s,l,u){for(var p=-1,y=l.length,S={};++p<y;){var _=l[p],E=Dr(s,_);u(E,_)&&ys(S,sr(_,s),E)}return S}function yS(s){return function(l){return Dr(l,s)}}function Uc(s,l,u,p){var y=p?H2:ui,S=-1,_=l.length,E=s;for(s===l&&(l=ut(l)),u&&(E=Ee(s,_t(u)));++S<_;)for(var C=0,N=l[S],O=u?u(N):N;(C=y(E,O,C,p))>-1;)E!==s&&Co.call(E,C,1),Co.call(s,C,1);return s}function pp(s,l){for(var u=s?l.length:0,p=u-1;u--;){var y=l[u];if(u==p||y!==S){var S=y;An(y)?Co.call(s,y,1):qc(s,y)}}return s}function Kc(s,l){return s+Ao(qh()*(l-s+1))}function bS(s,l,u,p){for(var y=-1,S=De(Mo((l-s)/(u||1)),0),_=A(S);S--;)_[p?S:++y]=s,s+=u;return _}function Jc(s,l){var u="";if(!s||l<1||l>Zn)return u;do l%2&&(u+=s),l=Ao(l/2),l&&(s+=s);while(l);return u}function ie(s,l){return cu(Up(s,l,ht),s+"")}function wS(s){return Xh(_i(s))}function SS(s,l){var u=_i(s);return Jo(u,Pr(l,0,u.length))}function ys(s,l,u,p){if(!Te(s))return s;l=sr(l,s);for(var y=-1,S=l.length,_=S-1,E=s;E!=null&&++y<S;){var C=dn(l[y]),N=u;if(C==="__proto__"||C==="constructor"||C==="prototype")return s;if(y!=_){var O=E[C];N=p?p(O,C,E):t,N===t&&(N=Te(O)?O:An(l[y+1])?[]:{})}hs(E,C,N),E=E[C]}return s}var mp=Io?function(s,l){return Io.set(s,l),s}:ht,vS=To?function(s,l){return To(s,"toString",{configurable:!0,enumerable:!1,value:wu(l),writable:!0})}:ht;function _S(s){return Jo(_i(s))}function zt(s,l,u){var p=-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 S=A(y);++p<y;)S[p]=s[p+l];return S}function xS(s,l){var u;return rr(s,function(p,y,S){return u=l(p,y,S),!u}),!!u}function Fo(s,l,u){var p=0,y=s==null?p:s.length;if(typeof l=="number"&&l===l&&y<=nc){for(;p<y;){var S=p+y>>>1,_=s[S];_!==null&&!Et(_)&&(u?_<=l:_<l)?p=S+1:y=S}return y}return Gc(s,l,ht,u)}function Gc(s,l,u,p){var y=0,S=s==null?0:s.length;if(S===0)return 0;l=u(l);for(var _=l!==l,E=l===null,C=Et(l),N=l===t;y<S;){var O=Ao((y+S)/2),R=u(s[O]),$=R!==t,J=R===null,q=R===R,ee=Et(R);if(_)var j=p||q;else N?j=q&&(p||$):E?j=q&&$&&(p||!J):C?j=q&&$&&!J&&(p||!ee):J||ee?j=!1:j=p?R<=l:R<l;j?y=O+1:S=O}return Qe(S,tc)}function gp(s,l){for(var u=-1,p=s.length,y=0,S=[];++u<p;){var _=s[u],E=l?l(_):_;if(!u||!Qt(E,C)){var C=E;S[y++]=_===0?0:_}}return S}function yp(s){return typeof s=="number"?s:Et(s)?cn:+s}function xt(s){if(typeof s=="string")return s;if(Z(s))return Ee(s,xt)+"";if(Et(s))return jh?jh.call(s):"";var l=s+"";return l=="0"&&1/s==-1/0?"-0":l}function ir(s,l,u){var p=-1,y=go,S=s.length,_=!0,E=[],C=E;if(u)_=!1,y=_c;else if(S>=i){var N=l?null:LS(s);if(N)return bo(N);_=!1,y=ls,C=new Lr}else C=l?[]:E;e:for(;++p<S;){var O=s[p],R=l?l(O):O;if(O=u||O!==0?O:0,_&&R===R){for(var $=C.length;$--;)if(C[$]===R)continue e;l&&C.push(R),E.push(O)}else y(C,R,u)||(C!==E&&C.push(R),E.push(O))}return E}function qc(s,l){return l=sr(l,s),s=Kp(s,l),s==null||delete s[dn(Bt(l))]}function bp(s,l,u,p){return ys(s,l,u(Dr(s,l)),p)}function zo(s,l,u,p){for(var y=s.length,S=p?y:-1;(p?S--:++S<y)&&l(s[S],S,s););return u?zt(s,p?0:S,p?S+1:y):zt(s,p?S+1:0,p?y:S)}function wp(s,l){var u=s;return u instanceof oe&&(u=u.value()),xc(l,function(p,y){return y.func.apply(y.thisArg,er([p],y.args))},u)}function jc(s,l,u){var p=s.length;if(p<2)return p?ir(s[0]):[];for(var y=-1,S=A(p);++y<p;)for(var _=s[y],E=-1;++E<p;)E!=y&&(S[y]=ps(S[y]||_,s[E],l,u));return ir(je(S,1),l,u)}function Sp(s,l,u){for(var p=-1,y=s.length,S=l.length,_={};++p<y;){var E=p<S?l[p]:t;u(_,s[p],E)}return _}function Yc(s){return Ne(s)?s:[]}function Xc(s){return typeof s=="function"?s:ht}function sr(s,l){return Z(s)?s:ou(s,l)?[s]:jp(ge(s))}var ES=ie;function or(s,l,u){var p=s.length;return u=u===t?p:u,!l&&u>=p?s:zt(s,l,u)}var vp=fw||function(s){return qe.clearTimeout(s)};function _p(s,l){if(l)return s.slice();var u=s.length,p=Vh?Vh(u):new s.constructor(u);return s.copy(p),p}function Zc(s){var l=new s.constructor(s.byteLength);return new Eo(l).set(new Eo(s)),l}function kS(s,l){var u=l?Zc(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.byteLength)}function CS(s){var l=new s.constructor(s.source,sh.exec(s));return l.lastIndex=s.lastIndex,l}function TS(s){return ds?Se(ds.call(s)):{}}function xp(s,l){var u=l?Zc(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.length)}function Ep(s,l){if(s!==l){var u=s!==t,p=s===null,y=s===s,S=Et(s),_=l!==t,E=l===null,C=l===l,N=Et(l);if(!E&&!N&&!S&&s>l||S&&_&&C&&!E&&!N||p&&_&&C||!u&&C||!y)return 1;if(!p&&!S&&!N&&s<l||N&&u&&y&&!p&&!S||E&&u&&y||!_&&y||!C)return-1}return 0}function MS(s,l,u){for(var p=-1,y=s.criteria,S=l.criteria,_=y.length,E=u.length;++p<_;){var C=Ep(y[p],S[p]);if(C){if(p>=E)return C;var N=u[p];return C*(N=="desc"?-1:1)}}return s.index-l.index}function kp(s,l,u,p){for(var y=-1,S=s.length,_=u.length,E=-1,C=l.length,N=De(S-_,0),O=A(C+N),R=!p;++E<C;)O[E]=l[E];for(;++y<_;)(R||y<S)&&(O[u[y]]=s[y]);for(;N--;)O[E++]=s[y++];return O}function Cp(s,l,u,p){for(var y=-1,S=s.length,_=-1,E=u.length,C=-1,N=l.length,O=De(S-E,0),R=A(O+N),$=!p;++y<O;)R[y]=s[y];for(var J=y;++C<N;)R[J+C]=l[C];for(;++_<E;)($||y<S)&&(R[J+u[_]]=s[y++]);return R}function ut(s,l){var u=-1,p=s.length;for(l||(l=A(p));++u<p;)l[u]=s[u];return l}function fn(s,l,u,p){var y=!u;u||(u={});for(var S=-1,_=l.length;++S<_;){var E=l[S],C=p?p(u[E],s[E],E,u,s):t;C===t&&(C=s[E]),y?Cn(u,E,C):hs(u,E,C)}return u}function AS(s,l){return fn(s,su(s),l)}function IS(s,l){return fn(s,Bp(s),l)}function Bo(s,l){return function(u,p){var y=Z(u)?P2:Zw,S=l?l():{};return y(u,s,G(p,2),S)}}function bi(s){return ie(function(l,u){var p=-1,y=u.length,S=y>1?u[y-1]:t,_=y>2?u[2]:t;for(S=s.length>3&&typeof S=="function"?(y--,S):t,_&&nt(u[0],u[1],_)&&(S=y<3?t:S,y=1),l=Se(l);++p<y;){var E=u[p];E&&s(l,E,p,S)}return l})}function Tp(s,l){return function(u,p){if(u==null)return u;if(!ft(u))return s(u,p);for(var y=u.length,S=l?y:-1,_=Se(u);(l?S--:++S<y)&&p(_[S],S,_)!==!1;);return u}}function Mp(s){return function(l,u,p){for(var y=-1,S=Se(l),_=p(l),E=_.length;E--;){var C=_[s?E:++y];if(u(S[C],C,S)===!1)break}return l}}function NS(s,l,u){var p=l&T,y=bs(s);function S(){var _=this&&this!==qe&&this instanceof S?y:s;return _.apply(p?u:this,arguments)}return S}function Ap(s){return function(l){l=ge(l);var u=fi(l)?Xt(l):t,p=u?u[0]:l.charAt(0),y=u?or(u,1).join(""):l.slice(1);return p[s]()+y}}function wi(s){return function(l){return xc(Tm(Cm(l).replace(v2,"")),s,"")}}function bs(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=yi(s.prototype),p=s.apply(u,l);return Te(p)?p:u}}function OS(s,l,u){var p=bs(s);function y(){for(var S=arguments.length,_=A(S),E=S,C=Si(y);E--;)_[E]=arguments[E];var N=S<3&&_[0]!==C&&_[S-1]!==C?[]:tr(_,C);if(S-=N.length,S<u)return Lp(s,l,$o,y.placeholder,t,_,N,t,t,u-S);var O=this&&this!==qe&&this instanceof y?p:s;return vt(O,this,_)}return y}function Ip(s){return function(l,u,p){var y=Se(l);if(!ft(l)){var S=G(u,3);l=$e(l),u=function(E){return S(y[E],E,y)}}var _=s(l,u,p);return _>-1?y[S?l[_]:_]:t}}function Np(s){return Mn(function(l){var u=l.length,p=u,y=Dt.prototype.thru;for(s&&l.reverse();p--;){var S=l[p];if(typeof S!="function")throw new Pt(a);if(y&&!_&&Uo(S)=="wrapper")var _=new Dt([],!0)}for(p=_?p:u;++p<u;){S=l[p];var E=Uo(S),C=E=="wrapper"?ru(S):t;C&&lu(C[0])&&C[1]==(de|B|V|be)&&!C[4].length&&C[9]==1?_=_[Uo(C[0])].apply(_,C[3]):_=S.length==1&&lu(S)?_[E]():_.thru(S)}return function(){var N=arguments,O=N[0];if(_&&N.length==1&&Z(O))return _.plant(O).value();for(var R=0,$=u?l[R].apply(this,N):O;++R<u;)$=l[R].call(this,$);return $}})}function $o(s,l,u,p,y,S,_,E,C,N){var O=l&de,R=l&T,$=l&M,J=l&(B|H),q=l&bt,ee=$?t:bs(s);function j(){for(var se=arguments.length,fe=A(se),kt=se;kt--;)fe[kt]=arguments[kt];if(J)var rt=Si(j),Ct=U2(fe,rt);if(p&&(fe=kp(fe,p,y,J)),S&&(fe=Cp(fe,S,_,J)),se-=Ct,J&&se<N){var Oe=tr(fe,rt);return Lp(s,l,$o,j.placeholder,u,fe,Oe,E,C,N-se)}var en=R?u:this,On=$?en[s]:s;return se=fe.length,E?fe=ZS(fe,E):q&&se>1&&fe.reverse(),O&&C<se&&(fe.length=C),this&&this!==qe&&this instanceof j&&(On=ee||bs(On)),On.apply(en,fe)}return j}function Op(s,l){return function(u,p){return oS(u,s,l(p),{})}}function Ho(s,l){return function(u,p){var y;if(u===t&&p===t)return l;if(u!==t&&(y=u),p!==t){if(y===t)return p;typeof u=="string"||typeof p=="string"?(u=xt(u),p=xt(p)):(u=yp(u),p=yp(p)),y=s(u,p)}return y}}function Qc(s){return Mn(function(l){return l=Ee(l,_t(G())),ie(function(u){var p=this;return s(l,function(y){return vt(y,p,u)})})})}function Wo(s,l){l=l===t?" ":xt(l);var u=l.length;if(u<2)return u?Jc(l,s):l;var p=Jc(l,Mo(s/di(l)));return fi(l)?or(Xt(p),0,s).join(""):p.slice(0,s)}function RS(s,l,u,p){var y=l&T,S=bs(s);function _(){for(var E=-1,C=arguments.length,N=-1,O=p.length,R=A(O+C),$=this&&this!==qe&&this instanceof _?S:s;++N<O;)R[N]=p[N];for(;C--;)R[N++]=arguments[++E];return vt($,y?u:this,R)}return _}function Rp(s){return function(l,u,p){return p&&typeof p!="number"&&nt(l,u,p)&&(u=p=t),l=Nn(l),u===t?(u=l,l=0):u=Nn(u),p=p===t?l<u?1:-1:Nn(p),bS(l,u,p,s)}}function Vo(s){return function(l,u){return typeof l=="string"&&typeof u=="string"||(l=$t(l),u=$t(u)),s(l,u)}}function Lp(s,l,u,p,y,S,_,E,C,N){var O=l&B,R=O?_:t,$=O?t:_,J=O?S:t,q=O?t:S;l|=O?V:ue,l&=~(O?ue:V),l&L||(l&=-4);var ee=[s,l,y,J,R,q,$,E,C,N],j=u.apply(t,ee);return lu(s)&&Jp(j,ee),j.placeholder=p,Gp(j,s,l)}function eu(s){var l=Pe[s];return function(u,p){if(u=$t(u),p=p==null?0:Qe(Q(p),292),p&&Gh(u)){var y=(ge(u)+"e").split("e"),S=l(y[0]+"e"+(+y[1]+p));return y=(ge(S)+"e").split("e"),+(y[0]+"e"+(+y[1]-p))}return l(u)}}var LS=mi&&1/bo(new mi([,-0]))[1]==wt?function(s){return new mi(s)}:_u;function Pp(s){return function(l){var u=et(l);return u==jt?Ic(l):u==Yt?X2(l):V2(l,s(l))}}function Tn(s,l,u,p,y,S,_,E){var C=l&M;if(!C&&typeof s!="function")throw new Pt(a);var N=p?p.length:0;if(N||(l&=-97,p=y=t),_=_===t?_:De(Q(_),0),E=E===t?E:Q(E),N-=y?y.length:0,l&ue){var O=p,R=y;p=y=t}var $=C?t:ru(s),J=[s,l,u,p,y,O,R,S,_,E];if($&&jS(J,$),s=J[0],l=J[1],u=J[2],p=J[3],y=J[4],E=J[9]=J[9]===t?C?0:s.length:De(J[9]-N,0),!E&&l&(B|H)&&(l&=-25),!l||l==T)var q=NS(s,l,u);else l==B||l==H?q=OS(s,l,E):(l==V||l==(T|V))&&!y.length?q=RS(s,l,u,p):q=$o.apply(t,J);var ee=$?mp:Jp;return Gp(ee(q,J),s,l)}function Dp(s,l,u,p){return s===t||Qt(s,pi[u])&&!we.call(p,u)?l:s}function Fp(s,l,u,p,y,S){return Te(s)&&Te(l)&&(S.set(l,s),Do(s,l,t,Fp,S),S.delete(l)),s}function PS(s){return vs(s)?t:s}function zp(s,l,u,p,y,S){var _=u&v,E=s.length,C=l.length;if(E!=C&&!(_&&C>E))return!1;var N=S.get(s),O=S.get(l);if(N&&O)return N==l&&O==s;var R=-1,$=!0,J=u&x?new Lr:t;for(S.set(s,l),S.set(l,s);++R<E;){var q=s[R],ee=l[R];if(p)var j=_?p(ee,q,R,l,s,S):p(q,ee,R,s,l,S);if(j!==t){if(j)continue;$=!1;break}if(J){if(!Ec(l,function(se,fe){if(!ls(J,fe)&&(q===se||y(q,se,u,p,S)))return J.push(fe)})){$=!1;break}}else if(!(q===ee||y(q,ee,u,p,S))){$=!1;break}}return S.delete(s),S.delete(l),$}function DS(s,l,u,p,y,S,_){switch(u){case ai:if(s.byteLength!=l.byteLength||s.byteOffset!=l.byteOffset)return!1;s=s.buffer,l=l.buffer;case ss:return!(s.byteLength!=l.byteLength||!S(new Eo(s),new Eo(l)));case Qi:case es:case ts:return Qt(+s,+l);case co:return s.name==l.name&&s.message==l.message;case ns:case rs:return s==l+"";case jt:var E=Ic;case Yt:var C=p&v;if(E||(E=bo),s.size!=l.size&&!C)return!1;var N=_.get(s);if(N)return N==l;p|=x,_.set(s,l);var O=zp(E(s),E(l),p,y,S,_);return _.delete(s),O;case fo:if(ds)return ds.call(s)==ds.call(l)}return!1}function FS(s,l,u,p,y,S){var _=u&v,E=tu(s),C=E.length,N=tu(l),O=N.length;if(C!=O&&!_)return!1;for(var R=C;R--;){var $=E[R];if(!(_?$ in l:we.call(l,$)))return!1}var J=S.get(s),q=S.get(l);if(J&&q)return J==l&&q==s;var ee=!0;S.set(s,l),S.set(l,s);for(var j=_;++R<C;){$=E[R];var se=s[$],fe=l[$];if(p)var kt=_?p(fe,se,$,l,s,S):p(se,fe,$,s,l,S);if(!(kt===t?se===fe||y(se,fe,u,p,S):kt)){ee=!1;break}j||(j=$=="constructor")}if(ee&&!j){var rt=s.constructor,Ct=l.constructor;rt!=Ct&&"constructor"in s&&"constructor"in l&&!(typeof rt=="function"&&rt instanceof rt&&typeof Ct=="function"&&Ct instanceof Ct)&&(ee=!1)}return S.delete(s),S.delete(l),ee}function Mn(s){return cu(Up(s,t,Qp),s+"")}function tu(s){return ip(s,$e,su)}function nu(s){return ip(s,dt,Bp)}var ru=Io?function(s){return Io.get(s)}:_u;function Uo(s){for(var l=s.name+"",u=gi[l],p=we.call(gi,l)?u.length:0;p--;){var y=u[p],S=y.func;if(S==null||S==s)return y.name}return l}function Si(s){var l=we.call(w,"placeholder")?w:s;return l.placeholder}function G(){var s=w.iteratee||Su;return s=s===Su?lp:s,arguments.length?s(arguments[0],arguments[1]):s}function Ko(s,l){var u=s.__data__;return KS(l)?u[typeof l=="string"?"string":"hash"]:u.map}function iu(s){for(var l=$e(s),u=l.length;u--;){var p=l[u],y=s[p];l[u]=[p,y,Wp(y)]}return l}function Fr(s,l){var u=q2(s,l);return op(u)?u:t}function zS(s){var l=we.call(s,Or),u=s[Or];try{s[Or]=t;var p=!0}catch{}var y=_o.call(s);return p&&(l?s[Or]=u:delete s[Or]),y}var su=Oc?function(s){return s==null?[]:(s=Se(s),Qn(Oc(s),function(l){return Kh.call(s,l)}))}:xu,Bp=Oc?function(s){for(var l=[];s;)er(l,su(s)),s=ko(s);return l}:xu,et=tt;(Rc&&et(new Rc(new ArrayBuffer(1)))!=ai||cs&&et(new cs)!=jt||Lc&&et(Lc.resolve())!=th||mi&&et(new mi)!=Yt||us&&et(new us)!=is)&&(et=function(s){var l=tt(s),u=l==xn?s.constructor:t,p=u?zr(u):"";if(p)switch(p){case Sw:return ai;case vw:return jt;case _w:return th;case xw:return Yt;case Ew:return is}return l});function BS(s,l,u){for(var p=-1,y=u.length;++p<y;){var S=u[p],_=S.size;switch(S.type){case"drop":s+=_;break;case"dropRight":l-=_;break;case"take":l=Qe(l,s+_);break;case"takeRight":s=De(s,l-_);break}}return{start:s,end:l}}function $S(s){var l=s.match(Jb);return l?l[1].split(Gb):[]}function $p(s,l,u){l=sr(l,s);for(var p=-1,y=l.length,S=!1;++p<y;){var _=dn(l[p]);if(!(S=s!=null&&u(s,_)))break;s=s[_]}return S||++p!=y?S:(y=s==null?0:s.length,!!y&&Zo(y)&&An(_,y)&&(Z(s)||Br(s)))}function HS(s){var l=s.length,u=new s.constructor(l);return l&&typeof s[0]=="string"&&we.call(s,"index")&&(u.index=s.index,u.input=s.input),u}function Hp(s){return typeof s.constructor=="function"&&!ws(s)?yi(ko(s)):{}}function WS(s,l,u){var p=s.constructor;switch(l){case ss:return Zc(s);case Qi:case es:return new p(+s);case ai:return kS(s,u);case ic:case sc:case oc:case lc:case ac:case cc:case uc:case fc:case dc:return xp(s,u);case jt:return new p;case ts:case rs:return new p(s);case ns:return CS(s);case Yt:return new p;case fo:return TS(s)}}function VS(s,l){var u=l.length;if(!u)return s;var p=u-1;return l[p]=(u>1?"& ":"")+l[p],l=l.join(u>2?", ":" "),s.replace(Kb,`{
21
25
  /* [wrapped with `+l+`] */
22
- `)}function Ww(s){return Z(s)||Rr(s)||!!(ud&&s&&s[ud])}function Cn(s,l){var u=typeof s;return l=l??qn,!!l&&(u=="number"||u!="symbol"&&e2.test(s))&&s>-1&&s%1==0&&s<l}function nt(s,l,u){if(!Te(u))return!1;var d=typeof l;return(d=="number"?ut(u)&&Cn(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:Fy.test(s)||!zy.test(s)||l!=null&&s in ve(l)}function Uw(s){var l=typeof s;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?s!=="__proto__":s===null}function zc(s){var l=Ao(s),u=w[l];if(typeof u!="function"||!(l in oe.prototype))return!1;if(s===u)return!0;var d=Lc(u);return!!d&&s===d[0]}function Vw(s){return!!od&&od in s}var Kw=io?Tn:tu;function is(s){var l=s&&s.constructor,u=typeof l=="function"&&l.prototype||ii;return s===u}function op(s){return s===s&&!Te(s)}function lp(s,l){return function(u){return u==null?!1:u[s]===l&&(l!==t||s in ve(u))}}function Gw(s){var l=Po(s,function(d){return u.size===h&&u.clear(),d}),u=l.cache;return l}function Jw(s,l){var u=s[1],d=l[1],y=u|d,v=y<(T|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(!(v||x))return s;d&T&&(s[2]=l[2],y|=u&T?0:P);var E=l[3];if(E){var C=s[3];s[3]=C?Ud(C,E,l[4]):E,s[4]=C?Xn(s[3],m):l[4]}return E=l[5],E&&(C=s[5],s[5]=C?Vd(C,E,l[6]):E,s[6]=C?Xn(s[5],m):l[6]),E=l[7],E&&(s[7]=E),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 qw(s){var l=[];if(s!=null)for(var u in ve(s))l.push(u);return l}function jw(s){return oo.call(s)}function ap(s,l,u){return l=De(l===t?s.length-1:l,0),function(){for(var d=arguments,y=-1,v=De(d.length-l,0),x=A(v);++y<v;)x[y]=d[l+y];y=-1;for(var E=A(l+1);++y<l;)E[y]=d[y];return E[l]=u(x),vt(s,this,E)}}function cp(s,l){return l.length<2?s:Ir(s,Bt(l,0,-1))}function Yw(s,l){for(var u=s.length,d=Qe(l.length,u),y=ct(s);d--;){var v=l[d];s[d]=Cn(v,u)?y[v]:t}return s}function Fc(s,l){if(!(l==="constructor"&&typeof s[l]=="function")&&l!="__proto__")return s[l]}var up=hp(Rd),ss=fb||function(s,l){return qe.setTimeout(s,l)},Hc=hp(ww);function fp(s,l,u){var d=l+"";return Hc(s,$w(d,Xw(zw(d),u)))}function hp(s){var l=0,u=0;return function(){var d=mb(),y=Xr-(d-u);if(u=d,y>0){if(++l>=Jn)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 v=xc(u,y),x=s[v];s[v]=s[u],s[u]=x}return s.length=l,s}var dp=Gw(function(s){var l=[];return s.charCodeAt(0)===46&&l.push(""),s.replace(Hy,function(u,d,y,v){l.push(y?v.replace(qy,"$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 Or(s){if(s!=null){try{return so.call(s)}catch{}try{return s+""}catch{}}return""}function Xw(s,l){return Rt(La,function(u){var d="_."+u[0];l&u[1]&&!eo(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 Zw(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,v=0,x=A(ho(d/l));y<d;)x[v++]=Bt(s,y,y+=l);return x}function Qw(s){for(var l=-1,u=s==null?0:s.length,d=0,y=[];++l<u;){var v=s[l];v&&(y[d++]=v)}return y}function ev(){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 Yn(Z(u)?ct(u):[u],je(l,1))}var tv=ie(function(s,l){return Ne(s)?Qi(s,je(l,1,Ne,!0)):[]}),nv=ie(function(s,l){var u=zt(l);return Ne(u)&&(u=t),Ne(s)?Qi(s,je(l,1,Ne,!0),J(u,2)):[]}),rv=ie(function(s,l){var u=zt(l);return Ne(u)&&(u=t),Ne(s)?Qi(s,je(l,1,Ne,!0),t,u):[]});function iv(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 sv(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 ov(s,l){return s&&s.length?ko(s,J(l,3),!0,!0):[]}function lv(s,l){return s&&s.length?ko(s,J(l,3),!0):[]}function av(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),ew(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)),to(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)),to(s,J(l,3),y,!0)}function yp(s){var l=s==null?0:s.length;return l?je(s,1):[]}function cv(s){var l=s==null?0:s.length;return l?je(s,bt):[]}function uv(s,l){var u=s==null?0:s.length;return u?(l=l===t?1:Q(l),je(s,l)):[]}function fv(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 hv(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)),ei(s,l,y)}function dv(s){var l=s==null?0:s.length;return l?Bt(s,0,-1):[]}var pv=ie(function(s){var l=Ee(s,Tc);return l.length&&l[0]===s[0]?yc(l):[]}),mv=ie(function(s){var l=zt(s),u=Ee(s,Tc);return l===zt(u)?l=t:u.pop(),u.length&&u[0]===s[0]?yc(u,J(l,2)):[]}),gv=ie(function(s){var l=zt(s),u=Ee(s,Tc);return l=typeof l=="function"?l:t,l&&u.pop(),u.length&&u[0]===s[0]?yc(u,t,l):[]});function yv(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 bv(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):to(s,Zh,y,!0)}function wv(s,l){return s&&s.length?Ad(s,Q(l)):t}var vv=ie(wp);function wp(s,l){return s&&s.length&&l&&l.length?Sc(s,l):s}function Sv(s,l,u){return s&&s.length&&l&&l.length?Sc(s,l,J(u,2)):s}function xv(s,l,u){return s&&s.length&&l&&l.length?Sc(s,l,t,u):s}var kv=_n(function(s,l){var u=s==null?0:s.length,d=dc(s,l);return Od(s,Ee(l,function(y){return Cn(y,u)?+y:y}).sort(Wd)),d});function Ev(s,l){var u=[];if(!(s&&s.length))return u;var d=-1,y=[],v=s.length;for(l=J(l,3);++d<v;){var x=s[d];l(x,d,s)&&(u.push(x),y.push(d))}return Od(s,y),u}function $c(s){return s==null?s:yb.call(s)}function _v(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 Cv(s,l){return xo(s,l)}function Tv(s,l,u){return Ec(s,l,J(u,2))}function Mv(s,l){var u=s==null?0:s.length;if(u){var d=xo(s,l);if(d<u&&Xt(s[d],l))return d}return-1}function Av(s,l){return xo(s,l,!0)}function Iv(s,l,u){return Ec(s,l,J(u,2),!0)}function Nv(s,l){var u=s==null?0:s.length;if(u){var d=xo(s,l,!0)-1;if(Xt(s[d],l))return d}return-1}function Ov(s){return s&&s.length?Ld(s):[]}function Rv(s,l){return s&&s.length?Ld(s,J(l,2)):[]}function Lv(s){var l=s==null?0:s.length;return l?Bt(s,1,l):[]}function Pv(s,l,u){return s&&s.length?(l=u||l===t?1:Q(l),Bt(s,0,l<0?0:l)):[]}function Dv(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 Bv(s,l){return s&&s.length?ko(s,J(l,3),!1,!0):[]}function zv(s,l){return s&&s.length?ko(s,J(l,3)):[]}var Fv=ie(function(s){return er(je(s,1,Ne,!0))}),Hv=ie(function(s){var l=zt(s);return Ne(l)&&(l=t),er(je(s,1,Ne,!0),J(l,2))}),$v=ie(function(s){var l=zt(s);return l=typeof l=="function"?l:t,er(je(s,1,Ne,!0),t,l)});function Wv(s){return s&&s.length?er(s):[]}function Uv(s,l){return s&&s.length?er(s,J(l,2)):[]}function Vv(s,l){return l=typeof l=="function"?l:t,s&&s.length?er(s,t,l):[]}function Wc(s){if(!(s&&s.length))return[];var l=0;return s=jn(s,function(u){if(Ne(u))return l=De(u.length,l),!0}),sc(l,function(u){return Ee(s,nc(u))})}function vp(s,l){if(!(s&&s.length))return[];var u=Wc(s);return l==null?u:Ee(u,function(d){return vt(l,t,d)})}var Kv=ie(function(s,l){return Ne(s)?Qi(s,l):[]}),Gv=ie(function(s){return Cc(jn(s,Ne))}),Jv=ie(function(s){var l=zt(s);return Ne(l)&&(l=t),Cc(jn(s,Ne),J(l,2))}),qv=ie(function(s){var l=zt(s);return l=typeof l=="function"?l:t,Cc(jn(s,Ne),t,l)}),jv=ie(Wc);function Yv(s,l){return zd(s||[],l||[],Zi)}function Xv(s,l){return zd(s||[],l||[],ns)}var Zv=ie(function(s){var l=s.length,u=l>1?s[l-1]:t;return u=typeof u=="function"?(s.pop(),u):t,vp(s,u)});function Sp(s){var l=w(s);return l.__chain__=!0,l}function Qv(s,l){return l(s),s}function Oo(s,l){return l(s)}var eS=_n(function(s){var l=s.length,u=l?s[0]:0,d=this.__wrapped__,y=function(v){return dc(v,s)};return l>1||this.__actions__.length||!(d instanceof oe)||!Cn(u)?this.thru(y):(d=d.slice(u,+u+(l?1:0)),d.__actions__.push({func:Oo,args:[y],thisArg:t}),new Pt(d,this.__chain__).thru(function(v){return l&&!v.length&&v.push(t),v}))});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 yo;){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:Oo,args:[$c],thisArg:t}),new Pt(l,this.__chain__)}return this.thru($c)}function lS(){return Bd(this.__wrapped__,this.__actions__)}var aS=Eo(function(s,l,u){we.call(s,u)?++s[u]:kn(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)?jn:vd;return u(s,J(l,3))}var fS=qd(mp),hS=qd(gp);function dS(s,l){return je(Ro(s,l),1)}function pS(s,l){return je(Ro(s,l),bt)}function mS(s,l,u){return u=u===t?1:Q(u),je(Ro(s,l),u)}function xp(s,l){var u=Z(s)?Rt:Qn;return u(s,J(l,3))}function kp(s,l){var u=Z(s)?L2:wd;return u(s,J(l,3))}var gS=Eo(function(s,l,u){we.call(s,u)?s[u].push(l):kn(s,u,[l])});function yS(s,l,u,d){s=ut(s)?s:hi(s),u=u&&!d?Q(u):0;var y=s.length;return u<0&&(u=De(y+u,0)),zo(s)?u<=y&&s.indexOf(l,u)>-1:!!y&&ei(s,l,u)>-1}var bS=ie(function(s,l,u){var d=-1,y=typeof l=="function",v=ut(s)?A(s.length):[];return Qn(s,function(x){v[++d]=y?vt(l,x,u):es(x,l,u)}),v}),wS=Eo(function(s,l,u){kn(s,u,l)});function Ro(s,l){var u=Z(s)?Ee:Cd;return u(s,J(l,3))}function vS(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=Eo(function(s,l,u){s[u?0:1].push(l)},function(){return[[],[]]});function xS(s,l,u){var d=Z(s)?ec:ed,y=arguments.length<3;return d(s,J(l,4),u,y,Qn)}function kS(s,l,u){var d=Z(s)?P2:ed,y=arguments.length<3;return d(s,J(l,4),u,y,wd)}function ES(s,l){var u=Z(s)?jn:vd;return u(s,Do(J(l,3)))}function _S(s){var l=Z(s)?md:yw;return l(s)}function CS(s,l,u){(u?nt(s,l,u):l===t)?l=1:l=Q(l);var d=Z(s)?qb:bw;return d(s,l)}function TS(s){var l=Z(s)?jb:vw;return l(s)}function MS(s){if(s==null)return 0;if(ut(s))return zo(s)?ni(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)?tc:Sw;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),[])}),Lo=ub||function(){return qe.Date.now()};function NS(s,l){if(typeof l!="function")throw new Lt(a);return s=Q(s),function(){if(--s<1)return l.apply(this,arguments)}}function Ep(s,l,u){return l=u?t:l,l=s&&l==null?s.length:l,En(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 Uc=ie(function(s,l,u){var d=T;if(u.length){var y=Xn(u,ui(Uc));d|=U}return En(s,d,l,u,y)}),Cp=ie(function(s,l,u){var d=T|M;if(u.length){var y=Xn(u,ui(Cp));d|=U}return En(l,d,s,u,y)});function Tp(s,l,u){l=u?t:l;var d=En(s,F,t,t,t,t,t,l);return d.placeholder=Tp.placeholder,d}function Mp(s,l,u){l=u?t:l;var d=En(s,$,t,t,t,t,t,l);return d.placeholder=Mp.placeholder,d}function Ap(s,l,u){var d,y,v,x,E,C,N=0,O=!1,R=!1,H=!0;if(typeof s!="function")throw new Lt(a);l=Ft(l)||0,Te(u)&&(O=!!u.leading,R="maxWait"in u,v=R?De(Ft(u.maxWait)||0,l):v,H="trailing"in u?!!u.trailing:H);function G(Oe){var Zt=d,An=y;return d=y=t,N=Oe,x=s.apply(An,Zt),x}function q(Oe){return N=Oe,E=ss(se,l),O?G(Oe):x}function ee(Oe){var Zt=Oe-C,An=Oe-N,qp=l-Zt;return R?Qe(qp,v-An):qp}function j(Oe){var Zt=Oe-C,An=Oe-N;return C===t||Zt>=l||Zt<0||R&&An>=v}function se(){var Oe=Lo();if(j(Oe))return fe(Oe);E=ss(se,ee(Oe))}function fe(Oe){return E=t,H&&d?G(Oe):(d=y=t,x)}function Et(){E!==t&&Fd(E),N=0,d=C=y=E=t}function rt(){return E===t?x:fe(Lo())}function _t(){var Oe=Lo(),Zt=j(Oe);if(d=arguments,y=this,C=Oe,Zt){if(E===t)return q(C);if(R)return Fd(E),E=ss(se,l),G(C)}return E===t&&(E=ss(se,l)),x}return _t.cancel=Et,_t.flush=rt,_t}var OS=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 En(s,yt)}function Po(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],v=u.cache;if(v.has(y))return v.get(y);var x=s.apply(this,d);return u.cache=v.set(y,x)||v,x};return u.cache=new(Po.Cache||xn),u}Po.Cache=xn;function Do(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=xw(function(s,l){l=l.length==1&&Z(l[0])?Ee(l[0],St(J())):Ee(je(l,1),St(J()));var u=l.length;return ie(function(d){for(var y=-1,v=Qe(d.length,u);++y<v;)d[y]=l[y].call(this,d[y]);return vt(s,this,d)})}),Vc=ie(function(s,l){var u=Xn(l,ui(Vc));return En(s,U,t,l,u)}),Ip=ie(function(s,l){var u=Xn(l,ui(Ip));return En(s,ue,t,l,u)}),BS=_n(function(s,l){return En(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=nr(u,0,l);return d&&Yn(y,d),vt(s,this,y)})}function HS(s,l,u){var d=!0,y=!0;if(typeof s!="function")throw new Lt(a);return Te(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 Ep(s,1)}function WS(s,l){return Vc(Mc(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=Mo(gc),YS=Mo(function(s,l){return s>=l}),Rr=kd(function(){return arguments}())?kd:function(s){return Me(s)&&we.call(s,"callee")&&!cd.call(s,"callee")},Z=A.isArray,XS=Vh?St(Vh):sw;function ut(s){return s!=null&&Bo(s.length)&&!Tn(s)}function Ne(s){return Me(s)&&ut(s)}function ZS(s){return s===!0||s===!1||Me(s)&&tt(s)==Fi}var rr=hb||tu,QS=Kh?St(Kh):ow;function e5(s){return Me(s)&&s.nodeType===1&&!ls(s)}function t5(s){if(s==null)return!0;if(ut(s)&&(Z(s)||typeof s=="string"||typeof s.splice=="function"||rr(s)||fi(s)||Rr(s)))return!s.length;var l=et(s);if(l==Jt||l==qt)return!s.size;if(is(s))return!wc(s).length;for(var u in s)if(we.call(s,u))return!1;return!0}function n5(s,l){return ts(s,l)}function r5(s,l,u){u=typeof u=="function"?u:t;var d=u?u(s,l):t;return d===t?ts(s,l,t,u):!!d}function Kc(s){if(!Me(s))return!1;var l=tt(s);return l==qs||l==Cy||typeof s.message=="string"&&typeof s.name=="string"&&!ls(s)}function i5(s){return typeof s=="number"&&fd(s)}function Tn(s){if(!Te(s))return!1;var l=tt(s);return l==js||l==bh||l==_y||l==My}function Np(s){return typeof s=="number"&&s==Q(s)}function Bo(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=qn}function Te(s){var l=typeof s;return s!=null&&(l=="object"||l=="function")}function Me(s){return s!=null&&typeof s=="object"}var Op=Gh?St(Gh):aw;function s5(s,l){return s===l||bc(s,l,Pc(l))}function o5(s,l,u){return u=typeof u=="function"?u:t,bc(s,l,Pc(l),u)}function l5(s){return Rp(s)&&s!=+s}function a5(s){if(Kw(s))throw new X(o);return Ed(s)}function c5(s){return s===null}function u5(s){return s==null}function Rp(s){return typeof s=="number"||Me(s)&&tt(s)==$i}function ls(s){if(!Me(s)||tt(s)!=vn)return!1;var l=co(s);if(l===null)return!0;var u=we.call(l,"constructor")&&l.constructor;return typeof u=="function"&&u instanceof u&&so.call(u)==ob}var Gc=Jh?St(Jh):cw;function f5(s){return Np(s)&&s>=-9007199254740991&&s<=qn}var Lp=qh?St(qh):uw;function zo(s){return typeof s=="string"||!Z(s)&&Me(s)&&tt(s)==Ui}function kt(s){return typeof s=="symbol"||Me(s)&&tt(s)==Ys}var fi=jh?St(jh):fw;function h5(s){return s===t}function d5(s){return Me(s)&&et(s)==Vi}function p5(s){return Me(s)&&tt(s)==Iy}var m5=Mo(vc),g5=Mo(function(s,l){return s<=l});function Pp(s){if(!s)return[];if(ut(s))return zo(s)?jt(s):ct(s);if(Ji&&s[Ji])return q2(s[Ji]());var l=et(s),u=l==Jt?lc:l==qt?no:hi;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*Gs}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?Ar(Q(s),0,wt):0}function Ft(s){if(typeof s=="number")return s;if(kt(s))return ln;if(Te(s)){var l=typeof s.valueOf=="function"?s.valueOf():s;s=Te(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)?N2(s.slice(2),u?2:8):Yy.test(s)?ln:+s}function Bp(s){return cn(s,ft(s))}function y5(s){return s?Ar(Q(s),-9007199254740991,qn):s===0?s:0}function ge(s){return s==null?"":xt(s)}var b5=ai(function(s,l){if(is(l)||ut(l)){cn(l,He(l),s);return}for(var u in l)we.call(l,u)&&Zi(s,u,l[u])}),zp=ai(function(s,l){cn(l,ft(l),s)}),Fo=ai(function(s,l,u,d){cn(l,ft(l),s,d)}),w5=ai(function(s,l,u,d){cn(l,He(l),s,d)}),v5=_n(dc);function S5(s,l){var u=li(s);return l==null?u:gd(u,l)}var x5=ie(function(s,l){s=ve(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 v=l[u],x=ft(v),E=-1,C=x.length;++E<C;){var N=x[E],O=s[N];(O===t||Xt(O,ii[N])&&!we.call(s,N))&&(s[N]=v[N])}return s}),k5=ie(function(s){return s.push(t,tp),vt(Fp,t,s)});function E5(s,l){return Xh(s,J(l,3),an)}function _5(s,l){return Xh(s,J(l,3),mc)}function C5(s,l){return s==null?s:pc(s,J(l,3),ft)}function T5(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&&mc(s,J(l,3))}function I5(s){return s==null?[]:vo(s,He(s))}function N5(s){return s==null?[]:vo(s,ft(s))}function Jc(s,l,u){var d=s==null?t:Ir(s,l);return d===t?u:d}function O5(s,l){return s!=null&&ip(s,l,tw)}function qc(s,l){return s!=null&&ip(s,l,nw)}var R5=Yd(function(s,l,u){l!=null&&typeof l.toString!="function"&&(l=oo.call(l)),s[l]=u},Yc(ht)),L5=Yd(function(s,l,u){l!=null&&typeof l.toString!="function"&&(l=oo.call(l)),we.call(s,l)?s[l].push(u):s[l]=[u]},J),P5=ie(es);function He(s){return ut(s)?pd(s):wc(s)}function ft(s){return ut(s)?pd(s,!0):hw(s)}function D5(s,l){var u={};return l=J(l,3),an(s,function(d,y,v){kn(u,l(d,y,v),d)}),u}function B5(s,l){var u={};return l=J(l,3),an(s,function(d,y,v){kn(u,y,l(d,y,v))}),u}var z5=ai(function(s,l,u){So(s,l,u)}),Fp=ai(function(s,l,u,d){So(s,l,u,d)}),F5=_n(function(s,l){var u={};if(s==null)return u;var d=!1;l=Ee(l,function(v){return v=tr(v,s),d||(d=v.length>1),v}),cn(s,Rc(s),u),d&&(u=Dt(u,p|g|b,Rw));for(var y=l.length;y--;)_c(u,l[y]);return u});function H5(s,l){return Hp(s,Do(J(l)))}var $5=_n(function(s,l){return s==null?{}:pw(s,l)});function Hp(s,l){if(s==null)return{};var u=Ee(Rc(s),function(d){return[d]});return l=J(l),Nd(s,u,function(d,y){return l(d,y[0])})}function W5(s,l,u){l=tr(l,s);var d=-1,y=l.length;for(y||(y=1,s=t);++d<y;){var v=s==null?t:s[un(l[d])];v===t&&(d=y,v=u),s=Tn(v)?v.call(s):v}return s}function U5(s,l,u){return s==null?s:ns(s,l,u)}function V5(s,l,u,d){return d=typeof d=="function"?d:t,s==null?s:ns(s,l,u,d)}var $p=Qd(He),Wp=Qd(ft);function K5(s,l,u){var d=Z(s),y=d||rr(s)||fi(s);if(l=J(l,4),u==null){var v=s&&s.constructor;y?u=d?new v:[]:Te(s)?u=Tn(v)?li(co(s)):{}:u={}}return(y?Rt:an)(s,function(x,E,C){return l(u,x,E,C)}),u}function G5(s,l){return s==null?!0:_c(s,l)}function J5(s,l,u){return s==null?s:Dd(s,l,Mc(u))}function q5(s,l,u,d){return d=typeof d=="function"?d:t,s==null?s:Dd(s,l,Mc(u),d)}function hi(s){return s==null?[]:oc(s,He(s))}function j5(s){return s==null?[]:oc(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),Ar(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),rw(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 xc(s,l)}var Q5=ci(function(s,l,u){return l=l.toLowerCase(),s+(u?Up(l):l)});function Up(s){return jc(ge(s).toLowerCase())}function Vp(s){return s=ge(s),s&&s.replace(t2,U2).replace(v2,"")}function ex(s,l,u){s=ge(s),l=xt(l);var d=s.length;u=u===t?d:Ar(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(Va,"\\$&"):s}var rx=ci(function(s,l,u){return s+(u?"-":"")+l.toLowerCase()}),ix=ci(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?ni(s):0;if(!l||d>=l)return s;var y=(l-d)/2;return To(po(y),u)+s+To(ho(y),u)}function lx(s,l,u){s=ge(s),l=Q(l);var d=l?ni(s):0;return l&&d<l?s+To(l-d,u):s}function ax(s,l,u){s=ge(s),l=Q(l);var d=l?ni(s):0;return l&&d<l?To(l-d,u)+s:s}function cx(s,l,u){return u||l==null?l=0:l&&(l=+l),gb(ge(s).replace(Ka,""),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=ci(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?wt:u>>>0,u?(s=ge(s),s&&(typeof l=="string"||l!=null&&!Gc(l))&&(l=xt(l),!l&&ti(s))?nr(jt(s),0,u):s.split(l,u)):[]}var px=ci(function(s,l,u){return s+(u?" ":"")+jc(l)});function mx(s,l,u){return s=ge(s),u=u==null?0:Ar(Q(u),0,s.length),l=xt(l),s.slice(u,u+l.length)==l}function gx(s,l,u){var d=w.templateSettings;u&&nt(s,l,u)&&(l=t),s=ge(s),l=Fo({},l,d,ep);var y=Fo({},l.imports,d.imports,ep),v=He(y),x=oc(y,v),E,C,N=0,O=l.interpolate||Xs,R="__p += '",H=ac((l.escape||Xs).source+"|"+O.source+"|"+(O===xh?jy:Xs).source+"|"+(l.evaluate||Xs).source+"|$","g"),G="//# sourceURL="+(we.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++_2+"]")+`
23
- `;s.replace(H,function(j,se,fe,Et,rt,_t){return fe||(fe=Et),R+=s.slice(N,_t).replace(n2,K2),se&&(E=!0,R+=`' +
26
+ `)}function US(s){return Z(s)||Br(s)||!!(Jh&&s&&s[Jh])}function An(s,l){var u=typeof s;return l=l??Zn,!!l&&(u=="number"||u!="symbol"&&n2.test(s))&&s>-1&&s%1==0&&s<l}function nt(s,l,u){if(!Te(u))return!1;var p=typeof l;return(p=="number"?ft(u)&&An(l,u.length):p=="string"&&l in u)?Qt(u[l],s):!1}function ou(s,l){if(Z(s))return!1;var u=typeof s;return u=="number"||u=="symbol"||u=="boolean"||s==null||Et(s)?!0:Hb.test(s)||!$b.test(s)||l!=null&&s in Se(l)}function KS(s){var l=typeof s;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?s!=="__proto__":s===null}function lu(s){var l=Uo(s),u=w[l];if(typeof u!="function"||!(l in oe.prototype))return!1;if(s===u)return!0;var p=ru(u);return!!p&&s===p[0]}function JS(s){return!!Wh&&Wh in s}var GS=So?In:Eu;function ws(s){var l=s&&s.constructor,u=typeof l=="function"&&l.prototype||pi;return s===u}function Wp(s){return s===s&&!Te(s)}function Vp(s,l){return function(u){return u==null?!1:u[s]===l&&(l!==t||s in Se(u))}}function qS(s){var l=Yo(s,function(p){return u.size===d&&u.clear(),p}),u=l.cache;return l}function jS(s,l){var u=s[1],p=l[1],y=u|p,S=y<(T|M|de),_=p==de&&u==B||p==de&&u==be&&s[7].length<=l[8]||p==(de|be)&&l[7].length<=l[8]&&u==B;if(!(S||_))return s;p&T&&(s[2]=l[2],y|=u&T?0:L);var E=l[3];if(E){var C=s[3];s[3]=C?kp(C,E,l[4]):E,s[4]=C?tr(s[3],m):l[4]}return E=l[5],E&&(C=s[5],s[5]=C?Cp(C,E,l[6]):E,s[6]=C?tr(s[5],m):l[6]),E=l[7],E&&(s[7]=E),p&de&&(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 YS(s){var l=[];if(s!=null)for(var u in Se(s))l.push(u);return l}function XS(s){return _o.call(s)}function Up(s,l,u){return l=De(l===t?s.length-1:l,0),function(){for(var p=arguments,y=-1,S=De(p.length-l,0),_=A(S);++y<S;)_[y]=p[l+y];y=-1;for(var E=A(l+1);++y<l;)E[y]=p[y];return E[l]=u(_),vt(s,this,E)}}function Kp(s,l){return l.length<2?s:Dr(s,zt(l,0,-1))}function ZS(s,l){for(var u=s.length,p=Qe(l.length,u),y=ut(s);p--;){var S=l[p];s[p]=An(S,u)?y[S]:t}return s}function au(s,l){if(!(l==="constructor"&&typeof s[l]=="function")&&l!="__proto__")return s[l]}var Jp=qp(mp),Ss=hw||function(s,l){return qe.setTimeout(s,l)},cu=qp(vS);function Gp(s,l,u){var p=l+"";return cu(s,VS(p,QS($S(p),u)))}function qp(s){var l=0,u=0;return function(){var p=yw(),y=li-(p-u);if(u=p,y>0){if(++l>=Xn)return arguments[0]}else l=0;return s.apply(t,arguments)}}function Jo(s,l){var u=-1,p=s.length,y=p-1;for(l=l===t?p:l;++u<l;){var S=Kc(u,y),_=s[S];s[S]=s[u],s[u]=_}return s.length=l,s}var jp=qS(function(s){var l=[];return s.charCodeAt(0)===46&&l.push(""),s.replace(Wb,function(u,p,y,S){l.push(y?S.replace(Yb,"$1"):p||u)}),l});function dn(s){if(typeof s=="string"||Et(s))return s;var l=s+"";return l=="0"&&1/s==-1/0?"-0":l}function zr(s){if(s!=null){try{return vo.call(s)}catch{}try{return s+""}catch{}}return""}function QS(s,l){return Lt(rc,function(u){var p="_."+u[0];l&u[1]&&!go(s,p)&&s.push(p)}),s.sort()}function Yp(s){if(s instanceof oe)return s.clone();var l=new Dt(s.__wrapped__,s.__chain__);return l.__actions__=ut(s.__actions__),l.__index__=s.__index__,l.__values__=s.__values__,l}function ev(s,l,u){(u?nt(s,l,u):l===t)?l=1:l=De(Q(l),0);var p=s==null?0:s.length;if(!p||l<1)return[];for(var y=0,S=0,_=A(Mo(p/l));y<p;)_[S++]=zt(s,y,y+=l);return _}function tv(s){for(var l=-1,u=s==null?0:s.length,p=0,y=[];++l<u;){var S=s[l];S&&(y[p++]=S)}return y}function nv(){var s=arguments.length;if(!s)return[];for(var l=A(s-1),u=arguments[0],p=s;p--;)l[p-1]=arguments[p];return er(Z(u)?ut(u):[u],je(l,1))}var rv=ie(function(s,l){return Ne(s)?ps(s,je(l,1,Ne,!0)):[]}),iv=ie(function(s,l){var u=Bt(l);return Ne(u)&&(u=t),Ne(s)?ps(s,je(l,1,Ne,!0),G(u,2)):[]}),sv=ie(function(s,l){var u=Bt(l);return Ne(u)&&(u=t),Ne(s)?ps(s,je(l,1,Ne,!0),t,u):[]});function ov(s,l,u){var p=s==null?0:s.length;return p?(l=u||l===t?1:Q(l),zt(s,l<0?0:l,p)):[]}function lv(s,l,u){var p=s==null?0:s.length;return p?(l=u||l===t?1:Q(l),l=p-l,zt(s,0,l<0?0:l)):[]}function av(s,l){return s&&s.length?zo(s,G(l,3),!0,!0):[]}function cv(s,l){return s&&s.length?zo(s,G(l,3),!0):[]}function uv(s,l,u,p){var y=s==null?0:s.length;return y?(u&&typeof u!="number"&&nt(s,l,u)&&(u=0,p=y),nS(s,l,u,p)):[]}function Xp(s,l,u){var p=s==null?0:s.length;if(!p)return-1;var y=u==null?0:Q(u);return y<0&&(y=De(p+y,0)),yo(s,G(l,3),y)}function Zp(s,l,u){var p=s==null?0:s.length;if(!p)return-1;var y=p-1;return u!==t&&(y=Q(u),y=u<0?De(p+y,0):Qe(y,p-1)),yo(s,G(l,3),y,!0)}function Qp(s){var l=s==null?0:s.length;return l?je(s,1):[]}function fv(s){var l=s==null?0:s.length;return l?je(s,wt):[]}function dv(s,l){var u=s==null?0:s.length;return u?(l=l===t?1:Q(l),je(s,l)):[]}function hv(s){for(var l=-1,u=s==null?0:s.length,p={};++l<u;){var y=s[l];p[y[0]]=y[1]}return p}function em(s){return s&&s.length?s[0]:t}function pv(s,l,u){var p=s==null?0:s.length;if(!p)return-1;var y=u==null?0:Q(u);return y<0&&(y=De(p+y,0)),ui(s,l,y)}function mv(s){var l=s==null?0:s.length;return l?zt(s,0,-1):[]}var gv=ie(function(s){var l=Ee(s,Yc);return l.length&&l[0]===s[0]?$c(l):[]}),yv=ie(function(s){var l=Bt(s),u=Ee(s,Yc);return l===Bt(u)?l=t:u.pop(),u.length&&u[0]===s[0]?$c(u,G(l,2)):[]}),bv=ie(function(s){var l=Bt(s),u=Ee(s,Yc);return l=typeof l=="function"?l:t,l&&u.pop(),u.length&&u[0]===s[0]?$c(u,t,l):[]});function wv(s,l){return s==null?"":mw.call(s,l)}function Bt(s){var l=s==null?0:s.length;return l?s[l-1]:t}function Sv(s,l,u){var p=s==null?0:s.length;if(!p)return-1;var y=p;return u!==t&&(y=Q(u),y=y<0?De(p+y,0):Qe(y,p-1)),l===l?Q2(s,l,y):yo(s,Lh,y,!0)}function vv(s,l){return s&&s.length?fp(s,Q(l)):t}var _v=ie(tm);function tm(s,l){return s&&s.length&&l&&l.length?Uc(s,l):s}function xv(s,l,u){return s&&s.length&&l&&l.length?Uc(s,l,G(u,2)):s}function Ev(s,l,u){return s&&s.length&&l&&l.length?Uc(s,l,t,u):s}var kv=Mn(function(s,l){var u=s==null?0:s.length,p=Dc(s,l);return pp(s,Ee(l,function(y){return An(y,u)?+y:y}).sort(Ep)),p});function Cv(s,l){var u=[];if(!(s&&s.length))return u;var p=-1,y=[],S=s.length;for(l=G(l,3);++p<S;){var _=s[p];l(_,p,s)&&(u.push(_),y.push(p))}return pp(s,y),u}function uu(s){return s==null?s:ww.call(s)}function Tv(s,l,u){var p=s==null?0:s.length;return p?(u&&typeof u!="number"&&nt(s,l,u)?(l=0,u=p):(l=l==null?0:Q(l),u=u===t?p:Q(u)),zt(s,l,u)):[]}function Mv(s,l){return Fo(s,l)}function Av(s,l,u){return Gc(s,l,G(u,2))}function Iv(s,l){var u=s==null?0:s.length;if(u){var p=Fo(s,l);if(p<u&&Qt(s[p],l))return p}return-1}function Nv(s,l){return Fo(s,l,!0)}function Ov(s,l,u){return Gc(s,l,G(u,2),!0)}function Rv(s,l){var u=s==null?0:s.length;if(u){var p=Fo(s,l,!0)-1;if(Qt(s[p],l))return p}return-1}function Lv(s){return s&&s.length?gp(s):[]}function Pv(s,l){return s&&s.length?gp(s,G(l,2)):[]}function Dv(s){var l=s==null?0:s.length;return l?zt(s,1,l):[]}function Fv(s,l,u){return s&&s.length?(l=u||l===t?1:Q(l),zt(s,0,l<0?0:l)):[]}function zv(s,l,u){var p=s==null?0:s.length;return p?(l=u||l===t?1:Q(l),l=p-l,zt(s,l<0?0:l,p)):[]}function Bv(s,l){return s&&s.length?zo(s,G(l,3),!1,!0):[]}function $v(s,l){return s&&s.length?zo(s,G(l,3)):[]}var Hv=ie(function(s){return ir(je(s,1,Ne,!0))}),Wv=ie(function(s){var l=Bt(s);return Ne(l)&&(l=t),ir(je(s,1,Ne,!0),G(l,2))}),Vv=ie(function(s){var l=Bt(s);return l=typeof l=="function"?l:t,ir(je(s,1,Ne,!0),t,l)});function Uv(s){return s&&s.length?ir(s):[]}function Kv(s,l){return s&&s.length?ir(s,G(l,2)):[]}function Jv(s,l){return l=typeof l=="function"?l:t,s&&s.length?ir(s,t,l):[]}function fu(s){if(!(s&&s.length))return[];var l=0;return s=Qn(s,function(u){if(Ne(u))return l=De(u.length,l),!0}),Mc(l,function(u){return Ee(s,kc(u))})}function nm(s,l){if(!(s&&s.length))return[];var u=fu(s);return l==null?u:Ee(u,function(p){return vt(l,t,p)})}var Gv=ie(function(s,l){return Ne(s)?ps(s,l):[]}),qv=ie(function(s){return jc(Qn(s,Ne))}),jv=ie(function(s){var l=Bt(s);return Ne(l)&&(l=t),jc(Qn(s,Ne),G(l,2))}),Yv=ie(function(s){var l=Bt(s);return l=typeof l=="function"?l:t,jc(Qn(s,Ne),t,l)}),Xv=ie(fu);function Zv(s,l){return Sp(s||[],l||[],hs)}function Qv(s,l){return Sp(s||[],l||[],ys)}var e_=ie(function(s){var l=s.length,u=l>1?s[l-1]:t;return u=typeof u=="function"?(s.pop(),u):t,nm(s,u)});function rm(s){var l=w(s);return l.__chain__=!0,l}function t_(s,l){return l(s),s}function Go(s,l){return l(s)}var n_=Mn(function(s){var l=s.length,u=l?s[0]:0,p=this.__wrapped__,y=function(S){return Dc(S,s)};return l>1||this.__actions__.length||!(p instanceof oe)||!An(u)?this.thru(y):(p=p.slice(u,+u+(l?1:0)),p.__actions__.push({func:Go,args:[y],thisArg:t}),new Dt(p,this.__chain__).thru(function(S){return l&&!S.length&&S.push(t),S}))});function r_(){return rm(this)}function i_(){return new Dt(this.value(),this.__chain__)}function s_(){this.__values__===t&&(this.__values__=ym(this.value()));var s=this.__index__>=this.__values__.length,l=s?t:this.__values__[this.__index__++];return{done:s,value:l}}function o_(){return this}function l_(s){for(var l,u=this;u instanceof Oo;){var p=Yp(u);p.__index__=0,p.__values__=t,l?y.__wrapped__=p:l=p;var y=p;u=u.__wrapped__}return y.__wrapped__=s,l}function a_(){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:Go,args:[uu],thisArg:t}),new Dt(l,this.__chain__)}return this.thru(uu)}function c_(){return wp(this.__wrapped__,this.__actions__)}var u_=Bo(function(s,l,u){we.call(s,u)?++s[u]:Cn(s,u,1)});function f_(s,l,u){var p=Z(s)?Oh:tS;return u&&nt(s,l,u)&&(l=t),p(s,G(l,3))}function d_(s,l){var u=Z(s)?Qn:np;return u(s,G(l,3))}var h_=Ip(Xp),p_=Ip(Zp);function m_(s,l){return je(qo(s,l),1)}function g_(s,l){return je(qo(s,l),wt)}function y_(s,l,u){return u=u===t?1:Q(u),je(qo(s,l),u)}function im(s,l){var u=Z(s)?Lt:rr;return u(s,G(l,3))}function sm(s,l){var u=Z(s)?D2:tp;return u(s,G(l,3))}var b_=Bo(function(s,l,u){we.call(s,u)?s[u].push(l):Cn(s,u,[l])});function w_(s,l,u,p){s=ft(s)?s:_i(s),u=u&&!p?Q(u):0;var y=s.length;return u<0&&(u=De(y+u,0)),Qo(s)?u<=y&&s.indexOf(l,u)>-1:!!y&&ui(s,l,u)>-1}var S_=ie(function(s,l,u){var p=-1,y=typeof l=="function",S=ft(s)?A(s.length):[];return rr(s,function(_){S[++p]=y?vt(l,_,u):ms(_,l,u)}),S}),v_=Bo(function(s,l,u){Cn(s,u,l)});function qo(s,l){var u=Z(s)?Ee:ap;return u(s,G(l,3))}function __(s,l,u,p){return s==null?[]:(Z(l)||(l=l==null?[]:[l]),u=p?t:u,Z(u)||(u=u==null?[]:[u]),dp(s,l,u))}var x_=Bo(function(s,l,u){s[u?0:1].push(l)},function(){return[[],[]]});function E_(s,l,u){var p=Z(s)?xc:Dh,y=arguments.length<3;return p(s,G(l,4),u,y,rr)}function k_(s,l,u){var p=Z(s)?F2:Dh,y=arguments.length<3;return p(s,G(l,4),u,y,tp)}function C_(s,l){var u=Z(s)?Qn:np;return u(s,Xo(G(l,3)))}function T_(s){var l=Z(s)?Xh:wS;return l(s)}function M_(s,l,u){(u?nt(s,l,u):l===t)?l=1:l=Q(l);var p=Z(s)?Yw:SS;return p(s,l)}function A_(s){var l=Z(s)?Xw:_S;return l(s)}function I_(s){if(s==null)return 0;if(ft(s))return Qo(s)?di(s):s.length;var l=et(s);return l==jt||l==Yt?s.size:Wc(s).length}function N_(s,l,u){var p=Z(s)?Ec:xS;return u&&nt(s,l,u)&&(l=t),p(s,G(l,3))}var O_=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]]),dp(s,je(l,1),[])}),jo=dw||function(){return qe.Date.now()};function R_(s,l){if(typeof l!="function")throw new Pt(a);return s=Q(s),function(){if(--s<1)return l.apply(this,arguments)}}function om(s,l,u){return l=u?t:l,l=s&&l==null?s.length:l,Tn(s,de,t,t,t,t,l)}function lm(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 du=ie(function(s,l,u){var p=T;if(u.length){var y=tr(u,Si(du));p|=V}return Tn(s,p,l,u,y)}),am=ie(function(s,l,u){var p=T|M;if(u.length){var y=tr(u,Si(am));p|=V}return Tn(l,p,s,u,y)});function cm(s,l,u){l=u?t:l;var p=Tn(s,B,t,t,t,t,t,l);return p.placeholder=cm.placeholder,p}function um(s,l,u){l=u?t:l;var p=Tn(s,H,t,t,t,t,t,l);return p.placeholder=um.placeholder,p}function fm(s,l,u){var p,y,S,_,E,C,N=0,O=!1,R=!1,$=!0;if(typeof s!="function")throw new Pt(a);l=$t(l)||0,Te(u)&&(O=!!u.leading,R="maxWait"in u,S=R?De($t(u.maxWait)||0,l):S,$="trailing"in u?!!u.trailing:$);function J(Oe){var en=p,On=y;return p=y=t,N=Oe,_=s.apply(On,en),_}function q(Oe){return N=Oe,E=Ss(se,l),O?J(Oe):_}function ee(Oe){var en=Oe-C,On=Oe-N,Im=l-en;return R?Qe(Im,S-On):Im}function j(Oe){var en=Oe-C,On=Oe-N;return C===t||en>=l||en<0||R&&On>=S}function se(){var Oe=jo();if(j(Oe))return fe(Oe);E=Ss(se,ee(Oe))}function fe(Oe){return E=t,$&&p?J(Oe):(p=y=t,_)}function kt(){E!==t&&vp(E),N=0,p=C=y=E=t}function rt(){return E===t?_:fe(jo())}function Ct(){var Oe=jo(),en=j(Oe);if(p=arguments,y=this,C=Oe,en){if(E===t)return q(C);if(R)return vp(E),E=Ss(se,l),J(C)}return E===t&&(E=Ss(se,l)),_}return Ct.cancel=kt,Ct.flush=rt,Ct}var L_=ie(function(s,l){return ep(s,1,l)}),P_=ie(function(s,l,u){return ep(s,$t(l)||0,u)});function D_(s){return Tn(s,bt)}function Yo(s,l){if(typeof s!="function"||l!=null&&typeof l!="function")throw new Pt(a);var u=function(){var p=arguments,y=l?l.apply(this,p):p[0],S=u.cache;if(S.has(y))return S.get(y);var _=s.apply(this,p);return u.cache=S.set(y,_)||S,_};return u.cache=new(Yo.Cache||kn),u}Yo.Cache=kn;function Xo(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 F_(s){return lm(2,s)}var z_=ES(function(s,l){l=l.length==1&&Z(l[0])?Ee(l[0],_t(G())):Ee(je(l,1),_t(G()));var u=l.length;return ie(function(p){for(var y=-1,S=Qe(p.length,u);++y<S;)p[y]=l[y].call(this,p[y]);return vt(s,this,p)})}),hu=ie(function(s,l){var u=tr(l,Si(hu));return Tn(s,V,t,l,u)}),dm=ie(function(s,l){var u=tr(l,Si(dm));return Tn(s,ue,t,l,u)}),B_=Mn(function(s,l){return Tn(s,be,t,t,t,l)});function $_(s,l){if(typeof s!="function")throw new Pt(a);return l=l===t?l:Q(l),ie(s,l)}function H_(s,l){if(typeof s!="function")throw new Pt(a);return l=l==null?0:De(Q(l),0),ie(function(u){var p=u[l],y=or(u,0,l);return p&&er(y,p),vt(s,this,y)})}function W_(s,l,u){var p=!0,y=!0;if(typeof s!="function")throw new Pt(a);return Te(u)&&(p="leading"in u?!!u.leading:p,y="trailing"in u?!!u.trailing:y),fm(s,l,{leading:p,maxWait:l,trailing:y})}function V_(s){return om(s,1)}function U_(s,l){return hu(Xc(l),s)}function K_(){if(!arguments.length)return[];var s=arguments[0];return Z(s)?s:[s]}function J_(s){return Ft(s,b)}function G_(s,l){return l=typeof l=="function"?l:t,Ft(s,b,l)}function q_(s){return Ft(s,h|b)}function j_(s,l){return l=typeof l=="function"?l:t,Ft(s,h|b,l)}function Y_(s,l){return l==null||Qh(s,l,$e(l))}function Qt(s,l){return s===l||s!==s&&l!==l}var X_=Vo(Bc),Z_=Vo(function(s,l){return s>=l}),Br=sp(function(){return arguments}())?sp:function(s){return Me(s)&&we.call(s,"callee")&&!Kh.call(s,"callee")},Z=A.isArray,Q_=Ch?_t(Ch):lS;function ft(s){return s!=null&&Zo(s.length)&&!In(s)}function Ne(s){return Me(s)&&ft(s)}function e5(s){return s===!0||s===!1||Me(s)&&tt(s)==Qi}var lr=pw||Eu,t5=Th?_t(Th):aS;function n5(s){return Me(s)&&s.nodeType===1&&!vs(s)}function r5(s){if(s==null)return!0;if(ft(s)&&(Z(s)||typeof s=="string"||typeof s.splice=="function"||lr(s)||vi(s)||Br(s)))return!s.length;var l=et(s);if(l==jt||l==Yt)return!s.size;if(ws(s))return!Wc(s).length;for(var u in s)if(we.call(s,u))return!1;return!0}function i5(s,l){return gs(s,l)}function s5(s,l,u){u=typeof u=="function"?u:t;var p=u?u(s,l):t;return p===t?gs(s,l,t,u):!!p}function pu(s){if(!Me(s))return!1;var l=tt(s);return l==co||l==Mb||typeof s.message=="string"&&typeof s.name=="string"&&!vs(s)}function o5(s){return typeof s=="number"&&Gh(s)}function In(s){if(!Te(s))return!1;var l=tt(s);return l==uo||l==eh||l==Tb||l==Ib}function hm(s){return typeof s=="number"&&s==Q(s)}function Zo(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=Zn}function Te(s){var l=typeof s;return s!=null&&(l=="object"||l=="function")}function Me(s){return s!=null&&typeof s=="object"}var pm=Mh?_t(Mh):uS;function l5(s,l){return s===l||Hc(s,l,iu(l))}function a5(s,l,u){return u=typeof u=="function"?u:t,Hc(s,l,iu(l),u)}function c5(s){return mm(s)&&s!=+s}function u5(s){if(GS(s))throw new X(o);return op(s)}function f5(s){return s===null}function d5(s){return s==null}function mm(s){return typeof s=="number"||Me(s)&&tt(s)==ts}function vs(s){if(!Me(s)||tt(s)!=xn)return!1;var l=ko(s);if(l===null)return!0;var u=we.call(l,"constructor")&&l.constructor;return typeof u=="function"&&u instanceof u&&vo.call(u)==aw}var mu=Ah?_t(Ah):fS;function h5(s){return hm(s)&&s>=-9007199254740991&&s<=Zn}var gm=Ih?_t(Ih):dS;function Qo(s){return typeof s=="string"||!Z(s)&&Me(s)&&tt(s)==rs}function Et(s){return typeof s=="symbol"||Me(s)&&tt(s)==fo}var vi=Nh?_t(Nh):hS;function p5(s){return s===t}function m5(s){return Me(s)&&et(s)==is}function g5(s){return Me(s)&&tt(s)==Ob}var y5=Vo(Vc),b5=Vo(function(s,l){return s<=l});function ym(s){if(!s)return[];if(ft(s))return Qo(s)?Xt(s):ut(s);if(as&&s[as])return Y2(s[as]());var l=et(s),u=l==jt?Ic:l==Yt?bo:_i;return u(s)}function Nn(s){if(!s)return s===0?s:0;if(s=$t(s),s===wt||s===-1/0){var l=s<0?-1:1;return l*lo}return s===s?s:0}function Q(s){var l=Nn(s),u=l%1;return l===l?u?l-u:l:0}function bm(s){return s?Pr(Q(s),0,St):0}function $t(s){if(typeof s=="number")return s;if(Et(s))return cn;if(Te(s)){var l=typeof s.valueOf=="function"?s.valueOf():s;s=Te(l)?l+"":l}if(typeof s!="string")return s===0?s:+s;s=Fh(s);var u=Qb.test(s);return u||t2.test(s)?R2(s.slice(2),u?2:8):Zb.test(s)?cn:+s}function wm(s){return fn(s,dt(s))}function w5(s){return s?Pr(Q(s),-9007199254740991,Zn):s===0?s:0}function ge(s){return s==null?"":xt(s)}var S5=bi(function(s,l){if(ws(l)||ft(l)){fn(l,$e(l),s);return}for(var u in l)we.call(l,u)&&hs(s,u,l[u])}),Sm=bi(function(s,l){fn(l,dt(l),s)}),el=bi(function(s,l,u,p){fn(l,dt(l),s,p)}),v5=bi(function(s,l,u,p){fn(l,$e(l),s,p)}),_5=Mn(Dc);function x5(s,l){var u=yi(s);return l==null?u:Zh(u,l)}var E5=ie(function(s,l){s=Se(s);var u=-1,p=l.length,y=p>2?l[2]:t;for(y&&nt(l[0],l[1],y)&&(p=1);++u<p;)for(var S=l[u],_=dt(S),E=-1,C=_.length;++E<C;){var N=_[E],O=s[N];(O===t||Qt(O,pi[N])&&!we.call(s,N))&&(s[N]=S[N])}return s}),k5=ie(function(s){return s.push(t,Fp),vt(vm,t,s)});function C5(s,l){return Rh(s,G(l,3),un)}function T5(s,l){return Rh(s,G(l,3),zc)}function M5(s,l){return s==null?s:Fc(s,G(l,3),dt)}function A5(s,l){return s==null?s:rp(s,G(l,3),dt)}function I5(s,l){return s&&un(s,G(l,3))}function N5(s,l){return s&&zc(s,G(l,3))}function O5(s){return s==null?[]:Po(s,$e(s))}function R5(s){return s==null?[]:Po(s,dt(s))}function gu(s,l,u){var p=s==null?t:Dr(s,l);return p===t?u:p}function L5(s,l){return s!=null&&$p(s,l,rS)}function yu(s,l){return s!=null&&$p(s,l,iS)}var P5=Op(function(s,l,u){l!=null&&typeof l.toString!="function"&&(l=_o.call(l)),s[l]=u},wu(ht)),D5=Op(function(s,l,u){l!=null&&typeof l.toString!="function"&&(l=_o.call(l)),we.call(s,l)?s[l].push(u):s[l]=[u]},G),F5=ie(ms);function $e(s){return ft(s)?Yh(s):Wc(s)}function dt(s){return ft(s)?Yh(s,!0):pS(s)}function z5(s,l){var u={};return l=G(l,3),un(s,function(p,y,S){Cn(u,l(p,y,S),p)}),u}function B5(s,l){var u={};return l=G(l,3),un(s,function(p,y,S){Cn(u,y,l(p,y,S))}),u}var $5=bi(function(s,l,u){Do(s,l,u)}),vm=bi(function(s,l,u,p){Do(s,l,u,p)}),H5=Mn(function(s,l){var u={};if(s==null)return u;var p=!1;l=Ee(l,function(S){return S=sr(S,s),p||(p=S.length>1),S}),fn(s,nu(s),u),p&&(u=Ft(u,h|g|b,PS));for(var y=l.length;y--;)qc(u,l[y]);return u});function W5(s,l){return _m(s,Xo(G(l)))}var V5=Mn(function(s,l){return s==null?{}:gS(s,l)});function _m(s,l){if(s==null)return{};var u=Ee(nu(s),function(p){return[p]});return l=G(l),hp(s,u,function(p,y){return l(p,y[0])})}function U5(s,l,u){l=sr(l,s);var p=-1,y=l.length;for(y||(y=1,s=t);++p<y;){var S=s==null?t:s[dn(l[p])];S===t&&(p=y,S=u),s=In(S)?S.call(s):S}return s}function K5(s,l,u){return s==null?s:ys(s,l,u)}function J5(s,l,u,p){return p=typeof p=="function"?p:t,s==null?s:ys(s,l,u,p)}var xm=Pp($e),Em=Pp(dt);function G5(s,l,u){var p=Z(s),y=p||lr(s)||vi(s);if(l=G(l,4),u==null){var S=s&&s.constructor;y?u=p?new S:[]:Te(s)?u=In(S)?yi(ko(s)):{}:u={}}return(y?Lt:un)(s,function(_,E,C){return l(u,_,E,C)}),u}function q5(s,l){return s==null?!0:qc(s,l)}function j5(s,l,u){return s==null?s:bp(s,l,Xc(u))}function Y5(s,l,u,p){return p=typeof p=="function"?p:t,s==null?s:bp(s,l,Xc(u),p)}function _i(s){return s==null?[]:Ac(s,$e(s))}function X5(s){return s==null?[]:Ac(s,dt(s))}function Z5(s,l,u){return u===t&&(u=l,l=t),u!==t&&(u=$t(u),u=u===u?u:0),l!==t&&(l=$t(l),l=l===l?l:0),Pr($t(s),l,u)}function Q5(s,l,u){return l=Nn(l),u===t?(u=l,l=0):u=Nn(u),s=$t(s),sS(s,l,u)}function ex(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=Nn(s),l===t?(l=s,s=0):l=Nn(l)),s>l){var p=s;s=l,l=p}if(u||s%1||l%1){var y=qh();return Qe(s+y*(l-s+O2("1e-"+((y+"").length-1))),l)}return Kc(s,l)}var tx=wi(function(s,l,u){return l=l.toLowerCase(),s+(u?km(l):l)});function km(s){return bu(ge(s).toLowerCase())}function Cm(s){return s=ge(s),s&&s.replace(r2,K2).replace(_2,"")}function nx(s,l,u){s=ge(s),l=xt(l);var p=s.length;u=u===t?p:Pr(Q(u),0,p);var y=u;return u-=l.length,u>=0&&s.slice(u,y)==l}function rx(s){return s=ge(s),s&&Fb.test(s)?s.replace(rh,J2):s}function ix(s){return s=ge(s),s&&Vb.test(s)?s.replace(hc,"\\$&"):s}var sx=wi(function(s,l,u){return s+(u?"-":"")+l.toLowerCase()}),ox=wi(function(s,l,u){return s+(u?" ":"")+l.toLowerCase()}),lx=Ap("toLowerCase");function ax(s,l,u){s=ge(s),l=Q(l);var p=l?di(s):0;if(!l||p>=l)return s;var y=(l-p)/2;return Wo(Ao(y),u)+s+Wo(Mo(y),u)}function cx(s,l,u){s=ge(s),l=Q(l);var p=l?di(s):0;return l&&p<l?s+Wo(l-p,u):s}function ux(s,l,u){s=ge(s),l=Q(l);var p=l?di(s):0;return l&&p<l?Wo(l-p,u)+s:s}function fx(s,l,u){return u||l==null?l=0:l&&(l=+l),bw(ge(s).replace(pc,""),l||0)}function dx(s,l,u){return(u?nt(s,l,u):l===t)?l=1:l=Q(l),Jc(ge(s),l)}function hx(){var s=arguments,l=ge(s[0]);return s.length<3?l:l.replace(s[1],s[2])}var px=wi(function(s,l,u){return s+(u?"_":"")+l.toLowerCase()});function mx(s,l,u){return u&&typeof u!="number"&&nt(s,l,u)&&(l=u=t),u=u===t?St:u>>>0,u?(s=ge(s),s&&(typeof l=="string"||l!=null&&!mu(l))&&(l=xt(l),!l&&fi(s))?or(Xt(s),0,u):s.split(l,u)):[]}var gx=wi(function(s,l,u){return s+(u?" ":"")+bu(l)});function yx(s,l,u){return s=ge(s),u=u==null?0:Pr(Q(u),0,s.length),l=xt(l),s.slice(u,u+l.length)==l}function bx(s,l,u){var p=w.templateSettings;u&&nt(s,l,u)&&(l=t),s=ge(s),l=el({},l,p,Dp);var y=el({},l.imports,p.imports,Dp),S=$e(y),_=Ac(y,S),E,C,N=0,O=l.interpolate||ho,R="__p += '",$=Nc((l.escape||ho).source+"|"+O.source+"|"+(O===ih?Xb:ho).source+"|"+(l.evaluate||ho).source+"|$","g"),J="//# sourceURL="+(we.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++T2+"]")+`
27
+ `;s.replace($,function(j,se,fe,kt,rt,Ct){return fe||(fe=kt),R+=s.slice(N,Ct).replace(i2,G2),se&&(E=!0,R+=`' +
24
28
  __e(`+se+`) +
25
29
  '`),rt&&(C=!0,R+=`';
26
30
  `+rt+`;
27
31
  __p += '`),fe&&(R+=`' +
28
32
  ((__t = (`+fe+`)) == null ? '' : __t) +
29
- '`),N=_t+j.length,j}),R+=`';
33
+ '`),N=Ct+j.length,j}),R+=`';
30
34
  `;var q=we.call(l,"variable")&&l.variable;if(!q)R=`with (obj) {
31
35
  `+R+`
32
36
  }
33
- `;else if(Jy.test(q))throw new X(c);R=(C?R.replace(Ny,""):R).replace(Oy,"$1").replace(Ry,"$1;"),R="function("+(q||"obj")+`) {
37
+ `;else if(jb.test(q))throw new X(c);R=(C?R.replace(Rb,""):R).replace(Lb,"$1").replace(Pb,"$1;"),R="function("+(q||"obj")+`) {
34
38
  `+(q?"":`obj || (obj = {});
35
39
  `)+"var __t, __p = ''"+(E?", __e = _.escape":"")+(C?`, __j = Array.prototype.join;
36
40
  function print() { __p += __j.call(arguments, '') }
37
41
  `:`;
38
42
  `)+R+`return __p
39
- }`;var ee=Gp(function(){return me(v,G+"return "+R).apply(t,x)});if(ee.source=R,Kc(ee))throw ee;return ee}function yx(s){return ge(s).toLowerCase()}function bx(s){return ge(s).toUpperCase()}function wx(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),v=nd(d,y),x=rd(d,y)+1;return nr(d,v,x).join("")}function vx(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 nr(d,0,y).join("")}function Sx(s,l,u){if(s=ge(s),s&&(u||l===t))return s.replace(Ka,"");if(!s||!(l=xt(l)))return s;var d=jt(s),y=nd(d,jt(l));return nr(d,y).join("")}function xx(s,l){var u=Gn,d=sn;if(Te(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 v=s.length;if(ti(s)){var x=jt(s);v=x.length}if(u>=v)return s;var E=u-ni(d);if(E<1)return d;var C=x?nr(x,0,E).join(""):s.slice(0,E);if(y===t)return C+d;if(x&&(E+=C.length-E),Gc(y)){if(s.slice(E).search(y)){var N,O=C;for(y.global||(y=ac(y.source,ge(kh.exec(y))+"g")),y.lastIndex=0;N=y.exec(O);)var R=N.index;C=C.slice(0,R===t?E:R)}}else if(s.indexOf(xt(y),E)!=E){var H=C.lastIndexOf(y);H>-1&&(C=C.slice(0,H))}return C+d}function kx(s){return s=ge(s),s&&Ly.test(s)?s.replace(vh,Z2):s}var Ex=ci(function(s,l,u){return s+(u?" ":"")+l.toUpperCase()}),jc=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 vt(s,t,l)}catch(u){return Kc(u)?u:new X(u)}}),_x=_n(function(s,l){return Rt(l,function(u){u=un(u),kn(s,u,Uc(s[u],s))}),s});function Cx(s){var l=s==null?0:s.length,u=J();return s=l?Ee(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 v=s[y];if(vt(v[0],this,d))return vt(v[1],this,d)}})}function Tx(s){return Zb(Dt(s,p))}function Yc(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 Xc(s){return _d(typeof s=="function"?s:Dt(s,p))}function Nx(s){return Td(Dt(s,p))}function Ox(s,l){return Md(s,Dt(l,p))}var Rx=ie(function(s,l){return function(u){return es(u,s,l)}}),Lx=ie(function(s,l){return function(u){return es(s,u,l)}});function Zc(s,l,u){var d=He(l),y=vo(l,d);u==null&&!(Te(l)&&(y.length||!d.length))&&(u=l,l=s,s=this,y=vo(l,He(l)));var v=!(Te(u)&&"chain"in u)||!!u.chain,x=Tn(s);return Rt(y,function(E){var C=l[E];s[E]=C,x&&(s.prototype[E]=function(){var N=this.__chain__;if(v||N){var O=s(this.__wrapped__),R=O.__actions__=ct(this.__actions__);return R.push({func:C,args:arguments,thisArg:s}),O.__chain__=N,O}return C.apply(s,Yn([this.value()],arguments))})}),s}function Px(){return qe._===this&&(qe._=lb),this}function Qc(){}function Dx(s){return s=Q(s),ie(function(l){return Ad(l,s)})}var Bx=Ic(Ee),zx=Ic(Yh),Fx=Ic(tc);function Jp(s){return Bc(s)?nc(un(s)):mw(s)}function Hx(s){return function(l){return s==null?t:Ir(s,l)}}var $x=Xd(),Wx=Xd(!0);function eu(){return[]}function tu(){return!1}function Ux(){return{}}function Vx(){return""}function Kx(){return!0}function Gx(s,l){if(s=Q(s),s<1||s>qn)return[];var u=wt,d=Qe(s,wt);l=J(l),s-=wt;for(var y=sc(d,l);++u<s;)l(u);return y}function Jx(s){return Z(s)?Ee(s,un):kt(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,gc):t}function ek(s,l){return s&&s.length?wo(s,J(l,2),gc):t}function tk(s){return Qh(s,ht)}function nk(s,l){return Qh(s,J(l,2))}function rk(s){return s&&s.length?wo(s,ht,vc):t}function ik(s,l){return s&&s.length?wo(s,J(l,2),vc):t}var sk=Co(function(s,l){return s*l},1),ok=Nc("round"),lk=Co(function(s,l){return s-l},0);function ak(s){return s&&s.length?ic(s,ht):0}function ck(s,l){return s&&s.length?ic(s,J(l,2)):0}return w.after=NS,w.ary=Ep,w.assign=b5,w.assignIn=zp,w.assignInWith=Fo,w.assignWith=w5,w.at=v5,w.before=_p,w.bind=Uc,w.bindAll=_x,w.bindKey=Cp,w.castArray=US,w.chain=Sp,w.chunk=Zw,w.compact=Qw,w.concat=ev,w.cond=Cx,w.conforms=Tx,w.constant=Yc,w.countBy=aS,w.create=S5,w.curry=Tp,w.curryRight=Mp,w.debounce=Ap,w.defaults=x5,w.defaultsDeep=k5,w.defer=OS,w.delay=RS,w.difference=tv,w.differenceBy=nv,w.differenceWith=rv,w.drop=iv,w.dropRight=sv,w.dropRightWhile=ov,w.dropWhile=lv,w.fill=av,w.filter=uS,w.flatMap=dS,w.flatMapDeep=pS,w.flatMapDepth=mS,w.flatten=yp,w.flattenDeep=cv,w.flattenDepth=uv,w.flip=LS,w.flow=Ax,w.flowRight=Ix,w.fromPairs=fv,w.functions=I5,w.functionsIn=N5,w.groupBy=gS,w.initial=dv,w.intersection=pv,w.intersectionBy=mv,w.intersectionWith=gv,w.invert=R5,w.invertBy=L5,w.invokeMap=bS,w.iteratee=Xc,w.keyBy=wS,w.keys=He,w.keysIn=ft,w.map=Ro,w.mapKeys=D5,w.mapValues=B5,w.matches=Nx,w.matchesProperty=Ox,w.memoize=Po,w.merge=z5,w.mergeWith=Fp,w.method=Rx,w.methodOf=Lx,w.mixin=Zc,w.negate=Do,w.nthArg=Dx,w.omit=F5,w.omitBy=H5,w.once=PS,w.orderBy=vS,w.over=Bx,w.overArgs=DS,w.overEvery=zx,w.overSome=Fx,w.partial=Vc,w.partialRight=Ip,w.partition=SS,w.pick=$5,w.pickBy=Hp,w.property=Jp,w.propertyOf=Hx,w.pull=vv,w.pullAll=wp,w.pullAllBy=Sv,w.pullAllWith=xv,w.pullAt=kv,w.range=$x,w.rangeRight=Wx,w.rearg=BS,w.reject=ES,w.remove=Ev,w.rest=zS,w.reverse=$c,w.sampleSize=CS,w.set=U5,w.setWith=V5,w.shuffle=TS,w.slice=_v,w.sortBy=IS,w.sortedUniq=Ov,w.sortedUniqBy=Rv,w.split=dx,w.spread=FS,w.tail=Lv,w.take=Pv,w.takeRight=Dv,w.takeRightWhile=Bv,w.takeWhile=zv,w.tap=Qv,w.throttle=HS,w.thru=Oo,w.toArray=Pp,w.toPairs=$p,w.toPairsIn=Wp,w.toPath=Jx,w.toPlainObject=Bp,w.transform=K5,w.unary=$S,w.union=Fv,w.unionBy=Hv,w.unionWith=$v,w.uniq=Wv,w.uniqBy=Uv,w.uniqWith=Vv,w.unset=G5,w.unzip=Wc,w.unzipWith=vp,w.update=J5,w.updateWith=q5,w.values=hi,w.valuesIn=j5,w.without=Kv,w.words=Kp,w.wrap=WS,w.xor=Gv,w.xorBy=Jv,w.xorWith=qv,w.zip=jv,w.zipObject=Yv,w.zipObjectDeep=Xv,w.zipWith=Zv,w.entries=$p,w.entriesIn=Wp,w.extend=zp,w.extendWith=Fo,Zc(w,w),w.add=jx,w.attempt=Gp,w.camelCase=Q5,w.capitalize=Up,w.ceil=Yx,w.clamp=Y5,w.clone=VS,w.cloneDeep=GS,w.cloneDeepWith=JS,w.cloneWith=KS,w.conformsTo=qS,w.deburr=Vp,w.defaultTo=Mx,w.divide=Xx,w.endsWith=ex,w.eq=Xt,w.escape=tx,w.escapeRegExp=nx,w.every=cS,w.find=fS,w.findIndex=mp,w.findKey=E5,w.findLast=hS,w.findLastIndex=gp,w.findLastKey=_5,w.floor=Zx,w.forEach=xp,w.forEachRight=kp,w.forIn=C5,w.forInRight=T5,w.forOwn=M5,w.forOwnRight=A5,w.get=Jc,w.gt=jS,w.gte=YS,w.has=O5,w.hasIn=qc,w.head=bp,w.identity=ht,w.includes=yS,w.indexOf=hv,w.inRange=X5,w.invoke=P5,w.isArguments=Rr,w.isArray=Z,w.isArrayBuffer=XS,w.isArrayLike=ut,w.isArrayLikeObject=Ne,w.isBoolean=ZS,w.isBuffer=rr,w.isDate=QS,w.isElement=e5,w.isEmpty=t5,w.isEqual=n5,w.isEqualWith=r5,w.isError=Kc,w.isFinite=i5,w.isFunction=Tn,w.isInteger=Np,w.isLength=Bo,w.isMap=Op,w.isMatch=s5,w.isMatchWith=o5,w.isNaN=l5,w.isNative=a5,w.isNil=u5,w.isNull=c5,w.isNumber=Rp,w.isObject=Te,w.isObjectLike=Me,w.isPlainObject=ls,w.isRegExp=Gc,w.isSafeInteger=f5,w.isSet=Lp,w.isString=zo,w.isSymbol=kt,w.isTypedArray=fi,w.isUndefined=h5,w.isWeakMap=d5,w.isWeakSet=p5,w.join=yv,w.kebabCase=rx,w.last=zt,w.lastIndexOf=bv,w.lowerCase=ix,w.lowerFirst=sx,w.lt=m5,w.lte=g5,w.max=Qx,w.maxBy=ek,w.mean=tk,w.meanBy=nk,w.min=rk,w.minBy=ik,w.stubArray=eu,w.stubFalse=tu,w.stubObject=Ux,w.stubString=Vx,w.stubTrue=Kx,w.multiply=sk,w.nth=wv,w.noConflict=Px,w.noop=Qc,w.now=Lo,w.pad=ox,w.padEnd=lx,w.padStart=ax,w.parseInt=cx,w.random=Z5,w.reduce=xS,w.reduceRight=kS,w.repeat=ux,w.replace=fx,w.result=W5,w.round=ok,w.runInContext=_,w.sample=_S,w.size=MS,w.snakeCase=hx,w.some=AS,w.sortedIndex=Cv,w.sortedIndexBy=Tv,w.sortedIndexOf=Mv,w.sortedLastIndex=Av,w.sortedLastIndexBy=Iv,w.sortedLastIndexOf=Nv,w.startCase=px,w.startsWith=mx,w.subtract=lk,w.sum=ak,w.sumBy=ck,w.template=gx,w.times=Gx,w.toFinite=Mn,w.toInteger=Q,w.toLength=Dp,w.toLower=yx,w.toNumber=Ft,w.toSafeInteger=y5,w.toString=ge,w.toUpper=bx,w.trim=wx,w.trimEnd=vx,w.trimStart=Sx,w.truncate=xx,w.unescape=kx,w.uniqueId=qx,w.upperCase=Ex,w.upperFirst=jc,w.each=xp,w.eachRight=kp,w.first=bp,Zc(w,function(){var s={};return an(w,function(l,u){we.call(w.prototype,u)||(s[u]=l)}),s}(),{chain:!1}),w.VERSION=r,Rt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){w[s].placeholder=w}),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,wt),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 v=this.clone();return v.__iteratees__.push({iteratee:J(y,3),type:u}),v.__filtered__=v.__filtered__||d,v}}),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 es(u,s,l)})}),oe.prototype.reject=function(s){return this.filter(Do(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=w[d?"take"+(l=="last"?"Right":""):l],v=d||/^find/.test(l);y&&(w.prototype[l]=function(){var x=this.__wrapped__,E=d?[1]:arguments,C=x instanceof oe,N=E[0],O=C||Z(x),R=function(se){var fe=y.apply(w,Yn([se],E));return d&&H?fe[0]:fe};O&&u&&typeof N=="function"&&N.length!=1&&(C=O=!1);var H=this.__chain__,G=!!this.__actions__.length,q=v&&!H,ee=C&&!G;if(!v&&O){x=ee?x:new oe(this);var j=s.apply(x,E);return j.__actions__.push({func:Oo,args:[R],thisArg:t}),new Pt(j,H)}return q&&ee?s.apply(this,E):(j=this.thru(R),q?d?j.value()[0]:j.value():j)})}),Rt(["pop","push","shift","sort","splice","unshift"],function(s){var l=ro[s],u=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",d=/^(?:pop|shift)$/.test(s);w.prototype[s]=function(){var y=arguments;if(d&&!this.__chain__){var v=this.value();return l.apply(Z(v)?v:[],y)}return this[u](function(x){return l.apply(Z(x)?x:[],y)})}}),an(oe.prototype,function(s,l){var u=w[l];if(u){var d=u.name+"";we.call(oi,d)||(oi[d]=[]),oi[d].push({name:l,func:u})}}),oi[_o(t,M).name]=[{name:"wrapper",func:t}],oe.prototype.clone=kb,oe.prototype.reverse=Eb,oe.prototype.value=_b,w.prototype.at=eS,w.prototype.chain=tS,w.prototype.commit=nS,w.prototype.next=rS,w.prototype.plant=sS,w.prototype.reverse=oS,w.prototype.toJSON=w.prototype.valueOf=w.prototype.value=lS,w.prototype.first=w.prototype.head,Ji&&(w.prototype[Ji]=iS),w},ri=nb();_r?((_r.exports=ri)._=ri,Xa._=ri):qe._=ri}).call(XI)}($s,$s.exports)),$s.exports}var by=ZI();function ch(n){return n.type.create(by.cloneDeep(n.attrs))}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 QI=Ie.create({name:"node_processor",addCommands(){return{setBlockAttributes:B(({commands:n,state:e},t,r,i={})=>{const o=z(n.getBlockAttributes(t))??{},{doc:a,tr:c}=e,{from:f,to:h}=c.selection;a.nodesBetween(f,h,(m,p)=>{kf.includes(m.type.name)&&c.setNodeAttribute(p,t,{...i,...o,...r})})}),getBlockAttributes:B(({editor:n},e,t)=>de(()=>{let r=Object.assign({},t||{});for(const i of kf)Object.assign(r,n.getAttributes(i)?.[e]||{});return Object.keys(r).length?r:null})),removeBlockAttributes:B(({commands:n},e)=>{for(const t of kf)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(Ce.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:k,node:T,position:M,mark:P}=S;uh({tr:k,node:T,position:M,mark:P.type})}};a.nodesBetween(f.pos,h.pos,(S,k)=>{if(S.type.name===te.LIST)return;const T=YI(S.marks,t),M=p.create({...T?.attrs||{},...r}),P=my(f,h,S,k);if(!m.isInSet(S.marks)&&jI(o.doc,k,M,i.isAppliedToParent))return b({tr:o,node:S,position:k,mark:M});if(S.isText){o.addMark(P.from,P.to,M);return}JI(o.doc,o.selection,S,k)&&o.addNodeMark(k,M)})}),getMarks:B(({editor:n},e)=>{const t=gi(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})})})}}}),eN=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)})})}}}),tN=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))}}}),nN=Kn.create({name:"doc",topNode:!0,content:"block+"});class Ks 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=cr.fromJSON(this.schema,e.toJSON());return t.attrs.meta[this.key]=this.value,Re.ok(t)}invert(){return new Ks(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 Ks(e.key,e.value,e.stepType)}}$e.jsonID("setDocAttr",Ks);const rN=nN.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 Ks(e,t,n.schema))})}}}),iN=Kn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Mi(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),sN=iN.extend({marks:Wt.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),oN=Kn.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]}`,Mi(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}}))}}),lN=oN.extend({marks:Wt.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),aN=Ie.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[ZM.create(this.editor),QM.create(this.editor)]}}),cN=()=>[rN,sN,lN,BM,JM,QI,eN,tN,aN],uN=Mt.create({name:Ce.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(Ce.FONT_STYLE).value;!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 Gr({font_family:e})}}),fN=Ie.create({name:Ce.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=gi(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=Bl.includes(r)?"attributes":"marks";return de(()=>z(i)[o]?.includes(r)??!1)}),getContentCustomization:B(({editor:t,commands:r})=>{const i=gi(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))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:B(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(X0).resetAttributes(te.PARAGRAPH,Bl).resetAttributes(te.HEADING,Bl).restoreSelection().run()}),removeFormat:B(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeAllMarks().applyDefaultPreset().restoreSelection().run()})}},onCreate(){this.options.styleRenderer.inject(Li.head,z(this.options.presets))}}),hN=Mt.create({name:Ce.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 Gr({font_weight:n.value})}}),dN=Mt.create({name:Ce.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=z(n.getDevice());n.applyMark(this.name,{[t]:e},{isAppliedToParent:(r,i)=>r.type.name!==i.type.name?!1:r.attrs[t]===i.attrs[t],onAppliedToParent:({tr:r,node:i,position:o,mark:a})=>{const c={...a.attrs,[t]:null};if(!Object.values(c).some(m=>!!m))return!1;const h=a.type.create(c);if(i.isText){r.addMark(o,o+i.nodeSize,h);return}r.addNodeMark(o,h)}})}),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 Gr({font_size_mobile:e(n.mobile),font_size_tablet:e(n.tablet),font_size_desktop:e(n.desktop)})}}),pN=Mt.create({name:Ce.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 Gr({font_color:n.value})}}),mN=Mt.create({name:Ce.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 Gr({background_color:n.value})}}),gN=Ie.create({name:"device_manager",addCommands(){return{getDevice:B(()=>gi(this.options,"device"))}}}),yN=Mt.create({name:Ce.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 Gr({font_style:e})}}),bN=Mt.create({name:Ce.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"),Gr({text_decoration:e.join(" ")})}}),wN=Ie.create({name:"case_style",addCommands(){return{applyCaseStyle:B(({commands:n},e)=>{switch(e){case Dl.CAPITALIZE:return n.applyCapitalize();case Dl.LOWERCASE:return n.applyLowerCase();case Dl.UPPERCASE:return n.applyUpperCase()}}),applyCapitalize:B(({commands:n})=>{n.transformText(({text:e})=>wA(e))}),applyLowerCase:B(({commands:n})=>{n.transformText(({text:e})=>e.toLowerCase())}),applyUpperCase:B(({commands:n})=>{n.transformText(({text:e})=>e.toUpperCase())})}}}),wy={mobile:null,tablet:null,desktop:null},vN=Ie.create({name:Ce.ALIGNMENT,addGlobalAttributes:()=>[{types:[te.PARAGRAPH,te.HEADING],attributes:{[Ce.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?ga({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=z(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},wy)}),removeAlignment:B(({commands:n})=>n.removeBlockAttributes(this.name)),getAlignment:B(({commands:n})=>{const e=n.getBlockAttributes(this.name,wy),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??yr.LEFT)})}},addKeyboardShortcuts:()=>({"Mod-Shift-l":Kt("applyAlignment",yr.LEFT),"Mod-Shift-e":Kt("applyAlignment",yr.CENTER),"Mod-Shift-r":Kt("applyAlignment",yr.RIGHT),"Mod-Shift-j":Kt("applyAlignment",yr.JUSTIFY)})}),vy={mobile:null,tablet:null,desktop:null},SN=Ie.create({name:Ce.LINE_HEIGHT,addGlobalAttributes(){return[{types:[te.PARAGRAPH,te.HEADING],attributes:{[Ce.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?ga({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,vy),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=z(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},vy)})}}}),xN=Kn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Mi(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)}}}),kN=xN.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 EN(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 _N(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}EN(r,c)&&(n.removeNodeMark(i+1,c),n.addNodeMark(i,ch(c)),o.push(c))}}),!1})}const CN=Kn.create({name:te.LIST,content:`${te.LIST_ITEM}+`,group:"block list",marks:Wt.SETTINGS,addExtensions:()=>[kN],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})=>_N(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 TN(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function MN(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=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],k=p.pos+g.lastIndexOf(S);if(!S)return!1;const T=ma(S).map(M=>M.toObject(n.defaultProtocol));if(!TN(T))return!1;T.filter(M=>M.isLink).map(M=>({...M,from:k+M.start+1,to:k+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 AN(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=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 IN(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 NN=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function qr(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(NN,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const ON=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)=>!!qr(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=>!!qr(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=>!!qr(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Mi(this.options.HTMLAttributes,n),0]:["a",Mi(this.options.HTMLAttributes,{...n,href:""}),0]},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!qr(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=>!!qr(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=>!!qr(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(MN({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!qr(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&n.push(AN({type:this.type})),this.options.linkOnPaste&&n.push(IN({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),n}}),RN=ON.extend({name:Ce.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:Ef.SELF,parseHTML:n=>n.getAttribute("target")||Ef.SELF},destination:{default:Ai.URL,parseHTML:n=>{const e=n.getAttribute("href");if(!e.startsWith("#"))return Ai.URL;const t=e.replace("#","");return z(this.options.pageBlocks).find(o=>o.id===parseInt(t))?Ai.BLOCK:Ai.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(Ce.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===Ai.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]}}),LN=Mt.create({name:Ce.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]}}),PN=Ie.create({name:Ce.MARGIN,addGlobalAttributes:()=>[{types:[te.PARAGRAPH,te.HEADING],attributes:{[Ce.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?ga({margin:n.margin.value}):null}}}}]});function DN(n){const e=r=>n.presetsRef.value.find(i=>i.id===r),t=yu({default:null,link:null});return xE(n.presetsRef,()=>{t.default=e(n.defaultPresetId),t.link=e(n.linkPresetId)},{immediate:!0,deep:!0}),cN().concat([fN.configure({presets:n.presetsRef,defaultId:n.defaultPresetId,styleRenderer:new $N({baseClass:n.basePresetClass,makeVariable:n.makePresetVariable,linkPresetId:n.linkPresetId})}),CN.configure({baseClass:n.baseListClass,presetClass:n.basePresetClass+n.defaultPresetId}),gN.configure({device:n.deviceRef}),dN.configure({minSize:n.minFontSize,maxSize:n.maxFontSize,wrapperRef:n.wrapperRef}),uN.configure({fonts:n.fonts,defaultPreset:gi(t,"default"),defaultFont:n.defaultFont}),hN,pN,mN,yN,bN,wN,LN,vN,SN.configure({wrapperRef:n.wrapperRef}),RN.configure({preset:gi(t,"link"),basePresetClass:n.basePresetClass,pageBlocks:n.pageBlocksRef}),PN])}class BN{_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 zN 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,Ce.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 BN})}static _buildJson(e){return new zN({content:e})}static normalize(e,t={}){return Na.build(e,t).normalize()}}class Li{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=DN({fonts:e.fonts,minFontSize:0,maxFontSize:0,presetsRef:qo(e.presets),defaultPresetId:e.defaultPresetId,linkPresetId:e.linkPresetId,makePresetVariable:()=>"",basePresetClass:e.basePresetClass,baseListClass:e.baseListClass,deviceRef:qo(xf.DESKTOP),pageBlocksRef:qo([]),wrapperRef:Li.document.createElement("p")}),i=lM(r);return new gh({schema:i,domParser:bs.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 FN(n,e){return n.type===e}function HN(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=>FN(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=>HN(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(Ce.LINK,t),...r])}static mark(e,t){return{type:e,attrs:t}}static populateAllDevices(e){return{mobile:e,tablet:e,desktop:e}}}class $N{_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=Li.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===xf.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 WN{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=Li,exports.NodeDomParser=WN;
43
+ }`;var ee=Mm(function(){return me(S,J+"return "+R).apply(t,_)});if(ee.source=R,pu(ee))throw ee;return ee}function wx(s){return ge(s).toLowerCase()}function Sx(s){return ge(s).toUpperCase()}function vx(s,l,u){if(s=ge(s),s&&(u||l===t))return Fh(s);if(!s||!(l=xt(l)))return s;var p=Xt(s),y=Xt(l),S=zh(p,y),_=Bh(p,y)+1;return or(p,S,_).join("")}function _x(s,l,u){if(s=ge(s),s&&(u||l===t))return s.slice(0,Hh(s)+1);if(!s||!(l=xt(l)))return s;var p=Xt(s),y=Bh(p,Xt(l))+1;return or(p,0,y).join("")}function xx(s,l,u){if(s=ge(s),s&&(u||l===t))return s.replace(pc,"");if(!s||!(l=xt(l)))return s;var p=Xt(s),y=zh(p,Xt(l));return or(p,y).join("")}function Ex(s,l){var u=Yn,p=ln;if(Te(l)){var y="separator"in l?l.separator:y;u="length"in l?Q(l.length):u,p="omission"in l?xt(l.omission):p}s=ge(s);var S=s.length;if(fi(s)){var _=Xt(s);S=_.length}if(u>=S)return s;var E=u-di(p);if(E<1)return p;var C=_?or(_,0,E).join(""):s.slice(0,E);if(y===t)return C+p;if(_&&(E+=C.length-E),mu(y)){if(s.slice(E).search(y)){var N,O=C;for(y.global||(y=Nc(y.source,ge(sh.exec(y))+"g")),y.lastIndex=0;N=y.exec(O);)var R=N.index;C=C.slice(0,R===t?E:R)}}else if(s.indexOf(xt(y),E)!=E){var $=C.lastIndexOf(y);$>-1&&(C=C.slice(0,$))}return C+p}function kx(s){return s=ge(s),s&&Db.test(s)?s.replace(nh,ew):s}var Cx=wi(function(s,l,u){return s+(u?" ":"")+l.toUpperCase()}),bu=Ap("toUpperCase");function Tm(s,l,u){return s=ge(s),l=u?t:l,l===t?j2(s)?rw(s):$2(s):s.match(l)||[]}var Mm=ie(function(s,l){try{return vt(s,t,l)}catch(u){return pu(u)?u:new X(u)}}),Tx=Mn(function(s,l){return Lt(l,function(u){u=dn(u),Cn(s,u,du(s[u],s))}),s});function Mx(s){var l=s==null?0:s.length,u=G();return s=l?Ee(s,function(p){if(typeof p[1]!="function")throw new Pt(a);return[u(p[0]),p[1]]}):[],ie(function(p){for(var y=-1;++y<l;){var S=s[y];if(vt(S[0],this,p))return vt(S[1],this,p)}})}function Ax(s){return eS(Ft(s,h))}function wu(s){return function(){return s}}function Ix(s,l){return s==null||s!==s?l:s}var Nx=Np(),Ox=Np(!0);function ht(s){return s}function Su(s){return lp(typeof s=="function"?s:Ft(s,h))}function Rx(s){return cp(Ft(s,h))}function Lx(s,l){return up(s,Ft(l,h))}var Px=ie(function(s,l){return function(u){return ms(u,s,l)}}),Dx=ie(function(s,l){return function(u){return ms(s,u,l)}});function vu(s,l,u){var p=$e(l),y=Po(l,p);u==null&&!(Te(l)&&(y.length||!p.length))&&(u=l,l=s,s=this,y=Po(l,$e(l)));var S=!(Te(u)&&"chain"in u)||!!u.chain,_=In(s);return Lt(y,function(E){var C=l[E];s[E]=C,_&&(s.prototype[E]=function(){var N=this.__chain__;if(S||N){var O=s(this.__wrapped__),R=O.__actions__=ut(this.__actions__);return R.push({func:C,args:arguments,thisArg:s}),O.__chain__=N,O}return C.apply(s,er([this.value()],arguments))})}),s}function Fx(){return qe._===this&&(qe._=cw),this}function _u(){}function zx(s){return s=Q(s),ie(function(l){return fp(l,s)})}var Bx=Qc(Ee),$x=Qc(Oh),Hx=Qc(Ec);function Am(s){return ou(s)?kc(dn(s)):yS(s)}function Wx(s){return function(l){return s==null?t:Dr(s,l)}}var Vx=Rp(),Ux=Rp(!0);function xu(){return[]}function Eu(){return!1}function Kx(){return{}}function Jx(){return""}function Gx(){return!0}function qx(s,l){if(s=Q(s),s<1||s>Zn)return[];var u=St,p=Qe(s,St);l=G(l),s-=St;for(var y=Mc(p,l);++u<s;)l(u);return y}function jx(s){return Z(s)?Ee(s,dn):Et(s)?[s]:ut(jp(ge(s)))}function Yx(s){var l=++lw;return ge(s)+l}var Xx=Ho(function(s,l){return s+l},0),Zx=eu("ceil"),Qx=Ho(function(s,l){return s/l},1),eE=eu("floor");function tE(s){return s&&s.length?Lo(s,ht,Bc):t}function nE(s,l){return s&&s.length?Lo(s,G(l,2),Bc):t}function rE(s){return Ph(s,ht)}function iE(s,l){return Ph(s,G(l,2))}function sE(s){return s&&s.length?Lo(s,ht,Vc):t}function oE(s,l){return s&&s.length?Lo(s,G(l,2),Vc):t}var lE=Ho(function(s,l){return s*l},1),aE=eu("round"),cE=Ho(function(s,l){return s-l},0);function uE(s){return s&&s.length?Tc(s,ht):0}function fE(s,l){return s&&s.length?Tc(s,G(l,2)):0}return w.after=R_,w.ary=om,w.assign=S5,w.assignIn=Sm,w.assignInWith=el,w.assignWith=v5,w.at=_5,w.before=lm,w.bind=du,w.bindAll=Tx,w.bindKey=am,w.castArray=K_,w.chain=rm,w.chunk=ev,w.compact=tv,w.concat=nv,w.cond=Mx,w.conforms=Ax,w.constant=wu,w.countBy=u_,w.create=x5,w.curry=cm,w.curryRight=um,w.debounce=fm,w.defaults=E5,w.defaultsDeep=k5,w.defer=L_,w.delay=P_,w.difference=rv,w.differenceBy=iv,w.differenceWith=sv,w.drop=ov,w.dropRight=lv,w.dropRightWhile=av,w.dropWhile=cv,w.fill=uv,w.filter=d_,w.flatMap=m_,w.flatMapDeep=g_,w.flatMapDepth=y_,w.flatten=Qp,w.flattenDeep=fv,w.flattenDepth=dv,w.flip=D_,w.flow=Nx,w.flowRight=Ox,w.fromPairs=hv,w.functions=O5,w.functionsIn=R5,w.groupBy=b_,w.initial=mv,w.intersection=gv,w.intersectionBy=yv,w.intersectionWith=bv,w.invert=P5,w.invertBy=D5,w.invokeMap=S_,w.iteratee=Su,w.keyBy=v_,w.keys=$e,w.keysIn=dt,w.map=qo,w.mapKeys=z5,w.mapValues=B5,w.matches=Rx,w.matchesProperty=Lx,w.memoize=Yo,w.merge=$5,w.mergeWith=vm,w.method=Px,w.methodOf=Dx,w.mixin=vu,w.negate=Xo,w.nthArg=zx,w.omit=H5,w.omitBy=W5,w.once=F_,w.orderBy=__,w.over=Bx,w.overArgs=z_,w.overEvery=$x,w.overSome=Hx,w.partial=hu,w.partialRight=dm,w.partition=x_,w.pick=V5,w.pickBy=_m,w.property=Am,w.propertyOf=Wx,w.pull=_v,w.pullAll=tm,w.pullAllBy=xv,w.pullAllWith=Ev,w.pullAt=kv,w.range=Vx,w.rangeRight=Ux,w.rearg=B_,w.reject=C_,w.remove=Cv,w.rest=$_,w.reverse=uu,w.sampleSize=M_,w.set=K5,w.setWith=J5,w.shuffle=A_,w.slice=Tv,w.sortBy=O_,w.sortedUniq=Lv,w.sortedUniqBy=Pv,w.split=mx,w.spread=H_,w.tail=Dv,w.take=Fv,w.takeRight=zv,w.takeRightWhile=Bv,w.takeWhile=$v,w.tap=t_,w.throttle=W_,w.thru=Go,w.toArray=ym,w.toPairs=xm,w.toPairsIn=Em,w.toPath=jx,w.toPlainObject=wm,w.transform=G5,w.unary=V_,w.union=Hv,w.unionBy=Wv,w.unionWith=Vv,w.uniq=Uv,w.uniqBy=Kv,w.uniqWith=Jv,w.unset=q5,w.unzip=fu,w.unzipWith=nm,w.update=j5,w.updateWith=Y5,w.values=_i,w.valuesIn=X5,w.without=Gv,w.words=Tm,w.wrap=U_,w.xor=qv,w.xorBy=jv,w.xorWith=Yv,w.zip=Xv,w.zipObject=Zv,w.zipObjectDeep=Qv,w.zipWith=e_,w.entries=xm,w.entriesIn=Em,w.extend=Sm,w.extendWith=el,vu(w,w),w.add=Xx,w.attempt=Mm,w.camelCase=tx,w.capitalize=km,w.ceil=Zx,w.clamp=Z5,w.clone=J_,w.cloneDeep=q_,w.cloneDeepWith=j_,w.cloneWith=G_,w.conformsTo=Y_,w.deburr=Cm,w.defaultTo=Ix,w.divide=Qx,w.endsWith=nx,w.eq=Qt,w.escape=rx,w.escapeRegExp=ix,w.every=f_,w.find=h_,w.findIndex=Xp,w.findKey=C5,w.findLast=p_,w.findLastIndex=Zp,w.findLastKey=T5,w.floor=eE,w.forEach=im,w.forEachRight=sm,w.forIn=M5,w.forInRight=A5,w.forOwn=I5,w.forOwnRight=N5,w.get=gu,w.gt=X_,w.gte=Z_,w.has=L5,w.hasIn=yu,w.head=em,w.identity=ht,w.includes=w_,w.indexOf=pv,w.inRange=Q5,w.invoke=F5,w.isArguments=Br,w.isArray=Z,w.isArrayBuffer=Q_,w.isArrayLike=ft,w.isArrayLikeObject=Ne,w.isBoolean=e5,w.isBuffer=lr,w.isDate=t5,w.isElement=n5,w.isEmpty=r5,w.isEqual=i5,w.isEqualWith=s5,w.isError=pu,w.isFinite=o5,w.isFunction=In,w.isInteger=hm,w.isLength=Zo,w.isMap=pm,w.isMatch=l5,w.isMatchWith=a5,w.isNaN=c5,w.isNative=u5,w.isNil=d5,w.isNull=f5,w.isNumber=mm,w.isObject=Te,w.isObjectLike=Me,w.isPlainObject=vs,w.isRegExp=mu,w.isSafeInteger=h5,w.isSet=gm,w.isString=Qo,w.isSymbol=Et,w.isTypedArray=vi,w.isUndefined=p5,w.isWeakMap=m5,w.isWeakSet=g5,w.join=wv,w.kebabCase=sx,w.last=Bt,w.lastIndexOf=Sv,w.lowerCase=ox,w.lowerFirst=lx,w.lt=y5,w.lte=b5,w.max=tE,w.maxBy=nE,w.mean=rE,w.meanBy=iE,w.min=sE,w.minBy=oE,w.stubArray=xu,w.stubFalse=Eu,w.stubObject=Kx,w.stubString=Jx,w.stubTrue=Gx,w.multiply=lE,w.nth=vv,w.noConflict=Fx,w.noop=_u,w.now=jo,w.pad=ax,w.padEnd=cx,w.padStart=ux,w.parseInt=fx,w.random=ex,w.reduce=E_,w.reduceRight=k_,w.repeat=dx,w.replace=hx,w.result=U5,w.round=aE,w.runInContext=k,w.sample=T_,w.size=I_,w.snakeCase=px,w.some=N_,w.sortedIndex=Mv,w.sortedIndexBy=Av,w.sortedIndexOf=Iv,w.sortedLastIndex=Nv,w.sortedLastIndexBy=Ov,w.sortedLastIndexOf=Rv,w.startCase=gx,w.startsWith=yx,w.subtract=cE,w.sum=uE,w.sumBy=fE,w.template=bx,w.times=qx,w.toFinite=Nn,w.toInteger=Q,w.toLength=bm,w.toLower=wx,w.toNumber=$t,w.toSafeInteger=w5,w.toString=ge,w.toUpper=Sx,w.trim=vx,w.trimEnd=_x,w.trimStart=xx,w.truncate=Ex,w.unescape=kx,w.uniqueId=Yx,w.upperCase=Cx,w.upperFirst=bu,w.each=im,w.eachRight=sm,w.first=em,vu(w,function(){var s={};return un(w,function(l,u){we.call(w.prototype,u)||(s[u]=l)}),s}(),{chain:!1}),w.VERSION=r,Lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){w[s].placeholder=w}),Lt(["drop","take"],function(s,l){oe.prototype[s]=function(u){u=u===t?1:De(Q(u),0);var p=this.__filtered__&&!l?new oe(this):this.clone();return p.__filtered__?p.__takeCount__=Qe(u,p.__takeCount__):p.__views__.push({size:Qe(u,St),type:s+(p.__dir__<0?"Right":"")}),p},oe.prototype[s+"Right"]=function(u){return this.reverse()[s](u).reverse()}}),Lt(["filter","map","takeWhile"],function(s,l){var u=l+1,p=u==an||u==Be;oe.prototype[s]=function(y){var S=this.clone();return S.__iteratees__.push({iteratee:G(y,3),type:u}),S.__filtered__=S.__filtered__||p,S}}),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 ms(u,s,l)})}),oe.prototype.reject=function(s){return this.filter(Xo(G(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(St)},un(oe.prototype,function(s,l){var u=/^(?:filter|find|map|reject)|While$/.test(l),p=/^(?:head|last)$/.test(l),y=w[p?"take"+(l=="last"?"Right":""):l],S=p||/^find/.test(l);y&&(w.prototype[l]=function(){var _=this.__wrapped__,E=p?[1]:arguments,C=_ instanceof oe,N=E[0],O=C||Z(_),R=function(se){var fe=y.apply(w,er([se],E));return p&&$?fe[0]:fe};O&&u&&typeof N=="function"&&N.length!=1&&(C=O=!1);var $=this.__chain__,J=!!this.__actions__.length,q=S&&!$,ee=C&&!J;if(!S&&O){_=ee?_:new oe(this);var j=s.apply(_,E);return j.__actions__.push({func:Go,args:[R],thisArg:t}),new Dt(j,$)}return q&&ee?s.apply(this,E):(j=this.thru(R),q?p?j.value()[0]:j.value():j)})}),Lt(["pop","push","shift","sort","splice","unshift"],function(s){var l=wo[s],u=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",p=/^(?:pop|shift)$/.test(s);w.prototype[s]=function(){var y=arguments;if(p&&!this.__chain__){var S=this.value();return l.apply(Z(S)?S:[],y)}return this[u](function(_){return l.apply(Z(_)?_:[],y)})}}),un(oe.prototype,function(s,l){var u=w[l];if(u){var p=u.name+"";we.call(gi,p)||(gi[p]=[]),gi[p].push({name:l,func:u})}}),gi[$o(t,M).name]=[{name:"wrapper",func:t}],oe.prototype.clone=kw,oe.prototype.reverse=Cw,oe.prototype.value=Tw,w.prototype.at=n_,w.prototype.chain=r_,w.prototype.commit=i_,w.prototype.next=s_,w.prototype.plant=l_,w.prototype.reverse=a_,w.prototype.toJSON=w.prototype.valueOf=w.prototype.value=c_,w.prototype.first=w.prototype.head,as&&(w.prototype[as]=o_),w},hi=iw();Nr?((Nr.exports=hi)._=hi,Sc._=hi):qe._=hi}).call($O)}(no,no.exports)),no.exports}var Sb=HO();function Kd(n){return n.type.create(Sb.cloneDeep(n.attrs))}function Jd({tr:n,node:e,position:t,mark:r}){return e.isText?n.removeMark(t,t+e.nodeSize,r):n.removeNodeMark(t,r)}const WO=Ie.create({name:"node_processor",addCommands(){return{setBlockAttributes:D(({commands:n,state:e},t,r,i={})=>{const o=F(n.getBlockAttributes(t))??{},{doc:a,tr:c}=e,{from:f,to:d}=c.selection;a.nodesBetween(f,d,(m,h)=>{Jf.includes(m.type.name)&&c.setNodeAttribute(h,t,{...i,...o,...r})})}),getBlockAttributes:D(({editor:n},e,t)=>he(()=>{let r=Object.assign({},t||{});for(const i of Jf)Object.assign(r,n.getAttributes(i)?.[e]||{});return Object.keys(r).length?r:null})),removeBlockAttributes:D(({commands:n},e)=>{for(const t of Jf)n.resetAttributes(t,e)}),applyMark:D(({state:n,commands:e},t,r,i={})=>{const{tr:o,doc:a,schema:c}=n,{$from:f,$to:d}=o.selection,m=pn(Ce.LINK,c),h=pn(t,c);if(!(h.spec.group||"").includes(Vt.SETTINGS))return e.setMark(t,r);if(f.pos===d.pos)return;const b=v=>{if(!i.onAppliedToParent||i.onAppliedToParent(v)===!1){const{tr:x,node:T,position:M,mark:L}=v;Jd({tr:x,node:T,position:M,mark:L.type})}};a.nodesBetween(f.pos,d.pos,(v,x)=>{if(v.type.name===te.LIST)return;const T=BO(v.marks,t),M=h.create({...T?.attrs||{},...r}),L=yb(f,d,v,x);if(!m.isInSet(v.marks)&&zO(o.doc,x,M,i.isAppliedToParent))return b({tr:o,node:v,position:x,mark:M});if(v.isText){o.addMark(L.from,L.to,M);return}DO(o.doc,o.selection,v,x)&&o.addNodeMark(x,M)})}),getMarks:D(({editor:n},e)=>{const t=Ci(n,"state");return he(()=>{const{selection:r,doc:i}=F(t),{from:o,to:a}=F(r),c=[];return i.nodesBetween(o,a,f=>{for(const d of f.marks)d.type.name===e&&c.unshift(d.attrs)}),c})}),getMark:D(({commands:n},e)=>{const t=n.getMarks(e);return he(()=>F(t)[0]??null)}),hasMark:D(({commands:n},e)=>{const t=n.getMark(e);return he(()=>!!F(t))}),getCommonSettingMark:D(({commands:n},e,t)=>{const r=n.getMark(e);return he(()=>F(r)?.value??F(t))}),getDeviceSettingMark:D(({commands:n},e,t)=>{const r=n.getMarks(e),i=n.getDevice();return he(()=>{for(const o of F(r)){const a=o[F(i)];if(a)return a}return F(t)})}),removeAllMarks:D(({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)Jd({tr:e,node:o,position:a,mark:c})})}),removeMarks:D(({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(d=>e.includes(d.type.name));for(const d of f)Jd({tr:t,node:a,position:c,mark:d})})})}}}),VO=Ie.create({name:"text_processor",addCommands(){return{getSelectedText:D(({state:n})=>{const{from:e,to:t}=n.selection;return n.doc.textBetween(e,t," ")}),transformText:D(({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=yb(t,r,i,o),c=Math.max(0,t.pos-o),f=Math.max(0,r.pos-o),d=e({text:i.textContent.substring(c,f)}),m=n.schema.text(d,i.marks);n.tr.replaceWith(a.from,a.to,m)})})}}}),UO=Ie.create({name:"selection_processor",addStorage:()=>({selection:null}),addCommands(){return{storeSelection:D(({state:n})=>{this.storage.selection=n.selection}),restoreSelection:D(({commands:n})=>{this.storage.selection&&n.setTextSelection(this.storage.selection)}),expandSelection:D(({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:bb(n.doc,a);r=Math.min(r,a+f),i=Math.max(i,a+o.nodeSize-f)}}),e.setTextSelection({from:r,to:i})}),expandSelectionToBlock:D(({commands:n})=>n.expandSelection(({parent:e})=>e.type.name===te.DOCUMENT))}}}),KO=jn.create({name:"doc",topNode:!0,content:"block+"});class oo extends He{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=hr.fromJSON(this.schema,e.toJSON());return t.attrs.meta[this.key]=this.value,Re.ok(t)}invert(){return new oo(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 oo(e.key,e.value,e.stepType)}}He.jsonID("setDocAttr",oo);const JO=KO.extend({marks:Vt.SETTINGS,addAttributes:()=>({meta:{default:{}}}),onCreate(){this.editor.view.dom.addEventListener("click",n=>{n.target.closest("a")&&n.preventDefault()})},addCommands(){return{setDocMetaAttributes:D(({state:n},e,t)=>{n.tr.step(new oo(e,t,n.schema))})}}}),GO=jn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",zi(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),qO=GO.extend({marks:Vt.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),jO=jn.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]}`,zi(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=>DA({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),YO=jO.extend({marks:Vt.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),XO=Ie.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[eI.create(this.editor),tI.create(this.editor)]}}),ZO=()=>[JO,qO,YO,BA,jA,WO,VO,UO,XO],QO=At.create({name:Ce.FONT_FAMILY,group:Vt.SETTINGS,addOptions:()=>({fonts:[]}),addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontFamily:D(({commands:n},e)=>{n.applyMark(this.name,{value:e});const t=n.findFontByName(e);let r=F(n.getFontWeight());t.isWeightSupported(r)||(r=t.findClosestWeight(r),n.applyFontWeight(r));const i=n.isSettingCustomized(Ce.FONT_STYLE).value;t.isItalicOnly?n.applyItalic():!t.isItalicSupported(r)&&i&&n.removeItalic()}),getFont:D(({commands:n})=>{const e=F(this.options.defaultPreset),t=n.findFontByName(e.common.font_family),r=n.getFontFamily();return he(()=>n.findFontByName(F(r))||t)}),findFontByName:D((n,e)=>F(this.options.fonts).find(t=>t.name===e)??this.options.defaultFont),getFontFamily:D(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontFamily())),getDefaultFontFamily:D(({commands:n})=>{const e=n.getPreset();return he(()=>F(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 Zr({font_family:e})}}),eR=Ie.create({name:Ce.STYLE_PRESET,addGlobalAttributes(){return[{types:[te.PARAGRAPH,te.HEADING],attributes:{preset:{isRequired:!1,default:{id:F(this.options.defaultId)},parseHTML:n=>{const e=F(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=F(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:F(this.options.defaultId)}:null},renderHTML:n=>n.preset?{class:F(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:D(()=>he(()=>F(this.options.presets).filter(t=>!t.hidden))),getPreset:D(({commands:t})=>{const r=t.getBlockAttributes("preset",{id:F(this.options.defaultId)}),i=t.getPresetList(),o=t.isLink(),a=t.getLinkPreset();return he(()=>{const c=n(F(i),F(r).id);if(!F(o))return c;const f=F(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:D(({commands:t,chain:r},i)=>{const o=F(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 d of N1)f[d]=F(t.getBlockAttributes(d));r().removeList().setNode(c,f).run()}),applyDefaultPreset:D(({commands:t})=>{t.applyPreset(F(this.options.defaultId))}),removePreset:D(({commands:t})=>{t.setNode(te.PARAGRAPH,{preset:null})}),getPresetCustomization:D(({editor:t,commands:r})=>{const i=Ci(t,"state");return he(()=>{const{selection:o,doc:a}=F(i),{from:c,to:f}=o;return r._getSettingCustomization(a,c,f)})}),isSettingCustomized:D(({commands:t},r)=>{const i=t.getPresetCustomization(),o=Zl.includes(r)?"attributes":"marks";return he(()=>F(i)[o]?.includes(r)??!1)}),getContentCustomization:D(({editor:t,commands:r})=>{const i=Ci(t,"state");return he(()=>{const{doc:o}=F(i);return r._getSettingCustomization(o,0,o.content.size)})}),_getSettingCustomization:D((t,r,i,o)=>{const a=new Set,c=new Set;return r.nodesBetween(i,o,f=>{for(const[d,m]of Object.entries(f.attrs))Zl.includes(d)&&m&&c.add(d);for(const{type:d}of f.marks)R1.includes(d.name)&&a.add(d.name)}),{attributes:Array.from(c),marks:Array.from(a)}}),removePresetCustomization:D(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(R1).resetAttributes(te.PARAGRAPH,Zl).resetAttributes(te.HEADING,Zl).restoreSelection().run()}),removeFormat:D(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeAllMarks().applyDefaultPreset().restoreSelection().run()})}},onCreate(){this.options.styleRenderer.inject(qi.head,F(this.options.presets))}}),tR=At.create({name:Ce.FONT_WEIGHT,group:Vt.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:D(({commands:n},e)=>{n.applyMark(this.name,{value:e}),F(n.getFont()).isItalicSupported(e)||n.removeItalic()}),toggleBold:D(({commands:n})=>{const e=F(n.getFontWeight()),t=F(n.getFont()),i=Number(e)>=600?"400":"700",o=t.findClosestWeight(i);n.applyFontWeight(o)}),getFontWeight:D(({commands:n})=>{const e=n.getCommonSettingMark(this.name,n.getDefaultFontWeight()),t=n.getFont();return he(()=>{const r=F(e),i=F(t);return i.isWeightSupported(r)?r:i.findClosestWeight(r)})}),getDefaultFontWeight:D(({commands:n})=>{const e=n.getPreset();return he(()=>F(e).common.font_weight)})}},addKeyboardShortcuts:()=>({"Mod-b":Jt("toggleBold"),"Mod-B":Jt("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 Zr({font_weight:n.value})}}),nR=At.create({name:Ce.FONT_SIZE,group:Vt.SETTINGS,addOptions:()=>({minSize:1,maxSize:100}),addAttributes(){return{mobile:{default:null},tablet:{default:null},desktop:{default:null}}},addCommands(){return{getFontSize:D(({commands:n})=>n.getDeviceSettingMark(this.name,n.getDefaultFontSize())),getDefaultFontSize:D(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return he(()=>F(t)[F(e)].font_size.replace("px",""))}),applyFontSize:D(({commands:n},e)=>{const t=F(n.getDevice());n.applyMark(this.name,{[t]:e},{isAppliedToParent:(r,i)=>r.type.name!==i.type.name?!1:r.attrs[t]===i.attrs[t],onAppliedToParent:({tr:r,node:i,position:o,mark:a})=>{const c={...a.attrs,[t]:null};if(!Object.values(c).some(m=>!!m))return!1;const d=a.type.create(c);if(i.isText){r.addMark(o,o+i.nodeSize,d);return}r.addNodeMark(o,d)}})}),increaseFontSize:D(({commands:n})=>{const e=Number(F(n.getFontSize())),t=Math.min(e+1,F(this.options.maxSize));n.applyFontSize(String(t))}),decreaseFontSize:D(({commands:n})=>{const e=Number(F(n.getFontSize())),t=Math.max(e-1,F(this.options.minSize));n.applyFontSize(String(t))})}},addKeyboardShortcuts:()=>({"Mod-Shift-=":Jt("increaseFontSize"),"Mod-Shift--":Jt("decreaseFontSize")}),parseHTML(){const n=e=>{if(!e)return null;const t=F(this.options.wrapperRef),r=gb(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 Zr({font_size_mobile:e(n.mobile),font_size_tablet:e(n.tablet),font_size_desktop:e(n.desktop)})}}),rR=At.create({name:Ce.FONT_COLOR,group:Vt.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getFontColor:D(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontColor())),getDefaultFontColor:D(({commands:n})=>{const e=n.getPreset();return he(()=>F(e).common.color)}),applyFontColor:D(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:mb(e)});return[{style:"--zw-font-color",getAttrs:n},{style:"color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Zr({font_color:n.value})}}),iR=At.create({name:Ce.BACKGROUND_COLOR,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getBackgroundColor:D(({commands:n})=>n.getCommonSettingMark(this.name,"rgba(255, 255, 255, 0%)")),applyBackgroundColor:D(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:mb(e)});return[{style:"--zw-background-color",getAttrs:n},{style:"background-color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Zr({background_color:n.value})}}),sR=Ie.create({name:"device_manager",addCommands(){return{getDevice:D(()=>Ci(this.options,"device"))}}}),oR=At.create({name:Ce.FONT_STYLE,group:Vt.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:D(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultFontStyle();return he(()=>F(e)?.italic??F(t).italic)}),isItalicAvailable:D(({commands:n})=>{const e=n.getFont(),t=n.getFontWeight();return he(()=>{const r=F(e),i=F(t);return r.isItalicSupported(i)&&!r.isWeightItalicOnly(i)})}),getDefaultFontStyle:D(({commands:n})=>{const e=n.getPreset();return he(()=>({italic:F(e).common.font_style==="italic"}))}),toggleItalic:D(({commands:n})=>{F(n.isItalicAvailable())&&(F(n.isItalic())?n.removeItalic():n.applyItalic())}),applyItalic:D(({commands:n})=>{n.applyMark(this.name,{italic:!0})}),removeItalic:D(({commands:n})=>{n.applyMark(this.name,{italic:!1})})}},addKeyboardShortcuts:()=>({"Mod-i":Jt("toggleItalic"),"Mod-I":Jt("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 Zr({font_style:e})}}),lR=At.create({name:Ce.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:D(({commands:n})=>{const e=n.getTextDecoration();return he(()=>F(e).underline)}),isStrikeThrough:D(({commands:n})=>{const e=n.getTextDecoration();return he(()=>F(e).strike_through)}),getTextDecoration:D(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultTextDecoration();return he(()=>{const r=F(e)??{},i=F(t);return{underline:r.underline||i.underline,strike_through:r.strike_through||i.strike_through}})}),isUnderlineCustomized:D(({commands:n})=>{const e=n.isUnderline(),t=n.getDefaultTextDecoration();return he(()=>F(e)!==F(t).underline)}),getDefaultTextDecoration:D(({commands:n})=>{const e=n.getPreset();return he(()=>{const{text_decoration:t}=F(e).common;return{underline:t.includes("underline"),strike_through:t.includes("line-through")}})}),toggleUnderline:D(({commands:n})=>{n.toggleTextDecoration("underline")}),toggleStrikeThrough:D(({commands:n})=>{n.toggleTextDecoration("strike_through")}),toggleTextDecoration:D(({commands:n},e,t=null)=>{const r=F(n.getTextDecoration()),i=t??!r[e];n.applyMark(this.name,{[e]:i})}),applyTextDecoration:D(({commands:n},e)=>{n.toggleTextDecoration(e,!0)}),removeTextDecoration:D(({commands:n},e)=>{n.toggleTextDecoration(e,!1)})}},addKeyboardShortcuts:()=>({"Mod-u":Jt("toggleUnderline"),"Mod-U":Jt("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"),Zr({text_decoration:e.join(" ")})}}),aR=Ie.create({name:"case_style",addCommands(){return{applyCaseStyle:D(({commands:n},e)=>{switch(e){case Xl.CAPITALIZE:return n.applyCapitalize();case Xl.LOWERCASE:return n.applyLowerCase();case Xl.UPPERCASE:return n.applyUpperCase()}}),applyCapitalize:D(({commands:n})=>{n.transformText(({text:e})=>vI(e))}),applyLowerCase:D(({commands:n})=>{n.transformText(({text:e})=>e.toLowerCase())}),applyUpperCase:D(({commands:n})=>{n.transformText(({text:e})=>e.toUpperCase())})}}}),vb={mobile:null,tablet:null,desktop:null},cR=Ie.create({name:Ce.ALIGNMENT,addGlobalAttributes:()=>[{types:[te.PARAGRAPH,te.HEADING],attributes:{[Ce.ALIGNMENT]:{isRequired:!1,parseHTML({style:n}){const e=PO(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?Na({alignment_mobile:n.alignment.mobile,alignment_tablet:n.alignment.tablet,alignment_desktop:n.alignment.desktop}):null}}}}],addCommands(){return{applyAlignment:D(({commands:n},e)=>{const t=F(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},vb)}),removeAlignment:D(({commands:n})=>n.removeBlockAttributes(this.name)),getAlignment:D(({commands:n})=>{const e=n.getBlockAttributes(this.name,vb),t=n.getDevice(),r=n.getDefaultAlignment();return he(()=>F(e)?.[F(t)]??F(r))}),getDefaultAlignment:D(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return he(()=>F(t)[F(e)].alignment??vr.LEFT)})}},addKeyboardShortcuts:()=>({"Mod-Shift-l":Jt("applyAlignment",vr.LEFT),"Mod-Shift-e":Jt("applyAlignment",vr.CENTER),"Mod-Shift-r":Jt("applyAlignment",vr.RIGHT),"Mod-Shift-j":Jt("applyAlignment",vr.JUSTIFY)})}),_b={mobile:null,tablet:null,desktop:null},uR=Ie.create({name:Ce.LINE_HEIGHT,addGlobalAttributes(){return[{types:[te.PARAGRAPH,te.HEADING],attributes:{[Ce.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=F(this.options.wrapperRef),r=RO(e,n,t);return r?{desktop:r,tablet:r,mobile:null}:null},renderHTML(n){return n.line_height?Na({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:D(({commands:n})=>{const e=n.getBlockAttributes(this.name,_b),t=n.getDevice(),r=n.getDefaultLineHeight();return he(()=>F(e)?.[F(t)]??F(r))}),getDefaultLineHeight:D(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return he(()=>F(t)[F(e)].line_height)}),applyLineHeight:D(({commands:n},e)=>{const t=F(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},_b)})}}}),fR=jn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",zi(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)}}}),dR=fR.extend({name:te.LIST_ITEM,marks:Vt.SETTINGS,addCommands(){const n=({selection:e})=>e.$cursor.before(e.$cursor.depth-1);return{listItemNewline:D(({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,Kd(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 hR(n,e){if(O1.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 pR(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}hR(r,c)&&(n.removeNodeMark(i+1,c),n.addNodeMark(i,Kd(c)),o.push(c))}}),!1})}const mR=jn.create({name:te.LIST,content:`${te.LIST_ITEM}+`,group:"block list",marks:Vt.SETTINGS,addExtensions:()=>[dR],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:rn.DISC}}}),parseHTML(){const n={a:rn.ROMAN,i:rn.LATIN,1:rn.DECIMAL},e=t=>{for(const r of ZA){const i=`.${F(this.options.baseClass)}${r}`;if(t.matches(i)||n[t.type.toLowerCase()]===r)return r}};return[{tag:"ol",getAttrs:t=>({bullet:{type:e(t)||rn.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||rn.DISC}})}]},renderHTML({HTMLAttributes:n}){const e=[F(this.options.baseClass)+n.bullet.type,F(this.options.presetClass)];return[QA.includes(n.bullet.type)?"ol":"ul",{class:e.join(" ")},0]},addCommands(){return{getListType:D(({commands:n})=>{const e=n.getBlockAttributes("bullet",{type:null});return he(()=>F(e).type??null)}),applyList:D(({commands:n,chain:e},t)=>F(n.getListType())===t?n.removeList():e().applyDefaultPreset().toggleList(te.LIST,te.LIST_ITEM).setBlockAttributes("bullet",{type:t}).command(({tr:i})=>pR(i)).run()),removeList:D(({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,Kd(f));return!1}),!0}).liftListItem(te.LIST_ITEM).run())}},addInputRules(){const n=(e,t)=>FA({find:t,type:this.type,getAttributes:{bullet:{type:e}},joinPredicate:(r,{attrs:i})=>i.bullet.type===e});return[n(rn.DISC,/^\s*([-+*])\s$/),n(rn.DECIMAL,/^(\d+)\.\s$/),n(rn.LATIN,/^([ivx]{1,3})\.\s$/i),n(rn.ROMAN,/^([a-z])\.\s$/i)]}});function gR(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function yR(n){return new lt({key:new Tt("autolink"),appendTransaction:(e,t,r)=>{const i=e.some(d=>d.docChanged)&&!t.doc.eq(r.doc),o=e.some(d=>d.getMeta("preventAutolink"));if(!i||o)return;const{tr:a}=r,c=sA(t.doc,[...e]);if(pA(c).forEach(({newRange:d})=>{const m=lA(r.doc,d,b=>b.isTextblock);let h,g;if(m.length>1?(h=m[0],g=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ")):m.length&&r.doc.textBetween(d.from,d.to," "," ").endsWith(" ")&&(h=m[0],g=r.doc.textBetween(h.pos,d.to,void 0," ")),h&&g){const b=g.split(" ").filter(M=>M!=="");if(b.length<=0)return!1;const v=b[b.length-1],x=h.pos+g.lastIndexOf(v);if(!v)return!1;const T=Ia(v).map(M=>M.toObject(n.defaultProtocol));if(!gR(T))return!1;T.filter(M=>M.isLink).map(M=>({...M,from:x+M.start+1,to:x+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=>{v1(M.from,M.to,r.doc).some(L=>L.mark.type===n.type)||a.addMark(M.from,M.to,n.type.create({href:M.href}))})}}),!!a.steps.length)return a}})}function bR(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=fA(e.state,n.type.name),d=r.target,m=(i=d?.href)!==null&&i!==void 0?i:f.href,h=(o=d?.target)!==null&&o!==void 0?o:f.target;return d&&m?(window.open(m,h),!0):!1}}})}function wR(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(d=>{c+=d.textContent});const f=j1(c,{defaultProtocol:n.defaultProtocol}).find(d=>d.isLink&&d.value===c);return!c||!f?!1:n.editor.commands.setMark(n.type,{href:f.href})}}})}const SR=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function ii(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(SR,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const vR=At.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"){q1(n);return}q1(n.scheme,n.optionalSlashes)})},onDestroy(){yI()},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)=>!!ii(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=>!!ii(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=>!!ii(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",zi(this.options.HTMLAttributes,n),0]:["a",zi(this.options.HTMLAttributes,{...n,href:""}),0]},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!ii(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=>!!ii(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[zA({find:n=>{const e=[];if(n){const{protocols:t,defaultProtocol:r}=this.options,i=j1(n).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:a=>!!ii(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(yR({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!ii(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&n.push(bR({type:this.type})),this.options.linkOnPaste&&n.push(wR({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),n}}),_R=vR.extend({name:Ce.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:Gf.SELF,parseHTML:n=>n.getAttribute("target")||Gf.SELF},destination:{default:Bi.URL,parseHTML:n=>{const e=n.getAttribute("href");if(!e.startsWith("#"))return Bi.URL;const t=e.replace("#","");return F(this.options.pageBlocks).find(o=>o.id===parseInt(t))?Bi.BLOCK:Bi.URL}}}},addCommands(){const{unsetLink:n}=this.parent();return{removeLink:n,applyLink:D(({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(Eb.text(r.text,[Eb.mark(Ce.LINK,r)])))),expandSelectionToLink:D(({commands:e})=>{e.expandSelection(({node:t})=>this.type.isInSet(t.marks))}),isLink:D(({commands:e})=>e.hasMark(this.name)),getLinkPreset:D(()=>he(()=>F(this.options.preset)))}},addProseMirrorPlugins(){return[...this.parent(),SI.create(this.editor)]},renderHTML({HTMLAttributes:n}){const e=n.destination===Bi.BLOCK?`#${n.href}`:n.href,t=F(this.options.basePresetClass)+F(this.options.preset).id;return["a",{href:e,target:n.target,class:`${t} zw-style`},0]}}),xR=At.create({name:Ce.SUPERSCRIPT,addCommands(){return{applySuperscript:D(({commands:n})=>{n.setMark(this.name)}),removeSuperscript:D(({commands:n})=>{n.unsetMark(this.name)}),toggleSuperscript:D(({commands:n})=>{F(n.isSuperscript())?n.removeSuperscript():n.applySuperscript()}),isSuperscript:D(({commands:n})=>{const e=n.getMark(this.name);return he(()=>!!F(e))})}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs:n=>n!=="super"?!1:null}]},renderHTML(){return["sup",{class:"zw-superscript"},0]}}),ER=Ie.create({name:Ce.MARGIN,addGlobalAttributes:()=>[{types:[te.PARAGRAPH,te.HEADING],attributes:{[Ce.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?Na({margin:n.margin.value}):null}}}}]});function kR(n){const e=r=>n.presetsRef.value.find(i=>i.id===r),t=$u({default:null,link:null});return Ek(n.presetsRef,()=>{t.default=e(n.defaultPresetId),t.link=e(n.linkPresetId)},{immediate:!0,deep:!0}),ZO().concat([eR.configure({presets:n.presetsRef,defaultId:n.defaultPresetId,styleRenderer:new IR({baseClass:n.basePresetClass,makeVariable:n.makePresetVariable,linkPresetId:n.linkPresetId})}),mR.configure({baseClass:n.baseListClass,presetClass:n.basePresetClass+n.defaultPresetId}),sR.configure({device:n.deviceRef}),nR.configure({minSize:n.minFontSize,maxSize:n.maxFontSize,wrapperRef:n.wrapperRef}),QO.configure({fonts:n.fonts,defaultPreset:Ci(t,"default"),defaultFont:n.defaultFont}),tR,rR,iR,oR,lR,aR,xR,cR,uR.configure({wrapperRef:n.wrapperRef}),_R.configure({preset:Ci(t,"link"),basePresetClass:n.basePresetClass,pageBlocks:n.pageBlocksRef}),ER])}class CR{_domParser=new DOMParser;types=window;parse(e){return this._domParser.parseFromString(e,"text/html")}}class xb{content;constructor({content:e}){this.content=e}normalize(){throw new Error("Implement abstract method")}}class wn extends xb{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=wn.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,wn.BLOCK_STYLES),t.append(c)};this._assignElementProperties(e,e.parentElement,wn.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,wn.BLOCK_STYLES),this._removeStyleProperties(e.parentElement,wn.BLOCK_STYLES),this._assignElementProperties(e,e.parentElement),e.parentElement.lastElementChild===e&&this._removeStyleProperties(e.parentElement)}_isBlockNode(e){return wn.BLOCK_NODE_NAMES.includes(e.tagName)}_isRootNode(e){return wn.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,wn.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 TR extends xb{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(O1.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=>Sb.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,Ce.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 ec{static build(e,t={}){return typeof e=="string"?this._buildHtml(e,t):this._buildJson(e)}static _buildHtml(e,t){return new wn({content:e,parser:t.parser||new CR})}static _buildJson(e){return new TR({content:e})}static normalize(e,t={}){return ec.build(e,t).normalize()}}class qi{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 Zd{static build({config:e,nodeDomParser:t}){const r=kR({fonts:e.fonts,minFontSize:0,maxFontSize:0,presetsRef:cl(e.presets),defaultPresetId:e.defaultPresetId,linkPresetId:e.linkPresetId,makePresetVariable:()=>"",basePresetClass:e.basePresetClass,baseListClass:e.baseListClass,deviceRef:cl(Kf.DESKTOP),pageBlocksRef:cl([]),wrapperRef:qi.document.createElement("p")}),i=cA(r);return new Zd({schema:i,domParser:Os.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=ec.build(e,{parser:this._nodeDomParser});return t.normalizeHTML(),this._domParser.parse(t.dom.body).toJSON()}}function MR(n,e){return n.type===e}function AR(n){return typeof n=="string"}class Eb{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=>MR(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=>AR(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(Ce.LINK,t),...r])}static mark(e,t){return{type:e,attrs:t}}static populateAllDevices(e){return{mobile:e,tablet:e,desktop:e}}}class IR{_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=qi.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 YA)for(const c of Object.keys(r[a])){const f=this._makeVariable({device:a,preset:r,property:c}),d=this._makeInternalVariableName(c,a);if(t+=`${d}: var(${f}, inherit);`,i&&!N1.includes(c)){const m=d.replace("preset-","");t+=`${m}: var(${d});`}}t+="}"}return t}_makeInternalVariableName(e,t){const r=e==="color"?"font-color":e.replace(/_/i,"-"),i=t===Kf.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 Qd{static _instance;static get instance(){return this._instance??=new Qd,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 NR{static createWindow(){return new Nm.JSDOM().window}types;parse(e){const{window:t}=new Nm.JSDOM(e);return this.types=t,t.document}}exports.ContentSerializer=Zd,exports.ContextWindow=qi,exports.NodeDomParser=NR;