-
Notifications
You must be signed in to change notification settings - Fork 0
/
chunk-AY2JODOE.js
7 lines (7 loc) · 58.3 KB
/
chunk-AY2JODOE.js
1
2
3
4
5
6
7
import{a as ft,aa as xt,xa as gt}from"./chunk-FUWO5VGL.js";import{g as ae}from"./chunk-BL3FZZIZ.js";var oe={};function Un(n,r){let t=r||oe,e=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,a=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return dt(n,e,a)}function dt(n,r,t){if(le(n)){if("value"in n)return n.type==="html"&&!t?"":n.value;if(r&&"alt"in n&&n.alt)return n.alt;if("children"in n)return kt(n.children,r,t)}return Array.isArray(n)?kt(n,r,t):""}function kt(n,r,t){let e=[],a=-1;for(;++a<n.length;)e[a]=dt(n[a],r,t);return e.join("")}function le(n){return!!(n&&typeof n=="object")}function $(n,r,t,e){let a=n.length,i=0,u;if(r<0?r=-r>a?0:a+r:r=r>a?a:r,t=t>0?t:0,e.length<1e4)u=Array.from(e),u.unshift(r,t),n.splice(...u);else for(t&&n.splice(r,t);i<e.length;)u=e.slice(i,i+1e4),u.unshift(r,0),n.splice(...u),i+=1e4,r+=1e4}function G(n,r){return n.length>0?($(n,n.length,0,r),n):r}var yt={}.hasOwnProperty;function bt(n){let r={},t=-1;for(;++t<n.length;)se(r,n[t]);return r}function se(n,r){let t;for(t in r){let a=(yt.call(n,t)?n[t]:void 0)||(n[t]={}),i=r[t],u;if(i)for(u in i){yt.call(a,u)||(a[u]=[]);let o=i[u];ce(a[u],Array.isArray(o)?o:o?[o]:[])}}}function ce(n,r){let t=-1,e=[];for(;++t<r.length;)(r[t].add==="after"?n:e).push(r[t]);$(n,0,0,e)}var St=/[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/;var X=cn(/[A-Za-z]/),J=cn(/[\dA-Za-z]/),wt=cn(/[#-'*+\--9=?A-Z^-~]/);function An(n){return n!==null&&(n<32||n===127)}var zn=cn(/\d/),Et=cn(/[\dA-Fa-f]/),Ft=cn(/[!-/:-@[-`{-~]/);function b(n){return n!==null&&n<-2}function N(n){return n!==null&&(n<0||n===32)}function F(n){return n===-2||n===-1||n===32}var Ct=cn(St),At=cn(/\s/);function cn(n){return r;function r(t){return t!==null&&n.test(String.fromCharCode(t))}}function C(n,r,t,e){let a=e?e-1:Number.POSITIVE_INFINITY,i=0;return u;function u(f){return F(f)?(n.enter(t),o(f)):r(f)}function o(f){return F(f)&&i++<a?(n.consume(f),o):(n.exit(t),r(f))}}var zt={tokenize:pe};function pe(n){let r=n.attempt(this.parser.constructs.contentInitial,e,a),t;return r;function e(o){if(o===null){n.consume(o);return}return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),C(n,r,"linePrefix")}function a(o){return n.enter("paragraph"),i(o)}function i(o){let f=n.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=f),t=f,u(o)}function u(o){if(o===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(o);return}return b(o)?(n.consume(o),n.exit("chunkText"),i):(n.consume(o),u)}}var Tt={tokenize:me},It={tokenize:he};function me(n){let r=this,t=[],e=0,a,i,u;return o;function o(S){if(e<t.length){let _=t[e];return r.containerState=_[1],n.attempt(_[0].continuation,f,m)(S)}return m(S)}function f(S){if(e++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,a&&R();let _=r.events.length,M=_,k;for(;M--;)if(r.events[M][0]==="exit"&&r.events[M][1].type==="chunkFlow"){k=r.events[M][1].end;break}y(e);let D=_;for(;D<r.events.length;)r.events[D][1].end=Object.assign({},k),D++;return $(r.events,M+1,0,r.events.slice(_)),r.events.length=D,m(S)}return o(S)}function m(S){if(e===t.length){if(!a)return h(S);if(a.currentConstruct&&a.currentConstruct.concrete)return T(S);r.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return r.containerState={},n.check(It,c,x)(S)}function c(S){return a&&R(),y(e),h(S)}function x(S){return r.parser.lazy[r.now().line]=e!==t.length,u=r.now().offset,T(S)}function h(S){return r.containerState={},n.attempt(It,p,T)(S)}function p(S){return e++,t.push([r.currentConstruct,r.containerState]),h(S)}function T(S){if(S===null){a&&R(),y(0),n.consume(S);return}return a=a||r.parser.flow(r.now()),n.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:a}),B(S)}function B(S){if(S===null){P(n.exit("chunkFlow"),!0),y(0),n.consume(S);return}return b(S)?(n.consume(S),P(n.exit("chunkFlow")),e=0,r.interrupt=void 0,o):(n.consume(S),B)}function P(S,_){let M=r.sliceStream(S);if(_&&M.push(null),S.previous=i,i&&(i.next=S),i=S,a.defineSkip(S.start),a.write(M),r.parser.lazy[S.start.line]){let k=a.events.length;for(;k--;)if(a.events[k][1].start.offset<u&&(!a.events[k][1].end||a.events[k][1].end.offset>u))return;let D=r.events.length,V=D,W,Z;for(;V--;)if(r.events[V][0]==="exit"&&r.events[V][1].type==="chunkFlow"){if(W){Z=r.events[V][1].end;break}W=!0}for(y(e),k=D;k<r.events.length;)r.events[k][1].end=Object.assign({},Z),k++;$(r.events,V+1,0,r.events.slice(D)),r.events.length=k}}function y(S){let _=t.length;for(;_-- >S;){let M=t[_];r.containerState=M[1],M[0].exit.call(r,n)}t.length=S}function R(){a.write([null]),i=void 0,a=void 0,r.containerState._closeFlow=void 0}}function he(n,r,t){return C(n,n.attempt(this.parser.constructs.document,r,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function $n(n){if(n===null||N(n)||At(n))return 1;if(Ct(n))return 2}function yn(n,r,t){let e=[],a=-1;for(;++a<n.length;){let i=n[a].resolveAll;i&&!e.includes(i)&&(r=i(r,t),e.push(i))}return r}var In={name:"attention",tokenize:xe,resolveAll:fe};function fe(n,r){let t=-1,e,a,i,u,o,f,m,c;for(;++t<n.length;)if(n[t][0]==="enter"&&n[t][1].type==="attentionSequence"&&n[t][1]._close){for(e=t;e--;)if(n[e][0]==="exit"&&n[e][1].type==="attentionSequence"&&n[e][1]._open&&r.sliceSerialize(n[e][1]).charCodeAt(0)===r.sliceSerialize(n[t][1]).charCodeAt(0)){if((n[e][1]._close||n[t][1]._open)&&(n[t][1].end.offset-n[t][1].start.offset)%3&&!((n[e][1].end.offset-n[e][1].start.offset+n[t][1].end.offset-n[t][1].start.offset)%3))continue;f=n[e][1].end.offset-n[e][1].start.offset>1&&n[t][1].end.offset-n[t][1].start.offset>1?2:1;let x=Object.assign({},n[e][1].end),h=Object.assign({},n[t][1].start);Bt(x,-f),Bt(h,f),u={type:f>1?"strongSequence":"emphasisSequence",start:x,end:Object.assign({},n[e][1].end)},o={type:f>1?"strongSequence":"emphasisSequence",start:Object.assign({},n[t][1].start),end:h},i={type:f>1?"strongText":"emphasisText",start:Object.assign({},n[e][1].end),end:Object.assign({},n[t][1].start)},a={type:f>1?"strong":"emphasis",start:Object.assign({},u.start),end:Object.assign({},o.end)},n[e][1].end=Object.assign({},u.start),n[t][1].start=Object.assign({},o.end),m=[],n[e][1].end.offset-n[e][1].start.offset&&(m=G(m,[["enter",n[e][1],r],["exit",n[e][1],r]])),m=G(m,[["enter",a,r],["enter",u,r],["exit",u,r],["enter",i,r]]),m=G(m,yn(r.parser.constructs.insideSpan.null,n.slice(e+1,t),r)),m=G(m,[["exit",i,r],["enter",o,r],["exit",o,r],["exit",a,r]]),n[t][1].end.offset-n[t][1].start.offset?(c=2,m=G(m,[["enter",n[t][1],r],["exit",n[t][1],r]])):c=0,$(n,e-1,t-e+3,m),t=e+m.length-c-2;break}}for(t=-1;++t<n.length;)n[t][1].type==="attentionSequence"&&(n[t][1].type="data");return n}function xe(n,r){let t=this.parser.constructs.attentionMarkers.null,e=this.previous,a=$n(e),i;return u;function u(f){return i=f,n.enter("attentionSequence"),o(f)}function o(f){if(f===i)return n.consume(f),o;let m=n.exit("attentionSequence"),c=$n(f),x=!c||c===2&&a||t.includes(f),h=!a||a===2&&c||t.includes(e);return m._open=!!(i===42?x:x&&(a||!h)),m._close=!!(i===42?h:h&&(c||!x)),r(f)}}function Bt(n,r){n.column+=r,n.offset+=r,n._bufferIndex+=r}var Zn={name:"autolink",tokenize:ge};function ge(n,r,t){let e=0;return a;function a(p){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(p),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),i}function i(p){return X(p)?(n.consume(p),u):m(p)}function u(p){return p===43||p===45||p===46||J(p)?(e=1,o(p)):m(p)}function o(p){return p===58?(n.consume(p),e=0,f):(p===43||p===45||p===46||J(p))&&e++<32?(n.consume(p),o):(e=0,m(p))}function f(p){return p===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(p),n.exit("autolinkMarker"),n.exit("autolink"),r):p===null||p===32||p===60||An(p)?t(p):(n.consume(p),f)}function m(p){return p===64?(n.consume(p),c):wt(p)?(n.consume(p),m):t(p)}function c(p){return J(p)?x(p):t(p)}function x(p){return p===46?(n.consume(p),e=0,c):p===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(p),n.exit("autolinkMarker"),n.exit("autolink"),r):h(p)}function h(p){if((p===45||J(p))&&e++<63){let T=p===45?h:x;return n.consume(p),T}return t(p)}}var pn={tokenize:ke,partial:!0};function ke(n,r,t){return e;function e(i){return F(i)?C(n,a,"linePrefix")(i):a(i)}function a(i){return i===null||b(i)?r(i):t(i)}}var Ln={name:"blockQuote",tokenize:de,continuation:{tokenize:ye},exit:be};function de(n,r,t){let e=this;return a;function a(u){if(u===62){let o=e.containerState;return o.open||(n.enter("blockQuote",{_container:!0}),o.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(u),n.exit("blockQuoteMarker"),i}return t(u)}function i(u){return F(u)?(n.enter("blockQuotePrefixWhitespace"),n.consume(u),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),r):(n.exit("blockQuotePrefix"),r(u))}}function ye(n,r,t){let e=this;return a;function a(u){return F(u)?C(n,i,"linePrefix",e.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):i(u)}function i(u){return n.attempt(Ln,r,t)(u)}}function be(n){n.exit("blockQuote")}var On={name:"characterEscape",tokenize:Se};function Se(n,r,t){return e;function e(i){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(i),n.exit("escapeMarker"),a}function a(i){return Ft(i)?(n.enter("characterEscapeValue"),n.consume(i),n.exit("characterEscapeValue"),n.exit("characterEscape"),r):t(i)}}var Lt=document.createElement("i");function bn(n){let r="&"+n+";";Lt.innerHTML=r;let t=Lt.textContent;return t.charCodeAt(t.length-1)===59&&n!=="semi"||t===r?!1:t}var Dn={name:"characterReference",tokenize:we};function we(n,r,t){let e=this,a=0,i,u;return o;function o(x){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(x),n.exit("characterReferenceMarker"),f}function f(x){return x===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(x),n.exit("characterReferenceMarkerNumeric"),m):(n.enter("characterReferenceValue"),i=31,u=J,c(x))}function m(x){return x===88||x===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(x),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),i=6,u=Et,c):(n.enter("characterReferenceValue"),i=7,u=zn,c(x))}function c(x){if(x===59&&a){let h=n.exit("characterReferenceValue");return u===J&&!bn(e.sliceSerialize(h))?t(x):(n.enter("characterReferenceMarker"),n.consume(x),n.exit("characterReferenceMarker"),n.exit("characterReference"),r)}return u(x)&&a++<i?(n.consume(x),c):t(x)}}var Ot={tokenize:Fe,partial:!0},Pn={name:"codeFenced",tokenize:Ee,concrete:!0};function Ee(n,r,t){let e=this,a={tokenize:M,partial:!0},i=0,u=0,o;return f;function f(k){return m(k)}function m(k){let D=e.events[e.events.length-1];return i=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,o=k,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),c(k)}function c(k){return k===o?(u++,n.consume(k),c):u<3?t(k):(n.exit("codeFencedFenceSequence"),F(k)?C(n,x,"whitespace")(k):x(k))}function x(k){return k===null||b(k)?(n.exit("codeFencedFence"),e.interrupt?r(k):n.check(Ot,B,_)(k)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),h(k))}function h(k){return k===null||b(k)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),x(k)):F(k)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),C(n,p,"whitespace")(k)):k===96&&k===o?t(k):(n.consume(k),h)}function p(k){return k===null||b(k)?x(k):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),T(k))}function T(k){return k===null||b(k)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),x(k)):k===96&&k===o?t(k):(n.consume(k),T)}function B(k){return n.attempt(a,_,P)(k)}function P(k){return n.enter("lineEnding"),n.consume(k),n.exit("lineEnding"),y}function y(k){return i>0&&F(k)?C(n,R,"linePrefix",i+1)(k):R(k)}function R(k){return k===null||b(k)?n.check(Ot,B,_)(k):(n.enter("codeFlowValue"),S(k))}function S(k){return k===null||b(k)?(n.exit("codeFlowValue"),R(k)):(n.consume(k),S)}function _(k){return n.exit("codeFenced"),r(k)}function M(k,D,V){let W=0;return Z;function Z(A){return k.enter("lineEnding"),k.consume(A),k.exit("lineEnding"),H}function H(A){return k.enter("codeFencedFence"),F(A)?C(k,I,"linePrefix",e.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):I(A)}function I(A){return A===o?(k.enter("codeFencedFenceSequence"),w(A)):V(A)}function w(A){return A===o?(W++,k.consume(A),w):W>=u?(k.exit("codeFencedFenceSequence"),F(A)?C(k,z,"whitespace")(A):z(A)):V(A)}function z(A){return A===null||b(A)?(k.exit("codeFencedFence"),D(A)):V(A)}}}function Fe(n,r,t){let e=this;return a;function a(u){return u===null?t(u):(n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),i)}function i(u){return e.parser.lazy[e.now().line]?t(u):r(u)}}var Tn={name:"codeIndented",tokenize:Ae},Ce={tokenize:ze,partial:!0};function Ae(n,r,t){let e=this;return a;function a(m){return n.enter("codeIndented"),C(n,i,"linePrefix",5)(m)}function i(m){let c=e.events[e.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?u(m):t(m)}function u(m){return m===null?f(m):b(m)?n.attempt(Ce,u,f)(m):(n.enter("codeFlowValue"),o(m))}function o(m){return m===null||b(m)?(n.exit("codeFlowValue"),u(m)):(n.consume(m),o)}function f(m){return n.exit("codeIndented"),r(m)}}function ze(n,r,t){let e=this;return a;function a(u){return e.parser.lazy[e.now().line]?t(u):b(u)?(n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),a):C(n,i,"linePrefix",5)(u)}function i(u){let o=e.events[e.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?r(u):b(u)?a(u):t(u)}}var Yn={name:"codeText",tokenize:Be,resolve:Ie,previous:Te};function Ie(n){let r=n.length-4,t=3,e,a;if((n[t][1].type==="lineEnding"||n[t][1].type==="space")&&(n[r][1].type==="lineEnding"||n[r][1].type==="space")){for(e=t;++e<r;)if(n[e][1].type==="codeTextData"){n[t][1].type="codeTextPadding",n[r][1].type="codeTextPadding",t+=2,r-=2;break}}for(e=t-1,r++;++e<=r;)a===void 0?e!==r&&n[e][1].type!=="lineEnding"&&(a=e):(e===r||n[e][1].type==="lineEnding")&&(n[a][1].type="codeTextData",e!==a+2&&(n[a][1].end=n[e-1][1].end,n.splice(a+2,e-a-2),r-=e-a-2,e=a+2),a=void 0);return n}function Te(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Be(n,r,t){let e=this,a=0,i,u;return o;function o(h){return n.enter("codeText"),n.enter("codeTextSequence"),f(h)}function f(h){return h===96?(n.consume(h),a++,f):(n.exit("codeTextSequence"),m(h))}function m(h){return h===null?t(h):h===32?(n.enter("space"),n.consume(h),n.exit("space"),m):h===96?(u=n.enter("codeTextSequence"),i=0,x(h)):b(h)?(n.enter("lineEnding"),n.consume(h),n.exit("lineEnding"),m):(n.enter("codeTextData"),c(h))}function c(h){return h===null||h===32||h===96||b(h)?(n.exit("codeTextData"),m(h)):(n.consume(h),c)}function x(h){return h===96?(n.consume(h),i++,x):i===a?(n.exit("codeTextSequence"),n.exit("codeText"),r(h)):(u.type="codeTextData",c(h))}}function _n(n){let r={},t=-1,e,a,i,u,o,f,m;for(;++t<n.length;){for(;t in r;)t=r[t];if(e=n[t],t&&e[1].type==="chunkFlow"&&n[t-1][1].type==="listItemPrefix"&&(f=e[1]._tokenizer.events,i=0,i<f.length&&f[i][1].type==="lineEndingBlank"&&(i+=2),i<f.length&&f[i][1].type==="content"))for(;++i<f.length&&f[i][1].type!=="content";)f[i][1].type==="chunkText"&&(f[i][1]._isInFirstContentOfListItem=!0,i++);if(e[0]==="enter")e[1].contentType&&(Object.assign(r,Le(n,t)),t=r[t],m=!0);else if(e[1]._container){for(i=t,a=void 0;i--&&(u=n[i],u[1].type==="lineEnding"||u[1].type==="lineEndingBlank");)u[0]==="enter"&&(a&&(n[a][1].type="lineEndingBlank"),u[1].type="lineEnding",a=i);a&&(e[1].end=Object.assign({},n[a][1].start),o=n.slice(a,t),o.unshift(e),$(n,a,t-a+1,o))}}return!m}function Le(n,r){let t=n[r][1],e=n[r][2],a=r-1,i=[],u=t._tokenizer||e.parser[t.contentType](t.start),o=u.events,f=[],m={},c,x,h=-1,p=t,T=0,B=0,P=[B];for(;p;){for(;n[++a][1]!==p;);i.push(a),p._tokenizer||(c=e.sliceStream(p),p.next||c.push(null),x&&u.defineSkip(p.start),p._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(c),p._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),x=p,p=p.next}for(p=t;++h<o.length;)o[h][0]==="exit"&&o[h-1][0]==="enter"&&o[h][1].type===o[h-1][1].type&&o[h][1].start.line!==o[h][1].end.line&&(B=h+1,P.push(B),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(u.events=[],p?(p._tokenizer=void 0,p.previous=void 0):P.pop(),h=P.length;h--;){let y=o.slice(P[h],P[h+1]),R=i.pop();f.unshift([R,R+y.length-1]),$(n,R,2,y)}for(h=-1;++h<f.length;)m[T+f[h][0]]=T+f[h][1],T+=f[h][1]-f[h][0]-1;return m}var Gn={tokenize:Pe,resolve:De},Oe={tokenize:_e,partial:!0};function De(n){return _n(n),n}function Pe(n,r){let t;return e;function e(o){return n.enter("content"),t=n.enter("chunkContent",{contentType:"content"}),a(o)}function a(o){return o===null?i(o):b(o)?n.check(Oe,u,i)(o):(n.consume(o),a)}function i(o){return n.exit("chunkContent"),n.exit("content"),r(o)}function u(o){return n.consume(o),n.exit("chunkContent"),t.next=n.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,a}}function _e(n,r,t){let e=this;return a;function a(u){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),C(n,i,"linePrefix")}function i(u){if(u===null||b(u))return t(u);let o=e.events[e.events.length-1];return!e.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?r(u):n.interrupt(e.parser.constructs.flow,t,r)(u)}}function Mn(n,r,t,e,a,i,u,o,f){let m=f||Number.POSITIVE_INFINITY,c=0;return x;function x(y){return y===60?(n.enter(e),n.enter(a),n.enter(i),n.consume(y),n.exit(i),h):y===null||y===32||y===41||An(y)?t(y):(n.enter(e),n.enter(u),n.enter(o),n.enter("chunkString",{contentType:"string"}),B(y))}function h(y){return y===62?(n.enter(i),n.consume(y),n.exit(i),n.exit(a),n.exit(e),r):(n.enter(o),n.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(n.exit("chunkString"),n.exit(o),h(y)):y===null||y===60||b(y)?t(y):(n.consume(y),y===92?T:p)}function T(y){return y===60||y===62||y===92?(n.consume(y),p):p(y)}function B(y){return!c&&(y===null||y===41||N(y))?(n.exit("chunkString"),n.exit(o),n.exit(u),n.exit(e),r(y)):c<m&&y===40?(n.consume(y),c++,B):y===41?(n.consume(y),c--,B):y===null||y===32||y===40||An(y)?t(y):(n.consume(y),y===92?P:B)}function P(y){return y===40||y===41||y===92?(n.consume(y),B):B(y)}}function Rn(n,r,t,e,a,i){let u=this,o=0,f;return m;function m(p){return n.enter(e),n.enter(a),n.consume(p),n.exit(a),n.enter(i),c}function c(p){return o>999||p===null||p===91||p===93&&!f||p===94&&!o&&"_hiddenFootnoteSupport"in u.parser.constructs?t(p):p===93?(n.exit(i),n.enter(a),n.consume(p),n.exit(a),n.exit(e),r):b(p)?(n.enter("lineEnding"),n.consume(p),n.exit("lineEnding"),c):(n.enter("chunkString",{contentType:"string"}),x(p))}function x(p){return p===null||p===91||p===93||b(p)||o++>999?(n.exit("chunkString"),c(p)):(n.consume(p),f||(f=!F(p)),p===92?h:x)}function h(p){return p===91||p===92||p===93?(n.consume(p),o++,x):x(p)}}function jn(n,r,t,e,a,i){let u;return o;function o(h){return h===34||h===39||h===40?(n.enter(e),n.enter(a),n.consume(h),n.exit(a),u=h===40?41:h,f):t(h)}function f(h){return h===u?(n.enter(a),n.consume(h),n.exit(a),n.exit(e),r):(n.enter(i),m(h))}function m(h){return h===u?(n.exit(i),f(u)):h===null?t(h):b(h)?(n.enter("lineEnding"),n.consume(h),n.exit("lineEnding"),C(n,m,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===u||h===null||b(h)?(n.exit("chunkString"),m(h)):(n.consume(h),h===92?x:c)}function x(h){return h===u||h===92?(n.consume(h),c):c(h)}}function fn(n,r){let t;return e;function e(a){return b(a)?(n.enter("lineEnding"),n.consume(a),n.exit("lineEnding"),t=!0,e):F(a)?C(n,e,t?"linePrefix":"lineSuffix")(a):r(a)}}function ln(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Jn={name:"definition",tokenize:Re},Me={tokenize:je,partial:!0};function Re(n,r,t){let e=this,a;return i;function i(p){return n.enter("definition"),u(p)}function u(p){return Rn.call(e,n,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return a=ln(e.sliceSerialize(e.events[e.events.length-1][1]).slice(1,-1)),p===58?(n.enter("definitionMarker"),n.consume(p),n.exit("definitionMarker"),f):t(p)}function f(p){return N(p)?fn(n,m)(p):m(p)}function m(p){return Mn(n,c,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return n.attempt(Me,x,x)(p)}function x(p){return F(p)?C(n,h,"whitespace")(p):h(p)}function h(p){return p===null||b(p)?(n.exit("definition"),e.parser.defined.push(a),r(p)):t(p)}}function je(n,r,t){return e;function e(o){return N(o)?fn(n,a)(o):t(o)}function a(o){return jn(n,i,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return F(o)?C(n,u,"whitespace")(o):u(o)}function u(o){return o===null||b(o)?r(o):t(o)}}var Kn={name:"hardBreakEscape",tokenize:He};function He(n,r,t){return e;function e(i){return n.enter("hardBreakEscape"),n.consume(i),a}function a(i){return b(i)?(n.exit("hardBreakEscape"),r(i)):t(i)}}var Xn={name:"headingAtx",tokenize:Ne,resolve:qe};function qe(n,r){let t=n.length-2,e=3,a,i;return n[e][1].type==="whitespace"&&(e+=2),t-2>e&&n[t][1].type==="whitespace"&&(t-=2),n[t][1].type==="atxHeadingSequence"&&(e===t-1||t-4>e&&n[t-2][1].type==="whitespace")&&(t-=e+1===t?2:4),t>e&&(a={type:"atxHeadingText",start:n[e][1].start,end:n[t][1].end},i={type:"chunkText",start:n[e][1].start,end:n[t][1].end,contentType:"text"},$(n,e,t-e+1,[["enter",a,r],["enter",i,r],["exit",i,r],["exit",a,r]])),n}function Ne(n,r,t){let e=0;return a;function a(c){return n.enter("atxHeading"),i(c)}function i(c){return n.enter("atxHeadingSequence"),u(c)}function u(c){return c===35&&e++<6?(n.consume(c),u):c===null||N(c)?(n.exit("atxHeadingSequence"),o(c)):t(c)}function o(c){return c===35?(n.enter("atxHeadingSequence"),f(c)):c===null||b(c)?(n.exit("atxHeading"),r(c)):F(c)?C(n,o,"whitespace")(c):(n.enter("atxHeadingText"),m(c))}function f(c){return c===35?(n.consume(c),f):(n.exit("atxHeadingSequence"),o(c))}function m(c){return c===null||c===35||N(c)?(n.exit("atxHeadingText"),o(c)):(n.consume(c),m)}}var Dt=["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"],vn=["pre","script","style","textarea"];var nt={name:"htmlFlow",tokenize:Ue,resolveTo:Qe,concrete:!0},Ve={tokenize:Ze,partial:!0},We={tokenize:$e,partial:!0};function Qe(n){let r=n.length;for(;r--&&!(n[r][0]==="enter"&&n[r][1].type==="htmlFlow"););return r>1&&n[r-2][1].type==="linePrefix"&&(n[r][1].start=n[r-2][1].start,n[r+1][1].start=n[r-2][1].start,n.splice(r-2,2)),n}function Ue(n,r,t){let e=this,a,i,u,o,f;return m;function m(s){return c(s)}function c(s){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(s),x}function x(s){return s===33?(n.consume(s),h):s===47?(n.consume(s),i=!0,B):s===63?(n.consume(s),a=3,e.interrupt?r:l):X(s)?(n.consume(s),u=String.fromCharCode(s),P):t(s)}function h(s){return s===45?(n.consume(s),a=2,p):s===91?(n.consume(s),a=5,o=0,T):X(s)?(n.consume(s),a=4,e.interrupt?r:l):t(s)}function p(s){return s===45?(n.consume(s),e.interrupt?r:l):t(s)}function T(s){let K="CDATA[";return s===K.charCodeAt(o++)?(n.consume(s),o===K.length?e.interrupt?r:I:T):t(s)}function B(s){return X(s)?(n.consume(s),u=String.fromCharCode(s),P):t(s)}function P(s){if(s===null||s===47||s===62||N(s)){let K=s===47,kn=u.toLowerCase();return!K&&!i&&vn.includes(kn)?(a=1,e.interrupt?r(s):I(s)):Dt.includes(u.toLowerCase())?(a=6,K?(n.consume(s),y):e.interrupt?r(s):I(s)):(a=7,e.interrupt&&!e.parser.lazy[e.now().line]?t(s):i?R(s):S(s))}return s===45||J(s)?(n.consume(s),u+=String.fromCharCode(s),P):t(s)}function y(s){return s===62?(n.consume(s),e.interrupt?r:I):t(s)}function R(s){return F(s)?(n.consume(s),R):Z(s)}function S(s){return s===47?(n.consume(s),Z):s===58||s===95||X(s)?(n.consume(s),_):F(s)?(n.consume(s),S):Z(s)}function _(s){return s===45||s===46||s===58||s===95||J(s)?(n.consume(s),_):M(s)}function M(s){return s===61?(n.consume(s),k):F(s)?(n.consume(s),M):S(s)}function k(s){return s===null||s===60||s===61||s===62||s===96?t(s):s===34||s===39?(n.consume(s),f=s,D):F(s)?(n.consume(s),k):V(s)}function D(s){return s===f?(n.consume(s),f=null,W):s===null||b(s)?t(s):(n.consume(s),D)}function V(s){return s===null||s===34||s===39||s===47||s===60||s===61||s===62||s===96||N(s)?M(s):(n.consume(s),V)}function W(s){return s===47||s===62||F(s)?S(s):t(s)}function Z(s){return s===62?(n.consume(s),H):t(s)}function H(s){return s===null||b(s)?I(s):F(s)?(n.consume(s),H):t(s)}function I(s){return s===45&&a===2?(n.consume(s),j):s===60&&a===1?(n.consume(s),Q):s===62&&a===4?(n.consume(s),v):s===63&&a===3?(n.consume(s),l):s===93&&a===5?(n.consume(s),en):b(s)&&(a===6||a===7)?(n.exit("htmlFlowData"),n.check(Ve,rn,w)(s)):s===null||b(s)?(n.exit("htmlFlowData"),w(s)):(n.consume(s),I)}function w(s){return n.check(We,z,rn)(s)}function z(s){return n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),A}function A(s){return s===null||b(s)?w(s):(n.enter("htmlFlowData"),I(s))}function j(s){return s===45?(n.consume(s),l):I(s)}function Q(s){return s===47?(n.consume(s),u="",nn):I(s)}function nn(s){if(s===62){let K=u.toLowerCase();return vn.includes(K)?(n.consume(s),v):I(s)}return X(s)&&u.length<8?(n.consume(s),u+=String.fromCharCode(s),nn):I(s)}function en(s){return s===93?(n.consume(s),l):I(s)}function l(s){return s===62?(n.consume(s),v):s===45&&a===2?(n.consume(s),l):I(s)}function v(s){return s===null||b(s)?(n.exit("htmlFlowData"),rn(s)):(n.consume(s),v)}function rn(s){return n.exit("htmlFlow"),r(s)}}function $e(n,r,t){let e=this;return a;function a(u){return b(u)?(n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),i):t(u)}function i(u){return e.parser.lazy[e.now().line]?t(u):r(u)}}function Ze(n,r,t){return e;function e(a){return n.enter("lineEnding"),n.consume(a),n.exit("lineEnding"),n.attempt(pn,r,t)}}var tt={name:"htmlText",tokenize:Ye};function Ye(n,r,t){let e=this,a,i,u;return o;function o(l){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(l),f}function f(l){return l===33?(n.consume(l),m):l===47?(n.consume(l),M):l===63?(n.consume(l),S):X(l)?(n.consume(l),V):t(l)}function m(l){return l===45?(n.consume(l),c):l===91?(n.consume(l),i=0,T):X(l)?(n.consume(l),R):t(l)}function c(l){return l===45?(n.consume(l),p):t(l)}function x(l){return l===null?t(l):l===45?(n.consume(l),h):b(l)?(u=x,Q(l)):(n.consume(l),x)}function h(l){return l===45?(n.consume(l),p):x(l)}function p(l){return l===62?j(l):l===45?h(l):x(l)}function T(l){let v="CDATA[";return l===v.charCodeAt(i++)?(n.consume(l),i===v.length?B:T):t(l)}function B(l){return l===null?t(l):l===93?(n.consume(l),P):b(l)?(u=B,Q(l)):(n.consume(l),B)}function P(l){return l===93?(n.consume(l),y):B(l)}function y(l){return l===62?j(l):l===93?(n.consume(l),y):B(l)}function R(l){return l===null||l===62?j(l):b(l)?(u=R,Q(l)):(n.consume(l),R)}function S(l){return l===null?t(l):l===63?(n.consume(l),_):b(l)?(u=S,Q(l)):(n.consume(l),S)}function _(l){return l===62?j(l):S(l)}function M(l){return X(l)?(n.consume(l),k):t(l)}function k(l){return l===45||J(l)?(n.consume(l),k):D(l)}function D(l){return b(l)?(u=D,Q(l)):F(l)?(n.consume(l),D):j(l)}function V(l){return l===45||J(l)?(n.consume(l),V):l===47||l===62||N(l)?W(l):t(l)}function W(l){return l===47?(n.consume(l),j):l===58||l===95||X(l)?(n.consume(l),Z):b(l)?(u=W,Q(l)):F(l)?(n.consume(l),W):j(l)}function Z(l){return l===45||l===46||l===58||l===95||J(l)?(n.consume(l),Z):H(l)}function H(l){return l===61?(n.consume(l),I):b(l)?(u=H,Q(l)):F(l)?(n.consume(l),H):W(l)}function I(l){return l===null||l===60||l===61||l===62||l===96?t(l):l===34||l===39?(n.consume(l),a=l,w):b(l)?(u=I,Q(l)):F(l)?(n.consume(l),I):(n.consume(l),z)}function w(l){return l===a?(n.consume(l),a=void 0,A):l===null?t(l):b(l)?(u=w,Q(l)):(n.consume(l),w)}function z(l){return l===null||l===34||l===39||l===60||l===61||l===96?t(l):l===47||l===62||N(l)?W(l):(n.consume(l),z)}function A(l){return l===47||l===62||N(l)?W(l):t(l)}function j(l){return l===62?(n.consume(l),n.exit("htmlTextData"),n.exit("htmlText"),r):t(l)}function Q(l){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),nn}function nn(l){return F(l)?C(n,en,"linePrefix",e.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):en(l)}function en(l){return n.enter("htmlTextData"),u(l)}}var xn={name:"labelEnd",tokenize:nr,resolveTo:ve,resolveAll:Xe},Ge={tokenize:tr},Je={tokenize:er},Ke={tokenize:rr};function Xe(n){let r=-1;for(;++r<n.length;){let t=n[r][1];(t.type==="labelImage"||t.type==="labelLink"||t.type==="labelEnd")&&(n.splice(r+1,t.type==="labelImage"?4:2),t.type="data",r++)}return n}function ve(n,r){let t=n.length,e=0,a,i,u,o;for(;t--;)if(a=n[t][1],i){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;n[t][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(u){if(n[t][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(i=t,a.type!=="labelLink")){e=2;break}}else a.type==="labelEnd"&&(u=t);let f={type:n[i][1].type==="labelLink"?"link":"image",start:Object.assign({},n[i][1].start),end:Object.assign({},n[n.length-1][1].end)},m={type:"label",start:Object.assign({},n[i][1].start),end:Object.assign({},n[u][1].end)},c={type:"labelText",start:Object.assign({},n[i+e+2][1].end),end:Object.assign({},n[u-2][1].start)};return o=[["enter",f,r],["enter",m,r]],o=G(o,n.slice(i+1,i+e+3)),o=G(o,[["enter",c,r]]),o=G(o,yn(r.parser.constructs.insideSpan.null,n.slice(i+e+4,u-3),r)),o=G(o,[["exit",c,r],n[u-2],n[u-1],["exit",m,r]]),o=G(o,n.slice(u+1)),o=G(o,[["exit",f,r]]),$(n,i,n.length,o),n}function nr(n,r,t){let e=this,a=e.events.length,i,u;for(;a--;)if((e.events[a][1].type==="labelImage"||e.events[a][1].type==="labelLink")&&!e.events[a][1]._balanced){i=e.events[a][1];break}return o;function o(h){return i?i._inactive?x(h):(u=e.parser.defined.includes(ln(e.sliceSerialize({start:i.end,end:e.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(h),n.exit("labelMarker"),n.exit("labelEnd"),f):t(h)}function f(h){return h===40?n.attempt(Ge,c,u?c:x)(h):h===91?n.attempt(Je,c,u?m:x)(h):u?c(h):x(h)}function m(h){return n.attempt(Ke,c,x)(h)}function c(h){return r(h)}function x(h){return i._balanced=!0,t(h)}}function tr(n,r,t){return e;function e(x){return n.enter("resource"),n.enter("resourceMarker"),n.consume(x),n.exit("resourceMarker"),a}function a(x){return N(x)?fn(n,i)(x):i(x)}function i(x){return x===41?c(x):Mn(n,u,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function u(x){return N(x)?fn(n,f)(x):c(x)}function o(x){return t(x)}function f(x){return x===34||x===39||x===40?jn(n,m,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):c(x)}function m(x){return N(x)?fn(n,c)(x):c(x)}function c(x){return x===41?(n.enter("resourceMarker"),n.consume(x),n.exit("resourceMarker"),n.exit("resource"),r):t(x)}}function er(n,r,t){let e=this;return a;function a(o){return Rn.call(e,n,i,u,"reference","referenceMarker","referenceString")(o)}function i(o){return e.parser.defined.includes(ln(e.sliceSerialize(e.events[e.events.length-1][1]).slice(1,-1)))?r(o):t(o)}function u(o){return t(o)}}function rr(n,r,t){return e;function e(i){return n.enter("reference"),n.enter("referenceMarker"),n.consume(i),n.exit("referenceMarker"),a}function a(i){return i===93?(n.enter("referenceMarker"),n.consume(i),n.exit("referenceMarker"),n.exit("reference"),r):t(i)}}var et={name:"labelStartImage",tokenize:ir,resolveAll:xn.resolveAll};function ir(n,r,t){let e=this;return a;function a(o){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(o),n.exit("labelImageMarker"),i}function i(o){return o===91?(n.enter("labelMarker"),n.consume(o),n.exit("labelMarker"),n.exit("labelImage"),u):t(o)}function u(o){return o===94&&"_hiddenFootnoteSupport"in e.parser.constructs?t(o):r(o)}}var rt={name:"labelStartLink",tokenize:ur,resolveAll:xn.resolveAll};function ur(n,r,t){let e=this;return a;function a(u){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(u),n.exit("labelMarker"),n.exit("labelLink"),i}function i(u){return u===94&&"_hiddenFootnoteSupport"in e.parser.constructs?t(u):r(u)}}var Bn={name:"lineEnding",tokenize:ar};function ar(n,r){return t;function t(e){return n.enter("lineEnding"),n.consume(e),n.exit("lineEnding"),C(n,r,"linePrefix")}}var gn={name:"thematicBreak",tokenize:or};function or(n,r,t){let e=0,a;return i;function i(m){return n.enter("thematicBreak"),u(m)}function u(m){return a=m,o(m)}function o(m){return m===a?(n.enter("thematicBreakSequence"),f(m)):e>=3&&(m===null||b(m))?(n.exit("thematicBreak"),r(m)):t(m)}function f(m){return m===a?(n.consume(m),e++,f):(n.exit("thematicBreakSequence"),F(m)?C(n,o,"whitespace")(m):o(m))}}var Y={name:"list",tokenize:cr,continuation:{tokenize:pr},exit:hr},lr={tokenize:fr,partial:!0},sr={tokenize:mr,partial:!0};function cr(n,r,t){let e=this,a=e.events[e.events.length-1],i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,u=0;return o;function o(p){let T=e.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(T==="listUnordered"?!e.containerState.marker||p===e.containerState.marker:zn(p)){if(e.containerState.type||(e.containerState.type=T,n.enter(T,{_container:!0})),T==="listUnordered")return n.enter("listItemPrefix"),p===42||p===45?n.check(gn,t,m)(p):m(p);if(!e.interrupt||p===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),f(p)}return t(p)}function f(p){return zn(p)&&++u<10?(n.consume(p),f):(!e.interrupt||u<2)&&(e.containerState.marker?p===e.containerState.marker:p===41||p===46)?(n.exit("listItemValue"),m(p)):t(p)}function m(p){return n.enter("listItemMarker"),n.consume(p),n.exit("listItemMarker"),e.containerState.marker=e.containerState.marker||p,n.check(pn,e.interrupt?t:c,n.attempt(lr,h,x))}function c(p){return e.containerState.initialBlankLine=!0,i++,h(p)}function x(p){return F(p)?(n.enter("listItemPrefixWhitespace"),n.consume(p),n.exit("listItemPrefixWhitespace"),h):t(p)}function h(p){return e.containerState.size=i+e.sliceSerialize(n.exit("listItemPrefix"),!0).length,r(p)}}function pr(n,r,t){let e=this;return e.containerState._closeFlow=void 0,n.check(pn,a,i);function a(o){return e.containerState.furtherBlankLines=e.containerState.furtherBlankLines||e.containerState.initialBlankLine,C(n,r,"listItemIndent",e.containerState.size+1)(o)}function i(o){return e.containerState.furtherBlankLines||!F(o)?(e.containerState.furtherBlankLines=void 0,e.containerState.initialBlankLine=void 0,u(o)):(e.containerState.furtherBlankLines=void 0,e.containerState.initialBlankLine=void 0,n.attempt(sr,r,u)(o))}function u(o){return e.containerState._closeFlow=!0,e.interrupt=void 0,C(n,n.attempt(Y,r,t),"linePrefix",e.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function mr(n,r,t){let e=this;return C(n,a,"listItemIndent",e.containerState.size+1);function a(i){let u=e.events[e.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===e.containerState.size?r(i):t(i)}}function hr(n){n.exit(this.containerState.type)}function fr(n,r,t){let e=this;return C(n,a,"listItemPrefixWhitespace",e.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(i){let u=e.events[e.events.length-1];return!F(i)&&u&&u[1].type==="listItemPrefixWhitespace"?r(i):t(i)}}var Hn={name:"setextUnderline",tokenize:gr,resolveTo:xr};function xr(n,r){let t=n.length,e,a,i;for(;t--;)if(n[t][0]==="enter"){if(n[t][1].type==="content"){e=t;break}n[t][1].type==="paragraph"&&(a=t)}else n[t][1].type==="content"&&n.splice(t,1),!i&&n[t][1].type==="definition"&&(i=t);let u={type:"setextHeading",start:Object.assign({},n[a][1].start),end:Object.assign({},n[n.length-1][1].end)};return n[a][1].type="setextHeadingText",i?(n.splice(a,0,["enter",u,r]),n.splice(i+1,0,["exit",n[e][1],r]),n[e][1].end=Object.assign({},n[i][1].end)):n[e][1]=u,n.push(["exit",u,r]),n}function gr(n,r,t){let e=this,a;return i;function i(m){let c=e.events.length,x;for(;c--;)if(e.events[c][1].type!=="lineEnding"&&e.events[c][1].type!=="linePrefix"&&e.events[c][1].type!=="content"){x=e.events[c][1].type==="paragraph";break}return!e.parser.lazy[e.now().line]&&(e.interrupt||x)?(n.enter("setextHeadingLine"),a=m,u(m)):t(m)}function u(m){return n.enter("setextHeadingLineSequence"),o(m)}function o(m){return m===a?(n.consume(m),o):(n.exit("setextHeadingLineSequence"),F(m)?C(n,f,"lineSuffix")(m):f(m))}function f(m){return m===null||b(m)?(n.exit("setextHeadingLine"),r(m)):t(m)}}var Pt={tokenize:kr};function kr(n){let r=this,t=n.attempt(pn,e,n.attempt(this.parser.constructs.flowInitial,a,C(n,n.attempt(this.parser.constructs.flow,a,n.attempt(Gn,a)),"linePrefix")));return t;function e(i){if(i===null){n.consume(i);return}return n.enter("lineEndingBlank"),n.consume(i),n.exit("lineEndingBlank"),r.currentConstruct=void 0,t}function a(i){if(i===null){n.consume(i);return}return n.enter("lineEnding"),n.consume(i),n.exit("lineEnding"),r.currentConstruct=void 0,t}}var _t={resolveAll:Ht()},Mt=jt("string"),Rt=jt("text");function jt(n){return{tokenize:r,resolveAll:Ht(n==="text"?dr:void 0)};function r(t){let e=this,a=this.parser.constructs[n],i=t.attempt(a,u,o);return u;function u(c){return m(c)?i(c):o(c)}function o(c){if(c===null){t.consume(c);return}return t.enter("data"),t.consume(c),f}function f(c){return m(c)?(t.exit("data"),i(c)):(t.consume(c),f)}function m(c){if(c===null)return!0;let x=a[c],h=-1;if(x)for(;++h<x.length;){let p=x[h];if(!p.previous||p.previous.call(e,e.previous))return!0}return!1}}}function Ht(n){return r;function r(t,e){let a=-1,i;for(;++a<=t.length;)i===void 0?t[a]&&t[a][1].type==="data"&&(i=a,a++):(!t[a]||t[a][1].type!=="data")&&(a!==i+2&&(t[i][1].end=t[a-1][1].end,t.splice(i+2,a-i-2),a=i+2),i=void 0);return n?n(t,e):t}}function dr(n,r){let t=0;for(;++t<=n.length;)if((t===n.length||n[t][1].type==="lineEnding")&&n[t-1][1].type==="data"){let e=n[t-1][1],a=r.sliceStream(e),i=a.length,u=-1,o=0,f;for(;i--;){let m=a[i];if(typeof m=="string"){for(u=m.length;m.charCodeAt(u-1)===32;)o++,u--;if(u)break;u=-1}else if(m===-2)f=!0,o++;else if(m!==-1){i++;break}}if(o){let m={type:t===n.length||f||o<2?"lineSuffix":"hardBreakTrailing",start:{line:e.end.line,column:e.end.column-o,offset:e.end.offset-o,_index:e.start._index+i,_bufferIndex:i?u:e.start._bufferIndex+u},end:Object.assign({},e.end)};e.end=Object.assign({},m.start),e.start.offset===e.end.offset?Object.assign(e,m):(n.splice(t,0,["enter",m,r],["exit",m,r]),t+=2)}t++}return n}function qt(n,r,t){let e=Object.assign(t?Object.assign({},t):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1}),a={},i=[],u=[],o=[],f=!0,m={consume:_,enter:M,exit:k,attempt:W(D),check:W(V),interrupt:W(V,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:n,sliceStream:B,sliceSerialize:T,now:P,defineSkip:y,write:p},x=r.tokenize.call(c,m),h;return r.resolveAll&&i.push(r),c;function p(w){return u=G(u,w),R(),u[u.length-1]!==null?[]:(Z(r,0),c.events=yn(i,c.events,c),c.events)}function T(w,z){return br(B(w),z)}function B(w){return yr(u,w)}function P(){let{line:w,column:z,offset:A,_index:j,_bufferIndex:Q}=e;return{line:w,column:z,offset:A,_index:j,_bufferIndex:Q}}function y(w){a[w.line]=w.column,I()}function R(){let w;for(;e._index<u.length;){let z=u[e._index];if(typeof z=="string")for(w=e._index,e._bufferIndex<0&&(e._bufferIndex=0);e._index===w&&e._bufferIndex<z.length;)S(z.charCodeAt(e._bufferIndex));else S(z)}}function S(w){f=void 0,h=w,x=x(w)}function _(w){b(w)?(e.line++,e.column=1,e.offset+=w===-3?2:1,I()):w!==-1&&(e.column++,e.offset++),e._bufferIndex<0?e._index++:(e._bufferIndex++,e._bufferIndex===u[e._index].length&&(e._bufferIndex=-1,e._index++)),c.previous=w,f=!0}function M(w,z){let A=z||{};return A.type=w,A.start=P(),c.events.push(["enter",A,c]),o.push(A),A}function k(w){let z=o.pop();return z.end=P(),c.events.push(["exit",z,c]),z}function D(w,z){Z(w,z.from)}function V(w,z){z.restore()}function W(w,z){return A;function A(j,Q,nn){let en,l,v,rn;return Array.isArray(j)?K(j):"tokenize"in j?K([j]):s(j);function s(U){return En;function En(un){let dn=un!==null&&U[un],hn=un!==null&&U.null,Wn=[...Array.isArray(dn)?dn:dn?[dn]:[],...Array.isArray(hn)?hn:hn?[hn]:[]];return K(Wn)(un)}}function K(U){return en=U,l=0,U.length===0?nn:kn(U[l])}function kn(U){return En;function En(un){return rn=H(),v=U,U.partial||(c.currentConstruct=U),U.name&&c.parser.constructs.disable.null.includes(U.name)?wn(un):U.tokenize.call(z?Object.assign(Object.create(c),z):c,m,Vn,wn)(un)}}function Vn(U){return f=!0,w(v,rn),Q}function wn(U){return f=!0,rn.restore(),++l<en.length?kn(en[l]):nn}}}function Z(w,z){w.resolveAll&&!i.includes(w)&&i.push(w),w.resolve&&$(c.events,z,c.events.length-z,w.resolve(c.events.slice(z),c)),w.resolveTo&&(c.events=w.resolveTo(c.events,c))}function H(){let w=P(),z=c.previous,A=c.currentConstruct,j=c.events.length,Q=Array.from(o);return{restore:nn,from:j};function nn(){e=w,c.previous=z,c.currentConstruct=A,c.events.length=j,o=Q,I()}}function I(){e.line in a&&e.column<2&&(e.column=a[e.line],e.offset+=a[e.line]-1)}}function yr(n,r){let t=r.start._index,e=r.start._bufferIndex,a=r.end._index,i=r.end._bufferIndex,u;if(t===a)u=[n[t].slice(e,i)];else{if(u=n.slice(t,a),e>-1){let o=u[0];typeof o=="string"?u[0]=o.slice(e):u.shift()}i>0&&u.push(n[a].slice(0,i))}return u}function br(n,r){let t=-1,e=[],a;for(;++t<n.length;){let i=n[t],u;if(typeof i=="string")u=i;else switch(i){case-5:{u="\r";break}case-4:{u=`
`;break}case-3:{u=`\r
`;break}case-2:{u=r?" ":" ";break}case-1:{if(!r&&a)continue;u=" ";break}default:u=String.fromCharCode(i)}a=i===-2,e.push(u)}return e.join("")}var it={};ae(it,{attentionMarkers:()=>Ir,contentInitial:()=>wr,disable:()=>Tr,document:()=>Sr,flow:()=>Fr,flowInitial:()=>Er,insideSpan:()=>zr,string:()=>Cr,text:()=>Ar});var Sr={42:Y,43:Y,45:Y,48:Y,49:Y,50:Y,51:Y,52:Y,53:Y,54:Y,55:Y,56:Y,57:Y,62:Ln},wr={91:Jn},Er={[-2]:Tn,[-1]:Tn,32:Tn},Fr={35:Xn,42:gn,45:[Hn,gn],60:nt,61:Hn,95:gn,96:Pn,126:Pn},Cr={38:Dn,92:On},Ar={[-5]:Bn,[-4]:Bn,[-3]:Bn,33:et,38:Dn,42:In,60:[Zn,tt],91:rt,92:[Kn,On],93:xn,95:In,96:Yn},zr={null:[In,_t]},Ir={null:[42,95]},Tr={null:[]};function Nt(n){let t=bt([it,...(n||{}).extensions||[]]),e={defined:[],lazy:{},constructs:t,content:a(zt),document:a(Tt),flow:a(Pt),string:a(Mt),text:a(Rt)};return e;function a(i){return u;function u(o){return qt(e,i,o)}}}var Vt=/[\0\t\n\r]/g;function Wt(){let n=1,r="",t=!0,e;return a;function a(i,u,o){let f=[],m,c,x,h,p;for(i=r+i.toString(u),x=0,r="",t&&(i.charCodeAt(0)===65279&&x++,t=void 0);x<i.length;){if(Vt.lastIndex=x,m=Vt.exec(i),h=m&&m.index!==void 0?m.index:i.length,p=i.charCodeAt(h),!m){r=i.slice(x);break}if(p===10&&x===h&&e)f.push(-3),e=void 0;else switch(e&&(f.push(-5),e=void 0),x<h&&(f.push(i.slice(x,h)),n+=h-x),p){case 0:{f.push(65533),n++;break}case 9:{for(c=Math.ceil(n/4)*4,f.push(-2);n++<c;)f.push(-1);break}case 10:{f.push(-4),n=1;break}default:e=!0,n=1}x=h+1}return o&&(e&&f.push(-5),r&&f.push(r),f.push(null)),f}}function Qt(n){for(;!_n(n););return n}function qn(n,r){let t=Number.parseInt(n,r);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?"\uFFFD":String.fromCharCode(t)}var Br=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ut(n){return n.replace(Br,Lr)}function Lr(n,r,t){if(r)return r;if(t.charCodeAt(0)===35){let a=t.charCodeAt(1),i=a===120||a===88;return qn(t.slice(i?2:1),i?16:10)}return bn(t)||n}function Sn(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?$t(n.position):"start"in n||"end"in n?$t(n):"line"in n||"column"in n?ut(n):""}function ut(n){return Zt(n&&n.line)+":"+Zt(n&&n.column)}function $t(n){return ut(n&&n.start)+"-"+ut(n&&n.end)}function Zt(n){return n&&typeof n=="number"?n:1}var Gt={}.hasOwnProperty,Nn=function(n,r,t){return typeof r!="string"&&(t=r,r=void 0),Or(t)(Qt(Nt(t).document().write(Wt()(n,r,!0))))};function Or(n){let r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(mt),autolinkProtocol:H,autolinkEmail:H,atxHeading:o(st),blockQuote:o(dn),characterEscape:H,characterReference:H,codeFenced:o(hn),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:o(hn,f),codeText:o(Wn,f),codeTextData:H,data:H,codeFlowValue:H,definition:o(Xt),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:o(vt),hardBreakEscape:o(ct),hardBreakTrailing:o(ct),htmlFlow:o(pt,f),htmlFlowData:H,htmlText:o(pt,f),htmlTextData:H,image:o(ne),label:f,link:o(mt),listItem:o(te),listItemValue:T,listOrdered:o(ht,p),listUnordered:o(ht),paragraph:o(ee),reference:kn,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:o(st),strong:o(re),thematicBreak:o(ue)},exit:{atxHeading:c(),atxHeadingSequence:D,autolink:c(),autolinkEmail:un,autolinkProtocol:En,blockQuote:c(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:wn,characterReferenceMarkerNumeric:wn,characterReferenceValue:U,codeFenced:c(R),codeFencedFence:y,codeFencedFenceInfo:B,codeFencedFenceMeta:P,codeFlowValue:I,codeIndented:c(S),codeText:c(Q),codeTextData:I,data:I,definition:c(),definitionDestinationString:k,definitionLabelString:_,definitionTitleString:M,emphasis:c(),hardBreakEscape:c(z),hardBreakTrailing:c(z),htmlFlow:c(A),htmlFlowData:I,htmlText:c(j),htmlTextData:I,image:c(en),label:v,labelText:l,lineEnding:w,link:c(nn),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Vn,resourceDestinationString:rn,resourceTitleString:s,resource:K,setextHeading:c(Z),setextHeadingLineSequence:W,setextHeadingText:V,strong:c(),thematicBreak:c()}};Jt(r,(n||{}).mdastExtensions||[]);let t={};return e;function e(g){let d={type:"root",children:[]},E={stack:[d],tokenStack:[],config:r,enter:m,exit:x,buffer:f,resume:h,setData:i,getData:u},L=[],O=-1;for(;++O<g.length;)if(g[O][1].type==="listOrdered"||g[O][1].type==="listUnordered")if(g[O][0]==="enter")L.push(O);else{let tn=L.pop();O=a(g,tn,O)}for(O=-1;++O<g.length;){let tn=r[g[O][0]];Gt.call(tn,g[O][1].type)&&tn[g[O][1].type].call(Object.assign({sliceSerialize:g[O][2].sliceSerialize},E),g[O][1])}if(E.tokenStack.length>0){let tn=E.tokenStack[E.tokenStack.length-1];(tn[1]||Yt).call(E,void 0,tn[0])}for(d.position={start:mn(g.length>0?g[0][1].start:{line:1,column:1,offset:0}),end:mn(g.length>0?g[g.length-2][1].end:{line:1,column:1,offset:0})},O=-1;++O<r.transforms.length;)d=r.transforms[O](d)||d;return d}function a(g,d,E){let L=d-1,O=-1,tn=!1,sn,an,Fn,Cn;for(;++L<=E;){let q=g[L];if(q[1].type==="listUnordered"||q[1].type==="listOrdered"||q[1].type==="blockQuote"?(q[0]==="enter"?O++:O--,Cn=void 0):q[1].type==="lineEndingBlank"?q[0]==="enter"&&(sn&&!Cn&&!O&&!Fn&&(Fn=L),Cn=void 0):q[1].type==="linePrefix"||q[1].type==="listItemValue"||q[1].type==="listItemMarker"||q[1].type==="listItemPrefix"||q[1].type==="listItemPrefixWhitespace"||(Cn=void 0),!O&&q[0]==="enter"&&q[1].type==="listItemPrefix"||O===-1&&q[0]==="exit"&&(q[1].type==="listUnordered"||q[1].type==="listOrdered")){if(sn){let Qn=L;for(an=void 0;Qn--;){let on=g[Qn];if(on[1].type==="lineEnding"||on[1].type==="lineEndingBlank"){if(on[0]==="exit")continue;an&&(g[an][1].type="lineEndingBlank",tn=!0),on[1].type="lineEnding",an=Qn}else if(!(on[1].type==="linePrefix"||on[1].type==="blockQuotePrefix"||on[1].type==="blockQuotePrefixWhitespace"||on[1].type==="blockQuoteMarker"||on[1].type==="listItemIndent"))break}Fn&&(!an||Fn<an)&&(sn._spread=!0),sn.end=Object.assign({},an?g[an][1].start:q[1].end),g.splice(an||L,0,["exit",sn,q[2]]),L++,E++}q[1].type==="listItemPrefix"&&(sn={type:"listItem",_spread:!1,start:Object.assign({},q[1].start),end:void 0},g.splice(L,0,["enter",sn,q[2]]),L++,E++,Fn=void 0,Cn=!0)}}return g[d][1]._spread=tn,E}function i(g,d){t[g]=d}function u(g){return t[g]}function o(g,d){return E;function E(L){m.call(this,g(L),L),d&&d.call(this,L)}}function f(){this.stack.push({type:"fragment",children:[]})}function m(g,d,E){return this.stack[this.stack.length-1].children.push(g),this.stack.push(g),this.tokenStack.push([d,E]),g.position={start:mn(d.start)},g}function c(g){return d;function d(E){g&&g.call(this,E),x.call(this,E)}}function x(g,d){let E=this.stack.pop(),L=this.tokenStack.pop();if(L)L[0].type!==g.type&&(d?d.call(this,g,L[0]):(L[1]||Yt).call(this,g,L[0]));else throw new Error("Cannot close `"+g.type+"` ("+Sn({start:g.start,end:g.end})+"): it\u2019s not open");return E.position.end=mn(g.end),E}function h(){return Un(this.stack.pop())}function p(){i("expectingFirstListItemValue",!0)}function T(g){if(u("expectingFirstListItemValue")){let d=this.stack[this.stack.length-2];d.start=Number.parseInt(this.sliceSerialize(g),10),i("expectingFirstListItemValue")}}function B(){let g=this.resume(),d=this.stack[this.stack.length-1];d.lang=g}function P(){let g=this.resume(),d=this.stack[this.stack.length-1];d.meta=g}function y(){u("flowCodeInside")||(this.buffer(),i("flowCodeInside",!0))}function R(){let g=this.resume(),d=this.stack[this.stack.length-1];d.value=g.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),i("flowCodeInside")}function S(){let g=this.resume(),d=this.stack[this.stack.length-1];d.value=g.replace(/(\r?\n|\r)$/g,"")}function _(g){let d=this.resume(),E=this.stack[this.stack.length-1];E.label=d,E.identifier=ln(this.sliceSerialize(g)).toLowerCase()}function M(){let g=this.resume(),d=this.stack[this.stack.length-1];d.title=g}function k(){let g=this.resume(),d=this.stack[this.stack.length-1];d.url=g}function D(g){let d=this.stack[this.stack.length-1];if(!d.depth){let E=this.sliceSerialize(g).length;d.depth=E}}function V(){i("setextHeadingSlurpLineEnding",!0)}function W(g){let d=this.stack[this.stack.length-1];d.depth=this.sliceSerialize(g).charCodeAt(0)===61?1:2}function Z(){i("setextHeadingSlurpLineEnding")}function H(g){let d=this.stack[this.stack.length-1],E=d.children[d.children.length-1];(!E||E.type!=="text")&&(E=ie(),E.position={start:mn(g.start)},d.children.push(E)),this.stack.push(E)}function I(g){let d=this.stack.pop();d.value+=this.sliceSerialize(g),d.position.end=mn(g.end)}function w(g){let d=this.stack[this.stack.length-1];if(u("atHardBreak")){let E=d.children[d.children.length-1];E.position.end=mn(g.end),i("atHardBreak");return}!u("setextHeadingSlurpLineEnding")&&r.canContainEols.includes(d.type)&&(H.call(this,g),I.call(this,g))}function z(){i("atHardBreak",!0)}function A(){let g=this.resume(),d=this.stack[this.stack.length-1];d.value=g}function j(){let g=this.resume(),d=this.stack[this.stack.length-1];d.value=g}function Q(){let g=this.resume(),d=this.stack[this.stack.length-1];d.value=g}function nn(){let g=this.stack[this.stack.length-1];if(u("inReference")){let d=u("referenceType")||"shortcut";g.type+="Reference",g.referenceType=d,delete g.url,delete g.title}else delete g.identifier,delete g.label;i("referenceType")}function en(){let g=this.stack[this.stack.length-1];if(u("inReference")){let d=u("referenceType")||"shortcut";g.type+="Reference",g.referenceType=d,delete g.url,delete g.title}else delete g.identifier,delete g.label;i("referenceType")}function l(g){let d=this.sliceSerialize(g),E=this.stack[this.stack.length-2];E.label=Ut(d),E.identifier=ln(d).toLowerCase()}function v(){let g=this.stack[this.stack.length-1],d=this.resume(),E=this.stack[this.stack.length-1];if(i("inReference",!0),E.type==="link"){let L=g.children;E.children=L}else E.alt=d}function rn(){let g=this.resume(),d=this.stack[this.stack.length-1];d.url=g}function s(){let g=this.resume(),d=this.stack[this.stack.length-1];d.title=g}function K(){i("inReference")}function kn(){i("referenceType","collapsed")}function Vn(g){let d=this.resume(),E=this.stack[this.stack.length-1];E.label=d,E.identifier=ln(this.sliceSerialize(g)).toLowerCase(),i("referenceType","full")}function wn(g){i("characterReferenceType",g.type)}function U(g){let d=this.sliceSerialize(g),E=u("characterReferenceType"),L;E?(L=qn(d,E==="characterReferenceMarkerNumeric"?10:16),i("characterReferenceType")):L=bn(d);let O=this.stack.pop();O.value+=L,O.position.end=mn(g.end)}function En(g){I.call(this,g);let d=this.stack[this.stack.length-1];d.url=this.sliceSerialize(g)}function un(g){I.call(this,g);let d=this.stack[this.stack.length-1];d.url="mailto:"+this.sliceSerialize(g)}function dn(){return{type:"blockquote",children:[]}}function hn(){return{type:"code",lang:null,meta:null,value:""}}function Wn(){return{type:"inlineCode",value:""}}function Xt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function vt(){return{type:"emphasis",children:[]}}function st(){return{type:"heading",depth:void 0,children:[]}}function ct(){return{type:"break"}}function pt(){return{type:"html",value:""}}function ne(){return{type:"image",title:null,url:"",alt:null}}function mt(){return{type:"link",title:null,url:"",children:[]}}function ht(g){return{type:"list",ordered:g.type==="listOrdered",start:null,spread:g._spread,children:[]}}function te(g){return{type:"listItem",spread:g._spread,checked:null,children:[]}}function ee(){return{type:"paragraph",children:[]}}function re(){return{type:"strong",children:[]}}function ie(){return{type:"text",value:""}}function ue(){return{type:"thematicBreak"}}}function mn(n){return{line:n.line,column:n.column,offset:n.offset}}function Jt(n,r){let t=-1;for(;++t<r.length;){let e=r[t];Array.isArray(e)?Jt(n,e):Dr(n,e)}}function Dr(n,r){let t;for(t in r)if(Gt.call(r,t)){if(t==="canContainEols"){let e=r[t];e&&n[t].push(...e)}else if(t==="transforms"){let e=r[t];e&&n[t].push(...e)}else if(t==="enter"||t==="exit"){let e=r[t];e&&Object.assign(n[t],e)}}}function Yt(n,r){throw n?new Error("Cannot close `"+n.type+"` ("+Sn({start:n.start,end:n.end})+"): a different token (`"+r.type+"`, "+Sn({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+Sn({start:r.start,end:r.end})+") is still open")}function Pr(n){let r=n.replace(/\n{2,}/g,`
`);return ft(r)}function _r(n){let r=Pr(n),{children:t}=Nn(r),e=[[]],a=0;function i(u,o="normal"){u.type==="text"?u.value.split(`
`).forEach((m,c)=>{c!==0&&(a++,e.push([])),m.split(" ").forEach(x=>{x&&e[a].push({content:x,type:o})})}):(u.type==="strong"||u.type==="emphasis")&&u.children.forEach(f=>{i(f,u.type)})}return t.forEach(u=>{u.type==="paragraph"&&u.children.forEach(o=>{i(o)})}),e}function Mr(n){let{children:r}=Nn(n);function t(e){return e.type==="text"?e.value.replace(/\n/g,"<br/>"):e.type==="strong"?`<strong>${e.children.map(t).join("")}</strong>`:e.type==="emphasis"?`<em>${e.children.map(t).join("")}</em>`:e.type==="paragraph"?`<p>${e.children.map(t).join("")}</p>`:`Unsupported markdown: ${e.type}`}return r.map(t).join("")}function Rr(n){return Intl.Segmenter?[...new Intl.Segmenter().segment(n)].map(r=>r.segment):[...n]}function jr(n,r){let t=Rr(r.content);return Kt(n,[],t,r.type)}function Kt(n,r,t,e){if(t.length===0)return[{content:r.join(""),type:e},{content:"",type:e}];let[a,...i]=t,u=[...r,a];return n([{content:u.join(""),type:e}])?Kt(n,u,i,e):(r.length===0&&a&&(r.push(a),t.shift()),[{content:r.join(""),type:e},{content:t.join(""),type:e}])}function Hr(n,r){if(n.some(({content:t})=>t.includes(`
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return at(n,r)}function at(n,r,t=[],e=[]){if(n.length===0)return e.length>0&&t.push(e),t.length>0?t:[];let a="";n[0].content===" "&&(a=" ",n.shift());let i=n.shift()??{content:" ",type:"normal"},u=[...e];if(a!==""&&u.push({content:a,type:"normal"}),u.push(i),r(u))return at(n,r,t,u);if(e.length>0)t.push(e),n.unshift(i);else if(i.content){let[o,f]=jr(r,i);t.push([o]),f.content&&n.unshift(f)}return at(n,r,t)}function qr(n,r){r&&n.attr("style",r)}function Nr(n,r,t,e,a=!1){let i=n.append("foreignObject"),u=i.append("xhtml:div"),o=r.label,f=r.isNode?"nodeLabel":"edgeLabel";u.html(`
<span class="${f} ${e}" `+(r.labelStyle?'style="'+r.labelStyle+'"':"")+">"+o+"</span>"),qr(u,r.labelStyle),u.style("display","table-cell"),u.style("white-space","nowrap"),u.style("max-width",t+"px"),u.attr("xmlns","http://www.w3.org/1999/xhtml"),a&&u.attr("class","labelBkg");let m=u.node().getBoundingClientRect();return m.width===t&&(u.style("display","table"),u.style("white-space","break-spaces"),u.style("width",t+"px"),m=u.node().getBoundingClientRect()),i.style("width",m.width),i.style("height",m.height),i.node()}function ot(n,r,t){return n.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",r*t-.1+"em").attr("dy",t+"em")}function Vr(n,r,t){let e=n.append("text"),a=ot(e,1,r);lt(a,t);let i=a.node().getComputedTextLength();return e.remove(),i}function ao(n,r,t){var e;let a=n.append("text"),i=ot(a,1,r);lt(i,[{content:t,type:"normal"}]);let u=(e=i.node())==null?void 0:e.getBoundingClientRect();return u&&a.remove(),u}function Wr(n,r,t,e=!1){let i=r.append("g"),u=i.insert("rect").attr("class","background"),o=i.append("text").attr("y","-10.1"),f=0;for(let m of t){let c=h=>Vr(i,1.1,h)<=n,x=c(m)?[m]:Hr(m,c);for(let h of x){let p=ot(o,f,1.1);lt(p,h),f++}}if(e){let m=o.node().getBBox(),c=2;return u.attr("x",-c).attr("y",-c).attr("width",m.width+2*c).attr("height",m.height+2*c),i.node()}else return o.node()}function lt(n,r){n.text(""),r.forEach((t,e)=>{let a=n.append("tspan").attr("font-style",t.type==="emphasis"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",t.type==="strong"?"bold":"normal");e===0?a.text(t.content):a.text(" "+t.content)})}var oo=(n,r="",{style:t="",isTitle:e=!1,classes:a="",useHtmlLabels:i=!0,isNode:u=!0,width:o=200,addSvgBackground:f=!1}={})=>{if(xt.info("createText",r,t,e,a,i,u,f),i){let m=Mr(r),c={isNode:u,label:gt(m).replace(/fa[blrs]?:fa-[\w-]+/g,h=>`<i class='${h.replace(":"," ")}'></i>`),labelStyle:t.replace("fill:","color:")};return Nr(n,c,o,a,f)}else{let m=_r(r);return Wr(o,n,m,f)}};export{ao as a,oo as b};