| 1 |
var oa=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)};var Pn=(n,e,t)=>(oa(n,e,"read from private field"),t?t.call(n):e.get(n)),Po=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},Lo=(n,e,t,r)=>(oa(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t);import{r as Be,d as zt,s as Qp,j as Nc,a3 as Dc,aw as ed,n as td,u as Ic,m as Di,c as zn,o as zc,A as Rc,$ as sa,g as kl,x as O,D as E,F as T,K as C}from"./vue.js?ver=2.8.1";import{h as nd}from"./dayjs.js?ver=2.8.1";function Gk(n,e){var t;const r=Qp();return Nc(()=>{r.value=n()},{...e,flush:(t=e==null?void 0:e.flush)!=null?t:"sync"}),Dc(r)}function ur(n){return ed()?(td(n),!0):!1}function Ue(n){return typeof n=="function"?n():Ic(n)}function rd(n){if(!Di(n))return sa(n);const e=new Proxy({},{get(t,r,i){return Ic(Reflect.get(n.value,r,i))},set(t,r,i){return Di(n.value[r])&&!Di(i)?n.value[r].value=i:n.value[r]=i,!0},deleteProperty(t,r){return Reflect.deleteProperty(n.value,r)},has(t,r){return Reflect.has(n.value,r)},ownKeys(){return Object.keys(n.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return sa(e)}function Zk(n){return rd(zn(n))}const po=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const id=n=>typeof n<"u",Fc=n=>n!=null,od=Object.prototype.toString,sd=n=>od.call(n)==="[object Object]",Xk=(n,e,t)=>Math.min(t,Math.max(e,n)),ct=()=>{},ld=ad();function ad(){var n,e;return po&&((n=window==null?void 0:window.navigator)==null?void 0:n.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Pc(n,e){function t(...r){return new Promise((i,o)=>{Promise.resolve(n(()=>e.apply(this,r),{fn:e,thisArg:this,args:r})).then(i).catch(o)})}return t}function ud(n,e={}){let t,r,i=ct;const o=l=>{clearTimeout(l),i(),i=ct};return l=>{const a=Ue(n),u=Ue(e.maxWait);return t&&o(t),a<=0||u!==void 0&&u<=0?(r&&(o(r),r=null),Promise.resolve(l())):new Promise((c,f)=>{i=e.rejectOnCancel?f:c,u&&!r&&(r=setTimeout(()=>{t&&o(t),r=null,c(l())},u)),t=setTimeout(()=>{r&&o(r),r=null,c(l())},a)})}}function cd(...n){let e=0,t,r=!0,i=ct,o,s,l,a,u;!Di(n[0])&&typeof n[0]=="object"?{delay:s,trailing:l=!0,leading:a=!0,rejectOnCancel:u=!1}=n[0]:[s,l=!0,a=!0,u=!1]=n;const c=()=>{t&&(clearTimeout(t),t=void 0,i(),i=ct)};return h=>{const p=Ue(s),d=Date.now()-e,m=()=>o=h();return c(),p<=0?(e=Date.now(),m()):(d>p&&(a||!r)?(e=Date.now(),m()):l&&(o=new Promise((y,g)=>{i=u?g:y,t=setTimeout(()=>{e=Date.now(),r=!0,y(m()),c()},Math.max(0,p-d))})),!a&&!t&&(t=setTimeout(()=>r=!0,p)),r=!1,o)}}function fd(n){return n||kl()}function hd(n,e=200,t={}){return Pc(ud(e,t),n)}function Qk(n,e=200,t={}){const r=Be(n.value),i=hd(()=>{r.value=n.value},e,t);return zt(n,()=>i()),r}function ev(n,e=200,t=!1,r=!0,i=!1){return Pc(cd(e,t,r,i),n)}function Lc(n,e=!0,t){fd()?zc(n,t):e?n():Rc(n)}function tv(n,e,t={}){const{immediate:r=!0}=t,i=Be(!1);let o=null;function s(){o&&(clearTimeout(o),o=null)}function l(){i.value=!1,s()}function a(...u){s(),i.value=!0,o=setTimeout(()=>{i.value=!1,o=null,n(...u)},Ue(e))}return r&&(i.value=!0,po&&a()),ur(l),{isPending:Dc(i),start:a,stop:l}}const Pt=po?window:void 0,pd=po?window.document:void 0;function Oe(n){var e;const t=Ue(n);return(e=t==null?void 0:t.$el)!=null?e:t}function kn(...n){let e,t,r,i;if(typeof n[0]=="string"||Array.isArray(n[0])?([t,r,i]=n,e=Pt):[e,t,r,i]=n,!e)return ct;Array.isArray(t)||(t=[t]),Array.isArray(r)||(r=[r]);const o=[],s=()=>{o.forEach(c=>c()),o.length=0},l=(c,f,h,p)=>(c.addEventListener(f,h,p),()=>c.removeEventListener(f,h,p)),a=zt(()=>[Oe(e),Ue(i)],([c,f])=>{if(s(),!c)return;const h=sd(f)?{...f}:f;o.push(...t.flatMap(p=>r.map(d=>l(c,p,d,h))))},{immediate:!0,flush:"post"}),u=()=>{a(),s()};return ur(u),u}let la=!1;function nv(n,e,t={}){const{window:r=Pt,ignore:i=[],capture:o=!0,detectIframe:s=!1}=t;if(!r)return ct;ld&&!la&&(la=!0,Array.from(r.document.body.children).forEach(m=>m.addEventListener("click",ct)),r.document.documentElement.addEventListener("click",ct));let l=!0;const a=m=>Ue(i).some(y=>{if(typeof y=="string")return Array.from(r.document.querySelectorAll(y)).some(g=>g===m.target||m.composedPath().includes(g));{const g=Oe(y);return g&&(m.target===g||m.composedPath().includes(g))}});function u(m){const y=Ue(m);return y&&y.$.subTree.shapeFlag===16}function c(m,y){const g=Ue(m),_=g.$.subTree&&g.$.subTree.children;return _==null||!Array.isArray(_)?!1:_.some(x=>x.el===y.target||y.composedPath().includes(x.el))}const f=m=>{const y=Oe(n);if(m.target!=null&&!(!(y instanceof Element)&&u(n)&&c(n,m))&&!(!y||y===m.target||m.composedPath().includes(y))){if(m.detail===0&&(l=!a(m)),!l){l=!0;return}e(m)}};let h=!1;const p=[kn(r,"click",m=>{h||(h=!0,setTimeout(()=>{h=!1},0),f(m))},{passive:!0,capture:o}),kn(r,"pointerdown",m=>{const y=Oe(n);l=!a(m)&&!!(y&&!m.composedPath().includes(y))},{passive:!0}),s&&kn(r,"blur",m=>{setTimeout(()=>{var y;const g=Oe(n);((y=r.document.activeElement)==null?void 0:y.tagName)==="IFRAME"&&!(g!=null&&g.contains(r.document.activeElement))&&e(m)},0)})].filter(Boolean);return()=>p.forEach(m=>m())}function dd(){const n=Be(!1),e=kl();return e&&zc(()=>{n.value=!0},e),n}function mo(n){const e=dd();return zn(()=>(e.value,!!n()))}function rv(n,e,t={}){const{window:r=Pt,...i}=t;let o;const s=mo(()=>r&&"MutationObserver"in r),l=()=>{o&&(o.disconnect(),o=void 0)},a=zn(()=>{const h=Ue(n),p=(Array.isArray(h)?h:[h]).map(Oe).filter(Fc);return new Set(p)}),u=zt(()=>a.value,h=>{l(),s.value&&h.size&&(o=new MutationObserver(e),h.forEach(p=>o.observe(p,i)))},{immediate:!0,flush:"post"}),c=()=>o==null?void 0:o.takeRecords(),f=()=>{u(),l()};return ur(f),{isSupported:s,stop:f,takeRecords:c}}function md(n,e={}){const{window:t=Pt}=e,r=mo(()=>t&&"matchMedia"in t&&typeof t.matchMedia=="function");let i;const o=Be(!1),s=u=>{o.value=u.matches},l=()=>{i&&("removeEventListener"in i?i.removeEventListener("change",s):i.removeListener(s))},a=Nc(()=>{r.value&&(l(),i=t.matchMedia(Ue(n)),"addEventListener"in i?i.addEventListener("change",s):i.addListener(s),o.value=i.matches)});return ur(()=>{a(),l(),i=void 0}),o}function gd(n){return JSON.parse(JSON.stringify(n))}function iv(n={}){const{document:e=pd}=n;if(!e)return Be("visible");const t=Be(e.visibilityState);return kn(e,"visibilitychange",()=>{t.value=e.visibilityState}),t}function yd(n,e,t={}){const{window:r=Pt,...i}=t;let o;const s=mo(()=>r&&"ResizeObserver"in r),l=()=>{o&&(o.disconnect(),o=void 0)},a=zn(()=>{const f=Ue(n);return Array.isArray(f)?f.map(h=>Oe(h)):[Oe(f)]}),u=zt(a,f=>{if(l(),s.value&&r){o=new ResizeObserver(e);for(const h of f)h&&o.observe(h,i)}},{immediate:!0,flush:"post"}),c=()=>{l(),u()};return ur(c),{isSupported:s,stop:c}}function ov(n,e={width:0,height:0},t={}){const{window:r=Pt,box:i="content-box"}=t,o=zn(()=>{var f,h;return(h=(f=Oe(n))==null?void 0:f.namespaceURI)==null?void 0:h.includes("svg")}),s=Be(e.width),l=Be(e.height),{stop:a}=yd(n,([f])=>{const h=i==="border-box"?f.borderBoxSize:i==="content-box"?f.contentBoxSize:f.devicePixelContentBoxSize;if(r&&o.value){const p=Oe(n);if(p){const d=p.getBoundingClientRect();s.value=d.width,l.value=d.height}}else if(h){const p=Array.isArray(h)?h:[h];s.value=p.reduce((d,{inlineSize:m})=>d+m,0),l.value=p.reduce((d,{blockSize:m})=>d+m,0)}else s.value=f.contentRect.width,l.value=f.contentRect.height},t);Lc(()=>{const f=Oe(n);f&&(s.value="offsetWidth"in f?f.offsetWidth:e.width,l.value="offsetHeight"in f?f.offsetHeight:e.height)});const u=zt(()=>Oe(n),f=>{s.value=f?e.width:0,l.value=f?e.height:0});function c(){a(),u()}return{width:s,height:l,stop:c}}function sv(n,e,t={}){const{root:r,rootMargin:i="0px",threshold:o=0,window:s=Pt,immediate:l=!0}=t,a=mo(()=>s&&"IntersectionObserver"in s),u=zn(()=>{const d=Ue(n);return(Array.isArray(d)?d:[d]).map(Oe).filter(Fc)});let c=ct;const f=Be(l),h=a.value?zt(()=>[u.value,Oe(r),f.value],([d,m])=>{if(c(),!f.value||!d.length)return;const y=new IntersectionObserver(e,{root:Oe(m),rootMargin:i,threshold:o});d.forEach(g=>g&&y.observe(g)),c=()=>{y.disconnect(),c=ct}},{immediate:l,flush:"post"}):ct,p=()=>{c(),h(),f.value=!1};return ur(p),{isSupported:a,isActive:f,pause(){c(),f.value=!1},resume(){f.value=!0},stop:p}}function lv(n,e,t,r={}){var i,o,s;const{clone:l=!1,passive:a=!1,eventName:u,deep:c=!1,defaultValue:f,shouldEmit:h}=r,p=kl(),d=t||(p==null?void 0:p.emit)||((i=p==null?void 0:p.$emit)==null?void 0:i.bind(p))||((s=(o=p==null?void 0:p.proxy)==null?void 0:o.$emit)==null?void 0:s.bind(p==null?void 0:p.proxy));let m=u;e||(e="modelValue"),m=m||`update:${e.toString()}`;const y=x=>l?typeof l=="function"?l(x):gd(x):x,g=()=>id(n[e])?y(n[e]):f,_=x=>{h?h(x)&&d(m,x):d(m,x)};if(a){const x=g(),S=Be(x);let M=!1;return zt(()=>n[e],k=>{M||(M=!0,S.value=y(k),Rc(()=>M=!1))}),zt(S,k=>{!M&&(k!==n[e]||c)&&_(k)},{deep:c}),S}else return zn({get(){return g()},set(x){_(x)}})}function av(n={}){const{window:e=Pt}=n;if(!e)return Be(!1);const t=Be(e.document.hasFocus());return kn(e,"blur",()=>{t.value=!1}),kn(e,"focus",()=>{t.value=!0}),t}function uv(n={}){const{window:e=Pt,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:r=Number.POSITIVE_INFINITY,listenOrientation:i=!0,includeScrollbar:o=!0,type:s="inner"}=n,l=Be(t),a=Be(r),u=()=>{e&&(s==="outer"?(l.value=e.outerWidth,a.value=e.outerHeight):o?(l.value=e.innerWidth,a.value=e.innerHeight):(l.value=e.document.documentElement.clientWidth,a.value=e.document.documentElement.clientHeight))};if(u(),Lc(u),kn("resize",u,{passive:!0}),i){const c=md("(orientation: portrait)");zt(c,()=>u())}return{width:l,height:a}}var Fe="top",nt="bottom",rt="right",Pe="left",vl="auto",Xr=[Fe,nt,rt,Pe],Zn="start",Hr="end",wd="clippingParents",Bc="viewport",wr="popper",bd="reference",aa=Xr.reduce(function(n,e){return n.concat([e+"-"+Zn,e+"-"+Hr])},[]),Vc=[].concat(Xr,[vl]).reduce(function(n,e){return n.concat([e,e+"-"+Zn,e+"-"+Hr])},[]),xd="beforeRead",kd="read",vd="afterRead",_d="beforeMain",Sd="main",Cd="afterMain",Ad="beforeWrite",Md="write",Od="afterWrite",Ed=[xd,kd,vd,_d,Sd,Cd,Ad,Md,Od];function kt(n){return n?(n.nodeName||"").toLowerCase():null}function pt(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function Xn(n){var e=pt(n).Element;return n instanceof e||n instanceof Element}function Qe(n){var e=pt(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function _l(n){if(typeof ShadowRoot>"u")return!1;var e=pt(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function Td(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},i=e.attributes[t]||{},o=e.elements[t];!Qe(o)||!kt(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var l=i[s];l===!1?o.removeAttribute(s):o.setAttribute(s,l===!0?"":l)}))})}function Nd(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),l=s.reduce(function(a,u){return a[u]="",a},{});!Qe(i)||!kt(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(a){i.removeAttribute(a)}))})}}var Hc={name:"applyStyles",enabled:!0,phase:"write",fn:Td,effect:Nd,requires:["computeStyles"]};function xt(n){return n.split("-")[0]}var vn=Math.max,Ui=Math.min,Qn=Math.round;function er(n,e){e===void 0&&(e=!1);var t=n.getBoundingClientRect(),r=1,i=1;if(Qe(n)&&e){var o=n.offsetHeight,s=n.offsetWidth;s>0&&(r=Qn(t.width)/s||1),o>0&&(i=Qn(t.height)/o||1)}return{width:t.width/r,height:t.height/i,top:t.top/i,right:t.right/r,bottom:t.bottom/i,left:t.left/r,x:t.left/r,y:t.top/i}}function Sl(n){var e=er(n),t=n.offsetWidth,r=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:r}}function $c(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&_l(t)){var r=e;do{if(r&&n.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Rt(n){return pt(n).getComputedStyle(n)}function Dd(n){return["table","td","th"].indexOf(kt(n))>=0}function sn(n){return((Xn(n)?n.ownerDocument:n.document)||window.document).documentElement}function go(n){return kt(n)==="html"?n:n.assignedSlot||n.parentNode||(_l(n)?n.host:null)||sn(n)}function ua(n){return!Qe(n)||Rt(n).position==="fixed"?null:n.offsetParent}function Id(n){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,t=navigator.userAgent.indexOf("Trident")!==-1;if(t&&Qe(n)){var r=Rt(n);if(r.position==="fixed")return null}var i=go(n);for(_l(i)&&(i=i.host);Qe(i)&&["html","body"].indexOf(kt(i))<0;){var o=Rt(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Qr(n){for(var e=pt(n),t=ua(n);t&&Dd(t)&&Rt(t).position==="static";)t=ua(t);return t&&(kt(t)==="html"||kt(t)==="body"&&Rt(t).position==="static")?e:t||Id(n)||e}function Cl(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Mr(n,e,t){return vn(n,Ui(e,t))}function zd(n,e,t){var r=Mr(n,e,t);return r>t?t:r}function qc(){return{top:0,right:0,bottom:0,left:0}}function jc(n){return Object.assign({},qc(),n)}function Wc(n,e){return e.reduce(function(t,r){return t[r]=n,t},{})}var Rd=function(n,e){return n=typeof n=="function"?n(Object.assign({},e.rects,{placement:e.placement})):n,jc(typeof n!="number"?n:Wc(n,Xr))};function Fd(n){var e,t=n.state,r=n.name,i=n.options,o=t.elements.arrow,s=t.modifiersData.popperOffsets,l=xt(t.placement),a=Cl(l),u=[Pe,rt].indexOf(l)>=0,c=u?"height":"width";if(!(!o||!s)){var f=Rd(i.padding,t),h=Sl(o),p=a==="y"?Fe:Pe,d=a==="y"?nt:rt,m=t.rects.reference[c]+t.rects.reference[a]-s[a]-t.rects.popper[c],y=s[a]-t.rects.reference[a],g=Qr(o),_=g?a==="y"?g.clientHeight||0:g.clientWidth||0:0,x=m/2-y/2,S=f[p],M=_-h[c]-f[d],k=_/2-h[c]/2+x,F=Mr(S,k,M),L=a;t.modifiersData[r]=(e={},e[L]=F,e.centerOffset=F-k,e)}}function Pd(n){var e=n.state,t=n.options,r=t.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||!$c(e.elements.popper,i)||(e.elements.arrow=i))}var Ld={name:"arrow",enabled:!0,phase:"main",fn:Fd,effect:Pd,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function tr(n){return n.split("-")[1]}var Bd={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Vd(n){var e=n.x,t=n.y,r=window,i=r.devicePixelRatio||1;return{x:Qn(e*i)/i||0,y:Qn(t*i)/i||0}}function ca(n){var e,t=n.popper,r=n.popperRect,i=n.placement,o=n.variation,s=n.offsets,l=n.position,a=n.gpuAcceleration,u=n.adaptive,c=n.roundOffsets,f=n.isFixed,h=s.x,p=h===void 0?0:h,d=s.y,m=d===void 0?0:d,y=typeof c=="function"?c({x:p,y:m}):{x:p,y:m};p=y.x,m=y.y;var g=s.hasOwnProperty("x"),_=s.hasOwnProperty("y"),x=Pe,S=Fe,M=window;if(u){var k=Qr(t),F="clientHeight",L="clientWidth";if(k===pt(t)&&(k=sn(t),Rt(k).position!=="static"&&l==="absolute"&&(F="scrollHeight",L="scrollWidth")),k=k,i===Fe||(i===Pe||i===rt)&&o===Hr){S=nt;var N=f&&k===M&&M.visualViewport?M.visualViewport.height:k[F];m-=N-r.height,m*=a?1:-1}if(i===Pe||(i===Fe||i===nt)&&o===Hr){x=rt;var v=f&&k===M&&M.visualViewport?M.visualViewport.width:k[L];p-=v-r.width,p*=a?1:-1}}var z=Object.assign({position:l},u&&Bd),D=c===!0?Vd({x:p,y:m}):{x:p,y:m};if(p=D.x,m=D.y,a){var B;return Object.assign({},z,(B={},B[S]=_?"0":"",B[x]=g?"0":"",B.transform=(M.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",B))}return Object.assign({},z,(e={},e[S]=_?m+"px":"",e[x]=g?p+"px":"",e.transform="",e))}function Hd(n){var e=n.state,t=n.options,r=t.gpuAcceleration,i=r===void 0?!0:r,o=t.adaptive,s=o===void 0?!0:o,l=t.roundOffsets,a=l===void 0?!0:l,u={placement:xt(e.placement),variation:tr(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,ca(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:a})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,ca(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var Uc={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Hd,data:{}},gi={passive:!0};function $d(n){var e=n.state,t=n.instance,r=n.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,l=s===void 0?!0:s,a=pt(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",t.update,gi)}),l&&a.addEventListener("resize",t.update,gi),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",t.update,gi)}),l&&a.removeEventListener("resize",t.update,gi)}}var Jc={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:$d,data:{}},qd={left:"right",right:"left",bottom:"top",top:"bottom"};function Ii(n){return n.replace(/left|right|bottom|top/g,function(e){return qd[e]})}var jd={start:"end",end:"start"};function fa(n){return n.replace(/start|end/g,function(e){return jd[e]})}function Al(n){var e=pt(n),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function Ml(n){return er(sn(n)).left+Al(n).scrollLeft}function Wd(n){var e=pt(n),t=sn(n),r=e.visualViewport,i=t.clientWidth,o=t.clientHeight,s=0,l=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,l=r.offsetTop)),{width:i,height:o,x:s+Ml(n),y:l}}function Ud(n){var e,t=sn(n),r=Al(n),i=(e=n.ownerDocument)==null?void 0:e.body,o=vn(t.scrollWidth,t.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=vn(t.scrollHeight,t.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+Ml(n),a=-r.scrollTop;return Rt(i||t).direction==="rtl"&&(l+=vn(t.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:a}}function Ol(n){var e=Rt(n),t=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+i+r)}function Kc(n){return["html","body","#document"].indexOf(kt(n))>=0?n.ownerDocument.body:Qe(n)&&Ol(n)?n:Kc(go(n))}function Or(n,e){var t;e===void 0&&(e=[]);var r=Kc(n),i=r===((t=n.ownerDocument)==null?void 0:t.body),o=pt(r),s=i?[o].concat(o.visualViewport||[],Ol(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(Or(go(s)))}function ks(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function Jd(n){var e=er(n);return e.top=e.top+n.clientTop,e.left=e.left+n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top,e}function ha(n,e){return e===Bc?ks(Wd(n)):Xn(e)?Jd(e):ks(Ud(sn(n)))}function Kd(n){var e=Or(go(n)),t=["absolute","fixed"].indexOf(Rt(n).position)>=0,r=t&&Qe(n)?Qr(n):n;return Xn(r)?e.filter(function(i){return Xn(i)&&$c(i,r)&&kt(i)!=="body"}):[]}function Yd(n,e,t){var r=e==="clippingParents"?Kd(n):[].concat(e),i=[].concat(r,[t]),o=i[0],s=i.reduce(function(l,a){var u=ha(n,a);return l.top=vn(u.top,l.top),l.right=Ui(u.right,l.right),l.bottom=Ui(u.bottom,l.bottom),l.left=vn(u.left,l.left),l},ha(n,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Yc(n){var e=n.reference,t=n.element,r=n.placement,i=r?xt(r):null,o=r?tr(r):null,s=e.x+e.width/2-t.width/2,l=e.y+e.height/2-t.height/2,a;switch(i){case Fe:a={x:s,y:e.y-t.height};break;case nt:a={x:s,y:e.y+e.height};break;case rt:a={x:e.x+e.width,y:l};break;case Pe:a={x:e.x-t.width,y:l};break;default:a={x:e.x,y:e.y}}var u=i?Cl(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(o){case Zn:a[u]=a[u]-(e[c]/2-t[c]/2);break;case Hr:a[u]=a[u]+(e[c]/2-t[c]/2);break}}return a}function $r(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=r===void 0?n.placement:r,o=t.boundary,s=o===void 0?wd:o,l=t.rootBoundary,a=l===void 0?Bc:l,u=t.elementContext,c=u===void 0?wr:u,f=t.altBoundary,h=f===void 0?!1:f,p=t.padding,d=p===void 0?0:p,m=jc(typeof d!="number"?d:Wc(d,Xr)),y=c===wr?bd:wr,g=n.rects.popper,_=n.elements[h?y:c],x=Yd(Xn(_)?_:_.contextElement||sn(n.elements.popper),s,a),S=er(n.elements.reference),M=Yc({reference:S,element:g,strategy:"absolute",placement:i}),k=ks(Object.assign({},g,M)),F=c===wr?k:S,L={top:x.top-F.top+m.top,bottom:F.bottom-x.bottom+m.bottom,left:x.left-F.left+m.left,right:F.right-x.right+m.right},N=n.modifiersData.offset;if(c===wr&&N){var v=N[i];Object.keys(L).forEach(function(z){var D=[rt,nt].indexOf(z)>=0?1:-1,B=[Fe,nt].indexOf(z)>=0?"y":"x";L[z]+=v[B]*D})}return L}function Gd(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=t.boundary,o=t.rootBoundary,s=t.padding,l=t.flipVariations,a=t.allowedAutoPlacements,u=a===void 0?Vc:a,c=tr(r),f=c?l?aa:aa.filter(function(d){return tr(d)===c}):Xr,h=f.filter(function(d){return u.indexOf(d)>=0});h.length===0&&(h=f);var p=h.reduce(function(d,m){return d[m]=$r(n,{placement:m,boundary:i,rootBoundary:o,padding:s})[xt(m)],d},{});return Object.keys(p).sort(function(d,m){return p[d]-p[m]})}function Zd(n){if(xt(n)===vl)return[];var e=Ii(n);return[fa(n),e,fa(e)]}function Xd(n){var e=n.state,t=n.options,r=n.name;if(!e.modifiersData[r]._skip){for(var i=t.mainAxis,o=i===void 0?!0:i,s=t.altAxis,l=s===void 0?!0:s,a=t.fallbackPlacements,u=t.padding,c=t.boundary,f=t.rootBoundary,h=t.altBoundary,p=t.flipVariations,d=p===void 0?!0:p,m=t.allowedAutoPlacements,y=e.options.placement,g=xt(y),_=g===y,x=a||(_||!d?[Ii(y)]:Zd(y)),S=[y].concat(x).reduce(function(le,pe){return le.concat(xt(pe)===vl?Gd(e,{placement:pe,boundary:c,rootBoundary:f,padding:u,flipVariations:d,allowedAutoPlacements:m}):pe)},[]),M=e.rects.reference,k=e.rects.popper,F=new Map,L=!0,N=S[0],v=0;v<S.length;v++){var z=S[v],D=xt(z),B=tr(z)===Zn,W=[Fe,nt].indexOf(D)>=0,H=W?"width":"height",U=$r(e,{placement:z,boundary:c,rootBoundary:f,altBoundary:h,padding:u}),Y=W?B?rt:Pe:B?nt:Fe;M[H]>k[H]&&(Y=Ii(Y));var ce=Ii(Y),he=[];if(o&&he.push(U[D]<=0),l&&he.push(U[Y]<=0,U[ce]<=0),he.every(function(le){return le})){N=z,L=!1;break}F.set(z,he)}if(L)for(var w=d?3:1,_e=function(le){var pe=S.find(function(ne){var st=F.get(ne);if(st)return st.slice(0,le).every(function(Ce){return Ce})});if(pe)return N=pe,"break"},Se=w;Se>0;Se--){var b=_e(Se);if(b==="break")break}e.placement!==N&&(e.modifiersData[r]._skip=!0,e.placement=N,e.reset=!0)}}var Qd={name:"flip",enabled:!0,phase:"main",fn:Xd,requiresIfExists:["offset"],data:{_skip:!1}};function pa(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function da(n){return[Fe,rt,nt,Pe].some(function(e){return n[e]>=0})}function e0(n){var e=n.state,t=n.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=$r(e,{elementContext:"reference"}),l=$r(e,{altBoundary:!0}),a=pa(s,r),u=pa(l,i,o),c=da(a),f=da(u);e.modifiersData[t]={referenceClippingOffsets:a,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":f})}var t0={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:e0};function n0(n,e,t){var r=xt(n),i=[Pe,Fe].indexOf(r)>=0?-1:1,o=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,s=o[0],l=o[1];return s=s||0,l=(l||0)*i,[Pe,rt].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function r0(n){var e=n.state,t=n.options,r=n.name,i=t.offset,o=i===void 0?[0,0]:i,s=Vc.reduce(function(c,f){return c[f]=n0(f,e.rects,o),c},{}),l=s[e.placement],a=l.x,u=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=a,e.modifiersData.popperOffsets.y+=u),e.modifiersData[r]=s}var i0={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:r0};function o0(n){var e=n.state,t=n.name;e.modifiersData[t]=Yc({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var Gc={name:"popperOffsets",enabled:!0,phase:"read",fn:o0,data:{}};function s0(n){return n==="x"?"y":"x"}function l0(n){var e=n.state,t=n.options,r=n.name,i=t.mainAxis,o=i===void 0?!0:i,s=t.altAxis,l=s===void 0?!1:s,a=t.boundary,u=t.rootBoundary,c=t.altBoundary,f=t.padding,h=t.tether,p=h===void 0?!0:h,d=t.tetherOffset,m=d===void 0?0:d,y=$r(e,{boundary:a,rootBoundary:u,padding:f,altBoundary:c}),g=xt(e.placement),_=tr(e.placement),x=!_,S=Cl(g),M=s0(S),k=e.modifiersData.popperOffsets,F=e.rects.reference,L=e.rects.popper,N=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,v=typeof N=="number"?{mainAxis:N,altAxis:N}:Object.assign({mainAxis:0,altAxis:0},N),z=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,D={x:0,y:0};if(k){if(o){var B,W=S==="y"?Fe:Pe,H=S==="y"?nt:rt,U=S==="y"?"height":"width",Y=k[S],ce=Y+y[W],he=Y-y[H],w=p?-L[U]/2:0,_e=_===Zn?F[U]:L[U],Se=_===Zn?-L[U]:-F[U],b=e.elements.arrow,le=p&&b?Sl(b):{width:0,height:0},pe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:qc(),ne=pe[W],st=pe[H],Ce=Mr(0,F[U],le[U]),Vt=x?F[U]/2-w-Ce-ne-v.mainAxis:_e-Ce-ne-v.mainAxis,Ht=x?-F[U]/2+w+Ce+st+v.mainAxis:Se+Ce+st+v.mainAxis,$t=e.elements.arrow&&Qr(e.elements.arrow),zo=$t?S==="y"?$t.clientTop||0:$t.clientLeft||0:0,ci=(B=z==null?void 0:z[S])!=null?B:0,Ro=Y+Vt-ci-zo,fi=Y+Ht-ci,pr=Mr(p?Ui(ce,Ro):ce,Y,p?vn(he,fi):he);k[S]=pr,D[S]=pr-Y}if(l){var dr,Fo=S==="x"?Fe:Pe,hi=S==="x"?nt:rt,dt=k[M],Rn=M==="y"?"height":"width",pi=dt+y[Fo],di=dt-y[hi],mr=[Fe,Pe].indexOf(g)!==-1,mi=(dr=z==null?void 0:z[M])!=null?dr:0,A=mr?pi:dt-F[Rn]-L[Rn]-mi+v.altAxis,R=mr?dt+F[Rn]+L[Rn]-mi-v.altAxis:di,$=p&&mr?zd(A,dt,R):Mr(p?A:pi,dt,p?R:di);k[M]=$,D[M]=$-dt}e.modifiersData[r]=D}}var a0={name:"preventOverflow",enabled:!0,phase:"main",fn:l0,requiresIfExists:["offset"]};function u0(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function c0(n){return n===pt(n)||!Qe(n)?Al(n):u0(n)}function f0(n){var e=n.getBoundingClientRect(),t=Qn(e.width)/n.offsetWidth||1,r=Qn(e.height)/n.offsetHeight||1;return t!==1||r!==1}function h0(n,e,t){t===void 0&&(t=!1);var r=Qe(e),i=Qe(e)&&f0(e),o=sn(e),s=er(n,i),l={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(r||!r&&!t)&&((kt(e)!=="body"||Ol(o))&&(l=c0(e)),Qe(e)?(a=er(e,!0),a.x+=e.clientLeft,a.y+=e.clientTop):o&&(a.x=Ml(o))),{x:s.left+l.scrollLeft-a.x,y:s.top+l.scrollTop-a.y,width:s.width,height:s.height}}function p0(n){var e=new Map,t=new Set,r=[];n.forEach(function(o){e.set(o.name,o)});function i(o){t.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(l){if(!t.has(l)){var a=e.get(l);a&&i(a)}}),r.push(o)}return n.forEach(function(o){t.has(o.name)||i(o)}),r}function d0(n){var e=p0(n);return Ed.reduce(function(t,r){return t.concat(e.filter(function(i){return i.phase===r}))},[])}function m0(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function g0(n){var e=n.reduce(function(t,r){var i=t[r.name];return t[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var ma={placement:"bottom",modifiers:[],strategy:"absolute"};function ga(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function El(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,r=t===void 0?[]:t,i=e.defaultOptions,o=i===void 0?ma:i;return function(s,l,a){a===void 0&&(a=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},ma,o),modifiersData:{},elements:{reference:s,popper:l},attributes:{},styles:{}},c=[],f=!1,h={state:u,setOptions:function(m){var y=typeof m=="function"?m(u.options):m;d(),u.options=Object.assign({},o,u.options,y),u.scrollParents={reference:Xn(s)?Or(s):s.contextElement?Or(s.contextElement):[],popper:Or(l)};var g=d0(g0([].concat(r,u.options.modifiers)));return u.orderedModifiers=g.filter(function(_){return _.enabled}),p(),h.update()},forceUpdate:function(){if(!f){var m=u.elements,y=m.reference,g=m.popper;if(ga(y,g)){u.rects={reference:h0(y,Qr(g),u.options.strategy==="fixed"),popper:Sl(g)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(L){return u.modifiersData[L.name]=Object.assign({},L.data)});for(var _=0;_<u.orderedModifiers.length;_++){if(u.reset===!0){u.reset=!1,_=-1;continue}var x=u.orderedModifiers[_],S=x.fn,M=x.options,k=M===void 0?{}:M,F=x.name;typeof S=="function"&&(u=S({state:u,options:k,name:F,instance:h})||u)}}}},update:m0(function(){return new Promise(function(m){h.forceUpdate(),m(u)})}),destroy:function(){d(),f=!0}};if(!ga(s,l))return h;h.setOptions(a).then(function(m){!f&&a.onFirstUpdate&&a.onFirstUpdate(m)});function p(){u.orderedModifiers.forEach(function(m){var y=m.name,g=m.options,_=g===void 0?{}:g,x=m.effect;if(typeof x=="function"){var S=x({state:u,name:y,instance:h,options:_}),M=function(){};c.push(S||M)}})}function d(){c.forEach(function(m){return m()}),c=[]}return h}}El();var y0=[Jc,Gc,Uc,Hc];El({defaultModifiers:y0});var w0=[Jc,Gc,Uc,Hc,i0,Qd,a0,Ld,t0],cv=El({defaultModifiers:w0});const ya=Math.min,Er=Math.max,Ji=Math.round,nn=n=>({x:n,y:n}),b0={left:"right",right:"left",bottom:"top",top:"bottom"},x0={start:"end",end:"start"};function Tl(n,e){return typeof n=="function"?n(e):n}function nr(n){return n.split("-")[0]}function yo(n){return n.split("-")[1]}function k0(n){return n==="x"?"y":"x"}function Zc(n){return n==="y"?"height":"width"}function Nl(n){return["top","bottom"].includes(nr(n))?"y":"x"}function Xc(n){return k0(Nl(n))}function v0(n,e,t){t===void 0&&(t=!1);const r=yo(n),i=Xc(n),o=Zc(i);let s=i==="x"?r===(t?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=Ki(s)),[s,Ki(s)]}function _0(n){const e=Ki(n);return[vs(n),e,vs(e)]}function vs(n){return n.replace(/start|end/g,e=>x0[e])}function S0(n,e,t){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(n){case"top":case"bottom":return t?e?i:r:e?r:i;case"left":case"right":return e?o:s;default:return[]}}function C0(n,e,t,r){const i=yo(n);let o=S0(nr(n),t==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(vs)))),o}function Ki(n){return n.replace(/left|right|bottom|top/g,e=>b0[e])}function A0(n){return{top:0,right:0,bottom:0,left:0,...n}}function M0(n){return typeof n!="number"?A0(n):{top:n,right:n,bottom:n,left:n}}function Yi(n){return{...n,top:n.y,left:n.x,right:n.x+n.width,bottom:n.y+n.height}}function wa(n,e,t){let{reference:r,floating:i}=n;const o=Nl(e),s=Xc(e),l=Zc(s),a=nr(e),u=o==="y",c=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[l]/2-i[l]/2;let p;switch(a){case"top":p={x:c,y:r.y-i.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(yo(e)){case"start":p[s]-=h*(t&&u?-1:1);break;case"end":p[s]+=h*(t&&u?-1:1);break}return p}const O0=async(n,e,t)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=t,l=o.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(e));let u=await s.getElementRects({reference:n,floating:e,strategy:i}),{x:c,y:f}=wa(u,r,a),h=r,p={},d=0;for(let m=0;m<l.length;m++){const{name:y,fn:g}=l[m],{x:_,y:x,data:S,reset:M}=await g({x:c,y:f,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:u,platform:s,elements:{reference:n,floating:e}});c=_??c,f=x??f,p={...p,[y]:{...p[y],...S}},M&&d<=50&&(d++,typeof M=="object"&&(M.placement&&(h=M.placement),M.rects&&(u=M.rects===!0?await s.getElementRects({reference:n,floating:e,strategy:i}):M.rects),{x:c,y:f}=wa(u,h,a)),m=-1)}return{x:c,y:f,placement:h,strategy:i,middlewareData:p}};async function E0(n,e){var t;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:l,strategy:a}=n,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=Tl(e,n),d=M0(p),y=l[h?f==="floating"?"reference":"floating":f],g=Yi(await o.getClippingRect({element:(t=await(o.isElement==null?void 0:o.isElement(y)))==null||t?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:u,rootBoundary:c,strategy:a})),_=f==="floating"?{...s.floating,x:r,y:i}:s.reference,x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),S=await(o.isElement==null?void 0:o.isElement(x))?await(o.getScale==null?void 0:o.getScale(x))||{x:1,y:1}:{x:1,y:1},M=Yi(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:_,offsetParent:x,strategy:a}):_);return{top:(g.top-M.top+d.top)/S.y,bottom:(M.bottom-g.bottom+d.bottom)/S.y,left:(g.left-M.left+d.left)/S.x,right:(M.right-g.right+d.right)/S.x}}const T0=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:l,platform:a,elements:u}=e,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:m=!0,...y}=Tl(n,e);if((t=o.arrow)!=null&&t.alignmentOffset)return{};const g=nr(i),_=nr(l)===l,x=await(a.isRTL==null?void 0:a.isRTL(u.floating)),S=h||(_||!m?[Ki(l)]:_0(l));!h&&d!=="none"&&S.push(...C0(l,m,d,x));const M=[l,...S],k=await E0(e,y),F=[];let L=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&F.push(k[g]),f){const D=v0(i,s,x);F.push(k[D[0]],k[D[1]])}if(L=[...L,{placement:i,overflows:F}],!F.every(D=>D<=0)){var N,v;const D=(((N=o.flip)==null?void 0:N.index)||0)+1,B=M[D];if(B)return{data:{index:D,overflows:L},reset:{placement:B}};let W=(v=L.filter(H=>H.overflows[0]<=0).sort((H,U)=>H.overflows[1]-U.overflows[1])[0])==null?void 0:v.placement;if(!W)switch(p){case"bestFit":{var z;const H=(z=L.map(U=>[U.placement,U.overflows.filter(Y=>Y>0).reduce((Y,ce)=>Y+ce,0)]).sort((U,Y)=>U[1]-Y[1])[0])==null?void 0:z[0];H&&(W=H);break}case"initialPlacement":W=l;break}if(i!==W)return{reset:{placement:W}}}return{}}}};async function N0(n,e){const{placement:t,platform:r,elements:i}=n,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=nr(t),l=yo(t),a=Nl(t)==="y",u=["left","top"].includes(s)?-1:1,c=o&&a?-1:1,f=Tl(e,n);let{mainAxis:h,crossAxis:p,alignmentAxis:d}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&typeof d=="number"&&(p=l==="end"?d*-1:d),a?{x:p*c,y:h*u}:{x:h*u,y:p*c}}const fv=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,r;const{x:i,y:o,placement:s,middlewareData:l}=e,a=await N0(e,n);return s===((t=l.offset)==null?void 0:t.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+a.x,y:o+a.y,data:{...a,placement:s}}}}};function rn(n){return Qc(n)?(n.nodeName||"").toLowerCase():"#document"}function Je(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function ln(n){var e;return(e=(Qc(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function Qc(n){return n instanceof Node||n instanceof Je(n).Node}function Ft(n){return n instanceof Element||n instanceof Je(n).Element}function vt(n){return n instanceof HTMLElement||n instanceof Je(n).HTMLElement}function ba(n){return typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Je(n).ShadowRoot}function ei(n){const{overflow:e,overflowX:t,overflowY:r,display:i}=it(n);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&!["inline","contents"].includes(i)}function D0(n){return["table","td","th"].includes(rn(n))}function Dl(n){const e=Il(),t=it(n);return t.transform!=="none"||t.perspective!=="none"||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(t.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(t.contain||"").includes(r))}function I0(n){let e=rr(n);for(;vt(e)&&!wo(e);){if(Dl(e))return e;e=rr(e)}return null}function Il(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function wo(n){return["html","body","#document"].includes(rn(n))}function it(n){return Je(n).getComputedStyle(n)}function bo(n){return Ft(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function rr(n){if(rn(n)==="html")return n;const e=n.assignedSlot||n.parentNode||ba(n)&&n.host||ln(n);return ba(e)?e.host:e}function ef(n){const e=rr(n);return wo(e)?n.ownerDocument?n.ownerDocument.body:n.body:vt(e)&&ei(e)?e:ef(e)}function _s(n,e,t){var r;e===void 0&&(e=[]),t===void 0&&(t=!0);const i=ef(n),o=i===((r=n.ownerDocument)==null?void 0:r.body),s=Je(i);return o?e.concat(s,s.visualViewport||[],ei(i)?i:[],s.frameElement&&t?_s(s.frameElement):[]):e.concat(i,_s(i,[],t))}function tf(n){const e=it(n);let t=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=vt(n),o=i?n.offsetWidth:t,s=i?n.offsetHeight:r,l=Ji(t)!==o||Ji(r)!==s;return l&&(t=o,r=s),{width:t,height:r,$:l}}function nf(n){return Ft(n)?n:n.contextElement}function Un(n){const e=nf(n);if(!vt(e))return nn(1);const t=e.getBoundingClientRect(),{width:r,height:i,$:o}=tf(e);let s=(o?Ji(t.width):t.width)/r,l=(o?Ji(t.height):t.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const z0=nn(0);function rf(n){const e=Je(n);return!Il()||!e.visualViewport?z0:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function R0(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==Je(n)?!1:e}function qr(n,e,t,r){e===void 0&&(e=!1),t===void 0&&(t=!1);const i=n.getBoundingClientRect(),o=nf(n);let s=nn(1);e&&(r?Ft(r)&&(s=Un(r)):s=Un(n));const l=R0(o,t,r)?rf(o):nn(0);let a=(i.left+l.x)/s.x,u=(i.top+l.y)/s.y,c=i.width/s.x,f=i.height/s.y;if(o){const h=Je(o),p=r&&Ft(r)?Je(r):r;let d=h,m=d.frameElement;for(;m&&r&&p!==d;){const y=Un(m),g=m.getBoundingClientRect(),_=it(m),x=g.left+(m.clientLeft+parseFloat(_.paddingLeft))*y.x,S=g.top+(m.clientTop+parseFloat(_.paddingTop))*y.y;a*=y.x,u*=y.y,c*=y.x,f*=y.y,a+=x,u+=S,d=Je(m),m=d.frameElement}}return Yi({width:c,height:f,x:a,y:u})}const F0=[":popover-open",":modal"];function of(n){return F0.some(e=>{try{return n.matches(e)}catch{return!1}})}function P0(n){let{elements:e,rect:t,offsetParent:r,strategy:i}=n;const o=i==="fixed",s=ln(r),l=e?of(e.floating):!1;if(r===s||l&&o)return t;let a={scrollLeft:0,scrollTop:0},u=nn(1);const c=nn(0),f=vt(r);if((f||!f&&!o)&&((rn(r)!=="body"||ei(s))&&(a=bo(r)),vt(r))){const h=qr(r);u=Un(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-a.scrollLeft*u.x+c.x,y:t.y*u.y-a.scrollTop*u.y+c.y}}function L0(n){return Array.from(n.getClientRects())}function sf(n){return qr(ln(n)).left+bo(n).scrollLeft}function B0(n){const e=ln(n),t=bo(n),r=n.ownerDocument.body,i=Er(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Er(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-t.scrollLeft+sf(n);const l=-t.scrollTop;return it(r).direction==="rtl"&&(s+=Er(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:l}}function V0(n,e){const t=Je(n),r=ln(n),i=t.visualViewport;let o=r.clientWidth,s=r.clientHeight,l=0,a=0;if(i){o=i.width,s=i.height;const u=Il();(!u||u&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop)}return{width:o,height:s,x:l,y:a}}function H0(n,e){const t=qr(n,!0,e==="fixed"),r=t.top+n.clientTop,i=t.left+n.clientLeft,o=vt(n)?Un(n):nn(1),s=n.clientWidth*o.x,l=n.clientHeight*o.y,a=i*o.x,u=r*o.y;return{width:s,height:l,x:a,y:u}}function xa(n,e,t){let r;if(e==="viewport")r=V0(n,t);else if(e==="document")r=B0(ln(n));else if(Ft(e))r=H0(e,t);else{const i=rf(n);r={...e,x:e.x-i.x,y:e.y-i.y}}return Yi(r)}function lf(n,e){const t=rr(n);return t===e||!Ft(t)||wo(t)?!1:it(t).position==="fixed"||lf(t,e)}function $0(n,e){const t=e.get(n);if(t)return t;let r=_s(n,[],!1).filter(l=>Ft(l)&&rn(l)!=="body"),i=null;const o=it(n).position==="fixed";let s=o?rr(n):n;for(;Ft(s)&&!wo(s);){const l=it(s),a=Dl(s);!a&&l.position==="fixed"&&(i=null),(o?!a&&!i:!a&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||ei(s)&&!a&&lf(n,s))?r=r.filter(c=>c!==s):i=l,s=rr(s)}return e.set(n,r),r}function q0(n){let{element:e,boundary:t,rootBoundary:r,strategy:i}=n;const s=[...t==="clippingAncestors"?$0(e,this._c):[].concat(t),r],l=s[0],a=s.reduce((u,c)=>{const f=xa(e,c,i);return u.top=Er(f.top,u.top),u.right=ya(f.right,u.right),u.bottom=ya(f.bottom,u.bottom),u.left=Er(f.left,u.left),u},xa(e,l,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function j0(n){const{width:e,height:t}=tf(n);return{width:e,height:t}}function W0(n,e,t){const r=vt(e),i=ln(e),o=t==="fixed",s=qr(n,!0,o,e);let l={scrollLeft:0,scrollTop:0};const a=nn(0);if(r||!r&&!o)if((rn(e)!=="body"||ei(i))&&(l=bo(e)),r){const f=qr(e,!0,o,e);a.x=f.x+e.clientLeft,a.y=f.y+e.clientTop}else i&&(a.x=sf(i));const u=s.left+l.scrollLeft-a.x,c=s.top+l.scrollTop-a.y;return{x:u,y:c,width:s.width,height:s.height}}function ka(n,e){return!vt(n)||it(n).position==="fixed"?null:e?e(n):n.offsetParent}function af(n,e){const t=Je(n);if(!vt(n)||of(n))return t;let r=ka(n,e);for(;r&&D0(r)&&it(r).position==="static";)r=ka(r,e);return r&&(rn(r)==="html"||rn(r)==="body"&&it(r).position==="static"&&!Dl(r))?t:r||I0(n)||t}const U0=async function(n){const e=this.getOffsetParent||af,t=this.getDimensions;return{reference:W0(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,...await t(n.floating)}}};function J0(n){return it(n).direction==="rtl"}const K0={convertOffsetParentRelativeRectToViewportRelativeRect:P0,getDocumentElement:ln,getClippingRect:q0,getOffsetParent:af,getElementRects:U0,getClientRects:L0,getDimensions:j0,getScale:Un,isElement:Ft,isRTL:J0},hv=T0,pv=(n,e,t)=>{const r=new Map,i={platform:K0,...t},o={...i.platform,_c:r};return O0(n,e,{...i,platform:o})};/*! Element Plus Icons Vue v2.3.2 */var Y0=O({name:"ArrowDown",__name:"arrow-down",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"})]))}}),dv=Y0,G0=O({name:"ArrowLeft",__name:"arrow-left",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.59 30.59 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.59 30.59 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0"})]))}}),mv=G0,Z0=O({name:"ArrowRight",__name:"arrow-right",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M340.864 149.312a30.59 30.59 0 0 0 0 42.752L652.736 512 340.864 831.872a30.59 30.59 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"})]))}}),gv=Z0,X0=O({name:"ArrowUp",__name:"arrow-up",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"})]))}}),yv=X0,Q0=O({name:"Calendar",__name:"calendar",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M128 384v512h768V192H768v32a32 32 0 1 1-64 0v-32H320v32a32 32 0 0 1-64 0v-32H128v128h768v64zm192-256h384V96a32 32 0 1 1 64 0v32h160a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h160V96a32 32 0 0 1 64 0zm-32 384h64a32 32 0 0 1 0 64h-64a32 32 0 0 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m192-192h64a32 32 0 0 1 0 64h-64a32 32 0 0 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m192-192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64"})]))}}),wv=Q0,em=O({name:"Check",__name:"check",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"})]))}}),bv=em,tm=O({name:"CircleCheckFilled",__name:"circle-check-filled",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}}),xv=tm,nm=O({name:"CircleCheck",__name:"circle-check",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),C("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752z"})]))}}),kv=nm,rm=O({name:"CircleCloseFilled",__name:"circle-close-filled",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}}),vv=rm,im=O({name:"CircleClose",__name:"circle-close",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),C("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),_v=im,om=O({name:"Clock",__name:"clock",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),C("path",{fill:"currentColor",d:"M480 256a32 32 0 0 1 32 32v256a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"}),C("path",{fill:"currentColor",d:"M480 512h256q32 0 32 32t-32 32H480q-32 0-32-32t32-32"})]))}}),Sv=om,sm=O({name:"Close",__name:"close",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),Cv=sm,lm=O({name:"DArrowLeft",__name:"d-arrow-left",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M529.408 149.376a29.12 29.12 0 0 1 41.728 0 30.59 30.59 0 0 1 0 42.688L259.264 511.936l311.872 319.936a30.59 30.59 0 0 1-.512 43.264 29.12 29.12 0 0 1-41.216-.512L197.76 534.272a32 32 0 0 1 0-44.672zm256 0a29.12 29.12 0 0 1 41.728 0 30.59 30.59 0 0 1 0 42.688L515.264 511.936l311.872 319.936a30.59 30.59 0 0 1-.512 43.264 29.12 29.12 0 0 1-41.216-.512L453.76 534.272a32 32 0 0 1 0-44.672z"})]))}}),Av=lm,am=O({name:"DArrowRight",__name:"d-arrow-right",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M452.864 149.312a29.12 29.12 0 0 1 41.728.064L826.24 489.664a32 32 0 0 1 0 44.672L494.592 874.624a29.12 29.12 0 0 1-41.728 0 30.59 30.59 0 0 1 0-42.752L764.736 512 452.864 192a30.59 30.59 0 0 1 0-42.688m-256 0a29.12 29.12 0 0 1 41.728.064L570.24 489.664a32 32 0 0 1 0 44.672L238.592 874.624a29.12 29.12 0 0 1-41.728 0 30.59 30.59 0 0 1 0-42.752L508.736 512 196.864 192a30.59 30.59 0 0 1 0-42.688"})]))}}),Mv=am,um=O({name:"Delete",__name:"delete",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),Ov=um,cm=O({name:"Document",__name:"document",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"})]))}}),Ev=cm,fm=O({name:"FullScreen",__name:"full-screen",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"})]))}}),Tv=fm,hm=O({name:"Hide",__name:"hide",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4s-12.8-9.6-22.4-9.6-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176S0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4s3.2 16 9.6 22.4 12.8 9.6 22.4 9.6 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4m-646.4 528Q115.2 579.2 76.8 512q43.2-72 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4m140.8-96Q352 555.2 352 512c0-44.8 16-83.2 48-112s67.2-48 112-48c28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6q-43.2 72-153.6 172.8c-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176S1024 528 1024 512s-48.001-73.6-134.401-176"}),C("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112s-67.2 48-112 48"})]))}}),Nv=hm,pm=O({name:"InfoFilled",__name:"info-filled",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.99 12.99 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}}),Dv=pm,dm=O({name:"Loading",__name:"loading",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248M828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0"})]))}}),Iv=dm,mm=O({name:"MoreFilled",__name:"more-filled",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M176 416a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224"})]))}}),zv=mm,gm=O({name:"PictureFilled",__name:"picture-filled",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M96 896a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h832a32 32 0 0 1 32 32v704a32 32 0 0 1-32 32zm315.52-228.48-68.928-68.928a32 32 0 0 0-45.248 0L128 768.064h778.688l-242.112-290.56a32 32 0 0 0-49.216 0L458.752 665.408a32 32 0 0 1-47.232 2.112M256 384a96 96 0 1 0 192.064-.064A96 96 0 0 0 256 384"})]))}}),Rv=gm,ym=O({name:"Plus",__name:"plus",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),Fv=ym,wm=O({name:"RefreshLeft",__name:"refresh-left",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M289.088 296.704h92.992a32 32 0 0 1 0 64H232.96a32 32 0 0 1-32-32V179.712a32 32 0 0 1 64 0v50.56a384 384 0 0 1 643.84 282.88 384 384 0 0 1-383.936 384 384 384 0 0 1-384-384h64a320 320 0 1 0 640 0 320 320 0 0 0-555.712-216.448z"})]))}}),Pv=wm,bm=O({name:"RefreshRight",__name:"refresh-right",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M784.512 230.272v-50.56a32 32 0 1 1 64 0v149.056a32 32 0 0 1-32 32H667.52a32 32 0 1 1 0-64h92.992A320 320 0 1 0 524.8 833.152a320 320 0 0 0 320-320h64a384 384 0 0 1-384 384 384 384 0 0 1-384-384 384 384 0 0 1 643.712-282.88"})]))}}),Lv=bm,xm=O({name:"ScaleToOriginal",__name:"scale-to-original",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M813.176 180.706a60.235 60.235 0 0 1 60.236 60.235v481.883a60.235 60.235 0 0 1-60.236 60.235H210.824a60.235 60.235 0 0 1-60.236-60.235V240.94a60.235 60.235 0 0 1 60.236-60.235h602.352zm0-60.235H210.824A120.47 120.47 0 0 0 90.353 240.94v481.883a120.47 120.47 0 0 0 120.47 120.47h602.353a120.47 120.47 0 0 0 120.471-120.47V240.94a120.47 120.47 0 0 0-120.47-120.47zm-120.47 180.705a30.12 30.12 0 0 0-30.118 30.118v301.177a30.118 30.118 0 0 0 60.236 0V331.294a30.12 30.12 0 0 0-30.118-30.118m-361.412 0a30.12 30.12 0 0 0-30.118 30.118v301.177a30.118 30.118 0 1 0 60.236 0V331.294a30.12 30.12 0 0 0-30.118-30.118M512 361.412a30.12 30.12 0 0 0-30.118 30.117v30.118a30.118 30.118 0 0 0 60.236 0V391.53A30.12 30.12 0 0 0 512 361.412M512 512a30.12 30.12 0 0 0-30.118 30.118v30.117a30.118 30.118 0 0 0 60.236 0v-30.117A30.12 30.12 0 0 0 512 512"})]))}}),Bv=xm,km=O({name:"SuccessFilled",__name:"success-filled",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}}),Vv=km,vm=O({name:"View",__name:"view",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),Hv=vm,_m=O({name:"WarningFilled",__name:"warning-filled",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.43 58.43 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.43 58.43 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}}),$v=_m,Sm=O({name:"ZoomIn",__name:"zoom-in",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"})]))}}),qv=Sm,Cm=O({name:"ZoomOut",__name:"zoom-out",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"})]))}}),jv=Cm;function gn(){return gn=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},gn.apply(this,arguments)}function Am(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,jr(n,e)}function Ss(n){return Ss=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ss(n)}function jr(n,e){return jr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},jr(n,e)}function Mm(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function zi(n,e,t){return Mm()?zi=Reflect.construct.bind():zi=function(i,o,s){var l=[null];l.push.apply(l,o);var a=Function.bind.apply(i,l),u=new a;return s&&jr(u,s.prototype),u},zi.apply(null,arguments)}function Om(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function Cs(n){var e=typeof Map=="function"?new Map:void 0;return Cs=function(r){if(r===null||!Om(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,i)}function i(){return zi(r,arguments,Ss(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),jr(i,r)},Cs(n)}var Em=/%[sdj%]/g,Tm=function(){};typeof process<"u"&&process.env;function As(n){if(!n||!n.length)return null;var e={};return n.forEach(function(t){var r=t.field;e[r]=e[r]||[],e[r].push(t)}),e}function We(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];var i=0,o=t.length;if(typeof n=="function")return n.apply(null,t);if(typeof n=="string"){var s=n.replace(Em,function(l){if(l==="%%")return"%";if(i>=o)return l;switch(l){case"%s":return String(t[i++]);case"%d":return Number(t[i++]);case"%j":try{return JSON.stringify(t[i++])}catch{return"[Circular]"}break;default:return l}});return s}return n}function Nm(n){return n==="string"||n==="url"||n==="hex"||n==="email"||n==="date"||n==="pattern"}function ue(n,e){return!!(n==null||e==="array"&&Array.isArray(n)&&!n.length||Nm(e)&&typeof n=="string"&&!n)}function Dm(n,e,t){var r=[],i=0,o=n.length;function s(l){r.push.apply(r,l||[]),i++,i===o&&t(r)}n.forEach(function(l){e(l,s)})}function va(n,e,t){var r=0,i=n.length;function o(s){if(s&&s.length){t(s);return}var l=r;r=r+1,l<i?e(n[l],o):t([])}o([])}function Im(n){var e=[];return Object.keys(n).forEach(function(t){e.push.apply(e,n[t]||[])}),e}var _a=function(n){Am(e,n);function e(t,r){var i;return i=n.call(this,"Async Validation Error")||this,i.errors=t,i.fields=r,i}return e}(Cs(Error));function zm(n,e,t,r,i){if(e.first){var o=new Promise(function(h,p){var d=function(g){return r(g),g.length?p(new _a(g,As(g))):h(i)},m=Im(n);va(m,t,d)});return o.catch(function(h){return h}),o}var s=e.firstFields===!0?Object.keys(n):e.firstFields||[],l=Object.keys(n),a=l.length,u=0,c=[],f=new Promise(function(h,p){var d=function(y){if(c.push.apply(c,y),u++,u===a)return r(c),c.length?p(new _a(c,As(c))):h(i)};l.length||(r(c),h(i)),l.forEach(function(m){var y=n[m];s.indexOf(m)!==-1?va(y,t,d):Dm(y,t,d)})});return f.catch(function(h){return h}),f}function Rm(n){return!!(n&&n.message!==void 0)}function Fm(n,e){for(var t=n,r=0;r<e.length;r++){if(t==null)return t;t=t[e[r]]}return t}function Sa(n,e){return function(t){var r;return n.fullFields?r=Fm(e,n.fullFields):r=e[t.field||n.fullField],Rm(t)?(t.field=t.field||n.fullField,t.fieldValue=r,t):{message:typeof t=="function"?t():t,fieldValue:r,field:t.field||n.fullField}}}function Ca(n,e){if(e){for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];typeof r=="object"&&typeof n[t]=="object"?n[t]=gn({},n[t],r):n[t]=r}}return n}var uf=function(e,t,r,i,o,s){e.required&&(!r.hasOwnProperty(e.field)||ue(t,s||e.type))&&i.push(We(o.messages.required,e.fullField))},Pm=function(e,t,r,i,o){(/^\s+$/.test(t)||t==="")&&i.push(We(o.messages.whitespace,e.fullField))},yi,Lm=function(){if(yi)return yi;var n="[a-fA-F\\d:]",e=function(S){return S&&S.includeBoundaries?"(?:(?<=\\s|^)(?="+n+")|(?<="+n+")(?=\\s|$))":""},t="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",i=(` |
| 2 |
(?: |
| 3 |
(?:`+r+":){7}(?:"+r+`|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8 |
| 4 |
(?:`+r+":){6}(?:"+t+"|:"+r+`|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4 |
| 5 |
(?:`+r+":){5}(?::"+t+"|(?::"+r+`){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4 |
| 6 |
(?:`+r+":){4}(?:(?::"+r+"){0,1}:"+t+"|(?::"+r+`){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4 |
| 7 |
(?:`+r+":){3}(?:(?::"+r+"){0,2}:"+t+"|(?::"+r+`){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4 |
| 8 |
(?:`+r+":){2}(?:(?::"+r+"){0,3}:"+t+"|(?::"+r+`){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4 |
| 9 |
(?:`+r+":){1}(?:(?::"+r+"){0,4}:"+t+"|(?::"+r+`){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4 |
| 10 |
(?::(?:(?::`+r+"){0,5}:"+t+"|(?::"+r+`){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4 |
| 11 |
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1 |
| 12 |
`).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),o=new RegExp("(?:^"+t+"$)|(?:^"+i+"$)"),s=new RegExp("^"+t+"$"),l=new RegExp("^"+i+"$"),a=function(S){return S&&S.exact?o:new RegExp("(?:"+e(S)+t+e(S)+")|(?:"+e(S)+i+e(S)+")","g")};a.v4=function(x){return x&&x.exact?s:new RegExp(""+e(x)+t+e(x),"g")},a.v6=function(x){return x&&x.exact?l:new RegExp(""+e(x)+i+e(x),"g")};var u="(?:(?:[a-z]+:)?//)",c="(?:\\S+(?::\\S*)?@)?",f=a.v4().source,h=a.v6().source,p="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",d="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",m="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",y="(?::\\d{2,5})?",g='(?:[/?#][^\\s"]*)?',_="(?:"+u+"|www\\.)"+c+"(?:localhost|"+f+"|"+h+"|"+p+d+m+")"+y+g;return yi=new RegExp("(?:^"+_+"$)","i"),yi},Aa={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},kr={integer:function(e){return kr.number(e)&&parseInt(e,10)===e},float:function(e){return kr.number(e)&&!kr.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return typeof e=="object"&&!kr.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(Aa.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(Lm())},hex:function(e){return typeof e=="string"&&!!e.match(Aa.hex)}},Bm=function(e,t,r,i,o){if(e.required&&t===void 0){uf(e,t,r,i,o);return}var s=["integer","float","array","regexp","object","method","email","number","date","url","hex"],l=e.type;s.indexOf(l)>-1?kr[l](t)||i.push(We(o.messages.types[l],e.fullField,e.type)):l&&typeof t!==e.type&&i.push(We(o.messages.types[l],e.fullField,e.type))},Vm=function(e,t,r,i,o){var s=typeof e.len=="number",l=typeof e.min=="number",a=typeof e.max=="number",u=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=t,f=null,h=typeof t=="number",p=typeof t=="string",d=Array.isArray(t);if(h?f="number":p?f="string":d&&(f="array"),!f)return!1;d&&(c=t.length),p&&(c=t.replace(u,"_").length),s?c!==e.len&&i.push(We(o.messages[f].len,e.fullField,e.len)):l&&!a&&c<e.min?i.push(We(o.messages[f].min,e.fullField,e.min)):a&&!l&&c>e.max?i.push(We(o.messages[f].max,e.fullField,e.max)):l&&a&&(c<e.min||c>e.max)&&i.push(We(o.messages[f].range,e.fullField,e.min,e.max))},Ln="enum",Hm=function(e,t,r,i,o){e[Ln]=Array.isArray(e[Ln])?e[Ln]:[],e[Ln].indexOf(t)===-1&&i.push(We(o.messages[Ln],e.fullField,e[Ln].join(", ")))},$m=function(e,t,r,i,o){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||i.push(We(o.messages.pattern.mismatch,e.fullField,t,e.pattern));else if(typeof e.pattern=="string"){var s=new RegExp(e.pattern);s.test(t)||i.push(We(o.messages.pattern.mismatch,e.fullField,t,e.pattern))}}},K={required:uf,whitespace:Pm,type:Bm,range:Vm,enum:Hm,pattern:$m},qm=function(e,t,r,i,o){var s=[],l=e.required||!e.required&&i.hasOwnProperty(e.field);if(l){if(ue(t,"string")&&!e.required)return r();K.required(e,t,i,s,o,"string"),ue(t,"string")||(K.type(e,t,i,s,o),K.range(e,t,i,s,o),K.pattern(e,t,i,s,o),e.whitespace===!0&&K.whitespace(e,t,i,s,o))}r(s)},jm=function(e,t,r,i,o){var s=[],l=e.required||!e.required&&i.hasOwnProperty(e.field);if(l){if(ue(t)&&!e.required)return r();K.required(e,t,i,s,o),t!==void 0&&K.type(e,t,i,s,o)}r(s)},Wm=function(e,t,r,i,o){var s=[],l=e.required||!e.required&&i.hasOwnProperty(e.field);if(l){if(t===""&&(t=void 0),ue(t)&&!e.required)return r();K.required(e,t,i,s,o),t!==void 0&&(K.type(e,t,i,s,o),K.range(e,t,i,s,o))}r(s)},Um=function(e,t,r,i,o){var s=[],l=e.required||!e.required&&i.hasOwnProperty(e.field);if(l){if(ue(t)&&!e.required)return r();K.required(e,t,i,s,o),t!==void 0&&K.type(e,t,i,s,o)}r(s)},Jm=function(e,t,r,i,o){var s=[],l=e.required||!e.required&&i.hasOwnProperty(e.field);if(l){if(ue(t)&&!e.required)return r();K.required(e,t,i,s,o),ue(t)||K.type(e,t,i,s,o)}r(s)},Km=function(e,t,r,i,o){var s=[],l=e.required||!e.required&&i.hasOwnProperty(e.field);if(l){if(ue(t)&&!e.required)return r();K.required(e,t,i,s,o),t!==void 0&&(K.type(e,t,i,s,o),K.range(e,t,i,s,o))}r(s)},Ym=function(e,t,r,i,o){var s=[],l=e.required||!e.required&&i.hasOwnProperty(e.field);if(l){if(ue(t)&&!e.required)return r();K.required(e,t,i,s,o),t!==void 0&&(K.type(e,t,i,s,o),K.range(e,t,i,s,o))}r(s)},Gm=function(e,t,r,i,o){var s=[],l=e.required||!e.required&&i.hasOwnProperty(e.field);if(l){if(t==null&&!e.required)return r();K.required(e,t,i,s,o,"array"),t!=null&&(K.type(e,t,i,s,o),K.range(e,t,i,s,o))}r(s)},Zm=function(e,t,r,i,o){var s=[],l=e.required||!e.required&&i.hasOwnProperty(e.field);if(l){if(ue(t)&&!e.required)return r();K.required(e,t,i,s,o),t!==void 0&&K.type(e,t,i,s,o)}r(s)},Xm="enum",Qm=function(e,t,r,i,o){var s=[],l=e.required||!e.required&&i.hasOwnProperty(e.field);if(l){if(ue(t)&&!e.required)return r();K.required(e,t,i,s,o),t!==void 0&&K[Xm](e,t,i,s,o)}r(s)},e1=function(e,t,r,i,o){var s=[],l=e.required||!e.required&&i.hasOwnProperty(e.field);if(l){if(ue(t,"string")&&!e.required)return r();K.required(e,t,i,s,o),ue(t,"string")||K.pattern(e,t,i,s,o)}r(s)},t1=function(e,t,r,i,o){var s=[],l=e.required||!e.required&&i.hasOwnProperty(e.field);if(l){if(ue(t,"date")&&!e.required)return r();if(K.required(e,t,i,s,o),!ue(t,"date")){var a;t instanceof Date?a=t:a=new Date(t),K.type(e,a,i,s,o),a&&K.range(e,a.getTime(),i,s,o)}}r(s)},n1=function(e,t,r,i,o){var s=[],l=Array.isArray(t)?"array":typeof t;K.required(e,t,i,s,o,l),r(s)},Bo=function(e,t,r,i,o){var s=e.type,l=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(ue(t,s)&&!e.required)return r();K.required(e,t,i,l,o,s),ue(t,s)||K.type(e,t,i,l,o)}r(l)},r1=function(e,t,r,i,o){var s=[],l=e.required||!e.required&&i.hasOwnProperty(e.field);if(l){if(ue(t)&&!e.required)return r();K.required(e,t,i,s,o)}r(s)},Tr={string:qm,method:jm,number:Wm,boolean:Um,regexp:Jm,integer:Km,float:Ym,array:Gm,object:Zm,enum:Qm,pattern:e1,date:t1,url:Bo,hex:Bo,email:Bo,required:n1,any:r1};function Ms(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var Os=Ms(),xo=function(){function n(t){this.rules=null,this._messages=Os,this.define(t)}var e=n.prototype;return e.define=function(r){var i=this;if(!r)throw new Error("Cannot configure a schema with no rules");if(typeof r!="object"||Array.isArray(r))throw new Error("Rules must be an object");this.rules={},Object.keys(r).forEach(function(o){var s=r[o];i.rules[o]=Array.isArray(s)?s:[s]})},e.messages=function(r){return r&&(this._messages=Ca(Ms(),r)),this._messages},e.validate=function(r,i,o){var s=this;i===void 0&&(i={}),o===void 0&&(o=function(){});var l=r,a=i,u=o;if(typeof a=="function"&&(u=a,a={}),!this.rules||Object.keys(this.rules).length===0)return u&&u(null,l),Promise.resolve(l);function c(m){var y=[],g={};function _(S){if(Array.isArray(S)){var M;y=(M=y).concat.apply(M,S)}else y.push(S)}for(var x=0;x<m.length;x++)_(m[x]);y.length?(g=As(y),u(y,g)):u(null,l)}if(a.messages){var f=this.messages();f===Os&&(f=Ms()),Ca(f,a.messages),a.messages=f}else a.messages=this.messages();var h={},p=a.keys||Object.keys(this.rules);p.forEach(function(m){var y=s.rules[m],g=l[m];y.forEach(function(_){var x=_;typeof x.transform=="function"&&(l===r&&(l=gn({},l)),g=l[m]=x.transform(g)),typeof x=="function"?x={validator:x}:x=gn({},x),x.validator=s.getValidationMethod(x),x.validator&&(x.field=m,x.fullField=x.fullField||m,x.type=s.getType(x),h[m]=h[m]||[],h[m].push({rule:x,value:g,source:l,field:m}))})});var d={};return zm(h,a,function(m,y){var g=m.rule,_=(g.type==="object"||g.type==="array")&&(typeof g.fields=="object"||typeof g.defaultField=="object");_=_&&(g.required||!g.required&&m.value),g.field=m.field;function x(k,F){return gn({},F,{fullField:g.fullField+"."+k,fullFields:g.fullFields?[].concat(g.fullFields,[k]):[k]})}function S(k){k===void 0&&(k=[]);var F=Array.isArray(k)?k:[k];!a.suppressWarning&&F.length&&n.warning("async-validator:",F),F.length&&g.message!==void 0&&(F=[].concat(g.message));var L=F.map(Sa(g,l));if(a.first&&L.length)return d[g.field]=1,y(L);if(!_)y(L);else{if(g.required&&!m.value)return g.message!==void 0?L=[].concat(g.message).map(Sa(g,l)):a.error&&(L=[a.error(g,We(a.messages.required,g.field))]),y(L);var N={};g.defaultField&&Object.keys(m.value).map(function(D){N[D]=g.defaultField}),N=gn({},N,m.rule.fields);var v={};Object.keys(N).forEach(function(D){var B=N[D],W=Array.isArray(B)?B:[B];v[D]=W.map(x.bind(null,D))});var z=new n(v);z.messages(a.messages),m.rule.options&&(m.rule.options.messages=a.messages,m.rule.options.error=a.error),z.validate(m.value,m.rule.options||a,function(D){var B=[];L&&L.length&&B.push.apply(B,L),D&&D.length&&B.push.apply(B,D),y(B.length?B:null)})}}var M;if(g.asyncValidator)M=g.asyncValidator(g,m.value,S,m.source,a);else if(g.validator){try{M=g.validator(g,m.value,S,m.source,a)}catch(k){console.error==null||console.error(k),a.suppressValidatorError||setTimeout(function(){throw k},0),S(k.message)}M===!0?S():M===!1?S(typeof g.message=="function"?g.message(g.fullField||g.field):g.message||(g.fullField||g.field)+" fails"):M instanceof Array?S(M):M instanceof Error&&S(M.message)}M&&M.then&&M.then(function(){return S()},function(k){return S(k)})},function(m){c(m)},l)},e.getType=function(r){if(r.type===void 0&&r.pattern instanceof RegExp&&(r.type="pattern"),typeof r.validator!="function"&&r.type&&!Tr.hasOwnProperty(r.type))throw new Error(We("Unknown rule type %s",r.type));return r.type||"string"},e.getValidationMethod=function(r){if(typeof r.validator=="function")return r.validator;var i=Object.keys(r),o=i.indexOf("message");return o!==-1&&i.splice(o,1),i.length===1&&i[0]==="required"?Tr.required:Tr[this.getType(r)]||void 0},n}();xo.register=function(e,t){if(typeof t!="function")throw new Error("Cannot register a validator by type, validator is not a function");Tr[e]=t};xo.warning=Tm;xo.messages=Os;xo.validators=Tr;function ye(n,e){i1(n)&&(n="100%");const t=o1(n);return n=e===360?n:Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(String(n*e),10)/100),Math.abs(n-e)<1e-6?1:(e===360?n=(n<0?n%e+e:n%e)/parseFloat(String(e)):n=n%e/parseFloat(String(e)),n)}function wi(n){return Math.min(1,Math.max(0,n))}function i1(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function o1(n){return typeof n=="string"&&n.indexOf("%")!==-1}function cf(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function bi(n){return Number(n)<=1?`${Number(n)*100}%`:n}function yn(n){return n.length===1?"0"+n:String(n)}function s1(n,e,t){return{r:ye(n,255)*255,g:ye(e,255)*255,b:ye(t,255)*255}}function Ma(n,e,t){n=ye(n,255),e=ye(e,255),t=ye(t,255);const r=Math.max(n,e,t),i=Math.min(n,e,t);let o=0,s=0;const l=(r+i)/2;if(r===i)s=0,o=0;else{const a=r-i;switch(s=l>.5?a/(2-r-i):a/(r+i),r){case n:o=(e-t)/a+(e<t?6:0);break;case e:o=(t-n)/a+2;break;case t:o=(n-e)/a+4;break}o/=6}return{h:o,s,l}}function Vo(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*(6*t):t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function l1(n,e,t){let r,i,o;if(n=ye(n,360),e=ye(e,100),t=ye(t,100),e===0)i=t,o=t,r=t;else{const s=t<.5?t*(1+e):t+e-t*e,l=2*t-s;r=Vo(l,s,n+1/3),i=Vo(l,s,n),o=Vo(l,s,n-1/3)}return{r:r*255,g:i*255,b:o*255}}function Oa(n,e,t){n=ye(n,255),e=ye(e,255),t=ye(t,255);const r=Math.max(n,e,t),i=Math.min(n,e,t);let o=0;const s=r,l=r-i,a=r===0?0:l/r;if(r===i)o=0;else{switch(r){case n:o=(e-t)/l+(e<t?6:0);break;case e:o=(t-n)/l+2;break;case t:o=(n-e)/l+4;break}o/=6}return{h:o,s:a,v:s}}function a1(n,e,t){n=ye(n,360)*6,e=ye(e,100),t=ye(t,100);const r=Math.floor(n),i=n-r,o=t*(1-e),s=t*(1-i*e),l=t*(1-(1-i)*e),a=r%6,u=[t,s,o,o,l,t][a],c=[l,t,t,s,o,o][a],f=[o,o,l,t,t,s][a];return{r:u*255,g:c*255,b:f*255}}function Ea(n,e,t,r){const i=[yn(Math.round(n).toString(16)),yn(Math.round(e).toString(16)),yn(Math.round(t).toString(16))];return r&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function u1(n,e,t,r,i){const o=[yn(Math.round(n).toString(16)),yn(Math.round(e).toString(16)),yn(Math.round(t).toString(16)),yn(f1(r))];return i&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))&&o[3].startsWith(o[3].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function c1(n,e,t,r){const i=n/100,o=e/100,s=t/100,l=r/100,a=255*(1-i)*(1-l),u=255*(1-o)*(1-l),c=255*(1-s)*(1-l);return{r:a,g:u,b:c}}function Ta(n,e,t){let r=1-n/255,i=1-e/255,o=1-t/255,s=Math.min(r,i,o);return s===1?(r=0,i=0,o=0):(r=(r-s)/(1-s)*100,i=(i-s)/(1-s)*100,o=(o-s)/(1-s)*100),s*=100,{c:Math.round(r),m:Math.round(i),y:Math.round(o),k:Math.round(s)}}function f1(n){return Math.round(parseFloat(n)*255).toString(16)}function Na(n){return qe(n)/255}function qe(n){return parseInt(n,16)}function h1(n){return{r:n>>16,g:(n&65280)>>8,b:n&255}}const Es={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function p1(n){let e={r:0,g:0,b:0},t=1,r=null,i=null,o=null,s=!1,l=!1;return typeof n=="string"&&(n=g1(n)),typeof n=="object"&&($e(n.r)&&$e(n.g)&&$e(n.b)?(e=s1(n.r,n.g,n.b),s=!0,l=String(n.r).substr(-1)==="%"?"prgb":"rgb"):$e(n.h)&&$e(n.s)&&$e(n.v)?(r=bi(n.s),i=bi(n.v),e=a1(n.h,r,i),s=!0,l="hsv"):$e(n.h)&&$e(n.s)&&$e(n.l)?(r=bi(n.s),o=bi(n.l),e=l1(n.h,r,o),s=!0,l="hsl"):$e(n.c)&&$e(n.m)&&$e(n.y)&&$e(n.k)&&(e=c1(n.c,n.m,n.y,n.k),s=!0,l="cmyk"),Object.prototype.hasOwnProperty.call(n,"a")&&(t=n.a)),t=cf(t),{ok:s,format:n.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}const d1="[-\\+]?\\d+%?",m1="[-\\+]?\\d*\\.\\d+%?",Yt="(?:"+m1+")|(?:"+d1+")",Ho="[\\s|\\(]+("+Yt+")[,|\\s]+("+Yt+")[,|\\s]+("+Yt+")\\s*\\)?",xi="[\\s|\\(]+("+Yt+")[,|\\s]+("+Yt+")[,|\\s]+("+Yt+")[,|\\s]+("+Yt+")\\s*\\)?",Ye={CSS_UNIT:new RegExp(Yt),rgb:new RegExp("rgb"+Ho),rgba:new RegExp("rgba"+xi),hsl:new RegExp("hsl"+Ho),hsla:new RegExp("hsla"+xi),hsv:new RegExp("hsv"+Ho),hsva:new RegExp("hsva"+xi),cmyk:new RegExp("cmyk"+xi),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function g1(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;let e=!1;if(Es[n])n=Es[n],e=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};let t=Ye.rgb.exec(n);return t?{r:t[1],g:t[2],b:t[3]}:(t=Ye.rgba.exec(n),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Ye.hsl.exec(n),t?{h:t[1],s:t[2],l:t[3]}:(t=Ye.hsla.exec(n),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Ye.hsv.exec(n),t?{h:t[1],s:t[2],v:t[3]}:(t=Ye.hsva.exec(n),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Ye.cmyk.exec(n),t?{c:t[1],m:t[2],y:t[3],k:t[4]}:(t=Ye.hex8.exec(n),t?{r:qe(t[1]),g:qe(t[2]),b:qe(t[3]),a:Na(t[4]),format:e?"name":"hex8"}:(t=Ye.hex6.exec(n),t?{r:qe(t[1]),g:qe(t[2]),b:qe(t[3]),format:e?"name":"hex"}:(t=Ye.hex4.exec(n),t?{r:qe(t[1]+t[1]),g:qe(t[2]+t[2]),b:qe(t[3]+t[3]),a:Na(t[4]+t[4]),format:e?"name":"hex8"}:(t=Ye.hex3.exec(n),t?{r:qe(t[1]+t[1]),g:qe(t[2]+t[2]),b:qe(t[3]+t[3]),format:e?"name":"hex"}:!1))))))))))}function $e(n){return typeof n=="number"?!Number.isNaN(n):Ye.CSS_UNIT.test(n)}class oe{constructor(e="",t={}){if(e instanceof oe)return e;typeof e=="number"&&(e=h1(e)),this.originalInput=e;const r=p1(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=t.format??r.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3}getLuminance(){const e=this.toRgb();let t,r,i;const o=e.r/255,s=e.g/255,l=e.b/255;return o<=.03928?t=o/12.92:t=Math.pow((o+.055)/1.055,2.4),s<=.03928?r=s/12.92:r=Math.pow((s+.055)/1.055,2.4),l<=.03928?i=l/12.92:i=Math.pow((l+.055)/1.055,2.4),.2126*t+.7152*r+.0722*i}getAlpha(){return this.a}setAlpha(e){return this.a=cf(e),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:e}=this.toHsl();return e===0}toHsv(){const e=Oa(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}}toHsvString(){const e=Oa(this.r,this.g,this.b),t=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.v*100);return this.a===1?`hsv(${t}, ${r}%, ${i}%)`:`hsva(${t}, ${r}%, ${i}%, ${this.roundA})`}toHsl(){const e=Ma(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}}toHslString(){const e=Ma(this.r,this.g,this.b),t=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.l*100);return this.a===1?`hsl(${t}, ${r}%, ${i}%)`:`hsla(${t}, ${r}%, ${i}%, ${this.roundA})`}toHex(e=!1){return Ea(this.r,this.g,this.b,e)}toHexString(e=!1){return"#"+this.toHex(e)}toHex8(e=!1){return u1(this.r,this.g,this.b,this.a,e)}toHex8String(e=!1){return"#"+this.toHex8(e)}toHexShortString(e=!1){return this.a===1?this.toHexString(e):this.toHex8String(e)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const e=Math.round(this.r),t=Math.round(this.g),r=Math.round(this.b);return this.a===1?`rgb(${e}, ${t}, ${r})`:`rgba(${e}, ${t}, ${r}, ${this.roundA})`}toPercentageRgb(){const e=t=>`${Math.round(ye(t,255)*100)}%`;return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}}toPercentageRgbString(){const e=t=>Math.round(ye(t,255)*100);return this.a===1?`rgb(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%)`:`rgba(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%, ${this.roundA})`}toCmyk(){return{...Ta(this.r,this.g,this.b)}}toCmykString(){const{c:e,m:t,y:r,k:i}=Ta(this.r,this.g,this.b);return`cmyk(${e}, ${t}, ${r}, ${i})`}toName(){if(this.a===0)return"transparent";if(this.a<1)return!1;const e="#"+Ea(this.r,this.g,this.b,!1);for(const[t,r]of Object.entries(Es))if(e===r)return t;return!1}toString(e){const t=!!e;e=e??this.format;let r=!1;const i=this.a<1&&this.a>=0;return!t&&i&&(e.startsWith("hex")||e==="name")?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),e==="cmyk"&&(r=this.toCmykString()),r||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new oe(this.toString())}lighten(e=10){const t=this.toHsl();return t.l+=e/100,t.l=wi(t.l),new oe(t)}brighten(e=10){const t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new oe(t)}darken(e=10){const t=this.toHsl();return t.l-=e/100,t.l=wi(t.l),new oe(t)}tint(e=10){return this.mix("white",e)}shade(e=10){return this.mix("black",e)}desaturate(e=10){const t=this.toHsl();return t.s-=e/100,t.s=wi(t.s),new oe(t)}saturate(e=10){const t=this.toHsl();return t.s+=e/100,t.s=wi(t.s),new oe(t)}greyscale(){return this.desaturate(100)}spin(e){const t=this.toHsl(),r=(t.h+e)%360;return t.h=r<0?360+r:r,new oe(t)}mix(e,t=50){const r=this.toRgb(),i=new oe(e).toRgb(),o=t/100,s={r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a};return new oe(s)}analogous(e=6,t=30){const r=this.toHsl(),i=360/t,o=[this];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(new oe(r));return o}complement(){const e=this.toHsl();return e.h=(e.h+180)%360,new oe(e)}monochromatic(e=6){const t=this.toHsv(),{h:r}=t,{s:i}=t;let{v:o}=t;const s=[],l=1/e;for(;e--;)s.push(new oe({h:r,s:i,v:o})),o=(o+l)%1;return s}splitcomplement(){const e=this.toHsl(),{h:t}=e;return[this,new oe({h:(t+72)%360,s:e.s,l:e.l}),new oe({h:(t+216)%360,s:e.s,l:e.l})]}onBackground(e){const t=this.toRgb(),r=new oe(e).toRgb(),i=t.a+r.a*(1-t.a);return new oe({r:(t.r*t.a+r.r*r.a*(1-t.a))/i,g:(t.g*t.a+r.g*r.a*(1-t.a))/i,b:(t.b*t.a+r.b*r.a*(1-t.a))/i,a:i})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(e){const t=this.toHsl(),{h:r}=t,i=[this],o=360/e;for(let s=1;s<e;s++)i.push(new oe({h:(r+s*o)%360,s:t.s,l:t.l}));return i}equals(e){const t=new oe(e);return this.format==="cmyk"||t.format==="cmyk"?this.toCmykString()===t.toCmykString():this.toRgbString()===t.toRgbString()}}var Da=!1,dn,Ts,Ns,Ri,Fi,ff,Pi,Ds,Is,zs,hf,Rs,Fs,pf,df;function De(){if(!Da){Da=!0;var n=navigator.userAgent,e=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(n),t=/(Mac OS X)|(Windows)|(Linux)/.exec(n);if(Rs=/\b(iPhone|iP[ao]d)/.exec(n),Fs=/\b(iP[ao]d)/.exec(n),zs=/Android/i.exec(n),pf=/FBAN\/\w+;/i.exec(n),df=/Mobile/i.exec(n),hf=!!/Win64/.exec(n),e){dn=e[1]?parseFloat(e[1]):e[5]?parseFloat(e[5]):NaN,dn&&document&&document.documentMode&&(dn=document.documentMode);var r=/(?:Trident\/(\d+.\d+))/.exec(n);ff=r?parseFloat(r[1])+4:dn,Ts=e[2]?parseFloat(e[2]):NaN,Ns=e[3]?parseFloat(e[3]):NaN,Ri=e[4]?parseFloat(e[4]):NaN,Ri?(e=/(?:Chrome\/(\d+\.\d+))/.exec(n),Fi=e&&e[1]?parseFloat(e[1]):NaN):Fi=NaN}else dn=Ts=Ns=Fi=Ri=NaN;if(t){if(t[1]){var i=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(n);Pi=i?parseFloat(i[1].replace("_",".")):!0}else Pi=!1;Ds=!!t[2],Is=!!t[3]}else Pi=Ds=Is=!1}}var Ps={ie:function(){return De()||dn},ieCompatibilityMode:function(){return De()||ff>dn},ie64:function(){return Ps.ie()&&hf},firefox:function(){return De()||Ts},opera:function(){return De()||Ns},webkit:function(){return De()||Ri},safari:function(){return Ps.webkit()},chrome:function(){return De()||Fi},windows:function(){return De()||Ds},osx:function(){return De()||Pi},linux:function(){return De()||Is},iphone:function(){return De()||Rs},mobile:function(){return De()||Rs||Fs||zs||df},nativeApp:function(){return De()||pf},android:function(){return De()||zs},ipad:function(){return De()||Fs}},y1=Ps,ki=!!(typeof window<"u"&&window.document&&window.document.createElement),w1={canUseDOM:ki,canUseWorkers:typeof Worker<"u",canUseEventListeners:ki&&!!(window.addEventListener||window.attachEvent),canUseViewport:ki&&!!window.screen,isInWorker:!ki},mf=w1,gf;mf.canUseDOM&&(gf=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);function b1(n,e){if(!mf.canUseDOM||e&&!("addEventListener"in document))return!1;var t="on"+n,r=t in document;if(!r){var i=document.createElement("div");i.setAttribute(t,"return;"),r=typeof i[t]=="function"}return!r&&gf&&n==="wheel"&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var x1=b1,Ia=10,za=40,Ra=800;function yf(n){var e=0,t=0,r=0,i=0;return"detail"in n&&(t=n.detail),"wheelDelta"in n&&(t=-n.wheelDelta/120),"wheelDeltaY"in n&&(t=-n.wheelDeltaY/120),"wheelDeltaX"in n&&(e=-n.wheelDeltaX/120),"axis"in n&&n.axis===n.HORIZONTAL_AXIS&&(e=t,t=0),r=e*Ia,i=t*Ia,"deltaY"in n&&(i=n.deltaY),"deltaX"in n&&(r=n.deltaX),(r||i)&&n.deltaMode&&(n.deltaMode==1?(r*=za,i*=za):(r*=Ra,i*=Ra)),r&&!e&&(e=r<1?-1:1),i&&!t&&(t=i<1?-1:1),{spinX:e,spinY:t,pixelX:r,pixelY:i}}yf.getEventType=function(){return y1.firefox()?"DOMMouseScroll":x1("wheel")?"wheel":"mousewheel"};var Wv=yf;/** |
| 13 |
* Checks if an event is supported in the current execution environment. |
| 14 |
* |
| 15 |
* NOTE: This will not work correctly for non-generic events such as `change`, |
| 16 |
* `reset`, `load`, `error`, and `select`. |
| 17 |
* |
| 18 |
* Borrows from Modernizr. |
| 19 |
* |
| 20 |
* @param {string} eventNameSuffix Event name, e.g. "click". |
| 21 |
* @param {?boolean} capture Check if the capture phase is supported. |
| 22 |
* @return {boolean} True if the event is supported. |
| 23 |
* @internal |
| 24 |
* @license Modernizr 3.0.0pre (Custom Build) | MIT |
| 25 |
*/var Uv=!1,mt=(n=>(n.LOADING="loading",n.LOADED="loaded",n.ERROR="error",n))(mt||{});const k1=typeof window<"u"&&window!==null,v1=A1(),_1=Object.prototype.propertyIsEnumerable,Fa=Object.getOwnPropertySymbols;function Nr(n){return typeof n=="function"||toString.call(n)==="[object Object]"}function S1(n){return typeof n=="object"?n===null:typeof n!="function"}function C1(n){return n!=="__proto__"&&n!=="constructor"&&n!=="prototype"}function A1(){return k1&&"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype?("isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get(){return this.intersectionRatio>0}}),!0):!1}function M1(n,...e){if(!Nr(n))throw new TypeError("expected the first argument to be an object");if(e.length===0||typeof Symbol!="function"||typeof Fa!="function")return n;for(const t of e){const r=Fa(t);for(const i of r)_1.call(t,i)&&(n[i]=t[i])}return n}function wf(n,...e){let t=0;for(S1(n)&&(n=e[t++]),n||(n={});t<e.length;t++)if(Nr(e[t])){for(const r of Object.keys(e[t]))C1(r)&&(Nr(n[r])&&Nr(e[t][r])?wf(n[r],e[t][r]):n[r]=e[t][r]);M1(n,e[t])}return n}const Pa="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",O1="",E1={rootMargin:"0px",threshold:0},Bn="data-lazy-timeout-id";class T1{constructor(e){this.options={loading:Pa,error:O1,observerOptions:E1,log:!0,lifecycle:{},logLevel:"error"},this._images=new WeakMap,this.config(e)}config(e={}){wf(this.options,e)}mount(e,t){if(!e)return;const{src:r,loading:i,error:o,lifecycle:s,delay:l}=this._valueFormatter(typeof t=="string"?t:t.value);this._lifecycle(mt.LOADING,s,e),e.setAttribute("src",i||Pa),v1||(this.loadImages(e,r,o,s),this._log(()=>{this._logger("Not support IntersectionObserver!")})),this._initIntersectionObserver(e,r,o,s,l)}update(e,t){var l;if(!e)return;(l=this._realObserver(e))==null||l.unobserve(e);const{src:r,error:i,lifecycle:o,delay:s}=this._valueFormatter(typeof t=="string"?t:t.value);this._initIntersectionObserver(e,r,i,o,s)}unmount(e){var t;e&&((t=this._realObserver(e))==null||t.unobserve(e),this._images.delete(e))}loadImages(e,t,r,i){this._setImageSrc(e,t,r,i)}_setImageSrc(e,t,r,i){e.tagName.toLowerCase()==="img"?(t&&e.getAttribute("src")!==t&&e.setAttribute("src",t),this._listenImageStatus(e,()=>{this._lifecycle(mt.LOADED,i,e)},()=>{var o;e.onload=null,this._lifecycle(mt.ERROR,i,e),(o=this._realObserver(e))==null||o.disconnect(),r&&e.getAttribute("src")!==r&&e.setAttribute("src",r),this._log(()=>{this._logger(`Image failed to load!And failed src was: ${t} `)})})):e.style.backgroundImage=`url('${t}')`}_initIntersectionObserver(e,t,r,i,o){var l;const s=this.options.observerOptions;this._images.set(e,new IntersectionObserver(a=>{Array.prototype.forEach.call(a,u=>{o&&o>0?this._delayedIntersectionCallback(e,u,o,t,r,i):this._intersectionCallback(e,u,t,r,i)})},s)),(l=this._realObserver(e))==null||l.observe(e)}_intersectionCallback(e,t,r,i,o){var s;t.isIntersecting&&((s=this._realObserver(e))==null||s.unobserve(t.target),this._setImageSrc(e,r,i,o))}_delayedIntersectionCallback(e,t,r,i,o,s){if(t.isIntersecting){if(t.target.hasAttribute(Bn))return;const l=setTimeout(()=>{this._intersectionCallback(e,t,i,o,s),t.target.removeAttribute(Bn)},r);t.target.setAttribute(Bn,String(l))}else t.target.hasAttribute(Bn)&&(clearTimeout(Number(t.target.getAttribute(Bn))),t.target.removeAttribute(Bn))}_listenImageStatus(e,t,r){e.onload=t,e.onerror=r}_valueFormatter(e){let t=e,r=this.options.loading,i=this.options.error,o=this.options.lifecycle,s=this.options.delay;return Nr(e)&&(t=e.src,r=e.loading||this.options.loading,i=e.error||this.options.error,o=e.lifecycle||this.options.lifecycle,s=e.delay||this.options.delay),{src:t,loading:r,error:i,lifecycle:o,delay:s}}_log(e){this.options.log&&e()}_lifecycle(e,t,r){switch(e){case mt.LOADING:r==null||r.setAttribute("lazy",mt.LOADING),t!=null&&t.loading&&t.loading(r);break;case mt.LOADED:r==null||r.setAttribute("lazy",mt.LOADED),t!=null&&t.loaded&&t.loaded(r);break;case mt.ERROR:r==null||r.setAttribute("lazy",mt.ERROR),t!=null&&t.error&&t.error(r);break}}_realObserver(e){return this._images.get(e)}_logger(e,...t){let r=console.error;switch(this.options.logLevel){case"error":r=console.error;break;case"warn":r=console.warn;break;case"info":r=console.info;break;case"debug":r=console.debug;break}r(e,t)}}const Jv={install(n,e){const t=new T1(e);n.config.globalProperties.$Lazyload=t,n.provide("Lazyload",t),n.directive("lazy",{mounted:t.mount.bind(t),updated:t.update.bind(t),unmounted:t.unmount.bind(t)})}};/*! Element Plus Icons Vue v2.3.1 */var N1=O({name:"AlarmClock",__name:"alarm-clock",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M512 832a320 320 0 1 0 0-640 320 320 0 0 0 0 640m0 64a384 384 0 1 1 0-768 384 384 0 0 1 0 768"}),C("path",{fill:"currentColor",d:"m292.288 824.576 55.424 32-48 83.136a32 32 0 1 1-55.424-32zm439.424 0-55.424 32 48 83.136a32 32 0 1 0 55.424-32zM512 512h160a32 32 0 1 1 0 64H480a32 32 0 0 1-32-32V320a32 32 0 0 1 64 0zM90.496 312.256A160 160 0 0 1 312.32 90.496l-46.848 46.848a96 96 0 0 0-128 128L90.56 312.256zm835.264 0A160 160 0 0 0 704 90.496l46.848 46.848a96 96 0 0 1 128 128z"})]))}}),Kv=N1,D1=O({name:"ArrowDown",__name:"arrow-down",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"})]))}}),Yv=D1,I1=O({name:"ArrowLeftBold",__name:"arrow-left-bold",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M685.248 104.704a64 64 0 0 1 0 90.496L368.448 512l316.8 316.8a64 64 0 0 1-90.496 90.496L232.704 557.248a64 64 0 0 1 0-90.496l362.048-362.048a64 64 0 0 1 90.496 0z"})]))}}),Gv=I1,z1=O({name:"ArrowLeft",__name:"arrow-left",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"})]))}}),Zv=z1,R1=O({name:"ArrowRightBold",__name:"arrow-right-bold",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M338.752 104.704a64 64 0 0 0 0 90.496l316.8 316.8-316.8 316.8a64 64 0 0 0 90.496 90.496l362.048-362.048a64 64 0 0 0 0-90.496L429.248 104.704a64 64 0 0 0-90.496 0z"})]))}}),Xv=R1,F1=O({name:"ArrowRight",__name:"arrow-right",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"})]))}}),Qv=F1,P1=O({name:"ArrowUp",__name:"arrow-up",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"})]))}}),e_=P1,L1=O({name:"Avatar",__name:"avatar",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M628.736 528.896A416 416 0 0 1 928 928H96a415.872 415.872 0 0 1 299.264-399.104L512 704zM720 304a208 208 0 1 1-416 0 208 208 0 0 1 416 0"})]))}}),t_=L1,B1=O({name:"Back",__name:"back",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M224 480h640a32 32 0 1 1 0 64H224a32 32 0 0 1 0-64"}),C("path",{fill:"currentColor",d:"m237.248 512 265.408 265.344a32 32 0 0 1-45.312 45.312l-288-288a32 32 0 0 1 0-45.312l288-288a32 32 0 1 1 45.312 45.312z"})]))}}),n_=B1,V1=O({name:"Baseball",__name:"baseball",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M195.2 828.8a448 448 0 1 1 633.6-633.6 448 448 0 0 1-633.6 633.6zm45.248-45.248a384 384 0 1 0 543.104-543.104 384 384 0 0 0-543.104 543.104"}),C("path",{fill:"currentColor",d:"M497.472 96.896c22.784 4.672 44.416 9.472 64.896 14.528a256.128 256.128 0 0 0 350.208 350.208c5.056 20.48 9.856 42.112 14.528 64.896A320.128 320.128 0 0 1 497.472 96.896zM108.48 491.904a320.128 320.128 0 0 1 423.616 423.68c-23.04-3.648-44.992-7.424-65.728-11.52a256.128 256.128 0 0 0-346.496-346.432 1736.64 1736.64 0 0 1-11.392-65.728z"})]))}}),r_=V1,H1=O({name:"Bell",__name:"bell",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M512 64a64 64 0 0 1 64 64v64H448v-64a64 64 0 0 1 64-64"}),C("path",{fill:"currentColor",d:"M256 768h512V448a256 256 0 1 0-512 0zm256-640a320 320 0 0 1 320 320v384H192V448a320 320 0 0 1 320-320"}),C("path",{fill:"currentColor",d:"M96 768h832q32 0 32 32t-32 32H96q-32 0-32-32t32-32m352 128h128a64 64 0 0 1-128 0"})]))}}),i_=H1,$1=O({name:"Bottom",__name:"bottom",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M544 805.888V168a32 32 0 1 0-64 0v637.888L246.656 557.952a30.72 30.72 0 0 0-45.312 0 35.52 35.52 0 0 0 0 48.064l288 306.048a30.72 30.72 0 0 0 45.312 0l288-306.048a35.52 35.52 0 0 0 0-48 30.72 30.72 0 0 0-45.312 0L544 805.824z"})]))}}),o_=$1,q1=O({name:"Calendar",__name:"calendar",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M128 384v512h768V192H768v32a32 32 0 1 1-64 0v-32H320v32a32 32 0 0 1-64 0v-32H128v128h768v64zm192-256h384V96a32 32 0 1 1 64 0v32h160a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h160V96a32 32 0 0 1 64 0zm-32 384h64a32 32 0 0 1 0 64h-64a32 32 0 0 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m192-192h64a32 32 0 0 1 0 64h-64a32 32 0 0 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m192-192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64"})]))}}),s_=q1,j1=O({name:"CameraFilled",__name:"camera-filled",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M160 224a64 64 0 0 0-64 64v512a64 64 0 0 0 64 64h704a64 64 0 0 0 64-64V288a64 64 0 0 0-64-64H748.416l-46.464-92.672A64 64 0 0 0 644.736 96H379.328a64 64 0 0 0-57.216 35.392L275.776 224zm352 435.2a115.2 115.2 0 1 0 0-230.4 115.2 115.2 0 0 0 0 230.4m0 140.8a256 256 0 1 1 0-512 256 256 0 0 1 0 512"})]))}}),l_=j1,W1=O({name:"ChatDotRound",__name:"chat-dot-round",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"m174.72 855.68 135.296-45.12 23.68 11.84C388.096 849.536 448.576 864 512 864c211.84 0 384-166.784 384-352S723.84 160 512 160 128 326.784 128 512c0 69.12 24.96 139.264 70.848 199.232l22.08 28.8-46.272 115.584zm-45.248 82.56A32 32 0 0 1 89.6 896l58.368-145.92C94.72 680.32 64 596.864 64 512 64 299.904 256 96 512 96s448 203.904 448 416-192 416-448 416a461.056 461.056 0 0 1-206.912-48.384l-175.616 58.56z"}),C("path",{fill:"currentColor",d:"M512 563.2a51.2 51.2 0 1 1 0-102.4 51.2 51.2 0 0 1 0 102.4m192 0a51.2 51.2 0 1 1 0-102.4 51.2 51.2 0 0 1 0 102.4m-384 0a51.2 51.2 0 1 1 0-102.4 51.2 51.2 0 0 1 0 102.4"})]))}}),a_=W1,U1=O({name:"ChatDotSquare",__name:"chat-dot-square",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M273.536 736H800a64 64 0 0 0 64-64V256a64 64 0 0 0-64-64H224a64 64 0 0 0-64 64v570.88zM296 800 147.968 918.4A32 32 0 0 1 96 893.44V256a128 128 0 0 1 128-128h576a128 128 0 0 1 128 128v416a128 128 0 0 1-128 128z"}),C("path",{fill:"currentColor",d:"M512 499.2a51.2 51.2 0 1 1 0-102.4 51.2 51.2 0 0 1 0 102.4zm192 0a51.2 51.2 0 1 1 0-102.4 51.2 51.2 0 0 1 0 102.4zm-384 0a51.2 51.2 0 1 1 0-102.4 51.2 51.2 0 0 1 0 102.4z"})]))}}),u_=U1,J1=O({name:"Check",__name:"check",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"})]))}}),c_=J1,K1=O({name:"CloseBold",__name:"close-bold",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M195.2 195.2a64 64 0 0 1 90.496 0L512 421.504 738.304 195.2a64 64 0 0 1 90.496 90.496L602.496 512 828.8 738.304a64 64 0 0 1-90.496 90.496L512 602.496 285.696 828.8a64 64 0 0 1-90.496-90.496L421.504 512 195.2 285.696a64 64 0 0 1 0-90.496z"})]))}}),f_=K1,Y1=O({name:"Close",__name:"close",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),h_=Y1,G1=O({name:"Comment",__name:"comment",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M736 504a56 56 0 1 1 0-112 56 56 0 0 1 0 112m-224 0a56 56 0 1 1 0-112 56 56 0 0 1 0 112m-224 0a56 56 0 1 1 0-112 56 56 0 0 1 0 112M128 128v640h192v160l224-160h352V128z"})]))}}),p_=G1,Z1=O({name:"CopyDocument",__name:"copy-document",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64z"}),C("path",{fill:"currentColor",d:"M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64"})]))}}),d_=Z1,X1=O({name:"DeleteFilled",__name:"delete-filled",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M352 192V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64H96a32 32 0 0 1 0-64zm64 0h192v-64H416zM192 960a32 32 0 0 1-32-32V256h704v672a32 32 0 0 1-32 32zm224-192a32 32 0 0 0 32-32V416a32 32 0 0 0-64 0v320a32 32 0 0 0 32 32m192 0a32 32 0 0 0 32-32V416a32 32 0 0 0-64 0v320a32 32 0 0 0 32 32"})]))}}),m_=X1,Q1=O({name:"Delete",__name:"delete",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),g_=Q1,e2=O({name:"Document",__name:"document",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"})]))}}),y_=e2,t2=O({name:"Download",__name:"download",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z"})]))}}),w_=t2,n2=O({name:"EditPen",__name:"edit-pen",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"m199.04 672.64 193.984 112 224-387.968-193.92-112-224 388.032zm-23.872 60.16 32.896 148.288 144.896-45.696zM455.04 229.248l193.92 112 56.704-98.112-193.984-112-56.64 98.112zM104.32 708.8l384-665.024 304.768 175.936L409.152 884.8h.064l-248.448 78.336zm384 254.272v-64h448v64h-448z"})]))}}),b_=n2,r2=O({name:"Edit",__name:"edit",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"}),C("path",{fill:"currentColor",d:"m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"})]))}}),x_=r2,i2=O({name:"Expand",__name:"expand",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M128 192h768v128H128zm0 256h512v128H128zm0 256h768v128H128zm576-352 192 160-192 128z"})]))}}),k_=i2,o2=O({name:"FullScreen",__name:"full-screen",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64l192-.192zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"})]))}}),v_=o2,s2=O({name:"Guide",__name:"guide",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M640 608h-64V416h64zm0 160v160a32 32 0 0 1-32 32H416a32 32 0 0 1-32-32V768h64v128h128V768zM384 608V416h64v192zm256-352h-64V128H448v128h-64V96a32 32 0 0 1 32-32h192a32 32 0 0 1 32 32z"}),C("path",{fill:"currentColor",d:"m220.8 256-71.232 80 71.168 80H768V256H220.8zm-14.4-64H800a32 32 0 0 1 32 32v224a32 32 0 0 1-32 32H206.4a32 32 0 0 1-23.936-10.752l-99.584-112a32 32 0 0 1 0-42.496l99.584-112A32 32 0 0 1 206.4 192m678.784 496-71.104 80H266.816V608h547.2l71.168 80zm-56.768-144H234.88a32 32 0 0 0-32 32v224a32 32 0 0 0 32 32h593.6a32 32 0 0 0 23.936-10.752l99.584-112a32 32 0 0 0 0-42.496l-99.584-112A32 32 0 0 0 828.48 544z"})]))}}),__=s2,l2=O({name:"Hide",__name:"hide",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"}),C("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"})]))}}),S_=l2,a2=O({name:"HomeFilled",__name:"home-filled",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M512 128 128 447.936V896h255.936V640H640v256h255.936V447.936z"})]))}}),C_=a2,u2=O({name:"InfoFilled",__name:"info-filled",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.992 12.992 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}}),A_=u2,c2=O({name:"Iphone",__name:"iphone",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M224 768v96.064a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V768zm0-64h576V160a64 64 0 0 0-64-64H288a64 64 0 0 0-64 64zm32 288a96 96 0 0 1-96-96V128a96 96 0 0 1 96-96h512a96 96 0 0 1 96 96v768a96 96 0 0 1-96 96zm304-144a48 48 0 1 1-96 0 48 48 0 0 1 96 0"})]))}}),M_=c2,f2=O({name:"Link",__name:"link",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M715.648 625.152 670.4 579.904l90.496-90.56c75.008-74.944 85.12-186.368 22.656-248.896-62.528-62.464-173.952-52.352-248.96 22.656L444.16 353.6l-45.248-45.248 90.496-90.496c100.032-99.968 251.968-110.08 339.456-22.656 87.488 87.488 77.312 239.424-22.656 339.456l-90.496 90.496zm-90.496 90.496-90.496 90.496C434.624 906.112 282.688 916.224 195.2 828.8c-87.488-87.488-77.312-239.424 22.656-339.456l90.496-90.496 45.248 45.248-90.496 90.56c-75.008 74.944-85.12 186.368-22.656 248.896 62.528 62.464 173.952 52.352 248.96-22.656l90.496-90.496zm0-362.048 45.248 45.248L398.848 670.4 353.6 625.152z"})]))}}),O_=f2,h2=O({name:"Loading",__name:"loading",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),E_=h2,p2=O({name:"Lock",__name:"lock",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"}),C("path",{fill:"currentColor",d:"M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m192-160v-64a192 192 0 1 0-384 0v64zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64"})]))}}),T_=p2,d2=O({name:"Memo",__name:"memo",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg","xml:space":"preserve",style:{"enable-background":"new 0 0 1024 1024"},viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M480 320h192c21.33 0 32-10.67 32-32s-10.67-32-32-32H480c-21.33 0-32 10.67-32 32s10.67 32 32 32"}),C("path",{fill:"currentColor",d:"M887.01 72.99C881.01 67 873.34 64 864 64H160c-9.35 0-17.02 3-23.01 8.99C131 78.99 128 86.66 128 96v832c0 9.35 2.99 17.02 8.99 23.01S150.66 960 160 960h704c9.35 0 17.02-2.99 23.01-8.99S896 937.34 896 928V96c0-9.35-3-17.02-8.99-23.01M192 896V128h96v768zm640 0H352V128h480z"}),C("path",{fill:"currentColor",d:"M480 512h192c21.33 0 32-10.67 32-32s-10.67-32-32-32H480c-21.33 0-32 10.67-32 32s10.67 32 32 32m0 192h192c21.33 0 32-10.67 32-32s-10.67-32-32-32H480c-21.33 0-32 10.67-32 32s10.67 32 32 32"})]))}}),N_=d2,m2=O({name:"Message",__name:"message",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M128 224v512a64 64 0 0 0 64 64h640a64 64 0 0 0 64-64V224zm0-64h768a64 64 0 0 1 64 64v512a128 128 0 0 1-128 128H192A128 128 0 0 1 64 736V224a64 64 0 0 1 64-64"}),C("path",{fill:"currentColor",d:"M904 224 656.512 506.88a192 192 0 0 1-289.024 0L120 224zm-698.944 0 210.56 240.704a128 128 0 0 0 192.704 0L818.944 224H205.056"})]))}}),D_=m2,g2=O({name:"Money",__name:"money",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M256 640v192h640V384H768v-64h150.976c14.272 0 19.456 1.472 24.64 4.288a29.056 29.056 0 0 1 12.16 12.096c2.752 5.184 4.224 10.368 4.224 24.64v493.952c0 14.272-1.472 19.456-4.288 24.64a29.056 29.056 0 0 1-12.096 12.16c-5.184 2.752-10.368 4.224-24.64 4.224H233.024c-14.272 0-19.456-1.472-24.64-4.288a29.056 29.056 0 0 1-12.16-12.096c-2.688-5.184-4.224-10.368-4.224-24.576V640z"}),C("path",{fill:"currentColor",d:"M768 192H128v448h640zm64-22.976v493.952c0 14.272-1.472 19.456-4.288 24.64a29.056 29.056 0 0 1-12.096 12.16c-5.184 2.752-10.368 4.224-24.64 4.224H105.024c-14.272 0-19.456-1.472-24.64-4.288a29.056 29.056 0 0 1-12.16-12.096C65.536 682.432 64 677.248 64 663.04V169.024c0-14.272 1.472-19.456 4.288-24.64a29.056 29.056 0 0 1 12.096-12.16C85.568 129.536 90.752 128 104.96 128h685.952c14.272 0 19.456 1.472 24.64 4.288a29.056 29.056 0 0 1 12.16 12.096c2.752 5.184 4.224 10.368 4.224 24.64z"}),C("path",{fill:"currentColor",d:"M448 576a160 160 0 1 1 0-320 160 160 0 0 1 0 320m0-64a96 96 0 1 0 0-192 96 96 0 0 0 0 192"})]))}}),I_=g2,y2=O({name:"MoreFilled",__name:"more-filled",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M176 416a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224"})]))}}),z_=y2,w2=O({name:"More",__name:"more",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M176 416a112 112 0 1 0 0 224 112 112 0 0 0 0-224m0 64a48 48 0 1 1 0 96 48 48 0 0 1 0-96m336-64a112 112 0 1 1 0 224 112 112 0 0 1 0-224m0 64a48 48 0 1 0 0 96 48 48 0 0 0 0-96m336-64a112 112 0 1 1 0 224 112 112 0 0 1 0-224m0 64a48 48 0 1 0 0 96 48 48 0 0 0 0-96"})]))}}),R_=w2,b2=O({name:"Notebook",__name:"notebook",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M192 128v768h640V128zm-32-64h704a32 32 0 0 1 32 32v832a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32"}),C("path",{fill:"currentColor",d:"M672 128h64v768h-64zM96 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32"})]))}}),F_=b2,x2=O({name:"Notification",__name:"notification",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M512 128v64H256a64 64 0 0 0-64 64v512a64 64 0 0 0 64 64h512a64 64 0 0 0 64-64V512h64v256a128 128 0 0 1-128 128H256a128 128 0 0 1-128-128V256a128 128 0 0 1 128-128z"}),C("path",{fill:"currentColor",d:"M768 384a128 128 0 1 0 0-256 128 128 0 0 0 0 256m0 64a192 192 0 1 1 0-384 192 192 0 0 1 0 384"})]))}}),P_=x2,k2=O({name:"Operation",__name:"operation",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M389.44 768a96.064 96.064 0 0 1 181.12 0H896v64H570.56a96.064 96.064 0 0 1-181.12 0H128v-64zm192-288a96.064 96.064 0 0 1 181.12 0H896v64H762.56a96.064 96.064 0 0 1-181.12 0H128v-64zm-320-288a96.064 96.064 0 0 1 181.12 0H896v64H442.56a96.064 96.064 0 0 1-181.12 0H128v-64z"})]))}}),L_=k2,v2=O({name:"Picture",__name:"picture",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M160 160v704h704V160zm-32-64h768a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32H128a32 32 0 0 1-32-32V128a32 32 0 0 1 32-32"}),C("path",{fill:"currentColor",d:"M384 288q64 0 64 64t-64 64q-64 0-64-64t64-64M185.408 876.992l-50.816-38.912L350.72 556.032a96 96 0 0 1 134.592-17.856l1.856 1.472 122.88 99.136a32 32 0 0 0 44.992-4.864l216-269.888 49.92 39.936-215.808 269.824-.256.32a96 96 0 0 1-135.04 14.464l-122.88-99.072-.64-.512a32 32 0 0 0-44.8 5.952z"})]))}}),B_=v2,_2=O({name:"Plus",__name:"plus",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),V_=_2,S2=O({name:"Postcard",__name:"postcard",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M160 224a32 32 0 0 0-32 32v512a32 32 0 0 0 32 32h704a32 32 0 0 0 32-32V256a32 32 0 0 0-32-32zm0-64h704a96 96 0 0 1 96 96v512a96 96 0 0 1-96 96H160a96 96 0 0 1-96-96V256a96 96 0 0 1 96-96"}),C("path",{fill:"currentColor",d:"M704 320a64 64 0 1 1 0 128 64 64 0 0 1 0-128M288 448h256q32 0 32 32t-32 32H288q-32 0-32-32t32-32m0 128h256q32 0 32 32t-32 32H288q-32 0-32-32t32-32"})]))}}),H_=S2,C2=O({name:"Reading",__name:"reading",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"m512 863.36 384-54.848v-638.72L525.568 222.72a96 96 0 0 1-27.136 0L128 169.792v638.72zM137.024 106.432l370.432 52.928a32 32 0 0 0 9.088 0l370.432-52.928A64 64 0 0 1 960 169.792v638.72a64 64 0 0 1-54.976 63.36l-388.48 55.488a32 32 0 0 1-9.088 0l-388.48-55.488A64 64 0 0 1 64 808.512v-638.72a64 64 0 0 1 73.024-63.36z"}),C("path",{fill:"currentColor",d:"M480 192h64v704h-64z"})]))}}),$_=C2,A2=O({name:"RefreshLeft",__name:"refresh-left",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M289.088 296.704h92.992a32 32 0 0 1 0 64H232.96a32 32 0 0 1-32-32V179.712a32 32 0 0 1 64 0v50.56a384 384 0 0 1 643.84 282.88 384 384 0 0 1-383.936 384 384 384 0 0 1-384-384h64a320 320 0 1 0 640 0 320 320 0 0 0-555.712-216.448z"})]))}}),q_=A2,M2=O({name:"Search",__name:"search",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"})]))}}),j_=M2,O2=O({name:"SuccessFilled",__name:"success-filled",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.272 38.272 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}}),W_=O2,E2=O({name:"Tickets",__name:"tickets",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M192 128v768h640V128zm-32-64h704a32 32 0 0 1 32 32v832a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h192v64H320zm0 384h384v64H320z"})]))}}),U_=E2,T2=O({name:"Timer",__name:"timer",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M512 896a320 320 0 1 0 0-640 320 320 0 0 0 0 640m0 64a384 384 0 1 1 0-768 384 384 0 0 1 0 768"}),C("path",{fill:"currentColor",d:"M512 320a32 32 0 0 1 32 32l-.512 224a32 32 0 1 1-64 0L480 352a32 32 0 0 1 32-32"}),C("path",{fill:"currentColor",d:"M448 576a64 64 0 1 0 128 0 64 64 0 1 0-128 0m96-448v128h-64V128h-96a32 32 0 0 1 0-64h256a32 32 0 1 1 0 64z"})]))}}),J_=T2,N2=O({name:"TopRight",__name:"top-right",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M768 256H353.6a32 32 0 1 1 0-64H800a32 32 0 0 1 32 32v448a32 32 0 0 1-64 0z"}),C("path",{fill:"currentColor",d:"M777.344 201.344a32 32 0 0 1 45.312 45.312l-544 544a32 32 0 0 1-45.312-45.312l544-544z"})]))}}),K_=N2,D2=O({name:"Top",__name:"top",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M572.235 205.282v600.365a30.118 30.118 0 1 1-60.235 0V205.282L292.382 438.633a28.913 28.913 0 0 1-42.646 0 33.43 33.43 0 0 1 0-45.236l271.058-288.045a28.913 28.913 0 0 1 42.647 0L834.5 393.397a33.43 33.43 0 0 1 0 45.176 28.913 28.913 0 0 1-42.647 0l-219.618-233.23z"})]))}}),Y_=D2,I2=O({name:"UploadFilled",__name:"upload-filled",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M544 864V672h128L512 480 352 672h128v192H320v-1.6c-5.376.32-10.496 1.6-16 1.6A240 240 0 0 1 64 624c0-123.136 93.12-223.488 212.608-237.248A239.808 239.808 0 0 1 512 192a239.872 239.872 0 0 1 235.456 194.752c119.488 13.76 212.48 114.112 212.48 237.248a240 240 0 0 1-240 240c-5.376 0-10.56-1.28-16-1.6v1.6z"})]))}}),G_=I2,z2=O({name:"User",__name:"user",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M512 512a192 192 0 1 0 0-384 192 192 0 0 0 0 384m0 64a256 256 0 1 1 0-512 256 256 0 0 1 0 512m320 320v-96a96 96 0 0 0-96-96H288a96 96 0 0 0-96 96v96a32 32 0 1 1-64 0v-96a160 160 0 0 1 160-160h448a160 160 0 0 1 160 160v96a32 32 0 1 1-64 0"})]))}}),Z_=z2,R2=O({name:"VideoPlay",__name:"video-play",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m-48-247.616L668.608 512 464 375.616zm10.624-342.656 249.472 166.336a48 48 0 0 1 0 79.872L474.624 718.272A48 48 0 0 1 400 678.336V345.6a48 48 0 0 1 74.624-39.936z"})]))}}),X_=R2,F2=O({name:"View",__name:"view",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),Q_=F2,P2=O({name:"ZoomIn",__name:"zoom-in",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"})]))}}),e5=P2,L2=O({name:"ZoomOut",__name:"zoom-out",setup(n){return(e,t)=>(E(),T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[C("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"})]))}}),t5=L2;function de(n){this.content=n}de.prototype={constructor:de,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 de(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 de(t)},addToStart:function(n,e){return new de([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new de(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 de(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=de.from(n),n.size?new de(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=de.from(n),n.size?new de(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=de.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}};de.from=function(n){if(n instanceof de)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new de(e)};function bf(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 s=0;i.text[s]==o.text[s];s++)t++;return t}if(i.content.size||o.content.size){let s=bf(i.content,o.content,t+1);if(s!=null)return s}t+=i.nodeSize}}function xf(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 s=n.child(--i),l=e.child(--o),a=s.nodeSize;if(s==l){t-=a,r-=a;continue}if(!s.sameMarkup(l))return{a:t,b:r};if(s.isText&&s.text!=l.text){let u=0,c=Math.min(s.text.length,l.text.length);for(;u<c&&s.text[s.text.length-u-1]==l.text[l.text.length-u-1];)u++,t--,r--;return{a:t,b:r}}if(s.content.size||l.content.size){let u=xf(s.content,l.content,t-1,r-1);if(u)return u}t-=a,r-=a}}let I=class Ae{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 s=0,l=0;l<t;s++){let a=this.content[s],u=l+a.nodeSize;if(u>e&&r(a,i+l,o||null,s)!==!1&&a.content.size){let c=l+1;a.nodesBetween(Math.max(0,e-c),Math.min(a.content.size,t-c),r,i+c)}l=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",s=!0;return this.nodesBetween(e,t,(l,a)=>{let u=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=u},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 Ae(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,s=0;s<t;o++){let l=this.content[o],a=s+l.nodeSize;a>e&&((s<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,t-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,t-s-1))),r.push(l),i+=l.nodeSize),s=a}return new Ae(r,i)}cutByIndex(e,t){return e==t?Ae.empty:e==0&&t==this.content.length?this:new Ae(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 Ae(i,o)}addToStart(e){return new Ae([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Ae(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 bf(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return xf(this,e,t,r)}findIndex(e,t=-1){if(e==0)return vi(0,e);if(e==this.size)return vi(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),s=i+o.nodeSize;if(s>=e)return s==e||t>0?vi(r+1,s):vi(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return Ae.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new Ae(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Ae.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 Ae(t||e,r)}static from(e){if(!e)return Ae.empty;if(e instanceof Ae)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Ae([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};I.empty=new I([],0);const $o={index:0,offset:0};function vi(n,e){return $o.index=n,$o.offset=e,$o}function Gi(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(!Gi(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Gi(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let ee=class Ls{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&&Gi(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 Ls.none;if(e instanceof Ls)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};ee.none=[];class Zi extends Error{}class P{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=vf(this.content,e+this.openStart,t);return r&&new P(r,this.openStart,this.openEnd)}removeBetween(e,t){return new P(kf(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 P.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 P(I.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 P(e,r,i)}}P.empty=new P(I.empty,0,0);function kf(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:s,offset:l}=n.findIndex(t);if(i==e||o.isText){if(l!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(kf(o.content,e-i-1,t-i-1)))}function vf(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),s=n.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=vf(s.content,e-o-1,t);return l&&n.replaceChild(i,s.copy(l))}function B2(n,e,t){if(t.openStart>n.depth)throw new Zi("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Zi("Inconsistent open depths");return _f(n,e,t,0)}function _f(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let s=_f(n,e,t,r+1);return o.copy(o.content.replaceChild(i,s))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let s=n.parent,l=s.content;return Sn(s,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:s,end:l}=V2(t,n);return Sn(o,Cf(n,s,l,e,r))}else return Sn(o,Xi(n,e,r))}function Sf(n,e){if(!e.type.compatibleContent(n.type))throw new Zi("Cannot join "+e.type.name+" onto "+n.type.name)}function Bs(n,e,t){let r=n.node(t);return Sf(r,e.node(t)),r}function _n(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 Dr(n,e,t,r){let i=(e||n).node(t),o=0,s=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(_n(n.nodeAfter,r),o++));for(let l=o;l<s;l++)_n(i.child(l),r);e&&e.depth==t&&e.textOffset&&_n(e.nodeBefore,r)}function Sn(n,e){return n.type.checkContent(e),n.copy(e)}function Cf(n,e,t,r,i){let o=n.depth>i&&Bs(n,e,i+1),s=r.depth>i&&Bs(t,r,i+1),l=[];return Dr(null,n,i,l),o&&s&&e.index(i)==t.index(i)?(Sf(o,s),_n(Sn(o,Cf(n,e,t,r,i+1)),l)):(o&&_n(Sn(o,Xi(n,e,i+1)),l),Dr(e,t,i,l),s&&_n(Sn(s,Xi(t,r,i+1)),l)),Dr(r,null,i,l),new I(l)}function Xi(n,e,t){let r=[];if(Dr(null,n,t,r),n.depth>t){let i=Bs(n,e,t+1);_n(Sn(i,Xi(n,e,t+1)),r)}return Dr(e,null,t,r),new I(r)}function V2(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(I.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class Wr{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 ee.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let l=r;r=i,i=l}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].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 Af(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 s=e;;){let{index:l,offset:a}=s.content.findIndex(o),u=o-a;if(r.push(s,l,i+a),!u||(s=s.child(l),s.isText))break;o=u-1,i+=a+1}return new Wr(t,r,o)}static resolveCached(e,t){let r=La.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==t)return s}else La.set(e,r=new H2);let i=r.elts[r.i]=Wr.resolve(e,t);return r.i=(r.i+1)%$2,i}}class H2{constructor(){this.elts=[],this.i=0}}const $2=12,La=new WeakMap;class Af{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 q2=Object.create(null);let Cn=class Vs{constructor(e,t,r,i=ee.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||I.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,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&&Gi(this.attrs,t||e.defaultAttrs||q2)&&ee.sameSet(this.marks,r||ee.none)}copy(e=null){return e==this.content?this:new Vs(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Vs(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 P.empty;let i=this.resolve(e),o=this.resolve(t),s=r?0:i.sharedDepth(t),l=i.start(s),u=i.node(s).content.cut(i.pos-l,o.pos-l);return new P(u,i.depth-s,o.depth-s)}replace(e,t,r){return B2(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 Wr.resolveCached(this,e)}resolveNoCache(e){return Wr.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()+")"),Mf(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=I.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=i;a<o;a++)if(!this.type.allowsMarks(r.child(a).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),s=o&&o.matchFragment(this.content,t);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ee.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(!ee.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=I.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Cn.prototype.text=void 0;class Qi extends Cn{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):Mf(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 Qi(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Qi(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 Mf(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class En{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new j2(e,t);if(r.next==null)return En.empty;let i=Of(r);r.next&&r.err("Unexpected trailing text");let o=Z2(G2(i));return X2(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(s,l){let a=s.matchFragment(e,r);if(a&&(!t||a.validEnd))return I.from(l.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:c,next:f}=s.next[u];if(!(c.isText||c.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let h=o(f,l.concat(c));if(h)return h}}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 s=[];for(let l=i;l.type;l=l.via)s.push(l.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:l,next:a}=o.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!i.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),t[l.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 s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(` |
| 26 |
`)}}En.empty=new En(!0);class j2{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 Of(n){let e=[];do e.push(W2(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function W2(n){let e=[];do e.push(U2(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function U2(n){let e=Y2(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=J2(n,e);else break;return e}function Ba(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function J2(n,e){let t=Ba(n),r=t;return n.eat(",")&&(n.next!="}"?r=Ba(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function K2(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let s=t[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function Y2(n){if(n.eat("(")){let e=Of(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=K2(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 G2(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(s,l,a){let u={term:a,to:l};return e[s].push(u),u}function i(s,l){s.forEach(a=>a.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((a,u)=>a.concat(o(u,l)),[]);if(s.type=="seq")for(let a=0;;a++){let u=o(s.exprs[a],l);if(a==s.exprs.length-1)return u;i(u,l=t())}else if(s.type=="star"){let a=t();return r(l,a),i(o(s.expr,a),a),[r(a)]}else if(s.type=="plus"){let a=t();return i(o(s.expr,l),a),i(o(s.expr,a),a),[r(a)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let a=l;for(let u=0;u<s.min;u++){let c=t();i(o(s.expr,a),c),a=c}if(s.max==-1)i(o(s.expr,a),a);else for(let u=s.min;u<s.max;u++){let c=t();r(a,c),i(o(s.expr,a),c),a=c}return[r(a)]}else{if(s.type=="name")return[r(l,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Ef(n,e){return e-n}function Va(n,e){let t=[];return r(e),t.sort(Ef);function r(i){let o=n[i];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(i);for(let s=0;s<o.length;s++){let{term:l,to:a}=o[s];!l&&t.indexOf(a)==-1&&r(a)}}}function Z2(n){let e=Object.create(null);return t(Va(n,0));function t(r){let i=[];r.forEach(s=>{n[s].forEach(({term:l,to:a})=>{if(!l)return;let u;for(let c=0;c<i.length;c++)i[c][0]==l&&(u=i[c][1]);Va(n,a).forEach(c=>{u||i.push([l,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let o=e[r.join(",")]=new En(r.indexOf(n.length-1)>-1);for(let s=0;s<i.length;s++){let l=i[s][1].sort(Ef);o.next.push({type:i[s][0],next:e[l.join(",")]||t(l)})}return o}}function X2(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],o=!i.validEnd,s=[];for(let l=0;l<i.next.length;l++){let{type:a,next:u}=i.next[l];s.push(a.name),o&&!(a.isText||a.hasRequiredAttrs())&&(o=!1),r.indexOf(u)==-1&&r.push(u)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Tf(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 Nf(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 Df(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 If(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new eg(n,r,e[r]);return t}let Ha=class zf{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=If(e,r.attrs),this.defaultAttrs=Tf(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==En.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Nf(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Cn(this,this.computeAttrs(e),I.from(t),ee.setFrom(r))}createChecked(e=null,t,r){return t=I.from(t),this.checkContent(t),new Cn(this,this.computeAttrs(e),t,ee.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=I.from(t),t.size){let s=this.contentMatch.fillBefore(t);if(!s)return null;t=s.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(I.empty,!0);return o?new Cn(this,e,t.append(o),ee.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){Df(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:ee.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,s)=>r[o]=new zf(o,t,s));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 Q2(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 eg{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Q2(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class ko{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=If(e,i.attrs),this.excluded=null;let o=Tf(this.attrs);this.instance=o?new ee(this,o):null}create(e=null){return!e&&this.instance?this.instance:new ee(this,Nf(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new ko(o,i++,t,s)),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){Df(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class n5{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=de.from(e.nodes),t.marks=de.from(e.marks||{}),this.nodes=Ha.compile(this.spec.nodes,this),this.marks=ko.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],s=o.spec.content||"",l=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=En.parse(s,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=l=="_"?null:l?$a(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:$a(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Ha){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 Qi(r,r.defaultAttrs,e,ee.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Cn.fromJSON(this,e)}markFromJSON(e){return ee.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function $a(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],o=n.marks[i],s=o;if(o)t.push(o);else for(let l in n.marks){let a=n.marks[l];(i=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(i)>-1)&&t.push(s=a)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function tg(n){return n.tag!=null}function ng(n){return n.style!=null}class Ur{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(tg(i))this.tags.push(i);else if(ng(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 ja(this,t,!1);return r.addAll(e,ee.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new ja(this,t,!0);return r.addAll(e,ee.none,t.from,t.to),P.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(og(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||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 s=this.styles[o],l=s.style;if(!(l.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(s.getAttrs){let a=s.getAttrs(t);if(a===!1)continue;s.attrs=a||void 0}return s}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<t.length;s++){let l=t[s];if((l.priority==null?50:l.priority)<o)break}t.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Wa(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Wa(s)),s.node||s.ignore||s.mark||(s.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Ur(e,Ur.schemaRules(e)))}}const Rf={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},rg={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ff={ol:!0,ul:!0},eo=1,to=2,Ir=4;function qa(n,e,t){return e!=null?(e?eo:0)|(e==="full"?to:0):n&&n.whitespace=="pre"?eo|to:t&~Ir}class _i{constructor(e,t,r,i,o,s){this.type=e,this.attrs=t,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=ee.none,this.match=o||(s&Ir?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(I.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&eo)){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=I.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(I.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&&!Rf.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class ja{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let i=t.topNode,o,s=qa(null,t.preserveWhitespace,0)|(r?Ir:0);i?o=new _i(i.type,i.attrs,ee.none,!0,t.topMatch||i.type.contentMatch,s):r?o=new _i(null,null,ee.none,!0,null,s):o=new _i(e.schema.topNodeType,null,ee.none,!0,null,s),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;if(i.options&to||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i.options&eo)i.options&to?r=r.replace(/\r\n?/g,` |
| 27 |
`):r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let o=i.content[i.content.length-1],s=e.previousSibling;(!o||s&&s.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.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=e.nodeName.toLowerCase(),o;Ff.hasOwnProperty(i)&&this.parser.normalizeLists&&ig(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,r));if(s?s.ignore:rg.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let l,a=this.top,u=this.needsBlock;if(Rf.hasOwnProperty(i))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),l=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);return}let c=s&&s.skip?t:this.readStyles(e,t);c&&this.addAll(e,c),l&&this.sync(a),this.needsBlock=u}else{let l=this.readStyles(e,t);l&&this.addElementByRule(e,s,l,s.consuming===!1?o:void 0)}}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` |
| 28 |
`),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],s=r.getPropertyValue(o);if(s)for(let l=void 0;;){let a=this.parser.matchStyle(o,s,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?t=t.filter(u=>!a.clearMark(u)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,r,i){let o,s;if(t.node)if(s=this.parser.schema.nodes[t.node],s.isLeaf)this.insertNode(s.create(t.attrs),r)||this.leafFallback(e,r);else{let a=this.enter(s,t.attrs||null,r,t.preserveWhitespace);a&&(o=!0,r=a)}else{let a=this.parser.schema.marks[t.mark];r=r.concat(a.create(t.attrs))}let l=this.top;if(s&&s.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(a=>this.insertNode(a,r));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,r)}o&&this.sync(l)&&this.open--}addAll(e,t,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];s!=l;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,t);this.findAtPoint(e,o)}findPlace(e,t){let r,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],l=s.findWrapping(e);if(l&&(!r||r.length>l.length)&&(r=l,i=s,!l.length)||s.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=ee.none;for(let s of r.concat(e.marks))(i.type?i.type.allowsMarkType(s.type):Ua(s.type,e.type))&&(o=s.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 s=this.top;s.match=s.match&&s.match.matchType(e);let l=qa(e,o,s.options);s.options&Ir&&s.content.length==0&&(l|=Ir);let a=ee.none;return r=r.filter(u=>(s.type?s.type.allowsMarkType(u.type):Ua(u.type,e))?(a=u.addToSet(a),!1):!0),this.nodes.push(new _i(e,t,a,i,null,l)),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;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),s=(l,a)=>{for(;l>=0;l--){let u=t[l];if(u==""){if(l==t.length-1||l==0)continue;for(;a>=o;a--)if(s(l-1,a))return!0;return!1}else{let c=a>0||a==0&&i?this.nodes[a].type:r&&a>=o?r.node(a-o).type:null;if(!c||c.name!=u&&c.groups.indexOf(u)==-1)return!1;a--}}return!0};return s(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 ig(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Ff.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function og(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Wa(n){let e={};for(let t in n)e[t]=n[t];return e}function Ua(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],s=l=>{o.push(l);for(let a=0;a<l.edgeCount;a++){let{type:u,next:c}=l.edge(a);if(u==e||o.indexOf(c)<0&&s(c))return!0}};if(s(i.contentMatch))return!0}}class cr{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=qo(t).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let l=0,a=0;for(;l<o.length&&a<s.marks.length;){let u=s.marks[a];if(!this.marks[u.type.name]){a++;continue}if(!u.eq(o[l][0])||u.type.spec.spanning===!1)break;l++,a++}for(;l<o.length;)i=o.pop()[1];for(;a<s.marks.length;){let u=s.marks[a++],c=this.serializeMark(u,s.isInline,t);c&&(o.push([u,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(s,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=Li(qo(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&&Li(qo(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return Li(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new cr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Ja(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Ja(e.marks)}}function Ja(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function qo(n){return n.document||window.document}const Ka=new WeakMap;function sg(n){let e=Ka.get(n);return e===void 0&&Ka.set(n,e=lg(n)),e}function lg(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 Li(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=sg(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 s=i.indexOf(" ");s>0&&(t=i.slice(0,s),i=i.slice(s+1));let l,a=t?n.createElementNS(t,i):n.createElement(i),u=e[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let f in u)if(u[f]!=null){let h=f.indexOf(" ");h>0?a.setAttributeNS(f.slice(0,h),f.slice(h+1),u[f]):a.setAttribute(f,u[f])}}for(let f=c;f<e.length;f++){let h=e[f];if(h===0){if(f<e.length-1||f>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:p,contentDOM:d}=Li(n,h,t,r);if(a.appendChild(p),d){if(l)throw new RangeError("Multiple content holes");l=d}}}return{dom:a,contentDOM:l}}const ag={};function zl(n,e){const t=e||ag,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Pf(n,r,i)}function Pf(n,e,t){if(ug(n)){if("value"in n)return n.type==="html"&&!t?"":n.value;if(e&&"alt"in n&&n.alt)return n.alt;if("children"in n)return Ya(n.children,e,t)}return Array.isArray(n)?Ya(n,e,t):""}function Ya(n,e,t){const r=[];let i=-1;for(;++i<n.length;)r[i]=Pf(n[i],e,t);return r.join("")}function ug(n){return!!(n&&typeof n=="object")}const Ga=document.createElement("i");function Rl(n){const e="&"+n+";";Ga.innerHTML=e;const t=Ga.textContent;return t.charCodeAt(t.length-1)===59&&n!=="semi"||t===e?!1:t}function et(n,e,t,r){const i=n.length;let o=0,s;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,t=t>0?t:0,r.length<1e4)s=Array.from(r),s.unshift(e,t),n.splice(...s);else for(t&&n.splice(e,t);o<r.length;)s=r.slice(o,o+1e4),s.unshift(e,0),n.splice(...s),o+=1e4,e+=1e4}function Ze(n,e){return n.length>0?(et(n,n.length,0,e),n):e}const Za={}.hasOwnProperty;function Lf(n){const e={};let t=-1;for(;++t<n.length;)cg(e,n[t]);return e}function cg(n,e){let t;for(t in e){const i=(Za.call(n,t)?n[t]:void 0)||(n[t]={}),o=e[t];let s;if(o)for(s in o){Za.call(i,s)||(i[s]=[]);const l=o[s];fg(i[s],Array.isArray(l)?l:l?[l]:[])}}}function fg(n,e){let t=-1;const r=[];for(;++t<e.length;)(e[t].add==="after"?n:r).push(e[t]);et(n,0,0,r)}function Bf(n,e){const t=Number.parseInt(n,e);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function ft(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Me=an(/[A-Za-z]/),ze=an(/[\dA-Za-z]/),hg=an(/[#-'*+\--9=?A-Z^-~]/);function no(n){return n!==null&&(n<32||n===127)}const Hs=an(/\d/),pg=an(/[\dA-Fa-f]/),dg=an(/[!-/:-@[-`{-~]/);function V(n){return n!==null&&n<-2}function te(n){return n!==null&&(n<0||n===32)}function J(n){return n===-2||n===-1||n===32}const vo=an(/\p{P}|\p{S}/u),Tn=an(/\s/);function an(n){return e;function e(t){return t!==null&&t>-1&&n.test(String.fromCharCode(t))}}function X(n,e,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(a){return J(a)?(n.enter(t),l(a)):e(a)}function l(a){return J(a)&&o++<i?(n.consume(a),l):(n.exit(t),e(a))}}const mg={tokenize:gg};function gg(n){const e=n.attempt(this.parser.constructs.contentInitial,r,i);let t;return e;function r(l){if(l===null){n.consume(l);return}return n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),X(n,e,"linePrefix")}function i(l){return n.enter("paragraph"),o(l)}function o(l){const a=n.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=a),t=a,s(l)}function s(l){if(l===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(l);return}return V(l)?(n.consume(l),n.exit("chunkText"),o):(n.consume(l),s)}}const yg={tokenize:wg},Xa={tokenize:bg};function wg(n){const e=this,t=[];let r=0,i,o,s;return l;function l(x){if(r<t.length){const S=t[r];return e.containerState=S[1],n.attempt(S[0].continuation,a,u)(x)}return u(x)}function a(x){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&_();const S=e.events.length;let M=S,k;for(;M--;)if(e.events[M][0]==="exit"&&e.events[M][1].type==="chunkFlow"){k=e.events[M][1].end;break}g(r);let F=S;for(;F<e.events.length;)e.events[F][1].end=Object.assign({},k),F++;return et(e.events,M+1,0,e.events.slice(S)),e.events.length=F,u(x)}return l(x)}function u(x){if(r===t.length){if(!i)return h(x);if(i.currentConstruct&&i.currentConstruct.concrete)return d(x);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},n.check(Xa,c,f)(x)}function c(x){return i&&_(),g(r),h(x)}function f(x){return e.parser.lazy[e.now().line]=r!==t.length,s=e.now().offset,d(x)}function h(x){return e.containerState={},n.attempt(Xa,p,d)(x)}function p(x){return r++,t.push([e.currentConstruct,e.containerState]),h(x)}function d(x){if(x===null){i&&_(),g(0),n.consume(x);return}return i=i||e.parser.flow(e.now()),n.enter("chunkFlow",{contentType:"flow",previous:o,_tokenizer:i}),m(x)}function m(x){if(x===null){y(n.exit("chunkFlow"),!0),g(0),n.consume(x);return}return V(x)?(n.consume(x),y(n.exit("chunkFlow")),r=0,e.interrupt=void 0,l):(n.consume(x),m)}function y(x,S){const M=e.sliceStream(x);if(S&&M.push(null),x.previous=o,o&&(o.next=x),o=x,i.defineSkip(x.start),i.write(M),e.parser.lazy[x.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<s&&(!i.events[k][1].end||i.events[k][1].end.offset>s))return;const F=e.events.length;let L=F,N,v;for(;L--;)if(e.events[L][0]==="exit"&&e.events[L][1].type==="chunkFlow"){if(N){v=e.events[L][1].end;break}N=!0}for(g(r),k=F;k<e.events.length;)e.events[k][1].end=Object.assign({},v),k++;et(e.events,L+1,0,e.events.slice(F)),e.events.length=k}}function g(x){let S=t.length;for(;S-- >x;){const M=t[S];e.containerState=M[1],M[0].exit.call(e,n)}t.length=x}function _(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function bg(n,e,t){return X(n,n.attempt(this.parser.constructs.document,e,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ro(n){if(n===null||te(n)||Tn(n))return 1;if(vo(n))return 2}function _o(n,e,t){const r=[];let i=-1;for(;++i<n.length;){const o=n[i].resolveAll;o&&!r.includes(o)&&(e=o(e,t),r.push(o))}return e}const $s={name:"attention",tokenize:kg,resolveAll:xg};function xg(n,e){let t=-1,r,i,o,s,l,a,u,c;for(;++t<n.length;)if(n[t][0]==="enter"&&n[t][1].type==="attentionSequence"&&n[t][1]._close){for(r=t;r--;)if(n[r][0]==="exit"&&n[r][1].type==="attentionSequence"&&n[r][1]._open&&e.sliceSerialize(n[r][1]).charCodeAt(0)===e.sliceSerialize(n[t][1]).charCodeAt(0)){if((n[r][1]._close||n[t][1]._open)&&(n[t][1].end.offset-n[t][1].start.offset)%3&&!((n[r][1].end.offset-n[r][1].start.offset+n[t][1].end.offset-n[t][1].start.offset)%3))continue;a=n[r][1].end.offset-n[r][1].start.offset>1&&n[t][1].end.offset-n[t][1].start.offset>1?2:1;const f=Object.assign({},n[r][1].end),h=Object.assign({},n[t][1].start);Qa(f,-a),Qa(h,a),s={type:a>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},n[r][1].end)},l={type:a>1?"strongSequence":"emphasisSequence",start:Object.assign({},n[t][1].start),end:h},o={type:a>1?"strongText":"emphasisText",start:Object.assign({},n[r][1].end),end:Object.assign({},n[t][1].start)},i={type:a>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},l.end)},n[r][1].end=Object.assign({},s.start),n[t][1].start=Object.assign({},l.end),u=[],n[r][1].end.offset-n[r][1].start.offset&&(u=Ze(u,[["enter",n[r][1],e],["exit",n[r][1],e]])),u=Ze(u,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",o,e]]),u=Ze(u,_o(e.parser.constructs.insideSpan.null,n.slice(r+1,t),e)),u=Ze(u,[["exit",o,e],["enter",l,e],["exit",l,e],["exit",i,e]]),n[t][1].end.offset-n[t][1].start.offset?(c=2,u=Ze(u,[["enter",n[t][1],e],["exit",n[t][1],e]])):c=0,et(n,r-1,t-r+3,u),t=r+u.length-c-2;break}}for(t=-1;++t<n.length;)n[t][1].type==="attentionSequence"&&(n[t][1].type="data");return n}function kg(n,e){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ro(r);let o;return s;function s(a){return o=a,n.enter("attentionSequence"),l(a)}function l(a){if(a===o)return n.consume(a),l;const u=n.exit("attentionSequence"),c=ro(a),f=!c||c===2&&i||t.includes(a),h=!i||i===2&&c||t.includes(r);return u._open=!!(o===42?f:f&&(i||!h)),u._close=!!(o===42?h:h&&(c||!f)),e(a)}}function Qa(n,e){n.column+=e,n.offset+=e,n._bufferIndex+=e}const vg={name:"autolink",tokenize:_g};function _g(n,e,t){let r=0;return i;function i(p){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(p),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),o}function o(p){return Me(p)?(n.consume(p),s):p===64?t(p):u(p)}function s(p){return p===43||p===45||p===46||ze(p)?(r=1,l(p)):u(p)}function l(p){return p===58?(n.consume(p),r=0,a):(p===43||p===45||p===46||ze(p))&&r++<32?(n.consume(p),l):(r=0,u(p))}function a(p){return p===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(p),n.exit("autolinkMarker"),n.exit("autolink"),e):p===null||p===32||p===60||no(p)?t(p):(n.consume(p),a)}function u(p){return p===64?(n.consume(p),c):hg(p)?(n.consume(p),u):t(p)}function c(p){return ze(p)?f(p):t(p)}function f(p){return p===46?(n.consume(p),r=0,c):p===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(p),n.exit("autolinkMarker"),n.exit("autolink"),e):h(p)}function h(p){if((p===45||ze(p))&&r++<63){const d=p===45?h:f;return n.consume(p),d}return t(p)}}const ti={tokenize:Sg,partial:!0};function Sg(n,e,t){return r;function r(o){return J(o)?X(n,i,"linePrefix")(o):i(o)}function i(o){return o===null||V(o)?e(o):t(o)}}const Vf={name:"blockQuote",tokenize:Cg,continuation:{tokenize:Ag},exit:Mg};function Cg(n,e,t){const r=this;return i;function i(s){if(s===62){const l=r.containerState;return l.open||(n.enter("blockQuote",{_container:!0}),l.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(s),n.exit("blockQuoteMarker"),o}return t(s)}function o(s){return J(s)?(n.enter("blockQuotePrefixWhitespace"),n.consume(s),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),e):(n.exit("blockQuotePrefix"),e(s))}}function Ag(n,e,t){const r=this;return i;function i(s){return J(s)?X(n,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return n.attempt(Vf,e,t)(s)}}function Mg(n){n.exit("blockQuote")}const Hf={name:"characterEscape",tokenize:Og};function Og(n,e,t){return r;function r(o){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(o),n.exit("escapeMarker"),i}function i(o){return dg(o)?(n.enter("characterEscapeValue"),n.consume(o),n.exit("characterEscapeValue"),n.exit("characterEscape"),e):t(o)}}const $f={name:"characterReference",tokenize:Eg};function Eg(n,e,t){const r=this;let i=0,o,s;return l;function l(f){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(f),n.exit("characterReferenceMarker"),a}function a(f){return f===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(f),n.exit("characterReferenceMarkerNumeric"),u):(n.enter("characterReferenceValue"),o=31,s=ze,c(f))}function u(f){return f===88||f===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(f),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),o=6,s=pg,c):(n.enter("characterReferenceValue"),o=7,s=Hs,c(f))}function c(f){if(f===59&&i){const h=n.exit("characterReferenceValue");return s===ze&&!Rl(r.sliceSerialize(h))?t(f):(n.enter("characterReferenceMarker"),n.consume(f),n.exit("characterReferenceMarker"),n.exit("characterReference"),e)}return s(f)&&i++<o?(n.consume(f),c):t(f)}}const eu={tokenize:Ng,partial:!0},tu={name:"codeFenced",tokenize:Tg,concrete:!0};function Tg(n,e,t){const r=this,i={tokenize:M,partial:!0};let o=0,s=0,l;return a;function a(k){return u(k)}function u(k){const F=r.events[r.events.length-1];return o=F&&F[1].type==="linePrefix"?F[2].sliceSerialize(F[1],!0).length:0,l=k,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),c(k)}function c(k){return k===l?(s++,n.consume(k),c):s<3?t(k):(n.exit("codeFencedFenceSequence"),J(k)?X(n,f,"whitespace")(k):f(k))}function f(k){return k===null||V(k)?(n.exit("codeFencedFence"),r.interrupt?e(k):n.check(eu,m,S)(k)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),h(k))}function h(k){return k===null||V(k)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),f(k)):J(k)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),X(n,p,"whitespace")(k)):k===96&&k===l?t(k):(n.consume(k),h)}function p(k){return k===null||V(k)?f(k):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),d(k))}function d(k){return k===null||V(k)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),f(k)):k===96&&k===l?t(k):(n.consume(k),d)}function m(k){return n.attempt(i,S,y)(k)}function y(k){return n.enter("lineEnding"),n.consume(k),n.exit("lineEnding"),g}function g(k){return o>0&&J(k)?X(n,_,"linePrefix",o+1)(k):_(k)}function _(k){return k===null||V(k)?n.check(eu,m,S)(k):(n.enter("codeFlowValue"),x(k))}function x(k){return k===null||V(k)?(n.exit("codeFlowValue"),_(k)):(n.consume(k),x)}function S(k){return n.exit("codeFenced"),e(k)}function M(k,F,L){let N=0;return v;function v(H){return k.enter("lineEnding"),k.consume(H),k.exit("lineEnding"),z}function z(H){return k.enter("codeFencedFence"),J(H)?X(k,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):D(H)}function D(H){return H===l?(k.enter("codeFencedFenceSequence"),B(H)):L(H)}function B(H){return H===l?(N++,k.consume(H),B):N>=s?(k.exit("codeFencedFenceSequence"),J(H)?X(k,W,"whitespace")(H):W(H)):L(H)}function W(H){return H===null||V(H)?(k.exit("codeFencedFence"),F(H)):L(H)}}}function Ng(n,e,t){const r=this;return i;function i(s){return s===null?t(s):(n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?t(s):e(s)}}const jo={name:"codeIndented",tokenize:Ig},Dg={tokenize:zg,partial:!0};function Ig(n,e,t){const r=this;return i;function i(u){return n.enter("codeIndented"),X(n,o,"linePrefix",4+1)(u)}function o(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(u):t(u)}function s(u){return u===null?a(u):V(u)?n.attempt(Dg,s,a)(u):(n.enter("codeFlowValue"),l(u))}function l(u){return u===null||V(u)?(n.exit("codeFlowValue"),s(u)):(n.consume(u),l)}function a(u){return n.exit("codeIndented"),e(u)}}function zg(n,e,t){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?t(s):V(s)?(n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),i):X(n,o,"linePrefix",4+1)(s)}function o(s){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(s):V(s)?i(s):t(s)}}const Rg={name:"codeText",tokenize:Lg,resolve:Fg,previous:Pg};function Fg(n){let e=n.length-4,t=3,r,i;if((n[t][1].type==="lineEnding"||n[t][1].type==="space")&&(n[e][1].type==="lineEnding"||n[e][1].type==="space")){for(r=t;++r<e;)if(n[r][1].type==="codeTextData"){n[t][1].type="codeTextPadding",n[e][1].type="codeTextPadding",t+=2,e-=2;break}}for(r=t-1,e++;++r<=e;)i===void 0?r!==e&&n[r][1].type!=="lineEnding"&&(i=r):(r===e||n[r][1].type==="lineEnding")&&(n[i][1].type="codeTextData",r!==i+2&&(n[i][1].end=n[r-1][1].end,n.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return n}function Pg(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Lg(n,e,t){let r=0,i,o;return s;function s(f){return n.enter("codeText"),n.enter("codeTextSequence"),l(f)}function l(f){return f===96?(n.consume(f),r++,l):(n.exit("codeTextSequence"),a(f))}function a(f){return f===null?t(f):f===32?(n.enter("space"),n.consume(f),n.exit("space"),a):f===96?(o=n.enter("codeTextSequence"),i=0,c(f)):V(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),a):(n.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||V(f)?(n.exit("codeTextData"),a(f)):(n.consume(f),u)}function c(f){return f===96?(n.consume(f),i++,c):i===r?(n.exit("codeTextSequence"),n.exit("codeText"),e(f)):(o.type="codeTextData",u(f))}}class Bg{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,t,r){const i=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&br(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),br(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),br(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);br(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);br(this.left,t.reverse())}}}function br(n,e){let t=0;if(e.length<1e4)n.push(...e);else for(;t<e.length;)n.push(...e.slice(t,t+1e4)),t+=1e4}function qf(n){const e={};let t=-1,r,i,o,s,l,a,u;const c=new Bg(n);for(;++t<c.length;){for(;t in e;)t=e[t];if(r=c.get(t),t&&r[1].type==="chunkFlow"&&c.get(t-1)[1].type==="listItemPrefix"&&(a=r[1]._tokenizer.events,o=0,o<a.length&&a[o][1].type==="lineEndingBlank"&&(o+=2),o<a.length&&a[o][1].type==="content"))for(;++o<a.length&&a[o][1].type!=="content";)a[o][1].type==="chunkText"&&(a[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,Vg(c,t)),t=e[t],u=!0);else if(r[1]._container){for(o=t,i=void 0;o--&&(s=c.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);i&&(r[1].end=Object.assign({},c.get(i)[1].start),l=c.slice(i,t),l.unshift(r),c.splice(i,t-i+1,l))}}return et(n,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function Vg(n,e){const t=n.get(e)[1],r=n.get(e)[2];let i=e-1;const o=[],s=t._tokenizer||r.parser[t.contentType](t.start),l=s.events,a=[],u={};let c,f,h=-1,p=t,d=0,m=0;const y=[m];for(;p;){for(;n.get(++i)[1]!==p;);o.push(i),p._tokenizer||(c=r.sliceStream(p),p.next||c.push(null),f&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(c),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=t;++h<l.length;)l[h][0]==="exit"&&l[h-1][0]==="enter"&&l[h][1].type===l[h-1][1].type&&l[h][1].start.line!==l[h][1].end.line&&(m=h+1,y.push(m),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):y.pop(),h=y.length;h--;){const g=l.slice(y[h],y[h+1]),_=o.pop();a.push([_,_+g.length-1]),n.splice(_,2,g)}for(a.reverse(),h=-1;++h<a.length;)u[d+a[h][0]]=d+a[h][1],d+=a[h][1]-a[h][0]-1;return u}const Hg={tokenize:jg,resolve:qg},$g={tokenize:Wg,partial:!0};function qg(n){return qf(n),n}function jg(n,e){let t;return r;function r(l){return n.enter("content"),t=n.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?o(l):V(l)?n.check($g,s,o)(l):(n.consume(l),i)}function o(l){return n.exit("chunkContent"),n.exit("content"),e(l)}function s(l){return n.consume(l),n.exit("chunkContent"),t.next=n.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function Wg(n,e,t){const r=this;return i;function i(s){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),X(n,o,"linePrefix")}function o(s){if(s===null||V(s))return t(s);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(s):n.interrupt(r.parser.constructs.flow,t,e)(s)}}function jf(n,e,t,r,i,o,s,l,a){const u=a||Number.POSITIVE_INFINITY;let c=0;return f;function f(g){return g===60?(n.enter(r),n.enter(i),n.enter(o),n.consume(g),n.exit(o),h):g===null||g===32||g===41||no(g)?t(g):(n.enter(r),n.enter(s),n.enter(l),n.enter("chunkString",{contentType:"string"}),m(g))}function h(g){return g===62?(n.enter(o),n.consume(g),n.exit(o),n.exit(i),n.exit(r),e):(n.enter(l),n.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===62?(n.exit("chunkString"),n.exit(l),h(g)):g===null||g===60||V(g)?t(g):(n.consume(g),g===92?d:p)}function d(g){return g===60||g===62||g===92?(n.consume(g),p):p(g)}function m(g){return!c&&(g===null||g===41||te(g))?(n.exit("chunkString"),n.exit(l),n.exit(s),n.exit(r),e(g)):c<u&&g===40?(n.consume(g),c++,m):g===41?(n.consume(g),c--,m):g===null||g===32||g===40||no(g)?t(g):(n.consume(g),g===92?y:m)}function y(g){return g===40||g===41||g===92?(n.consume(g),m):m(g)}}function Wf(n,e,t,r,i,o){const s=this;let l=0,a;return u;function u(p){return n.enter(r),n.enter(i),n.consume(p),n.exit(i),n.enter(o),c}function c(p){return l>999||p===null||p===91||p===93&&!a||p===94&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?t(p):p===93?(n.exit(o),n.enter(i),n.consume(p),n.exit(i),n.exit(r),e):V(p)?(n.enter("lineEnding"),n.consume(p),n.exit("lineEnding"),c):(n.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||V(p)||l++>999?(n.exit("chunkString"),c(p)):(n.consume(p),a||(a=!J(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(n.consume(p),l++,f):f(p)}}function Uf(n,e,t,r,i,o){let s;return l;function l(h){return h===34||h===39||h===40?(n.enter(r),n.enter(i),n.consume(h),n.exit(i),s=h===40?41:h,a):t(h)}function a(h){return h===s?(n.enter(i),n.consume(h),n.exit(i),n.exit(r),e):(n.enter(o),u(h))}function u(h){return h===s?(n.exit(o),a(s)):h===null?t(h):V(h)?(n.enter("lineEnding"),n.consume(h),n.exit("lineEnding"),X(n,u,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===s||h===null||V(h)?(n.exit("chunkString"),u(h)):(n.consume(h),h===92?f:c)}function f(h){return h===s||h===92?(n.consume(h),c):c(h)}}function zr(n,e){let t;return r;function r(i){return V(i)?(n.enter("lineEnding"),n.consume(i),n.exit("lineEnding"),t=!0,r):J(i)?X(n,r,t?"linePrefix":"lineSuffix")(i):e(i)}}const Ug={name:"definition",tokenize:Kg},Jg={tokenize:Yg,partial:!0};function Kg(n,e,t){const r=this;let i;return o;function o(p){return n.enter("definition"),s(p)}function s(p){return Wf.call(r,n,l,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return i=ft(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(n.enter("definitionMarker"),n.consume(p),n.exit("definitionMarker"),a):t(p)}function a(p){return te(p)?zr(n,u)(p):u(p)}function u(p){return jf(n,c,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return n.attempt(Jg,f,f)(p)}function f(p){return J(p)?X(n,h,"whitespace")(p):h(p)}function h(p){return p===null||V(p)?(n.exit("definition"),r.parser.defined.push(i),e(p)):t(p)}}function Yg(n,e,t){return r;function r(l){return te(l)?zr(n,i)(l):t(l)}function i(l){return Uf(n,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return J(l)?X(n,s,"whitespace")(l):s(l)}function s(l){return l===null||V(l)?e(l):t(l)}}const Gg={name:"hardBreakEscape",tokenize:Zg};function Zg(n,e,t){return r;function r(o){return n.enter("hardBreakEscape"),n.consume(o),i}function i(o){return V(o)?(n.exit("hardBreakEscape"),e(o)):t(o)}}const Xg={name:"headingAtx",tokenize:e4,resolve:Qg};function Qg(n,e){let t=n.length-2,r=3,i,o;return n[r][1].type==="whitespace"&&(r+=2),t-2>r&&n[t][1].type==="whitespace"&&(t-=2),n[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&n[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:n[r][1].start,end:n[t][1].end},o={type:"chunkText",start:n[r][1].start,end:n[t][1].end,contentType:"text"},et(n,r,t-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),n}function e4(n,e,t){let r=0;return i;function i(c){return n.enter("atxHeading"),o(c)}function o(c){return n.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&r++<6?(n.consume(c),s):c===null||te(c)?(n.exit("atxHeadingSequence"),l(c)):t(c)}function l(c){return c===35?(n.enter("atxHeadingSequence"),a(c)):c===null||V(c)?(n.exit("atxHeading"),e(c)):J(c)?X(n,l,"whitespace")(c):(n.enter("atxHeadingText"),u(c))}function a(c){return c===35?(n.consume(c),a):(n.exit("atxHeadingSequence"),l(c))}function u(c){return c===null||c===35||te(c)?(n.exit("atxHeadingText"),l(c)):(n.consume(c),u)}}const t4=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],nu=["pre","script","style","textarea"],n4={name:"htmlFlow",tokenize:s4,resolveTo:o4,concrete:!0},r4={tokenize:a4,partial:!0},i4={tokenize:l4,partial:!0};function o4(n){let e=n.length;for(;e--&&!(n[e][0]==="enter"&&n[e][1].type==="htmlFlow"););return e>1&&n[e-2][1].type==="linePrefix"&&(n[e][1].start=n[e-2][1].start,n[e+1][1].start=n[e-2][1].start,n.splice(e-2,2)),n}function s4(n,e,t){const r=this;let i,o,s,l,a;return u;function u(b){return c(b)}function c(b){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(b),f}function f(b){return b===33?(n.consume(b),h):b===47?(n.consume(b),o=!0,m):b===63?(n.consume(b),i=3,r.interrupt?e:w):Me(b)?(n.consume(b),s=String.fromCharCode(b),y):t(b)}function h(b){return b===45?(n.consume(b),i=2,p):b===91?(n.consume(b),i=5,l=0,d):Me(b)?(n.consume(b),i=4,r.interrupt?e:w):t(b)}function p(b){return b===45?(n.consume(b),r.interrupt?e:w):t(b)}function d(b){const le="CDATA[";return b===le.charCodeAt(l++)?(n.consume(b),l===le.length?r.interrupt?e:D:d):t(b)}function m(b){return Me(b)?(n.consume(b),s=String.fromCharCode(b),y):t(b)}function y(b){if(b===null||b===47||b===62||te(b)){const le=b===47,pe=s.toLowerCase();return!le&&!o&&nu.includes(pe)?(i=1,r.interrupt?e(b):D(b)):t4.includes(s.toLowerCase())?(i=6,le?(n.consume(b),g):r.interrupt?e(b):D(b)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(b):o?_(b):x(b))}return b===45||ze(b)?(n.consume(b),s+=String.fromCharCode(b),y):t(b)}function g(b){return b===62?(n.consume(b),r.interrupt?e:D):t(b)}function _(b){return J(b)?(n.consume(b),_):v(b)}function x(b){return b===47?(n.consume(b),v):b===58||b===95||Me(b)?(n.consume(b),S):J(b)?(n.consume(b),x):v(b)}function S(b){return b===45||b===46||b===58||b===95||ze(b)?(n.consume(b),S):M(b)}function M(b){return b===61?(n.consume(b),k):J(b)?(n.consume(b),M):x(b)}function k(b){return b===null||b===60||b===61||b===62||b===96?t(b):b===34||b===39?(n.consume(b),a=b,F):J(b)?(n.consume(b),k):L(b)}function F(b){return b===a?(n.consume(b),a=null,N):b===null||V(b)?t(b):(n.consume(b),F)}function L(b){return b===null||b===34||b===39||b===47||b===60||b===61||b===62||b===96||te(b)?M(b):(n.consume(b),L)}function N(b){return b===47||b===62||J(b)?x(b):t(b)}function v(b){return b===62?(n.consume(b),z):t(b)}function z(b){return b===null||V(b)?D(b):J(b)?(n.consume(b),z):t(b)}function D(b){return b===45&&i===2?(n.consume(b),U):b===60&&i===1?(n.consume(b),Y):b===62&&i===4?(n.consume(b),_e):b===63&&i===3?(n.consume(b),w):b===93&&i===5?(n.consume(b),he):V(b)&&(i===6||i===7)?(n.exit("htmlFlowData"),n.check(r4,Se,B)(b)):b===null||V(b)?(n.exit("htmlFlowData"),B(b)):(n.consume(b),D)}function B(b){return n.check(i4,W,Se)(b)}function W(b){return n.enter("lineEnding"),n.consume(b),n.exit("lineEnding"),H}function H(b){return b===null||V(b)?B(b):(n.enter("htmlFlowData"),D(b))}function U(b){return b===45?(n.consume(b),w):D(b)}function Y(b){return b===47?(n.consume(b),s="",ce):D(b)}function ce(b){if(b===62){const le=s.toLowerCase();return nu.includes(le)?(n.consume(b),_e):D(b)}return Me(b)&&s.length<8?(n.consume(b),s+=String.fromCharCode(b),ce):D(b)}function he(b){return b===93?(n.consume(b),w):D(b)}function w(b){return b===62?(n.consume(b),_e):b===45&&i===2?(n.consume(b),w):D(b)}function _e(b){return b===null||V(b)?(n.exit("htmlFlowData"),Se(b)):(n.consume(b),_e)}function Se(b){return n.exit("htmlFlow"),e(b)}}function l4(n,e,t){const r=this;return i;function i(s){return V(s)?(n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),o):t(s)}function o(s){return r.parser.lazy[r.now().line]?t(s):e(s)}}function a4(n,e,t){return r;function r(i){return n.enter("lineEnding"),n.consume(i),n.exit("lineEnding"),n.attempt(ti,e,t)}}const u4={name:"htmlText",tokenize:c4};function c4(n,e,t){const r=this;let i,o,s;return l;function l(w){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(w),a}function a(w){return w===33?(n.consume(w),u):w===47?(n.consume(w),M):w===63?(n.consume(w),x):Me(w)?(n.consume(w),L):t(w)}function u(w){return w===45?(n.consume(w),c):w===91?(n.consume(w),o=0,d):Me(w)?(n.consume(w),_):t(w)}function c(w){return w===45?(n.consume(w),p):t(w)}function f(w){return w===null?t(w):w===45?(n.consume(w),h):V(w)?(s=f,Y(w)):(n.consume(w),f)}function h(w){return w===45?(n.consume(w),p):f(w)}function p(w){return w===62?U(w):w===45?h(w):f(w)}function d(w){const _e="CDATA[";return w===_e.charCodeAt(o++)?(n.consume(w),o===_e.length?m:d):t(w)}function m(w){return w===null?t(w):w===93?(n.consume(w),y):V(w)?(s=m,Y(w)):(n.consume(w),m)}function y(w){return w===93?(n.consume(w),g):m(w)}function g(w){return w===62?U(w):w===93?(n.consume(w),g):m(w)}function _(w){return w===null||w===62?U(w):V(w)?(s=_,Y(w)):(n.consume(w),_)}function x(w){return w===null?t(w):w===63?(n.consume(w),S):V(w)?(s=x,Y(w)):(n.consume(w),x)}function S(w){return w===62?U(w):x(w)}function M(w){return Me(w)?(n.consume(w),k):t(w)}function k(w){return w===45||ze(w)?(n.consume(w),k):F(w)}function F(w){return V(w)?(s=F,Y(w)):J(w)?(n.consume(w),F):U(w)}function L(w){return w===45||ze(w)?(n.consume(w),L):w===47||w===62||te(w)?N(w):t(w)}function N(w){return w===47?(n.consume(w),U):w===58||w===95||Me(w)?(n.consume(w),v):V(w)?(s=N,Y(w)):J(w)?(n.consume(w),N):U(w)}function v(w){return w===45||w===46||w===58||w===95||ze(w)?(n.consume(w),v):z(w)}function z(w){return w===61?(n.consume(w),D):V(w)?(s=z,Y(w)):J(w)?(n.consume(w),z):N(w)}function D(w){return w===null||w===60||w===61||w===62||w===96?t(w):w===34||w===39?(n.consume(w),i=w,B):V(w)?(s=D,Y(w)):J(w)?(n.consume(w),D):(n.consume(w),W)}function B(w){return w===i?(n.consume(w),i=void 0,H):w===null?t(w):V(w)?(s=B,Y(w)):(n.consume(w),B)}function W(w){return w===null||w===34||w===39||w===60||w===61||w===96?t(w):w===47||w===62||te(w)?N(w):(n.consume(w),W)}function H(w){return w===47||w===62||te(w)?N(w):t(w)}function U(w){return w===62?(n.consume(w),n.exit("htmlTextData"),n.exit("htmlText"),e):t(w)}function Y(w){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(w),n.exit("lineEnding"),ce}function ce(w){return J(w)?X(n,he,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):he(w)}function he(w){return n.enter("htmlTextData"),s(w)}}const Fl={name:"labelEnd",tokenize:g4,resolveTo:m4,resolveAll:d4},f4={tokenize:y4},h4={tokenize:w4},p4={tokenize:b4};function d4(n){let e=-1;for(;++e<n.length;){const t=n[e][1];(t.type==="labelImage"||t.type==="labelLink"||t.type==="labelEnd")&&(n.splice(e+1,t.type==="labelImage"?4:2),t.type="data",e++)}return n}function m4(n,e){let t=n.length,r=0,i,o,s,l;for(;t--;)if(i=n[t][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;n[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(n[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=t);const a={type:n[o][1].type==="labelLink"?"link":"image",start:Object.assign({},n[o][1].start),end:Object.assign({},n[n.length-1][1].end)},u={type:"label",start:Object.assign({},n[o][1].start),end:Object.assign({},n[s][1].end)},c={type:"labelText",start:Object.assign({},n[o+r+2][1].end),end:Object.assign({},n[s-2][1].start)};return l=[["enter",a,e],["enter",u,e]],l=Ze(l,n.slice(o+1,o+r+3)),l=Ze(l,[["enter",c,e]]),l=Ze(l,_o(e.parser.constructs.insideSpan.null,n.slice(o+r+4,s-3),e)),l=Ze(l,[["exit",c,e],n[s-2],n[s-1],["exit",u,e]]),l=Ze(l,n.slice(s+1)),l=Ze(l,[["exit",a,e]]),et(n,o,n.length,l),n}function g4(n,e,t){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return l;function l(h){return o?o._inactive?f(h):(s=r.parser.defined.includes(ft(r.sliceSerialize({start:o.end,end:r.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(h),n.exit("labelMarker"),n.exit("labelEnd"),a):t(h)}function a(h){return h===40?n.attempt(f4,c,s?c:f)(h):h===91?n.attempt(h4,c,s?u:f)(h):s?c(h):f(h)}function u(h){return n.attempt(p4,c,f)(h)}function c(h){return e(h)}function f(h){return o._balanced=!0,t(h)}}function y4(n,e,t){return r;function r(f){return n.enter("resource"),n.enter("resourceMarker"),n.consume(f),n.exit("resourceMarker"),i}function i(f){return te(f)?zr(n,o)(f):o(f)}function o(f){return f===41?c(f):jf(n,s,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return te(f)?zr(n,a)(f):c(f)}function l(f){return t(f)}function a(f){return f===34||f===39||f===40?Uf(n,u,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function u(f){return te(f)?zr(n,c)(f):c(f)}function c(f){return f===41?(n.enter("resourceMarker"),n.consume(f),n.exit("resourceMarker"),n.exit("resource"),e):t(f)}}function w4(n,e,t){const r=this;return i;function i(l){return Wf.call(r,n,o,s,"reference","referenceMarker","referenceString")(l)}function o(l){return r.parser.defined.includes(ft(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(l):t(l)}function s(l){return t(l)}}function b4(n,e,t){return r;function r(o){return n.enter("reference"),n.enter("referenceMarker"),n.consume(o),n.exit("referenceMarker"),i}function i(o){return o===93?(n.enter("referenceMarker"),n.consume(o),n.exit("referenceMarker"),n.exit("reference"),e):t(o)}}const x4={name:"labelStartImage",tokenize:k4,resolveAll:Fl.resolveAll};function k4(n,e,t){const r=this;return i;function i(l){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(l),n.exit("labelImageMarker"),o}function o(l){return l===91?(n.enter("labelMarker"),n.consume(l),n.exit("labelMarker"),n.exit("labelImage"),s):t(l)}function s(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(l):e(l)}}const v4={name:"labelStartLink",tokenize:_4,resolveAll:Fl.resolveAll};function _4(n,e,t){const r=this;return i;function i(s){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(s),n.exit("labelMarker"),n.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(s):e(s)}}const Wo={name:"lineEnding",tokenize:S4};function S4(n,e){return t;function t(r){return n.enter("lineEnding"),n.consume(r),n.exit("lineEnding"),X(n,e,"linePrefix")}}const Bi={name:"thematicBreak",tokenize:C4};function C4(n,e,t){let r=0,i;return o;function o(u){return n.enter("thematicBreak"),s(u)}function s(u){return i=u,l(u)}function l(u){return u===i?(n.enter("thematicBreakSequence"),a(u)):r>=3&&(u===null||V(u))?(n.exit("thematicBreak"),e(u)):t(u)}function a(u){return u===i?(n.consume(u),r++,a):(n.exit("thematicBreakSequence"),J(u)?X(n,l,"whitespace")(u):l(u))}}const Ie={name:"list",tokenize:O4,continuation:{tokenize:E4},exit:N4},A4={tokenize:D4,partial:!0},M4={tokenize:T4,partial:!0};function O4(n,e,t){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return l;function l(p){const d=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(d==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Hs(p)){if(r.containerState.type||(r.containerState.type=d,n.enter(d,{_container:!0})),d==="listUnordered")return n.enter("listItemPrefix"),p===42||p===45?n.check(Bi,t,u)(p):u(p);if(!r.interrupt||p===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),a(p)}return t(p)}function a(p){return Hs(p)&&++s<10?(n.consume(p),a):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(n.exit("listItemValue"),u(p)):t(p)}function u(p){return n.enter("listItemMarker"),n.consume(p),n.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,n.check(ti,r.interrupt?t:c,n.attempt(A4,h,f))}function c(p){return r.containerState.initialBlankLine=!0,o++,h(p)}function f(p){return J(p)?(n.enter("listItemPrefixWhitespace"),n.consume(p),n.exit("listItemPrefixWhitespace"),h):t(p)}function h(p){return r.containerState.size=o+r.sliceSerialize(n.exit("listItemPrefix"),!0).length,e(p)}}function E4(n,e,t){const r=this;return r.containerState._closeFlow=void 0,n.check(ti,i,o);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,X(n,e,"listItemIndent",r.containerState.size+1)(l)}function o(l){return r.containerState.furtherBlankLines||!J(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,n.attempt(M4,e,s)(l))}function s(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,X(n,n.attempt(Ie,e,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function T4(n,e,t){const r=this;return X(n,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?e(o):t(o)}}function N4(n){n.exit(this.containerState.type)}function D4(n,e,t){const r=this;return X(n,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(o){const s=r.events[r.events.length-1];return!J(o)&&s&&s[1].type==="listItemPrefixWhitespace"?e(o):t(o)}}const ru={name:"setextUnderline",tokenize:z4,resolveTo:I4};function I4(n,e){let t=n.length,r,i,o;for(;t--;)if(n[t][0]==="enter"){if(n[t][1].type==="content"){r=t;break}n[t][1].type==="paragraph"&&(i=t)}else n[t][1].type==="content"&&n.splice(t,1),!o&&n[t][1].type==="definition"&&(o=t);const s={type:"setextHeading",start:Object.assign({},n[i][1].start),end:Object.assign({},n[n.length-1][1].end)};return n[i][1].type="setextHeadingText",o?(n.splice(i,0,["enter",s,e]),n.splice(o+1,0,["exit",n[r][1],e]),n[r][1].end=Object.assign({},n[o][1].end)):n[r][1]=s,n.push(["exit",s,e]),n}function z4(n,e,t){const r=this;let i;return o;function o(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(n.enter("setextHeadingLine"),i=u,s(u)):t(u)}function s(u){return n.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===i?(n.consume(u),l):(n.exit("setextHeadingLineSequence"),J(u)?X(n,a,"lineSuffix")(u):a(u))}function a(u){return u===null||V(u)?(n.exit("setextHeadingLine"),e(u)):t(u)}}const R4={tokenize:F4};function F4(n){const e=this,t=n.attempt(ti,r,n.attempt(this.parser.constructs.flowInitial,i,X(n,n.attempt(this.parser.constructs.flow,i,n.attempt(Hg,i)),"linePrefix")));return t;function r(o){if(o===null){n.consume(o);return}return n.enter("lineEndingBlank"),n.consume(o),n.exit("lineEndingBlank"),e.currentConstruct=void 0,t}function i(o){if(o===null){n.consume(o);return}return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),e.currentConstruct=void 0,t}}const P4={resolveAll:Kf()},L4=Jf("string"),B4=Jf("text");function Jf(n){return{tokenize:e,resolveAll:Kf(n==="text"?V4:void 0)};function e(t){const r=this,i=this.parser.constructs[n],o=t.attempt(i,s,l);return s;function s(c){return u(c)?o(c):l(c)}function l(c){if(c===null){t.consume(c);return}return t.enter("data"),t.consume(c),a}function a(c){return u(c)?(t.exit("data"),o(c)):(t.consume(c),a)}function u(c){if(c===null)return!0;const f=i[c];let h=-1;if(f)for(;++h<f.length;){const p=f[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function Kf(n){return e;function e(t,r){let i=-1,o;for(;++i<=t.length;)o===void 0?t[i]&&t[i][1].type==="data"&&(o=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==o+2&&(t[o][1].end=t[i-1][1].end,t.splice(o+2,i-o-2),i=o+2),o=void 0);return n?n(t,r):t}}function V4(n,e){let t=0;for(;++t<=n.length;)if((t===n.length||n[t][1].type==="lineEnding")&&n[t-1][1].type==="data"){const r=n[t-1][1],i=e.sliceStream(r);let o=i.length,s=-1,l=0,a;for(;o--;){const u=i[o];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)l++,s--;if(s)break;s=-1}else if(u===-2)a=!0,l++;else if(u!==-1){o++;break}}if(l){const u={type:t===n.length||a||l<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-l,offset:r.end.offset-l,_index:r.start._index+o,_bufferIndex:o?s:r.start._bufferIndex+s},end:Object.assign({},r.end)};r.end=Object.assign({},u.start),r.start.offset===r.end.offset?Object.assign(r,u):(n.splice(t,0,["enter",u,e],["exit",u,e]),t+=2)}t++}return n}function H4(n,e,t){let r=Object.assign(t?Object.assign({},t):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},o=[];let s=[],l=[];const a={consume:_,enter:x,exit:S,attempt:F(M),check:F(k),interrupt:F(k,{interrupt:!0})},u={previous:null,code:null,containerState:{},events:[],parser:n,sliceStream:p,sliceSerialize:h,now:d,defineSkip:m,write:f};let c=e.tokenize.call(u,a);return e.resolveAll&&o.push(e),u;function f(z){return s=Ze(s,z),y(),s[s.length-1]!==null?[]:(L(e,0),u.events=_o(o,u.events,u),u.events)}function h(z,D){return q4(p(z),D)}function p(z){return $4(s,z)}function d(){const{line:z,column:D,offset:B,_index:W,_bufferIndex:H}=r;return{line:z,column:D,offset:B,_index:W,_bufferIndex:H}}function m(z){i[z.line]=z.column,v()}function y(){let z;for(;r._index<s.length;){const D=s[r._index];if(typeof D=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<D.length;)g(D.charCodeAt(r._bufferIndex));else g(D)}}function g(z){c=c(z)}function _(z){V(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,v()):z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=z}function x(z,D){const B=D||{};return B.type=z,B.start=d(),u.events.push(["enter",B,u]),l.push(B),B}function S(z){const D=l.pop();return D.end=d(),u.events.push(["exit",D,u]),D}function M(z,D){L(z,D.from)}function k(z,D){D.restore()}function F(z,D){return B;function B(W,H,U){let Y,ce,he,w;return Array.isArray(W)?Se(W):"tokenize"in W?Se([W]):_e(W);function _e(ne){return st;function st(Ce){const Vt=Ce!==null&&ne[Ce],Ht=Ce!==null&&ne.null,$t=[...Array.isArray(Vt)?Vt:Vt?[Vt]:[],...Array.isArray(Ht)?Ht:Ht?[Ht]:[]];return Se($t)(Ce)}}function Se(ne){return Y=ne,ce=0,ne.length===0?U:b(ne[ce])}function b(ne){return st;function st(Ce){return w=N(),he=ne,ne.partial||(u.currentConstruct=ne),ne.name&&u.parser.constructs.disable.null.includes(ne.name)?pe():ne.tokenize.call(D?Object.assign(Object.create(u),D):u,a,le,pe)(Ce)}}function le(ne){return z(he,w),H}function pe(ne){return w.restore(),++ce<Y.length?b(Y[ce]):U}}}function L(z,D){z.resolveAll&&!o.includes(z)&&o.push(z),z.resolve&&et(u.events,D,u.events.length-D,z.resolve(u.events.slice(D),u)),z.resolveTo&&(u.events=z.resolveTo(u.events,u))}function N(){const z=d(),D=u.previous,B=u.currentConstruct,W=u.events.length,H=Array.from(l);return{restore:U,from:W};function U(){r=z,u.previous=D,u.currentConstruct=B,u.events.length=W,l=H,v()}}function v(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function $4(n,e){const t=e.start._index,r=e.start._bufferIndex,i=e.end._index,o=e.end._bufferIndex;let s;if(t===i)s=[n[t].slice(r,o)];else{if(s=n.slice(t,i),r>-1){const l=s[0];typeof l=="string"?s[0]=l.slice(r):s.shift()}o>0&&s.push(n[i].slice(0,o))}return s}function q4(n,e){let t=-1;const r=[];let i;for(;++t<n.length;){const o=n[t];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=` |
| 29 |
`;break}case-3:{s=`\r |
| 30 |
`;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}const j4={42:Ie,43:Ie,45:Ie,48:Ie,49:Ie,50:Ie,51:Ie,52:Ie,53:Ie,54:Ie,55:Ie,56:Ie,57:Ie,62:Vf},W4={91:Ug},U4={[-2]:jo,[-1]:jo,32:jo},J4={35:Xg,42:Bi,45:[ru,Bi],60:n4,61:ru,95:Bi,96:tu,126:tu},K4={38:$f,92:Hf},Y4={[-5]:Wo,[-4]:Wo,[-3]:Wo,33:x4,38:$f,42:$s,60:[vg,u4],91:v4,92:[Gg,Hf],93:Fl,95:$s,96:Rg},G4={null:[$s,P4]},Z4={null:[42,95]},X4={null:[]},Q4=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Z4,contentInitial:W4,disable:X4,document:j4,flow:J4,flowInitial:U4,insideSpan:G4,string:K4,text:Y4},Symbol.toStringTag,{value:"Module"}));function e3(n){const t=Lf([Q4,...(n||{}).extensions||[]]),r={defined:[],lazy:{},constructs:t,content:i(mg),document:i(yg),flow:i(R4),string:i(L4),text:i(B4)};return r;function i(o){return s;function s(l){return H4(r,o,l)}}}function t3(n){for(;!qf(n););return n}const iu=/[\0\t\n\r]/g;function n3(){let n=1,e="",t=!0,r;return i;function i(o,s,l){const a=[];let u,c,f,h,p;for(o=e+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),f=0,e="",t&&(o.charCodeAt(0)===65279&&f++,t=void 0);f<o.length;){if(iu.lastIndex=f,u=iu.exec(o),h=u&&u.index!==void 0?u.index:o.length,p=o.charCodeAt(h),!u){e=o.slice(f);break}if(p===10&&f===h&&r)a.push(-3),r=void 0;else switch(r&&(a.push(-5),r=void 0),f<h&&(a.push(o.slice(f,h)),n+=h-f),p){case 0:{a.push(65533),n++;break}case 9:{for(c=Math.ceil(n/4)*4,a.push(-2);n++<c;)a.push(-1);break}case 10:{a.push(-4),n=1;break}default:r=!0,n=1}f=h+1}return l&&(r&&a.push(-5),e&&a.push(e),a.push(null)),a}}const r3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Yf(n){return n.replace(r3,i3)}function i3(n,e,t){if(e)return e;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),o=i===120||i===88;return Bf(t.slice(o?2:1),o?16:10)}return Rl(t)||n}function Rr(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?ou(n.position):"start"in n||"end"in n?ou(n):"line"in n||"column"in n?qs(n):""}function qs(n){return su(n&&n.line)+":"+su(n&&n.column)}function ou(n){return qs(n&&n.start)+"-"+qs(n&&n.end)}function su(n){return n&&typeof n=="number"?n:1}const Gf={}.hasOwnProperty;function o3(n,e,t){return typeof e!="string"&&(t=e,e=void 0),s3(t)(t3(e3(t).document().write(n3()(n,e,!0))))}function s3(n){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(hi),autolinkProtocol:N,autolinkEmail:N,atxHeading:o(fi),blockQuote:o(Ht),characterEscape:N,characterReference:N,codeFenced:o($t),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o($t,s),codeText:o(zo,s),codeTextData:N,data:N,codeFlowValue:N,definition:o(ci),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Ro),hardBreakEscape:o(pr),hardBreakTrailing:o(pr),htmlFlow:o(dr,s),htmlFlowData:N,htmlText:o(dr,s),htmlTextData:N,image:o(Fo),label:s,link:o(hi),listItem:o(Rn),listItemValue:h,listOrdered:o(dt,f),listUnordered:o(dt),paragraph:o(pi),reference:b,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(fi),strong:o(di),thematicBreak:o(mi)},exit:{atxHeading:a(),atxHeadingSequence:M,autolink:a(),autolinkEmail:Vt,autolinkProtocol:Ce,blockQuote:a(),characterEscapeValue:v,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:ne,characterReference:st,codeFenced:a(y),codeFencedFence:m,codeFencedFenceInfo:p,codeFencedFenceMeta:d,codeFlowValue:v,codeIndented:a(g),codeText:a(H),codeTextData:v,data:v,definition:a(),definitionDestinationString:S,definitionLabelString:_,definitionTitleString:x,emphasis:a(),hardBreakEscape:a(D),hardBreakTrailing:a(D),htmlFlow:a(B),htmlFlowData:v,htmlText:a(W),htmlTextData:v,image:a(Y),label:he,labelText:ce,lineEnding:z,link:a(U),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:le,resourceDestinationString:w,resourceTitleString:_e,resource:Se,setextHeading:a(L),setextHeadingLineSequence:F,setextHeadingText:k,strong:a(),thematicBreak:a()}};Zf(e,(n||{}).mdastExtensions||[]);const t={};return r;function r(A){let R={type:"root",children:[]};const $={stack:[R],tokenStack:[],config:e,enter:l,exit:u,buffer:s,resume:c,data:t},G=[];let Q=-1;for(;++Q<A.length;)if(A[Q][1].type==="listOrdered"||A[Q][1].type==="listUnordered")if(A[Q][0]==="enter")G.push(Q);else{const lt=G.pop();Q=i(A,lt,Q)}for(Q=-1;++Q<A.length;){const lt=e[A[Q][0]];Gf.call(lt,A[Q][1].type)&<[A[Q][1].type].call(Object.assign({sliceSerialize:A[Q][2].sliceSerialize},$),A[Q][1])}if($.tokenStack.length>0){const lt=$.tokenStack[$.tokenStack.length-1];(lt[1]||lu).call($,void 0,lt[0])}for(R.position={start:qt(A.length>0?A[0][1].start:{line:1,column:1,offset:0}),end:qt(A.length>0?A[A.length-2][1].end:{line:1,column:1,offset:0})},Q=-1;++Q<e.transforms.length;)R=e.transforms[Q](R)||R;return R}function i(A,R,$){let G=R-1,Q=-1,lt=!1,fn,At,gr,yr;for(;++G<=$;){const He=A[G];switch(He[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{He[0]==="enter"?Q++:Q--,yr=void 0;break}case"lineEndingBlank":{He[0]==="enter"&&(fn&&!yr&&!Q&&!gr&&(gr=G),yr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:yr=void 0}if(!Q&&He[0]==="enter"&&He[1].type==="listItemPrefix"||Q===-1&&He[0]==="exit"&&(He[1].type==="listUnordered"||He[1].type==="listOrdered")){if(fn){let Fn=G;for(At=void 0;Fn--;){const Mt=A[Fn];if(Mt[1].type==="lineEnding"||Mt[1].type==="lineEndingBlank"){if(Mt[0]==="exit")continue;At&&(A[At][1].type="lineEndingBlank",lt=!0),Mt[1].type="lineEnding",At=Fn}else if(!(Mt[1].type==="linePrefix"||Mt[1].type==="blockQuotePrefix"||Mt[1].type==="blockQuotePrefixWhitespace"||Mt[1].type==="blockQuoteMarker"||Mt[1].type==="listItemIndent"))break}gr&&(!At||gr<At)&&(fn._spread=!0),fn.end=Object.assign({},At?A[At][1].start:He[1].end),A.splice(At||G,0,["exit",fn,He[2]]),G++,$++}if(He[1].type==="listItemPrefix"){const Fn={type:"listItem",_spread:!1,start:Object.assign({},He[1].start),end:void 0};fn=Fn,A.splice(G,0,["enter",Fn,He[2]]),G++,$++,gr=void 0,yr=!0}}}return A[R][1]._spread=lt,$}function o(A,R){return $;function $(G){l.call(this,A(G),G),R&&R.call(this,G)}}function s(){this.stack.push({type:"fragment",children:[]})}function l(A,R,$){this.stack[this.stack.length-1].children.push(A),this.stack.push(A),this.tokenStack.push([R,$]),A.position={start:qt(R.start),end:void 0}}function a(A){return R;function R($){A&&A.call(this,$),u.call(this,$)}}function u(A,R){const $=this.stack.pop(),G=this.tokenStack.pop();if(G)G[0].type!==A.type&&(R?R.call(this,A,G[0]):(G[1]||lu).call(this,A,G[0]));else throw new Error("Cannot close `"+A.type+"` ("+Rr({start:A.start,end:A.end})+"): it’s not open");$.position.end=qt(A.end)}function c(){return zl(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(A){if(this.data.expectingFirstListItemValue){const R=this.stack[this.stack.length-2];R.start=Number.parseInt(this.sliceSerialize(A),10),this.data.expectingFirstListItemValue=void 0}}function p(){const A=this.resume(),R=this.stack[this.stack.length-1];R.lang=A}function d(){const A=this.resume(),R=this.stack[this.stack.length-1];R.meta=A}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const A=this.resume(),R=this.stack[this.stack.length-1];R.value=A.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const A=this.resume(),R=this.stack[this.stack.length-1];R.value=A.replace(/(\r?\n|\r)$/g,"")}function _(A){const R=this.resume(),$=this.stack[this.stack.length-1];$.label=R,$.identifier=ft(this.sliceSerialize(A)).toLowerCase()}function x(){const A=this.resume(),R=this.stack[this.stack.length-1];R.title=A}function S(){const A=this.resume(),R=this.stack[this.stack.length-1];R.url=A}function M(A){const R=this.stack[this.stack.length-1];if(!R.depth){const $=this.sliceSerialize(A).length;R.depth=$}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function F(A){const R=this.stack[this.stack.length-1];R.depth=this.sliceSerialize(A).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function N(A){const $=this.stack[this.stack.length-1].children;let G=$[$.length-1];(!G||G.type!=="text")&&(G=mr(),G.position={start:qt(A.start),end:void 0},$.push(G)),this.stack.push(G)}function v(A){const R=this.stack.pop();R.value+=this.sliceSerialize(A),R.position.end=qt(A.end)}function z(A){const R=this.stack[this.stack.length-1];if(this.data.atHardBreak){const $=R.children[R.children.length-1];$.position.end=qt(A.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(R.type)&&(N.call(this,A),v.call(this,A))}function D(){this.data.atHardBreak=!0}function B(){const A=this.resume(),R=this.stack[this.stack.length-1];R.value=A}function W(){const A=this.resume(),R=this.stack[this.stack.length-1];R.value=A}function H(){const A=this.resume(),R=this.stack[this.stack.length-1];R.value=A}function U(){const A=this.stack[this.stack.length-1];if(this.data.inReference){const R=this.data.referenceType||"shortcut";A.type+="Reference",A.referenceType=R,delete A.url,delete A.title}else delete A.identifier,delete A.label;this.data.referenceType=void 0}function Y(){const A=this.stack[this.stack.length-1];if(this.data.inReference){const R=this.data.referenceType||"shortcut";A.type+="Reference",A.referenceType=R,delete A.url,delete A.title}else delete A.identifier,delete A.label;this.data.referenceType=void 0}function ce(A){const R=this.sliceSerialize(A),$=this.stack[this.stack.length-2];$.label=Yf(R),$.identifier=ft(R).toLowerCase()}function he(){const A=this.stack[this.stack.length-1],R=this.resume(),$=this.stack[this.stack.length-1];if(this.data.inReference=!0,$.type==="link"){const G=A.children;$.children=G}else $.alt=R}function w(){const A=this.resume(),R=this.stack[this.stack.length-1];R.url=A}function _e(){const A=this.resume(),R=this.stack[this.stack.length-1];R.title=A}function Se(){this.data.inReference=void 0}function b(){this.data.referenceType="collapsed"}function le(A){const R=this.resume(),$=this.stack[this.stack.length-1];$.label=R,$.identifier=ft(this.sliceSerialize(A)).toLowerCase(),this.data.referenceType="full"}function pe(A){this.data.characterReferenceType=A.type}function ne(A){const R=this.sliceSerialize(A),$=this.data.characterReferenceType;let G;$?(G=Bf(R,$==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):G=Rl(R);const Q=this.stack[this.stack.length-1];Q.value+=G}function st(A){const R=this.stack.pop();R.position.end=qt(A.end)}function Ce(A){v.call(this,A);const R=this.stack[this.stack.length-1];R.url=this.sliceSerialize(A)}function Vt(A){v.call(this,A);const R=this.stack[this.stack.length-1];R.url="mailto:"+this.sliceSerialize(A)}function Ht(){return{type:"blockquote",children:[]}}function $t(){return{type:"code",lang:null,meta:null,value:""}}function zo(){return{type:"inlineCode",value:""}}function ci(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ro(){return{type:"emphasis",children:[]}}function fi(){return{type:"heading",depth:0,children:[]}}function pr(){return{type:"break"}}function dr(){return{type:"html",value:""}}function Fo(){return{type:"image",title:null,url:"",alt:null}}function hi(){return{type:"link",title:null,url:"",children:[]}}function dt(A){return{type:"list",ordered:A.type==="listOrdered",start:null,spread:A._spread,children:[]}}function Rn(A){return{type:"listItem",spread:A._spread,checked:null,children:[]}}function pi(){return{type:"paragraph",children:[]}}function di(){return{type:"strong",children:[]}}function mr(){return{type:"text",value:""}}function mi(){return{type:"thematicBreak"}}}function qt(n){return{line:n.line,column:n.column,offset:n.offset}}function Zf(n,e){let t=-1;for(;++t<e.length;){const r=e[t];Array.isArray(r)?Zf(n,r):l3(n,r)}}function l3(n,e){let t;for(t in e)if(Gf.call(e,t))switch(t){case"canContainEols":{const r=e[t];r&&n[t].push(...r);break}case"transforms":{const r=e[t];r&&n[t].push(...r);break}case"enter":case"exit":{const r=e[t];r&&Object.assign(n[t],r);break}}}function lu(n,e){throw n?new Error("Cannot close `"+n.type+"` ("+Rr({start:n.start,end:n.end})+"): a different token (`"+e.type+"`, "+Rr({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Rr({start:e.start,end:e.end})+") is still open")}function r5(n){const e=this;e.parser=t;function t(r){return o3(r,{...e.data("settings"),...n,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}const au={}.hasOwnProperty;function a3(n,e){const t=e||{};function r(i,...o){let s=r.invalid;const l=r.handlers;if(i&&au.call(i,n)){const a=String(i[n]);s=au.call(l,a)?l[a]:r.unknown}if(s)return s.call(this,i,...o)}return r.handlers=t.handlers||{},r.invalid=t.invalid,r.unknown=t.unknown,r}const u3={}.hasOwnProperty;function Xf(n,e){let t=-1,r;if(e.extensions)for(;++t<e.extensions.length;)Xf(n,e.extensions[t]);for(r in e)if(u3.call(e,r))switch(r){case"extensions":break;case"unsafe":{uu(n[r],e[r]);break}case"join":{uu(n[r],e[r]);break}case"handlers":{c3(n[r],e[r]);break}default:n.options[r]=e[r]}return n}function uu(n,e){e&&n.push(...e)}function c3(n,e){e&&Object.assign(n,e)}function f3(n,e,t,r){const i=t.enter("blockquote"),o=t.createTracker(r);o.move("> "),o.shift(2);const s=t.indentLines(t.containerFlow(n,o.current()),h3);return i(),s}function h3(n,e,t){return">"+(t?"":" ")+n}function Qf(n,e){return cu(n,e.inConstruct,!0)&&!cu(n,e.notInConstruct,!1)}function cu(n,e,t){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return t;let r=-1;for(;++r<e.length;)if(n.includes(e[r]))return!0;return!1}function fu(n,e,t,r){let i=-1;for(;++i<t.unsafe.length;)if(t.unsafe[i].character===` |
| 31 |
`&&Qf(t.stack,t.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\ |
| 32 |
`}function p3(n,e){const t=String(n);let r=t.indexOf(e),i=r,o=0,s=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+e.length,r=t.indexOf(e,i);return s}function js(n,e){return!!(e.options.fences===!1&&n.value&&!n.lang&&/[^ \r\n]/.test(n.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(n.value))}function d3(n){const e=n.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function m3(n,e,t,r){const i=d3(t),o=n.value||"",s=i==="`"?"GraveAccent":"Tilde";if(js(n,t)){const f=t.enter("codeIndented"),h=t.indentLines(o,g3);return f(),h}const l=t.createTracker(r),a=i.repeat(Math.max(p3(o,i)+1,3)),u=t.enter("codeFenced");let c=l.move(a);if(n.lang){const f=t.enter(`codeFencedLang${s}`);c+=l.move(t.safe(n.lang,{before:c,after:" ",encode:["`"],...l.current()})),f()}if(n.lang&&n.meta){const f=t.enter(`codeFencedMeta${s}`);c+=l.move(" "),c+=l.move(t.safe(n.meta,{before:c,after:` |
| 33 |
`,encode:["`"],...l.current()})),f()}return c+=l.move(` |
| 34 |
`),o&&(c+=l.move(o+` |
| 35 |
`)),c+=l.move(a),u(),c}function g3(n,e,t){return(t?"":" ")+n}function Pl(n){const e=n.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function y3(n,e,t,r){const i=Pl(t),o=i==='"'?"Quote":"Apostrophe",s=t.enter("definition");let l=t.enter("label");const a=t.createTracker(r);let u=a.move("[");return u+=a.move(t.safe(t.associationId(n),{before:u,after:"]",...a.current()})),u+=a.move("]: "),l(),!n.url||/[\0- \u007F]/.test(n.url)?(l=t.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(t.safe(n.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=t.enter("destinationRaw"),u+=a.move(t.safe(n.url,{before:u,after:n.title?" ":` |
| 36 |
`,...a.current()}))),l(),n.title&&(l=t.enter(`title${o}`),u+=a.move(" "+i),u+=a.move(t.safe(n.title,{before:u,after:i,...a.current()})),u+=a.move(i),l()),s(),u}function w3(n){const e=n.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}eh.peek=b3;function eh(n,e,t,r){const i=w3(t),o=t.enter("emphasis"),s=t.createTracker(r);let l=s.move(i);return l+=s.move(t.containerPhrasing(n,{before:l,after:i,...s.current()})),l+=s.move(i),o(),l}function b3(n,e,t){return t.options.emphasis||"*"}const So=function(n){if(n==null)return _3;if(typeof n=="function")return Co(n);if(typeof n=="object")return Array.isArray(n)?x3(n):k3(n);if(typeof n=="string")return v3(n);throw new Error("Expected function, string, or object as test")};function x3(n){const e=[];let t=-1;for(;++t<n.length;)e[t]=So(n[t]);return Co(r);function r(...i){let o=-1;for(;++o<e.length;)if(e[o].apply(this,i))return!0;return!1}}function k3(n){const e=n;return Co(t);function t(r){const i=r;let o;for(o in n)if(i[o]!==e[o])return!1;return!0}}function v3(n){return Co(e);function e(t){return t&&t.type===n}}function Co(n){return e;function e(t,r,i){return!!(S3(t)&&n.call(this,t,typeof r=="number"?r:void 0,i||void 0))}}function _3(){return!0}function S3(n){return n!==null&&typeof n=="object"&&"type"in n}const th=[],C3=!0,Ws=!1,Us="skip";function nh(n,e,t,r){let i;typeof e=="function"&&typeof t!="function"?(r=t,t=e):i=e;const o=So(i),s=r?-1:1;l(n,void 0,[])();function l(a,u,c){const f=a&&typeof a=="object"?a:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(a.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=th,d,m,y;if((!e||o(a,u,c[c.length-1]||void 0))&&(p=A3(t(a,c)),p[0]===Ws))return p;if("children"in a&&a.children){const g=a;if(g.children&&p[0]!==Us)for(m=(r?g.children.length:-1)+s,y=c.concat(g);m>-1&&m<g.children.length;){const _=g.children[m];if(d=l(_,m,y)(),d[0]===Ws)return d;m=typeof d[1]=="number"?d[1]:m+s}}return p}}}function A3(n){return Array.isArray(n)?n:typeof n=="number"?[C3,n]:n==null?th:[n]}function Ll(n,e,t,r){let i,o,s;typeof e=="function"&&typeof t!="function"?(o=void 0,s=e,i=t):(o=e,s=t,i=r),nh(n,o,l,i);function l(a,u){const c=u[u.length-1],f=c?c.children.indexOf(a):void 0;return s(a,f,c)}}function rh(n,e){let t=!1;return Ll(n,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,Ws}),!!((!n.depth||n.depth<3)&&zl(n)&&(e.options.setext||t))}function M3(n,e,t,r){const i=Math.max(Math.min(6,n.depth||1),1),o=t.createTracker(r);if(rh(n,t)){const c=t.enter("headingSetext"),f=t.enter("phrasing"),h=t.containerPhrasing(n,{...o.current(),before:` |
| 37 |
`,after:` |
| 38 |
`});return f(),c(),h+` |
| 39 |
`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(` |
| 40 |
`))+1))}const s="#".repeat(i),l=t.enter("headingAtx"),a=t.enter("phrasing");o.move(s+" ");let u=t.containerPhrasing(n,{before:"# ",after:` |
| 41 |
`,...o.current()});return/^[\t ]/.test(u)&&(u="&#x"+u.charCodeAt(0).toString(16).toUpperCase()+";"+u.slice(1)),u=u?s+" "+u:s,t.options.closeAtx&&(u+=" "+s),a(),l(),u}ih.peek=O3;function ih(n){return n.value||""}function O3(){return"<"}oh.peek=E3;function oh(n,e,t,r){const i=Pl(t),o=i==='"'?"Quote":"Apostrophe",s=t.enter("image");let l=t.enter("label");const a=t.createTracker(r);let u=a.move("![");return u+=a.move(t.safe(n.alt,{before:u,after:"]",...a.current()})),u+=a.move("]("),l(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(l=t.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(t.safe(n.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=t.enter("destinationRaw"),u+=a.move(t.safe(n.url,{before:u,after:n.title?" ":")",...a.current()}))),l(),n.title&&(l=t.enter(`title${o}`),u+=a.move(" "+i),u+=a.move(t.safe(n.title,{before:u,after:i,...a.current()})),u+=a.move(i),l()),u+=a.move(")"),s(),u}function E3(){return"!"}sh.peek=T3;function sh(n,e,t,r){const i=n.referenceType,o=t.enter("imageReference");let s=t.enter("label");const l=t.createTracker(r);let a=l.move("![");const u=t.safe(n.alt,{before:a,after:"]",...l.current()});a+=l.move(u+"]["),s();const c=t.stack;t.stack=[],s=t.enter("reference");const f=t.safe(t.associationId(n),{before:a,after:"]",...l.current()});return s(),t.stack=c,o(),i==="full"||!u||u!==f?a+=l.move(f+"]"):i==="shortcut"?a=a.slice(0,-1):a+=l.move("]"),a}function T3(){return"!"}lh.peek=N3;function lh(n,e,t){let r=n.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<t.unsafe.length;){const s=t.unsafe[o],l=t.compilePattern(s);let a;if(s.atBreak)for(;a=l.exec(r);){let u=a.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(a.index+1)}}return i+r+i}function N3(){return"`"}function ah(n,e){const t=zl(n);return!!(!e.options.resourceLink&&n.url&&!n.title&&n.children&&n.children.length===1&&n.children[0].type==="text"&&(t===n.url||"mailto:"+t===n.url)&&/^[a-z][a-z+.-]+:/i.test(n.url)&&!/[\0- <>\u007F]/.test(n.url))}uh.peek=D3;function uh(n,e,t,r){const i=Pl(t),o=i==='"'?"Quote":"Apostrophe",s=t.createTracker(r);let l,a;if(ah(n,t)){const c=t.stack;t.stack=[],l=t.enter("autolink");let f=s.move("<");return f+=s.move(t.containerPhrasing(n,{before:f,after:">",...s.current()})),f+=s.move(">"),l(),t.stack=c,f}l=t.enter("link"),a=t.enter("label");let u=s.move("[");return u+=s.move(t.containerPhrasing(n,{before:u,after:"](",...s.current()})),u+=s.move("]("),a(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(a=t.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(t.safe(n.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(a=t.enter("destinationRaw"),u+=s.move(t.safe(n.url,{before:u,after:n.title?" ":")",...s.current()}))),a(),n.title&&(a=t.enter(`title${o}`),u+=s.move(" "+i),u+=s.move(t.safe(n.title,{before:u,after:i,...s.current()})),u+=s.move(i),a()),u+=s.move(")"),l(),u}function D3(n,e,t){return ah(n,t)?"<":"["}ch.peek=I3;function ch(n,e,t,r){const i=n.referenceType,o=t.enter("linkReference");let s=t.enter("label");const l=t.createTracker(r);let a=l.move("[");const u=t.containerPhrasing(n,{before:a,after:"]",...l.current()});a+=l.move(u+"]["),s();const c=t.stack;t.stack=[],s=t.enter("reference");const f=t.safe(t.associationId(n),{before:a,after:"]",...l.current()});return s(),t.stack=c,o(),i==="full"||!u||u!==f?a+=l.move(f+"]"):i==="shortcut"?a=a.slice(0,-1):a+=l.move("]"),a}function I3(){return"["}function Bl(n){const e=n.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function z3(n){const e=Bl(n),t=n.options.bulletOther;if(!t)return e==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+t+"`) to be different");return t}function R3(n){const e=n.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function fh(n){const e=n.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function F3(n,e,t,r){const i=t.enter("list"),o=t.bulletCurrent;let s=n.ordered?R3(t):Bl(t);const l=n.ordered?s==="."?")":".":z3(t);let a=e&&t.bulletLastUsed?s===t.bulletLastUsed:!1;if(!n.ordered){const c=n.children?n.children[0]:void 0;if((s==="*"||s==="-")&&c&&(!c.children||!c.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(a=!0),fh(t)===s&&c){let f=-1;for(;++f<n.children.length;){const h=n.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){a=!0;break}}}}a&&(s=l),t.bulletCurrent=s;const u=t.containerFlow(n,r);return t.bulletLastUsed=s,t.bulletCurrent=o,i(),u}function P3(n){const e=n.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function L3(n,e,t,r){const i=P3(t);let o=t.bulletCurrent||Bl(t);e&&e.type==="list"&&e.ordered&&(o=(typeof e.start=="number"&&e.start>-1?e.start:1)+(t.options.incrementListMarker===!1?0:e.children.indexOf(n))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||n.spread))&&(s=Math.ceil(s/4)*4);const l=t.createTracker(r);l.move(o+" ".repeat(s-o.length)),l.shift(s);const a=t.enter("listItem"),u=t.indentLines(t.containerFlow(n,l.current()),c);return a(),u;function c(f,h,p){return h?(p?"":" ".repeat(s))+f:(p?o:o+" ".repeat(s-o.length))+f}}function B3(n,e,t,r){const i=t.enter("paragraph"),o=t.enter("phrasing"),s=t.containerPhrasing(n,r);return o(),i(),s}const V3=So(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function H3(n,e,t,r){return(n.children.some(function(s){return V3(s)})?t.containerPhrasing:t.containerFlow).call(t,n,r)}function $3(n){const e=n.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}hh.peek=q3;function hh(n,e,t,r){const i=$3(t),o=t.enter("strong"),s=t.createTracker(r);let l=s.move(i+i);return l+=s.move(t.containerPhrasing(n,{before:l,after:i,...s.current()})),l+=s.move(i+i),o(),l}function q3(n,e,t){return t.options.strong||"*"}function j3(n,e,t,r){return t.safe(n.value,r)}function W3(n){const e=n.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function U3(n,e,t){const r=(fh(t)+(t.options.ruleSpaces?" ":"")).repeat(W3(t));return t.options.ruleSpaces?r.slice(0,-1):r}const Vl={blockquote:f3,break:fu,code:m3,definition:y3,emphasis:eh,hardBreak:fu,heading:M3,html:ih,image:oh,imageReference:sh,inlineCode:lh,link:uh,linkReference:ch,list:F3,listItem:L3,paragraph:B3,root:H3,strong:hh,text:j3,thematicBreak:U3},J3=[K3];function K3(n,e,t,r){if(e.type==="code"&&js(e,r)&&(n.type==="list"||n.type===e.type&&js(n,r)))return!1;if("spread"in t&&typeof t.spread=="boolean")return n.type==="paragraph"&&(n.type===e.type||e.type==="definition"||e.type==="heading"&&rh(e,r))?void 0:t.spread?1:0}const hn=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],Y3=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:` |
| 42 |
`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:hn},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r |
| 43 |
]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:hn},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r |
| 44 |
*])`},{character:"*",inConstruct:"phrasing",notInConstruct:hn},{atBreak:!0,character:"+",after:`(?:[ \r |
| 45 |
])`},{atBreak:!0,character:"-",after:`(?:[ \r |
| 46 |
-])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r |
| 47 |
]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:hn},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:hn},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:hn},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:hn},{atBreak:!0,character:"~"}];function G3(n){return n.label||!n.identifier?n.label||"":Yf(n.identifier)}function Z3(n){if(!n._compiled){const e=(n.atBreak?"[\\r\\n][\\t ]*":"")+(n.before?"(?:"+n.before+")":"");n._compiled=new RegExp((e?"("+e+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(n.character)?"\\":"")+n.character+(n.after?"(?:"+n.after+")":""),"g")}return n._compiled}function X3(n,e,t){const r=e.indexStack,i=n.children||[],o=[];let s=-1,l=t.before;r.push(-1);let a=e.createTracker(t);for(;++s<i.length;){const u=i[s];let c;if(r[r.length-1]=s,s+1<i.length){let f=e.handle.handlers[i[s+1].type];f&&f.peek&&(f=f.peek),c=f?f(i[s+1],n,e,{before:"",after:"",...a.current()}).charAt(0):""}else c=t.after;o.length>0&&(l==="\r"||l===` |
| 48 |
`)&&u.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),l=" ",a=e.createTracker(t),a.move(o.join(""))),o.push(a.move(e.handle(u,n,e,{...a.current(),before:l,after:c}))),l=o[o.length-1].slice(-1)}return r.pop(),o.join("")}function Q3(n,e,t){const r=e.indexStack,i=n.children||[],o=e.createTracker(t),s=[];let l=-1;for(r.push(-1);++l<i.length;){const a=i[l];r[r.length-1]=l,s.push(o.move(e.handle(a,n,e,{before:` |
| 49 |
`,after:` |
| 50 |
`,...o.current()}))),a.type!=="list"&&(e.bulletLastUsed=void 0),l<i.length-1&&s.push(o.move(ey(a,i[l+1],n,e)))}return r.pop(),s.join("")}function ey(n,e,t,r){let i=r.join.length;for(;i--;){const o=r.join[i](n,e,t,r);if(o===!0||o===1)break;if(typeof o=="number")return` |
| 51 |
`.repeat(1+o);if(o===!1)return` |
| 52 |
|
| 53 |
<!----> |
| 54 |
|
| 55 |
`}return` |
| 56 |
|
| 57 |
`}const ty=/\r?\n|\r/g;function ny(n,e){const t=[];let r=0,i=0,o;for(;o=ty.exec(n);)s(n.slice(r,o.index)),t.push(o[0]),r=o.index+o[0].length,i++;return s(n.slice(r)),t.join("");function s(l){t.push(e(l,i,!l))}}function ry(n,e,t){const r=(t.before||"")+(e||"")+(t.after||""),i=[],o=[],s={};let l=-1;for(;++l<n.unsafe.length;){const c=n.unsafe[l];if(!Qf(n.stack,c))continue;const f=n.compilePattern(c);let h;for(;h=f.exec(r);){const p="before"in c||!!c.atBreak,d="after"in c,m=h.index+(p?h[1].length:0);i.includes(m)?(s[m].before&&!p&&(s[m].before=!1),s[m].after&&!d&&(s[m].after=!1)):(i.push(m),s[m]={before:p,after:d})}}i.sort(iy);let a=t.before?t.before.length:0;const u=r.length-(t.after?t.after.length:0);for(l=-1;++l<i.length;){const c=i[l];c<a||c>=u||c+1<u&&i[l+1]===c+1&&s[c].after&&!s[c+1].before&&!s[c+1].after||i[l-1]===c-1&&s[c].before&&!s[c-1].before&&!s[c-1].after||(a!==c&&o.push(hu(r.slice(a,c),"\\")),a=c,/[!-/:-@[-`{-~]/.test(r.charAt(c))&&(!t.encode||!t.encode.includes(r.charAt(c)))?o.push("\\"):(o.push("&#x"+r.charCodeAt(c).toString(16).toUpperCase()+";"),a++))}return o.push(hu(r.slice(a,u),t.after)),o.join("")}function iy(n,e){return n-e}function hu(n,e){const t=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],o=n+e;let s=-1,l=0,a;for(;a=t.exec(o);)r.push(a.index);for(;++s<r.length;)l!==r[s]&&i.push(n.slice(l,r[s])),i.push("\\"),l=r[s];return i.push(n.slice(l)),i.join("")}function oy(n){const e=n||{},t=e.now||{};let r=e.lineShift||0,i=t.line||1,o=t.column||1;return{move:a,current:s,shift:l};function s(){return{now:{line:i,column:o},lineShift:r}}function l(u){r+=u}function a(u){const c=u||"",f=c.split(/\r?\n|\r/g),h=f[f.length-1];return i+=f.length-1,o=f.length===1?o+h.length:1+h.length+r,c}}function sy(n,e={}){const t={enter:i,indentLines:ny,associationId:G3,containerPhrasing:cy,containerFlow:fy,createTracker:oy,compilePattern:Z3,safe:hy,stack:[],unsafe:[...Y3],join:[...J3],handlers:{...Vl},options:{},indexStack:[],handle:void 0};Xf(t,e),t.options.tightDefinitions&&t.join.push(uy),t.handle=a3("type",{invalid:ly,unknown:ay,handlers:t.handlers});let r=t.handle(n,void 0,t,{before:` |
| 58 |
`,after:` |
| 59 |
`,now:{line:1,column:1},lineShift:0});return r&&r.charCodeAt(r.length-1)!==10&&r.charCodeAt(r.length-1)!==13&&(r+=` |
| 60 |
`),r;function i(o){return t.stack.push(o),s;function s(){t.stack.pop()}}}function ly(n){throw new Error("Cannot handle value `"+n+"`, expected node")}function ay(n){const e=n;throw new Error("Cannot handle unknown node `"+e.type+"`")}function uy(n,e){if(n.type==="definition"&&n.type===e.type)return 0}function cy(n,e){return X3(n,this,e)}function fy(n,e){return Q3(n,this,e)}function hy(n,e){return ry(this,n,e)}function i5(n){const e=this;e.compiler=t;function t(r){return sy(r,{...e.data("settings"),...n,extensions:e.data("toMarkdownExtensions")||[]})}}function pu(n){if(n)throw n}var Vi=Object.prototype.hasOwnProperty,ph=Object.prototype.toString,du=Object.defineProperty,mu=Object.getOwnPropertyDescriptor,gu=function(e){return typeof Array.isArray=="function"?Array.isArray(e):ph.call(e)==="[object Array]"},yu=function(e){if(!e||ph.call(e)!=="[object Object]")return!1;var t=Vi.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Vi.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!t&&!r)return!1;var i;for(i in e);return typeof i>"u"||Vi.call(e,i)},wu=function(e,t){du&&t.name==="__proto__"?du(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},bu=function(e,t){if(t==="__proto__")if(Vi.call(e,t)){if(mu)return mu(e,t).value}else return;return e[t]},py=function n(){var e,t,r,i,o,s,l=arguments[0],a=1,u=arguments.length,c=!1;for(typeof l=="boolean"&&(c=l,l=arguments[1]||{},a=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});a<u;++a)if(e=arguments[a],e!=null)for(t in e)r=bu(l,t),i=bu(e,t),l!==i&&(c&&i&&(yu(i)||(o=gu(i)))?(o?(o=!1,s=r&&gu(r)?r:[]):s=r&&yu(r)?r:{},wu(l,{name:t,newValue:n(c,s,i)})):typeof i<"u"&&wu(l,{name:t,newValue:i}));return l};const Uo=nd(py);function Js(n){if(typeof n!="object"||n===null)return!1;const e=Object.getPrototypeOf(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)}function dy(){const n=[],e={run:t,use:r};return e;function t(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);l(null,...i);function l(a,...u){const c=n[++o];let f=-1;if(a){s(a);return}for(;++f<i.length;)(u[f]===null||u[f]===void 0)&&(u[f]=i[f]);i=u,c?my(c,l)(...u):s(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return n.push(i),e}}function my(n,e){let t;return r;function r(...s){const l=n.length>s.length;let a;l&&s.push(i);try{a=n.apply(this,s)}catch(u){const c=u;if(l&&t)throw c;return i(c)}l||(a&&a.then&&typeof a.then=="function"?a.then(o,i):a instanceof Error?i(a):o(a))}function i(s,...l){t||(t=!0,e(s,...l))}function o(s){i(null,s)}}class Ve extends Error{constructor(e,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",o={},s=!1;if(t&&("line"in t&&"column"in t?o={place:t}:"start"in t&&"end"in t?o={place:t}:"type"in t?o={ancestors:[t],place:t.position}:o={...t}),typeof e=="string"?i=e:!o.cause&&e&&(s=!0,i=e.message,o.cause=e),!o.ruleId&&!o.source&&typeof r=="string"){const a=r.indexOf(":");a===-1?o.ruleId=r:(o.source=r.slice(0,a),o.ruleId=r.slice(a+1))}if(!o.place&&o.ancestors&&o.ancestors){const a=o.ancestors[o.ancestors.length-1];a&&(o.place=a.position)}const l=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=l?l.line:void 0,this.name=Rr(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Ve.prototype.file="";Ve.prototype.name="";Ve.prototype.reason="";Ve.prototype.message="";Ve.prototype.stack="";Ve.prototype.column=void 0;Ve.prototype.line=void 0;Ve.prototype.ancestors=void 0;Ve.prototype.cause=void 0;Ve.prototype.fatal=void 0;Ve.prototype.place=void 0;Ve.prototype.ruleId=void 0;Ve.prototype.source=void 0;const gt={basename:gy,dirname:yy,extname:wy,join:by,sep:"/"};function gy(n,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');ni(n);let t=0,r=-1,i=n.length,o;if(e===void 0||e.length===0||e.length>n.length){for(;i--;)if(n.codePointAt(i)===47){if(o){t=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":n.slice(t,r)}if(e===n)return"";let s=-1,l=e.length-1;for(;i--;)if(n.codePointAt(i)===47){if(o){t=i+1;break}}else s<0&&(o=!0,s=i+1),l>-1&&(n.codePointAt(i)===e.codePointAt(l--)?l<0&&(r=i):(l=-1,r=s));return t===r?r=s:r<0&&(r=n.length),n.slice(t,r)}function yy(n){if(ni(n),n.length===0)return".";let e=-1,t=n.length,r;for(;--t;)if(n.codePointAt(t)===47){if(r){e=t;break}}else r||(r=!0);return e<0?n.codePointAt(0)===47?"/":".":e===1&&n.codePointAt(0)===47?"//":n.slice(0,e)}function wy(n){ni(n);let e=n.length,t=-1,r=0,i=-1,o=0,s;for(;e--;){const l=n.codePointAt(e);if(l===47){if(s){r=e+1;break}continue}t<0&&(s=!0,t=e+1),l===46?i<0?i=e:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||t<0||o===0||o===1&&i===t-1&&i===r+1?"":n.slice(i,t)}function by(...n){let e=-1,t;for(;++e<n.length;)ni(n[e]),n[e]&&(t=t===void 0?n[e]:t+"/"+n[e]);return t===void 0?".":xy(t)}function xy(n){ni(n);const e=n.codePointAt(0)===47;let t=ky(n,!e);return t.length===0&&!e&&(t="."),t.length>0&&n.codePointAt(n.length-1)===47&&(t+="/"),e?"/"+t:t}function ky(n,e){let t="",r=0,i=-1,o=0,s=-1,l,a;for(;++s<=n.length;){if(s<n.length)l=n.codePointAt(s);else{if(l===47)break;l=47}if(l===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(a=t.lastIndexOf("/"),a!==t.length-1){a<0?(t="",r=0):(t=t.slice(0,a),r=t.length-1-t.lastIndexOf("/")),i=s,o=0;continue}}else if(t.length>0){t="",r=0,i=s,o=0;continue}}e&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+n.slice(i+1,s):t=n.slice(i+1,s),r=s-i-1;i=s,o=0}else l===46&&o>-1?o++:o=-1}return t}function ni(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const vy={cwd:_y};function _y(){return"/"}function Ks(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function Sy(n){if(typeof n=="string")n=new URL(n);else if(!Ks(n)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(n.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Cy(n)}function Cy(n){if(n.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=n.pathname;let t=-1;for(;++t<e.length;)if(e.codePointAt(t)===37&&e.codePointAt(t+1)===50){const r=e.codePointAt(t+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const Jo=["history","path","basename","stem","extname","dirname"];class Ay{constructor(e){let t;e?Ks(e)?t={path:e}:typeof e=="string"||My(e)?t={value:e}:t=e:t={},this.cwd="cwd"in t?"":vy.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Jo.length;){const o=Jo[r];o in t&&t[o]!==void 0&&t[o]!==null&&(this[o]=o==="history"?[...t[o]]:t[o])}let i;for(i in t)Jo.includes(i)||(this[i]=t[i])}get basename(){return typeof this.path=="string"?gt.basename(this.path):void 0}set basename(e){Yo(e,"basename"),Ko(e,"basename"),this.path=gt.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?gt.dirname(this.path):void 0}set dirname(e){xu(this.basename,"dirname"),this.path=gt.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?gt.extname(this.path):void 0}set extname(e){if(Ko(e,"extname"),xu(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=gt.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Ks(e)&&(e=Sy(e)),Yo(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?gt.basename(this.path,this.extname):void 0}set stem(e){Yo(e,"stem"),Ko(e,"stem"),this.path=gt.join(this.dirname||"",e+(this.extname||""))}fail(e,t,r){const i=this.message(e,t,r);throw i.fatal=!0,i}info(e,t,r){const i=this.message(e,t,r);return i.fatal=void 0,i}message(e,t,r){const i=new Ve(e,t,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Ko(n,e){if(n&&n.includes(gt.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+gt.sep+"`")}function Yo(n,e){if(!n)throw new Error("`"+e+"` cannot be empty")}function xu(n,e){if(!n)throw new Error("Setting `"+e+"` requires `path` to be set too")}function My(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const Oy=function(n){const r=this.constructor.prototype,i=r[n],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},Ey={}.hasOwnProperty;class Hl extends Oy{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=dy()}copy(){const e=new Hl;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];e.use(...r)}return e.data(Uo(!0,{},this.namespace)),e}data(e,t){return typeof e=="string"?arguments.length===2?(Xo("data",this.frozen),this.namespace[e]=t,this):Ey.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Xo("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=t.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=Si(e),r=this.parser||this.Parser;return Go("parse",r),r(String(t),t)}process(e,t){const r=this;return this.freeze(),Go("process",this.parser||this.Parser),Zo("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(o,s){const l=Si(e),a=r.parse(l);r.run(a,l,function(c,f,h){if(c||!f||!h)return u(c);const p=f,d=r.stringify(p,h);Ny(d)?h.value=d:h.result=d,u(c,h)});function u(c,f){c||!f?s(c):o?o(f):t(void 0,f)}}}processSync(e){let t=!1,r;return this.freeze(),Go("processSync",this.parser||this.Parser),Zo("processSync",this.compiler||this.Compiler),this.process(e,i),vu("processSync","process",t),r;function i(o,s){t=!0,pu(o),r=s}}run(e,t,r){ku(e),this.freeze();const i=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?o(void 0,r):new Promise(o);function o(s,l){const a=Si(t);i.run(e,a,u);function u(c,f,h){const p=f||e;c?l(c):s?s(p):r(void 0,p,h)}}}runSync(e,t){let r=!1,i;return this.run(e,t,o),vu("runSync","run",r),i;function o(s,l){pu(s),i=l,r=!0}}stringify(e,t){this.freeze();const r=Si(t),i=this.compiler||this.Compiler;return Zo("stringify",i),ku(e),i(e,r)}use(e,...t){const r=this.attachers,i=this.namespace;if(Xo("use",this.frozen),e!=null)if(typeof e=="function")a(e,t);else if(typeof e=="object")Array.isArray(e)?l(e):s(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function o(u){if(typeof u=="function")a(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[c,...f]=u;a(c,f)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(u.plugins),u.settings&&(i.settings=Uo(!0,i.settings,u.settings))}function l(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){const f=u[c];o(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function a(u,c){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===u){h=f;break}if(h===-1)r.push([u,...c]);else if(c.length>0){let[p,...d]=c;const m=r[h][1];Js(m)&&Js(p)&&(p=Uo(!0,m,p)),r[h]=[u,p,...d]}}}}const o5=new Hl().freeze();function Go(n,e){if(typeof e!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function Zo(n,e){if(typeof e!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function Xo(n,e){if(e)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ku(n){if(!Js(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function vu(n,e,t){if(!t)throw new Error("`"+n+"` finished async. Use `"+e+"` instead")}function Si(n){return Ty(n)?n:new Ay(n)}function Ty(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function Ny(n){return typeof n=="string"||Dy(n)}function Dy(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const dh=65535,mh=Math.pow(2,16);function Iy(n,e){return n+e*mh}function _u(n){return n&dh}function zy(n){return(n-(n&dh))/mh}const gh=1,yh=2,Hi=4,wh=8;class Ys{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&wh)>0}get deletedBefore(){return(this.delInfo&(gh|Hi))>0}get deletedAfter(){return(this.delInfo&(yh|Hi))>0}get deletedAcross(){return(this.delInfo&Hi)>0}}class je{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&je.empty)return je.empty}recover(e){let t=0,r=_u(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+zy(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,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?i:0);if(a>e)break;let u=this.ranges[l+o],c=this.ranges[l+s],f=a+u;if(e<=f){let h=u?e==a?-1:e==f?1:t:t,p=a+i+(h<0?0:c);if(r)return p;let d=e==(t<0?a:f)?null:Iy(l/3,e-a),m=e==a?yh:e==f?gh:Hi;return(t<0?e!=a:e!=f)&&(m|=wh),new Ys(p,m,d)}i+=c-u}return r?e+i:new Ys(e+i,0,null)}touches(e,t){let r=0,i=_u(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let u=this.ranges[l+o],c=a+u;if(e<=c&&l==i*3)return!0;r+=this.ranges[l+s]-u}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 s=this.ranges[i],l=s-(this.inverted?o:0),a=s+(this.inverted?0:o),u=this.ranges[i+t],c=this.ranges[i+r];e(l,l+u,a,a+c),o+=c-u}}invert(){return new je(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?je.empty:new je(e<0?[0,-e,0]:[0,0,e])}}je.empty=new je([]);class Jn{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 Jn(this.maps,this.mirror,e,t)}copy(){return new Jn(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 Jn;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 s=this.maps[o],l=s.mapResult(e,t);if(l.recover!=null){let a=this.getMirror(o);if(a!=null&&a>o&&a<this.to){o=a,e=this.maps[a].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return r?e:new Ys(e,i,null)}}const Qo=Object.create(null);class ve{getMap(){return je.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Qo[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 Qo)throw new RangeError("Duplicate use of step JSON ID "+e);return Qo[e]=t,t.prototype.jsonID=e,t}}class se{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new se(e,null)}static fail(e){return new se(null,e)}static fromReplace(e,t,r,i){try{return se.ok(e.replace(t,r,i))}catch(o){if(o instanceof Zi)return se.fail(o.message);throw o}}}function $l(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy($l(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return I.fromArray(r)}class Gt extends ve{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 P($l(t.content,(s,l)=>!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),t.openStart,t.openEnd);return se.fromReplace(e,this.from,this.to,o)}invert(){return new bt(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 Gt(t.pos,r.pos,this.mark)}merge(e){return e instanceof Gt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Gt(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 Gt(t.from,t.to,e.markFromJSON(t.mark))}}ve.jsonID("addMark",Gt);class bt extends ve{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 P($l(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return se.fromReplace(e,this.from,this.to,r)}invert(){return new Gt(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 bt(t.pos,r.pos,this.mark)}merge(e){return e instanceof bt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new bt(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 bt(t.from,t.to,e.markFromJSON(t.mark))}}ve.jsonID("removeMark",bt);class Zt extends ve{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return se.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return se.fromReplace(e,this.pos,this.pos+1,new P(I.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 Zt(this.pos,t.marks[i]);return new Zt(this.pos,this.mark)}}return new ir(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Zt(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 Zt(t.pos,e.markFromJSON(t.mark))}}ve.jsonID("addNodeMark",Zt);class ir extends ve{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return se.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return se.fromReplace(e,this.pos,this.pos+1,new P(I.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Zt(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:"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 ir(t.pos,e.markFromJSON(t.mark))}}ve.jsonID("removeNodeMark",ir);class be extends ve{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&Gs(e,this.from,this.to)?se.fail("Structure replace would overwrite content"):se.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new je([this.from,this.to-this.from,this.slice.size])}invert(e){return new be(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 be(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof be)||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?P.empty:new P(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new be(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?P.empty:new P(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new be(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 be(t.from,t.to,P.fromJSON(e,t.slice),!!t.structure)}}ve.jsonID("replace",be);class ke extends ve{constructor(e,t,r,i,o,s,l=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=l}apply(e){if(this.structure&&(Gs(e,this.from,this.gapFrom)||Gs(e,this.gapTo,this.to)))return se.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return se.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?se.fromReplace(e,this.from,this.to,r):se.fail("Content does not fit in gap")}getMap(){return new je([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,P.fromJSON(e,t.slice),t.insert,!!t.structure)}}ve.jsonID("replaceAround",ke);function Gs(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 s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function Ry(n,e,t,r){let i=[],o=[],s,l;n.doc.nodesBetween(e,t,(a,u,c)=>{if(!a.isInline)return;let f=a.marks;if(!r.isInSet(f)&&c.type.allowsMarkType(r.type)){let h=Math.max(u,e),p=Math.min(u+a.nodeSize,t),d=r.addToSet(f);for(let m=0;m<f.length;m++)f[m].isInSet(d)||(s&&s.to==h&&s.mark.eq(f[m])?s.to=p:i.push(s=new bt(h,p,f[m])));l&&l.to==h?l.to=p:o.push(l=new Gt(h,p,r))}}),i.forEach(a=>n.step(a)),o.forEach(a=>n.step(a))}function Fy(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(s,l)=>{if(!s.isInline)return;o++;let a=null;if(r instanceof ko){let u=s.marks,c;for(;c=r.isInSet(u);)(a||(a=[])).push(c),u=c.removeFromSet(u)}else r?r.isInSet(s.marks)&&(a=[r]):a=s.marks;if(a&&a.length){let u=Math.min(l+s.nodeSize,t);for(let c=0;c<a.length;c++){let f=a[c],h;for(let p=0;p<i.length;p++){let d=i[p];d.step==o-1&&f.eq(i[p].style)&&(h=d)}h?(h.to=u,h.step=o):i.push({style:f,from:Math.max(l,e),to:u,step:o})}}}),i.forEach(s=>n.step(new bt(s.from,s.to,s.style)))}function bh(n,e,t,r=t.contentMatch,i=!0){let o=n.doc.nodeAt(e),s=[],l=e+1;for(let a=0;a<o.childCount;a++){let u=o.child(a),c=l+u.nodeSize,f=r.matchType(u.type);if(!f)s.push(new be(l,c,P.empty));else{r=f;for(let h=0;h<u.marks.length;h++)t.allowsMarkType(u.marks[h].type)||n.step(new bt(l,c,u.marks[h]));if(i&&u.isText&&t.whitespace!="pre"){let h,p=/\r?\n|\r/g,d;for(;h=p.exec(u.text);)d||(d=new P(I.from(t.schema.text(" ",t.allowedMarks(u.marks))),0,0)),s.push(new be(l+h.index,l+h.index+h[0].length,d))}}l=c}if(!r.validEnd){let a=r.fillBefore(I.empty,!0);n.replace(l,l,new P(a,0,0))}for(let a=s.length-1;a>=0;a--)n.step(s[a])}function Py(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Ao(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),s=n.$to.indexAfter(r);if(r<n.depth&&i.canReplace(o,s,t))return r;if(r==0||i.type.spec.isolating||!Py(i,o,s))break}return null}function Ly(n,e,t){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),l=i.after(o+1),a=s,u=l,c=I.empty,f=0;for(let d=o,m=!1;d>t;d--)m||r.index(d)>0?(m=!0,c=I.from(r.node(d).copy(c)),f++):a--;let h=I.empty,p=0;for(let d=o,m=!1;d>t;d--)m||i.after(d+1)<i.end(d)?(m=!0,h=I.from(i.node(d).copy(h)),p++):u++;n.step(new ke(a,u,s,l,new P(c.append(h),f,p),c.size-f,!0))}function xh(n,e,t=null,r=n){let i=By(n,e),o=i&&Vy(r,e);return o?i.map(Su).concat({type:e,attrs:t}).concat(o.map(Su)):null}function Su(n){return{type:n,attrs:null}}function By(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return t.canReplaceWith(r,i,s)?o:null}function Vy(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let u=r;a&&u<i;u++)a=a.matchType(t.child(u).type);return!a||!a.validEnd?null:s}function Hy(n,e,t){let r=I.empty;for(let s=t.length-1;s>=0;s--){if(r.size){let l=t[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=I.from(t[s].type.create(t[s].attrs,r))}let i=e.start,o=e.end;n.step(new ke(i,o,i,o,new P(r,0,0),t.length,!0))}function $y(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,(s,l)=>{let a=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,a)&&Wy(n.doc,n.mapping.slice(o).map(l),r)){let u=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",d=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!d?u=!1:!p&&d&&(u=!0)}u===!1&&jy(n,s,l,o),bh(n,n.mapping.slice(o).map(l,1),r,void 0,u===null);let c=n.mapping.slice(o),f=c.map(l,1),h=c.map(l+s.nodeSize,1);return n.step(new ke(f,h,f+1,h-1,new P(I.from(r.create(a,null,s.marks)),0,0),1,!0)),u===!0&&qy(n,s,l,o),!1}})}function qy(n,e,t,r){e.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let a=n.mapping.slice(r).map(t+1+o+s.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function jy(n,e,t,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=n.mapping.slice(r).map(t+1+o);n.replaceWith(s,s+1,e.type.schema.text(` |
| 61 |
`))}})}function Wy(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function Uy(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 s=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,s);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 P(I.from(s),0,0),1,!0))}function Fr(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=t-2;u>o;u--,c--){let f=i.node(u),h=i.index(u);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(h,f.childCount),d=r&&r[c+1];d&&(p=p.replaceChild(0,d.type.create(d.attrs)));let m=r&&r[c]||f;if(!f.canReplace(h+1,f.childCount)||!m.type.validContent(p))return!1}let l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}function Jy(n,e,t=1,r){let i=n.doc.resolve(e),o=I.empty,s=I.empty;for(let l=i.depth,a=i.depth-t,u=t-1;l>a;l--,u--){o=I.from(i.node(l).copy(o));let c=r&&r[u];s=I.from(c?c.type.create(c.attrs,s):i.node(l).copy(s))}n.step(new be(e,e,new P(o.append(s),t,t),!0))}function Mo(n,e){let t=n.resolve(e),r=t.index();return Ky(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Ky(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function Yy(n,e,t){let r=new be(e-t,e+t,P.empty,!0);n.step(r)}function Gy(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 Zy(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 s=r.depth;s>=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,a=r.index(s)+(l>0?1:0),u=r.node(s),c=!1;if(o==1)c=u.canReplace(a,a,i);else{let f=u.contentMatchAt(a).findWrapping(i.firstChild.type);c=f&&u.canReplaceWith(a,a,f[0])}if(c)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function ql(n,e,t=e,r=P.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return kh(i,o,r)?new be(e,t,r):new Xy(i,o,r).fit()}function kh(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class Xy{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=I.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=I.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):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,s=r.depth,l=i.depth;for(;s&&l&&o.childCount==1;)o=o.firstChild.content,s--,l--;let a=new P(o,s,l);return e>-1?new ke(r.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||r.pos!=this.$to.pos?new be(r.pos,i.pos,a):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=es(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:u}=this.frontier[l],c,f=null;if(t==1&&(s?u.matchType(s.type)||(f=u.fillBefore(I.from(s),!1)):o&&a.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:f};if(t==2&&s&&(c=u.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:c};if(o&&u.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=es(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new P(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=es(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new P(vr(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new P(vr(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 m=0;m<o.length;m++)this.openFrontierNode(o[m]);let s=this.unplaced,l=r?r.content:s.content,a=s.openStart-e,u=0,c=[],{match:f,type:h}=this.frontier[t];if(i){for(let m=0;m<i.childCount;m++)c.push(i.child(m));f=f.matchFragment(i)}let p=l.size+e-(s.content.size-s.openEnd);for(;u<l.childCount;){let m=l.child(u),y=f.matchType(m.type);if(!y)break;u++,(u>1||a==0||m.content.size)&&(f=y,c.push(vh(m.mark(h.allowedMarks(m.marks)),u==1?a:0,u==l.childCount?p:-1)))}let d=u==l.childCount;d||(p=-1),this.placed=_r(this.placed,t,I.from(c)),this.frontier[t].match=f,d&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,y=l;m<p;m++){let g=y.lastChild;this.frontier.push({type:g.type,match:g.contentMatchAt(g.childCount)}),y=g.content}this.unplaced=d?e==0?P.empty:new P(vr(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new P(vr(s.content,e,u),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!ts(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)),s=ts(e,t,i,r,o);if(s){for(let l=t-1;l>=0;l--){let{match:a,type:u}=this.frontier[l],c=ts(e,l,u,a,!0);if(!c||c.childCount)continue e}return{depth:t,fit:s,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=_r(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=_r(this.placed,this.depth,I.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(I.empty,!0);t.childCount&&(this.placed=_r(this.placed,this.frontier.length,t))}}function vr(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(vr(n.firstChild.content,e-1,t)))}function _r(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(_r(n.lastChild.content,e-1,t)))}function es(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function vh(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,vh(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(I.empty,!0)))),n.copy(r)}function ts(n,e,t,r,i){let o=n.node(e),s=i?n.indexAfter(e):n.index(e);if(s==o.childCount&&!t.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!Qy(t,o.content,s)?l:null}function Qy(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function e6(n){return n.spec.defining||n.spec.definingForContent}function t6(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),o=n.doc.resolve(t);if(kh(i,o,r))return n.step(new be(e,t,r));let s=Sh(i,n.doc.resolve(t));s[s.length-1]==0&&s.pop();let l=-(i.depth+1);s.unshift(l);for(let h=i.depth,p=i.pos-1;h>0;h--,p--){let d=i.node(h).type.spec;if(d.defining||d.definingAsContext||d.isolating)break;s.indexOf(h)>-1?l=h:i.before(h)==p&&s.splice(1,0,-h)}let a=s.indexOf(l),u=[],c=r.openStart;for(let h=r.content,p=0;;p++){let d=h.firstChild;if(u.push(d),p==r.openStart)break;h=d.content}for(let h=c-1;h>=0;h--){let p=u[h],d=e6(p.type);if(d&&!p.sameMarkup(i.node(Math.abs(l)-1)))c=h;else if(d||!p.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let p=(h+c+1)%(r.openStart+1),d=u[p];if(d)for(let m=0;m<s.length;m++){let y=s[(m+a)%s.length],g=!0;y<0&&(g=!1,y=-y);let _=i.node(y-1),x=i.index(y-1);if(_.canReplaceWith(x,x,d.type,d.marks))return n.replace(i.before(y),g?o.after(y):t,new P(_h(r.content,0,r.openStart,p),p,r.openEnd))}}let f=n.steps.length;for(let h=s.length-1;h>=0&&(n.replace(e,t,r),!(n.steps.length>f));h--){let p=s[h];p<0||(e=i.before(p),t=o.after(p))}}function _h(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(_h(o.content,e+1,t,r,o)))}if(e>r){let o=i.contentMatchAt(0),s=o.fillBefore(n).append(n);n=s.append(o.matchFragment(s).fillBefore(I.empty,!0))}return n}function n6(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=Gy(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new P(I.from(r),0,0))}function r6(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=Sh(r,i);for(let s=0;s<o.length;s++){let l=o[s],a=s==o.length-1;if(a&&l==0||r.node(l).type.contentMatch.validEnd)return n.delete(r.start(l),i.end(l));if(l>0&&(a||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return n.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&t>r.end(s)&&i.end(s)-t!=i.depth-s)return n.delete(r.before(s),t);n.delete(e,t)}function Sh(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 Kn extends ve{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 se.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 se.fromReplace(e,this.pos,this.pos+1,new P(I.from(i),0,t.isLeaf?0:1))}getMap(){return je.empty}invert(e){return new Kn(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 Kn(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 Kn(t.pos,t.attr,t.value)}}ve.jsonID("attr",Kn);class Jr extends ve{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 se.ok(r)}getMap(){return je.empty}invert(e){return new Jr(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 Jr(t.attr,t.value)}}ve.jsonID("docAttr",Jr);let or=class extends Error{};or=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};or.prototype=Object.create(Error.prototype);or.prototype.constructor=or;or.prototype.name="TransformError";class Ch{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Jn}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new or(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=P.empty){let i=ql(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new P(I.from(r),0,0))}delete(e,t){return this.replace(e,t,P.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return t6(this,e,t,r),this}replaceRangeWith(e,t,r){return n6(this,e,t,r),this}deleteRange(e,t){return r6(this,e,t),this}lift(e,t){return Ly(this,e,t),this}join(e,t=1){return Yy(this,e,t),this}wrap(e,t){return Hy(this,e,t),this}setBlockType(e,t=e,r,i=null){return $y(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return Uy(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new Kn(e,t,r)),this}setDocAttribute(e,t){return this.step(new Jr(e,t)),this}addNodeMark(e,t){return this.step(new Zt(e,t)),this}removeNodeMark(e,t){if(!(t instanceof ee)){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 ir(e,t)),this}split(e,t=1,r){return Jy(this,e,t,r),this}addMark(e,t,r){return Ry(this,e,t,r),this}removeMark(e,t,r){return Fy(this,e,t,r),this}clearIncompatible(e,t,r){return bh(this,e,t,r),this}}const ns=Object.create(null);class j{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new io(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=P.empty){let r=t.content.lastChild,i=null;for(let l=0;l<t.openEnd;l++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let l=0;l<s.length;l++){let{$from:a,$to:u}=s[l],c=e.mapping.slice(o);e.replaceRange(c.map(a.pos),c.map(u.pos),l?P.empty:t),l==0&&Mu(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:s,$to:l}=i[o],a=e.mapping.slice(r),u=a.map(s.pos),c=a.map(l.pos);o?e.deleteRange(u,c):(e.replaceRangeWith(u,c,t),Mu(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new Z(e):qn(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 s=t<0?qn(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):qn(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(s)return s}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Ke(e.node(0))}static atStart(e){return qn(e,e,0,0,1)||new Ke(e)}static atEnd(e){return qn(e,e,e.content.size,e.childCount,-1)||new Ke(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=ns[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 ns)throw new RangeError("Duplicate use of selection JSON ID "+e);return ns[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Z.between(this.$anchor,this.$head).getBookmark()}}j.prototype.visible=!0;class io{constructor(e,t){this.$from=e,this.$to=t}}let Cu=!1;function Au(n){!Cu&&!n.parent.inlineContent&&(Cu=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class Z extends j{constructor(e,t=e){Au(e),Au(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 j.near(r);let i=e.resolve(t.map(this.anchor));return new Z(i.parent.inlineContent?i:r,r)}replace(e,t=P.empty){if(super.replace(e,t),t==P.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Z&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Oo(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 Z(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=j.findFrom(t,r,!0)||j.findFrom(t,-r,!0);if(o)t=o.$head;else return j.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(j.findFrom(e,-r,!0)||j.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new Z(e,t)}}j.jsonID("text",Z);class Oo{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Oo(e.map(this.anchor),e.map(this.head))}resolve(e){return Z.between(e.resolve(this.anchor),e.resolve(this.head))}}class q extends j{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?j.near(o):new q(o)}content(){return new P(I.from(this.node),0,0)}eq(e){return e instanceof q&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new jl(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new q(e.resolve(t.anchor))}static create(e,t){return new q(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}q.prototype.visible=!1;j.jsonID("node",q);class jl{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new Oo(r,r):new jl(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&q.isSelectable(r)?new q(t):j.near(t)}}class Ke extends j{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=P.empty){if(t==P.empty){e.delete(0,e.doc.content.size);let r=j.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Ke(e)}map(e){return new Ke(e)}eq(e){return e instanceof Ke}getBookmark(){return i6}}j.jsonID("all",Ke);const i6={map(){return this},resolve(n){return new Ke(n)}};function qn(n,e,t,r,i,o=!1){if(e.inlineContent)return Z.create(n,t);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&q.isSelectable(l))return q.create(n,t-(i<0?l.nodeSize:0))}else{let a=qn(n,l,t+i,i<0?l.childCount:0,i,o);if(a)return a}t+=l.nodeSize*i}return null}function Mu(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof be||i instanceof ke))return;let o=n.mapping.maps[r],s;o.forEach((l,a,u,c)=>{s==null&&(s=c)}),n.setSelection(j.near(n.doc.resolve(s),t))}const Ou=1,Ci=2,Eu=4;class o6 extends Ch{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Ou)&~Ci,this.storedMarks=null,this}get selectionSet(){return(this.updated&Ou)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ci,this}ensureMarks(e){return ee.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Ci)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~Ci,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ee.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(t);o=r==t?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,i.text(e,o)),this.selection.empty||this.setSelection(j.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Eu,this}get scrolledIntoView(){return(this.updated&Eu)>0}}function Tu(n,e){return!e||!n?n:n.bind(e)}class Sr{constructor(e,t,r){this.name=e,this.init=Tu(t.init,r),this.apply=Tu(t.apply,r)}}const s6=[new Sr("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Sr("selection",{init(n,e){return n.selection||j.atStart(e.doc)},apply(n){return n.selection}}),new Sr("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Sr("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class rs{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=s6.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Sr(r.key,r.spec.state,r))})}}class Cr{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=t){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let l=this.config.plugins[s];if(l.spec.appendTransaction){let a=i?i[s].n:0,u=i?i[s].state:this,c=a<t.length&&l.spec.appendTransaction.call(l,a?t.slice(a):t,u,r);if(c&&r.filterTransaction(c,s)){if(c.setMeta("appendedTransaction",e),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<s?{state:r,n:t.length}:{state:this,n:0})}t.push(c),r=r.applyInner(c),o=!0}i&&(i[s]={state:r,n:t.length})}}if(!o)return{state:r,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Cr(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new o6(this)}static create(e){let t=new rs(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Cr(t);for(let i=0;i<t.fields.length;i++)r[t.fields[i].name]=t.fields[i].init(e,r);return r}reconfigure(e){let t=new rs(this.schema,e.plugins),r=t.fields,i=new Cr(t);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(t[r]=o.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new rs(e.schema,e.plugins),o=new Cr(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=Cn.fromJSON(e.schema,t.doc);else if(s.name=="selection")o.selection=j.fromJSON(o.doc,t.selection);else if(s.name=="storedMarks")t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],u=a.spec.state;if(a.key==s.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(t,l)){o[s.name]=u.fromJSON.call(a,e,t[l],o);return}}o[s.name]=s.init(e,o)}}),o}}function Ah(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Ah(i,e,{})),t[r]=i}return t}class ri{constructor(e){this.spec=e,this.props={},e.props&&Ah(e.props,this,this.props),this.key=e.key?e.key.key:Mh("plugin")}getState(e){return e[this.key]}}const is=Object.create(null);function Mh(n){return n in is?n+"$"+ ++is[n]:(is[n]=0,n+"$")}class fr{constructor(e="key"){this.key=Mh(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}class un{constructor(e,t,r={}){this.match=e,this.match=e,this.handler=typeof t=="string"?l6(t):t,this.undoable=r.undoable!==!1,this.inCode=r.inCode||!1}}function l6(n){return function(e,t,r,i){let o=n;if(t[1]){let s=t[0].lastIndexOf(t[1]);o+=t[0].slice(s+t[1].length),r+=s;let l=r-i;l>0&&(o=t[0].slice(s-l,s)+o,r=i)}return e.tr.insertText(o,r,i)}}const s5=(n,e)=>{let t=n.plugins;for(let r=0;r<t.length;r++){let i=t[r],o;if(i.spec.isInputRules&&(o=i.getState(n))){if(e){let s=n.tr,l=o.transform;for(let a=l.steps.length-1;a>=0;a--)s.step(l.steps[a].invert(l.docs[a]));if(o.text){let a=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,n.schema.text(o.text,a))}else s.delete(o.from,o.to);e(s)}return!0}}return!1};new un(/--$/,"—");new un(/\.\.\.$/,"…");new un(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“");new un(/"$/,"”");new un(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘");new un(/'$/,"’");function l5(n,e,t=null,r){return new un(n,(i,o,s,l)=>{let a=t instanceof Function?t(o):t,u=i.tr.delete(s,l),c=u.doc.resolve(s),f=c.blockRange(),h=f&&xh(f,e,a);if(!h)return null;u.wrap(f,h);let p=u.doc.resolve(s-1).nodeBefore;return p&&p.type==e&&Mo(u.doc,s-1)&&(!r||r(o,p))&&u.join(s-1),u})}function a5(n,e,t=null){return new un(n,(r,i,o,s)=>{let l=r.doc.resolve(o),a=t instanceof Function?t(i):t;return l.node(-1).canReplaceWith(l.index(-1),l.indexAfter(-1),e)?r.tr.delete(o,s).setBlockType(o,o,e,a):null})}const Oh=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function a6(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const u6=(n,e,t)=>{let r=a6(n,t);if(!r)return!1;let i=Eh(r);if(!i){let s=r.blockRange(),l=s&&Ao(s);return l==null?!1:(e&&e(n.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(Nh(n,i,e,-1))return!0;if(r.parent.content.size==0&&(sr(o,"end")||q.isSelectable(o)))for(let s=r.depth;;s--){let l=ql(n.doc,r.before(s),r.after(s),P.empty);if(l&&l.slice.size<l.to-l.from){if(e){let a=n.tr.step(l);a.setSelection(sr(o,"end")?j.findFrom(a.doc.resolve(a.mapping.map(i.pos,-1)),-1):q.create(a.doc,i.pos-o.nodeSize)),e(a.scrollIntoView())}return!0}if(s==1||r.node(s-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};function sr(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 c6=(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=Eh(r)}let s=o&&o.nodeBefore;return!s||!q.isSelectable(s)?!1:(e&&e(n.tr.setSelection(q.create(n.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function Eh(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 f6(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const h6=(n,e,t)=>{let r=f6(n,t);if(!r)return!1;let i=Th(r);if(!i)return!1;let o=i.nodeAfter;if(Nh(n,i,e,1))return!0;if(r.parent.content.size==0&&(sr(o,"start")||q.isSelectable(o))){let s=ql(n.doc,r.before(),r.after(),P.empty);if(s&&s.slice.size<s.to-s.from){if(e){let l=n.tr.step(s);l.setSelection(sr(o,"start")?j.findFrom(l.doc.resolve(l.mapping.map(i.pos)),1):q.create(l.doc,l.mapping.map(i.pos))),e(l.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},p6=(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=Th(r)}let s=o&&o.nodeAfter;return!s||!q.isSelectable(s)?!1:(e&&e(n.tr.setSelection(q.create(n.doc,o.pos)).scrollIntoView()),!0)};function Th(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 d6=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(` |
| 62 |
`).scrollIntoView()),!0)};function Wl(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 m6=(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),s=Wl(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let l=t.after(),a=n.tr.replaceWith(l,l,s.createAndFill());a.setSelection(j.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},g6=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof Ke||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Wl(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,l=n.tr.insert(s,o.createAndFill());l.setSelection(Z.create(l.doc,s+1)),e(l.scrollIntoView())}return!0},y6=(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(Fr(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&Ao(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)};function w6(n){return(e,t)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof q&&e.selection.node.isBlock)return!r.parentOffset||!Fr(e.doc,r.pos)?!1:(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(t){let o=i.parentOffset==i.parent.content.size,s=e.tr;(e.selection instanceof Z||e.selection instanceof Ke)&&s.deleteSelection();let l=r.depth==0?null:Wl(r.node(-1).contentMatchAt(r.indexAfter(-1))),a=n&&n(i.parent,o,r),u=a?[a]:o&&l?[{type:l}]:void 0,c=Fr(s.doc,s.mapping.map(r.pos),1,u);if(!u&&!c&&Fr(s.doc,s.mapping.map(r.pos),1,l?[{type:l}]:void 0)&&(l&&(u=[{type:l}]),c=!0),c&&(s.split(s.mapping.map(r.pos),1,u),!o&&!r.parentOffset&&r.parent.type!=l)){let f=s.mapping.map(r.before()),h=s.doc.resolve(f);l&&r.node(-1).canReplaceWith(h.index(),h.index()+1,l)&&s.setNodeMarkup(s.mapping.map(r.before()),l)}t(s.scrollIntoView())}return!0}}const b6=w6(),x6=(n,e)=>(e&&e(n.tr.setSelection(new Ke(n.doc))),!0);function k6(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||Mo(n.doc,e.pos))?!1:(t&&t(n.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function Nh(n,e,t,r){let i=e.nodeBefore,o=e.nodeAfter,s,l,a=i.type.spec.isolating||o.type.spec.isolating;if(!a&&k6(n,e,t))return!0;let u=!a&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(s=(l=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&l.matchType(s[0]||o.type).validEnd){if(t){let p=e.pos+o.nodeSize,d=I.empty;for(let g=s.length-1;g>=0;g--)d=I.from(s[g].create(null,d));d=I.from(i.copy(d));let m=n.tr.step(new ke(e.pos-1,p,e.pos,p,new P(d,1,0),s.length,!0)),y=p+2*s.length;Mo(m.doc,y)&&m.join(y),t(m.scrollIntoView())}return!0}let c=o.type.spec.isolating||r>0&&a?null:j.findFrom(e,1),f=c&&c.$from.blockRange(c.$to),h=f&&Ao(f);if(h!=null&&h>=e.depth)return t&&t(n.tr.lift(f,h).scrollIntoView()),!0;if(u&&sr(o,"start",!0)&&sr(i,"end")){let p=i,d=[];for(;d.push(p),!p.isTextblock;)p=p.lastChild;let m=o,y=1;for(;!m.isTextblock;m=m.firstChild)y++;if(p.canReplace(p.childCount,p.childCount,m.content)){if(t){let g=I.empty;for(let x=d.length-1;x>=0;x--)g=I.from(d[x].copy(g));let _=n.tr.step(new ke(e.pos-d.length,e.pos+o.nodeSize,e.pos+y,e.pos+o.nodeSize-y,new P(g,d.length,0),0,!0));t(_.scrollIntoView())}return!0}}return!1}function Dh(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(Z.create(e.doc,n<0?i.start(o):i.end(o)))),!0):!1}}const v6=Dh(-1),_6=Dh(1);function u5(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,s=i.blockRange(o),l=s&&xh(s,n,e);return l?(r&&r(t.tr.wrap(s,l).scrollIntoView()),!0):!1}}function c5(n,e=null){return function(t,r){let i=!1;for(let o=0;o<t.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:l}}=t.selection.ranges[o];t.doc.nodesBetween(s,l,(a,u)=>{if(i)return!1;if(!(!a.isTextblock||a.hasMarkup(n,e)))if(a.type==n)i=!0;else{let c=t.doc.resolve(u),f=c.index();i=c.parent.canReplaceWith(f,f+1,n)}})}if(!i)return!1;if(r){let o=t.tr;for(let s=0;s<t.selection.ranges.length;s++){let{$from:{pos:l},$to:{pos:a}}=t.selection.ranges[s];o.setBlockType(l,a,n,e)}r(o.scrollIntoView())}return!0}}function S6(n,e,t,r){for(let i=0;i<e.length;i++){let{$from:o,$to:s}=e[i],l=o.depth==0?n.inlineContent&&n.type.allowsMarkType(t):!1;if(n.nodesBetween(o.pos,s.pos,(a,u)=>{if(l||!r&&a.isAtom&&a.isInline&&u>=o.pos&&u+a.nodeSize<=s.pos)return!1;l=a.inlineContent&&a.type.allowsMarkType(t)}),l)return!0}return!1}function C6(n){let e=[];for(let t=0;t<n.length;t++){let{$from:r,$to:i}=n[t];r.doc.nodesBetween(r.pos,i.pos,(o,s)=>{if(o.isAtom&&o.content.size&&o.isInline&&s>=r.pos&&s+o.nodeSize<=i.pos)return s+1>r.pos&&e.push(new io(r,r.doc.resolve(s+1))),r=r.doc.resolve(s+1+o.content.size),!1}),r.pos<i.pos&&e.push(new io(r,i))}return e}function f5(n,e=null,t){let r=(t&&t.removeWhenPresent)!==!1,i=(t&&t.enterInlineAtoms)!==!1;return function(o,s){let{empty:l,$cursor:a,ranges:u}=o.selection;if(l&&!a||!S6(o.doc,u,n,i))return!1;if(s)if(a)n.isInSet(o.storedMarks||a.marks())?s(o.tr.removeStoredMark(n)):s(o.tr.addStoredMark(n.create(e)));else{let c,f=o.tr;i||(u=C6(u)),r?c=!u.some(h=>o.doc.rangeHasMark(h.$from.pos,h.$to.pos,n)):c=!u.every(h=>{let p=!1;return f.doc.nodesBetween(h.$from.pos,h.$to.pos,(d,m,y)=>{if(p)return!1;p=!n.isInSet(d.marks)&&!!y&&y.type.allowsMarkType(n)&&!(d.isText&&/^\s*$/.test(d.textBetween(Math.max(0,h.$from.pos-m),Math.min(d.nodeSize,h.$to.pos-m))))}),!p});for(let h=0;h<u.length;h++){let{$from:p,$to:d}=u[h];if(!c)f.removeMark(p.pos,d.pos,n);else{let m=p.pos,y=d.pos,g=p.nodeAfter,_=d.nodeBefore,x=g&&g.isText?/^\s*/.exec(g.text)[0].length:0,S=_&&_.isText?/\s*$/.exec(_.text)[0].length:0;m+x<y&&(m+=x,y-=S),f.addMark(m,y,n.create(e))}}s(f.scrollIntoView())}return!0}}function Ul(...n){return function(e,t,r){for(let i=0;i<n.length;i++)if(n[i](e,t,r))return!0;return!1}}let ss=Ul(Oh,u6,c6),Nu=Ul(Oh,h6,p6);const Nt={Enter:Ul(d6,g6,y6,b6),"Mod-Enter":m6,Backspace:ss,"Mod-Backspace":ss,"Shift-Backspace":ss,Delete:Nu,"Mod-Delete":Nu,"Mod-a":x6},Ih={"Ctrl-h":Nt.Backspace,"Alt-Backspace":Nt["Mod-Backspace"],"Ctrl-d":Nt.Delete,"Ctrl-Alt-Backspace":Nt["Mod-Delete"],"Alt-Delete":Nt["Mod-Delete"],"Alt-d":Nt["Mod-Delete"],"Ctrl-a":v6,"Ctrl-e":_6};for(let n in Nt)Ih[n]=Nt[n];const A6=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform?os.platform()=="darwin":!1,h5=A6?Ih:Nt;var on={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:"'"},oo={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},M6=typeof navigator<"u"&&/Mac/.test(navigator.platform),O6=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var me=0;me<10;me++)on[48+me]=on[96+me]=String(me);for(var me=1;me<=24;me++)on[me+111]="F"+me;for(var me=65;me<=90;me++)on[me]=String.fromCharCode(me+32),oo[me]=String.fromCharCode(me);for(var ls in on)oo.hasOwnProperty(ls)||(oo[ls]=on[ls]);function E6(n){var e=M6&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||O6&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?oo:on)[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 T6=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function N6(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,o,s;for(let l=0;l<e.length-1;l++){let a=e[l];if(/^(cmd|meta|m)$/i.test(a))s=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))i=!0;else if(/^s(hift)?$/i.test(a))o=!0;else if(/^mod$/i.test(a))T6?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+a)}return r&&(t="Alt-"+t),i&&(t="Ctrl-"+t),s&&(t="Meta-"+t),o&&(t="Shift-"+t),t}function D6(n){let e=Object.create(null);for(let t in n)e[N6(t)]=n[t];return e}function as(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 p5(n){return new ri({props:{handleKeyDown:zh(n)}})}function zh(n){let e=D6(n);return function(t,r){let i=E6(r),o,s=e[as(i,r)];if(s&&s(t.state,t.dispatch,t))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let l=e[as(i,r,!1)];if(l&&l(t.state,t.dispatch,t))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=on[r.keyCode])&&o!=i){let l=e[as(o,r)];if(l&&l(t.state,t.dispatch,t))return!0}}return!1}}const ge=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},Kr=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let Zs=null;const Tt=function(n,e,t){let r=Zs||(Zs=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},I6=function(){Zs=null},Nn=function(n,e,t,r){return t&&(Du(n,e,t,r,-1)||Du(n,e,t,r,1))},z6=/^(img|br|input|textarea|hr)$/i;function Du(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:wt(n))){let o=n.parentNode;if(!o||o.nodeType!=1||ii(n)||z6.test(n.nodeName)||n.contentEditable=="false")return!1;e=ge(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?wt(n):0}else return!1}}function wt(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function R6(n,e){for(;;){if(n.nodeType==3&&e)return n;if(n.nodeType==1&&e>0){if(n.contentEditable=="false")return null;n=n.childNodes[e-1],e=wt(n)}else if(n.parentNode&&!ii(n))e=ge(n),n=n.parentNode;else return null}}function F6(n,e){for(;;){if(n.nodeType==3&&e<n.nodeValue.length)return n;if(n.nodeType==1&&e<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[e],e=0}else if(n.parentNode&&!ii(n))e=ge(n)+1,n=n.parentNode;else return null}}function P6(n,e,t){for(let r=e==0,i=e==wt(n);r||i;){if(n==t)return!0;let o=ge(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==wt(n)}}function ii(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 Eo=function(n){return n.focusNode&&Nn(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function mn(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}function L6(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function B6(n,e,t){if(n.caretPositionFromPoint)try{let r=n.caretPositionFromPoint(e,t);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(n.caretRangeFromPoint){let r=n.caretRangeFromPoint(e,t);if(r)return{node:r.startContainer,offset:r.startOffset}}}const _t=typeof navigator<"u"?navigator:null,Iu=typeof document<"u"?document:null,cn=_t&&_t.userAgent||"",Xs=/Edge\/(\d+)/.exec(cn),Rh=/MSIE \d/.exec(cn),Qs=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(cn),Le=!!(Rh||Qs||Xs),Qt=Rh?document.documentMode:Qs?+Qs[1]:Xs?+Xs[1]:0,ht=!Le&&/gecko\/(\d+)/i.test(cn);ht&&+(/Firefox\/(\d+)/.exec(cn)||[0,0])[1];const el=!Le&&/Chrome\/(\d+)/.exec(cn),xe=!!el,Fh=el?+el[1]:0,Ee=!Le&&!!_t&&/Apple Computer/.test(_t.vendor),lr=Ee&&(/Mobile\/\w+/.test(cn)||!!_t&&_t.maxTouchPoints>2),Ge=lr||(_t?/Mac/.test(_t.platform):!1),V6=_t?/Win/.test(_t.platform):!1,at=/Android \d/.test(cn),oi=!!Iu&&"webkitFontSmoothing"in Iu.documentElement.style,H6=oi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function $6(n){let e=n.defaultView&&n.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Ot(n,e){return typeof n=="number"?n:n[e]}function q6(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function zu(n,e,t){let r=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,o=n.dom.ownerDocument;for(let s=t||n.dom;s;s=Kr(s)){if(s.nodeType!=1)continue;let l=s,a=l==o.body,u=a?$6(o):q6(l),c=0,f=0;if(e.top<u.top+Ot(r,"top")?f=-(u.top-e.top+Ot(i,"top")):e.bottom>u.bottom-Ot(r,"bottom")&&(f=e.bottom-e.top>u.bottom-u.top?e.top+Ot(i,"top")-u.top:e.bottom-u.bottom+Ot(i,"bottom")),e.left<u.left+Ot(r,"left")?c=-(u.left-e.left+Ot(i,"left")):e.right>u.right-Ot(r,"right")&&(c=e.right-u.right+Ot(i,"right")),c||f)if(a)o.defaultView.scrollBy(c,f);else{let h=l.scrollLeft,p=l.scrollTop;f&&(l.scrollTop+=f),c&&(l.scrollLeft+=c);let d=l.scrollLeft-h,m=l.scrollTop-p;e={left:e.left-d,top:e.top-m,right:e.right-d,bottom:e.bottom-m}}if(a||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function j6(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=t+1;s<Math.min(innerHeight,e.bottom);s+=5){let l=n.root.elementFromPoint(o,s);if(!l||l==n.dom||!n.dom.contains(l))continue;let a=l.getBoundingClientRect();if(a.top>=t-20){r=l,i=a.top;break}}return{refDOM:r,refTop:i,stack:Ph(n.dom)}}function Ph(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=Kr(r));return e}function W6({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;Lh(t,r==0?0:r-e)}function Lh(n,e){for(let t=0;t<n.length;t++){let{dom:r,top:i,left:o}=n[t];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let Vn=null;function U6(n){if(n.setActive)return n.setActive();if(Vn)return n.focus(Vn);let e=Ph(n);n.focus(Vn==null?{get preventScroll(){return Vn={preventScroll:!0},!0}}:void 0),Vn||(Vn=!1,Lh(e,0))}function Bh(n,e){let t,r=2e8,i,o=0,s=e.top,l=e.top,a,u;for(let c=n.firstChild,f=0;c;c=c.nextSibling,f++){let h;if(c.nodeType==1)h=c.getClientRects();else if(c.nodeType==3)h=Tt(c).getClientRects();else continue;for(let p=0;p<h.length;p++){let d=h[p];if(d.top<=s&&d.bottom>=l){s=Math.max(d.bottom,s),l=Math.min(d.top,l);let m=d.left>e.left?d.left-e.left:d.right<e.left?e.left-d.right:0;if(m<r){t=c,r=m,i=m&&t.nodeType==3?{left:d.right<e.left?d.right:d.left,top:e.top}:e,c.nodeType==1&&m&&(o=f+(e.left>=(d.left+d.right)/2?1:0));continue}}else d.top>e.top&&!a&&d.left<=e.left&&d.right>=e.left&&(a=c,u={left:Math.max(d.left,Math.min(d.right,e.left)),top:d.top});!t&&(e.left>=d.right&&e.top>=d.top||e.left>=d.left&&e.top>=d.bottom)&&(o=f+1)}}return!t&&a&&(t=a,i=u,r=0),t&&t.nodeType==3?J6(t,i):!t||r&&t.nodeType==1?{node:n,offset:o}:Bh(t,i)}function J6(n,e){let t=n.nodeValue.length,r=document.createRange();for(let i=0;i<t;i++){r.setEnd(n,i+1),r.setStart(n,i);let o=jt(r,1);if(o.top!=o.bottom&&Jl(e,o))return{node:n,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:n,offset:0}}function Jl(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function K6(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left<n.getBoundingClientRect().left?t:n}function Y6(n,e,t){let{node:r,offset:i}=Bh(e,t),o=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&t.left>(s.left+s.right)/2?1:-1}return n.docView.posFromDOM(r,i,o)}function G6(n,e,t,r){let i=-1;for(let o=e,s=!1;o!=n.dom;){let l=n.docView.nearestDesc(o,!0);if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)){let a=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&(!s&&a.left>r.left||a.top>r.top?i=l.posBefore:(!s&&a.right<r.left||a.bottom<r.top)&&(i=l.posAfter),s=!0),!l.contentDOM&&i<0&&!l.node.isText)return(l.node.isBlock?r.top<(a.top+a.bottom)/2:r.left<(a.left+a.right)/2)?l.posBefore:l.posAfter}o=l.dom.parentNode}return i>-1?i:n.docView.posFromDOM(e,t,-1)}function Vh(n,e,t){let r=n.childNodes.length;if(r&&t.top<t.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-t.top)/(t.bottom-t.top))-2)),o=i;;){let s=n.childNodes[o];if(s.nodeType==1){let l=s.getClientRects();for(let a=0;a<l.length;a++){let u=l[a];if(Jl(e,u))return Vh(s,e,u)}}if((o=(o+1)%r)==i)break}return n}function Z6(n,e){let t=n.dom.ownerDocument,r,i=0,o=B6(t,e.left,e.top);o&&({node:r,offset:i}=o);let s=(n.root.elementFromPoint?n.root:t).elementFromPoint(e.left,e.top),l;if(!s||!n.dom.contains(s.nodeType!=1?s.parentNode:s)){let u=n.dom.getBoundingClientRect();if(!Jl(e,u)||(s=Vh(n.dom,e,u),!s))return null}if(Ee)for(let u=s;r&&u;u=Kr(u))u.draggable&&(r=void 0);if(s=K6(s,e),r){if(ht&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let c=r.childNodes[i],f;c.nodeName=="IMG"&&(f=c.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}let u;oi&&i&&r.nodeType==1&&(u=r.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,r==n.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=n.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=G6(n,r,i,e))}l==null&&(l=Y6(n,s,e));let a=n.docView.nearestDesc(s,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function Ru(n){return n.top<n.bottom||n.left<n.right}function jt(n,e){let t=n.getClientRects();if(t.length){let r=t[e<0?0:t.length-1];if(Ru(r))return r}return Array.prototype.find.call(t,Ru)||n.getBoundingClientRect()}const X6=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Hh(n,e,t){let{node:r,offset:i,atom:o}=n.docView.domFromPos(e,t<0?-1:1),s=oi||ht;if(r.nodeType==3)if(s&&(X6.test(r.nodeValue)||(t<0?!i:i==r.nodeValue.length))){let a=jt(Tt(r,i,i),t);if(ht&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let u=jt(Tt(r,i-1,i-1),-1);if(u.top==a.top){let c=jt(Tt(r,i,i+1),-1);if(c.top!=a.top)return xr(c,c.left<u.left)}}return a}else{let a=i,u=i,c=t<0?1:-1;return t<0&&!i?(u++,c=-1):t>=0&&i==r.nodeValue.length?(a--,c=1):t<0?a--:u++,xr(jt(Tt(r,a,u),c),c<0)}if(!n.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(t<0||i==wt(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return us(a.getBoundingClientRect(),!1)}if(o==null&&i<wt(r)){let a=r.childNodes[i];if(a.nodeType==1)return us(a.getBoundingClientRect(),!0)}return us(r.getBoundingClientRect(),t>=0)}if(o==null&&i&&(t<0||i==wt(r))){let a=r.childNodes[i-1],u=a.nodeType==3?Tt(a,wt(a)-(s?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(u)return xr(jt(u,1),!1)}if(o==null&&i<wt(r)){let a=r.childNodes[i];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let u=a?a.nodeType==3?Tt(a,0,s?0:1):a.nodeType==1?a:null:null;if(u)return xr(jt(u,-1),!0)}return xr(jt(r.nodeType==3?Tt(r):r,-t),t>=0)}function xr(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function us(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function $h(n,e,t){let r=n.state,i=n.root.activeElement;r!=e&&n.updateState(e),i!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),i!=n.dom&&i&&i.focus()}}function Q6(n,e,t){let r=e.selection,i=t=="up"?r.$from:r.$to;return $h(n,e,()=>{let{node:o}=n.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let l=n.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=Hh(n,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=Tt(l,0,l.nodeValue.length).getClientRects();else continue;for(let u=0;u<a.length;u++){let c=a[u];if(c.bottom>c.top+1&&(t=="up"?s.top-c.top>(c.bottom-s.top)*2:c.bottom-s.bottom>(s.bottom-c.top)*2))return!1}}return!0})}const ew=/[\u0590-\u08ac]/;function tw(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=n.domSelection();return l?!ew.test(r.parent.textContent)||!l.modify?t=="left"||t=="backward"?o:s:$h(n,e,()=>{let{focusNode:a,focusOffset:u,anchorNode:c,anchorOffset:f}=n.domSelectionRange(),h=l.caretBidiLevel;l.modify("move",t,"character");let p=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:d,focusOffset:m}=n.domSelectionRange(),y=d&&!p.contains(d.nodeType==1?d:d.parentNode)||a==d&&u==m;try{l.collapse(c,f),a&&(a!=c||u!=f)&&l.extend&&l.extend(a,u)}catch{}return h!=null&&(l.caretBidiLevel=h),y}):r.pos==r.start()||r.pos==r.end()}let Fu=null,Pu=null,Lu=!1;function nw(n,e,t){return Fu==e&&Pu==t?Lu:(Fu=e,Pu=t,Lu=t=="up"||t=="down"?Q6(n,e,t):tw(n,e,t))}const tt=0,Bu=1,wn=2,St=3;class si{constructor(e,t,r,i){this.parent=e,this.children=t,this.dom=r,this.contentDOM=i,this.dirty=tt,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,r=this.posAtStart;;t++){let i=this.children[t];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let o,s;if(e==this.contentDOM)o=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else{let o,s;if(e==this.contentDOM)o=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=t>ge(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!t||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;t<this.children.length;t++){let i=this.children[t],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],l=o+s.size;if(l>e||s instanceof jh){i=e-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof qh&&o.side>=0;r--);if(t<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&t&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,t):{node:this.contentDOM,offset:o?ge(o.dom)+1:0}}else{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,t):{node:this.contentDOM,offset:o?ge(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,l=0;;l++){let a=this.children[l],u=s+a.size;if(i==-1&&e<=u){let c=s+a.border;if(e>=c&&t<=u-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,c);e=s;for(let f=l;f>0;f--){let h=this.children[f-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=ge(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(u>t||l==this.children.length-1)){t=u;for(let c=l+1;c<this.children.length;c++){let f=this.children[c];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=ge(f.dom);break}t+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=u}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:r}=this.domFromPos(e,0);if(t.nodeType!=1||r==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[r]}setSelection(e,t,r,i=!1){let o=Math.min(e,t),s=Math.max(e,t);for(let h=0,p=0;h<this.children.length;h++){let d=this.children[h],m=p+d.size;if(o>p&&s<m)return d.setSelection(e-p-d.border,t-p-d.border,r,i);p=m}let l=this.domFromPos(e,e?-1:1),a=t==e?l:this.domFromPos(t,t?-1:1),u=r.getSelection(),c=!1;if((ht||Ee)&&e==t){let{node:h,offset:p}=l;if(h.nodeType==3){if(c=!!(p&&h.nodeValue[p-1]==` |
| 63 |
`),c&&p==h.nodeValue.length)for(let d=h,m;d;d=d.parentNode){if(m=d.nextSibling){m.nodeName=="BR"&&(l=a={node:m.parentNode,offset:ge(m)+1});break}let y=d.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let d=h.childNodes[p-1];c=d&&(d.nodeName=="BR"||d.contentEditable=="false")}}if(ht&&u.focusNode&&u.focusNode!=a.node&&u.focusNode.nodeType==1){let h=u.focusNode.childNodes[u.focusOffset];h&&h.contentEditable=="false"&&(i=!0)}if(!(i||c&&Ee)&&Nn(l.node,l.offset,u.anchorNode,u.anchorOffset)&&Nn(a.node,a.offset,u.focusNode,u.focusOffset))return;let f=!1;if((u.extend||e==t)&&!c){u.collapse(l.node,l.offset);try{e!=t&&u.extend(a.node,a.offset),f=!0}catch{}}if(!f){if(e>t){let p=l;l=a,a=p}let h=document.createRange();h.setEnd(a.node,a.offset),h.setStart(l.node,l.offset),u.removeAllRanges(),u.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?e<=s&&t>=r:e<s&&t>r){let l=r+o.border,a=s-o.border;if(e>=l&&t<=a){this.dirty=e==r||t==s?wn:Bu,e==l&&t==a&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=St:o.markDirty(e-l,t-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?wn:St}r=s}this.dirty=wn}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?wn:Bu;t.dirty<r&&(t.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class qh extends si{constructor(e,t,r,i){let o,s=t.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!t.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return this.dirty==tt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class rw extends si{constructor(e,t,r,i){super(e,[],t,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Dn extends si{constructor(e,t,r,i){super(e,[],r,i),this.mark=t}static create(e,t,r,i){let o=i.nodeViews[t.type.name],s=o&&o(t,i,r);return(!s||!s.dom)&&(s=cr.renderSpec(document,t.type.spec.toDOM(t,r),null,t.attrs)),new Dn(e,t,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&St||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=St&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=tt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=tt}}slice(e,t,r){let i=Dn.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;t<s&&(o=rl(o,t,s,r)),e>0&&(o=rl(o,0,e,r));for(let l=0;l<o.length;l++)o[l].parent=i;return i.children=o,i}}class en extends si{constructor(e,t,r,i,o,s,l,a,u){super(e,[],o,s),this.node=t,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=l}static create(e,t,r,i,o,s){let l=o.nodeViews[t.type.name],a,u=l&&l(t,o,()=>{if(!a)return s;if(a.parent)return a.parent.posBeforeChild(a)},r,i),c=u&&u.dom,f=u&&u.contentDOM;if(t.isText){if(!c)c=document.createTextNode(t.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:f}=cr.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!f&&!t.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let h=c;return c=Jh(c,r,t),u?a=new iw(e,t,r,i,c,f||null,h,u,o,s+1):t.isText?new To(e,t,r,i,c,h,o):new en(e,t,r,i,c,f||null,h,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>I.empty)}return e}matchesNode(e,t,r){return this.dirty==tt&&e.eq(this.node)&&nl(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,i=t,o=e.composing?this.localCompositionInfo(e,t):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,a=new sw(this,s&&s.node,e);uw(this.node,this.innerDeco,(u,c,f)=>{u.spec.marks?a.syncToMarks(u.spec.marks,r,e):u.type.side>=0&&!f&&a.syncToMarks(c==this.node.childCount?ee.none:this.node.child(c).marks,r,e),a.placeWidget(u,e,i)},(u,c,f,h)=>{a.syncToMarks(u.marks,r,e);let p;a.findNodeMatch(u,c,f,h)||l&&e.state.selection.from>i&&e.state.selection.to<i+u.nodeSize&&(p=a.findIndexWithChild(o.node))>-1&&a.updateNodeAt(u,c,f,p,e)||a.updateNextNode(u,c,f,e,h,i)||a.addNode(u,c,f,e,i),i+=u.nodeSize}),a.syncToMarks([],r,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==wn)&&(s&&this.protectLocalComposition(e,s),Wh(this.contentDOM,this.children,e),lr&&cw(this.dom))}localCompositionInfo(e,t){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof Z)||r<t||i>t+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,l=fw(this.node.content,s,r-t,i-t);return l<0?null:{node:o,pos:l,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:i}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new rw(this,o,t,i);e.input.compositionNodes.push(s),this.children=rl(this.children,r,r+i.length,e,s)}update(e,t,r,i){return this.dirty==St||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,r,i),!0)}updateInner(e,t,r,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=tt}updateOuterDeco(e){if(nl(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Uh(this.dom,this.nodeDOM,tl(this.outerDeco,this.node,t),tl(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Vu(n,e,t,r,i){Jh(r,e,n);let o=new en(void 0,n,e,t,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class To extends en{constructor(e,t,r,i,o,s,l){super(e,t,r,i,o,null,s,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,i){return this.dirty==St||this.dirty!=tt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=tt||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=tt,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let i=this.node.cut(e,t),o=document.createTextNode(i.text);return new To(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=St)}get domAtom(){return!1}isText(e){return this.node.text==e}}class jh extends si{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==tt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class iw extends en{constructor(e,t,r,i,o,s,l,a,u,c){super(e,t,r,i,o,s,l,u,c),this.spec=a}update(e,t,r,i){if(this.dirty==St)return!1;if(this.spec.update){let o=this.spec.update(e,t,r);return o&&this.updateInner(e,t,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,i){this.spec.setSelection?this.spec.setSelection(e,t,r):super.setSelection(e,t,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Wh(n,e,t){let r=n.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],l=s.dom;if(l.parentNode==n){for(;l!=r;)r=Hu(r),i=!0;r=r.nextSibling}else i=!0,n.insertBefore(l,r);if(s instanceof Dn){let a=r?r.previousSibling:n.lastChild;Wh(s.contentDOM,s.children,t),r=a?a.nextSibling:n.firstChild}}for(;r;)r=Hu(r),i=!0;i&&t.trackWrites==n&&(t.trackWrites=null)}const Pr=function(n){n&&(this.nodeName=n)};Pr.prototype=Object.create(null);const bn=[new Pr];function tl(n,e,t){if(n.length==0)return bn;let r=t?bn[0]:new Pr,i=[r];for(let o=0;o<n.length;o++){let s=n[o].type.attrs;if(s){s.nodeName&&i.push(r=new Pr(s.nodeName));for(let l in s){let a=s[l];a!=null&&(t&&i.length==1&&i.push(r=new Pr(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+a:l=="style"?r.style=(r.style?r.style+";":"")+a:l!="nodeName"&&(r[l]=a))}}}return i}function Uh(n,e,t,r){if(t==bn&&r==bn)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],l=t[o];if(o){let a;l&&l.nodeName==s.nodeName&&i!=n&&(a=i.parentNode)&&a.nodeName.toLowerCase()==s.nodeName||(a=document.createElement(s.nodeName),a.pmIsDeco=!0,a.appendChild(i),l=bn[0]),i=a}ow(i,l||bn[0],s)}return i}function ow(n,e,t){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in t)&&n.removeAttribute(r);for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&t[r]!=e[r]&&n.setAttribute(r,t[r]);if(e.class!=t.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=t.class?t.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&n.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&n.classList.add(i[o]);n.classList.length==0&&n.removeAttribute("class")}if(e.style!=t.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)n.style.removeProperty(i[1])}t.style&&(n.style.cssText+=t.style)}}function Jh(n,e,t){return Uh(n,n,bn,tl(e,t,n.nodeType!=1))}function nl(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].type.eq(e[t].type))return!1;return!0}function Hu(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class sw{constructor(e,t,r){this.lock=t,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=lw(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let r=e;r<t;r++)this.top.children[r].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=tt,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let l=-1;for(let a=this.index;a<Math.min(this.index+3,this.top.children.length);a++){let u=this.top.children[a];if(u.matchesMark(e[o])&&!this.isLocked(u.dom)){l=a;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let a=Dn.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,a),this.top=a,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,t,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l<a;l++){let u=this.top.children[l];if(u.matchesNode(e,t,r)&&!this.preMatch.matched.has(u)){o=l;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,t,r,i,o){let s=this.top.children[i];return s.dirty==St&&s.dom==s.contentDOM&&(s.dirty=wn),s.update(e,t,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=t}}updateNextNode(e,t,r,i,o,s){for(let l=this.index;l<this.top.children.length;l++){let a=this.top.children[l];if(a instanceof en){let u=this.preMatch.matched.get(a);if(u!=null&&u!=o)return!1;let c=a.dom,f,h=this.isLocked(c)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&a.dirty!=St&&nl(t,a.outerDeco));if(!h&&a.update(e,t,r,i))return this.destroyBetween(this.index,l),a.dom!=c&&(this.changed=!0),this.index++,!0;if(!h&&(f=this.recreateWrapper(a,e,t,r,i,s)))return this.top.children[this.index]=f,f.contentDOM&&(f.dirty=wn,f.updateChildren(i,s+1),f.dirty=tt),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,r,i,o,s){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content))return null;let l=en.create(this.top,t,r,i,o,s);if(l.contentDOM){l.children=e.children,e.children=[];for(let a of l.children)a.parent=l}return e.destroy(),l}addNode(e,t,r,i,o){let s=en.create(this.top,e,t,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,t,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new qh(this.top,e,t,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Dn;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof To)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Ee||xe)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new jh(this.top,[],r,null);t!=this.top?t.children.push(i):t.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function lw(n,e){let t=e,r=t.children.length,i=n.childCount,o=new Map,s=[];e:for(;i>0;){let l;for(;;)if(r){let u=t.children[r-1];if(u instanceof Dn)t=u,r=u.children.length;else{l=u,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let a=l.node;if(a){if(a!=n.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function aw(n,e){return n.type.side-e.type.side}function uw(n,e,t,r){let i=e.locals(n),o=0;if(i.length==0){for(let u=0;u<n.childCount;u++){let c=n.child(u);r(c,i,e.forChild(o,c),u),o+=c.nodeSize}return}let s=0,l=[],a=null;for(let u=0;;){let c,f;for(;s<i.length&&i[s].to==o;){let y=i[s++];y.widget&&(c?(f||(f=[c])).push(y):c=y)}if(c)if(f){f.sort(aw);for(let y=0;y<f.length;y++)t(f[y],u,!!a)}else t(c,u,!!a);let h,p;if(a)p=-1,h=a,a=null;else if(u<n.childCount)p=u,h=n.child(u++);else break;for(let y=0;y<l.length;y++)l[y].to<=o&&l.splice(y--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)l.push(i[s++]);let d=o+h.nodeSize;if(h.isText){let y=d;s<i.length&&i[s].from<y&&(y=i[s].from);for(let g=0;g<l.length;g++)l[g].to<y&&(y=l[g].to);y<d&&(a=h.cut(y-o),h=h.cut(0,y-o),d=y,p=-1)}else for(;s<i.length&&i[s].to<d;)s++;let m=h.isInline&&!h.isLeaf?l.filter(y=>!y.inline):l.slice();r(h,m,e.forChild(o,h),p),o=d}}function cw(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function fw(n,e,t,r){for(let i=0,o=0;i<n.childCount&&o<=r;){let s=n.child(i++),l=o;if(o+=s.nodeSize,!s.isText)continue;let a=s.text;for(;i<n.childCount;){let u=n.child(i++);if(o+=u.nodeSize,!u.isText)break;a+=u.text}if(o>=t){if(o>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let u=l<r?a.lastIndexOf(e,r-l-1):-1;if(u>=0&&u+e.length+l>=t)return l+u;if(t==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function rl(n,e,t,r,i){let o=[];for(let s=0,l=0;s<n.length;s++){let a=n[s],u=l,c=l+=a.size;u>=t||c<=e?o.push(a):(u<e&&o.push(a.slice(0,e-u,r)),i&&(o.push(i),i=void 0),c>t&&o.push(a.slice(t-u,a.size,r)))}return o}function Kl(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,s=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(s<0)return null;let l=r.resolve(s),a,u;if(Eo(t)){for(a=l;i&&!i.node;)i=i.parent;let c=i.node;if(i&&c.isAtom&&q.isSelectable(c)&&i.parent&&!(c.isInline&&P6(t.focusNode,t.focusOffset,i.dom))){let f=i.posBefore;u=new q(s==f?l:r.resolve(f))}}else{let c=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(c<0)return null;a=r.resolve(c)}if(!u){let c=e=="pointer"||n.state.selection.head<l.pos&&!o?1:-1;u=Yl(n,a,l,c)}return u}function Kh(n){return n.editable?n.hasFocus():Gh(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function It(n,e=!1){let t=n.state.selection;if(Yh(n,t),!!Kh(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&xe){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Nn(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)pw(n);else{let{anchor:r,head:i}=t,o,s;$u&&!(t instanceof Z)&&(t.$from.parent.inlineContent||(o=qu(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(s=qu(n,t.to))),n.docView.setSelection(r,i,n.root,e),$u&&(o&&ju(o),s&&ju(s)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&hw(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const $u=Ee||xe&&Fh<63;function qu(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(Ee&&i&&i.contentEditable=="false")return cs(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return cs(i);if(o)return cs(o)}}function cs(n){return n.contentEditable="true",Ee&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function ju(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function hw(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(()=>{(!Kh(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function pw(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,ge(r)+1):t.setStart(r,0),t.collapse(!0),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&Le&&Qt<=11&&(r.disabled=!0,r.disabled=!1)}function Yh(n,e){if(e instanceof q){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(Wu(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else Wu(n)}function Wu(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function Yl(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||Z.between(e,t,r)}function Uu(n){return n.editable&&!n.hasFocus()?!1:Gh(n)}function Gh(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 dw(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return Nn(e.node,e.offset,t.anchorNode,t.anchorOffset)}function il(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&&j.findFrom(o,e)}function Wt(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function Ju(n,e,t){let r=n.state.selection;if(r instanceof Z)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 s=n.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return Wt(n,new Z(r.$anchor,s))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let i=il(n.state,e);return i&&i instanceof q?Wt(n,i):!1}else if(!(Ge&&t.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=n.docView.descAt(l))&&!s.contentDOM?q.isSelectable(o)?Wt(n,new q(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):oi?Wt(n,new Z(n.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof q&&r.node.isInline)return Wt(n,new Z(e>0?r.$to:r.$from));{let i=il(n.state,e);return i?Wt(n,i):!1}}}function so(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Lr(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function Hn(n,e){return e<0?mw(n):gw(n)}function mw(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,s=!1;for(ht&&t.nodeType==1&&r<so(t)&&Lr(t.childNodes[r],-1)&&(s=!0);;)if(r>0){if(t.nodeType!=1)break;{let l=t.childNodes[r-1];if(Lr(l,-1))i=t,o=--r;else if(l.nodeType==3)t=l,r=t.nodeValue.length;else break}}else{if(Zh(t))break;{let l=t.previousSibling;for(;l&&Lr(l,-1);)i=t.parentNode,o=ge(l),l=l.previousSibling;if(l)t=l,r=so(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}s?ol(n,t,r):i&&ol(n,i,o)}function gw(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=so(t),o,s;for(;;)if(r<i){if(t.nodeType!=1)break;let l=t.childNodes[r];if(Lr(l,1))o=t,s=++r;else break}else{if(Zh(t))break;{let l=t.nextSibling;for(;l&&Lr(l,1);)o=l.parentNode,s=ge(l)+1,l=l.nextSibling;if(l)t=l,r=0,i=so(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}o&&ol(n,o,s)}function Zh(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function yw(n,e){for(;n&&e==n.childNodes.length&&!ii(n);)e=ge(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 ww(n,e){for(;n&&!e&&!ii(n);)e=ge(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 ol(n,e,t){if(e.nodeType!=3){let o,s;(s=yw(e,t))?(e=s,t=0):(o=ww(e,t))&&(e=o,t=o.nodeValue.length)}let r=n.domSelection();if(!r)return;if(Eo(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&&It(n)},50)}function Ku(n,e){let t=n.state.doc.resolve(e);if(!(xe||V6)&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let o=n.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s<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),s=(o.top+o.bottom)/2;if(s>i.top&&s<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 Yu(n,e,t){let r=n.state.selection;if(r instanceof Z&&!r.empty||t.indexOf("s")>-1||Ge&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let s=il(n.state,e);if(s&&s instanceof q)return Wt(n,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof Ke?j.near(s,e):j.findFrom(s,e);return l?Wt(n,l):!1}return!1}function Gu(n,e){if(!(n.state.selection instanceof Z))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 s=n.state.tr;return e<0?s.delete(t.pos-o.nodeSize,t.pos):s.delete(t.pos,t.pos+o.nodeSize),n.dispatch(s),!0}return!1}function Zu(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function bw(n){if(!Ee||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;Zu(n,r,"true"),setTimeout(()=>Zu(n,r,"false"),20)}return!1}function xw(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function kw(n,e){let t=e.keyCode,r=xw(e);if(t==8||Ge&&t==72&&r=="c")return Gu(n,-1)||Hn(n,-1);if(t==46&&!e.shiftKey||Ge&&t==68&&r=="c")return Gu(n,1)||Hn(n,1);if(t==13||t==27)return!0;if(t==37||Ge&&t==66&&r=="c"){let i=t==37?Ku(n,n.state.selection.from)=="ltr"?-1:1:-1;return Ju(n,i,r)||Hn(n,i)}else if(t==39||Ge&&t==70&&r=="c"){let i=t==39?Ku(n,n.state.selection.from)=="ltr"?1:-1:1;return Ju(n,i,r)||Hn(n,i)}else{if(t==38||Ge&&t==80&&r=="c")return Yu(n,-1,r)||Hn(n,-1);if(t==40||Ge&&t==78&&r=="c")return bw(n)||Yu(n,1,r)||Hn(n,1);if(r==(Ge?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function Xh(n,e){n.someProp("transformCopied",p=>{e=p(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 p=r.firstChild;t.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=n.someProp("clipboardSerializer")||cr.fromSchema(n.state.schema),l=ip(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let u=a.firstChild,c,f=0;for(;u&&u.nodeType==1&&(c=rp[u.nodeName.toLowerCase()]);){for(let p=c.length-1;p>=0;p--){let d=l.createElement(c[p]);for(;a.firstChild;)d.appendChild(a.firstChild);a.appendChild(d),f++}u=a.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(t)}`);let h=n.someProp("clipboardTextSerializer",p=>p(e,n))||e.content.textBetween(0,e.content.size,` |
| 64 |
|
| 65 |
`);return{dom:a,text:h,slice:e}}function Qh(n,e,t,r,i){let o=i.parent.type.spec.code,s,l;if(!t&&!e)return null;let a=e&&(r||o||!t);if(a){if(n.someProp("transformPastedText",h=>{e=h(e,o||r,n)}),o)return e?new P(I.from(n.state.schema.text(e.replace(/\r\n?/g,` |
| 66 |
`))),0,0):P.empty;let f=n.someProp("clipboardTextParser",h=>h(e,i,r,n));if(f)l=f;else{let h=i.marks(),{schema:p}=n.state,d=cr.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let y=s.appendChild(document.createElement("p"));m&&y.appendChild(d.serializeNode(p.text(m,h)))})}}else n.someProp("transformPastedHTML",f=>{t=f(t,n)}),s=Sw(t),oi&&Cw(s);let u=s&&s.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let f=+c[3];f>0;f--){let h=s.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;s=h}if(l||(l=(n.someProp("clipboardParser")||n.someProp("domParser")||Ur.fromSchema(n.state.schema)).parseSlice(s,{preserveWhitespace:!!(a||c),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!vw.test(h.parentNode.nodeName)?{ignore:!0}:null}})),c)l=Aw(Xu(l,+c[1],+c[2]),c[4]);else if(l=P.maxOpen(_w(l.content,i),!0),l.openStart||l.openEnd){let f=0,h=0;for(let p=l.content.firstChild;f<l.openStart&&!p.type.spec.isolating;f++,p=p.firstChild);for(let p=l.content.lastChild;h<l.openEnd&&!p.type.spec.isolating;h++,p=p.lastChild);l=Xu(l,f,h)}return n.someProp("transformPasted",f=>{l=f(l,n)}),l}const vw=/^(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 _w(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,s=[];if(n.forEach(l=>{if(!s)return;let a=i.findWrapping(l.type),u;if(!a)return s=null;if(u=s.length&&o.length&&tp(a,o,l,s[s.length-1],0))s[s.length-1]=u;else{s.length&&(s[s.length-1]=np(s[s.length-1],o.length));let c=ep(l,a);s.push(c),i=i.matchType(c.type),o=a}}),s)return I.from(s)}return n}function ep(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,I.from(n));return n}function tp(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=tp(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(I.from(ep(t,n,i+1))))}}function np(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,np(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(I.empty,!0);return n.copy(t.append(r))}function sl(n,e,t,r,i,o){let s=e<0?n.firstChild:n.lastChild,l=s.content;return n.childCount>1&&(o=0),i<r-1&&(l=sl(l,e,t,r,i+1,o)),i>=t&&(l=e<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(I.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,s.copy(l))}function Xu(n,e,t){return e<n.openStart&&(n=new P(sl(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new P(sl(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const rp={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 Qu=null;function ip(){return Qu||(Qu=document.implementation.createHTMLDocument("title"))}function Sw(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=ip().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&rp[r[1].toLowerCase()])&&(n=i.map(o=>"<"+o+">").join("")+n+i.map(o=>"</"+o+">").reverse().join("")),t.innerHTML=n,i)for(let o=0;o<i.length;o++)t=t.querySelector(i[o])||t;return t}function Cw(n){let e=n.querySelectorAll(xe?"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==" "&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function Aw(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:s}=n;for(let l=r.length-2;l>=0;l-=2){let a=t.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;i=I.from(a.create(r[l+1],i)),o++,s++}return new P(i,o,s)}const Te={},Ne={},Mw={touchstart:!0,touchmove:!0};class Ow{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Ew(n){for(let e in Te){let t=Te[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{Nw(n,r)&&!Gl(n,r)&&(n.editable||!(r.type in Ne))&&t(n,r)},Mw[e]?{passive:!0}:void 0)}Ee&&n.dom.addEventListener("input",()=>null),ll(n)}function Xt(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function Tw(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function ll(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>Gl(n,r))})}function Gl(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function Nw(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function Dw(n,e){!Gl(n,e)&&Te[e.type]&&(n.editable||!(e.type in Ne))&&Te[e.type](n,e)}Ne.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!sp(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(at&&xe&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),lr&&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,mn(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||kw(n,t)?t.preventDefault():Xt(n,"key")};Ne.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};Ne.keypress=(n,e)=>{let t=e;if(sp(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Ge&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof Z)||!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 No(n){return{left:n.clientX,top:n.clientY}}function Iw(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Zl(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(n.someProp(e,l=>s>o.depth?l(n,t,o.nodeAfter,o.before(s),i,!0):l(n,t,o.node(s),o.before(s),i,!1)))return!0;return!1}function Yn(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);t=="pointer"&&r.setMeta("pointer",!0),n.dispatch(r)}function zw(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&q.isSelectable(r)?(Yn(n,new q(t),"pointer"),!0):!1}function Rw(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof q&&(r=t.node);let o=n.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(q.isSelectable(l)){r&&t.$from.depth>0&&s>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?i=o.before(t.$from.depth):i=o.before(s);break}}return i!=null?(Yn(n,q.create(n.state.doc,i),"pointer"),!0):!1}function Fw(n,e,t,r,i){return Zl(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?Rw(n,t):zw(n,t))}function Pw(n,e,t,r){return Zl(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function Lw(n,e,t,r){return Zl(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||Bw(n,t,r)}function Bw(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(Yn(n,Z.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)Yn(n,Z.create(r,l+1,l+1+s.content.size),"pointer");else if(q.isSelectable(s))Yn(n,q.create(r,l),"pointer");else continue;return!0}}function Xl(n){return lo(n)}const op=Ge?"metaKey":"ctrlKey";Te.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Xl(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&Iw(t,n.input.lastClick)&&!t[op]&&(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 s=n.posAtCoords(No(t));s&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new Vw(n,s,t,!!r)):(o=="doubleClick"?Pw:Lw)(n,s.pos,s.inside,t)?t.preventDefault():Xt(n,"pointer"))};class Vw{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[op],this.allowDefault=r.shiftKey;let o,s;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),s=t.inside;else{let c=e.state.doc.resolve(t.pos);o=c.parent,s=c.depth?c.before():0}const l=i?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&a.dom.nodeType==1?a.dom:null;let{selection:u}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||u instanceof q&&u.from<=s&&u.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ht&&!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)),Xt(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(()=>It(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(No(e))),this.updateAllowDefault(e),this.allowDefault||!t?Xt(this.view,"pointer"):Fw(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Ee&&this.mightDrag&&!this.mightDrag.node.isAtom||xe&&!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)?(Yn(this.view,j.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Xt(this.view,"pointer")}move(e){this.updateAllowDefault(e),Xt(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)}}Te.touchstart=n=>{n.input.lastTouch=Date.now(),Xl(n),Xt(n,"pointer")};Te.touchmove=n=>{n.input.lastTouch=Date.now(),Xt(n,"pointer")};Te.contextmenu=n=>Xl(n);function sp(n,e){return n.composing?!0:Ee&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const Hw=at?5e3:-1;Ne.compositionstart=Ne.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof Z&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),lo(n,!0),n.markCursor=null;else if(lo(n,!e.selection.empty),ht&&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 s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let l=n.domSelection();l&&l.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}n.input.composing=!0}lp(n,Hw)};Ne.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++,lp(n,20))};function lp(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>lo(n),e))}function ap(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=qw());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function $w(n){let e=n.domSelectionRange();if(!e.focusNode)return null;let t=R6(e.focusNode,e.focusOffset),r=F6(e.focusNode,e.focusOffset);if(t&&r&&t!=r){let i=r.pmViewDesc,o=n.domObserver.lastChangedTextNode;if(t==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(n.input.compositionNode==r){let s=t.pmViewDesc;if(!(!s||!s.isText(t.nodeValue)))return r}}return t||r}function qw(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function lo(n,e=!1){if(!(at&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),ap(n),e||n.docView&&n.docView.dirty){let t=Kl(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 jw(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 Yr=Le&&Qt<15||lr&&H6<604;Te.copy=Ne.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=Yr?null:t.clipboardData,s=r.content(),{dom:l,text:a}=Xh(n,s);o?(t.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",a)):jw(n,l),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Ww(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function Uw(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?Gr(n,r.value,null,i,e):Gr(n,r.textContent,r.innerHTML,i,e)},50)}function Gr(n,e,t,r,i){let o=Qh(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",a=>a(n,i,o||P.empty)))return!0;if(!o)return!1;let s=Ww(o),l=s?n.state.tr.replaceSelectionWith(s,r):n.state.tr.replaceSelection(o);return n.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function up(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," "):""}Ne.paste=(n,e)=>{let t=e;if(n.composing&&!at)return;let r=Yr?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&Gr(n,up(r),r.getData("text/html"),i,t)?t.preventDefault():Uw(n,t)};class cp{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const fp=Ge?"altKey":"ctrlKey";Te.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(No(t)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof q?i.to-1:i.to))){if(r&&r.mightDrag)s=q.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let f=n.docView.nearestDesc(t.target,!0);f&&f.node.type.spec.draggable&&f!=n.docView&&(s=q.create(n.state.doc,f.posBefore))}}let l=(s||n.state.selection).content(),{dom:a,text:u,slice:c}=Xh(n,l);(!t.dataTransfer.files.length||!xe||Fh>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(Yr?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",Yr||t.dataTransfer.setData("text/plain",u),n.dragging=new cp(c,!t[fp],s)};Te.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};Ne.dragover=Ne.dragenter=(n,e)=>e.preventDefault();Ne.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(No(t));if(!i)return;let o=n.state.doc.resolve(i.pos),s=r&&r.slice;s?n.someProp("transformPasted",d=>{s=d(s,n)}):s=Qh(n,up(t.dataTransfer),Yr?null:t.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!t[fp]);if(n.someProp("handleDrop",d=>d(n,t,s||P.empty,l))){t.preventDefault();return}if(!s)return;t.preventDefault();let a=s?Zy(n.state.doc,o.pos,s):o.pos;a==null&&(a=o.pos);let u=n.state.tr;if(l){let{node:d}=r;d?d.replace(u):u.deleteSelection()}let c=u.mapping.map(a),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,h=u.doc;if(f?u.replaceRangeWith(c,c,s.content.firstChild):u.replaceRange(c,c,s),u.doc.eq(h))return;let p=u.doc.resolve(c);if(f&&q.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new q(p));else{let d=u.mapping.map(a);u.mapping.maps[u.mapping.maps.length-1].forEach((m,y,g,_)=>d=_),u.setSelection(Yl(n,p,u.doc.resolve(d)))}n.focus(),n.dispatch(u.setMeta("uiEvent","drop"))};Te.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())&&It(n)},20))};Te.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)};Te.beforeinput=(n,e)=>{if(xe&&at&&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,mn(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 Ne)Te[n]=Ne[n];function Zr(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 ao{constructor(e,t){this.toDOM=e,this.spec=t||An,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:s}=e.mapResult(t.from+i,this.side<0?-1:1);return s?null:new Re(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof ao&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Zr(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class tn{constructor(e,t){this.attrs=e,this.spec=t||An}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new Re(o,s,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof tn&&Zr(this.attrs,e.attrs)&&Zr(this.spec,e.spec)}static is(e){return e.type instanceof tn}destroy(){}}class Ql{constructor(e,t){this.attrs=e,this.spec=t||An}map(e,t,r,i){let o=e.mapResult(t.from+i,1);if(o.deleted)return null;let s=e.mapResult(t.to+i,-1);return s.deleted||s.pos<=o.pos?null:new Re(o.pos-r,s.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 Ql&&Zr(this.attrs,e.attrs)&&Zr(this.spec,e.spec)}destroy(){}}class Re{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new Re(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 Re(e,e,new ao(t,r))}static inline(e,t,r,i){return new Re(e,t,new tn(r,i))}static node(e,t,r,i){return new Re(e,t,new Ql(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof tn}get widget(){return this.type instanceof ao}}const jn=[],An={};class re{constructor(e,t){this.local=e.length?e:jn,this.children=t.length?t:jn}static create(e,t){return t.length?uo(t,e,0,An):we}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 s=0;s<this.local.length;s++){let l=this.local[s];l.from<=t&&l.to>=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>e){let l=this.children[s]+1;this.children[s+2].findInner(e-l,t-l,r,i+l,o)}}map(e,t,r){return this==we||e.maps.length==0?this:this.mapInner(e,t,0,0,r||An)}mapInner(e,t,r,i,o){let s;for(let l=0;l<this.local.length;l++){let a=this.local[l].map(e,r,i);a&&a.type.valid(t,a)?(s||(s=[])).push(a):o.onRemove&&o.onRemove(this.local[l].spec)}return this.children.length?Jw(this.children,s||[],e,t,r,i,o):s?new re(s.sort(Mn),jn):we}add(e,t){return t.length?this==we?re.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,o=0;e.forEach((l,a)=>{let u=a+r,c;if(c=pp(t,l,u)){for(i||(i=this.children.slice());o<i.length&&i[o]<a;)o+=3;i[o]==a?i[o+2]=i[o+2].addInner(l,c,u+1):i.splice(o,0,a,a+l.nodeSize,uo(c,l,u+1,An)),o+=3}});let s=hp(o?dp(t):t,-r);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||s.splice(l--,1);return new re(s.length?this.local.concat(s).sort(Mn):this.local,i||this.children)}remove(e){return e.length==0||this==we?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 s,l=r[o]+t,a=r[o+1]+t;for(let c=0,f;c<e.length;c++)(f=e[c])&&f.from>l&&f.to<a&&(e[c]=null,(s||(s=[])).push(f));if(!s)continue;r==this.children&&(r=this.children.slice());let u=r[o+2].removeInner(s,l+1);u!=we?r[o+2]=u:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let l=0;l<i.length;l++)i[l].eq(s,t)&&(i==this.local&&(i=this.local.slice()),i.splice(l--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new re(i,r):we}forChild(e,t){if(this==we)return this;if(t.isLeaf)return re.empty;let r,i;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,s=o+t.content.size;for(let l=0;l<this.local.length;l++){let a=this.local[l];if(a.from<s&&a.to>o&&a.type instanceof tn){let u=Math.max(o,a.from)-o,c=Math.min(s,a.to)-o;u<c&&(i||(i=[])).push(a.copy(u,c))}}if(i){let l=new re(i.sort(Mn),jn);return r?new Jt([l,r]):l}return r||we}eq(e){if(this==e)return!0;if(!(e instanceof re)||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 ea(this.localsInner(e))}localsInner(e){if(this==we)return jn;if(e.inlineContent||!this.local.some(tn.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof tn||t.push(this.local[r]);return t}forEachSet(e){e(this)}}re.empty=new re([],[]);re.removeOverlap=ea;const we=re.empty;class Jt{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,An));return Jt.from(r)}forChild(e,t){if(t.isLeaf)return re.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=we&&(o instanceof Jt?r=r.concat(o.members):r.push(o))}return Jt.from(r)}eq(e){if(!(e instanceof Jt)||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 s=0;s<o.length;s++)t.push(o[s])}}return t?ea(r?t:t.sort(Mn)):jn}static from(e){switch(e.length){case 0:return we;case 1:return e[0];default:return new Jt(e.every(t=>t instanceof re)?e:e.reduce((t,r)=>t.concat(r instanceof re?r:r.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function Jw(n,e,t,r,i,o,s){let l=n.slice();for(let u=0,c=o;u<t.maps.length;u++){let f=0;t.maps[u].forEach((h,p,d,m)=>{let y=m-d-(p-h);for(let g=0;g<l.length;g+=3){let _=l[g+1];if(_<0||h>_+c-f)continue;let x=l[g]+c-f;p>=x?l[g+1]=h<=x?-2:-1:h>=c&&y&&(l[g]+=y,l[g+1]+=y)}f+=y}),c=t.maps[u].map(c,-1)}let a=!1;for(let u=0;u<l.length;u+=3)if(l[u+1]<0){if(l[u+1]==-2){a=!0,l[u+1]=-1;continue}let c=t.map(n[u]+o),f=c-i;if(f<0||f>=r.content.size){a=!0;continue}let h=t.map(n[u+1]+o,-1),p=h-i,{index:d,offset:m}=r.content.findIndex(f),y=r.maybeChild(d);if(y&&m==f&&m+y.nodeSize==p){let g=l[u+2].mapInner(t,y,c+1,n[u]+o+1,s);g!=we?(l[u]=f,l[u+1]=p,l[u+2]=g):(l[u+1]=-2,a=!0)}else a=!0}if(a){let u=Kw(l,n,e,t,i,o,s),c=uo(u,r,0,s);e=c.local;for(let f=0;f<l.length;f+=3)l[f+1]<0&&(l.splice(f,3),f-=3);for(let f=0,h=0;f<c.children.length;f+=3){let p=c.children[f];for(;h<l.length&&l[h]<p;)h+=3;l.splice(h,0,c.children[f],c.children[f+1],c.children[f+2])}}return new re(e.sort(Mn),l)}function hp(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 Re(i.from+e,i.to+e,i.type))}return t}function Kw(n,e,t,r,i,o,s){function l(a,u){for(let c=0;c<a.local.length;c++){let f=a.local[c].map(r,i,u);f?t.push(f):s.onRemove&&s.onRemove(a.local[c].spec)}for(let c=0;c<a.children.length;c+=3)l(a.children[c+2],a.children[c]+u+1)}for(let a=0;a<n.length;a+=3)n[a+1]==-1&&l(n[a+2],e[a]+o+1);return t}function pp(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let o=0,s;o<n.length;o++)(s=n[o])&&s.from>t&&s.to<r&&((i||(i=[])).push(s),n[o]=null);return i}function dp(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function uo(n,e,t,r){let i=[],o=!1;e.forEach((l,a)=>{let u=pp(n,l,a+t);if(u){o=!0;let c=uo(u,l,t+a+1,r);c!=we&&i.push(a,a+l.nodeSize,c)}});let s=hp(o?dp(n):n,-t).sort(Mn);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||(r.onRemove&&r.onRemove(s[l].spec),s.splice(l--,1));return s.length||i.length?new re(s,i):we}function Mn(n,e){return n.from-e.from||n.to-e.to}function ea(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),ec(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),ec(e,i,r.copy(o.from,r.to)));break}}}return e}function ec(n,e,t){for(;e<n.length&&Mn(t,n[e])>0;)e++;n.splice(e,0,t)}function fs(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=we&&e.push(r)}),n.cursorWrapper&&e.push(re.create(n.state.doc,[n.cursorWrapper.deco])),Jt.from(e)}const Yw={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Gw=Le&&Qt<=11;class Zw{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Xw{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Zw,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);Le&&Qt<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),Gw&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Yw)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Uu(this.view)){if(this.suppressingSelectionUpdates)return It(this.view);if(Le&&Qt<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Nn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,r;for(let o=e.focusNode;o;o=Kr(o))t.add(o);for(let o=e.anchorNode;o;o=Kr(o))if(t.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Uu(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,a=[];if(e.editable)for(let c=0;c<t.length;c++){let f=this.registerMutation(t[c],a);f&&(o=o<0?f.from:Math.min(f.from,o),s=s<0?f.to:Math.max(f.to,s),f.typeOver&&(l=!0))}if(ht&&a.length){let c=a.filter(f=>f.nodeName=="BR");if(c.length==2){let[f,h]=c;f.parentNode&&f.parentNode.parentNode==h.parentNode?h.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let h of c){let p=h.parentNode;p&&p.nodeName=="LI"&&(!f||tb(e,f)!=p)&&h.remove()}}}let u=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Eo(r)&&(u=Kl(e))&&u.eq(j.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,It(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),Qw(e)),this.handleDOMChange(o,s,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||It(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let c=0;c<e.addedNodes.length;c++){let f=e.addedNodes[c];t.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(Le&&Qt<=11&&e.addedNodes.length)for(let c=0;c<e.addedNodes.length;c++){let{previousSibling:f,nextSibling:h}=e.addedNodes[c];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f),(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(o=h)}let s=i&&i.parentNode==e.target?ge(i)+1:0,l=r.localPosFromDOM(e.target,s,-1),a=o&&o.parentNode==e.target?ge(o):e.target.childNodes.length,u=r.localPosFromDOM(e.target,a,1);return{from:l,to:u}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let tc=new WeakMap,nc=!1;function Qw(n){if(!tc.has(n)&&(tc.set(n,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace)!==-1)){if(n.requiresGeckoHackNode=ht,nc)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),nc=!0}}function rc(n,e){let t=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=n.domAtPos(n.state.selection.anchor);return Nn(s.node,s.offset,i,o)&&([t,r,i,o]=[i,o,t,r]),{anchorNode:t,anchorOffset:r,focusNode:i,focusOffset:o}}function eb(n,e){if(e.getComposedRanges){let i=e.getComposedRanges(n.root)[0];if(i)return rc(n,i)}let t;function r(i){i.preventDefault(),i.stopImmediatePropagation(),t=i.getTargetRanges()[0]}return n.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),n.dom.removeEventListener("beforeinput",r,!0),t?rc(n,t):null}function tb(n,e){for(let t=e.parentNode;t&&t!=n.dom;t=t.parentNode){let r=n.docView.nearestDesc(t,!0);if(r&&r.node.isBlock)return t}return null}function nb(n,e,t){let{node:r,fromOffset:i,toOffset:o,from:s,to:l}=n.docView.parseRange(e,t),a=n.domSelectionRange(),u,c=a.anchorNode;if(c&&n.dom.contains(c.nodeType==1?c:c.parentNode)&&(u=[{node:c,offset:a.anchorOffset}],Eo(a)||u.push({node:a.focusNode,offset:a.focusOffset})),xe&&n.input.lastKeyCode===8)for(let y=o;y>i;y--){let g=r.childNodes[y-1],_=g.pmViewDesc;if(g.nodeName=="BR"&&!_){o=y;break}if(!_||_.size)break}let f=n.state.doc,h=n.someProp("domParser")||Ur.fromSchema(n.state.schema),p=f.resolve(s),d=null,m=h.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:rb,context:p});if(u&&u[0].pos!=null){let y=u[0].pos,g=u[1]&&u[1].pos;g==null&&(g=y),d={anchor:y+s,head:g+s}}return{doc:m,sel:d,from:s,to:l}}function rb(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(Ee&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||Ee&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const ib=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function ob(n,e,t,r,i){let o=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let N=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,v=Kl(n,N);if(v&&!n.state.selection.eq(v)){if(xe&&at&&n.input.lastKeyCode===13&&Date.now()-100<n.input.lastKeyCodeTime&&n.someProp("handleKeyDown",D=>D(n,mn(13,"Enter"))))return;let z=n.state.tr.setSelection(v);N=="pointer"?z.setMeta("pointer",!0):N=="key"&&z.scrollIntoView(),o&&z.setMeta("composition",o),n.dispatch(z)}return}let s=n.state.doc.resolve(e),l=s.sharedDepth(t);e=s.before(l+1),t=n.state.doc.resolve(t).after(l+1);let a=n.state.selection,u=nb(n,e,t),c=n.state.doc,f=c.slice(u.from,u.to),h,p;n.input.lastKeyCode===8&&Date.now()-100<n.input.lastKeyCodeTime?(h=n.state.selection.to,p="end"):(h=n.state.selection.from,p="start"),n.input.lastKeyCode=null;let d=ab(f.content,u.doc.content,u.from,h,p);if((lr&&n.input.lastIOSEnter>Date.now()-225||at)&&i.some(N=>N.nodeType==1&&!ib.test(N.nodeName))&&(!d||d.endA>=d.endB)&&n.someProp("handleKeyDown",N=>N(n,mn(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!d)if(r&&a instanceof Z&&!a.empty&&a.$head.sameParent(a.$anchor)&&!n.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))d={start:a.from,endA:a.to,endB:a.to};else{if(u.sel){let N=ic(n,n.state.doc,u.sel);if(N&&!N.eq(n.state.selection)){let v=n.state.tr.setSelection(N);o&&v.setMeta("composition",o),n.dispatch(v)}}return}n.input.domChangeCount++,n.state.selection.from<n.state.selection.to&&d.start==d.endB&&n.state.selection instanceof Z&&(d.start>n.state.selection.from&&d.start<=n.state.selection.from+2&&n.state.selection.from>=u.from?d.start=n.state.selection.from:d.endA<n.state.selection.to&&d.endA>=n.state.selection.to-2&&n.state.selection.to<=u.to&&(d.endB+=n.state.selection.to-d.endA,d.endA=n.state.selection.to)),Le&&Qt<=11&&d.endB==d.start+1&&d.endA==d.start&&d.start>u.from&&u.doc.textBetween(d.start-u.from-1,d.start-u.from+1)==" "&&(d.start--,d.endA--,d.endB--);let m=u.doc.resolveNoCache(d.start-u.from),y=u.doc.resolveNoCache(d.endB-u.from),g=c.resolve(d.start),_=m.sameParent(y)&&m.parent.inlineContent&&g.end()>=d.endA,x;if((lr&&n.input.lastIOSEnter>Date.now()-225&&(!_||i.some(N=>N.nodeName=="DIV"||N.nodeName=="P"))||!_&&m.pos<u.doc.content.size&&!m.sameParent(y)&&(x=j.findFrom(u.doc.resolve(m.pos+1),1,!0))&&x.head==y.pos)&&n.someProp("handleKeyDown",N=>N(n,mn(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>d.start&&lb(c,d.start,d.endA,m,y)&&n.someProp("handleKeyDown",N=>N(n,mn(8,"Backspace")))){at&&xe&&n.domObserver.suppressSelectionUpdates();return}xe&&at&&d.endB==d.start&&(n.input.lastAndroidDelete=Date.now()),at&&!_&&m.start()!=y.start()&&y.parentOffset==0&&m.depth==y.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==d.endA&&(d.endB-=2,y=u.doc.resolveNoCache(d.endB-u.from),setTimeout(()=>{n.someProp("handleKeyDown",function(N){return N(n,mn(13,"Enter"))})},20));let S=d.start,M=d.endA,k,F,L;if(_){if(m.pos==y.pos)Le&&Qt<=11&&m.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>It(n),20)),k=n.state.tr.delete(S,M),F=c.resolve(d.start).marksAcross(c.resolve(d.endA));else if(d.endA==d.endB&&(L=sb(m.parent.content.cut(m.parentOffset,y.parentOffset),g.parent.content.cut(g.parentOffset,d.endA-g.start()))))k=n.state.tr,L.type=="add"?k.addMark(S,M,L.mark):k.removeMark(S,M,L.mark);else if(m.parent.child(m.index()).isText&&m.index()==y.index()-(y.textOffset?0:1)){let N=m.parent.textBetween(m.parentOffset,y.parentOffset);if(n.someProp("handleTextInput",v=>v(n,S,M,N)))return;k=n.state.tr.insertText(N,S,M)}}if(k||(k=n.state.tr.replace(S,M,u.doc.slice(d.start-u.from,d.endB-u.from))),u.sel){let N=ic(n,k.doc,u.sel);N&&!(xe&&at&&n.composing&&N.empty&&(d.start!=d.endB||n.input.lastAndroidDelete<Date.now()-100)&&(N.head==S||N.head==k.mapping.map(M)-1)||Le&&N.empty&&N.head==S)&&k.setSelection(N)}F&&k.ensureMarks(F),o&&k.setMeta("composition",o),n.dispatch(k.scrollIntoView())}function ic(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:Yl(n,e.resolve(t.anchor),e.resolve(t.head))}function sb(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,i=t,o=r,s,l,a;for(let c=0;c<r.length;c++)i=r[c].removeFromSet(i);for(let c=0;c<t.length;c++)o=t[c].removeFromSet(o);if(i.length==1&&o.length==0)l=i[0],s="add",a=c=>c.mark(l.addToSet(c.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",a=c=>c.mark(l.removeFromSet(c.marks));else return null;let u=[];for(let c=0;c<e.childCount;c++)u.push(a(e.child(c)));if(I.from(u).eq(n))return{mark:l,type:s}}function lb(n,e,t,r,i){if(t-e<=i.pos-r.pos||hs(r,!0,!1)<i.pos)return!1;let o=n.resolve(e);if(!r.parent.isTextblock){let l=o.nodeAfter;return l!=null&&t==e+l.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=n.resolve(hs(o,!0,!0));return!s.parent.isTextblock||s.pos>t||hs(s,!0,!1)<t?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function hs(n,e,t){let r=n.depth,i=e?n.end():n.pos;for(;r>0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,i++,e=!1;if(t){let o=n.node(r).maybeChild(n.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function ab(n,e,t,r,i){let o=n.findDiffStart(e,t);if(o==null)return null;let{a:s,b:l}=n.findDiffEnd(e,t+n.size,t+e.size);if(i=="end"){let a=Math.max(0,o-Math.min(s,l));r-=s+a-o}if(s<o&&n.size<e.size){let a=r<=o&&r>=s?o-r:0;o-=a,o&&o<e.size&&oc(e.textBetween(o-1,o+1))&&(o+=a?1:-1),l=o+(l-s),s=o}else if(l<o){let a=r<=o&&r>=l?o-r:0;o-=a,o&&o<n.size&&oc(n.textBetween(o-1,o+1))&&(o+=a?1:-1),s=o+(s-l),l=o}return{start:o,endA:s,endB:l}}function oc(n){if(n.length!=2)return!1;let e=n.charCodeAt(0),t=n.charCodeAt(1);return e>=56320&&e<=57343&&t>=55296&&t<=56319}class d5{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Ow,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(cc),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=ac(this),lc(this),this.nodeViews=uc(this),this.docView=Vu(this.state.doc,sc(this),fs(this),this.dom,this),this.domObserver=new Xw(this,(r,i,o,s)=>ob(this,r,i,o,s)),this.domObserver.start(),Ew(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&ll(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(cc),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(ap(this),s=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let p=uc(this);cb(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&ll(this),this.editable=ac(this),lc(this);let a=fs(this),u=sc(this),c=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(e.doc,u,a);(f||!e.selection.eq(i.selection))&&(s=!0);let h=c=="preserve"&&s&&this.dom.style.overflowAnchor==null&&j6(this);if(s){this.domObserver.stop();let p=f&&(Le||xe)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&ub(i.selection,e.selection);if(f){let d=xe?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=$w(this)),(o||!this.docView.update(e.doc,u,a,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=Vu(e.doc,u,a,this.dom,this)),d&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&dw(this))?It(this,p):(Yh(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():h&&W6(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof q){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&zu(this,t.getBoundingClientRect(),e)}else zu(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let r=this.directPlugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let r=this.state.plugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let r=this.pluginViews[t];r.update&&r.update(this,e)}}updateDraggedNode(e,t){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-t.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new cp(e.slice,e.move,i<0?void 0:q.create(this.state.doc,i))}someProp(e,t){let r=this._props&&this._props[e],i;if(r!=null&&(i=t?t(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let l=this.directPlugins[s].props[e];if(l!=null&&(i=t?t(l):l))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let l=o[s].props[e];if(l!=null&&(i=t?t(l):l))return i}}hasFocus(){if(Le){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&U6(this.dom),It(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Z6(this,e)}coordsAtPos(e,t=1){return Hh(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let i=this.docView.posFromDOM(e,t,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return nw(this,t||this.state,e)}pasteHTML(e,t){return Gr(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return Gr(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(Tw(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],fs(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,I6())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Dw(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?Ee&&this.root.nodeType===11&&L6(this.dom.ownerDocument)==this.dom&&eb(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function sc(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[Re.node(0,n.state.doc.content.size,e)]}function lc(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:Re.widget(n.state.selection.from,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function ac(n){return!n.someProp("editable",e=>e(n.state)===!1)}function ub(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function uc(n){let e=Object.create(null);function t(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function cb(n,e){let t=0,r=0;for(let i in n){if(n[i]!=e[i])return!0;t++}for(let i in e)r++;return t!=r}function cc(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}let fb=n=>crypto.getRandomValues(new Uint8Array(n)),hb=(n,e,t)=>{let r=(2<<Math.log2(n.length-1))-1,i=-~(1.6*r*e/n.length);return(o=e)=>{let s="";for(;;){let l=t(i),a=i|0;for(;a--;)if(s+=n[l[a]&r]||"",s.length>=o)return s}}},m5=(n,e=21)=>hb(n,e|0,fb);function Do(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const pb=[["ß","ss"],["ẞ","Ss"],["ä","ae"],["Ä","Ae"],["ö","oe"],["Ö","Oe"],["ü","ue"],["Ü","Ue"],["À","A"],["Á","A"],["Â","A"],["Ã","A"],["Ä","Ae"],["Å","A"],["Æ","AE"],["Ç","C"],["È","E"],["É","E"],["Ê","E"],["Ë","E"],["Ì","I"],["Í","I"],["Î","I"],["Ï","I"],["Ð","D"],["Ñ","N"],["Ò","O"],["Ó","O"],["Ô","O"],["Õ","O"],["Ö","Oe"],["Ő","O"],["Ø","O"],["Ù","U"],["Ú","U"],["Û","U"],["Ü","Ue"],["Ű","U"],["Ý","Y"],["Þ","TH"],["ß","ss"],["à","a"],["á","a"],["â","a"],["ã","a"],["ä","ae"],["å","a"],["æ","ae"],["ç","c"],["è","e"],["é","e"],["ê","e"],["ë","e"],["ì","i"],["í","i"],["î","i"],["ï","i"],["ð","d"],["ñ","n"],["ò","o"],["ó","o"],["ô","o"],["õ","o"],["ö","oe"],["ő","o"],["ø","o"],["ù","u"],["ú","u"],["û","u"],["ü","ue"],["ű","u"],["ý","y"],["þ","th"],["ÿ","y"],["ẞ","SS"],["à","a"],["À","A"],["á","a"],["Á","A"],["â","a"],["Â","A"],["ã","a"],["Ã","A"],["è","e"],["È","E"],["é","e"],["É","E"],["ê","e"],["Ê","E"],["ì","i"],["Ì","I"],["í","i"],["Í","I"],["ò","o"],["Ò","O"],["ó","o"],["Ó","O"],["ô","o"],["Ô","O"],["õ","o"],["Õ","O"],["ù","u"],["Ù","U"],["ú","u"],["Ú","U"],["ý","y"],["Ý","Y"],["ă","a"],["Ă","A"],["Đ","D"],["đ","d"],["ĩ","i"],["Ĩ","I"],["ũ","u"],["Ũ","U"],["ơ","o"],["Ơ","O"],["ư","u"],["Ư","U"],["ạ","a"],["Ạ","A"],["ả","a"],["Ả","A"],["ấ","a"],["Ấ","A"],["ầ","a"],["Ầ","A"],["ẩ","a"],["Ẩ","A"],["ẫ","a"],["Ẫ","A"],["ậ","a"],["Ậ","A"],["ắ","a"],["Ắ","A"],["ằ","a"],["Ằ","A"],["ẳ","a"],["Ẳ","A"],["ẵ","a"],["Ẵ","A"],["ặ","a"],["Ặ","A"],["ẹ","e"],["Ẹ","E"],["ẻ","e"],["Ẻ","E"],["ẽ","e"],["Ẽ","E"],["ế","e"],["Ế","E"],["ề","e"],["Ề","E"],["ể","e"],["Ể","E"],["ễ","e"],["Ễ","E"],["ệ","e"],["Ệ","E"],["ỉ","i"],["Ỉ","I"],["ị","i"],["Ị","I"],["ọ","o"],["Ọ","O"],["ỏ","o"],["Ỏ","O"],["ố","o"],["Ố","O"],["ồ","o"],["Ồ","O"],["ổ","o"],["Ổ","O"],["ỗ","o"],["Ỗ","O"],["ộ","o"],["Ộ","O"],["ớ","o"],["Ớ","O"],["ờ","o"],["Ờ","O"],["ở","o"],["Ở","O"],["ỡ","o"],["Ỡ","O"],["ợ","o"],["Ợ","O"],["ụ","u"],["Ụ","U"],["ủ","u"],["Ủ","U"],["ứ","u"],["Ứ","U"],["ừ","u"],["Ừ","U"],["ử","u"],["Ử","U"],["ữ","u"],["Ữ","U"],["ự","u"],["Ự","U"],["ỳ","y"],["Ỳ","Y"],["ỵ","y"],["Ỵ","Y"],["ỷ","y"],["Ỷ","Y"],["ỹ","y"],["Ỹ","Y"],["ء","e"],["آ","a"],["أ","a"],["ؤ","w"],["إ","i"],["ئ","y"],["ا","a"],["ب","b"],["ة","t"],["ت","t"],["ث","th"],["ج","j"],["ح","h"],["خ","kh"],["د","d"],["ذ","dh"],["ر","r"],["ز","z"],["س","s"],["ش","sh"],["ص","s"],["ض","d"],["ط","t"],["ظ","z"],["ع","e"],["غ","gh"],["ـ","_"],["ف","f"],["ق","q"],["ك","k"],["ل","l"],["م","m"],["ن","n"],["ه","h"],["و","w"],["ى","a"],["ي","y"],["َ","a"],["ُ","u"],["ِ","i"],["٠","0"],["١","1"],["٢","2"],["٣","3"],["٤","4"],["٥","5"],["٦","6"],["٧","7"],["٨","8"],["٩","9"],["چ","ch"],["ک","k"],["گ","g"],["پ","p"],["ژ","zh"],["ی","y"],["۰","0"],["۱","1"],["۲","2"],["۳","3"],["۴","4"],["۵","5"],["۶","6"],["۷","7"],["۸","8"],["۹","9"],["ټ","p"],["ځ","z"],["څ","c"],["ډ","d"],["ﺫ","d"],["ﺭ","r"],["ړ","r"],["ﺯ","z"],["ږ","g"],["ښ","x"],["ګ","g"],["ڼ","n"],["ۀ","e"],["ې","e"],["ۍ","ai"],["ٹ","t"],["ڈ","d"],["ڑ","r"],["ں","n"],["ہ","h"],["ھ","h"],["ے","e"],["А","A"],["а","a"],["Б","B"],["б","b"],["В","V"],["в","v"],["Г","G"],["г","g"],["Д","D"],["д","d"],["ъе","ye"],["Ъе","Ye"],["ъЕ","yE"],["ЪЕ","YE"],["Е","E"],["е","e"],["Ё","Yo"],["ё","yo"],["Ж","Zh"],["ж","zh"],["З","Z"],["з","z"],["И","I"],["и","i"],["ый","iy"],["Ый","Iy"],["ЫЙ","IY"],["ыЙ","iY"],["Й","Y"],["й","y"],["К","K"],["к","k"],["Л","L"],["л","l"],["М","M"],["м","m"],["Н","N"],["н","n"],["О","O"],["о","o"],["П","P"],["п","p"],["Р","R"],["р","r"],["С","S"],["с","s"],["Т","T"],["т","t"],["У","U"],["у","u"],["Ф","F"],["ф","f"],["Х","Kh"],["х","kh"],["Ц","Ts"],["ц","ts"],["Ч","Ch"],["ч","ch"],["Ш","Sh"],["ш","sh"],["Щ","Sch"],["щ","sch"],["Ъ",""],["ъ",""],["Ы","Y"],["ы","y"],["Ь",""],["ь",""],["Э","E"],["э","e"],["Ю","Yu"],["ю","yu"],["Я","Ya"],["я","ya"],["ă","a"],["Ă","A"],["ș","s"],["Ș","S"],["ț","t"],["Ț","T"],["ţ","t"],["Ţ","T"],["ş","s"],["Ş","S"],["ç","c"],["Ç","C"],["ğ","g"],["Ğ","G"],["ı","i"],["İ","I"],["ա","a"],["Ա","A"],["բ","b"],["Բ","B"],["գ","g"],["Գ","G"],["դ","d"],["Դ","D"],["ե","ye"],["Ե","Ye"],["զ","z"],["Զ","Z"],["է","e"],["Է","E"],["ը","y"],["Ը","Y"],["թ","t"],["Թ","T"],["ժ","zh"],["Ժ","Zh"],["ի","i"],["Ի","I"],["լ","l"],["Լ","L"],["խ","kh"],["Խ","Kh"],["ծ","ts"],["Ծ","Ts"],["կ","k"],["Կ","K"],["հ","h"],["Հ","H"],["ձ","dz"],["Ձ","Dz"],["ղ","gh"],["Ղ","Gh"],["ճ","tch"],["Ճ","Tch"],["մ","m"],["Մ","M"],["յ","y"],["Յ","Y"],["ն","n"],["Ն","N"],["շ","sh"],["Շ","Sh"],["ո","vo"],["Ո","Vo"],["չ","ch"],["Չ","Ch"],["պ","p"],["Պ","P"],["ջ","j"],["Ջ","J"],["ռ","r"],["Ռ","R"],["ս","s"],["Ս","S"],["վ","v"],["Վ","V"],["տ","t"],["Տ","T"],["ր","r"],["Ր","R"],["ց","c"],["Ց","C"],["ու","u"],["ՈՒ","U"],["Ու","U"],["փ","p"],["Փ","P"],["ք","q"],["Ք","Q"],["օ","o"],["Օ","O"],["ֆ","f"],["Ֆ","F"],["և","yev"],["ა","a"],["ბ","b"],["გ","g"],["დ","d"],["ე","e"],["ვ","v"],["ზ","z"],["თ","t"],["ი","i"],["კ","k"],["ლ","l"],["მ","m"],["ნ","n"],["ო","o"],["პ","p"],["ჟ","zh"],["რ","r"],["ს","s"],["ტ","t"],["უ","u"],["ფ","ph"],["ქ","q"],["ღ","gh"],["ყ","k"],["შ","sh"],["ჩ","ch"],["ც","ts"],["ძ","dz"],["წ","ts"],["ჭ","tch"],["ხ","kh"],["ჯ","j"],["ჰ","h"],["č","c"],["ď","d"],["ě","e"],["ň","n"],["ř","r"],["š","s"],["ť","t"],["ů","u"],["ž","z"],["Č","C"],["Ď","D"],["Ě","E"],["Ň","N"],["Ř","R"],["Š","S"],["Ť","T"],["Ů","U"],["Ž","Z"],["ހ","h"],["ށ","sh"],["ނ","n"],["ރ","r"],["ބ","b"],["ޅ","lh"],["ކ","k"],["އ","a"],["ވ","v"],["މ","m"],["ފ","f"],["ދ","dh"],["ތ","th"],["ލ","l"],["ގ","g"],["ޏ","gn"],["ސ","s"],["ޑ","d"],["ޒ","z"],["ޓ","t"],["ޔ","y"],["ޕ","p"],["ޖ","j"],["ޗ","ch"],["ޘ","tt"],["ޙ","hh"],["ޚ","kh"],["ޛ","th"],["ޜ","z"],["ޝ","sh"],["ޞ","s"],["ޟ","d"],["ޠ","t"],["ޡ","z"],["ޢ","a"],["ޣ","gh"],["ޤ","q"],["ޥ","w"],["ަ","a"],["ާ","aa"],["ި","i"],["ީ","ee"],["ު","u"],["ޫ","oo"],["ެ","e"],["ޭ","ey"],["ޮ","o"],["ޯ","oa"],["ް",""],["α","a"],["β","v"],["γ","g"],["δ","d"],["ε","e"],["ζ","z"],["η","i"],["θ","th"],["ι","i"],["κ","k"],["λ","l"],["μ","m"],["ν","n"],["ξ","ks"],["ο","o"],["π","p"],["ρ","r"],["σ","s"],["τ","t"],["υ","y"],["φ","f"],["χ","x"],["ψ","ps"],["ω","o"],["ά","a"],["έ","e"],["ί","i"],["ό","o"],["ύ","y"],["ή","i"],["ώ","o"],["ς","s"],["ϊ","i"],["ΰ","y"],["ϋ","y"],["ΐ","i"],["Α","A"],["Β","B"],["Γ","G"],["Δ","D"],["Ε","E"],["Ζ","Z"],["Η","I"],["Θ","TH"],["Ι","I"],["Κ","K"],["Λ","L"],["Μ","M"],["Ν","N"],["Ξ","KS"],["Ο","O"],["Π","P"],["Ρ","R"],["Σ","S"],["Τ","T"],["Υ","Y"],["Φ","F"],["Χ","X"],["Ψ","PS"],["Ω","O"],["Ά","A"],["Έ","E"],["Ί","I"],["Ό","O"],["Ύ","Y"],["Ή","I"],["Ώ","O"],["Ϊ","I"],["Ϋ","Y"],["ā","a"],["ē","e"],["ģ","g"],["ī","i"],["ķ","k"],["ļ","l"],["ņ","n"],["ū","u"],["Ā","A"],["Ē","E"],["Ģ","G"],["Ī","I"],["Ķ","K"],["Ļ","L"],["Ņ","N"],["Ū","U"],["č","c"],["š","s"],["ž","z"],["Č","C"],["Š","S"],["Ž","Z"],["ą","a"],["č","c"],["ę","e"],["ė","e"],["į","i"],["š","s"],["ų","u"],["ū","u"],["ž","z"],["Ą","A"],["Č","C"],["Ę","E"],["Ė","E"],["Į","I"],["Š","S"],["Ų","U"],["Ū","U"],["Ќ","Kj"],["ќ","kj"],["Љ","Lj"],["љ","lj"],["Њ","Nj"],["њ","nj"],["Тс","Ts"],["тс","ts"],["ą","a"],["ć","c"],["ę","e"],["ł","l"],["ń","n"],["ś","s"],["ź","z"],["ż","z"],["Ą","A"],["Ć","C"],["Ę","E"],["Ł","L"],["Ń","N"],["Ś","S"],["Ź","Z"],["Ż","Z"],["Є","Ye"],["І","I"],["Ї","Yi"],["Ґ","G"],["є","ye"],["і","i"],["ї","yi"],["ґ","g"],["IJ","IJ"],["ij","ij"],["¢","c"],["¥","Y"],["߿","b"],["৳","t"],["૱","Bo"],["฿","B"],["₠","CE"],["₡","C"],["₢","Cr"],["₣","F"],["₥","m"],["₦","N"],["₧","Pt"],["₨","Rs"],["₩","W"],["₫","s"],["€","E"],["₭","K"],["₮","T"],["₯","Dp"],["₰","S"],["₱","P"],["₲","G"],["₳","A"],["₴","S"],["₵","C"],["₶","tt"],["₷","S"],["₸","T"],["₹","R"],["₺","L"],["₽","P"],["₿","B"],["﹩","$"],["¢","c"],["¥","Y"],["₩","W"],["𝐀","A"],["𝐁","B"],["𝐂","C"],["𝐃","D"],["𝐄","E"],["𝐅","F"],["𝐆","G"],["𝐇","H"],["𝐈","I"],["𝐉","J"],["𝐊","K"],["𝐋","L"],["𝐌","M"],["𝐍","N"],["𝐎","O"],["𝐏","P"],["𝐐","Q"],["𝐑","R"],["𝐒","S"],["𝐓","T"],["𝐔","U"],["𝐕","V"],["𝐖","W"],["𝐗","X"],["𝐘","Y"],["𝐙","Z"],["𝐚","a"],["𝐛","b"],["𝐜","c"],["𝐝","d"],["𝐞","e"],["𝐟","f"],["𝐠","g"],["𝐡","h"],["𝐢","i"],["𝐣","j"],["𝐤","k"],["𝐥","l"],["𝐦","m"],["𝐧","n"],["𝐨","o"],["𝐩","p"],["𝐪","q"],["𝐫","r"],["𝐬","s"],["𝐭","t"],["𝐮","u"],["𝐯","v"],["𝐰","w"],["𝐱","x"],["𝐲","y"],["𝐳","z"],["𝐴","A"],["𝐵","B"],["𝐶","C"],["𝐷","D"],["𝐸","E"],["𝐹","F"],["𝐺","G"],["𝐻","H"],["𝐼","I"],["𝐽","J"],["𝐾","K"],["𝐿","L"],["𝑀","M"],["𝑁","N"],["𝑂","O"],["𝑃","P"],["𝑄","Q"],["𝑅","R"],["𝑆","S"],["𝑇","T"],["𝑈","U"],["𝑉","V"],["𝑊","W"],["𝑋","X"],["𝑌","Y"],["𝑍","Z"],["𝑎","a"],["𝑏","b"],["𝑐","c"],["𝑑","d"],["𝑒","e"],["𝑓","f"],["𝑔","g"],["𝑖","i"],["𝑗","j"],["𝑘","k"],["𝑙","l"],["𝑚","m"],["𝑛","n"],["𝑜","o"],["𝑝","p"],["𝑞","q"],["𝑟","r"],["𝑠","s"],["𝑡","t"],["𝑢","u"],["𝑣","v"],["𝑤","w"],["𝑥","x"],["𝑦","y"],["𝑧","z"],["𝑨","A"],["𝑩","B"],["𝑪","C"],["𝑫","D"],["𝑬","E"],["𝑭","F"],["𝑮","G"],["𝑯","H"],["𝑰","I"],["𝑱","J"],["𝑲","K"],["𝑳","L"],["𝑴","M"],["𝑵","N"],["𝑶","O"],["𝑷","P"],["𝑸","Q"],["𝑹","R"],["𝑺","S"],["𝑻","T"],["𝑼","U"],["𝑽","V"],["𝑾","W"],["𝑿","X"],["𝒀","Y"],["𝒁","Z"],["𝒂","a"],["𝒃","b"],["𝒄","c"],["𝒅","d"],["𝒆","e"],["𝒇","f"],["𝒈","g"],["𝒉","h"],["𝒊","i"],["𝒋","j"],["𝒌","k"],["𝒍","l"],["𝒎","m"],["𝒏","n"],["𝒐","o"],["𝒑","p"],["𝒒","q"],["𝒓","r"],["𝒔","s"],["𝒕","t"],["𝒖","u"],["𝒗","v"],["𝒘","w"],["𝒙","x"],["𝒚","y"],["𝒛","z"],["𝒜","A"],["𝒞","C"],["𝒟","D"],["𝒢","g"],["𝒥","J"],["𝒦","K"],["𝒩","N"],["𝒪","O"],["𝒫","P"],["𝒬","Q"],["𝒮","S"],["𝒯","T"],["𝒰","U"],["𝒱","V"],["𝒲","W"],["𝒳","X"],["𝒴","Y"],["𝒵","Z"],["𝒶","a"],["𝒷","b"],["𝒸","c"],["𝒹","d"],["𝒻","f"],["𝒽","h"],["𝒾","i"],["𝒿","j"],["𝓀","h"],["𝓁","l"],["𝓂","m"],["𝓃","n"],["𝓅","p"],["𝓆","q"],["𝓇","r"],["𝓈","s"],["𝓉","t"],["𝓊","u"],["𝓋","v"],["𝓌","w"],["𝓍","x"],["𝓎","y"],["𝓏","z"],["𝓐","A"],["𝓑","B"],["𝓒","C"],["𝓓","D"],["𝓔","E"],["𝓕","F"],["𝓖","G"],["𝓗","H"],["𝓘","I"],["𝓙","J"],["𝓚","K"],["𝓛","L"],["𝓜","M"],["𝓝","N"],["𝓞","O"],["𝓟","P"],["𝓠","Q"],["𝓡","R"],["𝓢","S"],["𝓣","T"],["𝓤","U"],["𝓥","V"],["𝓦","W"],["𝓧","X"],["𝓨","Y"],["𝓩","Z"],["𝓪","a"],["𝓫","b"],["𝓬","c"],["𝓭","d"],["𝓮","e"],["𝓯","f"],["𝓰","g"],["𝓱","h"],["𝓲","i"],["𝓳","j"],["𝓴","k"],["𝓵","l"],["𝓶","m"],["𝓷","n"],["𝓸","o"],["𝓹","p"],["𝓺","q"],["𝓻","r"],["𝓼","s"],["𝓽","t"],["𝓾","u"],["𝓿","v"],["𝔀","w"],["𝔁","x"],["𝔂","y"],["𝔃","z"],["𝔄","A"],["𝔅","B"],["𝔇","D"],["𝔈","E"],["𝔉","F"],["𝔊","G"],["𝔍","J"],["𝔎","K"],["𝔏","L"],["𝔐","M"],["𝔑","N"],["𝔒","O"],["𝔓","P"],["𝔔","Q"],["𝔖","S"],["𝔗","T"],["𝔘","U"],["𝔙","V"],["𝔚","W"],["𝔛","X"],["𝔜","Y"],["𝔞","a"],["𝔟","b"],["𝔠","c"],["𝔡","d"],["𝔢","e"],["𝔣","f"],["𝔤","g"],["𝔥","h"],["𝔦","i"],["𝔧","j"],["𝔨","k"],["𝔩","l"],["𝔪","m"],["𝔫","n"],["𝔬","o"],["𝔭","p"],["𝔮","q"],["𝔯","r"],["𝔰","s"],["𝔱","t"],["𝔲","u"],["𝔳","v"],["𝔴","w"],["𝔵","x"],["𝔶","y"],["𝔷","z"],["𝔸","A"],["𝔹","B"],["𝔻","D"],["𝔼","E"],["𝔽","F"],["𝔾","G"],["𝕀","I"],["𝕁","J"],["𝕂","K"],["𝕃","L"],["𝕄","M"],["𝕆","N"],["𝕊","S"],["𝕋","T"],["𝕌","U"],["𝕍","V"],["𝕎","W"],["𝕏","X"],["𝕐","Y"],["𝕒","a"],["𝕓","b"],["𝕔","c"],["𝕕","d"],["𝕖","e"],["𝕗","f"],["𝕘","g"],["𝕙","h"],["𝕚","i"],["𝕛","j"],["𝕜","k"],["𝕝","l"],["𝕞","m"],["𝕟","n"],["𝕠","o"],["𝕡","p"],["𝕢","q"],["𝕣","r"],["𝕤","s"],["𝕥","t"],["𝕦","u"],["𝕧","v"],["𝕨","w"],["𝕩","x"],["𝕪","y"],["𝕫","z"],["𝕬","A"],["𝕭","B"],["𝕮","C"],["𝕯","D"],["𝕰","E"],["𝕱","F"],["𝕲","G"],["𝕳","H"],["𝕴","I"],["𝕵","J"],["𝕶","K"],["𝕷","L"],["𝕸","M"],["𝕹","N"],["𝕺","O"],["𝕻","P"],["𝕼","Q"],["𝕽","R"],["𝕾","S"],["𝕿","T"],["𝖀","U"],["𝖁","V"],["𝖂","W"],["𝖃","X"],["𝖄","Y"],["𝖅","Z"],["𝖆","a"],["𝖇","b"],["𝖈","c"],["𝖉","d"],["𝖊","e"],["𝖋","f"],["𝖌","g"],["𝖍","h"],["𝖎","i"],["𝖏","j"],["𝖐","k"],["𝖑","l"],["𝖒","m"],["𝖓","n"],["𝖔","o"],["𝖕","p"],["𝖖","q"],["𝖗","r"],["𝖘","s"],["𝖙","t"],["𝖚","u"],["𝖛","v"],["𝖜","w"],["𝖝","x"],["𝖞","y"],["𝖟","z"],["𝖠","A"],["𝖡","B"],["𝖢","C"],["𝖣","D"],["𝖤","E"],["𝖥","F"],["𝖦","G"],["𝖧","H"],["𝖨","I"],["𝖩","J"],["𝖪","K"],["𝖫","L"],["𝖬","M"],["𝖭","N"],["𝖮","O"],["𝖯","P"],["𝖰","Q"],["𝖱","R"],["𝖲","S"],["𝖳","T"],["𝖴","U"],["𝖵","V"],["𝖶","W"],["𝖷","X"],["𝖸","Y"],["𝖹","Z"],["𝖺","a"],["𝖻","b"],["𝖼","c"],["𝖽","d"],["𝖾","e"],["𝖿","f"],["𝗀","g"],["𝗁","h"],["𝗂","i"],["𝗃","j"],["𝗄","k"],["𝗅","l"],["𝗆","m"],["𝗇","n"],["𝗈","o"],["𝗉","p"],["𝗊","q"],["𝗋","r"],["𝗌","s"],["𝗍","t"],["𝗎","u"],["𝗏","v"],["𝗐","w"],["𝗑","x"],["𝗒","y"],["𝗓","z"],["𝗔","A"],["𝗕","B"],["𝗖","C"],["𝗗","D"],["𝗘","E"],["𝗙","F"],["𝗚","G"],["𝗛","H"],["𝗜","I"],["𝗝","J"],["𝗞","K"],["𝗟","L"],["𝗠","M"],["𝗡","N"],["𝗢","O"],["𝗣","P"],["𝗤","Q"],["𝗥","R"],["𝗦","S"],["𝗧","T"],["𝗨","U"],["𝗩","V"],["𝗪","W"],["𝗫","X"],["𝗬","Y"],["𝗭","Z"],["𝗮","a"],["𝗯","b"],["𝗰","c"],["𝗱","d"],["𝗲","e"],["𝗳","f"],["𝗴","g"],["𝗵","h"],["𝗶","i"],["𝗷","j"],["𝗸","k"],["𝗹","l"],["𝗺","m"],["𝗻","n"],["𝗼","o"],["𝗽","p"],["𝗾","q"],["𝗿","r"],["𝘀","s"],["𝘁","t"],["𝘂","u"],["𝘃","v"],["𝘄","w"],["𝘅","x"],["𝘆","y"],["𝘇","z"],["𝘈","A"],["𝘉","B"],["𝘊","C"],["𝘋","D"],["𝘌","E"],["𝘍","F"],["𝘎","G"],["𝘏","H"],["𝘐","I"],["𝘑","J"],["𝘒","K"],["𝘓","L"],["𝘔","M"],["𝘕","N"],["𝘖","O"],["𝘗","P"],["𝘘","Q"],["𝘙","R"],["𝘚","S"],["𝘛","T"],["𝘜","U"],["𝘝","V"],["𝘞","W"],["𝘟","X"],["𝘠","Y"],["𝘡","Z"],["𝘢","a"],["𝘣","b"],["𝘤","c"],["𝘥","d"],["𝘦","e"],["𝘧","f"],["𝘨","g"],["𝘩","h"],["𝘪","i"],["𝘫","j"],["𝘬","k"],["𝘭","l"],["𝘮","m"],["𝘯","n"],["𝘰","o"],["𝘱","p"],["𝘲","q"],["𝘳","r"],["𝘴","s"],["𝘵","t"],["𝘶","u"],["𝘷","v"],["𝘸","w"],["𝘹","x"],["𝘺","y"],["𝘻","z"],["𝘼","A"],["𝘽","B"],["𝘾","C"],["𝘿","D"],["𝙀","E"],["𝙁","F"],["𝙂","G"],["𝙃","H"],["𝙄","I"],["𝙅","J"],["𝙆","K"],["𝙇","L"],["𝙈","M"],["𝙉","N"],["𝙊","O"],["𝙋","P"],["𝙌","Q"],["𝙍","R"],["𝙎","S"],["𝙏","T"],["𝙐","U"],["𝙑","V"],["𝙒","W"],["𝙓","X"],["𝙔","Y"],["𝙕","Z"],["𝙖","a"],["𝙗","b"],["𝙘","c"],["𝙙","d"],["𝙚","e"],["𝙛","f"],["𝙜","g"],["𝙝","h"],["𝙞","i"],["𝙟","j"],["𝙠","k"],["𝙡","l"],["𝙢","m"],["𝙣","n"],["𝙤","o"],["𝙥","p"],["𝙦","q"],["𝙧","r"],["𝙨","s"],["𝙩","t"],["𝙪","u"],["𝙫","v"],["𝙬","w"],["𝙭","x"],["𝙮","y"],["𝙯","z"],["𝙰","A"],["𝙱","B"],["𝙲","C"],["𝙳","D"],["𝙴","E"],["𝙵","F"],["𝙶","G"],["𝙷","H"],["𝙸","I"],["𝙹","J"],["𝙺","K"],["𝙻","L"],["𝙼","M"],["𝙽","N"],["𝙾","O"],["𝙿","P"],["𝚀","Q"],["𝚁","R"],["𝚂","S"],["𝚃","T"],["𝚄","U"],["𝚅","V"],["𝚆","W"],["𝚇","X"],["𝚈","Y"],["𝚉","Z"],["𝚊","a"],["𝚋","b"],["𝚌","c"],["𝚍","d"],["𝚎","e"],["𝚏","f"],["𝚐","g"],["𝚑","h"],["𝚒","i"],["𝚓","j"],["𝚔","k"],["𝚕","l"],["𝚖","m"],["𝚗","n"],["𝚘","o"],["𝚙","p"],["𝚚","q"],["𝚛","r"],["𝚜","s"],["𝚝","t"],["𝚞","u"],["𝚟","v"],["𝚠","w"],["𝚡","x"],["𝚢","y"],["𝚣","z"],["𝚤","l"],["𝚥","j"],["𝛢","A"],["𝛣","B"],["𝛤","G"],["𝛥","D"],["𝛦","E"],["𝛧","Z"],["𝛨","I"],["𝛩","TH"],["𝛪","I"],["𝛫","K"],["𝛬","L"],["𝛭","M"],["𝛮","N"],["𝛯","KS"],["𝛰","O"],["𝛱","P"],["𝛲","R"],["𝛳","TH"],["𝛴","S"],["𝛵","T"],["𝛶","Y"],["𝛷","F"],["𝛸","x"],["𝛹","PS"],["𝛺","O"],["𝛻","D"],["𝛼","a"],["𝛽","b"],["𝛾","g"],["𝛿","d"],["𝜀","e"],["𝜁","z"],["𝜂","i"],["𝜃","th"],["𝜄","i"],["𝜅","k"],["𝜆","l"],["𝜇","m"],["𝜈","n"],["𝜉","ks"],["𝜊","o"],["𝜋","p"],["𝜌","r"],["𝜍","s"],["𝜎","s"],["𝜏","t"],["𝜐","y"],["𝜑","f"],["𝜒","x"],["𝜓","ps"],["𝜔","o"],["𝜕","d"],["𝜖","E"],["𝜗","TH"],["𝜘","K"],["𝜙","f"],["𝜚","r"],["𝜛","p"],["𝜜","A"],["𝜝","V"],["𝜞","G"],["𝜟","D"],["𝜠","E"],["𝜡","Z"],["𝜢","I"],["𝜣","TH"],["𝜤","I"],["𝜥","K"],["𝜦","L"],["𝜧","M"],["𝜨","N"],["𝜩","KS"],["𝜪","O"],["𝜫","P"],["𝜬","S"],["𝜭","TH"],["𝜮","S"],["𝜯","T"],["𝜰","Y"],["𝜱","F"],["𝜲","X"],["𝜳","PS"],["𝜴","O"],["𝜵","D"],["𝜶","a"],["𝜷","v"],["𝜸","g"],["𝜹","d"],["𝜺","e"],["𝜻","z"],["𝜼","i"],["𝜽","th"],["𝜾","i"],["𝜿","k"],["𝝀","l"],["𝝁","m"],["𝝂","n"],["𝝃","ks"],["𝝄","o"],["𝝅","p"],["𝝆","r"],["𝝇","s"],["𝝈","s"],["𝝉","t"],["𝝊","y"],["𝝋","f"],["𝝌","x"],["𝝍","ps"],["𝝎","o"],["𝝏","a"],["𝝐","e"],["𝝑","i"],["𝝒","k"],["𝝓","f"],["𝝔","r"],["𝝕","p"],["𝝖","A"],["𝝗","B"],["𝝘","G"],["𝝙","D"],["𝝚","E"],["𝝛","Z"],["𝝜","I"],["𝝝","TH"],["𝝞","I"],["𝝟","K"],["𝝠","L"],["𝝡","M"],["𝝢","N"],["𝝣","KS"],["𝝤","O"],["𝝥","P"],["𝝦","R"],["𝝧","TH"],["𝝨","S"],["𝝩","T"],["𝝪","Y"],["𝝫","F"],["𝝬","X"],["𝝭","PS"],["𝝮","O"],["𝝯","D"],["𝝰","a"],["𝝱","v"],["𝝲","g"],["𝝳","d"],["𝝴","e"],["𝝵","z"],["𝝶","i"],["𝝷","th"],["𝝸","i"],["𝝹","k"],["𝝺","l"],["𝝻","m"],["𝝼","n"],["𝝽","ks"],["𝝾","o"],["𝝿","p"],["𝞀","r"],["𝞁","s"],["𝞂","s"],["𝞃","t"],["𝞄","y"],["𝞅","f"],["𝞆","x"],["𝞇","ps"],["𝞈","o"],["𝞉","a"],["𝞊","e"],["𝞋","i"],["𝞌","k"],["𝞍","f"],["𝞎","r"],["𝞏","p"],["𝞐","A"],["𝞑","V"],["𝞒","G"],["𝞓","D"],["𝞔","E"],["𝞕","Z"],["𝞖","I"],["𝞗","TH"],["𝞘","I"],["𝞙","K"],["𝞚","L"],["𝞛","M"],["𝞜","N"],["𝞝","KS"],["𝞞","O"],["𝞟","P"],["𝞠","S"],["𝞡","TH"],["𝞢","S"],["𝞣","T"],["𝞤","Y"],["𝞥","F"],["𝞦","X"],["𝞧","PS"],["𝞨","O"],["𝞩","D"],["𝞪","av"],["𝞫","g"],["𝞬","d"],["𝞭","e"],["𝞮","z"],["𝞯","i"],["𝞰","i"],["𝞱","th"],["𝞲","i"],["𝞳","k"],["𝞴","l"],["𝞵","m"],["𝞶","n"],["𝞷","ks"],["𝞸","o"],["𝞹","p"],["𝞺","r"],["𝞻","s"],["𝞼","s"],["𝞽","t"],["𝞾","y"],["𝞿","f"],["𝟀","x"],["𝟁","ps"],["𝟂","o"],["𝟃","a"],["𝟄","e"],["𝟅","i"],["𝟆","k"],["𝟇","f"],["𝟈","r"],["𝟉","p"],["𝟊","F"],["𝟋","f"],["⒜","(a)"],["⒝","(b)"],["⒞","(c)"],["⒟","(d)"],["⒠","(e)"],["⒡","(f)"],["⒢","(g)"],["⒣","(h)"],["⒤","(i)"],["⒥","(j)"],["⒦","(k)"],["⒧","(l)"],["⒨","(m)"],["⒩","(n)"],["⒪","(o)"],["⒫","(p)"],["⒬","(q)"],["⒭","(r)"],["⒮","(s)"],["⒯","(t)"],["⒰","(u)"],["⒱","(v)"],["⒲","(w)"],["⒳","(x)"],["⒴","(y)"],["⒵","(z)"],["Ⓐ","(A)"],["Ⓑ","(B)"],["Ⓒ","(C)"],["Ⓓ","(D)"],["Ⓔ","(E)"],["Ⓕ","(F)"],["Ⓖ","(G)"],["Ⓗ","(H)"],["Ⓘ","(I)"],["Ⓙ","(J)"],["Ⓚ","(K)"],["Ⓛ","(L)"],["Ⓝ","(N)"],["Ⓞ","(O)"],["Ⓟ","(P)"],["Ⓠ","(Q)"],["Ⓡ","(R)"],["Ⓢ","(S)"],["Ⓣ","(T)"],["Ⓤ","(U)"],["Ⓥ","(V)"],["Ⓦ","(W)"],["Ⓧ","(X)"],["Ⓨ","(Y)"],["Ⓩ","(Z)"],["ⓐ","(a)"],["ⓑ","(b)"],["ⓒ","(b)"],["ⓓ","(c)"],["ⓔ","(e)"],["ⓕ","(f)"],["ⓖ","(g)"],["ⓗ","(h)"],["ⓘ","(i)"],["ⓙ","(j)"],["ⓚ","(k)"],["ⓛ","(l)"],["ⓜ","(m)"],["ⓝ","(n)"],["ⓞ","(o)"],["ⓟ","(p)"],["ⓠ","(q)"],["ⓡ","(r)"],["ⓢ","(s)"],["ⓣ","(t)"],["ⓤ","(u)"],["ⓥ","(v)"],["ⓦ","(w)"],["ⓧ","(x)"],["ⓨ","(y)"],["ⓩ","(z)"],["Ċ","C"],["ċ","c"],["Ġ","G"],["ġ","g"],["Ħ","H"],["ħ","h"],["Ż","Z"],["ż","z"],["𝟎","0"],["𝟏","1"],["𝟐","2"],["𝟑","3"],["𝟒","4"],["𝟓","5"],["𝟔","6"],["𝟕","7"],["𝟖","8"],["𝟗","9"],["𝟘","0"],["𝟙","1"],["𝟚","2"],["𝟛","3"],["𝟜","4"],["𝟝","5"],["𝟞","6"],["𝟟","7"],["𝟠","8"],["𝟡","9"],["𝟢","0"],["𝟣","1"],["𝟤","2"],["𝟥","3"],["𝟦","4"],["𝟧","5"],["𝟨","6"],["𝟩","7"],["𝟪","8"],["𝟫","9"],["𝟬","0"],["𝟭","1"],["𝟮","2"],["𝟯","3"],["𝟰","4"],["𝟱","5"],["𝟲","6"],["𝟳","7"],["𝟴","8"],["𝟵","9"],["𝟶","0"],["𝟷","1"],["𝟸","2"],["𝟹","3"],["𝟺","4"],["𝟻","5"],["𝟼","6"],["𝟽","7"],["𝟾","8"],["𝟿","9"],["①","1"],["②","2"],["③","3"],["④","4"],["⑤","5"],["⑥","6"],["⑦","7"],["⑧","8"],["⑨","9"],["⑩","10"],["⑪","11"],["⑫","12"],["⑬","13"],["⑭","14"],["⑮","15"],["⑯","16"],["⑰","17"],["⑱","18"],["⑲","19"],["⑳","20"],["⑴","1"],["⑵","2"],["⑶","3"],["⑷","4"],["⑸","5"],["⑹","6"],["⑺","7"],["⑻","8"],["⑼","9"],["⑽","10"],["⑾","11"],["⑿","12"],["⒀","13"],["⒁","14"],["⒂","15"],["⒃","16"],["⒄","17"],["⒅","18"],["⒆","19"],["⒇","20"],["⒈","1."],["⒉","2."],["⒊","3."],["⒋","4."],["⒌","5."],["⒍","6."],["⒎","7."],["⒏","8."],["⒐","9."],["⒑","10."],["⒒","11."],["⒓","12."],["⒔","13."],["⒕","14."],["⒖","15."],["⒗","16."],["⒘","17."],["⒙","18."],["⒚","19."],["⒛","20."],["⓪","0"],["⓫","11"],["⓬","12"],["⓭","13"],["⓮","14"],["⓯","15"],["⓰","16"],["⓱","17"],["⓲","18"],["⓳","19"],["⓴","20"],["⓵","1"],["⓶","2"],["⓷","3"],["⓸","4"],["⓹","5"],["⓺","6"],["⓻","7"],["⓼","8"],["⓽","9"],["⓾","10"],["⓿","0"],["🙰","&"],["🙱","&"],["🙲","&"],["🙳","&"],["🙴","&"],["🙵","&"],["🙶",'"'],["🙷",'"'],["🙸",'"'],["‽","?!"],["🙹","?!"],["🙺","?!"],["🙻","?!"],["🙼","/"],["🙽","\\"],["🜇","AR"],["🜈","V"],["🜉","V"],["🜆","VR"],["🜅","VF"],["🜩","2"],["🜪","5"],["🝡","f"],["🝢","W"],["🝣","U"],["🝧","V"],["🝨","T"],["🝪","V"],["🝫","MB"],["🝬","VB"],["🝲","3B"],["🝳","3B"],["💯","100"],["🔙","BACK"],["🔚","END"],["🔛","ON!"],["🔜","SOON"],["🔝","TOP"],["🔞","18"],["🔤","abc"],["🔠","ABCD"],["🔡","abcd"],["🔢","1234"],["🔣","T&@%"],["#️⃣","#"],["*️⃣","*"],["0️⃣","0"],["1️⃣","1"],["2️⃣","2"],["3️⃣","3"],["4️⃣","4"],["5️⃣","5"],["6️⃣","6"],["7️⃣","7"],["8️⃣","8"],["9️⃣","9"],["🔟","10"],["🅰️","A"],["🅱️","B"],["🆎","AB"],["🆑","CL"],["🅾️","O"],["🅿","P"],["🆘","SOS"],["🅲","C"],["🅳","D"],["🅴","E"],["🅵","F"],["🅶","G"],["🅷","H"],["🅸","I"],["🅹","J"],["🅺","K"],["🅻","L"],["🅼","M"],["🅽","N"],["🆀","Q"],["🆁","R"],["🆂","S"],["🆃","T"],["🆄","U"],["🆅","V"],["🆆","W"],["🆇","X"],["🆈","Y"],["🆉","Z"]],db=(n,e)=>{for(const[t,r]of e)n=n.replace(new RegExp(Do(t),"g"),r);return n};function mb(n,e){if(typeof n!="string")throw new TypeError(`Expected a string, got \`${typeof n}\``);e={customReplacements:[],...e};const t=new Map([...pb,...e.customReplacements]);return n=n.normalize(),n=db(n,t),n=n.normalize("NFD").replace(/\p{Diacritic}/gu,"").normalize(),n}const gb=[["&"," and "],["🦄"," unicorn "],["♥"," love "]],yb=n=>n.replace(/([A-Z]{2,})(\d+)/g,"$1 $2").replace(/([a-z\d]+)([A-Z]{2,})/g,"$1 $2").replace(/([a-z\d])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-rt-z\d]+)/g,"$1 $2"),wb=(n,e)=>{const t=Do(e);return n.replace(new RegExp(`${t}{2,}`,"g"),e).replace(new RegExp(`^${t}|${t}$`,"g"),"")},bb=n=>{let e="a-z\\d";if(e+=n.lowercase?"":"A-Z",n.preserveCharacters.length>0)for(const t of n.preserveCharacters){if(t===n.separator)throw new Error(`The separator character \`${n.separator}\` cannot be included in preserved characters: ${n.preserveCharacters}`);e+=Do(t)}return new RegExp(`[^${e}]+`,"g")};function g5(n,e){if(typeof n!="string")throw new TypeError(`Expected a string, got \`${typeof n}\``);e={separator:"-",lowercase:!0,decamelize:!0,customReplacements:[],preserveLeadingUnderscore:!1,preserveTrailingDash:!1,preserveCharacters:[],...e};const t=e.preserveLeadingUnderscore&&n.startsWith("_"),r=e.preserveTrailingDash&&n.endsWith("-"),i=new Map([...gb,...e.customReplacements]);n=mb(n,{customReplacements:i}),e.decamelize&&(n=yb(n));const o=bb(e);return e.lowercase&&(n=n.toLowerCase()),n=n.replace(/([a-zA-Z\d]+)'([ts])(\s|$)/g,"$1$2$3"),n=n.replace(o,e.separator),n=n.replace(/\\/g,""),e.separator&&(n=wb(n,e.separator)),t&&(n=`_${n}`),r&&(n=`${n}-`),n}function y5(n,e){return function(t,r){let{$from:i,$to:o,node:s}=t.selection;if(s&&s.isBlock||i.depth<2||!i.sameParent(o))return!1;let l=i.node(-1);if(l.type!=n)return!1;if(i.parent.content.size==0&&i.node(-1).childCount==i.indexAfter(-1)){if(i.depth==3||i.node(-3).type!=n||i.index(-2)!=i.node(-2).childCount-1)return!1;if(r){let f=I.empty,h=i.index(-1)?1:i.index(-2)?2:3;for(let g=i.depth-h;g>=i.depth-3;g--)f=I.from(i.node(g).copy(f));let p=i.indexAfter(-1)<i.node(-2).childCount?1:i.indexAfter(-2)<i.node(-3).childCount?2:3;f=f.append(I.from(n.createAndFill()));let d=i.before(i.depth-(h-1)),m=t.tr.replace(d,i.after(-p),new P(f,4-h,0)),y=-1;m.doc.nodesBetween(d,m.doc.content.size,(g,_)=>{if(y>-1)return!1;g.isTextblock&&g.content.size==0&&(y=_+1)}),y>-1&&m.setSelection(j.near(m.doc.resolve(y))),r(m.scrollIntoView())}return!0}let a=o.pos==i.end()?l.contentMatchAt(0).defaultType:null,u=t.tr.delete(i.pos,o.pos),c=a?[e?{type:n,attrs:e}:null,{type:a}]:void 0;return Fr(u.doc,i.pos,2,c)?(r&&r(u.split(i.pos,2,c).scrollIntoView()),!0):!1}}function w5(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==n);return o?t?r.node(o.depth-1).type==n?xb(e,t,n,o):kb(e,t,o):!0:!1}}function xb(n,e,t,r){let i=n.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new ke(o-1,s,o,s,new P(I.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new Af(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const l=Ao(r);if(l==null)return!1;i.lift(r,l);let a=i.mapping.map(o,-1)-1;return Mo(i.doc,a)&&i.join(a),e(i.scrollIntoView()),!0}function kb(n,e,t){let r=n.tr,i=t.parent;for(let p=t.end,d=t.endIndex-1,m=t.startIndex;d>m;d--)p-=i.child(d).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(t.start),s=o.nodeAfter;if(r.mapping.map(t.end)!=t.start+o.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,a=t.endIndex==i.childCount,u=o.node(-1),c=o.index(-1);if(!u.canReplace(c+(l?0:1),c+1,s.content.append(a?I.empty:I.from(i))))return!1;let f=o.pos,h=f+s.nodeSize;return r.step(new ke(f-(l?1:0),h+(a?1:0),f+1,h-1,new P((l?I.empty:I.from(i.copy(I.empty))).append(a?I.empty:I.from(i.copy(I.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function b5(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,u=>u.childCount>0&&u.firstChild.type==n);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let l=o.parent,a=l.child(s-1);if(a.type!=n)return!1;if(t){let u=a.lastChild&&a.lastChild.type==l.type,c=I.from(u?n.create():null),f=new P(I.from(n.create(null,I.from(l.type.create(null,c)))),u?3:1,0),h=o.start,p=o.end;t(e.tr.step(new ke(h-(u?3:1),p,h,p,f,1,!0)).scrollIntoView())}return!0}}function vb(n){const e=new Map;if(!n||!n.type)throw new Error("mdast-util-definitions expected node");return Ll(n,"definition",function(r){const i=fc(r.identifier);i&&!e.get(i)&&e.set(i,r)}),t;function t(r){const i=fc(r);return e.get(i)}}function fc(n){return String(n||"").toUpperCase()}function x5(){return function(n){const e=vb(n);Ll(n,function(t,r,i){if(t.type==="definition"&&i!==void 0&&typeof r=="number")return i.children.splice(r,1),[Us,r];if(t.type==="imageReference"||t.type==="linkReference"){const o=e(t.identifier);if(o&&i&&typeof r=="number")return i.children[r]=t.type==="imageReference"?{type:"image",url:o.url,title:o.title,alt:t.alt}:{type:"link",url:o.url,title:o.title,children:t.children},[Us,r]}})}}var al,ul;if(typeof WeakMap<"u"){let n=new WeakMap;al=e=>n.get(e),ul=(e,t)=>(n.set(e,t),t)}else{const n=[];let t=0;al=r=>{for(let i=0;i<n.length;i+=2)if(n[i]==r)return n[i+1]},ul=(r,i)=>(t==10&&(t=0),n[t++]=r,n[t++]=i)}var ie=class{constructor(n,e,t,r){this.width=n,this.height=e,this.map=t,this.problems=r}findCell(n){for(let e=0;e<this.map.length;e++){const t=this.map[e];if(t!=n)continue;const r=e%this.width,i=e/this.width|0;let o=r+1,s=i+1;for(let l=1;o<this.width&&this.map[e+l]==t;l++)o++;for(let l=1;s<this.height&&this.map[e+this.width*l]==t;l++)s++;return{left:r,top:i,right:o,bottom:s}}throw new RangeError(`No cell with offset ${n} found`)}colCount(n){for(let e=0;e<this.map.length;e++)if(this.map[e]==n)return e%this.width;throw new RangeError(`No cell with offset ${n} found`)}nextCell(n,e,t){const{left:r,right:i,top:o,bottom:s}=this.findCell(n);return e=="horiz"?(t<0?r==0:i==this.width)?null:this.map[o*this.width+(t<0?r-1:i)]:(t<0?o==0:s==this.height)?null:this.map[r+this.width*(t<0?o-1:s)]}rectBetween(n,e){const{left:t,right:r,top:i,bottom:o}=this.findCell(n),{left:s,right:l,top:a,bottom:u}=this.findCell(e);return{left:Math.min(t,s),top:Math.min(i,a),right:Math.max(r,l),bottom:Math.max(o,u)}}cellsInRect(n){const e=[],t={};for(let r=n.top;r<n.bottom;r++)for(let i=n.left;i<n.right;i++){const o=r*this.width+i,s=this.map[o];t[s]||(t[s]=!0,!(i==n.left&&i&&this.map[o-1]==s||r==n.top&&r&&this.map[o-this.width]==s)&&e.push(s))}return e}positionAt(n,e,t){for(let r=0,i=0;;r++){const o=i+t.child(r).nodeSize;if(r==n){let s=e+n*this.width;const l=(n+1)*this.width;for(;s<l&&this.map[s]<i;)s++;return s==l?o-1:this.map[s]}i=o}}static get(n){return al(n)||ul(n,_b(n))}};function _b(n){if(n.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+n.type.name);const e=Sb(n),t=n.childCount,r=[];let i=0,o=null;const s=[];for(let u=0,c=e*t;u<c;u++)r[u]=0;for(let u=0,c=0;u<t;u++){const f=n.child(u);c++;for(let d=0;;d++){for(;i<r.length&&r[i]!=0;)i++;if(d==f.childCount)break;const m=f.child(d),{colspan:y,rowspan:g,colwidth:_}=m.attrs;for(let x=0;x<g;x++){if(x+u>=t){(o||(o=[])).push({type:"overlong_rowspan",pos:c,n:g-x});break}const S=i+x*e;for(let M=0;M<y;M++){r[S+M]==0?r[S+M]=c:(o||(o=[])).push({type:"collision",row:u,pos:c,n:y-M});const k=_&&_[M];if(k){const F=(S+M)%e*2,L=s[F];L==null||L!=k&&s[F+1]==1?(s[F]=k,s[F+1]=1):L==k&&s[F+1]++}}}i+=y,c+=m.nodeSize}const h=(u+1)*e;let p=0;for(;i<h;)r[i++]==0&&p++;p&&(o||(o=[])).push({type:"missing",row:u,n:p}),c++}const l=new ie(e,t,r,o);let a=!1;for(let u=0;!a&&u<s.length;u+=2)s[u]!=null&&s[u+1]<t&&(a=!0);return a&&Cb(l,s,n),l}function Sb(n){let e=-1,t=!1;for(let r=0;r<n.childCount;r++){const i=n.child(r);let o=0;if(t)for(let s=0;s<r;s++){const l=n.child(s);for(let a=0;a<l.childCount;a++){const u=l.child(a);s+u.attrs.rowspan>r&&(o+=u.attrs.colspan)}}for(let s=0;s<i.childCount;s++){const l=i.child(s);o+=l.attrs.colspan,l.attrs.rowspan>1&&(t=!0)}e==-1?e=o:e!=o&&(e=Math.max(e,o))}return e}function Cb(n,e,t){n.problems||(n.problems=[]);const r={};for(let i=0;i<n.map.length;i++){const o=n.map[i];if(r[o])continue;r[o]=!0;const s=t.nodeAt(o);if(!s)throw new RangeError(`No cell with offset ${o} found`);let l=null;const a=s.attrs;for(let u=0;u<a.colspan;u++){const c=(i+u)%n.width,f=e[c*2];f!=null&&(!a.colwidth||a.colwidth[u]!=f)&&((l||(l=Ab(a)))[u]=f)}l&&n.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:l})}}function Ab(n){if(n.colwidth)return n.colwidth.slice();const e=[];for(let t=0;t<n.colspan;t++)e.push(0);return e}function hc(n,e){if(typeof n=="string")return{};const t=n.getAttribute("data-colwidth"),r=t&&/^\d+(,\d+)*$/.test(t)?t.split(",").map(s=>Number(s)):null,i=Number(n.getAttribute("colspan")||1),o={colspan:i,rowspan:Number(n.getAttribute("rowspan")||1),colwidth:r&&r.length==i?r:null};for(const s in e){const l=e[s].getFromDOM,a=l&&l(n);a!=null&&(o[s]=a)}return o}function pc(n,e){const t={};n.attrs.colspan!=1&&(t.colspan=n.attrs.colspan),n.attrs.rowspan!=1&&(t.rowspan=n.attrs.rowspan),n.attrs.colwidth&&(t["data-colwidth"]=n.attrs.colwidth.join(","));for(const r in e){const i=e[r].setDOMAttr;i&&i(n.attrs[r],t)}return t}function k5(n){const e=n.cellAttributes||{},t={colspan:{default:1},rowspan:{default:1},colwidth:{default:null}};for(const r in e)t[r]={default:e[r].default};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:n.tableGroup,parseDOM:[{tag:"table"}],toDOM(){return["table",["tbody",0]]}},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM(){return["tr",0]}},table_cell:{content:n.cellContent,attrs:t,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:r=>hc(r,e)}],toDOM(r){return["td",pc(r,e),0]}},table_header:{content:n.cellContent,attrs:t,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:r=>hc(r,e)}],toDOM(r){return["th",pc(r,e),0]}}}}function ot(n){let e=n.cached.tableNodeTypes;if(!e){e=n.cached.tableNodeTypes={};for(const t in n.nodes){const r=n.nodes[t],i=r.spec.tableRole;i&&(e[i]=r)}}return e}var Kt=new fr("selectingCells");function li(n){for(let e=n.depth-1;e>0;e--)if(n.node(e).type.spec.tableRole=="row")return n.node(0).resolve(n.before(e+1));return null}function Lt(n){const e=n.selection.$head;for(let t=e.depth;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return!0;return!1}function Io(n){const e=n.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const t=li(e.$head)||Mb(e.$head);if(t)return t;throw new RangeError(`No cell found around position ${e.head}`)}function Mb(n){for(let e=n.nodeAfter,t=n.pos;e;e=e.firstChild,t++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return n.doc.resolve(t)}for(let e=n.nodeBefore,t=n.pos;e;e=e.lastChild,t--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return n.doc.resolve(t-e.nodeSize)}}function cl(n){return n.parent.type.spec.tableRole=="row"&&!!n.nodeAfter}function Ob(n){return n.node(0).resolve(n.pos+n.nodeAfter.nodeSize)}function ta(n,e){return n.depth==e.depth&&n.pos>=e.start(-1)&&n.pos<=e.end(-1)}function mp(n,e,t){const r=n.node(-1),i=ie.get(r),o=n.start(-1),s=i.nextCell(n.pos-o,e,t);return s==null?null:n.node(0).resolve(o+s)}function In(n,e,t=1){const r={...n,colspan:n.colspan-t};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,t),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function Eb(n,e,t=1){const r={...n,colspan:n.colspan+t};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;i<t;i++)r.colwidth.splice(e,0,0)}return r}function Tb(n,e,t){const r=ot(e.type.schema).header_cell;for(let i=0;i<n.height;i++)if(e.nodeAt(n.map[t+i*n.width]).type!=r)return!1;return!0}var ae=class Et extends j{constructor(e,t=e){const r=e.node(-1),i=ie.get(r),o=e.start(-1),s=i.rectBetween(e.pos-o,t.pos-o),l=e.node(0),a=i.cellsInRect(s).filter(c=>c!=t.pos-o);a.unshift(t.pos-o);const u=a.map(c=>{const f=r.nodeAt(c);if(!f)throw RangeError(`No cell with offset ${c} found`);const h=o+c+1;return new io(l.resolve(h),l.resolve(h+f.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=e,this.$headCell=t}map(e,t){const r=e.resolve(t.map(this.$anchorCell.pos)),i=e.resolve(t.map(this.$headCell.pos));if(cl(r)&&cl(i)&&ta(r,i)){const o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?Et.rowSelection(r,i):o&&this.isColSelection()?Et.colSelection(r,i):new Et(r,i)}return Z.between(r,i)}content(){const e=this.$anchorCell.node(-1),t=ie.get(e),r=this.$anchorCell.start(-1),i=t.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},s=[];for(let a=i.top;a<i.bottom;a++){const u=[];for(let c=a*t.width+i.left,f=i.left;f<i.right;f++,c++){const h=t.map[c];if(o[h])continue;o[h]=!0;const p=t.findCell(h);let d=e.nodeAt(h);if(!d)throw RangeError(`No cell with offset ${h} found`);const m=i.left-p.left,y=p.right-i.right;if(m>0||y>0){let g=d.attrs;if(m>0&&(g=In(g,0,m)),y>0&&(g=In(g,g.colspan-y,y)),p.left<i.left){if(d=d.type.createAndFill(g),!d)throw RangeError(`Could not create cell with attrs ${JSON.stringify(g)}`)}else d=d.type.create(g,d.content)}if(p.top<i.top||p.bottom>i.bottom){const g={...d.attrs,rowspan:Math.min(p.bottom,i.bottom)-Math.max(p.top,i.top)};p.top<i.top?d=d.type.createAndFill(g):d=d.type.create(g,d.content)}u.push(d)}s.push(e.child(a).copy(I.from(u)))}const l=this.isColSelection()&&this.isRowSelection()?e:s;return new P(I.from(l),1,1)}replace(e,t=P.empty){const r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){const{$from:l,$to:a}=i[s],u=e.mapping.slice(r);e.replace(u.map(l.pos),u.map(a.pos),s?P.empty:t)}const o=j.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);o&&e.setSelection(o)}replaceWith(e,t){this.replace(e,new P(I.from(t),0,0))}forEachCell(e){const t=this.$anchorCell.node(-1),r=ie.get(t),i=this.$anchorCell.start(-1),o=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let s=0;s<o.length;s++)e(t.nodeAt(o[s]),i+o[s])}isColSelection(){const e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){const r=e.node(-1),i=ie.get(r),o=e.start(-1),s=i.findCell(e.pos-o),l=i.findCell(t.pos-o),a=e.node(0);return s.top<=l.top?(s.top>0&&(e=a.resolve(o+i.map[s.left])),l.bottom<i.height&&(t=a.resolve(o+i.map[i.width*(i.height-1)+l.right-1]))):(l.top>0&&(t=a.resolve(o+i.map[l.left])),s.bottom<i.height&&(e=a.resolve(o+i.map[i.width*(i.height-1)+s.right-1]))),new Et(e,t)}isRowSelection(){const e=this.$anchorCell.node(-1),t=ie.get(e),r=this.$anchorCell.start(-1),i=t.colCount(this.$anchorCell.pos-r),o=t.colCount(this.$headCell.pos-r);if(Math.min(i,o)>0)return!1;const s=i+this.$anchorCell.nodeAfter.attrs.colspan,l=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,l)==t.width}eq(e){return e instanceof Et&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){const r=e.node(-1),i=ie.get(r),o=e.start(-1),s=i.findCell(e.pos-o),l=i.findCell(t.pos-o),a=e.node(0);return s.left<=l.left?(s.left>0&&(e=a.resolve(o+i.map[s.top*i.width])),l.right<i.width&&(t=a.resolve(o+i.map[i.width*(l.top+1)-1]))):(l.left>0&&(t=a.resolve(o+i.map[l.top*i.width])),s.right<i.width&&(e=a.resolve(o+i.map[i.width*(s.top+1)-1]))),new Et(e,t)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,t){return new Et(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){return new Et(e.resolve(t),e.resolve(r))}getBookmark(){return new Nb(this.$anchorCell.pos,this.$headCell.pos)}};ae.prototype.visible=!1;j.jsonID("cell",ae);var Nb=class gp{constructor(e,t){this.anchor=e,this.head=t}map(e){return new gp(e.map(this.anchor),e.map(this.head))}resolve(e){const t=e.resolve(this.anchor),r=e.resolve(this.head);return t.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&t.index()<t.parent.childCount&&r.index()<r.parent.childCount&&ta(t,r)?new ae(t,r):j.near(r,1)}};function Db(n){if(!(n.selection instanceof ae))return null;const e=[];return n.selection.forEachCell((t,r)=>{e.push(Re.node(r,r+t.nodeSize,{class:"selectedCell"}))}),re.create(n.doc,e)}function Ib({$from:n,$to:e}){if(n.pos==e.pos||n.pos<n.pos-6)return!1;let t=n.pos,r=e.pos,i=n.depth;for(;i>=0&&!(n.after(i+1)<n.end(i));i--,t++);for(let o=e.depth;o>=0&&!(e.before(o+1)>e.start(o));o--,r--);return t==r&&/row|table/.test(n.node(i).type.spec.tableRole)}function zb({$from:n,$to:e}){let t,r;for(let i=n.depth;i>0;i--){const o=n.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){t=o;break}}for(let i=e.depth;i>0;i--){const o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return t!==r&&e.parentOffset===0}function Rb(n,e,t){const r=(e||n).selection,i=(e||n).doc;let o,s;if(r instanceof q&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=ae.create(i,r.from);else if(s=="row"){const l=i.resolve(r.from+1);o=ae.rowSelection(l,l)}else if(!t){const l=ie.get(r.node),a=r.from+1,u=a+l.map[l.width*l.height-1];o=ae.create(i,a+1,u)}}else r instanceof Z&&Ib(r)?o=Z.create(i,r.from):r instanceof Z&&zb(r)&&(o=Z.create(i,r.$from.start(),r.$from.end()));return o&&(e||(e=n.tr)).setSelection(o),e}var Fb=new fr("fix-tables");function yp(n,e,t,r){const i=n.childCount,o=e.childCount;e:for(let s=0,l=0;s<o;s++){const a=e.child(s);for(let u=l,c=Math.min(i,s+3);u<c;u++)if(n.child(u)==a){l=u+1,t+=a.nodeSize;continue e}r(a,t),l<i&&n.child(l).sameMarkup(a)?yp(n.child(l),a,t+1,r):a.nodesBetween(0,a.content.size,r,t+1),t+=a.nodeSize}}function Pb(n,e){let t;const r=(i,o)=>{i.type.spec.tableRole=="table"&&(t=Lb(n,i,o,t))};return e?e.doc!=n.doc&&yp(e.doc,n.doc,0,r):n.doc.descendants(r),t}function Lb(n,e,t,r){const i=ie.get(e);if(!i.problems)return r;r||(r=n.tr);const o=[];for(let a=0;a<i.height;a++)o.push(0);for(let a=0;a<i.problems.length;a++){const u=i.problems[a];if(u.type=="collision"){const c=e.nodeAt(u.pos);if(!c)continue;const f=c.attrs;for(let h=0;h<f.rowspan;h++)o[u.row+h]+=u.n;r.setNodeMarkup(r.mapping.map(t+1+u.pos),null,In(f,f.colspan-u.n,u.n))}else if(u.type=="missing")o[u.row]+=u.n;else if(u.type=="overlong_rowspan"){const c=e.nodeAt(u.pos);if(!c)continue;r.setNodeMarkup(r.mapping.map(t+1+u.pos),null,{...c.attrs,rowspan:c.attrs.rowspan-u.n})}else if(u.type=="colwidth mismatch"){const c=e.nodeAt(u.pos);if(!c)continue;r.setNodeMarkup(r.mapping.map(t+1+u.pos),null,{...c.attrs,colwidth:u.colwidth})}}let s,l;for(let a=0;a<o.length;a++)o[a]&&(s==null&&(s=a),l=a);for(let a=0,u=t+1;a<i.height;a++){const c=e.child(a),f=u+c.nodeSize,h=o[a];if(h>0){let p="cell";c.firstChild&&(p=c.firstChild.type.spec.tableRole);const d=[];for(let y=0;y<h;y++){const g=ot(n.schema)[p].createAndFill();g&&d.push(g)}const m=(a==0||s==a-1)&&l==a?u+1:f-1;r.insert(r.mapping.map(m),d)}u=f}return r.setMeta(Fb,{fixTables:!0})}function hr(n){const e=n.selection,t=Io(n),r=t.node(-1),i=t.start(-1),o=ie.get(r);return{...e instanceof ae?o.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):o.findCell(t.pos-i),tableStart:i,map:o,table:r}}function wp(n,{map:e,tableStart:t,table:r},i){let o=i>0?-1:0;Tb(e,r,i+o)&&(o=i==0||i==e.width?null:0);for(let s=0;s<e.height;s++){const l=s*e.width+i;if(i>0&&i<e.width&&e.map[l-1]==e.map[l]){const a=e.map[l],u=r.nodeAt(a);n.setNodeMarkup(n.mapping.map(t+a),null,Eb(u.attrs,i-e.colCount(a))),s+=u.attrs.rowspan-1}else{const a=o==null?ot(r.type.schema).cell:r.nodeAt(e.map[l+o]).type,u=e.positionAt(s,i,r);n.insert(n.mapping.map(t+u),a.createAndFill())}}return n}function v5(n,e){if(!Lt(n))return!1;if(e){const t=hr(n);e(wp(n.tr,t,t.left))}return!0}function _5(n,e){if(!Lt(n))return!1;if(e){const t=hr(n);e(wp(n.tr,t,t.right))}return!0}function Bb(n,{map:e,table:t,tableStart:r},i){const o=n.mapping.maps.length;for(let s=0;s<e.height;){const l=s*e.width+i,a=e.map[l],u=t.nodeAt(a),c=u.attrs;if(i>0&&e.map[l-1]==a||i<e.width-1&&e.map[l+1]==a)n.setNodeMarkup(n.mapping.slice(o).map(r+a),null,In(c,i-e.colCount(a)));else{const f=n.mapping.slice(o).map(r+a);n.delete(f,f+u.nodeSize)}s+=c.rowspan}}function S5(n,e){if(!Lt(n))return!1;if(e){const t=hr(n),r=n.tr;if(t.left==0&&t.right==t.map.width)return!1;for(let i=t.right-1;Bb(r,t,i),i!=t.left;i--){const o=t.tableStart?r.doc.nodeAt(t.tableStart-1):r.doc;if(!o)throw RangeError("No table found");t.table=o,t.map=ie.get(o)}e(r)}return!0}function Vb(n,{map:e,table:t,tableStart:r},i){let o=0;for(let u=0;u<i;u++)o+=t.child(u).nodeSize;const s=o+t.child(i).nodeSize,l=n.mapping.maps.length;n.delete(o+r,s+r);const a=new Set;for(let u=0,c=i*e.width;u<e.width;u++,c++){const f=e.map[c];if(!a.has(f)){if(a.add(f),i>0&&f==e.map[c-e.width]){const h=t.nodeAt(f).attrs;n.setNodeMarkup(n.mapping.slice(l).map(f+r),null,{...h,rowspan:h.rowspan-1}),u+=h.colspan-1}else if(i<e.height&&f==e.map[c+e.width]){const h=t.nodeAt(f),p=h.attrs,d=h.type.create({...p,rowspan:h.attrs.rowspan-1},h.content),m=e.positionAt(i+1,u,t);n.insert(n.mapping.slice(l).map(r+m),d),u+=p.colspan-1}}}}function C5(n,e){if(!Lt(n))return!1;if(e){const t=hr(n),r=n.tr;if(t.top==0&&t.bottom==t.map.height)return!1;for(let i=t.bottom-1;Vb(r,t,i),i!=t.top;i--){const o=t.tableStart?r.doc.nodeAt(t.tableStart-1):r.doc;if(!o)throw RangeError("No table found");t.table=o,t.map=ie.get(t.table)}e(r)}return!0}function A5(n,e){return function(t,r){if(!Lt(t))return!1;const i=Io(t);if(i.nodeAfter.attrs[n]===e)return!1;if(r){const o=t.tr;t.selection instanceof ae?t.selection.forEachCell((s,l)=>{s.attrs[n]!==e&&o.setNodeMarkup(l,null,{...s.attrs,[n]:e})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[n]:e}),r(o)}return!0}}function Hb(n){return function(e,t){if(!Lt(e))return!1;if(t){const r=ot(e.schema),i=hr(e),o=e.tr,s=i.map.cellsInRect(n=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:n=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),l=s.map(a=>i.table.nodeAt(a));for(let a=0;a<s.length;a++)l[a].type==r.header_cell&&o.setNodeMarkup(i.tableStart+s[a],r.cell,l[a].attrs);if(o.steps.length==0)for(let a=0;a<s.length;a++)o.setNodeMarkup(i.tableStart+s[a],r.header_cell,l[a].attrs);t(o)}return!0}}function dc(n,e,t){const r=e.map.cellsInRect({left:0,top:0,right:n=="row"?e.map.width:1,bottom:n=="column"?e.map.height:1});for(let i=0;i<r.length;i++){const o=e.table.nodeAt(r[i]);if(o&&o.type!==t.header_cell)return!1}return!0}function na(n,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?Hb(n):function(t,r){if(!Lt(t))return!1;if(r){const i=ot(t.schema),o=hr(t),s=t.tr,l=dc("row",o,i),a=dc("column",o,i),c=(n==="column"?l:n==="row"?a:!1)?1:0,f=n=="column"?{left:0,top:c,right:1,bottom:o.map.height}:n=="row"?{left:c,top:0,right:o.map.width,bottom:1}:o,h=n=="column"?a?i.cell:i.header_cell:n=="row"?l?i.cell:i.header_cell:i.cell;o.map.cellsInRect(f).forEach(p=>{const d=p+o.tableStart,m=s.doc.nodeAt(d);m&&s.setNodeMarkup(d,h,m.attrs)}),r(s)}return!0}}na("row",{useDeprecatedLogic:!0});na("column",{useDeprecatedLogic:!0});na("cell",{useDeprecatedLogic:!0});function $b(n,e){if(e<0){const t=n.nodeBefore;if(t)return n.pos-t.nodeSize;for(let r=n.index(-1)-1,i=n.before();r>=0;r--){const o=n.node(-1).child(r),s=o.lastChild;if(s)return i-1-s.nodeSize;i-=o.nodeSize}}else{if(n.index()<n.parent.childCount-1)return n.pos+n.nodeAfter.nodeSize;const t=n.node(-1);for(let r=n.indexAfter(-1),i=n.after();r<t.childCount;r++){const o=t.child(r);if(o.childCount)return i+1;i+=o.nodeSize}}return null}function M5(n){return function(e,t){if(!Lt(e))return!1;const r=$b(Io(e),n);if(r==null)return!1;if(t){const i=e.doc.resolve(r);t(e.tr.setSelection(Z.between(i,Ob(i))).scrollIntoView())}return!0}}function O5(n,e){const t=n.selection.$anchor;for(let r=t.depth;r>0;r--)if(t.node(r).type.spec.tableRole=="table")return e&&e(n.tr.delete(t.before(r),t.after(r)).scrollIntoView()),!0;return!1}function Ai(n,e){const t=n.selection;if(!(t instanceof ae))return!1;if(e){const r=n.tr,i=ot(n.schema).cell.createAndFill().content;t.forEachCell((o,s)=>{o.content.eq(i)||r.replace(r.mapping.map(s+1),r.mapping.map(s+o.nodeSize-1),new P(i,0,0))}),r.docChanged&&e(r)}return!0}function qb(n){if(!n.size)return null;let{content:e,openStart:t,openEnd:r}=n;for(;e.childCount==1&&(t>0&&r>0||e.child(0).type.spec.tableRole=="table");)t--,r--,e=e.child(0).content;const i=e.child(0),o=i.type.spec.tableRole,s=i.type.schema,l=[];if(o=="row")for(let a=0;a<e.childCount;a++){let u=e.child(a).content;const c=a?0:Math.max(0,t-1),f=a<e.childCount-1?0:Math.max(0,r-1);(c||f)&&(u=fl(ot(s).row,new P(u,c,f)).content),l.push(u)}else if(o=="cell"||o=="header_cell")l.push(t||r?fl(ot(s).row,new P(e,t,r)).content:e);else return null;return jb(s,l)}function jb(n,e){const t=[];for(let i=0;i<e.length;i++){const o=e[i];for(let s=o.childCount-1;s>=0;s--){const{rowspan:l,colspan:a}=o.child(s).attrs;for(let u=i;u<i+l;u++)t[u]=(t[u]||0)+a}}let r=0;for(let i=0;i<t.length;i++)r=Math.max(r,t[i]);for(let i=0;i<t.length;i++)if(i>=e.length&&e.push(I.empty),t[i]<r){const o=ot(n).cell.createAndFill(),s=[];for(let l=t[i];l<r;l++)s.push(o);e[i]=e[i].append(I.from(s))}return{height:e.length,width:r,rows:e}}function fl(n,e){const t=n.createAndFill();return new Ch(t).replace(0,t.content.size,e).doc}function Wb({width:n,height:e,rows:t},r,i){if(n!=r){const o=[],s=[];for(let l=0;l<t.length;l++){const a=t[l],u=[];for(let c=o[l]||0,f=0;c<r;f++){let h=a.child(f%a.childCount);c+h.attrs.colspan>r&&(h=h.type.createChecked(In(h.attrs,h.attrs.colspan,c+h.attrs.colspan-r),h.content)),u.push(h),c+=h.attrs.colspan;for(let p=1;p<h.attrs.rowspan;p++)o[l+p]=(o[l+p]||0)+h.attrs.colspan}s.push(I.from(u))}t=s,n=r}if(e!=i){const o=[];for(let s=0,l=0;s<i;s++,l++){const a=[],u=t[l%e];for(let c=0;c<u.childCount;c++){let f=u.child(c);s+f.attrs.rowspan>i&&(f=f.type.create({...f.attrs,rowspan:Math.max(1,i-f.attrs.rowspan)},f.content)),a.push(f)}o.push(I.from(a))}t=o,e=i}return{width:n,height:e,rows:t}}function Ub(n,e,t,r,i,o,s){const l=n.doc.type.schema,a=ot(l);let u,c;if(i>e.width)for(let f=0,h=0;f<e.height;f++){const p=t.child(f);h+=p.nodeSize;const d=[];let m;p.lastChild==null||p.lastChild.type==a.cell?m=u||(u=a.cell.createAndFill()):m=c||(c=a.header_cell.createAndFill());for(let y=e.width;y<i;y++)d.push(m);n.insert(n.mapping.slice(s).map(h-1+r),d)}if(o>e.height){const f=[];for(let d=0,m=(e.height-1)*e.width;d<Math.max(e.width,i);d++){const y=d>=e.width?!1:t.nodeAt(e.map[m+d]).type==a.header_cell;f.push(y?c||(c=a.header_cell.createAndFill()):u||(u=a.cell.createAndFill()))}const h=a.row.create(null,I.from(f)),p=[];for(let d=e.height;d<o;d++)p.push(h);n.insert(n.mapping.slice(s).map(r+t.nodeSize-2),p)}return!!(u||c)}function mc(n,e,t,r,i,o,s,l){if(s==0||s==e.height)return!1;let a=!1;for(let u=i;u<o;u++){const c=s*e.width+u,f=e.map[c];if(e.map[c-e.width]==f){a=!0;const h=t.nodeAt(f),{top:p,left:d}=e.findCell(f);n.setNodeMarkup(n.mapping.slice(l).map(f+r),null,{...h.attrs,rowspan:s-p}),n.insert(n.mapping.slice(l).map(e.positionAt(s,d,t)),h.type.createAndFill({...h.attrs,rowspan:p+h.attrs.rowspan-s})),u+=h.attrs.colspan-1}}return a}function gc(n,e,t,r,i,o,s,l){if(s==0||s==e.width)return!1;let a=!1;for(let u=i;u<o;u++){const c=u*e.width+s,f=e.map[c];if(e.map[c-1]==f){a=!0;const h=t.nodeAt(f),p=e.colCount(f),d=n.mapping.slice(l).map(f+r);n.setNodeMarkup(d,null,In(h.attrs,s-p,h.attrs.colspan-(s-p))),n.insert(d+h.nodeSize,h.type.createAndFill(In(h.attrs,0,s-p))),u+=h.attrs.rowspan-1}}return a}function yc(n,e,t,r,i){let o=t?n.doc.nodeAt(t-1):n.doc;if(!o)throw new Error("No table found");let s=ie.get(o);const{top:l,left:a}=r,u=a+i.width,c=l+i.height,f=n.tr;let h=0;function p(){if(o=t?f.doc.nodeAt(t-1):f.doc,!o)throw new Error("No table found");s=ie.get(o),h=f.mapping.maps.length}Ub(f,s,o,t,u,c,h)&&p(),mc(f,s,o,t,a,u,l,h)&&p(),mc(f,s,o,t,a,u,c,h)&&p(),gc(f,s,o,t,l,c,a,h)&&p(),gc(f,s,o,t,l,c,u,h)&&p();for(let d=l;d<c;d++){const m=s.positionAt(d,a,o),y=s.positionAt(d,u,o);f.replace(f.mapping.slice(h).map(m+t),f.mapping.slice(h).map(y+t),new P(i.rows[d-l],0,0))}p(),f.setSelection(new ae(f.doc.resolve(t+s.positionAt(l,a,o)),f.doc.resolve(t+s.positionAt(c-1,u-1,o)))),e(f)}var Jb=zh({ArrowLeft:Mi("horiz",-1),ArrowRight:Mi("horiz",1),ArrowUp:Mi("vert",-1),ArrowDown:Mi("vert",1),"Shift-ArrowLeft":Oi("horiz",-1),"Shift-ArrowRight":Oi("horiz",1),"Shift-ArrowUp":Oi("vert",-1),"Shift-ArrowDown":Oi("vert",1),Backspace:Ai,"Mod-Backspace":Ai,Delete:Ai,"Mod-Delete":Ai});function $i(n,e,t){return t.eq(n.selection)?!1:(e&&e(n.tr.setSelection(t).scrollIntoView()),!0)}function Mi(n,e){return(t,r,i)=>{if(!i)return!1;const o=t.selection;if(o instanceof ae)return $i(t,r,j.near(o.$headCell,e));if(n!="horiz"&&!o.empty)return!1;const s=bp(i,n,e);if(s==null)return!1;if(n=="horiz")return $i(t,r,j.near(t.doc.resolve(o.head+e),e));{const l=t.doc.resolve(s),a=mp(l,n,e);let u;return a?u=j.near(a,1):e<0?u=j.near(t.doc.resolve(l.before(-1)),-1):u=j.near(t.doc.resolve(l.after(-1)),1),$i(t,r,u)}}}function Oi(n,e){return(t,r,i)=>{if(!i)return!1;const o=t.selection;let s;if(o instanceof ae)s=o;else{const a=bp(i,n,e);if(a==null)return!1;s=new ae(t.doc.resolve(a))}const l=mp(s.$headCell,n,e);return l?$i(t,r,new ae(s.$anchorCell,l)):!1}}function Kb(n,e){const t=n.state.doc,r=li(t.resolve(e));return r?(n.dispatch(n.state.tr.setSelection(new ae(r))),!0):!1}function Yb(n,e,t){if(!Lt(n.state))return!1;let r=qb(t);const i=n.state.selection;if(i instanceof ae){r||(r={width:1,height:1,rows:[I.from(fl(ot(n.state.schema).cell,t))]});const o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),l=ie.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return r=Wb(r,l.right-l.left,l.bottom-l.top),yc(n.state,n.dispatch,s,l,r),!0}else if(r){const o=Io(n.state),s=o.start(-1);return yc(n.state,n.dispatch,s,ie.get(o.node(-1)).findCell(o.pos-s),r),!0}else return!1}function Gb(n,e){var t;if(e.ctrlKey||e.metaKey)return;const r=wc(n,e.target);let i;if(e.shiftKey&&n.state.selection instanceof ae)o(n.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=li(n.state.selection.$anchor))!=null&&((t=ps(n,e))==null?void 0:t.pos)!=i.pos)o(i,e),e.preventDefault();else if(!r)return;function o(a,u){let c=ps(n,u);const f=Kt.getState(n.state)==null;if(!c||!ta(a,c))if(f)c=a;else return;const h=new ae(a,c);if(f||!n.state.selection.eq(h)){const p=n.state.tr.setSelection(h);f&&p.setMeta(Kt,a.pos),n.dispatch(p)}}function s(){n.root.removeEventListener("mouseup",s),n.root.removeEventListener("dragstart",s),n.root.removeEventListener("mousemove",l),Kt.getState(n.state)!=null&&n.dispatch(n.state.tr.setMeta(Kt,-1))}function l(a){const u=a,c=Kt.getState(n.state);let f;if(c!=null)f=n.state.doc.resolve(c);else if(wc(n,u.target)!=r&&(f=ps(n,e),!f))return s();f&&o(f,u)}n.root.addEventListener("mouseup",s),n.root.addEventListener("dragstart",s),n.root.addEventListener("mousemove",l)}function bp(n,e,t){if(!(n.state.selection instanceof Z))return null;const{$head:r}=n.state.selection;for(let i=r.depth-1;i>=0;i--){const o=r.node(i);if((t<0?r.index(i):r.indexAfter(i))!=(t<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){const l=r.before(i),a=e=="vert"?t>0?"down":"up":t>0?"right":"left";return n.endOfTextblock(a)?l:null}}return null}function wc(n,e){for(;e&&e!=n.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function ps(n,e){const t=n.posAtCoords({left:e.clientX,top:e.clientY});return t&&t?li(n.state.doc.resolve(t.pos)):null}var Zb=class{constructor(n,e){this.node=n,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),hl(n,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(n){return n.type!=this.node.type?!1:(this.node=n,hl(n,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(n){return n.type=="attributes"&&(n.target==this.table||this.colgroup.contains(n.target))}};function hl(n,e,t,r,i,o){var s;let l=0,a=!0,u=e.firstChild;const c=n.firstChild;if(c){for(let f=0,h=0;f<c.childCount;f++){const{colspan:p,colwidth:d}=c.child(f).attrs;for(let m=0;m<p;m++,h++){const y=i==h?o:d&&d[m],g=y?y+"px":"";l+=y||r,y||(a=!1),u?(u.style.width!=g&&(u.style.width=g),u=u.nextSibling):e.appendChild(document.createElement("col")).style.width=g}}for(;u;){const f=u.nextSibling;(s=u.parentNode)==null||s.removeChild(u),u=f}a?(t.style.width=l+"px",t.style.minWidth=""):(t.style.width="",t.style.minWidth=l+"px")}}var Xe=new fr("tableColumnResizing");function E5({handleWidth:n=5,cellMinWidth:e=25,View:t=Zb,lastColumnResizable:r=!0}={}){const i=new ri({key:Xe,state:{init(o,s){var l,a;const u=(a=(l=i.spec)==null?void 0:l.props)==null?void 0:a.nodeViews,c=ot(s.schema).table.name;return t&&u&&(u[c]=(f,h)=>new t(f,e,h)),new Xb(-1,!1)},apply(o,s){return s.apply(o)}},props:{attributes:o=>{const s=Xe.getState(o);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,s)=>{Qb(o,s,n,e,r)},mouseleave:o=>{ex(o)},mousedown:(o,s)=>{tx(o,s,e)}},decorations:o=>{const s=Xe.getState(o);if(s&&s.activeHandle>-1)return lx(o,s.activeHandle)},nodeViews:{}}});return i}var Xb=class qi{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(e){const t=this,r=e.getMeta(Xe);if(r&&r.setHandle!=null)return new qi(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new qi(t.activeHandle,r.setDragging);if(t.activeHandle>-1&&e.docChanged){let i=e.mapping.map(t.activeHandle,-1);return cl(e.doc.resolve(i))||(i=-1),new qi(i,t.dragging)}return t}};function Qb(n,e,t,r,i){const o=Xe.getState(n.state);if(o&&!o.dragging){const s=rx(e.target);let l=-1;if(s){const{left:a,right:u}=s.getBoundingClientRect();e.clientX-a<=t?l=bc(n,e,"left",t):u-e.clientX<=t&&(l=bc(n,e,"right",t))}if(l!=o.activeHandle){if(!i&&l!==-1){const a=n.state.doc.resolve(l),u=a.node(-1),c=ie.get(u),f=a.start(-1);if(c.colCount(a.pos-f)+a.nodeAfter.attrs.colspan-1==c.width-1)return}xp(n,l)}}}function ex(n){const e=Xe.getState(n.state);e&&e.activeHandle>-1&&!e.dragging&&xp(n,-1)}function tx(n,e,t){var r;const i=(r=n.dom.ownerDocument.defaultView)!=null?r:window,o=Xe.getState(n.state);if(!o||o.activeHandle==-1||o.dragging)return!1;const s=n.state.doc.nodeAt(o.activeHandle),l=nx(n,o.activeHandle,s.attrs);n.dispatch(n.state.tr.setMeta(Xe,{setDragging:{startX:e.clientX,startWidth:l}}));function a(c){i.removeEventListener("mouseup",a),i.removeEventListener("mousemove",u);const f=Xe.getState(n.state);f!=null&&f.dragging&&(ix(n,f.activeHandle,xc(f.dragging,c,t)),n.dispatch(n.state.tr.setMeta(Xe,{setDragging:null})))}function u(c){if(!c.which)return a(c);const f=Xe.getState(n.state);if(f&&f.dragging){const h=xc(f.dragging,c,t);ox(n,f.activeHandle,h,t)}}return i.addEventListener("mouseup",a),i.addEventListener("mousemove",u),e.preventDefault(),!0}function nx(n,e,{colspan:t,colwidth:r}){const i=r&&r[r.length-1];if(i)return i;const o=n.domAtPos(e);let l=o.node.childNodes[o.offset].offsetWidth,a=t;if(r)for(let u=0;u<t;u++)r[u]&&(l-=r[u],a--);return l/a}function rx(n){for(;n&&n.nodeName!="TD"&&n.nodeName!="TH";)n=n.classList&&n.classList.contains("ProseMirror")?null:n.parentNode;return n}function bc(n,e,t,r){const i=t=="right"?-r:r,o=n.posAtCoords({left:e.clientX+i,top:e.clientY});if(!o)return-1;const{pos:s}=o,l=li(n.state.doc.resolve(s));if(!l)return-1;if(t=="right")return l.pos;const a=ie.get(l.node(-1)),u=l.start(-1),c=a.map.indexOf(l.pos-u);return c%a.width==0?-1:u+a.map[c-1]}function xc(n,e,t){const r=e.clientX-n.startX;return Math.max(t,n.startWidth+r)}function xp(n,e){n.dispatch(n.state.tr.setMeta(Xe,{setHandle:e}))}function ix(n,e,t){const r=n.state.doc.resolve(e),i=r.node(-1),o=ie.get(i),s=r.start(-1),l=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,a=n.state.tr;for(let u=0;u<o.height;u++){const c=u*o.width+l;if(u&&o.map[c]==o.map[c-o.width])continue;const f=o.map[c],h=i.nodeAt(f).attrs,p=h.colspan==1?0:l-o.colCount(f);if(h.colwidth&&h.colwidth[p]==t)continue;const d=h.colwidth?h.colwidth.slice():sx(h.colspan);d[p]=t,a.setNodeMarkup(s+f,null,{...h,colwidth:d})}a.docChanged&&n.dispatch(a)}function ox(n,e,t,r){const i=n.state.doc.resolve(e),o=i.node(-1),s=i.start(-1),l=ie.get(o).colCount(i.pos-s)+i.nodeAfter.attrs.colspan-1;let a=n.domAtPos(i.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&hl(o,a.firstChild,a,r,l,t)}function sx(n){return Array(n).fill(0)}function lx(n,e){const t=[],r=n.doc.resolve(e),i=r.node(-1);if(!i)return re.empty;const o=ie.get(i),s=r.start(-1),l=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1;for(let a=0;a<o.height;a++){const u=l+a*o.width;if((l==o.width-1||o.map[u]!=o.map[u+1])&&(a==0||o.map[u]!=o.map[u-o.width])){const c=o.map[u],f=s+c+i.nodeAt(c).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",t.push(Re.widget(f,h))}}return re.create(n.doc,t)}function T5({allowTableNodeSelection:n=!1}={}){return new ri({key:Kt,state:{init(){return null},apply(e,t){const r=e.getMeta(Kt);if(r!=null)return r==-1?null:r;if(t==null||!e.docChanged)return t;const{deleted:i,pos:o}=e.mapping.mapResult(t);return i?null:o}},props:{decorations:Db,handleDOMEvents:{mousedown:Gb},createSelectionBetween(e){return Kt.getState(e.state)!=null?e.state.selection:null},handleTripleClick:Kb,handleKeyDown:Jb,handlePaste:Yb},appendTransaction(e,t,r){return Rb(r,Pb(r,t),n)}})}var co=typeof navigator<"u"?navigator:null,ra=co&&co.userAgent||"",ax=/Edge\/(\d+)/.exec(ra),ux=/MSIE \d/.exec(ra),cx=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ra),fx=!!(ux||cx||ax),hx=!fx&&!!co&&/Apple Computer/.test(co.vendor),kp=new fr("safari-ime-span"),pl=!1,px={key:kp,props:{decorations:dx,handleDOMEvents:{compositionstart:()=>{pl=!0},compositionend:()=>{pl=!1}}}};function dx(n){const{$from:e,$to:t,to:r}=n.selection;if(pl&&e.sameParent(t)){const i=Re.widget(r,mx,{ignoreSelection:!0,key:"safari-ime-span"});return re.create(n.doc,[i])}}function mx(n){const e=n.dom.ownerDocument.createElement("span");return e.className="ProseMirror-safari-ime-span",e}var N5=new ri(hx?px:{key:kp});function kc(n,e){const t=String(n);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=t.indexOf(e);for(;i!==-1;)r++,i=t.indexOf(e,i+e.length);return r}function gx(n,e,t){const i=So((t||{}).ignore||[]),o=yx(e);let s=-1;for(;++s<o.length;)nh(n,"text",l);function l(u,c){let f=-1,h;for(;++f<c.length;){const p=c[f],d=h?h.children:void 0;if(i(p,d?d.indexOf(p):void 0,h))return;h=p}if(h)return a(u,c)}function a(u,c){const f=c[c.length-1],h=o[s][0],p=o[s][1];let d=0;const y=f.children.indexOf(u);let g=!1,_=[];h.lastIndex=0;let x=h.exec(u.value);for(;x;){const S=x.index,M={index:x.index,input:x.input,stack:[...c,u]};let k=p(...x,M);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?h.lastIndex=S+1:(d!==S&&_.push({type:"text",value:u.value.slice(d,S)}),Array.isArray(k)?_.push(...k):k&&_.push(k),d=S+x[0].length,g=!0),!h.global)break;x=h.exec(u.value)}return g?(d<u.value.length&&_.push({type:"text",value:u.value.slice(d)}),f.children.splice(y,1,..._)):_=[u],y+_.length}}function yx(n){const e=[];if(!Array.isArray(n))throw new TypeError("Expected find and replace tuple or list of tuples");const t=!n[0]||Array.isArray(n[0])?n:[n];let r=-1;for(;++r<t.length;){const i=t[r];e.push([wx(i[0]),bx(i[1])])}return e}function wx(n){return typeof n=="string"?new RegExp(Do(n),"g"):n}function bx(n){return typeof n=="function"?n:function(){return n}}const ds="phrasing",ms=["autolink","link","image","label"];function xx(){return{transforms:[Mx],enter:{literalAutolink:vx,literalAutolinkEmail:gs,literalAutolinkHttp:gs,literalAutolinkWww:gs},exit:{literalAutolink:Ax,literalAutolinkEmail:Cx,literalAutolinkHttp:_x,literalAutolinkWww:Sx}}}function kx(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ds,notInConstruct:ms},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ds,notInConstruct:ms},{character:":",before:"[ps]",after:"\\/",inConstruct:ds,notInConstruct:ms}]}}function vx(n){this.enter({type:"link",title:null,url:"",children:[]},n)}function gs(n){this.config.enter.autolinkProtocol.call(this,n)}function _x(n){this.config.exit.autolinkProtocol.call(this,n)}function Sx(n){this.config.exit.data.call(this,n);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(n)}function Cx(n){this.config.exit.autolinkEmail.call(this,n)}function Ax(n){this.exit(n)}function Mx(n){gx(n,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Ox],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Ex]],{ignore:["link","linkReference"]})}function Ox(n,e,t,r,i){let o="";if(!vp(i)||(/^w/i.test(e)&&(t=e+t,e="",o="http://"),!Tx(t)))return!1;const s=Nx(t+r);if(!s[0])return!1;const l={type:"link",title:null,url:o+e+s[0],children:[{type:"text",value:e+s[0]}]};return s[1]?[l,{type:"text",value:s[1]}]:l}function Ex(n,e,t,r){return!vp(r,!0)||/[-\d_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+t,children:[{type:"text",value:e+"@"+t}]}}function Tx(n){const e=n.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function Nx(n){const e=/[!"&'),.:;<>?\]}]+$/.exec(n);if(!e)return[n,void 0];n=n.slice(0,e.index);let t=e[0],r=t.indexOf(")");const i=kc(n,"(");let o=kc(n,")");for(;r!==-1&&i>o;)n+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),o++;return[n,t]}function vp(n,e){const t=n.input.charCodeAt(n.index-1);return(n.index===0||Tn(t)||vo(t))&&(!e||t!==47)}_p.peek=$x;function Dx(){return{enter:{gfmFootnoteDefinition:zx,gfmFootnoteDefinitionLabelString:Rx,gfmFootnoteCall:Lx,gfmFootnoteCallString:Bx},exit:{gfmFootnoteDefinition:Px,gfmFootnoteDefinitionLabelString:Fx,gfmFootnoteCall:Hx,gfmFootnoteCallString:Vx}}}function Ix(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:qx,footnoteReference:_p}}}function zx(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function Rx(){this.buffer()}function Fx(n){const e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.label=e,t.identifier=ft(this.sliceSerialize(n)).toLowerCase()}function Px(n){this.exit(n)}function Lx(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function Bx(){this.buffer()}function Vx(n){const e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.label=e,t.identifier=ft(this.sliceSerialize(n)).toLowerCase()}function Hx(n){this.exit(n)}function _p(n,e,t,r){const i=t.createTracker(r);let o=i.move("[^");const s=t.enter("footnoteReference"),l=t.enter("reference");return o+=i.move(t.safe(t.associationId(n),{...i.current(),before:o,after:"]"})),l(),s(),o+=i.move("]"),o}function $x(){return"["}function qx(n,e,t,r){const i=t.createTracker(r);let o=i.move("[^");const s=t.enter("footnoteDefinition"),l=t.enter("label");return o+=i.move(t.safe(t.associationId(n),{...i.current(),before:o,after:"]"})),l(),o+=i.move("]:"+(n.children&&n.children.length>0?" ":"")),i.shift(4),o+=i.move(t.indentLines(t.containerFlow(n,i.current()),jx)),s(),o}function jx(n,e,t){return e===0?n:(t?"":" ")+n}const Wx=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Sp.peek=Gx;function Ux(){return{canContainEols:["delete"],enter:{strikethrough:Kx},exit:{strikethrough:Yx}}}function Jx(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Wx}],handlers:{delete:Sp}}}function Kx(n){this.enter({type:"delete",children:[]},n)}function Yx(n){this.exit(n)}function Sp(n,e,t,r){const i=t.createTracker(r),o=t.enter("strikethrough");let s=i.move("~~");return s+=t.containerPhrasing(n,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function Gx(){return"~"}function Zx(n,e={}){const t=(e.align||[]).concat(),r=e.stringLength||Qx,i=[],o=[],s=[],l=[];let a=0,u=-1;for(;++u<n.length;){const d=[],m=[];let y=-1;for(n[u].length>a&&(a=n[u].length);++y<n[u].length;){const g=Xx(n[u][y]);if(e.alignDelimiters!==!1){const _=r(g);m[y]=_,(l[y]===void 0||_>l[y])&&(l[y]=_)}d.push(g)}o[u]=d,s[u]=m}let c=-1;if(typeof t=="object"&&"length"in t)for(;++c<a;)i[c]=vc(t[c]);else{const d=vc(t);for(;++c<a;)i[c]=d}c=-1;const f=[],h=[];for(;++c<a;){const d=i[c];let m="",y="";d===99?(m=":",y=":"):d===108?m=":":d===114&&(y=":");let g=e.alignDelimiters===!1?1:Math.max(1,l[c]-m.length-y.length);const _=m+"-".repeat(g)+y;e.alignDelimiters!==!1&&(g=m.length+g+y.length,g>l[c]&&(l[c]=g),h[c]=g),f[c]=_}o.splice(1,0,f),s.splice(1,0,h),u=-1;const p=[];for(;++u<o.length;){const d=o[u],m=s[u];c=-1;const y=[];for(;++c<a;){const g=d[c]||"";let _="",x="";if(e.alignDelimiters!==!1){const S=l[c]-(m[c]||0),M=i[c];M===114?_=" ".repeat(S):M===99?S%2?(_=" ".repeat(S/2+.5),x=" ".repeat(S/2-.5)):(_=" ".repeat(S/2),x=_):x=" ".repeat(S)}e.delimiterStart!==!1&&!c&&y.push("|"),e.padding!==!1&&!(e.alignDelimiters===!1&&g==="")&&(e.delimiterStart!==!1||c)&&y.push(" "),e.alignDelimiters!==!1&&y.push(_),y.push(g),e.alignDelimiters!==!1&&y.push(x),e.padding!==!1&&y.push(" "),(e.delimiterEnd!==!1||c!==a-1)&&y.push("|")}p.push(e.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return p.join(` |
| 67 |
`)}function Xx(n){return n==null?"":String(n)}function Qx(n){return n.length}function vc(n){const e=typeof n=="string"?n.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function e8(){return{enter:{table:t8,tableData:_c,tableHeader:_c,tableRow:r8},exit:{codeText:i8,table:n8,tableData:ys,tableHeader:ys,tableRow:ys}}}function t8(n){const e=n._align;this.enter({type:"table",align:e.map(function(t){return t==="none"?null:t}),children:[]},n),this.data.inTable=!0}function n8(n){this.exit(n),this.data.inTable=void 0}function r8(n){this.enter({type:"tableRow",children:[]},n)}function ys(n){this.exit(n)}function _c(n){this.enter({type:"tableCell",children:[]},n)}function i8(n){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,o8));const t=this.stack[this.stack.length-1];t.type,t.value=e,this.exit(n)}function o8(n,e){return e==="|"?e:n}function s8(n){const e=n||{},t=e.tableCellPadding,r=e.tablePipeAlign,i=e.stringLength,o=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` |
| 68 |
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:a,tableRow:l}};function s(p,d,m,y){return u(c(p,m,y),p.align)}function l(p,d,m,y){const g=f(p,m,y),_=u([g]);return _.slice(0,_.indexOf(` |
| 69 |
`))}function a(p,d,m,y){const g=m.enter("tableCell"),_=m.enter("phrasing"),x=m.containerPhrasing(p,{...y,before:o,after:o});return _(),g(),x}function u(p,d){return Zx(p,{align:d,alignDelimiters:r,padding:t,stringLength:i})}function c(p,d,m){const y=p.children;let g=-1;const _=[],x=d.enter("table");for(;++g<y.length;)_[g]=f(y[g],d,m);return x(),_}function f(p,d,m){const y=p.children;let g=-1;const _=[],x=d.enter("tableRow");for(;++g<y.length;)_[g]=a(y[g],p,d,m);return x(),_}function h(p,d,m){let y=Vl.inlineCode(p,d,m);return m.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function l8(){return{exit:{taskListCheckValueChecked:Sc,taskListCheckValueUnchecked:Sc,paragraph:u8}}}function a8(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:c8}}}function Sc(n){const e=this.stack[this.stack.length-2];e.type,e.checked=n.type==="taskListCheckValueChecked"}function u8(n){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const t=this.stack[this.stack.length-1];t.type;const r=t.children[0];if(r&&r.type==="text"){const i=e.children;let o=-1,s;for(;++o<i.length;){const l=i[o];if(l.type==="paragraph"){s=l;break}}s===t&&(r.value=r.value.slice(1),r.value.length===0?t.children.shift():t.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,t.position.start=Object.assign({},r.position.start)))}}this.exit(n)}function c8(n,e,t,r){const i=n.children[0],o=typeof n.checked=="boolean"&&i&&i.type==="paragraph",s="["+(n.checked?"x":" ")+"] ",l=t.createTracker(r);o&&l.move(s);let a=Vl.listItem(n,e,t,{...r,...l.current()});return o&&(a=a.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),a;function u(c){return c+s}}function f8(){return[xx(),Dx(),Ux(),e8(),l8()]}function h8(n){return{extensions:[kx(),Ix(),Jx(),s8(n),a8()]}}const p8={tokenize:b8,partial:!0},Cp={tokenize:x8,partial:!0},Ap={tokenize:k8,partial:!0},Mp={tokenize:v8,partial:!0},d8={tokenize:_8,partial:!0},Op={name:"wwwAutolink",tokenize:y8,previous:Tp},Ep={name:"protocolAutolink",tokenize:w8,previous:Np},Bt={name:"emailAutolink",tokenize:g8,previous:Dp},Ct={};function m8(){return{text:Ct}}let pn=48;for(;pn<123;)Ct[pn]=Bt,pn++,pn===58?pn=65:pn===91&&(pn=97);Ct[43]=Bt;Ct[45]=Bt;Ct[46]=Bt;Ct[95]=Bt;Ct[72]=[Bt,Ep];Ct[104]=[Bt,Ep];Ct[87]=[Bt,Op];Ct[119]=[Bt,Op];function g8(n,e,t){const r=this;let i,o;return s;function s(f){return!dl(f)||!Dp.call(r,r.previous)||ia(r.events)?t(f):(n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),l(f))}function l(f){return dl(f)?(n.consume(f),l):f===64?(n.consume(f),a):t(f)}function a(f){return f===46?n.check(d8,c,u)(f):f===45||f===95||ze(f)?(o=!0,n.consume(f),a):c(f)}function u(f){return n.consume(f),i=!0,a}function c(f){return o&&i&&Me(r.previous)?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),e(f)):t(f)}}function y8(n,e,t){const r=this;return i;function i(s){return s!==87&&s!==119||!Tp.call(r,r.previous)||ia(r.events)?t(s):(n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(p8,n.attempt(Cp,n.attempt(Ap,o),t),t)(s))}function o(s){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),e(s)}}function w8(n,e,t){const r=this;let i="",o=!1;return s;function s(f){return(f===72||f===104)&&Np.call(r,r.previous)&&!ia(r.events)?(n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),n.consume(f),l):t(f)}function l(f){if(Me(f)&&i.length<5)return i+=String.fromCodePoint(f),n.consume(f),l;if(f===58){const h=i.toLowerCase();if(h==="http"||h==="https")return n.consume(f),a}return t(f)}function a(f){return f===47?(n.consume(f),o?u:(o=!0,a)):t(f)}function u(f){return f===null||no(f)||te(f)||Tn(f)||vo(f)?t(f):n.attempt(Cp,n.attempt(Ap,c),t)(f)}function c(f){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),e(f)}}function b8(n,e,t){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,n.consume(s),i):s===46&&r===3?(n.consume(s),o):t(s)}function o(s){return s===null?t(s):e(s)}}function x8(n,e,t){let r,i,o;return s;function s(u){return u===46||u===95?n.check(Mp,a,l)(u):u===null||te(u)||Tn(u)||u!==45&&vo(u)?a(u):(o=!0,n.consume(u),s)}function l(u){return u===95?r=!0:(i=r,r=void 0),n.consume(u),s}function a(u){return i||r||!o?t(u):e(u)}}function k8(n,e){let t=0,r=0;return i;function i(s){return s===40?(t++,n.consume(s),i):s===41&&r<t?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?n.check(Mp,e,o)(s):s===null||te(s)||Tn(s)?e(s):(n.consume(s),i)}function o(s){return s===41&&r++,n.consume(s),i}}function v8(n,e,t){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(n.consume(l),r):l===38?(n.consume(l),o):l===93?(n.consume(l),i):l===60||l===null||te(l)||Tn(l)?e(l):t(l)}function i(l){return l===null||l===40||l===91||te(l)||Tn(l)?e(l):r(l)}function o(l){return Me(l)?s(l):t(l)}function s(l){return l===59?(n.consume(l),r):Me(l)?(n.consume(l),s):t(l)}}function _8(n,e,t){return r;function r(o){return n.consume(o),i}function i(o){return ze(o)?t(o):e(o)}}function Tp(n){return n===null||n===40||n===42||n===95||n===91||n===93||n===126||te(n)}function Np(n){return!Me(n)}function Dp(n){return!(n===47||dl(n))}function dl(n){return n===43||n===45||n===46||n===95||ze(n)}function ia(n){let e=n.length,t=!1;for(;e--;){const r=n[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){t=!0;break}if(r._gfmAutolinkLiteralWalkedInto){t=!1;break}}return n.length>0&&!t&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const S8={tokenize:D8,partial:!0};function C8(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:E8,continuation:{tokenize:T8},exit:N8}},text:{91:{name:"gfmFootnoteCall",tokenize:O8},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:A8,resolveTo:M8}}}}function A8(n,e,t){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const a=r.events[i][1];if(a.type==="labelImage"){s=a;break}if(a.type==="gfmFootnoteCall"||a.type==="labelLink"||a.type==="label"||a.type==="image"||a.type==="link")break}return l;function l(a){if(!s||!s._balanced)return t(a);const u=ft(r.sliceSerialize({start:s.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?t(a):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(a),n.exit("gfmFootnoteCallLabelMarker"),e(a))}}function M8(n,e){let t=n.length;for(;t--;)if(n[t][1].type==="labelImage"&&n[t][0]==="enter"){n[t][1];break}n[t+1][1].type="data",n[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},n[t+3][1].start),end:Object.assign({},n[n.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},n[t+3][1].end),end:Object.assign({},n[t+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},n[n.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},l=[n[t+1],n[t+2],["enter",r,e],n[t+3],n[t+4],["enter",i,e],["exit",i,e],["enter",o,e],["enter",s,e],["exit",s,e],["exit",o,e],n[n.length-2],n[n.length-1],["exit",r,e]];return n.splice(t,n.length-t+1,...l),n}function O8(n,e,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return l;function l(f){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(f),n.exit("gfmFootnoteCallLabelMarker"),a}function a(f){return f!==94?t(f):(n.enter("gfmFootnoteCallMarker"),n.consume(f),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",u)}function u(f){if(o>999||f===93&&!s||f===null||f===91||te(f))return t(f);if(f===93){n.exit("chunkString");const h=n.exit("gfmFootnoteCallString");return i.includes(ft(r.sliceSerialize(h)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(f),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),e):t(f)}return te(f)||(s=!0),o++,n.consume(f),f===92?c:u}function c(f){return f===91||f===92||f===93?(n.consume(f),o++,u):u(f)}}function E8(n,e,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,l;return a;function a(d){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(d),n.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(d){return d===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(d),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",c):t(d)}function c(d){if(s>999||d===93&&!l||d===null||d===91||te(d))return t(d);if(d===93){n.exit("chunkString");const m=n.exit("gfmFootnoteDefinitionLabelString");return o=ft(r.sliceSerialize(m)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(d),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),h}return te(d)||(l=!0),s++,n.consume(d),d===92?f:c}function f(d){return d===91||d===92||d===93?(n.consume(d),s++,c):c(d)}function h(d){return d===58?(n.enter("definitionMarker"),n.consume(d),n.exit("definitionMarker"),i.includes(o)||i.push(o),X(n,p,"gfmFootnoteDefinitionWhitespace")):t(d)}function p(d){return e(d)}}function T8(n,e,t){return n.check(ti,e,n.attempt(S8,e,t))}function N8(n){n.exit("gfmFootnoteDefinition")}function D8(n,e,t){const r=this;return X(n,i,"gfmFootnoteDefinitionIndent",4+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?e(o):t(o)}}function I8(n){let t=(n||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,l){let a=-1;for(;++a<s.length;)if(s[a][0]==="enter"&&s[a][1].type==="strikethroughSequenceTemporary"&&s[a][1]._close){let u=a;for(;u--;)if(s[u][0]==="exit"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._open&&s[a][1].end.offset-s[a][1].start.offset===s[u][1].end.offset-s[u][1].start.offset){s[a][1].type="strikethroughSequence",s[u][1].type="strikethroughSequence";const c={type:"strikethrough",start:Object.assign({},s[u][1].start),end:Object.assign({},s[a][1].end)},f={type:"strikethroughText",start:Object.assign({},s[u][1].end),end:Object.assign({},s[a][1].start)},h=[["enter",c,l],["enter",s[u][1],l],["exit",s[u][1],l],["enter",f,l]],p=l.parser.constructs.insideSpan.null;p&&et(h,h.length,0,_o(p,s.slice(u+1,a),l)),et(h,h.length,0,[["exit",f,l],["enter",s[a][1],l],["exit",s[a][1],l],["exit",c,l]]),et(s,u-1,a-u+3,h),a=u+h.length-2;break}}for(a=-1;++a<s.length;)s[a][1].type==="strikethroughSequenceTemporary"&&(s[a][1].type="data");return s}function o(s,l,a){const u=this.previous,c=this.events;let f=0;return h;function h(d){return u===126&&c[c.length-1][1].type!=="characterEscape"?a(d):(s.enter("strikethroughSequenceTemporary"),p(d))}function p(d){const m=ro(u);if(d===126)return f>1?a(d):(s.consume(d),f++,p);if(f<2&&!t)return a(d);const y=s.exit("strikethroughSequenceTemporary"),g=ro(d);return y._open=!g||g===2&&!!m,y._close=!m||m===2&&!!g,l(d)}}}class z8{constructor(){this.map=[]}add(e,t,r){R8(this,e,t,r)}consume(e){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];r.push([...e]),e.length=0;let i=r.pop();for(;i;)e.push(...i),i=r.pop();this.map.length=0}}function R8(n,e,t,r){let i=0;if(!(t===0&&r.length===0)){for(;i<n.map.length;){if(n.map[i][0]===e){n.map[i][1]+=t,n.map[i][2].push(...r);return}i+=1}n.map.push([e,t,r])}}function F8(n,e){let t=!1;const r=[];for(;e<n.length;){const i=n[e];if(t){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(n[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(n[e-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(t=!0);e+=1}return r}function P8(){return{flow:{null:{name:"table",tokenize:L8,resolveAll:B8}}}}function L8(n,e,t){const r=this;let i=0,o=0,s;return l;function l(v){let z=r.events.length-1;for(;z>-1;){const W=r.events[z][1].type;if(W==="lineEnding"||W==="linePrefix")z--;else break}const D=z>-1?r.events[z][1].type:null,B=D==="tableHead"||D==="tableRow"?k:a;return B===k&&r.parser.lazy[r.now().line]?t(v):B(v)}function a(v){return n.enter("tableHead"),n.enter("tableRow"),u(v)}function u(v){return v===124||(s=!0,o+=1),c(v)}function c(v){return v===null?t(v):V(v)?o>1?(o=0,r.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(v),n.exit("lineEnding"),p):t(v):J(v)?X(n,c,"whitespace")(v):(o+=1,s&&(s=!1,i+=1),v===124?(n.enter("tableCellDivider"),n.consume(v),n.exit("tableCellDivider"),s=!0,c):(n.enter("data"),f(v)))}function f(v){return v===null||v===124||te(v)?(n.exit("data"),c(v)):(n.consume(v),v===92?h:f)}function h(v){return v===92||v===124?(n.consume(v),f):f(v)}function p(v){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(v):(n.enter("tableDelimiterRow"),s=!1,J(v)?X(n,d,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):d(v))}function d(v){return v===45||v===58?y(v):v===124?(s=!0,n.enter("tableCellDivider"),n.consume(v),n.exit("tableCellDivider"),m):M(v)}function m(v){return J(v)?X(n,y,"whitespace")(v):y(v)}function y(v){return v===58?(o+=1,s=!0,n.enter("tableDelimiterMarker"),n.consume(v),n.exit("tableDelimiterMarker"),g):v===45?(o+=1,g(v)):v===null||V(v)?S(v):M(v)}function g(v){return v===45?(n.enter("tableDelimiterFiller"),_(v)):M(v)}function _(v){return v===45?(n.consume(v),_):v===58?(s=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(v),n.exit("tableDelimiterMarker"),x):(n.exit("tableDelimiterFiller"),x(v))}function x(v){return J(v)?X(n,S,"whitespace")(v):S(v)}function S(v){return v===124?d(v):v===null||V(v)?!s||i!==o?M(v):(n.exit("tableDelimiterRow"),n.exit("tableHead"),e(v)):M(v)}function M(v){return t(v)}function k(v){return n.enter("tableRow"),F(v)}function F(v){return v===124?(n.enter("tableCellDivider"),n.consume(v),n.exit("tableCellDivider"),F):v===null||V(v)?(n.exit("tableRow"),e(v)):J(v)?X(n,F,"whitespace")(v):(n.enter("data"),L(v))}function L(v){return v===null||v===124||te(v)?(n.exit("data"),F(v)):(n.consume(v),v===92?N:L)}function N(v){return v===92||v===124?(n.consume(v),L):L(v)}}function B8(n,e){let t=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],l=!1,a=0,u,c,f;const h=new z8;for(;++t<n.length;){const p=n[t],d=p[1];p[0]==="enter"?d.type==="tableHead"?(l=!1,a!==0&&(Cc(h,e,a,u,c),c=void 0,a=0),u={type:"table",start:Object.assign({},d.start),end:Object.assign({},d.end)},h.add(t,0,[["enter",u,e]])):d.type==="tableRow"||d.type==="tableDelimiterRow"?(r=!0,f=void 0,o=[0,0,0,0],s=[0,t+1,0,0],l&&(l=!1,c={type:"tableBody",start:Object.assign({},d.start),end:Object.assign({},d.end)},h.add(t,0,[["enter",c,e]])),i=d.type==="tableDelimiterRow"?2:c?3:1):i&&(d.type==="data"||d.type==="tableDelimiterMarker"||d.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],f=Ei(h,e,o,i,void 0,f),o=[0,0,0,0]),s[2]=t)):d.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],f=Ei(h,e,o,i,void 0,f)),o=s,s=[o[1],t,0,0])):d.type==="tableHead"?(l=!0,a=t):d.type==="tableRow"||d.type==="tableDelimiterRow"?(a=t,o[1]!==0?(s[0]=s[1],f=Ei(h,e,o,i,t,f)):s[1]!==0&&(f=Ei(h,e,s,i,t,f)),i=0):i&&(d.type==="data"||d.type==="tableDelimiterMarker"||d.type==="tableDelimiterFiller")&&(s[3]=t)}for(a!==0&&Cc(h,e,a,u,c),h.consume(e.events),t=-1;++t<e.events.length;){const p=e.events[t];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=F8(e.events,t))}return n}function Ei(n,e,t,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";t[0]!==0&&(o.end=Object.assign({},Wn(e.events,t[0])),n.add(t[0],0,[["exit",o,e]]));const a=Wn(e.events,t[1]);if(o={type:s,start:Object.assign({},a),end:Object.assign({},a)},n.add(t[1],0,[["enter",o,e]]),t[2]!==0){const u=Wn(e.events,t[2]),c=Wn(e.events,t[3]),f={type:l,start:Object.assign({},u),end:Object.assign({},c)};if(n.add(t[2],0,[["enter",f,e]]),r!==2){const h=e.events[t[2]],p=e.events[t[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",t[3]>t[2]+1){const d=t[2]+1,m=t[3]-t[2]-1;n.add(d,m,[])}}n.add(t[3]+1,0,[["exit",f,e]])}return i!==void 0&&(o.end=Object.assign({},Wn(e.events,i)),n.add(i,0,[["exit",o,e]]),o=void 0),o}function Cc(n,e,t,r,i){const o=[],s=Wn(e.events,t);i&&(i.end=Object.assign({},s),o.push(["exit",i,e])),r.end=Object.assign({},s),o.push(["exit",r,e]),n.add(t+1,0,o)}function Wn(n,e){const t=n[e],r=t[0]==="enter"?"start":"end";return t[1][r]}const V8={name:"tasklistCheck",tokenize:$8};function H8(){return{text:{91:V8}}}function $8(n,e,t){const r=this;return i;function i(a){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(a):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(a),n.exit("taskListCheckMarker"),o)}function o(a){return te(a)?(n.enter("taskListCheckValueUnchecked"),n.consume(a),n.exit("taskListCheckValueUnchecked"),s):a===88||a===120?(n.enter("taskListCheckValueChecked"),n.consume(a),n.exit("taskListCheckValueChecked"),s):t(a)}function s(a){return a===93?(n.enter("taskListCheckMarker"),n.consume(a),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),l):t(a)}function l(a){return V(a)?e(a):J(a)?n.check({tokenize:q8},e,t)(a):t(a)}}function q8(n,e,t){return X(n,r,"whitespace");function r(i){return i===null?t(i):e(i)}}function j8(n){return Lf([m8(),C8(),I8(n),P8(),H8()])}const W8={};function D5(n){const e=this,t=n||W8,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(j8(t)),o.push(f8()),s.push(h8(t))}var fo=200,fe=function(){};fe.prototype.append=function(e){return e.length?(e=fe.from(e),!this.length&&e||e.length<fo&&this.leafAppend(e)||this.length<fo&&e.leafPrepend(this)||this.appendInner(e)):this};fe.prototype.prepend=function(e){return e.length?fe.from(e).append(this):this};fe.prototype.appendInner=function(e){return new U8(this,e)};fe.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?fe.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};fe.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};fe.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)};fe.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},t,r),i};fe.from=function(e){return e instanceof fe?e:e&&e.length?new Ip(e):fe.empty};var Ip=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,s,l){for(var a=o;a<s;a++)if(i(this.values[a],l+a)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,s,l){for(var a=o-1;a>=s;a--)if(i(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=fo)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=fo)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}(fe);fe.empty=new Ip([]);var U8=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,s){var l=this.left.length;if(i<l&&this.left.forEachInner(r,i,Math.min(o,l),s)===!1||o>l&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o<l&&this.left.forEachInvertedInner(r,Math.min(i,l),o,s)===!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}(fe);const J8=500;class ut{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 s=e.tr,l,a,u=[],c=[];return this.items.forEach((f,h)=>{if(!f.step){i||(i=this.remapping(r,h+1),o=i.maps.length),o--,c.push(f);return}if(i){c.push(new yt(f.map));let p=f.step.map(i.slice(o)),d;p&&s.maybeStep(p).doc&&(d=s.mapping.maps[s.mapping.maps.length-1],u.push(new yt(d,void 0,void 0,u.length+c.length))),o--,d&&i.appendMap(d,o)}else s.maybeStep(f.step);if(f.selection)return l=i?f.selection.map(i.slice(o)):f.selection,a=new ut(this.items.slice(0,r).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:s,selection:l}}addTransform(e,t,r,i){let o=[],s=this.eventCount,l=this.items,a=!i&&l.length?l.get(l.length-1):null;for(let c=0;c<e.steps.length;c++){let f=e.steps[c].invert(e.docs[c]),h=new yt(e.mapping.maps[c],f,t),p;(p=a&&a.merge(h))&&(h=p,c?o.pop():l=l.slice(0,l.length-1)),o.push(h),t&&(s++,t=void 0),i||(a=h)}let u=s-r.depth;return u>Y8&&(l=K8(l,u),s-=u),new ut(l.append(o),s)}remapping(e,t){let r=new Jn;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,t),r}addMaps(e){return this.eventCount==0?this:new ut(this.items.append(e.map(t=>new yt(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(h=>{h.selection&&l--},i);let a=t;this.items.forEach(h=>{let p=o.getMirror(--a);if(p==null)return;s=Math.min(s,p);let d=o.maps[p];if(h.step){let m=e.steps[p].invert(e.docs[p]),y=h.selection&&h.selection.map(o.slice(a+1,p));y&&l++,r.push(new yt(d,m,y))}else r.push(new yt(d))},i);let u=[];for(let h=t;h<s;h++)u.push(new yt(o.maps[h]));let c=this.items.slice(0,i).append(u).append(r),f=new ut(c,l);return f.emptyItemCount()>J8&&(f=f.compress(this.items.length-r.length)),f}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((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let a=s.step.map(t.slice(r)),u=a&&a.getMap();if(r--,u&&t.appendMap(u,r),a){let c=s.selection&&s.selection.map(t.slice(r));c&&o++;let f=new yt(u.invert(),a,c),h,p=i.length-1;(h=i.length&&i[p].merge(f))?i[p]=h:i.push(f)}}else s.map&&r--},this.items.length,0),new ut(fe.from(i.reverse()),o)}}ut.empty=new ut(fe.empty,0);function K8(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class yt{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 yt(t.getMap().invert(),t,this.selection)}}}class Ut{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const Y8=20;function G8(n,e,t,r){let i=t.getMeta(On),o;if(i)return i.historyState;t.getMeta(Q8)&&(n=new Ut(n.done,n.undone,null,0,-1));let s=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(s&&s.getMeta(On))return s.getMeta(On).redo?new Ut(n.done.addTransform(t,void 0,r,ji(e)),n.undone,Ac(t.mapping.maps),n.prevTime,n.prevComposition):new Ut(n.done,n.undone.addTransform(t,void 0,r,ji(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),a=n.prevTime==0||!s&&n.prevComposition!=l&&(n.prevTime<(t.time||0)-r.newGroupDelay||!Z8(t,n.prevRanges)),u=s?ws(n.prevRanges,t.mapping):Ac(t.mapping.maps);return new Ut(n.done.addTransform(t,a?e.selection.getBookmark():void 0,r,ji(e)),ut.empty,u,t.time,l??n.prevComposition)}else return(o=t.getMeta("rebased"))?new Ut(n.done.rebased(t,o),n.undone.rebased(t,o),ws(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new Ut(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),ws(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function Z8(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 Ac(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,i,o,s)=>e.push(o,s));return e}function ws(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 X8(n,e,t){let r=ji(e),i=On.get(e).spec.config,o=(t?n.undone:n.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),l=(t?n.done:n.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),a=new Ut(t?l:o.remaining,t?o.remaining:l,null,0,-1);return o.transform.setSelection(s).setMeta(On,{redo:t,historyState:a})}let bs=!1,Mc=null;function ji(n){let e=n.plugins;if(Mc!=e){bs=!1,Mc=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){bs=!0;break}}return bs}const On=new fr("history"),Q8=new fr("closeHistory");function I5(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new ri({key:On,state:{init(){return new Ut(ut.empty,ut.empty,null,0,-1)},apply(e,t,r){return G8(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?ek:r=="historyRedo"?tk:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function zp(n,e){return(t,r)=>{let i=On.getState(t);if(!i||(n?i.undone:i.done).eventCount==0)return!1;if(r){let o=X8(i,t,n);o&&r(e?o.scrollIntoView():o)}return!0}}const ek=zp(!1,!0),tk=zp(!0,!0);let z5=(n=21)=>crypto.getRandomValues(new Uint8Array(n)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");var xn,Gn;class nk{constructor(e){Po(this,xn,void 0);Po(this,Gn,new Set);Lo(this,xn,e)}get current(){return Pn(this,xn)}set current(e){Pn(this,xn)!=e&&(Lo(this,xn,e),Pn(this,Gn).forEach(t=>t(e)))}on(e){return Pn(this,Gn).add(e),()=>Pn(this,Gn).delete(e)}}xn=new WeakMap,Gn=new WeakMap;const Rp=n=>new nk(n),ml=Symbol.for("atomico.hooks");globalThis[ml]=globalThis[ml]||{};let ar=globalThis[ml];const rk=Symbol.for("Atomico.suspense"),Fp=Symbol.for("Atomico.effect"),ik=Symbol.for("Atomico.layoutEffect"),Pp=Symbol.for("Atomico.insertionEffect"),ai=(n,e,t)=>{const{i:r,hooks:i}=ar.c,o=i[r]=i[r]||{};return o.value=n(o.value),o.effect=e,o.tag=t,ar.c.i++,i[r].value},ok=n=>ai((e=Rp(n))=>e),sk=()=>ai((n=Rp(ar.c.host))=>n),lk=()=>ar.c.update,ak=(n,e,t=0)=>{let r={},i=!1;const o=()=>i,s=(u,c)=>{for(const f in r){const h=r[f];h.effect&&h.tag===u&&(h.value=h.effect(h.value,c))}};return{load:u=>{ar.c={host:e,hooks:r,update:n,i:0,id:t};let c;try{i=!1,c=u()}catch(f){if(f!==rk)throw f;i=!0}finally{ar.c=null}return c},cleanEffects:u=>(s(Pp,u),()=>(s(ik,u),()=>{s(Fp,u)})),isSuspense:o}},ui=Symbol.for;function Lp(n,e){const t=n.length;if(t!==e.length)return!1;for(let r=0;r<t;r++){let i=n[r],o=e[r];if(i!==o)return!1}return!0}const Dt=n=>typeof n=="function",Br=n=>typeof n=="object",{isArray:uk}=Array,gl=(n,e)=>(e?n instanceof HTMLStyleElement:!0)&&"hydrate"in((n==null?void 0:n.dataset)||{});function Bp(n,e){let t;const r=i=>{let{length:o}=i;for(let s=0;s<o;s++){const l=i[s];if(l&&Array.isArray(l))r(l);else{const a=typeof l;if(l==null||a==="function"||a==="boolean")continue;a==="string"||a==="number"?(t==null&&(t=""),t+=l):(t!=null&&(e(t),t=null),e(l))}}};r(n),t!=null&&e(t)}const Vp=(n,e,t)=>(n.addEventListener(e,t),()=>n.removeEventListener(e,t));let Hp=class{constructor(e,t,r){this.message=t,this.target=e,this.value=r}};class ck extends Hp{}class fk extends Hp{}const ho="Custom",hk=null,pk={true:1,"":1,1:1};function dk(n,e,t,r,i){const{type:o,reflect:s,event:l,value:a,attr:u=gk(e)}=(t==null?void 0:t.name)!=ho&&Br(t)&&t!=hk?t:{type:t},c=(o==null?void 0:o.name)===ho&&o.map,f=a!=null?o==Function||!Dt(a)?()=>a:a:null;Object.defineProperty(n,e,{configurable:!0,set(h){const p=this[e];f&&o!=Boolean&&h==null&&(h=f());const{error:d,value:m}=(c?bk:xk)(o,h);if(d&&m!=null)throw new ck(this,`The value defined for prop '${e}' must be of type '${o.name}'`,m);p!=m&&(this._props[e]=m??void 0,this.update(),l&&mk(this,l),this.updated.then(()=>{s&&(this._ignoreAttr=u,yk(this,o,u,this[e]),this._ignoreAttr=null)}))},get(){return this._props[e]}}),f&&(i[e]=f()),r[u]={prop:e,type:o}}const mk=(n,{type:e,base:t=CustomEvent,...r})=>n.dispatchEvent(new t(e,r)),gk=n=>n.replace(/([A-Z])/g,"-$1").toLowerCase(),yk=(n,e,t,r)=>r==null||e==Boolean&&!r?n.removeAttribute(t):n.setAttribute(t,(e==null?void 0:e.name)===ho&&(e!=null&&e.serialize)?e==null?void 0:e.serialize(r):Br(r)?JSON.stringify(r):e==Boolean?"":r),wk=(n,e)=>n==Boolean?!!pk[e]:n==Number?Number(e):n==String?e:n==Array||n==Object?JSON.parse(e):n.name==ho?e:new n(e),bk=({map:n},e)=>{try{return{value:n(e),error:!1}}catch{return{value:e,error:!0}}},xk=(n,e)=>n==null||e==null?{value:e,error:!1}:n!=String&&e===""?{value:void 0,error:!1}:n==Object||n==Array||n==Symbol?{value:e,error:{}.toString.call(e)!==`[object ${n.name}]`}:e instanceof n?{value:e,error:n==Number&&Number.isNaN(e.valueOf())}:n==String||n==Number||n==Boolean?{value:e,error:n==Number?typeof e!="number"?!0:Number.isNaN(e):n==String?typeof e!="string":typeof e!="boolean"}:{value:e,error:!0};let kk=0;const vk=n=>{var t;const e=((t=(n==null?void 0:n.dataset)||{})==null?void 0:t.hydrate)||"";return e||"c"+kk++},_k=(n,e=HTMLElement)=>{const t={},r={},i="prototype"in e&&e.prototype instanceof Element,o=i?e:"base"in e?e.base:HTMLElement,{props:s,styles:l}=i?n:e;class a extends o{constructor(){super(),this._setup(),this._render=()=>n({...this._props});for(const c in r)this[c]=r[c]}static get styles(){return[super.styles,l]}async _setup(){if(this._props)return;this._props={};let c,f;this.mounted=new Promise(y=>this.mount=()=>{y(),c!=this.parentNode&&(f!=c?this.unmounted.then(this.update):this.update()),c=this.parentNode}),this.unmounted=new Promise(y=>this.unmount=()=>{y(),(c!=this.parentNode||!this.isConnected)&&(h.cleanEffects(!0)()(),f=this.parentNode,c=null)}),this.symbolId=this.symbolId||Symbol(),this.symbolIdParent=Symbol();const h=ak(()=>this.update(),this,vk(this));let p,d=!0;const m=gl(this);this.update=()=>(p||(p=!0,this.updated=(this.updated||this.mounted).then(()=>{try{const y=h.load(this._render),g=h.cleanEffects();return y&&y.render(this,this.symbolId,m),p=!1,d&&!h.isSuspense()&&(d=!1,!m&&Sk(this)),g()}finally{p=!1}}).then(y=>{y&&y()})),this.updated),this.update()}connectedCallback(){this.mount(),super.connectedCallback&&super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback(),this.unmount()}attributeChangedCallback(c,f,h){if(t[c]){if(c===this._ignoreAttr||f===h)return;const{prop:p,type:d}=t[c];try{this[p]=wk(d,h)}catch{throw new fk(this,`The value defined as attr '${c}' cannot be parsed by type '${d.name}'`,h)}}else super.attributeChangedCallback(c,f,h)}static get props(){return{...super.props,...s}}static get observedAttributes(){const c=super.observedAttributes||[];for(const f in s)dk(this.prototype,f,s[f],t,r);return Object.keys(t).concat(c)}}return a};function Sk(n){const{styles:e}=n.constructor,{shadowRoot:t}=n;if(t&&e.length){const r=[];Bp(e,i=>{i&&(i instanceof Element?t.appendChild(i.cloneNode(!0)):r.push(i))}),r.length&&(t.adoptedStyleSheets=r)}}const $p=n=>(e,t)=>{ai(([r,i]=[])=>((i||!i)&&(i&&Lp(i,t)?r=r||!0:(Dt(r)&&r(),r=null)),[r,t]),([r,i],o)=>o?(Dt(r)&&r(),[]):[r||e(),i],n)},F5=$p(Fp),Ck=$p(Pp);class Ak extends Array{constructor(e,t){let r=!0;const i=o=>{try{t(o,this,r)}finally{r=!1}};super(void 0,i,t),i(e)}}const P5=n=>{const e=lk();return ai((t=new Ak(n,(r,i,o)=>{r=Dt(r)?r(i[0]):r,r!==i[0]&&(i[0]=r,o||e())}))=>t)},Mk=(n,e)=>{const[t]=ai(([r,i,o=0]=[])=>((!i||i&&!Lp(i,e))&&(r=n()),[r,e,o]));return t},L5=(n,e)=>Mk(()=>n,e),yl=ui("atomico/options");globalThis[yl]=globalThis[yl]||{sheet:!!document.adoptedStyleSheets};const qp=globalThis[yl];new Promise(n=>{qp.ssr||(document.readyState==="loading"?Vp(document,"DOMContentLoaded",n):n())});const Ok={checked:1,value:1,selected:1},Ek={list:1,type:1,size:1,form:1,width:1,height:1,src:1,href:1,slot:1},Tk={shadowDom:1,staticNode:1,cloneNode:1,children:1,key:1},Wi={},wl=[];class bl extends Text{}const Nk=ui("atomico/id"),Vr=ui("atomico/type"),xs=ui("atomico/ref"),jp=ui("atomico/vnode"),Dk=()=>{};function Ik(n,e,t){return Up(this,n,e,t)}const Wp=(n,e,...t)=>{const r=e||Wi;let{children:i}=r;if(i=i??(t.length?t:wl),n===Dk)return i;const o=n?n instanceof Node?1:n.prototype instanceof HTMLElement&&2:0;if(o===!1&&n instanceof Function)return n(i!=wl?{children:i,...r}:r);const s=qp.render||Ik;return{[Vr]:jp,type:n,props:r,children:i,key:r.key,shadow:r.shadowDom,static:r.staticNode,raw:o,is:r.is,clone:r.cloneNode,render:s}};function Up(n,e,t=Nk,r,i){let o;if(e&&e[t]&&e[t].vnode==n||n[Vr]!=jp)return e;(n||!e)&&(i=i||n.type=="svg",o=n.type!="host"&&(n.raw==1?(e&&n.clone?e[xs]:e)!=n.type:n.raw==2?!(e instanceof n.type):e?e[xs]||e.localName!=n.type:!e),o&&n.type!=null&&(n.raw==1&&n.clone?(r=!0,e=n.type.cloneNode(!0),e[xs]=n.type):e=n.raw==1?n.type:n.raw==2?new n.type:i?document.createElementNS("http://www.w3.org/2000/svg",n.type):document.createElement(n.type,n.is?{is:n.is}:void 0)));const s=e[t]?e[t]:Wi,{vnode:l=Wi,cycle:a=0}=s;let{fragment:u,handlers:c}=s;const{children:f=wl,props:h=Wi}=l;if(c=o?{}:c||{},n.static&&!o)return e;if(n.shadow&&!e.shadowRoot&&e.attachShadow({mode:"open",...n.shadow}),n.props!=h&&Fk(e,h,n.props,c,i),n.children!==f){const p=n.shadow?e.shadowRoot:e;u=Rk(n.children,u,p,t,!a&&r,i&&n.type=="foreignObject"?!1:i)}return e[t]={vnode:n,handlers:c,fragment:u,cycle:a+1},e}function zk(n,e){const t=new bl(""),r=new bl("");let i;if(n[e?"prepend":"append"](t),e){let{lastElementChild:o}=n;for(;o;){const{previousElementSibling:s}=o;if(gl(o,!0)&&!gl(s,!0)){i=o;break}o=s}}return i?i.before(r):n.append(r),{markStart:t,markEnd:r}}function Rk(n,e,t,r,i,o){n=n==null?null:uk(n)?n:[n];const s=e||zk(t,i),{markStart:l,markEnd:a,keyes:u}=s;let c;const f=u&&new Set;let h=l;if(n&&Bp(n,p=>{if(typeof p=="object"&&!p[Vr])return;const d=p[Vr]&&p.key,m=u&&d!=null&&u.get(d);h!=a&&h===m?f.delete(h):h=h==a?a:h.nextSibling;const y=u?m:h;let g=y;if(p[Vr])g=Up(p,y,r,i,o);else{const _=p+"";!(g instanceof Text)||g instanceof bl?g=new Text(_):g.data!=_&&(g.data=_)}g!=h&&(u&&f.delete(g),!y||u?(t.insertBefore(g,h),u&&h!=a&&f.add(h)):y==a?t.insertBefore(g,a):(t.replaceChild(g,y),h=g)),d!=null&&(c=c||new Map,c.set(d,g))}),h=h==a?a:h.nextSibling,e&&h!=a)for(;h!=a;){const p=h;h=h.nextSibling,p.remove()}return f&&f.forEach(p=>p.remove()),s.keyes=c,s}function Fk(n,e,t,r,i){for(const o in e)!(o in t)&&Oc(n,o,e[o],null,i,r);for(const o in t)Oc(n,o,e[o],t[o],i,r)}function Oc(n,e,t,r,i,o){if(e=e=="class"&&!i?"className":e,t=t??null,r=r??null,e in n&&Ok[e]&&(t=n[e]),!(r===t||Tk[e]||e[0]=="_"))if(n.localName==="slot"&&e==="assignNode"&&"assign"in n)n.assign(r);else if(e[0]=="o"&&e[1]=="n"&&(Dt(r)||Dt(t)))Pk(n,e.slice(2),r,o);else if(e=="ref")r&&(Dt(r)?r(n):r.current=n);else if(e=="style"){const{style:s}=n;t=t||"",r=r||"";const l=Br(t),a=Br(r);if(l)for(const u in t)if(a)!(u in r)&&Ec(s,u,null);else break;if(a)for(const u in r){const c=r[u];l&&t[u]===c||Ec(s,u,c)}else s.cssText=r}else{const s=e[0]=="$"?e.slice(1):e;s===e&&(!i&&!Ek[e]&&e in n||Dt(r)||Dt(t))?n[e]=r??"":r==null?n.removeAttribute(s):n.setAttribute(s,Br(r)?JSON.stringify(r):r)}}function Pk(n,e,t,r){if(r.handleEvent||(r.handleEvent=i=>r[i.type].call(n,i)),t){if(!r[e]){const i=t.capture||t.once||t.passive?Object.assign({},t):null;n.addEventListener(e,r,i)}r[e]=t}else r[e]&&(n.removeEventListener(e,r),delete r[e])}function Ec(n,e,t){let r="setProperty";t==null&&(r="removeProperty",t=null),~e.indexOf("-")?n[r](e,t):n[e]=t}const Lk=Wp("host",{style:"display: contents"}),Bk="value",Vk=(n,e)=>{const t=sk(),r=ok();Ck(()=>Vp(t.current,"ConnectContext",i=>{i.composedPath().at(0)!==i.currentTarget&&n===i.detail.id&&(i.stopPropagation(),i.detail.connect(r))}),[n]),r.current=e},Hk=n=>{const e=_k(({value:t})=>(Vk(e,t),Lk),{props:{value:{type:Object,value:()=>n}}});return e[Bk]=n,e};Hk({dispatch(n,e){}});const $k=0,$n=1,Ti=2,Ni=3,Tc=4,Ar=5,xl=6,Jp=0,qk=2,Kp=3,Yp=4,Gp=Ar,jk=xl,Zp=(n,e,t,r)=>{let i;e[0]=0;for(let o=1;o<e.length;o++){const s=e[o++],l=e[o]?(e[0]|=s?1:2,t[e[o++]]):e[++o];s===Kp?r[0]=l:s===Yp?r[1]=Object.assign(r[1]||{},l):s===Gp?(r[1]=r[1]||{})[e[++o]]=l:s===jk?r[1][e[++o]]+=l+"":s?(i=n.apply(l,Zp(n,l,t,["",null])),r.push(i),l[0]?e[0]|=2:(e[o-2]=Jp,e[o]=i)):r.push(l)}return r},Wk=function(n){let e=$n,t="",r="",i=[0],o,s;const l=a=>{e===$n&&(a||(t=t.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?i.push(Jp,a,t):e===Ni&&(a||t)?(i.push(Kp,a,t),e=Ti):e===Ti&&t==="..."&&a?i.push(Yp,a,0):e===Ti&&t&&!a?i.push(Gp,0,!0,t):e>=Ar&&((t||!a&&e===Ar)&&(i.push(e,0,t,s),e=xl),a&&(i.push(e,a,0,s),e=xl)),t=""};for(let a=0;a<n.length;a++){a&&(e===$n&&l(),l(a));for(let u=0;u<n[a].length;u++)o=n[a][u],e===$n?o==="<"?(l(),i=[i],e=Ni):t+=o:e===Tc?t==="--"&&o===">"?(e=$n,t=""):t=o+t[0]:r?o===r?r="":t+=o:o==='"'||o==="'"?r=o:o===">"?(l(),e=$n):e&&(o==="="?(e=Ar,s=t,t=""):o==="/"&&(e<Ar||n[a][u+1]===">")?(l(),e===Ni&&(i=i[0]),e=i,(i=i[0]).push(qk,0,e),e=$k):o===" "||o===" "||o===` |
| 70 |
`||o==="\r"?(l(),e=Ti):t+=o),e===Ni&&t==="!--"&&(e=Tc,i=i[0])}return l(),i},Uk=new Map;function B5(n){let e=Uk;return e=Zp(Wp,e.get(n)||(e.set(n,e=Wk(n)),e),arguments,[]),e.length>1?e:e[0]}function Xp(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=Xp(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function V5(){for(var n,e,t=0,r="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=Xp(n))&&(r&&(r+=" "),r+=e);return r}export{Fv as $,Zk as A,Av as B,mv as C,gv as D,Vc as E,Mv as F,tv as G,uv as H,Xk as I,Tv as J,Bv as K,jv as L,qv as M,Pv as N,Lv as O,ev as P,sv as Q,zv as R,xo as S,oe as T,bv as U,xv as V,Rv as W,iv as X,Wv as Y,av as Z,ov as _,kn as a,cr as a$,Ev as a0,Ov as a1,lv as a2,ee as a3,fr as a4,ri as a5,q as a6,un as a7,o5 as a8,r5 as a9,j as aA,b5 as aB,w5 as aC,y5 as aD,Ll as aE,x5 as aF,a5 as aG,l5 as aH,k5 as aI,N5 as aJ,E5 as aK,T5 as aL,M5 as aM,Lt as aN,ae as aO,O5 as aP,S5 as aQ,C5 as aR,v5 as aS,_5 as aT,hr as aU,A5 as aV,D5 as aW,ie as aX,I5 as aY,ek as aZ,tk as a_,i5 as aa,n5 as ab,p5 as ac,Cr as ad,d5 as ae,Ur as af,Cn as ag,h5 as ah,Ul as ai,c6 as aj,u6 as ak,Oh as al,s5 as am,m5 as an,P as ao,Ha as ap,Re as aq,re as ar,be as as,Gt as at,I as au,f5 as av,c5 as aw,g5 as ax,u5 as ay,Z as az,Dv as b,k_ as b$,z5 as b0,pv as b1,hv as b2,fv as b3,_k as b4,B5 as b5,ok as b6,P5 as b7,F5 as b8,V5 as b9,c_ as bA,z_ as bB,P_ as bC,X_ as bD,Jv as bE,a_ as bF,d_ as bG,m_ as bH,B_ as bI,U_ as bJ,M_ as bK,N_ as bL,I_ as bM,Y_ as bN,o_ as bO,l_ as bP,Q_ as bQ,S_ as bR,R_ as bS,n_ as bT,D_ as bU,T_ as bV,W_ as bW,Qv as bX,Zv as bY,Yv as bZ,u_ as b_,sk as ba,Mk as bb,Uv as bc,h_ as bd,H_ as be,G_ as bf,b_ as bg,g_ as bh,y_ as bi,w_ as bj,j_ as bk,E_ as bl,Gv as bm,O_ as bn,e_ as bo,K_ as bp,Xv as bq,t5 as br,e5 as bs,v_ as bt,Z_ as bu,Kv as bv,s_ as bw,r_ as bx,A_ as by,J_ as bz,Gk as c,C_ as c0,$_ as c1,t_ as c2,f_ as c3,L_ as c4,V_ as c5,__ as c6,i_ as c7,p_ as c8,F_ as c9,q_ as ca,x_ as cb,xh as cc,L5 as cd,lk as ce,vv as d,kv as e,_v as f,Cv as g,Oe as h,po as i,Nv as j,Sv as k,Iv as l,wv as m,yv as n,nv as o,dv as p,rv as q,Qk as r,Vv as s,ur as t,yd as u,Hv as v,$v as w,ld as x,cv as y,hd as z}; |
| 71 |
|