@seriousgaming/sdk-tools 1.1.0 → 1.2.0

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.
@@ -189,16 +189,16 @@ Error generating stack: `+e.message+`
189
189
  `,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(`
190
190
  `))}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 FC(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=Pw.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Zw(){return{exit:{taskListCheckValueChecked:$w,taskListCheckValueUnchecked:$w,paragraph:eT}}}function Qw(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:tT}}}function $w(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function eT(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 tT(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=Pw.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 nT(){return[ZS(),SC(),DC(),Hw(),Zw()]}function rT(e){return{extensions:[QS(),CC(e),OC(),Xw(e),Qw()]}}function iT(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}function aT(e,t){return e.length>0?(iT(e,e.length,0,t),e):t}var oT={}.hasOwnProperty;function sT(e){let t={},n=-1;for(;++n<e.length;)cT(t,e[n]);return t}function cT(e,t){let n;for(n in t){let r=(oT.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){oT.call(r,a)||(r[a]=[]);let e=i[a];lT(r[a],Array.isArray(e)?e:e?[e]:[])}}}function lT(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);iT(e,0,0,r)}var uT={tokenize:wT,partial:!0},dT={tokenize:TT,partial:!0},fT={tokenize:ET,partial:!0},pT={tokenize:DT,partial:!0},mT={tokenize:OT,partial:!0},hT={name:`wwwAutolink`,tokenize:ST,previous:kT},gT={name:`protocolAutolink`,tokenize:CT,previous:AT},_T={name:`emailAutolink`,tokenize:xT,previous:jT},vT={};function yT(){return{text:vT}}for(var bT=48;bT<123;)vT[bT]=_T,bT++,bT===58?bT=65:bT===91&&(bT=97);vT[43]=_T,vT[45]=_T,vT[46]=_T,vT[95]=_T,vT[72]=[_T,gT],vT[104]=[_T,gT],vT[87]=[_T,hT],vT[119]=[_T,hT];function xT(e,t,n){let r=this,i,a;return o;function o(t){return!MT(t)||!jT.call(r,r.previous)||NT(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return MT(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(mT,u,l)(t):t===45||t===95||tx(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&ex(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function ST(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!kT.call(r,r.previous)||NT(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(uT,e.attempt(dT,e.attempt(fT,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function CT(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&AT.call(r,r.previous)&&!NT(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(ex(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||rx(t)||sx(t)||ux(t)||lx(t)?n(t):e.attempt(dT,e.attempt(fT,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function wT(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 TT(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(pT,c,s)(t):t===null||sx(t)||ux(t)||t!==45&&lx(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 ET(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(pT,t,a)(o):o===null||sx(o)||ux(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function DT(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||sx(o)||ux(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||sx(e)||ux(e)?t(e):r(e)}function a(e){return ex(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):ex(t)?(e.consume(t),o):n(t)}}function OT(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return tx(e)?n(e):t(e)}}function kT(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||sx(e)}function AT(e){return!ex(e)}function jT(e){return!(e===47||MT(e))}function MT(e){return e===43||e===45||e===46||e===95||tx(e)}function NT(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 PT(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&tx(e.charCodeAt(n+1))&&tx(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function FT(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}var IT={name:`attention`,resolveAll:LT,tokenize:RT};function LT(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};zT(o,-a),zT(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=aT(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=aT(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=aT(r,FT(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=aT(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=aT(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),iT(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function RT(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Vw(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Vw(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function zT(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var BT={name:`autolink`,tokenize:VT};function VT(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return ex(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||tx(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||tx(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||rx(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):nx(t)?(e.consume(t),l):n(t)}function u(e){return tx(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||tx(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var HT={partial:!0,tokenize:UT};function UT(e,t,n){return r;function r(t){return cx(t)?hS(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Q(e)?t(e):n(e)}}var WT={continuation:{tokenize:KT},exit:qT,name:`blockQuote`,tokenize:GT};function GT(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return cx(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function KT(e,t,n){let r=this;return i;function i(t){return cx(t)?hS(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(WT,t,n)(r)}}function qT(e){e.exit(`blockQuote`)}var JT={name:`characterEscape`,tokenize:YT};function YT(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return ox(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var XT={name:`characterReference`,tokenize:ZT};function ZT(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=tx,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=ax,u):(e.enter(`characterReferenceValue`),a=7,o=ix,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===tx&&!yx(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var QT={partial:!0,tokenize:$T};function $T(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var eE={concrete:!0,name:`codeFenced`,tokenize:tE};function tE(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),cx(t)?hS(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Q(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(QT,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):cx(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),hS(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Q(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&cx(t)?hS(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Q(t)?e.check(QT,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Q(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),cx(t)?hS(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),cx(t)?hS(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Q(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var nE={name:`codeIndented`,tokenize:iE},rE={partial:!0,tokenize:aE};function iE(e,t,n){return r;function r(t){return e.enter(`codeIndented`),gS(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):Q(t)?e.attempt(rE,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||Q(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function aE(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Q(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):gS(e,t,a,`linePrefix`,4,4)(o)}function a(e){return Q(e)?i(e):n(e)}}var oE={name:`codeText`,previous:cE,resolve:sE,tokenize:lE};function sE(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function cE(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function lE(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Q(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var uE=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&dE(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),dE(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),dE(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);dE(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);dE(this.left,t.reverse())}}}};function dE(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function fE(e){let t={},n=-1,r,i,a,o,s,c,l,u=new uE(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,pE(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return iT(e,0,1/0,u.slice(0)),!l}function pE(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var mE={resolve:gE,tokenize:_E},hE={partial:!0,tokenize:vE};function gE(e){return fE(e),e}function _E(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Q(t)?e.check(hE,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function vE(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),hS(e,a,`linePrefix`)}function a(i){if(i===null||Q(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function yE(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||rx(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Q(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||sx(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||rx(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function bE(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Q(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Q(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!cx(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function xE(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),hS(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Q(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}var SE={name:`definition`,tokenize:wE},CE={partial:!0,tokenize:TE};function wE(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return bE.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=dC(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return sx(t)?_S(e,l)(t):l(t)}function l(t){return yE(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(CE,d,d)(t)}function d(t){return cx(t)?hS(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Q(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function TE(e,t,n){return r;function r(t){return sx(t)?_S(e,i)(t):n(t)}function i(t){return xE(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return cx(t)?hS(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Q(e)?t(e):n(e)}}var EE={name:`hardBreakEscape`,tokenize:DE};function DE(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Q(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var OE={name:`headingAtx`,resolve:kE,tokenize:AE};function kE(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};iT(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function AE(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||sx(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Q(n)?(e.exit(`atxHeading`),t(n)):cx(n)?hS(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||sx(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var jE={concrete:!0,name:`htmlFlow`,resolveTo:NE,tokenize:PE},ME={partial:!0,tokenize:FE};function NE(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function PE(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:ee):ex(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):ex(a)?(e.consume(a),i=4,r.interrupt?t:ee):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:ee):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return ex(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||sx(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Iw.includes(l)?(i=1,r.interrupt?t(s):O(s)):Fw.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||tx(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return cx(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||ex(t)?(e.consume(t),b):cx(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||tx(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):cx(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):cx(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Q(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||sx(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||cx(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Q(t)?O(t):cx(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),te):t===63&&i===3?(e.consume(t),ee):t===93&&i===5?(e.consume(t),F):Q(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(ME,I,k)(t)):t===null||Q(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(QT,A,I)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||Q(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),ee):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return Iw.includes(n)?(e.consume(t),te):O(t)}return ex(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),ee):O(t)}function ee(t){return t===62?(e.consume(t),te):t===45&&i===2?(e.consume(t),ee):O(t)}function te(t){return t===null||Q(t)?(e.exit(`htmlFlowData`),I(t)):(e.consume(t),te)}function I(n){return e.exit(`htmlFlow`),t(n)}}function FE(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(HT,t,n)}}var IE={name:`htmlText`,tokenize:LE};function LE(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):ex(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):ex(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Q(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Q(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):Q(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Q(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return ex(t)?(e.consume(t),S):n(t)}function S(t){return t===45||tx(t)?(e.consume(t),S):C(t)}function C(t){return Q(t)?(o=C,N(t)):cx(t)?(e.consume(t),C):M(t)}function w(t){return t===45||tx(t)?(e.consume(t),w):t===47||t===62||sx(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||ex(t)?(e.consume(t),E):Q(t)?(o=T,N(t)):cx(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||tx(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Q(t)?(o=D,N(t)):cx(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Q(t)?(o=O,N(t)):cx(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):Q(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||sx(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||sx(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return cx(t)?hS(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var RE={name:`labelEnd`,resolveAll:HE,resolveTo:UE,tokenize:WE},zE={tokenize:GE},BE={tokenize:KE},VE={tokenize:qE};function HE(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&iT(e,0,e.length,n),e}function UE(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=aT(o,e.slice(i+1,i+r+3)),o=aT(o,[[`enter`,l,t]]),o=aT(o,FT(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=aT(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=aT(o,e.slice(a+1)),o=aT(o,[[`exit`,s,t]]),iT(e,i,e.length,o),e}function WE(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(dC(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(zE,u,o?u:d)(t):t===91?e.attempt(BE,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(VE,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function GE(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return sx(t)?_S(e,a)(t):a(t)}function a(t){return t===41?u(t):yE(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return sx(t)?_S(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?xE(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return sx(t)?_S(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function KE(e,t,n){let r=this;return i;function i(t){return bE.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(dC(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function qE(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var JE={name:`labelStartImage`,resolveAll:RE.resolveAll,tokenize:YE};function YE(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var XE={name:`labelStartLink`,resolveAll:RE.resolveAll,tokenize:ZE};function ZE(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var QE={name:`lineEnding`,tokenize:$E};function $E(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),hS(e,t,`linePrefix`)}}var eD={name:`thematicBreak`,tokenize:tD};function tD(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Q(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),cx(t)?hS(e,s,`whitespace`)(t):s(t))}}var nD={continuation:{tokenize:oD},exit:cD,name:`list`,tokenize:aD},rD={partial:!0,tokenize:lD},iD={partial:!0,tokenize:sD};function aD(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:ix(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(eD,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return ix(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(HT,r.interrupt?n:u,e.attempt(rD,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return cx(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function oD(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(HT,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,hS(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!cx(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(iD,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,hS(e,e.attempt(nD,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function sD(e,t,n){let r=this;return hS(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function cD(e){e.exit(this.containerState.type)}function lD(e,t,n){let r=this;return hS(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!cx(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var uD=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){dD(this,e,t,n,!1)}addBefore(e,t,n){dD(this,e,t,n,!0)}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,this.index.clear()}};function dD(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var fD={name:`setextUnderline`,resolveTo:pD,tokenize:mD};function pD(e,t){let n=new uD,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function mD(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),cx(t)?hS(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Q(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var hD={tokenize:CD,partial:!0};function gD(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:bD,continuation:{tokenize:xD},exit:SD}},text:{91:{name:`gfmFootnoteCall`,tokenize:yD},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:_D,resolveTo:vD}}}}function _D(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=dC(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 vD(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 yD(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`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||sx(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(dC(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return sx(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function bD(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`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||sx(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=dC(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return sx(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),hS(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function xD(e,t,n){return e.check(HT,t,e.attempt(hD,t,n))}function SD(e){e.exit(`gfmFootnoteDefinition`)}function CD(e,t,n){let r=this;return hS(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 wD(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&&iT(o,o.length,0,FT(s,e.slice(r+1,n),t)),iT(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),iT(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=Vw(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=Vw(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var TD=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){ED(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,this.index.clear()}};function ED(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function DD(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 OD(){return{flow:{null:{name:`table`,tokenize:kD,resolveAll:AD}}}}function kD(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{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):Q(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):cx(t)?hS(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||sx(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,cx(t)?hS(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return cx(t)?hS(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Q(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return cx(t)?hS(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Q(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Q(n)?(e.exit(`tableRow`),t(n)):cx(n)?hS(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||sx(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function AD(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 TD;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(MD(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=jD(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=jD(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=jD(f,t,o,i,n,d)):(o[0]=o[1],d=jD(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&MD(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=DD(t.events,n))}return e}function jD(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},ND(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=ND(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=ND(t.events,n[2]),a=ND(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({},ND(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function MD(e,t,n,r,i){let a=[],o=ND(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 ND(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var PD={name:`tasklistCheck`,tokenize:ID};function FD(){return{text:{91:PD}}}function ID(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 sx(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 Q(r)?t(r):cx(r)?e.check({tokenize:LD},t,n)(r):n(r)}}function LD(e,t,n){return hS(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function RD(e){return sT([yT(),gD(),wD(e),OD(),FD()])}var zD={};function BD(e){let t=this,n=e||zD,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(RD(n)),a.push(nT()),o.push(rT(n))}var VD={tokenize:HD};function HD(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),hS(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return Q(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var UD={tokenize:GD},WD={tokenize:KD};function GD(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new uD;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(WD,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(WD,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return Q(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new uD;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function KD(e,t,n){return hS(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var qD={tokenize:JD};function JD(e){let t=this,n=e.attempt(HT,r,e.attempt(this.parser.constructs.flowInitial,i,hS(e,e.attempt(this.parser.constructs.flow,i,e.attempt(mE,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var YD={resolveAll:$D()},XD=QD(`string`),ZD=QD(`text`);function QD(e){return{resolveAll:$D(e===`text`?eO:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function $D(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function eO(e,t){let n=new uD,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var tO=s({attentionMarkers:()=>lO,contentInitial:()=>rO,disable:()=>uO,document:()=>nO,flow:()=>aO,flowInitial:()=>iO,insideSpan:()=>cO,string:()=>oO,text:()=>sO}),nO={42:nD,43:nD,45:nD,48:nD,49:nD,50:nD,51:nD,52:nD,53:nD,54:nD,55:nD,56:nD,57:nD,62:WT},rO={91:SE},iO={[-2]:nE,[-1]:nE,32:nE},aO={35:OE,42:eD,45:[fD,eD],60:jE,61:fD,95:eD,96:eE,126:eE},oO={38:XT,92:JT},sO={[-5]:QE,[-4]:QE,[-3]:QE,33:JE,38:XT,42:IT,60:[BT,IE],91:XE,92:[EE,JT],93:RE,95:IT,96:oE},cO={null:[IT,YD]},lO={null:[42,95]},uO={null:[]};function dO(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=aT(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=FT(a,l.events,l),l.events):[]}function f(e,t){return pO(p(e),t)}function p(e){return fO(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){Q(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&iT(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function fO(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function pO(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
191
191
  `;break;case-3:o=`\r
192
- `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function mO(e){let t={constructs:sT([tO,...(e||{}).extensions||[]]),content:n(VD),defined:[],document:n(UD),flow:n(qD),lazy:{},string:n(XD),text:n(ZD)};return t;function n(e){return n;function n(n){return dO(t,e,n)}}}function hO(e){for(;!fE(e););return e}var gO=/[\0\t\n\r]/g;function _O(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){gO.lastIndex=c;let n=gO.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}function vO(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?bO(e.position):`start`in e||`end`in e?bO(e):`line`in e||`column`in e?yO(e):``}function yO(e){return xO(e&&e.line)+`:`+xO(e&&e.column)}function bO(e){return yO(e&&e.start)+`-`+yO(e&&e.end)}function xO(e){return e&&typeof e==`number`?e:1}var SO={}.hasOwnProperty;function CO(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),wO(n)(hO(mO(n).document().write(_O()(e,t,!0))))}function wO(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(ge),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(pe),blockQuote:o(ue),characterEscape:E,characterReference:E,codeFenced:o(de),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(de,s),codeText:o(L,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(R),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(fe),hardBreakEscape:o(me),hardBreakTrailing:o(me),htmlFlow:o(he,s),htmlFlowData:E,htmlText:o(he,s),htmlTextData:E,image:o(z),label:s,link:o(ge),listItem:o(ve),listItemValue:p,listOrdered:o(_e,f),listUnordered:o(_e),paragraph:o(ye),reference:re,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(pe),strong:o(be),thematicBreak:o(Se)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:le,autolinkProtocol:ce,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:oe,characterReference:se,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(M),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(A),htmlFlowData:D,htmlText:l(j),htmlTextData:D,image:l(P),label:ee,labelText:F,lineEnding:O,link:l(N),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ie,resourceDestinationString:te,resourceTitleString:I,resource:ne,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};EO(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),SO.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||OO).call(o,void 0,e[0])}for(r.position={start:TO(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:TO(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let n=r;for(s=void 0;n--;){let t=e[n];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=n}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:TO(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+vO({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||OO).call(this,e,r[0])),n.position.end=TO(e.end)}function d(){return Yb(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=dC(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=xe(),n.position={start:TO(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=TO(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=TO(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function F(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=zw(t),n.identifier=dC(t).toLowerCase()}function ee(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ne(){this.data.inReference=void 0}function re(){this.data.referenceType=`collapsed`}function ie(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=dC(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ae(e){this.data.characterReferenceType=e.type}function oe(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Lw(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=yx(t);let i=this.stack[this.stack.length-1];i.value+=r}function se(e){let t=this.stack.pop();t.position.end=TO(e.end)}function ce(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function le(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ue(){return{type:`blockquote`,children:[],position:void 0}}function de(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function L(){return{type:`inlineCode`,value:``,position:void 0}}function R(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function fe(){return{type:`emphasis`,children:[],position:void 0}}function pe(){return{type:`heading`,depth:0,children:[],position:void 0}}function me(){return{type:`break`,position:void 0}}function he(){return{type:`html`,value:``,position:void 0}}function z(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function ge(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function _e(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function ve(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function ye(){return{type:`paragraph`,children:[],position:void 0}}function be(){return{type:`strong`,children:[],position:void 0}}function xe(){return{type:`text`,value:``,position:void 0}}function Se(){return{type:`thematicBreak`,position:void 0}}}function TO(e){return{line:e.line,column:e.column,offset:e.offset}}function EO(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?EO(e,r):DO(e,r)}}function DO(e,t){let n;for(n in t)if(SO.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`afterExit`:case`beforeEnter`:{let r=t[n];r&&e[n].push(r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function OO(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+vO({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+vO({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+vO({start:t.start,end:t.end})+`) is still open`)}function kO(e){let t=this;t.parser=n;function n(n){return CO(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function AO(e){if(e)throw e}var jO=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function MO(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function NO(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?PO(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function PO(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var FO=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=vO(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};FO.prototype.file=``,FO.prototype.name=``,FO.prototype.reason=``,FO.prototype.message=``,FO.prototype.stack=``,FO.prototype.column=void 0,FO.prototype.line=void 0,FO.prototype.ancestors=void 0,FO.prototype.cause=void 0,FO.prototype.fatal=void 0,FO.prototype.place=void 0,FO.prototype.ruleId=void 0,FO.prototype.source=void 0;var IO={basename:LO,dirname:RO,extname:zO,join:BO,sep:`/`};function LO(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);UO(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function RO(e){if(UO(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function zO(e){UO(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function BO(...e){let t=-1,n;for(;++t<e.length;)UO(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:VO(n)}function VO(e){UO(e);let t=e.codePointAt(0)===47,n=HO(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function HO(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function UO(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var WO={cwd:GO};function GO(){return`/`}function KO(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function qO(e){if(typeof e==`string`)e=new URL(e);else if(!KO(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return JO(e)}function JO(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var YO=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],XO=class{constructor(e){let t;t=e?KO(e)?{path:e}:typeof e==`string`||ek(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:WO.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<YO.length;){let e=YO[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)YO.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?IO.basename(this.path):void 0}set basename(e){QO(e,`basename`),ZO(e,`basename`),this.path=IO.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?IO.dirname(this.path):void 0}set dirname(e){$O(this.basename,`dirname`),this.path=IO.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?IO.extname(this.path):void 0}set extname(e){if(ZO(e,`extname`),$O(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=IO.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){KO(e)&&(e=qO(e)),QO(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?IO.basename(this.path,this.extname):void 0}set stem(e){QO(e,`stem`),ZO(e,`stem`),this.path=IO.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new FO(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function ZO(e,t){if(e&&e.includes(IO.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+IO.sep+"`")}function QO(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function $O(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function ek(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var tk=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),nk=l(jO(),1),rk={}.hasOwnProperty,ik=new class e extends tk{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=NO()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,nk.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(sk(`data`,this.frozen),this.namespace[e]=t,this):rk.call(this.namespace,e)&&this.namespace[e]||void 0:e?(sk(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=uk(e),n=this.parser||this.Parser;return ak(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),ak(`process`,this.parser||this.Parser),ok(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=uk(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);fk(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),ak(`processSync`,this.parser||this.Parser),ok(`processSync`,this.compiler||this.Compiler),this.process(e,r),lk(`processSync`,`process`,t),n;function r(e,r){t=!0,AO(e),n=r}}run(e,t,n){ck(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=uk(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),lk(`runSync`,`run`,n),r;function i(e,t){AO(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=uk(t),r=this.compiler||this.Compiler;return ok(`stringify`,r),ck(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(sk(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,nk.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];MO(o)&&MO(r)&&(r=(0,nk.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function ak(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function ok(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function sk(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ck(e){if(!MO(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function lk(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function uk(e){return dk(e)?e:new XO(e)}function dk(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function fk(e){return typeof e==`string`||pk(e)}function pk(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var mk=[`note`,`warning`,`tip`,`say`,`do`,`timing`];function hk(e){return mk.includes(e)}function gk(){return e=>{nw(e,(e,t,n)=>{if(e.type!==`containerDirective`&&e.type!==`leafDirective`&&e.type!==`textDirective`)return;let r=e;if(r.type===`containerDirective`)r.data={...r.data,hName:`div`,hProperties:hk(r.name)?{dataAdmonition:r.name}:{dataAdmonitionUnknown:r.name}};else if(n&&typeof t==`number`){let e={type:`text`,value:`:${r.name}`},i=r.type===`leafDirective`?{type:`paragraph`,children:[e]}:e;return n.children.splice(t,1,i),[Ux,t]}})}}function _k(){return e=>{nw(e,`html`,(e,t,n)=>{if(n&&typeof t==`number`){let r={type:`text`,value:e.value},i=n.type===`root`?{type:`paragraph`,children:[r]}:r;return n.children.splice(t,1,i),[Ux,t]}})}}function vk(e,t){let[n,...r]=t.split(`.`);if(!n||r.length===0||!(n in e))return{found:!1};let i=e[n];for(let e of r){if(typeof i!=`object`||!i||Array.isArray(i)||!Object.prototype.hasOwnProperty.call(i,e))return{found:!1};i=i[e]}return{found:!0,value:i}}function yk(e,t){if(typeof e==`number`)try{return new Intl.NumberFormat(t).format(e)}catch{return new Intl.NumberFormat(`en`).format(e)}return typeof e==`string`?e:null}function bk(e,t){let n=t.setting;if(!n)return{error:`:::when names no setting`};let r=vk(e,n);if(!r.found)return{error:`:::when names "${n}", which this guide is not given`};let{value:i}=r,a=t.not!==void 0&&t.not!==null,o;if(t.is===void 0||t.is===null){if(typeof i!=`boolean`)return{error:`:::when on "${n}" needs is="…", since it is not true or false`};o=i}else if(typeof i==`number`)o=t.is.trim()!==``&&Number(t.is)===i;else if(typeof i==`string`||typeof i==`boolean`)o=String(i)===t.is;else return{error:`:::when on "${n}" compares a value that is not a single value`};return{show:a?!o:o}}function xk(e){return{type:`emphasis`,data:{hName:`span`,hProperties:{dataGuideError:e}},children:[{type:`text`,value:e}]}}function Sk(e){return{type:`paragraph`,data:{hName:`div`,hProperties:{dataGuideError:e}},children:[{type:`text`,value:e}]}}function Ck(e){return t=>{nw(t,(t,n,r)=>{if(!r||typeof n!=`number`)return;let i=t;if(i.type===`containerDirective`&&i.name===`when`){let t=bk(e.settings,i.attributes??{}),a=`error`in t?[Sk(t.error)]:t.show?i.children:[];return r.children.splice(n,1,...a),[Ux,n]}if(i.type===`textDirective`&&i.name===`setting`){let t=wk(i),a=vk(e.settings,t),o=a.found?yk(a.value,e.locale):null,s=o===null?xk(a.found?`:setting[${t}] is not a number or text`:`:setting[${t}] is not given to this guide`):{type:`text`,value:o};return r.children.splice(n,1,s),[Ux,n+1]}})}}function wk(e){return e.children.map(e=>`value`in e&&typeof e.value==`string`?e.value:``).join(``).trim()}var Tk=/\s*\{-\}\s*$/;function Ek(e){return e.replace(/\.md$/,``)}function Dk(e,t){let n=new Kb,r=Ek(t),i=[];return nw(e,`heading`,e=>{let t=Yb(e),a=Tk.test(t),o=t.replace(Tk,``);i.push({node:e,id:`${r}--${n.slug(o)}`,text:o,omitted:a})}),i}function Ok(e){let t=e.children[e.children.length-1];t?.type===`text`&&Tk.test(t.value)&&(t.value=t.value.replace(Tk,``))}function kk(e){return t=>{for(let n of Dk(t,e.chapterFile))Ok(n.node),n.node.data={...n.node.data,hProperties:{...n.node.data?.hProperties,id:n.id}}}}function Ak(e,t,n){let r=n?.minDepth??2,i=n?.maxDepth??3,a=ik().use(kO).use(BD).use(US).parse(t);return Ck({settings:n?.settings??{},locale:n?.locale??`en`})(a),gk()(a),Dk(a,e).filter(e=>!e.omitted).filter(e=>e.node.depth===1||e.node.depth>=r&&e.node.depth<=i).map(e=>({id:e.id,text:e.text,depth:e.node.depth}))}var jk={youtube:{idPattern:/^[A-Za-z0-9_-]{11}$/,embedUrl:e=>`https://www.youtube-nocookie.com/embed/${e}`,embedHosts:[`www.youtube-nocookie.com`]}},Mk=new Set([`provider`,`id`]);function Nk(e){let t={};for(let n of e.split(`
193
- `)){let e=n.trim();if(e.length===0)continue;let r=e.match(/^([A-Za-z][A-Za-z0-9_-]*):\s*(.*)$/);if(!r)return{ok:!1,error:`Malformed line in video block: "${e}"`};let i=r[1],a=r[2].trim();if(!Mk.has(i))return{ok:!1,error:`Unknown key "${i}" in video block`};if(i in t)return{ok:!1,error:`Duplicate key "${i}" in video block`};t[i]=a}let n=t.provider;if(!n)return{ok:!1,error:`Video block is missing "provider"`};let r=jk[n];if(!r)return{ok:!1,error:`Unknown video provider "${n}". Supported providers: ${Object.keys(jk).join(`, `)}`};let i=t.id;return i?r.idPattern.test(i)?{ok:!0,provider:n,id:i,embedUrl:r.embedUrl(i)}:{ok:!1,error:`Video id "${i}" is not a valid ${n} id`}:{ok:!1,error:`Video block is missing "id"`}}var Pk=Sl((0,V.jsx)(`path`,{d:`M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8`}),`InfoOutlined`),Fk=Sl((0,V.jsx)(`path`,{d:`M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7m2.85 11.1-.85.6V16h-4v-2.3l-.85-.6C7.8 12.16 7 10.63 7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.63-.8 3.16-2.15 4.1`}),`LightbulbOutlined`),Ik=Sl([(0,V.jsx)(`circle`,{cx:`9`,cy:`9`,r:`4`},`0`),(0,V.jsx)(`path`,{d:`M9 15c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4m7.76-9.64-1.68 1.69c.84 1.18.84 2.71 0 3.89l1.68 1.69c2.02-2.02 2.02-5.07 0-7.27M20.07 2l-1.63 1.63c2.77 3.02 2.77 7.56 0 10.74L20.07 16c3.9-3.89 3.91-9.95 0-14`},`1`)],`RecordVoiceOver`),Lk=Sl((0,V.jsx)(`path`,{d:`M22 5.18 10.59 16.6l-4.24-4.24 1.41-1.41 2.83 2.83 10-10zm-2.21 5.04c.13.57.21 1.17.21 1.78 0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8c1.58 0 3.04.46 4.28 1.25l1.44-1.44C16.1 2.67 14.13 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.19-.22-2.33-.6-3.39z`}),`TaskAlt`),Rk=Sl((0,V.jsx)(`path`,{d:`M15 1H9v2h6zm-4 13h2V8h-2zm8.03-6.61 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61M12 20c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7`}),`TimerOutlined`),zk=Sl([(0,V.jsx)(`path`,{d:`M12 5.99 19.53 19H4.47zM12 2 1 21h22z`},`0`),(0,V.jsx)(`path`,{d:`M13 16h-2v2h2zm0-6h-2v5h2z`},`1`)],`WarningAmber`);function Bk(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Vk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Hk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Uk={};function Wk(e,t){return((t||Uk).jsx?Hk:Vk).test(e)}var Gk=/[ \t\n\f\r]/g;function Kk(e){return typeof e==`object`?e.type===`text`&&qk(e.value):qk(e)}function qk(e){return e.replace(Gk,``)===``}var Jk=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Jk.prototype.normal={},Jk.prototype.property={},Jk.prototype.space=void 0;function Yk(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Jk(n,r,t)}function Xk(e){return e.toLowerCase()}var Zk=class{constructor(e,t){this.attribute=t,this.property=e}};Zk.prototype.attribute=``,Zk.prototype.booleanish=!1,Zk.prototype.boolean=!1,Zk.prototype.commaOrSpaceSeparated=!1,Zk.prototype.commaSeparated=!1,Zk.prototype.defined=!1,Zk.prototype.mustUseProperty=!1,Zk.prototype.number=!1,Zk.prototype.overloadedBoolean=!1,Zk.prototype.property=``,Zk.prototype.spaceSeparated=!1,Zk.prototype.space=void 0;var Qk=s({boolean:()=>eA,booleanish:()=>tA,commaOrSpaceSeparated:()=>aA,commaSeparated:()=>iA,number:()=>$,overloadedBoolean:()=>nA,spaceSeparated:()=>rA}),$k=0,eA=oA(),tA=oA(),nA=oA(),$=oA(),rA=oA(),iA=oA(),aA=oA();function oA(){return 2**++$k}var sA=Object.keys(Qk),cA=class extends Zk{constructor(e,t,n,r){let i=-1;if(super(e,t),lA(this,`space`,r),typeof n==`number`)for(;++i<sA.length;){let e=sA[i];lA(this,sA[i],(n&Qk[e])===Qk[e])}}};cA.prototype.defined=!0;function lA(e,t,n){n&&(e[t]=n)}function uA(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new cA(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Xk(r)]=r,n[Xk(a.attribute)]=r}return new Jk(t,n,e.space)}var dA=uA({properties:{ariaActiveDescendant:null,ariaAtomic:tA,ariaAutoComplete:null,ariaBusy:tA,ariaChecked:tA,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:rA,ariaCurrent:null,ariaDescribedBy:rA,ariaDetails:null,ariaDisabled:tA,ariaDropEffect:rA,ariaErrorMessage:null,ariaExpanded:tA,ariaFlowTo:rA,ariaGrabbed:tA,ariaHasPopup:null,ariaHidden:tA,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:rA,ariaLevel:$,ariaLive:null,ariaModal:tA,ariaMultiLine:tA,ariaMultiSelectable:tA,ariaOrientation:null,ariaOwns:rA,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:tA,ariaReadOnly:tA,ariaRelevant:null,ariaRequired:tA,ariaRoleDescription:rA,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:tA,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function fA(e,t){return t in e?e[t]:t}function pA(e,t){return fA(e,t.toLowerCase())}var mA=uA({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:iA,acceptCharset:rA,accessKey:rA,action:null,allow:null,allowFullScreen:eA,allowPaymentRequest:eA,allowUserMedia:eA,alpha:eA,alt:null,as:null,async:eA,autoCapitalize:null,autoComplete:rA,autoFocus:eA,autoPlay:eA,blocking:rA,capture:null,charSet:null,checked:eA,cite:null,className:rA,closedBy:null,colorSpace:null,cols:$,colSpan:$,command:null,commandFor:null,content:null,contentEditable:tA,controls:eA,controlsList:rA,coords:$|iA,crossOrigin:null,data:null,dateTime:null,decoding:null,default:eA,defer:eA,dir:null,dirName:null,disabled:eA,download:nA,draggable:tA,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:eA,formTarget:null,headers:rA,height:$,hidden:nA,high:$,href:null,hrefLang:null,htmlFor:rA,httpEquiv:rA,id:null,imageSizes:null,imageSrcSet:null,inert:eA,inputMode:null,integrity:null,is:null,isMap:eA,itemId:null,itemProp:rA,itemRef:rA,itemScope:eA,itemType:rA,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:eA,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:eA,muted:eA,name:null,nonce:null,noModule:eA,noValidate:eA,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:eA,optimum:$,pattern:null,ping:rA,placeholder:null,playsInline:eA,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:eA,referrerPolicy:null,rel:rA,required:eA,reversed:eA,rows:$,rowSpan:$,sandbox:rA,scope:null,scoped:eA,seamless:eA,selected:eA,shadowRootClonable:eA,shadowRootCustomElementRegistry:eA,shadowRootDelegatesFocus:eA,shadowRootMode:null,shadowRootSerializable:eA,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:tA,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:eA,useMap:null,value:tA,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:rA,axis:null,background:null,bgColor:null,border:$,borderColor:null,bottomMargin:$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:eA,declare:eA,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:eA,noHref:eA,noShade:eA,noWrap:eA,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:tA,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:eA,disablePictureInPicture:eA,disableRemotePlayback:eA,exportParts:iA,part:rA,prefix:null,property:null,results:$,security:null,unselectable:null},space:`html`,transform:pA}),hA=uA({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:aA,accentHeight:$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$,amplitude:$,arabicForm:null,ascent:$,attributeName:null,attributeType:null,azimuth:$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$,by:null,calcMode:null,capHeight:$,className:rA,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:$,diffuseConstant:$,direction:null,display:null,dur:null,divisor:$,dominantBaseline:null,download:eA,dx:null,dy:null,edgeMode:null,editable:null,elevation:$,enableBackground:null,end:null,event:null,exponent:$,externalResourcesRequired:null,fill:null,fillOpacity:$,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:iA,g2:iA,glyphName:iA,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$,horizOriginX:$,horizOriginY:$,id:null,ideographic:$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$,k:$,k1:$,k2:$,k3:$,k4:$,kernelMatrix:aA,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:$,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:$,overlineThickness:$,paintOrder:null,panose1:null,path:null,pathLength:$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:rA,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:aA,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:aA,rev:aA,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:aA,requiredFeatures:aA,requiredFonts:aA,requiredFormats:aA,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:$,specularExponent:$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$,strikethroughThickness:$,string:null,stroke:null,strokeDashArray:aA,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:aA,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:aA,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$,underlineThickness:$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$,values:null,vAlphabetic:$,vMathematical:$,vectorEffect:null,vHanging:$,vIdeographic:$,version:null,vertAdvY:$,vertOriginX:$,vertOriginY:$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:fA}),gA=uA({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),_A=uA({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:pA}),vA=uA({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),yA={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},bA=/[A-Z]/g,xA=/-[a-z]/g,SA=/^data[-\w.:]+$/i;function CA(e,t){let n=Xk(t),r=t,i=Zk;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&SA.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(xA,TA);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!xA.test(e)){let n=e.replace(bA,wA);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=cA}return new i(r,t)}function wA(e){return`-`+e.toLowerCase()}function TA(e){return e.charAt(1).toUpperCase()}var EA=Yk([dA,mA,gA,_A,vA],`html`),DA=Yk([dA,hA,gA,_A,vA],`svg`);function OA(e){return e.join(` `).trim()}var kA=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
194
- `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),AA=o(((e,t,n)=>{var r=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var i=r(kA());function a(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=(0,i.default)(e),a=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:i}=e;a?t(r,i,e):i&&(n||={},n[r]=i)}),n}})),jA=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),MA=o(((e,t,n)=>{var r=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(AA()),i=jA();function a(e,t){var n={};return!e||typeof e!=`string`||(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a})),NA=FA(`end`),PA=FA(`start`);function FA(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function IA(e){let t=PA(e),n=NA(e);if(t&&n)return{start:t,end:n}}var LA=l(MA(),1),RA={}.hasOwnProperty,zA=new Map,BA=/[A-Z]/g,VA=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),HA=new Set([`td`,`th`]),UA=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function WA(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=tj(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=ej(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?DA:EA,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=GA(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function GA(e,t,n){if(t.type===`element`)return KA(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return qA(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return YA(e,t,n);if(t.type===`mdxjsEsm`)return JA(e,t);if(t.type===`root`)return XA(e,t,n);if(t.type===`text`)return ZA(e,t)}function KA(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=DA,e.schema=i),e.ancestors.push(t);let a=sj(e,t.tagName,!1),o=nj(e,t),s=ij(e,t);return VA.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Kk(e)})),QA(e,o,a,t),$A(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function qA(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}cj(e,t.position)}function JA(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);cj(e,t.position)}function YA(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=DA,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:sj(e,t.name,!0),o=rj(e,t),s=ij(e,t);return QA(e,o,a,t),$A(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function XA(e,t,n){let r={};return $A(r,ij(e,t)),e.create(t,e.Fragment,r,n)}function ZA(e,t){return t.value}function QA(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $A(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function ej(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function tj(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=PA(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function nj(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&RA.call(t.properties,i)){let a=aj(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&HA.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function rj(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else cj(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else cj(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function ij(e,t){let n=[],r=-1,i=e.passKeys?new Map:zA;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=GA(e,a,o);s!==void 0&&n.push(s)}return n}function aj(e,t,n){let r=CA(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Bk(n):OA(n)),r.property===`style`){let t=typeof n==`object`?n:oj(e,String(n));return e.stylePropertyNameCase===`css`&&(t=lj(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?yA[r.property]||r.property:r.attribute,n]}}function oj(e,t){try{return(0,LA.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new FO("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=UA+`#cannot-parse-style-attribute`,r}}function sj(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Wk(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Wk(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return RA.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);cj(e)}function cj(e,t){let n=new FO("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=UA+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function lj(e){let t={},n;for(n in e)RA.call(e,n)&&(t[uj(n)]=e[n]);return t}function uj(e){let t=e.replace(BA,dj);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function dj(e){return`-`+e.toLowerCase()}var fj={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]};function pj(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function mj(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
195
- `}]}function hj(e,t){let n=t.value?t.value+`
196
- `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function gj(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _j(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vj(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=PT(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function yj(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bj(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function xj(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Sj(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return xj(e,t);let i={src:PT(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Cj(e,t){let n={src:PT(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function wj(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Tj(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return xj(e,t);let i={href:PT(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Ej(e,t){let n={href:PT(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Dj(e,t,n){let r=e.all(t),i=n?Oj(n):kj(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
192
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function mO(e){let t={constructs:sT([tO,...(e||{}).extensions||[]]),content:n(VD),defined:[],document:n(UD),flow:n(qD),lazy:{},string:n(XD),text:n(ZD)};return t;function n(e){return n;function n(n){return dO(t,e,n)}}}function hO(e){for(;!fE(e););return e}var gO=/[\0\t\n\r]/g;function _O(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){gO.lastIndex=c;let n=gO.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}function vO(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?bO(e.position):`start`in e||`end`in e?bO(e):`line`in e||`column`in e?yO(e):``}function yO(e){return xO(e&&e.line)+`:`+xO(e&&e.column)}function bO(e){return yO(e&&e.start)+`-`+yO(e&&e.end)}function xO(e){return e&&typeof e==`number`?e:1}var SO={}.hasOwnProperty;function CO(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),wO(n)(hO(mO(n).document().write(_O()(e,t,!0))))}function wO(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(ge),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(pe),blockQuote:o(ue),characterEscape:E,characterReference:E,codeFenced:o(de),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(de,s),codeText:o(L,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(R),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(fe),hardBreakEscape:o(me),hardBreakTrailing:o(me),htmlFlow:o(he,s),htmlFlowData:E,htmlText:o(he,s),htmlTextData:E,image:o(z),label:s,link:o(ge),listItem:o(ve),listItemValue:p,listOrdered:o(_e,f),listUnordered:o(_e),paragraph:o(ye),reference:re,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(pe),strong:o(be),thematicBreak:o(Se)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:le,autolinkProtocol:ce,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:oe,characterReference:se,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(M),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(A),htmlFlowData:D,htmlText:l(j),htmlTextData:D,image:l(P),label:ee,labelText:F,lineEnding:O,link:l(N),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ie,resourceDestinationString:te,resourceTitleString:I,resource:ne,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};EO(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),SO.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||OO).call(o,void 0,e[0])}for(r.position={start:TO(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:TO(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let n=r;for(s=void 0;n--;){let t=e[n];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=n}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:TO(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+vO({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||OO).call(this,e,r[0])),n.position.end=TO(e.end)}function d(){return Yb(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=dC(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=xe(),n.position={start:TO(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=TO(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=TO(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function F(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=zw(t),n.identifier=dC(t).toLowerCase()}function ee(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ne(){this.data.inReference=void 0}function re(){this.data.referenceType=`collapsed`}function ie(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=dC(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ae(e){this.data.characterReferenceType=e.type}function oe(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Lw(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=yx(t);let i=this.stack[this.stack.length-1];i.value+=r}function se(e){let t=this.stack.pop();t.position.end=TO(e.end)}function ce(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function le(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ue(){return{type:`blockquote`,children:[],position:void 0}}function de(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function L(){return{type:`inlineCode`,value:``,position:void 0}}function R(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function fe(){return{type:`emphasis`,children:[],position:void 0}}function pe(){return{type:`heading`,depth:0,children:[],position:void 0}}function me(){return{type:`break`,position:void 0}}function he(){return{type:`html`,value:``,position:void 0}}function z(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function ge(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function _e(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function ve(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function ye(){return{type:`paragraph`,children:[],position:void 0}}function be(){return{type:`strong`,children:[],position:void 0}}function xe(){return{type:`text`,value:``,position:void 0}}function Se(){return{type:`thematicBreak`,position:void 0}}}function TO(e){return{line:e.line,column:e.column,offset:e.offset}}function EO(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?EO(e,r):DO(e,r)}}function DO(e,t){let n;for(n in t)if(SO.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`afterExit`:case`beforeEnter`:{let r=t[n];r&&e[n].push(r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function OO(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+vO({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+vO({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+vO({start:t.start,end:t.end})+`) is still open`)}function kO(e){let t=this;t.parser=n;function n(n){return CO(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function AO(e){if(e)throw e}var jO=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function MO(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function NO(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?PO(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function PO(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var FO=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=vO(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};FO.prototype.file=``,FO.prototype.name=``,FO.prototype.reason=``,FO.prototype.message=``,FO.prototype.stack=``,FO.prototype.column=void 0,FO.prototype.line=void 0,FO.prototype.ancestors=void 0,FO.prototype.cause=void 0,FO.prototype.fatal=void 0,FO.prototype.place=void 0,FO.prototype.ruleId=void 0,FO.prototype.source=void 0;var IO={basename:LO,dirname:RO,extname:zO,join:BO,sep:`/`};function LO(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);UO(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function RO(e){if(UO(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function zO(e){UO(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function BO(...e){let t=-1,n;for(;++t<e.length;)UO(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:VO(n)}function VO(e){UO(e);let t=e.codePointAt(0)===47,n=HO(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function HO(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function UO(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var WO={cwd:GO};function GO(){return`/`}function KO(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function qO(e){if(typeof e==`string`)e=new URL(e);else if(!KO(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return JO(e)}function JO(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var YO=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],XO=class{constructor(e){let t;t=e?KO(e)?{path:e}:typeof e==`string`||ek(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:WO.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<YO.length;){let e=YO[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)YO.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?IO.basename(this.path):void 0}set basename(e){QO(e,`basename`),ZO(e,`basename`),this.path=IO.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?IO.dirname(this.path):void 0}set dirname(e){$O(this.basename,`dirname`),this.path=IO.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?IO.extname(this.path):void 0}set extname(e){if(ZO(e,`extname`),$O(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=IO.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){KO(e)&&(e=qO(e)),QO(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?IO.basename(this.path,this.extname):void 0}set stem(e){QO(e,`stem`),ZO(e,`stem`),this.path=IO.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new FO(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function ZO(e,t){if(e&&e.includes(IO.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+IO.sep+"`")}function QO(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function $O(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function ek(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var tk=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),nk=l(jO(),1),rk={}.hasOwnProperty,ik=new class e extends tk{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=NO()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,nk.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(sk(`data`,this.frozen),this.namespace[e]=t,this):rk.call(this.namespace,e)&&this.namespace[e]||void 0:e?(sk(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=uk(e),n=this.parser||this.Parser;return ak(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),ak(`process`,this.parser||this.Parser),ok(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=uk(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);fk(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),ak(`processSync`,this.parser||this.Parser),ok(`processSync`,this.compiler||this.Compiler),this.process(e,r),lk(`processSync`,`process`,t),n;function r(e,r){t=!0,AO(e),n=r}}run(e,t,n){ck(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=uk(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),lk(`runSync`,`run`,n),r;function i(e,t){AO(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=uk(t),r=this.compiler||this.Compiler;return ok(`stringify`,r),ck(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(sk(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,nk.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];MO(o)&&MO(r)&&(r=(0,nk.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function ak(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function ok(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function sk(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ck(e){if(!MO(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function lk(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function uk(e){return dk(e)?e:new XO(e)}function dk(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function fk(e){return typeof e==`string`||pk(e)}function pk(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var mk=[`note`,`warning`,`tip`,`say`,`do`,`timing`];function hk(e){return mk.includes(e)}function gk(){return e=>{nw(e,(e,t,n)=>{if(e.type!==`containerDirective`&&e.type!==`leafDirective`&&e.type!==`textDirective`)return;let r=e;if(r.type===`containerDirective`)r.data={...r.data,hName:`div`,hProperties:hk(r.name)?{dataAdmonition:r.name}:{dataAdmonitionUnknown:r.name}};else if(n&&typeof t==`number`){let e={type:`text`,value:`:${r.name}`},i=r.type===`leafDirective`?{type:`paragraph`,children:[e]}:e;return n.children.splice(t,1,i),[Ux,t]}})}}function _k(){return e=>{nw(e,`html`,(e,t,n)=>{if(n&&typeof t==`number`){let r={type:`text`,value:e.value},i=n.type===`root`?{type:`paragraph`,children:[r]}:r;return n.children.splice(t,1,i),[Ux,t]}})}}function vk(e,t){let[n,...r]=t.split(`.`);if(!n||r.length===0||!(n in e))return{found:!1};let i=e[n];for(let e of r){if(typeof i!=`object`||!i||Array.isArray(i)||!Object.prototype.hasOwnProperty.call(i,e))return{found:!1};i=i[e]}return{found:!0,value:i}}function yk(e,t){if(typeof e==`number`)try{return new Intl.NumberFormat(t).format(e)}catch{return new Intl.NumberFormat(`en`).format(e)}return typeof e==`string`?e:null}function bk(e,t){let n=t.setting;if(!n)return{error:`:::when names no setting`};let r=vk(e,n);if(!r.found)return{error:`:::when names "${n}", which this guide is not given`};let{value:i}=r,a=t.not!==void 0&&t.not!==null,o;if(t.is===void 0||t.is===null){if(typeof i!=`boolean`)return{error:`:::when on "${n}" needs is="…", since it is not true or false`};o=i}else if(typeof i==`number`)o=t.is.trim()!==``&&Number(t.is)===i;else if(typeof i==`string`||typeof i==`boolean`)o=String(i)===t.is;else return{error:`:::when on "${n}" compares a value that is not a single value`};return{show:a?!o:o}}function xk(e){return{type:`emphasis`,data:{hName:`span`,hProperties:{dataGuideError:e}},children:[{type:`text`,value:e}]}}function Sk(e){return{type:`paragraph`,data:{hName:`div`,hProperties:{dataGuideError:e}},children:[{type:`text`,value:e}]}}function Ck(e){return t=>{nw(t,(t,n,r)=>{if(!r||typeof n!=`number`)return;let i=t;if(i.type===`containerDirective`&&i.name===`when`){let t=bk(e.settings,i.attributes??{}),a=`error`in t?[Sk(t.error)]:t.show?i.children:[];return r.children.splice(n,1,...a),[Ux,n]}if(i.type===`textDirective`&&i.name===`setting`){let t=wk(i),a=vk(e.settings,t),o=a.found?yk(a.value,e.locale):null,s=o===null?xk(a.found?`:setting[${t}] is not a number or text`:`:setting[${t}] is not given to this guide`):{type:`text`,value:o};return r.children.splice(n,1,s),[Ux,n+1]}})}}function wk(e){return e.children.map(e=>`value`in e&&typeof e.value==`string`?e.value:``).join(``).trim()}var Tk=/\s*\{-\}\s*$/;function Ek(e){return e.replace(/\.md$/,``)}function Dk(e,t){let n=new Kb,r=Ek(t),i=[];return nw(e,`heading`,e=>{let t=Yb(e),a=Tk.test(t),o=t.replace(Tk,``);i.push({node:e,id:`${r}--${n.slug(o)}`,text:o,omitted:a})}),i}function Ok(e){let t=e.children[e.children.length-1];t?.type===`text`&&Tk.test(t.value)&&(t.value=t.value.replace(Tk,``))}function kk(e){return t=>{for(let n of Dk(t,e.chapterFile))Ok(n.node),n.node.data={...n.node.data,hProperties:{...n.node.data?.hProperties,id:n.id}}}}function Ak(e,t,n){let r=n?.minDepth??2,i=n?.maxDepth??3,a=ik().use(kO).use(BD).use(US).parse(t);return Ck({settings:n?.settings??{},locale:n?.locale??`en`})(a),gk()(a),Dk(a,e).filter(e=>!e.omitted).filter(e=>e.node.depth===1||e.node.depth>=r&&e.node.depth<=i).map(e=>({id:e.id,text:e.text,depth:e.node.depth}))}var jk={youtube:{idPattern:/^[A-Za-z0-9_-]{11}$/,embedUrl:e=>`https://www.youtube-nocookie.com/embed/${e}`,embedHosts:[`www.youtube-nocookie.com`]}},Mk=`file`,Nk={src:[`mp4`,`webm`],poster:[`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`],captions:[`vtt`]},Pk={youtube:new Set([`provider`,`id`]),[Mk]:new Set([`provider`,`src`,`title`,`poster`,`captions`])},Fk=[...Object.keys(jk),Mk],Ik=`https://guide.invalid/content/locale/chapter.md`;function Lk(e){if(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith(`/`)||e.includes(`\\`)||/[?#]/.test(e))return;let t;try{t=new URL(e,Ik)}catch{return}if(t.origin===`https://guide.invalid`&&t.pathname.startsWith(`/assets/`))try{let e=decodeURIComponent(t.pathname.slice(8));return e.split(`/`).some(e=>e===``||e===`.`||e===`..`||e.includes(`\\`))?void 0:e}catch{return}}function Rk(e){let t=e.lastIndexOf(`.`);return t===-1?``:e.slice(t+1).toLowerCase()}function zk(e){let t={};for(let n of e.split(`
193
+ `)){let e=n.trim();if(e.length===0)continue;let r=e.match(/^([A-Za-z][A-Za-z0-9_-]*):\s*(.*)$/);if(!r)return{ok:!1,error:`Malformed line in video block: "${e}"`};let i=r[1],a=r[2].trim();if(i in t)return{ok:!1,error:`Duplicate key "${i}" in video block`};t[i]=a}let n=t.provider;if(!n)return{ok:!1,error:`Video block is missing "provider"`};let r=Pk[n];if(!r)return{ok:!1,error:`Unknown video provider "${n}". Supported providers: ${Fk.join(`, `)}`};for(let e of Object.keys(t))if(!r.has(e))return{ok:!1,error:`Unknown key "${e}" in video block`};if(n===`file`)return Bk(t);let i=jk[n],a=t.id;return a?i.idPattern.test(a)?{ok:!0,kind:`embed`,provider:n,id:a,embedUrl:i.embedUrl(a)}:{ok:!1,error:`Video id "${a}" is not a valid ${n} id`}:{ok:!1,error:`Video block is missing "id"`}}function Bk(e){if(!e.src)return{ok:!1,error:`Video block is missing "src"`};let t={};for(let n of Object.keys(Nk)){let r=e[n];if(r===void 0)continue;let i=Lk(r);if(!i)return{ok:!1,error:`Video ${n} "${r}" must be a file in the guide's assets/ directory`};let a=Nk[n];if(!a.includes(Rk(i)))return{ok:!1,error:`Video ${n} "${r}" must be a ${a.map(e=>`.${e}`).join(`, `)} file`};t[n]=i}return{ok:!0,kind:`file`,provider:Mk,src:t.src,...t.poster?{poster:t.poster}:{},...t.captions?{captions:t.captions}:{},...e.title?{title:e.title}:{}}}var Vk=Sl((0,V.jsx)(`path`,{d:`M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8`}),`InfoOutlined`),Hk=Sl((0,V.jsx)(`path`,{d:`M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7m2.85 11.1-.85.6V16h-4v-2.3l-.85-.6C7.8 12.16 7 10.63 7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.63-.8 3.16-2.15 4.1`}),`LightbulbOutlined`),Uk=Sl([(0,V.jsx)(`circle`,{cx:`9`,cy:`9`,r:`4`},`0`),(0,V.jsx)(`path`,{d:`M9 15c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4m7.76-9.64-1.68 1.69c.84 1.18.84 2.71 0 3.89l1.68 1.69c2.02-2.02 2.02-5.07 0-7.27M20.07 2l-1.63 1.63c2.77 3.02 2.77 7.56 0 10.74L20.07 16c3.9-3.89 3.91-9.95 0-14`},`1`)],`RecordVoiceOver`),Wk=Sl((0,V.jsx)(`path`,{d:`M22 5.18 10.59 16.6l-4.24-4.24 1.41-1.41 2.83 2.83 10-10zm-2.21 5.04c.13.57.21 1.17.21 1.78 0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8c1.58 0 3.04.46 4.28 1.25l1.44-1.44C16.1 2.67 14.13 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.19-.22-2.33-.6-3.39z`}),`TaskAlt`),Gk=Sl((0,V.jsx)(`path`,{d:`M15 1H9v2h6zm-4 13h2V8h-2zm8.03-6.61 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61M12 20c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7`}),`TimerOutlined`),Kk=Sl([(0,V.jsx)(`path`,{d:`M12 5.99 19.53 19H4.47zM12 2 1 21h22z`},`0`),(0,V.jsx)(`path`,{d:`M13 16h-2v2h2zm0-6h-2v5h2z`},`1`)],`WarningAmber`);function qk(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Jk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Yk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Xk={};function Zk(e,t){return((t||Xk).jsx?Yk:Jk).test(e)}var Qk=/[ \t\n\f\r]/g;function $k(e){return typeof e==`object`?e.type===`text`&&eA(e.value):eA(e)}function eA(e){return e.replace(Qk,``)===``}var tA=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};tA.prototype.normal={},tA.prototype.property={},tA.prototype.space=void 0;function nA(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new tA(n,r,t)}function rA(e){return e.toLowerCase()}var iA=class{constructor(e,t){this.attribute=t,this.property=e}};iA.prototype.attribute=``,iA.prototype.booleanish=!1,iA.prototype.boolean=!1,iA.prototype.commaOrSpaceSeparated=!1,iA.prototype.commaSeparated=!1,iA.prototype.defined=!1,iA.prototype.mustUseProperty=!1,iA.prototype.number=!1,iA.prototype.overloadedBoolean=!1,iA.prototype.property=``,iA.prototype.spaceSeparated=!1,iA.prototype.space=void 0;var aA=s({boolean:()=>sA,booleanish:()=>cA,commaOrSpaceSeparated:()=>fA,commaSeparated:()=>dA,number:()=>$,overloadedBoolean:()=>lA,spaceSeparated:()=>uA}),oA=0,sA=pA(),cA=pA(),lA=pA(),$=pA(),uA=pA(),dA=pA(),fA=pA();function pA(){return 2**++oA}var mA=Object.keys(aA),hA=class extends iA{constructor(e,t,n,r){let i=-1;if(super(e,t),gA(this,`space`,r),typeof n==`number`)for(;++i<mA.length;){let e=mA[i];gA(this,mA[i],(n&aA[e])===aA[e])}}};hA.prototype.defined=!0;function gA(e,t,n){n&&(e[t]=n)}function _A(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new hA(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[rA(r)]=r,n[rA(a.attribute)]=r}return new tA(t,n,e.space)}var vA=_A({properties:{ariaActiveDescendant:null,ariaAtomic:cA,ariaAutoComplete:null,ariaBusy:cA,ariaChecked:cA,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:uA,ariaCurrent:null,ariaDescribedBy:uA,ariaDetails:null,ariaDisabled:cA,ariaDropEffect:uA,ariaErrorMessage:null,ariaExpanded:cA,ariaFlowTo:uA,ariaGrabbed:cA,ariaHasPopup:null,ariaHidden:cA,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:uA,ariaLevel:$,ariaLive:null,ariaModal:cA,ariaMultiLine:cA,ariaMultiSelectable:cA,ariaOrientation:null,ariaOwns:uA,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:cA,ariaReadOnly:cA,ariaRelevant:null,ariaRequired:cA,ariaRoleDescription:uA,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:cA,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function yA(e,t){return t in e?e[t]:t}function bA(e,t){return yA(e,t.toLowerCase())}var xA=_A({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:dA,acceptCharset:uA,accessKey:uA,action:null,allow:null,allowFullScreen:sA,allowPaymentRequest:sA,allowUserMedia:sA,alpha:sA,alt:null,as:null,async:sA,autoCapitalize:null,autoComplete:uA,autoFocus:sA,autoPlay:sA,blocking:uA,capture:null,charSet:null,checked:sA,cite:null,className:uA,closedBy:null,colorSpace:null,cols:$,colSpan:$,command:null,commandFor:null,content:null,contentEditable:cA,controls:sA,controlsList:uA,coords:$|dA,crossOrigin:null,data:null,dateTime:null,decoding:null,default:sA,defer:sA,dir:null,dirName:null,disabled:sA,download:lA,draggable:cA,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:sA,formTarget:null,headers:uA,height:$,hidden:lA,high:$,href:null,hrefLang:null,htmlFor:uA,httpEquiv:uA,id:null,imageSizes:null,imageSrcSet:null,inert:sA,inputMode:null,integrity:null,is:null,isMap:sA,itemId:null,itemProp:uA,itemRef:uA,itemScope:sA,itemType:uA,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:sA,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:sA,muted:sA,name:null,nonce:null,noModule:sA,noValidate:sA,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:sA,optimum:$,pattern:null,ping:uA,placeholder:null,playsInline:sA,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:sA,referrerPolicy:null,rel:uA,required:sA,reversed:sA,rows:$,rowSpan:$,sandbox:uA,scope:null,scoped:sA,seamless:sA,selected:sA,shadowRootClonable:sA,shadowRootCustomElementRegistry:sA,shadowRootDelegatesFocus:sA,shadowRootMode:null,shadowRootSerializable:sA,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:cA,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:sA,useMap:null,value:cA,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:uA,axis:null,background:null,bgColor:null,border:$,borderColor:null,bottomMargin:$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:sA,declare:sA,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:sA,noHref:sA,noShade:sA,noWrap:sA,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:cA,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:sA,disablePictureInPicture:sA,disableRemotePlayback:sA,exportParts:dA,part:uA,prefix:null,property:null,results:$,security:null,unselectable:null},space:`html`,transform:bA}),SA=_A({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:fA,accentHeight:$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$,amplitude:$,arabicForm:null,ascent:$,attributeName:null,attributeType:null,azimuth:$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$,by:null,calcMode:null,capHeight:$,className:uA,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:$,diffuseConstant:$,direction:null,display:null,dur:null,divisor:$,dominantBaseline:null,download:sA,dx:null,dy:null,edgeMode:null,editable:null,elevation:$,enableBackground:null,end:null,event:null,exponent:$,externalResourcesRequired:null,fill:null,fillOpacity:$,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:dA,g2:dA,glyphName:dA,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$,horizOriginX:$,horizOriginY:$,id:null,ideographic:$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$,k:$,k1:$,k2:$,k3:$,k4:$,kernelMatrix:fA,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:$,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:$,overlineThickness:$,paintOrder:null,panose1:null,path:null,pathLength:$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:uA,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:fA,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:fA,rev:fA,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:fA,requiredFeatures:fA,requiredFonts:fA,requiredFormats:fA,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:$,specularExponent:$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$,strikethroughThickness:$,string:null,stroke:null,strokeDashArray:fA,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:fA,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:fA,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$,underlineThickness:$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$,values:null,vAlphabetic:$,vMathematical:$,vectorEffect:null,vHanging:$,vIdeographic:$,version:null,vertAdvY:$,vertOriginX:$,vertOriginY:$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:yA}),CA=_A({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),wA=_A({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:bA}),TA=_A({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),EA={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},DA=/[A-Z]/g,OA=/-[a-z]/g,kA=/^data[-\w.:]+$/i;function AA(e,t){let n=rA(t),r=t,i=iA;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&kA.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(OA,MA);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!OA.test(e)){let n=e.replace(DA,jA);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=hA}return new i(r,t)}function jA(e){return`-`+e.toLowerCase()}function MA(e){return e.charAt(1).toUpperCase()}var NA=nA([vA,xA,CA,wA,TA],`html`),PA=nA([vA,SA,CA,wA,TA],`svg`);function FA(e){return e.join(` `).trim()}var IA=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
194
+ `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),LA=o(((e,t,n)=>{var r=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var i=r(IA());function a(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=(0,i.default)(e),a=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:i}=e;a?t(r,i,e):i&&(n||={},n[r]=i)}),n}})),RA=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),zA=o(((e,t,n)=>{var r=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(LA()),i=RA();function a(e,t){var n={};return!e||typeof e!=`string`||(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a})),BA=HA(`end`),VA=HA(`start`);function HA(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function UA(e){let t=VA(e),n=BA(e);if(t&&n)return{start:t,end:n}}var WA=l(zA(),1),GA={}.hasOwnProperty,KA=new Map,qA=/[A-Z]/g,JA=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),YA=new Set([`td`,`th`]),XA=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function ZA(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=cj(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=sj(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?PA:NA,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=QA(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function QA(e,t,n){if(t.type===`element`)return $A(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return ej(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return nj(e,t,n);if(t.type===`mdxjsEsm`)return tj(e,t);if(t.type===`root`)return rj(e,t,n);if(t.type===`text`)return ij(e,t)}function $A(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=PA,e.schema=i),e.ancestors.push(t);let a=mj(e,t.tagName,!1),o=lj(e,t),s=dj(e,t);return JA.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!$k(e)})),aj(e,o,a,t),oj(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function ej(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}hj(e,t.position)}function tj(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);hj(e,t.position)}function nj(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=PA,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:mj(e,t.name,!0),o=uj(e,t),s=dj(e,t);return aj(e,o,a,t),oj(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function rj(e,t,n){let r={};return oj(r,dj(e,t)),e.create(t,e.Fragment,r,n)}function ij(e,t){return t.value}function aj(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function oj(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function sj(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function cj(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=VA(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function lj(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&GA.call(t.properties,i)){let a=fj(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&YA.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function uj(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else hj(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else hj(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function dj(e,t){let n=[],r=-1,i=e.passKeys?new Map:KA;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=QA(e,a,o);s!==void 0&&n.push(s)}return n}function fj(e,t,n){let r=AA(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?qk(n):FA(n)),r.property===`style`){let t=typeof n==`object`?n:pj(e,String(n));return e.stylePropertyNameCase===`css`&&(t=gj(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?EA[r.property]||r.property:r.attribute,n]}}function pj(e,t){try{return(0,WA.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new FO("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=XA+`#cannot-parse-style-attribute`,r}}function mj(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Zk(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Zk(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return GA.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);hj(e)}function hj(e,t){let n=new FO("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=XA+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function gj(e){let t={},n;for(n in e)GA.call(e,n)&&(t[_j(n)]=e[n]);return t}function _j(e){let t=e.replace(qA,vj);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function vj(e){return`-`+e.toLowerCase()}var yj={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]};function bj(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function xj(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
195
+ `}]}function Sj(e,t){let n=t.value?t.value+`
196
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function Cj(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wj(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Tj(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=PT(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Ej(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Dj(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Oj(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function kj(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Oj(e,t);let i={src:PT(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Aj(e,t){let n={src:PT(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function jj(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Mj(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Oj(e,t);let i={href:PT(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Nj(e,t){let n={href:PT(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Pj(e,t,n){let r=e.all(t),i=n?Fj(n):Ij(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
197
197
  `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
198
- `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Oj(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=kj(n[r])}return t}function kj(e){return e.spread??e.children.length>1}function Aj(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function jj(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Mj(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Nj(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Pj(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=PA(t.children[1]),o=NA(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Fj(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Ij(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Lj=9,Rj=32;function zj(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Bj(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Bj(t.slice(i),i>0,!1)),a.join(``)}function Bj(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Lj||t===Rj;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Lj||t===Rj;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Vj(e,t){let n={type:`text`,value:zj(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Hj(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Uj={blockquote:pj,break:mj,code:hj,delete:gj,emphasis:_j,footnoteReference:vj,heading:yj,html:bj,imageReference:Sj,image:Cj,inlineCode:wj,linkReference:Tj,link:Ej,listItem:Dj,list:Aj,paragraph:jj,root:Mj,strong:Nj,table:Pj,tableCell:Ij,tableRow:Fj,text:Vj,thematicBreak:Hj,toml:Wj,yaml:Wj,definition:Wj,footnoteDefinition:Wj};function Wj(){}var{defineProperty:Gj}=Object,Kj=typeof self==`object`?self:globalThis,qj=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Kj[e](t)},Jj=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?Gj(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof Kj[e]==`function`?qj(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(qj(a,o),i)};return r},Yj=e=>Jj(new Map,e)(0),Xj=``,{toString:Zj}={},{keys:Qj,is:$j}=Object,eM=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Zj.call(e).slice(8,-1);switch(n){case`Array`:return[1,Xj];case`Object`:return[2,Xj];case`Date`:return[3,Xj];case`RegExp`:return[4,Xj];case`Map`:return[5,Xj];case`Set`:return[6,Xj];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},tM=([e,t])=>e===0&&(t===`function`||t===`symbol`),nM=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=eM(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&$j(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of Qj(o))(e||!tM(eM(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?Xj:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(tM(eM(n))||tM(eM(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!tM(eM(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},rM=(e,{json:t,lossy:n}={})=>{let r=[];return nM(!(t||n),!!t,new Map,r)(e),r},iM=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Yj(rM(e,t)):structuredClone(e):(e,t)=>Yj(rM(e,t));function aM(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function oM(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function sM(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||aM,r=e.options.footnoteBackLabel||oM,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=PT(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...iM(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
198
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Fj(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Ij(n[r])}return t}function Ij(e){return e.spread??e.children.length>1}function Lj(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Rj(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zj(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Bj(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Vj(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=VA(t.children[1]),o=BA(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Hj(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Uj(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Wj=9,Gj=32;function Kj(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(qj(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(qj(t.slice(i),i>0,!1)),a.join(``)}function qj(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Wj||t===Gj;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Wj||t===Gj;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Jj(e,t){let n={type:`text`,value:Kj(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Yj(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Xj={blockquote:bj,break:xj,code:Sj,delete:Cj,emphasis:wj,footnoteReference:Tj,heading:Ej,html:Dj,imageReference:kj,image:Aj,inlineCode:jj,linkReference:Mj,link:Nj,listItem:Pj,list:Lj,paragraph:Rj,root:zj,strong:Bj,table:Vj,tableCell:Uj,tableRow:Hj,text:Jj,thematicBreak:Yj,toml:Zj,yaml:Zj,definition:Zj,footnoteDefinition:Zj};function Zj(){}var{defineProperty:Qj}=Object,$j=typeof self==`object`?self:globalThis,eM=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new $j[e](t)},tM=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?Qj(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof $j[e]==`function`?eM(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(eM(a,o),i)};return r},nM=e=>tM(new Map,e)(0),rM=``,{toString:iM}={},{keys:aM,is:oM}=Object,sM=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=iM.call(e).slice(8,-1);switch(n){case`Array`:return[1,rM];case`Object`:return[2,rM];case`Date`:return[3,rM];case`RegExp`:return[4,rM];case`Map`:return[5,rM];case`Set`:return[6,rM];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},cM=([e,t])=>e===0&&(t===`function`||t===`symbol`),lM=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=sM(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&oM(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of aM(o))(e||!cM(sM(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?rM:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(cM(sM(n))||cM(sM(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!cM(sM(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},uM=(e,{json:t,lossy:n}={})=>{let r=[];return lM(!(t||n),!!t,new Map,r)(e),r},dM=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?nM(uM(e,t)):structuredClone(e):(e,t)=>nM(uM(e,t));function fM(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function pM(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function mM(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||fM,r=e.options.footnoteBackLabel||pM,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=PT(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...dM(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
199
199
  `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
200
- `}]}}var cM={}.hasOwnProperty,lM={};function uM(e,t){let n=t||lM,r=new Map,i=new Map,a={all:s,applyData:fM,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Uj,...n.handlers},one:o,options:n,patch:dM,wrap:mM};return nw(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(cM.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=iM(n);return r.children=a.all(e),r}return iM(e)}return(a.options.unknownHandler||pM)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=hM(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=hM(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function dM(e,t){e.position&&(t.position=IA(e))}function fM(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,iM(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function pM(e,t){let n=t.data||{},r=`value`in t&&!(cM.call(n,`hProperties`)||cM.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function mM(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
200
+ `}]}}var hM={}.hasOwnProperty,gM={};function _M(e,t){let n=t||gM,r=new Map,i=new Map,a={all:s,applyData:yM,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Xj,...n.handlers},one:o,options:n,patch:vM,wrap:xM};return nw(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(hM.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=dM(n);return r.children=a.all(e),r}return dM(e)}return(a.options.unknownHandler||bM)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=SM(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=SM(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function vM(e,t){e.position&&(t.position=UA(e))}function yM(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,dM(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function bM(e,t){let n=t.data||{},r=`value`in t&&!(hM.call(n,`hProperties`)||hM.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function xM(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
201
201
  `});++r<e.length;)r&&n.push({type:`text`,value:`
202
202
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
203
- `}),n}function hM(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function gM(e,t){let n=uM(e,t),r=n.one(e,void 0),i=sM(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
204
- `},i)),a}function _M(e,t){return e&&`run`in e?async function(n,r){let i=gM(n,{file:r,...t});await e.run(i,r)}:function(n,r){return gM(n,{file:r,...e||t})}}var vM=[],yM={allowDangerousHtml:!0},bM=/^(https?|ircs?|mailto|xmpp)$/i,xM=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function SM(e){let t=CM(e),n=wM(e);return TM(t.runSync(t.parse(n),n),e)}function CM(e){let t=e.rehypePlugins||vM,n=e.remarkPlugins||vM,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...yM}:yM;return ik().use(kO).use(n).use(_M,r).use(t)}function wM(e){let t=e.children||``,n=new XO;return typeof t==`string`?n.value=t:``+t,n}function TM(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||EM;for(let e of xM)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return nw(e,l),WA(e,{Fragment:V.Fragment,components:i,ignoreInvalidStyle:!0,jsx:V.jsx,jsxs:V.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in fj)if(Object.hasOwn(fj,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=fj[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function EM(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||bM.test(e.slice(0,t))?e:``}var DM={note:{label:`Note`,palette:`info`,icon:(0,V.jsx)(Pk,{fontSize:`small`})},warning:{label:`Warning`,palette:`warning`,icon:(0,V.jsx)(zk,{fontSize:`small`})},tip:{label:`Tip`,palette:`success`,icon:(0,V.jsx)(Fk,{fontSize:`small`})},say:{label:`Say`,palette:`primary`,icon:(0,V.jsx)(Ik,{fontSize:`small`})},do:{label:`Do`,palette:`secondary`,icon:(0,V.jsx)(Lk,{fontSize:`small`})},timing:{label:`Timing`,palette:`info`,icon:(0,V.jsx)(Rk,{fontSize:`small`})}};function OM({type:e,children:t}){let n=DM[e];return(0,V.jsxs)(im,{sx:e=>({my:2,px:2,py:1.5,borderLeft:3,borderColor:`${n.palette}.main`,borderRadius:1,bgcolor:gi(e.palette[n.palette].main,.08),"& p:first-of-type":{mt:0},"& p:last-of-type":{mb:0}}),"data-testid":`guide-admonition-${e}`,children:[(0,V.jsxs)(Z,{variant:`overline`,component:`p`,sx:{display:`flex`,alignItems:`center`,gap:.75,fontWeight:600,lineHeight:1.5,mb:.5,color:`${n.palette}.main`},children:[n.icon,n.label]}),t]})}function kM({body:e}){let t=Nk(e);return t.ok?(0,V.jsx)(im,{sx:{my:2,position:`relative`,aspectRatio:`16 / 9`,maxWidth:720},"data-testid":`guide-video-embed`,children:(0,V.jsx)(im,{component:`iframe`,src:t.embedUrl,title:`${t.provider} video`,sandbox:`allow-scripts allow-same-origin allow-presentation`,allow:`encrypted-media; fullscreen; picture-in-picture`,referrerPolicy:`strict-origin-when-cross-origin`,sx:{position:`absolute`,inset:0,width:`100%`,height:`100%`,border:0}})}):(0,V.jsxs)(bd,{severity:`error`,sx:{my:2},"data-testid":`guide-video-error`,children:[`Video block error: `,t.error]})}function AM(e){return e.children.map(e=>e.type===`text`?e.value:e.type===`element`?AM(e):``).join(``)}function jM({markdown:e,chapterFile:t,locale:n,settings:r}){return(0,V.jsx)(SM,{remarkPlugins:[BD,US,[Ck,{settings:r,locale:n}],gk,_k,[kk,{chapterFile:t}]],urlTransform:e=>{let r=EM(e);if(!r)return;if(/^[a-z][a-z0-9+.-]*:/i.test(r)||r.startsWith(`//`)||r.startsWith(`#`)||r.startsWith(`/`))return r;let i=new URL(`/api/guide/content/${n}/${t}`,window.location.origin),a=new URL(r,i);if(a.origin===window.location.origin&&a.pathname.startsWith(`/api/guide/`))return a.pathname+a.search},components:{pre({node:e,children:t,...n}){let r=e?.children[0];return r&&r.type===`element`&&r.tagName===`code`&&Array.isArray(r.properties?.className)&&r.properties.className.includes(`language-video`)?(0,V.jsx)(kM,{body:AM(r)}):(0,V.jsx)(`pre`,{...n,children:t})},span(e){let{node:t,children:n,...r}=e;return typeof r[`data-guide-error`]==`string`?(0,V.jsx)(im,{component:`span`,"data-testid":`guide-setting-error`,sx:{color:`error.main`,fontStyle:`italic`},children:n}):(0,V.jsx)(`span`,{...r,children:n})},div(e){let{node:t,children:n,...r}=e,i=r;if(typeof i[`data-guide-error`]==`string`)return(0,V.jsx)(bd,{severity:`error`,sx:{my:2},"data-testid":`guide-setting-error`,children:n});let a=i[`data-admonition`];if(typeof a==`string`&&hk(a))return(0,V.jsx)(OM,{type:a,children:n});let o=i[`data-admonition-unknown`];return typeof o==`string`?(0,V.jsxs)(bd,{severity:`error`,sx:{my:2},"data-testid":`guide-admonition-unknown`,children:[`Unknown admonition type ":::`,o,`"`]}):(0,V.jsx)(`div`,{...e})},a({node:e,children:t,href:n,...r}){let i=typeof n==`string`&&/^https?:\/\//.test(n);return(0,V.jsx)(`a`,{href:n,...r,...i?{target:`_blank`,rel:`noreferrer noopener`}:{},children:t})}},children:e})}function MM(e){let t=e.replace(/\.md$/,``).replace(/^\d+[-_. ]*/,``).replace(/[-_]+/g,` `).trim();return t.charAt(0).toUpperCase()+t.slice(1)}function NM({locale:e,reloads:t}){let n=new URLSearchParams(window.location.search),[r,i]=(0,E.useState)(void 0),[a,o]=(0,E.useState)(n.get(`locale`)??e),[s,c]=(0,E.useState)(n.get(`chapter`)),[l,u]=(0,E.useState)(``);(0,E.useEffect)(()=>{fetch(`/api/guide`).then(e=>e.json()).then(e=>i(e.guide))},[t]);let d=(0,E.useMemo)(()=>Object.keys(r?.locales??{}),[r]),f=(0,E.useMemo)(()=>r?Ub(r.locales,r.chapters,a):[],[r,a]),p=(0,E.useMemo)(()=>f.map(e=>e.file),[f]),m=f.find(e=>e.file===s)?.locale??a;(0,E.useEffect)(()=>{if(r){if(p.length===0)return c(null);s&&p.includes(s)||c(p[0])}},[r,p,s]),(0,E.useEffect)(()=>{if(!r||!s)return u(``);let e=!0;return fetch(`/api/guide/content/${encodeURIComponent(m)}/${encodeURIComponent(s)}`).then(e=>e.ok?e.text():`This chapter could not be read.`).then(t=>{e&&u(t)}),()=>{e=!1}},[r,m,s,t]);let h=(0,E.useMemo)(()=>s&&l&&r?Ak(s,l,{settings:r.settings,locale:m}):[],[s,l,r,m]);return r===void 0?(0,V.jsx)(ly,{sx:{alignItems:`center`,justifyContent:`center`,height:`100%`},children:(0,V.jsx)(nd,{size:28})}):r===null?(0,V.jsx)(ly,{sx:{alignItems:`center`,justifyContent:`center`,height:`100%`,p:4},children:(0,V.jsx)(Z,{color:`text.secondary`,children:`This package declares no facilitator guide, or none of its chapters applies to this session.`})}):(0,V.jsxs)(ly,{direction:`row`,sx:{height:`100%`},children:[(0,V.jsxs)(im,{sx:{width:280,borderRight:1,borderColor:`divider`,overflow:`auto`,"@media print":{display:`none`}},children:[d.length>1&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(im,{sx:{p:2},children:(0,V.jsx)(zv,{size:`small`,fullWidth:!0,value:d.includes(a)?a:d[0]??``,onChange:e=>o(e.target.value),children:d.map(e=>(0,V.jsx)(Q_,{value:e,children:r.locales[e]?.name??e},e))})}),(0,V.jsx)(Mh,{})]}),(0,V.jsxs)(Lg,{dense:!0,children:[p.map(e=>(0,V.jsx)(Vg,{selected:e===s,onClick:()=>c(e),children:(0,V.jsx)(qg,{primary:MM(e)})},e)),p.length===0&&(0,V.jsx)(im,{sx:{px:2,py:1},children:(0,V.jsx)(Z,{variant:`body2`,color:`text.secondary`,children:`This guide has no chapters yet.`})})]}),h.some(e=>e.depth>1)&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Mh,{}),(0,V.jsx)(Z,{variant:`overline`,color:`text.secondary`,sx:{display:`block`,px:2,pt:1.5},children:`On this page`}),(0,V.jsx)(Lg,{dense:!0,disablePadding:!0,sx:{pb:2},children:h.filter(e=>e.depth>1).map(e=>(0,V.jsx)(Vg,{dense:!0,sx:{pl:2+(e.depth-2)*1.5,py:.25},onClick:()=>document.getElementById(e.id)?.scrollIntoView({block:`start`}),children:(0,V.jsx)(qg,{primary:e.text,slotProps:{primary:{variant:`body2`,color:`text.secondary`}}})},e.id))})]})]}),(0,V.jsx)(im,{sx:{flex:1,minWidth:0,overflow:`auto`},children:(0,V.jsxs)(im,{"data-testid":`guide-content`,sx:{maxWidth:780,mx:`auto`,px:4,py:3,"& img":{maxWidth:`100%`},"& pre":{p:2,borderRadius:1,overflow:`auto`,bgcolor:`action.hover`},"& table":{borderCollapse:`collapse`,width:`100%`},"& th, & td":{border:1,borderColor:`divider`,px:1,py:.5},"& h1, & h2, & h3":{scrollMarginTop:16},"@media print":{maxWidth:`none`,px:0,py:0}},children:[s&&m!==a&&(0,V.jsxs)(bd,{severity:`info`,"data-testid":`guide-untranslated`,sx:{mb:2,"@media print":{display:`none`}},children:[`This chapter is not yet translated into`,` `,r.locales[a]?.name??a,`, so it is shown in`,` `,r.locales[m]?.name??m,`.`]}),s&&(0,V.jsx)(jM,{markdown:l,chapterFile:s,locale:m,settings:r.settings})]})})]})}function PM({team:e,bare:t}){return e?e.participants.length===0?(0,V.jsxs)(FM,{children:[(0,V.jsxs)(ly,{spacing:1,sx:{alignItems:`center`,maxWidth:420},children:[(0,V.jsx)(Z,{variant:`overline`,color:`text.secondary`,children:e.name}),(0,V.jsx)(Z,{variant:`h5`,children:`Nobody is on this team yet`}),(0,V.jsxs)(Z,{color:`text.secondary`,sx:{textAlign:`center`},children:[`Add a participant from the dev drawer, or with`,` `,(0,V.jsxs)(`code`,{children:[`sdk participant add --team `,e.index+1]}),`, and they will be listed here.`]})]}),(0,V.jsx)(gm,{size:`small`,href:Wc({kind:`observer`,teamIndex:e.index,bare:t}),children:`Watch without joining`})]}):(0,V.jsxs)(FM,{children:[(0,V.jsxs)(ly,{spacing:1,sx:{alignItems:`center`},children:[(0,V.jsx)(Z,{variant:`overline`,color:`text.secondary`,children:e.name}),(0,V.jsx)(Z,{variant:`h5`,children:`Who are you?`})]}),(0,V.jsx)(ly,{spacing:1.5,sx:{width:`100%`,maxWidth:420},children:e.participants.map((n,r)=>(0,V.jsx)(bm,{variant:`outlined`,"data-testid":`join-participant`,children:(0,V.jsxs)(Em,{href:Wc({kind:`player`,teamIndex:e.index,participant:r+1,bare:t}),sx:{p:2},children:[(0,V.jsx)(Z,{variant:`subtitle1`,children:n.name}),(0,V.jsxs)(Z,{variant:`body2`,color:`text.secondary`,children:[`Participant `,r+1]})]})},n.id))}),(0,V.jsx)(gm,{size:`small`,href:Wc({kind:`observer`,teamIndex:e.index,bare:t}),children:`Watch without joining`})]}):(0,V.jsxs)(FM,{children:[(0,V.jsx)(Z,{color:`text.secondary`,children:`This session has no such team. It may have been removed.`}),(0,V.jsx)(gm,{href:`/`,children:`Back to the session`})]})}function FM({children:e}){return(0,V.jsx)(ly,{spacing:3,sx:{alignItems:`center`,justifyContent:`center`,height:`100%`,p:4,bgcolor:`background.default`},children:(0,V.jsx)(im,{sx:{display:`contents`},children:e})})}function IM({state:e}){let t=new URLSearchParams(window.location.search).get(`team`),n=t?e.teams.filter(e=>e.teamId===t):e.teams;return(0,E.useEffect)(()=>{let t=document.title;return document.title=`${e.game.name} — team sheets`,()=>{document.title=t}},[e.game.name]),(0,V.jsxs)(im,{"data-testid":`print-sheets`,sx:{height:`100%`,overflow:`auto`,bgcolor:`background.default`,"@media print":{height:`auto`,overflow:`visible`}},children:[(0,V.jsxs)(ly,{direction:`row`,spacing:2,sx:{alignItems:`center`,p:2,"@media print":{display:`none`}},children:[(0,V.jsx)(Z,{variant:`h6`,sx:{flex:1},children:`Team sheets`}),(0,V.jsx)(gm,{variant:`contained`,onClick:()=>window.print(),children:`Print`})]}),n.map(t=>(0,V.jsxs)(im,{sx:{m:2,p:4,bgcolor:`background.paper`,border:1,borderColor:`divider`,borderRadius:1,"@media print":{breakAfter:`page`,breakInside:`avoid`,border:0,m:0}},children:[(0,V.jsx)(Z,{variant:`overline`,color:`text.secondary`,children:e.game.name}),(0,V.jsx)(Z,{variant:`h3`,gutterBottom:!0,children:t.name}),(0,V.jsx)(Mh,{sx:{my:2}}),(0,V.jsx)(Z,{variant:`subtitle2`,gutterBottom:!0,children:`Open your screen at`}),(0,V.jsx)(Z,{sx:{fontFamily:`monospace`,fontSize:18,mb:3,wordBreak:`break-all`},children:`${window.location.origin}${Wc({kind:`player`,teamIndex:t.index,participant:1})}`}),(0,V.jsx)(Z,{variant:`subtitle2`,gutterBottom:!0,children:`On this team`}),(0,V.jsxs)(ly,{spacing:.5,children:[t.participants.map((e,n)=>(0,V.jsxs)(Z,{children:[n+1,`. `,e.name,(0,V.jsx)(Z,{component:`span`,variant:`caption`,color:`text.secondary`,sx:{ml:1,fontFamily:`monospace`},children:Wc({kind:`player`,teamIndex:t.index,participant:n+1})})]},e.id)),t.participants.length===0&&(0,V.jsx)(Z,{color:`text.secondary`,children:`Nobody yet.`})]})]},t.teamId))]})}var LM={game:new Set([`updateData`,`requestTick`,`renameOwnTeam`]),"waiting-room":new Set([`updateData`,`requestTick`,`renameOwnTeam`]),session:new Set([`updateSessionData`,`updateSharedData`,`requestTick`,`undoTick`,`resetGame`,`resetWalkthrough`,`setWaitingRoom`,`createTeam`,`renameTeam`,`renameParticipant`,`moveParticipant`,`deleteTeam`,`pauseTimer`,`resumeTimer`,`extendTick`]),setup:new Set([`updateSettings`,`requestPlay`]),"scenario-editor":new Set([`updateSettings`]),presentation:new Set},RM={setWaitingRoom:`The waiting room is session-wide, so setWaitingRoom takes no teamId`,renameOwnTeam:`renameOwnTeam renames the caller's own team, which the host resolves; it takes no teamId`,resetWalkthrough:`A walkthrough holds one team, so resetWalkthrough takes no teamId`},zM={game:new Set([`callEndpoint`,`getPastState`,`getAllTeamsParticipants`]),"waiting-room":new Set([`callEndpoint`,`getPastState`,`getAllTeamsParticipants`]),session:new Set([`callEndpoint`,`getPastState`]),setup:new Set([`callEndpoint`]),"scenario-editor":new Set([`callEndpoint`]),presentation:new Set([`getPastState`])};function BM(e){return e.teamIndex===void 0?{}:{teamIndex:e.teamIndex}}function VM(e){return e.participantId===void 0?{}:{participantId:e.participantId,teamId:`team-${(e.teamIndex??0)+1}`}}function HM(e){return e.role===void 0?{}:{viewerRole:e.role}}function UM(e){return{...BM(e),...VM(e),...HM(e)}}function WM(e){let t=typeof e==`string`?/^team-([1-9]\d*)$/.exec(e):null;return t?Number(t[1])-1:-1}function GM(e,t){return e.teamId===void 0?t:{teamIndex:WM(e.teamId)}}function KM(e){return typeof e==`object`&&!!e&&`refused`in e}function qM(e,t,n){if(!LM[t.kind].has(e.type))return null;if(e.teamId!==void 0&&e.type in RM)return{refused:RM[e.type]};let r=BM(n),i=VM(n),a=HM(n);switch(e.type){case`updateData`:return{type:`updateContext`,uiIdentifier:t.identifier,payload:e.payload,...e.deletes?{deletes:e.deletes}:{},...r,...i,...a};case`updateSessionData`:return{type:`updateContext`,payload:e.payload,teamIndex:WM(e.teamId),sessionUiIdentifier:t.identifier,...e.deletes?{deletes:e.deletes}:{}};case`updateSharedData`:return{type:`updateSharedContext`,uiIdentifier:t.identifier,payload:e.payload,...e.deletes?{deletes:e.deletes}:{}};case`updateSettings`:return t.kind===`scenario-editor`?{type:`updateScenarioDraft`,scenarioId:n.scenario??null,payload:e.payload,uiIdentifier:t.identifier}:{type:`updateSettings`,payload:e.payload,uiIdentifier:t.identifier};case`requestTick`:return{type:`tick`,...GM(e,r),...t.kind===`session`?{}:{...i,...a}};case`undoTick`:return{type:`undo`,...GM(e,r)};case`resetGame`:return{type:`reset`,...GM(e,{})};case`setWaitingRoom`:return{type:`setWaitingRoom`,open:e.open===!0};case`resetWalkthrough`:return{type:`resetWalkthrough`};case`createTeam`:return{type:`addTeam`,...typeof e.name==`string`?{name:e.name}:{}};case`renameTeam`:return{type:`renameTeam`,teamId:String(e.teamId),name:String(e.name)};case`renameOwnTeam`:return{type:`renameOwnTeam`,name:String(e.name),...i};case`renameParticipant`:return{type:`renameParticipant`,participantId:String(e.participantId),name:String(e.name)};case`moveParticipant`:return{type:`moveParticipant`,participantId:String(e.participantId),teamId:String(e.teamId)};case`deleteTeam`:return{type:`removeTeam`,teamIndex:WM(e.teamId)};case`requestPlay`:return{type:`play`};case`pauseTimer`:return{type:`pauseTimer`,...GM(e,r)};case`resumeTimer`:return{type:`resumeTimer`,...GM(e,r)};case`extendTick`:return{type:`extendTick`,byMs:Number(e.byMs??0),...GM(e,r)};default:return null}}function JM(e,t,n){if(!zM[t.kind].has(e.type))return null;switch(e.type){case`callEndpoint`:return{type:`callEndpoint`,endpointIdentifier:String(e.endpointIdentifier),request:e.request,uiIdentifier:t.identifier,...UM(n),...t.kind===`scenario-editor`?{scenarioId:n.scenario??null}:{}};case`getPastState`:return{type:`getPastState`,query:e.query,uiIdentifier:t.identifier,...n.teamIndex===void 0?{}:{teamId:`team-${n.teamIndex+1}`}};case`getAllTeamsParticipants`:return{type:`getAllTeamsParticipants`,uiIdentifier:t.identifier};default:return null}}var YM={game:{required:[`stateChanged`,`setSettings`,`setTheme`,`setLocale`,`setAssetUrls`,`setParticipant`],alsoSent:[`setTimer`,`setViewerRole`,`setOwnTeam`,`setOwnTeamJoinLink`,`setParticipantList`,`setTeamList`,`setRunKind`,`setScenarioName`,`setRoundProcessing`,`setCrossTeamData`,`themePreferenceChanged`],isPlayerSurface:!0},"waiting-room":{required:[`stateChanged`,`setSettings`,`setTheme`,`setLocale`,`setAssetUrls`,`setParticipant`],alsoSent:[`setTimer`,`setViewerRole`,`setOwnTeam`,`setOwnTeamJoinLink`,`setParticipantList`,`setTeamList`,`setRunKind`,`setScenarioName`,`setCrossTeamData`,`themePreferenceChanged`],isPlayerSurface:!0},session:{required:[`setSessionMeta`,`setSessionData`,`setSettings`,`setTheme`,`setLocale`,`setAssetUrls`,`setTeamConfiguration`],alsoSent:[`setTeamList`,`setParticipantList`,`setTeamLinks`,`setAvailableOverlays`,`setRunKind`,`setScenarioName`,`setWalkthroughLink`,`themePreferenceChanged`],isPlayerSurface:!1},presentation:{required:[`setPresentation`,`setSettings`,`setTheme`,`setLocale`,`setAssetUrls`],alsoSent:[`themePreferenceChanged`],isPlayerSurface:!1},setup:{required:[`setSettings`,`setTheme`,`setLocale`,`setAssetUrls`],alsoSent:[`themePreferenceChanged`],isPlayerSurface:!1},"scenario-editor":{required:[`setSettings`,`setTheme`,`setLocale`,`setAssetUrls`],alsoSent:[`themePreferenceChanged`],isPlayerSurface:!1}};function XM(e,t={}){let{required:n,isPlayerSurface:r}=YM[e];return!t.observer||!r?n:n.filter(e=>e!==`setParticipant`)}var ZM=new Set([`callEndpoint`,`uploadBlob`,`getPastState`,`getAllTeamsParticipants`]),QM=class{options;host;logger;port=null;readyListener=null;loadListener=null;handshakeTimer=null;disposed=!1;lastSent=new Map;sticky=new Map;outbound=[];pending=new Map;requestCounter=0;constructor(e){this.options=e,this.host=e.window??globalThis.window,this.logger=e.logger??console,this.listenForReady()}get connected(){return this.port!==null}send(e){this.disposed||(this.lastSent.set(e.type,$M(e)),this.port?this.port.postMessage(e):this.outbound.push(e))}sendState(e){this.disposed||(this.sticky.set(e.type,e),this.lastSent.set(e.type,$M(e)),this.port?.postMessage(e))}sendIfChanged(e){return this.disposed||this.lastSent.get(e.type)===$M(e)?!1:(this.sendState(e),!0)}sendInitialBatch(e){let t=XM(this.options.surface,{observer:this.options.observer}),n=new Set(e.map(e=>e.type)),r=t.filter(e=>!n.has(e));if(r.length>0)throw Error(`Initial batch for a "${this.options.surface}" surface is missing ${r.join(`, `)}. The guest blocks its first paint on ${t.join(`, `)}.`);for(let t of e)this.sendState(t)}request(e,t=3e4){let n=`host-${++this.requestCounter}`;return new Promise((r,i)=>{let a=setTimeout(()=>{this.pending.delete(n),i(Error(`Guest did not answer "${e.type}" in ${t}ms`))},t);this.pending.set(n,{resolve:()=>{clearTimeout(a),r()},reject:e=>{clearTimeout(a),i(e)}}),this.send({...e,requestId:n})})}dispose(){this.disposed||(this.disposed=!0,this.clearHandshakeTimer(),this.readyListener&&=(this.host.removeEventListener(`message`,this.readyListener),null),this.loadListener&&=(this.options.iframe.removeEventListener?.(`load`,this.loadListener),null),this.closePort(),this.rejectPending(`Channel disposed`),this.options.onTeardown?.(`disposed`))}listenForReady(){let e=e=>{if(this.disposed)return;let t=e.data;if(!t||t.type!==`ready`||e.source!==this.options.iframe.contentWindow)return;if(e.origin!==this.options.iframeOrigin){this.logger.warn(`[${this.options.uiIdentifier}] ignoring a handshake from ${e.origin}; this frame is pinned to ${this.options.iframeOrigin}`);return}let n=t.protocolVersion;typeof n==`number`&&n!==4&&this.logger.warn(`[${this.options.uiIdentifier}] host↔iframe protocol version mismatch: iframe ${n}, host 4`),this.connect(t.signalsRendered===!0)};this.readyListener=e,this.host.addEventListener(`message`,e),this.armHandshakeTimer(),this.listenForLoads()}listenForLoads(){let{iframe:e}=this.options;if(!e.addEventListener)return;let t=()=>{this.disposed||(this.armHandshakeTimer(),this.port?.postMessage({type:`ping`}))};this.loadListener=t,e.addEventListener(`load`,t)}armHandshakeTimer(){this.clearHandshakeTimer();let e=this.options.handshakeTimeoutMs??1e4;this.handshakeTimer=setTimeout(()=>{this.handshakeTimer=null,!this.disposed&&(this.closePort(),this.options.onTeardown?.(`handshake-timeout`))},e)}connect(e){this.closePort(),this.rejectPending(`Connection reset`),this.lastSent.clear();let t=[...this.sticky.values()],n=new MessageChannel;this.port=n.port1,this.port.onmessage=e=>this.receive(e.data),this.port.start(),this.clearHandshakeTimer(),this.options.iframe.contentWindow?.postMessage({type:`init`,protocolVersion:4,sessionKey:this.options.sessionKey},this.options.iframeOrigin,[n.port2]);for(let e of t)this.sendState(e);let r=this.outbound;this.outbound=[];for(let e of r)this.port.postMessage(e);this.options.onConnect?.({signalsRendered:e})}closePort(){this.port&&=(this.port.onmessage=null,this.port.close(),null)}clearHandshakeTimer(){this.handshakeTimer!==null&&(clearTimeout(this.handshakeTimer),this.handshakeTimer=null)}rejectPending(e){for(let{reject:t}of this.pending.values())t(Error(e));this.pending.clear()}receive(e){if(e&&typeof e.type==`string`){switch(e.type){case`pong`:this.clearHandshakeTimer();return;case`rendered`:this.options.onRendered?.();return;case`refreshAssetAuth:response`:{let{requestId:t,ok:n,error:r}=e;if(typeof t!=`string`)return;let i=this.pending.get(t);this.pending.delete(t),n?i?.resolve():i?.reject(Error(r??`Asset auth refresh failed`));return}}ZM.has(e.type)?this.answer(e):this.options.onMessage?.(e)}}async answer(e){let t=e.requestId;if(typeof t!=`string`){this.logger.warn(`[${this.options.uiIdentifier}] dropped a "${e.type}" with no requestId`);return}let n=`${e.type}:response`;try{let r=await this.dispatch(e);this.send({type:n,requestId:t,ok:!0,...r})}catch(r){this.send(e.type===`callEndpoint`?{type:n,requestId:t,ok:!1,...eN(r)}:{type:n,requestId:t,ok:!1,error:r instanceof Error?r.message:String(r)})}}async dispatch(e){let t=this.options.adapter,n={uiIdentifier:this.options.uiIdentifier,...this.options.origin};switch(e.type){case`callEndpoint`:if(!t?.callEndpoint)throw Error(`This host serves no endpoints`);return{response:await t.callEndpoint({endpointIdentifier:String(e.endpointIdentifier),request:e.request},n)};case`uploadBlob`:if(!t?.uploadBlob)throw Error(`This host stores no blobs`);return{reference:await t.uploadBlob({data:e.data,name:String(e.name),mimeType:String(e.mimeType)},n)};case`getPastState`:if(!t?.getPastState)throw Error(`This host serves no past state`);return{entries:await t.getPastState(e.query,n)};case`getAllTeamsParticipants`:return{participants:await t?.getAllTeamsParticipants?.(n)??[]};default:throw Error(`Unroutable request "${e.type}"`)}}};function $M(e){return typeof e!=`object`||!e?JSON.stringify(e)??`undefined`:Array.isArray(e)?`[${e.map($M).join(`,`)}]`:`{${Object.entries(e).filter(([,e])=>e!==void 0).sort(([e],[t])=>e<t?-1:+(e>t)).map(([e,t])=>`${JSON.stringify(e)}:${$M(t)}`).join(`,`)}}`}function eN(e){let t=typeof e==`object`&&e?e.failure:void 0;return typeof t==`object`&&t&&typeof t.outcome?.kind==`string`&&Array.isArray(t.applied)?t:{outcome:{kind:`error`,message:e instanceof Error?e.message:String(e)},applied:[]}}var tN=[`primary`,`secondary`,`success`,`error`,`warning`,`info`];function nN(e){let t=e.trim().toLowerCase(),n=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.exec(t);if(n){let e=n[1];e.length<=4&&(e=[...e].map(e=>e+e).join(``));let t=t=>parseInt(e.slice(t,t+2),16);return{r:t(0),g:t(2),b:t(4),a:e.length===8?t(6)/255:1}}let r=/^rgba?\(([^)]*)\)$/.exec(t);if(r){let e=r[1].split(/[\s,/]+/).filter(Boolean);if(e.length!==3&&e.length!==4)return null;let[t,n,i]=e.slice(0,3).map(e=>e.endsWith(`%`)?parseFloat(e)/100*255:parseFloat(e)),a=e[3],o=a===void 0?1:a.endsWith(`%`)?parseFloat(a)/100:parseFloat(a);return[t,n,i,o].some(e=>!Number.isFinite(e))?null:{r:rN(t,255),g:rN(n,255),b:rN(i,255),a:rN(o,1)}}return null}function rN(e,t){return Math.min(t,Math.max(0,e))}function iN(e,t){let n=(t,n)=>t*e.a+n*(1-e.a);return{r:n(e.r,t.r),g:n(e.g,t.g),b:n(e.b,t.b),a:1}}function aN({r:e,g:t,b:n}){let r=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return .2126*r(e)+.7152*r(t)+.0722*r(n)}function oN(e,t){let[n,r]=[aN(e),aN(t)].sort((e,t)=>t-e);return(n+.05)/(r+.05)}function sN({r:e,g:t,b:n}){let r=e=>Math.round(e).toString(16).padStart(2,`0`);return`#${r(e)}${r(t)}${r(n)}`}var cN={r:0,g:0,b:0,a:1},lN={r:255,g:255,b:255,a:1};function uN(e,t){let n=nN(e);if(!n)return sN(cN);let r=n.a<1?iN(n,lN):n,i=t===void 0?null:nN(t);if(i){let e=iN(i,r);if(oN(e,r)>=4.5)return sN(e)}return oN(cN,r)>=oN(lN,r)?sN(cN):sN(lN)}var dN={light:{background:`#ffffff`,surface:`#ffffff`,text:`#000000`},dark:{background:`#121212`,surface:`#1e1e1e`,text:`#ffffff`}};function fN(e){let{background:t,surface:n,text:r}=e;if(!t||!n)return;let i=nN(t),a=nN(n);if(!i||!a)return;let o=e=>e.a<1?iN(e,lN):e,s=[o(i),o(a)],c=e=>Math.min(...s.map(t=>oN(iN(e,t),t))),l=r===void 0?null:nN(r);if(l&&l.a===1&&c(l)>=4.5)return{background:t,surface:n,text:sN(l)};let u=c(cN)>=c(lN)?cN:lN;if(!(c(u)<4.5))return{background:t,surface:n,text:sN(u)}}function pN(e,t){let n=Object.fromEntries(tN.map(t=>[t,uN(e[t],e.contrastText?.[t])]));return{...Object.fromEntries(tN.map(t=>[t,e[t]])),contrastText:n,...fN(e)??dN[t]}}function mN(e){return{mode:e.mode,light:pN(e.light,`light`),dark:pN(e.dark,`dark`),brand:e.brand}}var hN={primary:{main:`#6B00FF`,contrastText:`#ffffff`},secondary:{main:`#17D1C7`,contrastText:`rgba(0,0,0,0.87)`},error:{main:`#DB324D`,contrastText:`#ffffff`},success:{main:`#00c894`,contrastText:`rgba(0,0,0,0.87)`},warning:{main:`#ffb65c`,contrastText:`rgba(0,0,0,0.87)`},info:{main:`#336BEB`,contrastText:`#ffffff`}},gN={primary:{main:`#BC8CFF`,contrastText:`rgba(0,0,0,0.87)`},secondary:{main:`#17D1C7`,contrastText:`rgba(0,0,0,0.87)`},error:{main:`#ef7a8e`,contrastText:`rgba(0,0,0,0.87)`},success:{main:`#00c894`,contrastText:`rgba(0,0,0,0.87)`},warning:{main:`#ffb65c`,contrastText:`rgba(0,0,0,0.87)`},info:{main:`#7d9bf2`,contrastText:`rgba(0,0,0,0.87)`}},_N=`#414042`,vN=`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif`,yN=`"Work Sans", ${vN}`,bN=`Sora, ${vN}`;function xN(e){return{primary:e.primary.main,secondary:e.secondary.main,success:e.success.main,error:e.error.main,warning:e.warning.main,info:e.info.main,contrastText:{primary:e.primary.contrastText,secondary:e.secondary.contrastText,success:e.success.contrastText,error:e.error.contrastText,warning:e.warning.contrastText,info:e.info.contrastText}}}function SN(e,t){return mN(t?{mode:e,...t.theme}:{mode:e,light:xN(hN),dark:xN(gN),brand:{name:`Serious Gaming`}})}var CN=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`];function wN(e){return Xo({palette:e===`dark`?{mode:`dark`,...gN}:{mode:`light`,...hN,text:{primary:_N}},typography:{fontFamily:yN,...Object.fromEntries(CN.map(e=>[e,{fontFamily:bN}]))},components:{MuiButton:{styleOverrides:{root:{textTransform:`none`}}}}})}function TN(e){return e===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:e}function EN(e,t){return{"Content-Type":e.mimeType,"X-Blob-Name":encodeURIComponent(e.name),"X-Blob-Mime":e.mimeType,"X-Blob-Retention":t===`setup`?`settings`:t===`scenario-editor`?`scenario`:`game`}}var DN=5e3,ON=[`allow-scripts`,`allow-same-origin`,`allow-forms`,`allow-downloads`,`allow-modals`,`allow-presentation`,`allow-popups`,`allow-popups-to-escape-sandbox`].join(` `),kN=[`clipboard-write`,`autoplay`,`screen-wake-lock`,`fullscreen`,`microphone`,`camera`,`geolocation`,`picture-in-picture`,`web-share`,`gamepad`,`window-management`,`speaker-selection`].join(`; `);function AN(e){return Object.assign(Error(e.outcome.message??e.outcome.kind),{failure:e})}function jN(e,t,n){return async r=>{let i=JM(r,e,t)??qM(r,e,t);return KM(i)?{ok:!1,outcome:{kind:`denied`,message:i.refused}}:i?n(i):null}}function MN(e,t,n){return JSON.stringify([e.kind,e.identifier,t.observer??null,t.teamIndex??null,t.participantId??null,t.role??null,n])}function NN({surface:e,viewer:t,feed:n,mode:r,resolved:i,onModeChange:a,rejection:o,hookFailure:s,onTeardown:c}){let l=n.kind===`view`?n.dispatch:jN(e,t,n.send),u=e.origin??window.location.origin,d=(0,E.useRef)(null),f=(0,E.useRef)(null),p=LN(n),m=(0,E.useRef)({dispatch:l,onModeChange:a,overlays:p});m.current={dispatch:l,onModeChange:a,overlays:p};let[h,g]=(0,E.useState)(!1),[_,v]=(0,E.useState)(!1),[y,b]=(0,E.useState)(!1),{selected:x}=ab(),{hold:S}=fb(),C=n.kind===`view`?n.sessionKey:Xc(n.state,e,{sessionless:n.sessionless===!0});return(0,E.useEffect)(()=>{let n=d.current;if(!n)return;let r;return r=new QM({iframe:n,surface:e.kind,uiIdentifier:e.identifier,iframeOrigin:u,sessionKey:C,adapter:{callEndpoint:async({endpointIdentifier:e,request:t})=>{let n=await m.current.dispatch({type:`callEndpoint`,endpointIdentifier:e,request:t});if(n&&`type`in n){if(n.type===`endpoint`)return n.response;if(n.type===`endpointFailure`)throw AN(n.failure)}throw AN({outcome:n&&`ok`in n&&!n.ok?n.outcome:{kind:`error`,message:`The endpoint did not answer`},applied:[]})},uploadBlob:async t=>{let n=await(await fetch(`/api/blobs`,{method:`POST`,headers:EN(t,e.kind),body:t.data})).json();if(!n.reference)throw Error(`The blob was not stored`);return n.reference},getPastState:async e=>{let t=await m.current.dispatch({type:`getPastState`,query:e});return t&&`type`in t&&t.type===`pastState`?t.entries:[]},getAllTeamsParticipants:async()=>{let e=await m.current.dispatch({type:`getAllTeamsParticipants`});return e&&`type`in e&&e.type===`participants`?e.participants:[]}},observer:t.observer===!0,onConnect:({signalsRendered:e})=>{g(!0),v(!e),b(!1)},onRendered:()=>v(!0),onTeardown:e=>{e===`handshake-timeout`&&(g(!1),b(!0),c?.())},onMessage:e=>{e.type===`setThemePreference`?m.current.onModeChange?.(e.preference):FN(r,e,m.current.dispatch,m.current.overlays)}}),f.current=r,()=>{r.dispose(),f.current=null,g(!1),v(!1)}},[e.identifier,e.kind,t.observer,t.teamIndex,t.participantId,t.role,C,S]),(0,E.useEffect)(()=>{let a=f.current;if(!a)return;let o={mode:i,preference:r,palette:SN(i,x)},s=n.kind===`view`?[...n.messages,...Zc(o)]:nl({surface:e,state:n.state,viewer:t,theme:o,origin:window.location.origin,assetOrigin:u,gameName:n.state.game.name,...n.hasGuide===void 0?{}:{hasGuide:n.hasGuide},...n.roundProcessing===void 0?{}:{roundProcessing:n.roundProcessing},...n.sessionless===void 0?{}:{sessionless:n.sessionless}});if(S===`surface`)for(let e of cb(s,S))a.sendIfChanged(e);else if(a.connected)for(let e of s)a.sendIfChanged(e);else a.sendInitialBatch(s)},[e,n,t,r,i,u,x,S]),(0,E.useEffect)(()=>{if(!h||_||S===`host`)return;let e=setTimeout(()=>v(!0),DN);return()=>clearTimeout(e)},[h,_,S]),(0,E.useEffect)(()=>{let e=f.current;e&&o&&(o.teamIndex===void 0||o.teamIndex===t.teamIndex)&&e.send({type:`validationRejected`,rejections:o.rejections})},[o?.nonce,o,t.teamIndex]),(0,E.useEffect)(()=>{let t=f.current;t&&s&&e.kind===`session`&&t.send({type:`hookFailed`,payload:s.payload})},[s?.nonce,s,e.kind]),(0,V.jsxs)(im,{sx:{position:`relative`,width:`100%`,height:`100%`},children:[(0,V.jsx)(im,{component:`iframe`,ref:d,title:e.identifier,src:`${u}${e.src}?expectedParentOrigin=${encodeURIComponent(window.location.origin)}`,sandbox:ON,allow:kN,sx:{width:`100%`,height:`100%`,border:0,display:`block`}},`${MN(e,t,C)}:${S}`),(!h||S===`host`||!_&&S!==`surface`)&&(0,V.jsx)(ly,{spacing:2,"data-testid":`surface-loading`,sx:{alignItems:`center`,justifyContent:`center`,position:`absolute`,inset:0,bgcolor:`background.default`},children:y?(0,V.jsx)(Z,{color:`text.secondary`,children:`This surface did not connect. Check its console for an error.`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(BN,{brand:x,resolved:i}),(0,V.jsxs)(Z,{color:`text.secondary`,variant:`body2`,children:[`Loading `,e.identifier]})]})})]})}function PN(e,t,n){return e!==`facilitator-guide`&&e!==`print-sheets`?`"${String(e)}" is not a host overlay`:n.available.includes(e)?e===`print-sheets`&&t!==void 0&&n.teamIds!==void 0&&!n.teamIds.includes(String(t))?`There is no team "${String(t)}" to print`:null:`This host does not offer the "${e}" overlay for this game`}async function FN(e,t,n,r={available:[`facilitator-guide`,`print-sheets`]}){if(t.type===`setThemePreference`)return;if(t.type===`openHostOverlay`){let n=PN(t.overlay,t.target,r);n||IN(t.overlay,t.target),RN(e,t,n?{ok:!1,outcome:{kind:`denied`,message:n}}:{ok:!0});return}let i;try{i=await n(t)}catch(e){i={ok:!1,outcome:{kind:`error`,message:e instanceof Error?e.message:`The command failed`}}}if(!i){RN(e,t,{ok:!1,outcome:{kind:`denied`,message:`This host does not handle "${String(t.type)}"`}});return}let a=typeof t.requestId==`string`?t.requestId:null;a&&(`ok`in i?e.send(i.ok?{type:`mutation:response`,requestId:a,ok:!0,...i.committedAtTick===void 0?{}:{committedAtTick:i.committedAtTick}}:{type:`mutation:response`,requestId:a,ok:!1,outcome:i.outcome}):e.send({type:`mutation:response`,requestId:a,ok:!0}))}function IN(e,t){if(e===`facilitator-guide`)return window.open(`/guide`,`_blank`,`noreferrer`),!0;if(e===`print-sheets`){let e=typeof t==`string`?`?team=${encodeURIComponent(t)}`:``;return window.open(`/print${e}`,`_blank`,`noreferrer`),!0}return!1}function LN(e){if(e.kind===`operator`)return{available:ll(e.hasGuide),teamIds:e.state.teams.map(e=>e.teamId)};let t=e.messages.find(e=>e.type===`setAvailableOverlays`),n=e.messages.find(e=>e.type===`setTeamList`);return{available:Array.isArray(t?.overlays)?t.overlays:[],...Array.isArray(n?.payload)?{teamIds:n.payload.map(e=>e.teamId)}:{}}}function RN(e,t,n){typeof t.requestId==`string`&&e.send({type:`mutation:response`,requestId:t.requestId,...n})}function zN(e,t){return t===`dark`?e?.onDark??e?.onLight:e?.onLight??e?.onDark}function BN({brand:e,resolved:t}){let n=zN(e?.loader,t);if(n)return(0,V.jsx)(im,{component:`img`,src:n,alt:``,sx:{width:72,height:72}});let r=zN(e?.theme.brand?.logo,t),i=e?.theme[t].primary;return(0,V.jsxs)(V.Fragment,{children:[r&&(0,V.jsx)(im,{component:`img`,src:r,alt:e?.name??``,sx:{maxHeight:48,maxWidth:`min(320px, 80%)`,objectFit:`contain`}}),(0,V.jsx)(nd,{size:28,sx:i?{color:i}:void 0})]})}function VN({scenario:e,surface:t,state:n,mode:r,resolved:i,send:a,onModeChange:o,rejection:s}){let[c,l]=(0,E.useState)(!1),[u,d]=(0,E.useState)(!1),[f,p]=(0,E.useState)(null),m=e===``?null:e,h=n.scenarioDrafts?.some(e=>e.scenarioId===m)===!0,[g,_]=(0,E.useState)(null);(0,E.useEffect)(()=>{h||a({type:`editScenario`,scenarioId:m}).then(e=>{`ok`in e&&!e.ok&&_(e.outcome.message??`The scenario could not be opened`)})},[h,m,a]);let v=async()=>{l(!0),p(null);try{let t=await fetch(`/api/scenarios`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({identifier:e,overwrite:!0,draft:!0})});if(!t.ok){let e=await t.json();p(e.error??`The scenario could not be saved`);return}d(!0)}finally{l(!1)}};return(0,V.jsxs)(im,{sx:{display:`flex`,flexDirection:`column`,height:`100vh`},children:[(0,V.jsx)(Ad,{position:`static`,color:`default`,elevation:1,children:(0,V.jsxs)(vy,{variant:`dense`,sx:{gap:2},children:[(0,V.jsxs)(ly,{sx:{flex:1},children:[(0,V.jsx)(Z,{variant:`subtitle2`,children:`Editing scenario`}),(0,V.jsx)(Z,{variant:`caption`,color:`text.secondary`,children:e})]}),u&&!f&&(0,V.jsx)(Z,{variant:`body2`,color:`success.main`,children:`Saved`}),(0,V.jsx)(gm,{variant:`contained`,"data-testid":`save-scenario`,disabled:c,onClick:()=>void v(),children:`Save`}),(0,V.jsx)(gm,{href:`/`,children:`Done`})]})}),(f??g)&&(0,V.jsx)(bd,{severity:`error`,sx:{borderRadius:0},children:f??g}),(0,V.jsx)(im,{sx:{flex:1,minHeight:0,position:`relative`},children:h?t?(0,V.jsx)(NN,{surface:t,viewer:m===null?{}:{scenario:m},feed:{kind:`operator`,state:n,send:e=>(e.type===`updateScenarioDraft`&&d(!1),a(e))},mode:r,resolved:i,onModeChange:o,rejection:s}):(0,V.jsxs)(ly,{spacing:2,sx:{alignItems:`center`,justifyContent:`center`,height:`100%`,p:4},children:[(0,V.jsxs)(bd,{severity:`info`,sx:{maxWidth:560},children:[(0,V.jsxs)(Z,{gutterBottom:!0,children:[`This game has no `,(0,V.jsx)(`strong`,{children:`scenario_editor`}),` slot.`]}),(0,V.jsxs)(Z,{variant:`body2`,color:`text.secondary`,children:[`A scenario editor is optional (§6.5). Without one there is nothing to author a scenario in here; the values can still be set with`,` `,(0,V.jsx)(`code`,{children:`sdk configure`}),` and captured from the Scenario tab, and an agent can edit a game's settings directly from their schemas.`]})]}),(0,V.jsx)(gm,{href:`/`,children:`Back to the session`})]}):(0,V.jsxs)(ly,{spacing:2,sx:{alignItems:`center`,justifyContent:`center`,height:`100%`},children:[(0,V.jsx)(nd,{size:28}),(0,V.jsxs)(Z,{color:`text.secondary`,variant:`body2`,children:[`Opening `,e||`the package settings`]})]})})]})}var HN={processing:new Set,errors:[],rejection:null,hookFailure:null,reloads:0,restarted:null},UN=new Set([`bundles-reloaded`,`reinitialised-on-change`,`logic-reloaded`]);function WN(e=`session`){let[t,n]=(0,E.useState)(null),[r,i]=(0,E.useState)(!1),[a,o]=(0,E.useState)(0),[s,c]=(0,E.useState)(HN),l=(0,E.useRef)(null),u=(0,E.useRef)(null),d=(0,E.useRef)(new Map),f=(0,E.useRef)(0);(0,E.useEffect)(()=>{let t=!1,r,a=()=>{let s=e===`walkthrough`?`?run=walkthrough`:``,f=new WebSocket(`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/ws${s}`);l.current=f,f.onopen=()=>{i(!0),o(0),u.current!==null&&f.send(JSON.stringify({presence:u.current}))},f.onclose=()=>{i(!1),o(e=>e+1),t||(r=setTimeout(a,1e3))},f.onmessage=e=>{let t=JSON.parse(e.data);t.type===`result`?(d.current.get(t.requestId)?.(t.result),d.current.delete(t.requestId)):GN(t,n,c)}};return a(),()=>{t=!0,clearTimeout(r),l.current?.close()}},[e]);let p=(0,E.useCallback)(e=>{let t=l.current;if(!t||t.readyState!==WebSocket.OPEN)return Promise.resolve({ok:!1,outcome:{kind:`error`,message:`Not connected to the session`}});let n=`console-${++f.current}`;return new Promise(r=>{d.current.set(n,r),t.send(JSON.stringify({requestId:n,command:e}))})},[]),m=(0,E.useCallback)(e=>{if(u.current===e)return;u.current=e;let t=l.current;t&&t.readyState===WebSocket.OPEN&&t.send(JSON.stringify({presence:e}))},[]);return(0,E.useMemo)(()=>({state:t,connected:r,attempts:a,transients:s,send:p,announce:m}),[t,r,a,s,p,m])}function GN(e,t,n){switch(e.type){case`state`:t(e.state),UN.has(e.cause)&&n(t=>({...t,reloads:t.reloads+1,restarted:e.cause===`reinitialised-on-change`?{nonce:(t.restarted?.nonce??0)+1}:t.restarted}));return;case`round-processing`:n(t=>{let n=new Set(t.processing),r=e.teamIndex??-1;return e.processing?n.add(r):n.delete(r),{...t,processing:n}});return;case`error`:n(t=>({...t,errors:[...t.errors,`${e.source}: ${e.message}`],hookFailure:e.source.startsWith(`hook:`)?{payload:{signal:e.source.slice(5),teamId:e.teamId??``,message:e.message},nonce:(t.hookFailure?.nonce??0)+1}:t.hookFailure}));return;case`validation-rejected`:n(t=>({...t,rejection:{...e.teamIndex===void 0?{}:{teamIndex:e.teamIndex},rejections:e.rejections,nonce:(t.rejection?.nonce??0)+1}}));return}}function KN(){let[e,t]=(0,E.useState)(null),[n,r]=(0,E.useState)(!1),[i,a]=(0,E.useState)(0),[o,s]=(0,E.useState)(null),[c,l]=(0,E.useState)(null),u=(0,E.useRef)(null),d=(0,E.useRef)(new Map),f=(0,E.useRef)(0);(0,E.useEffect)(()=>{let e=!1,n,i=()=>{let o=encodeURIComponent(location.pathname+location.search),c=new WebSocket(`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/ws/view?page=${o}`);u.current=c,c.onopen=()=>{r(!0),a(0)},c.onclose=()=>{r(!1),a(e=>e+1),e||(n=setTimeout(i,1e3))},c.onmessage=e=>{let n=JSON.parse(e.data);switch(n.type){case`view`:(0,kp.flushSync)(()=>t({page:n.page,messages:n.messages}));return;case`result`:d.current.get(n.requestId)?.(n.result),d.current.delete(n.requestId);return;case`validation-rejected`:s(e=>({rejections:n.rejections,nonce:(e?.nonce??0)+1}));return;case`hookFailed`:l(e=>({payload:n.payload,nonce:(e?.nonce??0)+1}));return}}};return i(),()=>{e=!0,clearTimeout(n),u.current?.close()}},[]);let p=(0,E.useCallback)(e=>{let t=u.current;if(!t||t.readyState!==WebSocket.OPEN)return Promise.resolve({ok:!1,outcome:{kind:`error`,message:`Not connected to the session`}});let n=`view-${++f.current}`;return new Promise(r=>{d.current.set(n,r),t.send(JSON.stringify({requestId:n,message:e}))})},[]);return(0,E.useMemo)(()=>({view:e,connected:n,attempts:i,rejection:o,hookFailure:c,dispatch:p}),[e,n,i,o,c,p])}function qN(e){let t=(0,E.useMemo)(()=>Uc(location.pathname,location.search),[]);return gl(t)?(0,V.jsx)(JN,{...e}):(0,V.jsx)(XN,{...e,route:t})}function JN({mode:e,resolved:t,onModeChange:n}){let{view:r,connected:i,attempts:a,rejection:o,hookFailure:s,dispatch:c}=KN();if(!r)return(0,V.jsx)(nP,{connected:i,attempts:a});let{page:l,messages:u}=r;switch(l.status){case`redirect`:return location.replace(l.href),(0,V.jsx)(nP,{connected:i,attempts:a});case`configuring`:return(0,V.jsx)(YN,{children:`The facilitator is setting the session up. This page opens when it starts.`});case`closed`:return(0,V.jsx)(YN,{children:`This session has already started, so its configuration is closed.`});case`join`:return(0,V.jsx)(PM,{team:l.team??void 0,bare:!0});case`no-such-team`:return(0,V.jsx)(rP,{resolution:{kind:`no-such-team`,teamIndex:l.teamIndex},bare:!0});case`no-such-participant`:return(0,V.jsx)(rP,{resolution:{kind:`no-such-participant`,teamIndex:l.teamIndex,slot:l.slot,held:l.held},bare:!0});case`missing-surface`:return(0,V.jsx)(iP,{kind:l.kind});case`surface`:return(0,V.jsxs)(im,{sx:{display:`flex`,flexDirection:`column`,height:`100vh`},children:[!i&&(0,V.jsx)(eP,{attempts:a}),l.inSetup&&l.surface.kind===`setup`&&(0,V.jsx)(Ad,{position:`static`,color:`default`,elevation:1,children:(0,V.jsxs)(vy,{variant:`dense`,sx:{gap:2},children:[(0,V.jsx)(Z,{variant:`subtitle2`,sx:{flex:1},children:`Configure the session, then start it`}),(0,V.jsx)(gm,{variant:`contained`,"data-testid":`play`,onClick:()=>void c({type:`requestPlay`}),children:`Play`})]})}),(0,V.jsx)(im,{sx:{flex:1,minHeight:0,position:`relative`},children:(0,V.jsx)(NN,{surface:l.surface,viewer:l.viewer,feed:{kind:`view`,messages:u,dispatch:c,sessionKey:l.sessionKey},mode:e,resolved:t,onModeChange:n,rejection:o,hookFailure:s})})]})}}function YN({children:e}){return(0,V.jsx)(ly,{sx:{alignItems:`center`,justifyContent:`center`,height:`100vh`,p:4},children:(0,V.jsx)(bd,{severity:`info`,sx:{maxWidth:560},"data-testid":`view-notice`,children:(0,V.jsx)(Z,{children:e})})})}function XN({mode:e,resolved:t,onModeChange:n,route:r}){let{state:i,connected:a,attempts:o,transients:s,send:c,announce:l}=WN(r.run),[u,d]=(0,E.useState)(null),[f,p]=(0,E.useState)(!1);(0,E.useEffect)(()=>{fetch(`/api/surfaces`).then(e=>e.json()).then(d)},[s.reloads]);let[m,h]=(0,E.useState)([]);(0,E.useEffect)(()=>{fetch(`/api/session`).then(e=>e.json()).then(e=>h((e.warnings??[]).filter(e=>e.build)))},[s.reloads]);let[g,_]=(0,E.useState)(!1);(0,E.useEffect)(()=>{s.restarted&&_(!0)},[s.restarted]),(0,E.useEffect)(()=>{fetch(`/api/guide`).then(e=>e.json()).then(e=>p(e.guide!==null))},[s.reloads]);let v=i&&r.kind===`player`?(()=>{let e=pl(i,r);return e.kind===`viewer`?e.viewer.participantId??null:null})():null;if((0,E.useEffect)(()=>l(v),[l,v]),!i||!u)return(0,V.jsx)(nP,{connected:a,attempts:o});let y=u.some(e=>e.kind===`setup`),b=i.session.inSetup,x=r.kind===`guide`||r.kind===`print`||r.kind===`scenario-editor`||r.kind===`presentation`,S=b&&!x?{...r,kind:`setup`}:r;if(!b&&S.kind===`setup`)return(0,V.jsx)($N,{configurable:y,onReconfigure:()=>void c({type:`reconfigure`})});if(S.kind===`scenario-editor`)return S.scenario===void 0?(0,V.jsx)(tP,{}):(0,V.jsx)(VN,{scenario:S.scenario,surface:u.find(e=>e.kind===`scenario-editor`),state:i,mode:e,resolved:t,send:c,onModeChange:n,rejection:s.rejection});if(S.kind===`join`){let e=i.teams.find(e=>e.index===S.teamIndex);return e?.participants.length===1?(location.replace(Wc({kind:`player`,teamIndex:e.index,participant:1,bare:S.bare})),(0,V.jsx)(nP,{connected:a,attempts:o})):(0,V.jsx)(PM,{team:e,bare:S.bare})}let C=pl(i,S);if(C.kind!==`viewer`)return(0,V.jsx)(rP,{resolution:C,bare:S.bare,onAddParticipant:()=>void c({type:`addParticipant`,teamId:`team-${C.teamIndex+1}`})});let w=i.session.waitingRoomOpen&&(S.kind===`player`||S.kind===`waiting-room`)?`waiting-room`:ml[S.kind],T=w?u.find(e=>e.kind===w):void 0;return(0,V.jsxs)(im,{sx:{display:`flex`,flexDirection:`column`,height:`100vh`},children:[!a&&(0,V.jsx)(eP,{attempts:o}),Lc(i.session.pending)&&!S.bare&&(0,V.jsx)(ZN,{pending:i.session.pending,onReinitialise:()=>void c({type:`reset`})}),m.length>0&&!S.bare&&(0,V.jsx)(QN,{errors:m}),b&&(0,V.jsx)(Ad,{position:`static`,color:`default`,elevation:1,children:(0,V.jsxs)(vy,{variant:`dense`,sx:{gap:2},children:[(0,V.jsx)(Z,{variant:`subtitle2`,sx:{flex:1},children:`Configure the session, then start it`}),(0,V.jsx)(gm,{variant:`contained`,"data-testid":`play`,onClick:()=>void c({type:`play`}),children:`Play`})]})}),(0,V.jsx)(im,{sx:{flex:1,minHeight:0,position:`relative`},children:S.kind===`guide`?(0,V.jsx)(NM,{locale:i.session.locale,reloads:s.reloads}):S.kind===`print`?(0,V.jsx)(IM,{state:i}):T?(0,V.jsx)(NN,{surface:T,viewer:C.viewer,feed:{kind:`operator`,state:i,hasGuide:f,...S.kind===`presentation`?{sessionless:S.preview===!0}:{},roundProcessing:s.processing.has(-1)||C.viewer.teamIndex!==void 0&&s.processing.has(C.viewer.teamIndex),send:c},mode:e,resolved:t,onModeChange:n,rejection:s.rejection,hookFailure:s.hookFailure}):(0,V.jsx)(iP,{kind:w??`session`})}),!S.bare&&(0,V.jsx)(mb,{state:i,route:S,inSetup:b,configurable:y,connected:a,transients:s,mode:e,onModeChange:n,send:c}),(0,V.jsx)(Xv,{open:g,autoHideDuration:4e3,onClose:()=>_(!1),anchorOrigin:{vertical:`top`,horizontal:`center`},children:(0,V.jsx)(bd,{severity:`info`,"data-testid":`restarted-notice`,children:`Settings changed, game restarted`})})]})}function ZN({pending:e,onReinitialise:t}){return(0,V.jsxs)(bd,{severity:`warning`,square:!0,"data-testid":`pending-changes`,sx:{borderRadius:0,py:.25},action:(0,V.jsx)(gm,{size:`small`,color:`inherit`,"data-testid":`reinitialise`,onClick:t,children:`Re-initialise`}),children:[(0,V.jsx)(`strong`,{children:Rc(e)}),`. `,zc(e),`. Re-initialising returns play to tick 0.`]})}function QN({errors:e}){return(0,V.jsxs)(bd,{severity:`error`,square:!0,"data-testid":`build-errors`,sx:{borderRadius:0,py:.25},children:[(0,V.jsxs)(`strong`,{children:["`sdk build` would refuse this package (",e.length===1?`one error`:`${e.length} errors`,`)`]}),`. It runs here anyway, so it can be fixed while you watch.`,e.map((e,t)=>(0,V.jsx)(Z,{variant:`body2`,sx:{fontFamily:`monospace`},children:e.message},t))]})}function $N({configurable:e,onReconfigure:t}){return(0,V.jsxs)(ly,{spacing:2,sx:{alignItems:`center`,justifyContent:`center`,height:`100vh`,p:4},children:[(0,V.jsxs)(bd,{severity:`info`,sx:{maxWidth:560},children:[(0,V.jsx)(Z,{gutterBottom:!0,children:`This session has already started.`}),(0,V.jsx)(Z,{variant:`body2`,color:`text.secondary`,children:e?`Settings are resolved when a session initialises, so changing them now would change nothing until the session starts again. Reconfiguring puts the session back to its setup step and returns every team to tick 0.`:`This game has no setup step.`})]}),(0,V.jsxs)(ly,{direction:`row`,spacing:1,children:[e&&(0,V.jsx)(gm,{variant:`contained`,"data-testid":`reconfigure`,onClick:t,children:`Reconfigure`}),(0,V.jsx)(gm,{href:`/`,children:`Back to the session`})]})]})}function eP({attempts:e}){return(0,V.jsxs)(bd,{severity:`warning`,square:!0,"data-testid":`disconnected`,sx:{borderRadius:0,py:.25},action:(0,V.jsx)(gm,{size:`small`,color:`inherit`,onClick:()=>location.reload(),children:`Reload`}),children:[`Disconnected from the session — nothing on this page is live.`,e>1?` Retrying (${e}).`:` Retrying…`]})}function tP(){return(0,V.jsxs)(ly,{spacing:2,sx:{alignItems:`center`,justifyContent:`center`,height:`100vh`,p:4},children:[(0,V.jsxs)(bd,{severity:`info`,sx:{maxWidth:560},children:[(0,V.jsx)(Z,{gutterBottom:!0,children:`The scenario editor opens on a scenario.`}),(0,V.jsxs)(Z,{variant:`body2`,color:`text.secondary`,children:[`Open the dev drawer (press `,(0,V.jsx)(`kbd`,{children:"`"}),`) and use the Scenario tab:`,` `,(0,V.jsx)(`strong`,{children:`Add scenario`}),` to start a new one, or `,(0,V.jsx)(`strong`,{children:`Edit`}),` on an existing one. An editor with no scenario behind it has nowhere to save what you do in it.`]})]}),(0,V.jsx)(gm,{href:`/`,children:`Back to the session`})]})}function nP({connected:e,attempts:t}){let n=!e&&t>=2,r=$o().palette.mode===`dark`;return(0,V.jsxs)(ly,{spacing:2,sx:{alignItems:`center`,justifyContent:`center`,height:`100vh`,p:4},children:[(0,V.jsx)(im,{component:`img`,src:r?qy:Jy,alt:`Serious Gaming`,sx:{width:72,height:72}}),!n&&(0,V.jsx)(Z,{color:`text.secondary`,children:e?`Loading the session…`:`Connecting to the session…`}),n&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(bd,{severity:`warning`,sx:{maxWidth:620},children:[(0,V.jsxs)(Z,{gutterBottom:!0,children:[`Nothing is answering at`,` `,(0,V.jsxs)(`code`,{children:[location.host,`/ws`]}),`.`]}),(0,V.jsxs)(Z,{variant:`body2`,color:`text.secondary`,component:`div`,children:[`This page loaded, so something is serving it — most likely an older dev server still holding this port. Check two things:`,(0,V.jsxs)(`ul`,{style:{marginBottom:0},children:[(0,V.jsxs)(`li`,{children:[`The address your server actually printed. A port already in use makes it move to the next one, so it may be on`,` `,(0,V.jsx)(`code`,{children:Number(location.port||80)+1})]}),(0,V.jsxs)(`li`,{children:[`Whether an old one is still running:`,` `,(0,V.jsx)(`code`,{children:`pnpm run sdk dev status`}),`, and`,` `,(0,V.jsx)(`code`,{children:`pnpm run sdk dev stop`}),` to end it`]})]})]})]}),(0,V.jsx)(gm,{variant:`outlined`,onClick:()=>location.reload(),children:`Try again`})]})]})}function rP({resolution:e,bare:t,onAddParticipant:n}){let r=e.teamIndex+1;return(0,V.jsxs)(ly,{spacing:2,sx:{alignItems:`center`,justifyContent:`center`,height:`100vh`,p:4},"data-testid":`no-such-participant`,children:[(0,V.jsx)(bd,{severity:`warning`,sx:{maxWidth:560},children:e.kind===`no-such-team`?(0,V.jsxs)(Z,{gutterBottom:!0,children:[`This session has no team `,r,`. It may have been removed.`]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(Z,{gutterBottom:!0,children:[`Team `,r,` has`,` `,e.held===0?`no participants`:e.held===1?`one participant`:`${e.held} participants`,`, and this URL asks for participant `,e.slot,`.`]}),(0,V.jsx)(Z,{variant:`body2`,color:`text.secondary`,children:`A second tab is not a second participant. Add one, then open their surface: a participant is who a write is attributed to, and a surface with nobody behind it cannot submit one.`})]})}),e.kind===`no-such-participant`&&n&&(0,V.jsx)(gm,{variant:`contained`,onClick:n,"data-testid":`add-participant`,children:`Add participant`}),(0,V.jsxs)(gm,{size:`small`,href:Wc({kind:`observer`,teamIndex:e.teamIndex,bare:t}),children:[`Watch team `,r,` without joining`]})]})}function iP({kind:e}){return(0,V.jsxs)(ly,{spacing:2,sx:{alignItems:`center`,justifyContent:`center`,height:`100%`,p:4},children:[(0,V.jsxs)(bd,{severity:`info`,sx:{maxWidth:560},children:[(0,V.jsxs)(Z,{gutterBottom:!0,children:[`This package wires no `,(0,V.jsx)(`strong`,{children:e}),` surface.`]}),(0,V.jsx)(Z,{variant:`body2`,color:`text.secondary`,children:`A game supplies its own facilitator and player surfaces; the dev server renders them rather than substituting a console of its own, so there is nothing to show until the package fills that slot.`})]}),(0,V.jsx)(gm,{href:`/`,size:`small`,children:`Back to the session`})]})}function aP(){let[e,t]=(0,E.useState)(()=>localStorage.getItem(`theme`)??`light`),n=TN(e),r=(0,E.useMemo)(()=>wN(n),[n]);return(0,V.jsxs)(Ac,{theme:r,children:[(0,V.jsx)(ds,{}),(0,V.jsx)(ib,{children:(0,V.jsx)(db,{children:(0,V.jsx)(qN,{mode:e,resolved:n,onModeChange:e=>{localStorage.setItem(`theme`,e),t(e)}})})})]})}(0,Ic.createRoot)(document.getElementById(`root`)).render((0,V.jsx)(E.StrictMode,{children:(0,V.jsx)(aP,{})}));
203
+ `}),n}function SM(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function CM(e,t){let n=_M(e,t),r=n.one(e,void 0),i=mM(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
204
+ `},i)),a}function wM(e,t){return e&&`run`in e?async function(n,r){let i=CM(n,{file:r,...t});await e.run(i,r)}:function(n,r){return CM(n,{file:r,...e||t})}}var TM=[],EM={allowDangerousHtml:!0},DM=/^(https?|ircs?|mailto|xmpp)$/i,OM=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function kM(e){let t=AM(e),n=jM(e);return MM(t.runSync(t.parse(n),n),e)}function AM(e){let t=e.rehypePlugins||TM,n=e.remarkPlugins||TM,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...EM}:EM;return ik().use(kO).use(n).use(wM,r).use(t)}function jM(e){let t=e.children||``,n=new XO;return typeof t==`string`?n.value=t:``+t,n}function MM(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||NM;for(let e of OM)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return nw(e,l),ZA(e,{Fragment:V.Fragment,components:i,ignoreInvalidStyle:!0,jsx:V.jsx,jsxs:V.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in yj)if(Object.hasOwn(yj,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=yj[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function NM(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||DM.test(e.slice(0,t))?e:``}var PM={note:{label:`Note`,palette:`info`,icon:(0,V.jsx)(Vk,{fontSize:`small`})},warning:{label:`Warning`,palette:`warning`,icon:(0,V.jsx)(Kk,{fontSize:`small`})},tip:{label:`Tip`,palette:`success`,icon:(0,V.jsx)(Hk,{fontSize:`small`})},say:{label:`Say`,palette:`primary`,icon:(0,V.jsx)(Uk,{fontSize:`small`})},do:{label:`Do`,palette:`secondary`,icon:(0,V.jsx)(Wk,{fontSize:`small`})},timing:{label:`Timing`,palette:`info`,icon:(0,V.jsx)(Gk,{fontSize:`small`})}};function FM({type:e,children:t}){let n=PM[e];return(0,V.jsxs)(im,{sx:e=>({my:2,px:2,py:1.5,borderLeft:3,borderColor:`${n.palette}.main`,borderRadius:1,bgcolor:gi(e.palette[n.palette].main,.08),"& p:first-of-type":{mt:0},"& p:last-of-type":{mb:0}}),"data-testid":`guide-admonition-${e}`,children:[(0,V.jsxs)(Z,{variant:`overline`,component:`p`,sx:{display:`flex`,alignItems:`center`,gap:.75,fontWeight:600,lineHeight:1.5,mb:.5,color:`${n.palette}.main`},children:[n.icon,n.label]}),t]})}function IM(e){return`/api/guide/assets/${e.split(`/`).map(encodeURIComponent).join(`/`)}`}function LM({body:e,locale:t}){let n=zk(e);return n.ok?n.kind===`file`?(0,V.jsxs)(im,{component:`figure`,sx:{my:2,mx:0,maxWidth:720},"data-testid":`guide-video-file`,children:[(0,V.jsxs)(im,{component:`video`,controls:!0,preload:`metadata`,playsInline:!0,src:IM(n.src),poster:n.poster?IM(n.poster):void 0,"aria-label":n.title,sx:{display:`block`,width:`100%`,"@media print":{display:`none`}},children:[n.captions&&(0,V.jsx)(`track`,{kind:`captions`,src:IM(n.captions),srcLang:t,label:t,default:!0}),n.title]}),(0,V.jsxs)(im,{sx:{display:`none`,"@media print":{display:`block`}},children:[n.poster&&(0,V.jsx)(im,{component:`img`,src:IM(n.poster),alt:``,sx:{display:`block`,maxWidth:`100%`}}),n.title&&(0,V.jsx)(Z,{component:`figcaption`,variant:`body2`,children:n.title})]})]}):(0,V.jsx)(im,{sx:{my:2,position:`relative`,aspectRatio:`16 / 9`,maxWidth:720},"data-testid":`guide-video-embed`,children:(0,V.jsx)(im,{component:`iframe`,src:n.embedUrl,title:`${n.provider} video`,sandbox:`allow-scripts allow-same-origin allow-presentation`,allow:`encrypted-media; fullscreen; picture-in-picture`,referrerPolicy:`strict-origin-when-cross-origin`,sx:{position:`absolute`,inset:0,width:`100%`,height:`100%`,border:0}})}):(0,V.jsxs)(bd,{severity:`error`,sx:{my:2},"data-testid":`guide-video-error`,children:[`Video block error: `,n.error]})}function RM(e){return e.children.map(e=>e.type===`text`?e.value:e.type===`element`?RM(e):``).join(``)}function zM({markdown:e,chapterFile:t,locale:n,settings:r}){return(0,V.jsx)(kM,{remarkPlugins:[BD,US,[Ck,{settings:r,locale:n}],gk,_k,[kk,{chapterFile:t}]],urlTransform:e=>{let r=NM(e);if(!r)return;if(/^[a-z][a-z0-9+.-]*:/i.test(r)||r.startsWith(`//`)||r.startsWith(`#`)||r.startsWith(`/`))return r;let i=new URL(`/api/guide/content/${n}/${t}`,window.location.origin),a=new URL(r,i);if(a.origin===window.location.origin&&a.pathname.startsWith(`/api/guide/`))return a.pathname+a.search},components:{pre({node:e,children:t,...r}){let i=e?.children[0];return i&&i.type===`element`&&i.tagName===`code`&&Array.isArray(i.properties?.className)&&i.properties.className.includes(`language-video`)?(0,V.jsx)(LM,{body:RM(i),locale:n}):(0,V.jsx)(`pre`,{...r,children:t})},span(e){let{node:t,children:n,...r}=e;return typeof r[`data-guide-error`]==`string`?(0,V.jsx)(im,{component:`span`,"data-testid":`guide-setting-error`,sx:{color:`error.main`,fontStyle:`italic`},children:n}):(0,V.jsx)(`span`,{...r,children:n})},div(e){let{node:t,children:n,...r}=e,i=r;if(typeof i[`data-guide-error`]==`string`)return(0,V.jsx)(bd,{severity:`error`,sx:{my:2},"data-testid":`guide-setting-error`,children:n});let a=i[`data-admonition`];if(typeof a==`string`&&hk(a))return(0,V.jsx)(FM,{type:a,children:n});let o=i[`data-admonition-unknown`];return typeof o==`string`?(0,V.jsxs)(bd,{severity:`error`,sx:{my:2},"data-testid":`guide-admonition-unknown`,children:[`Unknown admonition type ":::`,o,`"`]}):(0,V.jsx)(`div`,{...e})},a({node:e,children:t,href:n,...r}){let i=typeof n==`string`&&/^https?:\/\//.test(n);return(0,V.jsx)(`a`,{href:n,...r,...i?{target:`_blank`,rel:`noreferrer noopener`}:{},children:t})}},children:e})}function BM(e){let t=e.replace(/\.md$/,``).replace(/^\d+[-_. ]*/,``).replace(/[-_]+/g,` `).trim();return t.charAt(0).toUpperCase()+t.slice(1)}function VM({locale:e,reloads:t}){let n=new URLSearchParams(window.location.search),[r,i]=(0,E.useState)(void 0),[a,o]=(0,E.useState)(n.get(`locale`)??e),[s,c]=(0,E.useState)(n.get(`chapter`)),[l,u]=(0,E.useState)(``);(0,E.useEffect)(()=>{fetch(`/api/guide`).then(e=>e.json()).then(e=>i(e.guide))},[t]);let d=(0,E.useMemo)(()=>Object.keys(r?.locales??{}),[r]),f=(0,E.useMemo)(()=>r?Ub(r.locales,r.chapters,a):[],[r,a]),p=(0,E.useMemo)(()=>f.map(e=>e.file),[f]),m=f.find(e=>e.file===s)?.locale??a;(0,E.useEffect)(()=>{if(r){if(p.length===0)return c(null);s&&p.includes(s)||c(p[0])}},[r,p,s]),(0,E.useEffect)(()=>{if(!r||!s)return u(``);let e=!0;return fetch(`/api/guide/content/${encodeURIComponent(m)}/${encodeURIComponent(s)}`).then(e=>e.ok?e.text():`This chapter could not be read.`).then(t=>{e&&u(t)}),()=>{e=!1}},[r,m,s,t]);let h=(0,E.useMemo)(()=>s&&l&&r?Ak(s,l,{settings:r.settings,locale:m}):[],[s,l,r,m]);return r===void 0?(0,V.jsx)(ly,{sx:{alignItems:`center`,justifyContent:`center`,height:`100%`},children:(0,V.jsx)(nd,{size:28})}):r===null?(0,V.jsx)(ly,{sx:{alignItems:`center`,justifyContent:`center`,height:`100%`,p:4},children:(0,V.jsx)(Z,{color:`text.secondary`,children:`This package declares no facilitator guide, or none of its chapters applies to this session.`})}):(0,V.jsxs)(ly,{direction:`row`,sx:{height:`100%`},children:[(0,V.jsxs)(im,{sx:{width:280,borderRight:1,borderColor:`divider`,overflow:`auto`,"@media print":{display:`none`}},children:[d.length>1&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(im,{sx:{p:2},children:(0,V.jsx)(zv,{size:`small`,fullWidth:!0,value:d.includes(a)?a:d[0]??``,onChange:e=>o(e.target.value),children:d.map(e=>(0,V.jsx)(Q_,{value:e,children:r.locales[e]?.name??e},e))})}),(0,V.jsx)(Mh,{})]}),(0,V.jsxs)(Lg,{dense:!0,children:[p.map(e=>(0,V.jsx)(Vg,{selected:e===s,onClick:()=>c(e),children:(0,V.jsx)(qg,{primary:BM(e)})},e)),p.length===0&&(0,V.jsx)(im,{sx:{px:2,py:1},children:(0,V.jsx)(Z,{variant:`body2`,color:`text.secondary`,children:`This guide has no chapters yet.`})})]}),h.some(e=>e.depth>1)&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Mh,{}),(0,V.jsx)(Z,{variant:`overline`,color:`text.secondary`,sx:{display:`block`,px:2,pt:1.5},children:`On this page`}),(0,V.jsx)(Lg,{dense:!0,disablePadding:!0,sx:{pb:2},children:h.filter(e=>e.depth>1).map(e=>(0,V.jsx)(Vg,{dense:!0,sx:{pl:2+(e.depth-2)*1.5,py:.25},onClick:()=>document.getElementById(e.id)?.scrollIntoView({block:`start`}),children:(0,V.jsx)(qg,{primary:e.text,slotProps:{primary:{variant:`body2`,color:`text.secondary`}}})},e.id))})]})]}),(0,V.jsx)(im,{sx:{flex:1,minWidth:0,overflow:`auto`},children:(0,V.jsxs)(im,{"data-testid":`guide-content`,sx:{maxWidth:780,mx:`auto`,px:4,py:3,"& img":{maxWidth:`100%`},"& pre":{p:2,borderRadius:1,overflow:`auto`,bgcolor:`action.hover`},"& table":{borderCollapse:`collapse`,width:`100%`},"& th, & td":{border:1,borderColor:`divider`,px:1,py:.5},"& h1, & h2, & h3":{scrollMarginTop:16},"@media print":{maxWidth:`none`,px:0,py:0}},children:[s&&m!==a&&(0,V.jsxs)(bd,{severity:`info`,"data-testid":`guide-untranslated`,sx:{mb:2,"@media print":{display:`none`}},children:[`This chapter is not yet translated into`,` `,r.locales[a]?.name??a,`, so it is shown in`,` `,r.locales[m]?.name??m,`.`]}),s&&(0,V.jsx)(zM,{markdown:l,chapterFile:s,locale:m,settings:r.settings})]})})]})}function HM({team:e,bare:t}){return e?e.participants.length===0?(0,V.jsxs)(UM,{children:[(0,V.jsxs)(ly,{spacing:1,sx:{alignItems:`center`,maxWidth:420},children:[(0,V.jsx)(Z,{variant:`overline`,color:`text.secondary`,children:e.name}),(0,V.jsx)(Z,{variant:`h5`,children:`Nobody is on this team yet`}),(0,V.jsxs)(Z,{color:`text.secondary`,sx:{textAlign:`center`},children:[`Add a participant from the dev drawer, or with`,` `,(0,V.jsxs)(`code`,{children:[`sdk participant add --team `,e.index+1]}),`, and they will be listed here.`]})]}),(0,V.jsx)(gm,{size:`small`,href:Wc({kind:`observer`,teamIndex:e.index,bare:t}),children:`Watch without joining`})]}):(0,V.jsxs)(UM,{children:[(0,V.jsxs)(ly,{spacing:1,sx:{alignItems:`center`},children:[(0,V.jsx)(Z,{variant:`overline`,color:`text.secondary`,children:e.name}),(0,V.jsx)(Z,{variant:`h5`,children:`Who are you?`})]}),(0,V.jsx)(ly,{spacing:1.5,sx:{width:`100%`,maxWidth:420},children:e.participants.map((n,r)=>(0,V.jsx)(bm,{variant:`outlined`,"data-testid":`join-participant`,children:(0,V.jsxs)(Em,{href:Wc({kind:`player`,teamIndex:e.index,participant:r+1,bare:t}),sx:{p:2},children:[(0,V.jsx)(Z,{variant:`subtitle1`,children:n.name}),(0,V.jsxs)(Z,{variant:`body2`,color:`text.secondary`,children:[`Participant `,r+1]})]})},n.id))}),(0,V.jsx)(gm,{size:`small`,href:Wc({kind:`observer`,teamIndex:e.index,bare:t}),children:`Watch without joining`})]}):(0,V.jsxs)(UM,{children:[(0,V.jsx)(Z,{color:`text.secondary`,children:`This session has no such team. It may have been removed.`}),(0,V.jsx)(gm,{href:`/`,children:`Back to the session`})]})}function UM({children:e}){return(0,V.jsx)(ly,{spacing:3,sx:{alignItems:`center`,justifyContent:`center`,height:`100%`,p:4,bgcolor:`background.default`},children:(0,V.jsx)(im,{sx:{display:`contents`},children:e})})}function WM({state:e}){let t=new URLSearchParams(window.location.search).get(`team`),n=t?e.teams.filter(e=>e.teamId===t):e.teams;return(0,E.useEffect)(()=>{let t=document.title;return document.title=`${e.game.name} — team sheets`,()=>{document.title=t}},[e.game.name]),(0,V.jsxs)(im,{"data-testid":`print-sheets`,sx:{height:`100%`,overflow:`auto`,bgcolor:`background.default`,"@media print":{height:`auto`,overflow:`visible`}},children:[(0,V.jsxs)(ly,{direction:`row`,spacing:2,sx:{alignItems:`center`,p:2,"@media print":{display:`none`}},children:[(0,V.jsx)(Z,{variant:`h6`,sx:{flex:1},children:`Team sheets`}),(0,V.jsx)(gm,{variant:`contained`,onClick:()=>window.print(),children:`Print`})]}),n.map(t=>(0,V.jsxs)(im,{sx:{m:2,p:4,bgcolor:`background.paper`,border:1,borderColor:`divider`,borderRadius:1,"@media print":{breakAfter:`page`,breakInside:`avoid`,border:0,m:0}},children:[(0,V.jsx)(Z,{variant:`overline`,color:`text.secondary`,children:e.game.name}),(0,V.jsx)(Z,{variant:`h3`,gutterBottom:!0,children:t.name}),(0,V.jsx)(Mh,{sx:{my:2}}),(0,V.jsx)(Z,{variant:`subtitle2`,gutterBottom:!0,children:`Open your screen at`}),(0,V.jsx)(Z,{sx:{fontFamily:`monospace`,fontSize:18,mb:3,wordBreak:`break-all`},children:`${window.location.origin}${Wc({kind:`player`,teamIndex:t.index,participant:1})}`}),(0,V.jsx)(Z,{variant:`subtitle2`,gutterBottom:!0,children:`On this team`}),(0,V.jsxs)(ly,{spacing:.5,children:[t.participants.map((e,n)=>(0,V.jsxs)(Z,{children:[n+1,`. `,e.name,(0,V.jsx)(Z,{component:`span`,variant:`caption`,color:`text.secondary`,sx:{ml:1,fontFamily:`monospace`},children:Wc({kind:`player`,teamIndex:t.index,participant:n+1})})]},e.id)),t.participants.length===0&&(0,V.jsx)(Z,{color:`text.secondary`,children:`Nobody yet.`})]})]},t.teamId))]})}var GM={game:new Set([`updateData`,`requestTick`,`renameOwnTeam`]),"waiting-room":new Set([`updateData`,`requestTick`,`renameOwnTeam`]),session:new Set([`updateSessionData`,`updateSharedData`,`requestTick`,`undoTick`,`resetGame`,`resetWalkthrough`,`setWaitingRoom`,`createTeam`,`renameTeam`,`renameParticipant`,`moveParticipant`,`deleteTeam`,`pauseTimer`,`resumeTimer`,`extendTick`]),setup:new Set([`updateSettings`,`requestPlay`]),"scenario-editor":new Set([`updateSettings`]),presentation:new Set},KM={setWaitingRoom:`The waiting room is session-wide, so setWaitingRoom takes no teamId`,renameOwnTeam:`renameOwnTeam renames the caller's own team, which the host resolves; it takes no teamId`,resetWalkthrough:`A walkthrough holds one team, so resetWalkthrough takes no teamId`},qM={game:new Set([`callEndpoint`,`getPastState`,`getAllTeamsParticipants`]),"waiting-room":new Set([`callEndpoint`,`getPastState`,`getAllTeamsParticipants`]),session:new Set([`callEndpoint`,`getPastState`]),setup:new Set([`callEndpoint`]),"scenario-editor":new Set([`callEndpoint`]),presentation:new Set([`getPastState`])};function JM(e){return e.teamIndex===void 0?{}:{teamIndex:e.teamIndex}}function YM(e){return e.participantId===void 0?{}:{participantId:e.participantId,teamId:`team-${(e.teamIndex??0)+1}`}}function XM(e){return e.role===void 0?{}:{viewerRole:e.role}}function ZM(e){return{...JM(e),...YM(e),...XM(e)}}function QM(e){let t=typeof e==`string`?/^team-([1-9]\d*)$/.exec(e):null;return t?Number(t[1])-1:-1}function $M(e,t){return e.teamId===void 0?t:{teamIndex:QM(e.teamId)}}function eN(e){return typeof e==`object`&&!!e&&`refused`in e}function tN(e,t,n){if(!GM[t.kind].has(e.type))return null;if(e.teamId!==void 0&&e.type in KM)return{refused:KM[e.type]};let r=JM(n),i=YM(n),a=XM(n);switch(e.type){case`updateData`:return{type:`updateContext`,uiIdentifier:t.identifier,payload:e.payload,...e.deletes?{deletes:e.deletes}:{},...r,...i,...a};case`updateSessionData`:return{type:`updateContext`,payload:e.payload,teamIndex:QM(e.teamId),sessionUiIdentifier:t.identifier,...e.deletes?{deletes:e.deletes}:{}};case`updateSharedData`:return{type:`updateSharedContext`,uiIdentifier:t.identifier,payload:e.payload,...e.deletes?{deletes:e.deletes}:{}};case`updateSettings`:return t.kind===`scenario-editor`?{type:`updateScenarioDraft`,scenarioId:n.scenario??null,payload:e.payload,uiIdentifier:t.identifier}:{type:`updateSettings`,payload:e.payload,uiIdentifier:t.identifier};case`requestTick`:return{type:`tick`,...$M(e,r),...t.kind===`session`?{}:{...i,...a}};case`undoTick`:return{type:`undo`,...$M(e,r)};case`resetGame`:return{type:`reset`,...$M(e,{})};case`setWaitingRoom`:return{type:`setWaitingRoom`,open:e.open===!0};case`resetWalkthrough`:return{type:`resetWalkthrough`};case`createTeam`:return{type:`addTeam`,...typeof e.name==`string`?{name:e.name}:{}};case`renameTeam`:return{type:`renameTeam`,teamId:String(e.teamId),name:String(e.name)};case`renameOwnTeam`:return{type:`renameOwnTeam`,name:String(e.name),...i};case`renameParticipant`:return{type:`renameParticipant`,participantId:String(e.participantId),name:String(e.name)};case`moveParticipant`:return{type:`moveParticipant`,participantId:String(e.participantId),teamId:String(e.teamId)};case`deleteTeam`:return{type:`removeTeam`,teamIndex:QM(e.teamId)};case`requestPlay`:return{type:`play`};case`pauseTimer`:return{type:`pauseTimer`,...$M(e,r)};case`resumeTimer`:return{type:`resumeTimer`,...$M(e,r)};case`extendTick`:return{type:`extendTick`,byMs:Number(e.byMs??0),...$M(e,r)};default:return null}}function nN(e,t,n){if(!qM[t.kind].has(e.type))return null;switch(e.type){case`callEndpoint`:return{type:`callEndpoint`,endpointIdentifier:String(e.endpointIdentifier),request:e.request,uiIdentifier:t.identifier,...ZM(n),...t.kind===`scenario-editor`?{scenarioId:n.scenario??null}:{}};case`getPastState`:return{type:`getPastState`,query:e.query,uiIdentifier:t.identifier,...n.teamIndex===void 0?{}:{teamId:`team-${n.teamIndex+1}`}};case`getAllTeamsParticipants`:return{type:`getAllTeamsParticipants`,uiIdentifier:t.identifier};default:return null}}var rN={game:{required:[`stateChanged`,`setSettings`,`setTheme`,`setLocale`,`setAssetUrls`,`setParticipant`],alsoSent:[`setTimer`,`setViewerRole`,`setOwnTeam`,`setOwnTeamJoinLink`,`setParticipantList`,`setTeamList`,`setRunKind`,`setScenarioName`,`setRoundProcessing`,`setCrossTeamData`,`themePreferenceChanged`],isPlayerSurface:!0},"waiting-room":{required:[`stateChanged`,`setSettings`,`setTheme`,`setLocale`,`setAssetUrls`,`setParticipant`],alsoSent:[`setTimer`,`setViewerRole`,`setOwnTeam`,`setOwnTeamJoinLink`,`setParticipantList`,`setTeamList`,`setRunKind`,`setScenarioName`,`setCrossTeamData`,`themePreferenceChanged`],isPlayerSurface:!0},session:{required:[`setSessionMeta`,`setSessionData`,`setSettings`,`setTheme`,`setLocale`,`setAssetUrls`,`setTeamConfiguration`],alsoSent:[`setTeamList`,`setParticipantList`,`setTeamLinks`,`setAvailableOverlays`,`setRunKind`,`setScenarioName`,`setWalkthroughLink`,`themePreferenceChanged`],isPlayerSurface:!1},presentation:{required:[`setPresentation`,`setSettings`,`setTheme`,`setLocale`,`setAssetUrls`],alsoSent:[`themePreferenceChanged`],isPlayerSurface:!1},setup:{required:[`setSettings`,`setTheme`,`setLocale`,`setAssetUrls`],alsoSent:[`themePreferenceChanged`],isPlayerSurface:!1},"scenario-editor":{required:[`setSettings`,`setTheme`,`setLocale`,`setAssetUrls`],alsoSent:[`themePreferenceChanged`],isPlayerSurface:!1}};function iN(e,t={}){let{required:n,isPlayerSurface:r}=rN[e];return!t.observer||!r?n:n.filter(e=>e!==`setParticipant`)}var aN=new Set([`callEndpoint`,`uploadBlob`,`getPastState`,`getAllTeamsParticipants`]),oN=class{options;host;logger;port=null;readyListener=null;loadListener=null;handshakeTimer=null;disposed=!1;lastSent=new Map;sticky=new Map;outbound=[];pending=new Map;requestCounter=0;constructor(e){this.options=e,this.host=e.window??globalThis.window,this.logger=e.logger??console,this.listenForReady()}get connected(){return this.port!==null}send(e){this.disposed||(this.lastSent.set(e.type,sN(e)),this.port?this.port.postMessage(e):this.outbound.push(e))}sendState(e){this.disposed||(this.sticky.set(e.type,e),this.lastSent.set(e.type,sN(e)),this.port?.postMessage(e))}sendIfChanged(e){return this.disposed||this.lastSent.get(e.type)===sN(e)?!1:(this.sendState(e),!0)}sendInitialBatch(e){let t=iN(this.options.surface,{observer:this.options.observer}),n=new Set(e.map(e=>e.type)),r=t.filter(e=>!n.has(e));if(r.length>0)throw Error(`Initial batch for a "${this.options.surface}" surface is missing ${r.join(`, `)}. The guest blocks its first paint on ${t.join(`, `)}.`);for(let t of e)this.sendState(t)}request(e,t=3e4){let n=`host-${++this.requestCounter}`;return new Promise((r,i)=>{let a=setTimeout(()=>{this.pending.delete(n),i(Error(`Guest did not answer "${e.type}" in ${t}ms`))},t);this.pending.set(n,{resolve:()=>{clearTimeout(a),r()},reject:e=>{clearTimeout(a),i(e)}}),this.send({...e,requestId:n})})}dispose(){this.disposed||(this.disposed=!0,this.clearHandshakeTimer(),this.readyListener&&=(this.host.removeEventListener(`message`,this.readyListener),null),this.loadListener&&=(this.options.iframe.removeEventListener?.(`load`,this.loadListener),null),this.closePort(),this.rejectPending(`Channel disposed`),this.options.onTeardown?.(`disposed`))}listenForReady(){let e=e=>{if(this.disposed)return;let t=e.data;if(!t||t.type!==`ready`||e.source!==this.options.iframe.contentWindow)return;if(e.origin!==this.options.iframeOrigin){this.logger.warn(`[${this.options.uiIdentifier}] ignoring a handshake from ${e.origin}; this frame is pinned to ${this.options.iframeOrigin}`);return}let n=t.protocolVersion;typeof n==`number`&&n!==4&&this.logger.warn(`[${this.options.uiIdentifier}] host↔iframe protocol version mismatch: iframe ${n}, host 4`),this.connect(t.signalsRendered===!0)};this.readyListener=e,this.host.addEventListener(`message`,e),this.armHandshakeTimer(),this.listenForLoads()}listenForLoads(){let{iframe:e}=this.options;if(!e.addEventListener)return;let t=()=>{this.disposed||(this.armHandshakeTimer(),this.port?.postMessage({type:`ping`}))};this.loadListener=t,e.addEventListener(`load`,t)}armHandshakeTimer(){this.clearHandshakeTimer();let e=this.options.handshakeTimeoutMs??1e4;this.handshakeTimer=setTimeout(()=>{this.handshakeTimer=null,!this.disposed&&(this.closePort(),this.options.onTeardown?.(`handshake-timeout`))},e)}connect(e){this.closePort(),this.rejectPending(`Connection reset`),this.lastSent.clear();let t=[...this.sticky.values()],n=new MessageChannel;this.port=n.port1,this.port.onmessage=e=>this.receive(e.data),this.port.start(),this.clearHandshakeTimer(),this.options.iframe.contentWindow?.postMessage({type:`init`,protocolVersion:4,sessionKey:this.options.sessionKey},this.options.iframeOrigin,[n.port2]);for(let e of t)this.sendState(e);let r=this.outbound;this.outbound=[];for(let e of r)this.port.postMessage(e);this.options.onConnect?.({signalsRendered:e})}closePort(){this.port&&=(this.port.onmessage=null,this.port.close(),null)}clearHandshakeTimer(){this.handshakeTimer!==null&&(clearTimeout(this.handshakeTimer),this.handshakeTimer=null)}rejectPending(e){for(let{reject:t}of this.pending.values())t(Error(e));this.pending.clear()}receive(e){if(e&&typeof e.type==`string`){switch(e.type){case`pong`:this.clearHandshakeTimer();return;case`rendered`:this.options.onRendered?.();return;case`refreshAssetAuth:response`:{let{requestId:t,ok:n,error:r}=e;if(typeof t!=`string`)return;let i=this.pending.get(t);this.pending.delete(t),n?i?.resolve():i?.reject(Error(r??`Asset auth refresh failed`));return}}aN.has(e.type)?this.answer(e):this.options.onMessage?.(e)}}async answer(e){let t=e.requestId;if(typeof t!=`string`){this.logger.warn(`[${this.options.uiIdentifier}] dropped a "${e.type}" with no requestId`);return}let n=`${e.type}:response`;try{let r=await this.dispatch(e);this.send({type:n,requestId:t,ok:!0,...r})}catch(r){this.send(e.type===`callEndpoint`?{type:n,requestId:t,ok:!1,...cN(r)}:{type:n,requestId:t,ok:!1,error:r instanceof Error?r.message:String(r)})}}async dispatch(e){let t=this.options.adapter,n={uiIdentifier:this.options.uiIdentifier,...this.options.origin};switch(e.type){case`callEndpoint`:if(!t?.callEndpoint)throw Error(`This host serves no endpoints`);return{response:await t.callEndpoint({endpointIdentifier:String(e.endpointIdentifier),request:e.request},n)};case`uploadBlob`:if(!t?.uploadBlob)throw Error(`This host stores no blobs`);return{reference:await t.uploadBlob({data:e.data,name:String(e.name),mimeType:String(e.mimeType)},n)};case`getPastState`:if(!t?.getPastState)throw Error(`This host serves no past state`);return{entries:await t.getPastState(e.query,n)};case`getAllTeamsParticipants`:return{participants:await t?.getAllTeamsParticipants?.(n)??[]};default:throw Error(`Unroutable request "${e.type}"`)}}};function sN(e){return typeof e!=`object`||!e?JSON.stringify(e)??`undefined`:Array.isArray(e)?`[${e.map(sN).join(`,`)}]`:`{${Object.entries(e).filter(([,e])=>e!==void 0).sort(([e],[t])=>e<t?-1:+(e>t)).map(([e,t])=>`${JSON.stringify(e)}:${sN(t)}`).join(`,`)}}`}function cN(e){let t=typeof e==`object`&&e?e.failure:void 0;return typeof t==`object`&&t&&typeof t.outcome?.kind==`string`&&Array.isArray(t.applied)?t:{outcome:{kind:`error`,message:e instanceof Error?e.message:String(e)},applied:[]}}var lN=[`primary`,`secondary`,`success`,`error`,`warning`,`info`];function uN(e){let t=e.trim().toLowerCase(),n=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.exec(t);if(n){let e=n[1];e.length<=4&&(e=[...e].map(e=>e+e).join(``));let t=t=>parseInt(e.slice(t,t+2),16);return{r:t(0),g:t(2),b:t(4),a:e.length===8?t(6)/255:1}}let r=/^rgba?\(([^)]*)\)$/.exec(t);if(r){let e=r[1].split(/[\s,/]+/).filter(Boolean);if(e.length!==3&&e.length!==4)return null;let[t,n,i]=e.slice(0,3).map(e=>e.endsWith(`%`)?parseFloat(e)/100*255:parseFloat(e)),a=e[3],o=a===void 0?1:a.endsWith(`%`)?parseFloat(a)/100:parseFloat(a);return[t,n,i,o].some(e=>!Number.isFinite(e))?null:{r:dN(t,255),g:dN(n,255),b:dN(i,255),a:dN(o,1)}}return null}function dN(e,t){return Math.min(t,Math.max(0,e))}function fN(e,t){let n=(t,n)=>t*e.a+n*(1-e.a);return{r:n(e.r,t.r),g:n(e.g,t.g),b:n(e.b,t.b),a:1}}function pN({r:e,g:t,b:n}){let r=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return .2126*r(e)+.7152*r(t)+.0722*r(n)}function mN(e,t){let[n,r]=[pN(e),pN(t)].sort((e,t)=>t-e);return(n+.05)/(r+.05)}function hN({r:e,g:t,b:n}){let r=e=>Math.round(e).toString(16).padStart(2,`0`);return`#${r(e)}${r(t)}${r(n)}`}var gN={r:0,g:0,b:0,a:1},_N={r:255,g:255,b:255,a:1};function vN(e,t){let n=uN(e);if(!n)return hN(gN);let r=n.a<1?fN(n,_N):n,i=t===void 0?null:uN(t);if(i){let e=fN(i,r);if(mN(e,r)>=4.5)return hN(e)}return mN(gN,r)>=mN(_N,r)?hN(gN):hN(_N)}var yN={light:{background:`#ffffff`,surface:`#ffffff`,text:`#000000`},dark:{background:`#121212`,surface:`#1e1e1e`,text:`#ffffff`}};function bN(e){let{background:t,surface:n,text:r}=e;if(!t||!n)return;let i=uN(t),a=uN(n);if(!i||!a)return;let o=e=>e.a<1?fN(e,_N):e,s=[o(i),o(a)],c=e=>Math.min(...s.map(t=>mN(fN(e,t),t))),l=r===void 0?null:uN(r);if(l&&l.a===1&&c(l)>=4.5)return{background:t,surface:n,text:hN(l)};let u=c(gN)>=c(_N)?gN:_N;if(!(c(u)<4.5))return{background:t,surface:n,text:hN(u)}}function xN(e,t){let n=Object.fromEntries(lN.map(t=>[t,vN(e[t],e.contrastText?.[t])]));return{...Object.fromEntries(lN.map(t=>[t,e[t]])),contrastText:n,...bN(e)??yN[t]}}function SN(e){return{mode:e.mode,light:xN(e.light,`light`),dark:xN(e.dark,`dark`),brand:e.brand}}var CN={primary:{main:`#6B00FF`,contrastText:`#ffffff`},secondary:{main:`#17D1C7`,contrastText:`rgba(0,0,0,0.87)`},error:{main:`#DB324D`,contrastText:`#ffffff`},success:{main:`#00c894`,contrastText:`rgba(0,0,0,0.87)`},warning:{main:`#ffb65c`,contrastText:`rgba(0,0,0,0.87)`},info:{main:`#336BEB`,contrastText:`#ffffff`}},wN={primary:{main:`#BC8CFF`,contrastText:`rgba(0,0,0,0.87)`},secondary:{main:`#17D1C7`,contrastText:`rgba(0,0,0,0.87)`},error:{main:`#ef7a8e`,contrastText:`rgba(0,0,0,0.87)`},success:{main:`#00c894`,contrastText:`rgba(0,0,0,0.87)`},warning:{main:`#ffb65c`,contrastText:`rgba(0,0,0,0.87)`},info:{main:`#7d9bf2`,contrastText:`rgba(0,0,0,0.87)`}},TN=`#414042`,EN=`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif`,DN=`"Work Sans", ${EN}`,ON=`Sora, ${EN}`;function kN(e){return{primary:e.primary.main,secondary:e.secondary.main,success:e.success.main,error:e.error.main,warning:e.warning.main,info:e.info.main,contrastText:{primary:e.primary.contrastText,secondary:e.secondary.contrastText,success:e.success.contrastText,error:e.error.contrastText,warning:e.warning.contrastText,info:e.info.contrastText}}}function AN(e,t){return SN(t?{mode:e,...t.theme}:{mode:e,light:kN(CN),dark:kN(wN),brand:{name:`Serious Gaming`}})}var jN=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`];function MN(e){return Xo({palette:e===`dark`?{mode:`dark`,...wN}:{mode:`light`,...CN,text:{primary:TN}},typography:{fontFamily:DN,...Object.fromEntries(jN.map(e=>[e,{fontFamily:ON}]))},components:{MuiButton:{styleOverrides:{root:{textTransform:`none`}}}}})}function NN(e){return e===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:e}function PN(e,t){return{"Content-Type":e.mimeType,"X-Blob-Name":encodeURIComponent(e.name),"X-Blob-Mime":e.mimeType,"X-Blob-Retention":t===`setup`?`settings`:t===`scenario-editor`?`scenario`:`game`}}var FN=5e3,IN=[`allow-scripts`,`allow-same-origin`,`allow-forms`,`allow-downloads`,`allow-modals`,`allow-presentation`,`allow-popups`,`allow-popups-to-escape-sandbox`].join(` `),LN=[`clipboard-write`,`autoplay`,`screen-wake-lock`,`fullscreen`,`microphone`,`camera`,`geolocation`,`picture-in-picture`,`web-share`,`gamepad`,`window-management`,`speaker-selection`].join(`; `);function RN(e){return Object.assign(Error(e.outcome.message??e.outcome.kind),{failure:e})}function zN(e,t,n){return async r=>{let i=nN(r,e,t)??tN(r,e,t);return eN(i)?{ok:!1,outcome:{kind:`denied`,message:i.refused}}:i?n(i):null}}function BN(e,t,n){return JSON.stringify([e.kind,e.identifier,t.observer??null,t.teamIndex??null,t.participantId??null,t.role??null,n])}function VN({surface:e,viewer:t,feed:n,mode:r,resolved:i,onModeChange:a,rejection:o,hookFailure:s,onTeardown:c}){let l=n.kind===`view`?n.dispatch:zN(e,t,n.send),u=e.origin??window.location.origin,d=(0,E.useRef)(null),f=(0,E.useRef)(null),p=GN(n),m=(0,E.useRef)({dispatch:l,onModeChange:a,overlays:p});m.current={dispatch:l,onModeChange:a,overlays:p};let[h,g]=(0,E.useState)(!1),[_,v]=(0,E.useState)(!1),[y,b]=(0,E.useState)(!1),{selected:x}=ab(),{hold:S}=fb(),C=n.kind===`view`?n.sessionKey:Xc(n.state,e,{sessionless:n.sessionless===!0});return(0,E.useEffect)(()=>{let n=d.current;if(!n)return;let r;return r=new oN({iframe:n,surface:e.kind,uiIdentifier:e.identifier,iframeOrigin:u,sessionKey:C,adapter:{callEndpoint:async({endpointIdentifier:e,request:t})=>{let n=await m.current.dispatch({type:`callEndpoint`,endpointIdentifier:e,request:t});if(n&&`type`in n){if(n.type===`endpoint`)return n.response;if(n.type===`endpointFailure`)throw RN(n.failure)}throw RN({outcome:n&&`ok`in n&&!n.ok?n.outcome:{kind:`error`,message:`The endpoint did not answer`},applied:[]})},uploadBlob:async t=>{let n=await(await fetch(`/api/blobs`,{method:`POST`,headers:PN(t,e.kind),body:t.data})).json();if(!n.reference)throw Error(`The blob was not stored`);return n.reference},getPastState:async e=>{let t=await m.current.dispatch({type:`getPastState`,query:e});return t&&`type`in t&&t.type===`pastState`?t.entries:[]},getAllTeamsParticipants:async()=>{let e=await m.current.dispatch({type:`getAllTeamsParticipants`});return e&&`type`in e&&e.type===`participants`?e.participants:[]}},observer:t.observer===!0,onConnect:({signalsRendered:e})=>{g(!0),v(!e),b(!1)},onRendered:()=>v(!0),onTeardown:e=>{e===`handshake-timeout`&&(g(!1),b(!0),c?.())},onMessage:e=>{e.type===`setThemePreference`?m.current.onModeChange?.(e.preference):UN(r,e,m.current.dispatch,m.current.overlays)}}),f.current=r,()=>{r.dispose(),f.current=null,g(!1),v(!1)}},[e.identifier,e.kind,t.observer,t.teamIndex,t.participantId,t.role,C,S]),(0,E.useEffect)(()=>{let a=f.current;if(!a)return;let o={mode:i,preference:r,palette:AN(i,x)},s=n.kind===`view`?[...n.messages,...Zc(o)]:nl({surface:e,state:n.state,viewer:t,theme:o,origin:window.location.origin,assetOrigin:u,gameName:n.state.game.name,...n.hasGuide===void 0?{}:{hasGuide:n.hasGuide},...n.roundProcessing===void 0?{}:{roundProcessing:n.roundProcessing},...n.sessionless===void 0?{}:{sessionless:n.sessionless}});if(S===`surface`)for(let e of cb(s,S))a.sendIfChanged(e);else if(a.connected)for(let e of s)a.sendIfChanged(e);else a.sendInitialBatch(s)},[e,n,t,r,i,u,x,S]),(0,E.useEffect)(()=>{if(!h||_||S===`host`)return;let e=setTimeout(()=>v(!0),FN);return()=>clearTimeout(e)},[h,_,S]),(0,E.useEffect)(()=>{let e=f.current;e&&o&&(o.teamIndex===void 0||o.teamIndex===t.teamIndex)&&e.send({type:`validationRejected`,rejections:o.rejections})},[o?.nonce,o,t.teamIndex]),(0,E.useEffect)(()=>{let t=f.current;t&&s&&e.kind===`session`&&t.send({type:`hookFailed`,payload:s.payload})},[s?.nonce,s,e.kind]),(0,V.jsxs)(im,{sx:{position:`relative`,width:`100%`,height:`100%`},children:[(0,V.jsx)(im,{component:`iframe`,ref:d,title:e.identifier,src:`${u}${e.src}?expectedParentOrigin=${encodeURIComponent(window.location.origin)}`,sandbox:IN,allow:LN,sx:{width:`100%`,height:`100%`,border:0,display:`block`}},`${BN(e,t,C)}:${S}`),(!h||S===`host`||!_&&S!==`surface`)&&(0,V.jsx)(ly,{spacing:2,"data-testid":`surface-loading`,sx:{alignItems:`center`,justifyContent:`center`,position:`absolute`,inset:0,bgcolor:`background.default`},children:y?(0,V.jsx)(Z,{color:`text.secondary`,children:`This surface did not connect. Check its console for an error.`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(JN,{brand:x,resolved:i}),(0,V.jsxs)(Z,{color:`text.secondary`,variant:`body2`,children:[`Loading `,e.identifier]})]})})]})}function HN(e,t,n){return e!==`facilitator-guide`&&e!==`print-sheets`?`"${String(e)}" is not a host overlay`:n.available.includes(e)?e===`print-sheets`&&t!==void 0&&n.teamIds!==void 0&&!n.teamIds.includes(String(t))?`There is no team "${String(t)}" to print`:null:`This host does not offer the "${e}" overlay for this game`}async function UN(e,t,n,r={available:[`facilitator-guide`,`print-sheets`]}){if(t.type===`setThemePreference`)return;if(t.type===`openHostOverlay`){let n=HN(t.overlay,t.target,r);n||WN(t.overlay,t.target),KN(e,t,n?{ok:!1,outcome:{kind:`denied`,message:n}}:{ok:!0});return}let i;try{i=await n(t)}catch(e){i={ok:!1,outcome:{kind:`error`,message:e instanceof Error?e.message:`The command failed`}}}if(!i){KN(e,t,{ok:!1,outcome:{kind:`denied`,message:`This host does not handle "${String(t.type)}"`}});return}let a=typeof t.requestId==`string`?t.requestId:null;a&&(`ok`in i?e.send(i.ok?{type:`mutation:response`,requestId:a,ok:!0,...i.committedAtTick===void 0?{}:{committedAtTick:i.committedAtTick}}:{type:`mutation:response`,requestId:a,ok:!1,outcome:i.outcome}):e.send({type:`mutation:response`,requestId:a,ok:!0}))}function WN(e,t){if(e===`facilitator-guide`)return window.open(`/guide`,`_blank`,`noreferrer`),!0;if(e===`print-sheets`){let e=typeof t==`string`?`?team=${encodeURIComponent(t)}`:``;return window.open(`/print${e}`,`_blank`,`noreferrer`),!0}return!1}function GN(e){if(e.kind===`operator`)return{available:ll(e.hasGuide),teamIds:e.state.teams.map(e=>e.teamId)};let t=e.messages.find(e=>e.type===`setAvailableOverlays`),n=e.messages.find(e=>e.type===`setTeamList`);return{available:Array.isArray(t?.overlays)?t.overlays:[],...Array.isArray(n?.payload)?{teamIds:n.payload.map(e=>e.teamId)}:{}}}function KN(e,t,n){typeof t.requestId==`string`&&e.send({type:`mutation:response`,requestId:t.requestId,...n})}function qN(e,t){return t===`dark`?e?.onDark??e?.onLight:e?.onLight??e?.onDark}function JN({brand:e,resolved:t}){let n=qN(e?.loader,t);if(n)return(0,V.jsx)(im,{component:`img`,src:n,alt:``,sx:{width:72,height:72}});let r=qN(e?.theme.brand?.logo,t),i=e?.theme[t].primary;return(0,V.jsxs)(V.Fragment,{children:[r&&(0,V.jsx)(im,{component:`img`,src:r,alt:e?.name??``,sx:{maxHeight:48,maxWidth:`min(320px, 80%)`,objectFit:`contain`}}),(0,V.jsx)(nd,{size:28,sx:i?{color:i}:void 0})]})}function YN({scenario:e,surface:t,state:n,mode:r,resolved:i,send:a,onModeChange:o,rejection:s}){let[c,l]=(0,E.useState)(!1),[u,d]=(0,E.useState)(!1),[f,p]=(0,E.useState)(null),m=e===``?null:e,h=n.scenarioDrafts?.some(e=>e.scenarioId===m)===!0,[g,_]=(0,E.useState)(null);(0,E.useEffect)(()=>{h||a({type:`editScenario`,scenarioId:m}).then(e=>{`ok`in e&&!e.ok&&_(e.outcome.message??`The scenario could not be opened`)})},[h,m,a]);let v=async()=>{l(!0),p(null);try{let t=await fetch(`/api/scenarios`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({identifier:e,overwrite:!0,draft:!0})});if(!t.ok){let e=await t.json();p(e.error??`The scenario could not be saved`);return}d(!0)}finally{l(!1)}};return(0,V.jsxs)(im,{sx:{display:`flex`,flexDirection:`column`,height:`100vh`},children:[(0,V.jsx)(Ad,{position:`static`,color:`default`,elevation:1,children:(0,V.jsxs)(vy,{variant:`dense`,sx:{gap:2},children:[(0,V.jsxs)(ly,{sx:{flex:1},children:[(0,V.jsx)(Z,{variant:`subtitle2`,children:`Editing scenario`}),(0,V.jsx)(Z,{variant:`caption`,color:`text.secondary`,children:e})]}),u&&!f&&(0,V.jsx)(Z,{variant:`body2`,color:`success.main`,children:`Saved`}),(0,V.jsx)(gm,{variant:`contained`,"data-testid":`save-scenario`,disabled:c,onClick:()=>void v(),children:`Save`}),(0,V.jsx)(gm,{href:`/`,children:`Done`})]})}),(f??g)&&(0,V.jsx)(bd,{severity:`error`,sx:{borderRadius:0},children:f??g}),(0,V.jsx)(im,{sx:{flex:1,minHeight:0,position:`relative`},children:h?t?(0,V.jsx)(VN,{surface:t,viewer:m===null?{}:{scenario:m},feed:{kind:`operator`,state:n,send:e=>(e.type===`updateScenarioDraft`&&d(!1),a(e))},mode:r,resolved:i,onModeChange:o,rejection:s}):(0,V.jsxs)(ly,{spacing:2,sx:{alignItems:`center`,justifyContent:`center`,height:`100%`,p:4},children:[(0,V.jsxs)(bd,{severity:`info`,sx:{maxWidth:560},children:[(0,V.jsxs)(Z,{gutterBottom:!0,children:[`This game has no `,(0,V.jsx)(`strong`,{children:`scenario_editor`}),` slot.`]}),(0,V.jsxs)(Z,{variant:`body2`,color:`text.secondary`,children:[`A scenario editor is optional (§6.5). Without one there is nothing to author a scenario in here; the values can still be set with`,` `,(0,V.jsx)(`code`,{children:`sdk configure`}),` and captured from the Scenario tab, and an agent can edit a game's settings directly from their schemas.`]})]}),(0,V.jsx)(gm,{href:`/`,children:`Back to the session`})]}):(0,V.jsxs)(ly,{spacing:2,sx:{alignItems:`center`,justifyContent:`center`,height:`100%`},children:[(0,V.jsx)(nd,{size:28}),(0,V.jsxs)(Z,{color:`text.secondary`,variant:`body2`,children:[`Opening `,e||`the package settings`]})]})})]})}var XN={processing:new Set,errors:[],rejection:null,hookFailure:null,reloads:0,restarted:null},ZN=new Set([`bundles-reloaded`,`reinitialised-on-change`,`logic-reloaded`]);function QN(e=`session`){let[t,n]=(0,E.useState)(null),[r,i]=(0,E.useState)(!1),[a,o]=(0,E.useState)(0),[s,c]=(0,E.useState)(XN),l=(0,E.useRef)(null),u=(0,E.useRef)(null),d=(0,E.useRef)(new Map),f=(0,E.useRef)(0);(0,E.useEffect)(()=>{let t=!1,r,a=()=>{let s=e===`walkthrough`?`?run=walkthrough`:``,f=new WebSocket(`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/ws${s}`);l.current=f,f.onopen=()=>{i(!0),o(0),u.current!==null&&f.send(JSON.stringify({presence:u.current}))},f.onclose=()=>{i(!1),o(e=>e+1),t||(r=setTimeout(a,1e3))},f.onmessage=e=>{let t=JSON.parse(e.data);t.type===`result`?(d.current.get(t.requestId)?.(t.result),d.current.delete(t.requestId)):$N(t,n,c)}};return a(),()=>{t=!0,clearTimeout(r),l.current?.close()}},[e]);let p=(0,E.useCallback)(e=>{let t=l.current;if(!t||t.readyState!==WebSocket.OPEN)return Promise.resolve({ok:!1,outcome:{kind:`error`,message:`Not connected to the session`}});let n=`console-${++f.current}`;return new Promise(r=>{d.current.set(n,r),t.send(JSON.stringify({requestId:n,command:e}))})},[]),m=(0,E.useCallback)(e=>{if(u.current===e)return;u.current=e;let t=l.current;t&&t.readyState===WebSocket.OPEN&&t.send(JSON.stringify({presence:e}))},[]);return(0,E.useMemo)(()=>({state:t,connected:r,attempts:a,transients:s,send:p,announce:m}),[t,r,a,s,p,m])}function $N(e,t,n){switch(e.type){case`state`:t(e.state),ZN.has(e.cause)&&n(t=>({...t,reloads:t.reloads+1,restarted:e.cause===`reinitialised-on-change`?{nonce:(t.restarted?.nonce??0)+1}:t.restarted}));return;case`round-processing`:n(t=>{let n=new Set(t.processing),r=e.teamIndex??-1;return e.processing?n.add(r):n.delete(r),{...t,processing:n}});return;case`error`:n(t=>({...t,errors:[...t.errors,`${e.source}: ${e.message}`],hookFailure:e.source.startsWith(`hook:`)?{payload:{signal:e.source.slice(5),teamId:e.teamId??``,message:e.message},nonce:(t.hookFailure?.nonce??0)+1}:t.hookFailure}));return;case`validation-rejected`:n(t=>({...t,rejection:{...e.teamIndex===void 0?{}:{teamIndex:e.teamIndex},rejections:e.rejections,nonce:(t.rejection?.nonce??0)+1}}));return}}function eP(){let[e,t]=(0,E.useState)(null),[n,r]=(0,E.useState)(!1),[i,a]=(0,E.useState)(0),[o,s]=(0,E.useState)(null),[c,l]=(0,E.useState)(null),u=(0,E.useRef)(null),d=(0,E.useRef)(new Map),f=(0,E.useRef)(0);(0,E.useEffect)(()=>{let e=!1,n,i=()=>{let o=encodeURIComponent(location.pathname+location.search),c=new WebSocket(`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/ws/view?page=${o}`);u.current=c,c.onopen=()=>{r(!0),a(0)},c.onclose=()=>{r(!1),a(e=>e+1),e||(n=setTimeout(i,1e3))},c.onmessage=e=>{let n=JSON.parse(e.data);switch(n.type){case`view`:(0,kp.flushSync)(()=>t({page:n.page,messages:n.messages}));return;case`result`:d.current.get(n.requestId)?.(n.result),d.current.delete(n.requestId);return;case`validation-rejected`:s(e=>({rejections:n.rejections,nonce:(e?.nonce??0)+1}));return;case`hookFailed`:l(e=>({payload:n.payload,nonce:(e?.nonce??0)+1}));return}}};return i(),()=>{e=!0,clearTimeout(n),u.current?.close()}},[]);let p=(0,E.useCallback)(e=>{let t=u.current;if(!t||t.readyState!==WebSocket.OPEN)return Promise.resolve({ok:!1,outcome:{kind:`error`,message:`Not connected to the session`}});let n=`view-${++f.current}`;return new Promise(r=>{d.current.set(n,r),t.send(JSON.stringify({requestId:n,message:e}))})},[]);return(0,E.useMemo)(()=>({view:e,connected:n,attempts:i,rejection:o,hookFailure:c,dispatch:p}),[e,n,i,o,c,p])}function tP(e){let t=(0,E.useMemo)(()=>Uc(location.pathname,location.search),[]);return gl(t)?(0,V.jsx)(nP,{...e}):(0,V.jsx)(iP,{...e,route:t})}function nP({mode:e,resolved:t,onModeChange:n}){let{view:r,connected:i,attempts:a,rejection:o,hookFailure:s,dispatch:c}=eP();if(!r)return(0,V.jsx)(uP,{connected:i,attempts:a});let{page:l,messages:u}=r;switch(l.status){case`redirect`:return location.replace(l.href),(0,V.jsx)(uP,{connected:i,attempts:a});case`configuring`:return(0,V.jsx)(rP,{children:`The facilitator is setting the session up. This page opens when it starts.`});case`closed`:return(0,V.jsx)(rP,{children:`This session has already started, so its configuration is closed.`});case`join`:return(0,V.jsx)(HM,{team:l.team??void 0,bare:!0});case`no-such-team`:return(0,V.jsx)(dP,{resolution:{kind:`no-such-team`,teamIndex:l.teamIndex},bare:!0});case`no-such-participant`:return(0,V.jsx)(dP,{resolution:{kind:`no-such-participant`,teamIndex:l.teamIndex,slot:l.slot,held:l.held},bare:!0});case`missing-surface`:return(0,V.jsx)(fP,{kind:l.kind});case`surface`:return(0,V.jsxs)(im,{sx:{display:`flex`,flexDirection:`column`,height:`100vh`},children:[!i&&(0,V.jsx)(cP,{attempts:a}),l.inSetup&&l.surface.kind===`setup`&&(0,V.jsx)(Ad,{position:`static`,color:`default`,elevation:1,children:(0,V.jsxs)(vy,{variant:`dense`,sx:{gap:2},children:[(0,V.jsx)(Z,{variant:`subtitle2`,sx:{flex:1},children:`Configure the session, then start it`}),(0,V.jsx)(gm,{variant:`contained`,"data-testid":`play`,onClick:()=>void c({type:`requestPlay`}),children:`Play`})]})}),(0,V.jsx)(im,{sx:{flex:1,minHeight:0,position:`relative`},children:(0,V.jsx)(VN,{surface:l.surface,viewer:l.viewer,feed:{kind:`view`,messages:u,dispatch:c,sessionKey:l.sessionKey},mode:e,resolved:t,onModeChange:n,rejection:o,hookFailure:s})})]})}}function rP({children:e}){return(0,V.jsx)(ly,{sx:{alignItems:`center`,justifyContent:`center`,height:`100vh`,p:4},children:(0,V.jsx)(bd,{severity:`info`,sx:{maxWidth:560},"data-testid":`view-notice`,children:(0,V.jsx)(Z,{children:e})})})}function iP({mode:e,resolved:t,onModeChange:n,route:r}){let{state:i,connected:a,attempts:o,transients:s,send:c,announce:l}=QN(r.run),[u,d]=(0,E.useState)(null),[f,p]=(0,E.useState)(!1);(0,E.useEffect)(()=>{fetch(`/api/surfaces`).then(e=>e.json()).then(d)},[s.reloads]);let[m,h]=(0,E.useState)([]);(0,E.useEffect)(()=>{fetch(`/api/session`).then(e=>e.json()).then(e=>h((e.warnings??[]).filter(e=>e.build)))},[s.reloads]);let[g,_]=(0,E.useState)(!1);(0,E.useEffect)(()=>{s.restarted&&_(!0)},[s.restarted]),(0,E.useEffect)(()=>{fetch(`/api/guide`).then(e=>e.json()).then(e=>p(e.guide!==null))},[s.reloads]);let v=i&&r.kind===`player`?(()=>{let e=pl(i,r);return e.kind===`viewer`?e.viewer.participantId??null:null})():null;if((0,E.useEffect)(()=>l(v),[l,v]),!i||!u)return(0,V.jsx)(uP,{connected:a,attempts:o});let y=u.some(e=>e.kind===`setup`),b=i.session.inSetup,x=r.kind===`guide`||r.kind===`print`||r.kind===`scenario-editor`||r.kind===`presentation`,S=b&&!x?{...r,kind:`setup`}:r;if(!b&&S.kind===`setup`)return(0,V.jsx)(sP,{configurable:y,onReconfigure:()=>void c({type:`reconfigure`})});if(S.kind===`scenario-editor`)return S.scenario===void 0?(0,V.jsx)(lP,{}):(0,V.jsx)(YN,{scenario:S.scenario,surface:u.find(e=>e.kind===`scenario-editor`),state:i,mode:e,resolved:t,send:c,onModeChange:n,rejection:s.rejection});if(S.kind===`join`){let e=i.teams.find(e=>e.index===S.teamIndex);return e?.participants.length===1?(location.replace(Wc({kind:`player`,teamIndex:e.index,participant:1,bare:S.bare})),(0,V.jsx)(uP,{connected:a,attempts:o})):(0,V.jsx)(HM,{team:e,bare:S.bare})}let C=pl(i,S);if(C.kind!==`viewer`)return(0,V.jsx)(dP,{resolution:C,bare:S.bare,onAddParticipant:()=>void c({type:`addParticipant`,teamId:`team-${C.teamIndex+1}`})});let w=i.session.waitingRoomOpen&&(S.kind===`player`||S.kind===`waiting-room`)?`waiting-room`:ml[S.kind],T=w?u.find(e=>e.kind===w):void 0;return(0,V.jsxs)(im,{sx:{display:`flex`,flexDirection:`column`,height:`100vh`},children:[!a&&(0,V.jsx)(cP,{attempts:o}),Lc(i.session.pending)&&!S.bare&&(0,V.jsx)(aP,{pending:i.session.pending,onReinitialise:()=>void c({type:`reset`})}),m.length>0&&!S.bare&&(0,V.jsx)(oP,{errors:m}),b&&(0,V.jsx)(Ad,{position:`static`,color:`default`,elevation:1,children:(0,V.jsxs)(vy,{variant:`dense`,sx:{gap:2},children:[(0,V.jsx)(Z,{variant:`subtitle2`,sx:{flex:1},children:`Configure the session, then start it`}),(0,V.jsx)(gm,{variant:`contained`,"data-testid":`play`,onClick:()=>void c({type:`play`}),children:`Play`})]})}),(0,V.jsx)(im,{sx:{flex:1,minHeight:0,position:`relative`},children:S.kind===`guide`?(0,V.jsx)(VM,{locale:i.session.locale,reloads:s.reloads}):S.kind===`print`?(0,V.jsx)(WM,{state:i}):T?(0,V.jsx)(VN,{surface:T,viewer:C.viewer,feed:{kind:`operator`,state:i,hasGuide:f,...S.kind===`presentation`?{sessionless:S.preview===!0}:{},roundProcessing:s.processing.has(-1)||C.viewer.teamIndex!==void 0&&s.processing.has(C.viewer.teamIndex),send:c},mode:e,resolved:t,onModeChange:n,rejection:s.rejection,hookFailure:s.hookFailure}):(0,V.jsx)(fP,{kind:w??`session`})}),!S.bare&&(0,V.jsx)(mb,{state:i,route:S,inSetup:b,configurable:y,connected:a,transients:s,mode:e,onModeChange:n,send:c}),(0,V.jsx)(Xv,{open:g,autoHideDuration:4e3,onClose:()=>_(!1),anchorOrigin:{vertical:`top`,horizontal:`center`},children:(0,V.jsx)(bd,{severity:`info`,"data-testid":`restarted-notice`,children:`Settings changed, game restarted`})})]})}function aP({pending:e,onReinitialise:t}){return(0,V.jsxs)(bd,{severity:`warning`,square:!0,"data-testid":`pending-changes`,sx:{borderRadius:0,py:.25},action:(0,V.jsx)(gm,{size:`small`,color:`inherit`,"data-testid":`reinitialise`,onClick:t,children:`Re-initialise`}),children:[(0,V.jsx)(`strong`,{children:Rc(e)}),`. `,zc(e),`. Re-initialising returns play to tick 0.`]})}function oP({errors:e}){return(0,V.jsxs)(bd,{severity:`error`,square:!0,"data-testid":`build-errors`,sx:{borderRadius:0,py:.25},children:[(0,V.jsxs)(`strong`,{children:["`sdk build` would refuse this package (",e.length===1?`one error`:`${e.length} errors`,`)`]}),`. It runs here anyway, so it can be fixed while you watch.`,e.map((e,t)=>(0,V.jsx)(Z,{variant:`body2`,sx:{fontFamily:`monospace`},children:e.message},t))]})}function sP({configurable:e,onReconfigure:t}){return(0,V.jsxs)(ly,{spacing:2,sx:{alignItems:`center`,justifyContent:`center`,height:`100vh`,p:4},children:[(0,V.jsxs)(bd,{severity:`info`,sx:{maxWidth:560},children:[(0,V.jsx)(Z,{gutterBottom:!0,children:`This session has already started.`}),(0,V.jsx)(Z,{variant:`body2`,color:`text.secondary`,children:e?`Settings are resolved when a session initialises, so changing them now would change nothing until the session starts again. Reconfiguring puts the session back to its setup step and returns every team to tick 0.`:`This game has no setup step.`})]}),(0,V.jsxs)(ly,{direction:`row`,spacing:1,children:[e&&(0,V.jsx)(gm,{variant:`contained`,"data-testid":`reconfigure`,onClick:t,children:`Reconfigure`}),(0,V.jsx)(gm,{href:`/`,children:`Back to the session`})]})]})}function cP({attempts:e}){return(0,V.jsxs)(bd,{severity:`warning`,square:!0,"data-testid":`disconnected`,sx:{borderRadius:0,py:.25},action:(0,V.jsx)(gm,{size:`small`,color:`inherit`,onClick:()=>location.reload(),children:`Reload`}),children:[`Disconnected from the session — nothing on this page is live.`,e>1?` Retrying (${e}).`:` Retrying…`]})}function lP(){return(0,V.jsxs)(ly,{spacing:2,sx:{alignItems:`center`,justifyContent:`center`,height:`100vh`,p:4},children:[(0,V.jsxs)(bd,{severity:`info`,sx:{maxWidth:560},children:[(0,V.jsx)(Z,{gutterBottom:!0,children:`The scenario editor opens on a scenario.`}),(0,V.jsxs)(Z,{variant:`body2`,color:`text.secondary`,children:[`Open the dev drawer (press `,(0,V.jsx)(`kbd`,{children:"`"}),`) and use the Scenario tab:`,` `,(0,V.jsx)(`strong`,{children:`Add scenario`}),` to start a new one, or `,(0,V.jsx)(`strong`,{children:`Edit`}),` on an existing one. An editor with no scenario behind it has nowhere to save what you do in it.`]})]}),(0,V.jsx)(gm,{href:`/`,children:`Back to the session`})]})}function uP({connected:e,attempts:t}){let n=!e&&t>=2,r=$o().palette.mode===`dark`;return(0,V.jsxs)(ly,{spacing:2,sx:{alignItems:`center`,justifyContent:`center`,height:`100vh`,p:4},children:[(0,V.jsx)(im,{component:`img`,src:r?qy:Jy,alt:`Serious Gaming`,sx:{width:72,height:72}}),!n&&(0,V.jsx)(Z,{color:`text.secondary`,children:e?`Loading the session…`:`Connecting to the session…`}),n&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(bd,{severity:`warning`,sx:{maxWidth:620},children:[(0,V.jsxs)(Z,{gutterBottom:!0,children:[`Nothing is answering at`,` `,(0,V.jsxs)(`code`,{children:[location.host,`/ws`]}),`.`]}),(0,V.jsxs)(Z,{variant:`body2`,color:`text.secondary`,component:`div`,children:[`This page loaded, so something is serving it — most likely an older dev server still holding this port. Check two things:`,(0,V.jsxs)(`ul`,{style:{marginBottom:0},children:[(0,V.jsxs)(`li`,{children:[`The address your server actually printed. A port already in use makes it move to the next one, so it may be on`,` `,(0,V.jsx)(`code`,{children:Number(location.port||80)+1})]}),(0,V.jsxs)(`li`,{children:[`Whether an old one is still running:`,` `,(0,V.jsx)(`code`,{children:`pnpm run sdk dev status`}),`, and`,` `,(0,V.jsx)(`code`,{children:`pnpm run sdk dev stop`}),` to end it`]})]})]})]}),(0,V.jsx)(gm,{variant:`outlined`,onClick:()=>location.reload(),children:`Try again`})]})]})}function dP({resolution:e,bare:t,onAddParticipant:n}){let r=e.teamIndex+1;return(0,V.jsxs)(ly,{spacing:2,sx:{alignItems:`center`,justifyContent:`center`,height:`100vh`,p:4},"data-testid":`no-such-participant`,children:[(0,V.jsx)(bd,{severity:`warning`,sx:{maxWidth:560},children:e.kind===`no-such-team`?(0,V.jsxs)(Z,{gutterBottom:!0,children:[`This session has no team `,r,`. It may have been removed.`]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(Z,{gutterBottom:!0,children:[`Team `,r,` has`,` `,e.held===0?`no participants`:e.held===1?`one participant`:`${e.held} participants`,`, and this URL asks for participant `,e.slot,`.`]}),(0,V.jsx)(Z,{variant:`body2`,color:`text.secondary`,children:`A second tab is not a second participant. Add one, then open their surface: a participant is who a write is attributed to, and a surface with nobody behind it cannot submit one.`})]})}),e.kind===`no-such-participant`&&n&&(0,V.jsx)(gm,{variant:`contained`,onClick:n,"data-testid":`add-participant`,children:`Add participant`}),(0,V.jsxs)(gm,{size:`small`,href:Wc({kind:`observer`,teamIndex:e.teamIndex,bare:t}),children:[`Watch team `,r,` without joining`]})]})}function fP({kind:e}){return(0,V.jsxs)(ly,{spacing:2,sx:{alignItems:`center`,justifyContent:`center`,height:`100%`,p:4},children:[(0,V.jsxs)(bd,{severity:`info`,sx:{maxWidth:560},children:[(0,V.jsxs)(Z,{gutterBottom:!0,children:[`This package wires no `,(0,V.jsx)(`strong`,{children:e}),` surface.`]}),(0,V.jsx)(Z,{variant:`body2`,color:`text.secondary`,children:`A game supplies its own facilitator and player surfaces; the dev server renders them rather than substituting a console of its own, so there is nothing to show until the package fills that slot.`})]}),(0,V.jsx)(gm,{href:`/`,size:`small`,children:`Back to the session`})]})}function pP(){let[e,t]=(0,E.useState)(()=>localStorage.getItem(`theme`)??`light`),n=NN(e),r=(0,E.useMemo)(()=>MN(n),[n]);return(0,V.jsxs)(Ac,{theme:r,children:[(0,V.jsx)(ds,{}),(0,V.jsx)(ib,{children:(0,V.jsx)(db,{children:(0,V.jsx)(tP,{mode:e,resolved:n,onModeChange:e=>{localStorage.setItem(`theme`,e),t(e)}})})})]})}(0,Ic.createRoot)(document.getElementById(`root`)).render((0,V.jsx)(E.StrictMode,{children:(0,V.jsx)(pP,{})}));