=4?t(u):e.interrupt(i.parser.constructs.flow,n,t)(u)}}function qC(e,t,n,i,o,l,u,f,d){const p=d||Number.POSITIVE_INFINITY;let m=0;return g;function g(A){return A===60?(e.enter(i),e.enter(o),e.enter(l),e.consume(A),e.exit(l),v):A===null||A===32||A===41||Cm(A)?n(A):(e.enter(i),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),S(A))}function v(A){return A===62?(e.enter(l),e.consume(A),e.exit(l),e.exit(o),e.exit(i),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),b(A))}function b(A){return A===62?(e.exit("chunkString"),e.exit(f),v(A)):A===null||A===60||Le(A)?n(A):(e.consume(A),A===92?w:b)}function w(A){return A===60||A===62||A===92?(e.consume(A),b):b(A)}function S(A){return!m&&(A===null||A===41||Ln(A))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(i),t(A)):m999||b===null||b===91||b===93&&!d||b===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?n(b):b===93?(e.exit(l),e.enter(o),e.consume(b),e.exit(o),e.exit(i),t):Le(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||b===91||b===93||Le(b)||f++>999?(e.exit("chunkString"),m(b)):(e.consume(b),d||(d=!ct(b)),b===92?v:g)}function v(b){return b===91||b===92||b===93?(e.consume(b),f++,g):g(b)}}function VC(e,t,n,i,o,l){let u;return f;function f(v){return v===34||v===39||v===40?(e.enter(i),e.enter(o),e.consume(v),e.exit(o),u=v===40?41:v,d):n(v)}function d(v){return v===u?(e.enter(o),e.consume(v),e.exit(o),e.exit(i),t):(e.enter(l),p(v))}function p(v){return v===u?(e.exit(l),d(u)):v===null?n(v):Le(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),Et(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===u||v===null||Le(v)?(e.exit("chunkString"),p(v)):(e.consume(v),v===92?g:m)}function g(v){return v===u||v===92?(e.consume(v),m):m(v)}}function kl(e,t){let n;return i;function i(o){return Le(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):ct(o)?Et(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const dI={name:"definition",tokenize:hI},pI={partial:!0,tokenize:mI};function hI(e,t,n){const i=this;let o;return l;function l(b){return e.enter("definition"),u(b)}function u(b){return FC.call(i,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function f(b){return o=$o(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),d):n(b)}function d(b){return Ln(b)?kl(e,p)(b):p(b)}function p(b){return qC(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function m(b){return e.attempt(pI,g,g)(b)}function g(b){return ct(b)?Et(e,v,"whitespace")(b):v(b)}function v(b){return b===null||Le(b)?(e.exit("definition"),i.parser.defined.push(o),t(b)):n(b)}}function mI(e,t,n){return i;function i(f){return Ln(f)?kl(e,o)(f):n(f)}function o(f){return VC(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function l(f){return ct(f)?Et(e,u,"whitespace")(f):u(f)}function u(f){return f===null||Le(f)?t(f):n(f)}}const gI={name:"hardBreakEscape",tokenize:yI};function yI(e,t,n){return i;function i(l){return e.enter("hardBreakEscape"),e.consume(l),o}function o(l){return Le(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const bI={name:"headingAtx",resolve:vI,tokenize:SI};function vI(e,t){let n=e.length-2,i=3,o,l;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},l={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Gr(e,i,n-i+1,[["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t]])),e}function SI(e,t,n){let i=0;return o;function o(m){return e.enter("atxHeading"),l(m)}function l(m){return e.enter("atxHeadingSequence"),u(m)}function u(m){return m===35&&i++<6?(e.consume(m),u):m===null||Ln(m)?(e.exit("atxHeadingSequence"),f(m)):n(m)}function f(m){return m===35?(e.enter("atxHeadingSequence"),d(m)):m===null||Le(m)?(e.exit("atxHeading"),t(m)):ct(m)?Et(e,f,"whitespace")(m):(e.enter("atxHeadingText"),p(m))}function d(m){return m===35?(e.consume(m),d):(e.exit("atxHeadingSequence"),f(m))}function p(m){return m===null||m===35||Ln(m)?(e.exit("atxHeadingText"),f(m)):(e.consume(m),p)}}const wI=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],R1=["pre","script","style","textarea"],xI={concrete:!0,name:"htmlFlow",resolveTo:EI,tokenize:TI},CI={partial:!0,tokenize:_I},kI={partial:!0,tokenize:AI};function EI(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 TI(e,t,n){const i=this;let o,l,u,f,d;return p;function p(L){return m(L)}function m(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),g}function g(L){return L===33?(e.consume(L),v):L===47?(e.consume(L),l=!0,S):L===63?(e.consume(L),o=3,i.interrupt?t:k):Hr(L)?(e.consume(L),u=String.fromCharCode(L),C):n(L)}function v(L){return L===45?(e.consume(L),o=2,b):L===91?(e.consume(L),o=5,f=0,w):Hr(L)?(e.consume(L),o=4,i.interrupt?t:k):n(L)}function b(L){return L===45?(e.consume(L),i.interrupt?t:k):n(L)}function w(L){const re="CDATA[";return L===re.charCodeAt(f++)?(e.consume(L),f===re.length?i.interrupt?t:U:w):n(L)}function S(L){return Hr(L)?(e.consume(L),u=String.fromCharCode(L),C):n(L)}function C(L){if(L===null||L===47||L===62||Ln(L)){const re=L===47,fe=u.toLowerCase();return!re&&!l&&R1.includes(fe)?(o=1,i.interrupt?t(L):U(L)):wI.includes(u.toLowerCase())?(o=6,re?(e.consume(L),A):i.interrupt?t(L):U(L)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(L):l?O(L):_(L))}return L===45||Kn(L)?(e.consume(L),u+=String.fromCharCode(L),C):n(L)}function A(L){return L===62?(e.consume(L),i.interrupt?t:U):n(L)}function O(L){return ct(L)?(e.consume(L),O):E(L)}function _(L){return L===47?(e.consume(L),E):L===58||L===95||Hr(L)?(e.consume(L),M):ct(L)?(e.consume(L),_):E(L)}function M(L){return L===45||L===46||L===58||L===95||Kn(L)?(e.consume(L),M):R(L)}function R(L){return L===61?(e.consume(L),D):ct(L)?(e.consume(L),R):_(L)}function D(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),d=L,P):ct(L)?(e.consume(L),D):z(L)}function P(L){return L===d?(e.consume(L),d=null,$):L===null||Le(L)?n(L):(e.consume(L),P)}function z(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||Ln(L)?R(L):(e.consume(L),z)}function $(L){return L===47||L===62||ct(L)?_(L):n(L)}function E(L){return L===62?(e.consume(L),I):n(L)}function I(L){return L===null||Le(L)?U(L):ct(L)?(e.consume(L),I):n(L)}function U(L){return L===45&&o===2?(e.consume(L),H):L===60&&o===1?(e.consume(L),Z):L===62&&o===4?(e.consume(L),X):L===63&&o===3?(e.consume(L),k):L===93&&o===5?(e.consume(L),J):Le(L)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(CI,se,G)(L)):L===null||Le(L)?(e.exit("htmlFlowData"),G(L)):(e.consume(L),U)}function G(L){return e.check(kI,Y,se)(L)}function Y(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),V}function V(L){return L===null||Le(L)?G(L):(e.enter("htmlFlowData"),U(L))}function H(L){return L===45?(e.consume(L),k):U(L)}function Z(L){return L===47?(e.consume(L),u="",ae):U(L)}function ae(L){if(L===62){const re=u.toLowerCase();return R1.includes(re)?(e.consume(L),X):U(L)}return Hr(L)&&u.length<8?(e.consume(L),u+=String.fromCharCode(L),ae):U(L)}function J(L){return L===93?(e.consume(L),k):U(L)}function k(L){return L===62?(e.consume(L),X):L===45&&o===2?(e.consume(L),k):U(L)}function X(L){return L===null||Le(L)?(e.exit("htmlFlowData"),se(L)):(e.consume(L),X)}function se(L){return e.exit("htmlFlow"),t(L)}}function AI(e,t,n){const i=this;return o;function o(u){return Le(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):n(u)}function l(u){return i.parser.lazy[i.now().line]?n(u):t(u)}}function _I(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Hf,t,n)}}const RI={name:"htmlText",tokenize:OI};function OI(e,t,n){const i=this;let o,l,u;return f;function f(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),d}function d(k){return k===33?(e.consume(k),p):k===47?(e.consume(k),R):k===63?(e.consume(k),_):Hr(k)?(e.consume(k),z):n(k)}function p(k){return k===45?(e.consume(k),m):k===91?(e.consume(k),l=0,w):Hr(k)?(e.consume(k),O):n(k)}function m(k){return k===45?(e.consume(k),b):n(k)}function g(k){return k===null?n(k):k===45?(e.consume(k),v):Le(k)?(u=g,Z(k)):(e.consume(k),g)}function v(k){return k===45?(e.consume(k),b):g(k)}function b(k){return k===62?H(k):k===45?v(k):g(k)}function w(k){const X="CDATA[";return k===X.charCodeAt(l++)?(e.consume(k),l===X.length?S:w):n(k)}function S(k){return k===null?n(k):k===93?(e.consume(k),C):Le(k)?(u=S,Z(k)):(e.consume(k),S)}function C(k){return k===93?(e.consume(k),A):S(k)}function A(k){return k===62?H(k):k===93?(e.consume(k),A):S(k)}function O(k){return k===null||k===62?H(k):Le(k)?(u=O,Z(k)):(e.consume(k),O)}function _(k){return k===null?n(k):k===63?(e.consume(k),M):Le(k)?(u=_,Z(k)):(e.consume(k),_)}function M(k){return k===62?H(k):_(k)}function R(k){return Hr(k)?(e.consume(k),D):n(k)}function D(k){return k===45||Kn(k)?(e.consume(k),D):P(k)}function P(k){return Le(k)?(u=P,Z(k)):ct(k)?(e.consume(k),P):H(k)}function z(k){return k===45||Kn(k)?(e.consume(k),z):k===47||k===62||Ln(k)?$(k):n(k)}function $(k){return k===47?(e.consume(k),H):k===58||k===95||Hr(k)?(e.consume(k),E):Le(k)?(u=$,Z(k)):ct(k)?(e.consume(k),$):H(k)}function E(k){return k===45||k===46||k===58||k===95||Kn(k)?(e.consume(k),E):I(k)}function I(k){return k===61?(e.consume(k),U):Le(k)?(u=I,Z(k)):ct(k)?(e.consume(k),I):$(k)}function U(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),o=k,G):Le(k)?(u=U,Z(k)):ct(k)?(e.consume(k),U):(e.consume(k),Y)}function G(k){return k===o?(e.consume(k),o=void 0,V):k===null?n(k):Le(k)?(u=G,Z(k)):(e.consume(k),G)}function Y(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||Ln(k)?$(k):(e.consume(k),Y)}function V(k){return k===47||k===62||Ln(k)?$(k):n(k)}function H(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function Z(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),ae}function ae(k){return ct(k)?Et(e,J,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):J(k)}function J(k){return e.enter("htmlTextData"),u(k)}}const $g={name:"labelEnd",resolveAll:LI,resolveTo:zI,tokenize:II},MI={tokenize:BI},NI={tokenize:jI},DI={tokenize:$I};function LI(e){let t=-1;const n=[];for(;++t=3&&(p===null||Le(p))?(e.exit("thematicBreak"),t(p)):n(p)}function d(p){return p===o?(e.consume(p),i++,d):(e.exit("thematicBreakSequence"),ct(p)?Et(e,f,"whitespace")(p):f(p))}}const Dn={continuation:{tokenize:XI},exit:QI,name:"list",tokenize:YI},GI={partial:!0,tokenize:ZI},KI={partial:!0,tokenize:WI};function YI(e,t,n){const i=this,o=i.events[i.events.length-1];let l=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,u=0;return f;function f(b){const w=i.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!i.containerState.marker||b===i.containerState.marker:km(b)){if(i.containerState.type||(i.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Bc,n,p)(b):p(b);if(!i.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(b)}return n(b)}function d(b){return km(b)&&++u<10?(e.consume(b),d):(!i.interrupt||u<2)&&(i.containerState.marker?b===i.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),p(b)):n(b)}function p(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||b,e.check(Hf,i.interrupt?n:m,e.attempt(GI,v,g))}function m(b){return i.containerState.initialBlankLine=!0,l++,v(b)}function g(b){return ct(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),v):n(b)}function v(b){return i.containerState.size=l+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function XI(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(Hf,o,l);function o(f){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Et(e,t,"listItemIndent",i.containerState.size+1)(f)}function l(f){return i.containerState.furtherBlankLines||!ct(f)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,u(f)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(KI,t,u)(f))}function u(f){return i.containerState._closeFlow=!0,i.interrupt=void 0,Et(e,e.attempt(Dn,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function WI(e,t,n){const i=this;return Et(e,o,"listItemIndent",i.containerState.size+1);function o(l){const u=i.events[i.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===i.containerState.size?t(l):n(l)}}function QI(e){e.exit(this.containerState.type)}function ZI(e,t,n){const i=this;return Et(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(l){const u=i.events[i.events.length-1];return!ct(l)&&u&&u[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const O1={name:"setextUnderline",resolveTo:JI,tokenize:e3};function JI(e,t){let n=e.length,i,o,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const u={type:"setextHeading",start:{...e[o][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",l?(e.splice(o,0,["enter",u,t]),e.splice(l+1,0,["exit",e[i][1],t]),e[i][1].end={...e[l][1].end}):e[i][1]=u,e.push(["exit",u,t]),e}function e3(e,t,n){const i=this;let o;return l;function l(p){let m=i.events.length,g;for(;m--;)if(i.events[m][1].type!=="lineEnding"&&i.events[m][1].type!=="linePrefix"&&i.events[m][1].type!=="content"){g=i.events[m][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||g)?(e.enter("setextHeadingLine"),o=p,u(p)):n(p)}function u(p){return e.enter("setextHeadingLineSequence"),f(p)}function f(p){return p===o?(e.consume(p),f):(e.exit("setextHeadingLineSequence"),ct(p)?Et(e,d,"lineSuffix")(p):d(p))}function d(p){return p===null||Le(p)?(e.exit("setextHeadingLine"),t(p)):n(p)}}const t3={tokenize:n3};function n3(e){const t=this,n=e.attempt(Hf,i,e.attempt(this.parser.constructs.flowInitial,o,Et(e,e.attempt(this.parser.constructs.flow,o,e.attempt(sI,o)),"linePrefix")));return n;function i(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const r3={resolveAll:KC()},i3=GC("string"),a3=GC("text");function GC(e){return{resolveAll:KC(e==="text"?o3:void 0),tokenize:t};function t(n){const i=this,o=this.parser.constructs[e],l=n.attempt(o,u,f);return u;function u(m){return p(m)?l(m):f(m)}function f(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),d}function d(m){return p(m)?(n.exit("data"),l(m)):(n.consume(m),d)}function p(m){if(m===null)return!0;const g=o[m];let v=-1;if(g)for(;++v-1){const f=u[0];typeof f=="string"?u[0]=f.slice(i):u.shift()}l>0&&u.push(e[o].slice(0,l))}return u}function v3(e,t){let n=-1;const i=[];let o;for(;++n0){const Me=he.tokenStack[he.tokenStack.length-1];(Me[1]||N1).call(he,void 0,Me[0])}for(de.position={start:Fi(ee.length>0?ee[0][1].start:{line:1,column:1,offset:0}),end:Fi(ee.length>0?ee[ee.length-2][1].end:{line:1,column:1,offset:0})},Re=-1;++Re1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,d);const p={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,p),e.applyData(t,p)}function I3(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function B3(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function WC(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const o=e.all(t),l=o[0];l&&l.type==="text"?l.value="["+l.value:o.unshift({type:"text",value:"["});const u=o[o.length-1];return u&&u.type==="text"?u.value+=i:o.push({type:"text",value:i}),o}function j3(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return WC(e,t);const o={src:ts(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(o.title=i.title);const l={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,l),e.applyData(t,l)}function $3(e,t){const n={src:ts(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function P3(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function U3(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return WC(e,t);const o={href:ts(i.url||"")};i.title!==null&&i.title!==void 0&&(o.title=i.title);const l={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function H3(e,t){const n={href:ts(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function q3(e,t,n){const i=e.all(t),o=n?F3(n):QC(t),l={},u=[];if(typeof t.checked=="boolean"){const m=i[0];let g;m&&m.type==="element"&&m.tagName==="p"?g=m:(g={type:"element",tagName:"p",properties:{},children:[]},i.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let f=-1;for(;++f1}function V3(e,t){const n={},i=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},f=Dg(t.children[1]),d=MC(t.children[t.children.length-1]);f&&d&&(u.position={start:f,end:d}),o.push(u)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,l),e.applyData(t,l)}function W3(e,t,n){const i=n?n.children:void 0,l=(i?i.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,f=u?u.length:t.children.length;let d=-1;const p=[];for(;++d0,!0),i[0]),o=i.index+i[0].length,i=n.exec(t);return l.push(z1(t.slice(o),o>0,!1)),l.join("")}function z1(e,t,n){let i=0,o=e.length;if(t){let l=e.codePointAt(i);for(;l===D1||l===L1;)i++,l=e.codePointAt(i)}if(n){let l=e.codePointAt(o-1);for(;l===D1||l===L1;)o--,l=e.codePointAt(o-1)}return o>i?e.slice(i,o):""}function J3(e,t){const n={type:"text",value:Z3(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function eB(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const tB={blockquote:O3,break:M3,code:N3,delete:D3,emphasis:L3,footnoteReference:z3,heading:I3,html:B3,imageReference:j3,image:$3,inlineCode:P3,linkReference:U3,link:H3,listItem:q3,list:V3,paragraph:G3,root:K3,strong:Y3,table:X3,tableCell:Q3,tableRow:W3,text:J3,thematicBreak:eB,toml:kc,yaml:kc,definition:kc,footnoteDefinition:kc};function kc(){}const ZC=-1,qf=0,El=1,tf=2,Pg=3,Ug=4,Hg=5,qg=6,JC=7,ek=8,I1=typeof self=="object"?self:globalThis,nB=(e,t)=>{const n=(o,l)=>(e.set(l,o),o),i=o=>{if(e.has(o))return e.get(o);const[l,u]=t[o];switch(l){case qf:case ZC:return n(u,o);case El:{const f=n([],o);for(const d of u)f.push(i(d));return f}case tf:{const f=n({},o);for(const[d,p]of u)f[i(d)]=i(p);return f}case Pg:return n(new Date(u),o);case Ug:{const{source:f,flags:d}=u;return n(new RegExp(f,d),o)}case Hg:{const f=n(new Map,o);for(const[d,p]of u)f.set(i(d),i(p));return f}case qg:{const f=n(new Set,o);for(const d of u)f.add(i(d));return f}case JC:{const{name:f,message:d}=u;return n(new I1[f](d),o)}case ek:return n(BigInt(u),o);case"BigInt":return n(Object(BigInt(u)),o);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return n(new DataView(f),u)}}return n(new I1[l](u),o)};return i},B1=e=>nB(new Map,e)(0),To="",{toString:rB}={},{keys:iB}=Object,sl=e=>{const t=typeof e;if(t!=="object"||!e)return[qf,t];const n=rB.call(e).slice(8,-1);switch(n){case"Array":return[El,To];case"Object":return[tf,To];case"Date":return[Pg,To];case"RegExp":return[Ug,To];case"Map":return[Hg,To];case"Set":return[qg,To];case"DataView":return[El,n]}return n.includes("Array")?[El,n]:n.includes("Error")?[JC,n]:[tf,n]},Ec=([e,t])=>e===qf&&(t==="function"||t==="symbol"),aB=(e,t,n,i)=>{const o=(u,f)=>{const d=i.push(u)-1;return n.set(f,d),d},l=u=>{if(n.has(u))return n.get(u);let[f,d]=sl(u);switch(f){case qf:{let m=u;switch(d){case"bigint":f=ek,m=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);m=null;break;case"undefined":return o([ZC],u)}return o([f,m],u)}case El:{if(d){let v=u;return d==="DataView"?v=new Uint8Array(u.buffer):d==="ArrayBuffer"&&(v=new Uint8Array(u)),o([d,[...v]],u)}const m=[],g=o([f,m],u);for(const v of u)m.push(l(v));return g}case tf:{if(d)switch(d){case"BigInt":return o([d,u.toString()],u);case"Boolean":case"Number":case"String":return o([d,u.valueOf()],u)}if(t&&"toJSON"in u)return l(u.toJSON());const m=[],g=o([f,m],u);for(const v of iB(u))(e||!Ec(sl(u[v])))&&m.push([l(v),l(u[v])]);return g}case Pg:return o([f,u.toISOString()],u);case Ug:{const{source:m,flags:g}=u;return o([f,{source:m,flags:g}],u)}case Hg:{const m=[],g=o([f,m],u);for(const[v,b]of u)(e||!(Ec(sl(v))||Ec(sl(b))))&&m.push([l(v),l(b)]);return g}case qg:{const m=[],g=o([f,m],u);for(const v of u)(e||!Ec(sl(v)))&&m.push(l(v));return g}}const{message:p}=u;return o([f,{name:d,message:p}],u)};return l},j1=(e,{json:t,lossy:n}={})=>{const i=[];return aB(!(t||n),!!t,new Map,i)(e),i},nf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?B1(j1(e,t)):structuredClone(e):(e,t)=>B1(j1(e,t));function oB(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function sB(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function lB(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||oB,i=e.options.footnoteBackLabel||sB,o=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let d=-1;for(;++d0&&w.push({type:"text",value:" "});let O=typeof n=="string"?n:n(d,b);typeof O=="string"&&(O={type:"text",value:O}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(d,b),className:["data-footnote-backref"]},children:Array.isArray(O)?O:[O]})}const C=m[m.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const O=C.children[C.children.length-1];O&&O.type==="text"?O.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...w)}else m.push(...w);const A={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(m,!0)};e.patch(p,A),f.push(A)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...nf(u),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
+`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
+`}]}}const tk=function(e){if(e==null)return dB;if(typeof e=="function")return Ff(e);if(typeof e=="object")return Array.isArray(e)?uB(e):cB(e);if(typeof e=="string")return fB(e);throw new Error("Expected function, string, or object as test")};function uB(e){const t=[];let n=-1;for(;++n":""))+")"})}return v;function v(){let b=nk,w,S,C;if((!t||l(d,p,m[m.length-1]||void 0))&&(b=yB(n(d,m)),b[0]===$1))return b;if("children"in d&&d.children){const A=d;if(A.children&&b[0]!==mB)for(S=(i?A.children.length:-1)+u,C=m.concat(A);S>-1&&S0&&n.push({type:"text",value:`
+`}),n}function P1(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function U1(e,t){const n=vB(e,t),i=n.one(e,void 0),o=lB(n),l=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return o&&l.children.push({type:"text",value:`
+`},o),l}function kB(e,t){return e&&"run"in e?async function(n,i){const o=U1(n,{file:i,...t});await e.run(o,i)}:function(n,i){return U1(n,{file:i,...e||t})}}function H1(e){if(e)throw e}var Dh,q1;function EB(){if(q1)return Dh;q1=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(p){return typeof Array.isArray=="function"?Array.isArray(p):t.call(p)==="[object Array]"},l=function(p){if(!p||t.call(p)!=="[object Object]")return!1;var m=e.call(p,"constructor"),g=p.constructor&&p.constructor.prototype&&e.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!m&&!g)return!1;var v;for(v in p);return typeof v>"u"||e.call(p,v)},u=function(p,m){n&&m.name==="__proto__"?n(p,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):p[m.name]=m.newValue},f=function(p,m){if(m==="__proto__")if(e.call(p,m)){if(i)return i(p,m).value}else return;return p[m]};return Dh=function d(){var p,m,g,v,b,w,S=arguments[0],C=1,A=arguments.length,O=!1;for(typeof S=="boolean"&&(O=S,S=arguments[1]||{},C=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});Cu.length;let d;f&&u.push(o);try{d=e.apply(this,u)}catch(p){const m=p;if(f&&n)throw m;return o(m)}f||(d&&d.then&&typeof d.then=="function"?d.then(l,o):d instanceof Error?o(d):l(d))}function o(u,...f){n||(n=!0,t(u,...f))}function l(u){o(null,u)}}const Br={basename:RB,dirname:OB,extname:MB,join:NB,sep:"/"};function RB(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ru(e);let n=0,i=-1,o=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(l){n=o+1;break}}else i<0&&(l=!0,i=o+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let u=-1,f=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(l){n=o+1;break}}else u<0&&(l=!0,u=o+1),f>-1&&(e.codePointAt(o)===t.codePointAt(f--)?f<0&&(i=o):(f=-1,i=u));return n===i?i=u:i<0&&(i=e.length),e.slice(n,i)}function OB(e){if(ru(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function MB(e){ru(e);let t=e.length,n=-1,i=0,o=-1,l=0,u;for(;t--;){const f=e.codePointAt(t);if(f===47){if(u){i=t+1;break}continue}n<0&&(u=!0,n=t+1),f===46?o<0?o=t:l!==1&&(l=1):o>-1&&(l=-1)}return o<0||n<0||l===0||l===1&&o===n-1&&o===i+1?"":e.slice(o,n)}function NB(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function LB(e,t){let n="",i=0,o=-1,l=0,u=-1,f,d;for(;++u<=e.length;){if(u2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",i=0):(n=n.slice(0,d),i=n.length-1-n.lastIndexOf("/")),o=u,l=0;continue}}else if(n.length>0){n="",i=0,o=u,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(o+1,u):n=e.slice(o+1,u),i=u-o-1;o=u,l=0}else f===46&&l>-1?l++:l=-1}return n}function ru(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const zB={cwd:IB};function IB(){return"/"}function _m(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function BB(e){if(typeof e=="string")e=new URL(e);else if(!_m(e)){const t=new 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:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return jB(e)}function jB(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n0){let[b,...w]=m;const S=i[v][1];Am(S)&&Am(b)&&(b=Lh(!0,S,b)),i[v]=[p,b,...w]}}}}const HB=new Fg().freeze();function jh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function $h(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ph(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function V1(e){if(!Am(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function G1(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Tc(e){return qB(e)?e:new ik(e)}function qB(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function FB(e){return typeof e=="string"||VB(e)}function VB(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const GB="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",K1=[],Y1={allowDangerousHtml:!0},KB=/^(https?|ircs?|mailto|xmpp)$/i,YB=[{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 XB(e){const t=WB(e),n=QB(e);return ZB(t.runSync(t.parse(n),n),e)}function WB(e){const t=e.rehypePlugins||K1,n=e.remarkPlugins||K1,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Y1}:Y1;return HB().use(R3).use(n).use(kB,i).use(t)}function QB(e){const t=e.children||"",n=new ik;return typeof t=="string"&&(n.value=t),n}function ZB(e,t){const n=t.allowedElements,i=t.allowElement,o=t.components,l=t.disallowedElements,u=t.skipHtml,f=t.unwrapDisallowed,d=t.urlTransform||JB;for(const m of YB)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+GB+m.id,void 0);return rk(e,p),s4(e,{Fragment:B.Fragment,components:o,ignoreInvalidStyle:!0,jsx:B.jsx,jsxs:B.jsxs,passKeys:!0,passNode:!0});function p(m,g,v){if(m.type==="raw"&&v&&typeof g=="number")return u?v.children.splice(g,1):v.children[g]={type:"text",value:m.value},g;if(m.type==="element"){let b;for(b in Oh)if(Object.hasOwn(Oh,b)&&Object.hasOwn(m.properties,b)){const w=m.properties[b],S=Oh[b];(S===null||S.includes(m.tagName))&&(m.properties[b]=d(String(w||""),b,m))}}if(m.type==="element"){let b=n?!n.includes(m.tagName):l?l.includes(m.tagName):!1;if(!b&&i&&typeof g=="number"&&(b=!i(m,g,v)),b&&v&&typeof g=="number")return f&&m.children?v.children.splice(g,1,...m.children):v.children.splice(g,1),g}}}function JB(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||i!==-1&&t>i||KB.test(e.slice(0,t))?e:""}const e6=bi(B.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator"),t6=bi(B.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility"),n6=bi(B.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff"),r6=bi(B.jsx("path",{d:"M11 18h2v-2h-2zm1-16C6.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 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline");String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)};const i6=({type:e,module:t,toggleModule:n,enabledModules:i,configValues:o})=>{const{attributes:l,listeners:u,setNodeRef:f,transform:d,transition:p,isDragging:m}=yL({id:t.name}),g={...wS.style,transform:Xi.Transform.toString(d),transition:p,zIndex:m?"100":"auto",opacity:m?.3:1};let v=t.name;const[b,w]=T.useState(!1),[S,C]=T.useState(!1),A=i[e].find(O=>O[0]===v)[1];return B.jsxs(sx,{ref:f,size:{xs:6,sm:4,md:3},style:g,children:[B.jsxs(wS,{children:[B.jsx(iM,{title:B.jsx(ax,{style:{paddingRight:"0 !important"},control:B.jsx(Qw,{title:"Check to enable this module",sx:{paddingTop:0,paddingBottom:0},id:v,onClick:n,checked:A}),label:t.display_name})}),B.jsx(QO,{children:B.jsxs(Pr,{sx:{justifyContent:"space-between",display:"flex",width:"100%"},children:[B.jsxs(Pr,{children:[B.jsx(rm,{title:"Module information",size:"small",onClick:()=>w(!0),children:B.jsx(r6,{})}),A&&t.configs&&v!="cli_feeder"?B.jsx(om,{size:"small",onClick:()=>C(!0),children:"Configure"}):null]}),B.jsx(rm,{size:"small",title:"Drag to reorder",sx:{cursor:"grab"},...u,...l,children:B.jsx(e6,{})})]})})]}),B.jsxs(tx,{open:b,onClose:()=>w(!1),maxWidth:"lg",children:[B.jsx(rx,{children:t.display_name}),B.jsx(nx,{children:B.jsx(XB,{children:t.manifest.description.split(`
+`).map(O=>O.trim()).join(`
+`)})})]}),t.configs&&v!="cli_feeder"&&B.jsx(o6,{module:t,open:S,setOpen:C,configValues:o})]})};function a6({config_value:e,module:t,configValues:n}){const[i,o]=T.useState(!1),l=()=>o(C=>!C),u=C=>{C.preventDefault()},f=C=>{C.preventDefault()};function d(C,A){n[t.name][C]=A}const p=t.configs[e],g=e.replace(/_/g," ").capitalize(),v=n[t.name][e]||p.default,b=e.toLowerCase(),w=b.includes("password")||b.includes("secret")||b.includes("token")||b.includes("key")||b.includes("api_hash")||p.type==="password",S=w?"password":p.type==="int"?"number":"text";return B.jsxs(Pr,{children:[B.jsxs(en,{variant:"body1",style:{fontWeight:"bold"},children:[g," ",p.required&&"(required)"," "]}),B.jsxs(ix,{size:"small",children:[p.type==="bool"?B.jsx(ax,{control:B.jsx(Qw,{defaultChecked:v,size:"small",id:`${t}.${e}`,onChange:C=>{d(e,C.target.checked)}}),label:p.help.capitalize()}):p.choices!==void 0?B.jsx(sg,{size:"small",id:`${t}.${e}`,defaultValue:p.default,value:v,onChange:C=>{d(e,C.target.value)},children:p.choices.map(C=>B.jsx(tD,{value:C,children:C},`${t}.${e}.${C}`))}):p.type==="json_loader"?B.jsx($S,{multiline:!0,size:"small",id:`${t}.${e}`,defaultValue:JSON.stringify(v,null,2),rows:6,onChange:C=>{try{let A=JSON.parse(C.target.value);d(e,A)}catch(A){console.log(A)}}}):B.jsx($S,{size:"small",id:`${t}.${e}`,defaultValue:v,type:i?"text":S,onChange:C=>{d(e,C.target.value)},required:p.required,slotProps:w?{input:{endAdornment:B.jsx(RN,{position:"end",children:B.jsx(rm,{"aria-label":"toggle password visibility",onClick:l,onMouseDown:u,onMouseUp:f,children:i?B.jsx(n6,{}):B.jsx(t6,{})})})}}:{}}),p.type!=="bool"&&B.jsx(ox,{children:p.help.capitalize()})]})]})}function o6({module:e,open:t,setOpen:n,configValues:i}){return B.jsx(B.Fragment,{children:B.jsxs(tx,{open:t,onClose:()=>n(!1),maxWidth:"lg",children:[B.jsx(rx,{children:e.display_name}),B.jsx(nx,{children:B.jsx(px,{direction:"column",spacing:1,children:Object.keys(e.configs).map(o=>B.jsx(a6,{config_value:o,module:e,configValues:i},o))})})]})})}function s6({setYamlFile:e}){const[t,n]=T.useState(!1),[i,o]=T.useState(B.jsx(B.Fragment,{children:"Drag and drop your orchestration.yaml file here, or click to select a file."}));T.useRef(null);function l(u){let f=u.target.files[0];if(f.type.indexOf("yaml")===-1){n(!0),o(B.jsx(B.Fragment,{children:"Invalid type, only YAML files are accepted."}));return}let d=new FileReader;d.onload=function(p){let m=p.target?p.target.result:"";try{let g=xC(m);if(g.errors.length>0){n(!0),o(B.jsx(B.Fragment,{children:"Invalid file. Make sure your Orchestration is a valid YAML file with a 'steps' section in it."}));return}else n(!1),o(B.jsx(B.Fragment,{children:"File loaded successfully."}));let v=g.get("steps");if(!v){n(!0),o(B.jsx(B.Fragment,{children:"Invalid file. Your orchestration file must have a 'steps' section in it."}));return}const b={feeder:"feeders",formatter:"formatters",archivers:"extractors"};let w=!1;for(let S of Object.keys(b))if(v.get(S)!==void 0){n(!0),o(B.jsxs(B.Fragment,{children:["Invalid file. Your orchestration file appears to be in the old (v0.12) format with a '",S,"' section.",B.jsx("br",{}),"You should manually update your orchestration file first (hint: ",S," → ",b[S],")"]})),w=!0;return}e(g)}catch(g){console.error(g)}},d.readAsText(f)}return B.jsx(B.Fragment,{children:B.jsxs("div",{style:{position:"relative",width:"100%",border:"dashed",borderRadius:"5px",textAlign:"center",borderWidth:"1px",padding:"20px"},onDragEnter:u=>{u.currentTarget.style.backgroundColor="var(--mui-palette-LinearProgress-infoBg)"},onDragLeave:u=>{u.currentTarget.style.backgroundColor=""},onDrop:u=>{u.currentTarget.style.backgroundColor=""},children:[B.jsx(_D,{style:{fontSize:50}}),B.jsx("input",{style:{opacity:0,position:"absolute",top:0,left:0,width:"100%",height:"100%",cursor:"pointer"},type:"file",id:"file",accept:".yaml",onChange:l}),B.jsx(en,{variant:"body1",color:t?"error":"",children:i})]})})}function l6({stepType:e,setEnabledModules:t,enabledModules:n,configValues:i}){const[o,l]=T.useState(!1),[u,f]=T.useState(),[d,p]=T.useState([]);T.useEffect(()=>{p(n[e].map(([w,S])=>w))},[n]);const m=w=>{let S=w.target.id,C=w.target.checked;(e==="feeders"||e==="formatters")&&n[e].filter(([_,M])=>_!==S&&M||C&&_===S).length>1?l(!0):l(!1);let A={...n};A[e]=n[e].map(([O,_])=>O===S?[O,C]:[O,_]),t(A)},g=qD(US(pg),US(fg,{coordinateGetter:SL})),v=w=>{f(w.active.id)},b=w=>{f(void 0);const{active:S,over:C}=w;if(S.id!==(C==null?void 0:C.id)){const A=d.indexOf(S.id),O=d.indexOf(C==null?void 0:C.id);let _=mg(d,A,O),M={...n};M[e]=n[e].sort((R,D)=>_.indexOf(R[0])-_.indexOf(D[0])),t(M)}};return B.jsxs(B.Fragment,{children:[B.jsxs(Pr,{sx:{my:4},children:[B.jsx(en,{id:e,variant:"h6",style:{textTransform:"capitalize"},children:e}),B.jsxs(en,{variant:"body1",children:["Select the ",B.jsx("a",{href:"{let S=dl[w];return B.jsx(i6,{type:e,module:S,toggleModule:m,enabledModules:n,configValues:i},w)}),B.jsx(oL,{children:u?B.jsx("div",{style:{width:"100%",height:"100%",backgroundColor:"grey",opacity:.1}}):null})]})},e)})]})}function u6(){const[e,t]=T.useState(new eu),[n,i]=T.useState(Object.fromEntries(Object.keys(il).map(f=>[f,il[f].map(d=>[d,!1])]))),[o,l]=T.useState(Object.keys(dl).reduce((f,d)=>(f[d]={},f),{})),u=function(f=!1){let d=n,p=null;if(!e||e.contents==null?p=xC(xL):p=e,wh.forEach(m=>{let g=m+"s",v=p.getIn(["steps",g]);d[g].forEach(([b,w])=>{var A,O;let S=v.items.findIndex(_=>(_.value||_)===b),C=p.getIn(["steps",g],!0);w&&S===-1?(p.addIn(["steps",g],b),C.commentBefore=(A=C.commentBefore)==null?void 0:A.replace(`
+ - `+b,""),C.comment=(O=C.comment)==null?void 0:O.replace(`
+ - `+b,"")):!w&&S!==-1&&(p.deleteIn(["steps",g,S]),C.commentBefore+=`
+ - `+b,p.setIn(["steps",g],C))}),v.items.sort((b,w)=>d[g].findIndex(S=>S[0]===(b.value||b))-d[g].findIndex(S=>S[0]===(w.value||w))),v.flow=!v.items.length}),Object.keys(o).forEach(m=>{let g=p.get(m,!0);g?(Object.keys(o[m]).forEach(v=>{let b=g.get(v,!0);b?(b.value=o[m][v],g.set(v,b)):g.set(v,o[m][v])}),p.set(m,g)):o[m]&&Object.keys(o[m]).length>0&&p.set(m,o[m])}),f)navigator.clipboard.writeText(String(p)).then(()=>{alert("Settings copied to clipboard.")});else{const m=new Blob([String(p)],{type:"application/x-yaml"}),g=URL.createObjectURL(m),v=document.createElement("a");v.href=g,v.download="orchestration.yaml",v.click()}};return T.useEffect(()=>{let f={};Object.keys(dl).map(d=>{let m=dl[d].configs;m&&(f[d]={},Object.keys(m).map(g=>{let v=m[g];v.default!==void 0&&(f[d][g]=v.default)}))}),l(f)},[]),T.useEffect(()=>{if(!e||e.contents==null)return;let f=e.toJS(),d=f.steps,p=Object.fromEntries(Object.keys(il).map(g=>[g,il[g].map(v=>[v,d[g].indexOf(v)!==-1]).sort((v,b)=>{let w=d[g].indexOf(v[0]),S=d[g].indexOf(b[0]);return w===-1&&S===-1?v-b:S===-1?-1:w===-1?1:w-S})]).sort((g,v)=>wh.indexOf(g[0])-wh.indexOf(v[0])));i(p);let m=f;delete m.steps,l(Object.keys(dl).reduce((g,v)=>(g[v]=m[v]||{},g),{}))},[e]),B.jsx(vM,{maxWidth:"lg",children:B.jsxs(Pr,{sx:{my:4},children:[B.jsxs(Pr,{sx:{my:4},children:[B.jsx(en,{variant:"h5",children:"1. Select your orchestration.yaml settings file."}),B.jsx(en,{variant:"body1",children:"Or skip this step to start from scratch"}),B.jsx(s6,{setYamlFile:t})]}),B.jsxs(Pr,{sx:{my:4},children:[B.jsx(en,{variant:"h5",children:"2. Choose the Modules you wish to enable/disable"}),Object.keys(il).map(f=>B.jsx(Pr,{sx:{my:4},children:B.jsx(l6,{stepType:f,setEnabledModules:i,enabledModules:n,configValues:o})},f))]}),B.jsxs(Pr,{sx:{my:4},children:[B.jsx(en,{variant:"h5",children:"3. Configure your Enabled Modules"}),B.jsx(en,{variant:"body1",children:"Next to each module you've enabled, you can click 'Configure' to set the module's settings."})]}),B.jsxs(Pr,{sx:{my:4},children:[B.jsx(en,{variant:"h5",children:"4. Save your settings"}),B.jsxs(px,{direction:"row",spacing:2,sx:{my:2},children:[B.jsx(om,{variant:"contained",color:"primary",onClick:()=>u(!0),children:"Copy Settings to Clipboard"}),B.jsx(om,{variant:"contained",color:"primary",onClick:()=>u(),children:"Save Settings to File"})]})]})]})})}function c6(){const[e,t]=T.useState("light");T.useEffect(()=>{t(window.localStorage.getItem("theme")||"light")},[]);var n=new MutationObserver(function(o){t(window.localStorage.getItem("theme")||"light")});n.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});const i=vf({palette:{mode:e=="light"?"light":"dark"},cssVariables:!0});return B.jsxs(kR,{theme:i,children:[B.jsx(kM,{}),B.jsx(u6,{})]})}E2.createRoot(document.getElementById("root")).render(B.jsx(T.StrictMode,{children:B.jsx(c6,{})}));