import{G as mt,g as Et,U as gt,F as it,J as Ot}from"./vc-shell-vendor-mdurl32435.js";import{B as $t,E as Pt,C as qt}from"./vc-shell-vendor-uc32435.js";import{H as bt}from"./vc-shell-vendor-entities32435.js";import{n as jt}from"./vc-shell-vendor-linkify32435.js";import{V as _t}from"./vc-shell-vendor-punycode32435.js";import{o as Rt}from"./vc-shell-vendor-boolbase32435.js";function Zt(t){return Object.prototype.toString.call(t)}function nt(t){return Zt(t)==="[object String]"}const Dt=Object.prototype.hasOwnProperty;function Nt(t,n){return Dt.call(t,n)}function H(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(e){t[e]=n[e]})}}),t}function Ct(t,n,e){return[].concat(t.slice(0,n),e,t.slice(n+1))}function et(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}function G(t){if(t>65535){t-=65536;const n=55296+(t>>10),e=56320+(t&1023);return String.fromCharCode(n,e)}return String.fromCharCode(t)}const yt=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Bt=/&([a-z#][a-z0-9]{1,31});/gi,Ft=new RegExp(yt.source+"|"+Bt.source,"gi"),Ut=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Gt(t,n){if(n.charCodeAt(0)===35&&Ut.test(n)){const o=n[1].toLowerCase()==="x"?parseInt(n.slice(2),16):parseInt(n.slice(1),10);return et(o)?G(o):t}const e=bt(t);return e!==t?e:t}function Ht(t){return t.indexOf("\\")<0?t:t.replace(yt,"$1")}function P(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(Ft,function(n,e,o){return e||Gt(n,o)})}const Jt=/[&<>"]/,Vt=/[&<>"]/g,Wt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function Xt(t){return Wt[t]}function E(t){return Jt.test(t)?t.replace(Vt,Xt):t}const Kt=/[.?*+^$[\]\\(){}|-]/g;function Qt(t){return t.replace(Kt,"\\$&")}function A(t){switch(t){case 9:case 32:return!0}return!1}function R(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Z(t){return Pt.test(t)||qt.test(t)}function D(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function J(t){return t=t.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}const Yt={mdurl:Ot,ucmicro:$t},tn=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:Ct,assign:H,escapeHtml:E,escapeRE:Qt,fromCodePoint:G,has:Nt,isMdAsciiPunct:D,isPunctChar:Z,isSpace:A,isString:nt,isValidEntityCode:et,isWhiteSpace:R,lib:Yt,normalizeReference:J,unescapeAll:P,unescapeMd:Ht},Symbol.toStringTag,{value:"Module"}));function nn(t,n,e){let o,r,s,i;const l=t.posMax,c=t.pos;for(t.pos=n+1,o=1;t.pos<l;){if(s=t.src.charCodeAt(t.pos),s===93&&(o--,o===0)){r=!0;break}if(i=t.pos,t.md.inline.skipToken(t),s===91){if(i===t.pos-1)o++;else if(e)return t.pos=c,-1}}let a=-1;return r&&(a=t.pos),t.pos=c,a}function en(t,n,e){let o,r=n;const s={ok:!1,pos:0,str:""};if(t.charCodeAt(r)===60){for(r++;r<e;){if(o=t.charCodeAt(r),o===10||o===60)return s;if(o===62)return s.pos=r+1,s.str=P(t.slice(n+1,r)),s.ok=!0,s;if(o===92&&r+1<e){r+=2;continue}r++}return s}let i=0;for(;r<e&&(o=t.charCodeAt(r),!(o===32||o<32||o===127));){if(o===92&&r+1<e){if(t.charCodeAt(r+1)===32)break;r+=2;continue}if(o===40&&(i++,i>32))return s;if(o===41){if(i===0)break;i--}r++}return n===r||i!==0||(s.str=P(t.slice(n,r)),s.pos=r,s.ok=!0),s}function rn(t,n,e,o){let r,s=n;const i={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(o)i.str=o.str,i.marker=o.marker;else{if(s>=e)return i;let l=t.charCodeAt(s);if(l!==34&&l!==39&&l!==40)return i;n++,s++,l===40&&(l=41),i.marker=l}for(;s<e;){if(r=t.charCodeAt(s),r===i.marker)return i.pos=s+1,i.str+=P(t.slice(n,s)),i.ok=!0,i;if(r===40&&i.marker===41)return i;r===92&&s+1<e&&s++,s++}return i.can_continue=!0,i.str+=P(t.slice(n,s)),i}const sn=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:en,parseLinkLabel:nn,parseLinkTitle:rn},Symbol.toStringTag,{value:"Module"})),L={};L.code_inline=function(t,n,e,o,r){const s=t[n];return"<code"+r.renderAttrs(s)+">"+E(s.content)+"</code>"};L.code_block=function(t,n,e,o,r){const s=t[n];return"<pre"+r.renderAttrs(s)+"><code>"+E(t[n].content)+`</code></pre>
`};L.fence=function(t,n,e,o,r){const s=t[n],i=s.info?P(s.info).trim():"";let l="",c="";if(i){const f=i.split(/(\s+)/g);l=f[0],c=f.slice(2).join("")}let a;if(e.highlight?a=e.highlight(s.content,l,c)||E(s.content):a=E(s.content),a.indexOf("<pre")===0)return a+`
`;if(i){const f=s.attrIndex("class"),h=s.attrs?s.attrs.slice():[];f<0?h.push(["class",e.langPrefix+l]):(h[f]=h[f].slice(),h[f][1]+=" "+e.langPrefix+l);const g={attrs:h};return`<pre><code${r.renderAttrs(g)}>${a}</code></pre>
`}return`<pre><code${r.renderAttrs(s)}>${a}</code></pre>
`};L.image=function(t,n,e,o,r){const s=t[n];return s.attrs[s.attrIndex("alt")][1]=r.renderInlineAsText(s.children,e,o),r.renderToken(t,n,e)};L.hardbreak=function(t,n,e){return e.xhtmlOut?`<br />
`:`<br>
`};L.softbreak=function(t,n,e){return e.breaks?e.xhtmlOut?`<br />
`:`<br>
`:`
`};L.text=function(t,n){return E(t[n].content)};L.html_block=function(t,n){return t[n].content};L.html_inline=function(t,n){return t[n].content};function q(){this.rules=H({},L)}q.prototype.renderAttrs=function(t){let n,e,o;if(!t.attrs)return"";for(o="",n=0,e=t.attrs.length;n<e;n++)o+=" "+E(t.attrs[n][0])+'="'+E(t.attrs[n][1])+'"';return o};q.prototype.renderToken=function(t,n,e){const o=t[n];let r="";if(o.hidden)return"";o.block&&o.nesting!==-1&&n&&t[n-1].hidden&&(r+=`
`),r+=(o.nesting===-1?"</":"<")+o.tag,r+=this.renderAttrs(o),o.nesting===0&&e.xhtmlOut&&(r+=" /");let s=!1;if(o.block&&(s=!0,o.nesting===1&&n+1<t.length)){const i=t[n+1];(i.type==="inline"||i.hidden||i.nesting===-1&&i.tag===o.tag)&&(s=!1)}return r+=s?`>
`:">",r};q.prototype.renderInline=function(t,n,e){let o="";const r=this.rules;for(let s=0,i=t.length;s<i;s++){const l=t[s].type;typeof r[l]<"u"?o+=r[l](t,s,n,e,this):o+=this.renderToken(t,s,n)}return o};q.prototype.renderInlineAsText=function(t,n,e){let o="";for(let r=0,s=t.length;r<s;r++)switch(t[r].type){case"text":o+=t[r].content;break;case"image":o+=this.renderInlineAsText(t[r].children,n,e);break;case"html_inline":case"html_block":o+=t[r].content;break;case"softbreak":case"hardbreak":o+=`
`;break}return o};q.prototype.render=function(t,n,e){let o="";const r=this.rules;for(let s=0,i=t.length;s<i;s++){const l=t[s].type;l==="inline"?o+=this.renderInline(t[s].children,n,e):typeof r[l]<"u"?o+=r[l](t,s,n,e,this):o+=this.renderToken(t,s,n,e)}return o};function v(){this.__rules__=[],this.__cache__=null}v.prototype.__find__=function(t){for(let n=0;n<this.__rules__.length;n++)if(this.__rules__[n].name===t)return n;return-1};v.prototype.__compile__=function(){const t=this,n=[""];t.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(o){n.indexOf(o)<0&&n.push(o)})}),t.__cache__={},n.forEach(function(e){t.__cache__[e]=[],t.__rules__.forEach(function(o){o.enabled&&(e&&o.alt.indexOf(e)<0||t.__cache__[e].push(o.fn))})})};v.prototype.at=function(t,n,e){const o=this.__find__(t),r=e||{};if(o===-1)throw new Error("Parser rule not found: "+t);this.__rules__[o].fn=n,this.__rules__[o].alt=r.alt||[],this.__cache__=null};v.prototype.before=function(t,n,e,o){const r=this.__find__(t),s=o||{};if(r===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(r,0,{name:n,enabled:!0,fn:e,alt:s.alt||[]}),this.__cache__=null};v.prototype.after=function(t,n,e,o){const r=this.__find__(t),s=o||{};if(r===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(r+1,0,{name:n,enabled:!0,fn:e,alt:s.alt||[]}),this.__cache__=null};v.prototype.push=function(t,n,e){const o=e||{};this.__rules__.push({name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null};v.prototype.enable=function(t,n){Array.isArray(t)||(t=[t]);const e=[];return t.forEach(function(o){const r=this.__find__(o);if(r<0){if(n)return;throw new Error("Rules manager: invalid rule name "+o)}this.__rules__[r].enabled=!0,e.push(o)},this),this.__cache__=null,e};v.prototype.enableOnly=function(t,n){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(t,n)};v.prototype.disable=function(t,n){Array.isArray(t)||(t=[t]);const e=[];return t.forEach(function(o){const r=this.__find__(o);if(r<0){if(n)return;throw new Error("Rules manager: invalid rule name "+o)}this.__rules__[r].enabled=!1,e.push(o)},this),this.__cache__=null,e};v.prototype.getRules=function(t){return this.__cache__===null&&this.__compile__(),this.__cache__[t]||[]};function I(t,n,e){this.type=t,this.tag=n,this.attrs=null,this.map=null,this.nesting=e,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}I.prototype.attrIndex=function(t){if(!this.attrs)return-1;const n=this.attrs;for(let e=0,o=n.length;e<o;e++)if(n[e][0]===t)return e;return-1};I.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]};I.prototype.attrSet=function(t,n){const e=this.attrIndex(t),o=[t,n];e<0?this.attrPush(o):this.attrs[e]=o};I.prototype.attrGet=function(t){const n=this.attrIndex(t);let e=null;return n>=0&&(e=this.attrs[n][1]),e};I.prototype.attrJoin=function(t,n){const e=this.attrIndex(t);e<0?this.attrPush([t,n]):this.attrs[e][1]=this.attrs[e][1]+" "+n};function xt(t,n,e){this.src=t,this.env=e,this.tokens=[],this.inlineMode=!1,this.md=n}xt.prototype.Token=I;const on=/\r\n?|\n/g,ln=/\0/g;function cn(t){let n;n=t.src.replace(on,`
`),n=n.replace(ln,"�"),t.src=n}function an(t){let n;t.inlineMode?(n=new t.Token("inline","",0),n.content=t.src,n.map=[0,1],n.children=[],t.tokens.push(n)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}function un(t){const n=t.tokens;for(let e=0,o=n.length;e<o;e++){const r=n[e];r.type==="inline"&&t.md.inline.parse(r.content,t.md,t.env,r.children)}}function fn(t){return/^<a[>\s]/i.test(t)}function hn(t){return/^<\/a\s*>/i.test(t)}function pn(t){const n=t.tokens;if(t.md.options.linkify)for(let e=0,o=n.length;e<o;e++){if(n[e].type!=="inline"||!t.md.linkify.pretest(n[e].content))continue;let r=n[e].children,s=0;for(let i=r.length-1;i>=0;i--){const l=r[i];if(l.type==="link_close"){for(i--;r[i].level!==l.level&&r[i].type!=="link_open";)i--;continue}if(l.type==="html_inline"&&(fn(l.content)&&s>0&&s--,hn(l.content)&&s++),!(s>0)&&l.type==="text"&&t.md.linkify.test(l.content)){const c=l.content;let a=t.md.linkify.match(c);const f=[];let h=l.level,g=0;a.length>0&&a[0].index===0&&i>0&&r[i-1].type==="text_special"&&(a=a.slice(1));for(let p=0;p<a.length;p++){const u=a[p].url,d=t.md.normalizeLink(u);if(!t.md.validateLink(d))continue;let m=a[p].text;a[p].schema?a[p].schema==="mailto:"&&!/^mailto:/i.test(m)?m=t.md.normalizeLinkText("mailto:"+m).replace(/^mailto:/,""):m=t.md.normalizeLinkText(m):m=t.md.normalizeLinkText("http://"+m).replace(/^http:\/\//,"");const C=a[p].index;if(C>g){const y=new t.Token("text","",0);y.content=c.slice(g,C),y.level=h,f.push(y)}const k=new t.Token("link_open","a",1);k.attrs=[["href",d]],k.level=h++,k.markup="linkify",k.info="auto",f.push(k);const b=new t.Token("text","",0);b.content=m,b.level=h,f.push(b);const _=new t.Token("link_close","a",-1);_.level=--h,_.markup="linkify",_.info="auto",f.push(_),g=a[p].lastIndex}if(g<c.length){const p=new t.Token("text","",0);p.content=c.slice(g),p.level=h,f.push(p)}n[e].children=r=Ct(r,i,f)}}}}const At=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,dn=/\((c|tm|r)\)/i,kn=/\((c|tm|r)\)/ig,mn={c:"©",r:"®",tm:"™"};function gn(t,n){return mn[n.toLowerCase()]}function bn(t){let n=0;for(let e=t.length-1;e>=0;e--){const o=t[e];o.type==="text"&&!n&&(o.content=o.content.replace(kn,gn)),o.type==="link_open"&&o.info==="auto"&&n--,o.type==="link_close"&&o.info==="auto"&&n++}}function _n(t){let n=0;for(let e=t.length-1;e>=0;e--){const o=t[e];o.type==="text"&&!n&&At.test(o.content)&&(o.content=o.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),o.type==="link_open"&&o.info==="auto"&&n--,o.type==="link_close"&&o.info==="auto"&&n++}}function Cn(t){let n;if(t.md.options.typographer)for(n=t.tokens.length-1;n>=0;n--)t.tokens[n].type==="inline"&&(dn.test(t.tokens[n].content)&&bn(t.tokens[n].children),At.test(t.tokens[n].content)&&_n(t.tokens[n].children))}const yn=/['"]/,lt=/['"]/g,ct="’";function F(t,n,e){return t.slice(0,n)+e+t.slice(n+1)}function xn(t,n){let e;const o=[];for(let r=0;r<t.length;r++){const s=t[r],i=t[r].level;for(e=o.length-1;e>=0&&!(o[e].level<=i);e--);if(o.length=e+1,s.type!=="text")continue;let l=s.content,c=0,a=l.length;t:for(;c<a;){lt.lastIndex=c;const f=lt.exec(l);if(!f)break;let h=!0,g=!0;c=f.index+1;const p=f[0]==="'";let u=32;if(f.index-1>=0)u=l.charCodeAt(f.index-1);else for(e=r-1;e>=0&&!(t[e].type==="softbreak"||t[e].type==="hardbreak");e--)if(t[e].content){u=t[e].content.charCodeAt(t[e].content.length-1);break}let d=32;if(c<a)d=l.charCodeAt(c);else for(e=r+1;e<t.length&&!(t[e].type==="softbreak"||t[e].type==="hardbreak");e++)if(t[e].content){d=t[e].content.charCodeAt(0);break}const m=D(u)||Z(String.fromCharCode(u)),C=D(d)||Z(String.fromCharCode(d)),k=R(u),b=R(d);if(b?h=!1:C&&(k||m||(h=!1)),k?g=!1:m&&(b||C||(g=!1)),d===34&&f[0]==='"'&&u>=48&&u<=57&&(g=h=!1),h&&g&&(h=m,g=C),!h&&!g){p&&(s.content=F(s.content,f.index,ct));continue}if(g)for(e=o.length-1;e>=0;e--){let _=o[e];if(o[e].level<i)break;if(_.single===p&&o[e].level===i){_=o[e];let y,x;p?(y=n.md.options.quotes[2],x=n.md.options.quotes[3]):(y=n.md.options.quotes[0],x=n.md.options.quotes[1]),s.content=F(s.content,f.index,x),t[_.token].content=F(t[_.token].content,_.pos,y),c+=x.length-1,_.token===r&&(c+=y.length-1),l=s.content,a=l.length,o.length=e;continue t}}h?o.push({token:r,pos:f.index,single:p,level:i}):g&&p&&(s.content=F(s.content,f.index,ct))}}}function An(t){if(t.md.options.typographer)for(let n=t.tokens.length-1;n>=0;n--)t.tokens[n].type!=="inline"||!yn.test(t.tokens[n].content)||xn(t.tokens[n].children,t)}function Mn(t){let n,e;const o=t.tokens,r=o.length;for(let s=0;s<r;s++){if(o[s].type!=="inline")continue;const i=o[s].children,l=i.length;for(n=0;n<l;n++)i[n].type==="text_special"&&(i[n].type="text");for(n=e=0;n<l;n++)i[n].type==="text"&&n+1<l&&i[n+1].type==="text"?i[n+1].content=i[n].content+i[n+1].content:(n!==e&&(i[e]=i[n]),e++);n!==e&&(i.length=e)}}const X=[["normalize",cn],["block",an],["inline",un],["linkify",pn],["replacements",Cn],["smartquotes",An],["text_join",Mn]];function rt(){this.ruler=new v;for(let t=0;t<X.length;t++)this.ruler.push(X[t][0],X[t][1])}rt.prototype.process=function(t){const n=this.ruler.getRules("");for(let e=0,o=n.length;e<o;e++)n[e](t)};rt.prototype.State=xt;function z(t,n,e,o){this.src=t,this.md=n,this.env=e,this.tokens=o,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const r=this.src;for(let s=0,i=0,l=0,c=0,a=r.length,f=!1;i<a;i++){const h=r.charCodeAt(i);if(!f)if(A(h)){l++,h===9?c+=4-c%4:c++;continue}else f=!0;(h===10||i===a-1)&&(h!==10&&i++,this.bMarks.push(s),this.eMarks.push(i),this.tShift.push(l),this.sCount.push(c),this.bsCount.push(0),f=!1,l=0,c=0,s=i+1)}this.bMarks.push(r.length),this.eMarks.push(r.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}z.prototype.push=function(t,n,e){const o=new I(t,n,e);return o.block=!0,e<0&&this.level--,o.level=this.level,e>0&&this.level++,this.tokens.push(o),o};z.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};z.prototype.skipEmptyLines=function(t){for(let n=this.lineMax;t<n&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t};z.prototype.skipSpaces=function(t){for(let n=this.src.length;t<n;t++){const e=this.src.charCodeAt(t);if(!A(e))break}return t};z.prototype.skipSpacesBack=function(t,n){if(t<=n)return t;for(;t>n;)if(!A(this.src.charCodeAt(--t)))return t+1;return t};z.prototype.skipChars=function(t,n){for(let e=this.src.length;t<e&&this.src.charCodeAt(t)===n;t++);return t};z.prototype.skipCharsBack=function(t,n,e){if(t<=e)return t;for(;t>e;)if(n!==this.src.charCodeAt(--t))return t+1;return t};z.prototype.getLines=function(t,n,e,o){if(t>=n)return"";const r=new Array(n-t);for(let s=0,i=t;i<n;i++,s++){let l=0;const c=this.bMarks[i];let a=c,f;for(i+1<n||o?f=this.eMarks[i]+1:f=this.eMarks[i];a<f&&l<e;){const h=this.src.charCodeAt(a);if(A(h))h===9?l+=4-(l+this.bsCount[i])%4:l++;else if(a-c<this.tShift[i])l++;else break;a++}l>e?r[s]=new Array(l-e+1).join(" ")+this.src.slice(a,f):r[s]=this.src.slice(a,f)}return r.join("")};z.prototype.Token=I;const vn=65536;function K(t,n){const e=t.bMarks[n]+t.tShift[n],o=t.eMarks[n];return t.src.slice(e,o)}function at(t){const n=[],e=t.length;let o=0,r=t.charCodeAt(o),s=!1,i=0,l="";for(;o<e;)r===124&&(s?(l+=t.substring(i,o-1),i=o):(n.push(l+t.substring(i,o)),l="",i=o+1)),s=r===92,o++,r=t.charCodeAt(o);return n.push(l+t.substring(i)),n}function wn(t,n,e,o){if(n+2>e)return!1;let r=n+1;if(t.sCount[r]<t.blkIndent||t.sCount[r]-t.blkIndent>=4)return!1;let s=t.bMarks[r]+t.tShift[r];if(s>=t.eMarks[r])return!1;const i=t.src.charCodeAt(s++);if(i!==124&&i!==45&&i!==58||s>=t.eMarks[r])return!1;const l=t.src.charCodeAt(s++);if(l!==124&&l!==45&&l!==58&&!A(l)||i===45&&A(l))return!1;for(;s<t.eMarks[r];){const _=t.src.charCodeAt(s);if(_!==124&&_!==45&&_!==58&&!A(_))return!1;s++}let c=K(t,n+1),a=c.split("|");const f=[];for(let _=0;_<a.length;_++){const y=a[_].trim();if(!y){if(_===0||_===a.length-1)continue;return!1}if(!/^:?-+:?$/.test(y))return!1;y.charCodeAt(y.length-1)===58?f.push(y.charCodeAt(0)===58?"center":"right"):y.charCodeAt(0)===58?f.push("left"):f.push("")}if(c=K(t,n).trim(),c.indexOf("|")===-1||t.sCount[n]-t.blkIndent>=4)return!1;a=at(c),a.length&&a[0]===""&&a.shift(),a.length&&a[a.length-1]===""&&a.pop();const h=a.length;if(h===0||h!==f.length)return!1;if(o)return!0;const g=t.parentType;t.parentType="table";const p=t.md.block.ruler.getRules("blockquote"),u=t.push("table_open","table",1),d=[n,0];u.map=d;const m=t.push("thead_open","thead",1);m.map=[n,n+1];const C=t.push("tr_open","tr",1);C.map=[n,n+1];for(let _=0;_<a.length;_++){const y=t.push("th_open","th",1);f[_]&&(y.attrs=[["style","text-align:"+f[_]]]);const x=t.push("inline","",0);x.content=a[_].trim(),x.children=[],t.push("th_close","th",-1)}t.push("tr_close","tr",-1),t.push("thead_close","thead",-1);let k,b=0;for(r=n+2;r<e&&!(t.sCount[r]<t.blkIndent);r++){let _=!1;for(let x=0,M=p.length;x<M;x++)if(p[x](t,r,e,!0)){_=!0;break}if(_||(c=K(t,r).trim(),!c)||t.sCount[r]-t.blkIndent>=4||(a=at(c),a.length&&a[0]===""&&a.shift(),a.length&&a[a.length-1]===""&&a.pop(),b+=h-a.length,b>vn))break;if(r===n+2){const x=t.push("tbody_open","tbody",1);x.map=k=[n+2,0]}const y=t.push("tr_open","tr",1);y.map=[r,r+1];for(let x=0;x<h;x++){const M=t.push("td_open","td",1);f[x]&&(M.attrs=[["style","text-align:"+f[x]]]);const w=t.push("inline","",0);w.content=a[x]?a[x].trim():"",w.children=[],t.push("td_close","td",-1)}t.push("tr_close","tr",-1)}return k&&(t.push("tbody_close","tbody",-1),k[1]=r),t.push("table_close","table",-1),d[1]=r,t.parentType=g,t.line=r,!0}function Sn(t,n,e){if(t.sCount[n]-t.blkIndent<4)return!1;let o=n+1,r=o;for(;o<e;){if(t.isEmpty(o)){o++;continue}if(t.sCount[o]-t.blkIndent>=4){o++,r=o;continue}break}t.line=r;const s=t.push("code_block","code",0);return s.content=t.getLines(n,r,4+t.blkIndent,!1)+`
`,s.map=[n,t.line],!0}function In(t,n,e,o){let r=t.bMarks[n]+t.tShift[n],s=t.eMarks[n];if(t.sCount[n]-t.blkIndent>=4||r+3>s)return!1;const i=t.src.charCodeAt(r);if(i!==126&&i!==96)return!1;let l=r;r=t.skipChars(r,i);let c=r-l;if(c<3)return!1;const a=t.src.slice(l,r),f=t.src.slice(r,s);if(i===96&&f.indexOf(String.fromCharCode(i))>=0)return!1;if(o)return!0;let h=n,g=!1;for(;h++,!(h>=e||(r=l=t.bMarks[h]+t.tShift[h],s=t.eMarks[h],r<s&&t.sCount[h]<t.blkIndent));)if(t.src.charCodeAt(r)===i&&!(t.sCount[h]-t.blkIndent>=4)&&(r=t.skipChars(r,i),!(r-l<c)&&(r=t.skipSpaces(r),!(r<s)))){g=!0;break}c=t.sCount[n],t.line=h+(g?1:0);const p=t.push("fence","code",0);return p.info=f,p.content=t.getLines(n+1,h,c,!0),p.markup=a,p.map=[n,t.line],!0}function Ln(t,n,e,o){let r=t.bMarks[n]+t.tShift[n],s=t.eMarks[n];const i=t.lineMax;if(t.sCount[n]-t.blkIndent>=4||t.src.charCodeAt(r)!==62)return!1;if(o)return!0;const l=[],c=[],a=[],f=[],h=t.md.block.ruler.getRules("blockquote"),g=t.parentType;t.parentType="blockquote";let p=!1,u;for(u=n;u<e;u++){const b=t.sCount[u]<t.blkIndent;if(r=t.bMarks[u]+t.tShift[u],s=t.eMarks[u],r>=s)break;if(t.src.charCodeAt(r++)===62&&!b){let y=t.sCount[u]+1,x,M;t.src.charCodeAt(r)===32?(r++,y++,M=!1,x=!0):t.src.charCodeAt(r)===9?(x=!0,(t.bsCount[u]+y)%4===3?(r++,y++,M=!1):M=!0):x=!1;let w=y;for(l.push(t.bMarks[u]),t.bMarks[u]=r;r<s;){const T=t.src.charCodeAt(r);if(A(T))T===9?w+=4-(w+t.bsCount[u]+(M?1:0))%4:w++;else break;r++}p=r>=s,c.push(t.bsCount[u]),t.bsCount[u]=t.sCount[u]+1+(x?1:0),a.push(t.sCount[u]),t.sCount[u]=w-y,f.push(t.tShift[u]),t.tShift[u]=r-t.bMarks[u];continue}if(p)break;let _=!1;for(let y=0,x=h.length;y<x;y++)if(h[y](t,u,e,!0)){_=!0;break}if(_){t.lineMax=u,t.blkIndent!==0&&(l.push(t.bMarks[u]),c.push(t.bsCount[u]),f.push(t.tShift[u]),a.push(t.sCount[u]),t.sCount[u]-=t.blkIndent);break}l.push(t.bMarks[u]),c.push(t.bsCount[u]),f.push(t.tShift[u]),a.push(t.sCount[u]),t.sCount[u]=-1}const d=t.blkIndent;t.blkIndent=0;const m=t.push("blockquote_open","blockquote",1);m.markup=">";const C=[n,0];m.map=C,t.md.block.tokenize(t,n,u);const k=t.push("blockquote_close","blockquote",-1);k.markup=">",t.lineMax=i,t.parentType=g,C[1]=t.line;for(let b=0;b<f.length;b++)t.bMarks[b+n]=l[b],t.tShift[b+n]=f[b],t.sCount[b+n]=a[b],t.bsCount[b+n]=c[b];return t.blkIndent=d,!0}function zn(t,n,e,o){const r=t.eMarks[n];if(t.sCount[n]-t.blkIndent>=4)return!1;let s=t.bMarks[n]+t.tShift[n];const i=t.src.charCodeAt(s++);if(i!==42&&i!==45&&i!==95)return!1;let l=1;for(;s<r;){const a=t.src.charCodeAt(s++);if(a!==i&&!A(a))return!1;a===i&&l++}if(l<3)return!1;if(o)return!0;t.line=n+1;const c=t.push("hr","hr",0);return c.map=[n,t.line],c.markup=Array(l+1).join(String.fromCharCode(i)),!0}function ut(t,n){const e=t.eMarks[n];let o=t.bMarks[n]+t.tShift[n];const r=t.src.charCodeAt(o++);if(r!==42&&r!==45&&r!==43)return-1;if(o<e){const s=t.src.charCodeAt(o);if(!A(s))return-1}return o}function ft(t,n){const e=t.bMarks[n]+t.tShift[n],o=t.eMarks[n];let r=e;if(r+1>=o)return-1;let s=t.src.charCodeAt(r++);if(s<48||s>57)return-1;for(;;){if(r>=o)return-1;if(s=t.src.charCodeAt(r++),s>=48&&s<=57){if(r-e>=10)return-1;continue}if(s===41||s===46)break;return-1}return r<o&&(s=t.src.charCodeAt(r),!A(s))?-1:r}function Tn(t,n){const e=t.level+2;for(let o=n+2,r=t.tokens.length-2;o<r;o++)t.tokens[o].level===e&&t.tokens[o].type==="paragraph_open"&&(t.tokens[o+2].hidden=!0,t.tokens[o].hidden=!0,o+=2)}function En(t,n,e,o){let r,s,i,l,c=n,a=!0;if(t.sCount[c]-t.blkIndent>=4||t.listIndent>=0&&t.sCount[c]-t.listIndent>=4&&t.sCount[c]<t.blkIndent)return!1;let f=!1;o&&t.parentType==="paragraph"&&t.sCount[c]>=t.blkIndent&&(f=!0);let h,g,p;if((p=ft(t,c))>=0){if(h=!0,i=t.bMarks[c]+t.tShift[c],g=Number(t.src.slice(i,p-1)),f&&g!==1)return!1}else if((p=ut(t,c))>=0)h=!1;else return!1;if(f&&t.skipSpaces(p)>=t.eMarks[c])return!1;if(o)return!0;const u=t.src.charCodeAt(p-1),d=t.tokens.length;h?(l=t.push("ordered_list_open","ol",1),g!==1&&(l.attrs=[["start",g]])):l=t.push("bullet_list_open","ul",1);const m=[c,0];l.map=m,l.markup=String.fromCharCode(u);let C=!1;const k=t.md.block.ruler.getRules("list"),b=t.parentType;for(t.parentType="list";c<e;){s=p,r=t.eMarks[c];const _=t.sCount[c]+p-(t.bMarks[c]+t.tShift[c]);let y=_;for(;s<r;){const O=t.src.charCodeAt(s);if(O===9)y+=4-(y+t.bsCount[c])%4;else if(O===32)y++;else break;s++}const x=s;let M;x>=r?M=1:M=y-_,M>4&&(M=1);const w=_+M;l=t.push("list_item_open","li",1),l.markup=String.fromCharCode(u);const T=[c,0];l.map=T,h&&(l.info=t.src.slice(i,p-1));const j=t.tight,W=t.tShift[c],Lt=t.sCount[c],zt=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=w,t.tight=!0,t.tShift[c]=x-t.bMarks[c],t.sCount[c]=y,x>=r&&t.isEmpty(c+1)?t.line=Math.min(t.line+2,e):t.md.block.tokenize(t,c,e,!0),(!t.tight||C)&&(a=!1),C=t.line-c>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=zt,t.tShift[c]=W,t.sCount[c]=Lt,t.tight=j,l=t.push("list_item_close","li",-1),l.markup=String.fromCharCode(u),c=t.line,T[1]=c,c>=e||t.sCount[c]<t.blkIndent||t.sCount[c]-t.blkIndent>=4)break;let ot=!1;for(let O=0,Tt=k.length;O<Tt;O++)if(k[O](t,c,e,!0)){ot=!0;break}if(ot)break;if(h){if(p=ft(t,c),p<0)break;i=t.bMarks[c]+t.tShift[c]}else if(p=ut(t,c),p<0)break;if(u!==t.src.charCodeAt(p-1))break}return h?l=t.push("ordered_list_close","ol",-1):l=t.push("bullet_list_close","ul",-1),l.markup=String.fromCharCode(u),m[1]=c,t.line=c,t.parentType=b,a&&Tn(t,d),!0}function On(t,n,e,o){let r=t.bMarks[n]+t.tShift[n],s=t.eMarks[n],i=n+1;if(t.sCount[n]-t.blkIndent>=4||t.src.charCodeAt(r)!==91)return!1;function l(k){const b=t.lineMax;if(k>=b||t.isEmpty(k))return null;let _=!1;if(t.sCount[k]-t.blkIndent>3&&(_=!0),t.sCount[k]<0&&(_=!0),!_){const M=t.md.block.ruler.getRules("reference"),w=t.parentType;t.parentType="reference";let T=!1;for(let j=0,W=M.length;j<W;j++)if(M[j](t,k,b,!0)){T=!0;break}if(t.parentType=w,T)return null}const y=t.bMarks[k]+t.tShift[k],x=t.eMarks[k];return t.src.slice(y,x+1)}let c=t.src.slice(r,s+1);s=c.length;let a=-1;for(r=1;r<s;r++){const k=c.charCodeAt(r);if(k===91)return!1;if(k===93){a=r;break}else if(k===10){const b=l(i);b!==null&&(c+=b,s=c.length,i++)}else if(k===92&&(r++,r<s&&c.charCodeAt(r)===10)){const b=l(i);b!==null&&(c+=b,s=c.length,i++)}}if(a<0||c.charCodeAt(a+1)!==58)return!1;for(r=a+2;r<s;r++){const k=c.charCodeAt(r);if(k===10){const b=l(i);b!==null&&(c+=b,s=c.length,i++)}else if(!A(k))break}const f=t.md.helpers.parseLinkDestination(c,r,s);if(!f.ok)return!1;const h=t.md.normalizeLink(f.str);if(!t.md.validateLink(h))return!1;r=f.pos;const g=r,p=i,u=r;for(;r<s;r++){const k=c.charCodeAt(r);if(k===10){const b=l(i);b!==null&&(c+=b,s=c.length,i++)}else if(!A(k))break}let d=t.md.helpers.parseLinkTitle(c,r,s);for(;d.can_continue;){const k=l(i);if(k===null)break;c+=k,r=s,s=c.length,i++,d=t.md.helpers.parseLinkTitle(c,r,s,d)}let m;for(r<s&&u!==r&&d.ok?(m=d.str,r=d.pos):(m="",r=g,i=p);r<s;){const k=c.charCodeAt(r);if(!A(k))break;r++}if(r<s&&c.charCodeAt(r)!==10&&m)for(m="",r=g,i=p;r<s;){const k=c.charCodeAt(r);if(!A(k))break;r++}if(r<s&&c.charCodeAt(r)!==10)return!1;const C=J(c.slice(1,a));return C?(o||(typeof t.env.references>"u"&&(t.env.references={}),typeof t.env.references[C]>"u"&&(t.env.references[C]={title:m,href:h}),t.line=i),!0):!1}const $n=["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"],Pn="[a-zA-Z_:][a-zA-Z0-9:._-]*",qn="[^\"'=<>`\\x00-\\x20]+",jn="'[^']*'",Rn='"[^"]*"',Zn="(?:"+qn+"|"+jn+"|"+Rn+")",Dn="(?:\\s+"+Pn+"(?:\\s*=\\s*"+Zn+")?)",Mt="<[A-Za-z][A-Za-z0-9\\-]*"+Dn+"*\\s*\\/?>",vt="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Nn="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",Bn="<[?][\\s\\S]*?[?]>",Fn="<![A-Za-z][^>]*>",Un="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",Gn=new RegExp("^(?:"+Mt+"|"+vt+"|"+Nn+"|"+Bn+"|"+Fn+"|"+Un+")"),Hn=new RegExp("^(?:"+Mt+"|"+vt+")"),$=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+$n.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(Hn.source+"\\s*$"),/^$/,!1]];function Jn(t,n,e,o){let r=t.bMarks[n]+t.tShift[n],s=t.eMarks[n];if(t.sCount[n]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(r)!==60)return!1;let i=t.src.slice(r,s),l=0;for(;l<$.length&&!$[l][0].test(i);l++);if(l===$.length)return!1;if(o)return $[l][2];let c=n+1;if(!$[l][1].test(i)){for(;c<e&&!(t.sCount[c]<t.blkIndent);c++)if(r=t.bMarks[c]+t.tShift[c],s=t.eMarks[c],i=t.src.slice(r,s),$[l][1].test(i)){i.length!==0&&c++;break}}t.line=c;const a=t.push("html_block","",0);return a.map=[n,c],a.content=t.getLines(n,c,t.blkIndent,!0),!0}function Vn(t,n,e,o){let r=t.bMarks[n]+t.tShift[n],s=t.eMarks[n];if(t.sCount[n]-t.blkIndent>=4)return!1;let i=t.src.charCodeAt(r);if(i!==35||r>=s)return!1;let l=1;for(i=t.src.charCodeAt(++r);i===35&&r<s&&l<=6;)l++,i=t.src.charCodeAt(++r);if(l>6||r<s&&!A(i))return!1;if(o)return!0;s=t.skipSpacesBack(s,r);const c=t.skipCharsBack(s,35,r);c>r&&A(t.src.charCodeAt(c-1))&&(s=c),t.line=n+1;const a=t.push("heading_open","h"+String(l),1);a.markup="########".slice(0,l),a.map=[n,t.line];const f=t.push("inline","",0);f.content=t.src.slice(r,s).trim(),f.map=[n,t.line],f.children=[];const h=t.push("heading_close","h"+String(l),-1);return h.markup="########".slice(0,l),!0}function Wn(t,n,e){const o=t.md.block.ruler.getRules("paragraph");if(t.sCount[n]-t.blkIndent>=4)return!1;const r=t.parentType;t.parentType="paragraph";let s=0,i,l=n+1;for(;l<e&&!t.isEmpty(l);l++){if(t.sCount[l]-t.blkIndent>3)continue;if(t.sCount[l]>=t.blkIndent){let p=t.bMarks[l]+t.tShift[l];const u=t.eMarks[l];if(p<u&&(i=t.src.charCodeAt(p),(i===45||i===61)&&(p=t.skipChars(p,i),p=t.skipSpaces(p),p>=u))){s=i===61?1:2;break}}if(t.sCount[l]<0)continue;let g=!1;for(let p=0,u=o.length;p<u;p++)if(o[p](t,l,e,!0)){g=!0;break}if(g)break}if(!s)return!1;const c=t.getLines(n,l,t.blkIndent,!1).trim();t.line=l+1;const a=t.push("heading_open","h"+String(s),1);a.markup=String.fromCharCode(i),a.map=[n,t.line];const f=t.push("inline","",0);f.content=c,f.map=[n,t.line-1],f.children=[];const h=t.push("heading_close","h"+String(s),-1);return h.markup=String.fromCharCode(i),t.parentType=r,!0}function Xn(t,n,e){const o=t.md.block.ruler.getRules("paragraph"),r=t.parentType;let s=n+1;for(t.parentType="paragraph";s<e&&!t.isEmpty(s);s++){if(t.sCount[s]-t.blkIndent>3||t.sCount[s]<0)continue;let a=!1;for(let f=0,h=o.length;f<h;f++)if(o[f](t,s,e,!0)){a=!0;break}if(a)break}const i=t.getLines(n,s,t.blkIndent,!1).trim();t.line=s;const l=t.push("paragraph_open","p",1);l.map=[n,t.line];const c=t.push("inline","",0);return c.content=i,c.map=[n,t.line],c.children=[],t.push("paragraph_close","p",-1),t.parentType=r,!0}const U=[["table",wn,["paragraph","reference"]],["code",Sn],["fence",In,["paragraph","reference","blockquote","list"]],["blockquote",Ln,["paragraph","reference","blockquote","list"]],["hr",zn,["paragraph","reference","blockquote","list"]],["list",En,["paragraph","reference","blockquote"]],["reference",On],["html_block",Jn,["paragraph","reference","blockquote"]],["heading",Vn,["paragraph","reference","blockquote"]],["lheading",Wn],["paragraph",Xn]];function V(){this.ruler=new v;for(let t=0;t<U.length;t++)this.ruler.push(U[t][0],U[t][1],{alt:(U[t][2]||[]).slice()})}V.prototype.tokenize=function(t,n,e){const o=this.ruler.getRules(""),r=o.length,s=t.md.options.maxNesting;let i=n,l=!1;for(;i<e&&(t.line=i=t.skipEmptyLines(i),!(i>=e||t.sCount[i]<t.blkIndent));){if(t.level>=s){t.line=e;break}const c=t.line;let a=!1;for(let f=0;f<r;f++)if(a=o[f](t,i,e,!1),a){if(c>=t.line)throw new Error("block rule didn't increment state.line");break}if(!a)throw new Error("none of the block rules matched");t.tight=!l,t.isEmpty(t.line-1)&&(l=!0),i=t.line,i<e&&t.isEmpty(i)&&(l=!0,i++,t.line=i)}};V.prototype.parse=function(t,n,e,o){if(!t)return;const r=new this.State(t,n,e,o);this.tokenize(r,r.line,r.lineMax)};V.prototype.State=z;function N(t,n,e,o){this.src=t,this.env=e,this.md=n,this.tokens=o,this.tokens_meta=Array(o.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}N.prototype.pushPending=function(){const t=new I("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t};N.prototype.push=function(t,n,e){this.pending&&this.pushPending();const o=new I(t,n,e);let r=null;return e<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),o.level=this.level,e>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(r),o};N.prototype.scanDelims=function(t,n){const e=this.posMax,o=this.src.charCodeAt(t),r=t>0?this.src.charCodeAt(t-1):32;let s=t;for(;s<e&&this.src.charCodeAt(s)===o;)s++;const i=s-t,l=s<e?this.src.charCodeAt(s):32,c=D(r)||Z(String.fromCharCode(r)),a=D(l)||Z(String.fromCharCode(l)),f=R(r),h=R(l),g=!h&&(!a||f||c),p=!f&&(!c||h||a);return{can_open:g&&(n||!p||c),can_close:p&&(n||!g||a),length:i}};N.prototype.Token=I;function Kn(t){switch(t){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function Qn(t,n){let e=t.pos;for(;e<t.posMax&&!Kn(t.src.charCodeAt(e));)e++;return e===t.pos?!1:(n||(t.pending+=t.src.slice(t.pos,e)),t.pos=e,!0)}const Yn=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function te(t,n){if(!t.md.options.linkify||t.linkLevel>0)return!1;const e=t.pos,o=t.posMax;if(e+3>o||t.src.charCodeAt(e)!==58||t.src.charCodeAt(e+1)!==47||t.src.charCodeAt(e+2)!==47)return!1;const r=t.pending.match(Yn);if(!r)return!1;const s=r[1],i=t.md.linkify.matchAtStart(t.src.slice(e-s.length));if(!i)return!1;let l=i.url;if(l.length<=s.length)return!1;l=l.replace(/\*+$/,"");const c=t.md.normalizeLink(l);if(!t.md.validateLink(c))return!1;if(!n){t.pending=t.pending.slice(0,-s.length);const a=t.push("link_open","a",1);a.attrs=[["href",c]],a.markup="linkify",a.info="auto";const f=t.push("text","",0);f.content=t.md.normalizeLinkText(l);const h=t.push("link_close","a",-1);h.markup="linkify",h.info="auto"}return t.pos+=l.length-s.length,!0}function ne(t,n){let e=t.pos;if(t.src.charCodeAt(e)!==10)return!1;const o=t.pending.length-1,r=t.posMax;if(!n)if(o>=0&&t.pending.charCodeAt(o)===32)if(o>=1&&t.pending.charCodeAt(o-1)===32){let s=o-1;for(;s>=1&&t.pending.charCodeAt(s-1)===32;)s--;t.pending=t.pending.slice(0,s),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(e++;e<r&&A(t.src.charCodeAt(e));)e++;return t.pos=e,!0}const st=[];for(let t=0;t<256;t++)st.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(t){st[t.charCodeAt(0)]=1});function ee(t,n){let e=t.pos;const o=t.posMax;if(t.src.charCodeAt(e)!==92||(e++,e>=o))return!1;let r=t.src.charCodeAt(e);if(r===10){for(n||t.push("hardbreak","br",0),e++;e<o&&(r=t.src.charCodeAt(e),!!A(r));)e++;return t.pos=e,!0}let s=t.src[e];if(r>=55296&&r<=56319&&e+1<o){const l=t.src.charCodeAt(e+1);l>=56320&&l<=57343&&(s+=t.src[e+1],e++)}const i="\\"+s;if(!n){const l=t.push("text_special","",0);r<256&&st[r]!==0?l.content=s:l.content=i,l.markup=i,l.info="escape"}return t.pos=e+1,!0}function re(t,n){let e=t.pos;if(t.src.charCodeAt(e)!==96)return!1;const o=e;e++;const r=t.posMax;for(;e<r&&t.src.charCodeAt(e)===96;)e++;const s=t.src.slice(o,e),i=s.length;if(t.backticksScanned&&(t.backticks[i]||0)<=o)return n||(t.pending+=s),t.pos+=i,!0;let l=e,c;for(;(c=t.src.indexOf("`",l))!==-1;){for(l=c+1;l<r&&t.src.charCodeAt(l)===96;)l++;const a=l-c;if(a===i){if(!n){const f=t.push("code_inline","code",0);f.markup=s,f.content=t.src.slice(e,c).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return t.pos=l,!0}t.backticks[a]=c}return t.backticksScanned=!0,n||(t.pending+=s),t.pos+=i,!0}function se(t,n){const e=t.pos,o=t.src.charCodeAt(e);if(n||o!==126)return!1;const r=t.scanDelims(t.pos,!0);let s=r.length;const i=String.fromCharCode(o);if(s<2)return!1;let l;s%2&&(l=t.push("text","",0),l.content=i,s--);for(let c=0;c<s;c+=2)l=t.push("text","",0),l.content=i+i,t.delimiters.push({marker:o,length:0,token:t.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return t.pos+=r.length,!0}function ht(t,n){let e;const o=[],r=n.length;for(let s=0;s<r;s++){const i=n[s];if(i.marker!==126||i.end===-1)continue;const l=n[i.end];e=t.tokens[i.token],e.type="s_open",e.tag="s",e.nesting=1,e.markup="~~",e.content="",e=t.tokens[l.token],e.type="s_close",e.tag="s",e.nesting=-1,e.markup="~~",e.content="",t.tokens[l.token-1].type==="text"&&t.tokens[l.token-1].content==="~"&&o.push(l.token-1)}for(;o.length;){const s=o.pop();let i=s+1;for(;i<t.tokens.length&&t.tokens[i].type==="s_close";)i++;i--,s!==i&&(e=t.tokens[i],t.tokens[i]=t.tokens[s],t.tokens[s]=e)}}function oe(t){const n=t.tokens_meta,e=t.tokens_meta.length;ht(t,t.delimiters);for(let o=0;o<e;o++)n[o]&&n[o].delimiters&&ht(t,n[o].delimiters)}const wt={tokenize:se,postProcess:oe};function ie(t,n){const e=t.pos,o=t.src.charCodeAt(e);if(n||o!==95&&o!==42)return!1;const r=t.scanDelims(t.pos,o===42);for(let s=0;s<r.length;s++){const i=t.push("text","",0);i.content=String.fromCharCode(o),t.delimiters.push({marker:o,length:r.length,token:t.tokens.length-1,end:-1,open:r.can_open,close:r.can_close})}return t.pos+=r.length,!0}function pt(t,n){const e=n.length;for(let o=e-1;o>=0;o--){const r=n[o];if(r.marker!==95&&r.marker!==42||r.end===-1)continue;const s=n[r.end],i=o>0&&n[o-1].end===r.end+1&&n[o-1].marker===r.marker&&n[o-1].token===r.token-1&&n[r.end+1].token===s.token+1,l=String.fromCharCode(r.marker),c=t.tokens[r.token];c.type=i?"strong_open":"em_open",c.tag=i?"strong":"em",c.nesting=1,c.markup=i?l+l:l,c.content="";const a=t.tokens[s.token];a.type=i?"strong_close":"em_close",a.tag=i?"strong":"em",a.nesting=-1,a.markup=i?l+l:l,a.content="",i&&(t.tokens[n[o-1].token].content="",t.tokens[n[r.end+1].token].content="",o--)}}function le(t){const n=t.tokens_meta,e=t.tokens_meta.length;pt(t,t.delimiters);for(let o=0;o<e;o++)n[o]&&n[o].delimiters&&pt(t,n[o].delimiters)}const St={tokenize:ie,postProcess:le};function ce(t,n){let e,o,r,s,i="",l="",c=t.pos,a=!0;if(t.src.charCodeAt(t.pos)!==91)return!1;const f=t.pos,h=t.posMax,g=t.pos+1,p=t.md.helpers.parseLinkLabel(t,t.pos,!0);if(p<0)return!1;let u=p+1;if(u<h&&t.src.charCodeAt(u)===40){for(a=!1,u++;u<h&&(e=t.src.charCodeAt(u),!(!A(e)&&e!==10));u++);if(u>=h)return!1;if(c=u,r=t.md.helpers.parseLinkDestination(t.src,u,t.posMax),r.ok){for(i=t.md.normalizeLink(r.str),t.md.validateLink(i)?u=r.pos:i="",c=u;u<h&&(e=t.src.charCodeAt(u),!(!A(e)&&e!==10));u++);if(r=t.md.helpers.parseLinkTitle(t.src,u,t.posMax),u<h&&c!==u&&r.ok)for(l=r.str,u=r.pos;u<h&&(e=t.src.charCodeAt(u),!(!A(e)&&e!==10));u++);}(u>=h||t.src.charCodeAt(u)!==41)&&(a=!0),u++}if(a){if(typeof t.env.references>"u")return!1;if(u<h&&t.src.charCodeAt(u)===91?(c=u+1,u=t.md.helpers.parseLinkLabel(t,u),u>=0?o=t.src.slice(c,u++):u=p+1):u=p+1,o||(o=t.src.slice(g,p)),s=t.env.references[J(o)],!s)return t.pos=f,!1;i=s.href,l=s.title}if(!n){t.pos=g,t.posMax=p;const d=t.push("link_open","a",1),m=[["href",i]];d.attrs=m,l&&m.push(["title",l]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=u,t.posMax=h,!0}function ae(t,n){let e,o,r,s,i,l,c,a,f="";const h=t.pos,g=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;const p=t.pos+2,u=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(u<0)return!1;if(s=u+1,s<g&&t.src.charCodeAt(s)===40){for(s++;s<g&&(e=t.src.charCodeAt(s),!(!A(e)&&e!==10));s++);if(s>=g)return!1;for(a=s,l=t.md.helpers.parseLinkDestination(t.src,s,t.posMax),l.ok&&(f=t.md.normalizeLink(l.str),t.md.validateLink(f)?s=l.pos:f=""),a=s;s<g&&(e=t.src.charCodeAt(s),!(!A(e)&&e!==10));s++);if(l=t.md.helpers.parseLinkTitle(t.src,s,t.posMax),s<g&&a!==s&&l.ok)for(c=l.str,s=l.pos;s<g&&(e=t.src.charCodeAt(s),!(!A(e)&&e!==10));s++);else c="";if(s>=g||t.src.charCodeAt(s)!==41)return t.pos=h,!1;s++}else{if(typeof t.env.references>"u")return!1;if(s<g&&t.src.charCodeAt(s)===91?(a=s+1,s=t.md.helpers.parseLinkLabel(t,s),s>=0?r=t.src.slice(a,s++):s=u+1):s=u+1,r||(r=t.src.slice(p,u)),i=t.env.references[J(r)],!i)return t.pos=h,!1;f=i.href,c=i.title}if(!n){o=t.src.slice(p,u);const d=[];t.md.inline.parse(o,t.md,t.env,d);const m=t.push("image","img",0),C=[["src",f],["alt",""]];m.attrs=C,m.children=d,m.content=o,c&&C.push(["title",c])}return t.pos=s,t.posMax=g,!0}const ue=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,fe=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function he(t,n){let e=t.pos;if(t.src.charCodeAt(e)!==60)return!1;const o=t.pos,r=t.posMax;for(;;){if(++e>=r)return!1;const i=t.src.charCodeAt(e);if(i===60)return!1;if(i===62)break}const s=t.src.slice(o+1,e);if(fe.test(s)){const i=t.md.normalizeLink(s);if(!t.md.validateLink(i))return!1;if(!n){const l=t.push("link_open","a",1);l.attrs=[["href",i]],l.markup="autolink",l.info="auto";const c=t.push("text","",0);c.content=t.md.normalizeLinkText(s);const a=t.push("link_close","a",-1);a.markup="autolink",a.info="auto"}return t.pos+=s.length+2,!0}if(ue.test(s)){const i=t.md.normalizeLink("mailto:"+s);if(!t.md.validateLink(i))return!1;if(!n){const l=t.push("link_open","a",1);l.attrs=[["href",i]],l.markup="autolink",l.info="auto";const c=t.push("text","",0);c.content=t.md.normalizeLinkText(s);const a=t.push("link_close","a",-1);a.markup="autolink",a.info="auto"}return t.pos+=s.length+2,!0}return!1}function pe(t){return/^<a[>\s]/i.test(t)}function de(t){return/^<\/a\s*>/i.test(t)}function ke(t){const n=t|32;return n>=97&&n<=122}function me(t,n){if(!t.md.options.html)return!1;const e=t.posMax,o=t.pos;if(t.src.charCodeAt(o)!==60||o+2>=e)return!1;const r=t.src.charCodeAt(o+1);if(r!==33&&r!==63&&r!==47&&!ke(r))return!1;const s=t.src.slice(o).match(Gn);if(!s)return!1;if(!n){const i=t.push("html_inline","",0);i.content=s[0],pe(i.content)&&t.linkLevel++,de(i.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}const ge=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,be=/^&([a-z][a-z0-9]{1,31});/i;function _e(t,n){const e=t.pos,o=t.posMax;if(t.src.charCodeAt(e)!==38||e+1>=o)return!1;if(t.src.charCodeAt(e+1)===35){const r=t.src.slice(e).match(ge);if(r){if(!n){const s=r[1][0].toLowerCase()==="x"?parseInt(r[1].slice(1),16):parseInt(r[1],10),i=t.push("text_special","",0);i.content=et(s)?G(s):G(65533),i.markup=r[0],i.info="entity"}return t.pos+=r[0].length,!0}}else{const r=t.src.slice(e).match(be);if(r){const s=bt(r[0]);if(s!==r[0]){if(!n){const i=t.push("text_special","",0);i.content=s,i.markup=r[0],i.info="entity"}return t.pos+=r[0].length,!0}}}return!1}function dt(t){const n={},e=t.length;if(!e)return;let o=0,r=-2;const s=[];for(let i=0;i<e;i++){const l=t[i];if(s.push(0),(t[o].marker!==l.marker||r!==l.token-1)&&(o=i),r=l.token,l.length=l.length||0,!l.close)continue;n.hasOwnProperty(l.marker)||(n[l.marker]=[-1,-1,-1,-1,-1,-1]);const c=n[l.marker][(l.open?3:0)+l.length%3];let a=o-s[o]-1,f=a;for(;a>c;a-=s[a]+1){const h=t[a];if(h.marker===l.marker&&h.open&&h.end<0){let g=!1;if((h.close||l.open)&&(h.length+l.length)%3===0&&(h.length%3!==0||l.length%3!==0)&&(g=!0),!g){const p=a>0&&!t[a-1].open?s[a-1]+1:0;s[i]=i-a+p,s[a]=p,l.open=!1,h.end=i,h.close=!1,f=-1,r=-2;break}}}f!==-1&&(n[l.marker][(l.open?3:0)+(l.length||0)%3]=f)}}function Ce(t){const n=t.tokens_meta,e=t.tokens_meta.length;dt(t.delimiters);for(let o=0;o<e;o++)n[o]&&n[o].delimiters&&dt(n[o].delimiters)}function ye(t){let n,e,o=0;const r=t.tokens,s=t.tokens.length;for(n=e=0;n<s;n++)r[n].nesting<0&&o--,r[n].level=o,r[n].nesting>0&&o++,r[n].type==="text"&&n+1<s&&r[n+1].type==="text"?r[n+1].content=r[n].content+r[n+1].content:(n!==e&&(r[e]=r[n]),e++);n!==e&&(r.length=e)}const Q=[["text",Qn],["linkify",te],["newline",ne],["escape",ee],["backticks",re],["strikethrough",wt.tokenize],["emphasis",St.tokenize],["link",ce],["image",ae],["autolink",he],["html_inline",me],["entity",_e]],Y=[["balance_pairs",Ce],["strikethrough",wt.postProcess],["emphasis",St.postProcess],["fragments_join",ye]];function B(){this.ruler=new v;for(let t=0;t<Q.length;t++)this.ruler.push(Q[t][0],Q[t][1]);this.ruler2=new v;for(let t=0;t<Y.length;t++)this.ruler2.push(Y[t][0],Y[t][1])}B.prototype.skipToken=function(t){const n=t.pos,e=this.ruler.getRules(""),o=e.length,r=t.md.options.maxNesting,s=t.cache;if(typeof s[n]<"u"){t.pos=s[n];return}let i=!1;if(t.level<r){for(let l=0;l<o;l++)if(t.level++,i=e[l](t,!0),t.level--,i){if(n>=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;i||t.pos++,s[n]=t.pos};B.prototype.tokenize=function(t){const n=this.ruler.getRules(""),e=n.length,o=t.posMax,r=t.md.options.maxNesting;for(;t.pos<o;){const s=t.pos;let i=!1;if(t.level<r){for(let l=0;l<e;l++)if(i=n[l](t,!1),i){if(s>=t.pos)throw new Error("inline rule didn't increment state.pos");break}}if(i){if(t.pos>=o)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()};B.prototype.parse=function(t,n,e,o){const r=new this.State(t,n,e,o);this.tokenize(r);const s=this.ruler2.getRules(""),i=s.length;for(let l=0;l<i;l++)s[l](r)};B.prototype.State=N;const xe={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},Ae={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},Me={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},ve={default:xe,zero:Ae,commonmark:Me},we=/^(vbscript|javascript|file|data):/,Se=/^data:image\/(gif|png|jpeg|webp);/;function Ie(t){const n=t.trim().toLowerCase();return we.test(n)?Se.test(n):!0}const It=["http:","https:","mailto:"];function Le(t){const n=mt(t,!0);if(n.hostname&&(!n.protocol||It.indexOf(n.protocol)>=0))try{n.hostname=_t.toASCII(n.hostname)}catch{}return Et(gt(n))}function ze(t){const n=mt(t,!0);if(n.hostname&&(!n.protocol||It.indexOf(n.protocol)>=0))try{n.hostname=_t.toUnicode(n.hostname)}catch{}return it(gt(n),it.defaultChars+"%")}function S(t,n){if(!(this instanceof S))return new S(t,n);n||nt(t)||(n=t||{},t="default"),this.inline=new B,this.block=new V,this.core=new rt,this.renderer=new q,this.linkify=new jt,this.validateLink=Ie,this.normalizeLink=Le,this.normalizeLinkText=ze,this.utils=tn,this.helpers=H({},sn),this.options={},this.configure(t),n&&this.set(n)}S.prototype.set=function(t){return H(this.options,t),this};S.prototype.configure=function(t){const n=this;if(nt(t)){const e=t;if(t=ve[e],!t)throw new Error('Wrong `markdown-it` preset "'+e+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&n.set(t.options),t.components&&Object.keys(t.components).forEach(function(e){t.components[e].rules&&n[e].ruler.enableOnly(t.components[e].rules),t.components[e].rules2&&n[e].ruler2.enableOnly(t.components[e].rules2)}),this};S.prototype.enable=function(t,n){let e=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(r){e=e.concat(this[r].ruler.enable(t,!0))},this),e=e.concat(this.inline.ruler2.enable(t,!0));const o=t.filter(function(r){return e.indexOf(r)<0});if(o.length&&!n)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+o);return this};S.prototype.disable=function(t,n){let e=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(r){e=e.concat(this[r].ruler.disable(t,!0))},this),e=e.concat(this.inline.ruler2.disable(t,!0));const o=t.filter(function(r){return e.indexOf(r)<0});if(o.length&&!n)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+o);return this};S.prototype.use=function(t){const n=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,n),this};S.prototype.parse=function(t,n){if(typeof t!="string")throw new Error("Input data should be a String");const e=new this.core.State(t,this,n);return this.core.process(e),e.tokens};S.prototype.render=function(t,n){return n=n||{},this.renderer.render(this.parse(t,n),this.options,n)};S.prototype.parseInline=function(t,n){const e=new this.core.State(t,this,n);return e.inlineMode=!0,this.core.process(e),e.tokens};S.prototype.renderInline=function(t,n){return n=n||{},this.renderer.render(this.parseInline(t,n),this.options,n)};var tt,kt;function Te(){if(kt)return tt;kt=1;var t=!0,n=!1,e=!1;tt=function(d,m){m&&(t=!m.enabled,n=!!m.label,e=!!m.labelAfter),d.core.ruler.after("inline","github-task-lists",function(C){for(var k=C.tokens,b=2;b<k.length;b++)s(k,b)&&(i(k[b],C.Token),o(k[b-2],"class","task-list-item"+(t?"":" enabled")),o(k[r(k,b-2)],"class","contains-task-list"))})};function o(d,m,C){var k=d.attrIndex(m),b=[m,C];k<0?d.attrPush(b):d.attrs[k]=b}function r(d,m){for(var C=d[m].level-1,k=m-1;k>=0;k--)if(d[k].level===C)return k;return-1}function s(d,m){return h(d[m])&&g(d[m-1])&&p(d[m-2])&&u(d[m])}function i(d,m){if(d.children.unshift(l(d,m)),d.children[1].content=d.children[1].content.slice(3),d.content=d.content.slice(3),n)if(e){d.children.pop();var C="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);d.children[0].content=d.children[0].content.slice(0,-1)+' id="'+C+'">',d.children.push(f(d.content,C,m))}else d.children.unshift(c(m)),d.children.push(a(m))}function l(d,m){var C=new m("html_inline","",0),k=t?' disabled="" ':"";return d.content.indexOf("[ ] ")===0?C.content='<input class="task-list-item-checkbox"'+k+'type="checkbox">':(d.content.indexOf("[x] ")===0||d.content.indexOf("[X] ")===0)&&(C.content='<input class="task-list-item-checkbox" checked=""'+k+'type="checkbox">'),C}function c(d){var m=new d("html_inline","",0);return m.content="<label>",m}function a(d){var m=new d("html_inline","",0);return m.content="</label>",m}function f(d,m,C){var k=new C("html_inline","",0);return k.content='<label class="task-list-item-label" for="'+m+'">'+d+"</label>",k.attrs=[{for:m}],k}function h(d){return d.type==="inline"}function g(d){return d.type==="paragraph_open"}function p(d){return d.type==="list_item_open"}function u(d){return d.content.indexOf("[ ] ")===0||d.content.indexOf("[x] ")===0||d.content.indexOf("[X] ")===0}return tt}var Ee=Te();const Ze=Rt(Ee);export{Ze as O,S as w};
