diff --git a/package-lock.json b/package-lock.json index 56be6c7..9ed4d38 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "quizdown", - "version": "0.3.0", + "version": "0.3.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "quizdown", - "version": "0.3.0", + "version": "0.3.1", "license": "MIT", "dependencies": { "auto-bind": "^4.0.0", diff --git a/package.json b/package.json index aa6a97f..2c63457 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "quizdown", - "version": "0.3.0", + "version": "0.3.1", "description": "Markdown for generating interactive quiz apps in the browser.", "private": false, "type": "module", diff --git a/public/build/extensions/quizdownHighlight.js b/public/build/extensions/quizdownHighlight.js index dca8959..d911267 100644 --- a/public/build/extensions/quizdownHighlight.js +++ b/public/build/extensions/quizdownHighlight.js @@ -1 +1 @@ -!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).quizdownHighlight=n()}(this,(function(){"use strict";var e={exports:{}};function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((function(t){var i=e[t];"object"!=typeof i||Object.isFrozen(i)||n(i)})),e}e.exports=n,e.exports.default=n;var t=e.exports;class i{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function s(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function r(e,...n){const t=Object.create(null);for(const n in e)t[n]=e[n];return n.forEach((function(e){for(const n in e)t[n]=e[n]})),t}const a=e=>!!e.kind;class o{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=s(e)}openNode(e){if(!a(e))return;let n=e.kind;n=e.sublanguage?`language-${n}`:((e,{prefix:n})=>{if(e.includes(".")){const t=e.split(".");return[`${n}${t.shift()}`,...t.map(((e,n)=>`${e}${"_".repeat(n+1)}`))].join(" ")}return`${n}${e}`})(n,{prefix:this.classPrefix}),this.span(n)}closeNode(e){a(e)&&(this.buffer+="")}value(){return this.buffer}span(e){this.buffer+=``}}class c{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n={kind:e,children:[]};this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n),n.children.forEach((n=>this._walk(e,n))),e.closeNode(n)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{c._collapse(e)})))}}class l extends c{constructor(e){super(),this.options=e}addKeyword(e,n){""!==e&&(this.openNode(n),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,n){const t=e.root;t.kind=n,t.sublanguage=!0,this.add(t)}toHTML(){return new o(this,this.options).value()}finalize(){return!0}}function g(e){return e?"string"==typeof e?e:e.source:null}function u(...e){return e.map((e=>g(e))).join("")}function d(...e){return"("+(function(e){const n=e[e.length-1];return"object"==typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{}}(e).capture?"":"?:")+e.map((e=>g(e))).join("|")+")"}function h(e){return new RegExp(e.toString()+"|").exec("").length-1}const f=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function b(e,{joinWith:n}){let t=0;return e.map((e=>{t+=1;const n=t;let i=g(e),s="";for(;i.length>0;){const e=f.exec(i);if(!e){s+=i;break}s+=i.substring(0,e.index),i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?s+="\\"+String(Number(e[1])+n):(s+=e[0],"("===e[0]&&t++)}return s})).map((e=>`(${e})`)).join(n)}const p="[a-zA-Z]\\w*",m="[a-zA-Z_]\\w*",E="\\b\\d+(\\.\\d+)?",y="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",_="\\b(0b[01]+)",x={begin:"\\\\[\\s\\S]",relevance:0},w={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[x]},v={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[x]},N=function(e,n,t={}){const i=r({scope:"comment",begin:e,end:n,contains:[]},t);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const s=d("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:u(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},A=N("//","$"),S=N("/\\*","\\*/"),O=N("#","$"),R={scope:"number",begin:E,relevance:0},k={scope:"number",begin:y,relevance:0},M={scope:"number",begin:_,relevance:0},j={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[x,{begin:/\[/,end:/\]/,relevance:0,contains:[x]}]}]},B={scope:"title",begin:p,relevance:0},I={scope:"title",begin:m,relevance:0},T={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var L=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:p,UNDERSCORE_IDENT_RE:m,NUMBER_RE:E,C_NUMBER_RE:y,BINARY_NUMBER_RE:_,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const n=/^#![ ]*\//;return e.binary&&(e.begin=u(n,/.*\b/,e.binary,/\b.*/)),r({scope:"meta",begin:n,end:/$/,relevance:0,"on:begin":(e,n)=>{0!==e.index&&n.ignoreMatch()}},e)},BACKSLASH_ESCAPE:x,APOS_STRING_MODE:w,QUOTE_STRING_MODE:v,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},COMMENT:N,C_LINE_COMMENT_MODE:A,C_BLOCK_COMMENT_MODE:S,HASH_COMMENT_MODE:O,NUMBER_MODE:R,C_NUMBER_MODE:k,BINARY_NUMBER_MODE:M,REGEXP_MODE:j,TITLE_MODE:B,UNDERSCORE_TITLE_MODE:I,METHOD_GUARD:T,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})}});function C(e,n){"."===e.input[e.index-1]&&n.ignoreMatch()}function P(e,n){void 0!==e.className&&(e.scope=e.className,delete e.className)}function D(e,n){n&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=C,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function $(e,n){Array.isArray(e.illegal)&&(e.illegal=d(...e.illegal))}function H(e,n){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function z(e,n){void 0===e.relevance&&(e.relevance=1)}const U=(e,n)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const t=Object.assign({},e);Object.keys(e).forEach((n=>{delete e[n]})),e.keywords=t.keywords,e.begin=u(t.beforeMatch,u("(?=",t.begin,")")),e.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},e.relevance=0,delete t.beforeMatch},F=["of","and","for","in","not","or","if","then","parent","list","value"];function K(e,n,t="keyword"){const i=Object.create(null);return"string"==typeof e?s(t,e.split(" ")):Array.isArray(e)?s(t,e):Object.keys(e).forEach((function(t){Object.assign(i,K(e[t],n,t))})),i;function s(e,t){n&&(t=t.map((e=>e.toLowerCase()))),t.forEach((function(n){const t=n.split("|");i[t[0]]=[e,X(t[0],t[1])]}))}}function X(e,n){return n?Number(n):function(e){return F.includes(e.toLowerCase())}(e)?0:1}const Z={},G=e=>{console.error(e)},W=(e,...n)=>{console.log(`WARN: ${e}`,...n)},J=(e,n)=>{Z[`${e}/${n}`]||(console.log(`Deprecated as of ${e}. ${n}`),Z[`${e}/${n}`]=!0)},q=new Error;function V(e,n,{key:t}){let i=0;const s=e[t],r={},a={};for(let e=1;e<=n.length;e++)a[e+i]=s[e],r[e+i]=!0,i+=h(n[e-1]);e[t]=a,e[t]._emit=r,e[t]._multi=!0}function Q(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw G("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),q;if("object"!=typeof e.beginScope||null===e.beginScope)throw G("beginScope must be object"),q;V(e,e.begin,{key:"beginScope"}),e.begin=b(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw G("skip, excludeEnd, returnEnd not compatible with endScope: {}"),q;if("object"!=typeof e.endScope||null===e.endScope)throw G("endScope must be object"),q;V(e,e.end,{key:"endScope"}),e.end=b(e.end,{joinWith:""})}}(e)}function Y(e){function n(n,t){return new RegExp(g(n),"m"+(e.case_insensitive?"i":"")+(t?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,n){n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]),this.matchAt+=h(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=n(b(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const n=this.matcherRe.exec(e);if(!n)return null;const t=n.findIndex(((e,n)=>n>0&&void 0!==e)),i=this.matchIndexes[t];return n.splice(0,t),Object.assign(n,i)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const n=new t;return this.rules.slice(e).forEach((([e,t])=>n.addRule(e,t))),n.compile(),this.multiRegexes[e]=n,n}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,n){this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex;let t=n.exec(e);if(this.resumingScanAtSamePosition())if(t&&t.index===this.lastIndex);else{const n=this.getMatcher(0);n.lastIndex=this.lastIndex+1,t=n.exec(e)}return t&&(this.regexIndex+=t.position+1,this.regexIndex===this.count&&this.considerAll()),t}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=r(e.classNameAliases||{}),function t(s,a){const o=s;if(s.isCompiled)return o;[P,H,Q,U].forEach((e=>e(s,a))),e.compilerExtensions.forEach((e=>e(s,a))),s.__beforeBegin=null,[D,$,z].forEach((e=>e(s,a))),s.isCompiled=!0;let c=null;return"object"==typeof s.keywords&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),c=s.keywords.$pattern,delete s.keywords.$pattern),c=c||/\w+/,s.keywords&&(s.keywords=K(s.keywords,e.case_insensitive)),o.keywordPatternRe=n(c,!0),a&&(s.begin||(s.begin=/\B|\b/),o.beginRe=n(s.begin),s.end||s.endsWithParent||(s.end=/\B|\b/),s.end&&(o.endRe=n(s.end)),o.terminatorEnd=g(s.end)||"",s.endsWithParent&&a.terminatorEnd&&(o.terminatorEnd+=(s.end?"|":"")+a.terminatorEnd)),s.illegal&&(o.illegalRe=n(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(n){return r(e,{variants:null},n)})));if(e.cachedVariants)return e.cachedVariants;if(ee(e))return r(e,{starts:e.starts?r(e.starts):null});if(Object.isFrozen(e))return r(e);return e}("self"===e?s:e)}))),s.contains.forEach((function(e){t(e,o)})),s.starts&&t(s.starts,a),o.matcher=function(e){const n=new i;return e.contains.forEach((e=>n.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&n.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n}(o),o}(e)}function ee(e){return!!e&&(e.endsWithParent||ee(e.starts))}const ne=s,te=r,ie=Symbol("nomatch");var se=function(e){const n=Object.create(null),s=Object.create(null),r=[];let a=!0;const o="Could not find the language '{}', did you forget to load/include a language module?",c={disableAutodetect:!0,name:"Plain text",contains:[]};let g={ignoreUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:l};function u(e){return g.noHighlightRe.test(e)}function d(e,n,t,i){let s="",r="";"object"==typeof n?(s=e,t=n.ignoreIllegals,r=n.language,i=void 0):(J("10.7.0","highlight(lang, code, ...args) has been deprecated."),J("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),r=e,s=n),void 0===t&&(t=!0);const a={code:s,language:r};x("before:highlight",a);const o=a.result?a.result:h(a.language,a.code,t,i);return o.code=a.code,x("after:highlight",o),o}function h(e,t,s,r){const c=Object.create(null);function l(){if(!A.keywords)return void O.addText(R);let e=0;A.keywordPatternRe.lastIndex=0;let n=A.keywordPatternRe.exec(R),t="";for(;n;){t+=R.substring(e,n.index);const s=w.case_insensitive?n[0].toLowerCase():n[0],r=(i=s,A.keywords[i]);if(r){const[e,i]=r;if(O.addText(t),t="",c[s]=(c[s]||0)+1,c[s]<=7&&(k+=i),e.startsWith("_"))t+=n[0];else{const t=w.classNameAliases[e]||e;O.addKeyword(n[0],t)}}else t+=n[0];e=A.keywordPatternRe.lastIndex,n=A.keywordPatternRe.exec(R)}var i;t+=R.substr(e),O.addText(t)}function u(){null!=A.subLanguage?function(){if(""===R)return;let e=null;if("string"==typeof A.subLanguage){if(!n[A.subLanguage])return void O.addText(R);e=h(A.subLanguage,R,!0,S[A.subLanguage]),S[A.subLanguage]=e._top}else e=f(R,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(k+=e.relevance),O.addSublanguage(e._emitter,e.language)}():l(),R=""}function d(e,n){let t=1;for(;void 0!==n[t];){if(!e._emit[t]){t++;continue}const i=w.classNameAliases[e[t]]||e[t],s=n[t];i?O.addKeyword(s,i):(R=s,l(),R=""),t++}}function b(e,n){return e.scope&&"string"==typeof e.scope&&O.openNode(w.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(O.addKeyword(R,w.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),R=""):e.beginScope._multi&&(d(e.beginScope,n),R="")),A=Object.create(e,{parent:{value:A}}),A}function p(e,n,t){let s=function(e,n){const t=e&&e.exec(n);return t&&0===t.index}(e.endRe,t);if(s){if(e["on:end"]){const t=new i(e);e["on:end"](n,t),t.isMatchIgnored&&(s=!1)}if(s){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return p(e.parent,n,t)}function m(e){return 0===A.matcher.regexIndex?(R+=e[0],1):(B=!0,0)}function y(e){const n=e[0],i=t.substr(e.index),s=p(A,e,i);if(!s)return ie;const r=A;A.endScope&&A.endScope._wrap?(u(),O.addKeyword(n,A.endScope._wrap)):A.endScope&&A.endScope._multi?(u(),d(A.endScope,e)):r.skip?R+=n:(r.returnEnd||r.excludeEnd||(R+=n),u(),r.excludeEnd&&(R=n));do{A.scope&&!A.isMultiClass&&O.closeNode(),A.skip||A.subLanguage||(k+=A.relevance),A=A.parent}while(A!==s.parent);return s.starts&&b(s.starts,e),r.returnEnd?0:n.length}let _={};function x(n,r){const o=r&&r[0];if(R+=n,null==o)return u(),0;if("begin"===_.type&&"end"===r.type&&_.index===r.index&&""===o){if(R+=t.slice(r.index,r.index+1),!a){const n=new Error(`0 width match regex (${e})`);throw n.languageName=e,n.badRule=_.rule,n}return 1}if(_=r,"begin"===r.type)return function(e){const n=e[0],t=e.rule,s=new i(t),r=[t.__beforeBegin,t["on:begin"]];for(const t of r)if(t&&(t(e,s),s.isMatchIgnored))return m(n);return t.skip?R+=n:(t.excludeBegin&&(R+=n),u(),t.returnBegin||t.excludeBegin||(R=n)),b(t,e),t.returnBegin?0:n.length}(r);if("illegal"===r.type&&!s){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(A.scope||"")+'"');throw e.mode=A,e}if("end"===r.type){const e=y(r);if(e!==ie)return e}if("illegal"===r.type&&""===o)return 1;if(j>1e5&&j>3*r.index){throw new Error("potential infinite loop, way more iterations than matches")}return R+=o,o.length}const w=E(e);if(!w)throw G(o.replace("{}",e)),new Error('Unknown language: "'+e+'"');const v=Y(w);let N="",A=r||v;const S={},O=new g.__emitter(g);!function(){const e=[];for(let n=A;n!==w;n=n.parent)n.scope&&e.unshift(n.scope);e.forEach((e=>O.openNode(e)))}();let R="",k=0,M=0,j=0,B=!1;try{for(A.matcher.considerAll();;){j++,B?B=!1:A.matcher.considerAll(),A.matcher.lastIndex=M;const e=A.matcher.exec(t);if(!e)break;const n=x(t.substring(M,e.index),e);M=e.index+n}return x(t.substr(M)),O.closeAllNodes(),O.finalize(),N=O.toHTML(),{language:e,value:N,relevance:k,illegal:!1,_emitter:O,_top:A}}catch(n){if(n.message&&n.message.includes("Illegal"))return{language:e,value:ne(t),illegal:!0,relevance:0,_illegalBy:{message:n.message,index:M,context:t.slice(M-100,M+100),mode:n.mode,resultSoFar:N},_emitter:O};if(a)return{language:e,value:ne(t),illegal:!1,relevance:0,errorRaised:n,_emitter:O,_top:A};throw n}}function f(e,t){t=t||g.languages||Object.keys(n);const i=function(e){const n={value:ne(e),illegal:!1,relevance:0,_top:c,_emitter:new g.__emitter(g)};return n._emitter.addText(e),n}(e),s=t.filter(E).filter(_).map((n=>h(n,e,!1)));s.unshift(i);const r=s.sort(((e,n)=>{if(e.relevance!==n.relevance)return n.relevance-e.relevance;if(e.language&&n.language){if(E(e.language).supersetOf===n.language)return 1;if(E(n.language).supersetOf===e.language)return-1}return 0})),[a,o]=r,l=a;return l.secondBest=o,l}function b(e){let n=null;const t=function(e){let n=e.className+" ";n+=e.parentNode?e.parentNode.className:"";const t=g.languageDetectRe.exec(n);if(t){const n=E(t[1]);return n||(W(o.replace("{}",t[1])),W("Falling back to no-highlight mode for this block.",e)),n?t[1]:"no-highlight"}return n.split(/\s+/).find((e=>u(e)||E(e)))}(e);if(u(t))return;x("before:highlightElement",{el:e,language:t}),!g.ignoreUnescapedHTML&&e.children.length>0&&(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/issues/2886"),console.warn(e)),n=e;const i=n.textContent,r=t?d(i,{language:t,ignoreIllegals:!0}):f(i);e.innerHTML=r.value,function(e,n,t){const i=n&&s[n]||t;e.classList.add("hljs"),e.classList.add(`language-${i}`)}(e,t,r.language),e.result={language:r.language,re:r.relevance,relevance:r.relevance},r.secondBest&&(e.secondBest={language:r.secondBest.language,relevance:r.secondBest.relevance}),x("after:highlightElement",{el:e,result:r,text:i})}let p=!1;function m(){if("loading"===document.readyState)return void(p=!0);document.querySelectorAll(g.cssSelector).forEach(b)}function E(e){return e=(e||"").toLowerCase(),n[e]||n[s[e]]}function y(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach((e=>{s[e.toLowerCase()]=n}))}function _(e){const n=E(e);return n&&!n.disableAutodetect}function x(e,n){const t=e;r.forEach((function(e){e[t]&&e[t](n)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){p&&m()}),!1),Object.assign(e,{highlight:d,highlightAuto:f,highlightAll:m,highlightElement:b,highlightBlock:function(e){return J("10.7.0","highlightBlock will be removed entirely in v12.0"),J("10.7.0","Please use highlightElement now."),b(e)},configure:function(e){g=te(g,e)},initHighlighting:()=>{m(),J("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){m(),J("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(t,i){let s=null;try{s=i(e)}catch(e){if(G("Language definition for '{}' could not be registered.".replace("{}",t)),!a)throw e;G(e),s=c}s.name||(s.name=t),n[t]=s,s.rawDefinition=i.bind(null,e),s.aliases&&y(s.aliases,{languageName:t})},unregisterLanguage:function(e){delete n[e];for(const n of Object.keys(s))s[n]===e&&delete s[n]},listLanguages:function(){return Object.keys(n)},getLanguage:E,registerAliases:y,autoDetection:_,inherit:te,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=n=>{e["before:highlightBlock"](Object.assign({block:n.el},n))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=n=>{e["after:highlightBlock"](Object.assign({block:n.el},n))})}(e),r.push(e)}}),e.debugMode=function(){a=!1},e.safeMode=function(){a=!0},e.versionString="11.0.1";for(const e in L)"object"==typeof L[e]&&t(L[e]);return Object.assign(e,L),e}({});function re(e){return e?"string"==typeof e?e:e.source:null}function ae(...e){return e.map((e=>re(e))).join("")}function oe(...e){return"("+(function(e){const n=e[e.length-1];return"object"==typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{}}(e).capture?"":"?:")+e.map((e=>re(e))).join("|")+")"}const ce="[a-zA-Z]\\w*",le=function(e,n,t={}){const i=function(e,...n){const t=Object.create(null);for(const n in e)t[n]=e[n];return n.forEach((function(e){for(const n in e)t[n]=e[n]})),t}({scope:"comment",begin:e,end:n,contains:[]},t);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const s=oe("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:ae(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i};function ge(e){return e?"string"==typeof e?e:e.source:null}function ue(e){return de("(?=",e,")")}function de(...e){return e.map((e=>ge(e))).join("")}function he(...e){return"("+(function(e){const n=e[e.length-1];return"object"==typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{}}(e).capture?"":"?:")+e.map((e=>ge(e))).join("|")+")"}function fe(e,n){const t=se.getLanguage(n)?n:"plaintext";return se.highlight(e,{language:t}).value}return le("//","$"),le("/\\*","\\*/"),le("#","$"),se.registerLanguage("python",(function(e){const n={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:["and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},t={className:"meta",begin:/^(>>>|\.\.\.) /},i={className:"subst",begin:/\{/,end:/\}/,keywords:n,illegal:/#/},s={begin:/\{\{/,relevance:0},r={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,t],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,t],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,t,s,i]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,t,s,i]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,i]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,i]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},a="[0-9](_?[0-9])*",o=`(\\b(${a}))?\\.(${a})|\\b(${a})\\.`,c={className:"number",relevance:0,variants:[{begin:`(\\b(${a})|(${o}))[eE][+-]?(${a})[jJ]?\\b`},{begin:`(${o})[jJ]?`},{begin:"\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?\\b"},{begin:"\\b0[bB](_?[01])+[lL]?\\b"},{begin:"\\b0[oO](_?[0-7])+[lL]?\\b"},{begin:"\\b0[xX](_?[0-9a-fA-F])+[lL]?\\b"},{begin:`\\b(${a})[jJ]\\b`}]},l={className:"comment",begin:(g=/# type:/,ae("(?=",g,")")),end:/$/,keywords:n,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]};var g;const u={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,contains:["self",t,c,r,e.HASH_COMMENT_MODE]}]};return i.contains=[r,c,t],{name:"Python",aliases:["py","gyp","ipython"],keywords:n,illegal:/(<\/|->|\?)|=>/,contains:[t,c,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},r,l,e.HASH_COMMENT_MODE,{match:[/def/,/\s+/,ce],scope:{1:"keyword",3:"title.function"},contains:[u]},{variants:[{match:[/class/,/\s+/,ce,/\s*/,/\(\s*/,ce,/\s*\)/]},{match:[/class/,/\s+/,ce]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[c,u,r]}]}})),se.registerLanguage("html",(function(e){const n=de(/[A-Z_]/,de("(?:",/[A-Z0-9_.-]*:/,")?"),/[A-Z0-9_.-]*/),t={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=e.inherit(i,{begin:/\(/,end:/\)/}),r=e.inherit(e.APOS_STRING_MODE,{className:"string"}),a=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),o={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin://,relevance:10,contains:[i,a,r,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[i,s,a,r]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},t,{className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[o],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[o],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:de(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:o}]},{className:"tag",begin:de(/<\//,ue(de(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}})),se.registerLanguage("plaintext",(function(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}})),{setup:function(e){e.getMarkedParser().setOptions({highlight:fe,langPrefix:"hljs lang-"})}}})); +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).quizdownHighlight=n()}(this,(function(){"use strict";function e(n){return n instanceof Map?n.clear=n.delete=n.set=function(){throw new Error("map is read-only")}:n instanceof Set&&(n.add=n.clear=n.delete=function(){throw new Error("set is read-only")}),Object.freeze(n),Object.getOwnPropertyNames(n).forEach((function(t){var i=n[t];"object"!=typeof i||Object.isFrozen(i)||e(i)})),n}var n=e,t=e;n.default=t;class i{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function a(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function s(e,...n){const t=Object.create(null);for(const n in e)t[n]=e[n];return n.forEach((function(e){for(const n in e)t[n]=e[n]})),t}const r=e=>!!e.kind;class l{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=a(e)}openNode(e){if(!r(e))return;let n=e.kind;e.sublanguage||(n=`${this.classPrefix}${n}`),this.span(n)}closeNode(e){r(e)&&(this.buffer+="")}value(){return this.buffer}span(e){this.buffer+=``}}class o{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n={kind:e,children:[]};this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n),n.children.forEach((n=>this._walk(e,n))),e.closeNode(n)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{o._collapse(e)})))}}class c extends o{constructor(e){super(),this.options=e}addKeyword(e,n){""!==e&&(this.openNode(n),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,n){const t=e.root;t.kind=n,t.sublanguage=!0,this.add(t)}toHTML(){return new l(this,this.options).value()}finalize(){return!0}}function g(e){return e?"string"==typeof e?e:e.source:null}const u=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;const d="[a-zA-Z]\\w*",h="[a-zA-Z_]\\w*",f="\\b\\d+(\\.\\d+)?",b="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",m="\\b(0b[01]+)",p={begin:"\\\\[\\s\\S]",relevance:0},E={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[p]},x={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[p]},v={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},y=function(e,n,t={}){const i=s({className:"comment",begin:e,end:n,contains:[]},t);return i.contains.push(v),i.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),i},_=y("//","$"),w=y("/\\*","\\*/"),N=y("#","$"),R={className:"number",begin:f,relevance:0},A={className:"number",begin:b,relevance:0},O={className:"number",begin:m,relevance:0},M={className:"number",begin:f+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},k={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[p,{begin:/\[/,end:/\]/,relevance:0,contains:[p]}]}]},L={className:"title",begin:d,relevance:0},S={className:"title",begin:h,relevance:0},B={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var T=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:d,UNDERSCORE_IDENT_RE:h,NUMBER_RE:f,C_NUMBER_RE:b,BINARY_NUMBER_RE:m,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const n=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map((e=>g(e))).join("")}(n,/.*\b/,e.binary,/\b.*/)),s({className:"meta",begin:n,end:/$/,relevance:0,"on:begin":(e,n)=>{0!==e.index&&n.ignoreMatch()}},e)},BACKSLASH_ESCAPE:p,APOS_STRING_MODE:E,QUOTE_STRING_MODE:x,PHRASAL_WORDS_MODE:v,COMMENT:y,C_LINE_COMMENT_MODE:_,C_BLOCK_COMMENT_MODE:w,HASH_COMMENT_MODE:N,NUMBER_MODE:R,C_NUMBER_MODE:A,BINARY_NUMBER_MODE:O,CSS_NUMBER_MODE:M,REGEXP_MODE:k,TITLE_MODE:L,UNDERSCORE_TITLE_MODE:S,METHOD_GUARD:B,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})}});function j(e,n){"."===e.input[e.index-1]&&n.ignoreMatch()}function P(e,n){n&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=j,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function I(e,n){Array.isArray(e.illegal)&&(e.illegal=function(...e){return"("+e.map((e=>g(e))).join("|")+")"}(...e.illegal))}function C(e,n){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function D(e,n){void 0===e.relevance&&(e.relevance=1)}const H=["of","and","for","in","not","or","if","then","parent","list","value"];function $(e,n,t="keyword"){const i={};return"string"==typeof e?a(t,e.split(" ")):Array.isArray(e)?a(t,e):Object.keys(e).forEach((function(t){Object.assign(i,$(e[t],n,t))})),i;function a(e,t){n&&(t=t.map((e=>e.toLowerCase()))),t.forEach((function(n){const t=n.split("|");i[t[0]]=[e,U(t[0],t[1])]}))}}function U(e,n){return n?Number(n):function(e){return H.includes(e.toLowerCase())}(e)?0:1}function z(e,{plugins:n}){function t(n,t){return new RegExp(g(n),"m"+(e.case_insensitive?"i":"")+(t?"g":""))}class i{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,n){n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]),this.matchAt+=function(e){return new RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=t(function(e,n="|"){let t=0;return e.map((e=>{t+=1;const n=t;let i=g(e),a="";for(;i.length>0;){const e=u.exec(i);if(!e){a+=i;break}a+=i.substring(0,e.index),i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?a+="\\"+String(Number(e[1])+n):(a+=e[0],"("===e[0]&&t++)}return a})).map((e=>`(${e})`)).join(n)}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const n=this.matcherRe.exec(e);if(!n)return null;const t=n.findIndex(((e,n)=>n>0&&void 0!==e)),i=this.matchIndexes[t];return n.splice(0,t),Object.assign(n,i)}}class a{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const n=new i;return this.rules.slice(e).forEach((([e,t])=>n.addRule(e,t))),n.compile(),this.multiRegexes[e]=n,n}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,n){this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex;let t=n.exec(e);if(this.resumingScanAtSamePosition())if(t&&t.index===this.lastIndex);else{const n=this.getMatcher(0);n.lastIndex=this.lastIndex+1,t=n.exec(e)}return t&&(this.regexIndex+=t.position+1,this.regexIndex===this.count&&this.considerAll()),t}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=s(e.classNameAliases||{}),function n(i,r){const l=i;if(i.isCompiled)return l;[C].forEach((e=>e(i,r))),e.compilerExtensions.forEach((e=>e(i,r))),i.__beforeBegin=null,[P,I,D].forEach((e=>e(i,r))),i.isCompiled=!0;let o=null;if("object"==typeof i.keywords&&(o=i.keywords.$pattern,delete i.keywords.$pattern),i.keywords&&(i.keywords=$(i.keywords,e.case_insensitive)),i.lexemes&&o)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return o=o||i.lexemes||/\w+/,l.keywordPatternRe=t(o,!0),r&&(i.begin||(i.begin=/\B|\b/),l.beginRe=t(i.begin),i.endSameAsBegin&&(i.end=i.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(l.endRe=t(i.end)),l.terminatorEnd=g(i.end)||"",i.endsWithParent&&r.terminatorEnd&&(l.terminatorEnd+=(i.end?"|":"")+r.terminatorEnd)),i.illegal&&(l.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(n){return s(e,{variants:null},n)})));if(e.cachedVariants)return e.cachedVariants;if(F(e))return s(e,{starts:e.starts?s(e.starts):null});if(Object.isFrozen(e))return s(e);return e}("self"===e?i:e)}))),i.contains.forEach((function(e){n(e,l)})),i.starts&&n(i.starts,r),l.matcher=function(e){const n=new a;return e.contains.forEach((e=>n.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&n.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n}(l),l}(e)}function F(e){return!!e&&(e.endsWithParent||F(e.starts))}function K(e){const n={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!e.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,a(this.code);let n={};return this.autoDetect?(n=e.highlightAuto(this.code),this.detectedLanguage=n.language):(n=e.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language),n.value},autoDetect(){return!this.language||(e=this.autodetect,Boolean(e||""===e));var e},ignoreIllegals:()=>!0},render(e){return e("pre",{},[e("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:n,VuePlugin:{install(e){e.component("highlightjs",n)}}}}const G={"after:highlightElement":({el:e,result:n,text:t})=>{const i=Z(e);if(!i.length)return;const s=document.createElement("div");s.innerHTML=n.value,n.value=function(e,n,t){let i=0,s="";const r=[];function l(){return e.length&&n.length?e[0].offset!==n[0].offset?e[0].offset"}function c(e){s+=""}function g(e){("start"===e.event?o:c)(e.node)}for(;e.length||n.length;){let n=l();if(s+=a(t.substring(i,n[0].offset)),i=n[0].offset,n===e){r.reverse().forEach(c);do{g(n.splice(0,1)[0]),n=l()}while(n===e&&n.length&&n[0].offset===i);r.reverse().forEach(o)}else"start"===n[0].event?r.push(n[0].node):r.pop(),g(n.splice(0,1)[0])}return s+a(t.substr(i))}(i,Z(s),t)}};function W(e){return e.nodeName.toLowerCase()}function Z(e){const n=[];return function e(t,i){for(let a=t.firstChild;a;a=a.nextSibling)3===a.nodeType?i+=a.nodeValue.length:1===a.nodeType&&(n.push({event:"start",offset:i,node:a}),i=e(a,i),W(a).match(/br|hr|img|input/)||n.push({event:"stop",offset:i,node:a}));return i}(e,0),n}const q={},X=e=>{console.error(e)},V=(e,...n)=>{console.log(`WARN: ${e}`,...n)},J=(e,n)=>{q[`${e}/${n}`]||(console.log(`Deprecated as of ${e}. ${n}`),q[`${e}/${n}`]=!0)},Q=a,Y=s,ee=Symbol("nomatch");var ne=function(e){const t=Object.create(null),a=Object.create(null),s=[];let r=!0;const l=/(^(<[^>]+>|\t|)+|\n)/gm,o="Could not find the language '{}', did you forget to load/include a language module?",g={disableAutodetect:!0,name:"Plain text",contains:[]};let u={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:c};function d(e){return u.noHighlightRe.test(e)}function h(e,n,t,i){let a="",s="";"object"==typeof n?(a=e,t=n.ignoreIllegals,s=n.language,i=void 0):(J("10.7.0","highlight(lang, code, ...args) has been deprecated."),J("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),s=e,a=n);const r={code:a,language:s};A("before:highlight",r);const l=r.result?r.result:f(r.language,r.code,t,i);return l.code=r.code,A("after:highlight",l),l}function f(e,n,a,l){function c(e,n){const t=y.case_insensitive?n[0].toLowerCase():n[0];return Object.prototype.hasOwnProperty.call(e.keywords,t)&&e.keywords[t]}function g(){null!=R.subLanguage?function(){if(""===M)return;let e=null;if("string"==typeof R.subLanguage){if(!t[R.subLanguage])return void O.addText(M);e=f(R.subLanguage,M,!0,A[R.subLanguage]),A[R.subLanguage]=e.top}else e=b(M,R.subLanguage.length?R.subLanguage:null);R.relevance>0&&(k+=e.relevance),O.addSublanguage(e.emitter,e.language)}():function(){if(!R.keywords)return void O.addText(M);let e=0;R.keywordPatternRe.lastIndex=0;let n=R.keywordPatternRe.exec(M),t="";for(;n;){t+=M.substring(e,n.index);const i=c(R,n);if(i){const[e,a]=i;if(O.addText(t),t="",k+=a,e.startsWith("_"))t+=n[0];else{const t=y.classNameAliases[e]||e;O.addKeyword(n[0],t)}}else t+=n[0];e=R.keywordPatternRe.lastIndex,n=R.keywordPatternRe.exec(M)}t+=M.substr(e),O.addText(t)}(),M=""}function d(e){return e.className&&O.openNode(y.classNameAliases[e.className]||e.className),R=Object.create(e,{parent:{value:R}}),R}function h(e,n,t){let a=function(e,n){const t=e&&e.exec(n);return t&&0===t.index}(e.endRe,t);if(a){if(e["on:end"]){const t=new i(e);e["on:end"](n,t),t.isMatchIgnored&&(a=!1)}if(a){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return h(e.parent,n,t)}function m(e){return 0===R.matcher.regexIndex?(M+=e[0],1):(B=!0,0)}function p(e){const n=e[0],t=e.rule,a=new i(t),s=[t.__beforeBegin,t["on:begin"]];for(const t of s)if(t&&(t(e,a),a.isMatchIgnored))return m(n);return t&&t.endSameAsBegin&&(t.endRe=new RegExp(n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),t.skip?M+=n:(t.excludeBegin&&(M+=n),g(),t.returnBegin||t.excludeBegin||(M=n)),d(t),t.returnBegin?0:n.length}function E(e){const t=e[0],i=n.substr(e.index),a=h(R,e,i);if(!a)return ee;const s=R;s.skip?M+=t:(s.returnEnd||s.excludeEnd||(M+=t),g(),s.excludeEnd&&(M=t));do{R.className&&O.closeNode(),R.skip||R.subLanguage||(k+=R.relevance),R=R.parent}while(R!==a.parent);return a.starts&&(a.endSameAsBegin&&(a.starts.endRe=a.endRe),d(a.starts)),s.returnEnd?0:t.length}let x={};function v(t,i){const s=i&&i[0];if(M+=t,null==s)return g(),0;if("begin"===x.type&&"end"===i.type&&x.index===i.index&&""===s){if(M+=n.slice(i.index,i.index+1),!r){const n=new Error("0 width match regex");throw n.languageName=e,n.badRule=x.rule,n}return 1}if(x=i,"begin"===i.type)return p(i);if("illegal"===i.type&&!a){const e=new Error('Illegal lexeme "'+s+'" for mode "'+(R.className||"")+'"');throw e.mode=R,e}if("end"===i.type){const e=E(i);if(e!==ee)return e}if("illegal"===i.type&&""===s)return 1;if(S>1e5&&S>3*i.index){throw new Error("potential infinite loop, way more iterations than matches")}return M+=s,s.length}const y=w(e);if(!y)throw X(o.replace("{}",e)),new Error('Unknown language: "'+e+'"');const _=z(y,{plugins:s});let N="",R=l||_;const A={},O=new u.__emitter(u);!function(){const e=[];for(let n=R;n!==y;n=n.parent)n.className&&e.unshift(n.className);e.forEach((e=>O.openNode(e)))}();let M="",k=0,L=0,S=0,B=!1;try{for(R.matcher.considerAll();;){S++,B?B=!1:R.matcher.considerAll(),R.matcher.lastIndex=L;const e=R.matcher.exec(n);if(!e)break;const t=v(n.substring(L,e.index),e);L=e.index+t}return v(n.substr(L)),O.closeAllNodes(),O.finalize(),N=O.toHTML(),{relevance:Math.floor(k),value:N,language:e,illegal:!1,emitter:O,top:R}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:n.slice(L-100,L+100),mode:t.mode},sofar:N,relevance:0,value:Q(n),emitter:O};if(r)return{illegal:!1,relevance:0,value:Q(n),emitter:O,language:e,top:R,errorRaised:t};throw t}}function b(e,n){n=n||u.languages||Object.keys(t);const i=function(e){const n={relevance:0,emitter:new u.__emitter(u),value:Q(e),illegal:!1,top:g};return n.emitter.addText(e),n}(e),a=n.filter(w).filter(R).map((n=>f(n,e,!1)));a.unshift(i);const s=a.sort(((e,n)=>{if(e.relevance!==n.relevance)return n.relevance-e.relevance;if(e.language&&n.language){if(w(e.language).supersetOf===n.language)return 1;if(w(n.language).supersetOf===e.language)return-1}return 0})),[r,l]=s,o=r;return o.second_best=l,o}const m={"before:highlightElement":({el:e})=>{u.useBR&&(e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n"))},"after:highlightElement":({result:e})=>{u.useBR&&(e.value=e.value.replace(/\n/g,"
"))}},p=/^(<[^>]+>|\t)+/gm,E={"after:highlightElement":({result:e})=>{u.tabReplace&&(e.value=e.value.replace(p,(e=>e.replace(/\t/g,u.tabReplace))))}};function x(e){let n=null;const t=function(e){let n=e.className+" ";n+=e.parentNode?e.parentNode.className:"";const t=u.languageDetectRe.exec(n);if(t){const n=w(t[1]);return n||(V(o.replace("{}",t[1])),V("Falling back to no-highlight mode for this block.",e)),n?t[1]:"no-highlight"}return n.split(/\s+/).find((e=>d(e)||w(e)))}(e);if(d(t))return;A("before:highlightElement",{el:e,language:t}),n=e;const i=n.textContent,s=t?h(i,{language:t,ignoreIllegals:!0}):b(i);A("after:highlightElement",{el:e,result:s,text:i}),e.innerHTML=s.value,function(e,n,t){const i=n?a[n]:t;e.classList.add("hljs"),i&&e.classList.add(i)}(e,t,s.language),e.result={language:s.language,re:s.relevance,relavance:s.relevance},s.second_best&&(e.second_best={language:s.second_best.language,re:s.second_best.relevance,relavance:s.second_best.relevance})}const v=()=>{if(v.called)return;v.called=!0,J("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead.");document.querySelectorAll("pre code").forEach(x)};let y=!1;function _(){if("loading"===document.readyState)return void(y=!0);document.querySelectorAll("pre code").forEach(x)}function w(e){return e=(e||"").toLowerCase(),t[e]||t[a[e]]}function N(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach((e=>{a[e.toLowerCase()]=n}))}function R(e){const n=w(e);return n&&!n.disableAutodetect}function A(e,n){const t=e;s.forEach((function(e){e[t]&&e[t](n)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){y&&_()}),!1),Object.assign(e,{highlight:h,highlightAuto:b,highlightAll:_,fixMarkup:function(e){return J("10.2.0","fixMarkup will be removed entirely in v11.0"),J("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),n=e,u.tabReplace||u.useBR?n.replace(l,(e=>"\n"===e?u.useBR?"
":e:u.tabReplace?e.replace(/\t/g,u.tabReplace):e)):n;var n},highlightElement:x,highlightBlock:function(e){return J("10.7.0","highlightBlock will be removed entirely in v12.0"),J("10.7.0","Please use highlightElement now."),x(e)},configure:function(e){e.useBR&&(J("10.3.0","'useBR' will be removed entirely in v11.0"),J("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),u=Y(u,e)},initHighlighting:v,initHighlightingOnLoad:function(){J("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),y=!0},registerLanguage:function(n,i){let a=null;try{a=i(e)}catch(e){if(X("Language definition for '{}' could not be registered.".replace("{}",n)),!r)throw e;X(e),a=g}a.name||(a.name=n),t[n]=a,a.rawDefinition=i.bind(null,e),a.aliases&&N(a.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const n of Object.keys(a))a[n]===e&&delete a[n]},listLanguages:function(){return Object.keys(t)},getLanguage:w,registerAliases:N,requireLanguage:function(e){J("10.4.0","requireLanguage will be removed entirely in v11."),J("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const n=w(e);if(n)return n;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:R,inherit:Y,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=n=>{e["before:highlightBlock"](Object.assign({block:n.el},n))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=n=>{e["after:highlightBlock"](Object.assign({block:n.el},n))})}(e),s.push(e)},vuePlugin:K(e).VuePlugin}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString="10.7.3";for(const e in T)"object"==typeof T[e]&&n(T[e]);return Object.assign(e,T),e.addPlugin(m),e.addPlugin(G),e.addPlugin(E),e}({});function te(e){return function(...e){return e.map((e=>function(e){return e?"string"==typeof e?e:e.source:null}(e))).join("")}("(?=",e,")")}var ie=function(e){const n={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:["and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},t={className:"meta",begin:/^(>>>|\.\.\.) /},i={className:"subst",begin:/\{/,end:/\}/,keywords:n,illegal:/#/},a={begin:/\{\{/,relevance:0},s={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,t],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,t],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,t,a,i]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,t,a,i]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,a,i]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a,i]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},r="[0-9](_?[0-9])*",l=`(\\b(${r}))?\\.(${r})|\\b(${r})\\.`,o={className:"number",relevance:0,variants:[{begin:`(\\b(${r})|(${l}))[eE][+-]?(${r})[jJ]?\\b`},{begin:`(${l})[jJ]?`},{begin:"\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?\\b"},{begin:"\\b0[bB](_?[01])+[lL]?\\b"},{begin:"\\b0[oO](_?[0-7])+[lL]?\\b"},{begin:"\\b0[xX](_?[0-9a-fA-F])+[lL]?\\b"},{begin:`\\b(${r})[jJ]\\b`}]},c={className:"comment",begin:te(/# type:/),end:/$/,keywords:n,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},g={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,contains:["self",t,o,s,e.HASH_COMMENT_MODE]}]};return i.contains=[s,o,t],{name:"Python",aliases:["py","gyp","ipython"],keywords:n,illegal:/(<\/|->|\?)|=>/,contains:[t,o,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},s,c,e.HASH_COMMENT_MODE,{variants:[{className:"function",beginKeywords:"def"},{className:"class",beginKeywords:"class"}],end:/:/,illegal:/[${=;\n,]/,contains:[e.UNDERSCORE_TITLE_MODE,g,{begin:/->/,endsWithParent:!0,keywords:n}]},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[o,g,s]}]}};function ae(e){return e?"string"==typeof e?e:e.source:null}function se(e){return re("(?=",e,")")}function re(...e){return e.map((e=>ae(e))).join("")}function le(...e){return"("+e.map((e=>ae(e))).join("|")+")"}var oe=function(e){const n=re(/[A-Z_]/,re("(",/[A-Z0-9_.-]*:/,")?"),/[A-Z0-9_.-]*/),t={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"meta-keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(i,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"meta-string"}),r=e.inherit(e.QUOTE_STRING_MODE,{className:"meta-string"}),l={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin://,relevance:10,contains:[i,r,s,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[i,a,r,s]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},t,{className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:re(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:re(/<\//,se(re(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}};var ce=function(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}};function ge(e,n){const t=ne.getLanguage(n)?n:"plaintext";return ne.highlight(e,{language:t}).value}return ne.registerLanguage("python",ie),ne.registerLanguage("html",oe),ne.registerLanguage("plaintext",ce),{setup:function(e){e.getMarkedParser().setOptions({highlight:ge,langPrefix:"hljs lang-"})}}})); diff --git a/public/build/quizdown.js b/public/build/quizdown.js index 5255fa3..0776d68 100644 --- a/public/build/quizdown.js +++ b/public/build/quizdown.js @@ -1,4 +1,4 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).quizdown=t()}(this,(function(){"use strict";function e(){}const t=e=>e;function n(e,t){for(const n in t)e[n]=t[n];return e}function s(e){return e()}function r(){return Object.create(null)}function i(e){e.forEach(s)}function o(e){return"function"==typeof e}function a(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function l(t,...n){if(null==t)return e;const s=t.subscribe(...n);return s.unsubscribe?()=>s.unsubscribe():s}function c(e){let t;return l(e,(e=>t=e))(),t}function u(e,t,n){e.$$.on_destroy.push(l(t,n))}function h(e,t,s,r){return e[1]&&r?n(s.ctx.slice(),e[1](r(t))):s.ctx}function f(e,t,n,s,r,i,o){const a=function(e,t,n,s){if(e[2]&&s){const r=e[2](s(n));if(void 0===t.dirty)return r;if("object"==typeof r){const e=[],n=Math.max(t.dirty.length,r.length);for(let s=0;swindow.performance.now():()=>Date.now(),g=d?e=>requestAnimationFrame(e):e;const y=new Set;function b(e){y.forEach((t=>{t.c(e)||(y.delete(t),t.f())})),0!==y.size&&g(b)}function v(e){let t;return 0===y.size&&g(b),{promise:new Promise((n=>{y.add(t={c:e,f:n})})),abort(){y.delete(t)}}}let w=!1;function k(e,t,n,s){for(;e>1);n(r)<=s?e=r+1:t=r}return e}function E(e,t,n){const s=_(e);if(!function(e){let t,n=e[0],s=1;for(;sn.call(t,...e))),t=void 0)}return n}([s,"optionalAccess",e=>e.querySelector,"call",e=>e(`#${t}`)])){const e=N("style");e.id=t,e.textContent=n,S(s,e)}}function x(e){return e?e.getRootNode?e.getRootNode():e.ownerDocument:document}function _(e){const t=x(e);return t.host?t:t.head}function S(e,t){w?(!function(e){if(e.hydrate_init)return;e.hydrate_init=!0;const t=e.childNodes,n=new Int32Array(t.length+1),s=new Int32Array(t.length);n[0]=-1;let r=0;for(let e=0;et[n[e]].claim_order),t[e].claim_order)-1;s[e]=n[i]+1;const o=i+1;n[o]=e,r=Math.max(o,r)}const i=[],o=[];let a=t.length-1;for(let e=n[r]+1;0!=e;e=s[e-1]){for(i.push(t[e-1]);a>=e;a--)o.push(t[a]);a--}for(;a>=0;a--)o.push(t[a]);i.reverse(),o.sort(((e,t)=>e.claim_order-t.claim_order));for(let t=0,n=0;t=i[n].claim_order;)n++;const s=ne.removeEventListener(t,n,s)}function R(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function P(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function q(e,t,n,s){e.style.setProperty(t,n,s?"important":"")}class D{constructor(e){this.e=this.n=null,this.l=e}m(e,t,n=null){this.e||(this.e=N(t.nodeName),this.t=t,this.l?this.n=this.l:this.h(e)),this.i(n)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.childNodes)}i(e){for(let t=0;t>>0}(u)}_${a}`,f=x(e);z.add(f);const p=f.__svelte_stylesheet||(f.__svelte_stylesheet=function(e){return _(e).appendChild(N("style"))}(e).sheet),d=f.__svelte_rules||(f.__svelte_rules={});d[h]||(d[h]=!0,p.insertRule(`@keyframes ${h} ${u}`,p.cssRules.length));const m=e.style.animation||"";return e.style.animation=`${m?`${m}, `:""}${h} ${s}ms linear ${r}ms 1 both`,j+=1,h}function B(e,t){const n=(e.style.animation||"").split(", "),s=n.filter(t?e=>e.indexOf(t)<0:e=>-1===e.indexOf("__svelte")),r=n.length-s.length;r&&(e.style.animation=s.join(", "),j-=r,j||g((()=>{j||(z.forEach((e=>{const t=e.__svelte_stylesheet;let n=t.cssRules.length;for(;n--;)t.deleteRule(n);e.__svelte_rules={}})),z.clear())})))}function G(e){const t=getComputedStyle(e);if("absolute"!==t.position&&"fixed"!==t.position){const{width:n,height:s}=t,r=e.getBoundingClientRect();e.style.position="absolute",e.style.width=n,e.style.height=s,function(e,t){const n=e.getBoundingClientRect();if(t.left!==n.left||t.top!==n.top){const s=getComputedStyle(e),r="none"===s.transform?"":s.transform;e.style.transform=`${r} translate(${t.left-n.left}px, ${t.top-n.top}px)`}}(e,r)}}function K(e){U=e}function V(e){(function(){if(!U)throw new Error("Function called outside component initialization");return U})().$$.on_mount.push(e)}const H=[],Y=[],X=[],W=[],J=Promise.resolve();let Z=!1;function Q(e){X.push(e)}let ee=!1;const te=new Set;function ne(){if(!ee){ee=!0;do{for(let e=0;e{re.delete(e),s&&(n&&e.d(1),s())})),e.o(t)}}const ue="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function he(e,t){e.f(),function(e,t){e.d(1),t.delete(e.key)}(e,t)}function fe(e){e&&e.c()}function pe(e,t,n,r){const{fragment:a,on_mount:l,on_destroy:c,after_update:u}=e.$$;a&&a.m(t,n),r||Q((()=>{const t=l.map(s).filter(o);c?c.push(...t):i(t),e.$$.on_mount=[]})),u.forEach(Q)}function de(e,t){const n=e.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function me(e,t){-1===e.$$.dirty[0]&&(H.push(e),Z||(Z=!0,J.then(ne)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const r=s.length?s[0]:n;return f.ctx&&a(f.ctx[e],f.ctx[e]=r)&&(!f.skip_bound&&f.bound[e]&&f.bound[e](r),p&&me(t,e)),n})):[],f.update(),p=!0,i(f.before_update),f.fragment=!!o&&o(f.ctx),n.target){if(n.hydrate){w=!0;const e=function(e){return Array.from(e.childNodes)}(n.target);f.fragment&&f.fragment.l(e),e.forEach(A)}else f.fragment&&f.fragment.c();n.intro&&le(t.$$.fragment),pe(t,n.target,n.anchor,n.customElement),w=!1,ne()}K(h)}class ye{$destroy(){de(this,1),this.$destroy=e}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function be(e){const t=e-1;return t*t*t+1}function ve(e,t,n={}){const s=getComputedStyle(e),r="none"===s.transform?"":s.transform,i=t.from.width/e.clientWidth,a=t.from.height/e.clientHeight,l=(t.from.left-t.to.left)/i,c=(t.from.top-t.to.top)/a,u=Math.sqrt(l*l+c*c),{delay:h=0,duration:f=(e=>120*Math.sqrt(e)),easing:p=be}=n;return{delay:h,duration:o(f)?f(u):f,easing:p,css:(e,t)=>`transform: ${r} translate(${t*l}px, ${t*c}px);`}}const{Map:we}=ue;function ke(e){E(e,"svelte-1imq117",".dragdroplist.svelte-1imq117.svelte-1imq117{position:relative;padding:0}.list.svelte-1imq117.svelte-1imq117{cursor:grab;z-index:5;display:flex;flex-direction:column}.item.svelte-1imq117.svelte-1imq117{box-sizing:border-box;display:inline-flex;width:100%;margin-bottom:0.5em;border-radius:2px;user-select:none;margin:5px;padding:0;background-color:var(--quizdown-color-secondary);border:3px solid transparent;color:var(--quizdown-color-text)}.item.svelte-1imq117.svelte-1imq117:last-child{margin-bottom:0}.item.svelte-1imq117.svelte-1imq117:not(#grabbed):not(#ghost){z-index:10}.item.svelte-1imq117>.svelte-1imq117{margin:auto auto auto 0}.buttons.svelte-1imq117.svelte-1imq117{width:32px;min-width:32px;margin:auto 0;display:flex;flex-direction:column}.buttons.svelte-1imq117 button.svelte-1imq117{cursor:pointer;width:18px;height:18px;margin:0 auto;padding:0;border:1px solid rgba(0, 0, 0, 0);background-color:inherit}.buttons.svelte-1imq117 button.svelte-1imq117:focus{border:1px solid black}.delete.svelte-1imq117.svelte-1imq117{width:32px}#grabbed.svelte-1imq117.svelte-1imq117{opacity:0}#ghost.svelte-1imq117.svelte-1imq117{pointer-events:none;z-index:-5;position:absolute;top:0;left:0;opacity:0;border:3px solid var(--quizdown-color-primary);background-color:var(--quizdown-color-secondary)}#ghost.svelte-1imq117 .svelte-1imq117{pointer-events:none}#ghost.haunting.svelte-1imq117.svelte-1imq117{z-index:20;opacity:1}")}function Ee(e,t,n){const s=e.slice();return s[28]=t[n],s[30]=n,s}function xe(e){let t,n,s=e[28]+"";return{c(){t=N("p"),n=L(s)},m(e,s){T(e,t,s),S(t,n)},p(e,t){1&t&&s!==(s=e[28]+"")&&P(n,s)},d(e){e&&A(t)}}}function _e(e){let t,n,s=e[28].text+"";return{c(){t=N("p"),n=L(s)},m(e,s){T(e,t,s),S(t,n)},p(e,t){1&t&&s!==(s=e[28].text+"")&&P(n,s)},d(e){e&&A(t)}}}function Se(e){let t,n,s=e[28].html+"";return{c(){t=new D,n=C(),t.a=n},m(e,r){t.m(s,e,r),T(e,n,r)},p(e,n){1&n&&s!==(s=e[28].html+"")&&t.p(s)},d(e){e&&A(n),e&&t.d()}}}function Te(e){let t,n,s;function r(...t){return e[17](e[30],...t)}return{c(){t=N("button"),t.innerHTML='',R(t,"class","svelte-1imq117")},m(e,i){T(e,t,i),n||(s=M(t,"click",r),n=!0)},p(t,n){e=t},d(e){e&&A(t),n=!1,s()}}}function Ae(n,s){let r,o,a,l,c,u,h,f,p,d,g,y,b,w,k,E,x,_,$,L,C,P,q,D,z=e;function U(...e){return s[15](s[30],...e)}function j(...e){return s[16](s[30],...e)}function K(e,t){return e[28].html?Se:e[28].text?_e:xe}let V=K(s),H=V(s),Y=s[1]&&Te(s);return{key:n,first:null,c(){r=N("div"),o=N("div"),a=N("button"),l=O("svg"),c=O("path"),u=O("path"),f=I(),p=N("button"),d=O("svg"),g=O("path"),y=O("path"),w=I(),k=N("div"),H.c(),E=I(),x=N("div"),Y&&Y.c(),_=I(),R(c,"d","M0 0h24v24H0V0z"),R(c,"fill","none"),R(u,"d","M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6 1.41 1.41z"),R(l,"xmlns","http://www.w3.org/2000/svg"),R(l,"viewBox","0 0 24 24"),R(l,"width","16px"),R(l,"height","16px"),R(a,"class","up svelte-1imq117"),R(a,"style",h="visibility: "+(s[30]>0?"":"hidden")+";"),R(g,"d","M0 0h24v24H0V0z"),R(g,"fill","none"),R(y,"d","M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"),R(d,"xmlns","http://www.w3.org/2000/svg"),R(d,"viewBox","0 0 24 24"),R(d,"width","16px"),R(d,"height","16px"),R(p,"class","down svelte-1imq117"),R(p,"style",b="visibility: "+(s[30]0?"":"hidden")+";")&&R(a,"style",h),1&t&&b!==(b="visibility: "+(s[30]{if(!y&&e>=u&&(y=!0),y&&e>=h&&(f(1,0),b()),!g)return!1;if(y){const t=0+1*c((e-u)/l);f(t,1-t)}return!0})),p&&(d=F(n,0,1,l,a,c,p)),a||(y=!0),f(0,1),b}(r,P,ve,{duration:200})},d(e){e&&A(r),H.d(),Y&&Y.d(),q=!1,i(D)}}}function $e(t){let n,s,r,o,a,l,c,u,h,f=[],d=new we,m=t[0];const g=e=>e[28].id?e[28].id:JSON.stringify(e[28]);for(let e=0;eb.get(r)?(w.add(s),k(t)):(v.add(r),f--):(l(n,o),f--)}for(;f--;){const t=e[f];y.has(t.key)||l(t,o)}for(;p;)k(g[p-1]);return g}(f,t,g,1,e,m,d,c,he,Ae,null,Ee);for(let e=0;e{"data"in e&&n(0,o=e.data),"removesItems"in e&&n(1,a=e.removesItems)},[o,a,s,r,l,c,u,h,f,p,d,m,g,y,function(e){Y[e?"unshift":"push"]((()=>{s=e,n(2,s)}))},function(e,t){m(e,e-1)},function(e,t){m(e,e+1)},function(e,t){y(e)},function(e){h(e.clientY,this)},function(e){h(e.touches[0].clientY,this)},function(e){e.stopPropagation(),d(0,e.target)},function(e){e.stopPropagation(),e.preventDefault(),p(e.touches[0])},function(e){e.stopPropagation(),f(e.clientY)},function(e){e.stopPropagation(),f(e.touches[0].clientY)},function(e){e.stopPropagation(),g()},function(e){e.stopPropagation(),g()},function(e){e.stopPropagation(),g(e.touches[0])}]}class Oe extends ye{constructor(e){super(),ge(this,e,Ne,$e,a,{data:0,removesItems:1},ke)}}function Le(e){let t,n,s;function r(t){e[4](t)}let i={};return void 0!==e[0].answers&&(i.data=e[0].answers),t=new Oe({props:i}),Y.push((()=>function(e,t,n){const s=e.$$.props[t];void 0!==s&&(e.$$.bound[s]=n,n(e.$$.ctx[s]))}(t,"data",r))),{c(){fe(t.$$.fragment)},m(e,n){pe(t,e,n),s=!0},p(e,[s]){const r={};var i;!n&&1&s&&(n=!0,r.data=e[0].answers,i=()=>n=!1,W.push(i)),t.$set(r)},i(e){s||(le(t.$$.fragment,e),s=!0)},o(e){ce(t.$$.fragment,e),s=!1},d(e){de(t,e)}}}function Ie(t,n,s){let r,i,o,a=e;t.$$.on_destroy.push((()=>a()));let{quiz:c}=n;return t.$$set=e=>{"quiz"in e&&s(2,c=e.quiz)},t.$$.update=()=>{4&t.$$.dirty&&(s(1,r=c.counter),a(),a=l(r,(e=>s(3,o=e)))),12&t.$$.dirty&&s(0,i=c.questions[o]),1&t.$$.dirty&&s(0,i.selected=i.answers.map((e=>e.id)),i)},[i,r,c,o,function(e){t.$$.not_equal(i.answers,e)&&(i.answers=e,s(0,i),s(2,c),s(3,o))}]}class Ce extends ye{constructor(e){super(),ge(this,e,Ie,Le,a,{quiz:2})}}function Me(e){E(e,"svelte-1kynd15","[type='checkbox'].svelte-1kynd15.svelte-1kynd15,[type='radio'].svelte-1kynd15.svelte-1kynd15{display:none}[type='radio'].svelte-1kynd15+span.svelte-1kynd15{border-radius:0.5em}[type='checkbox'].svelte-1kynd15+span.svelte-1kynd15{border-radius:2px}[type='checkbox'].svelte-1kynd15+span.svelte-1kynd15,[type='radio'].svelte-1kynd15+span.svelte-1kynd15{transition-duration:0.3s;background-color:var(--quizdown-color-secondary);color:var(--quizdown-color-text);display:block;padding:0.5rem;margin:5px;border:3px solid transparent;cursor:pointer}[type='checkbox'].svelte-1kynd15:hover+span.svelte-1kynd15,[type='radio'].svelte-1kynd15:hover+span.svelte-1kynd15{filter:brightness(0.9)}[type='checkbox'].svelte-1kynd15:checked+span.svelte-1kynd15,[type='radio'].svelte-1kynd15:checked+span.svelte-1kynd15{border:3px solid var(--quizdown-color-primary)}")}function Re(e,t,n){const s=e.slice();return s[7]=t[n],s[9]=n,s}function Pe(e,t,n){const s=e.slice();return s[7]=t[n],s[9]=n,s}function qe(e){let t,n=e[1].answers,s=[];for(let t=0;ta()));let{quiz:c}=n;const u=[[],[]];return t.$$set=e=>{"quiz"in e&&s(2,c=e.quiz)},t.$$.update=()=>{4&t.$$.dirty&&(s(0,r=c.counter),a(),a=l(r,(e=>s(3,o=e)))),12&t.$$.dirty&&s(1,i=c.questions[o])},[r,i,c,o,function(){i.selected=function(e,t,n){const s=new Set;for(let t=0;t{const e=r.indexOf(l);-1!==e&&r.splice(e,1),0===r.length&&(s(),s=null)}}}}function Ve(t,n,s){const r=!Array.isArray(t),a=r?[t]:t,c=n.length<2;return{subscribe:Ke(s,(t=>{let s=!1;const u=[];let h=0,f=e;const p=()=>{if(h)return;f();const s=n(r?u[0]:u,t);c?t(s):f=o(s)?s:e},d=a.map(((e,t)=>l(e,(e=>{u[t]=e,h&=~(1<{h|=1<1)throw new RangeError("integer-width stems only accept a single optional option");r.options[0].replace($t,(function(e,n,s,r,i,o){if(n)t.minimumIntegerDigits=s.length;else{if(r&&i)throw new Error("We currently do not support maximum integer digits");if(o)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(Nt.test(r.stem))t.minimumIntegerDigits=r.stem.length;else if(Tt.test(r.stem)){if(r.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");r.stem.replace(Tt,(function(e,n,s,r,i,o){return"*"===s?t.minimumFractionDigits=n.length:r&&"#"===r[0]?t.maximumFractionDigits=r.length:i&&o?(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length+o.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),""})),r.options.length&&(t=at(at({},t),Ot(r.options[0])))}else if(At.test(r.stem))t=at(at({},t),Ot(r.stem));else{var i=Lt(r.stem);i&&(t=at(at({},t),i));var o=It(r.stem);o&&(t=at(at({},t),o))}}return t}function Rt(e,t){return{start:e,end:t}}var Pt=!!String.prototype.startsWith,qt=!!String.fromCodePoint,Dt=!!Object.fromEntries,zt=!!String.prototype.codePointAt,Ut=!!String.prototype.trimStart,jt=!!String.prototype.trimEnd,Ft=!!Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Bt=!0;try{Bt="a"===(null===(St=Jt("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===St?void 0:St[0])}catch(e){Bt=!1}var Gt,Kt=Pt?function(e,t,n){return e.startsWith(t,n)}:function(e,t,n){return e.slice(n,n+t.length)===t},Vt=qt?String.fromCodePoint:function(){for(var e=[],t=0;ti;){if((n=e[i++])>1114111)throw RangeError(n+" is not a valid code point");s+=n<65536?String.fromCharCode(n):String.fromCharCode(55296+((n-=65536)>>10),n%1024+56320)}return s},Ht=Dt?Object.fromEntries:function(e){for(var t={},n=0,s=e;n=n)){var s,r=e.charCodeAt(t);return r<55296||r>56319||t+1===n||(s=e.charCodeAt(t+1))<56320||s>57343?r:s-56320+(r-55296<<10)+65536}},Xt=Ut?function(e){return e.trimStart()}:function(e){return e.replace(wt,"")},Wt=jt?function(e){return e.trimEnd()}:function(e){return e.replace(kt,"")};function Jt(e,t){return new RegExp(e,t)}if(Bt){var Zt=Jt("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Gt=function(e,t){var n;return Zt.lastIndex=t,null!==(n=Zt.exec(e)[1])&&void 0!==n?n:""}}else Gt=function(e,t){for(var n=[];;){var s=Yt(e,t);if(void 0===s||nn(s)||sn(s))break;n.push(s),t+=s>=65536?2:1}return Vt.apply(void 0,n)};var Qt=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,n){for(var s=[];!this.isEOF();){var r=this.char();if(123===r){if((i=this.parseArgument(e,n)).err)return i;s.push(i.val)}else{if(125===r&&e>0)break;if(35!==r||"plural"!==t&&"selectordinal"!==t){if(60===r&&!this.ignoreTag&&47===this.peek()){if(n)break;return this.error(rt.UNMATCHED_CLOSING_TAG,Rt(this.clonePosition(),this.clonePosition()))}if(60===r&&!this.ignoreTag&&en(this.peek()||0)){if((i=this.parseTag(e,t)).err)return i;s.push(i.val)}else{var i;if((i=this.parseLiteral(e,t)).err)return i;s.push(i.val)}}else{var o=this.clonePosition();this.bump(),s.push({type:it.pound,location:Rt(o,this.clonePosition())})}}}return{val:s,err:null}},e.prototype.parseTag=function(e,t){var n=this.clonePosition();this.bump();var s=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:it.literal,value:"<"+s+"/>",location:Rt(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var r=this.parseMessage(e+1,t,!0);if(r.err)return r;var i=r.val,o=this.clonePosition();if(this.bumpIf("")?{val:{type:it.tag,value:s,children:i,location:Rt(n,this.clonePosition())},err:null}:this.error(rt.INVALID_TAG,Rt(o,this.clonePosition())))}return this.error(rt.UNCLOSED_TAG,Rt(n,this.clonePosition()))}return this.error(rt.INVALID_TAG,Rt(n,this.clonePosition()))},e.prototype.parseTagName=function(){var e=this.offset();for(this.bump();!this.isEOF()&&tn(this.char());)this.bump();return this.message.slice(e,this.offset())},e.prototype.parseLiteral=function(e,t){for(var n=this.clonePosition(),s="";;){var r=this.tryParseQuote(t);if(r)s+=r;else{var i=this.tryParseUnquoted(e,t);if(i)s+=i;else{var o=this.tryParseLeftAngleBracket();if(!o)break;s+=o}}}var a=Rt(n,this.clonePosition());return{val:{type:it.literal,value:s,location:a},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(en(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(39===n){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(n);this.bump()}return Vt.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var n=this.char();return 60===n||123===n||35===n&&("plural"===t||"selectordinal"===t)||125===n&&e>0?null:(this.bump(),Vt(n))},e.prototype.parseArgument=function(e,t){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(rt.EXPECT_ARGUMENT_CLOSING_BRACE,Rt(n,this.clonePosition()));if(125===this.char())return this.bump(),this.error(rt.EMPTY_ARGUMENT,Rt(n,this.clonePosition()));var s=this.parseIdentifierIfPossible().value;if(!s)return this.error(rt.MALFORMED_ARGUMENT,Rt(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(rt.EXPECT_ARGUMENT_CLOSING_BRACE,Rt(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:it.argument,value:s,location:Rt(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(rt.EXPECT_ARGUMENT_CLOSING_BRACE,Rt(n,this.clonePosition())):this.parseArgumentOptions(e,t,s,n);default:return this.error(rt.MALFORMED_ARGUMENT,Rt(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=Gt(this.message,t),s=t+n.length;return this.bumpTo(s),{value:n,location:Rt(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,n,s){var r,i=this.clonePosition(),o=this.parseIdentifierIfPossible().value,a=this.clonePosition();switch(o){case"":return this.error(rt.EXPECT_ARGUMENT_TYPE,Rt(i,a));case"number":case"date":case"time":this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition();if((g=this.parseSimpleArgStyleIfPossible()).err)return g;if(0===(f=Wt(g.val)).length)return this.error(rt.EXPECT_ARGUMENT_STYLE,Rt(this.clonePosition(),this.clonePosition()));l={style:f,styleLocation:Rt(c,this.clonePosition())}}if((y=this.tryParseArgumentClose(s)).err)return y;var u=Rt(s,this.clonePosition());if(l&&Kt(null==l?void 0:l.style,"::",0)){var h=Xt(l.style.slice(2));if("number"===o)return(g=this.parseNumberSkeletonFromString(h,l.styleLocation)).err?g:{val:{type:it.number,value:n,location:u,style:g.val},err:null};if(0===h.length)return this.error(rt.EXPECT_DATE_TIME_SKELETON,u);var f={type:ot.dateTime,pattern:h,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?xt(h):{}};return{val:{type:"date"===o?it.date:it.time,value:n,location:u,style:f},err:null}}return{val:{type:"number"===o?it.number:"date"===o?it.date:it.time,value:n,location:u,style:null!==(r=null==l?void 0:l.style)&&void 0!==r?r:null},err:null};case"plural":case"selectordinal":case"select":var p=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(rt.EXPECT_SELECT_ARGUMENT_OPTIONS,Rt(p,at({},p)));this.bumpSpace();var d=this.parseIdentifierIfPossible(),m=0;if("select"!==o&&"offset"===d.value){if(!this.bumpIf(":"))return this.error(rt.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Rt(this.clonePosition(),this.clonePosition()));var g;if(this.bumpSpace(),(g=this.tryParseDecimalInteger(rt.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,rt.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return g;this.bumpSpace(),d=this.parseIdentifierIfPossible(),m=g.val}var y,b=this.tryParsePluralOrSelectOptions(e,o,t,d);if(b.err)return b;if((y=this.tryParseArgumentClose(s)).err)return y;var v=Rt(s,this.clonePosition());return"select"===o?{val:{type:it.select,value:n,options:Ht(b.val),location:v},err:null}:{val:{type:it.plural,value:n,options:Ht(b.val),offset:m,pluralType:"plural"===o?"cardinal":"ordinal",location:v},err:null};default:return this.error(rt.INVALID_ARGUMENT_TYPE,Rt(i,a))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(rt.EXPECT_ARGUMENT_CLOSING_BRACE,Rt(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();){switch(this.char()){case 39:this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(rt.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Rt(n,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var n=[];try{n=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var t=[],n=0,s=e.split(_t).filter((function(e){return e.length>0}));n=48&&o<=57))break;r=!0,i=10*i+(o-48),this.bump()}var a=Rt(s,this.clonePosition());return r?Ft(i*=n)?{val:i,err:null}:this.error(t,a):this.error(e,a)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=Yt(this.message,e);if(void 0===t)throw Error("Offset "+e+" is at invalid UTF-16 code unit boundary");return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(Kt(this.message,e,this.offset())){for(var t=0;t=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset "+e+" must be greater than or equal to the current offset "+this.offset());for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset "+e+" is at invalid UTF-16 code unit boundary");if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&nn(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),n=this.message.charCodeAt(t+(e>=65536?2:1));return null!=n?n:null},e}();function en(e){return e>=97&&e<=122||e>=65&&e<=90}function tn(e){return 45===e||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function nn(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function sn(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function rn(e){e.forEach((function(e){if(delete e.location,dt(e)||mt(e))for(var t in e.options)delete e.options[t].location,rn(e.options[t].value);else ht(e)&&bt(e.style)||(ft(e)||pt(e))&&vt(e.style)?delete e.style.location:yt(e)&&rn(e.children)}))}function on(e,t){void 0===t&&(t={}),t=at({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new Qt(e,t).parse();if(n.err){var s=SyntaxError(rt[n.err.kind]);throw s.location=n.err.location,s.originalMessage=n.err.message,s}return(null==t?void 0:t.captureLocation)||rn(n.val),n.val}function an(e,t){var n=t&&t.cache?t.cache:mn,s=t&&t.serializer?t.serializer:fn;return(t&&t.strategy?t.strategy:hn)(e,{cache:n,serializer:s})}function ln(e,t,n,s){var r,i=null==(r=s)||"number"==typeof r||"boolean"==typeof r?s:n(s),o=t.get(i);return void 0===o&&(o=e.call(this,s),t.set(i,o)),o}function cn(e,t,n){var s=Array.prototype.slice.call(arguments,3),r=n(s),i=t.get(r);return void 0===i&&(i=e.apply(this,s),t.set(r,i)),i}function un(e,t,n,s,r){return n.bind(t,e,s,r)}function hn(e,t){return un(e,this,1===e.length?ln:cn,t.cache.create(),t.serializer)}var fn=function(){return JSON.stringify(arguments)};function pn(){this.cache=Object.create(null)}pn.prototype.has=function(e){return e in this.cache},pn.prototype.get=function(e){return this.cache[e]},pn.prototype.set=function(e,t){this.cache[e]=t};var dn,mn={create:function(){return new pn}},gn={variadic:function(e,t){return un(e,this,cn,t.cache.create(),t.serializer)},monadic:function(e,t){return un(e,this,ln,t.cache.create(),t.serializer)}};!function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"}(dn||(dn={}));var yn,bn=function(e){function t(t,n,s){var r=e.call(this,t)||this;return r.code=n,r.originalMessage=s,r}return st(t,e),t.prototype.toString=function(){return"[formatjs Error: "+this.code+"] "+this.message},t}(Error),vn=function(e){function t(t,n,s,r){return e.call(this,'Invalid values for "'+t+'": "'+n+'". Options are "'+Object.keys(s).join('", "')+'"',dn.INVALID_VALUE,r)||this}return st(t,e),t}(bn),wn=function(e){function t(t,n,s){return e.call(this,'Value for "'+t+'" must be of type '+n,dn.INVALID_VALUE,s)||this}return st(t,e),t}(bn),kn=function(e){function t(t,n){return e.call(this,'The intl string context variable "'+t+'" was not provided to the string "'+n+'"',dn.MISSING_VALUE,n)||this}return st(t,e),t}(bn);function En(e){return"function"==typeof e}function xn(e,t,n,s,r,i,o){if(1===e.length&&ct(e[0]))return[{type:yn.literal,value:e[0].value}];for(var a=[],l=0,c=e;ln?(t in An||(An[t]={}),e in An[t]||(An[t][e]=n),n):n,Nn=(e,t)=>{if(null==t)return;if(t in An&&e in An[t])return An[t][e];const n=Hn(t);for(let s=0;s0){const t=n.slice(e,n.length).join(".");if(t in s){s=s[t];break}}s=s[n[e]]}else s=void 0;return s}(function(e){return On[e]||null}(e),t):null}function Mn(e,...t){delete An[e],Ln.update((n=>(n[e]=tt.all([n[e]||{},...t]),n)))}Ve([Ln],(([e])=>Object.keys(e))),Ln.subscribe((e=>On=e));const Rn={};function Pn(e){return Rn[e]}function qn(e){return Hn(e).some((e=>{var t;return null===(t=Pn(e))||void 0===t?void 0:t.size}))}const Dn={};function zn(e){if(!qn(e))return e in Dn?Dn[e]:void 0;const t=function(e){return Hn(e).map((e=>{const t=Pn(e);return[e,t?[...t]:[]]})).filter((([,e])=>e.length>0))}(e);return Dn[e]=Promise.all(t.map((([e,t])=>function(e,t){return Promise.all(t.map((t=>(function(e,t){Rn[e].delete(t),0===Rn[e].size&&delete Rn[e]}(e,t),t().then((e=>e.default||e)))))).then((t=>Mn(e,...t)))}(e,t)))).then((()=>{if(qn(e))return zn(e);delete Dn[e]})),Dn[e]} +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).quizdown=t()}(this,(function(){"use strict";function e(){}const t=e=>e;function n(e,t){for(const n in t)e[n]=t[n];return e}function s(e){return e()}function r(){return Object.create(null)}function i(e){e.forEach(s)}function o(e){return"function"==typeof e}function a(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function l(t,...n){if(null==t)return e;const s=t.subscribe(...n);return s.unsubscribe?()=>s.unsubscribe():s}function c(e){let t;return l(e,(e=>t=e))(),t}function u(e,t,n){e.$$.on_destroy.push(l(t,n))}function h(e,t,s,r){return e[1]&&r?n(s.ctx.slice(),e[1](r(t))):s.ctx}function f(e,t,n,s,r,i,o){const a=function(e,t,n,s){if(e[2]&&s){const r=e[2](s(n));if(void 0===t.dirty)return r;if("object"==typeof r){const e=[],n=Math.max(t.dirty.length,r.length);for(let s=0;swindow.performance.now():()=>Date.now(),g=d?e=>requestAnimationFrame(e):e;const y=new Set;function b(e){y.forEach((t=>{t.c(e)||(y.delete(t),t.f())})),0!==y.size&&g(b)}function v(e){let t;return 0===y.size&&g(b),{promise:new Promise((n=>{y.add(t={c:e,f:n})})),abort(){y.delete(t)}}}let w=!1;function k(e,t,n,s){for(;e>1);n(r)<=s?e=r+1:t=r}return e}function E(e,t,n){const s=_(e);if(!function(e){let t,n=e[0],s=1;for(;sn.call(t,...e))),t=void 0)}return n}([s,"optionalAccess",e=>e.getElementById,"call",e=>e(t)])){const e=O("style");e.id=t,e.textContent=n,S(s,e)}}function x(e){return e?e.getRootNode?e.getRootNode():e.ownerDocument:document}function _(e){const t=x(e);return t.host,t}function S(e,t){T(e.head||e,t)}function T(e,t){w?(!function(e){if(e.hydrate_init)return;e.hydrate_init=!0;const t=e.childNodes,n=new Int32Array(t.length+1),s=new Int32Array(t.length);n[0]=-1;let r=0;for(let e=0;et[n[e]].claim_order),t[e].claim_order)-1;s[e]=n[i]+1;const o=i+1;n[o]=e,r=Math.max(o,r)}const i=[],o=[];let a=t.length-1;for(let e=n[r]+1;0!=e;e=s[e-1]){for(i.push(t[e-1]);a>=e;a--)o.push(t[a]);a--}for(;a>=0;a--)o.push(t[a]);i.reverse(),o.sort(((e,t)=>e.claim_order-t.claim_order));for(let t=0,n=0;t=i[n].claim_order;)n++;const s=ne.removeEventListener(t,n,s)}function P(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function q(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function D(e,t,n,s){e.style.setProperty(t,n,s?"important":"")}class z{constructor(e){this.e=this.n=null,this.l=e}m(e,t,n=null){this.e||(this.e=O(t.nodeName),this.t=t,this.l?this.n=this.l:this.h(e)),this.i(n)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.childNodes)}i(e){for(let t=0;t>>0}(u)}_${a}`,f=x(e);U.add(f);const p=f.__svelte_stylesheet||(f.__svelte_stylesheet=function(e){const t=O("style");return S(_(e),t),t}(e).sheet),d=f.__svelte_rules||(f.__svelte_rules={});d[h]||(d[h]=!0,p.insertRule(`@keyframes ${h} ${u}`,p.cssRules.length));const m=e.style.animation||"";return e.style.animation=`${m?`${m}, `:""}${h} ${s}ms linear ${r}ms 1 both`,F+=1,h}function G(e,t){const n=(e.style.animation||"").split(", "),s=n.filter(t?e=>e.indexOf(t)<0:e=>-1===e.indexOf("__svelte")),r=n.length-s.length;r&&(e.style.animation=s.join(", "),F-=r,F||g((()=>{F||(U.forEach((e=>{const t=e.__svelte_stylesheet;let n=t.cssRules.length;for(;n--;)t.deleteRule(n);e.__svelte_rules={}})),U.clear())})))}function K(e){const t=getComputedStyle(e);if("absolute"!==t.position&&"fixed"!==t.position){const{width:n,height:s}=t,r=e.getBoundingClientRect();e.style.position="absolute",e.style.width=n,e.style.height=s,function(e,t){const n=e.getBoundingClientRect();if(t.left!==n.left||t.top!==n.top){const s=getComputedStyle(e),r="none"===s.transform?"":s.transform;e.style.transform=`${r} translate(${t.left-n.left}px, ${t.top-n.top}px)`}}(e,r)}}function V(e){j=e}function H(e){(function(){if(!j)throw new Error("Function called outside component initialization");return j})().$$.on_mount.push(e)}const Y=[],X=[],W=[],J=[],Z=Promise.resolve();let Q=!1;function ee(e){W.push(e)}let te=!1;const ne=new Set;function se(){if(!te){te=!0;do{for(let e=0;e{ie.delete(e),s&&(n&&e.d(1),s())})),e.o(t)}}const he="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function fe(e,t){e.f(),function(e,t){e.d(1),t.delete(e.key)}(e,t)}function pe(e){e&&e.c()}function de(e,t,n,r){const{fragment:a,on_mount:l,on_destroy:c,after_update:u}=e.$$;a&&a.m(t,n),r||ee((()=>{const t=l.map(s).filter(o);c?c.push(...t):i(t),e.$$.on_mount=[]})),u.forEach(ee)}function me(e,t){const n=e.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function ge(e,t){-1===e.$$.dirty[0]&&(Y.push(e),Q||(Q=!0,Z.then(se)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const r=s.length?s[0]:n;return f.ctx&&a(f.ctx[e],f.ctx[e]=r)&&(!f.skip_bound&&f.bound[e]&&f.bound[e](r),p&&ge(t,e)),n})):[],f.update(),p=!0,i(f.before_update),f.fragment=!!o&&o(f.ctx),n.target){if(n.hydrate){w=!0;const e=function(e){return Array.from(e.childNodes)}(n.target);f.fragment&&f.fragment.l(e),e.forEach($)}else f.fragment&&f.fragment.c();n.intro&&ce(t.$$.fragment),de(t,n.target,n.anchor,n.customElement),w=!1,se()}V(h)}class be{$destroy(){me(this,1),this.$destroy=e}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function ve(e){const t=e-1;return t*t*t+1}function we(e,t,n={}){const s=getComputedStyle(e),r="none"===s.transform?"":s.transform,i=t.from.width/e.clientWidth,a=t.from.height/e.clientHeight,l=(t.from.left-t.to.left)/i,c=(t.from.top-t.to.top)/a,u=Math.sqrt(l*l+c*c),{delay:h=0,duration:f=(e=>120*Math.sqrt(e)),easing:p=ve}=n;return{delay:h,duration:o(f)?f(u):f,easing:p,css:(e,t)=>`transform: ${r} translate(${t*l}px, ${t*c}px);`}}const{Map:ke}=he;function Ee(e){E(e,"svelte-1imq117",".dragdroplist.svelte-1imq117.svelte-1imq117{position:relative;padding:0}.list.svelte-1imq117.svelte-1imq117{cursor:grab;z-index:5;display:flex;flex-direction:column}.item.svelte-1imq117.svelte-1imq117{box-sizing:border-box;display:inline-flex;width:100%;margin-bottom:0.5em;border-radius:2px;user-select:none;margin:5px;padding:0;background-color:var(--quizdown-color-secondary);border:3px solid transparent;color:var(--quizdown-color-text)}.item.svelte-1imq117.svelte-1imq117:last-child{margin-bottom:0}.item.svelte-1imq117.svelte-1imq117:not(#grabbed):not(#ghost){z-index:10}.item.svelte-1imq117>.svelte-1imq117{margin:auto auto auto 0}.buttons.svelte-1imq117.svelte-1imq117{width:32px;min-width:32px;margin:auto 0;display:flex;flex-direction:column}.buttons.svelte-1imq117 button.svelte-1imq117{cursor:pointer;width:18px;height:18px;margin:0 auto;padding:0;border:1px solid rgba(0, 0, 0, 0);background-color:inherit}.buttons.svelte-1imq117 button.svelte-1imq117:focus{border:1px solid black}.delete.svelte-1imq117.svelte-1imq117{width:32px}#grabbed.svelte-1imq117.svelte-1imq117{opacity:0}#ghost.svelte-1imq117.svelte-1imq117{pointer-events:none;z-index:-5;position:absolute;top:0;left:0;opacity:0;border:3px solid var(--quizdown-color-primary);background-color:var(--quizdown-color-secondary)}#ghost.svelte-1imq117 .svelte-1imq117{pointer-events:none}#ghost.haunting.svelte-1imq117.svelte-1imq117{z-index:20;opacity:1}")}function xe(e,t,n){const s=e.slice();return s[28]=t[n],s[30]=n,s}function _e(e){let t,n,s=e[28]+"";return{c(){t=O("p"),n=I(s)},m(e,s){A(e,t,s),T(t,n)},p(e,t){1&t&&s!==(s=e[28]+"")&&q(n,s)},d(e){e&&$(t)}}}function Se(e){let t,n,s=e[28].text+"";return{c(){t=O("p"),n=I(s)},m(e,s){A(e,t,s),T(t,n)},p(e,t){1&t&&s!==(s=e[28].text+"")&&q(n,s)},d(e){e&&$(t)}}}function Te(e){let t,n,s=e[28].html+"";return{c(){t=new z,n=M(),t.a=n},m(e,r){t.m(s,e,r),A(e,n,r)},p(e,n){1&n&&s!==(s=e[28].html+"")&&t.p(s)},d(e){e&&$(n),e&&t.d()}}}function Ae(e){let t,n,s;function r(...t){return e[17](e[30],...t)}return{c(){t=O("button"),t.innerHTML='',P(t,"class","svelte-1imq117")},m(e,i){A(e,t,i),n||(s=R(t,"click",r),n=!0)},p(t,n){e=t},d(e){e&&$(t),n=!1,s()}}}function $e(n,s){let r,o,a,l,c,u,h,f,p,d,g,y,b,w,k,E,x,_,S,N,I,M,q,D,z=e;function U(...e){return s[15](s[30],...e)}function j(...e){return s[16](s[30],...e)}function F(e,t){return e[28].html?Te:e[28].text?Se:_e}let V=F(s),H=V(s),Y=s[1]&&Ae(s);return{key:n,first:null,c(){r=O("div"),o=O("div"),a=O("button"),l=L("svg"),c=L("path"),u=L("path"),f=C(),p=O("button"),d=L("svg"),g=L("path"),y=L("path"),w=C(),k=O("div"),H.c(),E=C(),x=O("div"),Y&&Y.c(),_=C(),P(c,"d","M0 0h24v24H0V0z"),P(c,"fill","none"),P(u,"d","M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6 1.41 1.41z"),P(l,"xmlns","http://www.w3.org/2000/svg"),P(l,"viewBox","0 0 24 24"),P(l,"width","16px"),P(l,"height","16px"),P(a,"class","up svelte-1imq117"),P(a,"style",h="visibility: "+(s[30]>0?"":"hidden")+";"),P(g,"d","M0 0h24v24H0V0z"),P(g,"fill","none"),P(y,"d","M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"),P(d,"xmlns","http://www.w3.org/2000/svg"),P(d,"viewBox","0 0 24 24"),P(d,"width","16px"),P(d,"height","16px"),P(p,"class","down svelte-1imq117"),P(p,"style",b="visibility: "+(s[30]0?"":"hidden")+";")&&P(a,"style",h),1&t&&b!==(b="visibility: "+(s[30]{if(!y&&e>=u&&(y=!0),y&&e>=h&&(f(1,0),b()),!g)return!1;if(y){const t=0+1*c((e-u)/l);f(t,1-t)}return!0})),p&&(d=B(n,0,1,l,a,c,p)),a||(y=!0),f(0,1),b}(r,M,we,{duration:200})},d(e){e&&$(r),H.d(),Y&&Y.d(),q=!1,i(D)}}}function Ne(t){let n,s,r,o,a,l,c,u,h,f=[],d=new ke,m=t[0];const g=e=>e[28].id?e[28].id:JSON.stringify(e[28]);for(let e=0;eb.get(r)?(w.add(s),k(t)):(v.add(r),f--):(l(n,o),f--)}for(;f--;){const t=e[f];y.has(t.key)||l(t,o)}for(;p;)k(g[p-1]);return g}(f,t,g,1,e,m,d,c,fe,$e,null,xe);for(let e=0;e{"data"in e&&n(0,o=e.data),"removesItems"in e&&n(1,a=e.removesItems)},[o,a,s,r,l,c,u,h,f,p,d,m,g,y,function(e){X[e?"unshift":"push"]((()=>{s=e,n(2,s)}))},function(e,t){m(e,e-1)},function(e,t){m(e,e+1)},function(e,t){y(e)},function(e){h(e.clientY,this)},function(e){h(e.touches[0].clientY,this)},function(e){e.stopPropagation(),d(0,e.target)},function(e){e.stopPropagation(),e.preventDefault(),p(e.touches[0])},function(e){e.stopPropagation(),f(e.clientY)},function(e){e.stopPropagation(),f(e.touches[0].clientY)},function(e){e.stopPropagation(),g()},function(e){e.stopPropagation(),g()},function(e){e.stopPropagation(),g(e.touches[0])}]}class Le extends be{constructor(e){super(),ye(this,e,Oe,Ne,a,{data:0,removesItems:1},Ee)}}function Ie(e){let t,n,s;function r(t){e[4](t)}let i={};return void 0!==e[0].answers&&(i.data=e[0].answers),t=new Le({props:i}),X.push((()=>function(e,t,n){const s=e.$$.props[t];void 0!==s&&(e.$$.bound[s]=n,n(e.$$.ctx[s]))}(t,"data",r))),{c(){pe(t.$$.fragment)},m(e,n){de(t,e,n),s=!0},p(e,[s]){const r={};var i;!n&&1&s&&(n=!0,r.data=e[0].answers,i=()=>n=!1,J.push(i)),t.$set(r)},i(e){s||(ce(t.$$.fragment,e),s=!0)},o(e){ue(t.$$.fragment,e),s=!1},d(e){me(t,e)}}}function Ce(t,n,s){let r,i,o,a=e;t.$$.on_destroy.push((()=>a()));let{quiz:c}=n;return t.$$set=e=>{"quiz"in e&&s(2,c=e.quiz)},t.$$.update=()=>{4&t.$$.dirty&&(s(1,r=c.counter),a(),a=l(r,(e=>s(3,o=e)))),12&t.$$.dirty&&s(0,i=c.questions[o]),1&t.$$.dirty&&s(0,i.selected=i.answers.map((e=>e.id)),i)},[i,r,c,o,function(e){t.$$.not_equal(i.answers,e)&&(i.answers=e,s(0,i),s(2,c),s(3,o))}]}class Me extends be{constructor(e){super(),ye(this,e,Ce,Ie,a,{quiz:2})}}function Re(e){E(e,"svelte-1kynd15","[type='checkbox'].svelte-1kynd15.svelte-1kynd15,[type='radio'].svelte-1kynd15.svelte-1kynd15{display:none}[type='radio'].svelte-1kynd15+span.svelte-1kynd15{border-radius:0.5em}[type='checkbox'].svelte-1kynd15+span.svelte-1kynd15{border-radius:2px}[type='checkbox'].svelte-1kynd15+span.svelte-1kynd15,[type='radio'].svelte-1kynd15+span.svelte-1kynd15{transition-duration:0.3s;background-color:var(--quizdown-color-secondary);color:var(--quizdown-color-text);display:block;padding:0.5rem;margin:5px;border:3px solid transparent;cursor:pointer}[type='checkbox'].svelte-1kynd15:hover+span.svelte-1kynd15,[type='radio'].svelte-1kynd15:hover+span.svelte-1kynd15{filter:brightness(0.9)}[type='checkbox'].svelte-1kynd15:checked+span.svelte-1kynd15,[type='radio'].svelte-1kynd15:checked+span.svelte-1kynd15{border:3px solid var(--quizdown-color-primary)}")}function Pe(e,t,n){const s=e.slice();return s[7]=t[n],s[9]=n,s}function qe(e,t,n){const s=e.slice();return s[7]=t[n],s[9]=n,s}function De(e){let t,n=e[1].answers,s=[];for(let t=0;ta()));let{quiz:c}=n;const u=[[],[]];return t.$$set=e=>{"quiz"in e&&s(2,c=e.quiz)},t.$$.update=()=>{4&t.$$.dirty&&(s(0,r=c.counter),a(),a=l(r,(e=>s(3,o=e)))),12&t.$$.dirty&&s(1,i=c.questions[o])},[r,i,c,o,function(){i.selected=function(e,t,n){const s=new Set;for(let t=0;t{const e=r.indexOf(l);-1!==e&&r.splice(e,1),0===r.length&&(s(),s=null)}}}}function He(t,n,s){const r=!Array.isArray(t),a=r?[t]:t,c=n.length<2;return{subscribe:Ve(s,(t=>{let s=!1;const u=[];let h=0,f=e;const p=()=>{if(h)return;f();const s=n(r?u[0]:u,t);c?t(s):f=o(s)?s:e},d=a.map(((e,t)=>l(e,(e=>{u[t]=e,h&=~(1<{h|=1<1)throw new RangeError("integer-width stems only accept a single optional option");r.options[0].replace($t,(function(e,n,s,r,i,o){if(n)t.minimumIntegerDigits=s.length;else{if(r&&i)throw new Error("We currently do not support maximum integer digits");if(o)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(Nt.test(r.stem))t.minimumIntegerDigits=r.stem.length;else if(Tt.test(r.stem)){if(r.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");r.stem.replace(Tt,(function(e,n,s,r,i,o){return"*"===s?t.minimumFractionDigits=n.length:r&&"#"===r[0]?t.maximumFractionDigits=r.length:i&&o?(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length+o.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),""})),r.options.length&&(t=lt(lt({},t),Ot(r.options[0])))}else if(At.test(r.stem))t=lt(lt({},t),Ot(r.stem));else{var i=Lt(r.stem);i&&(t=lt(lt({},t),i));var o=It(r.stem);o&&(t=lt(lt({},t),o))}}return t}var Rt=new RegExp("^"+kt.source+"*"),Pt=new RegExp(kt.source+"*$");function qt(e,t){return{start:e,end:t}}var Dt=!!String.prototype.startsWith,zt=!!String.fromCodePoint,Ut=!!Object.fromEntries,jt=!!String.prototype.codePointAt,Ft=!!String.prototype.trimStart,Bt=!!String.prototype.trimEnd,Gt=!!Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Kt=!0;try{Kt="a"===(null===(St=Qt("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===St?void 0:St[0])}catch(e){Kt=!1}var Vt,Ht=Dt?function(e,t,n){return e.startsWith(t,n)}:function(e,t,n){return e.slice(n,n+t.length)===t},Yt=zt?String.fromCodePoint:function(){for(var e=[],t=0;ti;){if((n=e[i++])>1114111)throw RangeError(n+" is not a valid code point");s+=n<65536?String.fromCharCode(n):String.fromCharCode(55296+((n-=65536)>>10),n%1024+56320)}return s},Xt=Ut?Object.fromEntries:function(e){for(var t={},n=0,s=e;n=n)){var s,r=e.charCodeAt(t);return r<55296||r>56319||t+1===n||(s=e.charCodeAt(t+1))<56320||s>57343?r:s-56320+(r-55296<<10)+65536}},Jt=Ft?function(e){return e.trimStart()}:function(e){return e.replace(Rt,"")},Zt=Bt?function(e){return e.trimEnd()}:function(e){return e.replace(Pt,"")};function Qt(e,t){return new RegExp(e,t)}if(Kt){var en=Qt("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Vt=function(e,t){var n;return en.lastIndex=t,null!==(n=en.exec(e)[1])&&void 0!==n?n:""}}else Vt=function(e,t){for(var n=[];;){var s=Wt(e,t);if(void 0===s||rn(s)||on(s))break;n.push(s),t+=s>=65536?2:1}return Yt.apply(void 0,n)};var tn=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,n){for(var s=[];!this.isEOF();){var r=this.char();if(123===r){if((i=this.parseArgument(e,n)).err)return i;s.push(i.val)}else{if(125===r&&e>0)break;if(35!==r||"plural"!==t&&"selectordinal"!==t){if(60===r&&!this.ignoreTag&&47===this.peek()){if(n)break;return this.error(it.UNMATCHED_CLOSING_TAG,qt(this.clonePosition(),this.clonePosition()))}if(60===r&&!this.ignoreTag&&nn(this.peek()||0)){if((i=this.parseTag(e,t)).err)return i;s.push(i.val)}else{var i;if((i=this.parseLiteral(e,t)).err)return i;s.push(i.val)}}else{var o=this.clonePosition();this.bump(),s.push({type:ot.pound,location:qt(o,this.clonePosition())})}}}return{val:s,err:null}},e.prototype.parseTag=function(e,t){var n=this.clonePosition();this.bump();var s=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:ot.literal,value:"<"+s+"/>",location:qt(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var r=this.parseMessage(e+1,t,!0);if(r.err)return r;var i=r.val,o=this.clonePosition();if(this.bumpIf("")?{val:{type:ot.tag,value:s,children:i,location:qt(n,this.clonePosition())},err:null}:this.error(it.INVALID_TAG,qt(o,this.clonePosition())))}return this.error(it.UNCLOSED_TAG,qt(n,this.clonePosition()))}return this.error(it.INVALID_TAG,qt(n,this.clonePosition()))},e.prototype.parseTagName=function(){var e=this.offset();for(this.bump();!this.isEOF()&&sn(this.char());)this.bump();return this.message.slice(e,this.offset())},e.prototype.parseLiteral=function(e,t){for(var n=this.clonePosition(),s="";;){var r=this.tryParseQuote(t);if(r)s+=r;else{var i=this.tryParseUnquoted(e,t);if(i)s+=i;else{var o=this.tryParseLeftAngleBracket();if(!o)break;s+=o}}}var a=qt(n,this.clonePosition());return{val:{type:ot.literal,value:s,location:a},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(nn(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(39===n){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(n);this.bump()}return Yt.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var n=this.char();return 60===n||123===n||35===n&&("plural"===t||"selectordinal"===t)||125===n&&e>0?null:(this.bump(),Yt(n))},e.prototype.parseArgument=function(e,t){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(it.EXPECT_ARGUMENT_CLOSING_BRACE,qt(n,this.clonePosition()));if(125===this.char())return this.bump(),this.error(it.EMPTY_ARGUMENT,qt(n,this.clonePosition()));var s=this.parseIdentifierIfPossible().value;if(!s)return this.error(it.MALFORMED_ARGUMENT,qt(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(it.EXPECT_ARGUMENT_CLOSING_BRACE,qt(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:ot.argument,value:s,location:qt(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(it.EXPECT_ARGUMENT_CLOSING_BRACE,qt(n,this.clonePosition())):this.parseArgumentOptions(e,t,s,n);default:return this.error(it.MALFORMED_ARGUMENT,qt(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=Vt(this.message,t),s=t+n.length;return this.bumpTo(s),{value:n,location:qt(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,n,s){var r,i=this.clonePosition(),o=this.parseIdentifierIfPossible().value,a=this.clonePosition();switch(o){case"":return this.error(it.EXPECT_ARGUMENT_TYPE,qt(i,a));case"number":case"date":case"time":this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition();if((g=this.parseSimpleArgStyleIfPossible()).err)return g;if(0===(f=Zt(g.val)).length)return this.error(it.EXPECT_ARGUMENT_STYLE,qt(this.clonePosition(),this.clonePosition()));l={style:f,styleLocation:qt(c,this.clonePosition())}}if((y=this.tryParseArgumentClose(s)).err)return y;var u=qt(s,this.clonePosition());if(l&&Ht(null==l?void 0:l.style,"::",0)){var h=Jt(l.style.slice(2));if("number"===o)return(g=this.parseNumberSkeletonFromString(h,l.styleLocation)).err?g:{val:{type:ot.number,value:n,location:u,style:g.val},err:null};if(0===h.length)return this.error(it.EXPECT_DATE_TIME_SKELETON,u);var f={type:at.dateTime,pattern:h,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?xt(h):{}};return{val:{type:"date"===o?ot.date:ot.time,value:n,location:u,style:f},err:null}}return{val:{type:"number"===o?ot.number:"date"===o?ot.date:ot.time,value:n,location:u,style:null!==(r=null==l?void 0:l.style)&&void 0!==r?r:null},err:null};case"plural":case"selectordinal":case"select":var p=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(it.EXPECT_SELECT_ARGUMENT_OPTIONS,qt(p,lt({},p)));this.bumpSpace();var d=this.parseIdentifierIfPossible(),m=0;if("select"!==o&&"offset"===d.value){if(!this.bumpIf(":"))return this.error(it.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,qt(this.clonePosition(),this.clonePosition()));var g;if(this.bumpSpace(),(g=this.tryParseDecimalInteger(it.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,it.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return g;this.bumpSpace(),d=this.parseIdentifierIfPossible(),m=g.val}var y,b=this.tryParsePluralOrSelectOptions(e,o,t,d);if(b.err)return b;if((y=this.tryParseArgumentClose(s)).err)return y;var v=qt(s,this.clonePosition());return"select"===o?{val:{type:ot.select,value:n,options:Xt(b.val),location:v},err:null}:{val:{type:ot.plural,value:n,options:Xt(b.val),offset:m,pluralType:"plural"===o?"cardinal":"ordinal",location:v},err:null};default:return this.error(it.INVALID_ARGUMENT_TYPE,qt(i,a))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(it.EXPECT_ARGUMENT_CLOSING_BRACE,qt(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();){switch(this.char()){case 39:this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(it.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,qt(n,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var n=[];try{n=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var t=[],n=0,s=e.split(_t).filter((function(e){return e.length>0}));n=48&&o<=57))break;r=!0,i=10*i+(o-48),this.bump()}var a=qt(s,this.clonePosition());return r?Gt(i*=n)?{val:i,err:null}:this.error(t,a):this.error(e,a)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=Wt(this.message,e);if(void 0===t)throw Error("Offset "+e+" is at invalid UTF-16 code unit boundary");return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(Ht(this.message,e,this.offset())){for(var t=0;t=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset "+e+" must be greater than or equal to the current offset "+this.offset());for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset "+e+" is at invalid UTF-16 code unit boundary");if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&rn(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),n=this.message.charCodeAt(t+(e>=65536?2:1));return null!=n?n:null},e}();function nn(e){return e>=97&&e<=122||e>=65&&e<=90}function sn(e){return 45===e||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function rn(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function on(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function an(e){e.forEach((function(e){if(delete e.location,mt(e)||gt(e))for(var t in e.options)delete e.options[t].location,an(e.options[t].value);else ft(e)&&vt(e.style)||(pt(e)||dt(e))&&wt(e.style)?delete e.style.location:bt(e)&&an(e.children)}))}function ln(e,t){void 0===t&&(t={}),t=lt({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new tn(e,t).parse();if(n.err){var s=SyntaxError(it[n.err.kind]);throw s.location=n.err.location,s.originalMessage=n.err.message,s}return(null==t?void 0:t.captureLocation)||an(n.val),n.val}function cn(e,t){var n=t&&t.cache?t.cache:yn,s=t&&t.serializer?t.serializer:dn;return(t&&t.strategy?t.strategy:pn)(e,{cache:n,serializer:s})}function un(e,t,n,s){var r,i=null==(r=s)||"number"==typeof r||"boolean"==typeof r?s:n(s),o=t.get(i);return void 0===o&&(o=e.call(this,s),t.set(i,o)),o}function hn(e,t,n){var s=Array.prototype.slice.call(arguments,3),r=n(s),i=t.get(r);return void 0===i&&(i=e.apply(this,s),t.set(r,i)),i}function fn(e,t,n,s,r){return n.bind(t,e,s,r)}function pn(e,t){return fn(e,this,1===e.length?un:hn,t.cache.create(),t.serializer)}var dn=function(){return JSON.stringify(arguments)};function mn(){this.cache=Object.create(null)}mn.prototype.has=function(e){return e in this.cache},mn.prototype.get=function(e){return this.cache[e]},mn.prototype.set=function(e,t){this.cache[e]=t};var gn,yn={create:function(){return new mn}},bn={variadic:function(e,t){return fn(e,this,hn,t.cache.create(),t.serializer)},monadic:function(e,t){return fn(e,this,un,t.cache.create(),t.serializer)}};!function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"}(gn||(gn={}));var vn,wn=function(e){function t(t,n,s){var r=e.call(this,t)||this;return r.code=n,r.originalMessage=s,r}return rt(t,e),t.prototype.toString=function(){return"[formatjs Error: "+this.code+"] "+this.message},t}(Error),kn=function(e){function t(t,n,s,r){return e.call(this,'Invalid values for "'+t+'": "'+n+'". Options are "'+Object.keys(s).join('", "')+'"',gn.INVALID_VALUE,r)||this}return rt(t,e),t}(wn),En=function(e){function t(t,n,s){return e.call(this,'Value for "'+t+'" must be of type '+n,gn.INVALID_VALUE,s)||this}return rt(t,e),t}(wn),xn=function(e){function t(t,n){return e.call(this,'The intl string context variable "'+t+'" was not provided to the string "'+n+'"',gn.MISSING_VALUE,n)||this}return rt(t,e),t}(wn);function _n(e){return"function"==typeof e}function Sn(e,t,n,s,r,i,o){if(1===e.length&&ut(e[0]))return[{type:vn.literal,value:e[0].value}];for(var a=[],l=0,c=e;ln?(t in Nn||(Nn[t]={}),e in Nn[t]||(Nn[t][e]=n),n):n,Ln=(e,t)=>{if(null==t)return;if(t in Nn&&e in Nn[t])return Nn[t][e];const n=Xn(t);for(let s=0;s0){const t=n.slice(e,n.length).join(".");if(t in s){s=s[t];break}}s=s[n[e]]}else s=void 0;return s}(function(e){return In[e]||null}(e),t):null}function Pn(e,...t){delete Nn[e],Cn.update((n=>(n[e]=nt.all([n[e]||{},...t]),n)))}He([Cn],(([e])=>Object.keys(e))),Cn.subscribe((e=>In=e));const qn={};function Dn(e){return qn[e]}function zn(e){return Xn(e).some((e=>{var t;return null===(t=Dn(e))||void 0===t?void 0:t.size}))}const Un={};function jn(e){if(!zn(e))return e in Un?Un[e]:void 0;const t=function(e){return Xn(e).map((e=>{const t=Dn(e);return[e,t?[...t]:[]]})).filter((([,e])=>e.length>0))}(e);return Un[e]=Promise.all(t.map((([e,t])=>function(e,t){return Promise.all(t.map((t=>(function(e,t){qn[e].delete(t),0===qn[e].size&&delete qn[e]}(e,t),t().then((e=>e.default||e)))))).then((t=>Pn(e,...t)))}(e,t)))).then((()=>{if(zn(e))return jn(e);delete Un[e]})),Un[e]} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -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}`}})+"",u=t[0].questions,h=[];for(let e=0;e${e[0].points}`,total:`${e[0].counter.max}`}})+"")&&(i.innerHTML=c),5&t){let n;for(u=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[4][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[4][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;return t=new gs({props:{quiz:e[0]}}),{c(){fe(t.$$.fragment)},m(e,s){pe(t,e,s),n=!0},p(e,n){const s={};1&n&&(s.quiz=e[0]),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 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=e;t.$$.on_destroy.push((()=>a()));let{quiz:c}=n,u={MultipleChoice:Be,SingleChoice:Be,Sequence:Ce};return t.$$set=e=>{"quiz"in e&&s(0,c=e.quiz)},t.$$.update=()=>{1&t.$$.dirty&&(s(2,r=c.counter),a(),a=l(r,(e=>s(1,o=e)))),3&t.$$.dirty&&s(3,i=c.questions[o])},[c,o,r,i,u]}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 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",resultsTitle:"Your quiz results",resultsText:"You have answered {points} out of {total} questions correctly!"},Xs={next:"Weiter",previous:"Zurück",evaluate:"Zum Ergebnis",reset:"Noch einmal!",hint:"💡 Tipp anzeigen",resultsTitle:"Ihr Ergebnis",resultsText:"Sie haben {points} von {total} Fragen richtig beantwortet!"},Ws={next:"Suivant",previous:"Précédent",evaluate:"Réponse",reset:"Recommencer!",hint:"💡 Indice",resultsTitle:"Vos résultats",resultsText:"Vous avez répondu correctement à {points} questions sur {total}!"},Js={next:"Siguiente",previous:"Anterior",evaluate:"Respuesta",reset:"Otra vez!",hint:"💡 Pista",resultsTitle:"Resultados",resultsText:"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.primaryColor,t=i.config.secondaryColor,n=i.config.textColor;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 isEqual(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.shuffleAnswers&&(this.answers=ei.shuffle(this.answers))}}class ti extends ei{constructor(e,t,n,s,r){r.shuffleAnswers=!0,super(e,t,n,s,"Sequence",r)}check(){let e=this.answers.map((e=>e.id));return this.solved=ei.isEqual(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.isEqual(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.shuffleQuestions&&(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.startOnLoad=li(e.startOnLoad,!0),this.shuffleAnswers=li(e.shuffleAnswers,!0),this.shuffleQuestions=li(e.shuffleQuestions,!1),this.primaryColor=li(e.primaryColor,"steelblue"),this.secondaryColor=li(e.secondaryColor,"#f2f2f2"),this.textColor=li(e.textColor,"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}const gc={hr(e){const t=RegExp(/^ {0,3}(-{3,}(?=[^-\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~-]* *(?:\n+|$)|$)/).exec(e);if(t){let e=function(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))}(t[3],{});const i={start_on_load:"startOnLoad",shuffle_answers:"shuffleAnswers",shuffle_questions:"shuffleQuestions",primary_color:"primaryColor",secondary_color:"secondaryColor",text_color:"textColor"};for(const t in i)n=t,s=i[t],n in(r=e)&&(r[s]=r[n]);return{type:"options",raw:t[0],data:e}}var n,s,r}},yc={paragraph:e=>e,blockquote:e=>e,heading:e=>e};function bc(e){return Jr.sanitize(Eo.parser(e))}function vc(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=bc([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+=bc([e])),"blockquote"==e.type&&(a+=bc([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+=bc([e]):t+=bc([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 wc(e,t,n){let s;t.innerHTML="",t.shadowRoot?(s=t.shadowRoot,s.innerHTML=""):s=t.attachShadow({mode:"open"});try{let t=vc(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:yc,tokenizer:gc}),{init:function(e={}){let t=new ci(e);t.startOnLoad&&"undefined"!=typeof document&&window.addEventListener("load",(function(){let e=document.querySelectorAll(".quizdown");for(let n of e)wc(n.innerHTML,n,t)}),!1)},register:function(e){return e.setup(this),this},createApp:wc,getMarkedParser:function(){return Eo}}})); + ***************************************************************************** */function Fn(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 Xn(e,t=Gn().fallbackLocale){const n=Yn(e);return t?[...new Set([...n,...Yn(t)])]:n}function Wn(){return Vn}Hn.subscribe((e=>{Vn=e,"undefined"!=typeof window&&null!==e&&document.documentElement.setAttribute("lang",e)}));const Jn=Hn.set;Hn.set=e=>{if(function(e){if(null==e)return;const t=Xn(e);for(let e=0;eKn.set(!0)),t):Kn.set(!0),jn(e).then((()=>{Jn(e)})).finally((()=>{clearTimeout(n),Kn.set(!1)}))}return Jn(e)},Hn.update=e=>Jn(e(Vn));const Zn=e=>{const t=Object.create(null);return n=>{const s=JSON.stringify(n);return s in t?t[s]:t[s]=e(n)}},Qn=(e,t)=>{const{formats:n}=Gn();if(e in n&&t in n[e])return n[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},es=Zn((e=>{var{locale:t,format:n}=e,s=Fn(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return n&&(s=Qn("number",n)),new Intl.NumberFormat(t,s)})),ts=Zn((e=>{var{locale:t,format:n}=e,s=Fn(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return n?s=Qn("date",n):0===Object.keys(s).length&&(s=Qn("date","short")),new Intl.DateTimeFormat(t,s)})),ns=Zn((e=>{var{locale:t,format:n}=e,s=Fn(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return n?s=Qn("time",n):0===Object.keys(s).length&&(s=Qn("time","short")),new Intl.DateTimeFormat(t,s)})),ss=Zn(((e,t=Wn())=>new $n(e,t,Gn().formats,{ignoreTag:Gn().ignoreTag}))),rs=(e,t={})=>{"object"==typeof e&&(e=(t=e).id);const{values:n,locale:s=Wn(),default:r}=t;if(null==s)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let i=Ln(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 Gn().warnOnMissingMessages&&console.warn(`[svelte-i18n] The message "${e}" was not found in "${Xn(s).join('", "')}".${zn(Wn())?"\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=ss(i,s).format(n)}catch(t){console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,t.message)}return o},is=(e,t)=>((e={})=>{var{locale:t=Wn()}=e,n=Fn(e,["locale"]);return ns(Object.assign({locale:t},n))})(t).format(e),os=(e,t)=>((e={})=>{var{locale:t=Wn()}=e,n=Fn(e,["locale"]);return ts(Object.assign({locale:t},n))})(t).format(e),as=(e,t)=>((e={})=>{var{locale:t=Wn()}=e,n=Fn(e,["locale"]);return es(Object.assign({locale:t},n))})(t).format(e),ls=(e,t=Wn())=>Ln(e,t),cs=He([Hn,Cn],(()=>rs));function us(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 hs(e,t,n){const s=e.slice();return s[4]=t[n],s[6]=n,s}function fs(e,t,n){const s=e.slice();return s[7]=t[n],s}function ps(e){let t,n,s,r,i,o=e[4].answers[e[7]].html+"",a=e[4].answers[e[7]].comment+"";return{c(){t=O("li"),n=O("i"),s=I(":\n "),r=new z,i=C(),r.a=i,P(t,"class","list-comment svelte-xeqbwq")},m(e,l){A(e,t,l),T(t,n),n.innerHTML=o,T(t,s),r.m(a,t),T(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&&$(t)}}}function ds(e){let t,n=""!==e[4].answers[e[7]].comment&&ps(e);return{c(){n&&n.c(),t=M()},m(e,s){n&&n.m(e,s),A(e,t,s)},p(e,s){""!==e[4].answers[e[7]].comment?n?n.p(e,s):(n=ps(e),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(e){n&&n.d(e),e&&$(t)}}}function ms(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}`}})+"",u=t[0].questions,h=[];for(let e=0;e${e[0].points}`,total:`${e[0].counter.max}`}})+"")&&(i.innerHTML=c),5&t){let n;for(u=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)]}He([Hn],(()=>is)),He([Hn],(()=>os)),He([Hn],(()=>as)),He([Hn,Cn],(()=>ls));class bs extends be{constructor(e){super(),ye(this,e,ys,gs,a,{quiz:0},us)}}function vs(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&&ks(e);var d=e[4][e[3].type];function m(e){return{props:{quiz:e[0]}}}return d&&(l=new d(m(e))),{c(){t=O("h3"),n=I("Q"),s=I(h),r=I(": "),i=new z,o=C(),p&&p.c(),a=C(),l&&pe(l.$$.fragment),c=M(),i.a=null},m(e,h){A(e,t,h),T(t,n),T(t,s),T(t,r),i.m(f,t),A(e,o,h),p&&p.m(e,h),A(e,a,h),l&&de(l,e,h),A(e,c,h),u=!0},p(e,t){(!u||2&t)&&h!==(h=e[1]+1+"")&&q(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=ks(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[4][e[3].type])){if(l){ae();const e=l;ue(e.$$.fragment,1,0,(()=>{me(e,1)})),le()}d?(l=new d(m(e)),pe(l.$$.fragment),ce(l.$$.fragment,1),de(l,c.parentNode,c)):l=null}else d&&l.$set(n)},i(e){u||(l&&ce(l.$$.fragment,e),u=!0)},o(e){l&&ue(l.$$.fragment,e),u=!1},d(e){e&&$(t),e&&$(o),p&&p.d(e),e&&$(a),e&&$(c),l&&me(l,e)}}}function ws(e){let t,n;return t=new bs({props:{quiz:e[0]}}),{c(){pe(t.$$.fragment)},m(e,s){de(t,e,s),n=!0},p(e,n){const s={};1&n&&(s.quiz=e[0]),t.$set(s)},i(e){n||(ce(t.$$.fragment,e),n=!0)},o(e){ue(t.$$.fragment,e),n=!1},d(e){me(t,e)}}}function ks(e){let t,n=e[3].explanation+"";return{c(){t=O("p")},m(e,s){A(e,t,s),t.innerHTML=n},p(e,s){8&s&&n!==(n=e[3].explanation+"")&&(t.innerHTML=n)},d(e){e&&$(t)}}}function Es(e){let t,n,s,r;const i=[ws,vs],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=M()},m(e,n){o[t].m(e,n),A(e,s,n),r=!0},p(e,[r]){let l=t;t=a(e),t===l?o[t].p(e,r):(ae(),ue(o[l],1,1,(()=>{o[l]=null})),le(),n=o[t],n?n.p(e,r):(n=o[t]=i[t](e),n.c()),ce(n,1),n.m(s.parentNode,s))},i(e){r||(ce(n),r=!0)},o(e){ue(n),r=!1},d(e){o[t].d(e),e&&$(s)}}}function xs(t,n,s){let r,i,o,a=e;t.$$.on_destroy.push((()=>a()));let{quiz:c}=n,u={MultipleChoice:Ge,SingleChoice:Ge,Sequence:Me};return t.$$set=e=>{"quiz"in e&&s(0,c=e.quiz)},t.$$.update=()=>{1&t.$$.dirty&&(s(2,r=c.counter),a(),a=l(r,(e=>s(1,o=e)))),3&t.$$.dirty&&s(3,i=c.questions[o])},[c,o,r,i,u]}class _s extends be{constructor(e){super(),ye(this,e,xs,Es,a,{quiz:0})}}function Ss(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 Ts(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=I("Hello World")},m(e,n){A(e,t,n)},d(e){e&&$(t)}}}();return{c(){t=O("button"),l&&l.c(),t.disabled=e[1],P(t,"class","svelte-1wqt442")},m(i,a){A(i,t,a),l&&l.m(t,null),n=!0,s||(r=R(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||(ce(l,e),n=!0)},o(e){ue(l,e),n=!1},d(e){e&&$(t),l&&l.d(e),s=!1,r()}}}function As(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 $s extends be{constructor(e){super(),ye(this,e,As,Ts,a,{buttonAction:0,disabled:1},Ss)}}function Ns(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 Os(e){let t,n,s,r,i,o;t=new $s({props:{disabled:null===e[5].hint||""===e[5].hint||e[2],buttonAction:e[8],$$slots:{default:[Is]},$$scope:{ctx:e}}});const a=[Rs,Ms,Cs],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(){pe(t.$$.fragment),n=C(),r.c(),i=M()},m(e,r){de(t,e,r),A(e,n,r),l[s].m(e,r),A(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):(ae(),ue(l[u],1,1,(()=>{l[u]=null})),le(),r=l[s],r?r.p(e,n):(r=l[s]=a[s](e),r.c()),ce(r,1),r.m(i.parentNode,i))},i(e){o||(ce(t.$$.fragment,e),ce(r),o=!0)},o(e){ue(t.$$.fragment,e),ue(r),o=!1},d(e){me(t,e),e&&$(n),l[s].d(e),e&&$(i)}}}function Ls(e){let t,n;return t=new $s({props:{buttonAction:e[0].reset,$$slots:{default:[zs]},$$scope:{ctx:e}}}),{c(){pe(t.$$.fragment)},m(e,s){de(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||(ce(t.$$.fragment,e),n=!0)},o(e){ue(t.$$.fragment,e),n=!1},d(e){me(t,e)}}}function Is(e){let t,n=e[6]("hint")+"";return{c(){t=I(n)},m(e,n){A(e,t,n)},p(e,s){64&s&&n!==(n=e[6]("hint")+"")&&q(t,n)},d(e){e&&$(t)}}}function Cs(e){let t,n;return t=new $s({props:{buttonAction:e[0].next,$$slots:{default:[Ps]},$$scope:{ctx:e}}}),{c(){pe(t.$$.fragment)},m(e,s){de(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||(ce(t.$$.fragment,e),n=!0)},o(e){ue(t.$$.fragment,e),n=!1},d(e){me(t,e)}}}function Ms(e){let t,n;return t=new $s({props:{buttonAction:e[0].evaluate,$$slots:{default:[qs]},$$scope:{ctx:e}}}),{c(){pe(t.$$.fragment)},m(e,s){de(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||(ce(t.$$.fragment,e),n=!0)},o(e){ue(t.$$.fragment,e),n=!1},d(e){me(t,e)}}}function Rs(e){let t,n;return t=new $s({props:{buttonAction:e[0].evaluate,$$slots:{default:[Ds]},$$scope:{ctx:e}}}),{c(){pe(t.$$.fragment)},m(e,s){de(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||(ce(t.$$.fragment,e),n=!0)},o(e){ue(t.$$.fragment,e),n=!1},d(e){me(t,e)}}}function Ps(e){let t,n=e[6]("next")+"";return{c(){t=I(n)},m(e,n){A(e,t,n)},p(e,s){64&s&&n!==(n=e[6]("next")+"")&&q(t,n)},d(e){e&&$(t)}}}function qs(e){let t,n=e[6]("evaluate")+"";return{c(){t=I(n)},m(e,n){A(e,t,n)},p(e,s){64&s&&n!==(n=e[6]("evaluate")+"")&&q(t,n)},d(e){e&&$(t)}}}function Ds(e){let t,n=e[6]("evaluate")+"";return{c(){t=I(n)},m(e,n){A(e,t,n)},p(e,s){64&s&&n!==(n=e[6]("evaluate")+"")&&q(t,n)},d(e){e&&$(t)}}}function zs(e){let t,n=e[6]("reset")+"";return{c(){t=I(n)},m(e,n){A(e,t,n)},p(e,s){64&s&&n!==(n=e[6]("reset")+"")&&q(t,n)},d(e){e&&$(t)}}}function Us(e){let t,n,s,r=e[5].hint+"";return{c(){t=O("p"),n=I("💡 "),s=new z,s.a=null,P(t,"class","quizdown-hint svelte-kh8fob")},m(e,i){A(e,t,i),T(t,n),s.m(r,t)},p(e,t){32&t&&r!==(r=e[5].hint+"")&&s.p(r)},d(e){e&&$(t)}}}function js(e){let t,n,s,r,i,o,a,l;const c=[Ls,Os],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]&&Us(e);return{c(){t=O("div"),s.c(),r=C(),f&&f.c(),i=C(),o=O("div"),a=O("a"),a.textContent="quizdown v0.3.1",P(t,"class","button-row svelte-kh8fob"),P(a,"href","https://github.com/bonartm/quizdown-js"),P(a,"class","svelte-kh8fob"),P(o,"class","quizdown-credits svelte-kh8fob")},m(e,s){A(e,t,s),u[n].m(t,null),A(e,r,s),f&&f.m(e,s),A(e,i,s),A(e,o,s),T(o,a),l=!0},p(e,[r]){let o=n;n=h(e),n===o?u[n].p(e,r):(ae(),ue(u[o],1,1,(()=>{u[o]=null})),le(),s=u[n],s?s.p(e,r):(s=u[n]=c[n](e),s.c()),ce(s,1),s.m(t,null)),e[2]?f?f.p(e,r):(f=Us(e),f.c(),f.m(i.parentNode,i)):f&&(f.d(1),f=null)},i(e){l||(ce(s),l=!0)},o(e){ue(s),l=!1},d(e){e&&$(t),u[n].d(),e&&$(r),f&&f.d(e),e&&$(i),e&&$(o)}}}function Fs(t,n,s){let r,i,o,a,c,h,f=e,p=e;u(t,cs,(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 Bs extends be{constructor(e){super(),ye(this,e,Fs,js,a,{quiz:0},Ns)}}function Gs(e){return"[object Date]"===Object.prototype.toString.call(e)}function Ks(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)=>Ks(e[n],t)));return e=>n.map((t=>t(e)))}if("object"===n){if(!e||!t)throw new Error("Object cannot be null");if(Gs(e)&&Gs(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]=Ks(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 Vs(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 Hs(t){let n,s;return{c(){n=O("div"),s=O("div"),P(s,"class","progress-slider svelte-1ma47z2"),D(s,"width",t[2]),P(n,"class","quizdown-progress svelte-1ma47z2"),P(n,"data-label","")},m(e,t){A(e,n,t),T(n,s)},p(e,[t]){4&t&&D(s,"width",e[2])},i:e,o:e,d(e){e&&$(n)}}}function Ys(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=Ve(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=Ks}=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:ve});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 Xs extends be{constructor(e){super(),ye(this,e,Ys,Hs,a,{quiz:4},Vs)}}var Ws={next:"Next",previous:"Previous",evaluate:"Evaluate",reset:"One more time!",hint:"💡 Show hint",resultsTitle:"Your quiz results",resultsText:"You have answered {points} out of {total} questions correctly!"},Js={next:"Weiter",previous:"Zurück",evaluate:"Zum Ergebnis",reset:"Noch einmal!",hint:"💡 Tipp anzeigen",resultsTitle:"Ihr Ergebnis",resultsText:"Sie haben {points} von {total} Fragen richtig beantwortet!"},Zs={next:"Suivant",previous:"Précédent",evaluate:"Réponse",reset:"Recommencer!",hint:"💡 Indice",resultsTitle:"Vos résultats",resultsText:"Vous avez répondu correctement à {points} questions sur {total}!"},Qs={next:"Siguiente",previous:"Anterior",evaluate:"Respuesta",reset:"Otra vez!",hint:"💡 Pista",resultsTitle:"Resultados",resultsText:"Ha acertado a {points} preguntas de {total}!"};function er(e){Pn("de",Js),Pn("en",Ws),Pn("fr",Zs),Pn("es",Qs),function(e){const{formats:t}=e,n=Fn(e,["formats"]),s=e.initialLocale||e.fallbackLocale;Object.assign(Bn,n,{initialLocale:s}),t&&("number"in t&&Object.assign(Bn.formats.number,t.number),"date"in t&&Object.assign(Bn.formats.date,t.date),"time"in t&&Object.assign(Bn.formats.time,t.time)),Hn.set(s)}({fallbackLocale:"en",initialLocale:null===e?"undefined"==typeof window?null:window.navigator.language||window.navigator.languages[0]:e})}function tr(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 nr(e){let t,n,s,r,i,o,a,l,c;return s=new Xs({props:{quiz:e[0]}}),o=new _s({props:{quiz:e[0]}}),l=new Bs({props:{quiz:e[0]}}),{c(){t=O("div"),n=O("div"),pe(s.$$.fragment),r=C(),i=O("div"),pe(o.$$.fragment),a=C(),pe(l.$$.fragment),P(i,"class","quizdown-container svelte-18qsn2d"),P(n,"class","quizdown-card svelte-18qsn2d"),P(t,"class","quizdown-content svelte-18qsn2d")},m(u,h){A(u,t,h),T(t,n),de(s,n,null),T(n,r),T(n,i),de(o,i,null),T(i,a),de(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||(ce(s.$$.fragment,e),ce(o.$$.fragment,e),ce(l.$$.fragment,e),c=!0)},o(e){ue(s.$$.fragment,e),ue(o.$$.fragment,e),ue(l.$$.fragment,e),c=!1},d(n){n&&$(t),me(s),me(o),me(l),e[2](null)}}}function sr(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 er(i.config.locale),H((()=>s(void 0,void 0,void 0,(function*(){let e=i.config.primaryColor,t=i.config.secondaryColor,n=i.config.textColor;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){X[e?"unshift":"push"]((()=>{r=e,n(1,r)}))}]}class rr extends be{constructor(e){super(),ye(this,e,sr,nr,a,{quiz:0},tr)}} +/*! @license DOMPurify 2.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.0/LICENSE */var ir=Object.hasOwnProperty,or=Object.setPrototypeOf,ar=Object.isFrozen,lr=Object.getPrototypeOf,cr=Object.getOwnPropertyDescriptor,ur=Object.freeze,hr=Object.seal,fr=Object.create,pr="undefined"!=typeof Reflect&&Reflect,dr=pr.apply,mr=pr.construct;dr||(dr=function(e,t,n){return e.apply(t,n)}),ur||(ur=function(e){return e}),hr||(hr=function(e){return e}),mr||(mr=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),Gr=hr(/^data-[\-\w.\u00B7-\uFFFF]/),Kr=hr(/^aria-[\-\w]+$/),Vr=hr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Hr=hr(/^(?:\w+script|data):/i),Yr=hr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Xr="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 Wr(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:Jr(),n=function(t){return e(t)};if(n.version="2.3.0",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=Or(g,"cloneNode"),b=Or(g,"nextSibling"),v=Or(g,"childNodes"),w=Or(g,"parentNode");if("function"==typeof o){var k=r.createElement("template");k.content&&k.content.ownerDocument&&(r=k.content.ownerDocument)}var E=Zr(m,s),x=E&&te?E.createHTML(""):"",_=r,S=_.implementation,T=_.createNodeIterator,A=_.createDocumentFragment,$=_.getElementsByTagName,N=s.importNode,O={};try{O=Nr(r).documentMode?r.documentMode:{}}catch(e){}var L={};n.isSupported="function"==typeof w&&S&&void 0!==S.createHTMLDocument&&9!==O;var I=Fr,C=Br,M=Gr,R=Kr,P=Hr,q=Yr,D=Vr,z=null,U=$r({},[].concat(Wr(Lr),Wr(Ir),Wr(Cr),Wr(Rr),Wr(qr))),j=null,F=$r({},[].concat(Wr(Dr),Wr(zr),Wr(Ur),Wr(jr))),B=null,G=null,K=!0,V=!0,H=!1,Y=!1,X=!1,W=!1,J=!1,Z=!1,Q=!1,ee=!0,te=!1,ne=!0,se=!0,re=!1,ie={},oe=$r({},["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"]),ae=null,le=$r({},["audio","video","img","source","image","track"]),ce=null,ue=$r({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),he="http://www.w3.org/1998/Math/MathML",fe="http://www.w3.org/2000/svg",pe="http://www.w3.org/1999/xhtml",de=pe,me=!1,ge=null,ye=r.createElement("form"),be=function(e){ge&&ge===e||(e&&"object"===(void 0===e?"undefined":Xr(e))||(e={}),e=Nr(e),z="ALLOWED_TAGS"in e?$r({},e.ALLOWED_TAGS):U,j="ALLOWED_ATTR"in e?$r({},e.ALLOWED_ATTR):F,ce="ADD_URI_SAFE_ATTR"in e?$r(Nr(ue),e.ADD_URI_SAFE_ATTR):ue,ae="ADD_DATA_URI_TAGS"in e?$r(Nr(le),e.ADD_DATA_URI_TAGS):le,B="FORBID_TAGS"in e?$r({},e.FORBID_TAGS):{},G="FORBID_ATTR"in e?$r({},e.FORBID_ATTR):{},ie="USE_PROFILES"in e&&e.USE_PROFILES,K=!1!==e.ALLOW_ARIA_ATTR,V=!1!==e.ALLOW_DATA_ATTR,H=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Y=e.SAFE_FOR_TEMPLATES||!1,X=e.WHOLE_DOCUMENT||!1,Z=e.RETURN_DOM||!1,Q=e.RETURN_DOM_FRAGMENT||!1,ee=!1!==e.RETURN_DOM_IMPORT,te=e.RETURN_TRUSTED_TYPE||!1,J=e.FORCE_BODY||!1,ne=!1!==e.SANITIZE_DOM,se=!1!==e.KEEP_CONTENT,re=e.IN_PLACE||!1,D=e.ALLOWED_URI_REGEXP||D,de=e.NAMESPACE||pe,Y&&(V=!1),Q&&(Z=!0),ie&&(z=$r({},[].concat(Wr(qr))),j=[],!0===ie.html&&($r(z,Lr),$r(j,Dr)),!0===ie.svg&&($r(z,Ir),$r(j,zr),$r(j,jr)),!0===ie.svgFilters&&($r(z,Cr),$r(j,zr),$r(j,jr)),!0===ie.mathMl&&($r(z,Rr),$r(j,Ur),$r(j,jr))),e.ADD_TAGS&&(z===U&&(z=Nr(z)),$r(z,e.ADD_TAGS)),e.ADD_ATTR&&(j===F&&(j=Nr(j)),$r(j,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&$r(ce,e.ADD_URI_SAFE_ATTR),se&&(z["#text"]=!0),X&&$r(z,["html","head","body"]),z.table&&($r(z,["tbody"]),delete B.tbody),ur&&ur(e),ge=e)},ve=$r({},["mi","mo","mn","ms","mtext"]),we=$r({},["foreignobject","desc","title","annotation-xml"]),ke=$r({},Ir);$r(ke,Cr),$r(ke,Mr);var Ee=$r({},Rr);$r(Ee,Pr);var xe=function(e){var t=w(e);t&&t.tagName||(t={namespaceURI:pe,tagName:"template"});var n=wr(e.tagName),s=wr(t.tagName);if(e.namespaceURI===fe)return t.namespaceURI===pe?"svg"===n:t.namespaceURI===he?"svg"===n&&("annotation-xml"===s||ve[s]):Boolean(ke[n]);if(e.namespaceURI===he)return t.namespaceURI===pe?"math"===n:t.namespaceURI===fe?"math"===n&&we[s]:Boolean(Ee[n]);if(e.namespaceURI===pe){if(t.namespaceURI===fe&&!we[s])return!1;if(t.namespaceURI===he&&!ve[s])return!1;var r=$r({},["title","style","font","a","script"]);return!Ee[n]&&(r[n]||!ke[n])}return!1},_e=function(e){vr(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=x}catch(t){e.remove()}}},Se=function(e,t){try{vr(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){vr(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!j[e])if(Z||Q)try{_e(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Te=function(e){var t=void 0,n=void 0;if(J)e=""+e;else{var s=kr(e,/^[\r\n\t ]+/);n=s&&s[0]}var i=E?E.createHTML(e):e;if(de===pe)try{t=(new d).parseFromString(i,"text/html")}catch(e){}if(!t||!t.documentElement){t=S.createDocument(de,"template",null);try{t.documentElement.innerHTML=me?"":i}catch(e){}}var o=t.body||t.documentElement;return e&&n&&o.insertBefore(r.createTextNode(n),o.childNodes[0]||null),de===pe?$.call(t,X?"html":"body")[0]:X?t.documentElement:o},Ae=function(e){return T.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},$e=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)},Ne=function(e){return"object"===(void 0===a?"undefined":Xr(a))?e instanceof a:e&&"object"===(void 0===e?"undefined":Xr(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Oe=function(e,t,s){L[e]&&yr(L[e],(function(e){e.call(n,t,s,ge)}))},Le=function(e){var t=void 0;if(Oe("beforeSanitizeElements",e,null),$e(e))return _e(e),!0;if(kr(e.nodeName,/[\u0080-\uFFFF]/))return _e(e),!0;var s=wr(e.nodeName);if(Oe("uponSanitizeElement",e,{tagName:s,allowedTags:z}),!Ne(e.firstElementChild)&&(!Ne(e.content)||!Ne(e.content.firstElementChild))&&Sr(/<[/\w]/g,e.innerHTML)&&Sr(/<[/\w]/g,e.textContent))return _e(e),!0;if(!z[s]||B[s]){if(se&&!oe[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 _e(e),!0}return e instanceof l&&!xe(e)?(_e(e),!0):"noscript"!==s&&"noembed"!==s||!Sr(/<\/no(script|embed)/i,e.innerHTML)?(Y&&3===e.nodeType&&(t=e.textContent,t=Er(t,I," "),t=Er(t,C," "),e.textContent!==t&&(vr(n.removed,{element:e.cloneNode()}),e.textContent=t)),Oe("afterSanitizeElements",e,null),!1):(_e(e),!0)},Ie=function(e,t,n){if(ne&&("id"===t||"name"===t)&&(n in r||n in ye))return!1;if(V&&!G[t]&&Sr(M,t));else if(K&&Sr(R,t));else{if(!j[t]||G[t])return!1;if(ce[t]);else if(Sr(D,Er(n,q,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==xr(n,"data:")||!ae[e]){if(H&&!Sr(P,Er(n,q,"")));else if(n)return!1}else;}return!0},Ce=function(e){var t=void 0,s=void 0,r=void 0,i=void 0;Oe("beforeSanitizeAttributes",e,null);var o=e.attributes;if(o){var a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j};for(i=o.length;i--;){var l=t=o[i],c=l.name,u=l.namespaceURI;if(s=_r(t.value),r=wr(c),a.attrName=r,a.attrValue=s,a.keepAttr=!0,a.forceKeepAttr=void 0,Oe("uponSanitizeAttribute",e,a),s=a.attrValue,!a.forceKeepAttr&&(Se(c,e),a.keepAttr))if(Sr(/\/>/i,s))Se(c,e);else{Y&&(s=Er(s,I," "),s=Er(s,C," "));var h=e.nodeName.toLowerCase();if(Ie(h,r,s))try{u?e.setAttributeNS(u,c,s):e.setAttribute(c,s),br(n.removed)}catch(e){}}}Oe("afterSanitizeAttributes",e,null)}},Me=function e(t){var n=void 0,s=Ae(t);for(Oe("beforeSanitizeShadowDOM",t,null);n=s.nextNode();)Oe("uponSanitizeShadowNode",n,null),Le(n)||(n.content instanceof i&&e(n.content),Ce(n));Oe("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((me=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ne(e)){if("function"!=typeof e.toString)throw Tr("toString is not a function");if("string"!=typeof(e=e.toString()))throw Tr("dirty is not a string, aborting")}if(!n.isSupported){if("object"===Xr(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(Ne(e))return t.toStaticHTML(e.outerHTML)}return e}if(W||be(r),n.removed=[],"string"==typeof e&&(re=!1),re);else if(e instanceof a)1===(l=(o=Te("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?o=l:o.appendChild(l);else{if(!Z&&!Y&&!X&&-1===e.indexOf("<"))return E&&te?E.createHTML(e):e;if(!(o=Te(e)))return Z?null:x}o&&J&&_e(o.firstChild);for(var f=Ae(re?e:o);c=f.nextNode();)3===c.nodeType&&c===u||Le(c)||(c.content instanceof i&&Me(c.content),Ce(c),u=c);if(u=null,re)return e;if(Z){if(Q)for(h=A.call(o.ownerDocument);o.firstChild;)h.appendChild(o.firstChild);else h=o;return ee&&(h=N.call(s,h,!0)),h}var p=X?o.outerHTML:o.innerHTML;return Y&&(p=Er(p,I," "),p=Er(p,C," ")),E&&te?E.createHTML(p):p},n.setConfig=function(e){be(e),W=!0},n.clearConfig=function(){ge=null,W=!1},n.isValidAttribute=function(e,t,n){ge||be({});var s=wr(e),r=wr(t);return Ie(s,r,n)},n.addHook=function(e,t){"function"==typeof t&&(L[e]=L[e]||[],vr(L[e],t))},n.removeHook=function(e){L[e]&&br(L[e])},n.removeHooks=function(e){L[e]&&(L[e]=[])},n.removeAllHooks=function(){L={}},n}();const ei=e=>{const t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce(((e,t)=>Math.min(e,t.length)),1/0):0};var ti=(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 ni{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,ti(this),this.reset()}static isEqual(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.shuffleAnswers&&(this.answers=ni.shuffle(this.answers))}}class si extends ni{constructor(e,t,n,s,r){r.shuffleAnswers=!0,super(e,t,n,s,"Sequence",r)}check(){let e=this.answers.map((e=>e.id));return this.solved=ni.isEqual(e.sort(),this.selected),this.solved}}class ri extends ni{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=ni.isEqual(e.sort(),t.sort()),this.solved}}class ii extends ri{constructor(e,t,n,s,r){super(e,t,n,s,"MultipleChoice",r)}}class oi extends ri{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 ai{constructor(e,t,n,s){this.html=t,this.correct=n,this.id=e,this.comment=s,ti(this)}}class li{constructor(e){this.val=Ve(0),this.max=e,this.subscribe=this.val.subscribe,ti(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 ci{constructor(e,t){if(0==e.length)throw"No questions for quiz provided";this.questions=e,this.counter=new li(this.questions.length),this.finished=Ve(!1),this.points=0,this.config=t,t.shuffleQuestions&&(this.questions=ni.shuffle(e)),ti(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 ui(e,t){return void 0!==e?e:t}const hi={start_on_load:"startOnLoad",shuffle_answers:"shuffleAnswers",shuffle_questions:"shuffleQuestions",primary_color:"primaryColor",secondary_color:"secondaryColor",text_color:"textColor"};class fi{constructor(e){for(const r in hi)n=hi[r],(t=r)in(s=e)&&(s[n]=s[t]);var t,n,s;this.startOnLoad=ui(e.startOnLoad,!0),this.shuffleAnswers=ui(e.shuffleAnswers,!0),this.shuffleQuestions=ui(e.shuffleQuestions,!1),this.primaryColor=ui(e.primaryColor,"steelblue"),this.secondaryColor=ui(e.secondaryColor,"#f2f2f2"),this.textColor=ui(e.textColor,"black"),this.locale=ui(e.locale,null)}}function pi(e,t){let n=new fi(e);for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}var di={exports:{}};function mi(){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}}di.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:mi,changeDefaults:function(e){di.exports.defaults=e}};const gi=/[&<>"']/,yi=/[&<>"']/g,bi=/[<>"']|&(?!#?\w+;)/,vi=/[<>"']|&(?!#?\w+;)/g,wi={"&":"&","<":"<",">":">",'"':""","'":"'"},ki=e=>wi[e];const Ei=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function xi(e){return e.replace(Ei,((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 _i=/(^|[^\[])\^/g;const Si=/[^\w:]/g,Ti=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const Ai={},$i=/^[^:]+:\/*[^/]*$/,Ni=/^([^:]+:)[\s\S]*$/,Oi=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Li(e,t){Ai[" "+e]||($i.test(e)?Ai[" "+e]=e+"/":Ai[" "+e]=Ii(e,"/",!0));const n=-1===(e=Ai[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(Ni,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(Oi,"$1")+t:e+t}function Ii(e,t,n){const s=e.length;if(0===s)return"";let r=0;for(;r(s=(s=s.source||s).replace(_i,"$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(xi(n)).replace(Si,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!Ti.test(n)&&(n=Li(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},resolveUrl:Li,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:Mi}=di.exports,{rtrim:Ri,splitCells:Pi,escape:qi,findClosingBracket:Di}=Ci;function zi(e,t,n){const s=t.href,r=t.title?qi(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:qi(i)}}var Ui=class{constructor(e){this.options=e||Mi}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:Ri(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=Ri(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:Pi(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]):qi(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=Ri(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=Di(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)),zi(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 zi(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=qi(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=qi(this.options.mangle?t(n[1]):n[1]),s="mailto:"+e):(e=qi(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=qi(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=qi(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]):qi(s[0]):s[0]:qi(this.options.smartypants?n(s[0]):s[0]),{type:"text",raw:s[0],text:e}}}};const{noopTest:ji,edit:Fi,merge:Bi}=Ci,Gi={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:ji,table:ji,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?'|\([^()]*\))/};Gi.def=Fi(Gi.def).replace("label",Gi._label).replace("title",Gi._title).getRegex(),Gi.bullet=/(?:[*+-]|\d{1,9}[.)])/,Gi.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,Gi.item=Fi(Gi.item,"gm").replace(/bull/g,Gi.bullet).getRegex(),Gi.listItemStart=Fi(/^( *)(bull) */).replace("bull",Gi.bullet).getRegex(),Gi.list=Fi(Gi.list).replace(/bull/g,Gi.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Gi.def.source+")").getRegex(),Gi._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",Gi._comment=/|$)/,Gi.html=Fi(Gi.html,"i").replace("comment",Gi._comment).replace("tag",Gi._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Gi.paragraph=Fi(Gi._paragraph).replace("hr",Gi.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",Gi._tag).getRegex(),Gi.blockquote=Fi(Gi.blockquote).replace("paragraph",Gi.paragraph).getRegex(),Gi.normal=Bi({},Gi),Gi.gfm=Bi({},Gi.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*|$)"}),Gi.gfm.nptable=Fi(Gi.gfm.nptable).replace("hr",Gi.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",Gi._tag).getRegex(),Gi.gfm.table=Fi(Gi.gfm.table).replace("hr",Gi.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",Gi._tag).getRegex(),Gi.pedantic=Bi({},Gi.normal,{html:Fi("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Gi._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:ji,paragraph:Fi(Gi.normal._paragraph).replace("hr",Gi.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Gi.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const Ki={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ji,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:ji,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};Ki.punctuation=Fi(Ki.punctuation).replace(/punctuation/g,Ki._punctuation).getRegex(),Ki.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ki.escapedEmSt=/\\\*|\\_/g,Ki._comment=Fi(Gi._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ki.emStrong.lDelim=Fi(Ki.emStrong.lDelim).replace(/punct/g,Ki._punctuation).getRegex(),Ki.emStrong.rDelimAst=Fi(Ki.emStrong.rDelimAst,"g").replace(/punct/g,Ki._punctuation).getRegex(),Ki.emStrong.rDelimUnd=Fi(Ki.emStrong.rDelimUnd,"g").replace(/punct/g,Ki._punctuation).getRegex(),Ki._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ki._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ki._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])?)+(?![-_])/,Ki.autolink=Fi(Ki.autolink).replace("scheme",Ki._scheme).replace("email",Ki._email).getRegex(),Ki._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ki.tag=Fi(Ki.tag).replace("comment",Ki._comment).replace("attribute",Ki._attribute).getRegex(),Ki._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ki._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ki._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ki.link=Fi(Ki.link).replace("label",Ki._label).replace("href",Ki._href).replace("title",Ki._title).getRegex(),Ki.reflink=Fi(Ki.reflink).replace("label",Ki._label).getRegex(),Ki.reflinkSearch=Fi(Ki.reflinkSearch,"g").replace("reflink",Ki.reflink).replace("nolink",Ki.nolink).getRegex(),Ki.normal=Bi({},Ki),Ki.pedantic=Bi({},Ki.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:Fi(/^!?\[(label)\]\((.*?)\)/).replace("label",Ki._label).getRegex(),reflink:Fi(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ki._label).getRegex()}),Ki.gfm=Bi({},Ki.normal,{escape:Fi(Ki.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:eo}=di.exports,{cleanUrl:to,escape:no}=Ci;var so=class{constructor(e){this.options=e||eo}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:no(e,!0))+"
    \n":"
    "+(n?e:no(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=to(this.options.sanitize,this.options.baseUrl,e)))return n;let s='
    ",s}image(e,t,n){if(null===(e=to(this.options.sanitize,this.options.baseUrl,e)))return n;let s=''+n+'":">",s}text(e){return e}},ro=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""}},io=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 oo=so,ao=ro,lo=io,{defaults:co}=di.exports,{unescape:uo}=Ci;const ho=class e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Yi,this.options.tokenizer=this.options.tokenizer||new Hi,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;const t={block:Xi.normal,inline:Wi.normal};this.options.pedantic?(t.block=Xi.pedantic,t.inline=Wi.pedantic):this.options.gfm&&(t.block=Xi.gfm,this.options.breaks?t.inline=Wi.breaks:t.inline=Wi.gfm),this.tokenizer.rules=t}static get rules(){return{block:Xi,inline:Wi}}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)+"["+Ji("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)+"["+Ji("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,Qi))e=e.substring(r.raw.length),t.push(r);else if(n||!(r=this.tokenizer.url(e,Qi))){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,Zi))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}},fo=class e{constructor(e){this.options=e||co,this.options.renderer=this.options.renderer||new oo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ao,this.slugger=new lo}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=ho.lex(e,t);return t.walkTokens&&_o.walkTokens(n,t.walkTokens),fo.parse(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+wo(e.message+"",!0)+"
    ";throw e}}_o.options=_o.setOptions=function(e){return bo(_o.defaults,e),Eo(_o.defaults),_o},_o.getDefaults=ko,_o.defaults=xo,_o.use=function(...e){const t=bo({},...e),n=_o.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=_o.defaults.renderer||new mo;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=_o.defaults.tokenizer||new po;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=_o.defaults.walkTokens;t.walkTokens=t=>{e.walkTokens.call(this,t),n&&n(t)}}s&&(t.extensions=n),_o.setOptions(t)}))},_o.walkTokens=function(e,t){for(const n of e)switch(t(n),n.type){case"table":for(const e of n.tokens.header)_o.walkTokens(e,t);for(const e of n.tokens.cells)for(const n of e)_o.walkTokens(n,t);break;case"list":_o.walkTokens(n.items,t);break;default:_o.defaults.extensions&&_o.defaults.extensions.childTokens&&_o.defaults.extensions.childTokens[n.type]?_o.defaults.extensions.childTokens[n.type].forEach((function(e){_o.walkTokens(n[e],t)})):n.tokens&&_o.walkTokens(n.tokens,t)}},_o.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=bo({},_o.defaults,t||{}),vo(t);try{const n=ho.lexInline(e,t);return t.walkTokens&&_o.walkTokens(n,t.walkTokens),fo.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+wo(e.message+"",!0)+"
    ";throw e}},_o.Parser=fo,_o.parser=fo.parse,_o.Renderer=mo,_o.TextRenderer=go,_o.Lexer=ho,_o.lexer=ho.lex,_o.Tokenizer=po,_o.Slugger=yo,_o.parse=_o;var So=_o;const To=Symbol.for("yaml.alias"),Ao=Symbol.for("yaml.document"),$o=Symbol.for("yaml.map"),No=Symbol.for("yaml.pair"),Oo=Symbol.for("yaml.scalar"),Lo=Symbol.for("yaml.seq"),Io=Symbol.for("yaml.node.type"),Co=e=>!!e&&"object"==typeof e&&e[Io]===To,Mo=e=>!!e&&"object"==typeof e&&e[Io]===Ao,Ro=e=>!!e&&"object"==typeof e&&e[Io]===$o,Po=e=>!!e&&"object"==typeof e&&e[Io]===No,qo=e=>!!e&&"object"==typeof e&&e[Io]===Oo,Do=e=>!!e&&"object"==typeof e&&e[Io]===Lo;function zo(e){if(e&&"object"==typeof e)switch(e[Io]){case $o:case Lo:return!0}return!1}function Uo(e){if(e&&"object"==typeof e)switch(e[Io]){case To:case $o:case Oo:case Lo:return!0}return!1}class jo{constructor(e){Object.defineProperty(this,Io,{value:e})}}const Fo=Symbol("break visit"),Bo=Symbol("skip children"),Go=Symbol("remove node");function Ko(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)),Mo(e)){Vo(null,e.contents,t,Object.freeze([e]))===Go&&(e.contents=null)}else Vo(null,e,t,Object.freeze([]))}function Vo(e,t,n,s){let r;if("function"==typeof n?r=n(e,t,s):Ro(t)?n.Map&&(r=n.Map(e,t,s)):Do(t)?n.Seq&&(r=n.Seq(e,t,s)):Po(t)?n.Pair&&(r=n.Pair(e,t,s)):qo(t)?n.Scalar&&(r=n.Scalar(e,t,s)):Co(t)&&n.Alias&&(r=n.Alias(e,t,s)),Uo(r)||Po(r)){const t=s[s.length-1];if(zo(t))t.items[e]=r;else if(Po(t))"key"===e?t.key=r:t.value=r;else{if(!Mo(t)){const e=Co(t)?"alias":"scalar";throw new Error(`Cannot replace node with ${e} parent`)}t.contents=r}return Vo(e,r,n,s)}if("symbol"!=typeof r)if(zo(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=>Ho[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&&Uo(e.contents)){const t={};Ko(e.contents,((e,n)=>{Uo(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 Xo(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 Wo(e){const t=new Set;return Ko(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function Jo(e,t){for(let n=1;;++n){const s=`${e}${n}`;if(!t.has(s))return s}}Yo.defaultYaml={explicit:!1,version:"1.2"},Yo.defaultTags={"!!":"tag:yaml.org,2002:"};class Zo extends jo{constructor(e){super(To),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return Ko(e,{Node:(e,n)=>{if(n===this)return Ko.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=Qo(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(Xo(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 Qo(e,t,n){if(Co(t)){const s=t.resolve(e),r=n&&s&&n.get(s);return r?r.count*r.aliasCount:0}if(zo(t)){let s=0;for(const r of t.items){const t=Qo(e,r,n);t>s&&(s=t)}return s}if(Po(t)){const s=Qo(e,t.key,n),r=Qo(e,t.value,n);return Math.max(s,r)}return 1}function ea(e,t,n){if(Array.isArray(e))return e.map(((e,t)=>ea(e,String(t),n)));if(e&&"function"==typeof e.toJSON){if(!n||(!qo(s=e)&&!zo(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 ta=e=>!e||"function"!=typeof e&&"object"!=typeof e;class na extends jo{constructor(e){super(Oo),this.value=e}toJSON(e,t){return t&&t.keep?this.value:ea(this.value,e,t)}toString(){return String(this.value)}}na.BLOCK_FOLDED="BLOCK_FOLDED",na.BLOCK_LITERAL="BLOCK_LITERAL",na.PLAIN="PLAIN",na.QUOTE_DOUBLE="QUOTE_DOUBLE",na.QUOTE_SINGLE="QUOTE_SINGLE";function sa(e,t,n){var s,r;if(Uo(e))return e;if(Po(e)){const t=null===(r=(s=n.schema[$o]).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 Zo(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 na(e);u=e instanceof Map?a[$o]:Symbol.iterator in Object(e)?a[Lo]:a[$o]}o&&(o(u),delete n.onTagObj);const h=(null==u?void 0:u.createNode)?u.createNode(n.schema,e,n):new na(e);return t&&(h.tag=t),c&&(c.node=h),h}function ra(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 sa(s,void 0,{onAnchor(){throw new Error("Repeated objects are not supported here")},schema:e,sourceObjects:new Map})}const ia=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;class oa extends jo{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}addIn(e,t){if(ia(e))this.add(t);else{const[n,...s]=e,r=this.get(n,!0);if(zo(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,ra(this.schema,s,t))}}}deleteIn([e,...t]){if(0===t.length)return this.delete(e);const n=this.get(e,!0);if(zo(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&&qo(s)?s.value:s:zo(s)?s.getIn(t,n):void 0}hasAllNullValues(e){return this.items.every((t=>{if(!Po(t))return!1;const n=t.value;return null==n||e&&qo(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!!zo(n)&&n.hasIn(t)}setIn([e,...t],n){if(0===t.length)this.set(e,n);else{const s=this.get(e,!0);if(zo(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,ra(this.schema,t,n))}}}}function aa(e,t,n){return n?n.includes("\n")?`${e}\n`+n.replace(/^/gm,`${t||""}#`):e.endsWith(" ")?`${e}#${n}`:`${e} #${n}`:e}oa.maxFlowStringSingleLineLength=60;const la="flow",ca="block",ua="quoted";function ha(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===ca&&(g=fa(e,g),-1!==g&&(p=g+l));d=e[g+=1];){if(n===ua&&"\\"===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===ca&&(g=fa(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===ua){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}),da=e=>/^(%|---|\.\.\.)/m.test(e);function ma(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:s}=t,r=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(da(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}${ha(`${m}${n=n.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${o}`)}${u}`,o,ca,pa(s))}`}function ba(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!==na.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=na.QUOTE_DOUBLE);const l=e=>{switch(e){case na.BLOCK_FOLDED:case na.BLOCK_LITERAL:return r||i?ma(o.value,t):ya(o,t,n,s);case na.QUOTE_DOUBLE:return ma(o.value,t);case na.QUOTE_SINGLE:return ga(o.value,t);case na.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 ma(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?ga:i&&!r?ma:t.options.singleQuote?ga:ma,l||u||-1===o.indexOf("\n")?a(o,t):ya(e,t,n,s)}if(!l&&!u&&i!==na.PLAIN&&-1!==o.indexOf("\n"))return ya(e,t,n,s);if(""===c&&da(o))return t.forceBlockIndent=!0,ya(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 ma(o,t);return l?h:ha(h,c,la,pa(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 va=(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 wa(e,t,n,s){if(Po(e))return e.toString(t,n,s);if(Co(e))return e.toString(t);let r;const i=Uo(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(qo(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=(qo(e)||zo(e))&&e.anchor;return i&&Xo(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):qo(i)?ba(i,t,n,s):i.toString(t,n,s);return o?qo(i)||"{"===a[0]||"["===a[0]?`${o} ${a}`:`${o}\n${t.indent}${a}`:a}function ka(e,t){"debug"!==e&&"warn"!==e||("undefined"!=typeof process&&process.emitWarning?process.emitWarning(t):console.warn(t))}function Ea(e,t,{key:n,value:s}){if(e&&e.doc.schema.merge&&xa(n))if(Do(s))for(const n of s.items)_a(e,t,n);else if(Array.isArray(s))for(const n of s)_a(e,t,n);else _a(e,t,s);else{const r=ea(n,"",e);if(t instanceof Map)t.set(r,ea(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(Uo(e)&&n&&n.doc){const t=va(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)+'..."'),ka(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=ea(s,i,e);i in t?Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[i]=o}}return t}const xa=e=>"<<"===e||qo(e)&&"<<"===e.value&&(!e.type||e.type===na.PLAIN);function _a(e,t,n){const s=e&&Co(n)?n.resolve(e.doc):null;if(!Ro(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 Sa(e,t,n){const s=sa(e,void 0,n),r=sa(t,void 0,n);return new Ta(s,r)}class Ta{constructor(e,t=null){Object.defineProperty(this,Io,{value:No}),this.key=e,this.value=t}toJSON(e,t){return Ea(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=Uo(e)&&e.comment||null;if(u){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(zo(e))throw new Error("With simple keys, collection cannot be used as a key value")}let f=!u&&(!e||h&&null==t&&!n.inFlow||zo(e)||(qo(e)?e.type===na.BLOCK_FOLDED||e.type===na.BLOCK_LITERAL:"object"==typeof e));n=Object.assign({},n,{allNullValues:!1,implicitKey:!f&&(u||!i),indent:a+l});let p=!1,d=!1,m=wa(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(),aa(`? ${m}`,n.indent,h);p&&(h=null),m=f?`? ${aa(m,n.indent,h)}\n${a}:`:aa(`${m}:`,n.indent,h);let g="",y=null;Uo(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||!qo(t)||(n.indentAtStart=m.length+1),d=!1,c||!(l.length>=2)||n.inFlow||f||!Do(t)||t.flow||t.tag||t.anchor||(n.indent=n.indent.substr(2));let b=!1;const v=wa(t,n,(()=>b=!0),(()=>d=!0));let w=" ";g||h?w=`${g}\n${n.indent}`:!f&&zo(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(),aa(m+w+v,n.indent,y))}(this,e,t,n):JSON.stringify(this)}}const Aa={intAsBigInt:!1,logLevel:"warn",prettyErrors:!0,strict:!0,version:"1.2"};function $a({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(Uo(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(Po(t)){const n=Uo(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=Uo(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=wa(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>oa.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 Na(e,t){const n=qo(t)?t.value:t;for(const s of e)if(Po(s)){if(s.key===t||s.key===n)return s;if(qo(s.key)&&s.key.value===n)return s}}class Oa extends oa{constructor(e){super($o,e),this.items=[]}static get tagName(){return"tag:yaml.org,2002:map"}add(e,t){let n;n=Po(e)?e:new Ta(e&&"object"==typeof e&&"key"in e?e.key:e,e.value);const s=Na(this.items,n.key),r=this.schema&&this.schema.sortMapEntries;if(s){if(!t)throw new Error(`Key ${n.key} already set`);qo(s.value)&&ta(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=Na(this.items,e);if(!t)return!1;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){const n=Na(this.items,e),s=n&&n.value;return!t&&qo(s)?s.value:s}has(e){return!!Na(this.items,e)}set(e,t){this.add(new Ta(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)Ea(t,s,e);return s}toString(e,t,n){if(!e)return JSON.stringify(this);for(const e of this.items)if(!Po(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})),$a(this,e,{blockItem:e=>e.str,flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}const La={collection:"map",createNode:function(e,t,n){const{keepUndefined:s,replacer:r}=n,i=new Oa(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(Sa(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:Oa,tag:"tag:yaml.org,2002:map",resolve:(e,t)=>(Ro(e)||t("Expected a mapping for this tag"),e)};class Ia extends oa{constructor(e){super(Lo,e),this.items=[]}static get tagName(){return"tag:yaml.org,2002:seq"}add(e){this.items.push(e)}delete(e){const t=Ca(e);if("number"!=typeof t)return!1;return this.items.splice(t,1).length>0}get(e,t){const n=Ca(e);if("number"!=typeof n)return;const s=this.items[n];return!t&&qo(s)?s.value:s}has(e){const t=Ca(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 Ca(e){let t=qo(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}const Ma={collection:"seq",createNode:function(e,t,n){const{replacer:s}=n,r=new Ia(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(sa(i,void 0,n))}}return r},default:!0,nodeClass:Ia,tag:"tag:yaml.org,2002:seq",resolve:(e,t)=>(Do(e)||t("Expected a sequence for this tag"),e)},Ra={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(e,t,n,s)=>ba(e,t=Object.assign({actualString:!0},t),n,s)},Pa={identify:e=>null==e,createNode:()=>new na(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new na(null),stringify:({source:e},t)=>e&&Pa.test.test(e)?e:t.options.nullStr},qa={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new na("t"===e[0]||"T"===e[0]),stringify({source:e,value:t},n){if(e&&qa.test.test(e)){if(t===("t"===e[0]||"T"===e[0]))return e}return t?n.options.trueStr:n.options.falseStr}};function Da({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 za={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:Da},Ua={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()},ja={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 na(parseFloat(e)),n=e.indexOf(".");return-1!==n&&"0"===e[e.length-1]&&(t.minFractionDigits=e.length-n-1),t},stringify:Da},Fa=e=>"bigint"==typeof e||Number.isInteger(e),Ba=(e,t,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),n);function Ga(e,t,n){const{value:s}=e;return Fa(s)&&s>=0?n+s.toString(t):Da(e)}const Ka={identify:e=>Fa(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Ba(e,2,8,n),stringify:e=>Ga(e,8,"0o")},Va={identify:Fa,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Ba(e,0,10,n),stringify:Da},Ha={identify:e=>Fa(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Ba(e,2,16,n),stringify:e=>Ga(e,16,"0x")},Ya=[La,Ma,Ra,Pa,qa,Ka,Va,Ha,za,Ua,ja];function Xa(e){return"bigint"==typeof e||Number.isInteger(e)}const Wa=({value:e})=>JSON.stringify(e),Ja=[La,Ma].concat([{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Wa},{identify:e=>null==e,createNode:()=>new na(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Wa},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:e=>"true"===e,stringify:Wa},{identify:Xa,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})=>Xa(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:Wa}],{default:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)}),Za={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 Ta(new na(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]=Po(s)?s:new Ta(s)}}else t("Expected a sequence for this tag");return e}function el(e,t,n){const{replacer:s}=n,r=new Ia(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(Sa(o,a,n))}return r}const tl={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Qa,createNode:el};class nl extends Ia{constructor(){super(),this.add=Oa.prototype.add.bind(this),this.delete=Oa.prototype.delete.bind(this),this.get=Oa.prototype.get.bind(this),this.has=Oa.prototype.has.bind(this),this.set=Oa.prototype.set.bind(this),this.tag=nl.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(Po(e)?(s=ea(e.key,"",t),r=ea(e.value,s,t)):s=ea(e,"",t),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,r)}return n}}nl.tag="tag:yaml.org,2002:omap";const sl={collection:"seq",identify:e=>e instanceof Map,nodeClass:nl,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=Qa(e,t),s=[];for(const{key:e}of n.items)qo(e)&&(s.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):s.push(e.value));return Object.assign(new nl,n)},createNode(e,t,n){const s=el(e,t,n),r=new nl;return r.items=s.items,r}};function rl({value:e,source:t},n){return t&&(e?il:ol).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const il={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 na(!0),stringify:rl},ol={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 na(!1),stringify:rl},al={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:Da},ll={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()},cl={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 na(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:Da},ul=e=>"bigint"==typeof e||Number.isInteger(e);function hl(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 fl(e,t,n){const{value:s}=e;if(ul(s)){const e=s.toString(t);return s<0?"-"+n+e.substr(1):n+e}return Da(e)}const pl={identify:ul,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>hl(e,2,2,n),stringify:e=>fl(e,2,"0b")},dl={identify:ul,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>hl(e,1,8,n),stringify:e=>fl(e,8,"0")},ml={identify:ul,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>hl(e,0,10,n),stringify:Da},gl={identify:ul,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>hl(e,2,16,n),stringify:e=>fl(e,16,"0x")};class yl extends Oa{constructor(e){super(e),this.tag=yl.tag}add(e){let t;t=Po(e)?e:"object"==typeof e&&"key"in e&&"value"in e&&null===e.value?new Ta(e.key,null):new Ta(e,null);Na(this.items,t.key)||this.items.push(t)}get(e,t){const n=Na(this.items,e);return!t&&Po(n)?qo(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=Na(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Ta(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")}}yl.tag="tag:yaml.org,2002:set";const bl={collection:"map",identify:e=>e instanceof Set,nodeClass:yl,default:!1,tag:"tag:yaml.org,2002:set",resolve(e,t){if(Ro(e)){if(e.hasAllNullValues(!0))return Object.assign(new yl,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 yl(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(Sa(e,null,n));return r}};function vl(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 wl(e){let{value:t}=e,n=e=>e;if("bigint"==typeof t)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return Da(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 kl={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})=>vl(e,n),stringify:wl},El={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=>vl(e,!1),stringify:wl},xl={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(xl.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=vl(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$/,"")},_l=[La,Ma,Ra,Pa,il,ol,pl,dl,ml,gl,al,ll,cl,Za,sl,tl,bl,kl,El,xl],Sl={core:Ya,failsafe:[La,Ma,Ra],json:Ja,yaml11:_l,"yaml-1.1":_l},Tl={binary:Za,bool:qa,float:ja,floatExp:Ua,floatNaN:za,floatTime:El,int:Va,intHex:Ha,intOct:Ka,intTime:kl,map:La,null:Pa,omap:sl,pairs:tl,seq:Ma,set:bl,timestamp:xl},Al={"tag:yaml.org,2002:binary":Za,"tag:yaml.org,2002:omap":sl,"tag:yaml.org,2002:pairs":tl,"tag:yaml.org,2002:set":bl,"tag:yaml.org,2002:timestamp":xl};const $l=(e,t)=>e.keyt.key?1:0;class Nl{constructor({customTags:e,merge:t,resolveKnownTags:n,schema:s,sortMapEntries:r}){this.merge=!!t,this.name=s||"core",this.knownTags=n?Al:{},this.tags=function(e,t){let n=Sl[t];if(!n){const e=Object.keys(Sl).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=Tl[e];if(t)return t;const n=Object.keys(Tl).map((e=>JSON.stringify(e))).join(", ");throw new Error(`Unknown custom tag "${e}"; use one of ${n}`)}))}(e,this.name),Object.defineProperty(this,$o,{value:La}),Object.defineProperty(this,Oo,{value:Ra}),Object.defineProperty(this,Lo,{value:Ma}),this.sortMapEntries=!0===r?$l:r||null}}function Ol(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=Wo(e));const i=Jo(t,r);return r.add(i),i},setAnchors(){for(const e of n){const t=s.get(e);if("object"!=typeof t||!t.anchor||!qo(t.node)&&!zo(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=sa(e,l,{keepUndefined:null!=o&&o,onAnchor:c,onTagObj:a,replacer:s,schema:this.schema,sourceObjects:h});return i&&zo(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 Ta(s,r)}delete(e){return!!Il(this.contents)&&this.contents.delete(e)}deleteIn(e){return ia(e)?null!=this.contents&&(this.contents=null,!0):!!Il(this.contents)&&this.contents.deleteIn(e)}get(e,t){return zo(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return ia(e)?!t&&qo(this.contents)?this.contents.value:this.contents:zo(this.contents)?this.contents.getIn(e,t):void 0}has(e){return!!zo(this.contents)&&this.contents.has(e)}hasIn(e){return ia(e)?void 0!==this.contents:!!zo(this.contents)&&this.contents.hasIn(e)}set(e,t){null==this.contents?this.contents=ra(this.schema,[e],t):Il(this.contents)&&this.contents.set(e,t)}setIn(e,t){ia(e)?this.contents=t:null==this.contents?this.contents=ra(this.schema,Array.from(e),t):Il(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 Nl(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:wa},a=ea(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?Ol(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=va(e,t);let i=!1,o=null;if(e.contents){Uo(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=wa(e.contents,r,(()=>o=null),t);o&&(a=aa(a,"",o)),"|"!==a[0]&&">"!==a[0]||"---"!==n[n.length-1]?n.push(a):n[n.length-1]=`--- ${a}`}else n.push(wa(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 Il(e){if(zo(e))return!0;throw new Error("Expected a YAML collection as document contents")}class Cl extends Error{constructor(e,t,n,s){super(),this.name=e,this.code=n,this.message=s,this.pos=t}}class Ml extends Cl{constructor(e,t,n){super("YAMLParseError",e,t,n)}}class Rl extends Cl{constructor(e,t,n){super("YAMLWarning",e,t,n)}}const Pl=(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 ql(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 Dl(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(Dl(t.key)||Dl(t.value))return!0}return!1;default:return!0}}const zl="All mapping items must start at the same column";function Ul(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 jl="Block collections are not allowed within flow collections",Fl=e=>e&&("block-map"===e.type||"block-seq"===e.type);function Bl(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 Oa(n.schema);let a=s.offset;for(const{start:l,key:c,sep:u,value:h}of s.items){const f=ql(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",zl)),!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",zl);p&&Dl(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=ql(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=Ul(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=Ro(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=Uo(u)?u:new na(u);return h.range=i.range,h.tag=o,(null==c?void 0:c.format)&&(h.format=c.format),h}function Gl(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=na.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 Vl(e)}(i,c);break;case"single-quoted-scalar":a=na.QUOTE_SINGLE,l=function(e,t){"'"===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR","Missing closing 'quote");return Vl(e.slice(1,-1)).replace(/''/g,"'")}(i,c);break;case"double-quoted-scalar":a=na.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=Ul(o,u,t,n);return{value:l,type:a,comment:h.comment,range:[s,u,h.offset]}}function Vl(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[Oo];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[Oo]}(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[Oo]}(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=qo(i)?i:new na(i)}catch(e){s(n||t,"TAG_RESOLVE_FAILED",e.message),u=new na(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 Jl(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 Zl={composeNode:Ql,composeEmptyNode:ec};function Ql(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 Zo(n.substring(1)),o=t+n.length,a=Ul(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=Wl(e,t,a,s),o&&(l.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=Bl(Zl,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 ec(e,t,n,s,{spaceBefore:r,comment:i,anchor:o,tag:a},l){const c=Wl(e,{type:"scalar",offset:Jl(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 tc(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 nc(e){let t="",n=!1,s=!1;for(let r=0;r{const r=tc(e);s?this.warnings.push(new Rl(r,t,n)):this.errors.push(new Ml(r,t,n))},this.directives=new Yo({version:e.version||Aa.version}),this.options=e}decorate(e,t){const{comment:n,afterEmptyLine:s}=nc(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(zo(r)&&!r.flow&&r.items.length>0){let e=r.items[0];Po(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:nc(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=tc(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 Ll(void 0,a),c={directives:l.directives,options:l.options,schema:l.schema},u=ql(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?Ql(c,r,u,o):ec(c,u.end,s,null,u,o);const h=l.contents.range[2],f=Ul(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 Ml(tc(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 Ml(tc(e),"UNEXPECTED_TOKEN",t));break}const t=Ul(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 Ml(tc(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 Ll(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 rc(e){switch(e){case void 0:case" ":case"\n":case"\r":case"\t":return!0;default:return!1}}const ic=[",","[","]","{","}"],oc=[" ",",","[","]","{","}","\n","\r","\t"],ac=e=>!e||oc.includes(e);class lc{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)&&rc(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&&rc(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,"doc";if("..."===e&&rc(this.charAt(3)))return yield*this.pushCount(3),"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!rc(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)&&rc(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(ac),"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=>rc(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(rc(t)||e&&","===t)break;n=s}else if(rc(t)){const r=this.buffer[s+1];if("#"===r||e&&ic.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&&ic.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(ac))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case":":case"?":case"-":if(rc(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(;!rc(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 cc{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 pc(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 dc(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 mc(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 gc(e){if("flow-seq-start"===e.start.type)for(const t of e.items)!t.sep||t.value||uc(t.start,"explicit-key-ind")||uc(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,pc(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 yc{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 lc,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&&gc(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=!uc(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&&!hc(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||hc(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||uc(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&&!uc(n.start,"explicit-key-ind"))e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(uc(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(uc(n.start,"explicit-key-ind")&&pc(n.key)&&!uc(n.sep,"newline")){const e=mc(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&&uc(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&&fc(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||uc(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=mc(dc(t));gc(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=mc(dc(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=mc(dc(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 bc(e,t={}){const{lineCounter:n,prettyErrors:s}=function(e){const t=!e||!1!==e.prettyErrors;return{lineCounter:e&&e.lineCounter||t&&new cc||null,prettyErrors:t}}(t),r=new yc(null==n?void 0:n.addNewLine),i=new sc(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 Ml(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(Pl(e,n)),o.warnings.forEach(Pl(e,n))),o}function vc(e,t,n){let s;"function"==typeof t?s=t:void 0===n&&t&&"object"==typeof t&&(n=t);const r=bc(e,n);if(!r)return null;if(r.warnings.forEach((e=>ka(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 wc={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:vc(t[3],{})}}},kc={paragraph:e=>e,blockquote:e=>e,heading:e=>e};function Ec(e){return Qr.sanitize(So.parser(e))}function xc(e,t){let n=So.lexer((e=>{const t=ei(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 fi(t);return n.forEach((function(e,t){if("heading"==e.type&&(o="",a="",i=Ec([e]),s=new fi(c),l=!1),"options"==e.type&&(l?c=pi(c,e.data):s=pi(c,e.data)),"paragraph"!=e.type&&"code"!=e.type||(o+=Ec([e])),"blockquote"==e.type&&(a+=Ec([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+=Ec([e]):t+=Ec([e])})),{text:t,comment:n}}(e);t.push(new ai(n,s.text,e.checked,s.comment))})),e.ordered?e.items[0].task?r.push(new oi(i,o,a,t,s)):r.push(new si(i,o,a,t,s)):r.push(new ii(i,o,a,t,s))}})),new ci(r,c)}function _c(e,t,n){let s;t.innerHTML="",t.shadowRoot?(s=t.shadowRoot,s.innerHTML=""):s=t.attachShadow({mode:"open"});try{let t=xc(e,n);new rr({target:s,intro:!1,props:{quiz:t}})}catch(e){s.innerHTML=`${e}. App could not render. Please check your quizdown syntax.`}}return So.use({renderer:kc,tokenizer:wc}),{init:function(e={}){let t=new fi(e);t.startOnLoad&&"undefined"!=typeof document&&window.addEventListener("load",(function(){let e=document.querySelectorAll(".quizdown");for(let n of e)_c(n.innerHTML,n,t)}),!1)},register:function(e){return e.setup(this),this},createApp:_c,getMarkedParser:function(){return So}}}));