From c69a0c80b6b994edadb860322ec60c0d5fca1cd9 Mon Sep 17 00:00:00 2001 From: bonartm Date: Thu, 1 Jul 2021 12:20:58 +0200 Subject: [PATCH] Release 0.3.0 --- package-lock.json | 4 ++-- package.json | 2 +- public/build/quizdown.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index d3dd9a7..56be6c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "quizdown", - "version": "0.2.8", + "version": "0.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "quizdown", - "version": "0.2.8", + "version": "0.3.0", "license": "MIT", "dependencies": { "auto-bind": "^4.0.0", diff --git a/package.json b/package.json index 73ec9d1..aa6a97f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "quizdown", - "version": "0.2.8", + "version": "0.3.0", "description": "Markdown for generating interactive quiz apps in the browser.", "private": false, "type": "module", diff --git a/public/build/quizdown.js b/public/build/quizdown.js index 022c004..49c0dcd 100644 --- a/public/build/quizdown.js +++ b/public/build/quizdown.js @@ -12,5 +12,5 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ***************************************************************************** */function Un(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);rn.slice(0,t+1).join("-"))).reverse()}function Hn(e,t=Fn().fallbackLocale){const n=Vn(e);return t?[...new Set([...n,...Vn(t)])]:n}function Yn(){return Gn}Kn.subscribe((e=>{Gn=e,"undefined"!=typeof window&&null!==e&&document.documentElement.setAttribute("lang",e)}));const Xn=Kn.set;Kn.set=e=>{if(function(e){if(null==e)return;const t=Hn(e);for(let e=0;eBn.set(!0)),t):Bn.set(!0),zn(e).then((()=>{Xn(e)})).finally((()=>{clearTimeout(n),Bn.set(!1)}))}return Xn(e)},Kn.update=e=>Xn(e(Gn));const Wn=e=>{const t=Object.create(null);return n=>{const s=JSON.stringify(n);return s in t?t[s]:t[s]=e(n)}},Jn=(e,t)=>{const{formats:n}=Fn();if(e in n&&t in n[e])return n[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},Zn=Wn((e=>{var{locale:t,format:n}=e,s=Un(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return n&&(s=Jn("number",n)),new Intl.NumberFormat(t,s)})),Qn=Wn((e=>{var{locale:t,format:n}=e,s=Un(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return n?s=Jn("date",n):0===Object.keys(s).length&&(s=Jn("date","short")),new Intl.DateTimeFormat(t,s)})),es=Wn((e=>{var{locale:t,format:n}=e,s=Un(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return n?s=Jn("time",n):0===Object.keys(s).length&&(s=Jn("time","short")),new Intl.DateTimeFormat(t,s)})),ts=Wn(((e,t=Yn())=>new Tn(e,t,Fn().formats,{ignoreTag:Fn().ignoreTag}))),ns=(e,t={})=>{"object"==typeof e&&(e=(t=e).id);const{values:n,locale:s=Yn(),default:r}=t;if(null==s)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let i=Nn(e,s);if(i){if("string"!=typeof i)return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof i}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),i}else Fn().warnOnMissingMessages&&console.warn(`[svelte-i18n] The message "${e}" was not found in "${Hn(s).join('", "')}".${qn(Yn())?"\n\nNote: there are at least one loader still registered to this locale that wasn't executed.":""}`),i=r||e;if(!n)return i;let o=i;try{o=ts(i,s).format(n)}catch(t){console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,t.message)}return o},ss=(e,t)=>((e={})=>{var{locale:t=Yn()}=e,n=Un(e,["locale"]);return es(Object.assign({locale:t},n))})(t).format(e),rs=(e,t)=>((e={})=>{var{locale:t=Yn()}=e,n=Un(e,["locale"]);return Qn(Object.assign({locale:t},n))})(t).format(e),is=(e,t)=>((e={})=>{var{locale:t=Yn()}=e,n=Un(e,["locale"]);return Zn(Object.assign({locale:t},n))})(t).format(e),os=(e,t=Yn())=>Nn(e,t),as=Ve([Kn,Ln],(()=>ns));function ls(e){E(e,"svelte-xeqbwq",".top-list-item.svelte-xeqbwq.svelte-xeqbwq{margin-bottom:0.2rem;list-style-type:none}.top-list-item.svelte-xeqbwq.svelte-xeqbwq:hover{cursor:pointer;background-color:var(--quizdown-color-secondary)}.top-list-item.svelte-xeqbwq:hover .list-question.svelte-xeqbwq{text-decoration:underline}.list-comment.svelte-xeqbwq.svelte-xeqbwq{margin-left:2em;list-style-type:initial}")}function cs(e,t,n){const s=e.slice();return s[4]=t[n],s[6]=n,s}function us(e,t,n){const s=e.slice();return s[7]=t[n],s}function hs(e){let t,n,s,r,i,o=e[4].answers[e[7]].html+"",a=e[4].answers[e[7]].comment+"";return{c(){t=N("li"),n=N("i"),s=L(":\n "),r=new D,i=I(),r.a=i,R(t,"class","list-comment svelte-xeqbwq")},m(e,l){T(e,t,l),S(t,n),n.innerHTML=o,S(t,s),r.m(a,t),S(t,i)},p(e,t){1&t&&o!==(o=e[4].answers[e[7]].html+"")&&(n.innerHTML=o),1&t&&a!==(a=e[4].answers[e[7]].comment+"")&&r.p(a)},d(e){e&&A(t)}}}function fs(e){let t,n=""!==e[4].answers[e[7]].comment&&hs(e);return{c(){n&&n.c(),t=C()},m(e,s){n&&n.m(e,s),T(e,t,s)},p(e,s){""!==e[4].answers[e[7]].comment?n?n.p(e,s):(n=hs(e),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(e){n&&n.d(e),e&&A(t)}}}function ps(e){let t,n,s,r,i,o,a,l,c,u,h,f,p=e[2][+e[4].solved]+"",d=e[6]+1+"",m=e[4].text+"",g=e[4].selected,y=[];for(let t=0;t${t[0].points}`,total:`${t[0].counter.max}`}})+"",o=t[0].questions,a=[];for(let e=0;e${e[0].points}`,total:`${e[0].counter.max}`}})+"")&&(n.innerHTML=i),5&t){let n;for(o=e[0].questions,n=0;nn(1,s=e)));let{quiz:r}=t;return e.$$set=e=>{"quiz"in e&&n(0,r=e.quiz)},[r,s,["❌","✅"],e=>r.jump(e)]}Ve([Kn],(()=>ss)),Ve([Kn],(()=>rs)),Ve([Kn],(()=>is)),Ve([Kn,Ln],(()=>os));class gs extends ye{constructor(e){super(),ge(this,e,ms,ds,a,{quiz:0},ls)}}function ys(e){let t,n,s,r,i,o,a,l,c,u,h=e[1]+1+"",f=e[3].text+"",p=null!==e[3].explanation&&""!==e[3].explanation&&vs(e);var d=e[5][e[3].type];function m(e){return{props:{quiz:e[0]}}}return d&&(l=new d(m(e))),{c(){t=N("h3"),n=L("Q"),s=L(h),r=L(": "),i=new D,o=I(),p&&p.c(),a=I(),l&&fe(l.$$.fragment),c=C(),i.a=null},m(e,h){T(e,t,h),S(t,n),S(t,s),S(t,r),i.m(f,t),T(e,o,h),p&&p.m(e,h),T(e,a,h),l&&pe(l,e,h),T(e,c,h),u=!0},p(e,t){(!u||2&t)&&h!==(h=e[1]+1+"")&&P(s,h),(!u||8&t)&&f!==(f=e[3].text+"")&&i.p(f),null!==e[3].explanation&&""!==e[3].explanation?p?p.p(e,t):(p=vs(e),p.c(),p.m(a.parentNode,a)):p&&(p.d(1),p=null);const n={};if(1&t&&(n.quiz=e[0]),d!==(d=e[5][e[3].type])){if(l){oe();const e=l;ce(e.$$.fragment,1,0,(()=>{de(e,1)})),ae()}d?(l=new d(m(e)),fe(l.$$.fragment),le(l.$$.fragment,1),pe(l,c.parentNode,c)):l=null}else d&&l.$set(n)},i(e){u||(l&&le(l.$$.fragment,e),u=!0)},o(e){l&&ce(l.$$.fragment,e),u=!1},d(e){e&&A(t),e&&A(o),p&&p.d(e),e&&A(a),e&&A(c),l&&de(l,e)}}}function bs(e){let t,n,s,r,i,o=e[4]("results_title")+"";return r=new gs({props:{quiz:e[0]}}),{c(){t=N("h3"),n=L(o),s=I(),fe(r.$$.fragment)},m(e,o){T(e,t,o),S(t,n),T(e,s,o),pe(r,e,o),i=!0},p(e,t){(!i||16&t)&&o!==(o=e[4]("results_title")+"")&&P(n,o);const s={};1&t&&(s.quiz=e[0]),r.$set(s)},i(e){i||(le(r.$$.fragment,e),i=!0)},o(e){ce(r.$$.fragment,e),i=!1},d(e){e&&A(t),e&&A(s),de(r,e)}}}function vs(e){let t,n=e[3].explanation+"";return{c(){t=N("p")},m(e,s){T(e,t,s),t.innerHTML=n},p(e,s){8&s&&n!==(n=e[3].explanation+"")&&(t.innerHTML=n)},d(e){e&&A(t)}}}function ws(e){let t,n,s,r;const i=[bs,ys],o=[];function a(e,t){return e[1]===e[2].max?0:1}return t=a(e),n=o[t]=i[t](e),{c(){n.c(),s=C()},m(e,n){o[t].m(e,n),T(e,s,n),r=!0},p(e,[r]){let l=t;t=a(e),t===l?o[t].p(e,r):(oe(),ce(o[l],1,1,(()=>{o[l]=null})),ae(),n=o[t],n?n.p(e,r):(n=o[t]=i[t](e),n.c()),le(n,1),n.m(s.parentNode,s))},i(e){r||(le(n),r=!0)},o(e){ce(n),r=!1},d(e){o[t].d(e),e&&A(s)}}}function ks(t,n,s){let r,i,o,a,c=e;u(t,as,(e=>s(4,a=e))),t.$$.on_destroy.push((()=>c()));let{quiz:h}=n,f={MultipleChoice:Be,SingleChoice:Be,Sequence:Ce};return t.$$set=e=>{"quiz"in e&&s(0,h=e.quiz)},t.$$.update=()=>{1&t.$$.dirty&&(s(2,r=h.counter),c(),c=l(r,(e=>s(1,o=e)))),3&t.$$.dirty&&s(3,i=h.questions[o])},[h,o,r,i,a,f]}class Es extends ye{constructor(e){super(),ge(this,e,ks,ws,a,{quiz:0})}}function xs(e){E(e,"svelte-1wqt442","button.svelte-1wqt442:disabled{background-color:rgb(231, 231, 231);filter:grayscale(100%);color:gray;cursor:initial}button.svelte-1wqt442{background-color:var(--quizdown-color-secondary);color:var(--quizdown-color-text);padding:0.5rem 1rem;border-radius:4px;border:1px solid transparent;line-height:1;text-align:center;transition:opacity 0.2s ease;text-decoration:none;transform:scale(1);display:inline-block;cursor:pointer;margin:0.2rem;font-size:1em}button.svelte-1wqt442:hover:not(:checked):not(:active):not(:disabled){filter:brightness(0.9)}")}function _s(e){let t,n,s,r;const i=e[3].default,a=function(e,t,n,s){if(e){const r=h(e,t,n,s);return e[0](r)}}(i,e,e[2],null),l=a||function(e){let t;return{c(){t=L("Hello World")},m(e,n){T(e,t,n)},d(e){e&&A(t)}}}();return{c(){t=N("button"),l&&l.c(),t.disabled=e[1],R(t,"class","svelte-1wqt442")},m(i,a){T(i,t,a),l&&l.m(t,null),n=!0,s||(r=M(t,"click",(function(){o(e[0])&&e[0].apply(this,arguments)})),s=!0)},p(s,[r]){e=s,a&&a.p&&(!n||4&r)&&f(a,i,e,e[2],n?r:-1,null,null),(!n||2&r)&&(t.disabled=e[1])},i(e){n||(le(l,e),n=!0)},o(e){ce(l,e),n=!1},d(e){e&&A(t),l&&l.d(e),s=!1,r()}}}function Ss(e,t,n){let{$$slots:s={},$$scope:r}=t,{buttonAction:i=(()=>alert("Life has never Svelte better"))}=t,{disabled:o=!1}=t;return e.$$set=e=>{"buttonAction"in e&&n(0,i=e.buttonAction),"disabled"in e&&n(1,o=e.disabled),"$$scope"in e&&n(2,r=e.$$scope)},[i,o,r,s]}class Ts extends ye{constructor(e){super(),ge(this,e,Ss,_s,a,{buttonAction:0,disabled:1},xs)}}function As(e){E(e,"svelte-kh8fob",".button-row.svelte-kh8fob.svelte-kh8fob{margin-top:1em;display:flex;justify-content:left}.quizdown-credits.svelte-kh8fob a.svelte-kh8fob{color:gray;text-decoration:none}.quizdown-credits.svelte-kh8fob a.svelte-kh8fob:hover{text-decoration:underline}.quizdown-credits.svelte-kh8fob.svelte-kh8fob{margin-top:1rem;font-size:small;text-align:end;color:lightgray}.quizdown-hint.svelte-kh8fob.svelte-kh8fob{font-size:smaller}")}function $s(e){let t,n,s,r,i,o;t=new Ts({props:{disabled:null===e[5].hint||""===e[5].hint||e[2],buttonAction:e[8],$$slots:{default:[Os]},$$scope:{ctx:e}}});const a=[Cs,Is,Ls],l=[];function c(e,t){return e[7]?0:e[1]===e[3].max-1?1:2}return s=c(e),r=l[s]=a[s](e),{c(){fe(t.$$.fragment),n=I(),r.c(),i=C()},m(e,r){pe(t,e,r),T(e,n,r),l[s].m(e,r),T(e,i,r),o=!0},p(e,n){const o={};36&n&&(o.disabled=null===e[5].hint||""===e[5].hint||e[2]),4&n&&(o.buttonAction=e[8]),576&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o);let u=s;s=c(e),s===u?l[s].p(e,n):(oe(),ce(l[u],1,1,(()=>{l[u]=null})),ae(),r=l[s],r?r.p(e,n):(r=l[s]=a[s](e),r.c()),le(r,1),r.m(i.parentNode,i))},i(e){o||(le(t.$$.fragment,e),le(r),o=!0)},o(e){ce(t.$$.fragment,e),ce(r),o=!1},d(e){de(t,e),e&&A(n),l[s].d(e),e&&A(i)}}}function Ns(e){let t,n;return t=new Ts({props:{buttonAction:e[0].reset,$$slots:{default:[qs]},$$scope:{ctx:e}}}),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};1&n&&(s.buttonAction=e[0].reset),576&n&&(s.$$scope={dirty:n,ctx:e}),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ce(t.$$.fragment,e),n=!1},d(e){de(t,e)}}}function Os(e){let t,n=e[6]("hint")+"";return{c(){t=L(n)},m(e,n){T(e,t,n)},p(e,s){64&s&&n!==(n=e[6]("hint")+"")&&P(t,n)},d(e){e&&A(t)}}}function Ls(e){let t,n;return t=new Ts({props:{buttonAction:e[0].next,$$slots:{default:[Ms]},$$scope:{ctx:e}}}),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};1&n&&(s.buttonAction=e[0].next),576&n&&(s.$$scope={dirty:n,ctx:e}),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ce(t.$$.fragment,e),n=!1},d(e){de(t,e)}}}function Is(e){let t,n;return t=new Ts({props:{buttonAction:e[0].evaluate,$$slots:{default:[Rs]},$$scope:{ctx:e}}}),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};1&n&&(s.buttonAction=e[0].evaluate),576&n&&(s.$$scope={dirty:n,ctx:e}),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ce(t.$$.fragment,e),n=!1},d(e){de(t,e)}}}function Cs(e){let t,n;return t=new Ts({props:{buttonAction:e[0].evaluate,$$slots:{default:[Ps]},$$scope:{ctx:e}}}),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};1&n&&(s.buttonAction=e[0].evaluate),576&n&&(s.$$scope={dirty:n,ctx:e}),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ce(t.$$.fragment,e),n=!1},d(e){de(t,e)}}}function Ms(e){let t,n=e[6]("next")+"";return{c(){t=L(n)},m(e,n){T(e,t,n)},p(e,s){64&s&&n!==(n=e[6]("next")+"")&&P(t,n)},d(e){e&&A(t)}}}function Rs(e){let t,n=e[6]("evaluate")+"";return{c(){t=L(n)},m(e,n){T(e,t,n)},p(e,s){64&s&&n!==(n=e[6]("evaluate")+"")&&P(t,n)},d(e){e&&A(t)}}}function Ps(e){let t,n=e[6]("evaluate")+"";return{c(){t=L(n)},m(e,n){T(e,t,n)},p(e,s){64&s&&n!==(n=e[6]("evaluate")+"")&&P(t,n)},d(e){e&&A(t)}}}function qs(e){let t,n=e[6]("reset")+"";return{c(){t=L(n)},m(e,n){T(e,t,n)},p(e,s){64&s&&n!==(n=e[6]("reset")+"")&&P(t,n)},d(e){e&&A(t)}}}function Ds(e){let t,n,s,r=e[5].hint+"";return{c(){t=N("p"),n=L("💡 "),s=new D,s.a=null,R(t,"class","quizdown-hint svelte-kh8fob")},m(e,i){T(e,t,i),S(t,n),s.m(r,t)},p(e,t){32&t&&r!==(r=e[5].hint+"")&&s.p(r)},d(e){e&&A(t)}}}function zs(e){let t,n,s,r,i,o,a,l;const c=[Ns,$s],u=[];function h(e,t){return e[1]===e[3].max?0:1}n=h(e),s=u[n]=c[n](e);let f=e[2]&&Ds(e);return{c(){t=N("div"),s.c(),r=I(),f&&f.c(),i=I(),o=N("div"),a=N("a"),a.textContent="quizdown-js v0.2.8",R(t,"class","button-row svelte-kh8fob"),R(a,"href","https://github.com/bonartm/quizdown-js"),R(a,"class","svelte-kh8fob"),R(o,"class","quizdown-credits svelte-kh8fob")},m(e,s){T(e,t,s),u[n].m(t,null),T(e,r,s),f&&f.m(e,s),T(e,i,s),T(e,o,s),S(o,a),l=!0},p(e,[r]){let o=n;n=h(e),n===o?u[n].p(e,r):(oe(),ce(u[o],1,1,(()=>{u[o]=null})),ae(),s=u[n],s?s.p(e,r):(s=u[n]=c[n](e),s.c()),le(s,1),s.m(t,null)),e[2]?f?f.p(e,r):(f=Ds(e),f.c(),f.m(i.parentNode,i)):f&&(f.d(1),f=null)},i(e){l||(le(s),l=!0)},o(e){ce(s),l=!1},d(e){e&&A(t),u[n].d(),e&&A(r),f&&f.d(e),e&&A(i),e&&A(o)}}}function Us(t,n,s){let r,i,o,a,c,h,f=e,p=e;u(t,as,(e=>s(6,c=e))),t.$$.on_destroy.push((()=>f())),t.$$.on_destroy.push((()=>p()));let{quiz:d}=n,m=!1;return t.$$set=e=>{"quiz"in e&&s(0,d=e.quiz)},t.$$.update=()=>{1&t.$$.dirty&&(s(3,r=d.counter),f(),f=l(r,(e=>s(1,a=e)))),1&t.$$.dirty&&(s(4,i=d.finished),p(),p=l(i,(e=>s(7,h=e)))),3&t.$$.dirty&&s(5,o=d.questions[a]),2&t.$$.dirty&&s(2,m=!1)},[d,a,m,r,i,o,c,h,()=>s(2,m=!m)]}class js extends ye{constructor(e){super(),ge(this,e,Us,zs,a,{quiz:0},As)}}function Fs(e){return"[object Date]"===Object.prototype.toString.call(e)}function Bs(e,t){if(e===t||e!=e)return()=>e;const n=typeof e;if(n!==typeof t||Array.isArray(e)!==Array.isArray(t))throw new Error("Cannot interpolate values of different type");if(Array.isArray(e)){const n=t.map(((t,n)=>Bs(e[n],t)));return e=>n.map((t=>t(e)))}if("object"===n){if(!e||!t)throw new Error("Object cannot be null");if(Fs(e)&&Fs(t)){e=e.getTime();const n=(t=t.getTime())-e;return t=>new Date(e+t*n)}const n=Object.keys(t),s={};return n.forEach((n=>{s[n]=Bs(e[n],t[n])})),e=>{const t={};return n.forEach((n=>{t[n]=s[n](e)})),t}}if("number"===n){const n=t-e;return t=>e+t*n}throw new Error(`Cannot interpolate ${n} values`)}function Gs(e){E(e,"svelte-1ma47z2",".quizdown-progress.svelte-1ma47z2.svelte-1ma47z2{height:0.4em;width:100%;position:relative}.quizdown-progress.svelte-1ma47z2 .progress-slider.svelte-1ma47z2{background-color:var(--quizdown-color-primary);height:100%;display:block}")}function Ks(t){let n,s;return{c(){n=N("div"),s=N("div"),R(s,"class","progress-slider svelte-1ma47z2"),q(s,"width",t[2]),R(n,"class","quizdown-progress svelte-1ma47z2"),R(n,"data-label","")},m(e,t){T(e,n,t),S(n,s)},p(e,[t]){4&t&&q(s,"width",e[2])},i:e,o:e,d(e){e&&A(n)}}}function Vs(s,r,i){let o,a,c,h,f,p,d=e,g=e;s.$$.on_destroy.push((()=>d())),s.$$.on_destroy.push((()=>g()));let{quiz:y}=r;const b=function(e,s={}){const r=Ke(e);let i,o=e;function a(a,l){if(null==e)return r.set(e=a),Promise.resolve();o=a;let c=i,u=!1,{delay:h=0,duration:f=400,easing:p=t,interpolate:d=Bs}=n(n({},s),l);if(0===f)return c&&(c.abort(),c=null),r.set(e=o),Promise.resolve();const g=m()+h;let y;return i=v((t=>{if(tf?(r.set(e=a),!1):(r.set(e=y(p(n/f))),!0)})),i.promise}return{set:a,update:(t,n)=>a(t(o,e),n),subscribe:r.subscribe}}(0,{duration:400,easing:be});return u(s,b,(e=>i(7,p=e))),s.$$set=e=>{"quiz"in e&&i(4,y=e.quiz)},s.$$.update=()=>{16&s.$$.dirty&&(i(0,o=y.counter),g(),g=l(o,(e=>i(6,f=e)))),16&s.$$.dirty&&(i(1,a=y.finished),d(),d=l(a,(e=>i(5,h=e)))),112&s.$$.dirty&&(h?b.set(y.counter.max-.5):b.set(f+.1)),144&s.$$.dirty&&i(2,c=String(p/(y.counter.max-.5)*100)+"%")},[o,a,c,b,y,h,f,p]}class Hs extends ye{constructor(e){super(),ge(this,e,Vs,Ks,a,{quiz:4},Gs)}}var Ys={next:"Next",previous:"Previous",evaluate:"Evaluate",reset:"One more time!",hint:"💡 Show hint",results_title:"Your quiz results",results_text:"You have answered {points} out of {total} questions correctly!"},Xs={next:"Weiter",previous:"Zurück",evaluate:"Zum Ergebnis",reset:"Noch einmal!",hint:"💡 Tipp anzeigen",results_title:"Ihr Ergebnis",results_text:"Sie haben {points} von {total} Fragen richtig beantwortet!"},Ws={next:"Suivant",previous:"Précédent",evaluate:"Réponse",reset:"Recommencer!",hint:"💡 Indice",results_title:"Vos résultats",results_text:"Vous avez répondu correctement à {points} questions sur {total}!"},Js={next:"Siguiente",previous:"Anterior",evaluate:"Respuesta",reset:"Otra vez!",hint:"💡 Pista",results_title:"Resultados",results_text:"Ha acertado a {points} preguntas de {total}!"};function Zs(e){Mn("de",Xs),Mn("en",Ys),Mn("fr",Ws),Mn("es",Js),function(e){const{formats:t}=e,n=Un(e,["formats"]),s=e.initialLocale||e.fallbackLocale;Object.assign(jn,n,{initialLocale:s}),t&&("number"in t&&Object.assign(jn.formats.number,t.number),"date"in t&&Object.assign(jn.formats.date,t.date),"time"in t&&Object.assign(jn.formats.time,t.time)),Kn.set(s)}({fallbackLocale:"en",initialLocale:null===e?"undefined"==typeof window?null:window.navigator.language||window.navigator.languages[0]:e})}function Qs(e){E(e,"svelte-18qsn2d","@import 'https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.6.0/build/styles/github.min.css';@import 'https://cdn.jsdelivr.net/npm/katex@0.13.11/dist/katex.css';img{max-height:400px;border-radius:4px;max-width:100%;height:auto}code{padding:0 0.4rem;font-size:85%;color:#333;white-space:pre-wrap;border-radius:4px;padding:0.2em 0.4em;background-color:#f8f8f8;font-family:Consolas, Monaco, monospace}a{color:var(--quizdown-color-primary)}.quizdown-content.svelte-18qsn2d{padding:1rem;max-width:900px;margin:auto}.quizdown-card.svelte-18qsn2d{box-shadow:0 4px 8px 0 rgba(0, 0, 0, 0.2);border-radius:0 0 4px 4px}.quizdown-container.svelte-18qsn2d{padding:2px 16px}")}function er(e){let t,n,s,r,i,o,a,l,c;return s=new Hs({props:{quiz:e[0]}}),o=new Es({props:{quiz:e[0]}}),l=new js({props:{quiz:e[0]}}),{c(){t=N("div"),n=N("div"),fe(s.$$.fragment),r=I(),i=N("div"),fe(o.$$.fragment),a=I(),fe(l.$$.fragment),R(i,"class","quizdown-container svelte-18qsn2d"),R(n,"class","quizdown-card svelte-18qsn2d"),R(t,"class","quizdown-content svelte-18qsn2d")},m(u,h){T(u,t,h),S(t,n),pe(s,n,null),S(n,r),S(n,i),pe(o,i,null),S(i,a),pe(l,i,null),e[2](t),c=!0},p(e,[t]){const n={};1&t&&(n.quiz=e[0]),s.$set(n);const r={};1&t&&(r.quiz=e[0]),o.$set(r);const i={};1&t&&(i.quiz=e[0]),l.$set(i)},i(e){c||(le(s.$$.fragment,e),le(o.$$.fragment,e),le(l.$$.fragment,e),c=!0)},o(e){ce(s.$$.fragment,e),ce(o.$$.fragment,e),ce(l.$$.fragment,e),c=!1},d(n){n&&A(t),de(s),de(o),de(l),e[2](null)}}}function tr(e,t,n){var s=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))((function(r,i){function o(e){try{l(s.next(e))}catch(e){i(e)}}function a(e){try{l(s.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((s=s.apply(e,t||[])).next())}))};let r,{quiz:i}=t;return Zs(i.config.locale),V((()=>s(void 0,void 0,void 0,(function*(){let e=i.config.primary_color,t=i.config.secondary_color,n=i.config.text_color;r.style.setProperty("--quizdown-color-primary",e),r.style.setProperty("--quizdown-color-secondary",t),r.style.setProperty("--quizdown-color-text",n)})))),e.$$set=e=>{"quiz"in e&&n(0,i=e.quiz)},[i,r,function(e){Y[e?"unshift":"push"]((()=>{r=e,n(1,r)}))}]}class nr extends ye{constructor(e){super(),ge(this,e,tr,er,a,{quiz:0},Qs)}} + ***************************************************************************** */function Un(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);rn.slice(0,t+1).join("-"))).reverse()}function Hn(e,t=Fn().fallbackLocale){const n=Vn(e);return t?[...new Set([...n,...Vn(t)])]:n}function Yn(){return Gn}Kn.subscribe((e=>{Gn=e,"undefined"!=typeof window&&null!==e&&document.documentElement.setAttribute("lang",e)}));const Xn=Kn.set;Kn.set=e=>{if(function(e){if(null==e)return;const t=Hn(e);for(let e=0;eBn.set(!0)),t):Bn.set(!0),zn(e).then((()=>{Xn(e)})).finally((()=>{clearTimeout(n),Bn.set(!1)}))}return Xn(e)},Kn.update=e=>Xn(e(Gn));const Wn=e=>{const t=Object.create(null);return n=>{const s=JSON.stringify(n);return s in t?t[s]:t[s]=e(n)}},Jn=(e,t)=>{const{formats:n}=Fn();if(e in n&&t in n[e])return n[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},Zn=Wn((e=>{var{locale:t,format:n}=e,s=Un(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return n&&(s=Jn("number",n)),new Intl.NumberFormat(t,s)})),Qn=Wn((e=>{var{locale:t,format:n}=e,s=Un(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return n?s=Jn("date",n):0===Object.keys(s).length&&(s=Jn("date","short")),new Intl.DateTimeFormat(t,s)})),es=Wn((e=>{var{locale:t,format:n}=e,s=Un(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return n?s=Jn("time",n):0===Object.keys(s).length&&(s=Jn("time","short")),new Intl.DateTimeFormat(t,s)})),ts=Wn(((e,t=Yn())=>new Tn(e,t,Fn().formats,{ignoreTag:Fn().ignoreTag}))),ns=(e,t={})=>{"object"==typeof e&&(e=(t=e).id);const{values:n,locale:s=Yn(),default:r}=t;if(null==s)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let i=Nn(e,s);if(i){if("string"!=typeof i)return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof i}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),i}else Fn().warnOnMissingMessages&&console.warn(`[svelte-i18n] The message "${e}" was not found in "${Hn(s).join('", "')}".${qn(Yn())?"\n\nNote: there are at least one loader still registered to this locale that wasn't executed.":""}`),i=r||e;if(!n)return i;let o=i;try{o=ts(i,s).format(n)}catch(t){console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,t.message)}return o},ss=(e,t)=>((e={})=>{var{locale:t=Yn()}=e,n=Un(e,["locale"]);return es(Object.assign({locale:t},n))})(t).format(e),rs=(e,t)=>((e={})=>{var{locale:t=Yn()}=e,n=Un(e,["locale"]);return Qn(Object.assign({locale:t},n))})(t).format(e),is=(e,t)=>((e={})=>{var{locale:t=Yn()}=e,n=Un(e,["locale"]);return Zn(Object.assign({locale:t},n))})(t).format(e),os=(e,t=Yn())=>Nn(e,t),as=Ve([Kn,Ln],(()=>ns));function ls(e){E(e,"svelte-xeqbwq",".top-list-item.svelte-xeqbwq.svelte-xeqbwq{margin-bottom:0.2rem;list-style-type:none}.top-list-item.svelte-xeqbwq.svelte-xeqbwq:hover{cursor:pointer;background-color:var(--quizdown-color-secondary)}.top-list-item.svelte-xeqbwq:hover .list-question.svelte-xeqbwq{text-decoration:underline}.list-comment.svelte-xeqbwq.svelte-xeqbwq{margin-left:2em;list-style-type:initial}")}function cs(e,t,n){const s=e.slice();return s[4]=t[n],s[6]=n,s}function us(e,t,n){const s=e.slice();return s[7]=t[n],s}function hs(e){let t,n,s,r,i,o=e[4].answers[e[7]].html+"",a=e[4].answers[e[7]].comment+"";return{c(){t=N("li"),n=N("i"),s=L(":\n "),r=new D,i=I(),r.a=i,R(t,"class","list-comment svelte-xeqbwq")},m(e,l){T(e,t,l),S(t,n),n.innerHTML=o,S(t,s),r.m(a,t),S(t,i)},p(e,t){1&t&&o!==(o=e[4].answers[e[7]].html+"")&&(n.innerHTML=o),1&t&&a!==(a=e[4].answers[e[7]].comment+"")&&r.p(a)},d(e){e&&A(t)}}}function fs(e){let t,n=""!==e[4].answers[e[7]].comment&&hs(e);return{c(){n&&n.c(),t=C()},m(e,s){n&&n.m(e,s),T(e,t,s)},p(e,s){""!==e[4].answers[e[7]].comment?n?n.p(e,s):(n=hs(e),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(e){n&&n.d(e),e&&A(t)}}}function ps(e){let t,n,s,r,i,o,a,l,c,u,h,f,p=e[2][+e[4].solved]+"",d=e[6]+1+"",m=e[4].text+"",g=e[4].selected,y=[];for(let t=0;t${t[0].points}`,total:`${t[0].counter.max}`}})+"",o=t[0].questions,a=[];for(let e=0;e${e[0].points}`,total:`${e[0].counter.max}`}})+"")&&(n.innerHTML=i),5&t){let n;for(o=e[0].questions,n=0;nn(1,s=e)));let{quiz:r}=t;return e.$$set=e=>{"quiz"in e&&n(0,r=e.quiz)},[r,s,["❌","✅"],e=>r.jump(e)]}Ve([Kn],(()=>ss)),Ve([Kn],(()=>rs)),Ve([Kn],(()=>is)),Ve([Kn,Ln],(()=>os));class gs extends ye{constructor(e){super(),ge(this,e,ms,ds,a,{quiz:0},ls)}}function ys(e){let t,n,s,r,i,o,a,l,c,u,h=e[1]+1+"",f=e[3].text+"",p=null!==e[3].explanation&&""!==e[3].explanation&&vs(e);var d=e[5][e[3].type];function m(e){return{props:{quiz:e[0]}}}return d&&(l=new d(m(e))),{c(){t=N("h3"),n=L("Q"),s=L(h),r=L(": "),i=new D,o=I(),p&&p.c(),a=I(),l&&fe(l.$$.fragment),c=C(),i.a=null},m(e,h){T(e,t,h),S(t,n),S(t,s),S(t,r),i.m(f,t),T(e,o,h),p&&p.m(e,h),T(e,a,h),l&&pe(l,e,h),T(e,c,h),u=!0},p(e,t){(!u||2&t)&&h!==(h=e[1]+1+"")&&P(s,h),(!u||8&t)&&f!==(f=e[3].text+"")&&i.p(f),null!==e[3].explanation&&""!==e[3].explanation?p?p.p(e,t):(p=vs(e),p.c(),p.m(a.parentNode,a)):p&&(p.d(1),p=null);const n={};if(1&t&&(n.quiz=e[0]),d!==(d=e[5][e[3].type])){if(l){oe();const e=l;ce(e.$$.fragment,1,0,(()=>{de(e,1)})),ae()}d?(l=new d(m(e)),fe(l.$$.fragment),le(l.$$.fragment,1),pe(l,c.parentNode,c)):l=null}else d&&l.$set(n)},i(e){u||(l&&le(l.$$.fragment,e),u=!0)},o(e){l&&ce(l.$$.fragment,e),u=!1},d(e){e&&A(t),e&&A(o),p&&p.d(e),e&&A(a),e&&A(c),l&&de(l,e)}}}function bs(e){let t,n,s,r,i,o=e[4]("results_title")+"";return r=new gs({props:{quiz:e[0]}}),{c(){t=N("h3"),n=L(o),s=I(),fe(r.$$.fragment)},m(e,o){T(e,t,o),S(t,n),T(e,s,o),pe(r,e,o),i=!0},p(e,t){(!i||16&t)&&o!==(o=e[4]("results_title")+"")&&P(n,o);const s={};1&t&&(s.quiz=e[0]),r.$set(s)},i(e){i||(le(r.$$.fragment,e),i=!0)},o(e){ce(r.$$.fragment,e),i=!1},d(e){e&&A(t),e&&A(s),de(r,e)}}}function vs(e){let t,n=e[3].explanation+"";return{c(){t=N("p")},m(e,s){T(e,t,s),t.innerHTML=n},p(e,s){8&s&&n!==(n=e[3].explanation+"")&&(t.innerHTML=n)},d(e){e&&A(t)}}}function ws(e){let t,n,s,r;const i=[bs,ys],o=[];function a(e,t){return e[1]===e[2].max?0:1}return t=a(e),n=o[t]=i[t](e),{c(){n.c(),s=C()},m(e,n){o[t].m(e,n),T(e,s,n),r=!0},p(e,[r]){let l=t;t=a(e),t===l?o[t].p(e,r):(oe(),ce(o[l],1,1,(()=>{o[l]=null})),ae(),n=o[t],n?n.p(e,r):(n=o[t]=i[t](e),n.c()),le(n,1),n.m(s.parentNode,s))},i(e){r||(le(n),r=!0)},o(e){ce(n),r=!1},d(e){o[t].d(e),e&&A(s)}}}function ks(t,n,s){let r,i,o,a,c=e;u(t,as,(e=>s(4,a=e))),t.$$.on_destroy.push((()=>c()));let{quiz:h}=n,f={MultipleChoice:Be,SingleChoice:Be,Sequence:Ce};return t.$$set=e=>{"quiz"in e&&s(0,h=e.quiz)},t.$$.update=()=>{1&t.$$.dirty&&(s(2,r=h.counter),c(),c=l(r,(e=>s(1,o=e)))),3&t.$$.dirty&&s(3,i=h.questions[o])},[h,o,r,i,a,f]}class Es extends ye{constructor(e){super(),ge(this,e,ks,ws,a,{quiz:0})}}function xs(e){E(e,"svelte-1wqt442","button.svelte-1wqt442:disabled{background-color:rgb(231, 231, 231);filter:grayscale(100%);color:gray;cursor:initial}button.svelte-1wqt442{background-color:var(--quizdown-color-secondary);color:var(--quizdown-color-text);padding:0.5rem 1rem;border-radius:4px;border:1px solid transparent;line-height:1;text-align:center;transition:opacity 0.2s ease;text-decoration:none;transform:scale(1);display:inline-block;cursor:pointer;margin:0.2rem;font-size:1em}button.svelte-1wqt442:hover:not(:checked):not(:active):not(:disabled){filter:brightness(0.9)}")}function _s(e){let t,n,s,r;const i=e[3].default,a=function(e,t,n,s){if(e){const r=h(e,t,n,s);return e[0](r)}}(i,e,e[2],null),l=a||function(e){let t;return{c(){t=L("Hello World")},m(e,n){T(e,t,n)},d(e){e&&A(t)}}}();return{c(){t=N("button"),l&&l.c(),t.disabled=e[1],R(t,"class","svelte-1wqt442")},m(i,a){T(i,t,a),l&&l.m(t,null),n=!0,s||(r=M(t,"click",(function(){o(e[0])&&e[0].apply(this,arguments)})),s=!0)},p(s,[r]){e=s,a&&a.p&&(!n||4&r)&&f(a,i,e,e[2],n?r:-1,null,null),(!n||2&r)&&(t.disabled=e[1])},i(e){n||(le(l,e),n=!0)},o(e){ce(l,e),n=!1},d(e){e&&A(t),l&&l.d(e),s=!1,r()}}}function Ss(e,t,n){let{$$slots:s={},$$scope:r}=t,{buttonAction:i=(()=>alert("Life has never Svelte better"))}=t,{disabled:o=!1}=t;return e.$$set=e=>{"buttonAction"in e&&n(0,i=e.buttonAction),"disabled"in e&&n(1,o=e.disabled),"$$scope"in e&&n(2,r=e.$$scope)},[i,o,r,s]}class Ts extends ye{constructor(e){super(),ge(this,e,Ss,_s,a,{buttonAction:0,disabled:1},xs)}}function As(e){E(e,"svelte-kh8fob",".button-row.svelte-kh8fob.svelte-kh8fob{margin-top:1em;display:flex;justify-content:left}.quizdown-credits.svelte-kh8fob a.svelte-kh8fob{color:gray;text-decoration:none}.quizdown-credits.svelte-kh8fob a.svelte-kh8fob:hover{text-decoration:underline}.quizdown-credits.svelte-kh8fob.svelte-kh8fob{margin-top:1rem;font-size:small;text-align:end;color:lightgray}.quizdown-hint.svelte-kh8fob.svelte-kh8fob{font-size:smaller}")}function $s(e){let t,n,s,r,i,o;t=new Ts({props:{disabled:null===e[5].hint||""===e[5].hint||e[2],buttonAction:e[8],$$slots:{default:[Os]},$$scope:{ctx:e}}});const a=[Cs,Is,Ls],l=[];function c(e,t){return e[7]?0:e[1]===e[3].max-1?1:2}return s=c(e),r=l[s]=a[s](e),{c(){fe(t.$$.fragment),n=I(),r.c(),i=C()},m(e,r){pe(t,e,r),T(e,n,r),l[s].m(e,r),T(e,i,r),o=!0},p(e,n){const o={};36&n&&(o.disabled=null===e[5].hint||""===e[5].hint||e[2]),4&n&&(o.buttonAction=e[8]),576&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o);let u=s;s=c(e),s===u?l[s].p(e,n):(oe(),ce(l[u],1,1,(()=>{l[u]=null})),ae(),r=l[s],r?r.p(e,n):(r=l[s]=a[s](e),r.c()),le(r,1),r.m(i.parentNode,i))},i(e){o||(le(t.$$.fragment,e),le(r),o=!0)},o(e){ce(t.$$.fragment,e),ce(r),o=!1},d(e){de(t,e),e&&A(n),l[s].d(e),e&&A(i)}}}function Ns(e){let t,n;return t=new Ts({props:{buttonAction:e[0].reset,$$slots:{default:[qs]},$$scope:{ctx:e}}}),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};1&n&&(s.buttonAction=e[0].reset),576&n&&(s.$$scope={dirty:n,ctx:e}),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ce(t.$$.fragment,e),n=!1},d(e){de(t,e)}}}function Os(e){let t,n=e[6]("hint")+"";return{c(){t=L(n)},m(e,n){T(e,t,n)},p(e,s){64&s&&n!==(n=e[6]("hint")+"")&&P(t,n)},d(e){e&&A(t)}}}function Ls(e){let t,n;return t=new Ts({props:{buttonAction:e[0].next,$$slots:{default:[Ms]},$$scope:{ctx:e}}}),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};1&n&&(s.buttonAction=e[0].next),576&n&&(s.$$scope={dirty:n,ctx:e}),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ce(t.$$.fragment,e),n=!1},d(e){de(t,e)}}}function Is(e){let t,n;return t=new Ts({props:{buttonAction:e[0].evaluate,$$slots:{default:[Rs]},$$scope:{ctx:e}}}),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};1&n&&(s.buttonAction=e[0].evaluate),576&n&&(s.$$scope={dirty:n,ctx:e}),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ce(t.$$.fragment,e),n=!1},d(e){de(t,e)}}}function Cs(e){let t,n;return t=new Ts({props:{buttonAction:e[0].evaluate,$$slots:{default:[Ps]},$$scope:{ctx:e}}}),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};1&n&&(s.buttonAction=e[0].evaluate),576&n&&(s.$$scope={dirty:n,ctx:e}),t.$set(s)},i(e){n||(le(t.$$.fragment,e),n=!0)},o(e){ce(t.$$.fragment,e),n=!1},d(e){de(t,e)}}}function Ms(e){let t,n=e[6]("next")+"";return{c(){t=L(n)},m(e,n){T(e,t,n)},p(e,s){64&s&&n!==(n=e[6]("next")+"")&&P(t,n)},d(e){e&&A(t)}}}function Rs(e){let t,n=e[6]("evaluate")+"";return{c(){t=L(n)},m(e,n){T(e,t,n)},p(e,s){64&s&&n!==(n=e[6]("evaluate")+"")&&P(t,n)},d(e){e&&A(t)}}}function Ps(e){let t,n=e[6]("evaluate")+"";return{c(){t=L(n)},m(e,n){T(e,t,n)},p(e,s){64&s&&n!==(n=e[6]("evaluate")+"")&&P(t,n)},d(e){e&&A(t)}}}function qs(e){let t,n=e[6]("reset")+"";return{c(){t=L(n)},m(e,n){T(e,t,n)},p(e,s){64&s&&n!==(n=e[6]("reset")+"")&&P(t,n)},d(e){e&&A(t)}}}function Ds(e){let t,n,s,r=e[5].hint+"";return{c(){t=N("p"),n=L("💡 "),s=new D,s.a=null,R(t,"class","quizdown-hint svelte-kh8fob")},m(e,i){T(e,t,i),S(t,n),s.m(r,t)},p(e,t){32&t&&r!==(r=e[5].hint+"")&&s.p(r)},d(e){e&&A(t)}}}function zs(e){let t,n,s,r,i,o,a,l;const c=[Ns,$s],u=[];function h(e,t){return e[1]===e[3].max?0:1}n=h(e),s=u[n]=c[n](e);let f=e[2]&&Ds(e);return{c(){t=N("div"),s.c(),r=I(),f&&f.c(),i=I(),o=N("div"),a=N("a"),a.textContent="quizdown-js v0.3.0",R(t,"class","button-row svelte-kh8fob"),R(a,"href","https://github.com/bonartm/quizdown-js"),R(a,"class","svelte-kh8fob"),R(o,"class","quizdown-credits svelte-kh8fob")},m(e,s){T(e,t,s),u[n].m(t,null),T(e,r,s),f&&f.m(e,s),T(e,i,s),T(e,o,s),S(o,a),l=!0},p(e,[r]){let o=n;n=h(e),n===o?u[n].p(e,r):(oe(),ce(u[o],1,1,(()=>{u[o]=null})),ae(),s=u[n],s?s.p(e,r):(s=u[n]=c[n](e),s.c()),le(s,1),s.m(t,null)),e[2]?f?f.p(e,r):(f=Ds(e),f.c(),f.m(i.parentNode,i)):f&&(f.d(1),f=null)},i(e){l||(le(s),l=!0)},o(e){ce(s),l=!1},d(e){e&&A(t),u[n].d(),e&&A(r),f&&f.d(e),e&&A(i),e&&A(o)}}}function Us(t,n,s){let r,i,o,a,c,h,f=e,p=e;u(t,as,(e=>s(6,c=e))),t.$$.on_destroy.push((()=>f())),t.$$.on_destroy.push((()=>p()));let{quiz:d}=n,m=!1;return t.$$set=e=>{"quiz"in e&&s(0,d=e.quiz)},t.$$.update=()=>{1&t.$$.dirty&&(s(3,r=d.counter),f(),f=l(r,(e=>s(1,a=e)))),1&t.$$.dirty&&(s(4,i=d.finished),p(),p=l(i,(e=>s(7,h=e)))),3&t.$$.dirty&&s(5,o=d.questions[a]),2&t.$$.dirty&&s(2,m=!1)},[d,a,m,r,i,o,c,h,()=>s(2,m=!m)]}class js extends ye{constructor(e){super(),ge(this,e,Us,zs,a,{quiz:0},As)}}function Fs(e){return"[object Date]"===Object.prototype.toString.call(e)}function Bs(e,t){if(e===t||e!=e)return()=>e;const n=typeof e;if(n!==typeof t||Array.isArray(e)!==Array.isArray(t))throw new Error("Cannot interpolate values of different type");if(Array.isArray(e)){const n=t.map(((t,n)=>Bs(e[n],t)));return e=>n.map((t=>t(e)))}if("object"===n){if(!e||!t)throw new Error("Object cannot be null");if(Fs(e)&&Fs(t)){e=e.getTime();const n=(t=t.getTime())-e;return t=>new Date(e+t*n)}const n=Object.keys(t),s={};return n.forEach((n=>{s[n]=Bs(e[n],t[n])})),e=>{const t={};return n.forEach((n=>{t[n]=s[n](e)})),t}}if("number"===n){const n=t-e;return t=>e+t*n}throw new Error(`Cannot interpolate ${n} values`)}function Gs(e){E(e,"svelte-1ma47z2",".quizdown-progress.svelte-1ma47z2.svelte-1ma47z2{height:0.4em;width:100%;position:relative}.quizdown-progress.svelte-1ma47z2 .progress-slider.svelte-1ma47z2{background-color:var(--quizdown-color-primary);height:100%;display:block}")}function Ks(t){let n,s;return{c(){n=N("div"),s=N("div"),R(s,"class","progress-slider svelte-1ma47z2"),q(s,"width",t[2]),R(n,"class","quizdown-progress svelte-1ma47z2"),R(n,"data-label","")},m(e,t){T(e,n,t),S(n,s)},p(e,[t]){4&t&&q(s,"width",e[2])},i:e,o:e,d(e){e&&A(n)}}}function Vs(s,r,i){let o,a,c,h,f,p,d=e,g=e;s.$$.on_destroy.push((()=>d())),s.$$.on_destroy.push((()=>g()));let{quiz:y}=r;const b=function(e,s={}){const r=Ke(e);let i,o=e;function a(a,l){if(null==e)return r.set(e=a),Promise.resolve();o=a;let c=i,u=!1,{delay:h=0,duration:f=400,easing:p=t,interpolate:d=Bs}=n(n({},s),l);if(0===f)return c&&(c.abort(),c=null),r.set(e=o),Promise.resolve();const g=m()+h;let y;return i=v((t=>{if(tf?(r.set(e=a),!1):(r.set(e=y(p(n/f))),!0)})),i.promise}return{set:a,update:(t,n)=>a(t(o,e),n),subscribe:r.subscribe}}(0,{duration:400,easing:be});return u(s,b,(e=>i(7,p=e))),s.$$set=e=>{"quiz"in e&&i(4,y=e.quiz)},s.$$.update=()=>{16&s.$$.dirty&&(i(0,o=y.counter),g(),g=l(o,(e=>i(6,f=e)))),16&s.$$.dirty&&(i(1,a=y.finished),d(),d=l(a,(e=>i(5,h=e)))),112&s.$$.dirty&&(h?b.set(y.counter.max-.5):b.set(f+.1)),144&s.$$.dirty&&i(2,c=String(p/(y.counter.max-.5)*100)+"%")},[o,a,c,b,y,h,f,p]}class Hs extends ye{constructor(e){super(),ge(this,e,Vs,Ks,a,{quiz:4},Gs)}}var Ys={next:"Next",previous:"Previous",evaluate:"Evaluate",reset:"One more time!",hint:"💡 Show hint",results_title:"Your quiz results",results_text:"You have answered {points} out of {total} questions correctly!"},Xs={next:"Weiter",previous:"Zurück",evaluate:"Zum Ergebnis",reset:"Noch einmal!",hint:"💡 Tipp anzeigen",results_title:"Ihr Ergebnis",results_text:"Sie haben {points} von {total} Fragen richtig beantwortet!"},Ws={next:"Suivant",previous:"Précédent",evaluate:"Réponse",reset:"Recommencer!",hint:"💡 Indice",results_title:"Vos résultats",results_text:"Vous avez répondu correctement à {points} questions sur {total}!"},Js={next:"Siguiente",previous:"Anterior",evaluate:"Respuesta",reset:"Otra vez!",hint:"💡 Pista",results_title:"Resultados",results_text:"Ha acertado a {points} preguntas de {total}!"};function Zs(e){Mn("de",Xs),Mn("en",Ys),Mn("fr",Ws),Mn("es",Js),function(e){const{formats:t}=e,n=Un(e,["formats"]),s=e.initialLocale||e.fallbackLocale;Object.assign(jn,n,{initialLocale:s}),t&&("number"in t&&Object.assign(jn.formats.number,t.number),"date"in t&&Object.assign(jn.formats.date,t.date),"time"in t&&Object.assign(jn.formats.time,t.time)),Kn.set(s)}({fallbackLocale:"en",initialLocale:null===e?"undefined"==typeof window?null:window.navigator.language||window.navigator.languages[0]:e})}function Qs(e){E(e,"svelte-18qsn2d","@import 'https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.6.0/build/styles/github.min.css';@import 'https://cdn.jsdelivr.net/npm/katex@0.13.11/dist/katex.css';img{max-height:400px;border-radius:4px;max-width:100%;height:auto}code{padding:0 0.4rem;font-size:85%;color:#333;white-space:pre-wrap;border-radius:4px;padding:0.2em 0.4em;background-color:#f8f8f8;font-family:Consolas, Monaco, monospace}a{color:var(--quizdown-color-primary)}.quizdown-content.svelte-18qsn2d{padding:1rem;max-width:900px;margin:auto}.quizdown-card.svelte-18qsn2d{box-shadow:0 4px 8px 0 rgba(0, 0, 0, 0.2);border-radius:0 0 4px 4px}.quizdown-container.svelte-18qsn2d{padding:2px 16px}")}function er(e){let t,n,s,r,i,o,a,l,c;return s=new Hs({props:{quiz:e[0]}}),o=new Es({props:{quiz:e[0]}}),l=new js({props:{quiz:e[0]}}),{c(){t=N("div"),n=N("div"),fe(s.$$.fragment),r=I(),i=N("div"),fe(o.$$.fragment),a=I(),fe(l.$$.fragment),R(i,"class","quizdown-container svelte-18qsn2d"),R(n,"class","quizdown-card svelte-18qsn2d"),R(t,"class","quizdown-content svelte-18qsn2d")},m(u,h){T(u,t,h),S(t,n),pe(s,n,null),S(n,r),S(n,i),pe(o,i,null),S(i,a),pe(l,i,null),e[2](t),c=!0},p(e,[t]){const n={};1&t&&(n.quiz=e[0]),s.$set(n);const r={};1&t&&(r.quiz=e[0]),o.$set(r);const i={};1&t&&(i.quiz=e[0]),l.$set(i)},i(e){c||(le(s.$$.fragment,e),le(o.$$.fragment,e),le(l.$$.fragment,e),c=!0)},o(e){ce(s.$$.fragment,e),ce(o.$$.fragment,e),ce(l.$$.fragment,e),c=!1},d(n){n&&A(t),de(s),de(o),de(l),e[2](null)}}}function tr(e,t,n){var s=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))((function(r,i){function o(e){try{l(s.next(e))}catch(e){i(e)}}function a(e){try{l(s.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((s=s.apply(e,t||[])).next())}))};let r,{quiz:i}=t;return Zs(i.config.locale),V((()=>s(void 0,void 0,void 0,(function*(){let e=i.config.primary_color,t=i.config.secondary_color,n=i.config.text_color;r.style.setProperty("--quizdown-color-primary",e),r.style.setProperty("--quizdown-color-secondary",t),r.style.setProperty("--quizdown-color-text",n)})))),e.$$set=e=>{"quiz"in e&&n(0,i=e.quiz)},[i,r,function(e){Y[e?"unshift":"push"]((()=>{r=e,n(1,r)}))}]}class nr extends ye{constructor(e){super(),ge(this,e,tr,er,a,{quiz:0},Qs)}} /*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.2.2/LICENSE */var sr=Object.hasOwnProperty,rr=Object.setPrototypeOf,ir=Object.isFrozen,or=Object.getPrototypeOf,ar=Object.getOwnPropertyDescriptor,lr=Object.freeze,cr=Object.seal,ur=Object.create,hr="undefined"!=typeof Reflect&&Reflect,fr=hr.apply,pr=hr.construct;fr||(fr=function(e,t,n){return e.apply(t,n)}),lr||(lr=function(e){return e}),cr||(cr=function(e){return e}),pr||(pr=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1?n-1:0),r=1;r/gm),Fr=cr(/^data-[\-\w.\u00B7-\uFFFF]/),Br=cr(/^aria-[\-\w]+$/),Gr=cr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Kr=cr(/^(?:\w+script|data):/i),Vr=cr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function Yr(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:Xr(),n=function(t){return e(t)};if(n.version="2.2.8",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var s=t.document,r=t.document,i=t.DocumentFragment,o=t.HTMLTemplateElement,a=t.Node,l=t.Element,c=t.NodeFilter,u=t.NamedNodeMap,h=void 0===u?t.NamedNodeMap||t.MozNamedAttrMap:u,f=t.Text,p=t.Comment,d=t.DOMParser,m=t.trustedTypes,g=l.prototype,y=$r(g,"cloneNode"),b=$r(g,"nextSibling"),v=$r(g,"childNodes"),w=$r(g,"parentNode");if("function"==typeof o){var k=r.createElement("template");k.content&&k.content.ownerDocument&&(r=k.content.ownerDocument)}var E=Wr(m,s),x=E&&ee?E.createHTML(""):"",_=r,S=_.implementation,T=_.createNodeIterator,A=_.createDocumentFragment,$=s.importNode,N={};try{N=Ar(r).documentMode?r.documentMode:{}}catch(e){}var O={};n.isSupported="function"==typeof w&&S&&void 0!==S.createHTMLDocument&&9!==N;var L=Ur,I=jr,C=Fr,M=Br,R=Kr,P=Vr,q=Gr,D=null,z=Tr({},[].concat(Yr(Nr),Yr(Or),Yr(Lr),Yr(Cr),Yr(Rr))),U=null,j=Tr({},[].concat(Yr(Pr),Yr(qr),Yr(Dr),Yr(zr))),F=null,B=null,G=!0,K=!0,V=!1,H=!1,Y=!1,X=!1,W=!1,J=!1,Z=!1,Q=!0,ee=!1,te=!0,ne=!0,se=!1,re={},ie=Tr({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),oe=null,ae=Tr({},["audio","video","img","source","image","track"]),le=null,ce=Tr({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),ue="http://www.w3.org/1998/Math/MathML",he="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml",pe=fe,de=null,me=r.createElement("form"),ge=function(e){de&&de===e||(e&&"object"===(void 0===e?"undefined":Hr(e))||(e={}),e=Ar(e),D="ALLOWED_TAGS"in e?Tr({},e.ALLOWED_TAGS):z,U="ALLOWED_ATTR"in e?Tr({},e.ALLOWED_ATTR):j,le="ADD_URI_SAFE_ATTR"in e?Tr(Ar(ce),e.ADD_URI_SAFE_ATTR):ce,oe="ADD_DATA_URI_TAGS"in e?Tr(Ar(ae),e.ADD_DATA_URI_TAGS):ae,F="FORBID_TAGS"in e?Tr({},e.FORBID_TAGS):{},B="FORBID_ATTR"in e?Tr({},e.FORBID_ATTR):{},re="USE_PROFILES"in e&&e.USE_PROFILES,G=!1!==e.ALLOW_ARIA_ATTR,K=!1!==e.ALLOW_DATA_ATTR,V=e.ALLOW_UNKNOWN_PROTOCOLS||!1,H=e.SAFE_FOR_TEMPLATES||!1,Y=e.WHOLE_DOCUMENT||!1,J=e.RETURN_DOM||!1,Z=e.RETURN_DOM_FRAGMENT||!1,Q=!1!==e.RETURN_DOM_IMPORT,ee=e.RETURN_TRUSTED_TYPE||!1,W=e.FORCE_BODY||!1,te=!1!==e.SANITIZE_DOM,ne=!1!==e.KEEP_CONTENT,se=e.IN_PLACE||!1,q=e.ALLOWED_URI_REGEXP||q,pe=e.NAMESPACE||pe,H&&(K=!1),Z&&(J=!0),re&&(D=Tr({},[].concat(Yr(Rr))),U=[],!0===re.html&&(Tr(D,Nr),Tr(U,Pr)),!0===re.svg&&(Tr(D,Or),Tr(U,qr),Tr(U,zr)),!0===re.svgFilters&&(Tr(D,Lr),Tr(U,qr),Tr(U,zr)),!0===re.mathMl&&(Tr(D,Cr),Tr(U,Dr),Tr(U,zr))),e.ADD_TAGS&&(D===z&&(D=Ar(D)),Tr(D,e.ADD_TAGS)),e.ADD_ATTR&&(U===j&&(U=Ar(U)),Tr(U,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&Tr(le,e.ADD_URI_SAFE_ATTR),ne&&(D["#text"]=!0),Y&&Tr(D,["html","head","body"]),D.table&&(Tr(D,["tbody"]),delete F.tbody),lr&&lr(e),de=e)},ye=Tr({},["mi","mo","mn","ms","mtext"]),be=Tr({},["foreignobject","desc","title","annotation-xml"]),ve=Tr({},Or);Tr(ve,Lr),Tr(ve,Ir);var we=Tr({},Cr);Tr(we,Mr);var ke=function(e){var t=w(e);t&&t.tagName||(t={namespaceURI:fe,tagName:"template"});var n=br(e.tagName),s=br(t.tagName);if(e.namespaceURI===he)return t.namespaceURI===fe?"svg"===n:t.namespaceURI===ue?"svg"===n&&("annotation-xml"===s||ye[s]):Boolean(ve[n]);if(e.namespaceURI===ue)return t.namespaceURI===fe?"math"===n:t.namespaceURI===he?"math"===n&&be[s]:Boolean(we[n]);if(e.namespaceURI===fe){if(t.namespaceURI===he&&!be[s])return!1;if(t.namespaceURI===ue&&!ye[s])return!1;var r=Tr({},["title","style","font","a","script"]);return!we[n]&&(r[n]||!ve[n])}return!1},Ee=function(e){yr(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=x}catch(t){e.remove()}}},xe=function(e,t){try{yr(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){yr(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!U[e])if(J||Z)try{Ee(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},_e=function(e){var t=void 0,n=void 0;if(W)e=""+e;else{var s=vr(e,/^[\r\n\t ]+/);n=s&&s[0]}var i=E?E.createHTML(e):e;if(pe===fe)try{t=(new d).parseFromString(i,"text/html")}catch(e){}t&&t.documentElement||((t=S.createDocument(pe,"template",null)).documentElement.innerHTML=i);var o=t.body||t.documentElement;return e&&n&&o.insertBefore(r.createTextNode(n),o.childNodes[0]||null),Y?t.documentElement:o},Se=function(e){return T.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,(function(){return c.FILTER_ACCEPT}),!1)},Te=function(e){return!(e instanceof f||e instanceof p)&&!("string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof h&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI&&"function"==typeof e.insertBefore)},Ae=function(e){return"object"===(void 0===a?"undefined":Hr(a))?e instanceof a:e&&"object"===(void 0===e?"undefined":Hr(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},$e=function(e,t,s){O[e]&&mr(O[e],(function(e){e.call(n,t,s,de)}))},Ne=function(e){var t=void 0;if($e("beforeSanitizeElements",e,null),Te(e))return Ee(e),!0;if(vr(e.nodeName,/[\u0080-\uFFFF]/))return Ee(e),!0;var s=br(e.nodeName);if($e("uponSanitizeElement",e,{tagName:s,allowedTags:D}),!Ae(e.firstElementChild)&&(!Ae(e.content)||!Ae(e.content.firstElementChild))&&xr(/<[/\w]/g,e.innerHTML)&&xr(/<[/\w]/g,e.textContent))return Ee(e),!0;if(!D[s]||F[s]){if(ne&&!ie[s]){var r=w(e)||e.parentNode,i=v(e)||e.childNodes;if(i&&r)for(var o=i.length-1;o>=0;--o)r.insertBefore(y(i[o],!0),b(e))}return Ee(e),!0}return e instanceof l&&!ke(e)?(Ee(e),!0):"noscript"!==s&&"noembed"!==s||!xr(/<\/no(script|embed)/i,e.innerHTML)?(H&&3===e.nodeType&&(t=e.textContent,t=wr(t,L," "),t=wr(t,I," "),e.textContent!==t&&(yr(n.removed,{element:e.cloneNode()}),e.textContent=t)),$e("afterSanitizeElements",e,null),!1):(Ee(e),!0)},Oe=function(e,t,n){if(te&&("id"===t||"name"===t)&&(n in r||n in me))return!1;if(K&&xr(C,t));else if(G&&xr(M,t));else{if(!U[t]||B[t])return!1;if(le[t]);else if(xr(q,wr(n,P,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==kr(n,"data:")||!oe[e]){if(V&&!xr(R,wr(n,P,"")));else if(n)return!1}else;}return!0},Le=function(e){var t=void 0,s=void 0,r=void 0,i=void 0;$e("beforeSanitizeAttributes",e,null);var o=e.attributes;if(o){var a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:U};for(i=o.length;i--;){var l=t=o[i],c=l.name,u=l.namespaceURI;if(s=Er(t.value),r=br(c),a.attrName=r,a.attrValue=s,a.keepAttr=!0,a.forceKeepAttr=void 0,$e("uponSanitizeAttribute",e,a),s=a.attrValue,!a.forceKeepAttr&&(xe(c,e),a.keepAttr))if(xr(/\/>/i,s))xe(c,e);else{H&&(s=wr(s,L," "),s=wr(s,I," "));var h=e.nodeName.toLowerCase();if(Oe(h,r,s))try{u?e.setAttributeNS(u,c,s):e.setAttribute(c,s),gr(n.removed)}catch(e){}}}$e("afterSanitizeAttributes",e,null)}},Ie=function e(t){var n=void 0,s=Se(t);for($e("beforeSanitizeShadowDOM",t,null);n=s.nextNode();)$e("uponSanitizeShadowNode",n,null),Ne(n)||(n.content instanceof i&&e(n.content),Le(n));$e("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e,r){var o=void 0,l=void 0,c=void 0,u=void 0,h=void 0;if(e||(e="\x3c!--\x3e"),"string"!=typeof e&&!Ae(e)){if("function"!=typeof e.toString)throw _r("toString is not a function");if("string"!=typeof(e=e.toString()))throw _r("dirty is not a string, aborting")}if(!n.isSupported){if("object"===Hr(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(Ae(e))return t.toStaticHTML(e.outerHTML)}return e}if(X||ge(r),n.removed=[],"string"==typeof e&&(se=!1),se);else if(e instanceof a)1===(l=(o=_e("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?o=l:o.appendChild(l);else{if(!J&&!H&&!Y&&-1===e.indexOf("<"))return E&&ee?E.createHTML(e):e;if(!(o=_e(e)))return J?null:x}o&&W&&Ee(o.firstChild);for(var f=Se(se?e:o);c=f.nextNode();)3===c.nodeType&&c===u||Ne(c)||(c.content instanceof i&&Ie(c.content),Le(c),u=c);if(u=null,se)return e;if(J){if(Z)for(h=A.call(o.ownerDocument);o.firstChild;)h.appendChild(o.firstChild);else h=o;return Q&&(h=$.call(s,h,!0)),h}var p=Y?o.outerHTML:o.innerHTML;return H&&(p=wr(p,L," "),p=wr(p,I," ")),E&&ee?E.createHTML(p):p},n.setConfig=function(e){ge(e),X=!0},n.clearConfig=function(){de=null,X=!1},n.isValidAttribute=function(e,t,n){de||ge({});var s=br(e),r=br(t);return Oe(s,r,n)},n.addHook=function(e,t){"function"==typeof t&&(O[e]=O[e]||[],yr(O[e],t))},n.removeHook=function(e){O[e]&&gr(O[e])},n.removeHooks=function(e){O[e]&&(O[e]=[])},n.removeAllHooks=function(){O={}},n}();const Zr=e=>{const t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce(((e,t)=>Math.min(e,t.length)),1/0):0};var Qr=(e,{include:t,exclude:n}={})=>{const s=e=>{const s=t=>"string"==typeof t?e===t:t.test(e);return t?t.some(s):!n||!n.some(s)};for(const[t,n]of(e=>{const t=new Set;do{for(const n of Reflect.ownKeys(e))t.add([e,n])}while((e=Reflect.getPrototypeOf(e))&&e!==Object.prototype);return t})(e.constructor.prototype)){if("constructor"===n||!s(n))continue;const r=Reflect.getOwnPropertyDescriptor(t,n);r&&"function"==typeof r.value&&(e[n]=e[n].bind(e))}return e};class ei{constructor(e,t,n,s,r,i){if(0===s.length)throw"no answers for question provided";this.text=e,this.explanation=t,this.hint=n,this.solved=!1,this.options=i,this.answers=s,this.type=r,Qr(this),this.reset()}static is_equal(e,t){return JSON.stringify(e)===JSON.stringify(t)}static shuffle(e){let t,n,s=e.length;for(;0!==s;)n=Math.floor(Math.random()*s),s-=1,t=e[s],e[s]=e[n],e[n]=t;return e}reset(){this.selected=[],this.solved=!1,this.options.shuffle_answers&&(this.answers=ei.shuffle(this.answers))}}class ti extends ei{constructor(e,t,n,s,r){r.shuffle_answers=!0,super(e,t,n,s,"Sequence",r)}check(){let e=this.answers.map((e=>e.id));return this.solved=ei.is_equal(e.sort(),this.selected),this.solved}}class ni extends ei{check(){let e=this.answers.filter((e=>e.correct)).map((e=>e.id)),t=this.selected.map((e=>this.answers[e].id));return this.solved=ei.is_equal(e.sort(),t.sort()),this.solved}}class si extends ni{constructor(e,t,n,s,r){super(e,t,n,s,"MultipleChoice",r)}}class ri extends ni{constructor(e,t,n,s,r){if(super(e,t,n,s,"SingleChoice",r),this.answers.filter((e=>e.correct)).length>1)throw"Single Choice questions can not have more than one correct answer."}}class ii{constructor(e,t,n,s){this.html=t,this.correct=n,this.id=e,this.comment=s,Qr(this)}}class oi{constructor(e){this.val=Ke(0),this.max=e,this.subscribe=this.val.subscribe,Qr(this)}jump(e){this.val.set(e)}next(){this.val.update((e=>ee>0?e-1:e))}reset(){0==c(this.val)&&this.val.set(1),this.val.set(0)}}class ai{constructor(e,t){if(0==e.length)throw"No questions for quiz provided";this.questions=e,this.counter=new oi(this.questions.length),this.finished=Ke(!1),this.points=0,this.config=t,t.shuffle_questions&&(this.questions=ei.shuffle(e)),Qr(this)}current(){let e=c(this.counter);return this.questions[e]}next(){this.counter.next()}previous(){this.counter.previous()}jump(e){this.counter.jump(e)}reset(){this.counter.reset(),this.questions.forEach((e=>e.reset())),this.finished.set(!1)}evaluate(){this.finished.set(!0);var e=0;for(var t of this.questions)t.check(),t.solved&&e++;this.points=e,this.jump(this.counter.max)}}function li(e,t){return void 0!==e?e:t}class ci{constructor(e){this.start_on_load=li(e.start_on_load,!0),this.shuffle_answers=li(e.shuffle_answers,!0),this.shuffle_questions=li(e.shuffle_questions,!1),this.primary_color=li(e.primary_color,"steelblue"),this.secondary_color=li(e.secondary_color,"#f2f2f2"),this.text_color=li(e.text_color,"black"),this.locale=li(e.locale,null)}}function ui(e,t){let n=new ci(e);for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}var hi={exports:{}};function fi(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}hi.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:fi,changeDefaults:function(e){hi.exports.defaults=e}};const pi=/[&<>"']/,di=/[&<>"']/g,mi=/[<>"']|&(?!#?\w+;)/,gi=/[<>"']|&(?!#?\w+;)/g,yi={"&":"&","<":"<",">":">",'"':""","'":"'"},bi=e=>yi[e];const vi=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function wi(e){return e.replace(vi,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const ki=/(^|[^\[])\^/g;const Ei=/[^\w:]/g,xi=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const _i={},Si=/^[^:]+:\/*[^/]*$/,Ti=/^([^:]+:)[\s\S]*$/,Ai=/^([^:]+:\/*[^/]*)[\s\S]*$/;function $i(e,t){_i[" "+e]||(Si.test(e)?_i[" "+e]=e+"/":_i[" "+e]=Ni(e,"/",!0));const n=-1===(e=_i[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(Ti,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(Ai,"$1")+t:e+t}function Ni(e,t,n){const s=e.length;if(0===s)return"";let r=0;for(;r(s=(s=s.source||s).replace(ki,"$1"),e=e.replace(t,s),n),getRegex:()=>new RegExp(e,t)};return n},cleanUrl:function(e,t,n){if(e){let e;try{e=decodeURIComponent(wi(n)).replace(Ei,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!xi.test(n)&&(n=$i(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},resolveUrl:$i,noopTest:{exec:function(){}},merge:function(e){let t,n,s=1;for(;s{let s=!1,r=t;for(;--r>=0&&"\\"===n[r];)s=!s;return s?"|":" |"})).split(/ \|/);let s=0;if(n.length>t)n.splice(t);else for(;n.length1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}};const{defaults:Li}=hi.exports,{rtrim:Ii,splitCells:Ci,escape:Mi,findClosingBracket:Ri}=Oi;function Pi(e,t,n){const s=t.href,r=t.title?Mi(t.title):null,i=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?{type:"link",raw:n,href:s,title:r,text:i}:{type:"image",raw:n,href:s,title:r,text:Mi(i)}}var qi=class{constructor(e){this.options=e||Li}space(e){const t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Ii(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const s=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=s.length?e.slice(s.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=Ii(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e}}}nptable(e){const t=this.rules.block.nptable.exec(e);if(t){const e={type:"table",header:Ci(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(e.header.length===e.align.length){let t,n=e.align.length;for(t=0;t ?/gm,"");return{type:"blockquote",raw:t[0],text:e}}}list(e){const t=this.rules.block.list.exec(e);if(t){let e=t[0];const n=t[2],s=n.length>1,r={type:"list",raw:e,ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]},i=t[0].match(this.rules.block.item);let o,a,l,c,u,h,f,p,d,m=!1,g=i.length;l=this.rules.block.listItemStart.exec(i[0]);for(let t=0;tl[1].length:c[1].length>=l[0].length||c[1].length>3){i.splice(t,2,i[t]+(!this.options.pedantic&&c[1].length/i.test(s[0])&&(t=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(s[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(s[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:s[0],inLink:t,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):Mi(s[0]):s[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=Ii(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=Ri(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],s=e[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),Pi(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:s?s.replace(this.rules.inline._escapes,"$1"):s},t[0])}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return Pi(n,e,n[0])}}emStrong(e,t,n=""){let s=this.rules.inline.emStrong.lDelim.exec(e);if(!s)return;if(s[3]&&n.match(/[\p{L}\p{N}]/u))return;const r=s[1]||s[2]||"";if(!r||r&&(""===n||this.rules.inline.punctuation.exec(n))){const n=s[0].length-1;let r,i,o=n,a=0;const l="*"===s[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(s=l.exec(t));)if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],r)if(i=r.length,s[3]||s[4])o+=i;else if(!((s[5]||s[6])&&n%3)||(n+i)%3){if(o-=i,!(o>0))return i=Math.min(i,i+o+a),Math.min(n,i)%2?{type:"em",raw:e.slice(0,n+s.index+i+1),text:e.slice(1,n+s.index+i)}:{type:"strong",raw:e.slice(0,n+s.index+i+1),text:e.slice(2,n+s.index+i-1)}}else a+=i}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),s=/^ /.test(e)&&/ $/.test(e);return n&&s&&(e=e.substring(1,e.length-1)),e=Mi(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2]}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,s;return"@"===n[2]?(e=Mi(this.options.mangle?t(n[1]):n[1]),s="mailto:"+e):(e=Mi(n[1]),s=e),{type:"link",raw:n[0],text:e,href:s,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,s;if("@"===n[2])e=Mi(this.options.mangle?t(n[0]):n[0]),s="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=Mi(n[0]),s="www."===n[1]?"http://"+e:e}return{type:"link",raw:n[0],text:e,href:s,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t,n){const s=this.rules.inline.text.exec(e);if(s){let e;return e=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):Mi(s[0]):s[0]:Mi(this.options.smartypants?n(s[0]):s[0]),{type:"text",raw:s[0],text:e}}}};const{noopTest:Di,edit:zi,merge:Ui}=Oi,ji={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Di,table:Di,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};ji.def=zi(ji.def).replace("label",ji._label).replace("title",ji._title).getRegex(),ji.bullet=/(?:[*+-]|\d{1,9}[.)])/,ji.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,ji.item=zi(ji.item,"gm").replace(/bull/g,ji.bullet).getRegex(),ji.listItemStart=zi(/^( *)(bull) */).replace("bull",ji.bullet).getRegex(),ji.list=zi(ji.list).replace(/bull/g,ji.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ji.def.source+")").getRegex(),ji._tag="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ji._comment=/|$)/,ji.html=zi(ji.html,"i").replace("comment",ji._comment).replace("tag",ji._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ji.paragraph=zi(ji._paragraph).replace("hr",ji.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ji._tag).getRegex(),ji.blockquote=zi(ji.blockquote).replace("paragraph",ji.paragraph).getRegex(),ji.normal=Ui({},ji),ji.gfm=Ui({},ji.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ji.gfm.nptable=zi(ji.gfm.nptable).replace("hr",ji.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ji._tag).getRegex(),ji.gfm.table=zi(ji.gfm.table).replace("hr",ji.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ji._tag).getRegex(),ji.pedantic=Ui({},ji.normal,{html:zi("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",ji._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Di,paragraph:zi(ji.normal._paragraph).replace("hr",ji.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ji.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const Fi={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Di,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Di,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};Fi.punctuation=zi(Fi.punctuation).replace(/punctuation/g,Fi._punctuation).getRegex(),Fi.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Fi.escapedEmSt=/\\\*|\\_/g,Fi._comment=zi(ji._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Fi.emStrong.lDelim=zi(Fi.emStrong.lDelim).replace(/punct/g,Fi._punctuation).getRegex(),Fi.emStrong.rDelimAst=zi(Fi.emStrong.rDelimAst,"g").replace(/punct/g,Fi._punctuation).getRegex(),Fi.emStrong.rDelimUnd=zi(Fi.emStrong.rDelimUnd,"g").replace(/punct/g,Fi._punctuation).getRegex(),Fi._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Fi._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Fi._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Fi.autolink=zi(Fi.autolink).replace("scheme",Fi._scheme).replace("email",Fi._email).getRegex(),Fi._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Fi.tag=zi(Fi.tag).replace("comment",Fi._comment).replace("attribute",Fi._attribute).getRegex(),Fi._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Fi._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Fi._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Fi.link=zi(Fi.link).replace("label",Fi._label).replace("href",Fi._href).replace("title",Fi._title).getRegex(),Fi.reflink=zi(Fi.reflink).replace("label",Fi._label).getRegex(),Fi.reflinkSearch=zi(Fi.reflinkSearch,"g").replace("reflink",Fi.reflink).replace("nolink",Fi.nolink).getRegex(),Fi.normal=Ui({},Fi),Fi.pedantic=Ui({},Fi.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:zi(/^!?\[(label)\]\((.*?)\)/).replace("label",Fi._label).getRegex(),reflink:zi(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Fi._label).getRegex()}),Fi.gfm=Ui({},Fi.normal,{escape:zi(Fi.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),s+="&#"+n+";";return s}const{defaults:Ji}=hi.exports,{cleanUrl:Zi,escape:Qi}=Oi;var eo=class{constructor(e){this.options=e||Ji}code(e,t,n){const s=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,s);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",s?'
'+(n?e:Qi(e,!0))+"
\n":"
"+(n?e:Qi(e,!0))+"
\n"}blockquote(e){return"
\n"+e+"
\n"}html(e){return e}heading(e,t,n,s){return this.options.headerIds?"'+e+"\n":""+e+"\n"}hr(){return this.options.xhtml?"
\n":"
\n"}list(e,t,n){const s=t?"ol":"ul";return"<"+s+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e){return"
  • "+e+"
  • \n"}checkbox(e){return" "}paragraph(e){return"

    "+e+"

    \n"}table(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return"\n"+e+"\n"}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"}strong(e){return""+e+""}em(e){return""+e+""}codespan(e){return""+e+""}br(){return this.options.xhtml?"
    ":"
    "}del(e){return""+e+""}link(e,t,n){if(null===(e=Zi(this.options.sanitize,this.options.baseUrl,e)))return n;let s='",s}image(e,t,n){if(null===(e=Zi(this.options.sanitize,this.options.baseUrl,e)))return n;let s=''+n+'":">",s}text(e){return e}},to=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}},no=class{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,s=0;if(this.seen.hasOwnProperty(n)){s=this.seen[e];do{s++,n=e+"-"+s}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=s,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}};const so=eo,ro=to,io=no,{defaults:oo}=hi.exports,{unescape:ao}=Oi;const lo=class e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ki,this.options.tokenizer=this.options.tokenizer||new Gi,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;const t={block:Vi.normal,inline:Hi.normal};this.options.pedantic?(t.block=Vi.pedantic,t.inline=Hi.pedantic):this.options.gfm&&(t.block=Vi.gfm,this.options.breaks?t.inline=Hi.breaks:t.inline=Hi.gfm),this.tokenizer.rules=t}static get rules(){return{block:Vi,inline:Hi}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens}blockTokens(e,t=[],n=!0){let s,r,i,o,a,l;for(this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((n=>!!(s=n.call(this,e,t))&&(e=e.substring(s.raw.length),t.push(s),!0)))))if(s=this.tokenizer.space(e))e=e.substring(s.raw.length),s.type&&t.push(s);else if(s=this.tokenizer.code(e))e=e.substring(s.raw.length),o=t[t.length-1],o&&"paragraph"===o.type?(o.raw+="\n"+s.raw,o.text+="\n"+s.text):t.push(s);else if(s=this.tokenizer.fences(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.heading(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.nptable(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.hr(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.blockquote(e))e=e.substring(s.raw.length),s.tokens=this.blockTokens(s.text,[],n),t.push(s);else if(s=this.tokenizer.list(e)){for(e=e.substring(s.raw.length),i=s.items.length,r=0;r=0&&(t=Math.min(t,s))})),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(n&&(s=this.tokenizer.paragraph(a)))o=t[t.length-1],l&&"paragraph"===o.type?(o.raw+="\n"+s.raw,o.text+="\n"+s.text):t.push(s),l=a.length!==e.length,e=e.substring(s.raw.length);else if(s=this.tokenizer.text(e))e=e.substring(s.raw.length),o=t[t.length-1],o&&"text"===o.type?(o.raw+="\n"+s.raw,o.text+="\n"+s.text):t.push(s);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}inline(e){let t,n,s,r,i,o;const a=e.length;for(t=0;t0)for(;null!=(a=this.tokenizer.rules.inline.reflinkSearch.exec(u));)e.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(u=u.slice(0,a.index)+"["+Yi("a",a[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(a=this.tokenizer.rules.inline.blockSkip.exec(u));)u=u.slice(0,a.index)+"["+Yi("a",a[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(a=this.tokenizer.rules.inline.escapedEmSt.exec(u));)u=u.slice(0,a.index)+"++"+u.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((n=>!!(r=n.call(this,e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))))if(r=this.tokenizer.escape(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.tag(e,n,s))e=e.substring(r.raw.length),n=r.inLink,s=r.inRawBlock,i=t[t.length-1],i&&"text"===r.type&&"text"===i.type?(i.raw+=r.raw,i.text+=r.text):t.push(r);else if(r=this.tokenizer.link(e))e=e.substring(r.raw.length),"link"===r.type&&(r.tokens=this.inlineTokens(r.text,[],!0,s)),t.push(r);else if(r=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(r.raw.length),i=t[t.length-1],"link"===r.type?(r.tokens=this.inlineTokens(r.text,[],!0,s),t.push(r)):i&&"text"===r.type&&"text"===i.type?(i.raw+=r.raw,i.text+=r.text):t.push(r);else if(r=this.tokenizer.emStrong(e,u,c))e=e.substring(r.raw.length),r.tokens=this.inlineTokens(r.text,[],n,s),t.push(r);else if(r=this.tokenizer.codespan(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.br(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.del(e))e=e.substring(r.raw.length),r.tokens=this.inlineTokens(r.text,[],n,s),t.push(r);else if(r=this.tokenizer.autolink(e,Wi))e=e.substring(r.raw.length),t.push(r);else if(n||!(r=this.tokenizer.url(e,Wi))){if(o=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let s;this.options.extensions.startInline.forEach((function(e){s=e.call(this,n),"number"==typeof s&&s>=0&&(t=Math.min(t,s))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(o,s,Xi))e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(c=r.raw.slice(-1)),l=!0,i=t[t.length-1],i&&"text"===i.type?(i.raw+=r.raw,i.text+=r.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(r.raw.length),t.push(r);return t}},co=class e{constructor(e){this.options=e||oo,this.options.renderer=this.options.renderer||new so,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ro,this.slugger=new io}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n,s,r,i,o,a,l,c,u,h,f,p,d,m,g,y,b,v,w,k="";const E=e.length;for(n=0;n0&&"text"===g.tokens[0].type?(g.tokens[0].text=v+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=v+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:v}):m+=v),m+=this.parse(g.tokens,d),u+=this.renderer.listitem(m,b,y);k+=this.renderer.list(u,f,p);continue;case"html":k+=this.renderer.html(h.text);continue;case"paragraph":k+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(u=h.tokens?this.parseInline(h.tokens):h.text;n+1{s(e.text,e.lang,(function(t,n){if(t)return i(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),o--,0===o&&i()}))}),0))})),void(0===o&&i())}try{const n=lo.lex(e,t);return t.walkTokens&&ko.walkTokens(n,t.walkTokens),co.parse(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+yo(e.message+"",!0)+"
    ";throw e}}ko.options=ko.setOptions=function(e){return mo(ko.defaults,e),vo(ko.defaults),ko},ko.getDefaults=bo,ko.defaults=wo,ko.use=function(...e){const t=mo({},...e),n=ko.defaults.extensions||{renderers:{},childTokens:{}};let s;e.forEach((e=>{if(e.extensions&&(s=!0,e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=n.renderers?n.renderers[e.name]:null;n.renderers[e.name]=t?function(...n){let s=e.renderer.apply(this,n);return!1===s&&(s=t.apply(this,n)),s}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&("block"===e.level?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:"inline"===e.level&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)}))),e.renderer){const n=ko.defaults.renderer||new ho;for(const t in e.renderer){const s=n[t];n[t]=(...r)=>{let i=e.renderer[t].apply(n,r);return!1===i&&(i=s.apply(n,r)),i}}t.renderer=n}if(e.tokenizer){const n=ko.defaults.tokenizer||new uo;for(const t in e.tokenizer){const s=n[t];n[t]=(...r)=>{let i=e.tokenizer[t].apply(n,r);return!1===i&&(i=s.apply(n,r)),i}}t.tokenizer=n}if(e.walkTokens){const n=ko.defaults.walkTokens;t.walkTokens=t=>{e.walkTokens.call(this,t),n&&n(t)}}s&&(t.extensions=n),ko.setOptions(t)}))},ko.walkTokens=function(e,t){for(const n of e)switch(t(n),n.type){case"table":for(const e of n.tokens.header)ko.walkTokens(e,t);for(const e of n.tokens.cells)for(const n of e)ko.walkTokens(n,t);break;case"list":ko.walkTokens(n.items,t);break;default:ko.defaults.extensions&&ko.defaults.extensions.childTokens&&ko.defaults.extensions.childTokens[n.type]?ko.defaults.extensions.childTokens[n.type].forEach((function(e){ko.walkTokens(n[e],t)})):n.tokens&&ko.walkTokens(n.tokens,t)}},ko.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");t=mo({},ko.defaults,t||{}),go(t);try{const n=lo.lexInline(e,t);return t.walkTokens&&ko.walkTokens(n,t.walkTokens),co.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+yo(e.message+"",!0)+"
    ";throw e}},ko.Parser=co,ko.parser=co.parse,ko.Renderer=ho,ko.TextRenderer=fo,ko.Lexer=lo,ko.lexer=lo.lex,ko.Tokenizer=uo,ko.Slugger=po,ko.parse=ko;var Eo=ko;const xo=Symbol.for("yaml.alias"),_o=Symbol.for("yaml.document"),So=Symbol.for("yaml.map"),To=Symbol.for("yaml.pair"),Ao=Symbol.for("yaml.scalar"),$o=Symbol.for("yaml.seq"),No=Symbol.for("yaml.node.type"),Oo=e=>!!e&&"object"==typeof e&&e[No]===xo,Lo=e=>!!e&&"object"==typeof e&&e[No]===_o,Io=e=>!!e&&"object"==typeof e&&e[No]===So,Co=e=>!!e&&"object"==typeof e&&e[No]===To,Mo=e=>!!e&&"object"==typeof e&&e[No]===Ao,Ro=e=>!!e&&"object"==typeof e&&e[No]===$o;function Po(e){if(e&&"object"==typeof e)switch(e[No]){case So:case $o:return!0}return!1}function qo(e){if(e&&"object"==typeof e)switch(e[No]){case xo:case So:case Ao:case $o:return!0}return!1}class Do{constructor(e){Object.defineProperty(this,No,{value:e})}}const zo=Symbol("break visit"),Uo=Symbol("skip children"),jo=Symbol("remove node");function Fo(e,t){if("object"==typeof t&&(t.Collection||t.Node||t.Value)&&(t=Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t)),Lo(e)){Bo(null,e.contents,t,Object.freeze([e]))===jo&&(e.contents=null)}else Bo(null,e,t,Object.freeze([]))}function Bo(e,t,n,s){let r;if("function"==typeof n?r=n(e,t,s):Io(t)?n.Map&&(r=n.Map(e,t,s)):Ro(t)?n.Seq&&(r=n.Seq(e,t,s)):Co(t)?n.Pair&&(r=n.Pair(e,t,s)):Mo(t)?n.Scalar&&(r=n.Scalar(e,t,s)):Oo(t)&&n.Alias&&(r=n.Alias(e,t,s)),qo(r)||Co(r)){const t=s[s.length-1];if(Po(t))t.items[e]=r;else if(Co(t))"key"===e?t.key=r:t.value=r;else{if(!Lo(t)){const e=Oo(t)?"alias":"scalar";throw new Error(`Cannot replace node with ${e} parent`)}t.contents=r}return Bo(e,r,n,s)}if("symbol"!=typeof r)if(Po(t)){s=Object.freeze(s.concat(t));for(let e=0;e"!==e[e.length-1]&&t("Verbatim tags must end with a >"),n)}const[,n,s]=e.match(/^(.*!)([^!]*)$/);s||t(`The ${e} tag has no suffix`);const r=this.tags[n];return r?r+decodeURIComponent(s):"!"===n?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+e.substring(n.length).replace(/[!,[\]{}]/g,(e=>Go[e]));return"!"===e[0]?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let s;if(e&&n.length>0&&qo(e.contents)){const t={};Fo(e.contents,((e,n)=>{qo(n)&&n.tag&&(t[n.tag]=!0)})),s=Object.keys(t)}else s=[];for(const[r,i]of n)"!!"===r&&"tag:yaml.org,2002:"===i||e&&!s.some((e=>e.startsWith(i)))||t.push(`%TAG ${r} ${i}`);return t.join("\n")}}function Vo(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=JSON.stringify(e);throw new Error(`Anchor must not contain whitespace or control characters: ${t}`)}return!0}function Ho(e){const t=new Set;return Fo(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function Yo(e,t){for(let n=1;;++n){const s=`${e}${n}`;if(!t.has(s))return s}}Ko.defaultYaml={explicit:!1,version:"1.2"},Ko.defaultTags={"!!":"tag:yaml.org,2002:"};class Xo extends Do{constructor(e){super(xo),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return Fo(e,{Node:(e,n)=>{if(n===this)return Fo.BREAK;n.anchor===this.source&&(t=n)}}),t}toJSON(e,t){if(!t)return{source:this.source};const{anchors:n,doc:s,maxAliasCount:r}=t,i=this.resolve(s);if(!i){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(e)}const o=n.get(i);if(!o||void 0===o.res){throw new ReferenceError("This should not happen: Alias anchor was not resolved?")}if(r>=0&&(o.count+=1,0===o.aliasCount&&(o.aliasCount=Wo(s,i,n)),o.count*o.aliasCount>r)){throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return o.res}toString(e,t,n){const s=`*${this.source}`;if(e){if(Vo(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(e)}if(e.implicitKey)return`${s} `}return s}}function Wo(e,t,n){if(Oo(t)){const s=t.resolve(e),r=n&&s&&n.get(s);return r?r.count*r.aliasCount:0}if(Po(t)){let s=0;for(const r of t.items){const t=Wo(e,r,n);t>s&&(s=t)}return s}if(Co(t)){const s=Wo(e,t.key,n),r=Wo(e,t.value,n);return Math.max(s,r)}return 1}function Jo(e,t,n){if(Array.isArray(e))return e.map(((e,t)=>Jo(e,String(t),n)));if(e&&"function"==typeof e.toJSON){if(!n||(!Mo(s=e)&&!Po(s)||!s.anchor))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};const i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}var s;return"bigint"!=typeof e||n&&n.keep?e:Number(e)}const Zo=e=>!e||"function"!=typeof e&&"object"!=typeof e;class Qo extends Do{constructor(e){super(Ao),this.value=e}toJSON(e,t){return t&&t.keep?this.value:Jo(this.value,e,t)}toString(){return String(this.value)}}Qo.BLOCK_FOLDED="BLOCK_FOLDED",Qo.BLOCK_LITERAL="BLOCK_LITERAL",Qo.PLAIN="PLAIN",Qo.QUOTE_DOUBLE="QUOTE_DOUBLE",Qo.QUOTE_SINGLE="QUOTE_SINGLE";function ea(e,t,n){var s,r;if(qo(e))return e;if(Co(e)){const t=null===(r=(s=n.schema[So]).createNode)||void 0===r?void 0:r.call(s,n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||"function"==typeof BigInt&&e instanceof BigInt)&&(e=e.valueOf());const{onAnchor:i,onTagObj:o,schema:a,sourceObjects:l}=n;let c;if(e&&"object"==typeof e){if(c=l.get(e),c)return c.anchor||(c.anchor=i(e)),new Xo(c.anchor);c={anchor:null,node:null},l.set(e,c)}t&&t.startsWith("!!")&&(t="tag:yaml.org,2002:"+t.slice(2));let u=function(e,t,n){if(t){const e=n.filter((e=>e.tag===t)),s=e.find((e=>!e.format))||e[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return n.find((t=>t.identify&&t.identify(e)&&!t.format))}(e,t,a.tags);if(!u){if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),!e||"object"!=typeof e)return new Qo(e);u=e instanceof Map?a[So]:Symbol.iterator in Object(e)?a[$o]:a[So]}o&&(o(u),delete n.onTagObj);const h=(null==u?void 0:u.createNode)?u.createNode(n.schema,e,n):new Qo(e);return t&&(h.tag=t),c&&(c.node=h),h}function ta(e,t,n){let s=n;for(let e=t.length-1;e>=0;--e){const n=t[e];if("number"==typeof n&&Number.isInteger(n)&&n>=0){const e=[];e[n]=s,s=e}else{const e={};Object.defineProperty(e,"symbol"==typeof n?n:String(n),{value:s,writable:!0,enumerable:!0,configurable:!0}),s=e}}return ea(s,void 0,{onAnchor(){throw new Error("Repeated objects are not supported here")},schema:e,sourceObjects:new Map})}const na=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;class sa extends Do{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}addIn(e,t){if(na(e))this.add(t);else{const[n,...s]=e,r=this.get(n,!0);if(Po(r))r.addIn(s,t);else{if(void 0!==r||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`);this.set(n,ta(this.schema,s,t))}}}deleteIn([e,...t]){if(0===t.length)return this.delete(e);const n=this.get(e,!0);if(Po(n))return n.deleteIn(t);throw new Error(`Expected YAML collection at ${e}. Remaining path: ${t}`)}getIn([e,...t],n){const s=this.get(e,!0);return 0===t.length?!n&&Mo(s)?s.value:s:Po(s)?s.getIn(t,n):void 0}hasAllNullValues(e){return this.items.every((t=>{if(!Co(t))return!1;const n=t.value;return null==n||e&&Mo(n)&&null==n.value&&!n.commentBefore&&!n.comment&&!n.tag}))}hasIn([e,...t]){if(0===t.length)return this.has(e);const n=this.get(e,!0);return!!Po(n)&&n.hasIn(t)}setIn([e,...t],n){if(0===t.length)this.set(e,n);else{const s=this.get(e,!0);if(Po(s))s.setIn(t,n);else{if(void 0!==s||!this.schema)throw new Error(`Expected YAML collection at ${e}. Remaining path: ${t}`);this.set(e,ta(this.schema,t,n))}}}}function ra(e,t,n){return n?n.includes("\n")?`${e}\n`+n.replace(/^/gm,`${t||""}#`):e.endsWith(" ")?`${e}#${n}`:`${e} #${n}`:e}sa.maxFlowStringSingleLineLength=60;const ia="flow",oa="block",aa="quoted";function la(e,t,n="flow",{indentAtStart:s,lineWidth:r=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!r||r<0)return e;const l=Math.max(1+i,1+r-t.length);if(e.length<=l)return e;const c=[],u={};let h,f,p=r-t.length;"number"==typeof s&&(s>r-Math.max(2,i)?c.push(0):p=r-s);let d,m=!1,g=-1,y=-1,b=-1;for(n===oa&&(g=ca(e,g),-1!==g&&(p=g+l));d=e[g+=1];){if(n===aa&&"\\"===d){switch(y=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}b=g}if("\n"===d)n===oa&&(g=ca(e,g)),p=g+l,h=void 0;else{if(" "===d&&f&&" "!==f&&"\n"!==f&&"\t"!==f){const t=e[g+1];t&&" "!==t&&"\n"!==t&&"\t"!==t&&(h=g)}if(g>=p)if(h)c.push(h),p=h+l,h=void 0;else if(n===aa){for(;" "===f||"\t"===f;)f=d,d=e[g+=1],m=!0;const t=g>b+1?g-2:y-1;if(u[t])return e;c.push(t),u[t]=!0,p=t+l,h=void 0}else m=!0}f=d}if(m&&a&&a(),0===c.length)return e;o&&o();let v=e.slice(0,c[0]);for(let s=0;s({indentAtStart:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ha=e=>/^(%|---|\.\.\.)/m.test(e);function fa(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:s}=t,r=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(ha(e)?" ":"");let o="",a=0;for(let e=0,t=n[e];t;t=n[++e])if(" "===t&&"\\"===n[e+1]&&"n"===n[e+2]&&(o+=n.slice(a,e)+"\\ ",e+=1,a=e,t="\\"),"\\"===t)switch(n[e+1]){case"u":{o+=n.slice(a,e);const t=n.substr(e+2,4);switch(t){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:"00"===t.substr(0,2)?o+="\\x"+t.substr(2):o+=n.substr(e,6)}e+=5,a=e+1}break;case"n":if(s||'"'===n[e+2]||n.lengths)return!0;if(n=t+1,r-n<=s)return!1}return!0}(n,s.options.lineWidth,o.length));if(!n)return a?"|\n":">\n";let l,c;for(c=n.length;c>0;--c){const e=n[c-1];if("\n"!==e&&"\t"!==e&&" "!==e)break}let u=n.substring(c);const h=u.indexOf("\n");-1===h?l="-":n===u||h!==u.length-1?(l="+",i&&i()):l="",u&&(n=n.slice(0,-u.length),"\n"===u[u.length-1]&&(u=u.slice(0,-1)),u=u.replace(/\n+(?!\n|$)/g,`$&${o}`));let f,p=!1,d=-1;for(f=0;f")+(p?o?"2":"1":"")+l;if(e&&(g+=" #"+e.replace(/ ?[\r\n]+/g," "),r&&r()),a)return`${g}\n${o}${m}${n=n.replace(/\n+/g,`$&${o}`)}${u}`;return`${g}\n${o}${la(`${m}${n=n.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${o}`)}${u}`,o,oa,ua(s))}`}function ma(e,t,n,s){const{implicitKey:r,inFlow:i}=t,o="string"==typeof e.value?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==Qo.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=Qo.QUOTE_DOUBLE);const l=e=>{switch(e){case Qo.BLOCK_FOLDED:case Qo.BLOCK_LITERAL:return r||i?fa(o.value,t):da(o,t,n,s);case Qo.QUOTE_DOUBLE:return fa(o.value,t);case Qo.QUOTE_SINGLE:return pa(o.value,t);case Qo.PLAIN:return function(e,t,n,s){var r;const{type:i,value:o}=e,{actualString:a,implicitKey:l,indent:c,inFlow:u}=t;if(l&&/[\n[\]{},]/.test(o)||u&&/[[\]{},]/.test(o))return fa(o,t);if(!o||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o)){const r=-1!==o.indexOf('"'),i=-1!==o.indexOf("'");let a;return a=r&&!i?pa:i&&!r?fa:t.options.singleQuote?pa:fa,l||u||-1===o.indexOf("\n")?a(o,t):da(e,t,n,s)}if(!l&&!u&&i!==Qo.PLAIN&&-1!==o.indexOf("\n"))return da(e,t,n,s);if(""===c&&ha(o))return t.forceBlockIndent=!0,da(e,t,n,s);const h=o.replace(/\n+/g,`$&\n${c}`);if(a)for(const e of t.doc.schema.tags)if(e.default&&"tag:yaml.org,2002:str"!==e.tag&&(null===(r=e.test)||void 0===r?void 0:r.test(h)))return fa(o,t);return l?h:la(h,c,ia,ua(t))}(o,t,n,s);default:return null}};let c=l(a);if(null===c){const{defaultKeyType:e,defaultStringType:n}=t.options,s=r&&e||n;if(c=l(s),null===c)throw new Error(`Unsupported default string type ${s}`)}return c}const ga=(e,t)=>({anchors:new Set,doc:e,indent:"",indentStep:"number"==typeof t.indent?" ".repeat(t.indent):" ",options:Object.assign({defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:!1,trueStr:"true",verifyAliasOrder:!0},t)});function ya(e,t,n,s){if(Co(e))return e.toString(t,n,s);if(Oo(e))return e.toString(t);let r;const i=qo(e)?e:t.doc.createNode(e,{onTagObj:e=>r=e});r||(r=function(e,t){if(t.tag){const n=e.filter((e=>e.tag===t.tag));if(n.length>0)return n.find((e=>e.format===t.format))||n[0]}let n,s;if(Mo(t)){s=t.value;const r=e.filter((e=>e.identify&&e.identify(s)));n=r.find((e=>e.format===t.format))||r.find((e=>!e.format))}else s=t,n=e.find((e=>e.nodeClass&&s instanceof e.nodeClass));if(!n){const e=s&&s.constructor?s.constructor.name:typeof s;throw new Error(`Tag not resolved for ${e} value`)}return n}(t.doc.schema.tags,i));const o=function(e,t,{anchors:n,doc:s}){const r=[],i=(Mo(e)||Po(e))&&e.anchor;return i&&Vo(i)&&(n.add(i),r.push(`&${i}`)),e.tag?r.push(s.directives.tagString(e.tag)):t.default||r.push(s.directives.tagString(t.tag)),r.join(" ")}(i,r,t);o.length>0&&(t.indentAtStart=(t.indentAtStart||0)+o.length+1);const a="function"==typeof r.stringify?r.stringify(i,t,n,s):Mo(i)?ma(i,t,n,s):i.toString(t,n,s);return o?Mo(i)||"{"===a[0]||"["===a[0]?`${o} ${a}`:`${o}\n${t.indent}${a}`:a}function ba(e,t){"debug"!==e&&"warn"!==e||("undefined"!=typeof process&&process.emitWarning?process.emitWarning(t):console.warn(t))}function va(e,t,{key:n,value:s}){if(e&&e.doc.schema.merge&&wa(n))if(Ro(s))for(const n of s.items)ka(e,t,n);else if(Array.isArray(s))for(const n of s)ka(e,t,n);else ka(e,t,s);else{const r=Jo(n,"",e);if(t instanceof Map)t.set(r,Jo(s,r,e));else if(t instanceof Set)t.add(r);else{const i=function(e,t,n){if(null===t)return"";if("object"!=typeof t)return String(t);if(qo(e)&&n&&n.doc){const t=ga(n.doc,{});t.anchors=new Set;for(const e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;const s=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(s);e.length>40&&(e=e.substring(0,36)+'..."'),ba(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}(n,r,e),o=Jo(s,i,e);i in t?Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[i]=o}}return t}const wa=e=>"<<"===e||Mo(e)&&"<<"===e.value&&(!e.type||e.type===Qo.PLAIN);function ka(e,t,n){const s=e&&Oo(n)?n.resolve(e.doc):null;if(!Io(s))throw new Error("Merge sources must be map aliases");const r=s.toJSON(null,e,Map);for(const[e,n]of r)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function Ea(e,t,n){const s=ea(e,void 0,n),r=ea(t,void 0,n);return new xa(s,r)}class xa{constructor(e,t=null){Object.defineProperty(this,No,{value:To}),this.key=e,this.value=t}toJSON(e,t){return va(t,t&&t.mapAsMap?new Map:{},this)}toString(e,t,n){return e&&e.doc?function({key:e,value:t},n,s,r){const{allNullValues:i,doc:o,indent:a,indentStep:l,options:{indentSeq:c,simpleKeys:u}}=n;let h=qo(e)&&e.comment||null;if(u){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Po(e))throw new Error("With simple keys, collection cannot be used as a key value")}let f=!u&&(!e||h&&null==t&&!n.inFlow||Po(e)||(Mo(e)?e.type===Qo.BLOCK_FOLDED||e.type===Qo.BLOCK_LITERAL:"object"==typeof e));n=Object.assign({},n,{allNullValues:!1,implicitKey:!f&&(u||!i),indent:a+l});let p=!1,d=!1,m=ya(e,n,(()=>p=!0),(()=>d=!0));if(!f&&!n.inFlow&&m.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");f=!0}if(n.inFlow){if(i||null==t)return p&&s&&s(),f?`? ${m}`:m}else if(i&&!u||null==t&&f)return p&&(h=null),d&&!h&&r&&r(),ra(`? ${m}`,n.indent,h);p&&(h=null),m=f?`? ${ra(m,n.indent,h)}\n${a}:`:ra(`${m}:`,n.indent,h);let g="",y=null;qo(t)?(t.spaceBefore&&(g="\n"),t.commentBefore&&(g+=`\n${t.commentBefore.replace(/^/gm,`${n.indent}#`)}`),y=t.comment):t&&"object"==typeof t&&(t=o.createNode(t));n.implicitKey=!1,f||h||!Mo(t)||(n.indentAtStart=m.length+1),d=!1,c||!(l.length>=2)||n.inFlow||f||!Ro(t)||t.flow||t.tag||t.anchor||(n.indent=n.indent.substr(2));let b=!1;const v=ya(t,n,(()=>b=!0),(()=>d=!0));let w=" ";g||h?w=`${g}\n${n.indent}`:!f&&Po(t)?("["===v[0]||"{"===v[0])&&!v.includes("\n")||(w=`\n${n.indent}`):"\n"===v[0]&&(w="");return n.inFlow?(b&&s&&s(),m+w+v):(b&&(y=null),d&&!y&&r&&r(),ra(m+w+v,n.indent,y))}(this,e,t,n):JSON.stringify(this)}}const _a={intAsBigInt:!1,logLevel:"warn",prettyErrors:!0,strict:!0,version:"1.2"};function Sa({comment:e,flow:t,items:n},s,{blockItem:r,flowChars:i,itemIndent:o,onChompKeep:a,onComment:l}){const{indent:c,indentStep:u}=s,h=t||s.inFlow;h&&(o+=u),s=Object.assign({},s,{indent:o,inFlow:h,type:null});let f=!0,p=!1;const d=n.reduce(((e,t,r)=>{let i=null;if(qo(t)){if(!p&&t.spaceBefore&&e.push({comment:!0,str:""}),t.commentBefore)for(const n of t.commentBefore.match(/^.*$/gm))e.push({comment:!0,str:`#${n}`});t.comment&&(i=t.comment,f=!1)}else if(Co(t)){const n=qo(t.key)?t.key:null;if(n){if(!p&&n.spaceBefore&&e.push({comment:!0,str:""}),n.commentBefore)for(const t of n.commentBefore.match(/^.*$/gm))e.push({comment:!0,str:`#${t}`});n.comment&&(f=!1)}if(h){const e=qo(t.value)?t.value:null;e?(e.comment&&(i=e.comment),(e.comment||e.commentBefore)&&(f=!1)):null==t.value&&n&&n.comment&&(i=n.comment)}}p=!1;let a=ya(t,s,(()=>i=null),(()=>p=!0));return h&&re.str));let s=2;for(const e of d){if(e.comment||e.str.includes("\n")){f=!1;break}s+=e.str.length+2}if(!f||s>sa.maxFlowStringSingleLineLength){m=e;for(const e of n)m+=e?`\n${u}${c}${e}`:"\n";m+=`\n${c}${t}`}else m=`${e} ${n.join(" ")} ${t}`}else{const e=d.map(r);m=e.shift()||"";for(const t of e)m+=t?`\n${c}${t}`:"\n"}return e?(m+="\n"+e.replace(/^/gm,`${c}#`),l&&l()):p&&a&&a(),m}function Ta(e,t){const n=Mo(t)?t.value:t;for(const s of e)if(Co(s)){if(s.key===t||s.key===n)return s;if(Mo(s.key)&&s.key.value===n)return s}}class Aa extends sa{constructor(e){super(So,e),this.items=[]}static get tagName(){return"tag:yaml.org,2002:map"}add(e,t){let n;n=Co(e)?e:new xa(e&&"object"==typeof e&&"key"in e?e.key:e,e.value);const s=Ta(this.items,n.key),r=this.schema&&this.schema.sortMapEntries;if(s){if(!t)throw new Error(`Key ${n.key} already set`);Mo(s.value)&&Zo(n.value)?s.value.value=n.value:s.value=n.value}else if(r){const e=this.items.findIndex((e=>r(n,e)<0));-1===e?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){const t=Ta(this.items,e);if(!t)return!1;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){const n=Ta(this.items,e),s=n&&n.value;return!t&&Mo(s)?s.value:s}has(e){return!!Ta(this.items,e)}set(e,t){this.add(new xa(e,t),!0)}toJSON(e,t,n){const s=n?new n:t&&t.mapAsMap?new Map:{};t&&t.onCreate&&t.onCreate(s);for(const e of this.items)va(t,s,e);return s}toString(e,t,n){if(!e)return JSON.stringify(this);for(const e of this.items)if(!Co(e))throw new Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Sa(this,e,{blockItem:e=>e.str,flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}const $a={collection:"map",createNode:function(e,t,n){const{keepUndefined:s,replacer:r}=n,i=new Aa(e),o=(e,o)=>{if("function"==typeof r)o=r.call(t,e,o);else if(Array.isArray(r)&&!r.includes(e))return;(void 0!==o||s)&&i.items.push(Ea(e,o,n))};if(t instanceof Map)for(const[e,n]of t)o(e,n);else if(t&&"object"==typeof t)for(const e of Object.keys(t))o(e,t[e]);return"function"==typeof e.sortMapEntries&&i.items.sort(e.sortMapEntries),i},default:!0,nodeClass:Aa,tag:"tag:yaml.org,2002:map",resolve:(e,t)=>(Io(e)||t("Expected a mapping for this tag"),e)};class Na extends sa{constructor(e){super($o,e),this.items=[]}static get tagName(){return"tag:yaml.org,2002:seq"}add(e){this.items.push(e)}delete(e){const t=Oa(e);if("number"!=typeof t)return!1;return this.items.splice(t,1).length>0}get(e,t){const n=Oa(e);if("number"!=typeof n)return;const s=this.items[n];return!t&&Mo(s)?s.value:s}has(e){const t=Oa(e);return"number"==typeof t&&te.comment?e.str:`- ${e.str}`,flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}}function Oa(e){let t=Mo(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}const La={collection:"seq",createNode:function(e,t,n){const{replacer:s}=n,r=new Na(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let i of t){if("function"==typeof s){const n=t instanceof Set?i:String(e++);i=s.call(t,n,i)}r.items.push(ea(i,void 0,n))}}return r},default:!0,nodeClass:Na,tag:"tag:yaml.org,2002:seq",resolve:(e,t)=>(Ro(e)||t("Expected a sequence for this tag"),e)},Ia={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(e,t,n,s)=>ma(e,t=Object.assign({actualString:!0},t),n,s)},Ca={identify:e=>null==e,createNode:()=>new Qo(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Qo(null),stringify:({source:e},t)=>e&&Ca.test.test(e)?e:t.options.nullStr},Ma={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Qo("t"===e[0]||"T"===e[0]),stringify({source:e,value:t},n){if(e&&Ma.test.test(e)){if(t===("t"===e[0]||"T"===e[0]))return e}return t?n.options.trueStr:n.options.falseStr}};function Ra({format:e,minFractionDigits:t,tag:n,value:s}){if("bigint"==typeof s)return String(s);const r="number"==typeof s?s:Number(s);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let i=JSON.stringify(s);if(!e&&t&&(!n||"tag:yaml.org,2002:float"===n)&&/^\d/.test(i)){let e=i.indexOf(".");e<0&&(e=i.length,i+=".");let n=t-(i.length-e-1);for(;n-- >0;)i+="0"}return i}const Pa={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN))$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ra},qa={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify:({value:e})=>Number(e).toExponential()},Da={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new Qo(parseFloat(e)),n=e.indexOf(".");return-1!==n&&"0"===e[e.length-1]&&(t.minFractionDigits=e.length-n-1),t},stringify:Ra},za=e=>"bigint"==typeof e||Number.isInteger(e),Ua=(e,t,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),n);function ja(e,t,n){const{value:s}=e;return za(s)&&s>=0?n+s.toString(t):Ra(e)}const Fa={identify:e=>za(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Ua(e,2,8,n),stringify:e=>ja(e,8,"0o")},Ba={identify:za,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Ua(e,0,10,n),stringify:Ra},Ga={identify:e=>za(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Ua(e,2,16,n),stringify:e=>ja(e,16,"0x")},Ka=[$a,La,Ia,Ca,Ma,Fa,Ba,Ga,Pa,qa,Da];function Va(e){return"bigint"==typeof e||Number.isInteger(e)}const Ha=({value:e})=>JSON.stringify(e),Ya=[$a,La].concat([{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Ha},{identify:e=>null==e,createNode:()=>new Qo(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ha},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:e=>"true"===e,stringify:Ha},{identify:Va,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Va(e)?e.toString():JSON.stringify(e)},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Ha}],{default:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)}),Xa={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if("function"==typeof Buffer)return Buffer.from(e,"base64");if("function"==typeof atob){const t=atob(e.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let e=0;e1&&t("Each pair must have its own sequence indicator");const e=s.items[0]||new xa(new Qo(null));if(s.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${s.commentBefore}\n${e.key.commentBefore}`:s.commentBefore),s.comment){const t=e.value||e.key;t.comment=t.comment?`${s.comment}\n${t.comment}`:s.comment}s=e}e.items[n]=Co(s)?s:new xa(s)}}else t("Expected a sequence for this tag");return e}function Ja(e,t,n){const{replacer:s}=n,r=new Na(e);r.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let e of t){let o,a;if("function"==typeof s&&(e=s.call(t,String(i++),e)),Array.isArray(e)){if(2!==e.length)throw new TypeError(`Expected [key, value] tuple: ${e}`);o=e[0],a=e[1]}else if(e&&e instanceof Object){const t=Object.keys(e);if(1!==t.length)throw new TypeError(`Expected { key: value } tuple: ${e}`);o=t[0],a=e[o]}else o=e;r.items.push(Ea(o,a,n))}return r}const Za={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Wa,createNode:Ja};class Qa extends Na{constructor(){super(),this.add=Aa.prototype.add.bind(this),this.delete=Aa.prototype.delete.bind(this),this.get=Aa.prototype.get.bind(this),this.has=Aa.prototype.has.bind(this),this.set=Aa.prototype.set.bind(this),this.tag=Qa.tag}toJSON(e,t){if(!t)return super.toJSON(e);const n=new Map;t&&t.onCreate&&t.onCreate(n);for(const e of this.items){let s,r;if(Co(e)?(s=Jo(e.key,"",t),r=Jo(e.value,s,t)):s=Jo(e,"",t),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,r)}return n}}Qa.tag="tag:yaml.org,2002:omap";const el={collection:"seq",identify:e=>e instanceof Map,nodeClass:Qa,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=Wa(e,t),s=[];for(const{key:e}of n.items)Mo(e)&&(s.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):s.push(e.value));return Object.assign(new Qa,n)},createNode(e,t,n){const s=Ja(e,t,n),r=new Qa;return r.items=s.items,r}};function tl({value:e,source:t},n){return t&&(e?nl:sl).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const nl={identify:e=>!0===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Qo(!0),stringify:tl},sl={identify:e=>!1===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>new Qo(!1),stringify:tl},rl={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ra},il={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify:({value:e})=>Number(e).toExponential()},ol={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new Qo(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(-1!==n){const s=e.substring(n+1).replace(/_/g,"");"0"===s[s.length-1]&&(t.minFractionDigits=s.length)}return t},stringify:Ra},al=e=>"bigint"==typeof e||Number.isInteger(e);function ll(e,t,n,{intAsBigInt:s}){const r=e[0];if("-"!==r&&"+"!==r||(t+=1),e=e.substring(t).replace(/_/g,""),s){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}const t=BigInt(e);return"-"===r?BigInt(-1)*t:t}const i=parseInt(e,n);return"-"===r?-1*i:i}function cl(e,t,n){const{value:s}=e;if(al(s)){const e=s.toString(t);return s<0?"-"+n+e.substr(1):n+e}return Ra(e)}const ul={identify:al,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>ll(e,2,2,n),stringify:e=>cl(e,2,"0b")},hl={identify:al,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>ll(e,1,8,n),stringify:e=>cl(e,8,"0")},fl={identify:al,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>ll(e,0,10,n),stringify:Ra},pl={identify:al,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>ll(e,2,16,n),stringify:e=>cl(e,16,"0x")};class dl extends Aa{constructor(e){super(e),this.tag=dl.tag}add(e){let t;t=Co(e)?e:"object"==typeof e&&"key"in e&&"value"in e&&null===e.value?new xa(e.key,null):new xa(e,null);Ta(this.items,t.key)||this.items.push(t)}get(e,t){const n=Ta(this.items,e);return!t&&Co(n)?Mo(n.key)?n.key.value:n.key:n}set(e,t){if("boolean"!=typeof t)throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof t);const n=Ta(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new xa(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}}dl.tag="tag:yaml.org,2002:set";const ml={collection:"map",identify:e=>e instanceof Set,nodeClass:dl,default:!1,tag:"tag:yaml.org,2002:set",resolve(e,t){if(Io(e)){if(e.hasAllNullValues(!0))return Object.assign(new dl,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e},createNode(e,t,n){const{replacer:s}=n,r=new dl(e);if(t&&Symbol.iterator in Object(t))for(let e of t)"function"==typeof s&&(e=s.call(t,e,e)),r.items.push(Ea(e,null,n));return r}};function gl(e,t){const n=e[0],s="-"===n||"+"===n?e.substring(1):e,r=e=>t?BigInt(e):Number(e),i=s.replace(/_/g,"").split(":").reduce(((e,t)=>e*r(60)+r(t)),r(0));return"-"===n?r(-1)*i:i}function yl(e){let{value:t}=e,n=e=>e;if("bigint"==typeof t)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return Ra(e);let s="";t<0&&(s="-",t*=n(-1));const r=n(60),i=[t%r];return t<60?i.unshift(0):(t=(t-i[0])/r,i.unshift(t%r),t>=60&&(t=(t-i[0])/r,i.unshift(t))),s+i.map((e=>e<10?"0"+String(e):String(e))).join(":").replace(/000000\d*$/,"")}const bl={identify:e=>"bigint"==typeof e||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>gl(e,n),stringify:yl},vl={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>gl(e,!1),stringify:yl},wl={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(wl.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,s,r,i,o,a]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0;let c=Date.UTC(n,s-1,r,i||0,o||0,a||0,l);const u=t[8];if(u&&"Z"!==u){let e=gl(u,!1);Math.abs(e)<30&&(e*=60),c-=6e4*e}return new Date(c)},stringify:({value:e})=>e.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")},kl=[$a,La,Ia,Ca,nl,sl,ul,hl,fl,pl,rl,il,ol,Xa,el,Za,ml,bl,vl,wl],El={core:Ka,failsafe:[$a,La,Ia],json:Ya,yaml11:kl,"yaml-1.1":kl},xl={binary:Xa,bool:Ma,float:Da,floatExp:qa,floatNaN:Pa,floatTime:vl,int:Ba,intHex:Ga,intOct:Fa,intTime:bl,map:$a,null:Ca,omap:el,pairs:Za,seq:La,set:ml,timestamp:wl},_l={"tag:yaml.org,2002:binary":Xa,"tag:yaml.org,2002:omap":el,"tag:yaml.org,2002:pairs":Za,"tag:yaml.org,2002:set":ml,"tag:yaml.org,2002:timestamp":wl};const Sl=(e,t)=>e.keyt.key?1:0;class Tl{constructor({customTags:e,merge:t,resolveKnownTags:n,schema:s,sortMapEntries:r}){this.merge=!!t,this.name=s||"core",this.knownTags=n?_l:{},this.tags=function(e,t){let n=El[t];if(!n){const e=Object.keys(El).filter((e=>"yaml11"!==e)).map((e=>JSON.stringify(e))).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${e}`)}if(Array.isArray(e))for(const t of e)n=n.concat(t);else"function"==typeof e&&(n=e(n.slice()));return n.map((e=>{if("string"!=typeof e)return e;const t=xl[e];if(t)return t;const n=Object.keys(xl).map((e=>JSON.stringify(e))).join(", ");throw new Error(`Unknown custom tag "${e}"; use one of ${n}`)}))}(e,this.name),Object.defineProperty(this,So,{value:$a}),Object.defineProperty(this,Ao,{value:Ia}),Object.defineProperty(this,$o,{value:La}),this.sortMapEntries=!0===r?Sl:r||null}}function Al(e,t,n,s){if(s&&"object"==typeof s)if(Array.isArray(s))for(let t=0,n=s.length;t"number"==typeof e||e instanceof String||e instanceof Number,n=t.filter(e).map(String);n.length>0&&(t=t.concat(n)),s=t}else void 0===n&&t&&(n=t,t=void 0);const{anchorPrefix:r,flow:i,keepUndefined:o,onTagObj:a,tag:l}=n||{},{onAnchor:c,setAnchors:u,sourceObjects:h}=function(e,t){const n=[],s=new Map;let r=null;return{onAnchor(s){n.push(s),r||(r=Ho(e));const i=Yo(t,r);return r.add(i),i},setAnchors(){for(const e of n){const t=s.get(e);if("object"!=typeof t||!t.anchor||!Mo(t.node)&&!Po(t.node)){const t=new Error("Failed to resolve repeated object (this should not happen)");throw t.source=e,t}t.node.anchor=t.anchor}},sourceObjects:s}}(this,r||"a"),f=ea(e,l,{keepUndefined:null!=o&&o,onAnchor:c,onTagObj:a,replacer:s,schema:this.schema,sourceObjects:h});return i&&Po(f)&&(f.flow=!0),u(),f}createPair(e,t,n={}){const s=this.createNode(e,null,n),r=this.createNode(t,null,n);return new xa(s,r)}delete(e){return!!Nl(this.contents)&&this.contents.delete(e)}deleteIn(e){return na(e)?null!=this.contents&&(this.contents=null,!0):!!Nl(this.contents)&&this.contents.deleteIn(e)}get(e,t){return Po(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return na(e)?!t&&Mo(this.contents)?this.contents.value:this.contents:Po(this.contents)?this.contents.getIn(e,t):void 0}has(e){return!!Po(this.contents)&&this.contents.has(e)}hasIn(e){return na(e)?void 0!==this.contents:!!Po(this.contents)&&this.contents.hasIn(e)}set(e,t){null==this.contents?this.contents=ta(this.schema,[e],t):Nl(this.contents)&&this.contents.set(e,t)}setIn(e,t){na(e)?this.contents=t:null==this.contents?this.contents=ta(this.schema,Array.from(e),t):Nl(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t){let n;switch(String(e)){case"1.1":this.directives.yaml.version="1.1",n=Object.assign({merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"},t);break;case"1.2":this.directives.yaml.version="1.2",n=Object.assign({merge:!1,resolveKnownTags:!0,schema:"core"},t);break;default:{const t=JSON.stringify(e);throw new Error(`Expected '1.1' or '1.2' as version, but found: ${t}`)}}this.schema=new Tl(n)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:s,onAnchor:r,reviver:i}={}){const o={anchors:new Map,doc:this,keep:!e,mapAsMap:!0===n,mapKeyWarned:!1,maxAliasCount:"number"==typeof s?s:100,stringify:ya},a=Jo(this.contents,t||"",o);if("function"==typeof r)for(const{count:e,res:t}of o.anchors.values())r(t,e);return"function"==typeof i?Al(i,{"":a},"",a):a}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return function(e,t){const n=[];let s=!0===t.directives;if(!1!==t.directives){const t=e.directives.toString(e);t?(n.push(t),s=!0):e.directives.marker&&(s=!0)}s&&n.push("---"),e.commentBefore&&(1!==n.length&&n.unshift(""),n.unshift(e.commentBefore.replace(/^/gm,"#")));const r=ga(e,t);let i=!1,o=null;if(e.contents){qo(e.contents)&&(e.contents.spaceBefore&&s&&n.push(""),e.contents.commentBefore&&n.push(e.contents.commentBefore.replace(/^/gm,"#")),r.forceBlockIndent=!!e.comment,o=e.contents.comment);const t=o?void 0:()=>i=!0;let a=ya(e.contents,r,(()=>o=null),t);o&&(a=ra(a,"",o)),"|"!==a[0]&&">"!==a[0]||"---"!==n[n.length-1]?n.push(a):n[n.length-1]=`--- ${a}`}else n.push(ya(e.contents,r));return e.comment&&(i&&!o||""===n[n.length-1]||n.push(""),n.push(e.comment.replace(/^/gm,"#"))),n.join("\n")+"\n"}(this,e)}}function Nl(e){if(Po(e))return!0;throw new Error("Expected a YAML collection as document contents")}class Ol extends Error{constructor(e,t,n,s){super(),this.name=e,this.code=n,this.message=s,this.pos=t}}class Ll extends Ol{constructor(e,t,n){super("YAMLParseError",e,t,n)}}class Il extends Ol{constructor(e,t,n){super("YAMLWarning",e,t,n)}}const Cl=(e,t)=>n=>{if(-1===n.pos[0])return;n.linePos=n.pos.map((e=>t.linePos(e)));const{line:s,col:r}=n.linePos[0];n.message+=` at line ${s}, column ${r}`;let i=r-1,o=e.substring(t.lineStarts[s-1],t.lineStarts[s]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){const e=Math.min(i-39,o.length-79);o="…"+o.substring(e),i-=e-1}if(o.length>80&&(o=o.substring(0,79)+"…"),s>1&&/^ *$/.test(o.substring(0,i))){let n=e.substring(t.lineStarts[s-2],t.lineStarts[s-1]);n.length>80&&(n=n.substring(0,79)+"…\n"),o=n+o}if(/[^ ]/.test(o)){let e=1;const t=n.linePos[1];t&&t.line===s&&t.col>r&&(e=Math.min(t.col-r,80-i));const a=" ".repeat(i)+"^".repeat(e);n.message+=`:\n\n${o}\n${a}\n`}};function Ml(e,{ctx:t,flow:n,indicator:s,offset:r,onError:i,startOnNewline:o}){let a=!1,l=o,c=o,u="",h="",f=!1,p=null,d=null,m=null,g=null,y=null;for(const r of e)switch(r.type){case"space":!n&&l&&"doc-start"!==s&&"\t"===r.source[0]&&i(r,"TAB_AS_INDENT","Tabs are not allowed as indentation"),c=!0;break;case"comment":{t.options.strict&&!c&&i(r,"COMMENT_SPACE","Comments must be separated from other tokens by white space characters");const e=r.source.substring(1);u?u+=h+e:u=e,h="";break}case"newline":l&&!u&&(a=!0),l=!0,f=!0,c=!0,h+=r.source;break;case"anchor":p&&i(r,"MULTIPLE_ANCHORS","A node can have at most one anchor"),p=r,null===y&&(y=r.offset),l=!1,c=!1;break;case"tag":d&&i(r,"MULTIPLE_TAGS","A node can have at most one tag"),d=r,null===y&&(y=r.offset),l=!1,c=!1;break;case s:(p||d)&&i(r,"BAD_PROP_ORDER",`Anchors and tags must be after the ${r.source} indicator`),g=r,l=!1,c=!1;break;case"comma":if(n){m&&i(r,"UNEXPECTED_TOKEN",`Unexpected , in ${n}`),m=r,l=!1,c=!1;break}default:i(r,"UNEXPECTED_TOKEN",`Unexpected ${r.type} token`),l=!1,c=!1}const b=e[e.length-1],v=b?b.offset+b.source.length:r;return{comma:m,found:g,spaceBefore:a,comment:u,hasNewline:f,anchor:p,tag:d,end:v,start:null!=y?y:v}}function Rl(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes("\n"))return!0;if(e.end)for(const t of e.end)if("newline"===t.type)return!0;return!1;case"flow-collection":for(const t of e.items){for(const e of t.start)if("newline"===e.type)return!0;if(t.sep)for(const e of t.sep)if("newline"===e.type)return!0;if(Rl(t.key)||Rl(t.value))return!0}return!1;default:return!0}}const Pl="All mapping items must start at the same column";function ql(e,t,n,s){let r="";if(e){let i=!1,o="";for(const a of e){const{source:e,type:l}=a;switch(l){case"space":i=!0;break;case"comment":{n&&!i&&s(a,"COMMENT_SPACE","Comments must be separated from other tokens by white space characters");const t=e.substring(1);r?r+=o+t:r=t,o="";break}case"newline":r&&(o+=e),i=!0;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=e.length}}return{comment:r,offset:t}}const Dl="Block collections are not allowed within flow collections",zl=e=>e&&("block-map"===e.type||"block-seq"===e.type);function Ul(e,t,n,s,r){let i;switch(n.type){case"block-map":i=function({composeNode:e,composeEmptyNode:t},n,s,r){var i;const o=new Aa(n.schema);let a=s.offset;for(const{start:l,key:c,sep:u,value:h}of s.items){const f=Ml(l,{ctx:n,indicator:"explicit-key-ind",offset:a,onError:r,startOnNewline:!0}),p=!f.found;if(p){if(c&&("block-seq"===c.type?r(a,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in c&&c.indent!==s.indent&&r(a,"BAD_INDENT",Pl)),!f.anchor&&!f.tag&&!u){f.comment&&(o.comment?o.comment+="\n"+f.comment:o.comment=f.comment);continue}}else(null===(i=f.found)||void 0===i?void 0:i.indent)!==s.indent&&r(a,"BAD_INDENT",Pl);p&&Rl(c)&&r(c,"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line");const d=f.end,m=c?e(n,c,f,r):t(n,d,l,null,f,r),g=Ml(u||[],{ctx:n,indicator:"map-value-ind",offset:m.range[2],onError:r,startOnNewline:!c||"block-scalar"===c.type});if(a=g.end,g.found){p&&("block-map"!==(null==h?void 0:h.type)||g.hasNewline||r(a,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&f.start0){const e=ql(h,f,n.options.strict,r);e.comment&&(a.comment?a.comment+="\n"+e.comment:a.comment=e.comment),a.range=[s.offset,f,e.offset]}else a.range=[s.offset,f,f];return a}(e,t,n,r)}if(!s)return i;const o=t.directives.tagName(s.source,(e=>r(s,"TAG_RESOLVE_FAILED",e)));if(!o)return i;const a=i.constructor;if("!"===o||o===a.tagName)return i.tag=a.tagName,i;const l=Io(i)?"map":"seq";let c=t.schema.tags.find((e=>e.collection===l&&e.tag===o));if(!c){const e=t.schema.knownTags[o];if(!e||e.collection!==l)return r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),i.tag=o,i;t.schema.tags.push(Object.assign({},e,{default:!1})),c=e}const u=c.resolve(i,(e=>r(s,"TAG_RESOLVE_FAILED",e)),t.options),h=qo(u)?u:new Qo(u);return h.range=i.range,h.tag=o,(null==c?void 0:c.format)&&(h.format=c.format),h}function jl(e,t,n){const s=e.offset,r=function({offset:e,props:t},n,s){if("block-scalar-header"!==t[0].type)return s(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=t[0],i=r[0];let o=0,a="",l=-1;for(let t=1;t=0;--e){const t=o[e][1];if(""!==t&&"\r"!==t)break;a=e}if(!e.source||0===a){const t="+"===r.chomp?o.map((e=>e[0])).join("\n"):"";let n=s+r.length;return e.source&&(n+=e.source.length),{value:t,type:i,comment:r.comment,range:[s,n,n]}}let l=e.indent+r.indent,c=e.offset+r.length,u=0;for(let e=0;el&&(l=t.length),c+=t.length+s.length+1}let h="",f="",p=!1;for(let e=0;el||"\t"===s[0]?(" "===f?f="\n":p||"\n"!==f||(f="\n\n"),h+=f+t.slice(l)+s,f="\n",p=!0):""===s?"\n"===f?h+="\n":f="\n":(h+=f+s,f=" ",p=!1)}switch(r.chomp){case"-":break;case"+":for(let e=a;en(s+e,t,r);switch(r){case"scalar":a=Qo.PLAIN,l=function(e,t){let n="";switch(e[0]){case"\t":n="Plain value cannot start with a tab character";break;case"|":case">":n=`Plain value cannot start with block scalar indicator ${e[0]}`;break;case"@":case"`":n=`Plain value cannot start with reserved character ${e[0]}`}n&&t(0,"BAD_SCALAR_START",n);return Bl(e)}(i,c);break;case"single-quoted-scalar":a=Qo.QUOTE_SINGLE,l=function(e,t){"'"===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR","Missing closing 'quote");return Bl(e.slice(1,-1)).replace(/''/g,"'")}(i,c);break;case"double-quoted-scalar":a=Qo.QUOTE_DOUBLE,l=function(e,t){let n="";for(let s=1;st?e.slice(t,s+1):r)}else n+=r}'"'===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR",'Missing closing "quote');return n}(i,c);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[s,s+i.length,s+i.length]}}const u=s+i.length,h=ql(o,u,t,n);return{value:l,type:a,comment:h.comment,range:[s,u,h.offset]}}function Bl(e){let t,n;try{t=new RegExp("(.*?)(?s(n,"TAG_RESOLVE_FAILED",e))):null,c=n&&l?function(e,t,n,s,r){var i;if("!"===n)return e[Ao];const o=[];for(const t of e.tags)if(!t.collection&&t.tag===n){if(!t.default||!t.test)return t;o.push(t)}for(const e of o)if(null===(i=e.test)||void 0===i?void 0:i.test(t))return e;const a=e.knownTags[n];if(a&&!a.collection)return e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a;return r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,"tag:yaml.org,2002:str"!==n),e[Ao]}(e.schema,r,l,n,s):function(e,t,n){var s;if(n)for(const n of e.tags)if(n.default&&(null===(s=n.test)||void 0===s?void 0:s.test(t)))return n;return e[Ao]}(e.schema,r,"scalar"===t.type);let u;try{const i=c.resolve(r,(e=>s(n||t,"TAG_RESOLVE_FAILED",e)),e.options);u=Mo(i)?i:new Qo(i)}catch(e){s(n||t,"TAG_RESOLVE_FAILED",e.message),u=new Qo(r)}return u.range=a,u.source=r,i&&(u.type=i),l&&(u.tag=l),c.format&&(u.format=c.format),o&&(u.comment=o),u}function Yl(e,t,n){if(t){null===n&&(n=t.length);for(let s=n-1;s>=0;--s){let n=t[s];switch(n.type){case"space":case"comment":case"newline":e-=n.source.length;continue}for(n=t[++s];"space"===(null==n?void 0:n.type);)e+=n.source.length,n=t[++s];break}}return e}const Xl={composeNode:Wl,composeEmptyNode:Jl};function Wl(e,t,n,s){const{spaceBefore:r,comment:i,anchor:o,tag:a}=n;let l;switch(t.type){case"alias":l=function({options:e},{offset:t,source:n,end:s},r){const i=new Xo(n.substring(1)),o=t+n.length,a=ql(s,o,e.strict,r);i.range=[t,o,a.offset],a.comment&&(i.comment=a.comment);return i}(e,t,s),(o||a)&&s(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=Hl(e,t,a,s),o&&(l.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=Ul(Xl,e,t,a,s),o&&(l.anchor=o.source.substring(1));break;default:throw console.log(t),new Error(`Unsupporten token type: ${t.type}`)}return r&&(l.spaceBefore=!0),i&&("scalar"===t.type&&""===t.source?l.comment=i:l.commentBefore=i),l}function Jl(e,t,n,s,{spaceBefore:r,comment:i,anchor:o,tag:a},l){const c=Hl(e,{type:"scalar",offset:Yl(t,n,s),indent:-1,source:""},a,l);return o&&(c.anchor=o.source.substring(1)),r&&(c.spaceBefore=!0),i&&(c.comment=i),c}function Zl(e){if("number"==typeof e)return[e,e+1];if(Array.isArray(e))return 2===e.length?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+("string"==typeof n?n.length:1)]}function Ql(e){let t="",n=!1,s=!1;for(let r=0;r{const r=Zl(e);s?this.warnings.push(new Il(r,t,n)):this.errors.push(new Ll(r,t,n))},this.directives=new Ko({version:e.version||_a.version}),this.options=e}decorate(e,t){const{comment:n,afterEmptyLine:s}=Ql(this.prelude);if(n){const r=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(s||e.directives.marker||!r)e.commentBefore=n;else if(Po(r)&&!r.flow&&r.items.length>0){let e=r.items[0];Co(e)&&(e=e.key);const t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{const e=r.commentBefore;r.commentBefore=e?`${n}\n${e}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Ql(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(const t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,((t,n,s)=>{const r=Zl(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",n,s)})),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=function(e,t,{offset:n,start:s,value:r,end:i},o){const a=Object.assign({directives:t},e),l=new $l(void 0,a),c={directives:l.directives,options:l.options,schema:l.schema},u=Ml(s,{ctx:c,indicator:"doc-start",offset:n,onError:o,startOnNewline:!0});u.found&&(l.directives.marker=!0,!r||"block-map"!==r.type&&"block-seq"!==r.type||u.hasNewline||o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=r?Wl(c,r,u,o):Jl(c,u.end,s,null,u,o);const h=l.contents.range[2],f=ql(i,h,!1,o);return f.comment&&(l.comment=f.comment),l.range=[n,h,f.offset],l}(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.marker&&this.onError(e,"MISSING_CHAR","Missing directives-end indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Ll(Zl(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const t="Unexpected doc-end without preceding document";this.errors.push(new Ll(Zl(e),"UNEXPECTED_TOKEN",t));break}const t=ql(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Ll(Zl(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const e=Object.assign({directives:this.directives},this.options),n=new $l(void 0,e);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,t,t],this.decorate(n,!1),yield n}}}function tc(e){switch(e){case void 0:case" ":case"\n":case"\r":case"\t":return!0;default:return!1}}const nc=[",","[","]","{","}"],sc=[" ",",","[","]","{","}","\n","\r","\t"],rc=e=>!e||sc.includes(e);class ic{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.next=null,this.pos=0}*lex(e,t=!1){e&&(this.buffer=this.buffer?this.buffer+e:e),this.atEnd=!t;let n=this.next||"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;" "===t||"\t"===t;)t=this.buffer[++e];return!t||"#"===t||"\n"===t||"\r"===t&&"\n"===this.buffer[e+1]}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;" "===t;)t=this.buffer[++n+e];if("\r"===t){const t=this.buffer[n+e+1];if("\n"===t||!t&&!this.atEnd)return e+n+1}return"\n"===t||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if("-"===t||"."===t){const t=this.buffer.substr(e,3);if(("---"===t||"..."===t)&&tc(this.buffer[e+3]))return-1}return e}getLine(){let e=this.buffer.indexOf("\n",this.pos);return-1===e?this.atEnd?this.buffer.substring(this.pos):null:("\r"===this.buffer[e-1]&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(null===e)return this.setNext("stream");if("\ufeff"===e[0]&&(yield*this.pushCount(1),e=e.substring(1)),"%"===e[0]){let t=e.length;const n=e.indexOf("#");if(-1!==n){const s=e[n-1];" "!==s&&"\t"!==s||(t=n-1)}for(;;){const n=e[t-1];if(" "!==n&&"\t"!==n)break;t-=1}const s=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-s),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield"",yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if("-"===e||"."===e){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const e=this.peek(3);if("---"===e&&tc(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,"doc";if("..."===e&&tc(this.charAt(3)))return yield*this.pushCount(3),"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!tc(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if(("-"===e||"?"===e||":"===e)&&tc(t)){const e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(null===e)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(rc),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=(yield*this.parseBlockScalarHeader()),t+=(yield*this.pushSpaces(!0)),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do{e=yield*this.pushNewline(),t=yield*this.pushSpaces(!0),e>0&&(this.indentValue=n=t)}while(e+t>0);const s=this.getLine();if(null===s)return this.setNext("flow");if(-1!==n&&n"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if("-"!==t)break}return yield*this.pushUntil((e=>tc(e)||"#"===e))}*parseBlockScalar(){let e,t=this.pos-1,n=0;e:for(let s=this.pos;e=this.buffer[s];++s)switch(e){case" ":n+=1;break;case"\n":t=s,n=0;break;case"\r":{const e=this.buffer[s+1];if(!e&&!this.atEnd)return this.setNext("block-scalar");if("\n"===e)break}default:break e}if(!e&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=n:this.indentNext+=this.blockScalarIndent;do{const e=this.continueScalar(t+1);if(-1===e)break;t=this.buffer.indexOf("\n",e)}while(-1!==t);if(-1===t){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}if(!this.blockScalarKeep)for(;;){let e=t-1,n=this.buffer[e];for("\r"===n&&(n=this.buffer[--e]);" "===n||"\t"===n;)n=this.buffer[--e];if(!("\n"===n&&e>=this.pos))break;t=e}return yield"",yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t,n=this.pos-1,s=this.pos-1;for(;t=this.buffer[++s];)if(":"===t){const t=this.buffer[s+1];if(tc(t)||e&&","===t)break;n=s}else if(tc(t)){const r=this.buffer[s+1];if("#"===r||e&&nc.includes(r))break;if("\r"===t&&("\n"===r?(s+=1,t="\n"):n=s),"\n"===t){const e=this.continueScalar(s+1);if(-1===e)break;s=Math.max(s,e-2)}}else{if(e&&nc.includes(t))break;n=s}return t||this.atEnd?(yield"",yield*this.pushToIndex(n+1,!0),e?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":if("<"===this.charAt(1))return(yield*this.pushVerbatimTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(rc))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case":":case"?":case"-":if(tc(this.charAt(1)))return 0===this.flowLevel&&(this.indentNext=this.indentValue+1),(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}return 0}*pushVerbatimTag(){let e=this.pos+2,t=this.buffer[e];for(;!tc(t)&&">"!==t;)t=this.buffer[++e];return yield*this.pushToIndex(">"===t?e+1:e,!1)}*pushNewline(){const e=this.buffer[this.pos];return"\n"===e?yield*this.pushCount(1):"\r"===e&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(e){let t,n=this.pos-1;do{t=this.buffer[++n]}while(" "===t||e&&"\t"===t);const s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}class oc{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t>1;this.lineStarts[s]=0;--t)switch(e[t].type){case"space":break;case"newline":return!0;default:return!1}return!1}function uc(e){switch(null==e?void 0:e.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function hc(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep||t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function fc(e){var t;if(0===e.length)return[];let n=e.length;e:for(;--n>=0;)switch(e[n].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;"space"===(null===(t=e[++n])||void 0===t?void 0:t.type););return e.splice(n,e.length)}function pc(e){if("flow-seq-start"===e.start.type)for(const t of e.items)!t.sep||t.value||ac(t.start,"explicit-key-ind")||ac(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,uc(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}class dc{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new ic,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&0===this.offset&&this.onNewLine(0);for(const n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar)return this.atScalar=!1,yield*this.step(),void(this.offset+=e.length);const t=function(e){switch(e){case"\ufeff":return"byte-order-mark";case"":return"doc-mode";case"":return"flow-error-end";case"":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}(e);if(t)if("scalar"===t)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&" "===e[0]&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":return;default:this.atNewLine=!1}this.offset+=e.length}else{const t=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:t,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if("doc-end"!==this.type||e&&"doc-end"===e.type){if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}else{for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source})}}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e||this.stack.pop();if(t)if(0===this.stack.length)yield t;else{const e=this.peek(1);switch("block-scalar"!==t.type&&"flow-collection"!==t.type||(t.indent="indent"in e?e.indent:-1),"flow-collection"===t.type&&pc(t),e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{const n=e.items[e.items.length-1];if(n.value)return e.items.push({start:[],key:t,sep:[]}),void(this.onKeyLine=!0);if(!n.sep)return Object.assign(n,{key:t,sep:[]}),void(this.onKeyLine=!ac(n.start,"explicit-key-ind"));n.value=t;break}case"block-seq":{const n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case"flow-collection":{const n=e.items[e.items.length-1];return void(!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]}))}default:yield*this.pop(),yield*this.pop(t)}if(!("document"!==e.type&&"block-map"!==e.type&&"block-seq"!==e.type||"block-map"!==t.type&&"block-seq"!==t.type)){const n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&!lc(n.start)&&(0===t.indent||n.start.every((e=>"comment"!==e.type||e.indent=e.indent){const t=!this.onKeyLine&&this.indent===e.indent&&(n.sep||lc(n.start));switch(this.type){case"anchor":case"tag":return void(t||n.value?(e.items.push({start:[this.sourceToken]}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken));case"explicit-key-ind":return n.sep||ac(n.start,"explicit-key-ind")?t||n.value?e.items.push({start:[this.sourceToken]}):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]}):n.start.push(this.sourceToken),void(this.onKeyLine=!0);case"map-value-ind":if(n.sep)if(n.value||t&&!ac(n.start,"explicit-key-ind"))e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ac(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else if(ac(n.start,"explicit-key-ind")&&uc(n.key)&&!ac(n.sep,"newline")){const e=fc(n.start),t=n.key,s=n.sep;s.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:t,sep:s}]})}else n.sep.push(this.sourceToken);else Object.assign(n,{key:null,sep:[this.sourceToken]});return void(this.onKeyLine=!0);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);return void(t||n.value?(e.items.push({start:[],key:s,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(s):(Object.assign(n,{key:s,sep:[]}),this.onKeyLine=!0))}default:{const s=this.startBlockValue(e);if(s)return t&&"block-seq"!==s.type&&ac(n.start,"explicit-key-ind")&&e.items.push({start:[]}),void this.stack.push(s)}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var t;const n=e.items[e.items.length-1];switch(this.type){case"newline":if(!n.value&&cc(n.start)){const s=e.items[e.items.length-2],r=null===(t=null==s?void 0:s.value)||void 0===t?void 0:t.end;if(Array.isArray(r))return Array.prototype.push.apply(r,n.start),void(n.start=[this.sourceToken])}case"space":case"comment":return void(n.value?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken));case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;return void n.start.push(this.sourceToken);case"seq-item-ind":if(this.indent!==e.indent)break;return void(n.value||ac(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken))}if(this.indent>e.indent){const t=this.startBlockValue(e);if(t)return void this.stack.push(t)}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if("flow-error-end"===this.type){let e;do{yield*this.pop(),e=this.peek(1)}while(e&&"flow-collection"===e.type)}else if(0===e.end.length){switch(this.type){case"comma":case"explicit-key-ind":return void(!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken));case"map-value-ind":return void(!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]}));case"space":case"comment":case"newline":case"anchor":case"tag":return void(!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken));case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]}))}case"flow-map-end":case"flow-seq-end":return void e.end.push(this.sourceToken)}const n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{const t=this.peek(2);if("block-map"!==t.type||"map-value-ind"!==this.type&&("newline"!==this.type||t.items[t.items.length-1].sep))if("map-value-ind"===this.type&&"flow-collection"!==t.type){const n=fc(hc(t));pc(e);const s=e.end.splice(1,e.end.length);s.push(this.sourceToken);const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e);else yield*this.pop(),yield*this.step()}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=fc(hc(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t}]}}case"map-value-ind":{this.onKeyLine=!0;const t=fc(hc(e));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}*documentEnd(e){"doc-mode"!==this.type&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}}function mc(e,t={}){const{lineCounter:n,prettyErrors:s}=function(e){const t=!e||!1!==e.prettyErrors;return{lineCounter:e&&e.lineCounter||t&&new oc||null,prettyErrors:t}}(t),r=new dc(null==n?void 0:n.addNewLine),i=new ec(t);let o=null;for(const t of i.compose(r.parse(e),!0,e.length))if(o){if("silent"!==o.options.logLevel){o.errors.push(new Ll(t.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else o=t;return s&&n&&(o.errors.forEach(Cl(e,n)),o.warnings.forEach(Cl(e,n))),o}function gc(e,t,n){let s;"function"==typeof t?s=t:void 0===n&&t&&"object"==typeof t&&(n=t);const r=mc(e,n);if(!r)return null;if(r.warnings.forEach((e=>ba(r.options.logLevel,e))),r.errors.length>0){if("silent"!==r.options.logLevel)throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:s},n))}const yc={hr(e){const t=RegExp(/^ {0,3}(-{3,}(?=[^-\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~-]* *(?:\n+|$)|$)/).exec(e);if(t)return{type:"options",raw:t[0],data:gc(t[3],{})}}},bc={paragraph:e=>e,blockquote:e=>e,heading:e=>e};function vc(e){return Jr.sanitize(Eo.parser(e))}function wc(e,t){let n=Eo.lexer((e=>{const t=Zr(e);if(0===t)return e;const n=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(n,"")})(e).replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&"));let s,r=[],i="",o="",a="",l=!0,c=new ci(t);return n.forEach((function(e,t){if("heading"==e.type&&(o="",a="",i=vc([e]),s=new ci(c),l=!1),"options"==e.type&&(l?c=ui(c,e.data):s=ui(c,e.data)),"paragraph"!=e.type&&"code"!=e.type||(o+=vc([e])),"blockquote"==e.type&&(a+=vc([e])),"list"==e.type){let t=[];e.items.forEach((function(e,n){let s=function(e){let t="",n="";return e.tokens.forEach((function(e,s){"blockquote"==e.type?n+=vc([e]):t+=vc([e])})),{text:t,comment:n}}(e);t.push(new ii(n,s.text,e.checked,s.comment))})),e.ordered?e.items[0].task?r.push(new ri(i,o,a,t,s)):r.push(new ti(i,o,a,t,s)):r.push(new si(i,o,a,t,s))}})),new ai(r,c)}function kc(e,t,n){let s;t.innerHTML="",t.shadowRoot?(s=t.shadowRoot,s.innerHTML=""):s=t.attachShadow({mode:"open"});try{let t=wc(e,n);new nr({target:s,intro:!1,props:{quiz:t}})}catch(e){s.innerHTML=`${e}. App could not render. Please check your quizdown syntax.`}}return Eo.use({renderer:bc,tokenizer:yc}),{init:function(e={}){let t=new ci(e);t.start_on_load&&"undefined"!=typeof document&&window.addEventListener("load",(function(){let e=document.querySelectorAll(".quizdown");for(let n of e)kc(n.innerHTML,n,t)}),!1)},register:function(e){return e.setup(this),this},create_app:kc,get_marked_parser:function(){return Eo}}}));