orbitchat 2.1.6 → 2.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/orbitchat.js +11 -10
- package/dist/assets/{api-CK3k3ceJ.js → api-uEDUqkTi.js} +1 -1
- package/dist/assets/arc-m8RC5oDD-BT8qBEWK.js +1 -0
- package/dist/assets/{blockDiagram-c4efeb88-NvaZhZFT-B2z-bNEd.js → blockDiagram-c4efeb88-CZ2mpei3-DwC_8AXi.js} +7 -7
- package/dist/assets/{c4Diagram-c83219d4-gPr1eF38-BpklvzfC.js → c4Diagram-c83219d4-DL2EmCLj-Bb77Yjks.js} +2 -2
- package/dist/assets/channel-BKp1WYnX-BpupPR-0.js +1 -0
- package/dist/assets/classDiagram-beda092f-vKbJ2bcD-ByRiBo_z.js +2 -0
- package/dist/assets/classDiagram-v2-2358418a-BHXpn1Du-CsAMUMgi.js +2 -0
- package/dist/assets/clone-B1V2003j-DKfYfMmY.js +1 -0
- package/dist/assets/{createText-1719965b-D9Y3vUMn-UiwO3q8Q.js → createText-1719965b-C2-AT0ab-Ngc7i9D1.js} +2 -2
- package/dist/assets/edges-96097737-Zk-qG_8u-dmc-RUJc.js +4 -0
- package/dist/assets/{erDiagram-0228fc6a-BLw8FsIp-CkgJ5rpM.js → erDiagram-0228fc6a-B94anMjz-CVrsMLr0.js} +3 -3
- package/dist/assets/{flowDb-c6c81e3f-DXVkMlSE-DRQM6L-v.js → flowDb-c6c81e3f-CRRW-bQO-BYHCtAAr.js} +4 -4
- package/dist/assets/{flowDiagram-50d868cf-mkkB0hFd-CL_JosYM.js → flowDiagram-50d868cf-DPzQMhJv-CrArx2UT.js} +4 -4
- package/dist/assets/flowDiagram-v2-4f6560a1-Si9enBmB-CcZjaZir.js +1 -0
- package/dist/assets/{flowchart-elk-definition-6af322e1-D9IbjnSJ-DWoCBlEO.js → flowchart-elk-definition-6af322e1-CULhtvD--Bc4SZDEI.js} +1 -1
- package/dist/assets/{ganttDiagram-a2739b55-Cqs5_Zht-CyVqot_b.js → ganttDiagram-a2739b55-Bp8yOLEz-DMtD2BxT.js} +3 -3
- package/dist/assets/{gitGraphDiagram-82fe8481-txBzFn40-CZkxfaP2.js → gitGraphDiagram-82fe8481-BYtOQJl0-BxXpgB9C.js} +1 -1
- package/dist/assets/{graph-BZahQKIN-CTgzd5us.js → graph-BV6jB5rk-DcOA8BmL.js} +1 -1
- package/dist/assets/{index-CDwx2U7N.js → index-3H3i7ExC.js} +156 -156
- package/dist/assets/{index-5325376f-DsNDppci-BaFeDo3U.js → index-5325376f-DrY72DrM-BQxxLtiM.js} +1 -1
- package/dist/assets/index-DlFdZiHl-B3vsLXXB.js +134 -0
- package/dist/assets/{infoDiagram-8eee0895-SbmhgTjv-CCnN8bBn.js → infoDiagram-8eee0895-C6GFnrZ7-OKacvbId.js} +4 -4
- package/dist/assets/{journeyDiagram-c64418c1-C7AiwbKr-YZTGwLv1.js → journeyDiagram-c64418c1-daS1W8qe-BkJ9QLFM.js} +4 -4
- package/dist/assets/{layout-j-hMNqAM-C88IAVJC.js → layout-LXMv3mSS-CNNBHyhJ.js} +1 -1
- package/dist/assets/{mindmap-definition-8da855dc-B1WjnfxE-a9TK-xQN.js → mindmap-definition-8da855dc-DmNQYVT1-BsCbTj6n.js} +1 -1
- package/dist/assets/{pieDiagram-a8764435-zrkaw4r--BMPBVA0x.js → pieDiagram-a8764435-381urBY5-A6raAt-D.js} +5 -5
- package/dist/assets/{quadrantDiagram-1e28029f-C2Wa5n16-DwWDm6cx.js → quadrantDiagram-1e28029f-hgRmK2bX-CiuNGTtQ.js} +4 -4
- package/dist/assets/{requirementDiagram-08caed73-BtHxx079-zeP-18qR.js → requirementDiagram-08caed73-BB0Q-cI9-T9Fr-hSN.js} +1 -1
- package/dist/assets/{sankeyDiagram-a04cb91d-DXlmqTKB-BJu62Tg5.js → sankeyDiagram-a04cb91d-BpsipZNt-DeqT-JYz.js} +5 -5
- package/dist/assets/{sequenceDiagram-c5b8d532-BVQF3vcA-GR7-Xw8e.js → sequenceDiagram-c5b8d532-xoAvPcQJ-Dh_25-gi.js} +4 -4
- package/dist/assets/{stateDiagram-1ecb1508-Dybc3i2m-BMJzxrY5.js → stateDiagram-1ecb1508-b721R49K-DfgySJAt.js} +1 -1
- package/dist/assets/stateDiagram-v2-c2b004d7-BmSbrbqZ-BT-EqIcl.js +1 -0
- package/dist/assets/{styles-b4e223ce-BSiU4oYL-9ql-THae.js → styles-b4e223ce-TYmJC5IN-CyGeIEtW.js} +3 -3
- package/dist/assets/{styles-ca3715f6-DU7x0doE-B7zhH0Zm.js → styles-ca3715f6-CfJZu0Yn-Czxwj2Eo.js} +2 -2
- package/dist/assets/{styles-d45a18b0-B_CU21kM--NwLlmWK.js → styles-d45a18b0-DZ8oSYcV-KS40LPFU.js} +3 -3
- package/dist/assets/{svgDrawCommon-b86b1483-sbEe2n2v-CJw2W-Er.js → svgDrawCommon-b86b1483-CXPkN8HW-Dq40yjrO.js} +1 -1
- package/dist/assets/{timeline-definition-faaaa080-b82QCnJ9-CY85LKH1.js → timeline-definition-faaaa080-LDFf1jfb-CB8wN-VT.js} +6 -6
- package/dist/assets/{xychartDiagram-f5964ef8-BtRcO0uy-ylxrBreP.js → xychartDiagram-f5964ef8-DdhO5-Bp-B3w4U23E.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/dist/assets/arc-CvECY7sY-BAfm7gAl.js +0 -1
- package/dist/assets/channel-6PI3wNcc-1exBkyGg.js +0 -1
- package/dist/assets/classDiagram-beda092f-B8axaKGu-C7KpiekH.js +0 -2
- package/dist/assets/classDiagram-v2-2358418a-DPdf2DxR-CfXv0anP.js +0 -2
- package/dist/assets/clone-D01vUIhD-D0aslzw6.js +0 -1
- package/dist/assets/edges-96097737-Zc6U9nQz-Czq3--42.js +0 -4
- package/dist/assets/flowDiagram-v2-4f6560a1-BRIhxQ3y-BzGZQhJW.js +0 -1
- package/dist/assets/stateDiagram-v2-c2b004d7-Bp8rRkv2-Dm74LB8O.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{O as Et,br as At,G as It,ak as Tt,bs as Ct,bt as ze}from"./index-CDwx2U7N.js";const wt={};function zt(e,r){const t=wt,n=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,u=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return et(e,n,u)}function et(e,r,t){if(Dt(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 qe(e.children,r,t)}return Array.isArray(e)?qe(e,r,t):""}function qe(e,r,t){const n=[];let u=-1;for(;++u<e.length;)n[u]=et(e[u],r,t);return n.join("")}function Dt(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 G(e,r){return e.length>0?(te(e,e.length,0,r),e):r}const Ve={}.hasOwnProperty;function _t(e){const r={};let t=-1;for(;++t<e.length;)Bt(r,e[t]);return r}function Bt(e,r){let t;for(t in r){const n=(Ve.call(e,t)?e[t]:void 0)||(e[t]={}),u=r[t];let c;if(u)for(c in u){Ve.call(n,c)||(n[c]=[]);const i=u[c];Mt(n[c],Array.isArray(i)?i:i?[i]:[])}}}function Mt(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 Pt=/[!-\/:-@\[-`\{-~\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]/),Lt=se(/[#-'*+\--9=?A-Z^-~]/);function Ae(e){return e!==null&&(e<32||e===127)}const Ie=se(/\d/),Ot=se(/[\dA-Fa-f]/),jt=se(/[!-/:-@[-`{-~]/);function E(e){return e!==null&&e<-2}function Q(e){return e!==null&&(e<0||e===32)}function T(e){return e===-2||e===-1||e===32}const Ht=se(Pt),Rt=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 qt={tokenize:Vt};function Vt(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 Nt={tokenize:Ut},Ne={tokenize:Wt};function Ut(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(Ne,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(Ne,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 Wt(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 Ue(e){if(e===null||Q(e)||Rt(e))return 1;if(Ht(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:$t};function $t(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);We(h,-p),We(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=G(a,[["enter",e[n][1],r],["exit",e[n][1],r]])),a=G(a,[["enter",u,r],["enter",i,r],["exit",i,r],["enter",c,r]]),a=G(a,De(r.parser.constructs.insideSpan.null,e.slice(n+1,t),r)),a=G(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=G(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=Ue(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=Ue(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 We(e,r){e.column+=r,e.offset+=r,e._bufferIndex+=r}const Gt={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):Lt(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:Jt,partial:!0};function Jt(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 tt={name:"blockQuote",tokenize:Xt,continuation:{tokenize:Zt},exit:Yt};function Xt(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 Zt(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(tt,r,t)(i)}}function Yt(e){e.exit("blockQuote")}const nt={name:"characterEscape",tokenize:en};function en(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 jt(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),r):t(c)}}const rt={name:"characterReference",tokenize:tn};function tn(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=Ot,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:rn,partial:!0},Qe={name:"codeFenced",tokenize:nn,concrete:!0};function nn(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 rn(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:cn},un={tokenize:on,partial:!0};function cn(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(un,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 on(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 sn={name:"codeText",tokenize:fn,resolve:ln,previous:an};function ln(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 an(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function fn(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 it(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,dn(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 dn(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 pn={tokenize:gn,resolve:mn},hn={tokenize:xn,partial:!0};function mn(e){return it(e),e}function gn(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(hn,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 xn(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 ut(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||Q(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 ct(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 ot(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 kn={name:"definition",tokenize:Fn},yn={tokenize:vn,partial:!0};function Fn(e,r,t){const n=this;let u;return c;function c(f){return e.enter("definition"),i(f)}function i(f){return ct.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 Q(f)?xe(e,a)(f):a(f)}function a(f){return ut(e,d,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return e.attempt(yn,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 vn(e,r,t){return n;function n(o){return Q(o)?xe(e,u)(o):t(o)}function u(o){return ot(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 Sn={name:"hardBreakEscape",tokenize:bn};function bn(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 En={name:"headingAtx",tokenize:In,resolve:An};function An(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 In(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||Q(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||Q(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),a)}}const Tn=["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"],Cn={name:"htmlFlow",tokenize:_n,resolveTo:Dn,concrete:!0},wn={tokenize:Mn,partial:!0},zn={tokenize:Bn,partial:!0};function Dn(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 _n(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||Q(l)){const X=l===47,ae=i.toLowerCase();return!X&&!c&&Ge.includes(ae)?(u=1,n.interrupt?r(l):v(l)):Tn.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||Q(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(wn,re,M)(l)):l===null||E(l)?(e.exit("htmlFlowData"),M(l)):(e.consume(l),v)}function M(l){return e.check(zn,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="",K):v(l)}function K(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),K):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 Bn(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 Mn(e,r,t){return n;function n(u){return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),e.attempt(Fe,r,t)}}const Pn={name:"htmlText",tokenize:Ln};function Ln(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||Q(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||Q(s)?q(s):(e.consume(s),j)}function A(s){return s===47||s===62||Q(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"),K}function K(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:Vn,resolveTo:qn,resolveAll:Rn},On={tokenize:Nn},jn={tokenize:Un},Hn={tokenize:Wn};function Rn(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 qn(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=G(o,e.slice(c+1,c+n+3)),o=G(o,[["enter",d,r]]),o=G(o,De(r.parser.constructs.insideSpan.null,e.slice(c+n+4,i-3),r)),o=G(o,[["exit",d,r],e[i-2],e[i-1],["exit",a,r]]),o=G(o,e.slice(i+1)),o=G(o,[["exit",p,r]]),te(e,c,e.length,o),e}function Vn(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(On,d,i?d:h)(g):g===91?e.attempt(jn,d,i?a:h)(g):i?d(g):h(g)}function a(g){return e.attempt(Hn,d,h)(g)}function d(g){return r(g)}function h(g){return c._balanced=!0,t(g)}}function Nn(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 Q(h)?xe(e,c)(h):c(h)}function c(h){return h===41?d(h):ut(e,i,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function i(h){return Q(h)?xe(e,p)(h):d(h)}function o(h){return t(h)}function p(h){return h===34||h===39||h===40?ot(e,a,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function a(h){return Q(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 Un(e,r,t){const n=this;return u;function u(o){return ct.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 Wn(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 $n={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 Gn={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:Jn};function Jn(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:Xn};function Xn(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 $={name:"list",tokenize:er,continuation:{tokenize:tr},exit:rr},Zn={tokenize:ir,partial:!0},Yn={tokenize:nr,partial:!0};function er(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(Zn,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 tr(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(Yn,r,i)(o))}function i(o){return n.containerState._closeFlow=!0,n.interrupt=void 0,_(e,e.attempt($,r,t),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function nr(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 rr(e){e.exit(this.containerState.type)}function ir(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 Ke={name:"setextUnderline",tokenize:cr,resolveTo:ur};function ur(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 cr(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 or={tokenize:sr};function sr(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(pn,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 lr={resolveAll:lt()},ar=st("string"),fr=st("text");function st(e){return{tokenize:r,resolveAll:lt(e==="text"?dr: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 lt(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 dr(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 pr(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=G(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 mr(f(F),v)}function f(F){return hr(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,K,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,K=0,U.length===0?W:l(U[K])}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(),++K<N.length?l(N[K]):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 hr(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 mr(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=`
|
|
1
|
+
import{O as Et,br as At,W as It,ak as Tt,bs as Ct,bt as ze}from"./index-3H3i7ExC.js";const wt={};function zt(e,r){const t=wt,n=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,u=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return et(e,n,u)}function et(e,r,t){if(Dt(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 qe(e.children,r,t)}return Array.isArray(e)?qe(e,r,t):""}function qe(e,r,t){const n=[];let u=-1;for(;++u<e.length;)n[u]=et(e[u],r,t);return n.join("")}function Dt(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 Ve={}.hasOwnProperty;function _t(e){const r={};let t=-1;for(;++t<e.length;)Bt(r,e[t]);return r}function Bt(e,r){let t;for(t in r){const n=(Ve.call(e,t)?e[t]:void 0)||(e[t]={}),u=r[t];let c;if(u)for(c in u){Ve.call(n,c)||(n[c]=[]);const i=u[c];Mt(n[c],Array.isArray(i)?i:i?[i]:[])}}}function Mt(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 Pt=/[!-\/:-@\[-`\{-~\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]/),Lt=se(/[#-'*+\--9=?A-Z^-~]/);function Ae(e){return e!==null&&(e<32||e===127)}const Ie=se(/\d/),Ot=se(/[\dA-Fa-f]/),jt=se(/[!-/:-@[-`{-~]/);function E(e){return e!==null&&e<-2}function Q(e){return e!==null&&(e<0||e===32)}function T(e){return e===-2||e===-1||e===32}const Ht=se(Pt),Rt=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 qt={tokenize:Vt};function Vt(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 Nt={tokenize:Ut},Ne={tokenize:Wt};function Ut(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(Ne,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(Ne,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 Wt(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 Ue(e){if(e===null||Q(e)||Rt(e))return 1;if(Ht(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:$t};function $t(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);We(h,-p),We(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=Ue(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=Ue(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 We(e,r){e.column+=r,e.offset+=r,e._bufferIndex+=r}const Kt={name:"autolink",tokenize:Gt};function Gt(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):Lt(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:Jt,partial:!0};function Jt(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 tt={name:"blockQuote",tokenize:Xt,continuation:{tokenize:Zt},exit:Yt};function Xt(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 Zt(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(tt,r,t)(i)}}function Yt(e){e.exit("blockQuote")}const nt={name:"characterEscape",tokenize:en};function en(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 jt(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),r):t(c)}}const rt={name:"characterReference",tokenize:tn};function tn(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=Ot,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:rn,partial:!0},Qe={name:"codeFenced",tokenize:nn,concrete:!0};function nn(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 rn(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:cn},un={tokenize:on,partial:!0};function cn(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(un,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 on(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 sn={name:"codeText",tokenize:fn,resolve:ln,previous:an};function ln(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 an(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function fn(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 it(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,dn(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 dn(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 pn={tokenize:gn,resolve:mn},hn={tokenize:xn,partial:!0};function mn(e){return it(e),e}function gn(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(hn,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 xn(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 ut(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||Q(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 ct(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 ot(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 kn={name:"definition",tokenize:Fn},yn={tokenize:vn,partial:!0};function Fn(e,r,t){const n=this;let u;return c;function c(f){return e.enter("definition"),i(f)}function i(f){return ct.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 Q(f)?xe(e,a)(f):a(f)}function a(f){return ut(e,d,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return e.attempt(yn,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 vn(e,r,t){return n;function n(o){return Q(o)?xe(e,u)(o):t(o)}function u(o){return ot(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 Sn={name:"hardBreakEscape",tokenize:bn};function bn(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 En={name:"headingAtx",tokenize:In,resolve:An};function An(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 In(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||Q(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||Q(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),a)}}const Tn=["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"],Ke=["pre","script","style","textarea"],Cn={name:"htmlFlow",tokenize:_n,resolveTo:Dn,concrete:!0},wn={tokenize:Mn,partial:!0},zn={tokenize:Bn,partial:!0};function Dn(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 _n(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||Q(l)){const X=l===47,ae=i.toLowerCase();return!X&&!c&&Ke.includes(ae)?(u=1,n.interrupt?r(l):v(l)):Tn.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||Q(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(wn,re,M)(l)):l===null||E(l)?(e.exit("htmlFlowData"),M(l)):(e.consume(l),v)}function M(l){return e.check(zn,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 Ke.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 Bn(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 Mn(e,r,t){return n;function n(u){return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),e.attempt(Fe,r,t)}}const Pn={name:"htmlText",tokenize:Ln};function Ln(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||Q(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||Q(s)?q(s):(e.consume(s),j)}function A(s){return s===47||s===62||Q(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:Vn,resolveTo:qn,resolveAll:Rn},On={tokenize:Nn},jn={tokenize:Un},Hn={tokenize:Wn};function Rn(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 qn(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 Vn(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(On,d,i?d:h)(g):g===91?e.attempt(jn,d,i?a:h)(g):i?d(g):h(g)}function a(g){return e.attempt(Hn,d,h)(g)}function d(g){return r(g)}function h(g){return c._balanced=!0,t(g)}}function Nn(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 Q(h)?xe(e,c)(h):c(h)}function c(h){return h===41?d(h):ut(e,i,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function i(h){return Q(h)?xe(e,p)(h):d(h)}function o(h){return t(h)}function p(h){return h===34||h===39||h===40?ot(e,a,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function a(h){return Q(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 Un(e,r,t){const n=this;return u;function u(o){return ct.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 Wn(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 $n={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 Kn={name:"labelStartLink",tokenize:Gn,resolveAll:_e.resolveAll};function Gn(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:Jn};function Jn(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:Xn};function Xn(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 $={name:"list",tokenize:er,continuation:{tokenize:tr},exit:rr},Zn={tokenize:ir,partial:!0},Yn={tokenize:nr,partial:!0};function er(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(Zn,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 tr(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(Yn,r,i)(o))}function i(o){return n.containerState._closeFlow=!0,n.interrupt=void 0,_(e,e.attempt($,r,t),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function nr(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 rr(e){e.exit(this.containerState.type)}function ir(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 Ge={name:"setextUnderline",tokenize:cr,resolveTo:ur};function ur(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 cr(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 or={tokenize:sr};function sr(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(pn,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 lr={resolveAll:lt()},ar=st("string"),fr=st("text");function st(e){return{tokenize:r,resolveAll:lt(e==="text"?dr: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 lt(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 dr(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 pr(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 mr(f(F),v)}function f(F){return hr(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 hr(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 mr(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=`
|
|
2
2
|
`;break}case-3:{i=`\r
|
|
3
|
-
`;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 gr={42:$,43:$,45:$,48:$,49:$,50:$,51:$,52:$,53:$,54:$,55:$,56:$,57:$,62:tt},xr={91:kn},kr={[-2]:be,[-1]:be,32:be},yr={35:En,42:ke,45:[Ke,ke],60:Cn,61:Ke,95:ke,96:Qe,126:Qe},Fr={38:rt,92:nt},vr={[-5]:Ee,[-4]:Ee,[-3]:Ee,33:$n,38:rt,42:Te,60:[Gt,Pn],91:Gn,92:[Sn,nt],93:_e,95:Te,96:sn},Sr={null:[Te,lr]},br={null:[42,95]},Er={null:[]},Ar=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:br,contentInitial:xr,disable:Er,document:gr,flow:yr,flowInitial:kr,insideSpan:Sr,string:Fr,text:vr},Symbol.toStringTag,{value:"Module"}));function Ir(e){const r=_t([Ar,...(e||{}).extensions||[]]),t={defined:[],lazy:{},constructs:r,content:n(qt),document:n(Nt),flow:n(or),string:n(ar),text:n(fr)};return t;function n(u){return c;function c(i){return pr(t,u,i)}}}const Je=/[\0\t\n\r]/g;function Tr(){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(Je.lastIndex=h,a=Je.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 Cr(e){for(;!it(e););return e}function at(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?"�":String.fromCharCode(t)}const wr=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function zr(e){return e.replace(wr,Dr)}function Dr(e,r,t){if(r)return r;if(t.charCodeAt(0)===35){const n=t.charCodeAt(1),u=n===120||n===88;return at(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?Xe(e.position):"start"in e||"end"in e?Xe(e):"line"in e||"column"in e?Ce(e):""}function Ce(e){return Ze(e&&e.line)+":"+Ze(e&&e.column)}function Xe(e){return Ce(e&&e.start)+"-"+Ce(e&&e.end)}function Ze(e){return e&&typeof e=="number"?e:1}const ft={}.hasOwnProperty,dt=function(e,r,t){return typeof r!="string"&&(t=r,r=void 0),_r(t)(Cr(Ir(t).document().write(Tr()(e,r,!0))))};function _r(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(mt,p),codeTextData:F,data:F,codeFlowValue:F,definition:o(gt),definitionDestinationString:p,definitionLabelString:p,definitionTitleString:p,emphasis:o(xt),hardBreakEscape:o(Oe),hardBreakTrailing:o(Oe),htmlFlow:o(je,p),htmlFlowData:F,htmlText:o(je,p),htmlTextData:F,image:o(kt),label:p,link:o(He),listItem:o(yt),listItemValue:I,listOrdered:o(Re,f),listUnordered:o(Re),paragraph:o(Ft),reference:ae,referenceString:p,resourceDestinationString:p,resourceTitleString:p,setextHeading:o(Le),strong:o(vt),thematicBreak:o(bt)},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(K),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()}};pt(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]];ft.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]||Ye).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]||Ye).call(this,m,z[0]));else throw new Error("Cannot close `"+m.type+"` ("+ye({start:m.start,end:m.end})+"): it’s not open");return b.position.end=oe(m.end),b}function g(){return zt(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=St(),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 K(){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=zr(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=at(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 mt(){return{type:"inlineCode",value:""}}function gt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function xt(){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 kt(){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 yt(m){return{type:"listItem",spread:m._spread,checked:null,children:[]}}function Ft(){return{type:"paragraph",children:[]}}function vt(){return{type:"strong",children:[]}}function St(){return{type:"text",value:""}}function bt(){return{type:"thematicBreak"}}}function oe(e){return{line:e.line,column:e.column,offset:e.offset}}function pt(e,r){let t=-1;for(;++t<r.length;){const n=r[t];Array.isArray(n)?pt(e,n):Br(e,n)}}function Br(e,r){let t;for(t in r)if(ft.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 Ye(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 Mr(e){const r=e.replace(/\n{2,}/g,`
|
|
3
|
+
`;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 gr={42:$,43:$,45:$,48:$,49:$,50:$,51:$,52:$,53:$,54:$,55:$,56:$,57:$,62:tt},xr={91:kn},kr={[-2]:be,[-1]:be,32:be},yr={35:En,42:ke,45:[Ge,ke],60:Cn,61:Ge,95:ke,96:Qe,126:Qe},Fr={38:rt,92:nt},vr={[-5]:Ee,[-4]:Ee,[-3]:Ee,33:$n,38:rt,42:Te,60:[Kt,Pn],91:Kn,92:[Sn,nt],93:_e,95:Te,96:sn},Sr={null:[Te,lr]},br={null:[42,95]},Er={null:[]},Ar=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:br,contentInitial:xr,disable:Er,document:gr,flow:yr,flowInitial:kr,insideSpan:Sr,string:Fr,text:vr},Symbol.toStringTag,{value:"Module"}));function Ir(e){const r=_t([Ar,...(e||{}).extensions||[]]),t={defined:[],lazy:{},constructs:r,content:n(qt),document:n(Nt),flow:n(or),string:n(ar),text:n(fr)};return t;function n(u){return c;function c(i){return pr(t,u,i)}}}const Je=/[\0\t\n\r]/g;function Tr(){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(Je.lastIndex=h,a=Je.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 Cr(e){for(;!it(e););return e}function at(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?"�":String.fromCharCode(t)}const wr=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function zr(e){return e.replace(wr,Dr)}function Dr(e,r,t){if(r)return r;if(t.charCodeAt(0)===35){const n=t.charCodeAt(1),u=n===120||n===88;return at(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?Xe(e.position):"start"in e||"end"in e?Xe(e):"line"in e||"column"in e?Ce(e):""}function Ce(e){return Ze(e&&e.line)+":"+Ze(e&&e.column)}function Xe(e){return Ce(e&&e.start)+"-"+Ce(e&&e.end)}function Ze(e){return e&&typeof e=="number"?e:1}const ft={}.hasOwnProperty,dt=function(e,r,t){return typeof r!="string"&&(t=r,r=void 0),_r(t)(Cr(Ir(t).document().write(Tr()(e,r,!0))))};function _r(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(mt,p),codeTextData:F,data:F,codeFlowValue:F,definition:o(gt),definitionDestinationString:p,definitionLabelString:p,definitionTitleString:p,emphasis:o(xt),hardBreakEscape:o(Oe),hardBreakTrailing:o(Oe),htmlFlow:o(je,p),htmlFlowData:F,htmlText:o(je,p),htmlTextData:F,image:o(kt),label:p,link:o(He),listItem:o(yt),listItemValue:I,listOrdered:o(Re,f),listUnordered:o(Re),paragraph:o(Ft),reference:ae,referenceString:p,resourceDestinationString:p,resourceTitleString:p,setextHeading:o(Le),strong:o(vt),thematicBreak:o(bt)},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()}};pt(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]];ft.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]||Ye).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]||Ye).call(this,m,z[0]));else throw new Error("Cannot close `"+m.type+"` ("+ye({start:m.start,end:m.end})+"): it’s not open");return b.position.end=oe(m.end),b}function g(){return zt(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=St(),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=zr(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=at(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 mt(){return{type:"inlineCode",value:""}}function gt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function xt(){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 kt(){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 yt(m){return{type:"listItem",spread:m._spread,checked:null,children:[]}}function Ft(){return{type:"paragraph",children:[]}}function vt(){return{type:"strong",children:[]}}function St(){return{type:"text",value:""}}function bt(){return{type:"thematicBreak"}}}function oe(e){return{line:e.line,column:e.column,offset:e.offset}}function pt(e,r){let t=-1;for(;++t<r.length;){const n=r[t];Array.isArray(n)?pt(e,n):Br(e,n)}}function Br(e,r){let t;for(t in r)if(ft.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 Ye(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 Mr(e){const r=e.replace(/\n{2,}/g,`
|
|
4
4
|
`);return Ct(r)}function Pr(e){const r=Mr(e),{children:t}=dt(r),n=[[]];let u=0;function c(i,o="normal"){i.type==="text"?i.value.split(`
|
|
5
5
|
`).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 Lr(e){const{children:r}=dt(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 Or(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(r=>r.segment):[...e]}function jr(e,r){const t=Or(r.content);return ht(e,[],t,r.type)}function ht(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}])?ht(e,i,c,n):(r.length===0&&u&&(r.push(u),t.shift()),[{content:r.join(""),type:n},{content:t.join(""),type:n}])}function Hr(e,r){if(e.some(({content:t})=>t.includes(`
|
|
6
6
|
`)))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]=jr(r,c);t.push([o]),p.content&&e.unshift(p)}return we(e,r,t)}function Rr(e,r){r&&e.attr("style",r)}function qr(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(It(`
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{O as f,d as lt,o as ot,E as w,x as W,F as _,f as N,W as F,br as q}from"./index-3H3i7ExC.js";import{$ as nt}from"./createText-1719965b-C2-AT0ab-Ngc7i9D1.js";const dt=(a,t,e,s)=>{t.forEach(l=>{bt[l](a,e,s)})},ht=(a,t,e)=>{f.trace("Making markers for ",e),a.append("defs").append("marker").attr("id",e+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),a.append("defs").append("marker").attr("id",e+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},ct=(a,t,e)=>{a.append("defs").append("marker").attr("id",e+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),a.append("defs").append("marker").attr("id",e+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},yt=(a,t,e)=>{a.append("defs").append("marker").attr("id",e+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),a.append("defs").append("marker").attr("id",e+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},pt=(a,t,e)=>{a.append("defs").append("marker").attr("id",e+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),a.append("defs").append("marker").attr("id",e+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},gt=(a,t,e)=>{a.append("defs").append("marker").attr("id",e+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),a.append("defs").append("marker").attr("id",e+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},xt=(a,t,e)=>{a.append("marker").attr("id",e+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),a.append("marker").attr("id",e+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},ft=(a,t,e)=>{a.append("marker").attr("id",e+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),a.append("marker").attr("id",e+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},ut=(a,t,e)=>{a.append("marker").attr("id",e+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),a.append("marker").attr("id",e+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},wt=(a,t,e)=>{a.append("defs").append("marker").attr("id",e+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},bt={extension:ht,composition:ct,aggregation:yt,dependency:pt,lollipop:gt,point:xt,circle:ft,cross:ut,barb:wt},or=dt;function mt(a,t){t&&a.attr("style",t)}function kt(a,t){const e=_(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),s=e.append("xhtml:div"),l=a.label,r=a.isNode?"nodeLabel":"edgeLabel";return s.html(F('<span class="'+r+'" '+(a.labelStyle?'style="'+a.labelStyle+'"':"")+">"+l+"</span>",t)),mt(s,a.labelStyle),s.style("display","inline-block"),s.style("white-space","nowrap"),s.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}const Lt=(a,t,e,s)=>{let l=a||"";typeof l=="object"&&(l=l[0]);const r=w();if(W(r.flowchart.htmlLabels)){l=l.replace(/\\n|\n/g,"<br />"),f.debug("vertexText"+l);const n={isNode:s,label:q(l).replace(/fa[blrs]?:fa-[\w-]+/g,i=>`<i class='${i.replace(":"," ")}'></i>`),labelStyle:t.replace("fill:","color:")};return kt(n,r)}else{const n=document.createElementNS("http://www.w3.org/2000/svg","text");n.setAttribute("style",t.replace("color:","fill:"));let i=[];typeof l=="string"?i=l.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(l)?i=l:i=[];for(const o of i){const h=document.createElementNS("http://www.w3.org/2000/svg","tspan");h.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),h.setAttribute("dy","1em"),h.setAttribute("x","0"),e?h.setAttribute("class","title-row"):h.setAttribute("class","row"),h.textContent=o.trim(),n.appendChild(h)}return n}},P=Lt,M=async(a,t,e,s)=>{let l;const r=t.useHtmlLabels||W(w().flowchart.htmlLabels);e?l=e:l="node default";const n=a.insert("g").attr("class",l).attr("id",t.domId||t.id),i=n.insert("g").attr("class","label").attr("style",t.labelStyle);let o;t.labelText===void 0?o="":o=typeof t.labelText=="string"?t.labelText:t.labelText[0];const h=i.node();let d;t.labelType==="markdown"?d=nt(i,F(q(o),w()),{useHtmlLabels:r,width:t.width||w().flowchart.wrappingWidth,classes:"markdown-node-label"}):d=h.appendChild(P(F(q(o),w()),t.labelStyle,!1,s));let c=d.getBBox();const p=t.padding/2;if(W(w().flowchart.htmlLabels)){const y=d.children[0],x=_(d),k=y.getElementsByTagName("img");if(k){const g=o.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...k].map(u=>new Promise(v=>{function B(){if(u.style.display="flex",u.style.flexDirection="column",g){const C=w().fontSize?w().fontSize:window.getComputedStyle(document.body).fontSize,X=parseInt(C,10)*5+"px";u.style.minWidth=X,u.style.maxWidth=X}else u.style.width="100%";v(u)}setTimeout(()=>{u.complete&&B()}),u.addEventListener("error",B),u.addEventListener("load",B)})))}c=y.getBoundingClientRect(),x.attr("width",c.width),x.attr("height",c.height)}return r?i.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"):i.attr("transform","translate(0, "+-c.height/2+")"),t.centerLabel&&i.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:n,bbox:c,halfPadding:p,label:i}},m=(a,t)=>{const e=t.node().getBBox();a.width=e.width,a.height=e.height};function O(a,t,e,s){return a.insert("polygon",":first-child").attr("points",s.map(function(l){return l.x+","+l.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+e/2+")")}function St(a,t){return a.intersect(t)}function st(a,t,e,s){var l=a.x,r=a.y,n=l-s.x,i=r-s.y,o=Math.sqrt(t*t*i*i+e*e*n*n),h=Math.abs(t*e*n/o);s.x<l&&(h=-h);var d=Math.abs(t*e*i/o);return s.y<r&&(d=-d),{x:l+h,y:r+d}}function vt(a,t,e){return st(a,t,t,e)}function Mt(a,t,e,s){var l,r,n,i,o,h,d,c,p,y,x,k,g,u,v;if(l=t.y-a.y,n=a.x-t.x,o=t.x*a.y-a.x*t.y,p=l*e.x+n*e.y+o,y=l*s.x+n*s.y+o,!(p!==0&&y!==0&&J(p,y))&&(r=s.y-e.y,i=e.x-s.x,h=s.x*e.y-e.x*s.y,d=r*a.x+i*a.y+h,c=r*t.x+i*t.y+h,!(d!==0&&c!==0&&J(d,c))&&(x=l*i-r*n,x!==0)))return k=Math.abs(x/2),g=n*h-i*o,u=g<0?(g-k)/x:(g+k)/x,g=r*o-l*h,v=g<0?(g-k)/x:(g+k)/x,{x:u,y:v}}function J(a,t){return a*t>0}function Tt(a,t,e){var s=a.x,l=a.y,r=[],n=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(x){n=Math.min(n,x.x),i=Math.min(i,x.y)}):(n=Math.min(n,t.x),i=Math.min(i,t.y));for(var o=s-a.width/2-n,h=l-a.height/2-i,d=0;d<t.length;d++){var c=t[d],p=t[d<t.length-1?d+1:0],y=Mt(a,e,{x:o+c.x,y:h+c.y},{x:o+p.x,y:h+p.y});y&&r.push(y)}return r.length?(r.length>1&&r.sort(function(x,k){var g=x.x-e.x,u=x.y-e.y,v=Math.sqrt(g*g+u*u),B=k.x-e.x,C=k.y-e.y,X=Math.sqrt(B*B+C*C);return v<X?-1:v===X?0:1}),r[0]):a}const Bt=(a,t)=>{var e=a.x,s=a.y,l=t.x-e,r=t.y-s,n=a.width/2,i=a.height/2,o,h;return Math.abs(r)*n>Math.abs(l)*i?(r<0&&(i=-i),o=r===0?0:i*l/r,h=i):(l<0&&(n=-n),o=n,h=l===0?0:n*r/l),{x:e+o,y:s+h}},_t=Bt,b={node:St,circle:vt,ellipse:st,polygon:Tt,rect:_t},Ct=async(a,t)=>{t.useHtmlLabels||w().flowchart.htmlLabels||(t.centerLabel=!0);const{shapeSvg:e,bbox:s,halfPadding:l}=await M(a,t,"node "+t.classes,!0);f.info("Classes = ",t.classes);const r=e.insert("rect",":first-child");return r.attr("rx",t.rx).attr("ry",t.ry).attr("x",-s.width/2-l).attr("y",-s.height/2-l).attr("width",s.width+t.padding).attr("height",s.height+t.padding),m(t,r),t.intersect=function(n){return b.rect(t,n)},e},Et=Ct,$t=a=>{const t=new Set;for(const e of a)switch(e){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(e);break}return t},Pt=(a,t,e)=>{const s=$t(a),l=2,r=t.height+2*e.padding,n=r/l,i=t.width+2*n+e.padding,o=e.padding/2;return s.has("right")&&s.has("left")&&s.has("up")&&s.has("down")?[{x:0,y:0},{x:n,y:0},{x:i/2,y:2*o},{x:i-n,y:0},{x:i,y:0},{x:i,y:-r/3},{x:i+2*o,y:-r/2},{x:i,y:-2*r/3},{x:i,y:-r},{x:i-n,y:-r},{x:i/2,y:-r-2*o},{x:n,y:-r},{x:0,y:-r},{x:0,y:-2*r/3},{x:-2*o,y:-r/2},{x:0,y:-r/3}]:s.has("right")&&s.has("left")&&s.has("up")?[{x:n,y:0},{x:i-n,y:0},{x:i,y:-r/2},{x:i-n,y:-r},{x:n,y:-r},{x:0,y:-r/2}]:s.has("right")&&s.has("left")&&s.has("down")?[{x:0,y:0},{x:n,y:-r},{x:i-n,y:-r},{x:i,y:0}]:s.has("right")&&s.has("up")&&s.has("down")?[{x:0,y:0},{x:i,y:-n},{x:i,y:-r+n},{x:0,y:-r}]:s.has("left")&&s.has("up")&&s.has("down")?[{x:i,y:0},{x:0,y:-n},{x:0,y:-r+n},{x:i,y:-r}]:s.has("right")&&s.has("left")?[{x:n,y:0},{x:n,y:-o},{x:i-n,y:-o},{x:i-n,y:0},{x:i,y:-r/2},{x:i-n,y:-r},{x:i-n,y:-r+o},{x:n,y:-r+o},{x:n,y:-r},{x:0,y:-r/2}]:s.has("up")&&s.has("down")?[{x:i/2,y:0},{x:0,y:-o},{x:n,y:-o},{x:n,y:-r+o},{x:0,y:-r+o},{x:i/2,y:-r},{x:i,y:-r+o},{x:i-n,y:-r+o},{x:i-n,y:-o},{x:i,y:-o}]:s.has("right")&&s.has("up")?[{x:0,y:0},{x:i,y:-n},{x:0,y:-r}]:s.has("right")&&s.has("down")?[{x:0,y:0},{x:i,y:0},{x:0,y:-r}]:s.has("left")&&s.has("up")?[{x:i,y:0},{x:0,y:-n},{x:i,y:-r}]:s.has("left")&&s.has("down")?[{x:i,y:0},{x:0,y:0},{x:i,y:-r}]:s.has("right")?[{x:n,y:-o},{x:n,y:-o},{x:i-n,y:-o},{x:i-n,y:0},{x:i,y:-r/2},{x:i-n,y:-r},{x:i-n,y:-r+o},{x:n,y:-r+o},{x:n,y:-r+o}]:s.has("left")?[{x:n,y:0},{x:n,y:-o},{x:i-n,y:-o},{x:i-n,y:-r+o},{x:n,y:-r+o},{x:n,y:-r},{x:0,y:-r/2}]:s.has("up")?[{x:n,y:-o},{x:n,y:-r+o},{x:0,y:-r+o},{x:i/2,y:-r},{x:i,y:-r+o},{x:i-n,y:-r+o},{x:i-n,y:-o}]:s.has("down")?[{x:i/2,y:0},{x:0,y:-o},{x:n,y:-o},{x:n,y:-r+o},{x:i-n,y:-r+o},{x:i-n,y:-o},{x:i,y:-o}]:[{x:0,y:0}]},Q=a=>a?" "+a:"",$=(a,t)=>`node default${Q(a.classes)} ${Q(a.class)}`,K=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,$(t),!0),l=s.width+t.padding,r=s.height+t.padding,n=l+r,i=[{x:n/2,y:0},{x:n,y:-n/2},{x:n/2,y:-n},{x:0,y:-n/2}];f.info("Question main (Circle)");const o=O(e,n,n,i);return o.attr("style",t.style),m(t,o),t.intersect=function(h){return f.warn("Intersect called"),b.polygon(t,i,h)},e},Wt=(a,t)=>{const e=a.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=28,l=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}];return e.insert("polygon",":first-child").attr("points",l.map(function(r){return r.x+","+r.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(r){return b.circle(t,14,r)},e},Ot=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,$(t),!0),l=4,r=s.height+t.padding,n=r/l,i=s.width+2*n+t.padding,o=[{x:n,y:0},{x:i-n,y:0},{x:i,y:-r/2},{x:i-n,y:-r},{x:n,y:-r},{x:0,y:-r/2}],h=O(e,i,r,o);return h.attr("style",t.style),m(t,h),t.intersect=function(d){return b.polygon(t,o,d)},e},Rt=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,void 0,!0),l=2,r=s.height+2*t.padding,n=r/l,i=s.width+2*n+t.padding,o=Pt(t.directions,s,t),h=O(e,i,r,o);return h.attr("style",t.style),m(t,h),t.intersect=function(d){return b.polygon(t,o,d)},e},Xt=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,$(t),!0),l=s.width+t.padding,r=s.height+t.padding,n=[{x:-r/2,y:0},{x:l,y:0},{x:l,y:-r},{x:-r/2,y:-r},{x:0,y:-r/2}];return O(e,l,r,n).attr("style",t.style),t.width=l+r,t.height=r,t.intersect=function(i){return b.polygon(t,n,i)},e},Yt=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,$(t),!0),l=s.width+t.padding,r=s.height+t.padding,n=[{x:-2*r/6,y:0},{x:l-r/6,y:0},{x:l+2*r/6,y:-r},{x:r/6,y:-r}],i=O(e,l,r,n);return i.attr("style",t.style),m(t,i),t.intersect=function(o){return b.polygon(t,n,o)},e},It=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,$(t),!0),l=s.width+t.padding,r=s.height+t.padding,n=[{x:2*r/6,y:0},{x:l+r/6,y:0},{x:l-2*r/6,y:-r},{x:-r/6,y:-r}],i=O(e,l,r,n);return i.attr("style",t.style),m(t,i),t.intersect=function(o){return b.polygon(t,n,o)},e},Dt=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,$(t),!0),l=s.width+t.padding,r=s.height+t.padding,n=[{x:-2*r/6,y:0},{x:l+2*r/6,y:0},{x:l-r/6,y:-r},{x:r/6,y:-r}],i=O(e,l,r,n);return i.attr("style",t.style),m(t,i),t.intersect=function(o){return b.polygon(t,n,o)},e},Ht=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,$(t),!0),l=s.width+t.padding,r=s.height+t.padding,n=[{x:r/6,y:0},{x:l-r/6,y:0},{x:l+2*r/6,y:-r},{x:-2*r/6,y:-r}],i=O(e,l,r,n);return i.attr("style",t.style),m(t,i),t.intersect=function(o){return b.polygon(t,n,o)},e},Nt=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,$(t),!0),l=s.width+t.padding,r=s.height+t.padding,n=[{x:0,y:0},{x:l+r/2,y:0},{x:l,y:-r/2},{x:l+r/2,y:-r},{x:0,y:-r}],i=O(e,l,r,n);return i.attr("style",t.style),m(t,i),t.intersect=function(o){return b.polygon(t,n,o)},e},jt=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,$(t),!0),l=s.width+t.padding,r=l/2,n=r/(2.5+l/50),i=s.height+n+t.padding,o="M 0,"+n+" a "+r+","+n+" 0,0,0 "+l+" 0 a "+r+","+n+" 0,0,0 "+-l+" 0 l 0,"+i+" a "+r+","+n+" 0,0,0 "+l+" 0 l 0,"+-i,h=e.attr("label-offset-y",n).insert("path",":first-child").attr("style",t.style).attr("d",o).attr("transform","translate("+-l/2+","+-(i/2+n)+")");return m(t,h),t.intersect=function(d){const c=b.rect(t,d),p=c.x-t.x;if(r!=0&&(Math.abs(p)<t.width/2||Math.abs(p)==t.width/2&&Math.abs(c.y-t.y)>t.height/2-n)){let y=n*n*(1-p*p/(r*r));y!=0&&(y=Math.sqrt(y)),y=n-y,d.y-t.y>0&&(y=-y),c.y+=y}return c},e},Ut=async(a,t)=>{const{shapeSvg:e,bbox:s,halfPadding:l}=await M(a,t,"node "+t.classes+" "+t.class,!0),r=e.insert("rect",":first-child"),n=t.positioned?t.width:s.width+t.padding,i=t.positioned?t.height:s.height+t.padding,o=t.positioned?-n/2:-s.width/2-l,h=t.positioned?-i/2:-s.height/2-l;if(r.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",o).attr("y",h).attr("width",n).attr("height",i),t.props){const d=new Set(Object.keys(t.props));t.props.borders&&(G(r,t.props.borders,n,i),d.delete("borders")),d.forEach(c=>{f.warn(`Unknown node property ${c}`)})}return m(t,r),t.intersect=function(d){return b.rect(t,d)},e},At=async(a,t)=>{const{shapeSvg:e,bbox:s,halfPadding:l}=await M(a,t,"node "+t.classes,!0),r=e.insert("rect",":first-child"),n=t.positioned?t.width:s.width+t.padding,i=t.positioned?t.height:s.height+t.padding,o=t.positioned?-n/2:-s.width/2-l,h=t.positioned?-i/2:-s.height/2-l;if(r.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",o).attr("y",h).attr("width",n).attr("height",i),t.props){const d=new Set(Object.keys(t.props));t.props.borders&&(G(r,t.props.borders,n,i),d.delete("borders")),d.forEach(c=>{f.warn(`Unknown node property ${c}`)})}return m(t,r),t.intersect=function(d){return b.rect(t,d)},e},Zt=async(a,t)=>{const{shapeSvg:e}=await M(a,t,"label",!0);f.trace("Classes = ",t.class);const s=e.insert("rect",":first-child"),l=0,r=0;if(s.attr("width",l).attr("height",r),e.attr("class","label edgeLabel"),t.props){const n=new Set(Object.keys(t.props));t.props.borders&&(G(s,t.props.borders,l,r),n.delete("borders")),n.forEach(i=>{f.warn(`Unknown node property ${i}`)})}return m(t,s),t.intersect=function(n){return b.rect(t,n)},e};function G(a,t,e,s){const l=[],r=i=>{l.push(i,0)},n=i=>{l.push(0,i)};t.includes("t")?(f.debug("add top border"),r(e)):n(e),t.includes("r")?(f.debug("add right border"),r(s)):n(s),t.includes("b")?(f.debug("add bottom border"),r(e)):n(e),t.includes("l")?(f.debug("add left border"),r(s)):n(s),a.attr("stroke-dasharray",l.join(" "))}const zt=(a,t)=>{let e;t.classes?e="node "+t.classes:e="node default";const s=a.insert("g").attr("class",e).attr("id",t.domId||t.id),l=s.insert("rect",":first-child"),r=s.insert("line"),n=s.insert("g").attr("class","label"),i=t.labelText.flat?t.labelText.flat():t.labelText;let o="";typeof i=="object"?o=i[0]:o=i,f.info("Label text abc79",o,i,typeof i=="object");const h=n.node().appendChild(P(o,t.labelStyle,!0,!0));let d={width:0,height:0};if(W(w().flowchart.htmlLabels)){const k=h.children[0],g=_(h);d=k.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}f.info("Text 2",i);const c=i.slice(1,i.length);let p=h.getBBox();const y=n.node().appendChild(P(c.join?c.join("<br/>"):c,t.labelStyle,!0,!0));if(W(w().flowchart.htmlLabels)){const k=y.children[0],g=_(y);d=k.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}const x=t.padding/2;return _(y).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+x+5)+")"),_(h).attr("transform","translate( "+(d.width<p.width?0:-(p.width-d.width)/2)+", 0)"),d=n.node().getBBox(),n.attr("transform","translate("+-d.width/2+", "+(-d.height/2-x+3)+")"),l.attr("class","outer title-state").attr("x",-d.width/2-x).attr("y",-d.height/2-x).attr("width",d.width+t.padding).attr("height",d.height+t.padding),r.attr("class","divider").attr("x1",-d.width/2-x).attr("x2",d.width/2+x).attr("y1",-d.height/2-x+p.height+x).attr("y2",-d.height/2-x+p.height+x),m(t,l),t.intersect=function(k){return b.rect(t,k)},s},Ft=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,$(t),!0),l=s.height+t.padding,r=s.width+l/4+t.padding,n=e.insert("rect",":first-child").attr("style",t.style).attr("rx",l/2).attr("ry",l/2).attr("x",-r/2).attr("y",-l/2).attr("width",r).attr("height",l);return m(t,n),t.intersect=function(i){return b.rect(t,i)},e},qt=async(a,t)=>{const{shapeSvg:e,bbox:s,halfPadding:l}=await M(a,t,$(t),!0),r=e.insert("circle",":first-child");return r.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+l).attr("width",s.width+t.padding).attr("height",s.height+t.padding),f.info("Circle main"),m(t,r),t.intersect=function(n){return f.info("Circle intersect",t,s.width/2+l,n),b.circle(t,s.width/2+l,n)},e},Gt=async(a,t)=>{const{shapeSvg:e,bbox:s,halfPadding:l}=await M(a,t,$(t),!0),r=5,n=e.insert("g",":first-child"),i=n.insert("circle"),o=n.insert("circle");return n.attr("class",t.class),i.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+l+r).attr("width",s.width+t.padding+r*2).attr("height",s.height+t.padding+r*2),o.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+l).attr("width",s.width+t.padding).attr("height",s.height+t.padding),f.info("DoubleCircle main"),m(t,i),t.intersect=function(h){return f.info("DoubleCircle intersect",t,s.width/2+l+r,h),b.circle(t,s.width/2+l+r,h)},e},Vt=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,$(t),!0),l=s.width+t.padding,r=s.height+t.padding,n=[{x:0,y:0},{x:l,y:0},{x:l,y:-r},{x:0,y:-r},{x:0,y:0},{x:-8,y:0},{x:l+8,y:0},{x:l+8,y:-r},{x:-8,y:-r},{x:-8,y:0}],i=O(e,l,r,n);return i.attr("style",t.style),m(t,i),t.intersect=function(o){return b.polygon(t,n,o)},e},Jt=(a,t)=>{const e=a.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=e.insert("circle",":first-child");return s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),m(t,s),t.intersect=function(l){return b.circle(t,7,l)},e},tt=(a,t,e)=>{const s=a.insert("g").attr("class","node default").attr("id",t.domId||t.id);let l=70,r=10;e==="LR"&&(l=10,r=70);const n=s.append("rect").attr("x",-1*l/2).attr("y",-1*r/2).attr("width",l).attr("height",r).attr("class","fork-join");return m(t,n),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(i){return b.rect(t,i)},s},Qt=(a,t)=>{const e=a.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=e.insert("circle",":first-child"),l=e.insert("circle",":first-child");return l.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),s.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),m(t,l),t.intersect=function(r){return b.circle(t,7,r)},e},Kt=(a,t)=>{const e=t.padding/2,s=4,l=8;let r;t.classes?r="node "+t.classes:r="node default";const n=a.insert("g").attr("class",r).attr("id",t.domId||t.id),i=n.insert("rect",":first-child"),o=n.insert("line"),h=n.insert("line");let d=0,c=s;const p=n.insert("g").attr("class","label");let y=0;const x=t.classData.annotations&&t.classData.annotations[0],k=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",g=p.node().appendChild(P(k,t.labelStyle,!0,!0));let u=g.getBBox();if(W(w().flowchart.htmlLabels)){const L=g.children[0],S=_(g);u=L.getBoundingClientRect(),S.attr("width",u.width),S.attr("height",u.height)}t.classData.annotations[0]&&(c+=u.height+s,d+=u.width);let v=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(w().flowchart.htmlLabels?v+="<"+t.classData.type+">":v+="<"+t.classData.type+">");const B=p.node().appendChild(P(v,t.labelStyle,!0,!0));_(B).attr("class","classTitle");let C=B.getBBox();if(W(w().flowchart.htmlLabels)){const L=B.children[0],S=_(B);C=L.getBoundingClientRect(),S.attr("width",C.width),S.attr("height",C.height)}c+=C.height+s,C.width>d&&(d=C.width);const X=[];t.classData.members.forEach(L=>{const S=L.getDisplayDetails();let I=S.displayText;w().flowchart.htmlLabels&&(I=I.replace(/</g,"<").replace(/>/g,">"));const R=p.node().appendChild(P(I,S.cssStyle?S.cssStyle:t.labelStyle,!0,!0));let E=R.getBBox();if(W(w().flowchart.htmlLabels)){const z=R.children[0],H=_(R);E=z.getBoundingClientRect(),H.attr("width",E.width),H.attr("height",E.height)}E.width>d&&(d=E.width),c+=E.height+s,X.push(R)}),c+=l;const V=[];if(t.classData.methods.forEach(L=>{const S=L.getDisplayDetails();let I=S.displayText;w().flowchart.htmlLabels&&(I=I.replace(/</g,"<").replace(/>/g,">"));const R=p.node().appendChild(P(I,S.cssStyle?S.cssStyle:t.labelStyle,!0,!0));let E=R.getBBox();if(W(w().flowchart.htmlLabels)){const z=R.children[0],H=_(R);E=z.getBoundingClientRect(),H.attr("width",E.width),H.attr("height",E.height)}E.width>d&&(d=E.width),c+=E.height+s,V.push(R)}),c+=l,x){let L=(d-u.width)/2;_(g).attr("transform","translate( "+(-1*d/2+L)+", "+-1*c/2+")"),y=u.height+s}let it=(d-C.width)/2;return _(B).attr("transform","translate( "+(-1*d/2+it)+", "+(-1*c/2+y)+")"),y+=C.height+s,o.attr("class","divider").attr("x1",-d/2-e).attr("x2",d/2+e).attr("y1",-c/2-e+l+y).attr("y2",-c/2-e+l+y),y+=l,X.forEach(L=>{_(L).attr("transform","translate( "+-d/2+", "+(-1*c/2+y+l/2)+")");const S=L==null?void 0:L.getBBox();y+=((S==null?void 0:S.height)??0)+s}),y+=l,h.attr("class","divider").attr("x1",-d/2-e).attr("x2",d/2+e).attr("y1",-c/2-e+l+y).attr("y2",-c/2-e+l+y),y+=l,V.forEach(L=>{_(L).attr("transform","translate( "+-d/2+", "+(-1*c/2+y)+")");const S=L==null?void 0:L.getBBox();y+=((S==null?void 0:S.height)??0)+s}),i.attr("style",t.style).attr("class","outer title-state").attr("x",-d/2-e).attr("y",-(c/2)-e).attr("width",d+t.padding).attr("height",c+t.padding),m(t,i),t.intersect=function(L){return b.rect(t,L)},n},rt={rhombus:K,composite:At,question:K,rect:Ut,labelRect:Zt,rectWithTitle:zt,choice:Wt,circle:qt,doublecircle:Gt,stadium:Ft,hexagon:Ot,block_arrow:Rt,rect_left_inv_arrow:Xt,lean_right:Yt,lean_left:It,trapezoid:Dt,inv_trapezoid:Ht,rect_right_inv_arrow:Nt,cylinder:jt,start:Jt,end:Qt,note:Et,subroutine:Vt,fork:tt,join:tt,class_box:Kt};let D={};const dr=async(a,t,e)=>{let s,l;if(t.link){let r;w().securityLevel==="sandbox"?r="_top":t.linkTarget&&(r=t.linkTarget||"_blank"),s=a.insert("svg:a").attr("xlink:href",t.link).attr("target",r),l=await rt[t.shape](s,t,e)}else l=await rt[t.shape](a,t,e),s=l;return t.tooltip&&l.attr("title",t.tooltip),t.class&&l.attr("class","node default "+t.class),s.attr("data-node","true"),s.attr("data-id",t.id),D[t.id]=s,t.haveCallback&&D[t.id].attr("class",D[t.id].attr("class")+" clickable"),s},hr=(a,t)=>{D[t.id]=a},cr=()=>{D={}},yr=a=>{const t=D[a.id];f.trace("Transforming node",a.diff,a,"translate("+(a.x-a.width/2-5)+", "+a.width/2+")");const e=8,s=a.diff||0;return a.clusterNode?t.attr("transform","translate("+(a.x+s-a.width/2)+", "+(a.y-a.height/2-e)+")"):t.attr("transform","translate("+a.x+", "+a.y+")"),s},tr=({flowchart:a})=>{var t,e;const s=((t=a==null?void 0:a.subGraphTitleMargin)==null?void 0:t.top)??0,l=((e=a==null?void 0:a.subGraphTitleMargin)==null?void 0:e.bottom)??0,r=s+l;return{subGraphTitleTopMargin:s,subGraphTitleBottomMargin:l,subGraphTitleTotalMargin:r}},Y={aggregation:18,extension:18,composition:18,dependency:6,lollipop:13.5,arrow_point:5.3};function j(a,t){if(a===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};a=A(a),t=A(t);const[e,s]=[a.x,a.y],[l,r]=[t.x,t.y],n=l-e,i=r-s;return{angle:Math.atan(i/n),deltaX:n,deltaY:i}}const A=a=>Array.isArray(a)?{x:a[0],y:a[1]}:a,rr=a=>({x:function(t,e,s){let l=0;if(e===0&&Object.hasOwn(Y,a.arrowTypeStart)){const{angle:r,deltaX:n}=j(s[0],s[1]);l=Y[a.arrowTypeStart]*Math.cos(r)*(n>=0?1:-1)}else if(e===s.length-1&&Object.hasOwn(Y,a.arrowTypeEnd)){const{angle:r,deltaX:n}=j(s[s.length-1],s[s.length-2]);l=Y[a.arrowTypeEnd]*Math.cos(r)*(n>=0?1:-1)}return A(t).x+l},y:function(t,e,s){let l=0;if(e===0&&Object.hasOwn(Y,a.arrowTypeStart)){const{angle:r,deltaY:n}=j(s[0],s[1]);l=Y[a.arrowTypeStart]*Math.abs(Math.sin(r))*(n>=0?1:-1)}else if(e===s.length-1&&Object.hasOwn(Y,a.arrowTypeEnd)){const{angle:r,deltaY:n}=j(s[s.length-1],s[s.length-2]);l=Y[a.arrowTypeEnd]*Math.abs(Math.sin(r))*(n>=0?1:-1)}return A(t).y+l}}),er=(a,t,e,s,l)=>{t.arrowTypeStart&&et(a,"start",t.arrowTypeStart,e,s,l),t.arrowTypeEnd&&et(a,"end",t.arrowTypeEnd,e,s,l)},ar={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},et=(a,t,e,s,l,r)=>{const n=ar[e];if(!n){f.warn(`Unknown arrow type: ${e}`);return}const i=t==="start"?"Start":"End";a.attr(`marker-${t}`,`url(${s}#${l}_${r}-${n}${i})`)};let Z={},T={};const pr=()=>{Z={},T={}},gr=(a,t)=>{const e=W(w().flowchart.htmlLabels),s=t.labelType==="markdown"?nt(a,t.label,{style:t.labelStyle,useHtmlLabels:e,addSvgBackground:!0}):P(t.label,t.labelStyle),l=a.insert("g").attr("class","edgeLabel"),r=l.insert("g").attr("class","label");r.node().appendChild(s);let n=s.getBBox();if(e){const o=s.children[0],h=_(s);n=o.getBoundingClientRect(),h.attr("width",n.width),h.attr("height",n.height)}r.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),Z[t.id]=l,t.width=n.width,t.height=n.height;let i;if(t.startLabelLeft){const o=P(t.startLabelLeft,t.labelStyle),h=a.insert("g").attr("class","edgeTerminals"),d=h.insert("g").attr("class","inner");i=d.node().appendChild(o);const c=o.getBBox();d.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),T[t.id]||(T[t.id]={}),T[t.id].startLeft=h,U(i,t.startLabelLeft)}if(t.startLabelRight){const o=P(t.startLabelRight,t.labelStyle),h=a.insert("g").attr("class","edgeTerminals"),d=h.insert("g").attr("class","inner");i=h.node().appendChild(o),d.node().appendChild(o);const c=o.getBBox();d.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),T[t.id]||(T[t.id]={}),T[t.id].startRight=h,U(i,t.startLabelRight)}if(t.endLabelLeft){const o=P(t.endLabelLeft,t.labelStyle),h=a.insert("g").attr("class","edgeTerminals"),d=h.insert("g").attr("class","inner");i=d.node().appendChild(o);const c=o.getBBox();d.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),h.node().appendChild(o),T[t.id]||(T[t.id]={}),T[t.id].endLeft=h,U(i,t.endLabelLeft)}if(t.endLabelRight){const o=P(t.endLabelRight,t.labelStyle),h=a.insert("g").attr("class","edgeTerminals"),d=h.insert("g").attr("class","inner");i=d.node().appendChild(o);const c=o.getBBox();d.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),h.node().appendChild(o),T[t.id]||(T[t.id]={}),T[t.id].endRight=h,U(i,t.endLabelRight)}return s};function U(a,t){w().flowchart.htmlLabels&&a&&(a.style.width=t.length*9+"px",a.style.height="12px")}const xr=(a,t)=>{f.debug("Moving label abc88 ",a.id,a.label,Z[a.id],t);let e=t.updatedPath?t.updatedPath:t.originalPath;const s=w(),{subGraphTitleTotalMargin:l}=tr(s);if(a.label){const r=Z[a.id];let n=a.x,i=a.y;if(e){const o=N.calcLabelPosition(e);f.debug("Moving label "+a.label+" from (",n,",",i,") to (",o.x,",",o.y,") abc88"),t.updatedPath&&(n=o.x,i=o.y)}r.attr("transform",`translate(${n}, ${i+l/2})`)}if(a.startLabelLeft){const r=T[a.id].startLeft;let n=a.x,i=a.y;if(e){const o=N.calcTerminalLabelPosition(a.arrowTypeStart?10:0,"start_left",e);n=o.x,i=o.y}r.attr("transform",`translate(${n}, ${i})`)}if(a.startLabelRight){const r=T[a.id].startRight;let n=a.x,i=a.y;if(e){const o=N.calcTerminalLabelPosition(a.arrowTypeStart?10:0,"start_right",e);n=o.x,i=o.y}r.attr("transform",`translate(${n}, ${i})`)}if(a.endLabelLeft){const r=T[a.id].endLeft;let n=a.x,i=a.y;if(e){const o=N.calcTerminalLabelPosition(a.arrowTypeEnd?10:0,"end_left",e);n=o.x,i=o.y}r.attr("transform",`translate(${n}, ${i})`)}if(a.endLabelRight){const r=T[a.id].endRight;let n=a.x,i=a.y;if(e){const o=N.calcTerminalLabelPosition(a.arrowTypeEnd?10:0,"end_right",e);n=o.x,i=o.y}r.attr("transform",`translate(${n}, ${i})`)}},nr=(a,t)=>{const e=a.x,s=a.y,l=Math.abs(t.x-e),r=Math.abs(t.y-s),n=a.width/2,i=a.height/2;return l>=n||r>=i},sr=(a,t,e)=>{f.debug(`intersection calc abc89:
|
|
2
|
+
outsidePoint: ${JSON.stringify(t)}
|
|
3
|
+
insidePoint : ${JSON.stringify(e)}
|
|
4
|
+
node : x:${a.x} y:${a.y} w:${a.width} h:${a.height}`);const s=a.x,l=a.y,r=Math.abs(s-e.x),n=a.width/2;let i=e.x<t.x?n-r:n+r;const o=a.height/2,h=Math.abs(t.y-e.y),d=Math.abs(t.x-e.x);if(Math.abs(l-t.y)*n>Math.abs(s-t.x)*o){let c=e.y<t.y?t.y-o-l:l-o-t.y;i=d*c/h;const p={x:e.x<t.x?e.x+i:e.x-d+i,y:e.y<t.y?e.y+h-c:e.y-h+c};return i===0&&(p.x=t.x,p.y=t.y),d===0&&(p.x=t.x),h===0&&(p.y=t.y),f.debug(`abc89 topp/bott calc, Q ${h}, q ${c}, R ${d}, r ${i}`,p),p}else{e.x<t.x?i=t.x-n-s:i=s-n-t.x;let c=h*i/d,p=e.x<t.x?e.x+d-i:e.x-d+i,y=e.y<t.y?e.y+c:e.y-c;return f.debug(`sides calc abc89, Q ${h}, q ${c}, R ${d}, r ${i}`,{_x:p,_y:y}),i===0&&(p=t.x,y=t.y),d===0&&(p=t.x),h===0&&(y=t.y),{x:p,y}}},at=(a,t)=>{f.debug("abc88 cutPathAtIntersect",a,t);let e=[],s=a[0],l=!1;return a.forEach(r=>{if(!nr(t,r)&&!l){const n=sr(t,s,r);let i=!1;e.forEach(o=>{i=i||o.x===n.x&&o.y===n.y}),e.some(o=>o.x===n.x&&o.y===n.y)||e.push(n),l=!0}else s=r,l||e.push(r)}),e},fr=function(a,t,e,s,l,r,n){let i=e.points;f.debug("abc88 InsertEdge: edge=",e,"e=",t);let o=!1;const h=r.node(t.v);var d=r.node(t.w);d!=null&&d.intersect&&h!=null&&h.intersect&&(i=i.slice(1,e.points.length-1),i.unshift(h.intersect(i[0])),i.push(d.intersect(i[i.length-1]))),e.toCluster&&(f.debug("to cluster abc88",s[e.toCluster]),i=at(e.points,s[e.toCluster].node),o=!0),e.fromCluster&&(f.debug("from cluster abc88",s[e.fromCluster]),i=at(i.reverse(),s[e.fromCluster].node).reverse(),o=!0);const c=i.filter(C=>!Number.isNaN(C.y));let p=ot;e.curve&&(l==="graph"||l==="flowchart")&&(p=e.curve);const{x:y,y:x}=rr(e),k=lt().x(y).y(x).curve(p);let g;switch(e.thickness){case"normal":g="edge-thickness-normal";break;case"thick":g="edge-thickness-thick";break;case"invisible":g="edge-thickness-thick";break;default:g=""}switch(e.pattern){case"solid":g+=" edge-pattern-solid";break;case"dotted":g+=" edge-pattern-dotted";break;case"dashed":g+=" edge-pattern-dashed";break}const u=a.append("path").attr("d",k(c)).attr("id",e.id).attr("class"," "+g+(e.classes?" "+e.classes:"")).attr("style",e.style);let v="";(w().flowchart.arrowMarkerAbsolute||w().state.arrowMarkerAbsolute)&&(v=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,v=v.replace(/\(/g,"\\("),v=v.replace(/\)/g,"\\)")),er(u,e,v,n,l);let B={};return o&&(B.updatedPath=i),B.originalPath=e.points,B};export{_t as E,M,P as R,er as a,or as c,xr as d,pr as f,fr as g,dr as h,m,hr as o,yr as p,rr as r,tr as t,gr as x,cr as y};
|