UNPKG

@undp/design-system-react

Version:

React based design system for UNDP

17 lines 45.2 kB
const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./utils-Dd9-5CFr.cjs");let n=require("react/jsx-runtime"),r=require("react-markdown");r=e.r(r,1);function i(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var a=p(/[A-Za-z]/),o=p(/[\dA-Za-z]/);function s(e){return e!==null&&(e<32||e===127)}function c(e){return e!==null&&e<-2}function l(e){return e!==null&&(e<0||e===32)}function u(e){return e===-2||e===-1||e===32}var d=p(/\p{P}|\p{S}/u),f=p(/\s/);function p(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function m(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}var h=(function(e){if(e==null)return v;if(typeof e==`function`)return _(e);if(typeof e==`object`)return Array.isArray(e)?ee(e):g(e);if(typeof e==`string`)return te(e);throw Error(`Expected function, string, or object as test`)});function ee(e){let t=[],n=-1;for(;++n<e.length;)t[n]=h(e[n]);return _(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function g(e){let t=e;return _(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function te(e){return _(t);function t(t){return t&&t.type===e}}function _(e){return t;function t(t,n,r){return!!(y(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function v(){return!0}function y(e){return typeof e==`object`&&!!e&&`type`in e}function b(e){return e}var x=[];function S(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=h(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+b(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=x,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=C(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function C(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?x:[e]}function w(e,t,n){let r=h((n||{}).ignore||[]),i=T(t),a=-1;for(;++a<i.length;)S(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function T(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([E(e[0]),ne(e[1])])}return t}function E(e){return typeof e==`string`?new RegExp(m(e),`g`):e}function ne(e){return typeof e==`function`?e:function(){return e}}var D=`phrasing`,O=[`autolink`,`link`,`image`,`label`];function re(){return{transforms:[ue],enter:{literalAutolink:ae,literalAutolinkEmail:k,literalAutolinkHttp:k,literalAutolinkWww:k},exit:{literalAutolink:le,literalAutolinkEmail:ce,literalAutolinkHttp:oe,literalAutolinkWww:se}}}function ie(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:D,notInConstruct:O},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:D,notInConstruct:O},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:D,notInConstruct:O}]}}function ae(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function k(e){this.config.enter.autolinkProtocol.call(this,e)}function oe(e){this.config.exit.autolinkProtocol.call(this,e)}function se(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function ce(e){this.config.exit.autolinkEmail.call(this,e)}function le(e){this.exit(e)}function ue(e){w(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,de],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,fe]],{ignore:[`link`,`linkReference`]})}function de(e,t,n,r,i){let a=``;if(!he(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!pe(n)))return!1;let o=me(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function fe(e,t,n,r){return!he(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function pe(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function me(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),a=i(e,`(`),o=i(e,`)`);for(;r!==-1&&a>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),o++;return[e,n]}function he(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||f(n)||d(n))&&(!t||n!==47)}function A(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}Te.peek=we;function ge(){this.buffer()}function _e(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function ve(){this.buffer()}function ye(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function be(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=A(this.sliceSerialize(e)).toLowerCase(),n.label=t}function xe(e){this.exit(e)}function Se(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=A(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ce(e){this.exit(e)}function we(){return`[`}function Te(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Ee(){return{enter:{gfmFootnoteCallString:ge,gfmFootnoteCall:_e,gfmFootnoteDefinitionLabelString:ve,gfmFootnoteDefinition:ye},exit:{gfmFootnoteCallString:be,gfmFootnoteCall:xe,gfmFootnoteDefinitionLabelString:Se,gfmFootnoteDefinition:Ce}}}function De(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Te},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?` `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?ke:Oe))),s(),o}}function Oe(e,t,n){return t===0?e:ke(e,t,n)}function ke(e,t,n){return(n?``:` `)+e}var Ae=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Fe.peek=Ie;function je(){return{canContainEols:[`delete`],enter:{strikethrough:Ne},exit:{strikethrough:Pe}}}function Me(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Ae}],handlers:{delete:Fe}}}function Ne(e){this.enter({type:`delete`,children:[]},e)}function Pe(e){this.exit(e)}function Fe(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function Ie(){return`~`}function Le(e){return e.length}function Re(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Le,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=ze(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=j(r[d]);else{let e=j(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(` `)}function ze(e){return e==null?``:String(e)}function j(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Be(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Ve);return i(),o}function Ve(e,t,n){return`>`+(n?``:` `)+e}function He(e,t){return Ue(e,t.inConstruct,!0)&&!Ue(e,t.notInConstruct,!1)}function Ue(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function We(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===` `&&He(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\ `}function Ge(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Ke(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function qe(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Je(e,t,n,r){let i=qe(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Ke(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Ye);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Ge(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:` `,encode:["`"],...s.current()})),t()}return u+=s.move(` `),a&&(u+=s.move(a+` `)),u+=s.move(c),l(),u}function Ye(e,t,n){return(n?``:` `)+e}function M(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Xe(e,t,n,r){let i=M(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:` `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Ze(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function N(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function P(e){if(e===null||l(e)||f(e))return 1;if(d(e))return 2}function F(e,t,n){let r=P(e),i=P(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Qe.peek=$e;function Qe(e,t,n,r){let i=Ze(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=F(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=N(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=F(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+N(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function $e(e,t,n){return n.options.emphasis||`*`}function et(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),S(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var tt={};function nt(e,t){let n=t||tt;return rt(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function rt(e,t,n){if(at(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return it(e.children,t,n)}return Array.isArray(e)?it(e,t,n):``}function it(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=rt(e[i],t,n);return r.join(``)}function at(e){return!!(e&&typeof e==`object`)}function ot(e,t){let n=!1;return et(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&nt(e)&&(t.options.setext||n))}function st(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(ot(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:` `,after:` `});return r(),t(),o+` `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(` `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:` `,...a.current()});return/^[\t ]/.test(l)&&(l=N(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}I.peek=ct;function I(e){return e.value||``}function ct(){return`<`}L.peek=lt;function L(e,t,n,r){let i=M(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function lt(){return`!`}R.peek=ut;function R(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function ut(){return`!`}z.peek=dt;function z(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function dt(){return"`"}function B(e,t){let n=nt(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}V.peek=ft;function V(e,t,n,r){let i=M(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(B(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function ft(e,t,n){return B(e,n)?`<`:`[`}H.peek=pt;function H(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function pt(){return`[`}function U(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function mt(e){let t=U(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function ht(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function gt(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function _t(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?ht(n):U(n),s=e.ordered?o===`.`?`)`:`.`:mt(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),gt(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function vt(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function yt(e,t,n,r){let i=vt(n),a=n.bulletCurrent||U(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function bt(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var xt=h([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function St(e,t,n,r){return(e.children.some(function(e){return xt(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Ct(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}wt.peek=Tt;function wt(e,t,n,r){let i=Ct(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=F(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=N(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=F(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+N(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Tt(e,t,n){return n.options.strong||`*`}function Et(e,t,n,r){return n.safe(e.value,r)}function Dt(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Ot(e,t,n){let r=(gt(n)+(n.options.ruleSpaces?` `:``)).repeat(Dt(n));return n.options.ruleSpaces?r.slice(0,-1):r}var kt={blockquote:Be,break:We,code:Je,definition:Xe,emphasis:Qe,hardBreak:We,heading:st,html:I,image:L,imageReference:R,inlineCode:z,link:V,linkReference:H,list:_t,listItem:yt,paragraph:bt,root:St,strong:wt,text:Et,thematicBreak:Ot};function At(){return{enter:{table:jt,tableData:Pt,tableHeader:Pt,tableRow:Nt},exit:{codeText:Ft,table:Mt,tableData:W,tableHeader:W,tableRow:W}}}function jt(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Mt(e){this.exit(e),this.data.inTable=void 0}function Nt(e){this.enter({type:`tableRow`,children:[]},e)}function W(e){this.exit(e)}function Pt(e){this.enter({type:`tableCell`,children:[]},e)}function Ft(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,It));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function It(e,t){return t===`|`?t:e}function Lt(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:` `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(` `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Re(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=kt.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Rt(){return{exit:{taskListCheckValueChecked:Bt,taskListCheckValueUnchecked:Bt,paragraph:Vt}}}function zt(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Ht}}}function Bt(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Vt(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Ht(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=kt.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Ut(){return[re(),Ee(),je(),At(),Rt()]}function Wt(e){return{extensions:[ie(),De(e),Me(),Lt(e),zt()]}}function G(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}var Gt={}.hasOwnProperty;function Kt(e){let t={},n=-1;for(;++n<e.length;)qt(t,e[n]);return t}function qt(e,t){let n;for(n in t){let r=(Gt.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Gt.call(r,a)||(r[a]=[]);let e=i[a];Jt(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Jt(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);G(e,0,0,r)}var Yt={tokenize:sn,partial:!0},Xt={tokenize:cn,partial:!0},Zt={tokenize:ln,partial:!0},Qt={tokenize:un,partial:!0},$t={tokenize:dn,partial:!0},en={name:`wwwAutolink`,tokenize:an,previous:fn},tn={name:`protocolAutolink`,tokenize:on,previous:pn},K={name:`emailAutolink`,tokenize:rn,previous:mn},q={};function nn(){return{text:q}}for(var J=48;J<123;)q[J]=K,J++,J===58?J=65:J===91&&(J=97);q[43]=K,q[45]=K,q[46]=K,q[95]=K,q[72]=[K,tn],q[104]=[K,tn],q[87]=[K,en],q[119]=[K,en];function rn(e,t,n){let r=this,i,s;return c;function c(t){return!Y(t)||!mn.call(r,r.previous)||X(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),l(t))}function l(t){return Y(t)?(e.consume(t),l):t===64?(e.consume(t),u):n(t)}function u(t){return t===46?e.check($t,f,d)(t):t===45||t===95||o(t)?(s=!0,e.consume(t),u):f(t)}function d(t){return e.consume(t),i=!0,u}function f(o){return s&&i&&a(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function an(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!fn.call(r,r.previous)||X(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Yt,e.attempt(Xt,e.attempt(Zt,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function on(e,t,n){let r=this,i=``,o=!1;return c;function c(t){return(t===72||t===104)&&pn.call(r,r.previous)&&!X(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),u):n(t)}function u(t){if(a(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),u;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),p}return n(t)}function p(t){return t===47?(e.consume(t),o?m:(o=!0,p)):n(t)}function m(t){return t===null||s(t)||l(t)||f(t)||d(t)?n(t):e.attempt(Xt,e.attempt(Zt,h),n)(t)}function h(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function sn(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function cn(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Qt,c,s)(t):t===null||l(t)||f(t)||t!==45&&d(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function ln(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Qt,t,a)(o):o===null||l(o)||f(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function un(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||l(a)||f(a)?t(a):n(a)}function i(e){return e===null||e===40||e===91||l(e)||f(e)?t(e):r(e)}function o(e){return a(e)?s(e):n(e)}function s(t){return t===59?(e.consume(t),r):a(t)?(e.consume(t),s):n(t)}}function dn(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return o(e)?n(e):t(e)}}function fn(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||l(e)}function pn(e){return!a(e)}function mn(e){return!(e===47||Y(e))}function Y(e){return e===43||e===45||e===46||e===95||o(e)}function X(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function hn(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}function Z(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return u(r)?(e.enter(n),s(r)):t(r)}function s(r){return u(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var gn={partial:!0,tokenize:_n};function _n(e,t,n){return r;function r(t){return u(t)?Z(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||c(e)?t(e):n(e)}}var vn={tokenize:En,partial:!0};function yn(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Cn,continuation:{tokenize:wn},exit:Tn}},text:{91:{name:`gfmFootnoteCall`,tokenize:Sn},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:bn,resolveTo:xn}}}}function bn(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=A(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function xn(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function Sn(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(s){if(a>999||s===93&&!o||s===null||s===91||l(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(A(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return l(s)||(o=!0),a++,e.consume(s),s===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),a++,u):u(t)}}function Cn(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),u}function u(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,d):n(t)}function d(t){if(o>999||t===93&&!s||t===null||t===91||l(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=A(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),p}return l(t)||(s=!0),o++,e.consume(t),t===92?f:d}function f(t){return t===91||t===92||t===93?(e.consume(t),o++,d):d(t)}function p(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Z(e,m,`gfmFootnoteDefinitionWhitespace`)):n(t)}function m(e){return t(e)}}function wn(e,t,n){return e.check(gn,t,e.attempt(vn,t,n))}function Tn(e){e.exit(`gfmFootnoteDefinition`)}function En(e,t,n){let r=this;return Z(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Dn(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&G(o,o.length,0,hn(s,e.slice(r+1,n),t)),G(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),G(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=P(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=P(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var On=class{constructor(){this.map=[]}add(e,t,n){kn(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function kn(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function An(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function jn(){return{flow:{null:{name:`table`,tokenize:Mn,resolveAll:Nn}}}}function Mn(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?C:d;return a===C&&r.parser.lazy[r.now().line]?n(e):a(e)}function d(t){return e.enter(`tableHead`),e.enter(`tableRow`),f(t)}function f(e){return e===124?p(e):(o=!0,a+=1,p(e))}function p(t){return t===null?n(t):c(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee):n(t):u(t)?Z(e,p,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,p):(e.enter(`data`),m(t)))}function m(t){return t===null||t===124||l(t)?(e.exit(`data`),p(t)):(e.consume(t),t===92?h:m)}function h(t){return t===92||t===124?(e.consume(t),m):m(t)}function ee(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,u(t)?Z(e,g,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):g(t))}function g(t){return t===45||t===58?_(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),te):S(t)}function te(t){return u(t)?Z(e,_,`whitespace`)(t):_(t)}function _(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),v):t===45?(a+=1,v(t)):t===null||c(t)?x(t):S(t)}function v(t){return t===45?(e.enter(`tableDelimiterFiller`),y(t)):S(t)}function y(t){return t===45?(e.consume(t),y):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),b):(e.exit(`tableDelimiterFiller`),b(t))}function b(t){return u(t)?Z(e,x,`whitespace`)(t):x(t)}function x(n){return n===124?g(n):n===null||c(n)?!o||i!==a?S(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):S(n)}function S(e){return n(e)}function C(t){return e.enter(`tableRow`),w(t)}function w(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),w):n===null||c(n)?(e.exit(`tableRow`),t(n)):u(n)?Z(e,w,`whitespace`)(n):(e.enter(`data`),T(n))}function T(t){return t===null||t===124||l(t)?(e.exit(`data`),w(t)):(e.consume(t),t===92?E:T)}function E(t){return t===92||t===124?(e.consume(t),T):T(t)}}function Nn(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new On;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(Pn(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=Q(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=Q(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=Q(f,t,o,i,n,d)):(o[0]=o[1],d=Q(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&Pn(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=An(t.events,n))}return e}function Q(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},$(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=$(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=$(t.events,n[2]),a=$(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},$(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Pn(e,t,n,r,i){let a=[],o=$(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function $(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Fn={name:`tasklistCheck`,tokenize:Ln};function In(){return{text:{91:Fn}}}function Ln(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return l(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return c(r)?t(r):u(r)?e.check({tokenize:Rn},t,n)(r):n(r)}}function Rn(e,t,n){return Z(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function zn(e){return Kt([nn(),yn(),Dn(e),jn(),In()])}var Bn={};function Vn(e){let t=this,n=e||Bn,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(zn(n)),a.push(Ut()),o.push(Wt(n))}function Hn({classNames:e,text:i,components:a}){return(0,n.jsx)(r.default,{remarkPlugins:[Vn],components:{h1:r=>(0,n.jsx)(`h1`,{className:t.t(`mt-0 mr-0 mb-3 ml-0 p-0 font-bold font-heading text-h1-xs uppercase tracking-[0.06rem] md:mb-4 md:text-h1-sm lg:text-h1`,e?.h1),...r}),h2:r=>(0,n.jsx)(`h2`,{className:t.t(`mt-0 mr-0 mb-3 ml-0 p-0 font-bold font-inherit text-h2-xs md:mb-4 md:text-h2-sm lg:text-h2`,e?.h2),...r}),h3:r=>(0,n.jsx)(`h3`,{className:t.t(`mt-0 mr-0 mb-3 ml-0 p-0 font-inherit font-semibold text-h3-xs md:mb-4 md:text-h3-sm lg:text-h3`,e?.h3),...r}),h4:r=>(0,n.jsx)(`h4`,{className:t.t(`mt-0 mr-0 mb-3 ml-0 p-0 font-inherit font-normal text-h4-xs md:mb-4 md:text-h4-sm lg:text-h4`,e?.h4),...r}),h5:r=>(0,n.jsx)(`h5`,{className:t.t(`mt-0 mr-0 mb-3 ml-0 p-0 font-inherit font-normal text-h5-xs md:mb-4 md:text-h5-sm lg:text-h5`,e?.h5),...r}),h6:r=>(0,n.jsx)(`h6`,{className:t.t(`mt-0 mr-0 mb-3 ml-0 p-0 font-bold font-inherit text-h6-xs uppercase tracking-[0.48px] md:mb-4 md:text-h6-sm lg:text-h6`,e?.h6),...r}),cite:r=>(0,n.jsx)(`cite`,{className:t.t(`mt-0 mr-0 mb-3 ml-0 block p-0 font-inherit font-normal text-h5-xs md:mb-4 md:text-h5-sm lg:text-h5`,e?.cite),...r}),code:r=>(0,n.jsx)(`code`,{className:t.t(`m-0 bg-surface px-1 pb-1 font-mono text-content-primary text-p-xs md:text-p-sm lg:text-p`,e?.code),...r}),blockquote:r=>(0,n.jsx)(`blockquote`,{className:t.t(`m-0 font-inherit font-semibold text-h4-xs md:text-h4-sm lg:text-h4`,e?.blockquote),...r}),p:r=>(0,n.jsx)(`p`,{className:t.t(`mt-0 mr-0 mb-5 ml-0 text-p-xs md:text-p-sm lg:text-p`,e?.p),...r}),a:r=>(0,n.jsx)(`a`,{className:t.t(`undp-link bg-double-primary font-inherit text-content-primary`,`cursor-pointer no-underline focus-visible:shadow-[0_0_0_var(--ring)] focus-visible:outline-hidden`,e?.a),...r}),ul:r=>(0,n.jsx)(`ul`,{className:t.t(`pl-6 rtl:pr-6 rtl:pl-0`,e?.ul),...r}),ol:r=>(0,n.jsx)(`ol`,{className:t.t(`pl-6 rtl:pr-6 rtl:pl-0`,e?.ol),...r}),li:r=>(0,n.jsx)(`li`,{className:t.t(`mb-6 pl-3 text-p-xs md:text-p-sm lg:text-p rtl:pr-3 rtl:pl-0`,e?.li),...r}),hr:r=>(0,n.jsx)(`hr`,{className:t.t(`mb-4 h-px w-full border-0 bg-surface-hard`,e?.hr),...r}),pre:r=>(0,n.jsx)(`pre`,{className:t.t(`mb-3 bg-surface p-4 md:mb-4`,e?.pre),...r}),table:r=>(0,n.jsx)(`table`,{className:t.t(`mb-4 w-full caption-bottom`,e?.table),...r}),thead:t=>(0,n.jsx)(`thead`,{className:e?.thead,...t}),th:r=>(0,n.jsx)(`th`,{className:t.t(`whitespace-nowrap bg-surface py-3 pr-10 pl-3 text-left align-middle font-semibold text-p-xs has-[[role=checkbox]]:pr-0 md:text-p-sm lg:text-p rtl:pr-3 rtl:pl-10 rtl:text-right *:[[role=checkbox]]:translate-y-0.5`,e?.th),...r}),tbody:t=>(0,n.jsx)(`tbody`,{className:e?.tbody,...t}),tr:r=>(0,n.jsx)(`tr`,{className:t.t(`border-stroke border-b`,e?.tr),...r}),td:r=>(0,n.jsx)(`td`,{className:t.t(`whitespace-nowrap py-3 pr-10 pl-3 align-middle text-p-xs has-[[role=checkbox]]:pr-0 md:text-p-sm lg:text-p rtl:pr-3 rtl:pl-10 *:[[role=checkbox]]:translate-y-0.5`,e?.td),...r}),...a||{}},children:i})}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Hn}}); //# sourceMappingURL=md-renderer-MLcC3XbM.cjs.map