f7cloud_client/apps/whiteboard/js/createText-2e5e7dd3-DGO2Nq3C.chunk.mjs
root 8b6a0139db f7cloud_client
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-17 22:59:26 +00:00

10 lines
59 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! third party licenses: js/vendor.LICENSE.txt */
import{l as At,r as It}from"./index-CyCAgei9.chunk.mjs";import{O as Tt}from"./isEmpty-nTVdZyYD.chunk.mjs";const qe=document.createElement("i");function ze(e){const r="&"+e+";";qe.innerHTML=r;const t=qe.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===r?!1:t}const Ct={};function wt(e,r){const t=Ct,n=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,u=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return tt(e,n,u)}function tt(e,r,t){if(zt(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(r&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Ve(e.children,r,t)}return Array.isArray(e)?Ve(e,r,t):""}function Ve(e,r,t){const n=[];let u=-1;for(;++u<e.length;)n[u]=tt(e[u],r,t);return n.join("")}function zt(e){return!!(e&&typeof e=="object")}function te(e,r,t,n){const u=e.length;let c=0,i;if(r<0?r=-r>u?0:u+r:r=r>u?u:r,t=t>0?t:0,n.length<1e4)i=Array.from(n),i.unshift(r,t),e.splice(...i);else for(t&&e.splice(r,t);c<n.length;)i=n.slice(c,c+1e4),i.unshift(r,0),e.splice(...i),c+=1e4,r+=1e4}function K(e,r){return e.length>0?(te(e,e.length,0,r),e):r}const Ne={}.hasOwnProperty;function Dt(e){const r={};let t=-1;for(;++t<e.length;)_t(r,e[t]);return r}function _t(e,r){let t;for(t in r){const n=(Ne.call(e,t)?e[t]:void 0)||(e[t]={}),u=r[t];let c;if(u)for(c in u){Ne.call(n,c)||(n[c]=[]);const i=u[c];Bt(n[c],Array.isArray(i)?i:i?[i]:[])}}}function Bt(e,r){let t=-1;const n=[];for(;++t<r.length;)(r[t].add==="after"?e:n).push(r[t]);te(e,0,0,n)}const Mt=/[!-\/:-@\[-`\{-~\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]/,ee=se(/[A-Za-z]/),Z=se(/[\dA-Za-z]/),Pt=se(/[#-'*+\--9=?A-Z^-~]/);function Ae(e){return e!==null&&(e<32||e===127)}const Ie=se(/\d/),Lt=se(/[\dA-Fa-f]/),Ot=se(/[!-/:-@[-`{-~]/);function E(e){return e!==null&&e<-2}function $(e){return e!==null&&(e<0||e===32)}function T(e){return e===-2||e===-1||e===32}const jt=se(Mt),Ht=se(/\s/);function se(e){return r;function r(t){return t!==null&&e.test(String.fromCharCode(t))}}function _(e,r,t,n){const u=n?n-1:Number.POSITIVE_INFINITY;let c=0;return i;function i(p){return T(p)?(e.enter(t),o(p)):r(p)}function o(p){return T(p)&&c++<u?(e.consume(p),o):(e.exit(t),r(p))}}const Rt={tokenize:qt};function qt(e){const r=e.attempt(this.parser.constructs.contentInitial,n,u);let t;return r;function n(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),_(e,r,"linePrefix")}function u(o){return e.enter("paragraph"),c(o)}function c(o){const p=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=p),t=p,i(o)}function i(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return E(o)?(e.consume(o),e.exit("chunkText"),c):(e.consume(o),i)}}const Vt={tokenize:Nt},Ue={tokenize:Ut};function Nt(e){const r=this,t=[];let n=0,u,c,i;return o;function o(S){if(n<t.length){const B=t[n];return r.containerState=B[1],e.attempt(B[0].continuation,p,a)(S)}return a(S)}function p(S){if(n++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,u&&O();const B=r.events.length;let P=B,x;for(;P--;)if(r.events[P][0]==="exit"&&r.events[P][1].type==="chunkFlow"){x=r.events[P][1].end;break}y(n);let w=B;for(;w<r.events.length;)r.events[w][1].end=Object.assign({},x),w++;return te(r.events,P+1,0,r.events.slice(B)),r.events.length=w,a(S)}return o(S)}function a(S){if(n===t.length){if(!u)return g(S);if(u.currentConstruct&&u.currentConstruct.concrete)return I(S);r.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return r.containerState={},e.check(Ue,d,h)(S)}function d(S){return u&&O(),y(n),g(S)}function h(S){return r.parser.lazy[r.now().line]=n!==t.length,i=r.now().offset,I(S)}function g(S){return r.containerState={},e.attempt(Ue,f,I)(S)}function f(S){return n++,t.push([r.currentConstruct,r.containerState]),g(S)}function I(S){if(S===null){u&&O(),y(0),e.consume(S);return}return u=u||r.parser.flow(r.now()),e.enter("chunkFlow",{contentType:"flow",previous:c,_tokenizer:u}),C(S)}function C(S){if(S===null){L(e.exit("chunkFlow"),!0),y(0),e.consume(S);return}return E(S)?(e.consume(S),L(e.exit("chunkFlow")),n=0,r.interrupt=void 0,o):(e.consume(S),C)}function L(S,B){const P=r.sliceStream(S);if(B&&P.push(null),S.previous=c,c&&(c.next=S),c=S,u.defineSkip(S.start),u.write(P),r.parser.lazy[S.start.line]){let x=u.events.length;for(;x--;)if(u.events[x][1].start.offset<i&&(!u.events[x][1].end||u.events[x][1].end.offset>i))return;const w=r.events.length;let R=w,q,V;for(;R--;)if(r.events[R][0]==="exit"&&r.events[R][1].type==="chunkFlow"){if(q){V=r.events[R][1].end;break}q=!0}for(y(n),x=w;x<r.events.length;)r.events[x][1].end=Object.assign({},V),x++;te(r.events,R+1,0,r.events.slice(w)),r.events.length=x}}function y(S){let B=t.length;for(;B-- >S;){const P=t[B];r.containerState=P[1],P[0].exit.call(r,e)}t.length=S}function O(){u.write([null]),c=void 0,u=void 0,r.containerState._closeFlow=void 0}}function Ut(e,r,t){return _(e,e.attempt(this.parser.constructs.document,r,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function We(e){if(e===null||$(e)||Ht(e))return 1;if(jt(e))return 2}function De(e,r,t){const n=[];let u=-1;for(;++u<e.length;){const c=e[u].resolveAll;c&&!n.includes(c)&&(r=c(r,t),n.push(c))}return r}const Te={name:"attention",tokenize:Qt,resolveAll:Wt};function Wt(e,r){let t=-1,n,u,c,i,o,p,a,d;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(n=t;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&r.sliceSerialize(e[n][1]).charCodeAt(0)===r.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[n][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;p=e[n][1].end.offset-e[n][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const h=Object.assign({},e[n][1].end),g=Object.assign({},e[t][1].start);Qe(h,-p),Qe(g,p),i={type:p>1?"strongSequence":"emphasisSequence",start:h,end:Object.assign({},e[n][1].end)},o={type:p>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[t][1].start),end:g},c={type:p>1?"strongText":"emphasisText",start:Object.assign({},e[n][1].end),end:Object.assign({},e[t][1].start)},u={type:p>1?"strong":"emphasis",start:Object.assign({},i.start),end:Object.assign({},o.end)},e[n][1].end=Object.assign({},i.start),e[t][1].start=Object.assign({},o.end),a=[],e[n][1].end.offset-e[n][1].start.offset&&(a=K(a,[["enter",e[n][1],r],["exit",e[n][1],r]])),a=K(a,[["enter",u,r],["enter",i,r],["exit",i,r],["enter",c,r]]),a=K(a,De(r.parser.constructs.insideSpan.null,e.slice(n+1,t),r)),a=K(a,[["exit",c,r],["enter",o,r],["exit",o,r],["exit",u,r]]),e[t][1].end.offset-e[t][1].start.offset?(d=2,a=K(a,[["enter",e[t][1],r],["exit",e[t][1],r]])):d=0,te(e,n-1,t-n+3,a),t=n+a.length-d-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function Qt(e,r){const t=this.parser.constructs.attentionMarkers.null,n=this.previous,u=We(n);let c;return i;function i(p){return c=p,e.enter("attentionSequence"),o(p)}function o(p){if(p===c)return e.consume(p),o;const a=e.exit("attentionSequence"),d=We(p),h=!d||d===2&&u||t.includes(p),g=!u||u===2&&d||t.includes(n);return a._open=!!(c===42?h:h&&(u||!g)),a._close=!!(c===42?g:g&&(d||!h)),r(p)}}function Qe(e,r){e.column+=r,e.offset+=r,e._bufferIndex+=r}const $t={name:"autolink",tokenize:Kt};function Kt(e,r,t){let n=0;return u;function u(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(f){return ee(f)?(e.consume(f),i):a(f)}function i(f){return f===43||f===45||f===46||Z(f)?(n=1,o(f)):a(f)}function o(f){return f===58?(e.consume(f),n=0,p):(f===43||f===45||f===46||Z(f))&&n++<32?(e.consume(f),o):(n=0,a(f))}function p(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),r):f===null||f===32||f===60||Ae(f)?t(f):(e.consume(f),p)}function a(f){return f===64?(e.consume(f),d):Pt(f)?(e.consume(f),a):t(f)}function d(f){return Z(f)?h(f):t(f)}function h(f){return f===46?(e.consume(f),n=0,d):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),r):g(f)}function g(f){if((f===45||Z(f))&&n++<63){const I=f===45?g:h;return e.consume(f),I}return t(f)}}const Fe={tokenize:Gt,partial:!0};function Gt(e,r,t){return n;function n(c){return T(c)?_(e,u,"linePrefix")(c):u(c)}function u(c){return c===null||E(c)?r(c):t(c)}}const nt={name:"blockQuote",tokenize:Jt,continuation:{tokenize:Xt},exit:Zt};function Jt(e,r,t){const n=this;return u;function u(i){if(i===62){const o=n.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),c}return t(i)}function c(i){return T(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),r):(e.exit("blockQuotePrefix"),r(i))}}function Xt(e,r,t){const n=this;return u;function u(i){return T(i)?_(e,c,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):c(i)}function c(i){return e.attempt(nt,r,t)(i)}}function Zt(e){e.exit("blockQuote")}const rt={name:"characterEscape",tokenize:Yt};function Yt(e,r,t){return n;function n(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),u}function u(c){return Ot(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),r):t(c)}}const it={name:"characterReference",tokenize:en};function en(e,r,t){const n=this;let u=0,c,i;return o;function o(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),p}function p(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),a):(e.enter("characterReferenceValue"),c=31,i=Z,d(h))}function a(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,i=Lt,d):(e.enter("characterReferenceValue"),c=7,i=Ie,d(h))}function d(h){if(h===59&&u){const g=e.exit("characterReferenceValue");return i===Z&&!ze(n.sliceSerialize(g))?t(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),r)}return i(h)&&u++<c?(e.consume(h),d):t(h)}}const $e={tokenize:nn,partial:!0},Ke={name:"codeFenced",tokenize:tn,concrete:!0};function tn(e,r,t){const n=this,u={tokenize:P,partial:!0};let c=0,i=0,o;return p;function p(x){return a(x)}function a(x){const w=n.events[n.events.length-1];return c=w&&w[1].type==="linePrefix"?w[2].sliceSerialize(w[1],!0).length:0,o=x,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(x)}function d(x){return x===o?(i++,e.consume(x),d):i<3?t(x):(e.exit("codeFencedFenceSequence"),T(x)?_(e,h,"whitespace")(x):h(x))}function h(x){return x===null||E(x)?(e.exit("codeFencedFence"),n.interrupt?r(x):e.check($e,C,B)(x)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===null||E(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(x)):T(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),_(e,f,"whitespace")(x)):x===96&&x===o?t(x):(e.consume(x),g)}function f(x){return x===null||E(x)?h(x):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),I(x))}function I(x){return x===null||E(x)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(x)):x===96&&x===o?t(x):(e.consume(x),I)}function C(x){return e.attempt(u,B,L)(x)}function L(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),y}function y(x){return c>0&&T(x)?_(e,O,"linePrefix",c+1)(x):O(x)}function O(x){return x===null||E(x)?e.check($e,C,B)(x):(e.enter("codeFlowValue"),S(x))}function S(x){return x===null||E(x)?(e.exit("codeFlowValue"),O(x)):(e.consume(x),S)}function B(x){return e.exit("codeFenced"),r(x)}function P(x,w,R){let q=0;return V;function V(A){return x.enter("lineEnding"),x.consume(A),x.exit("lineEnding"),F}function F(A){return x.enter("codeFencedFence"),T(A)?_(x,v,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):v(A)}function v(A){return A===o?(x.enter("codeFencedFenceSequence"),M(A)):R(A)}function M(A){return A===o?(q++,x.consume(A),M):q>=i?(x.exit("codeFencedFenceSequence"),T(A)?_(x,j,"whitespace")(A):j(A)):R(A)}function j(A){return A===null||E(A)?(x.exit("codeFencedFence"),w(A)):R(A)}}}function nn(e,r,t){const n=this;return u;function u(i){return i===null?t(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),c)}function c(i){return n.parser.lazy[n.now().line]?t(i):r(i)}}const be={name:"codeIndented",tokenize:un},rn={tokenize:cn,partial:!0};function un(e,r,t){const n=this;return u;function u(a){return e.enter("codeIndented"),_(e,c,"linePrefix",5)(a)}function c(a){const d=n.events[n.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?i(a):t(a)}function i(a){return a===null?p(a):E(a)?e.attempt(rn,i,p)(a):(e.enter("codeFlowValue"),o(a))}function o(a){return a===null||E(a)?(e.exit("codeFlowValue"),i(a)):(e.consume(a),o)}function p(a){return e.exit("codeIndented"),r(a)}}function cn(e,r,t){const n=this;return u;function u(i){return n.parser.lazy[n.now().line]?t(i):E(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),u):_(e,c,"linePrefix",5)(i)}function c(i){const o=n.events[n.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?r(i):E(i)?u(i):t(i)}}const on={name:"codeText",tokenize:an,resolve:sn,previous:ln};function sn(e){let r=e.length-4,t=3,n,u;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[r][1].type==="lineEnding"||e[r][1].type==="space")){for(n=t;++n<r;)if(e[n][1].type==="codeTextData"){e[t][1].type="codeTextPadding",e[r][1].type="codeTextPadding",t+=2,r-=2;break}}for(n=t-1,r++;++n<=r;)u===void 0?n!==r&&e[n][1].type!=="lineEnding"&&(u=n):(n===r||e[n][1].type==="lineEnding")&&(e[u][1].type="codeTextData",n!==u+2&&(e[u][1].end=e[n-1][1].end,e.splice(u+2,n-u-2),r-=n-u-2,n=u+2),u=void 0);return e}function ln(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function an(e,r,t){let n=0,u,c;return i;function i(h){return e.enter("codeText"),e.enter("codeTextSequence"),o(h)}function o(h){return h===96?(e.consume(h),n++,o):(e.exit("codeTextSequence"),p(h))}function p(h){return h===null?t(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),p):h===96?(c=e.enter("codeTextSequence"),u=0,d(h)):E(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),p):(e.enter("codeTextData"),a(h))}function a(h){return h===null||h===32||h===96||E(h)?(e.exit("codeTextData"),p(h)):(e.consume(h),a)}function d(h){return h===96?(e.consume(h),u++,d):u===n?(e.exit("codeTextSequence"),e.exit("codeText"),r(h)):(c.type="codeTextData",a(h))}}function ut(e){const r={};let t=-1,n,u,c,i,o,p,a;for(;++t<e.length;){for(;t in r;)t=r[t];if(n=e[t],t&&n[1].type==="chunkFlow"&&e[t-1][1].type==="listItemPrefix"&&(p=n[1]._tokenizer.events,c=0,c<p.length&&p[c][1].type==="lineEndingBlank"&&(c+=2),c<p.length&&p[c][1].type==="content"))for(;++c<p.length&&p[c][1].type!=="content";)p[c][1].type==="chunkText"&&(p[c][1]._isInFirstContentOfListItem=!0,c++);if(n[0]==="enter")n[1].contentType&&(Object.assign(r,fn(e,t)),t=r[t],a=!0);else if(n[1]._container){for(c=t,u=void 0;c--&&(i=e[c],i[1].type==="lineEnding"||i[1].type==="lineEndingBlank");)i[0]==="enter"&&(u&&(e[u][1].type="lineEndingBlank"),i[1].type="lineEnding",u=c);u&&(n[1].end=Object.assign({},e[u][1].start),o=e.slice(u,t),o.unshift(n),te(e,u,t-u+1,o))}}return!a}function fn(e,r){const t=e[r][1],n=e[r][2];let u=r-1;const c=[],i=t._tokenizer||n.parser[t.contentType](t.start),o=i.events,p=[],a={};let d,h,g=-1,f=t,I=0,C=0;const L=[C];for(;f;){for(;e[++u][1]!==f;);c.push(u),f._tokenizer||(d=n.sliceStream(f),f.next||d.push(null),h&&i.defineSkip(f.start),f._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(d),f._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),h=f,f=f.next}for(f=t;++g<o.length;)o[g][0]==="exit"&&o[g-1][0]==="enter"&&o[g][1].type===o[g-1][1].type&&o[g][1].start.line!==o[g][1].end.line&&(C=g+1,L.push(C),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(i.events=[],f?(f._tokenizer=void 0,f.previous=void 0):L.pop(),g=L.length;g--;){const y=o.slice(L[g],L[g+1]),O=c.pop();p.unshift([O,O+y.length-1]),te(e,O,2,y)}for(g=-1;++g<p.length;)a[I+p[g][0]]=I+p[g][1],I+=p[g][1]-p[g][0]-1;return a}const dn={tokenize:mn,resolve:hn},pn={tokenize:gn,partial:!0};function hn(e){return ut(e),e}function mn(e,r){let t;return n;function n(o){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),u(o)}function u(o){return o===null?c(o):E(o)?e.check(pn,i,c)(o):(e.consume(o),u)}function c(o){return e.exit("chunkContent"),e.exit("content"),r(o)}function i(o){return e.consume(o),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,u}}function gn(e,r,t){const n=this;return u;function u(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),_(e,c,"linePrefix")}function c(i){if(i===null||E(i))return t(i);const o=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?r(i):e.interrupt(n.parser.constructs.flow,t,r)(i)}}function ct(e,r,t,n,u,c,i,o,p){const a=p||Number.POSITIVE_INFINITY;let d=0;return h;function h(y){return y===60?(e.enter(n),e.enter(u),e.enter(c),e.consume(y),e.exit(c),g):y===null||y===32||y===41||Ae(y)?t(y):(e.enter(n),e.enter(i),e.enter(o),e.enter("chunkString",{contentType:"string"}),C(y))}function g(y){return y===62?(e.enter(c),e.consume(y),e.exit(c),e.exit(u),e.exit(n),r):(e.enter(o),e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(o),g(y)):y===null||y===60||E(y)?t(y):(e.consume(y),y===92?I:f)}function I(y){return y===60||y===62||y===92?(e.consume(y),f):f(y)}function C(y){return!d&&(y===null||y===41||$(y))?(e.exit("chunkString"),e.exit(o),e.exit(i),e.exit(n),r(y)):d<a&&y===40?(e.consume(y),d++,C):y===41?(e.consume(y),d--,C):y===null||y===32||y===40||Ae(y)?t(y):(e.consume(y),y===92?L:C)}function L(y){return y===40||y===41||y===92?(e.consume(y),C):C(y)}}function ot(e,r,t,n,u,c){const i=this;let o=0,p;return a;function a(f){return e.enter(n),e.enter(u),e.consume(f),e.exit(u),e.enter(c),d}function d(f){return o>999||f===null||f===91||f===93&&!p||f===94&&!o&&"_hiddenFootnoteSupport"in i.parser.constructs?t(f):f===93?(e.exit(c),e.enter(u),e.consume(f),e.exit(u),e.exit(n),r):E(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===null||f===91||f===93||E(f)||o++>999?(e.exit("chunkString"),d(f)):(e.consume(f),p||(p=!T(f)),f===92?g:h)}function g(f){return f===91||f===92||f===93?(e.consume(f),o++,h):h(f)}}function st(e,r,t,n,u,c){let i;return o;function o(g){return g===34||g===39||g===40?(e.enter(n),e.enter(u),e.consume(g),e.exit(u),i=g===40?41:g,p):t(g)}function p(g){return g===i?(e.enter(u),e.consume(g),e.exit(u),e.exit(n),r):(e.enter(c),a(g))}function a(g){return g===i?(e.exit(c),p(i)):g===null?t(g):E(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),_(e,a,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(g))}function d(g){return g===i||g===null||E(g)?(e.exit("chunkString"),a(g)):(e.consume(g),g===92?h:d)}function h(g){return g===i||g===92?(e.consume(g),d):d(g)}}function xe(e,r){let t;return n;function n(u){return E(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),t=!0,n):T(u)?_(e,n,t?"linePrefix":"lineSuffix")(u):r(u)}}function he(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const xn={name:"definition",tokenize:yn},kn={tokenize:Fn,partial:!0};function yn(e,r,t){const n=this;let u;return c;function c(f){return e.enter("definition"),i(f)}function i(f){return ot.call(n,e,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function o(f){return u=he(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),p):t(f)}function p(f){return $(f)?xe(e,a)(f):a(f)}function a(f){return ct(e,d,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return e.attempt(kn,h,h)(f)}function h(f){return T(f)?_(e,g,"whitespace")(f):g(f)}function g(f){return f===null||E(f)?(e.exit("definition"),n.parser.defined.push(u),r(f)):t(f)}}function Fn(e,r,t){return n;function n(o){return $(o)?xe(e,u)(o):t(o)}function u(o){return st(e,c,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function c(o){return T(o)?_(e,i,"whitespace")(o):i(o)}function i(o){return o===null||E(o)?r(o):t(o)}}const vn={name:"hardBreakEscape",tokenize:Sn};function Sn(e,r,t){return n;function n(c){return e.enter("hardBreakEscape"),e.consume(c),u}function u(c){return E(c)?(e.exit("hardBreakEscape"),r(c)):t(c)}}const bn={name:"headingAtx",tokenize:An,resolve:En};function En(e,r){let t=e.length-2,n=3,u,c;return e[n][1].type==="whitespace"&&(n+=2),t-2>n&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(n===t-1||t-4>n&&e[t-2][1].type==="whitespace")&&(t-=n+1===t?2:4),t>n&&(u={type:"atxHeadingText",start:e[n][1].start,end:e[t][1].end},c={type:"chunkText",start:e[n][1].start,end:e[t][1].end,contentType:"text"},te(e,n,t-n+1,[["enter",u,r],["enter",c,r],["exit",c,r],["exit",u,r]])),e}function An(e,r,t){let n=0;return u;function u(d){return e.enter("atxHeading"),c(d)}function c(d){return e.enter("atxHeadingSequence"),i(d)}function i(d){return d===35&&n++<6?(e.consume(d),i):d===null||$(d)?(e.exit("atxHeadingSequence"),o(d)):t(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),p(d)):d===null||E(d)?(e.exit("atxHeading"),r(d)):T(d)?_(e,o,"whitespace")(d):(e.enter("atxHeadingText"),a(d))}function p(d){return d===35?(e.consume(d),p):(e.exit("atxHeadingSequence"),o(d))}function a(d){return d===null||d===35||$(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),a)}}const In=["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"],Ge=["pre","script","style","textarea"],Tn={name:"htmlFlow",tokenize:Dn,resolveTo:zn,concrete:!0},Cn={tokenize:Bn,partial:!0},wn={tokenize:_n,partial:!0};function zn(e){let r=e.length;for(;r--&&!(e[r][0]==="enter"&&e[r][1].type==="htmlFlow"););return r>1&&e[r-2][1].type==="linePrefix"&&(e[r][1].start=e[r-2][1].start,e[r+1][1].start=e[r-2][1].start,e.splice(r-2,2)),e}function Dn(e,r,t){const n=this;let u,c,i,o,p;return a;function a(l){return d(l)}function d(l){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(l),h}function h(l){return l===33?(e.consume(l),g):l===47?(e.consume(l),c=!0,C):l===63?(e.consume(l),u=3,n.interrupt?r:s):ee(l)?(e.consume(l),i=String.fromCharCode(l),L):t(l)}function g(l){return l===45?(e.consume(l),u=2,f):l===91?(e.consume(l),u=5,o=0,I):ee(l)?(e.consume(l),u=4,n.interrupt?r:s):t(l)}function f(l){return l===45?(e.consume(l),n.interrupt?r:s):t(l)}function I(l){const X="CDATA[";return l===X.charCodeAt(o++)?(e.consume(l),o===X.length?n.interrupt?r:v:I):t(l)}function C(l){return ee(l)?(e.consume(l),i=String.fromCharCode(l),L):t(l)}function L(l){if(l===null||l===47||l===62||$(l)){const X=l===47,ae=i.toLowerCase();return!X&&!c&&Ge.includes(ae)?(u=1,n.interrupt?r(l):v(l)):In.includes(i.toLowerCase())?(u=6,X?(e.consume(l),y):n.interrupt?r(l):v(l)):(u=7,n.interrupt&&!n.parser.lazy[n.now().line]?t(l):c?O(l):S(l))}return l===45||Z(l)?(e.consume(l),i+=String.fromCharCode(l),L):t(l)}function y(l){return l===62?(e.consume(l),n.interrupt?r:v):t(l)}function O(l){return T(l)?(e.consume(l),O):V(l)}function S(l){return l===47?(e.consume(l),V):l===58||l===95||ee(l)?(e.consume(l),B):T(l)?(e.consume(l),S):V(l)}function B(l){return l===45||l===46||l===58||l===95||Z(l)?(e.consume(l),B):P(l)}function P(l){return l===61?(e.consume(l),x):T(l)?(e.consume(l),P):S(l)}function x(l){return l===null||l===60||l===61||l===62||l===96?t(l):l===34||l===39?(e.consume(l),p=l,w):T(l)?(e.consume(l),x):R(l)}function w(l){return l===p?(e.consume(l),p=null,q):l===null||E(l)?t(l):(e.consume(l),w)}function R(l){return l===null||l===34||l===39||l===47||l===60||l===61||l===62||l===96||$(l)?P(l):(e.consume(l),R)}function q(l){return l===47||l===62||T(l)?S(l):t(l)}function V(l){return l===62?(e.consume(l),F):t(l)}function F(l){return l===null||E(l)?v(l):T(l)?(e.consume(l),F):t(l)}function v(l){return l===45&&u===2?(e.consume(l),W):l===60&&u===1?(e.consume(l),N):l===62&&u===4?(e.consume(l),J):l===63&&u===3?(e.consume(l),s):l===93&&u===5?(e.consume(l),ne):E(l)&&(u===6||u===7)?(e.exit("htmlFlowData"),e.check(Cn,re,M)(l)):l===null||E(l)?(e.exit("htmlFlowData"),M(l)):(e.consume(l),v)}function M(l){return e.check(wn,j,re)(l)}function j(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),A}function A(l){return l===null||E(l)?M(l):(e.enter("htmlFlowData"),v(l))}function W(l){return l===45?(e.consume(l),s):v(l)}function N(l){return l===47?(e.consume(l),i="",G):v(l)}function G(l){if(l===62){const X=i.toLowerCase();return Ge.includes(X)?(e.consume(l),J):v(l)}return ee(l)&&i.length<8?(e.consume(l),i+=String.fromCharCode(l),G):v(l)}function ne(l){return l===93?(e.consume(l),s):v(l)}function s(l){return l===62?(e.consume(l),J):l===45&&u===2?(e.consume(l),s):v(l)}function J(l){return l===null||E(l)?(e.exit("htmlFlowData"),re(l)):(e.consume(l),J)}function re(l){return e.exit("htmlFlow"),r(l)}}function _n(e,r,t){const n=this;return u;function u(i){return E(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),c):t(i)}function c(i){return n.parser.lazy[n.now().line]?t(i):r(i)}}function Bn(e,r,t){return n;function n(u){return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),e.attempt(Fe,r,t)}}const Mn={name:"htmlText",tokenize:Pn};function Pn(e,r,t){const n=this;let u,c,i;return o;function o(s){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(s),p}function p(s){return s===33?(e.consume(s),a):s===47?(e.consume(s),P):s===63?(e.consume(s),S):ee(s)?(e.consume(s),R):t(s)}function a(s){return s===45?(e.consume(s),d):s===91?(e.consume(s),c=0,I):ee(s)?(e.consume(s),O):t(s)}function d(s){return s===45?(e.consume(s),f):t(s)}function h(s){return s===null?t(s):s===45?(e.consume(s),g):E(s)?(i=h,N(s)):(e.consume(s),h)}function g(s){return s===45?(e.consume(s),f):h(s)}function f(s){return s===62?W(s):s===45?g(s):h(s)}function I(s){const J="CDATA[";return s===J.charCodeAt(c++)?(e.consume(s),c===J.length?C:I):t(s)}function C(s){return s===null?t(s):s===93?(e.consume(s),L):E(s)?(i=C,N(s)):(e.consume(s),C)}function L(s){return s===93?(e.consume(s),y):C(s)}function y(s){return s===62?W(s):s===93?(e.consume(s),y):C(s)}function O(s){return s===null||s===62?W(s):E(s)?(i=O,N(s)):(e.consume(s),O)}function S(s){return s===null?t(s):s===63?(e.consume(s),B):E(s)?(i=S,N(s)):(e.consume(s),S)}function B(s){return s===62?W(s):S(s)}function P(s){return ee(s)?(e.consume(s),x):t(s)}function x(s){return s===45||Z(s)?(e.consume(s),x):w(s)}function w(s){return E(s)?(i=w,N(s)):T(s)?(e.consume(s),w):W(s)}function R(s){return s===45||Z(s)?(e.consume(s),R):s===47||s===62||$(s)?q(s):t(s)}function q(s){return s===47?(e.consume(s),W):s===58||s===95||ee(s)?(e.consume(s),V):E(s)?(i=q,N(s)):T(s)?(e.consume(s),q):W(s)}function V(s){return s===45||s===46||s===58||s===95||Z(s)?(e.consume(s),V):F(s)}function F(s){return s===61?(e.consume(s),v):E(s)?(i=F,N(s)):T(s)?(e.consume(s),F):q(s)}function v(s){return s===null||s===60||s===61||s===62||s===96?t(s):s===34||s===39?(e.consume(s),u=s,M):E(s)?(i=v,N(s)):T(s)?(e.consume(s),v):(e.consume(s),j)}function M(s){return s===u?(e.consume(s),u=void 0,A):s===null?t(s):E(s)?(i=M,N(s)):(e.consume(s),M)}function j(s){return s===null||s===34||s===39||s===60||s===61||s===96?t(s):s===47||s===62||$(s)?q(s):(e.consume(s),j)}function A(s){return s===47||s===62||$(s)?q(s):t(s)}function W(s){return s===62?(e.consume(s),e.exit("htmlTextData"),e.exit("htmlText"),r):t(s)}function N(s){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),G}function G(s){return T(s)?_(e,ne,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):ne(s)}function ne(s){return e.enter("htmlTextData"),i(s)}}const _e={name:"labelEnd",tokenize:qn,resolveTo:Rn,resolveAll:Hn},Ln={tokenize:Vn},On={tokenize:Nn},jn={tokenize:Un};function Hn(e){let r=-1;for(;++r<e.length;){const t=e[r][1];(t.type==="labelImage"||t.type==="labelLink"||t.type==="labelEnd")&&(e.splice(r+1,t.type==="labelImage"?4:2),t.type="data",r++)}return e}function Rn(e,r){let t=e.length,n=0,u,c,i,o;for(;t--;)if(u=e[t][1],c){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;e[t][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(i){if(e[t][0]==="enter"&&(u.type==="labelImage"||u.type==="labelLink")&&!u._balanced&&(c=t,u.type!=="labelLink")){n=2;break}}else u.type==="labelEnd"&&(i=t);const p={type:e[c][1].type==="labelLink"?"link":"image",start:Object.assign({},e[c][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"label",start:Object.assign({},e[c][1].start),end:Object.assign({},e[i][1].end)},d={type:"labelText",start:Object.assign({},e[c+n+2][1].end),end:Object.assign({},e[i-2][1].start)};return o=[["enter",p,r],["enter",a,r]],o=K(o,e.slice(c+1,c+n+3)),o=K(o,[["enter",d,r]]),o=K(o,De(r.parser.constructs.insideSpan.null,e.slice(c+n+4,i-3),r)),o=K(o,[["exit",d,r],e[i-2],e[i-1],["exit",a,r]]),o=K(o,e.slice(i+1)),o=K(o,[["exit",p,r]]),te(e,c,e.length,o),e}function qn(e,r,t){const n=this;let u=n.events.length,c,i;for(;u--;)if((n.events[u][1].type==="labelImage"||n.events[u][1].type==="labelLink")&&!n.events[u][1]._balanced){c=n.events[u][1];break}return o;function o(g){return c?c._inactive?h(g):(i=n.parser.defined.includes(he(n.sliceSerialize({start:c.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),p):t(g)}function p(g){return g===40?e.attempt(Ln,d,i?d:h)(g):g===91?e.attempt(On,d,i?a:h)(g):i?d(g):h(g)}function a(g){return e.attempt(jn,d,h)(g)}function d(g){return r(g)}function h(g){return c._balanced=!0,t(g)}}function Vn(e,r,t){return n;function n(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),u}function u(h){return $(h)?xe(e,c)(h):c(h)}function c(h){return h===41?d(h):ct(e,i,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function i(h){return $(h)?xe(e,p)(h):d(h)}function o(h){return t(h)}function p(h){return h===34||h===39||h===40?st(e,a,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function a(h){return $(h)?xe(e,d)(h):d(h)}function d(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),r):t(h)}}function Nn(e,r,t){const n=this;return u;function u(o){return ot.call(n,e,c,i,"reference","referenceMarker","referenceString")(o)}function c(o){return n.parser.defined.includes(he(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?r(o):t(o)}function i(o){return t(o)}}function Un(e,r,t){return n;function n(c){return e.enter("reference"),e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),u}function u(c){return c===93?(e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),e.exit("reference"),r):t(c)}}const Wn={name:"labelStartImage",tokenize:Qn,resolveAll:_e.resolveAll};function Qn(e,r,t){const n=this;return u;function u(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),c}function c(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),i):t(o)}function i(o){return o===94&&"_hiddenFootnoteSupport"in n.parser.constructs?t(o):r(o)}}const $n={name:"labelStartLink",tokenize:Kn,resolveAll:_e.resolveAll};function Kn(e,r,t){const n=this;return u;function u(i){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelLink"),c}function c(i){return i===94&&"_hiddenFootnoteSupport"in n.parser.constructs?t(i):r(i)}}const Ee={name:"lineEnding",tokenize:Gn};function Gn(e,r){return t;function t(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),_(e,r,"linePrefix")}}const ke={name:"thematicBreak",tokenize:Jn};function Jn(e,r,t){let n=0,u;return c;function c(a){return e.enter("thematicBreak"),i(a)}function i(a){return u=a,o(a)}function o(a){return a===u?(e.enter("thematicBreakSequence"),p(a)):n>=3&&(a===null||E(a))?(e.exit("thematicBreak"),r(a)):t(a)}function p(a){return a===u?(e.consume(a),n++,p):(e.exit("thematicBreakSequence"),T(a)?_(e,o,"whitespace")(a):o(a))}}const Q={name:"list",tokenize:Yn,continuation:{tokenize:er},exit:nr},Xn={tokenize:rr,partial:!0},Zn={tokenize:tr,partial:!0};function Yn(e,r,t){const n=this,u=n.events[n.events.length-1];let c=u&&u[1].type==="linePrefix"?u[2].sliceSerialize(u[1],!0).length:0,i=0;return o;function o(f){const I=n.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(I==="listUnordered"?!n.containerState.marker||f===n.containerState.marker:Ie(f)){if(n.containerState.type||(n.containerState.type=I,e.enter(I,{_container:!0})),I==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(ke,t,a)(f):a(f);if(!n.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),p(f)}return t(f)}function p(f){return Ie(f)&&++i<10?(e.consume(f),p):(!n.interrupt||i<2)&&(n.containerState.marker?f===n.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),a(f)):t(f)}function a(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||f,e.check(Fe,n.interrupt?t:d,e.attempt(Xn,g,h))}function d(f){return n.containerState.initialBlankLine=!0,c++,g(f)}function h(f){return T(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),g):t(f)}function g(f){return n.containerState.size=c+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,r(f)}}function er(e,r,t){const n=this;return n.containerState._closeFlow=void 0,e.check(Fe,u,c);function u(o){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,_(e,r,"listItemIndent",n.containerState.size+1)(o)}function c(o){return n.containerState.furtherBlankLines||!T(o)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,i(o)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(Zn,r,i)(o))}function i(o){return n.containerState._closeFlow=!0,n.interrupt=void 0,_(e,e.attempt(Q,r,t),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function tr(e,r,t){const n=this;return _(e,u,"listItemIndent",n.containerState.size+1);function u(c){const i=n.events[n.events.length-1];return i&&i[1].type==="listItemIndent"&&i[2].sliceSerialize(i[1],!0).length===n.containerState.size?r(c):t(c)}}function nr(e){e.exit(this.containerState.type)}function rr(e,r,t){const n=this;return _(e,u,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function u(c){const i=n.events[n.events.length-1];return!T(c)&&i&&i[1].type==="listItemPrefixWhitespace"?r(c):t(c)}}const Je={name:"setextUnderline",tokenize:ur,resolveTo:ir};function ir(e,r){let t=e.length,n,u,c;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){n=t;break}e[t][1].type==="paragraph"&&(u=t)}else e[t][1].type==="content"&&e.splice(t,1),!c&&e[t][1].type==="definition"&&(c=t);const i={type:"setextHeading",start:Object.assign({},e[u][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[u][1].type="setextHeadingText",c?(e.splice(u,0,["enter",i,r]),e.splice(c+1,0,["exit",e[n][1],r]),e[n][1].end=Object.assign({},e[c][1].end)):e[n][1]=i,e.push(["exit",i,r]),e}function ur(e,r,t){const n=this;let u;return c;function c(a){let d=n.events.length,h;for(;d--;)if(n.events[d][1].type!=="lineEnding"&&n.events[d][1].type!=="linePrefix"&&n.events[d][1].type!=="content"){h=n.events[d][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||h)?(e.enter("setextHeadingLine"),u=a,i(a)):t(a)}function i(a){return e.enter("setextHeadingLineSequence"),o(a)}function o(a){return a===u?(e.consume(a),o):(e.exit("setextHeadingLineSequence"),T(a)?_(e,p,"lineSuffix")(a):p(a))}function p(a){return a===null||E(a)?(e.exit("setextHeadingLine"),r(a)):t(a)}}const cr={tokenize:or};function or(e){const r=this,t=e.attempt(Fe,n,e.attempt(this.parser.constructs.flowInitial,u,_(e,e.attempt(this.parser.constructs.flow,u,e.attempt(dn,u)),"linePrefix")));return t;function n(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),r.currentConstruct=void 0,t}function u(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),r.currentConstruct=void 0,t}}const sr={resolveAll:at()},lr=lt("string"),ar=lt("text");function lt(e){return{tokenize:r,resolveAll:at(e==="text"?fr:void 0)};function r(t){const n=this,u=this.parser.constructs[e],c=t.attempt(u,i,o);return i;function i(d){return a(d)?c(d):o(d)}function o(d){if(d===null){t.consume(d);return}return t.enter("data"),t.consume(d),p}function p(d){return a(d)?(t.exit("data"),c(d)):(t.consume(d),p)}function a(d){if(d===null)return!0;const h=u[d];let g=-1;if(h)for(;++g<h.length;){const f=h[g];if(!f.previous||f.previous.call(n,n.previous))return!0}return!1}}}function at(e){return r;function r(t,n){let u=-1,c;for(;++u<=t.length;)c===void 0?t[u]&&t[u][1].type==="data"&&(c=u,u++):(!t[u]||t[u][1].type!=="data")&&(u!==c+2&&(t[c][1].end=t[u-1][1].end,t.splice(c+2,u-c-2),u=c+2),c=void 0);return e?e(t,n):t}}function fr(e,r){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const n=e[t-1][1],u=r.sliceStream(n);let c=u.length,i=-1,o=0,p;for(;c--;){const a=u[c];if(typeof a=="string"){for(i=a.length;a.charCodeAt(i-1)===32;)o++,i--;if(i)break;i=-1}else if(a===-2)p=!0,o++;else if(a!==-1){c++;break}}if(o){const a={type:t===e.length||p||o<2?"lineSuffix":"hardBreakTrailing",start:{line:n.end.line,column:n.end.column-o,offset:n.end.offset-o,_index:n.start._index+c,_bufferIndex:c?i:n.start._bufferIndex+i},end:Object.assign({},n.end)};n.end=Object.assign({},a.start),n.start.offset===n.end.offset?Object.assign(n,a):(e.splice(t,0,["enter",a,r],["exit",a,r]),t+=2)}t++}return e}function dr(e,r,t){let n=Object.assign(t?Object.assign({},t):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const u={},c=[];let i=[],o=[];const p={consume:O,enter:S,exit:B,attempt:w(P),check:w(x),interrupt:w(x,{interrupt:!0})},a={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:f,sliceSerialize:g,now:I,defineSkip:C,write:h};let d=r.tokenize.call(a,p);return r.resolveAll&&c.push(r),a;function h(F){return i=K(i,F),L(),i[i.length-1]!==null?[]:(R(r,0),a.events=De(c,a.events,a),a.events)}function g(F,v){return hr(f(F),v)}function f(F){return pr(i,F)}function I(){const{line:F,column:v,offset:M,_index:j,_bufferIndex:A}=n;return{line:F,column:v,offset:M,_index:j,_bufferIndex:A}}function C(F){u[F.line]=F.column,V()}function L(){let F;for(;n._index<i.length;){const v=i[n._index];if(typeof v=="string")for(F=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===F&&n._bufferIndex<v.length;)y(v.charCodeAt(n._bufferIndex));else y(v)}}function y(F){d=d(F)}function O(F){E(F)?(n.line++,n.column=1,n.offset+=F===-3?2:1,V()):F!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===i[n._index].length&&(n._bufferIndex=-1,n._index++)),a.previous=F}function S(F,v){const M=v||{};return M.type=F,M.start=I(),a.events.push(["enter",M,a]),o.push(M),M}function B(F){const v=o.pop();return v.end=I(),a.events.push(["exit",v,a]),v}function P(F,v){R(F,v.from)}function x(F,v){v.restore()}function w(F,v){return M;function M(j,A,W){let N,G,ne,s;return Array.isArray(j)?re(j):"tokenize"in j?re([j]):J(j);function J(U){return fe;function fe(ce){const de=ce!==null&&U[ce],pe=ce!==null&&U.null,ve=[...Array.isArray(de)?de:de?[de]:[],...Array.isArray(pe)?pe:pe?[pe]:[]];return re(ve)(ce)}}function re(U){return N=U,G=0,U.length===0?W:l(U[G])}function l(U){return fe;function fe(ce){return s=q(),ne=U,U.partial||(a.currentConstruct=U),U.name&&a.parser.constructs.disable.null.includes(U.name)?ae():U.tokenize.call(v?Object.assign(Object.create(a),v):a,p,X,ae)(ce)}}function X(U){return F(ne,s),A}function ae(U){return s.restore(),++G<N.length?l(N[G]):W}}}function R(F,v){F.resolveAll&&!c.includes(F)&&c.push(F),F.resolve&&te(a.events,v,a.events.length-v,F.resolve(a.events.slice(v),a)),F.resolveTo&&(a.events=F.resolveTo(a.events,a))}function q(){const F=I(),v=a.previous,M=a.currentConstruct,j=a.events.length,A=Array.from(o);return{restore:W,from:j};function W(){n=F,a.previous=v,a.currentConstruct=M,a.events.length=j,o=A,V()}}function V(){n.line in u&&n.column<2&&(n.column=u[n.line],n.offset+=u[n.line]-1)}}function pr(e,r){const t=r.start._index,n=r.start._bufferIndex,u=r.end._index,c=r.end._bufferIndex;let i;if(t===u)i=[e[t].slice(n,c)];else{if(i=e.slice(t,u),n>-1){const o=i[0];typeof o=="string"?i[0]=o.slice(n):i.shift()}c>0&&i.push(e[u].slice(0,c))}return i}function hr(e,r){let t=-1;const n=[];let u;for(;++t<e.length;){const c=e[t];let i;if(typeof c=="string")i=c;else switch(c){case-5:{i="\r";break}case-4:{i=`
`;break}case-3:{i=`\r
`;break}case-2:{i=r?" ":" ";break}case-1:{if(!r&&u)continue;i=" ";break}default:i=String.fromCharCode(c)}u=c===-2,n.push(i)}return n.join("")}const mr={42:Q,43:Q,45:Q,48:Q,49:Q,50:Q,51:Q,52:Q,53:Q,54:Q,55:Q,56:Q,57:Q,62:nt},gr={91:xn},xr={[-2]:be,[-1]:be,32:be},kr={35:bn,42:ke,45:[Je,ke],60:Tn,61:Je,95:ke,96:Ke,126:Ke},yr={38:it,92:rt},Fr={[-5]:Ee,[-4]:Ee,[-3]:Ee,33:Wn,38:it,42:Te,60:[$t,Mn],91:$n,92:[vn,rt],93:_e,95:Te,96:on},vr={null:[Te,sr]},Sr={null:[42,95]},br={null:[]},Er=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Sr,contentInitial:gr,disable:br,document:mr,flow:kr,flowInitial:xr,insideSpan:vr,string:yr,text:Fr},Symbol.toStringTag,{value:"Module"}));function Ar(e){const r=Dt([Er,...(e||{}).extensions||[]]),t={defined:[],lazy:{},constructs:r,content:n(Rt),document:n(Vt),flow:n(cr),string:n(lr),text:n(ar)};return t;function n(u){return c;function c(i){return dr(t,u,i)}}}const Xe=/[\0\t\n\r]/g;function Ir(){let e=1,r="",t=!0,n;return u;function u(c,i,o){const p=[];let a,d,h,g,f;for(c=r+c.toString(i),h=0,r="",t&&(c.charCodeAt(0)===65279&&h++,t=void 0);h<c.length;){if(Xe.lastIndex=h,a=Xe.exec(c),g=a&&a.index!==void 0?a.index:c.length,f=c.charCodeAt(g),!a){r=c.slice(h);break}if(f===10&&h===g&&n)p.push(-3),n=void 0;else switch(n&&(p.push(-5),n=void 0),h<g&&(p.push(c.slice(h,g)),e+=g-h),f){case 0:{p.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,p.push(-2);e++<d;)p.push(-1);break}case 10:{p.push(-4),e=1;break}default:n=!0,e=1}h=g+1}return o&&(n&&p.push(-5),r&&p.push(r),p.push(null)),p}}function Tr(e){for(;!ut(e););return e}function ft(e,r){const t=Number.parseInt(e,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?"<22>":String.fromCharCode(t)}const Cr=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function wr(e){return e.replace(Cr,zr)}function zr(e,r,t){if(r)return r;if(t.charCodeAt(0)===35){const n=t.charCodeAt(1),u=n===120||n===88;return ft(t.slice(u?2:1),u?16:10)}return ze(t)||e}function ye(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ze(e.position):"start"in e||"end"in e?Ze(e):"line"in e||"column"in e?Ce(e):""}function Ce(e){return Ye(e&&e.line)+":"+Ye(e&&e.column)}function Ze(e){return Ce(e&&e.start)+"-"+Ce(e&&e.end)}function Ye(e){return e&&typeof e=="number"?e:1}const dt={}.hasOwnProperty,pt=function(e,r,t){return typeof r!="string"&&(t=r,r=void 0),Dr(t)(Tr(Ar(t).document().write(Ir()(e,r,!0))))};function Dr(e){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(He),autolinkProtocol:F,autolinkEmail:F,atxHeading:o(Le),blockQuote:o(ve),characterEscape:F,characterReference:F,codeFenced:o(Pe),codeFencedFenceInfo:p,codeFencedFenceMeta:p,codeIndented:o(Pe,p),codeText:o(gt,p),codeTextData:F,data:F,codeFlowValue:F,definition:o(xt),definitionDestinationString:p,definitionLabelString:p,definitionTitleString:p,emphasis:o(kt),hardBreakEscape:o(Oe),hardBreakTrailing:o(Oe),htmlFlow:o(je,p),htmlFlowData:F,htmlText:o(je,p),htmlTextData:F,image:o(yt),label:p,link:o(He),listItem:o(Ft),listItemValue:I,listOrdered:o(Re,f),listUnordered:o(Re),paragraph:o(vt),reference:ae,referenceString:p,resourceDestinationString:p,resourceTitleString:p,setextHeading:o(Le),strong:o(St),thematicBreak:o(Et)},exit:{atxHeading:d(),atxHeadingSequence:w,autolink:d(),autolinkEmail:pe,autolinkProtocol:de,blockQuote:d(),characterEscapeValue:v,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:ce,codeFenced:d(O),codeFencedFence:y,codeFencedFenceInfo:C,codeFencedFenceMeta:L,codeFlowValue:v,codeIndented:d(S),codeText:d(N),codeTextData:v,data:v,definition:d(),definitionDestinationString:x,definitionLabelString:B,definitionTitleString:P,emphasis:d(),hardBreakEscape:d(j),hardBreakTrailing:d(j),htmlFlow:d(A),htmlFlowData:v,htmlText:d(W),htmlTextData:v,image:d(ne),label:J,labelText:s,lineEnding:M,link:d(G),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:U,resourceDestinationString:re,resourceTitleString:l,resource:X,setextHeading:d(V),setextHeadingLineSequence:q,setextHeadingText:R,strong:d(),thematicBreak:d()}};ht(r,(e||{}).mdastExtensions||[]);const t={};return n;function n(m){let k={type:"root",children:[]};const b={stack:[k],tokenStack:[],config:r,enter:a,exit:h,buffer:p,resume:g,setData:c,getData:i},z=[];let D=-1;for(;++D<m.length;)if(m[D][1].type==="listOrdered"||m[D][1].type==="listUnordered")if(m[D][0]==="enter")z.push(D);else{const Y=z.pop();D=u(m,Y,D)}for(D=-1;++D<m.length;){const Y=r[m[D][0]];dt.call(Y,m[D][1].type)&&Y[m[D][1].type].call(Object.assign({sliceSerialize:m[D][2].sliceSerialize},b),m[D][1])}if(b.tokenStack.length>0){const Y=b.tokenStack[b.tokenStack.length-1];(Y[1]||et).call(b,void 0,Y[0])}for(k.position={start:oe(m.length>0?m[0][1].start:{line:1,column:1,offset:0}),end:oe(m.length>0?m[m.length-2][1].end:{line:1,column:1,offset:0})},D=-1;++D<r.transforms.length;)k=r.transforms[D](k)||k;return k}function u(m,k,b){let z=k-1,D=-1,Y=!1,le,ie,me,ge;for(;++z<=b;){const H=m[z];if(H[1].type==="listUnordered"||H[1].type==="listOrdered"||H[1].type==="blockQuote"?(H[0]==="enter"?D++:D--,ge=void 0):H[1].type==="lineEndingBlank"?H[0]==="enter"&&(le&&!ge&&!D&&!me&&(me=z),ge=void 0):H[1].type==="linePrefix"||H[1].type==="listItemValue"||H[1].type==="listItemMarker"||H[1].type==="listItemPrefix"||H[1].type==="listItemPrefixWhitespace"||(ge=void 0),!D&&H[0]==="enter"&&H[1].type==="listItemPrefix"||D===-1&&H[0]==="exit"&&(H[1].type==="listUnordered"||H[1].type==="listOrdered")){if(le){let Se=z;for(ie=void 0;Se--;){const ue=m[Se];if(ue[1].type==="lineEnding"||ue[1].type==="lineEndingBlank"){if(ue[0]==="exit")continue;ie&&(m[ie][1].type="lineEndingBlank",Y=!0),ue[1].type="lineEnding",ie=Se}else if(!(ue[1].type==="linePrefix"||ue[1].type==="blockQuotePrefix"||ue[1].type==="blockQuotePrefixWhitespace"||ue[1].type==="blockQuoteMarker"||ue[1].type==="listItemIndent"))break}me&&(!ie||me<ie)&&(le._spread=!0),le.end=Object.assign({},ie?m[ie][1].start:H[1].end),m.splice(ie||z,0,["exit",le,H[2]]),z++,b++}H[1].type==="listItemPrefix"&&(le={type:"listItem",_spread:!1,start:Object.assign({},H[1].start),end:void 0},m.splice(z,0,["enter",le,H[2]]),z++,b++,me=void 0,ge=!0)}}return m[k][1]._spread=Y,b}function c(m,k){t[m]=k}function i(m){return t[m]}function o(m,k){return b;function b(z){a.call(this,m(z),z),k&&k.call(this,z)}}function p(){this.stack.push({type:"fragment",children:[]})}function a(m,k,b){return this.stack[this.stack.length-1].children.push(m),this.stack.push(m),this.tokenStack.push([k,b]),m.position={start:oe(k.start)},m}function d(m){return k;function k(b){m&&m.call(this,b),h.call(this,b)}}function h(m,k){const b=this.stack.pop(),z=this.tokenStack.pop();if(z)z[0].type!==m.type&&(k?k.call(this,m,z[0]):(z[1]||et).call(this,m,z[0]));else throw new Error("Cannot close `"+m.type+"` ("+ye({start:m.start,end:m.end})+"): its not open");return b.position.end=oe(m.end),b}function g(){return wt(this.stack.pop())}function f(){c("expectingFirstListItemValue",!0)}function I(m){if(i("expectingFirstListItemValue")){const k=this.stack[this.stack.length-2];k.start=Number.parseInt(this.sliceSerialize(m),10),c("expectingFirstListItemValue")}}function C(){const m=this.resume(),k=this.stack[this.stack.length-1];k.lang=m}function L(){const m=this.resume(),k=this.stack[this.stack.length-1];k.meta=m}function y(){i("flowCodeInside")||(this.buffer(),c("flowCodeInside",!0))}function O(){const m=this.resume(),k=this.stack[this.stack.length-1];k.value=m.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),c("flowCodeInside")}function S(){const m=this.resume(),k=this.stack[this.stack.length-1];k.value=m.replace(/(\r?\n|\r)$/g,"")}function B(m){const k=this.resume(),b=this.stack[this.stack.length-1];b.label=k,b.identifier=he(this.sliceSerialize(m)).toLowerCase()}function P(){const m=this.resume(),k=this.stack[this.stack.length-1];k.title=m}function x(){const m=this.resume(),k=this.stack[this.stack.length-1];k.url=m}function w(m){const k=this.stack[this.stack.length-1];if(!k.depth){const b=this.sliceSerialize(m).length;k.depth=b}}function R(){c("setextHeadingSlurpLineEnding",!0)}function q(m){const k=this.stack[this.stack.length-1];k.depth=this.sliceSerialize(m).charCodeAt(0)===61?1:2}function V(){c("setextHeadingSlurpLineEnding")}function F(m){const k=this.stack[this.stack.length-1];let b=k.children[k.children.length-1];(!b||b.type!=="text")&&(b=bt(),b.position={start:oe(m.start)},k.children.push(b)),this.stack.push(b)}function v(m){const k=this.stack.pop();k.value+=this.sliceSerialize(m),k.position.end=oe(m.end)}function M(m){const k=this.stack[this.stack.length-1];if(i("atHardBreak")){const b=k.children[k.children.length-1];b.position.end=oe(m.end),c("atHardBreak");return}!i("setextHeadingSlurpLineEnding")&&r.canContainEols.includes(k.type)&&(F.call(this,m),v.call(this,m))}function j(){c("atHardBreak",!0)}function A(){const m=this.resume(),k=this.stack[this.stack.length-1];k.value=m}function W(){const m=this.resume(),k=this.stack[this.stack.length-1];k.value=m}function N(){const m=this.resume(),k=this.stack[this.stack.length-1];k.value=m}function G(){const m=this.stack[this.stack.length-1];if(i("inReference")){const k=i("referenceType")||"shortcut";m.type+="Reference",m.referenceType=k,delete m.url,delete m.title}else delete m.identifier,delete m.label;c("referenceType")}function ne(){const m=this.stack[this.stack.length-1];if(i("inReference")){const k=i("referenceType")||"shortcut";m.type+="Reference",m.referenceType=k,delete m.url,delete m.title}else delete m.identifier,delete m.label;c("referenceType")}function s(m){const k=this.sliceSerialize(m),b=this.stack[this.stack.length-2];b.label=wr(k),b.identifier=he(k).toLowerCase()}function J(){const m=this.stack[this.stack.length-1],k=this.resume(),b=this.stack[this.stack.length-1];if(c("inReference",!0),b.type==="link"){const z=m.children;b.children=z}else b.alt=k}function re(){const m=this.resume(),k=this.stack[this.stack.length-1];k.url=m}function l(){const m=this.resume(),k=this.stack[this.stack.length-1];k.title=m}function X(){c("inReference")}function ae(){c("referenceType","collapsed")}function U(m){const k=this.resume(),b=this.stack[this.stack.length-1];b.label=k,b.identifier=he(this.sliceSerialize(m)).toLowerCase(),c("referenceType","full")}function fe(m){c("characterReferenceType",m.type)}function ce(m){const k=this.sliceSerialize(m),b=i("characterReferenceType");let z;b?(z=ft(k,b==="characterReferenceMarkerNumeric"?10:16),c("characterReferenceType")):z=ze(k);const D=this.stack.pop();D.value+=z,D.position.end=oe(m.end)}function de(m){v.call(this,m);const k=this.stack[this.stack.length-1];k.url=this.sliceSerialize(m)}function pe(m){v.call(this,m);const k=this.stack[this.stack.length-1];k.url="mailto:"+this.sliceSerialize(m)}function ve(){return{type:"blockquote",children:[]}}function Pe(){return{type:"code",lang:null,meta:null,value:""}}function gt(){return{type:"inlineCode",value:""}}function xt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function kt(){return{type:"emphasis",children:[]}}function Le(){return{type:"heading",depth:void 0,children:[]}}function Oe(){return{type:"break"}}function je(){return{type:"html",value:""}}function yt(){return{type:"image",title:null,url:"",alt:null}}function He(){return{type:"link",title:null,url:"",children:[]}}function Re(m){return{type:"list",ordered:m.type==="listOrdered",start:null,spread:m._spread,children:[]}}function Ft(m){return{type:"listItem",spread:m._spread,checked:null,children:[]}}function vt(){return{type:"paragraph",children:[]}}function St(){return{type:"strong",children:[]}}function bt(){return{type:"text",value:""}}function Et(){return{type:"thematicBreak"}}}function oe(e){return{line:e.line,column:e.column,offset:e.offset}}function ht(e,r){let t=-1;for(;++t<r.length;){const n=r[t];Array.isArray(n)?ht(e,n):_r(e,n)}}function _r(e,r){let t;for(t in r)if(dt.call(r,t)){if(t==="canContainEols"){const n=r[t];n&&e[t].push(...n)}else if(t==="transforms"){const n=r[t];n&&e[t].push(...n)}else if(t==="enter"||t==="exit"){const n=r[t];n&&Object.assign(e[t],n)}}}function et(e,r){throw e?new Error("Cannot close `"+e.type+"` ("+ye({start:e.start,end:e.end})+"): a different token (`"+r.type+"`, "+ye({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+ye({start:r.start,end:r.end})+") is still open")}function Br(e){const r=e.replace(/\n{2,}/g,`
`);return Tt(r)}function Mr(e){const r=Br(e),{children:t}=pt(r),n=[[]];let u=0;function c(i,o="normal"){i.type==="text"?i.value.split(`
`).forEach((p,a)=>{a!==0&&(u++,n.push([])),p.split(" ").forEach(d=>{d&&n[u].push({content:d,type:o})})}):(i.type==="strong"||i.type==="emphasis")&&i.children.forEach(p=>{c(p,i.type)})}return t.forEach(i=>{i.type==="paragraph"&&i.children.forEach(o=>{c(o)})}),n}function Pr(e){const{children:r}=pt(e);function t(n){return n.type==="text"?n.value.replace(/\n/g,"<br/>"):n.type==="strong"?`<strong>${n.children.map(t).join("")}</strong>`:n.type==="emphasis"?`<em>${n.children.map(t).join("")}</em>`:n.type==="paragraph"?`<p>${n.children.map(t).join("")}</p>`:`Unsupported markdown: ${n.type}`}return r.map(t).join("")}function Lr(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(r=>r.segment):[...e]}function Or(e,r){const t=Lr(r.content);return mt(e,[],t,r.type)}function mt(e,r,t,n){if(t.length===0)return[{content:r.join(""),type:n},{content:"",type:n}];const[u,...c]=t,i=[...r,u];return e([{content:i.join(""),type:n}])?mt(e,i,c,n):(r.length===0&&u&&(r.push(u),t.shift()),[{content:r.join(""),type:n},{content:t.join(""),type:n}])}function jr(e,r){if(e.some(({content:t})=>t.includes(`
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return we(e,r)}function we(e,r,t=[],n=[]){if(e.length===0)return n.length>0&&t.push(n),t.length>0?t:[];let u="";e[0].content===" "&&(u=" ",e.shift());const c=e.shift()??{content:" ",type:"normal"},i=[...n];if(u!==""&&i.push({content:u,type:"normal"}),i.push(c),r(i))return we(e,r,t,i);if(n.length>0)t.push(n),e.unshift(c);else if(c.content){const[o,p]=Or(r,c);t.push([o]),p.content&&e.unshift(p)}return we(e,r,t)}function Hr(e,r){r&&e.attr("style",r)}function Rr(e,r,t,n,u=!1){const c=e.append("foreignObject"),i=c.append("xhtml:div"),o=r.label,p=r.isNode?"nodeLabel":"edgeLabel";i.html(`
<span class="${p} ${n}" `+(r.labelStyle?'style="'+r.labelStyle+'"':"")+">"+o+"</span>"),Hr(i,r.labelStyle),i.style("display","table-cell"),i.style("white-space","nowrap"),i.style("max-width",t+"px"),i.attr("xmlns","http://www.w3.org/1999/xhtml"),u&&i.attr("class","labelBkg");let a=i.node().getBoundingClientRect();return a.width===t&&(i.style("display","table"),i.style("white-space","break-spaces"),i.style("width",t+"px"),a=i.node().getBoundingClientRect()),c.style("width",a.width),c.style("height",a.height),c.node()}function Be(e,r,t){return e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",r*t-.1+"em").attr("dy",t+"em")}function qr(e,r,t){const n=e.append("text"),u=Be(n,1,r);Me(u,t);const c=u.node().getComputedTextLength();return n.remove(),c}function Wr(e,r,t){var n;const u=e.append("text"),c=Be(u,1,r);Me(c,[{content:t,type:"normal"}]);const i=(n=c.node())==null?void 0:n.getBoundingClientRect();return i&&u.remove(),i}function Vr(e,r,t,n=!1){const u=r.append("g"),c=u.insert("rect").attr("class","background"),i=u.append("text").attr("y","-10.1");let o=0;for(const p of t){const a=h=>qr(u,1.1,h)<=e,d=a(p)?[p]:jr(p,a);for(const h of d){const g=Be(i,o,1.1);Me(g,h),o++}}if(n){const p=i.node().getBBox(),a=2;return c.attr("x",-a).attr("y",-a).attr("width",p.width+2*a).attr("height",p.height+2*a),u.node()}else return i.node()}function Me(e,r){e.text(""),r.forEach((t,n)=>{const u=e.append("tspan").attr("font-style",t.type==="emphasis"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",t.type==="strong"?"bold":"normal");n===0?u.text(t.content):u.text(" "+t.content)})}const Qr=(e,r="",{style:t="",isTitle:n=!1,classes:u="",useHtmlLabels:c=!0,isNode:i=!0,width:o=200,addSvgBackground:p=!1}={})=>{if(At.info("createText",r,t,n,u,c,i,p),c){const a=Pr(r),d={isNode:i,label:It(a).replace(/fa[blrs]?:fa-[\w-]+/g,h=>`<i class='${h.replace(":"," ")}'></i>`),labelStyle:t.replace("fill:","color:")};return Rr(e,d,o,u,p)}else{const a=Mr(r);return Vr(o,e,a,p)}};export{Wr as a,Qr as c};
//# sourceMappingURL=createText-2e5e7dd3-DGO2Nq3C.chunk.mjs.map