diff --git a/CHANGELOG.md b/CHANGELOG.md index d946662..8d8bdb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG +## 0.8.1 + +- Bumped dependencies +- Fixed incorrect disableAll & selectedButtons +- Replaced uuidv4 by nanoid + ## 0.8.0 - Bumped dependencies diff --git a/dist/index.es.js b/dist/index.es.js index d442b46..8dfe790 100644 --- a/dist/index.es.js +++ b/dist/index.es.js @@ -1,2 +1,2 @@ -import e,{useState as t,useRef as n,useEffect as r,useCallback as o,Fragment as i}from"react";function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n",""],_:["",""],"*":["",""],"~":["",""],"\n":["
"]," ":["
"],"-":["
"]};function L(e){return e.replace(RegExp("^"+(e.match(/^(\t| )+/)||"")[0],"gm"),"")}function D(e){return(e+"").replace(/"/g,""").replace(//g,">")}function j(e,t){var n,r,o,i,a,c=/((?:^|\n+)(?:\n---+|\* \*(?: \*)+)\n)|(?:^``` *(\w*)\n([\s\S]*?)\n```$)|((?:(?:^|\n+)(?:\t| {2,}).+)+\n*)|((?:(?:^|\n)([>*+-]|\d+\.)\s+.*)+)|(?:!\[([^\]]*?)\]\(([^)]+?)\))|(\[)|(\](?:\(([^)]+?)\))?)|(?:(?:^|\n+)([^\s].*)\n(-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,6})\s*(.+)(?:\n+|$))|(?:`([^`].*?)`)|( \n\n*|\n{2,}|__|\*\*|[_*]|~~)/gm,s=[],l="",u=t||{},d=0;function p(e){var t=R[e[1]||""],n=s[s.length-1]==e;return t?t[1]?(n?s.pop():s.push(e),t[0|n]):t[0]:e}function f(){for(var e="";s.length;)e+=p(s[s.length-1]);return e}for(e=e.replace(/^\[(.+?)\]:\s*(.+)$/gm,(function(e,t,n){return u[t.toLowerCase()]=n,""})).replace(/^\n+|\n+$/g,"");o=c.exec(e);)r=e.substring(d,o.index),d=c.lastIndex,n=o[0],r.match(/[^\\](\\\\)*\\$/)||((a=o[3]||o[4])?n='
"+L(D(a).replace(/^\n+|\n+$/g,""))+"
":(a=o[6])?(a.match(/\./)&&(o[5]=o[5].replace(/^\d+/gm,"")),i=j(L(o[5].replace(/^\s*[>*+.-]/gm,""))),">"==a?a="blockquote":(a=a.match(/\./)?"ol":"ul",i=i.replace(/^(.*)(\n|$)/gm,"
  • $1
  • ")),n="<"+a+">"+i+""):o[8]?n=''+D(o[7])+'':o[10]?(l=l.replace("",''),n=f()+""):o[9]?n="":o[12]||o[14]?n="<"+(a="h"+(o[14]?o[14].length:o[13]>"="?1:2))+">"+j(o[12]||o[15],u)+"":o[16]?n=""+D(o[16])+"":(o[17]||o[1])&&(n=p(o[17]||"--"))),l+=r,l+=n;return(l+e.substring(d)+f()).replace(/^\n+|\n+$/g,"")}var q={exports:{}}; -/*! @license DOMPurify 3.0.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.8/LICENSE */q.exports=function(){const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:o}=Object;let{freeze:i,seal:a,create:c}=Object,{apply:s,construct:l}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),s||(s=function(e,t,n){return e.apply(t,n)}),l||(l=function(e,t){return new e(...t)});const u=v(Array.prototype.forEach),d=v(Array.prototype.pop),p=v(Array.prototype.push),f=v(String.prototype.toLowerCase),m=v(String.prototype.toString),g=v(String.prototype.match),h=v(String.prototype.replace),b=v(String.prototype.indexOf),y=v(String.prototype.trim),x=v(RegExp.prototype.test),w=T(TypeError);function v(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o2&&void 0!==arguments[2]?arguments[2]:f;t&&t(e,null);let i=r.length;for(;i--;){let t=r[i];if("string"==typeof t){const e=o(t);e!==t&&(n(r)||(r[i]=e),t=e)}e[t]=!0}return e}function S(e){for(let t=0;t/gm),U=a(/\${[\w\W]*}/gm),F=a(/^data-[\-\w.\u00B7-\uFFFF]/),B=a(/^aria-[\-\w]+$/),H=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Q=a(/^(?:\w+script|data):/i),W=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Y=a(/^html$/i);var G=Object.freeze({__proto__:null,MUSTACHE_EXPR:z,ERB_EXPR:M,TMPLIT_EXPR:U,DATA_ATTR:F,ARIA_ATTR:B,IS_ALLOWED_URI:H,IS_SCRIPT_OR_DATA:Q,ATTR_WHITESPACE:W,DOCTYPE_NAME:Y});const $=function(){return"undefined"==typeof window?null:window},K=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function V(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$();const n=e=>V(e);if(n.version="3.0.8",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;let{document:r}=t;const o=r,a=o.currentScript,{DocumentFragment:s,HTMLTemplateElement:l,Node:v,Element:T,NodeFilter:S,NamedNodeMap:z=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:M,DOMParser:U,trustedTypes:F}=t,B=T.prototype,Q=E(B,"cloneNode"),W=E(B,"nextSibling"),X=E(B,"childNodes"),Z=E(B,"parentNode");if("function"==typeof l){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let J,ee="";const{implementation:te,createNodeIterator:ne,createDocumentFragment:re,getElementsByTagName:oe}=r,{importNode:ie}=o;let ae={};n.isSupported="function"==typeof e&&"function"==typeof Z&&te&&void 0!==te.createHTMLDocument;const{MUSTACHE_EXPR:ce,ERB_EXPR:se,TMPLIT_EXPR:le,DATA_ATTR:ue,ARIA_ATTR:de,IS_SCRIPT_OR_DATA:pe,ATTR_WHITESPACE:fe}=G;let{IS_ALLOWED_URI:me}=G,ge=null;const he=A({},[...k,..._,...O,...C,...L]);let be=null;const ye=A({},[...D,...j,...q,...P]);let xe=Object.seal(c(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),we=null,ve=null,Te=!0,Ae=!0,Se=!1,Ne=!0,Ee=!1,ke=!1,_e=!1,Oe=!1,Ie=!1,Ce=!1,Re=!1,Le=!0,De=!1;const je="user-content-";let qe=!0,Pe=!1,ze={},Me=null;const Ue=A({},["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"]);let Fe=null;const Be=A({},["audio","video","img","source","image","track"]);let He=null;const Qe=A({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),We="http://www.w3.org/1998/Math/MathML",Ye="http://www.w3.org/2000/svg",Ge="http://www.w3.org/1999/xhtml";let $e=Ge,Ke=!1,Ve=null;const Xe=A({},[We,Ye,Ge],m);let Ze=null;const Je=["application/xhtml+xml","text/html"],et="text/html";let tt=null,nt=null;const rt=r.createElement("form"),ot=function(e){return e instanceof RegExp||e instanceof Function},it=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!nt||nt!==e){if(e&&"object"==typeof e||(e={}),e=N(e),Ze=-1===Je.indexOf(e.PARSER_MEDIA_TYPE)?et:e.PARSER_MEDIA_TYPE,tt="application/xhtml+xml"===Ze?m:f,ge="ALLOWED_TAGS"in e?A({},e.ALLOWED_TAGS,tt):he,be="ALLOWED_ATTR"in e?A({},e.ALLOWED_ATTR,tt):ye,Ve="ALLOWED_NAMESPACES"in e?A({},e.ALLOWED_NAMESPACES,m):Xe,He="ADD_URI_SAFE_ATTR"in e?A(N(Qe),e.ADD_URI_SAFE_ATTR,tt):Qe,Fe="ADD_DATA_URI_TAGS"in e?A(N(Be),e.ADD_DATA_URI_TAGS,tt):Be,Me="FORBID_CONTENTS"in e?A({},e.FORBID_CONTENTS,tt):Ue,we="FORBID_TAGS"in e?A({},e.FORBID_TAGS,tt):{},ve="FORBID_ATTR"in e?A({},e.FORBID_ATTR,tt):{},ze="USE_PROFILES"in e&&e.USE_PROFILES,Te=!1!==e.ALLOW_ARIA_ATTR,Ae=!1!==e.ALLOW_DATA_ATTR,Se=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ne=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ee=e.SAFE_FOR_TEMPLATES||!1,ke=e.WHOLE_DOCUMENT||!1,Ie=e.RETURN_DOM||!1,Ce=e.RETURN_DOM_FRAGMENT||!1,Re=e.RETURN_TRUSTED_TYPE||!1,Oe=e.FORCE_BODY||!1,Le=!1!==e.SANITIZE_DOM,De=e.SANITIZE_NAMED_PROPS||!1,qe=!1!==e.KEEP_CONTENT,Pe=e.IN_PLACE||!1,me=e.ALLOWED_URI_REGEXP||H,$e=e.NAMESPACE||Ge,xe=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ot(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(xe.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ot(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(xe.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(xe.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ee&&(Ae=!1),Ce&&(Ie=!0),ze&&(ge=A({},L),be=[],!0===ze.html&&(A(ge,k),A(be,D)),!0===ze.svg&&(A(ge,_),A(be,j),A(be,P)),!0===ze.svgFilters&&(A(ge,O),A(be,j),A(be,P)),!0===ze.mathMl&&(A(ge,C),A(be,q),A(be,P))),e.ADD_TAGS&&(ge===he&&(ge=N(ge)),A(ge,e.ADD_TAGS,tt)),e.ADD_ATTR&&(be===ye&&(be=N(be)),A(be,e.ADD_ATTR,tt)),e.ADD_URI_SAFE_ATTR&&A(He,e.ADD_URI_SAFE_ATTR,tt),e.FORBID_CONTENTS&&(Me===Ue&&(Me=N(Me)),A(Me,e.FORBID_CONTENTS,tt)),qe&&(ge["#text"]=!0),ke&&A(ge,["html","head","body"]),ge.table&&(A(ge,["tbody"]),delete we.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw w('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw w('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');J=e.TRUSTED_TYPES_POLICY,ee=J.createHTML("")}else void 0===J&&(J=K(F,a)),null!==J&&"string"==typeof ee&&(ee=J.createHTML(""));i&&i(e),nt=e}},at=A({},["mi","mo","mn","ms","mtext"]),ct=A({},["foreignobject","desc","title","annotation-xml"]),st=A({},["title","style","font","a","script"]),lt=A({},[..._,...O,...I]),ut=A({},[...C,...R]),dt=function(e){let t=Z(e);t&&t.tagName||(t={namespaceURI:$e,tagName:"template"});const n=f(e.tagName),r=f(t.tagName);return!!Ve[e.namespaceURI]&&(e.namespaceURI===Ye?t.namespaceURI===Ge?"svg"===n:t.namespaceURI===We?"svg"===n&&("annotation-xml"===r||at[r]):Boolean(lt[n]):e.namespaceURI===We?t.namespaceURI===Ge?"math"===n:t.namespaceURI===Ye?"math"===n&&ct[r]:Boolean(ut[n]):e.namespaceURI===Ge?!(t.namespaceURI===Ye&&!ct[r])&&!(t.namespaceURI===We&&!at[r])&&!ut[n]&&(st[n]||!lt[n]):!("application/xhtml+xml"!==Ze||!Ve[e.namespaceURI]))},pt=function(e){p(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},ft=function(e,t){try{p(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){p(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!be[e])if(Ie||Ce)try{pt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},mt=function(e){let t=null,n=null;if(Oe)e=""+e;else{const t=g(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Ze&&$e===Ge&&(e=''+e+"");const o=J?J.createHTML(e):e;if($e===Ge)try{t=(new U).parseFromString(o,Ze)}catch(e){}if(!t||!t.documentElement){t=te.createDocument($e,"template",null);try{t.documentElement.innerHTML=Ke?ee:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),$e===Ge?oe.call(t,ke?"html":"body")[0]:ke?t.documentElement:i},gt=function(e){return ne.call(e.ownerDocument||e,e,S.SHOW_ELEMENT|S.SHOW_COMMENT|S.SHOW_TEXT,null)},ht=function(e){return e instanceof M&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof z)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},bt=function(e){return"function"==typeof v&&e instanceof v},yt=function(e,t,r){ae[e]&&u(ae[e],(e=>{e.call(n,t,r,nt)}))},xt=function(e){let t=null;if(yt("beforeSanitizeElements",e,null),ht(e))return pt(e),!0;const r=tt(e.nodeName);if(yt("uponSanitizeElement",e,{tagName:r,allowedTags:ge}),e.hasChildNodes()&&!bt(e.firstElementChild)&&x(/<[/\w]/g,e.innerHTML)&&x(/<[/\w]/g,e.textContent))return pt(e),!0;if(!ge[r]||we[r]){if(!we[r]&&vt(r)){if(xe.tagNameCheck instanceof RegExp&&x(xe.tagNameCheck,r))return!1;if(xe.tagNameCheck instanceof Function&&xe.tagNameCheck(r))return!1}if(qe&&!Me[r]){const t=Z(e)||e.parentNode,n=X(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r)t.insertBefore(Q(n[r],!0),W(e))}return pt(e),!0}return e instanceof T&&!dt(e)?(pt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!x(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ee&&3===e.nodeType&&(t=e.textContent,u([ce,se,le],(e=>{t=h(t,e," ")})),e.textContent!==t&&(p(n.removed,{element:e.cloneNode()}),e.textContent=t)),yt("afterSanitizeElements",e,null),!1):(pt(e),!0)},wt=function(e,t,n){if(Le&&("id"===t||"name"===t)&&(n in r||n in rt))return!1;if(Ae&&!ve[t]&&x(ue,t));else if(Te&&x(de,t));else if(!be[t]||ve[t]){if(!(vt(e)&&(xe.tagNameCheck instanceof RegExp&&x(xe.tagNameCheck,e)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(e))&&(xe.attributeNameCheck instanceof RegExp&&x(xe.attributeNameCheck,t)||xe.attributeNameCheck instanceof Function&&xe.attributeNameCheck(t))||"is"===t&&xe.allowCustomizedBuiltInElements&&(xe.tagNameCheck instanceof RegExp&&x(xe.tagNameCheck,n)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(n))))return!1}else if(He[t]);else if(x(me,h(n,fe,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==b(n,"data:")||!Fe[e])if(Se&&!x(pe,h(n,fe,"")));else if(n)return!1;return!0},vt=function(e){return e.indexOf("-")>0},Tt=function(e){yt("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:be};let o=t.length;for(;o--;){const i=t[o],{name:a,namespaceURI:c,value:s}=i,l=tt(a);let p="value"===a?s:y(s);if(r.attrName=l,r.attrValue=p,r.keepAttr=!0,r.forceKeepAttr=void 0,yt("uponSanitizeAttribute",e,r),p=r.attrValue,r.forceKeepAttr)continue;if(ft(a,e),!r.keepAttr)continue;if(!Ne&&x(/\/>/i,p)){ft(a,e);continue}Ee&&u([ce,se,le],(e=>{p=h(p,e," ")}));const f=tt(e.nodeName);if(wt(f,l,p)){if(!De||"id"!==l&&"name"!==l||(ft(a,e),p=je+p),J&&"object"==typeof F&&"function"==typeof F.getAttributeType)if(c);else switch(F.getAttributeType(f,l)){case"TrustedHTML":p=J.createHTML(p);break;case"TrustedScriptURL":p=J.createScriptURL(p)}try{c?e.setAttributeNS(c,a,p):e.setAttribute(a,p),d(n.removed)}catch(e){}}}yt("afterSanitizeAttributes",e,null)},At=function e(t){let n=null;const r=gt(t);for(yt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)yt("uponSanitizeShadowNode",n,null),xt(n)||(n.content instanceof s&&e(n.content),Tt(n));yt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,a=null,c=null;if(Ke=!e,Ke&&(e="\x3c!--\x3e"),"string"!=typeof e&&!bt(e)){if("function"!=typeof e.toString)throw w("toString is not a function");if("string"!=typeof(e=e.toString()))throw w("dirty is not a string, aborting")}if(!n.isSupported)return e;if(_e||it(t),n.removed=[],"string"==typeof e&&(Pe=!1),Pe){if(e.nodeName){const t=tt(e.nodeName);if(!ge[t]||we[t])throw w("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof v)r=mt("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!Ie&&!Ee&&!ke&&-1===e.indexOf("<"))return J&&Re?J.createHTML(e):e;if(r=mt(e),!r)return Ie?null:Re?ee:""}r&&Oe&&pt(r.firstChild);const l=gt(Pe?e:r);for(;a=l.nextNode();)xt(a)||(a.content instanceof s&&At(a.content),Tt(a));if(Pe)return e;if(Ie){if(Ce)for(c=re.call(r.ownerDocument);r.firstChild;)c.appendChild(r.firstChild);else c=r;return(be.shadowroot||be.shadowrootmode)&&(c=ie.call(o,c,!0)),c}let d=ke?r.outerHTML:r.innerHTML;return ke&&ge["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&x(Y,r.ownerDocument.doctype.name)&&(d="\n"+d),Ee&&u([ce,se,le],(e=>{d=h(d,e," ")})),J&&Re?J.createHTML(d):d},n.setConfig=function(){it(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),_e=!0},n.clearConfig=function(){nt=null,_e=!1},n.isValidAttribute=function(e,t,n){nt||it({});const r=tt(e),o=tt(t);return wt(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(ae[e]=ae[e]||[],p(ae[e],t))},n.removeHook=function(e){if(ae[e])return d(ae[e])},n.removeHooks=function(e){ae[e]&&(ae[e]=[])},n.removeAllHooks=function(){ae={}},n}var X=V();return X}();var P=w(q.exports),z=function(e){return{__html:j((0,P.sanitize)(e))}},M=function(e,t,n,r,o){var i=o.userInput,a=o.userAttempt,s=o.currentQuestionIndex,u=o.continueTillCorrect,p=o.showNextQuestionButton,f=o.incorrect,m=o.correct,g=o.setButtons,h=o.setIsCorrect,b=o.setIncorrectAnswer,y=o.setCorrect,x=o.setIncorrect,w=o.setShowNextQuestionButton,v=o.setUserInput,T=o.setUserAttempt,A="".concat(e),S={0:{disabled:!0},1:{disabled:!0},2:{disabled:!0},3:{disabled:!0}},N=d(i);if("single"===n)void 0===N[s]&&(N[s]=e),A===t?(f.indexOf(s)<0&&m.indexOf(s)<0&&m.push(s),g((function(n){return c(c(c({},n),S),{},l({},e-1,{className:A===t?"correct":"incorrect"}))})),h(!0),b(!1),y(m),w(!0)):(m.indexOf(s)<0&&f.indexOf(s)<0&&f.push(s),u?g((function(t){return c(c({},t),{},l({},e-1,{disabled:!t[e-1]}))})):(g((function(n){return c(c(c({},n),S),{},l({},e-1,{className:A===t?"correct":"incorrect"}))})),w(!0)),b(!0),h(!1),x(f));else{var E=t.length;if(void 0===N[s]&&(N[s]=[]),N[s].length=0&&u.splice(u.indexOf(i),1)):(u.indexOf(i)<0&&u.push(i),f.indexOf(i)>=0&&f.splice(f.indexOf(i),1)),m(f),g(u),a((function(t){return c(c(c({},t),b),{},l({},e-1,{className:"selected"}))})),s(!0);else{if(void 0===y[i]&&(y[i]=[]),y[i].includes(e)?y[i].splice(y[i].indexOf(e),1):y[i].push(e),y[i].length===t.length){var x,w=!0,v=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=p(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}(o[i]);try{for(v.s();!(x=v.n()).done;){var T=x.value;if(!t.includes(T)){w=!1,u.indexOf(i)<0&&u.push(i),f.indexOf(i)>=0&&f.splice(f.indexOf(i),1);break}}}catch(e){v.e(e)}finally{v.f()}w&&(f.indexOf(i)<0&&f.push(i),u.indexOf(i)>=0&&u.splice(u.indexOf(i),1))}else u.indexOf(i)<0&&u.push(i),f.indexOf(i)>=0&&f.splice(f.indexOf(i),1);m(f),g(u),a((function(t){return c(c({},t),{},l({},e-1,{className:y[i].includes(e)?"selected":void 0}))})),y[i].length>0&&s(!0)}h(y)};function F(e){var t=e.question,n=e.isResultPage,r=t.explanation;return r?n?I.jsx("div",{className:"explanation",children:r}):I.jsxs("div",{children:[I.jsx("br",{}),r]}):null}var B=function(e){return e.messageForCorrectAnswer||"You are correct. Please click Next to continue."},H=function(e){return e.messageForIncorrectAnswer||"Incorrect answer. Please try again."};function Q(e){var t=e.showInstantFeedback,n=e.incorrectAnswer,o=e.correctAnswer,i=e.question,a=e.onQuestionSubmit,c=e.userAnswer;return r((function(){a&&(o||n)&&a({question:i,userAnswer:c,isCorrect:o})}),[o,n]),I.jsxs(I.Fragment,{children:[n&&t&&I.jsx("div",{className:"alert incorrect",children:H(i)}),o&&t&&I.jsxs("div",{className:"alert correct",children:[B(i),I.jsx(F,{question:i,isResultPage:!1})]})]})}function W(e){var n=e.questions,a=e.appLocale,c=e.showDefaultResult,l=e.onComplete,p=e.customResultPage,f=e.showInstantFeedback,m=e.continueTillCorrect,g=e.revealAnswerOnSubmit,h=e.allowNavigation,b=e.onQuestionSubmit,y=e.timer,w=e.allowPauseTimer,v=u(t(!1),2),T=v[0],A=v[1],S=u(t(!1),2),N=S[0],E=S[1],k=u(t(!1),2),_=k[0],O=k[1],R=u(t(!1),2),L=R[0],D=R[1],j=u(t(0),2),q=j[0],P=j[1],B=u(t({}),2),H=B[0],W=B[1],Y=u(t([]),2),G=Y[0],$=Y[1],K=u(t([]),2),V=K[0],X=K[1],Z=u(t([]),2),J=Z[0],ee=Z[1],te=u(t([]),2),ne=te[0],re=te[1],oe=u(t("all"),2),ie=oe[0],ae=oe[1],ce=u(t(1),2),se=ce[0],le=ce[1],ue=u(t(!0),2),de=ue[0],pe=ue[1],fe=u(t(void 0),2),me=fe[0],ge=fe[1],he=u(t(0),2),be=he[0],ye=he[1],xe=u(t(0),2),we=xe[0],ve=xe[1],Te=u(t(n[q]),2),Ae=Te[0],Se=Te[1],Ne=u(t(void 0),2),Ee=Ne[0],ke=Ne[1],_e=u(t(y),2),Oe=_e[0],Ie=_e[1],Ce=u(t(!0),2),Re=Ce[0],Le=Ce[1];r((function(){pe(void 0===c||c)}),[c]),r((function(){Se(n[q])}),[q,n]),r((function(){var e=Ae.answerSelectionType;ge(e||"single")}),[Ae,q]),r((function(){if(L){Le(!1);for(var e=0,t=0,r=0;r",t)}),n&&I.jsx("span",{className:"selection-tag segment",children:n})]})},ze=function(e,t){return"string"==typeof t?e===Number(t):"object"===s(t)&&void 0!==t.find((function(t){return t===e}))},Me=o((function(){var e,t;if("all"!==ie){var r=J;"correct"===ie?r=G:"incorrect"===ie&&(r=V),e=n.filter((function(e,t){return-1!==r.indexOf(t)})),t=ne.filter((function(e,t){return-1!==r.indexOf(t)}))}return(e||n).map((function(e,n){var r=t?t[n]:ne[n],o=e.answerSelectionType||"single";return I.jsxs("div",{className:"result-answer-wrapper",children:[I.jsx("h3",{dangerouslySetInnerHTML:z("Q".concat(e.questionIndex,": ").concat(e.question," ").concat(a.marksOfQuestion.replace("",e.point)))}),e.questionPic&&I.jsx("img",{src:e.questionPic,alt:"question"}),Pe(o,e.correctAnswer.length,e.segment),I.jsx("div",{className:"result-answer",children:qe(e,r)}),I.jsx(F,{question:e,isResultPage:!0})]},x())}))}),[L,ie]);r((function(){var e;return y&&Re&&Oe>0&&(e=setInterval((function(){Ie((function(e){return e-1}))}),1e3)),function(){return y&&clearInterval(e)}}),[Re,Oe,y]);var Ue,Fe,Be,He,Qe,We,Ye,Ge,$e,Ke,Ve=function(e){return e<10?"0":""},Xe=function(e){var t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60;return"".concat(Ve(t)).concat(t,":").concat(Ve(n)).concat(n,":").concat(Ve(r)).concat(r)};return I.jsxs("div",{className:"questionWrapper",children:[y&&!Re&&I.jsxs("div",{children:[a.timerTimeTaken,":"," ",I.jsx("b",{children:Xe(y-Oe)})]}),y&&Re&&I.jsxs("div",{children:[a.timerTimeRemaining,":"," ",I.jsx("b",{children:Xe(Oe)})]}),y&&0===Oe&&Re&&(Le(!1),D(!0),void n.forEach((function(e,t){void 0===ne[t]&&ee((function(e){return[].concat(d(e),[t])}))}))),!L&&I.jsxs("div",{className:"questionWrapperBody",children:[I.jsxs("div",{children:["".concat(a.question," ").concat(q+1," / ").concat(n.length,":"),I.jsx("br",{}),y&&w&&I.jsx("button",{type:"button",className:"timerBtn",onClick:function(){Le(!Re)},children:Re?a.pauseScreenPause:a.pauseScreenResume})]}),Re?I.jsxs(I.Fragment,{children:[I.jsx("h3",{dangerouslySetInnerHTML:z("".concat(Ae&&Ae.question," ").concat(a.marksOfQuestion.replace("",Ae.point)))}),Ae&&Ae.questionPic&&I.jsx("img",{src:Ae.questionPic,alt:"question"}),Ae&&Pe(me,Ae.correctAnswer.length,Ae.segment),I.jsx("div",{className:"questionModal",children:I.jsx(Q,{question:Ae,showInstantFeedback:f,correctAnswer:N,incorrectAnswer:T,onQuestionSubmit:b,userAnswer:d(ne).pop()})}),Ae&&(Ue=Ae,Fe=H,Be=Ue.answers,He=Ue.correctAnswer,Qe=Ue.questionType,We=Ue.questionIndex,Ye=Ue.answerSelectionType,Ge=function(e){return M(e+1,He,Ye,Be,{userInput:ne,userAttempt:se,currentQuestionIndex:q,continueTillCorrect:m,showNextQuestionButton:_,incorrect:V,correct:G,setButtons:W,setIsCorrect:E,setIncorrectAnswer:A,setCorrect:$,setIncorrect:X,setShowNextQuestionButton:O,setUserInput:re,setUserAttempt:le})},$e=function(e){return U(e+1,He,Ye,{userInput:ne,currentQuestionIndex:q,setButtons:W,setShowNextQuestionButton:O,incorrect:V,correct:G,setCorrect:$,setIncorrect:X,setUserInput:re})},Ke=function(e){return void 0!==ne[We-1]&&("single"===Ye?ne[We-1]===e:Array.isArray(ne[We-1])&&ne[We-1].includes(e))},Ye=Ye||"single",Be.map((function(e,t){return I.jsx(i,{children:void 0!==Fe[t]?I.jsxs("button",{type:"button",disabled:Fe[t].disabled||!1,className:"".concat(Fe[t].className," answerBtn btn ").concat(ze(t+1,He)&&f?"correct":""),onClick:function(){return g?$e(t):Ge(t)},children:["text"===Qe&&I.jsx("span",{children:e}),"photo"===Qe&&I.jsx("img",{src:e,alt:"answer"})]}):I.jsxs("button",{type:"button",onClick:function(){return g?$e(t):Ge(t)},className:"answerBtn btn ".concat(h&&Ke(t+1)?"selected":null),children:["text"===Qe&&e,"photo"===Qe&&I.jsx("img",{src:e,alt:"answer"})]})},x())}))),(_||h)&&I.jsxs("div",{className:"questionBtnContainer",children:[h&&q>0&&I.jsx("button",{onClick:function(){return De(q-2)},className:"prevQuestionBtn btn",type:"button",children:a.prevQuestionBtn}),I.jsx("button",{onClick:function(){return De(q)},className:"nextQuestionBtn btn",type:"button",children:a.nextQuestionBtn})]})]}):I.jsxs("span",{className:"timerPauseScreen dark:text-white text-black",children:[I.jsx("br",{}),I.jsx("br",{}),a.pauseScreenDisplay]})]}),L&&de&&void 0===p&&I.jsxs("div",{className:"card-body",children:[I.jsx("h2",{children:a.resultPageHeaderText.replace("",G.length).replace("",n.length)}),I.jsx("h2",{children:a.resultPagePoint.replace("",we).replace("",be)}),I.jsx("br",{}),I.jsx(C,{filteredValue:ie,handleChange:je,appLocale:a}),Me()]}),L&&!de&&void 0!==p&&p(Ee)]})}var Y={landingHeaderText:" Questions",question:"Question",startQuizBtn:"Start Quiz",resultFilterAll:"All",resultFilterCorrect:"Correct",resultFilterIncorrect:"Incorrect",resultFilterUnanswered:"Unanswered",nextQuestionBtn:"Next",prevQuestionBtn:"Prev",resultPageHeaderText:"You have completed the quiz. You got out of questions.",resultPagePoint:"You scored out of .",pauseScreenDisplay:"Test is paused. Clicked the Resume button to continue",timerTimeRemaining:"Time Remaining",timerTimeTaken:"Time Taken",pauseScreenPause:"Pause",pauseScreenResume:"Resume",singleSelectionTagText:"Single Selection",multipleSelectionTagText:"Multiple Selection",pickNumberOfSelection:"Pick ",marksOfQuestion:"( marks)"};function G(e){var n=e.quiz,i=e.shuffle,a=e.shuffleAnswer,s=e.showDefaultResult,l=e.onComplete,d=e.customResultPage,p=e.showInstantFeedback,f=e.continueTillCorrect,m=e.revealAnswerOnSubmit,g=e.allowNavigation,h=e.onQuestionSubmit,b=e.disableSynopsis,y=e.timer,x=e.allowPauseTimer,w=u(t(!1),2),v=w[0],T=w[1],A=u(t(n.questions),2),S=A[0],N=A[1],E=n.nrOfQuestions&&n.nrOfQuestions0;t-=1){var n=Math.floor(Math.random()*(t+1)),r=[e[n],e[t]];e[t]=r[0],e[n]=r[1]}return e}),[]);r((function(){b&&T(!0)}),[]),r((function(){var e=n.questions;i&&(e=k(e)),a&&(e=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((function(e){var t,n=(null===(t=e.answers)||void 0===t?void 0:t.map((function(e,t){return[e,t]}))).sort((function(){return Math.random()-.5})),r=n.map((function(e){return e[0]}));if("single"===e.answerSelectionType){var o=e.correctAnswer,i=n.findIndex((function(e){return"".concat(e[1]+1)==="".concat(o)}))+1;return c(c({},e),{},{correctAnswer:"".concat(i),answers:r})}if("multiple"===e.answerSelectionType){var a=e.correctAnswer.map((function(e){return n.findIndex((function(t){return"".concat(t[1]+1)==="".concat(e)}))+1}));return c(c({},e),{},{correctAnswer:a,answers:r})}return e}))}(e)),e.length=E,e=e.map((function(e,t){return c(c({},e),{},{questionIndex:t+1})})),N(e)}),[v]);if(!function(e){if(!e)return console.error("Quiz object is required."),!1;if(y&&"number"!=typeof y||y<1)return console.error(y&&"number"!=typeof y?"timer must be a number":"timer must be a number greater than 0"),!1;if(x&&"boolean"!=typeof x)return console.error("allowPauseTimer must be a Boolean"),!1;for(var t=0;t",E)}),n.quizSynopsis&&I.jsx("div",{className:"quiz-synopsis",children:n.quizSynopsis}),I.jsx("div",{className:"startQuizWrapper",children:I.jsx("button",{type:"button",onClick:function(){return T(!0)},className:"startQuizBtn btn",children:_.startQuizBtn})})]}),v&&I.jsx(W,{questions:S,showDefaultResult:s,onComplete:l,customResultPage:d,showInstantFeedback:p,continueTillCorrect:f,revealAnswerOnSubmit:m,allowNavigation:g,appLocale:_,onQuestionSubmit:h,timer:y,allowPauseTimer:x})]})}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('.react-quiz-container{margin:20px;max-width:500px}.react-quiz-container .startQuizWrapper{margin-top:10px}.react-quiz-container .btn{background-image:none;border:1px solid transparent;cursor:pointer;font-weight:600;margin-bottom:0;padding:11px 12px;text-align:center;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap}.react-quiz-container .questionWrapper .btn{border:1px solid #e8e8e8;border-radius:4px;display:block;font-size:15px;margin-bottom:10px;margin-top:10px;text-align:unset;white-space:normal}.react-quiz-container .questionWrapper .btn.correct,.timerBtn{background:green;color:#fff}.timerBtn{border:0!important;border-radius:10px;cursor:pointer;float:right;padding:5px;position:relative;top:-35px;width:80px}.timerPauseScreen{font-size:30px}.react-quiz-container .questionModal .alert{border:1px solid transparent;border-radius:2px;color:#fff;margin-bottom:21px;padding:20px}.react-quiz-container .correct{background:green}.react-quiz-container .incorrect{background:red;color:#fff}.react-quiz-container .unanswered{background:grey;color:#fff}.react-quiz-container .answerBtn,.react-quiz-container .questionWrapper img{width:100%}.react-quiz-container .selected{background:#007bff;color:#fff}.react-quiz-container .startQuizWrapper .startQuizBtn{background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;color:rgba(0,0,0,.65);font-size:15px;line-height:1.35135}.react-quiz-container .result-answer-wrapper{border:1px solid #e8e8e8;border-bottom-left-radius:5px;border-bottom-right-radius:5px;margin-bottom:20px}.react-quiz-container .result-answer-wrapper h3{background-color:#fafafa;border-top-left-radius:5px;border-top-right-radius:5px;color:rgba(0,0,0,.9);margin:0;opacity:.8;padding:10px}.react-quiz-container .result-answer-wrapper .explanation{border:1px solid #e8e8e8;margin:0 20px 20px;padding:20px}.react-quiz-container .result-answer-wrapper .tag-container{margin:20px}.react-quiz-container .result-answer{padding:0 20px}.react-quiz-container .quiz-synopsis{margin:15px 0}.react-quiz-container .tag-container{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:20px;margin-top:20px}.react-quiz-container .number-of-selection,.react-quiz-container .selection-tag{border-radius:5px;color:#fff;padding:7px}.react-quiz-container .number-of-selection{background:#673ab7;margin-left:5px}.react-quiz-container .selection-tag.single{background:#3f51b5}.react-quiz-container .selection-tag.multiple{background:#ff9800}.react-quiz-container .selection-tag.segment{background:#3db4b9;margin-left:5px}.react-quiz-container .questionBtnContainer{display:flex;justify-content:space-between}.react-quiz-container .quiz-result-filter{bottom:15px;position:relative;width:120px;.filter-dropdown-select{background-color:#fcfcfc;border:2px solid #c2c5c7;border-radius:7px;bottom:10px;color:#333;cursor:pointer;font-size:16px;height:12px;margin-top:2px;padding:8px;position:relative;text-transform:capitalize}.filter-dropdown-select:after{color:#a5a5a5;content:"▼";font-size:11px;position:absolute;right:10px;top:57%;transform:translateY(-50%);transition:all .3s ease}.filter-dropdown-select:hover{border:2px solid #51aae6;box-shadow:0 0 6px rgba(109,179,250,.5)}.dropdown-options{background-color:#fcfcfc;border-radius:10px;box-shadow:0 0 10px hsla(210,2%,56%,.5);left:0;list-style:none;margin:0;padding:0;position:absolute;top:85%;width:100%;z-index:1}.filter-dropdown-select.open{border:2px solid #51aae6;box-shadow:0 0 6px rgba(109,179,250,.5)}.dropdown-options .dropdown-options-item{cursor:pointer;font-size:16px;padding:10px}.dropdown-options .dropdown-options-item:hover{background-color:hsla(0,0%,89%,.852);border-radius:5px}.dropdown-options .dropdown-options-item:focus{background-color:#d7f1f9;font-weight:700}.filter-dropdown-select .selected-option.selected-open{color:#c6c2c2;font-weight:lighter}.filter-dropdown-select .selected-option{bottom:2px;font-size:16px;position:relative}.filter-dropdown-select:focus+.dropdown-options{max-height:200px}.dropdown-options .dropdown-options-item.selected{background-color:#d7f1f9;color:#333;font-weight:700}.dropdown-options.open{max-height:200px}}');export{G as default}; +import e,{useState as t,useRef as n,useEffect as r,useCallback as o,Fragment as i}from"react";function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function g(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var h={exports:{}},b={},x=e,y=Symbol.for("react.element"),w=Symbol.for("react.fragment"),v=Object.prototype.hasOwnProperty,T=x.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,A={key:!0,ref:!0,__self:!0,__source:!0};function N(e,t,n){var r,o={},i=null,a=null;for(r in void 0!==n&&(i=""+n),void 0!==t.key&&(i=""+t.key),void 0!==t.ref&&(a=t.ref),t)v.call(t,r)&&!A.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:y,type:e,key:i,ref:a,props:o,_owner:T.current}}b.Fragment=w,b.jsx=N,b.jsxs=N,h.exports=b;var S=h.exports;function E(e){var o=e.filteredValue,i=e.handleChange,a=e.appLocale,c=u(t(!1),2),s=c[0],l=c[1],d=n(null),p=function(){l(!s)},f=function(e){i({target:{value:e}}),l(!1)},m=s?"selected-open":"";return r((function(){var e=function(e){s&&d.current&&!d.current.contains(e.target)&&l(!1)};return document.addEventListener("click",e),function(){document.removeEventListener("click",e)}}),[s]),S.jsxs("div",{className:"quiz-result-filter",children:[S.jsxs("div",{ref:d,className:"filter-dropdown-select ".concat(s?"open":""),onClick:p,onKeyDown:function(e){"Enter"===e.key&&p()},role:"button",tabIndex:0,children:[S.jsx("div",{className:"selected-option ".concat(m),children:"all"===o?a.resultFilterAll:o}),S.jsx("span",{className:"arrow ".concat(s?"up":"down")})]}),s&&S.jsxs("div",{className:"dropdown-options",role:"menu","aria-labelledby":"quiz-filter",children:[S.jsx("div",{className:"dropdown-options-item ".concat("all"===o?"selected":""),onClick:function(){return f("all")},onKeyDown:function(e){"Enter"===e.key&&f("all")},role:"menuitem",tabIndex:0,children:a.resultFilterAll}),S.jsx("div",{className:"dropdown-options-item ".concat("correct"===o?"selected":""),onClick:function(){return f("correct")},onKeyDown:function(e){"Enter"===e.key&&f("correct")},role:"menuitem",tabIndex:0,children:a.resultFilterCorrect}),S.jsx("div",{className:"dropdown-options-item ".concat("incorrect"===o?"selected":""),onClick:function(){return f("incorrect")},onKeyDown:function(e){"Enter"===e.key&&f("incorrect")},role:"menuitem",tabIndex:0,children:a.resultFilterIncorrect}),S.jsx("div",{className:"dropdown-options-item ".concat("unanswered"===o?"selected":""),onClick:function(){return f("unanswered")},onKeyDown:function(e){"Enter"===e.key&&f("unanswered")},role:"menuitem",tabIndex:0,children:a.resultFilterUnanswered})]})]})}var k={"":["",""],_:["",""],"*":["",""],"~":["",""],"\n":["
    "]," ":["
    "],"-":["
    "]};function O(e){return e.replace(RegExp("^"+(e.match(/^(\t| )+/)||"")[0],"gm"),"")}function _(e){return(e+"").replace(/"/g,""").replace(//g,">")}function I(e,t){var n,r,o,i,a,c=/((?:^|\n+)(?:\n---+|\* \*(?: \*)+)\n)|(?:^``` *(\w*)\n([\s\S]*?)\n```$)|((?:(?:^|\n+)(?:\t| {2,}).+)+\n*)|((?:(?:^|\n)([>*+-]|\d+\.)\s+.*)+)|(?:!\[([^\]]*?)\]\(([^)]+?)\))|(\[)|(\](?:\(([^)]+?)\))?)|(?:(?:^|\n+)([^\s].*)\n(-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,6})\s*(.+)(?:\n+|$))|(?:`([^`].*?)`)|( \n\n*|\n{2,}|__|\*\*|[_*]|~~)/gm,s=[],l="",u=t||{},d=0;function p(e){var t=k[e[1]||""],n=s[s.length-1]==e;return t?t[1]?(n?s.pop():s.push(e),t[0|n]):t[0]:e}function f(){for(var e="";s.length;)e+=p(s[s.length-1]);return e}for(e=e.replace(/^\[(.+?)\]:\s*(.+)$/gm,(function(e,t,n){return u[t.toLowerCase()]=n,""})).replace(/^\n+|\n+$/g,"");o=c.exec(e);)r=e.substring(d,o.index),d=c.lastIndex,n=o[0],r.match(/[^\\](\\\\)*\\$/)||((a=o[3]||o[4])?n='
    "+O(_(a).replace(/^\n+|\n+$/g,""))+"
    ":(a=o[6])?(a.match(/\./)&&(o[5]=o[5].replace(/^\d+/gm,"")),i=I(O(o[5].replace(/^\s*[>*+.-]/gm,""))),">"==a?a="blockquote":(a=a.match(/\./)?"ol":"ul",i=i.replace(/^(.*)(\n|$)/gm,"
  • $1
  • ")),n="<"+a+">"+i+""):o[8]?n=''+_(o[7])+'':o[10]?(l=l.replace("
    ",''),n=f()+""):o[9]?n="":o[12]||o[14]?n="<"+(a="h"+(o[14]?o[14].length:o[13]>"="?1:2))+">"+I(o[12]||o[15],u)+"":o[16]?n=""+_(o[16])+"":(o[17]||o[1])&&(n=p(o[17]||"--"))),l+=r,l+=n;return(l+e.substring(d)+f()).replace(/^\n+|\n+$/g,"")}var C={exports:{}}; +/*! @license DOMPurify 3.0.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.8/LICENSE */C.exports=function(){const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:o}=Object;let{freeze:i,seal:a,create:c}=Object,{apply:s,construct:l}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),s||(s=function(e,t,n){return e.apply(t,n)}),l||(l=function(e,t){return new e(...t)});const u=v(Array.prototype.forEach),d=v(Array.prototype.pop),p=v(Array.prototype.push),f=v(String.prototype.toLowerCase),m=v(String.prototype.toString),g=v(String.prototype.match),h=v(String.prototype.replace),b=v(String.prototype.indexOf),x=v(String.prototype.trim),y=v(RegExp.prototype.test),w=T(TypeError);function v(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o2&&void 0!==arguments[2]?arguments[2]:f;t&&t(e,null);let i=r.length;for(;i--;){let t=r[i];if("string"==typeof t){const e=o(t);e!==t&&(n(r)||(r[i]=e),t=e)}e[t]=!0}return e}function N(e){for(let t=0;t/gm),U=a(/\${[\w\W]*}/gm),F=a(/^data-[\-\w.\u00B7-\uFFFF]/),B=a(/^aria-[\-\w]+$/),H=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Q=a(/^(?:\w+script|data):/i),W=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Y=a(/^html$/i);var G=Object.freeze({__proto__:null,MUSTACHE_EXPR:z,ERB_EXPR:M,TMPLIT_EXPR:U,DATA_ATTR:F,ARIA_ATTR:B,IS_ALLOWED_URI:H,IS_SCRIPT_OR_DATA:Q,ATTR_WHITESPACE:W,DOCTYPE_NAME:Y});const $=function(){return"undefined"==typeof window?null:window},K=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function X(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$();const n=e=>X(e);if(n.version="3.0.8",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;let{document:r}=t;const o=r,a=o.currentScript,{DocumentFragment:s,HTMLTemplateElement:l,Node:v,Element:T,NodeFilter:N,NamedNodeMap:z=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:M,DOMParser:U,trustedTypes:F}=t,B=T.prototype,Q=E(B,"cloneNode"),W=E(B,"nextSibling"),V=E(B,"childNodes"),Z=E(B,"parentNode");if("function"==typeof l){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let J,ee="";const{implementation:te,createNodeIterator:ne,createDocumentFragment:re,getElementsByTagName:oe}=r,{importNode:ie}=o;let ae={};n.isSupported="function"==typeof e&&"function"==typeof Z&&te&&void 0!==te.createHTMLDocument;const{MUSTACHE_EXPR:ce,ERB_EXPR:se,TMPLIT_EXPR:le,DATA_ATTR:ue,ARIA_ATTR:de,IS_SCRIPT_OR_DATA:pe,ATTR_WHITESPACE:fe}=G;let{IS_ALLOWED_URI:me}=G,ge=null;const he=A({},[...k,...O,..._,...C,...L]);let be=null;const xe=A({},[...j,...D,...q,...P]);let ye=Object.seal(c(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),we=null,ve=null,Te=!0,Ae=!0,Ne=!1,Se=!0,Ee=!1,ke=!1,Oe=!1,_e=!1,Ie=!1,Ce=!1,Re=!1,Le=!0,je=!1;const De="user-content-";let qe=!0,Pe=!1,ze={},Me=null;const Ue=A({},["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"]);let Fe=null;const Be=A({},["audio","video","img","source","image","track"]);let He=null;const Qe=A({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),We="http://www.w3.org/1998/Math/MathML",Ye="http://www.w3.org/2000/svg",Ge="http://www.w3.org/1999/xhtml";let $e=Ge,Ke=!1,Xe=null;const Ve=A({},[We,Ye,Ge],m);let Ze=null;const Je=["application/xhtml+xml","text/html"],et="text/html";let tt=null,nt=null;const rt=r.createElement("form"),ot=function(e){return e instanceof RegExp||e instanceof Function},it=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!nt||nt!==e){if(e&&"object"==typeof e||(e={}),e=S(e),Ze=-1===Je.indexOf(e.PARSER_MEDIA_TYPE)?et:e.PARSER_MEDIA_TYPE,tt="application/xhtml+xml"===Ze?m:f,ge="ALLOWED_TAGS"in e?A({},e.ALLOWED_TAGS,tt):he,be="ALLOWED_ATTR"in e?A({},e.ALLOWED_ATTR,tt):xe,Xe="ALLOWED_NAMESPACES"in e?A({},e.ALLOWED_NAMESPACES,m):Ve,He="ADD_URI_SAFE_ATTR"in e?A(S(Qe),e.ADD_URI_SAFE_ATTR,tt):Qe,Fe="ADD_DATA_URI_TAGS"in e?A(S(Be),e.ADD_DATA_URI_TAGS,tt):Be,Me="FORBID_CONTENTS"in e?A({},e.FORBID_CONTENTS,tt):Ue,we="FORBID_TAGS"in e?A({},e.FORBID_TAGS,tt):{},ve="FORBID_ATTR"in e?A({},e.FORBID_ATTR,tt):{},ze="USE_PROFILES"in e&&e.USE_PROFILES,Te=!1!==e.ALLOW_ARIA_ATTR,Ae=!1!==e.ALLOW_DATA_ATTR,Ne=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Se=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ee=e.SAFE_FOR_TEMPLATES||!1,ke=e.WHOLE_DOCUMENT||!1,Ie=e.RETURN_DOM||!1,Ce=e.RETURN_DOM_FRAGMENT||!1,Re=e.RETURN_TRUSTED_TYPE||!1,_e=e.FORCE_BODY||!1,Le=!1!==e.SANITIZE_DOM,je=e.SANITIZE_NAMED_PROPS||!1,qe=!1!==e.KEEP_CONTENT,Pe=e.IN_PLACE||!1,me=e.ALLOWED_URI_REGEXP||H,$e=e.NAMESPACE||Ge,ye=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ot(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ye.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ot(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ye.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(ye.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ee&&(Ae=!1),Ce&&(Ie=!0),ze&&(ge=A({},L),be=[],!0===ze.html&&(A(ge,k),A(be,j)),!0===ze.svg&&(A(ge,O),A(be,D),A(be,P)),!0===ze.svgFilters&&(A(ge,_),A(be,D),A(be,P)),!0===ze.mathMl&&(A(ge,C),A(be,q),A(be,P))),e.ADD_TAGS&&(ge===he&&(ge=S(ge)),A(ge,e.ADD_TAGS,tt)),e.ADD_ATTR&&(be===xe&&(be=S(be)),A(be,e.ADD_ATTR,tt)),e.ADD_URI_SAFE_ATTR&&A(He,e.ADD_URI_SAFE_ATTR,tt),e.FORBID_CONTENTS&&(Me===Ue&&(Me=S(Me)),A(Me,e.FORBID_CONTENTS,tt)),qe&&(ge["#text"]=!0),ke&&A(ge,["html","head","body"]),ge.table&&(A(ge,["tbody"]),delete we.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw w('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw w('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');J=e.TRUSTED_TYPES_POLICY,ee=J.createHTML("")}else void 0===J&&(J=K(F,a)),null!==J&&"string"==typeof ee&&(ee=J.createHTML(""));i&&i(e),nt=e}},at=A({},["mi","mo","mn","ms","mtext"]),ct=A({},["foreignobject","desc","title","annotation-xml"]),st=A({},["title","style","font","a","script"]),lt=A({},[...O,..._,...I]),ut=A({},[...C,...R]),dt=function(e){let t=Z(e);t&&t.tagName||(t={namespaceURI:$e,tagName:"template"});const n=f(e.tagName),r=f(t.tagName);return!!Xe[e.namespaceURI]&&(e.namespaceURI===Ye?t.namespaceURI===Ge?"svg"===n:t.namespaceURI===We?"svg"===n&&("annotation-xml"===r||at[r]):Boolean(lt[n]):e.namespaceURI===We?t.namespaceURI===Ge?"math"===n:t.namespaceURI===Ye?"math"===n&&ct[r]:Boolean(ut[n]):e.namespaceURI===Ge?!(t.namespaceURI===Ye&&!ct[r])&&!(t.namespaceURI===We&&!at[r])&&!ut[n]&&(st[n]||!lt[n]):!("application/xhtml+xml"!==Ze||!Xe[e.namespaceURI]))},pt=function(e){p(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},ft=function(e,t){try{p(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){p(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!be[e])if(Ie||Ce)try{pt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},mt=function(e){let t=null,n=null;if(_e)e=""+e;else{const t=g(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Ze&&$e===Ge&&(e=''+e+"");const o=J?J.createHTML(e):e;if($e===Ge)try{t=(new U).parseFromString(o,Ze)}catch(e){}if(!t||!t.documentElement){t=te.createDocument($e,"template",null);try{t.documentElement.innerHTML=Ke?ee:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),$e===Ge?oe.call(t,ke?"html":"body")[0]:ke?t.documentElement:i},gt=function(e){return ne.call(e.ownerDocument||e,e,N.SHOW_ELEMENT|N.SHOW_COMMENT|N.SHOW_TEXT,null)},ht=function(e){return e instanceof M&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof z)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},bt=function(e){return"function"==typeof v&&e instanceof v},xt=function(e,t,r){ae[e]&&u(ae[e],(e=>{e.call(n,t,r,nt)}))},yt=function(e){let t=null;if(xt("beforeSanitizeElements",e,null),ht(e))return pt(e),!0;const r=tt(e.nodeName);if(xt("uponSanitizeElement",e,{tagName:r,allowedTags:ge}),e.hasChildNodes()&&!bt(e.firstElementChild)&&y(/<[/\w]/g,e.innerHTML)&&y(/<[/\w]/g,e.textContent))return pt(e),!0;if(!ge[r]||we[r]){if(!we[r]&&vt(r)){if(ye.tagNameCheck instanceof RegExp&&y(ye.tagNameCheck,r))return!1;if(ye.tagNameCheck instanceof Function&&ye.tagNameCheck(r))return!1}if(qe&&!Me[r]){const t=Z(e)||e.parentNode,n=V(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r)t.insertBefore(Q(n[r],!0),W(e))}return pt(e),!0}return e instanceof T&&!dt(e)?(pt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!y(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ee&&3===e.nodeType&&(t=e.textContent,u([ce,se,le],(e=>{t=h(t,e," ")})),e.textContent!==t&&(p(n.removed,{element:e.cloneNode()}),e.textContent=t)),xt("afterSanitizeElements",e,null),!1):(pt(e),!0)},wt=function(e,t,n){if(Le&&("id"===t||"name"===t)&&(n in r||n in rt))return!1;if(Ae&&!ve[t]&&y(ue,t));else if(Te&&y(de,t));else if(!be[t]||ve[t]){if(!(vt(e)&&(ye.tagNameCheck instanceof RegExp&&y(ye.tagNameCheck,e)||ye.tagNameCheck instanceof Function&&ye.tagNameCheck(e))&&(ye.attributeNameCheck instanceof RegExp&&y(ye.attributeNameCheck,t)||ye.attributeNameCheck instanceof Function&&ye.attributeNameCheck(t))||"is"===t&&ye.allowCustomizedBuiltInElements&&(ye.tagNameCheck instanceof RegExp&&y(ye.tagNameCheck,n)||ye.tagNameCheck instanceof Function&&ye.tagNameCheck(n))))return!1}else if(He[t]);else if(y(me,h(n,fe,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==b(n,"data:")||!Fe[e])if(Ne&&!y(pe,h(n,fe,"")));else if(n)return!1;return!0},vt=function(e){return e.indexOf("-")>0},Tt=function(e){xt("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:be};let o=t.length;for(;o--;){const i=t[o],{name:a,namespaceURI:c,value:s}=i,l=tt(a);let p="value"===a?s:x(s);if(r.attrName=l,r.attrValue=p,r.keepAttr=!0,r.forceKeepAttr=void 0,xt("uponSanitizeAttribute",e,r),p=r.attrValue,r.forceKeepAttr)continue;if(ft(a,e),!r.keepAttr)continue;if(!Se&&y(/\/>/i,p)){ft(a,e);continue}Ee&&u([ce,se,le],(e=>{p=h(p,e," ")}));const f=tt(e.nodeName);if(wt(f,l,p)){if(!je||"id"!==l&&"name"!==l||(ft(a,e),p=De+p),J&&"object"==typeof F&&"function"==typeof F.getAttributeType)if(c);else switch(F.getAttributeType(f,l)){case"TrustedHTML":p=J.createHTML(p);break;case"TrustedScriptURL":p=J.createScriptURL(p)}try{c?e.setAttributeNS(c,a,p):e.setAttribute(a,p),d(n.removed)}catch(e){}}}xt("afterSanitizeAttributes",e,null)},At=function e(t){let n=null;const r=gt(t);for(xt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)xt("uponSanitizeShadowNode",n,null),yt(n)||(n.content instanceof s&&e(n.content),Tt(n));xt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,a=null,c=null;if(Ke=!e,Ke&&(e="\x3c!--\x3e"),"string"!=typeof e&&!bt(e)){if("function"!=typeof e.toString)throw w("toString is not a function");if("string"!=typeof(e=e.toString()))throw w("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Oe||it(t),n.removed=[],"string"==typeof e&&(Pe=!1),Pe){if(e.nodeName){const t=tt(e.nodeName);if(!ge[t]||we[t])throw w("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof v)r=mt("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!Ie&&!Ee&&!ke&&-1===e.indexOf("<"))return J&&Re?J.createHTML(e):e;if(r=mt(e),!r)return Ie?null:Re?ee:""}r&&_e&&pt(r.firstChild);const l=gt(Pe?e:r);for(;a=l.nextNode();)yt(a)||(a.content instanceof s&&At(a.content),Tt(a));if(Pe)return e;if(Ie){if(Ce)for(c=re.call(r.ownerDocument);r.firstChild;)c.appendChild(r.firstChild);else c=r;return(be.shadowroot||be.shadowrootmode)&&(c=ie.call(o,c,!0)),c}let d=ke?r.outerHTML:r.innerHTML;return ke&&ge["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&y(Y,r.ownerDocument.doctype.name)&&(d="\n"+d),Ee&&u([ce,se,le],(e=>{d=h(d,e," ")})),J&&Re?J.createHTML(d):d},n.setConfig=function(){it(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Oe=!0},n.clearConfig=function(){nt=null,Oe=!1},n.isValidAttribute=function(e,t,n){nt||it({});const r=tt(e),o=tt(t);return wt(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(ae[e]=ae[e]||[],p(ae[e],t))},n.removeHook=function(e){if(ae[e])return d(ae[e])},n.removeHooks=function(e){ae[e]&&(ae[e]=[])},n.removeAllHooks=function(){ae={}},n}var V=X();return V}();var R=g(C.exports),L=function(e){return{__html:I((0,R.sanitize)(e))}},j=function(e,t,n,r,o){var i=o.userInput,a=o.userAttempt,s=o.currentQuestionIndex,u=o.continueTillCorrect,p=o.showNextQuestionButton,f=o.incorrect,m=o.correct,g=o.setButtons,h=o.setIsCorrect,b=o.setIncorrectAnswer,x=o.setCorrect,y=o.setIncorrect,w=o.setShowNextQuestionButton,v=o.setUserInput,T=o.setUserAttempt,A="".concat(e),N=Object.keys(r).map((function(){return{disabled:!0}})),S=d(i);if("single"===n)void 0===S[s]&&(S[s]=e),A===t?(f.indexOf(s)<0&&m.indexOf(s)<0&&m.push(s),g((function(n){return c(c(c({},n),N),{},l({},e-1,{className:A===t?"correct":"incorrect"}))})),h(!0),b(!1),x(m),w(!0)):(m.indexOf(s)<0&&f.indexOf(s)<0&&f.push(s),u?g((function(t){return c(c({},t),{},l({},e-1,{disabled:!t[e-1]}))})):(g((function(n){return c(c(c({},n),N),{},l({},e-1,{className:A===t?"correct":"incorrect"}))})),w(!0)),b(!0),h(!1),y(f));else{var E=t.length;if(void 0===S[s]&&(S[s]=[]),S[s].length=0&&f.splice(f.indexOf(a),1)):(f.indexOf(a)<0&&f.push(a),m.indexOf(a)>=0&&m.splice(m.indexOf(a),1)),g(m),h(f),s((function(t){return c(c(c({},t),x),{},l({},e-1,{className:"selected"}))})),u(!0);else{if(void 0===y[a]&&(y[a]=[]),y[a].includes(e)?y[a].splice(y[a].indexOf(e),1):y[a].push(e),y[a].length===t.length){var w,v=!0,T=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=p(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}(i[a]);try{for(T.s();!(w=T.n()).done;){var A=w.value;if(!t.includes(A)){v=!1,f.indexOf(a)<0&&f.push(a),m.indexOf(a)>=0&&m.splice(m.indexOf(a),1);break}}}catch(e){T.e(e)}finally{T.f()}v&&(m.indexOf(a)<0&&m.push(a),f.indexOf(a)>=0&&f.splice(f.indexOf(a),1))}else f.indexOf(a)<0&&f.push(a),m.indexOf(a)>=0&&m.splice(m.indexOf(a),1);g(m),h(f),s((function(t){return c(c({},t),{},l({},e-1,{className:y[a].includes(e)?"selected":void 0}))})),y[a].length>0&&u(!0)}b(y)};function q(e){var t=e.question,n=e.isResultPage,r=t.explanation;return r?n?S.jsx("div",{className:"explanation",children:r}):S.jsxs("div",{children:[S.jsx("br",{}),r]}):null}var P=function(e){return e.messageForCorrectAnswer||"You are correct. Please click Next to continue."},z=function(e){return e.messageForIncorrectAnswer||"Incorrect answer. Please try again."};function M(e){var t=e.showInstantFeedback,n=e.incorrectAnswer,o=e.correctAnswer,i=e.question,a=e.onQuestionSubmit,c=e.userAnswer;return r((function(){a&&(o||n)&&a({question:i,userAnswer:c,isCorrect:o})}),[o,n]),S.jsxs(S.Fragment,{children:[n&&t&&S.jsx("div",{className:"alert incorrect",children:z(i)}),o&&t&&S.jsxs("div",{className:"alert correct",children:[P(i),S.jsx(q,{question:i,isResultPage:!1})]})]})}function U(e){var n=e.questions,a=e.appLocale,c=e.showDefaultResult,l=e.onComplete,p=e.customResultPage,f=e.showInstantFeedback,g=e.continueTillCorrect,h=e.revealAnswerOnSubmit,b=e.allowNavigation,x=e.onQuestionSubmit,y=e.timer,w=e.allowPauseTimer,v=u(t(!1),2),T=v[0],A=v[1],N=u(t(!1),2),k=N[0],O=N[1],_=u(t(!1),2),I=_[0],C=_[1],R=u(t(!1),2),P=R[0],z=R[1],U=u(t(0),2),F=U[0],B=U[1],H=u(t({}),2),Q=H[0],W=H[1],Y=u(t([]),2),G=Y[0],$=Y[1],K=u(t([]),2),X=K[0],V=K[1],Z=u(t([]),2),J=Z[0],ee=Z[1],te=u(t([]),2),ne=te[0],re=te[1],oe=u(t("all"),2),ie=oe[0],ae=oe[1],ce=u(t(1),2),se=ce[0],le=ce[1],ue=u(t(!0),2),de=ue[0],pe=ue[1],fe=u(t(void 0),2),me=fe[0],ge=fe[1],he=u(t(0),2),be=he[0],xe=he[1],ye=u(t(0),2),we=ye[0],ve=ye[1],Te=u(t(n[F]),2),Ae=Te[0],Ne=Te[1],Se=u(t(void 0),2),Ee=Se[0],ke=Se[1],Oe=u(t(y),2),_e=Oe[0],Ie=Oe[1],Ce=u(t(!0),2),Re=Ce[0],Le=Ce[1];r((function(){pe(void 0===c||c)}),[c]),r((function(){Ne(n[F])}),[F,n]),r((function(){var e=Ae.answerSelectionType;ge(e||"single")}),[Ae,F]),r((function(){if(P){Le(!1);for(var e=0,t=0,r=0;r",t)}),n&&S.jsx("span",{className:"selection-tag segment",children:n})]})},ze=function(e,t){return"string"==typeof t?e===Number(t):"object"===s(t)&&void 0!==t.find((function(t){return t===e}))},Me=o((function(){var e,t;if("all"!==ie){var r=J;"correct"===ie?r=G:"incorrect"===ie&&(r=X),e=n.filter((function(e,t){return-1!==r.indexOf(t)})),t=ne.filter((function(e,t){return-1!==r.indexOf(t)}))}return(e||n).map((function(e,n){var r=t?t[n]:ne[n],o=e.answerSelectionType||"single";return S.jsxs("div",{className:"result-answer-wrapper",children:[S.jsx("h3",{dangerouslySetInnerHTML:L("Q".concat(e.questionIndex,": ").concat(e.question," ").concat(a.marksOfQuestion.replace("",e.point)))}),e.questionPic&&S.jsx("img",{src:e.questionPic,alt:"question"}),Pe(o,e.correctAnswer.length,e.segment),S.jsx("div",{className:"result-answer",children:qe(e,r)}),S.jsx(q,{question:e,isResultPage:!0})]},m())}))}),[P,ie]);r((function(){var e;return y&&Re&&_e>0&&(e=setInterval((function(){Ie((function(e){return e-1}))}),1e3)),function(){return y&&clearInterval(e)}}),[Re,_e,y]);var Ue,Fe,Be,He,Qe,We,Ye,Ge,$e,Ke,Xe=function(e){return e<10?"0":""},Ve=function(e){var t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60;return"".concat(Xe(t)).concat(t,":").concat(Xe(n)).concat(n,":").concat(Xe(r)).concat(r)};return S.jsxs("div",{className:"questionWrapper",children:[y&&!Re&&S.jsxs("div",{children:[a.timerTimeTaken,":"," ",S.jsx("b",{children:Ve(y-_e)})]}),y&&Re&&S.jsxs("div",{children:[a.timerTimeRemaining,":"," ",S.jsx("b",{children:Ve(_e)})]}),y&&0===_e&&Re&&(Le(!1),z(!0),void n.forEach((function(e,t){void 0===ne[t]&&ee((function(e){return[].concat(d(e),[t])}))}))),!P&&S.jsxs("div",{className:"questionWrapperBody",children:[S.jsxs("div",{children:["".concat(a.question," ").concat(F+1," / ").concat(n.length,":"),S.jsx("br",{}),y&&w&&S.jsx("button",{type:"button",className:"timerBtn",onClick:function(){Le(!Re)},children:Re?a.pauseScreenPause:a.pauseScreenResume})]}),Re?S.jsxs(S.Fragment,{children:[S.jsx("h3",{dangerouslySetInnerHTML:L("".concat(Ae&&Ae.question," ").concat(a.marksOfQuestion.replace("",Ae.point)))}),Ae&&Ae.questionPic&&S.jsx("img",{src:Ae.questionPic,alt:"question"}),Ae&&Pe(me,Ae.correctAnswer.length,Ae.segment),S.jsx("div",{className:"questionModal",children:S.jsx(M,{question:Ae,showInstantFeedback:f,correctAnswer:k,incorrectAnswer:T,onQuestionSubmit:x,userAnswer:d(ne).pop()})}),Ae&&(Ue=Ae,Fe=Q,Be=Ue.answers,He=Ue.correctAnswer,Qe=Ue.questionType,We=Ue.questionIndex,Ye=Ue.answerSelectionType,Ge=function(e){return j(e+1,He,Ye,Be,{userInput:ne,userAttempt:se,currentQuestionIndex:F,continueTillCorrect:g,showNextQuestionButton:I,incorrect:X,correct:G,setButtons:W,setIsCorrect:O,setIncorrectAnswer:A,setCorrect:$,setIncorrect:V,setShowNextQuestionButton:C,setUserInput:re,setUserAttempt:le})},$e=function(e){return D(e+1,He,Ye,Be,{userInput:ne,currentQuestionIndex:F,setButtons:W,setShowNextQuestionButton:C,incorrect:X,correct:G,setCorrect:$,setIncorrect:V,setUserInput:re})},Ke=function(e){return void 0!==ne[We-1]&&("single"===Ye?ne[We-1]===e:Array.isArray(ne[We-1])&&ne[We-1].includes(e))},Ye=Ye||"single",Be.map((function(e,t){return S.jsx(i,{children:void 0!==Fe[t]?S.jsxs("button",{type:"button",disabled:Fe[t].disabled||!1,className:"".concat(Fe[t].className," answerBtn btn ").concat(ze(t+1,He)&&f?"correct":""),onClick:function(){return h?$e(t):Ge(t)},children:["text"===Qe&&S.jsx("span",{children:e}),"photo"===Qe&&S.jsx("img",{src:e,alt:"answer"})]}):S.jsxs("button",{type:"button",onClick:function(){return h?$e(t):Ge(t)},className:"answerBtn btn ".concat(b&&Ke(t+1)?"selected":null),children:["text"===Qe&&e,"photo"===Qe&&S.jsx("img",{src:e,alt:"answer"})]})},m())}))),(I||b)&&S.jsxs("div",{className:"questionBtnContainer",children:[b&&F>0&&S.jsx("button",{onClick:function(){return je(F-2)},className:"prevQuestionBtn btn",type:"button",children:a.prevQuestionBtn}),S.jsx("button",{onClick:function(){return je(F)},className:"nextQuestionBtn btn",type:"button",children:a.nextQuestionBtn})]})]}):S.jsxs("span",{className:"timerPauseScreen dark:text-white text-black",children:[S.jsx("br",{}),S.jsx("br",{}),a.pauseScreenDisplay]})]}),P&&de&&void 0===p&&S.jsxs("div",{className:"card-body",children:[S.jsx("h2",{children:a.resultPageHeaderText.replace("",G.length).replace("",n.length)}),S.jsx("h2",{children:a.resultPagePoint.replace("",we).replace("",be)}),S.jsx("br",{}),S.jsx(E,{filteredValue:ie,handleChange:De,appLocale:a}),Me()]}),P&&!de&&void 0!==p&&p(Ee)]})}var F={landingHeaderText:" Questions",question:"Question",startQuizBtn:"Start Quiz",resultFilterAll:"All",resultFilterCorrect:"Correct",resultFilterIncorrect:"Incorrect",resultFilterUnanswered:"Unanswered",nextQuestionBtn:"Next",prevQuestionBtn:"Prev",resultPageHeaderText:"You have completed the quiz. You got out of questions.",resultPagePoint:"You scored out of .",pauseScreenDisplay:"Test is paused. Clicked the Resume button to continue",timerTimeRemaining:"Time Remaining",timerTimeTaken:"Time Taken",pauseScreenPause:"Pause",pauseScreenResume:"Resume",singleSelectionTagText:"Single Selection",multipleSelectionTagText:"Multiple Selection",pickNumberOfSelection:"Pick ",marksOfQuestion:"( marks)"};function B(e){var n=e.quiz,i=e.shuffle,a=e.shuffleAnswer,s=e.showDefaultResult,l=e.onComplete,d=e.customResultPage,p=e.showInstantFeedback,f=e.continueTillCorrect,m=e.revealAnswerOnSubmit,g=e.allowNavigation,h=e.onQuestionSubmit,b=e.disableSynopsis,x=e.timer,y=e.allowPauseTimer,w=u(t(!1),2),v=w[0],T=w[1],A=u(t(n.questions),2),N=A[0],E=A[1],k=n.nrOfQuestions&&n.nrOfQuestions0;t-=1){var n=Math.floor(Math.random()*(t+1)),r=[e[n],e[t]];e[t]=r[0],e[n]=r[1]}return e}),[]);r((function(){b&&T(!0)}),[]),r((function(){var e=n.questions;i&&(e=O(e)),a&&(e=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((function(e){var t,n=(null===(t=e.answers)||void 0===t?void 0:t.map((function(e,t){return[e,t]}))).sort((function(){return Math.random()-.5})),r=n.map((function(e){return e[0]}));if("single"===e.answerSelectionType){var o=e.correctAnswer,i=n.findIndex((function(e){return"".concat(e[1]+1)==="".concat(o)}))+1;return c(c({},e),{},{correctAnswer:"".concat(i),answers:r})}if("multiple"===e.answerSelectionType){var a=e.correctAnswer.map((function(e){return n.findIndex((function(t){return"".concat(t[1]+1)==="".concat(e)}))+1}));return c(c({},e),{},{correctAnswer:a,answers:r})}return e}))}(e)),e.length=k,e=e.map((function(e,t){return c(c({},e),{},{questionIndex:t+1})})),E(e)}),[v]);if(!function(e){if(!e)return console.error("Quiz object is required."),!1;if(x&&"number"!=typeof x||x<1)return console.error(x&&"number"!=typeof x?"timer must be a number":"timer must be a number greater than 0"),!1;if(y&&"boolean"!=typeof y)return console.error("allowPauseTimer must be a Boolean"),!1;for(var t=0;t",k)}),n.quizSynopsis&&S.jsx("div",{className:"quiz-synopsis",children:n.quizSynopsis}),S.jsx("div",{className:"startQuizWrapper",children:S.jsx("button",{type:"button",onClick:function(){return T(!0)},className:"startQuizBtn btn",children:_.startQuizBtn})})]}),v&&S.jsx(U,{questions:N,showDefaultResult:s,onComplete:l,customResultPage:d,showInstantFeedback:p,continueTillCorrect:f,revealAnswerOnSubmit:m,allowNavigation:g,appLocale:_,onQuestionSubmit:h,timer:x,allowPauseTimer:y})]})}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('.react-quiz-container{margin:20px;max-width:500px}.react-quiz-container .startQuizWrapper{margin-top:10px}.react-quiz-container .btn{background-image:none;border:1px solid transparent;cursor:pointer;font-weight:600;margin-bottom:0;padding:11px 12px;text-align:center;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap}.react-quiz-container .questionWrapper .btn{border:1px solid #e8e8e8;border-radius:4px;display:block;font-size:15px;margin-bottom:10px;margin-top:10px;text-align:unset;white-space:normal}.react-quiz-container .questionWrapper .btn.correct,.timerBtn{background:green;color:#fff}.timerBtn{border:0!important;border-radius:10px;cursor:pointer;float:right;padding:5px;position:relative;top:-35px;width:80px}.timerPauseScreen{font-size:30px}.react-quiz-container .questionModal .alert{border:1px solid transparent;border-radius:2px;color:#fff;margin-bottom:21px;padding:20px}.react-quiz-container .correct{background:green}.react-quiz-container .incorrect{background:red;color:#fff}.react-quiz-container .unanswered{background:grey;color:#fff}.react-quiz-container .answerBtn,.react-quiz-container .questionWrapper img{width:100%}.react-quiz-container .selected{background:#007bff;color:#fff}.react-quiz-container .startQuizWrapper .startQuizBtn{background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;color:rgba(0,0,0,.65);font-size:15px;line-height:1.35135}.react-quiz-container .result-answer-wrapper{border:1px solid #e8e8e8;border-bottom-left-radius:5px;border-bottom-right-radius:5px;margin-bottom:20px}.react-quiz-container .result-answer-wrapper h3{background-color:#fafafa;border-top-left-radius:5px;border-top-right-radius:5px;color:rgba(0,0,0,.9);margin:0;opacity:.8;padding:10px}.react-quiz-container .result-answer-wrapper .explanation{border:1px solid #e8e8e8;margin:0 20px 20px;padding:20px}.react-quiz-container .result-answer-wrapper .tag-container{margin:20px}.react-quiz-container .result-answer{padding:0 20px}.react-quiz-container .quiz-synopsis{margin:15px 0}.react-quiz-container .tag-container{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:20px;margin-top:20px}.react-quiz-container .number-of-selection,.react-quiz-container .selection-tag{border-radius:5px;color:#fff;padding:7px}.react-quiz-container .number-of-selection{background:#673ab7;margin-left:5px}.react-quiz-container .selection-tag.single{background:#3f51b5}.react-quiz-container .selection-tag.multiple{background:#ff9800}.react-quiz-container .selection-tag.segment{background:#3db4b9;margin-left:5px}.react-quiz-container .questionBtnContainer{display:flex;justify-content:space-between}.react-quiz-container .quiz-result-filter{bottom:15px;position:relative;width:120px;.filter-dropdown-select{background-color:#fcfcfc;border:2px solid #c2c5c7;border-radius:7px;bottom:10px;color:#333;cursor:pointer;font-size:16px;height:12px;margin-top:2px;padding:8px;position:relative;text-transform:capitalize}.filter-dropdown-select:after{color:#a5a5a5;content:"▼";font-size:11px;position:absolute;right:10px;top:57%;transform:translateY(-50%);transition:all .3s ease}.filter-dropdown-select:hover{border:2px solid #51aae6;box-shadow:0 0 6px rgba(109,179,250,.5)}.dropdown-options{background-color:#fcfcfc;border-radius:10px;box-shadow:0 0 10px hsla(210,2%,56%,.5);left:0;list-style:none;margin:0;padding:0;position:absolute;top:85%;width:100%;z-index:1}.filter-dropdown-select.open{border:2px solid #51aae6;box-shadow:0 0 6px rgba(109,179,250,.5)}.dropdown-options .dropdown-options-item{cursor:pointer;font-size:16px;padding:10px}.dropdown-options .dropdown-options-item:hover{background-color:hsla(0,0%,89%,.852);border-radius:5px}.dropdown-options .dropdown-options-item:focus{background-color:#d7f1f9;font-weight:700}.filter-dropdown-select .selected-option.selected-open{color:#c6c2c2;font-weight:lighter}.filter-dropdown-select .selected-option{bottom:2px;font-size:16px;position:relative}.filter-dropdown-select:focus+.dropdown-options{max-height:200px}.dropdown-options .dropdown-options-item.selected{background-color:#d7f1f9;color:#333;font-weight:700}.dropdown-options.open{max-height:200px}}');export{B as default}; diff --git a/dist/index.js b/dist/index.js index 72e15d7..938ea01 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,2 +1,2 @@ -"use strict";var e=require("react");function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(e){for(var n=1;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n",""],_:["",""],"*":["",""],"~":["",""],"\n":["
    "]," ":["
    "],"-":["
    "]};function _(e){return e.replace(RegExp("^"+(e.match(/^(\t| )+/)||"")[0],"gm"),"")}function O(e){return(e+"").replace(/"/g,""").replace(//g,">")}function I(e,t){var n,r,o,i,a,s=/((?:^|\n+)(?:\n---+|\* \*(?: \*)+)\n)|(?:^``` *(\w*)\n([\s\S]*?)\n```$)|((?:(?:^|\n+)(?:\t| {2,}).+)+\n*)|((?:(?:^|\n)([>*+-]|\d+\.)\s+.*)+)|(?:!\[([^\]]*?)\]\(([^)]+?)\))|(\[)|(\](?:\(([^)]+?)\))?)|(?:(?:^|\n+)([^\s].*)\n(-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,6})\s*(.+)(?:\n+|$))|(?:`([^`].*?)`)|( \n\n*|\n{2,}|__|\*\*|[_*]|~~)/gm,c=[],l="",u=t||{},d=0;function p(e){var t=k[e[1]||""],n=c[c.length-1]==e;return t?t[1]?(n?c.pop():c.push(e),t[0|n]):t[0]:e}function f(){for(var e="";c.length;)e+=p(c[c.length-1]);return e}for(e=e.replace(/^\[(.+?)\]:\s*(.+)$/gm,(function(e,t,n){return u[t.toLowerCase()]=n,""})).replace(/^\n+|\n+$/g,"");o=s.exec(e);)r=e.substring(d,o.index),d=s.lastIndex,n=o[0],r.match(/[^\\](\\\\)*\\$/)||((a=o[3]||o[4])?n='
    "+_(O(a).replace(/^\n+|\n+$/g,""))+"
    ":(a=o[6])?(a.match(/\./)&&(o[5]=o[5].replace(/^\d+/gm,"")),i=I(_(o[5].replace(/^\s*[>*+.-]/gm,""))),">"==a?a="blockquote":(a=a.match(/\./)?"ol":"ul",i=i.replace(/^(.*)(\n|$)/gm,"
  • $1
  • ")),n="<"+a+">"+i+""):o[8]?n=''+O(o[7])+'':o[10]?(l=l.replace("
    ",''),n=f()+""):o[9]?n="":o[12]||o[14]?n="<"+(a="h"+(o[14]?o[14].length:o[13]>"="?1:2))+">"+I(o[12]||o[15],u)+"":o[16]?n=""+O(o[16])+"":(o[17]||o[1])&&(n=p(o[17]||"--"))),l+=r,l+=n;return(l+e.substring(d)+f()).replace(/^\n+|\n+$/g,"")}var C={exports:{}}; -/*! @license DOMPurify 3.0.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.8/LICENSE */C.exports=function(){const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:o}=Object;let{freeze:i,seal:a,create:s}=Object,{apply:c,construct:l}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t,n){return e.apply(t,n)}),l||(l=function(e,t){return new e(...t)});const u=v(Array.prototype.forEach),d=v(Array.prototype.pop),p=v(Array.prototype.push),f=v(String.prototype.toLowerCase),m=v(String.prototype.toString),g=v(String.prototype.match),h=v(String.prototype.replace),b=v(String.prototype.indexOf),y=v(String.prototype.trim),x=v(RegExp.prototype.test),w=T(TypeError);function v(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o2&&void 0!==arguments[2]?arguments[2]:f;t&&t(e,null);let i=r.length;for(;i--;){let t=r[i];if("string"==typeof t){const e=o(t);e!==t&&(n(r)||(r[i]=e),t=e)}e[t]=!0}return e}function A(e){for(let t=0;t/gm),U=a(/\${[\w\W]*}/gm),F=a(/^data-[\-\w.\u00B7-\uFFFF]/),B=a(/^aria-[\-\w]+$/),H=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Q=a(/^(?:\w+script|data):/i),W=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Y=a(/^html$/i);var G=Object.freeze({__proto__:null,MUSTACHE_EXPR:z,ERB_EXPR:M,TMPLIT_EXPR:U,DATA_ATTR:F,ARIA_ATTR:B,IS_ALLOWED_URI:H,IS_SCRIPT_OR_DATA:Q,ATTR_WHITESPACE:W,DOCTYPE_NAME:Y});const $=function(){return"undefined"==typeof window?null:window},K=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function V(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$();const n=e=>V(e);if(n.version="3.0.8",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;let{document:r}=t;const o=r,a=o.currentScript,{DocumentFragment:c,HTMLTemplateElement:l,Node:v,Element:T,NodeFilter:A,NamedNodeMap:z=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:M,DOMParser:U,trustedTypes:F}=t,B=T.prototype,Q=E(B,"cloneNode"),W=E(B,"nextSibling"),X=E(B,"childNodes"),Z=E(B,"parentNode");if("function"==typeof l){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let J,ee="";const{implementation:te,createNodeIterator:ne,createDocumentFragment:re,getElementsByTagName:oe}=r,{importNode:ie}=o;let ae={};n.isSupported="function"==typeof e&&"function"==typeof Z&&te&&void 0!==te.createHTMLDocument;const{MUSTACHE_EXPR:se,ERB_EXPR:ce,TMPLIT_EXPR:le,DATA_ATTR:ue,ARIA_ATTR:de,IS_SCRIPT_OR_DATA:pe,ATTR_WHITESPACE:fe}=G;let{IS_ALLOWED_URI:me}=G,ge=null;const he=S({},[...k,..._,...O,...C,...L]);let be=null;const ye=S({},[...D,...j,...q,...P]);let xe=Object.seal(s(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),we=null,ve=null,Te=!0,Se=!0,Ae=!1,Ne=!0,Ee=!1,ke=!1,_e=!1,Oe=!1,Ie=!1,Ce=!1,Re=!1,Le=!0,De=!1;const je="user-content-";let qe=!0,Pe=!1,ze={},Me=null;const Ue=S({},["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"]);let Fe=null;const Be=S({},["audio","video","img","source","image","track"]);let He=null;const Qe=S({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),We="http://www.w3.org/1998/Math/MathML",Ye="http://www.w3.org/2000/svg",Ge="http://www.w3.org/1999/xhtml";let $e=Ge,Ke=!1,Ve=null;const Xe=S({},[We,Ye,Ge],m);let Ze=null;const Je=["application/xhtml+xml","text/html"],et="text/html";let tt=null,nt=null;const rt=r.createElement("form"),ot=function(e){return e instanceof RegExp||e instanceof Function},it=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!nt||nt!==e){if(e&&"object"==typeof e||(e={}),e=N(e),Ze=-1===Je.indexOf(e.PARSER_MEDIA_TYPE)?et:e.PARSER_MEDIA_TYPE,tt="application/xhtml+xml"===Ze?m:f,ge="ALLOWED_TAGS"in e?S({},e.ALLOWED_TAGS,tt):he,be="ALLOWED_ATTR"in e?S({},e.ALLOWED_ATTR,tt):ye,Ve="ALLOWED_NAMESPACES"in e?S({},e.ALLOWED_NAMESPACES,m):Xe,He="ADD_URI_SAFE_ATTR"in e?S(N(Qe),e.ADD_URI_SAFE_ATTR,tt):Qe,Fe="ADD_DATA_URI_TAGS"in e?S(N(Be),e.ADD_DATA_URI_TAGS,tt):Be,Me="FORBID_CONTENTS"in e?S({},e.FORBID_CONTENTS,tt):Ue,we="FORBID_TAGS"in e?S({},e.FORBID_TAGS,tt):{},ve="FORBID_ATTR"in e?S({},e.FORBID_ATTR,tt):{},ze="USE_PROFILES"in e&&e.USE_PROFILES,Te=!1!==e.ALLOW_ARIA_ATTR,Se=!1!==e.ALLOW_DATA_ATTR,Ae=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ne=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ee=e.SAFE_FOR_TEMPLATES||!1,ke=e.WHOLE_DOCUMENT||!1,Ie=e.RETURN_DOM||!1,Ce=e.RETURN_DOM_FRAGMENT||!1,Re=e.RETURN_TRUSTED_TYPE||!1,Oe=e.FORCE_BODY||!1,Le=!1!==e.SANITIZE_DOM,De=e.SANITIZE_NAMED_PROPS||!1,qe=!1!==e.KEEP_CONTENT,Pe=e.IN_PLACE||!1,me=e.ALLOWED_URI_REGEXP||H,$e=e.NAMESPACE||Ge,xe=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ot(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(xe.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ot(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(xe.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(xe.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ee&&(Se=!1),Ce&&(Ie=!0),ze&&(ge=S({},L),be=[],!0===ze.html&&(S(ge,k),S(be,D)),!0===ze.svg&&(S(ge,_),S(be,j),S(be,P)),!0===ze.svgFilters&&(S(ge,O),S(be,j),S(be,P)),!0===ze.mathMl&&(S(ge,C),S(be,q),S(be,P))),e.ADD_TAGS&&(ge===he&&(ge=N(ge)),S(ge,e.ADD_TAGS,tt)),e.ADD_ATTR&&(be===ye&&(be=N(be)),S(be,e.ADD_ATTR,tt)),e.ADD_URI_SAFE_ATTR&&S(He,e.ADD_URI_SAFE_ATTR,tt),e.FORBID_CONTENTS&&(Me===Ue&&(Me=N(Me)),S(Me,e.FORBID_CONTENTS,tt)),qe&&(ge["#text"]=!0),ke&&S(ge,["html","head","body"]),ge.table&&(S(ge,["tbody"]),delete we.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw w('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw w('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');J=e.TRUSTED_TYPES_POLICY,ee=J.createHTML("")}else void 0===J&&(J=K(F,a)),null!==J&&"string"==typeof ee&&(ee=J.createHTML(""));i&&i(e),nt=e}},at=S({},["mi","mo","mn","ms","mtext"]),st=S({},["foreignobject","desc","title","annotation-xml"]),ct=S({},["title","style","font","a","script"]),lt=S({},[..._,...O,...I]),ut=S({},[...C,...R]),dt=function(e){let t=Z(e);t&&t.tagName||(t={namespaceURI:$e,tagName:"template"});const n=f(e.tagName),r=f(t.tagName);return!!Ve[e.namespaceURI]&&(e.namespaceURI===Ye?t.namespaceURI===Ge?"svg"===n:t.namespaceURI===We?"svg"===n&&("annotation-xml"===r||at[r]):Boolean(lt[n]):e.namespaceURI===We?t.namespaceURI===Ge?"math"===n:t.namespaceURI===Ye?"math"===n&&st[r]:Boolean(ut[n]):e.namespaceURI===Ge?!(t.namespaceURI===Ye&&!st[r])&&!(t.namespaceURI===We&&!at[r])&&!ut[n]&&(ct[n]||!lt[n]):!("application/xhtml+xml"!==Ze||!Ve[e.namespaceURI]))},pt=function(e){p(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},ft=function(e,t){try{p(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){p(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!be[e])if(Ie||Ce)try{pt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},mt=function(e){let t=null,n=null;if(Oe)e=""+e;else{const t=g(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Ze&&$e===Ge&&(e=''+e+"");const o=J?J.createHTML(e):e;if($e===Ge)try{t=(new U).parseFromString(o,Ze)}catch(e){}if(!t||!t.documentElement){t=te.createDocument($e,"template",null);try{t.documentElement.innerHTML=Ke?ee:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),$e===Ge?oe.call(t,ke?"html":"body")[0]:ke?t.documentElement:i},gt=function(e){return ne.call(e.ownerDocument||e,e,A.SHOW_ELEMENT|A.SHOW_COMMENT|A.SHOW_TEXT,null)},ht=function(e){return e instanceof M&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof z)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},bt=function(e){return"function"==typeof v&&e instanceof v},yt=function(e,t,r){ae[e]&&u(ae[e],(e=>{e.call(n,t,r,nt)}))},xt=function(e){let t=null;if(yt("beforeSanitizeElements",e,null),ht(e))return pt(e),!0;const r=tt(e.nodeName);if(yt("uponSanitizeElement",e,{tagName:r,allowedTags:ge}),e.hasChildNodes()&&!bt(e.firstElementChild)&&x(/<[/\w]/g,e.innerHTML)&&x(/<[/\w]/g,e.textContent))return pt(e),!0;if(!ge[r]||we[r]){if(!we[r]&&vt(r)){if(xe.tagNameCheck instanceof RegExp&&x(xe.tagNameCheck,r))return!1;if(xe.tagNameCheck instanceof Function&&xe.tagNameCheck(r))return!1}if(qe&&!Me[r]){const t=Z(e)||e.parentNode,n=X(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r)t.insertBefore(Q(n[r],!0),W(e))}return pt(e),!0}return e instanceof T&&!dt(e)?(pt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!x(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ee&&3===e.nodeType&&(t=e.textContent,u([se,ce,le],(e=>{t=h(t,e," ")})),e.textContent!==t&&(p(n.removed,{element:e.cloneNode()}),e.textContent=t)),yt("afterSanitizeElements",e,null),!1):(pt(e),!0)},wt=function(e,t,n){if(Le&&("id"===t||"name"===t)&&(n in r||n in rt))return!1;if(Se&&!ve[t]&&x(ue,t));else if(Te&&x(de,t));else if(!be[t]||ve[t]){if(!(vt(e)&&(xe.tagNameCheck instanceof RegExp&&x(xe.tagNameCheck,e)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(e))&&(xe.attributeNameCheck instanceof RegExp&&x(xe.attributeNameCheck,t)||xe.attributeNameCheck instanceof Function&&xe.attributeNameCheck(t))||"is"===t&&xe.allowCustomizedBuiltInElements&&(xe.tagNameCheck instanceof RegExp&&x(xe.tagNameCheck,n)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(n))))return!1}else if(He[t]);else if(x(me,h(n,fe,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==b(n,"data:")||!Fe[e])if(Ae&&!x(pe,h(n,fe,"")));else if(n)return!1;return!0},vt=function(e){return e.indexOf("-")>0},Tt=function(e){yt("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:be};let o=t.length;for(;o--;){const i=t[o],{name:a,namespaceURI:s,value:c}=i,l=tt(a);let p="value"===a?c:y(c);if(r.attrName=l,r.attrValue=p,r.keepAttr=!0,r.forceKeepAttr=void 0,yt("uponSanitizeAttribute",e,r),p=r.attrValue,r.forceKeepAttr)continue;if(ft(a,e),!r.keepAttr)continue;if(!Ne&&x(/\/>/i,p)){ft(a,e);continue}Ee&&u([se,ce,le],(e=>{p=h(p,e," ")}));const f=tt(e.nodeName);if(wt(f,l,p)){if(!De||"id"!==l&&"name"!==l||(ft(a,e),p=je+p),J&&"object"==typeof F&&"function"==typeof F.getAttributeType)if(s);else switch(F.getAttributeType(f,l)){case"TrustedHTML":p=J.createHTML(p);break;case"TrustedScriptURL":p=J.createScriptURL(p)}try{s?e.setAttributeNS(s,a,p):e.setAttribute(a,p),d(n.removed)}catch(e){}}}yt("afterSanitizeAttributes",e,null)},St=function e(t){let n=null;const r=gt(t);for(yt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)yt("uponSanitizeShadowNode",n,null),xt(n)||(n.content instanceof c&&e(n.content),Tt(n));yt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,a=null,s=null;if(Ke=!e,Ke&&(e="\x3c!--\x3e"),"string"!=typeof e&&!bt(e)){if("function"!=typeof e.toString)throw w("toString is not a function");if("string"!=typeof(e=e.toString()))throw w("dirty is not a string, aborting")}if(!n.isSupported)return e;if(_e||it(t),n.removed=[],"string"==typeof e&&(Pe=!1),Pe){if(e.nodeName){const t=tt(e.nodeName);if(!ge[t]||we[t])throw w("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof v)r=mt("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!Ie&&!Ee&&!ke&&-1===e.indexOf("<"))return J&&Re?J.createHTML(e):e;if(r=mt(e),!r)return Ie?null:Re?ee:""}r&&Oe&&pt(r.firstChild);const l=gt(Pe?e:r);for(;a=l.nextNode();)xt(a)||(a.content instanceof c&&St(a.content),Tt(a));if(Pe)return e;if(Ie){if(Ce)for(s=re.call(r.ownerDocument);r.firstChild;)s.appendChild(r.firstChild);else s=r;return(be.shadowroot||be.shadowrootmode)&&(s=ie.call(o,s,!0)),s}let d=ke?r.outerHTML:r.innerHTML;return ke&&ge["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&x(Y,r.ownerDocument.doctype.name)&&(d="\n"+d),Ee&&u([se,ce,le],(e=>{d=h(d,e," ")})),J&&Re?J.createHTML(d):d},n.setConfig=function(){it(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),_e=!0},n.clearConfig=function(){nt=null,_e=!1},n.isValidAttribute=function(e,t,n){nt||it({});const r=tt(e),o=tt(t);return wt(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(ae[e]=ae[e]||[],p(ae[e],t))},n.removeHook=function(e){if(ae[e])return d(ae[e])},n.removeHooks=function(e){ae[e]&&(ae[e]=[])},n.removeAllHooks=function(){ae={}},n}var X=V();return X}();var R=g(C.exports),L=function(e){return{__html:I((0,R.sanitize)(e))}},D=function(e,t,r,i,s){var c=s.userInput,l=s.userAttempt,u=s.currentQuestionIndex,d=s.continueTillCorrect,p=s.showNextQuestionButton,f=s.incorrect,m=s.correct,g=s.setButtons,h=s.setIsCorrect,b=s.setIncorrectAnswer,y=s.setCorrect,x=s.setIncorrect,w=s.setShowNextQuestionButton,v=s.setUserInput,T=s.setUserAttempt,S="".concat(e),A={0:{disabled:!0},1:{disabled:!0},2:{disabled:!0},3:{disabled:!0}},N=a(c);if("single"===r)void 0===N[u]&&(N[u]=e),S===t?(f.indexOf(u)<0&&m.indexOf(u)<0&&m.push(u),g((function(r){return n(n(n({},r),A),{},o({},e-1,{className:S===t?"correct":"incorrect"}))})),h(!0),b(!1),y(m),w(!0)):(m.indexOf(u)<0&&f.indexOf(u)<0&&f.push(u),d?g((function(t){return n(n({},t),{},o({},e-1,{disabled:!t[e-1]}))})):(g((function(r){return n(n(n({},r),A),{},o({},e-1,{className:S===t?"correct":"incorrect"}))})),w(!0)),b(!0),h(!1),x(f));else{var E=t.length;if(void 0===N[u]&&(N[u]=[]),N[u].length=0&&p.splice(p.indexOf(l),1)):(p.indexOf(l)<0&&p.push(l),f.indexOf(l)>=0&&f.splice(f.indexOf(l),1)),m(f),g(p),u((function(t){return n(n(n({},t),b),{},o({},e-1,{className:"selected"}))})),d(!0);else{if(void 0===y[l]&&(y[l]=[]),y[l].includes(e)?y[l].splice(y[l].indexOf(e),1):y[l].push(e),y[l].length===t.length){var x,w=!0,v=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=s(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}(c[l]);try{for(v.s();!(x=v.n()).done;){var T=x.value;if(!t.includes(T)){w=!1,p.indexOf(l)<0&&p.push(l),f.indexOf(l)>=0&&f.splice(f.indexOf(l),1);break}}}catch(e){v.e(e)}finally{v.f()}w&&(f.indexOf(l)<0&&f.push(l),p.indexOf(l)>=0&&p.splice(p.indexOf(l),1))}else p.indexOf(l)<0&&p.push(l),f.indexOf(l)>=0&&f.splice(f.indexOf(l),1);m(f),g(p),u((function(t){return n(n({},t),{},o({},e-1,{className:y[l].includes(e)?"selected":void 0}))})),y[l].length>0&&d(!0)}h(y)};function q(e){var t=e.question,n=e.isResultPage,r=t.explanation;return r?n?N.jsx("div",{className:"explanation",children:r}):N.jsxs("div",{children:[N.jsx("br",{}),r]}):null}var P=function(e){return e.messageForCorrectAnswer||"You are correct. Please click Next to continue."},z=function(e){return e.messageForIncorrectAnswer||"Incorrect answer. Please try again."};function M(t){var n=t.showInstantFeedback,r=t.incorrectAnswer,o=t.correctAnswer,i=t.question,a=t.onQuestionSubmit,s=t.userAnswer;return e.useEffect((function(){a&&(o||r)&&a({question:i,userAnswer:s,isCorrect:o})}),[o,r]),N.jsxs(N.Fragment,{children:[r&&n&&N.jsx("div",{className:"alert incorrect",children:z(i)}),o&&n&&N.jsxs("div",{className:"alert correct",children:[P(i),N.jsx(q,{question:i,isResultPage:!1})]})]})}function U(t){var n=t.questions,o=t.appLocale,s=t.showDefaultResult,c=t.onComplete,l=t.customResultPage,u=t.showInstantFeedback,d=t.continueTillCorrect,p=t.revealAnswerOnSubmit,f=t.allowNavigation,g=t.onQuestionSubmit,h=t.timer,b=t.allowPauseTimer,y=i(e.useState(!1),2),x=y[0],w=y[1],v=i(e.useState(!1),2),T=v[0],S=v[1],A=i(e.useState(!1),2),k=A[0],_=A[1],O=i(e.useState(!1),2),I=O[0],C=O[1],R=i(e.useState(0),2),P=R[0],z=R[1],U=i(e.useState({}),2),F=U[0],B=U[1],H=i(e.useState([]),2),Q=H[0],W=H[1],Y=i(e.useState([]),2),G=Y[0],$=Y[1],K=i(e.useState([]),2),V=K[0],X=K[1],Z=i(e.useState([]),2),J=Z[0],ee=Z[1],te=i(e.useState("all"),2),ne=te[0],re=te[1],oe=i(e.useState(1),2),ie=oe[0],ae=oe[1],se=i(e.useState(!0),2),ce=se[0],le=se[1],ue=i(e.useState(void 0),2),de=ue[0],pe=ue[1],fe=i(e.useState(0),2),me=fe[0],ge=fe[1],he=i(e.useState(0),2),be=he[0],ye=he[1],xe=i(e.useState(n[P]),2),we=xe[0],ve=xe[1],Te=i(e.useState(void 0),2),Se=Te[0],Ae=Te[1],Ne=i(e.useState(h),2),Ee=Ne[0],ke=Ne[1],_e=i(e.useState(!0),2),Oe=_e[0],Ie=_e[1];e.useEffect((function(){le(void 0===s||s)}),[s]),e.useEffect((function(){ve(n[P])}),[P,n]),e.useEffect((function(){var e=we.answerSelectionType;pe(e||"single")}),[we,P]),e.useEffect((function(){if(I){Ie(!1);for(var e=0,t=0,r=0;r",t)}),n&&N.jsx("span",{className:"selection-tag segment",children:n})]})},je=function(e,t){return"string"==typeof t?e===Number(t):"object"===r(t)&&void 0!==t.find((function(t){return t===e}))},qe=e.useCallback((function(){var e,t;if("all"!==ne){var r=V;"correct"===ne?r=Q:"incorrect"===ne&&(r=G),e=n.filter((function(e,t){return-1!==r.indexOf(t)})),t=J.filter((function(e,t){return-1!==r.indexOf(t)}))}return(e||n).map((function(e,n){var r=t?t[n]:J[n],i=e.answerSelectionType||"single";return N.jsxs("div",{className:"result-answer-wrapper",children:[N.jsx("h3",{dangerouslySetInnerHTML:L("Q".concat(e.questionIndex,": ").concat(e.question," ").concat(o.marksOfQuestion.replace("",e.point)))}),e.questionPic&&N.jsx("img",{src:e.questionPic,alt:"question"}),De(i,e.correctAnswer.length,e.segment),N.jsx("div",{className:"result-answer",children:Le(e,r)}),N.jsx(q,{question:e,isResultPage:!0})]},m())}))}),[I,ne]);e.useEffect((function(){var e;return h&&Oe&&Ee>0&&(e=setInterval((function(){ke((function(e){return e-1}))}),1e3)),function(){return h&&clearInterval(e)}}),[Oe,Ee,h]);var Pe,ze,Me,Ue,Fe,Be,He,Qe,We,Ye,Ge=function(e){return e<10?"0":""},$e=function(e){var t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60;return"".concat(Ge(t)).concat(t,":").concat(Ge(n)).concat(n,":").concat(Ge(r)).concat(r)};return N.jsxs("div",{className:"questionWrapper",children:[h&&!Oe&&N.jsxs("div",{children:[o.timerTimeTaken,":"," ",N.jsx("b",{children:$e(h-Ee)})]}),h&&Oe&&N.jsxs("div",{children:[o.timerTimeRemaining,":"," ",N.jsx("b",{children:$e(Ee)})]}),h&&0===Ee&&Oe&&(Ie(!1),C(!0),void n.forEach((function(e,t){void 0===J[t]&&X((function(e){return[].concat(a(e),[t])}))}))),!I&&N.jsxs("div",{className:"questionWrapperBody",children:[N.jsxs("div",{children:["".concat(o.question," ").concat(P+1," / ").concat(n.length,":"),N.jsx("br",{}),h&&b&&N.jsx("button",{type:"button",className:"timerBtn",onClick:function(){Ie(!Oe)},children:Oe?o.pauseScreenPause:o.pauseScreenResume})]}),Oe?N.jsxs(N.Fragment,{children:[N.jsx("h3",{dangerouslySetInnerHTML:L("".concat(we&&we.question," ").concat(o.marksOfQuestion.replace("",we.point)))}),we&&we.questionPic&&N.jsx("img",{src:we.questionPic,alt:"question"}),we&&De(de,we.correctAnswer.length,we.segment),N.jsx("div",{className:"questionModal",children:N.jsx(M,{question:we,showInstantFeedback:u,correctAnswer:T,incorrectAnswer:x,onQuestionSubmit:g,userAnswer:a(J).pop()})}),we&&(Pe=we,ze=F,Me=Pe.answers,Ue=Pe.correctAnswer,Fe=Pe.questionType,Be=Pe.questionIndex,He=Pe.answerSelectionType,Qe=function(e){return D(e+1,Ue,He,Me,{userInput:J,userAttempt:ie,currentQuestionIndex:P,continueTillCorrect:d,showNextQuestionButton:k,incorrect:G,correct:Q,setButtons:B,setIsCorrect:S,setIncorrectAnswer:w,setCorrect:W,setIncorrect:$,setShowNextQuestionButton:_,setUserInput:ee,setUserAttempt:ae})},We=function(e){return j(e+1,Ue,He,{userInput:J,currentQuestionIndex:P,setButtons:B,setShowNextQuestionButton:_,incorrect:G,correct:Q,setCorrect:W,setIncorrect:$,setUserInput:ee})},Ye=function(e){return void 0!==J[Be-1]&&("single"===He?J[Be-1]===e:Array.isArray(J[Be-1])&&J[Be-1].includes(e))},He=He||"single",Me.map((function(t,n){return N.jsx(e.Fragment,{children:void 0!==ze[n]?N.jsxs("button",{type:"button",disabled:ze[n].disabled||!1,className:"".concat(ze[n].className," answerBtn btn ").concat(je(n+1,Ue)&&u?"correct":""),onClick:function(){return p?We(n):Qe(n)},children:["text"===Fe&&N.jsx("span",{children:t}),"photo"===Fe&&N.jsx("img",{src:t,alt:"answer"})]}):N.jsxs("button",{type:"button",onClick:function(){return p?We(n):Qe(n)},className:"answerBtn btn ".concat(f&&Ye(n+1)?"selected":null),children:["text"===Fe&&t,"photo"===Fe&&N.jsx("img",{src:t,alt:"answer"})]})},m())}))),(k||f)&&N.jsxs("div",{className:"questionBtnContainer",children:[f&&P>0&&N.jsx("button",{onClick:function(){return Ce(P-2)},className:"prevQuestionBtn btn",type:"button",children:o.prevQuestionBtn}),N.jsx("button",{onClick:function(){return Ce(P)},className:"nextQuestionBtn btn",type:"button",children:o.nextQuestionBtn})]})]}):N.jsxs("span",{className:"timerPauseScreen dark:text-white text-black",children:[N.jsx("br",{}),N.jsx("br",{}),o.pauseScreenDisplay]})]}),I&&ce&&void 0===l&&N.jsxs("div",{className:"card-body",children:[N.jsx("h2",{children:o.resultPageHeaderText.replace("",Q.length).replace("",n.length)}),N.jsx("h2",{children:o.resultPagePoint.replace("",be).replace("",me)}),N.jsx("br",{}),N.jsx(E,{filteredValue:ne,handleChange:Re,appLocale:o}),qe()]}),I&&!ce&&void 0!==l&&l(Se)]})}var F={landingHeaderText:" Questions",question:"Question",startQuizBtn:"Start Quiz",resultFilterAll:"All",resultFilterCorrect:"Correct",resultFilterIncorrect:"Incorrect",resultFilterUnanswered:"Unanswered",nextQuestionBtn:"Next",prevQuestionBtn:"Prev",resultPageHeaderText:"You have completed the quiz. You got out of questions.",resultPagePoint:"You scored out of .",pauseScreenDisplay:"Test is paused. Clicked the Resume button to continue",timerTimeRemaining:"Time Remaining",timerTimeTaken:"Time Taken",pauseScreenPause:"Pause",pauseScreenResume:"Resume",singleSelectionTagText:"Single Selection",multipleSelectionTagText:"Multiple Selection",pickNumberOfSelection:"Pick ",marksOfQuestion:"( marks)"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('.react-quiz-container{margin:20px;max-width:500px}.react-quiz-container .startQuizWrapper{margin-top:10px}.react-quiz-container .btn{background-image:none;border:1px solid transparent;cursor:pointer;font-weight:600;margin-bottom:0;padding:11px 12px;text-align:center;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap}.react-quiz-container .questionWrapper .btn{border:1px solid #e8e8e8;border-radius:4px;display:block;font-size:15px;margin-bottom:10px;margin-top:10px;text-align:unset;white-space:normal}.react-quiz-container .questionWrapper .btn.correct,.timerBtn{background:green;color:#fff}.timerBtn{border:0!important;border-radius:10px;cursor:pointer;float:right;padding:5px;position:relative;top:-35px;width:80px}.timerPauseScreen{font-size:30px}.react-quiz-container .questionModal .alert{border:1px solid transparent;border-radius:2px;color:#fff;margin-bottom:21px;padding:20px}.react-quiz-container .correct{background:green}.react-quiz-container .incorrect{background:red;color:#fff}.react-quiz-container .unanswered{background:grey;color:#fff}.react-quiz-container .answerBtn,.react-quiz-container .questionWrapper img{width:100%}.react-quiz-container .selected{background:#007bff;color:#fff}.react-quiz-container .startQuizWrapper .startQuizBtn{background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;color:rgba(0,0,0,.65);font-size:15px;line-height:1.35135}.react-quiz-container .result-answer-wrapper{border:1px solid #e8e8e8;border-bottom-left-radius:5px;border-bottom-right-radius:5px;margin-bottom:20px}.react-quiz-container .result-answer-wrapper h3{background-color:#fafafa;border-top-left-radius:5px;border-top-right-radius:5px;color:rgba(0,0,0,.9);margin:0;opacity:.8;padding:10px}.react-quiz-container .result-answer-wrapper .explanation{border:1px solid #e8e8e8;margin:0 20px 20px;padding:20px}.react-quiz-container .result-answer-wrapper .tag-container{margin:20px}.react-quiz-container .result-answer{padding:0 20px}.react-quiz-container .quiz-synopsis{margin:15px 0}.react-quiz-container .tag-container{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:20px;margin-top:20px}.react-quiz-container .number-of-selection,.react-quiz-container .selection-tag{border-radius:5px;color:#fff;padding:7px}.react-quiz-container .number-of-selection{background:#673ab7;margin-left:5px}.react-quiz-container .selection-tag.single{background:#3f51b5}.react-quiz-container .selection-tag.multiple{background:#ff9800}.react-quiz-container .selection-tag.segment{background:#3db4b9;margin-left:5px}.react-quiz-container .questionBtnContainer{display:flex;justify-content:space-between}.react-quiz-container .quiz-result-filter{bottom:15px;position:relative;width:120px;.filter-dropdown-select{background-color:#fcfcfc;border:2px solid #c2c5c7;border-radius:7px;bottom:10px;color:#333;cursor:pointer;font-size:16px;height:12px;margin-top:2px;padding:8px;position:relative;text-transform:capitalize}.filter-dropdown-select:after{color:#a5a5a5;content:"▼";font-size:11px;position:absolute;right:10px;top:57%;transform:translateY(-50%);transition:all .3s ease}.filter-dropdown-select:hover{border:2px solid #51aae6;box-shadow:0 0 6px rgba(109,179,250,.5)}.dropdown-options{background-color:#fcfcfc;border-radius:10px;box-shadow:0 0 10px hsla(210,2%,56%,.5);left:0;list-style:none;margin:0;padding:0;position:absolute;top:85%;width:100%;z-index:1}.filter-dropdown-select.open{border:2px solid #51aae6;box-shadow:0 0 6px rgba(109,179,250,.5)}.dropdown-options .dropdown-options-item{cursor:pointer;font-size:16px;padding:10px}.dropdown-options .dropdown-options-item:hover{background-color:hsla(0,0%,89%,.852);border-radius:5px}.dropdown-options .dropdown-options-item:focus{background-color:#d7f1f9;font-weight:700}.filter-dropdown-select .selected-option.selected-open{color:#c6c2c2;font-weight:lighter}.filter-dropdown-select .selected-option{bottom:2px;font-size:16px;position:relative}.filter-dropdown-select:focus+.dropdown-options{max-height:200px}.dropdown-options .dropdown-options-item.selected{background-color:#d7f1f9;color:#333;font-weight:700}.dropdown-options.open{max-height:200px}}'),module.exports=function(t){var r=t.quiz,o=t.shuffle,a=t.shuffleAnswer,s=t.showDefaultResult,c=t.onComplete,l=t.customResultPage,u=t.showInstantFeedback,d=t.continueTillCorrect,p=t.revealAnswerOnSubmit,f=t.allowNavigation,m=t.onQuestionSubmit,g=t.disableSynopsis,h=t.timer,b=t.allowPauseTimer,y=i(e.useState(!1),2),x=y[0],w=y[1],v=i(e.useState(r.questions),2),T=v[0],S=v[1],A=r.nrOfQuestions&&r.nrOfQuestions0;t-=1){var n=Math.floor(Math.random()*(t+1)),r=[e[n],e[t]];e[t]=r[0],e[n]=r[1]}return e}),[]);if(e.useEffect((function(){g&&w(!0)}),[]),e.useEffect((function(){var e=r.questions;o&&(e=E(e)),a&&(e=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((function(e){var t,r=(null===(t=e.answers)||void 0===t?void 0:t.map((function(e,t){return[e,t]}))).sort((function(){return Math.random()-.5})),o=r.map((function(e){return e[0]}));if("single"===e.answerSelectionType){var i=e.correctAnswer,a=r.findIndex((function(e){return"".concat(e[1]+1)==="".concat(i)}))+1;return n(n({},e),{},{correctAnswer:"".concat(a),answers:o})}if("multiple"===e.answerSelectionType){var s=e.correctAnswer.map((function(e){return r.findIndex((function(t){return"".concat(t[1]+1)==="".concat(e)}))+1}));return n(n({},e),{},{correctAnswer:s,answers:o})}return e}))}(e)),e.length=A,e=e.map((function(e,t){return n(n({},e),{},{questionIndex:t+1})})),S(e)}),[x]),!function(e){if(!e)return console.error("Quiz object is required."),!1;if(h&&"number"!=typeof h||h<1)return console.error(h&&"number"!=typeof h?"timer must be a number":"timer must be a number greater than 0"),!1;if(b&&"boolean"!=typeof b)return console.error("allowPauseTimer must be a Boolean"),!1;for(var t=0;t",A)}),r.quizSynopsis&&N.jsx("div",{className:"quiz-synopsis",children:r.quizSynopsis}),N.jsx("div",{className:"startQuizWrapper",children:N.jsx("button",{type:"button",onClick:function(){return w(!0)},className:"startQuizBtn btn",children:k.startQuizBtn})})]}),x&&N.jsx(U,{questions:T,showDefaultResult:s,onComplete:c,customResultPage:l,showInstantFeedback:u,continueTillCorrect:d,revealAnswerOnSubmit:p,allowNavigation:f,appLocale:k,onQuestionSubmit:m,timer:h,allowPauseTimer:b})]})}; +"use strict";var e=require("react");function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(e){for(var n=1;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function u(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d={exports:{}},p={},f=e,m=Symbol.for("react.element"),g=Symbol.for("react.fragment"),h=Object.prototype.hasOwnProperty,b=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,x={key:!0,ref:!0,__self:!0,__source:!0};function y(e,t,n){var r,o={},i=null,a=null;for(r in void 0!==n&&(i=""+n),void 0!==t.key&&(i=""+t.key),void 0!==t.ref&&(a=t.ref),t)h.call(t,r)&&!x.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:m,type:e,key:i,ref:a,props:o,_owner:b.current}}p.Fragment=g,p.jsx=y,p.jsxs=y,d.exports=p;var w=d.exports;function v(t){var n=t.filteredValue,r=t.handleChange,o=t.appLocale,a=i(e.useState(!1),2),s=a[0],c=a[1],l=e.useRef(null),u=function(){c(!s)},d=function(e){r({target:{value:e}}),c(!1)},p=s?"selected-open":"";return e.useEffect((function(){var e=function(e){s&&l.current&&!l.current.contains(e.target)&&c(!1)};return document.addEventListener("click",e),function(){document.removeEventListener("click",e)}}),[s]),w.jsxs("div",{className:"quiz-result-filter",children:[w.jsxs("div",{ref:l,className:"filter-dropdown-select ".concat(s?"open":""),onClick:u,onKeyDown:function(e){"Enter"===e.key&&u()},role:"button",tabIndex:0,children:[w.jsx("div",{className:"selected-option ".concat(p),children:"all"===n?o.resultFilterAll:n}),w.jsx("span",{className:"arrow ".concat(s?"up":"down")})]}),s&&w.jsxs("div",{className:"dropdown-options",role:"menu","aria-labelledby":"quiz-filter",children:[w.jsx("div",{className:"dropdown-options-item ".concat("all"===n?"selected":""),onClick:function(){return d("all")},onKeyDown:function(e){"Enter"===e.key&&d("all")},role:"menuitem",tabIndex:0,children:o.resultFilterAll}),w.jsx("div",{className:"dropdown-options-item ".concat("correct"===n?"selected":""),onClick:function(){return d("correct")},onKeyDown:function(e){"Enter"===e.key&&d("correct")},role:"menuitem",tabIndex:0,children:o.resultFilterCorrect}),w.jsx("div",{className:"dropdown-options-item ".concat("incorrect"===n?"selected":""),onClick:function(){return d("incorrect")},onKeyDown:function(e){"Enter"===e.key&&d("incorrect")},role:"menuitem",tabIndex:0,children:o.resultFilterIncorrect}),w.jsx("div",{className:"dropdown-options-item ".concat("unanswered"===n?"selected":""),onClick:function(){return d("unanswered")},onKeyDown:function(e){"Enter"===e.key&&d("unanswered")},role:"menuitem",tabIndex:0,children:o.resultFilterUnanswered})]})]})}var T={"":["",""],_:["",""],"*":["",""],"~":["",""],"\n":["
    "]," ":["
    "],"-":["
    "]};function S(e){return e.replace(RegExp("^"+(e.match(/^(\t| )+/)||"")[0],"gm"),"")}function A(e){return(e+"").replace(/"/g,""").replace(//g,">")}function N(e,t){var n,r,o,i,a,s=/((?:^|\n+)(?:\n---+|\* \*(?: \*)+)\n)|(?:^``` *(\w*)\n([\s\S]*?)\n```$)|((?:(?:^|\n+)(?:\t| {2,}).+)+\n*)|((?:(?:^|\n)([>*+-]|\d+\.)\s+.*)+)|(?:!\[([^\]]*?)\]\(([^)]+?)\))|(\[)|(\](?:\(([^)]+?)\))?)|(?:(?:^|\n+)([^\s].*)\n(-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,6})\s*(.+)(?:\n+|$))|(?:`([^`].*?)`)|( \n\n*|\n{2,}|__|\*\*|[_*]|~~)/gm,c=[],l="",u=t||{},d=0;function p(e){var t=T[e[1]||""],n=c[c.length-1]==e;return t?t[1]?(n?c.pop():c.push(e),t[0|n]):t[0]:e}function f(){for(var e="";c.length;)e+=p(c[c.length-1]);return e}for(e=e.replace(/^\[(.+?)\]:\s*(.+)$/gm,(function(e,t,n){return u[t.toLowerCase()]=n,""})).replace(/^\n+|\n+$/g,"");o=s.exec(e);)r=e.substring(d,o.index),d=s.lastIndex,n=o[0],r.match(/[^\\](\\\\)*\\$/)||((a=o[3]||o[4])?n='
    "+S(A(a).replace(/^\n+|\n+$/g,""))+"
    ":(a=o[6])?(a.match(/\./)&&(o[5]=o[5].replace(/^\d+/gm,"")),i=N(S(o[5].replace(/^\s*[>*+.-]/gm,""))),">"==a?a="blockquote":(a=a.match(/\./)?"ol":"ul",i=i.replace(/^(.*)(\n|$)/gm,"
  • $1
  • ")),n="<"+a+">"+i+""):o[8]?n=''+A(o[7])+'':o[10]?(l=l.replace("
    ",''),n=f()+""):o[9]?n="":o[12]||o[14]?n="<"+(a="h"+(o[14]?o[14].length:o[13]>"="?1:2))+">"+N(o[12]||o[15],u)+"":o[16]?n=""+A(o[16])+"":(o[17]||o[1])&&(n=p(o[17]||"--"))),l+=r,l+=n;return(l+e.substring(d)+f()).replace(/^\n+|\n+$/g,"")}var E={exports:{}}; +/*! @license DOMPurify 3.0.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.8/LICENSE */E.exports=function(){const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:o}=Object;let{freeze:i,seal:a,create:s}=Object,{apply:c,construct:l}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t,n){return e.apply(t,n)}),l||(l=function(e,t){return new e(...t)});const u=v(Array.prototype.forEach),d=v(Array.prototype.pop),p=v(Array.prototype.push),f=v(String.prototype.toLowerCase),m=v(String.prototype.toString),g=v(String.prototype.match),h=v(String.prototype.replace),b=v(String.prototype.indexOf),x=v(String.prototype.trim),y=v(RegExp.prototype.test),w=T(TypeError);function v(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o2&&void 0!==arguments[2]?arguments[2]:f;t&&t(e,null);let i=r.length;for(;i--;){let t=r[i];if("string"==typeof t){const e=o(t);e!==t&&(n(r)||(r[i]=e),t=e)}e[t]=!0}return e}function A(e){for(let t=0;t/gm),F=a(/\${[\w\W]*}/gm),U=a(/^data-[\-\w.\u00B7-\uFFFF]/),B=a(/^aria-[\-\w]+$/),H=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Q=a(/^(?:\w+script|data):/i),W=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Y=a(/^html$/i);var G=Object.freeze({__proto__:null,MUSTACHE_EXPR:z,ERB_EXPR:M,TMPLIT_EXPR:F,DATA_ATTR:U,ARIA_ATTR:B,IS_ALLOWED_URI:H,IS_SCRIPT_OR_DATA:Q,ATTR_WHITESPACE:W,DOCTYPE_NAME:Y});const $=function(){return"undefined"==typeof window?null:window},K=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function X(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$();const n=e=>X(e);if(n.version="3.0.8",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;let{document:r}=t;const o=r,a=o.currentScript,{DocumentFragment:c,HTMLTemplateElement:l,Node:v,Element:T,NodeFilter:A,NamedNodeMap:z=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:M,DOMParser:F,trustedTypes:U}=t,B=T.prototype,Q=E(B,"cloneNode"),W=E(B,"nextSibling"),V=E(B,"childNodes"),Z=E(B,"parentNode");if("function"==typeof l){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let J,ee="";const{implementation:te,createNodeIterator:ne,createDocumentFragment:re,getElementsByTagName:oe}=r,{importNode:ie}=o;let ae={};n.isSupported="function"==typeof e&&"function"==typeof Z&&te&&void 0!==te.createHTMLDocument;const{MUSTACHE_EXPR:se,ERB_EXPR:ce,TMPLIT_EXPR:le,DATA_ATTR:ue,ARIA_ATTR:de,IS_SCRIPT_OR_DATA:pe,ATTR_WHITESPACE:fe}=G;let{IS_ALLOWED_URI:me}=G,ge=null;const he=S({},[...k,...O,..._,...I,...L]);let be=null;const xe=S({},[...j,...D,...q,...P]);let ye=Object.seal(s(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),we=null,ve=null,Te=!0,Se=!0,Ae=!1,Ne=!0,Ee=!1,ke=!1,Oe=!1,_e=!1,Ce=!1,Ie=!1,Re=!1,Le=!0,je=!1;const De="user-content-";let qe=!0,Pe=!1,ze={},Me=null;const Fe=S({},["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"]);let Ue=null;const Be=S({},["audio","video","img","source","image","track"]);let He=null;const Qe=S({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),We="http://www.w3.org/1998/Math/MathML",Ye="http://www.w3.org/2000/svg",Ge="http://www.w3.org/1999/xhtml";let $e=Ge,Ke=!1,Xe=null;const Ve=S({},[We,Ye,Ge],m);let Ze=null;const Je=["application/xhtml+xml","text/html"],et="text/html";let tt=null,nt=null;const rt=r.createElement("form"),ot=function(e){return e instanceof RegExp||e instanceof Function},it=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!nt||nt!==e){if(e&&"object"==typeof e||(e={}),e=N(e),Ze=-1===Je.indexOf(e.PARSER_MEDIA_TYPE)?et:e.PARSER_MEDIA_TYPE,tt="application/xhtml+xml"===Ze?m:f,ge="ALLOWED_TAGS"in e?S({},e.ALLOWED_TAGS,tt):he,be="ALLOWED_ATTR"in e?S({},e.ALLOWED_ATTR,tt):xe,Xe="ALLOWED_NAMESPACES"in e?S({},e.ALLOWED_NAMESPACES,m):Ve,He="ADD_URI_SAFE_ATTR"in e?S(N(Qe),e.ADD_URI_SAFE_ATTR,tt):Qe,Ue="ADD_DATA_URI_TAGS"in e?S(N(Be),e.ADD_DATA_URI_TAGS,tt):Be,Me="FORBID_CONTENTS"in e?S({},e.FORBID_CONTENTS,tt):Fe,we="FORBID_TAGS"in e?S({},e.FORBID_TAGS,tt):{},ve="FORBID_ATTR"in e?S({},e.FORBID_ATTR,tt):{},ze="USE_PROFILES"in e&&e.USE_PROFILES,Te=!1!==e.ALLOW_ARIA_ATTR,Se=!1!==e.ALLOW_DATA_ATTR,Ae=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ne=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ee=e.SAFE_FOR_TEMPLATES||!1,ke=e.WHOLE_DOCUMENT||!1,Ce=e.RETURN_DOM||!1,Ie=e.RETURN_DOM_FRAGMENT||!1,Re=e.RETURN_TRUSTED_TYPE||!1,_e=e.FORCE_BODY||!1,Le=!1!==e.SANITIZE_DOM,je=e.SANITIZE_NAMED_PROPS||!1,qe=!1!==e.KEEP_CONTENT,Pe=e.IN_PLACE||!1,me=e.ALLOWED_URI_REGEXP||H,$e=e.NAMESPACE||Ge,ye=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ot(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ye.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ot(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ye.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(ye.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ee&&(Se=!1),Ie&&(Ce=!0),ze&&(ge=S({},L),be=[],!0===ze.html&&(S(ge,k),S(be,j)),!0===ze.svg&&(S(ge,O),S(be,D),S(be,P)),!0===ze.svgFilters&&(S(ge,_),S(be,D),S(be,P)),!0===ze.mathMl&&(S(ge,I),S(be,q),S(be,P))),e.ADD_TAGS&&(ge===he&&(ge=N(ge)),S(ge,e.ADD_TAGS,tt)),e.ADD_ATTR&&(be===xe&&(be=N(be)),S(be,e.ADD_ATTR,tt)),e.ADD_URI_SAFE_ATTR&&S(He,e.ADD_URI_SAFE_ATTR,tt),e.FORBID_CONTENTS&&(Me===Fe&&(Me=N(Me)),S(Me,e.FORBID_CONTENTS,tt)),qe&&(ge["#text"]=!0),ke&&S(ge,["html","head","body"]),ge.table&&(S(ge,["tbody"]),delete we.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw w('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw w('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');J=e.TRUSTED_TYPES_POLICY,ee=J.createHTML("")}else void 0===J&&(J=K(U,a)),null!==J&&"string"==typeof ee&&(ee=J.createHTML(""));i&&i(e),nt=e}},at=S({},["mi","mo","mn","ms","mtext"]),st=S({},["foreignobject","desc","title","annotation-xml"]),ct=S({},["title","style","font","a","script"]),lt=S({},[...O,..._,...C]),ut=S({},[...I,...R]),dt=function(e){let t=Z(e);t&&t.tagName||(t={namespaceURI:$e,tagName:"template"});const n=f(e.tagName),r=f(t.tagName);return!!Xe[e.namespaceURI]&&(e.namespaceURI===Ye?t.namespaceURI===Ge?"svg"===n:t.namespaceURI===We?"svg"===n&&("annotation-xml"===r||at[r]):Boolean(lt[n]):e.namespaceURI===We?t.namespaceURI===Ge?"math"===n:t.namespaceURI===Ye?"math"===n&&st[r]:Boolean(ut[n]):e.namespaceURI===Ge?!(t.namespaceURI===Ye&&!st[r])&&!(t.namespaceURI===We&&!at[r])&&!ut[n]&&(ct[n]||!lt[n]):!("application/xhtml+xml"!==Ze||!Xe[e.namespaceURI]))},pt=function(e){p(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},ft=function(e,t){try{p(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){p(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!be[e])if(Ce||Ie)try{pt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},mt=function(e){let t=null,n=null;if(_e)e=""+e;else{const t=g(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Ze&&$e===Ge&&(e=''+e+"");const o=J?J.createHTML(e):e;if($e===Ge)try{t=(new F).parseFromString(o,Ze)}catch(e){}if(!t||!t.documentElement){t=te.createDocument($e,"template",null);try{t.documentElement.innerHTML=Ke?ee:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),$e===Ge?oe.call(t,ke?"html":"body")[0]:ke?t.documentElement:i},gt=function(e){return ne.call(e.ownerDocument||e,e,A.SHOW_ELEMENT|A.SHOW_COMMENT|A.SHOW_TEXT,null)},ht=function(e){return e instanceof M&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof z)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},bt=function(e){return"function"==typeof v&&e instanceof v},xt=function(e,t,r){ae[e]&&u(ae[e],(e=>{e.call(n,t,r,nt)}))},yt=function(e){let t=null;if(xt("beforeSanitizeElements",e,null),ht(e))return pt(e),!0;const r=tt(e.nodeName);if(xt("uponSanitizeElement",e,{tagName:r,allowedTags:ge}),e.hasChildNodes()&&!bt(e.firstElementChild)&&y(/<[/\w]/g,e.innerHTML)&&y(/<[/\w]/g,e.textContent))return pt(e),!0;if(!ge[r]||we[r]){if(!we[r]&&vt(r)){if(ye.tagNameCheck instanceof RegExp&&y(ye.tagNameCheck,r))return!1;if(ye.tagNameCheck instanceof Function&&ye.tagNameCheck(r))return!1}if(qe&&!Me[r]){const t=Z(e)||e.parentNode,n=V(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r)t.insertBefore(Q(n[r],!0),W(e))}return pt(e),!0}return e instanceof T&&!dt(e)?(pt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!y(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ee&&3===e.nodeType&&(t=e.textContent,u([se,ce,le],(e=>{t=h(t,e," ")})),e.textContent!==t&&(p(n.removed,{element:e.cloneNode()}),e.textContent=t)),xt("afterSanitizeElements",e,null),!1):(pt(e),!0)},wt=function(e,t,n){if(Le&&("id"===t||"name"===t)&&(n in r||n in rt))return!1;if(Se&&!ve[t]&&y(ue,t));else if(Te&&y(de,t));else if(!be[t]||ve[t]){if(!(vt(e)&&(ye.tagNameCheck instanceof RegExp&&y(ye.tagNameCheck,e)||ye.tagNameCheck instanceof Function&&ye.tagNameCheck(e))&&(ye.attributeNameCheck instanceof RegExp&&y(ye.attributeNameCheck,t)||ye.attributeNameCheck instanceof Function&&ye.attributeNameCheck(t))||"is"===t&&ye.allowCustomizedBuiltInElements&&(ye.tagNameCheck instanceof RegExp&&y(ye.tagNameCheck,n)||ye.tagNameCheck instanceof Function&&ye.tagNameCheck(n))))return!1}else if(He[t]);else if(y(me,h(n,fe,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==b(n,"data:")||!Ue[e])if(Ae&&!y(pe,h(n,fe,"")));else if(n)return!1;return!0},vt=function(e){return e.indexOf("-")>0},Tt=function(e){xt("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:be};let o=t.length;for(;o--;){const i=t[o],{name:a,namespaceURI:s,value:c}=i,l=tt(a);let p="value"===a?c:x(c);if(r.attrName=l,r.attrValue=p,r.keepAttr=!0,r.forceKeepAttr=void 0,xt("uponSanitizeAttribute",e,r),p=r.attrValue,r.forceKeepAttr)continue;if(ft(a,e),!r.keepAttr)continue;if(!Ne&&y(/\/>/i,p)){ft(a,e);continue}Ee&&u([se,ce,le],(e=>{p=h(p,e," ")}));const f=tt(e.nodeName);if(wt(f,l,p)){if(!je||"id"!==l&&"name"!==l||(ft(a,e),p=De+p),J&&"object"==typeof U&&"function"==typeof U.getAttributeType)if(s);else switch(U.getAttributeType(f,l)){case"TrustedHTML":p=J.createHTML(p);break;case"TrustedScriptURL":p=J.createScriptURL(p)}try{s?e.setAttributeNS(s,a,p):e.setAttribute(a,p),d(n.removed)}catch(e){}}}xt("afterSanitizeAttributes",e,null)},St=function e(t){let n=null;const r=gt(t);for(xt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)xt("uponSanitizeShadowNode",n,null),yt(n)||(n.content instanceof c&&e(n.content),Tt(n));xt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,a=null,s=null;if(Ke=!e,Ke&&(e="\x3c!--\x3e"),"string"!=typeof e&&!bt(e)){if("function"!=typeof e.toString)throw w("toString is not a function");if("string"!=typeof(e=e.toString()))throw w("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Oe||it(t),n.removed=[],"string"==typeof e&&(Pe=!1),Pe){if(e.nodeName){const t=tt(e.nodeName);if(!ge[t]||we[t])throw w("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof v)r=mt("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!Ce&&!Ee&&!ke&&-1===e.indexOf("<"))return J&&Re?J.createHTML(e):e;if(r=mt(e),!r)return Ce?null:Re?ee:""}r&&_e&&pt(r.firstChild);const l=gt(Pe?e:r);for(;a=l.nextNode();)yt(a)||(a.content instanceof c&&St(a.content),Tt(a));if(Pe)return e;if(Ce){if(Ie)for(s=re.call(r.ownerDocument);r.firstChild;)s.appendChild(r.firstChild);else s=r;return(be.shadowroot||be.shadowrootmode)&&(s=ie.call(o,s,!0)),s}let d=ke?r.outerHTML:r.innerHTML;return ke&&ge["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&y(Y,r.ownerDocument.doctype.name)&&(d="\n"+d),Ee&&u([se,ce,le],(e=>{d=h(d,e," ")})),J&&Re?J.createHTML(d):d},n.setConfig=function(){it(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Oe=!0},n.clearConfig=function(){nt=null,Oe=!1},n.isValidAttribute=function(e,t,n){nt||it({});const r=tt(e),o=tt(t);return wt(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(ae[e]=ae[e]||[],p(ae[e],t))},n.removeHook=function(e){if(ae[e])return d(ae[e])},n.removeHooks=function(e){ae[e]&&(ae[e]=[])},n.removeAllHooks=function(){ae={}},n}var V=X();return V}();var k=u(E.exports),O=function(e){return{__html:N((0,k.sanitize)(e))}},_=function(e,t,r,i,s){var c=s.userInput,l=s.userAttempt,u=s.currentQuestionIndex,d=s.continueTillCorrect,p=s.showNextQuestionButton,f=s.incorrect,m=s.correct,g=s.setButtons,h=s.setIsCorrect,b=s.setIncorrectAnswer,x=s.setCorrect,y=s.setIncorrect,w=s.setShowNextQuestionButton,v=s.setUserInput,T=s.setUserAttempt,S="".concat(e),A=Object.keys(i).map((function(){return{disabled:!0}})),N=a(c);if("single"===r)void 0===N[u]&&(N[u]=e),S===t?(f.indexOf(u)<0&&m.indexOf(u)<0&&m.push(u),g((function(r){return n(n(n({},r),A),{},o({},e-1,{className:S===t?"correct":"incorrect"}))})),h(!0),b(!1),x(m),w(!0)):(m.indexOf(u)<0&&f.indexOf(u)<0&&f.push(u),d?g((function(t){return n(n({},t),{},o({},e-1,{disabled:!t[e-1]}))})):(g((function(r){return n(n(n({},r),A),{},o({},e-1,{className:S===t?"correct":"incorrect"}))})),w(!0)),b(!0),h(!1),y(f));else{var E=t.length;if(void 0===N[u]&&(N[u]=[]),N[u].length=0&&f.splice(f.indexOf(u),1)):(f.indexOf(u)<0&&f.push(u),m.indexOf(u)>=0&&m.splice(m.indexOf(u),1)),g(m),h(f),d((function(t){return n(n(n({},t),x),{},o({},e-1,{className:"selected"}))})),p(!0);else{if(void 0===y[u]&&(y[u]=[]),y[u].includes(e)?y[u].splice(y[u].indexOf(e),1):y[u].push(e),y[u].length===t.length){var w,v=!0,T=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=s(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}(l[u]);try{for(T.s();!(w=T.n()).done;){var S=w.value;if(!t.includes(S)){v=!1,f.indexOf(u)<0&&f.push(u),m.indexOf(u)>=0&&m.splice(m.indexOf(u),1);break}}}catch(e){T.e(e)}finally{T.f()}v&&(m.indexOf(u)<0&&m.push(u),f.indexOf(u)>=0&&f.splice(f.indexOf(u),1))}else f.indexOf(u)<0&&f.push(u),m.indexOf(u)>=0&&m.splice(m.indexOf(u),1);g(m),h(f),d((function(t){return n(n({},t),{},o({},e-1,{className:y[u].includes(e)?"selected":void 0}))})),y[u].length>0&&p(!0)}b(y)};function I(e){var t=e.question,n=e.isResultPage,r=t.explanation;return r?n?w.jsx("div",{className:"explanation",children:r}):w.jsxs("div",{children:[w.jsx("br",{}),r]}):null}var R=function(e){return e.messageForCorrectAnswer||"You are correct. Please click Next to continue."},L=function(e){return e.messageForIncorrectAnswer||"Incorrect answer. Please try again."};function j(t){var n=t.showInstantFeedback,r=t.incorrectAnswer,o=t.correctAnswer,i=t.question,a=t.onQuestionSubmit,s=t.userAnswer;return e.useEffect((function(){a&&(o||r)&&a({question:i,userAnswer:s,isCorrect:o})}),[o,r]),w.jsxs(w.Fragment,{children:[r&&n&&w.jsx("div",{className:"alert incorrect",children:L(i)}),o&&n&&w.jsxs("div",{className:"alert correct",children:[R(i),w.jsx(I,{question:i,isResultPage:!1})]})]})}function D(t){var n=t.questions,o=t.appLocale,s=t.showDefaultResult,c=t.onComplete,u=t.customResultPage,d=t.showInstantFeedback,p=t.continueTillCorrect,f=t.revealAnswerOnSubmit,m=t.allowNavigation,g=t.onQuestionSubmit,h=t.timer,b=t.allowPauseTimer,x=i(e.useState(!1),2),y=x[0],T=x[1],S=i(e.useState(!1),2),A=S[0],N=S[1],E=i(e.useState(!1),2),k=E[0],R=E[1],L=i(e.useState(!1),2),D=L[0],q=L[1],P=i(e.useState(0),2),z=P[0],M=P[1],F=i(e.useState({}),2),U=F[0],B=F[1],H=i(e.useState([]),2),Q=H[0],W=H[1],Y=i(e.useState([]),2),G=Y[0],$=Y[1],K=i(e.useState([]),2),X=K[0],V=K[1],Z=i(e.useState([]),2),J=Z[0],ee=Z[1],te=i(e.useState("all"),2),ne=te[0],re=te[1],oe=i(e.useState(1),2),ie=oe[0],ae=oe[1],se=i(e.useState(!0),2),ce=se[0],le=se[1],ue=i(e.useState(void 0),2),de=ue[0],pe=ue[1],fe=i(e.useState(0),2),me=fe[0],ge=fe[1],he=i(e.useState(0),2),be=he[0],xe=he[1],ye=i(e.useState(n[z]),2),we=ye[0],ve=ye[1],Te=i(e.useState(void 0),2),Se=Te[0],Ae=Te[1],Ne=i(e.useState(h),2),Ee=Ne[0],ke=Ne[1],Oe=i(e.useState(!0),2),_e=Oe[0],Ce=Oe[1];e.useEffect((function(){le(void 0===s||s)}),[s]),e.useEffect((function(){ve(n[z])}),[z,n]),e.useEffect((function(){var e=we.answerSelectionType;pe(e||"single")}),[we,z]),e.useEffect((function(){if(D){Ce(!1);for(var e=0,t=0,r=0;r",t)}),n&&w.jsx("span",{className:"selection-tag segment",children:n})]})},De=function(e,t){return"string"==typeof t?e===Number(t):"object"===r(t)&&void 0!==t.find((function(t){return t===e}))},qe=e.useCallback((function(){var e,t;if("all"!==ne){var r=X;"correct"===ne?r=Q:"incorrect"===ne&&(r=G),e=n.filter((function(e,t){return-1!==r.indexOf(t)})),t=J.filter((function(e,t){return-1!==r.indexOf(t)}))}return(e||n).map((function(e,n){var r=t?t[n]:J[n],i=e.answerSelectionType||"single";return w.jsxs("div",{className:"result-answer-wrapper",children:[w.jsx("h3",{dangerouslySetInnerHTML:O("Q".concat(e.questionIndex,": ").concat(e.question," ").concat(o.marksOfQuestion.replace("",e.point)))}),e.questionPic&&w.jsx("img",{src:e.questionPic,alt:"question"}),je(i,e.correctAnswer.length,e.segment),w.jsx("div",{className:"result-answer",children:Le(e,r)}),w.jsx(I,{question:e,isResultPage:!0})]},l())}))}),[D,ne]);e.useEffect((function(){var e;return h&&_e&&Ee>0&&(e=setInterval((function(){ke((function(e){return e-1}))}),1e3)),function(){return h&&clearInterval(e)}}),[_e,Ee,h]);var Pe,ze,Me,Fe,Ue,Be,He,Qe,We,Ye,Ge=function(e){return e<10?"0":""},$e=function(e){var t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60;return"".concat(Ge(t)).concat(t,":").concat(Ge(n)).concat(n,":").concat(Ge(r)).concat(r)};return w.jsxs("div",{className:"questionWrapper",children:[h&&!_e&&w.jsxs("div",{children:[o.timerTimeTaken,":"," ",w.jsx("b",{children:$e(h-Ee)})]}),h&&_e&&w.jsxs("div",{children:[o.timerTimeRemaining,":"," ",w.jsx("b",{children:$e(Ee)})]}),h&&0===Ee&&_e&&(Ce(!1),q(!0),void n.forEach((function(e,t){void 0===J[t]&&V((function(e){return[].concat(a(e),[t])}))}))),!D&&w.jsxs("div",{className:"questionWrapperBody",children:[w.jsxs("div",{children:["".concat(o.question," ").concat(z+1," / ").concat(n.length,":"),w.jsx("br",{}),h&&b&&w.jsx("button",{type:"button",className:"timerBtn",onClick:function(){Ce(!_e)},children:_e?o.pauseScreenPause:o.pauseScreenResume})]}),_e?w.jsxs(w.Fragment,{children:[w.jsx("h3",{dangerouslySetInnerHTML:O("".concat(we&&we.question," ").concat(o.marksOfQuestion.replace("",we.point)))}),we&&we.questionPic&&w.jsx("img",{src:we.questionPic,alt:"question"}),we&&je(de,we.correctAnswer.length,we.segment),w.jsx("div",{className:"questionModal",children:w.jsx(j,{question:we,showInstantFeedback:d,correctAnswer:A,incorrectAnswer:y,onQuestionSubmit:g,userAnswer:a(J).pop()})}),we&&(Pe=we,ze=U,Me=Pe.answers,Fe=Pe.correctAnswer,Ue=Pe.questionType,Be=Pe.questionIndex,He=Pe.answerSelectionType,Qe=function(e){return _(e+1,Fe,He,Me,{userInput:J,userAttempt:ie,currentQuestionIndex:z,continueTillCorrect:p,showNextQuestionButton:k,incorrect:G,correct:Q,setButtons:B,setIsCorrect:N,setIncorrectAnswer:T,setCorrect:W,setIncorrect:$,setShowNextQuestionButton:R,setUserInput:ee,setUserAttempt:ae})},We=function(e){return C(e+1,Fe,He,Me,{userInput:J,currentQuestionIndex:z,setButtons:B,setShowNextQuestionButton:R,incorrect:G,correct:Q,setCorrect:W,setIncorrect:$,setUserInput:ee})},Ye=function(e){return void 0!==J[Be-1]&&("single"===He?J[Be-1]===e:Array.isArray(J[Be-1])&&J[Be-1].includes(e))},He=He||"single",Me.map((function(t,n){return w.jsx(e.Fragment,{children:void 0!==ze[n]?w.jsxs("button",{type:"button",disabled:ze[n].disabled||!1,className:"".concat(ze[n].className," answerBtn btn ").concat(De(n+1,Fe)&&d?"correct":""),onClick:function(){return f?We(n):Qe(n)},children:["text"===Ue&&w.jsx("span",{children:t}),"photo"===Ue&&w.jsx("img",{src:t,alt:"answer"})]}):w.jsxs("button",{type:"button",onClick:function(){return f?We(n):Qe(n)},className:"answerBtn btn ".concat(m&&Ye(n+1)?"selected":null),children:["text"===Ue&&t,"photo"===Ue&&w.jsx("img",{src:t,alt:"answer"})]})},l())}))),(k||m)&&w.jsxs("div",{className:"questionBtnContainer",children:[m&&z>0&&w.jsx("button",{onClick:function(){return Ie(z-2)},className:"prevQuestionBtn btn",type:"button",children:o.prevQuestionBtn}),w.jsx("button",{onClick:function(){return Ie(z)},className:"nextQuestionBtn btn",type:"button",children:o.nextQuestionBtn})]})]}):w.jsxs("span",{className:"timerPauseScreen dark:text-white text-black",children:[w.jsx("br",{}),w.jsx("br",{}),o.pauseScreenDisplay]})]}),D&&ce&&void 0===u&&w.jsxs("div",{className:"card-body",children:[w.jsx("h2",{children:o.resultPageHeaderText.replace("",Q.length).replace("",n.length)}),w.jsx("h2",{children:o.resultPagePoint.replace("",be).replace("",me)}),w.jsx("br",{}),w.jsx(v,{filteredValue:ne,handleChange:Re,appLocale:o}),qe()]}),D&&!ce&&void 0!==u&&u(Se)]})}var q={landingHeaderText:" Questions",question:"Question",startQuizBtn:"Start Quiz",resultFilterAll:"All",resultFilterCorrect:"Correct",resultFilterIncorrect:"Incorrect",resultFilterUnanswered:"Unanswered",nextQuestionBtn:"Next",prevQuestionBtn:"Prev",resultPageHeaderText:"You have completed the quiz. You got out of questions.",resultPagePoint:"You scored out of .",pauseScreenDisplay:"Test is paused. Clicked the Resume button to continue",timerTimeRemaining:"Time Remaining",timerTimeTaken:"Time Taken",pauseScreenPause:"Pause",pauseScreenResume:"Resume",singleSelectionTagText:"Single Selection",multipleSelectionTagText:"Multiple Selection",pickNumberOfSelection:"Pick ",marksOfQuestion:"( marks)"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('.react-quiz-container{margin:20px;max-width:500px}.react-quiz-container .startQuizWrapper{margin-top:10px}.react-quiz-container .btn{background-image:none;border:1px solid transparent;cursor:pointer;font-weight:600;margin-bottom:0;padding:11px 12px;text-align:center;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap}.react-quiz-container .questionWrapper .btn{border:1px solid #e8e8e8;border-radius:4px;display:block;font-size:15px;margin-bottom:10px;margin-top:10px;text-align:unset;white-space:normal}.react-quiz-container .questionWrapper .btn.correct,.timerBtn{background:green;color:#fff}.timerBtn{border:0!important;border-radius:10px;cursor:pointer;float:right;padding:5px;position:relative;top:-35px;width:80px}.timerPauseScreen{font-size:30px}.react-quiz-container .questionModal .alert{border:1px solid transparent;border-radius:2px;color:#fff;margin-bottom:21px;padding:20px}.react-quiz-container .correct{background:green}.react-quiz-container .incorrect{background:red;color:#fff}.react-quiz-container .unanswered{background:grey;color:#fff}.react-quiz-container .answerBtn,.react-quiz-container .questionWrapper img{width:100%}.react-quiz-container .selected{background:#007bff;color:#fff}.react-quiz-container .startQuizWrapper .startQuizBtn{background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;color:rgba(0,0,0,.65);font-size:15px;line-height:1.35135}.react-quiz-container .result-answer-wrapper{border:1px solid #e8e8e8;border-bottom-left-radius:5px;border-bottom-right-radius:5px;margin-bottom:20px}.react-quiz-container .result-answer-wrapper h3{background-color:#fafafa;border-top-left-radius:5px;border-top-right-radius:5px;color:rgba(0,0,0,.9);margin:0;opacity:.8;padding:10px}.react-quiz-container .result-answer-wrapper .explanation{border:1px solid #e8e8e8;margin:0 20px 20px;padding:20px}.react-quiz-container .result-answer-wrapper .tag-container{margin:20px}.react-quiz-container .result-answer{padding:0 20px}.react-quiz-container .quiz-synopsis{margin:15px 0}.react-quiz-container .tag-container{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:20px;margin-top:20px}.react-quiz-container .number-of-selection,.react-quiz-container .selection-tag{border-radius:5px;color:#fff;padding:7px}.react-quiz-container .number-of-selection{background:#673ab7;margin-left:5px}.react-quiz-container .selection-tag.single{background:#3f51b5}.react-quiz-container .selection-tag.multiple{background:#ff9800}.react-quiz-container .selection-tag.segment{background:#3db4b9;margin-left:5px}.react-quiz-container .questionBtnContainer{display:flex;justify-content:space-between}.react-quiz-container .quiz-result-filter{bottom:15px;position:relative;width:120px;.filter-dropdown-select{background-color:#fcfcfc;border:2px solid #c2c5c7;border-radius:7px;bottom:10px;color:#333;cursor:pointer;font-size:16px;height:12px;margin-top:2px;padding:8px;position:relative;text-transform:capitalize}.filter-dropdown-select:after{color:#a5a5a5;content:"▼";font-size:11px;position:absolute;right:10px;top:57%;transform:translateY(-50%);transition:all .3s ease}.filter-dropdown-select:hover{border:2px solid #51aae6;box-shadow:0 0 6px rgba(109,179,250,.5)}.dropdown-options{background-color:#fcfcfc;border-radius:10px;box-shadow:0 0 10px hsla(210,2%,56%,.5);left:0;list-style:none;margin:0;padding:0;position:absolute;top:85%;width:100%;z-index:1}.filter-dropdown-select.open{border:2px solid #51aae6;box-shadow:0 0 6px rgba(109,179,250,.5)}.dropdown-options .dropdown-options-item{cursor:pointer;font-size:16px;padding:10px}.dropdown-options .dropdown-options-item:hover{background-color:hsla(0,0%,89%,.852);border-radius:5px}.dropdown-options .dropdown-options-item:focus{background-color:#d7f1f9;font-weight:700}.filter-dropdown-select .selected-option.selected-open{color:#c6c2c2;font-weight:lighter}.filter-dropdown-select .selected-option{bottom:2px;font-size:16px;position:relative}.filter-dropdown-select:focus+.dropdown-options{max-height:200px}.dropdown-options .dropdown-options-item.selected{background-color:#d7f1f9;color:#333;font-weight:700}.dropdown-options.open{max-height:200px}}'),module.exports=function(t){var r=t.quiz,o=t.shuffle,a=t.shuffleAnswer,s=t.showDefaultResult,c=t.onComplete,l=t.customResultPage,u=t.showInstantFeedback,d=t.continueTillCorrect,p=t.revealAnswerOnSubmit,f=t.allowNavigation,m=t.onQuestionSubmit,g=t.disableSynopsis,h=t.timer,b=t.allowPauseTimer,x=i(e.useState(!1),2),y=x[0],v=x[1],T=i(e.useState(r.questions),2),S=T[0],A=T[1],N=r.nrOfQuestions&&r.nrOfQuestions0;t-=1){var n=Math.floor(Math.random()*(t+1)),r=[e[n],e[t]];e[t]=r[0],e[n]=r[1]}return e}),[]);if(e.useEffect((function(){g&&v(!0)}),[]),e.useEffect((function(){var e=r.questions;o&&(e=E(e)),a&&(e=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((function(e){var t,r=(null===(t=e.answers)||void 0===t?void 0:t.map((function(e,t){return[e,t]}))).sort((function(){return Math.random()-.5})),o=r.map((function(e){return e[0]}));if("single"===e.answerSelectionType){var i=e.correctAnswer,a=r.findIndex((function(e){return"".concat(e[1]+1)==="".concat(i)}))+1;return n(n({},e),{},{correctAnswer:"".concat(a),answers:o})}if("multiple"===e.answerSelectionType){var s=e.correctAnswer.map((function(e){return r.findIndex((function(t){return"".concat(t[1]+1)==="".concat(e)}))+1}));return n(n({},e),{},{correctAnswer:s,answers:o})}return e}))}(e)),e.length=N,e=e.map((function(e,t){return n(n({},e),{},{questionIndex:t+1})})),A(e)}),[y]),!function(e){if(!e)return console.error("Quiz object is required."),!1;if(h&&"number"!=typeof h||h<1)return console.error(h&&"number"!=typeof h?"timer must be a number":"timer must be a number greater than 0"),!1;if(b&&"boolean"!=typeof b)return console.error("allowPauseTimer must be a Boolean"),!1;for(var t=0;t",N)}),r.quizSynopsis&&w.jsx("div",{className:"quiz-synopsis",children:r.quizSynopsis}),w.jsx("div",{className:"startQuizWrapper",children:w.jsx("button",{type:"button",onClick:function(){return v(!0)},className:"startQuizBtn btn",children:k.startQuizBtn})})]}),y&&w.jsx(D,{questions:S,showDefaultResult:s,onComplete:c,customResultPage:l,showInstantFeedback:u,continueTillCorrect:d,revealAnswerOnSubmit:p,allowNavigation:f,appLocale:k,onQuestionSubmit:m,timer:h,allowPauseTimer:b})]})}; diff --git a/docs/bundle.js b/docs/bundle.js index c8c5bc3..78699e4 100644 --- a/docs/bundle.js +++ b/docs/bundle.js @@ -1 +1 @@ -(()=>{var __webpack_modules__={412:(__unused_webpack_module,__unused_webpack___webpack_exports__,__webpack_require__)=>{"use strict";eval('\n// EXTERNAL MODULE: ./node_modules/react/index.js\nvar react = __webpack_require__(294);\n// EXTERNAL MODULE: ./node_modules/react-dom/client.js\nvar client = __webpack_require__(745);\n;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/native.js\nconst randomUUID = typeof crypto !== \'undefined\' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\n/* harmony default export */ const esm_browser_native = ({\n randomUUID\n});\n;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/rng.js\n// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nfunction rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.\n getRandomValues = typeof crypto !== \'undefined\' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error(\'crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported\');\n }\n }\n\n return getRandomValues(rnds8);\n}\n;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/stringify.js\n\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nfunction unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It\'s been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + \'-\' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + \'-\' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + \'-\' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + \'-\' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it\'s likely due to one\n // of the following:\n // - One or more input array values don\'t map to a hex octet (leading to\n // "undefined" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError(\'Stringified UUID is invalid\');\n }\n\n return uuid;\n}\n\n/* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify)));\n;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v4.js\n\n\n\n\nfunction v4(options, buf, offset) {\n if (esm_browser_native.randomUUID && !buf && !options) {\n return esm_browser_native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\n/* harmony default export */ const esm_browser_v4 = (v4);\n;// CONCATENATED MODULE: ./src/lib/core-components/QuizResultFilter.jsx\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction QuizResultFilter(_ref) {\n var filteredValue = _ref.filteredValue,\n handleChange = _ref.handleChange,\n appLocale = _ref.appLocale;\n var _useState = (0,react.useState)(false),\n _useState2 = _slicedToArray(_useState, 2),\n isOpen = _useState2[0],\n setIsOpen = _useState2[1];\n var dropdownRef = (0,react.useRef)(null);\n var toggleDropdown = function toggleDropdown() {\n setIsOpen(!isOpen);\n };\n var handleOptionClick = function handleOptionClick(value) {\n handleChange({\n target: {\n value: value\n }\n });\n setIsOpen(false);\n };\n var selectedOptionClass = isOpen ? \'selected-open\' : \'\';\n (0,react.useEffect)(function () {\n var handleOutsideClick = function handleOutsideClick(e) {\n if (isOpen && dropdownRef.current && !dropdownRef.current.contains(e.target)) {\n setIsOpen(false);\n }\n };\n document.addEventListener(\'click\', handleOutsideClick);\n return function () {\n document.removeEventListener(\'click\', handleOutsideClick);\n };\n }, [isOpen]);\n return /*#__PURE__*/react.createElement("div", {\n className: "quiz-result-filter"\n }, /*#__PURE__*/react.createElement("div", {\n ref: dropdownRef,\n className: "filter-dropdown-select ".concat(isOpen ? \'open\' : \'\'),\n onClick: toggleDropdown,\n onKeyDown: function onKeyDown(e) {\n if (e.key === \'Enter\') {\n toggleDropdown();\n }\n },\n role: "button",\n tabIndex: 0\n }, /*#__PURE__*/react.createElement("div", {\n className: "selected-option ".concat(selectedOptionClass)\n }, filteredValue === \'all\' ? appLocale.resultFilterAll : filteredValue), /*#__PURE__*/react.createElement("span", {\n className: "arrow ".concat(isOpen ? \'up\' : \'down\')\n })), isOpen && /*#__PURE__*/react.createElement("div", {\n className: "dropdown-options",\n role: "menu",\n "aria-labelledby": "quiz-filter"\n }, /*#__PURE__*/react.createElement("div", {\n className: "dropdown-options-item ".concat(filteredValue === \'all\' ? \'selected\' : \'\'),\n onClick: function onClick() {\n return handleOptionClick(\'all\');\n },\n onKeyDown: function onKeyDown(e) {\n if (e.key === \'Enter\') {\n handleOptionClick(\'all\');\n }\n },\n role: "menuitem",\n tabIndex: 0\n }, appLocale.resultFilterAll), /*#__PURE__*/react.createElement("div", {\n className: "dropdown-options-item ".concat(filteredValue === \'correct\' ? \'selected\' : \'\'),\n onClick: function onClick() {\n return handleOptionClick(\'correct\');\n },\n onKeyDown: function onKeyDown(e) {\n if (e.key === \'Enter\') {\n handleOptionClick(\'correct\');\n }\n },\n role: "menuitem",\n tabIndex: 0\n }, appLocale.resultFilterCorrect), /*#__PURE__*/react.createElement("div", {\n className: "dropdown-options-item ".concat(filteredValue === \'incorrect\' ? \'selected\' : \'\'),\n onClick: function onClick() {\n return handleOptionClick(\'incorrect\');\n },\n onKeyDown: function onKeyDown(e) {\n if (e.key === \'Enter\') {\n handleOptionClick(\'incorrect\');\n }\n },\n role: "menuitem",\n tabIndex: 0\n }, appLocale.resultFilterIncorrect), /*#__PURE__*/react.createElement("div", {\n className: "dropdown-options-item ".concat(filteredValue === \'unanswered\' ? \'selected\' : \'\'),\n onClick: function onClick() {\n return handleOptionClick(\'unanswered\');\n },\n onKeyDown: function onKeyDown(e) {\n if (e.key === \'Enter\') {\n handleOptionClick(\'unanswered\');\n }\n },\n role: "menuitem",\n tabIndex: 0\n }, appLocale.resultFilterUnanswered)));\n}\n/* harmony default export */ const core_components_QuizResultFilter = (QuizResultFilter);\n;// CONCATENATED MODULE: ./node_modules/snarkdown/dist/snarkdown.es.js\nvar e={"":["",""],_:["",""],"*":["",""],"~":["",""],"\\n":["
    "]," ":["
    "],"-":["
    "]};function n(e){return e.replace(RegExp("^"+(e.match(/^(\\t| )+/)||"")[0],"gm"),"")}function r(e){return(e+"").replace(/"/g,""").replace(//g,">")}function t(a,c){var o,l,g,s,p,u=/((?:^|\\n+)(?:\\n---+|\\* \\*(?: \\*)+)\\n)|(?:^``` *(\\w*)\\n([\\s\\S]*?)\\n```$)|((?:(?:^|\\n+)(?:\\t| {2,}).+)+\\n*)|((?:(?:^|\\n)([>*+-]|\\d+\\.)\\s+.*)+)|(?:!\\[([^\\]]*?)\\]\\(([^)]+?)\\))|(\\[)|(\\](?:\\(([^)]+?)\\))?)|(?:(?:^|\\n+)([^\\s].*)\\n(-{3,}|={3,})(?:\\n+|$))|(?:(?:^|\\n+)(#{1,6})\\s*(.+)(?:\\n+|$))|(?:`([^`].*?)`)|( \\n\\n*|\\n{2,}|__|\\*\\*|[_*]|~~)/gm,m=[],h="",i=c||{},d=0;function f(n){var r=e[n[1]||""],t=m[m.length-1]==n;return r?r[1]?(t?m.pop():m.push(n),r[0|t]):r[0]:n}function $(){for(var e="";m.length;)e+=f(m[m.length-1]);return e}for(a=a.replace(/^\\[(.+?)\\]:\\s*(.+)$/gm,function(e,n,r){return i[n.toLowerCase()]=r,""}).replace(/^\\n+|\\n+$/g,"");g=u.exec(a);)l=a.substring(d,g.index),d=u.lastIndex,o=g[0],l.match(/[^\\\\](\\\\\\\\)*\\\\$/)||((p=g[3]||g[4])?o=\'
    "+n(r(p).replace(/^\\n+|\\n+$/g,""))+"
    ":(p=g[6])?(p.match(/\\./)&&(g[5]=g[5].replace(/^\\d+/gm,"")),s=t(n(g[5].replace(/^\\s*[>*+.-]/gm,""))),">"==p?p="blockquote":(p=p.match(/\\./)?"ol":"ul",s=s.replace(/^(.*)(\\n|$)/gm,"
  • $1
  • ")),o="<"+p+">"+s+""):g[8]?o=\'\'+r(g[7])+\'\':g[10]?(h=h.replace("
    ",\'\'),o=$()+""):g[9]?o="":g[12]||g[14]?o="<"+(p="h"+(g[14]?g[14].length:g[13]>"="?1:2))+">"+t(g[12]||g[15],i)+"":g[16]?o=""+r(g[16])+"":(g[17]||g[1])&&(o=f(g[17]||"--"))),h+=l,h+=o;return(h+a.substring(d)+$()).replace(/^\\n+|\\n+$/g,"")}\n//# sourceMappingURL=snarkdown.es.js.map\n\n// EXTERNAL MODULE: ./node_modules/dompurify/dist/purify.js\nvar purify = __webpack_require__(856);\nvar purify_default = /*#__PURE__*/__webpack_require__.n(purify);\n;// CONCATENATED MODULE: ./src/lib/core-components/helpers.jsx\nfunction _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = helpers_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || helpers_unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction helpers_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return helpers_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return helpers_arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return helpers_arrayLikeToArray(arr); }\nfunction helpers_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\n\n\nvar rawMarkup = function rawMarkup(data) {\n var sanitizer = (purify_default()).sanitize;\n return {\n __html: t(sanitizer(data))\n };\n};\nvar checkAnswer = function checkAnswer(index, correctAnswer, answerSelectionType, answers, _ref) {\n var userInput = _ref.userInput,\n userAttempt = _ref.userAttempt,\n currentQuestionIndex = _ref.currentQuestionIndex,\n continueTillCorrect = _ref.continueTillCorrect,\n showNextQuestionButton = _ref.showNextQuestionButton,\n incorrect = _ref.incorrect,\n correct = _ref.correct,\n setButtons = _ref.setButtons,\n setIsCorrect = _ref.setIsCorrect,\n setIncorrectAnswer = _ref.setIncorrectAnswer,\n setCorrect = _ref.setCorrect,\n setIncorrect = _ref.setIncorrect,\n setShowNextQuestionButton = _ref.setShowNextQuestionButton,\n setUserInput = _ref.setUserInput,\n setUserAttempt = _ref.setUserAttempt;\n var indexStr = "".concat(index);\n var disabledAll = {\n 0: {\n disabled: true\n },\n 1: {\n disabled: true\n },\n 2: {\n disabled: true\n },\n 3: {\n disabled: true\n }\n };\n var userInputCopy = _toConsumableArray(userInput);\n if (answerSelectionType === \'single\') {\n if (userInputCopy[currentQuestionIndex] === undefined) {\n userInputCopy[currentQuestionIndex] = index;\n }\n if (indexStr === correctAnswer) {\n if (incorrect.indexOf(currentQuestionIndex) < 0 && correct.indexOf(currentQuestionIndex) < 0) {\n correct.push(currentQuestionIndex);\n }\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread(_objectSpread({}, prevState), disabledAll), {}, _defineProperty({}, index - 1, {\n className: indexStr === correctAnswer ? \'correct\' : \'incorrect\'\n }));\n });\n setIsCorrect(true);\n setIncorrectAnswer(false);\n setCorrect(correct);\n setShowNextQuestionButton(true);\n } else {\n if (correct.indexOf(currentQuestionIndex) < 0 && incorrect.indexOf(currentQuestionIndex) < 0) {\n incorrect.push(currentQuestionIndex);\n }\n if (continueTillCorrect) {\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread({}, prevState), {}, _defineProperty({}, index - 1, {\n disabled: !prevState[index - 1]\n }));\n });\n } else {\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread(_objectSpread({}, prevState), disabledAll), {}, _defineProperty({}, index - 1, {\n className: indexStr === correctAnswer ? \'correct\' : \'incorrect\'\n }));\n });\n setShowNextQuestionButton(true);\n }\n setIncorrectAnswer(true);\n setIsCorrect(false);\n setIncorrect(incorrect);\n }\n } else {\n var maxNumberOfMultipleSelection = correctAnswer.length;\n if (userInputCopy[currentQuestionIndex] === undefined) {\n userInputCopy[currentQuestionIndex] = [];\n }\n if (userInputCopy[currentQuestionIndex].length < maxNumberOfMultipleSelection) {\n userInputCopy[currentQuestionIndex].push(index);\n if (correctAnswer.includes(index)) {\n if (userInputCopy[currentQuestionIndex].length <= maxNumberOfMultipleSelection) {\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread({}, prevState), {}, _defineProperty({}, index - 1, {\n disabled: !prevState[index - 1],\n className: correctAnswer.includes(index) ? \'correct\' : \'incorrect\'\n }));\n });\n }\n } else if (userInputCopy[currentQuestionIndex].length <= maxNumberOfMultipleSelection) {\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread({}, prevState), {}, _defineProperty({}, index - 1, {\n className: correctAnswer.includes(index) ? \'correct\' : \'incorrect\'\n }));\n });\n }\n }\n if (maxNumberOfMultipleSelection === userAttempt) {\n var cnt = 0;\n for (var i = 0; i < correctAnswer.length; i += 1) {\n if (userInputCopy[currentQuestionIndex].includes(correctAnswer[i])) {\n cnt += 1;\n }\n }\n var _loop = function _loop(_i) {\n if (correctAnswer.includes(_i + 1)) {\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread({}, prevState), {}, _defineProperty({}, _i, {}));\n });\n }\n };\n for (var _i = 0; _i < answers.length; _i += 1) {\n _loop(_i);\n }\n if (cnt === maxNumberOfMultipleSelection) {\n correct.push(currentQuestionIndex);\n setIsCorrect(true);\n setIncorrectAnswer(false);\n setCorrect(correct);\n setShowNextQuestionButton(true);\n setUserAttempt(1);\n } else {\n incorrect.push(currentQuestionIndex);\n setIncorrectAnswer(true);\n setIsCorrect(false);\n setIncorrect(incorrect);\n setShowNextQuestionButton(true);\n setUserAttempt(1);\n }\n } else if (!showNextQuestionButton) {\n setUserAttempt(userAttempt + 1);\n }\n }\n setUserInput(userInputCopy);\n};\nvar selectAnswer = function selectAnswer(index, correctAnswer, answerSelectionType, _ref2) {\n var userInput = _ref2.userInput,\n currentQuestionIndex = _ref2.currentQuestionIndex,\n setButtons = _ref2.setButtons,\n setShowNextQuestionButton = _ref2.setShowNextQuestionButton,\n incorrect = _ref2.incorrect,\n correct = _ref2.correct,\n setCorrect = _ref2.setCorrect,\n setIncorrect = _ref2.setIncorrect,\n setUserInput = _ref2.setUserInput;\n var selectedButtons = {\n 0: {\n selected: false\n },\n 1: {\n selected: false\n },\n 2: {\n selected: false\n },\n 3: {\n selected: false\n }\n };\n var userInputCopy = _toConsumableArray(userInput);\n if (answerSelectionType === \'single\') {\n correctAnswer = Number(correctAnswer);\n userInputCopy[currentQuestionIndex] = index;\n if (index === correctAnswer) {\n if (correct.indexOf(currentQuestionIndex) < 0) {\n correct.push(currentQuestionIndex);\n }\n if (incorrect.indexOf(currentQuestionIndex) >= 0) {\n incorrect.splice(incorrect.indexOf(currentQuestionIndex), 1);\n }\n } else {\n if (incorrect.indexOf(currentQuestionIndex) < 0) {\n incorrect.push(currentQuestionIndex);\n }\n if (correct.indexOf(currentQuestionIndex) >= 0) {\n correct.splice(correct.indexOf(currentQuestionIndex), 1);\n }\n }\n setCorrect(correct);\n setIncorrect(incorrect);\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread(_objectSpread({}, prevState), selectedButtons), {}, _defineProperty({}, index - 1, {\n className: \'selected\'\n }));\n });\n setShowNextQuestionButton(true);\n } else {\n if (userInputCopy[currentQuestionIndex] === undefined) {\n userInputCopy[currentQuestionIndex] = [];\n }\n if (userInputCopy[currentQuestionIndex].includes(index)) {\n userInputCopy[currentQuestionIndex].splice(userInputCopy[currentQuestionIndex].indexOf(index), 1);\n } else {\n userInputCopy[currentQuestionIndex].push(index);\n }\n if (userInputCopy[currentQuestionIndex].length === correctAnswer.length) {\n var exactMatch = true;\n // eslint-disable-next-line no-restricted-syntax\n var _iterator = _createForOfIteratorHelper(userInput[currentQuestionIndex]),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var input = _step.value;\n if (!correctAnswer.includes(input)) {\n exactMatch = false;\n if (incorrect.indexOf(currentQuestionIndex) < 0) {\n incorrect.push(currentQuestionIndex);\n }\n if (correct.indexOf(currentQuestionIndex) >= 0) {\n correct.splice(correct.indexOf(currentQuestionIndex), 1);\n }\n break;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n if (exactMatch) {\n if (correct.indexOf(currentQuestionIndex) < 0) {\n correct.push(currentQuestionIndex);\n }\n if (incorrect.indexOf(currentQuestionIndex) >= 0) {\n incorrect.splice(incorrect.indexOf(currentQuestionIndex), 1);\n }\n }\n } else {\n if (incorrect.indexOf(currentQuestionIndex) < 0) {\n incorrect.push(currentQuestionIndex);\n }\n if (correct.indexOf(currentQuestionIndex) >= 0) {\n correct.splice(correct.indexOf(currentQuestionIndex), 1);\n }\n }\n setCorrect(correct);\n setIncorrect(incorrect);\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread({}, prevState), {}, _defineProperty({}, index - 1, {\n className: userInputCopy[currentQuestionIndex].includes(index) ? \'selected\' : undefined\n }));\n });\n if (userInputCopy[currentQuestionIndex].length > 0) {\n setShowNextQuestionButton(true);\n }\n }\n setUserInput(userInputCopy);\n};\n;// CONCATENATED MODULE: ./src/lib/core-components/Explanation.jsx\n\nfunction Explanation(_ref) {\n var question = _ref.question,\n isResultPage = _ref.isResultPage;\n var explanation = question.explanation;\n if (!explanation) {\n return null;\n }\n if (isResultPage) {\n return /*#__PURE__*/react.createElement("div", {\n className: "explanation"\n }, explanation);\n }\n return /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("br", null), explanation);\n}\n/* harmony default export */ const core_components_Explanation = (Explanation);\n;// CONCATENATED MODULE: ./src/lib/core-components/InstantFeedback.jsx\n\n\nvar renderMessageForCorrectAnswer = function renderMessageForCorrectAnswer(question) {\n var defaultMessage = \'You are correct. Please click Next to continue.\';\n return question.messageForCorrectAnswer || defaultMessage;\n};\nvar renderMessageForIncorrectAnswer = function renderMessageForIncorrectAnswer(question) {\n var defaultMessage = \'Incorrect answer. Please try again.\';\n return question.messageForIncorrectAnswer || defaultMessage;\n};\nfunction InstantFeedback(_ref) {\n var showInstantFeedback = _ref.showInstantFeedback,\n incorrectAnswer = _ref.incorrectAnswer,\n correctAnswer = _ref.correctAnswer,\n question = _ref.question,\n onQuestionSubmit = _ref.onQuestionSubmit,\n userAnswer = _ref.userAnswer;\n (0,react.useEffect)(function () {\n if (onQuestionSubmit && (correctAnswer || incorrectAnswer)) {\n onQuestionSubmit({\n question: question,\n userAnswer: userAnswer,\n isCorrect: correctAnswer\n });\n }\n }, [correctAnswer, incorrectAnswer]);\n return /*#__PURE__*/react.createElement(react.Fragment, null, incorrectAnswer && showInstantFeedback && /*#__PURE__*/react.createElement("div", {\n className: "alert incorrect"\n }, renderMessageForIncorrectAnswer(question)), correctAnswer && showInstantFeedback && /*#__PURE__*/react.createElement("div", {\n className: "alert correct"\n }, renderMessageForCorrectAnswer(question), /*#__PURE__*/react.createElement(core_components_Explanation, {\n question: question,\n isResultPage: false\n })));\n}\n/* harmony default export */ const core_components_InstantFeedback = (InstantFeedback);\n;// CONCATENATED MODULE: ./src/lib/Core.jsx\nfunction Core_toConsumableArray(arr) { return Core_arrayWithoutHoles(arr) || Core_iterableToArray(arr) || Core_unsupportedIterableToArray(arr) || Core_nonIterableSpread(); }\nfunction Core_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction Core_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }\nfunction Core_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return Core_arrayLikeToArray(arr); }\nfunction Core_typeof(o) { "@babel/helpers - typeof"; return Core_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, Core_typeof(o); }\nfunction Core_slicedToArray(arr, i) { return Core_arrayWithHoles(arr) || Core_iterableToArrayLimit(arr, i) || Core_unsupportedIterableToArray(arr, i) || Core_nonIterableRest(); }\nfunction Core_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction Core_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Core_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Core_arrayLikeToArray(o, minLen); }\nfunction Core_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction Core_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction Core_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\n\n\n\nfunction Core(_ref) {\n var questions = _ref.questions,\n appLocale = _ref.appLocale,\n showDefaultResult = _ref.showDefaultResult,\n onComplete = _ref.onComplete,\n customResultPage = _ref.customResultPage,\n showInstantFeedback = _ref.showInstantFeedback,\n continueTillCorrect = _ref.continueTillCorrect,\n revealAnswerOnSubmit = _ref.revealAnswerOnSubmit,\n allowNavigation = _ref.allowNavigation,\n onQuestionSubmit = _ref.onQuestionSubmit,\n timer = _ref.timer,\n allowPauseTimer = _ref.allowPauseTimer;\n var _useState = (0,react.useState)(false),\n _useState2 = Core_slicedToArray(_useState, 2),\n incorrectAnswer = _useState2[0],\n setIncorrectAnswer = _useState2[1];\n var _useState3 = (0,react.useState)(false),\n _useState4 = Core_slicedToArray(_useState3, 2),\n isCorrect = _useState4[0],\n setIsCorrect = _useState4[1];\n var _useState5 = (0,react.useState)(false),\n _useState6 = Core_slicedToArray(_useState5, 2),\n showNextQuestionButton = _useState6[0],\n setShowNextQuestionButton = _useState6[1];\n var _useState7 = (0,react.useState)(false),\n _useState8 = Core_slicedToArray(_useState7, 2),\n endQuiz = _useState8[0],\n setEndQuiz = _useState8[1];\n var _useState9 = (0,react.useState)(0),\n _useState10 = Core_slicedToArray(_useState9, 2),\n currentQuestionIndex = _useState10[0],\n setCurrentQuestionIndex = _useState10[1];\n var _useState11 = (0,react.useState)({}),\n _useState12 = Core_slicedToArray(_useState11, 2),\n buttons = _useState12[0],\n setButtons = _useState12[1];\n var _useState13 = (0,react.useState)([]),\n _useState14 = Core_slicedToArray(_useState13, 2),\n correct = _useState14[0],\n setCorrect = _useState14[1];\n var _useState15 = (0,react.useState)([]),\n _useState16 = Core_slicedToArray(_useState15, 2),\n incorrect = _useState16[0],\n setIncorrect = _useState16[1];\n var _useState17 = (0,react.useState)([]),\n _useState18 = Core_slicedToArray(_useState17, 2),\n unanswered = _useState18[0],\n setUnanswered = _useState18[1];\n var _useState19 = (0,react.useState)([]),\n _useState20 = Core_slicedToArray(_useState19, 2),\n userInput = _useState20[0],\n setUserInput = _useState20[1];\n var _useState21 = (0,react.useState)(\'all\'),\n _useState22 = Core_slicedToArray(_useState21, 2),\n filteredValue = _useState22[0],\n setFilteredValue = _useState22[1];\n var _useState23 = (0,react.useState)(1),\n _useState24 = Core_slicedToArray(_useState23, 2),\n userAttempt = _useState24[0],\n setUserAttempt = _useState24[1];\n var _useState25 = (0,react.useState)(true),\n _useState26 = Core_slicedToArray(_useState25, 2),\n showDefaultResultState = _useState26[0],\n setShowDefaultResult = _useState26[1];\n var _useState27 = (0,react.useState)(undefined),\n _useState28 = Core_slicedToArray(_useState27, 2),\n answerSelectionTypeState = _useState28[0],\n setAnswerSelectionType = _useState28[1];\n var _useState29 = (0,react.useState)(0),\n _useState30 = Core_slicedToArray(_useState29, 2),\n totalPoints = _useState30[0],\n setTotalPoints = _useState30[1];\n var _useState31 = (0,react.useState)(0),\n _useState32 = Core_slicedToArray(_useState31, 2),\n correctPoints = _useState32[0],\n setCorrectPoints = _useState32[1];\n var _useState33 = (0,react.useState)(questions[currentQuestionIndex]),\n _useState34 = Core_slicedToArray(_useState33, 2),\n activeQuestion = _useState34[0],\n setActiveQuestion = _useState34[1];\n var _useState35 = (0,react.useState)(undefined),\n _useState36 = Core_slicedToArray(_useState35, 2),\n questionSummary = _useState36[0],\n setQuestionSummary = _useState36[1];\n var _useState37 = (0,react.useState)(timer),\n _useState38 = Core_slicedToArray(_useState37, 2),\n timeRemaining = _useState38[0],\n setTimeRemaining = _useState38[1];\n var _useState39 = (0,react.useState)(true),\n _useState40 = Core_slicedToArray(_useState39, 2),\n isRunning = _useState40[0],\n setIsRunning = _useState40[1];\n (0,react.useEffect)(function () {\n setShowDefaultResult(showDefaultResult !== undefined ? showDefaultResult : true);\n }, [showDefaultResult]);\n (0,react.useEffect)(function () {\n setActiveQuestion(questions[currentQuestionIndex]);\n }, [currentQuestionIndex, questions]);\n (0,react.useEffect)(function () {\n var answerSelectionType = activeQuestion.answerSelectionType;\n // Default single to avoid code breaking due to automatic version upgrade\n setAnswerSelectionType(answerSelectionType || \'single\');\n }, [activeQuestion, currentQuestionIndex]);\n (0,react.useEffect)(function () {\n if (endQuiz) {\n setIsRunning(false);\n var totalPointsTemp = 0;\n var correctPointsTemp = 0;\n for (var i = 0; i < questions.length; i += 1) {\n var point = questions[i].point || 0;\n if (typeof point === \'string\' || point instanceof String) {\n point = parseInt(point, 10);\n }\n totalPointsTemp += point;\n if (correct.includes(i)) {\n correctPointsTemp += point;\n }\n }\n setTotalPoints(totalPointsTemp);\n setCorrectPoints(correctPointsTemp);\n }\n }, [endQuiz]);\n (0,react.useEffect)(function () {\n setQuestionSummary({\n numberOfQuestions: questions.length,\n numberOfCorrectAnswers: correct.length,\n numberOfIncorrectAnswers: incorrect.length,\n questions: questions,\n userInput: userInput,\n totalPoints: totalPoints,\n correctPoints: correctPoints\n });\n }, [totalPoints, correctPoints]);\n (0,react.useEffect)(function () {\n if (endQuiz && onComplete !== undefined && questionSummary !== undefined) {\n onComplete(questionSummary);\n }\n }, [questionSummary]);\n var nextQuestion = function nextQuestion(currentQuestionIdx) {\n setIncorrectAnswer(false);\n setIsCorrect(false);\n setShowNextQuestionButton(false);\n setButtons({});\n if (currentQuestionIdx + 1 === questions.length) {\n if (userInput.length !== questions.length) {\n alert(\'Quiz is incomplete\');\n } else if (allowNavigation) {\n var submitQuiz = confirm(\'You have finished all the questions. Submit Quiz now?\');\n if (submitQuiz) {\n setEndQuiz(true);\n }\n } else {\n setEndQuiz(true);\n }\n } else {\n setCurrentQuestionIndex(currentQuestionIdx + 1);\n }\n };\n var handleChange = function handleChange(event) {\n setFilteredValue(event.target.value);\n };\n var renderAnswerInResult = function renderAnswerInResult(question, userInputIndex) {\n var answers = question.answers,\n correctAnswer = question.correctAnswer,\n questionType = question.questionType;\n var answerSelectionType = question.answerSelectionType;\n var answerBtnCorrectClassName;\n var answerBtnIncorrectClassName;\n\n // Default single to avoid code breaking due to automatic version upgrade\n answerSelectionType = answerSelectionType || \'single\';\n return answers.map(function (answer, index) {\n if (answerSelectionType === \'single\') {\n // correctAnswer - is string\n answerBtnCorrectClassName = "".concat(index + 1) === correctAnswer ? \'correct\' : \'\';\n answerBtnIncorrectClassName = "".concat(userInputIndex) !== correctAnswer && "".concat(index + 1) === "".concat(userInputIndex) ? \'incorrect\' : \'\';\n if (userInputIndex === undefined && "".concat(index + 1) !== correctAnswer) {\n answerBtnIncorrectClassName = \'unanswered\';\n }\n } else {\n // correctAnswer - is array of numbers\n answerBtnCorrectClassName = correctAnswer.includes(index + 1) ? \'correct\' : \'\';\n answerBtnIncorrectClassName = !correctAnswer.includes(index + 1) && userInputIndex !== null && userInputIndex !== void 0 && userInputIndex.includes(index + 1) ? \'incorrect\' : \'\';\n if (userInputIndex === undefined && !correctAnswer.includes(index + 1)) {\n answerBtnIncorrectClassName = \'unanswered\';\n }\n }\n return /*#__PURE__*/react.createElement("div", {\n key: esm_browser_v4()\n }, /*#__PURE__*/react.createElement("button", {\n type: "button",\n disabled: true,\n className: "answerBtn btn ".concat(answerBtnCorrectClassName).concat(answerBtnIncorrectClassName)\n }, questionType === \'text\' && /*#__PURE__*/react.createElement("span", null, answer), questionType === \'photo\' && /*#__PURE__*/react.createElement("img", {\n src: answer,\n alt: "answer"\n })));\n });\n };\n var renderTags = function renderTags(answerSelectionType, numberOfSelection, segment) {\n var singleSelectionTagText = appLocale.singleSelectionTagText,\n multipleSelectionTagText = appLocale.multipleSelectionTagText,\n pickNumberOfSelection = appLocale.pickNumberOfSelection;\n return /*#__PURE__*/react.createElement("div", {\n className: "tag-container"\n }, answerSelectionType === \'single\' && /*#__PURE__*/react.createElement("span", {\n className: "single selection-tag"\n }, singleSelectionTagText), answerSelectionType === \'multiple\' && /*#__PURE__*/react.createElement("span", {\n className: "multiple selection-tag"\n }, multipleSelectionTagText), /*#__PURE__*/react.createElement("span", {\n className: "number-of-selection"\n }, pickNumberOfSelection.replace(\'\', numberOfSelection)), segment && /*#__PURE__*/react.createElement("span", {\n className: "selection-tag segment"\n }, segment));\n };\n var isCorrectCheck = function isCorrectCheck(index, correctAnswerIndex) {\n if (typeof correctAnswerIndex === \'string\') {\n return index === Number(correctAnswerIndex);\n }\n if (Core_typeof(correctAnswerIndex) === \'object\') {\n return correctAnswerIndex.find(function (element) {\n return element === index;\n }) !== undefined;\n }\n return false;\n };\n var renderQuizResultQuestions = (0,react.useCallback)(function () {\n var filteredQuestions;\n var filteredUserInput;\n if (filteredValue !== \'all\') {\n var targetQuestions = unanswered;\n if (filteredValue === \'correct\') {\n targetQuestions = correct;\n } else if (filteredValue === \'incorrect\') {\n targetQuestions = incorrect;\n }\n filteredQuestions = questions.filter(function (_, index) {\n return targetQuestions.indexOf(index) !== -1;\n });\n filteredUserInput = userInput.filter(function (_, index) {\n return targetQuestions.indexOf(index) !== -1;\n });\n }\n return (filteredQuestions || questions).map(function (question, index) {\n var userInputIndex = filteredUserInput ? filteredUserInput[index] : userInput[index];\n\n // Default single to avoid code breaking due to automatic version upgrade\n var answerSelectionType = question.answerSelectionType || \'single\';\n return /*#__PURE__*/react.createElement("div", {\n className: "result-answer-wrapper",\n key: esm_browser_v4()\n }, /*#__PURE__*/react.createElement("h3", {\n dangerouslySetInnerHTML: rawMarkup("Q".concat(question.questionIndex, ": ").concat(question.question, " ").concat(appLocale.marksOfQuestion.replace(\'\', question.point)))\n }), question.questionPic && /*#__PURE__*/react.createElement("img", {\n src: question.questionPic,\n alt: "question"\n }), renderTags(answerSelectionType, question.correctAnswer.length, question.segment), /*#__PURE__*/react.createElement("div", {\n className: "result-answer"\n }, renderAnswerInResult(question, userInputIndex)), /*#__PURE__*/react.createElement(core_components_Explanation, {\n question: question,\n isResultPage: true\n }));\n });\n }, [endQuiz, filteredValue]);\n var renderAnswers = function renderAnswers(question, answerButtons) {\n var answers = question.answers,\n correctAnswer = question.correctAnswer,\n questionType = question.questionType,\n questionIndex = question.questionIndex;\n var answerSelectionType = question.answerSelectionType;\n var onClickAnswer = function onClickAnswer(index) {\n return checkAnswer(index + 1, correctAnswer, answerSelectionType, answers, {\n userInput: userInput,\n userAttempt: userAttempt,\n currentQuestionIndex: currentQuestionIndex,\n continueTillCorrect: continueTillCorrect,\n showNextQuestionButton: showNextQuestionButton,\n incorrect: incorrect,\n correct: correct,\n setButtons: setButtons,\n setIsCorrect: setIsCorrect,\n setIncorrectAnswer: setIncorrectAnswer,\n setCorrect: setCorrect,\n setIncorrect: setIncorrect,\n setShowNextQuestionButton: setShowNextQuestionButton,\n setUserInput: setUserInput,\n setUserAttempt: setUserAttempt\n });\n };\n var onSelectAnswer = function onSelectAnswer(index) {\n return selectAnswer(index + 1, correctAnswer, answerSelectionType, {\n userInput: userInput,\n currentQuestionIndex: currentQuestionIndex,\n setButtons: setButtons,\n setShowNextQuestionButton: setShowNextQuestionButton,\n incorrect: incorrect,\n correct: correct,\n setCorrect: setCorrect,\n setIncorrect: setIncorrect,\n setUserInput: setUserInput\n });\n };\n var checkSelectedAnswer = function checkSelectedAnswer(index) {\n if (userInput[questionIndex - 1] === undefined) {\n return false;\n }\n if (answerSelectionType === \'single\') {\n return userInput[questionIndex - 1] === index;\n }\n return Array.isArray(userInput[questionIndex - 1]) && userInput[questionIndex - 1].includes(index);\n };\n\n // Default single to avoid code breaking due to automatic version upgrade\n answerSelectionType = answerSelectionType || \'single\';\n return answers.map(function (answer, index) {\n return /*#__PURE__*/react.createElement(react.Fragment, {\n key: esm_browser_v4()\n }, answerButtons[index] !== undefined ? /*#__PURE__*/react.createElement("button", {\n type: "button",\n disabled: answerButtons[index].disabled || false,\n className: "".concat(answerButtons[index].className, " answerBtn btn ").concat(isCorrectCheck(index + 1, correctAnswer) && showInstantFeedback ? \'correct\' : \'\'),\n onClick: function onClick() {\n return revealAnswerOnSubmit ? onSelectAnswer(index) : onClickAnswer(index);\n }\n }, questionType === \'text\' && /*#__PURE__*/react.createElement("span", null, answer), questionType === \'photo\' && /*#__PURE__*/react.createElement("img", {\n src: answer,\n alt: "answer"\n })) : /*#__PURE__*/react.createElement("button", {\n type: "button",\n onClick: function onClick() {\n return revealAnswerOnSubmit ? onSelectAnswer(index) : onClickAnswer(index);\n },\n className: "answerBtn btn ".concat(allowNavigation && checkSelectedAnswer(index + 1) ? \'selected\' : null)\n }, questionType === \'text\' && answer, questionType === \'photo\' && /*#__PURE__*/react.createElement("img", {\n src: answer,\n alt: "answer"\n })));\n });\n };\n var getUnansweredQuestions = function getUnansweredQuestions() {\n questions.forEach(function (question, index) {\n if (userInput[index] === undefined) {\n setUnanswered(function (oldArray) {\n return [].concat(Core_toConsumableArray(oldArray), [index]);\n });\n }\n });\n };\n var renderResult = function renderResult() {\n return /*#__PURE__*/react.createElement("div", {\n className: "card-body"\n }, /*#__PURE__*/react.createElement("h2", null, appLocale.resultPageHeaderText.replace(\'\', correct.length).replace(\'\', questions.length)), /*#__PURE__*/react.createElement("h2", null, appLocale.resultPagePoint.replace(\'\', correctPoints).replace(\'\', totalPoints)), /*#__PURE__*/react.createElement("br", null), /*#__PURE__*/react.createElement(core_components_QuizResultFilter, {\n filteredValue: filteredValue,\n handleChange: handleChange,\n appLocale: appLocale\n }), renderQuizResultQuestions());\n };\n (0,react.useEffect)(function () {\n var countdown;\n if (timer && isRunning && timeRemaining > 0) {\n countdown = setInterval(function () {\n setTimeRemaining(function (prevTime) {\n return prevTime - 1;\n });\n }, 1000);\n }\n return function () {\n return timer && clearInterval(countdown);\n };\n }, [isRunning, timeRemaining, timer]);\n var toggleTimer = function toggleTimer() {\n setIsRunning(!isRunning);\n };\n var formatTime = function formatTime(time) {\n return time < 10 ? \'0\' : \'\';\n };\n var displayTime = function displayTime(time) {\n var hours = Math.floor(time / 3600);\n var minutes = Math.floor(time % 3600 / 60);\n var seconds = time % 60;\n return "".concat(formatTime(hours)).concat(hours, ":").concat(formatTime(minutes)).concat(minutes, ":").concat(formatTime(seconds)).concat(seconds);\n };\n var handleTimeUp = function handleTimeUp() {\n setIsRunning(false);\n setEndQuiz(true);\n getUnansweredQuestions();\n };\n return /*#__PURE__*/react.createElement("div", {\n className: "questionWrapper"\n }, timer && !isRunning && /*#__PURE__*/react.createElement("div", null, appLocale.timerTimeTaken, ":", \' \', /*#__PURE__*/react.createElement("b", null, displayTime(timer - timeRemaining))), timer && isRunning && /*#__PURE__*/react.createElement("div", null, appLocale.timerTimeRemaining, ":", \' \', /*#__PURE__*/react.createElement("b", null, displayTime(timeRemaining))), timer && timeRemaining === 0 && isRunning && handleTimeUp(), !endQuiz && /*#__PURE__*/react.createElement("div", {\n className: "questionWrapperBody"\n }, /*#__PURE__*/react.createElement("div", null, "".concat(appLocale.question, " ").concat(currentQuestionIndex + 1, " / ").concat(questions.length, ":"), /*#__PURE__*/react.createElement("br", null), timer && allowPauseTimer && /*#__PURE__*/react.createElement("button", {\n type: "button",\n className: "timerBtn",\n onClick: toggleTimer\n }, isRunning ? appLocale.pauseScreenPause : appLocale.pauseScreenResume)), isRunning ? /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("h3", {\n dangerouslySetInnerHTML: rawMarkup("".concat(activeQuestion && activeQuestion.question, " ").concat(appLocale.marksOfQuestion.replace(\'\', activeQuestion.point)))\n }), activeQuestion && activeQuestion.questionPic && /*#__PURE__*/react.createElement("img", {\n src: activeQuestion.questionPic,\n alt: "question"\n }), activeQuestion && renderTags(answerSelectionTypeState, activeQuestion.correctAnswer.length, activeQuestion.segment), /*#__PURE__*/react.createElement("div", {\n className: "questionModal"\n }, /*#__PURE__*/react.createElement(core_components_InstantFeedback, {\n question: activeQuestion,\n showInstantFeedback: showInstantFeedback,\n correctAnswer: isCorrect,\n incorrectAnswer: incorrectAnswer,\n onQuestionSubmit: onQuestionSubmit,\n userAnswer: Core_toConsumableArray(userInput).pop()\n })), activeQuestion && renderAnswers(activeQuestion, buttons), (showNextQuestionButton || allowNavigation) && /*#__PURE__*/react.createElement("div", {\n className: "questionBtnContainer"\n }, allowNavigation && currentQuestionIndex > 0 && /*#__PURE__*/react.createElement("button", {\n onClick: function onClick() {\n return nextQuestion(currentQuestionIndex - 2);\n },\n className: "prevQuestionBtn btn",\n type: "button"\n }, appLocale.prevQuestionBtn), /*#__PURE__*/react.createElement("button", {\n onClick: function onClick() {\n return nextQuestion(currentQuestionIndex);\n },\n className: "nextQuestionBtn btn",\n type: "button"\n }, appLocale.nextQuestionBtn))) : /*#__PURE__*/react.createElement("span", {\n className: "timerPauseScreen dark:text-white text-black"\n }, /*#__PURE__*/react.createElement("br", null), /*#__PURE__*/react.createElement("br", null), appLocale.pauseScreenDisplay)), endQuiz && showDefaultResultState && customResultPage === undefined && renderResult(), endQuiz && !showDefaultResultState && customResultPage !== undefined && customResultPage(questionSummary));\n}\n/* harmony default export */ const lib_Core = (Core);\n;// CONCATENATED MODULE: ./src/lib/Locale.jsx\nvar defaultLocale = {\n landingHeaderText: \' Questions\',\n question: \'Question\',\n startQuizBtn: \'Start Quiz\',\n resultFilterAll: \'All\',\n resultFilterCorrect: \'Correct\',\n resultFilterIncorrect: \'Incorrect\',\n resultFilterUnanswered: \'Unanswered\',\n nextQuestionBtn: \'Next\',\n prevQuestionBtn: \'Prev\',\n resultPageHeaderText: \'You have completed the quiz. You got out of questions.\',\n resultPagePoint: \'You scored out of .\',\n pauseScreenDisplay: \'Test is paused. Clicked the Resume button to continue\',\n timerTimeRemaining: \'Time Remaining\',\n timerTimeTaken: \'Time Taken\',\n pauseScreenPause: \'Pause\',\n pauseScreenResume: \'Resume\',\n singleSelectionTagText: \'Single Selection\',\n multipleSelectionTagText: \'Multiple Selection\',\n pickNumberOfSelection: \'Pick \',\n marksOfQuestion: \'( marks)\'\n};\n/* harmony default export */ const Locale = (defaultLocale);\n;// CONCATENATED MODULE: ./src/lib/Quiz.jsx\nfunction Quiz_typeof(o) { "@babel/helpers - typeof"; return Quiz_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, Quiz_typeof(o); }\nfunction Quiz_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction Quiz_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? Quiz_ownKeys(Object(t), !0).forEach(function (r) { Quiz_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Quiz_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction Quiz_defineProperty(obj, key, value) { key = Quiz_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction Quiz_toPropertyKey(arg) { var key = Quiz_toPrimitive(arg, "string"); return Quiz_typeof(key) === "symbol" ? key : String(key); }\nfunction Quiz_toPrimitive(input, hint) { if (Quiz_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (Quiz_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }\nfunction Quiz_slicedToArray(arr, i) { return Quiz_arrayWithHoles(arr) || Quiz_iterableToArrayLimit(arr, i) || Quiz_unsupportedIterableToArray(arr, i) || Quiz_nonIterableRest(); }\nfunction Quiz_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction Quiz_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Quiz_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Quiz_arrayLikeToArray(o, minLen); }\nfunction Quiz_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction Quiz_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction Quiz_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\n\nfunction Quiz(_ref) {\n var quiz = _ref.quiz,\n shuffle = _ref.shuffle,\n shuffleAnswer = _ref.shuffleAnswer,\n showDefaultResult = _ref.showDefaultResult,\n onComplete = _ref.onComplete,\n customResultPage = _ref.customResultPage,\n showInstantFeedback = _ref.showInstantFeedback,\n continueTillCorrect = _ref.continueTillCorrect,\n revealAnswerOnSubmit = _ref.revealAnswerOnSubmit,\n allowNavigation = _ref.allowNavigation,\n onQuestionSubmit = _ref.onQuestionSubmit,\n disableSynopsis = _ref.disableSynopsis,\n timer = _ref.timer,\n allowPauseTimer = _ref.allowPauseTimer;\n var _useState = (0,react.useState)(false),\n _useState2 = Quiz_slicedToArray(_useState, 2),\n start = _useState2[0],\n setStart = _useState2[1];\n var _useState3 = (0,react.useState)(quiz.questions),\n _useState4 = Quiz_slicedToArray(_useState3, 2),\n questions = _useState4[0],\n setQuestions = _useState4[1];\n var nrOfQuestions = quiz.nrOfQuestions && quiz.nrOfQuestions < quiz.questions.length ? quiz.nrOfQuestions : quiz.questions.length;\n\n // Shuffle answers funtion here\n var shuffleAnswerSequence = function shuffleAnswerSequence() {\n var oldQuestions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var newQuestions = oldQuestions.map(function (question) {\n var _question$answers;\n var answerWithIndex = (_question$answers = question.answers) === null || _question$answers === void 0 ? void 0 : _question$answers.map(function (ans, i) {\n return [ans, i];\n });\n var shuffledAnswersWithIndex = answerWithIndex.sort(function () {\n return Math.random() - 0.5;\n });\n var shuffledAnswers = shuffledAnswersWithIndex.map(function (ans) {\n return ans[0];\n });\n if (question.answerSelectionType === \'single\') {\n var oldCorrectAnswer = question.correctAnswer;\n var newCorrectAnswer = shuffledAnswersWithIndex.findIndex(function (ans) {\n return "".concat(ans[1] + 1) === "".concat(oldCorrectAnswer);\n }) + 1;\n return Quiz_objectSpread(Quiz_objectSpread({}, question), {}, {\n correctAnswer: "".concat(newCorrectAnswer),\n answers: shuffledAnswers\n });\n }\n if (question.answerSelectionType === \'multiple\') {\n var _oldCorrectAnswer = question.correctAnswer;\n var _newCorrectAnswer = _oldCorrectAnswer.map(function (cans) {\n return shuffledAnswersWithIndex.findIndex(function (ans) {\n return "".concat(ans[1] + 1) === "".concat(cans);\n }) + 1;\n });\n return Quiz_objectSpread(Quiz_objectSpread({}, question), {}, {\n correctAnswer: _newCorrectAnswer,\n answers: shuffledAnswers\n });\n }\n return question;\n });\n return newQuestions;\n };\n var shuffleQuestions = (0,react.useCallback)(function (q) {\n for (var i = q.length - 1; i > 0; i -= 1) {\n var j = Math.floor(Math.random() * (i + 1));\n var _ref2 = [q[j], q[i]];\n q[i] = _ref2[0];\n q[j] = _ref2[1];\n }\n return q;\n }, []);\n (0,react.useEffect)(function () {\n if (disableSynopsis) setStart(true);\n }, []);\n (0,react.useEffect)(function () {\n var newQuestions = quiz.questions;\n if (shuffle) {\n newQuestions = shuffleQuestions(newQuestions);\n }\n if (shuffleAnswer) {\n newQuestions = shuffleAnswerSequence(newQuestions);\n }\n newQuestions.length = nrOfQuestions;\n newQuestions = newQuestions.map(function (question, index) {\n return Quiz_objectSpread(Quiz_objectSpread({}, question), {}, {\n questionIndex: index + 1\n });\n });\n setQuestions(newQuestions);\n }, [start]);\n var validateQuiz = function validateQuiz(q) {\n if (!q) {\n console.error(\'Quiz object is required.\');\n return false;\n }\n if (timer && typeof timer !== \'number\' || timer < 1) {\n console.error(timer && typeof timer !== \'number\' ? \'timer must be a number\' : \'timer must be a number greater than 0\');\n return false;\n }\n if (allowPauseTimer && typeof allowPauseTimer !== \'boolean\') {\n console.error(\'allowPauseTimer must be a Boolean\');\n return false;\n }\n for (var i = 0; i < questions.length; i += 1) {\n var _questions$i = questions[i],\n question = _questions$i.question,\n questionType = _questions$i.questionType,\n answerSelectionType = _questions$i.answerSelectionType,\n answers = _questions$i.answers,\n correctAnswer = _questions$i.correctAnswer;\n if (!question) {\n console.error("Field \'question\' is required.");\n return false;\n }\n if (!questionType) {\n console.error("Field \'questionType\' is required.");\n return false;\n }\n if (questionType !== \'text\' && questionType !== \'photo\') {\n console.error("The value of \'questionType\' is either \'text\' or \'photo\'.");\n return false;\n }\n if (!answers) {\n console.error("Field \'answers\' is required.");\n return false;\n }\n if (!Array.isArray(answers)) {\n console.error("Field \'answers\' has to be an Array");\n return false;\n }\n if (!correctAnswer) {\n console.error("Field \'correctAnswer\' is required.");\n return false;\n }\n var selectType = answerSelectionType;\n if (!answerSelectionType) {\n // Default single to avoid code breaking due to automatic version upgrade\n console.warn(\'Field answerSelectionType should be defined since v0.3.0. Use single by default.\');\n selectType = answerSelectionType || \'single\';\n }\n if (selectType === \'single\' && !(typeof selectType === \'string\' || selectType instanceof String)) {\n console.error(\'answerSelectionType is single but expecting String in the field correctAnswer\');\n return false;\n }\n if (selectType === \'multiple\' && !Array.isArray(correctAnswer)) {\n console.error(\'answerSelectionType is multiple but expecting Array in the field correctAnswer\');\n return false;\n }\n }\n return true;\n };\n if (!validateQuiz(quiz)) {\n return null;\n }\n var appLocale = Quiz_objectSpread(Quiz_objectSpread({}, Locale), quiz.appLocale);\n return /*#__PURE__*/react.createElement("div", {\n className: "react-quiz-container"\n }, !start && /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("h2", null, quiz.quizTitle), /*#__PURE__*/react.createElement("div", null, appLocale.landingHeaderText.replace(\'\', nrOfQuestions)), quiz.quizSynopsis && /*#__PURE__*/react.createElement("div", {\n className: "quiz-synopsis"\n }, quiz.quizSynopsis), /*#__PURE__*/react.createElement("div", {\n className: "startQuizWrapper"\n }, /*#__PURE__*/react.createElement("button", {\n type: "button",\n onClick: function onClick() {\n return setStart(true);\n },\n className: "startQuizBtn btn"\n }, appLocale.startQuizBtn))), start && /*#__PURE__*/react.createElement(lib_Core, {\n questions: questions,\n showDefaultResult: showDefaultResult,\n onComplete: onComplete,\n customResultPage: customResultPage,\n showInstantFeedback: showInstantFeedback,\n continueTillCorrect: continueTillCorrect,\n revealAnswerOnSubmit: revealAnswerOnSubmit,\n allowNavigation: allowNavigation,\n appLocale: appLocale,\n onQuestionSubmit: onQuestionSubmit,\n timer: timer,\n allowPauseTimer: allowPauseTimer\n }));\n}\n/* harmony default export */ const lib_Quiz = (Quiz);\n;// CONCATENATED MODULE: ./src/docs/quiz.jsx\nvar segment = {\n basic: \'Basic\',\n medium: \'Medium\',\n advanced: \'Advanced\'\n};\nvar quiz = {\n quizTitle: \'React Quiz Component Demo\',\n quizSynopsis: \'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim\',\n nrOfQuestions: \'6\',\n questions: [{\n question: \'How can you access the state of a component from inside of a member function?\',\n questionPic: \'https://dummyimage.com/600x400/000/fff&text=X\',\n questionType: \'text\',\n answerSelectionType: \'single\',\n answers: [\'this.getState()\', \'this.prototype.stateValue\', \'this.state\', \'this.values\'],\n correctAnswer: \'3\',\n messageForCorrectAnswer: \'Correct answer. Good job.\',\n messageForIncorrectAnswer: \'Incorrect answer. Please try again.\',\n explanation: \'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\',\n point: \'20\',\n segment: segment.advanced\n }, {\n question: \'ReactJS is developed by ?\',\n questionType: \'text\',\n answerSelectionType: \'single\',\n answers: [\'Google Engineers\', \'Facebook Engineers\'],\n correctAnswer: \'2\',\n messageForCorrectAnswer: \'Correct answer. Good job.\',\n messageForIncorrectAnswer: \'Incorrect answer. Please try again.\',\n explanation: \'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\',\n point: \'20\',\n segment: segment.basic\n }, {\n question: \'ReactJS is an MVC based framework?\',\n questionType: \'text\',\n answerSelectionType: \'single\',\n answers: [\'True\', \'False\'],\n correctAnswer: \'2\',\n messageForCorrectAnswer: \'Correct answer. Good job.\',\n messageForIncorrectAnswer: \'Incorrect answer. Please try again.\',\n explanation: \'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\',\n point: \'10\'\n }, {\n question: \'Which of the following concepts is/are key to ReactJS?\',\n questionType: \'text\',\n answerSelectionType: \'single\',\n answers: [\'Component-oriented design\', \'Event delegation model\', \'Both of the above\'],\n correctAnswer: \'3\',\n messageForCorrectAnswer: \'Correct answer. Good job.\',\n messageForIncorrectAnswer: \'Incorrect answer. Please try again.\',\n explanation: \'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\',\n point: \'30\',\n segment: segment.medium\n }, {\n question: \'How does the initial page of any react project looks like if we create the project using vite\',\n questionType: \'photo\',\n answerSelectionType: \'single\',\n answers: [\'https://github.com/wingkwong/react-quiz-component/assets/35857179/e169cd44-13a7-4301-9d30-6c0859d3ac35\', \'https://github.com/wingkwong/react-quiz-component/assets/35857179/30b4aa3d-2523-4d73-9e3b-27ce44ffd50a\', \'https://github.com/wingkwong/react-quiz-component/assets/35857179/64da0348-30b7-4a13-9fea-791537c49109\', \'https://github.com/wingkwong/react-quiz-component/assets/35857179/660e9255-8a16-4e0f-a7e4-81ba6ac0f9bc\'],\n correctAnswer: \'1\',\n messageForCorrectAnswer: \'Correct answer. Good job.\',\n messageForIncorrectAnswer: \'Incorrect answer. Please try again.\',\n explanation: \'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\',\n point: \'20\'\n }, {\n question: \'What are the advantages of React JS?\',\n questionType: \'text\',\n answerSelectionType: \'multiple\',\n answers: [\'React can be used on client and as well as server side too\', \'Using React increases readability and makes maintainability easier. Component, Data patterns improves readability and thus makes it easier for manitaining larger apps\', \'React components have lifecycle events that fall into State/Property Updates\', \'React can be used with any other framework (Backbone.js, Angular.js) as it is only a view layer\'],\n correctAnswer: [1, 2, 4],\n messageForCorrectAnswer: \'Correct answer. Good job.\',\n messageForIncorrectAnswer: \'Incorrect answer. Please try again.\',\n explanation: \'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\',\n point: \'20\'\n }]\n};\n/* harmony default export */ const docs_quiz = (quiz);\n;// CONCATENATED MODULE: ./src/docs/index.jsx\nfunction docs_slicedToArray(arr, i) { return docs_arrayWithHoles(arr) || docs_iterableToArrayLimit(arr, i) || docs_unsupportedIterableToArray(arr, i) || docs_nonIterableRest(); }\nfunction docs_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction docs_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return docs_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return docs_arrayLikeToArray(o, minLen); }\nfunction docs_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction docs_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction docs_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\n\nvar container = document.getElementById(\'app\');\nvar root = (0,client/* createRoot */.s)(container);\nfunction App() {\n var _useState = (0,react.useState)(),\n _useState2 = docs_slicedToArray(_useState, 2),\n quizResult = _useState2[0],\n setQuizResult = _useState2[1];\n return /*#__PURE__*/react.createElement("div", {\n style: {\n margin: \'auto\',\n width: \'500px\'\n }\n }, /*#__PURE__*/react.createElement(lib_Quiz, {\n quiz: docs_quiz,\n shuffle: true,\n shuffleAnswer: true,\n showInstantFeedback: true\n // continueTillCorrect\n ,\n onComplete: setQuizResult,\n onQuestionSubmit: function onQuestionSubmit(obj) {\n return console.log(\'user question results:\', obj);\n },\n disableSynopsis: true,\n timer: 60,\n allowPauseTimer: true\n }));\n}\nroot.render( /*#__PURE__*/react.createElement(App, null));//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDEyLmpzIiwibWFwcGluZ3MiOiI7Ozs7OztBQUFBO0FBQ0E7QUFDQTtBQUNBOztBQ0hBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUNqQkE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQ2hDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7Ozs7OztBQzVCQTtBQUVBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7QUFBQTtBQUFBO0FBQUE7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFFQTtBQ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xhYmVsbGVkYnk9XCJxdWl6LWZpbHRlclwiXG4gICAgICAgID5cbiAgICAgICAgICA8ZGl2XG4gICAgICAgICAgICBjbGFzc05hbWU9e2Bkcm9wZG93bi1vcHRpb25zLWl0ZW0gJHtcbiAgICAgICAgICAgICAgZmlsdGVyZWRWYWx1ZSA9PT0gJ2FsbCcgPyAnc2VsZWN0ZWQnIDogJydcbiAgICAgICAgICAgIH1gfVxuICAgICAgICAgICAgb25DbGljaz17KCkgPT4gaGFuZGxlT3B0aW9uQ2xpY2soJ2FsbCcpfVxuICAgICAgICAgICAgb25LZXlEb3duPXsoZSkgPT4ge1xuICAgICAgICAgICAgICBpZiAoZS5rZXkgPT09ICdFbnRlcicpIHtcbiAgICAgICAgICAgICAgICBoYW5kbGVPcHRpb25DbGljaygnYWxsJyk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH19XG4gICAgICAgICAgICByb2xlPVwibWVudWl0ZW1cIlxuICAgICAgICAgICAgdGFiSW5kZXg9ezB9XG4gICAgICAgICAgPlxuICAgICAgICAgICAge2FwcExvY2FsZS5yZXN1bHRGaWx0ZXJBbGx9XG4gICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgPGRpdlxuICAgICAgICAgICAgY2xhc3NOYW1lPXtgZHJvcGRvd24tb3B0aW9ucy1pdGVtICR7XG4gICAgICAgICAgICAgIGZpbHRlcmVkVmFsdWUgPT09ICdjb3JyZWN0JyA/ICdzZWxlY3RlZCcgOiAnJ1xuICAgICAgICAgICAgfWB9XG4gICAgICAgICAgICBvbkNsaWNrPXsoKSA9PiBoYW5kbGVPcHRpb25DbGljaygnY29ycmVjdCcpfVxuICAgICAgICAgICAgb25LZXlEb3duPXsoZSkgPT4ge1xuICAgICAgICAgICAgICBpZiAoZS5rZXkgPT09ICdFbnRlcicpIHtcbiAgICAgICAgICAgICAgICBoYW5kbGVPcHRpb25DbGljaygnY29ycmVjdCcpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9fVxuICAgICAgICAgICAgcm9sZT1cIm1lbnVpdGVtXCJcbiAgICAgICAgICAgIHRhYkluZGV4PXswfVxuICAgICAgICAgID5cbiAgICAgICAgICAgIHthcHBMb2NhbGUucmVzdWx0RmlsdGVyQ29ycmVjdH1cbiAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICA8ZGl2XG4gICAgICAgICAgICBjbGFzc05hbWU9e2Bkcm9wZG93bi1vcHRpb25zLWl0ZW0gJHtcbiAgICAgICAgICAgICAgZmlsdGVyZWRWYWx1ZSA9PT0gJ2luY29ycmVjdCcgPyAnc2VsZWN0ZWQnIDogJydcbiAgICAgICAgICAgIH1gfVxuICAgICAgICAgICAgb25DbGljaz17KCkgPT4gaGFuZGxlT3B0aW9uQ2xpY2soJ2luY29ycmVjdCcpfVxuICAgICAgICAgICAgb25LZXlEb3duPXsoZSkgPT4ge1xuICAgICAgICAgICAgICBpZiAoZS5rZXkgPT09ICdFbnRlcicpIHtcbiAgICAgICAgICAgICAgICBoYW5kbGVPcHRpb25DbGljaygnaW5jb3JyZWN0Jyk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH19XG4gICAgICAgICAgICByb2xlPVwibWVudWl0ZW1cIlxuICAgICAgICAgICAgdGFiSW5kZXg9ezB9XG4gICAgICAgICAgPlxuICAgICAgICAgICAge2FwcExvY2FsZS5yZXN1bHRGaWx0ZXJJbmNvcnJlY3R9XG4gICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgPGRpdlxuICAgICAgICAgICAgY2xhc3NOYW1lPXtgZHJvcGRvd24tb3B0aW9ucy1pdGVtICR7XG4gICAgICAgICAgICAgIGZpbHRlcmVkVmFsdWUgPT09ICd1bmFuc3dlcmVkJyA/ICdzZWxlY3RlZCcgOiAnJ1xuICAgICAgICAgICAgfWB9XG4gICAgICAgICAgICBvbkNsaWNrPXsoKSA9PiBoYW5kbGVPcHRpb25DbGljaygndW5hbnN3ZXJlZCcpfVxuICAgICAgICAgICAgb25LZXlEb3duP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JyZW50UXVlc3Rpb25JbmRleCkgPCAwKSB7XG4gICAgICAgIGluY29ycmVjdC5wdXNoKGN1cnJlbnRRdWVzdGlvbkluZGV4KTtcbiAgICAgIH1cblxuICAgICAgaWYgKGNvbnRpbnVlVGlsbENvcnJlY3QpIHtcbiAgICAgICAgc2V0QnV0dG9ucygocHJldlN0YXRlKSA9PiAoXG4gICAgICAgICAge1xuXG4gICAgICAgICAgICAuLi5wcmV2U3RhdGUsXG4gICAgICAgICAgICBbaW5kZXggLSAxXToge1xuICAgICAgICAgICAgICBkaXNhYmxlZDogIXByZXZTdGF0ZVtpbmRleCAtIDFdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICB9XG4gICAgICAgICkpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgc2V0QnV0dG9ucygocHJldlN0YXRlKSA9PiAoXG4gICAgICAgICAge1xuXG4gICAgICAgICAgICAuLi5wcmV2U3RhdGUsXG4gICAgICAgICAgICAuLi5kaXNhYmxlZEFsbCxcbiAgICAgICAgICAgIFtpbmRleCAtIDFdOiB7XG4gICAgICAgICAgICAgIGNsYXNzTmFtZTogKGluZGV4U3RyID09PSBjb3JyZWN0QW5zd2VyKSA/ICdjb3JyZWN0JyA6ICdpbmNvcnJlY3QnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICB9XG4gICAgICAgICkpO1xuXG4gICAgICAgIHNldFNob3dOZXh0UXVlc3Rpb25CdXR0b24odHJ1ZSk7XG4gICAgICB9XG5cbiAgICAgIHNldEluY29ycmVjdEFuc3dlcih0cnVlKTtcbiAgICAgIHNldElzQ29ycmVjdChmYWxzZSk7XG4gICAgICBzZXRJbmNvcnJlY3QoaW5jb3JyZWN0KTtcbiAgICB9XG4gIH0gZWxzZSB7XG4gICAgY29uc3QgbWF4TnVtYmVyT2ZNdWx0aXBsZVNlbGVjdGlvbiA9IGNvcnJlY3RBbnN3ZXIubGVuZ3RoO1xuXG4gICAgaWYgKHVzZXJJbnB1dENvcHlbY3Vyc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GluY29ycmVjdC5pbmRleE9mKGN1cnJlbnRRdWVzdGlvbkluZGV4KSA8IDApIHtcbiAgICAgICAgICAgIGluY29ycmVjdC5wdXNoKGN1cnJlbnRRdWVzdGlvbkluZGV4KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGNvcnJlY3QuaW5kZXhPZihjdXJyZW50UXVlc3Rpb25JbmRleCkgPj0gMCkge1xuICAgICAgICAgICAgY29ycmVjdC5zcGxpY2UoY29ycmVjdC5pbmRleE9mKGN1cnJlbnRRdWVzdGlvbkluZGV4KSwgMSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAoZXhhY3RNYXRjaCkge1xuICAgICAgICBpZiAoY29ycmVjdC5pbmRleE9mKGN1cnJlbnRRdWVzdGlvbkluZGV4KSA8IDApIHtcbiAgICAgICAgICBjb3JyZWN0LnB1c2goY3VycmVudFF1ZXN0aW9uSW5kZXgpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChpbmNvcnJlY3QuaW5kZXhPZihjdXJyZW50UXVlc3Rpb25JbmRleCkgPj0gMCkge1xuICAgICAgICAgIGluY29ycmVjdC5zcGxpY2UoaW5jb3JyZWN0LmluZGV4T2YoY3VycmVudFF1ZXN0aW9uSW5kZXgpLCAxKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBpZiAoaW5jb3JyZWN0LmluZGV4T2YoY3VycmVudFF1ZXN0aW9uSW5kZXgpIDwgMCkge1xuICAgICAgICBpbmNvcnJlY3QucHVzaChjdXJyZW50UXVlc3Rpb25JbmRleCk7XG4gICAgICB9XG4gICAgICBpZiAoY29ycmVjdC5pbmRleE9mKGN1cnJlbnRRdWVzdGlvbkluZGV4KSA+PSAwKSB7XG4gICAgICAgIGNvcnJlY3Quc3BsaWNlKGNvcnJlY3QuaW5kZXhPZihjdXJyZW50UXVlc3Rpb25JbmRleCksIDEpO1xuICAg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AgICBzZXRFbmRRdWl6KHRydWUpO1xuICAgIGdldFVuYW5zd2VyZWRRdWVzdGlvbnMoKTtcbiAgfTtcblxuICByZXR1cm4gKFxuICAgIDxkaXYgY2xhc3NOYW1lPVwicXVlc3Rpb25XcmFwcGVyXCI+XG4gICAgICB7dGltZXIgJiYgIWlzUnVubmluZyAmJiAoXG4gICAgICAgIDxkaXY+XG4gICAgICAgICAge2FwcExvY2FsZS50aW1lclRpbWVUYWtlbn1cbiAgICAgICAgICA6XG4gICAgICAgICAgeycgJ31cbiAgICAgICAgICA8Yj57ZGlzcGxheVRpbWUodGltZXIgLSB0aW1lUmVtYWluaW5nKX08L2I+XG4gICAgICAgIDwvZGl2PlxuICAgICAgKX1cblxuICAgICAge3RpbWVyICYmIGlzUnVubmluZyAmJiAoXG4gICAgICAgIDxkaXY+XG4gICAgICAgICAge2FwcExvY2FsZS50aW1lclRpbWVSZW1haW5pbmd9XG4gICAgICAgICAgOlxuICAgICAgICAgIHsnICd9XG4gICAgICAgICAgPGI+XG4gICAgICAgICAgICB7ZGlzcGxheVRpbWUodGltZVJlbWFpbmluZyl9XG4gICAgICAgICAgPC9iPlxuICAgICAgICA8L2Rpdj5cbiAgICAgICl9XG4gICAgICB7dGltZXIgJiYgdGltZVJlbWFpbmluZyA9PT0gMCAmJiBpc1J1bm5pbmcgJiYgaGFuZGxlVGltZVVwKCl9XG5cbiAgICAgIHshZW5kUXVpeiAmJiAoXG4gICAgICAgIDxkaXYgY2xhc3NOYW1lPVwicXVlc3Rpb25XcmFwcGVyQm9keVwiPlxuICAgICAgICAgIDxkaXY+XG4gICAgICAgICAgICB7YCR7YXBwTG9jYWxlLnF1ZXN0aW9ufSAke2N1cnJlbnRRdWVzdGlvbkluZGV4ICsgMX0gLyAke1xuICAgICAgICAgICAgICBxdWVzdGlvbnMubGVuZ3RoXG4gICAgICAgICAgICB9OmB9XG4gICAgICAgICAgICA8YnIgLz5cbiAgICAgICAgICAgIHt0aW1lciAmJiBhbGxvd1BhdXNlVGltZXIgJiYgKFxuICAgICAgICAgICAgICA8YnV0dG9uIHR5cGU9XCJidXR0b25cIiBjbGFzc05hbWU9XCJ0aW1lckJ0blwiIG9uQ2xpY2s9e3RvZ2dsZVRpbWVyfT5cbiAgICAgICAgICAgICAgICB7aXNSdW5uaW5nID8gYXBwTG9jYWxlLnBhdXNlU2NyZWVuUGF1c2UgOiBhcHBMb2NhbGUucGF1c2VTY3JlZW5SZXN1bWV9XG4gICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgKX1cbiAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICB7aXNSdW5uaW5nID8gKFxuICAgICAgICAgICAgPD5cbiAgICAgICAgICAgICAgPGgzXG4gICAgICAgICAgICAgICAgZGFuZ2Vyb3VzbHlTZXRJbm5lckhUTUw9e3Jhd01hcmt1cChcbiAgICAgICAgICAgICAgICAgIGAke1xuICAgICAgICAgICAgICAgICAgICBhY3RpdmVRdWVzdGlvbiAmJiBhY3RpdmVRdWVzdGlvbi5xdWVzdGlvblxuICAgICAgICAgICAgICAgICAgfSAke2FwcExvY2FsZS5tYXJrc09mUXVlc3Rpb24ucmVwbGFjZShcbiAgICAgICAgICAgICAgICAgICAgJzxtYXJrcz4nLFxuICAgICAgICAgICAgICAgICAgICBhY3RpdmVRdWVzdGlvbi5wb2ludCxcbiAgICAgICAgICAgICAgICAgICl9YCxcbiAgICAgICAgICAgICAgICApfVxuICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICB7YWN0aXZlUXVlc3Rpb24gJiYgYWN0aXZlUXVlc3Rpb24ucXVlc3Rpb25QaWMgJiYgKFxuICAgICAgICAgICAgICAgIDxpbWcgc3JjPXthY3RpdmVRdWVzdGlvbi5xdWVzdGlvblBpY30gYWx0PVwicXVlc3Rpb25cIiAvPlxuICAgICAgICAgICAgICApfVxuICAgICAgICAgICAgICB7YWN0aXZlUXVlc3Rpb25cbiAgICAgICAgICAgICAgICAmJiByZW5kZXJUYWdzKFxuICAgICAgICAgICAgICAgICAgYW5zd2VyU2VsZWN0aW9uVHlwZVN0YXRlLFxuICAgICAgICAgICAgICAgICAgYWN0aXZlUXVlc3Rpb24uY29ycmVjdEFuc3dlci5sZW5ndGgsXG4gICAgICAgICAgICAgICAgICBhY3RpdmVRdWVzdGlvbi5zZWdtZW50LFxuICAgICAgICAgICAgICAgICl9XG4gICAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPVwicXVlc3Rpb25Nb2RhbFwiPlxuICAgICAgICAgICAgICAgIDxJbnN0YW50RmVlZGJhY2tcbiAgICAgICAgICAgICAgICAgIHF1ZXN0aW9uPXthY3RpdmVRdWVzdGlvbn1cbiAgICAgICAgICAgICAgICAgIHNob3dJbnN0YW50RmVlZGJhY2s9e3Nob3dJbnN0YW50RmVlZGJhY2t9XG4gICAgICAgICAgICAgICAgICBjb3JyZWN0QW5zd2VyPXtpc0NvcnJlY3R9XG4gICAgICAgICAgICAgICAgICBpbmNvcnJlY3RBbnN3ZXI9e2luY29ycmVjdEFuc3dlcn1cbiAgICAgICAgICAgICAgICAgIG9uUXVlc3Rpb25TdWJtaXQ9e29uUXVlc3Rpb25TdWJtaXR9XG4gICAgICAgICAgICAgICAgICB1c2VyQW5zd2VyPXtbLi4udXNlcklucHV0XS5wb3AoKX1cbiAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAge2FjdGl2ZVF1ZXN0aW9uICYmIHJlbmRlckFuc3dlcnMoYWN0aXZlUXVlc3Rpb24sIGJ1dHRvbnMpfVxuICAgICAgICAgICAgICB7KHNob3dOZXh0UXVlc3Rpb25CdXR0b24gfHwgYWxsb3dOYXZpZ2F0aW9uKSAmJiAoXG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9XCJxdWVzdGlvbkJ0bkNvbnRhaW5lclwiPlxuICAgICAgICAgICAgICAgICAge2FsbG93TmF2aWdhdGlvbiAmJiBjdXJyZW50UXVlc3Rpb25JbmRleCA+IDAgJiYgKFxuICAgICAgICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgICAgICAgb25DbGljaz17KCkgPT4gbmV4dFF1ZXN0aW9uKGN1cnJlbnRRdWVzdGlvbkluZGV4IC0gMil9XG4gICAgICAgICAgICAgICAgICAgICAgY2xhc3NOYW1lPVwicHJldlF1ZXN0aW9uQnRuIGJ0blwiXG4gICAgICAgICAgICAgICAgICAgICAgdHlwZT1cImJ1dHRvblwiXG4gICAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgICB7YXBwTG9jYWxlLnByZXZRdWVzdGlvbkJ0bn1cbiAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgICAgICAgICAgICApfVxuXG4gICAgICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s9eygpID0+IG5leHRRdWVzdGlvbihjdXJyZW50UXVlc3Rpb25JbmRleCl9XG4gICAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZT1cIm5leHRRdWVzdGlvbkJ0biBidG5cIlxuICAgICAgICAgICAgICAgICAgICB0eXBlPVwiYnV0dG9uXCJcbiAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAge2FwcExvY2FsZS5uZXh0UXVlc3Rpb25CdG59XG4gICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgKX1cbiAgICAgICAgICAgIDwvPlxuICAgICAgICAgICkgOiAoXG4gICAgICAgICAgICA8c3BhbiBjbGFzc05hbWU9XCJ0aW1lclBhdXNlU2NyZWVuIGRhcms6dGV4dC13aGl0ZSB0ZXh0LWJsYWNrXCI+XG4gICAgICAgICAgICAgIDxiciAvPlxuICAgICAgICAgICAgICA8YnIgLz5cbiAgICAgICAgICAgICAge2FwcExvY2FsZS5wYXVzZVNjcmVlbkRpc3BsYXl9X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ICAgfVxuICAgIH1cblxuICAgIHJldHVybiB0cnVlO1xuICB9O1xuXG4gIGlmICghdmFsaWRhdGVRdWl6KHF1aXopKSB7XG4gICAgcmV0dXJuIG51bGw7XG4gIH1cblxuICBjb25zdCBhcHBMb2NhbGUgPSB7XG4gICAgLi4uZGVmYXVsdExvY2FsZSxcbiAgICAuLi5xdWl6LmFwcExvY2FsZSxcbiAgfTtcblxuICByZXR1cm4gKFxuICAgIDxkaXYgY2xhc3NOYW1lPVwicmVhY3QtcXVpei1jb250YWluZXJcIj5cbiAgICAgIHshc3RhcnQgJiYgKFxuICAgICAgICA8ZGl2PlxuICAgICAgICAgIDxoMj57cXVpei5xdWl6VGl0bGV9PC9oMj5cbiAgICAgICAgICA8ZGl2PlxuICAgICAgICAgICAge2FwcExvY2FsZS5sYW5kaW5nSGVhZGVyVGV4dC5yZXBsYWNlKFxuICAgICAgICAgICAgICAnPHF1ZXN0aW9uTGVuZ3RoPicsXG4gICAgICAgICAgICAgIG5yT2ZRdWVzdGlvbnMsXG4gICAgICAgICAgICApfVxuICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgIHtxdWl6LnF1aXpTeW5vcHNpcyAmJiAoXG4gICAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cInF1aXotc3lub3BzaXNcIj57cXVpei5xdWl6U3lub3BzaXN9PC9kaXY+XG4gICAgICAgICAgKX1cbiAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cInN0YXJ0UXVpeldyYXBwZXJcIj5cbiAgICAgICAgICAgIDxidXR0b24gdHlwZT1cImJ1dHRvblwiIG9uQ2xpY2s9eygpID0+IHNldFN0YXJ0KHRydWUpfSBjbGFzc05hbWU9XCJzdGFydFF1aXpCdG4gYnRuXCI+XG4gICAgICAgICAgICAgIHthcHBMb2NhbGUuc3RhcnRRdWl6QnRufVxuICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgICAgPC9kaXY+XG4gICAgICAgIDwvZGl2PlxuICAgICAgKX1cblxu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5SWQoJ2FwcCcpO1xuY29uc3Qgcm9vdCA9IGNyZWF0ZVJvb3QoY29udGFpbmVyKTtcblxuZnVuY3Rpb24gQXBwKCkge1xuICBjb25zdCBbcXVpelJlc3VsdCwgc2V0UXVpelJlc3VsdF0gPSB1c2VTdGF0ZSgpO1xuXG4gIHJldHVybiAoXG4gICAgPGRpdiBzdHlsZT17eyBtYXJnaW46ICdhdXRvJywgd2lkdGg6ICc1MDBweCcgfX0+XG4gICAgICA8UXVpelxuICAgICAgICBxdWl6PXtxdWl6fVxuICAgICAgICBzaHVmZmxlXG4gICAgICAgIHNodWZmbGVBbnN3ZXJcbiAgICAgICAgc2hvd0luc3RhbnRGZWVkYmFja1xuICAgICAgLy8gY29udGludWVUaWxsQ29ycmVjdFxuICAgICAgICBvbkNvbXBsZXRlPXtzZXRRdWl6UmVzdWx0fVxuICAgICAgICBvblF1ZXN0aW9uU3VibWl0PXsob2JqKSA9PiBjb25zb2xlLmxvZygndXNlciBxdWVzdGlvbiByZXN1bHRzOicsIG9iail9XG4gICAgICAgIGRpc2FibGVTeW5vcHNpc1xuICAgICAgICB0aW1lcj17NjB9XG4gICAgICAgIGFsbG93UGF1c2VUaW1lclxuICAgICAgLz5cbiAgICA8L2Rpdj5cbiAgKTtcbn1cblxucm9vdC5yZW5kZXIoPEFwcCAvPik7XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///412\n')},856:function(module){eval("/*! @license DOMPurify 3.0.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.8/LICENSE */\n\n(function (global, factory) {\n true ? module.exports = factory() :\n 0;\n})(this, (function () { 'use strict';\n\n const {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor\n } = Object;\n let {\n freeze,\n seal,\n create\n } = Object; // eslint-disable-line import/no-mutable-exports\n let {\n apply,\n construct\n } = typeof Reflect !== 'undefined' && Reflect;\n if (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n }\n if (!seal) {\n seal = function seal(x) {\n return x;\n };\n }\n if (!apply) {\n apply = function apply(fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n }\n if (!construct) {\n construct = function construct(Func, args) {\n return new Func(...args);\n };\n }\n const arrayForEach = unapply(Array.prototype.forEach);\n const arrayPop = unapply(Array.prototype.pop);\n const arrayPush = unapply(Array.prototype.push);\n const stringToLowerCase = unapply(String.prototype.toLowerCase);\n const stringToString = unapply(String.prototype.toString);\n const stringMatch = unapply(String.prototype.match);\n const stringReplace = unapply(String.prototype.replace);\n const stringIndexOf = unapply(String.prototype.indexOf);\n const stringTrim = unapply(String.prototype.trim);\n const regExpTest = unapply(RegExp.prototype.test);\n const typeErrorCreate = unconstruct(TypeError);\n\n /**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param {Function} func - The function to be wrapped and called.\n * @returns {Function} A new function that calls the given function with a specified thisArg and arguments.\n */\n function unapply(func) {\n return function (thisArg) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return apply(func, thisArg, args);\n };\n }\n\n /**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param {Function} func - The constructor function to be wrapped and called.\n * @returns {Function} A new function that constructs an instance of the given constructor function with the provided arguments.\n */\n function unconstruct(func) {\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return construct(func, args);\n };\n }\n\n /**\n * Add properties to a lookup table\n *\n * @param {Object} set - The set to which elements will be added.\n * @param {Array} array - The array containing elements to be added to the set.\n * @param {Function} transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns {Object} The modified set with added elements.\n */\n function addToSet(set, array) {\n let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n element = lcElement;\n }\n }\n set[element] = true;\n }\n return set;\n }\n\n /**\n * Clean up an array to harden against CSPP\n *\n * @param {Array} array - The array to be cleaned.\n * @returns {Array} The cleaned version of the array\n */\n function cleanArray(array) {\n for (let index = 0; index < array.length; index++) {\n if (getOwnPropertyDescriptor(array, index) === undefined) {\n array[index] = null;\n }\n }\n return array;\n }\n\n /**\n * Shallow clone an object\n *\n * @param {Object} object - The object to be cloned.\n * @returns {Object} A new object that copies the original.\n */\n function clone(object) {\n const newObject = create(null);\n for (const [property, value] of entries(object)) {\n if (getOwnPropertyDescriptor(object, property) !== undefined) {\n if (Array.isArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (value && typeof value === 'object' && value.constructor === Object) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n return newObject;\n }\n\n /**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param {Object} object - The object to look up the getter function in its prototype chain.\n * @param {String} prop - The property name for which to find the getter function.\n * @returns {Function} The getter function found in the prototype chain or a fallback function.\n */\n function lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n object = getPrototypeOf(object);\n }\n function fallbackValue(element) {\n console.warn('fallback value for', element);\n return null;\n }\n return fallbackValue;\n }\n\n const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\n\n // SVG\n const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\n const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);\n\n // List of SVG elements that are disallowed by default.\n // We still need to know them so that we can do namespace\n // checks properly in case one wants to add them to\n // allow-list.\n const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\n const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);\n\n // Similarly to SVG, we want to know all MathML elements,\n // even those that we disallow by default.\n const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\n const text = freeze(['#text']);\n\n const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns', 'slot']);\n const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\n const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\n const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n // eslint-disable-next-line unicorn/better-regex\n const MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\n const ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\n const TMPLIT_EXPR = seal(/\\${[\\w\\W]*}/gm);\n const DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\n const ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\n const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n );\n\n const IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\n const ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n );\n\n const DOCTYPE_NAME = seal(/^html$/i);\n\n var EXPRESSIONS = /*#__PURE__*/Object.freeze({\n __proto__: null,\n MUSTACHE_EXPR: MUSTACHE_EXPR,\n ERB_EXPR: ERB_EXPR,\n TMPLIT_EXPR: TMPLIT_EXPR,\n DATA_ATTR: DATA_ATTR,\n ARIA_ATTR: ARIA_ATTR,\n IS_ALLOWED_URI: IS_ALLOWED_URI,\n IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE: ATTR_WHITESPACE,\n DOCTYPE_NAME: DOCTYPE_NAME\n });\n\n const getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n };\n\n /**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\n const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n }\n\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n }\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n };\n function createDOMPurify() {\n let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n const DOMPurify = root => createDOMPurify(root);\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n DOMPurify.version = '3.0.8';\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n DOMPurify.removed = [];\n if (!window || !window.document || window.document.nodeType !== 9) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n return DOMPurify;\n }\n let {\n document\n } = window;\n const originalDocument = document;\n const currentScript = originalDocument.currentScript;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes\n } = window;\n const ElementPrototype = Element.prototype;\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n let trustedTypesPolicy;\n let emptyHTML = '';\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName\n } = document;\n const {\n importNode\n } = originalDocument;\n let hooks = {};\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE\n } = EXPRESSIONS;\n let {\n IS_ALLOWED_URI: IS_ALLOWED_URI$1\n } = EXPRESSIONS;\n\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);\n\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);\n\n /*\n * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false\n }\n }));\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n\n /* Decide if document with ... should be returned */\n let WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, ['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']);\n\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc = null;\n\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n const formElement = document.createElement('form');\n const isRegexOrFunction = function isRegexOrFunction(testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function _parseConfig() {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n\n /* Set configuration parameters */\n ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = 'ALLOWED_NAMESPACES' in cfg ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES),\n // eslint-disable-line indent\n cfg.ADD_URI_SAFE_ATTR,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS),\n // eslint-disable-line indent\n cfg.ADD_DATA_URI_TAGS,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = 'FORBID_CONTENTS' in cfg ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};\n FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};\n USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, text);\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html$1);\n addToSet(ALLOWED_ATTR, html);\n }\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg$1);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl$1);\n addToSet(ALLOWED_ATTR, mathMl);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');\n }\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');\n }\n\n // Overwrite existing TrustedTypes policy.\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\n // Sign local variables required by `sanitize`.\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n }\n\n // If creating the internal policy succeeded sign internal variables.\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n CONFIG = cfg;\n };\n const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n const HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'desc', 'title', 'annotation-xml']);\n\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);\n const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n\n /**\n * @param {Element} element a DOM element whose namespace is being checked\n * @returns {boolean} Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function _checkValidNamespace(element) {\n let parent = getParentNode(element);\n\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template'\n };\n }\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n }\n\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n\n // The only way to switch from SVG to MathML is via\n // and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n }\n\n // For XHTML and XML documents that support custom namespaces\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {\n return true;\n }\n\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n\n /**\n * _forceRemove\n *\n * @param {Node} node a DOM node\n */\n const _forceRemove = function _forceRemove(node) {\n arrayPush(DOMPurify.removed, {\n element: node\n });\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n node.parentNode.removeChild(node);\n } catch (_) {\n node.remove();\n }\n };\n\n /**\n * _removeAttribute\n *\n * @param {String} name an Attribute name\n * @param {Node} node a DOM node\n */\n const _removeAttribute = function _removeAttribute(name, node) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: node.getAttributeNode(name),\n from: node\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: node\n });\n }\n node.removeAttribute(name);\n\n // We void attribute values for unremovable \"is\"\" attributes\n if (name === 'is' && !ALLOWED_ATTR[name]) {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(node);\n } catch (_) {}\n } else {\n try {\n node.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n\n /**\n * _initDocument\n *\n * @param {String} dirty a string of dirty markup\n * @return {Document} a DOM, filled with the dirty markup\n */\n const _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n if (FORCE_BODY) {\n dirty = '' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty = '' + dirty + '';\n }\n const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n const body = doc.body || doc.documentElement;\n if (dirty && leadingWhitespace) {\n body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n }\n\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n }\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param {Node} root The root element or node to start traversing on.\n * @return {NodeIterator} The created NodeIterator\n */\n const _createNodeIterator = function _createNodeIterator(root) {\n return createNodeIterator.call(root.ownerDocument || root, root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, null);\n };\n\n /**\n * _isClobbered\n *\n * @param {Node} elm element to check for clobbering attacks\n * @return {Boolean} true if clobbered, false if safe\n */\n const _isClobbered = function _isClobbered(elm) {\n return elm instanceof HTMLFormElement && (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function');\n };\n\n /**\n * Checks whether the given object is a DOM node.\n *\n * @param {Node} object object to check whether it's a DOM node\n * @return {Boolean} true is object is a DOM node\n */\n const _isNode = function _isNode(object) {\n return typeof Node === 'function' && object instanceof Node;\n };\n\n /**\n * _executeHook\n * Execute user configurable hooks\n *\n * @param {String} entryPoint Name of the hook's entry point\n * @param {Node} currentNode node to work on with the hook\n * @param {Object} data additional hook parameters\n */\n const _executeHook = function _executeHook(entryPoint, currentNode, data) {\n if (!hooks[entryPoint]) {\n return;\n }\n arrayForEach(hooks[entryPoint], hook => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n };\n\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n *\n * @param {Node} currentNode to check for permission to exist\n * @return {Boolean} true if node was killed, false if left alive\n */\n const _sanitizeElements = function _sanitizeElements(currentNode) {\n let content = null;\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeElements', currentNode, null);\n\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(currentNode.nodeName);\n\n /* Execute a hook if present */\n _executeHook('uponSanitizeElement', currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS\n });\n\n /* Detect mXSS attempts abusing namespace confusion */\n if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\\w]/g, currentNode.innerHTML) && regExpTest(/<[/\\w]/g, currentNode.textContent)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {\n return false;\n }\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {\n return false;\n }\n }\n\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n for (let i = childCount - 1; i >= 0; --i) {\n parentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));\n }\n }\n }\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {\n /* Get the element's text content */\n content = currentNode.textContent;\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n content = stringReplace(content, expr, ' ');\n });\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, {\n element: currentNode.cloneNode()\n });\n currentNode.textContent = content;\n }\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeElements', currentNode, null);\n return false;\n };\n\n /**\n * _isValidAttribute\n *\n * @param {string} lcTag Lowercase tag name of containing element.\n * @param {string} lcName Lowercase attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n return false;\n }\n\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {\n return false;\n } else ;\n return true;\n };\n\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param {string} tagName name of the tag of the node to sanitize\n * @returns {boolean} Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n return tagName.indexOf('-') > 0;\n };\n\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param {Node} currentNode to sanitize\n */\n const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n /* Execute a hook if present */\n _executeHook('beforeSanitizeAttributes', currentNode, null);\n const {\n attributes\n } = currentNode;\n\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes) {\n return;\n }\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR\n };\n let l = attributes.length;\n\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const {\n name,\n namespaceURI,\n value: attrValue\n } = attr;\n const lcName = transformCaseFunc(name);\n let value = name === 'value' ? attrValue : stringTrim(attrValue);\n\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n value = hookEvent.attrValue;\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n\n /* Remove attribute */\n _removeAttribute(name, currentNode);\n\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n value = stringReplace(value, expr, ' ');\n });\n }\n\n /* Is `value` valid for this attribute? */\n const lcTag = transformCaseFunc(currentNode.nodeName);\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n\n /* Handle attributes that require Trusted Types */\n if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {\n if (namespaceURI) ; else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML':\n {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n case 'TrustedScriptURL':\n {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n }\n }\n }\n\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n arrayPop(DOMPurify.removed);\n } catch (_) {}\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeAttributes', currentNode, null);\n };\n\n /**\n * _sanitizeShadowDOM\n *\n * @param {DocumentFragment} fragment to iterate over recursively\n */\n const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeShadowDOM', fragment, null);\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHook('uponSanitizeShadowNode', shadowNode, null);\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(shadowNode)) {\n continue;\n }\n\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(shadowNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(shadowNode);\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeShadowDOM', fragment, null);\n };\n\n /**\n * Sanitize\n * Public method providing core sanitation functionality\n *\n * @param {String|Node} dirty string or DOM node\n * @param {Object} cfg object\n */\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty) {\n let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '\x3c!--\x3e';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if (dirty.nodeName) {\n const tagName = transformCaseFunc(dirty.nodeName);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('\x3c!----\x3e');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while (currentNode = nodeIterator.nextNode()) {\n /* Sanitize tags and elements */\n if (_sanitizeElements(currentNode)) {\n continue;\n }\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(currentNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(currentNode);\n }\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n return returnNode;\n }\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n /* Serialize doctype if allowed */\n if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {\n serializedHTML = '\\n' + serializedHTML;\n }\n\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n serializedHTML = stringReplace(serializedHTML, expr, ' ');\n });\n }\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;\n };\n\n /**\n * Public method to set the configuration once\n * setConfig\n *\n * @param {Object} cfg configuration object\n */\n DOMPurify.setConfig = function () {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n /**\n * Public method to remove the configuration\n * clearConfig\n *\n */\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n /**\n * Public method to check if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n * isValidAttribute\n *\n * @param {String} tag Tag name of containing element.\n * @param {String} attr Attribute name.\n * @param {String} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n */\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n /**\n * AddHook\n * Public method to add DOMPurify hooks\n *\n * @param {String} entryPoint entry point for the hook to add\n * @param {Function} hookFunction function to execute\n */\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n hooks[entryPoint] = hooks[entryPoint] || [];\n arrayPush(hooks[entryPoint], hookFunction);\n };\n\n /**\n * RemoveHook\n * Public method to remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if more are present)\n *\n * @param {String} entryPoint entry point for the hook to remove\n * @return {Function} removed(popped) hook\n */\n DOMPurify.removeHook = function (entryPoint) {\n if (hooks[entryPoint]) {\n return arrayPop(hooks[entryPoint]);\n }\n };\n\n /**\n * RemoveHooks\n * Public method to remove all DOMPurify hooks at a given entryPoint\n *\n * @param {String} entryPoint entry point for the hooks to remove\n */\n DOMPurify.removeHooks = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint] = [];\n }\n };\n\n /**\n * RemoveAllHooks\n * Public method to remove all DOMPurify hooks\n */\n DOMPurify.removeAllHooks = function () {\n hooks = {};\n };\n return DOMPurify;\n }\n var purify = createDOMPurify();\n\n return purify;\n\n}));\n//#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ByZWdFeHBUZXN0KC88XFwvbm8oc2NyaXB0fGVtYmVkfGZyYW1lcykvaSwgY3VycmVudE5vZGUuaW5uZXJIVE1MKSkge1xuICAgICAgICBfZm9yY2VSZW1vdmUoY3VycmVudE5vZGUpO1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cblxuICAgICAgLyogU2FuaXRpemUgZWxlbWVudCBjb250ZW50IHRvIGJlIHRlbXBsYXRlLXNhZmUgKi9cbiAgICAgIGlmIChTQUZFX0ZPUl9URU1QTEFURVMgJiYgY3VycmVudE5vZGUubm9kZVR5cGUgPT09IDMpIHtcbiAgICAgICAgLyogR2V0IHRoZSBlbGVtZW50J3MgdGV4dCBjb250ZW50ICovXG4gICAgICAgIGNvbnRlbnQgPSBjdXJyZW50Tm9kZS50ZXh0Q29udGVudDtcbiAgICAgICAgYXJyYXlGb3JFYWNoKFtNVVNUQUNIRV9FWFBSLCBFUkJfRVhQUiwgVE1QTElUX0VYUFJdLCBleHByID0+IHtcbiAgICAgICAgICBjb250ZW50ID0gc3RyaW5nUmVwbGFjZShjb250ZW50LCBleHByLCAnICcpO1xuICAgICAgICB9KTtcbiAgICAgICAgaWYgKGN1cnJlbnROb2RlLnRleHRDb250ZW50ICE9PSBjb250ZW50KSB7XG4gICAgICAgICAgYXJyYXlQdXNoKERPTVB1cmlmeS5yZW1vdmVkLCB7XG4gICAgICAgICAgICBlbGVtZW50OiBjdXJyZW50Tm9kZS5jbG9uZU5vZGUoKVxuICAgICAgICAgIH0pO1xuICAgICAgICAgIGN1cnJlbnROb2RlLnRleHRDb250ZW50ID0gY29udGVudDtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvKiBFeGVjdXRlIGEgaG9vayBpZiBwcmVzZW50ICovXG4gICAgICBfZXhlY3V0ZUhvb2soJ2FmdGVyU2FuaXRpemVFbGVtZW50cycsIGN1cnJlbnROb2RlLCBudWxsKTtcbiAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9O1xuXG4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iBhcnJheVBvcChob29rc1tlbnRyeVBvaW50XSk7XG4gICAgICB9XG4gICAgfTtcblxuICAgIC8qKlxuICAgICAqIFJlbW92ZUhvb2tzXG4gICAgICogUHVibGljIG1ldGhvZCB0byByZW1vdmUgYWxsIERPTVB1cmlmeSBob29rcyBhdCBhIGdpdmVuIGVudHJ5UG9pbnRcbiAgICAgKlxuICAgICAqIEBwYXJhbSAge1N0cmluZ30gZW50cnlQb2ludCBlbnRyeSBwb2ludCBmb3IgdGhlIGhvb2tzIHRvIHJlbW92ZVxuICAgICAqL1xuICAgIERPTVB1cmlmeS5yZW1vdmVIb29rcyA9IGZ1bmN0aW9uIChlbnRyeVBvaW50KSB7XG4gICAgICBpZiAoaG9va3NbZW50cnlQb2ludF0pIHtcbiAgICAgICAgaG9va3NbZW50cnlQb2ludF0gPSBbXTtcbiAgICAgIH1cbiAgICB9O1xuXG4gICAgLyoqXG4gICAgICogUmVtb3ZlQWxsSG9va3NcbiAgICAgKiBQdWJsaWMgbWV0aG9kIHRvIHJlbW92ZSBhbGwgRE9NUHVyaWZ5IGhvb2tzXG4gICAgICovXG4gICAgRE9NUHVyaWZ5LnJlbW92ZUFsbEhvb2tzID0gZnVuY3Rpb24gKCkge1xuICAgICAgaG9va3MgPSB7fTtcbiAgICB9O1xuICAgIHJldHVybiBET01QdXJpZnk7XG4gIH1cbiAgdmFyIHB1cmlmeSA9IGNyZWF0ZURPTVB1cmlmeSgpO1xuXG4gIHJldHVybiBwdXJpZnk7XG5cbn0pKTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXB1cmlmeS5qcy5tYXBcbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///856\n")},448:(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('/**\n * @license React\n * react-dom.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n/*\n Modernizr 3.0.0pre (Custom Build) | MIT\n*/\nvar aa=__webpack_require__(294),ca=__webpack_require__(840);function p(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;cb}return!1}function v(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var z={};\n"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){z[a]=new v(a,0,!1,a,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];z[b]=new v(b,1,!1,a[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){z[a]=new v(a,2,!1,a.toLowerCase(),null,!1,!1)});\n["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){z[a]=new v(a,2,!1,a,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){z[a]=new v(a,3,!1,a.toLowerCase(),null,!1,!1)});\n["checked","multiple","muted","selected"].forEach(function(a){z[a]=new v(a,3,!0,a,null,!1,!1)});["capture","download"].forEach(function(a){z[a]=new v(a,4,!1,a,null,!1,!1)});["cols","rows","size","span"].forEach(function(a){z[a]=new v(a,6,!1,a,null,!1,!1)});["rowSpan","start"].forEach(function(a){z[a]=new v(a,5,!1,a.toLowerCase(),null,!1,!1)});var ra=/[\\-:]([a-z])/g;function sa(a){return a[1].toUpperCase()}\n"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var b=a.replace(ra,\nsa);z[b]=new v(b,1,!1,a,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!1,!1)});\nz.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!0,!0)});\nfunction ta(a,b,c,d){var e=z.hasOwnProperty(b)?z[b]:null;if(null!==e?0!==e.type:d||!(2h||e[g]!==f[h]){var k="\\n"+e[g].replace(" at new "," at ");a.displayName&&k.includes("")&&(k=k.replace("",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{Na=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:"")?Ma(a):""}\nfunction Pa(a){switch(a.tag){case 5:return Ma(a.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return a=Oa(a.type,!1),a;case 11:return a=Oa(a.type.render,!1),a;case 1:return a=Oa(a.type,!0),a;default:return""}}\nfunction Qa(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case ya:return"Fragment";case wa:return"Portal";case Aa:return"Profiler";case za:return"StrictMode";case Ea:return"Suspense";case Fa:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case Ca:return(a.displayName||"Context")+".Consumer";case Ba:return(a._context.displayName||"Context")+".Provider";case Da:var b=a.render;a=a.displayName;a||(a=b.displayName||\nb.name||"",a=""!==a?"ForwardRef("+a+")":"ForwardRef");return a;case Ga:return b=a.displayName||null,null!==b?b:Qa(a.type)||"Memo";case Ha:b=a._payload;a=a._init;try{return Qa(a(b))}catch(c){}}return null}\nfunction Ra(a){var b=a.type;switch(a.tag){case 24:return"Cache";case 9:return(b.displayName||"Context")+".Consumer";case 10:return(b._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=b.render,a=a.displayName||a.name||"",b.displayName||(""!==a?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return b;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa(b);case 8:return b===za?"StrictMode":"Mode";case 22:return"Offscreen";\ncase 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof b)return b.displayName||b.name||null;if("string"===typeof b)return b}return null}function Sa(a){switch(typeof a){case "boolean":case "number":case "string":case "undefined":return a;case "object":return a;default:return""}}\nfunction Ta(a){var b=a.type;return(a=a.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===b||"radio"===b)}\nfunction Ua(a){var b=Ta(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=""+a[b];if(!a.hasOwnProperty(b)&&"undefined"!==typeof c&&"function"===typeof c.get&&"function"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=""+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=""+a},stopTracking:function(){a._valueTracker=\nnull;delete a[b]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d="";a&&(d=Ta(a)?a.checked?"true":"false":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}\nfunction Ya(a,b){var c=b.checked;return A({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?"":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:"checkbox"===b.type||"radio"===b.type?null!=b.checked:null!=b.value}}function ab(a,b){b=b.checked;null!=b&&ta(a,"checked",b,!1)}\nfunction bb(a,b){ab(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if("number"===d){if(0===c&&""===a.value||a.value!=c)a.value=""+c}else a.value!==""+c&&(a.value=""+c);else if("submit"===d||"reset"===d){a.removeAttribute("value");return}b.hasOwnProperty("value")?cb(a,b.type,c):b.hasOwnProperty("defaultValue")&&cb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}\nfunction db(a,b,c){if(b.hasOwnProperty("value")||b.hasOwnProperty("defaultValue")){var d=b.type;if(!("submit"!==d&&"reset"!==d||void 0!==b.value&&null!==b.value))return;b=""+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;""!==c&&(a.name="");a.defaultChecked=!!a._wrapperState.initialChecked;""!==c&&(a.name=c)}\nfunction cb(a,b,c){if("number"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+c&&(a.defaultValue=""+c)}var eb=Array.isArray;\nfunction fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e"+b.valueOf().toString()+"";for(b=mb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction ob(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}\nvar pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,\nzoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=["Webkit","ms","Moz","O"];Object.keys(pb).forEach(function(a){qb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);pb[b]=pb[a]})});function rb(a,b,c){return null==b||"boolean"===typeof b||""===b?"":c||"number"!==typeof b||0===b||pb.hasOwnProperty(a)&&pb[a]?(""+b).trim():b+"px"}\nfunction sb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--"),e=rb(c,b[c],d);"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e}}var tb=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});\nfunction ub(a,b){if(b){if(tb[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(p(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(p(60));if("object"!==typeof b.dangerouslySetInnerHTML||!("__html"in b.dangerouslySetInnerHTML))throw Error(p(61));}if(null!=b.style&&"object"!==typeof b.style)throw Error(p(62));}}\nfunction vb(a,b){if(-1===a.indexOf("-"))return"string"===typeof b.is;switch(a){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return!1;default:return!0}}var wb=null;function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null;\nfunction Bb(a){if(a=Cb(a)){if("function"!==typeof yb)throw Error(p(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;a>>=0;return 0===a?32:31-(pc(a)/qc|0)|0}var rc=64,sc=4194304;\nfunction tc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;\ndefault:return a}}function uc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=tc(h):(f&=g,0!==f&&(d=tc(f)))}else g=c&~e,0!==g?d=tc(g):0!==f&&(d=tc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&&(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0c;c++)b.push(a);return b}\nfunction Ac(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-oc(b);a[b]=c}function Bc(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0=be),ee=String.fromCharCode(32),fe=!1;\nfunction ge(a,b){switch(a){case "keyup":return-1!==$d.indexOf(b.keyCode);case "keydown":return 229!==b.keyCode;case "keypress":case "mousedown":case "focusout":return!0;default:return!1}}function he(a){a=a.detail;return"object"===typeof a&&"data"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case "compositionend":return he(b);case "keypress":if(32!==b.which)return null;fe=!0;return ee;case "textInput":return a=b.data,a===ee&&fe?null:a;default:return null}}\nfunction ke(a,b){if(ie)return"compositionend"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case "paste":return null;case "keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Je(c)}}function Le(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Le(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}\nfunction Me(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c="string"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Xa(a.document)}return b}function Ne(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)}\nfunction Oe(a){var b=Me(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Le(c.ownerDocument.documentElement,c)){if(null!==d&&Ne(c))if(b=d.start,a=d.end,void 0===a&&(a=b),"selectionStart"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Ke(c,f);var g=Ke(c,\nd);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});"function"===typeof c.focus&&c.focus();for(c=0;c=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;\nfunction Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,"selectionStart"in d&&Ne(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Ie(Se,d)||(Se=d,d=oe(Re,"onSelect"),0Tf||(a.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(a,b){Tf++;Sf[Tf]=a.current;a.current=b}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(a,b){var c=a.type.contextTypes;if(!c)return Vf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}\nfunction Zf(a){a=a.childContextTypes;return null!==a&&void 0!==a}function $f(){E(Wf);E(H)}function ag(a,b,c){if(H.current!==Vf)throw Error(p(168));G(H,b);G(Wf,c)}function bg(a,b,c){var d=a.stateNode;b=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(p(108,Ra(a)||"Unknown",e));return A({},c,d)}\nfunction cg(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Vf;Xf=H.current;G(H,a);G(Wf,Wf.current);return!0}function dg(a,b,c){var d=a.stateNode;if(!d)throw Error(p(169));c?(a=bg(a,b,Xf),d.__reactInternalMemoizedMergedChildContext=a,E(Wf),E(H),G(H,a)):E(Wf);G(Wf,c)}var eg=null,fg=!1,gg=!1;function hg(a){null===eg?eg=[a]:eg.push(a)}function ig(a){fg=!0;hg(a)}\nfunction jg(){if(!gg&&null!==eg){gg=!0;var a=0,b=C;try{var c=eg;for(C=1;a>=g;e-=g;rg=1<<32-oc(b)+e|c<w?(x=u,u=null):x=u.sibling;var n=r(e,u,h[w],k);if(null===n){null===u&&(u=x);break}a&&u&&null===n.alternate&&b(e,u);g=f(n,g,w);null===m?l=n:m.sibling=n;m=n;u=x}if(w===h.length)return c(e,u),I&&tg(e,w),l;if(null===u){for(;ww?(x=m,m=null):x=m.sibling;var t=r(e,m,n.value,k);if(null===t){null===m&&(m=x);break}a&&m&&null===t.alternate&&b(e,m);g=f(t,g,w);null===u?l=t:u.sibling=t;u=t;m=x}if(n.done)return c(e,\nm),I&&tg(e,w),l;if(null===m){for(;!n.done;w++,n=h.next())n=q(e,n.value,k),null!==n&&(g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);I&&tg(e,w);return l}for(m=d(e,m);!n.done;w++,n=h.next())n=y(m,e,w,n.value,k),null!==n&&(a&&null!==n.alternate&&m.delete(null===n.key?w:n.key),g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);a&&m.forEach(function(a){return b(e,a)});I&&tg(e,w);return l}function J(a,d,f,h){"object"===typeof f&&null!==f&&f.type===ya&&null===f.key&&(f=f.props.children);if("object"===typeof f&&null!==f){switch(f.$$typeof){case va:a:{for(var k=\nf.key,l=d;null!==l;){if(l.key===k){k=f.type;if(k===ya){if(7===l.tag){c(a,l.sibling);d=e(l,f.props.children);d.return=a;a=d;break a}}else if(l.elementType===k||"object"===typeof k&&null!==k&&k.$$typeof===Ha&&uh(k)===l.type){c(a,l.sibling);d=e(l,f.props);d.ref=sh(a,l,f);d.return=a;a=d;break a}c(a,l);break}else b(a,l);l=l.sibling}f.type===ya?(d=Ah(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=yh(f.type,f.key,f.props,null,a.mode,h),h.ref=sh(a,d,f),h.return=a,a=h)}return g(a);case wa:a:{for(l=f.key;null!==\nd;){if(d.key===l)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=zh(f,a.mode,h);d.return=a;a=d}return g(a);case Ha:return l=f._init,J(a,d,l(f._payload),h)}if(eb(f))return n(a,d,f,h);if(Ka(f))return t(a,d,f,h);th(a,f)}return"string"===typeof f&&""!==f||"number"===typeof f?(f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):\n(c(a,d),d=xh(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return J}var Bh=vh(!0),Ch=vh(!1),Dh={},Eh=Uf(Dh),Fh=Uf(Dh),Gh=Uf(Dh);function Hh(a){if(a===Dh)throw Error(p(174));return a}function Ih(a,b){G(Gh,b);G(Fh,a);G(Eh,Dh);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:lb(null,"");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=lb(b,a)}E(Eh);G(Eh,b)}function Jh(){E(Eh);E(Fh);E(Gh)}\nfunction Kh(a){Hh(Gh.current);var b=Hh(Eh.current);var c=lb(b,a.type);b!==c&&(G(Fh,a),G(Eh,c))}function Lh(a){Fh.current===a&&(E(Eh),E(Fh))}var M=Uf(0);\nfunction Mh(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||"$?"===c.data||"$!"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&128))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}var Nh=[];\nfunction Oh(){for(var a=0;ac?c:4;a(!0);var d=Qh.transition;Qh.transition={};try{a(!1),b()}finally{C=c,Qh.transition=d}}function Fi(){return di().memoizedState}\nfunction Gi(a,b,c){var d=lh(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,c);else if(c=Yg(a,b,c,d),null!==c){var e=L();mh(c,a,d,e);Ji(c,b,d)}}\nfunction ri(a,b,c){var d=lh(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(He(h,g)){var k=b.interleaved;null===k?(e.next=e,Xg(b)):(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(l){}finally{}c=Yg(a,b,e,d);null!==c&&(e=L(),mh(c,a,d,e),Ji(c,b,d))}}\nfunction Hi(a){var b=a.alternate;return a===N||null!==b&&b===N}function Ii(a,b){Th=Sh=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function Ji(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}}\nvar ai={readContext:Vg,useCallback:Q,useContext:Q,useEffect:Q,useImperativeHandle:Q,useInsertionEffect:Q,useLayoutEffect:Q,useMemo:Q,useReducer:Q,useRef:Q,useState:Q,useDebugValue:Q,useDeferredValue:Q,useTransition:Q,useMutableSource:Q,useSyncExternalStore:Q,useId:Q,unstable_isNewReconciler:!1},Yh={readContext:Vg,useCallback:function(a,b){ci().memoizedState=[a,void 0===b?null:b];return a},useContext:Vg,useEffect:vi,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ti(4194308,\n4,yi.bind(null,b,a),c)},useLayoutEffect:function(a,b){return ti(4194308,4,a,b)},useInsertionEffect:function(a,b){return ti(4,2,a,b)},useMemo:function(a,b){var c=ci();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=ci();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};d.queue=a;a=a.dispatch=Gi.bind(null,N,a);return[d.memoizedState,a]},useRef:function(a){var b=\nci();a={current:a};return b.memoizedState=a},useState:qi,useDebugValue:Ai,useDeferredValue:function(a){return ci().memoizedState=a},useTransition:function(){var a=qi(!1),b=a[0];a=Ei.bind(null,a[1]);ci().memoizedState=a;return[b,a]},useMutableSource:function(){},useSyncExternalStore:function(a,b,c){var d=N,e=ci();if(I){if(void 0===c)throw Error(p(407));c=c()}else{c=b();if(null===R)throw Error(p(349));0!==(Rh&30)||ni(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};e.queue=f;vi(ki.bind(null,d,\nf,a),[a]);d.flags|=2048;li(9,mi.bind(null,d,f,c,b),void 0,null);return c},useId:function(){var a=ci(),b=R.identifierPrefix;if(I){var c=sg;var d=rg;c=(d&~(1<<32-oc(d)-1)).toString(32)+c;b=":"+b+"R"+c;c=Uh++;0\\x3c/script>",a=a.removeChild(a.firstChild)):\n"string"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),"select"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Of]=b;a[Pf]=d;Aj(a,b,!1,!1);b.stateNode=a;a:{g=vb(c,d);switch(c){case "dialog":D("cancel",a);D("close",a);e=d;break;case "iframe":case "object":case "embed":D("load",a);e=d;break;case "video":case "audio":for(e=0;eHj&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304)}else{if(!d)if(a=Mh(g),null!==a){if(b.flags|=128,d=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Ej(f,!0),null===f.tail&&"hidden"===f.tailMode&&!g.alternate&&!I)return S(b),null}else 2*B()-f.renderingStartTime>Hj&&1073741824!==c&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304);f.isBackwards?(g.sibling=b.child,b.child=g):(c=f.last,null!==c?c.sibling=g:b.child=g,f.last=g)}if(null!==f.tail)return b=f.tail,f.rendering=\nb,f.tail=b.sibling,f.renderingStartTime=B(),b.sibling=null,c=M.current,G(M,d?c&1|2:c&1),b;S(b);return null;case 22:case 23:return Ij(),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!==(b.mode&1)?0!==(gj&1073741824)&&(S(b),b.subtreeFlags&6&&(b.flags|=8192)):S(b),null;case 24:return null;case 25:return null}throw Error(p(156,b.tag));}\nfunction Jj(a,b){wg(b);switch(b.tag){case 1:return Zf(b.type)&&$f(),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return Jh(),E(Wf),E(H),Oh(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return Lh(b),null;case 13:E(M);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(p(340));Ig()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return E(M),null;case 4:return Jh(),null;case 10:return Rg(b.type._context),null;case 22:case 23:return Ij(),\nnull;case 24:return null;default:return null}}var Kj=!1,U=!1,Lj="function"===typeof WeakSet?WeakSet:Set,V=null;function Mj(a,b){var c=a.ref;if(null!==c)if("function"===typeof c)try{c(null)}catch(d){W(a,b,d)}else c.current=null}function Nj(a,b,c){try{c()}catch(d){W(a,b,d)}}var Oj=!1;\nfunction Pj(a,b){Cf=dd;a=Me();if(Ne(a)){if("selectionStart"in a)var c={start:a.selectionStart,end:a.selectionEnd};else a:{c=(c=a.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();if(d&&0!==d.rangeCount){c=d.anchorNode;var e=d.anchorOffset,f=d.focusNode;d=d.focusOffset;try{c.nodeType,f.nodeType}catch(F){c=null;break a}var g=0,h=-1,k=-1,l=0,m=0,q=a,r=null;b:for(;;){for(var y;;){q!==c||0!==e&&3!==q.nodeType||(h=g+e);q!==f||0!==d&&3!==q.nodeType||(k=g+d);3===q.nodeType&&(g+=\nq.nodeValue.length);if(null===(y=q.firstChild))break;r=q;q=y}for(;;){if(q===a)break b;r===c&&++l===e&&(h=g);r===f&&++m===d&&(k=g);if(null!==(y=q.nextSibling))break;q=r;r=q.parentNode}q=y}c=-1===h||-1===k?null:{start:h,end:k}}else c=null}c=c||{start:0,end:0}}else c=null;Df={focusedElem:a,selectionRange:c};dd=!1;for(V=b;null!==V;)if(b=V,a=b.child,0!==(b.subtreeFlags&1028)&&null!==a)a.return=b,V=a;else for(;null!==V;){b=V;try{var n=b.alternate;if(0!==(b.flags&1024))switch(b.tag){case 0:case 11:case 15:break;\ncase 1:if(null!==n){var t=n.memoizedProps,J=n.memoizedState,x=b.stateNode,w=x.getSnapshotBeforeUpdate(b.elementType===b.type?t:Lg(b.type,t),J);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var u=b.stateNode.containerInfo;1===u.nodeType?u.textContent="":9===u.nodeType&&u.documentElement&&u.removeChild(u.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163));}}catch(F){W(b,b.return,F)}a=b.sibling;if(null!==a){a.return=b.return;V=a;break}V=b.return}n=Oj;Oj=!1;return n}\nfunction Qj(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&Nj(b,c,f)}e=e.next}while(e!==d)}}function Rj(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Sj(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=c;break;default:a=c}"function"===typeof b?b(a):b.current=a}}\nfunction Tj(a){var b=a.alternate;null!==b&&(a.alternate=null,Tj(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&(delete b[Of],delete b[Pf],delete b[of],delete b[Qf],delete b[Rf]));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}function Uj(a){return 5===a.tag||3===a.tag||4===a.tag}\nfunction Vj(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Uj(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}\nfunction Wj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=Bf));else if(4!==d&&(a=a.child,null!==a))for(Wj(a,b,c),a=a.sibling;null!==a;)Wj(a,b,c),a=a.sibling}\nfunction Xj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(Xj(a,b,c),a=a.sibling;null!==a;)Xj(a,b,c),a=a.sibling}var X=null,Yj=!1;function Zj(a,b,c){for(c=c.child;null!==c;)ak(a,b,c),c=c.sibling}\nfunction ak(a,b,c){if(lc&&"function"===typeof lc.onCommitFiberUnmount)try{lc.onCommitFiberUnmount(kc,c)}catch(h){}switch(c.tag){case 5:U||Mj(c,b);case 6:var d=X,e=Yj;X=null;Zj(a,b,c);X=d;Yj=e;null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?a.parentNode.removeChild(c):a.removeChild(c)):X.removeChild(c.stateNode));break;case 18:null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?Kf(a.parentNode,c):1===a.nodeType&&Kf(a,c),bd(a)):Kf(X,c.stateNode));break;case 4:d=X;e=Yj;X=c.stateNode.containerInfo;Yj=!0;\nZj(a,b,c);X=d;Yj=e;break;case 0:case 11:case 14:case 15:if(!U&&(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?Nj(c,b,g):0!==(f&4)&&Nj(c,b,g));e=e.next}while(e!==d)}Zj(a,b,c);break;case 1:if(!U&&(Mj(c,b),d=c.stateNode,"function"===typeof d.componentWillUnmount))try{d.props=c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){W(c,b,h)}Zj(a,b,c);break;case 21:Zj(a,b,c);break;case 22:c.mode&1?(U=(d=U)||null!==\nc.memoizedState,Zj(a,b,c),U=d):Zj(a,b,c);break;default:Zj(a,b,c)}}function bk(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Lj);b.forEach(function(b){var d=ck.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}\nfunction dk(a,b){var c=b.deletions;if(null!==c)for(var d=0;de&&(e=g);d&=~f}d=e;d=B()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*mk(d/1960))-d;if(10a?16:a;if(null===xk)var d=!1;else{a=xk;xk=null;yk=0;if(0!==(K&6))throw Error(p(331));var e=K;K|=4;for(V=a.current;null!==V;){var f=V,g=f.child;if(0!==(V.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;kB()-gk?Lk(a,0):sk|=c);Ek(a,b)}function Zk(a,b){0===b&&(0===(a.mode&1)?b=1:(b=sc,sc<<=1,0===(sc&130023424)&&(sc=4194304)));var c=L();a=Zg(a,b);null!==a&&(Ac(a,b,c),Ek(a,c))}function vj(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);Zk(a,c)}\nfunction ck(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane);break;case 19:d=a.stateNode;break;default:throw Error(p(314));}null!==d&&d.delete(b);Zk(a,c)}var Wk;\nWk=function(a,b,c){if(null!==a)if(a.memoizedProps!==b.pendingProps||Wf.current)Ug=!0;else{if(0===(a.lanes&c)&&0===(b.flags&128))return Ug=!1,zj(a,b,c);Ug=0!==(a.flags&131072)?!0:!1}else Ug=!1,I&&0!==(b.flags&1048576)&&ug(b,ng,b.index);b.lanes=0;switch(b.tag){case 2:var d=b.type;jj(a,b);a=b.pendingProps;var e=Yf(b,H.current);Tg(b,c);e=Xh(null,b,d,a,e,c);var f=bi();b.flags|=1;"object"===typeof e&&null!==e&&"function"===typeof e.render&&void 0===e.$$typeof?(b.tag=1,b.memoizedState=null,b.updateQueue=\nnull,Zf(d)?(f=!0,cg(b)):f=!1,b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,ah(b),e.updater=nh,b.stateNode=e,e._reactInternals=b,rh(b,d,a,c),b=kj(null,b,d,!0,f,c)):(b.tag=0,I&&f&&vg(b),Yi(null,b,e,c),b=b.child);return b;case 16:d=b.elementType;a:{jj(a,b);a=b.pendingProps;e=d._init;d=e(d._payload);b.type=d;e=b.tag=$k(d);a=Lg(d,a);switch(e){case 0:b=dj(null,b,d,a,c);break a;case 1:b=ij(null,b,d,a,c);break a;case 11:b=Zi(null,b,d,a,c);break a;case 14:b=aj(null,b,d,Lg(d.type,a),c);break a}throw Error(p(306,\nd,""));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),dj(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),ij(a,b,d,e,c);case 3:a:{lj(b);if(null===a)throw Error(p(387));d=b.pendingProps;f=b.memoizedState;e=f.element;bh(a,b);gh(b,d,null,c);var g=b.memoizedState;d=g.element;if(f.isDehydrated)if(f={element:d,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},b.updateQueue.baseState=\nf,b.memoizedState=f,b.flags&256){e=Ki(Error(p(423)),b);b=mj(a,b,d,c,e);break a}else if(d!==e){e=Ki(Error(p(424)),b);b=mj(a,b,d,c,e);break a}else for(yg=Lf(b.stateNode.containerInfo.firstChild),xg=b,I=!0,zg=null,c=Ch(b,null,d,c),b.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{Ig();if(d===e){b=$i(a,b,c);break a}Yi(a,b,d,c)}b=b.child}return b;case 5:return Kh(b),null===a&&Eg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Ef(d,e)?g=null:null!==f&&Ef(d,f)&&(b.flags|=32),\nhj(a,b),Yi(a,b,g,c),b.child;case 6:return null===a&&Eg(b),null;case 13:return pj(a,b,c);case 4:return Ih(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Bh(b,null,d,c):Yi(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),Zi(a,b,d,e,c);case 7:return Yi(a,b,b.pendingProps,c),b.child;case 8:return Yi(a,b,b.pendingProps.children,c),b.child;case 12:return Yi(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;f=b.memoizedProps;\ng=e.value;G(Mg,d._currentValue);d._currentValue=g;if(null!==f)if(He(f.value,g)){if(f.children===e.children&&!Wf.current){b=$i(a,b,c);break a}}else for(f=b.child,null!==f&&(f.return=b);null!==f;){var h=f.dependencies;if(null!==h){g=f.child;for(var k=h.firstContext;null!==k;){if(k.context===d){if(1===f.tag){k=ch(-1,c&-c);k.tag=2;var l=f.updateQueue;if(null!==l){l=l.shared;var m=l.pending;null===m?k.next=k:(k.next=m.next,m.next=k);l.pending=k}}f.lanes|=c;k=f.alternate;null!==k&&(k.lanes|=c);Sg(f.return,\nc,b);h.lanes|=c;break}k=k.next}}else if(10===f.tag)g=f.type===b.type?null:f.child;else if(18===f.tag){g=f.return;if(null===g)throw Error(p(341));g.lanes|=c;h=g.alternate;null!==h&&(h.lanes|=c);Sg(g,c,b);g=f.sibling}else g=f.child;if(null!==g)g.return=f;else for(g=f;null!==g;){if(g===b){g=null;break}f=g.sibling;if(null!==f){f.return=g.return;g=f;break}g=g.return}f=g}Yi(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,d=b.pendingProps.children,Tg(b,c),e=Vg(e),d=d(e),b.flags|=1,Yi(a,b,d,c),\nb.child;case 14:return d=b.type,e=Lg(d,b.pendingProps),e=Lg(d.type,e),aj(a,b,d,e,c);case 15:return cj(a,b,b.type,b.pendingProps,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),jj(a,b),b.tag=1,Zf(d)?(a=!0,cg(b)):a=!1,Tg(b,c),ph(b,d,e),rh(b,d,e,c),kj(null,b,d,!0,a,c);case 19:return yj(a,b,c);case 22:return ej(a,b,c)}throw Error(p(156,b.tag));};function Gk(a,b){return ac(a,b)}\nfunction al(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function Bg(a,b,c,d){return new al(a,b,c,d)}function bj(a){a=a.prototype;return!(!a||!a.isReactComponent)}\nfunction $k(a){if("function"===typeof a)return bj(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Da)return 11;if(a===Ga)return 14}return 2}\nfunction wh(a,b){var c=a.alternate;null===c?(c=Bg(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};\nc.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}\nfunction yh(a,b,c,d,e,f){var g=2;d=a;if("function"===typeof a)bj(a)&&(g=1);else if("string"===typeof a)g=5;else a:switch(a){case ya:return Ah(c.children,e,f,b);case za:g=8;e|=8;break;case Aa:return a=Bg(12,c,b,e|2),a.elementType=Aa,a.lanes=f,a;case Ea:return a=Bg(13,c,b,e),a.elementType=Ea,a.lanes=f,a;case Fa:return a=Bg(19,c,b,e),a.elementType=Fa,a.lanes=f,a;case Ia:return qj(c,e,f,b);default:if("object"===typeof a&&null!==a)switch(a.$$typeof){case Ba:g=10;break a;case Ca:g=9;break a;case Da:g=11;\nbreak a;case Ga:g=14;break a;case Ha:g=16;d=null;break a}throw Error(p(130,null==a?a:typeof a,""));}b=Bg(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function Ah(a,b,c,d){a=Bg(7,a,d,b);a.lanes=c;return a}function qj(a,b,c,d){a=Bg(22,a,d,b);a.elementType=Ia;a.lanes=c;a.stateNode={isHidden:!1};return a}function xh(a,b,c){a=Bg(6,a,null,b);a.lanes=c;return a}\nfunction zh(a,b,c){b=Bg(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}\nfunction bl(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=0;this.eventTimes=zc(0);this.expirationTimes=zc(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=zc(0);this.identifierPrefix=d;this.onRecoverableError=e;this.mutableSourceEagerHydrationData=\nnull}function cl(a,b,c,d,e,f,g,h,k){a=new bl(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=Bg(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null};ah(f);return a}function dl(a,b,c){var d=3{"use strict";eval("var __webpack_unused_export__;\n\n\nvar m = __webpack_require__(935);\nif (true) {\n exports.s = m.createRoot;\n __webpack_unused_export__ = m.hydrateRoot;\n} else { var i; }\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzQ1LmpzIiwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQ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__webpack_require__)=>{"use strict";eval("\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (false) {}\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (true) {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = __webpack_require__(448);\n} else {}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTM1LmpzIiwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFVQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZXMiOlsid2VicGFjazovL3JlYWN0LXF1aXotY29tcG9uZW50Ly4vbm9kZV9tb2R1bGVzL3JlYWN0LWRvbS9pbmRleC5qcz84YmM4Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcblxuZnVuY3Rpb24gY2hlY2tEQ0UoKSB7XG4gIC8qIGdsb2JhbCBfX1JFQUNUX0RFVlRPT0xTX0dMT0JBTF9IT09LX18gKi9cbiAgaWYgKFxuICAgIHR5cGVvZiBfX1JFQUNUX0RFVlRPT0xTX0dMT0JBTF9IT09LX18gPT09ICd1bmRlZmluZWQnIHx8XG4gICAgdHlwZW9mIF9fUkVBQ1Rf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ICAgLy8gV2Ugc2hvdWxkIHN0aWxsIHJlcG9ydCBpbiBjYXNlIHdlIGJyZWFrIHRoaXMgY29kZS5cbiAgICBjb25zb2xlLmVycm9yKGVycik7XG4gIH1cbn1cblxuaWYgKHByb2Nlc3MuZW52Lk5PREVfRU5WID09PSAncHJvZHVjdGlvbicpIHtcbiAgLy8gRENFIGNoZWNrIHNob3VsZCBoYXBwZW4gYmVmb3JlIFJlYWN0RE9NIGJ1bmRsZSBleGVjdXRlcyBzbyB0aGF0XG4gIC8vIERldlRvb2xzIGNhbiByZXBvcnQgYmFkIG1pbmlmaWNhdGlvbiBkdXJpbmcgaW5qZWN0aW9uLlxuICBjaGVja0RDRSgpO1xuICBtb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4vY2pzL3JlYWN0LWRvbS5wcm9kdWN0aW9uLm1pbi5qcycpO1xufSBlbHNlIHtcbiAgbW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL2Nqcy9yZWFjdC1kb20uZGV2ZWxvcG1lbnQuanMnKTtcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///935\n")},408:(__unused_webpack_module,exports)=>{"use strict";eval('/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nvar l=Symbol.for("react.element"),n=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),t=Symbol.for("react.provider"),u=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),z=Symbol.iterator;function A(a){if(null===a||"object"!==typeof a)return null;a=z&&a[z]||a["@@iterator"];return"function"===typeof a?a:null}\nvar B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};\nE.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,a,b,"setState")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;\nH.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=""+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1{"use strict";eval("\n\nif (true) {\n module.exports = __webpack_require__(408);\n} else {}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjk0LmpzIiwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9yZWFjdC1xdWl6LWNvbXBvbmVudC8uL25vZGVfbW9kdWxlcy9yZWFjdC9pbmRleC5qcz9hYjViIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcblxuaWYgKHByb2Nlc3MuZW52Lk5PREVfRU5WID09PSAncHJvZHVjdGlvbicpIHtcbiAgbW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL2Nqcy9yZWFjdC5wcm9kdWN0aW9uLm1pbi5qcycpO1xufSBlbHNlIHtcbiAgbW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL2Nqcy9yZWFjdC5kZXZlbG9wbWVudC5qcycpO1xufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///294\n")},53:(__unused_webpack_module,exports)=>{"use strict";eval('/**\n * @license React\n * scheduler.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nfunction f(a,b){var c=a.length;a.push(b);a:for(;0>>1,e=a[d];if(0>>1;dg(C,c))ng(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(ng(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}\nfunction g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if("object"===typeof performance&&"function"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D="function"===typeof setTimeout?setTimeout:null,E="function"===typeof clearTimeout?clearTimeout:null,F="undefined"!==typeof setImmediate?setImmediate:null;\n"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}\nfunction J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if("function"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();"function"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;\nfunction M(){return exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTMuanMiLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9yZWFjdC1xdWl6LWNvbXBvbmVudC8uL25vZGVfbW9kdWxlcy9zY2hlZHVsZXIvY2pzL3NjaGVkdWxlci5wcm9kdWN0aW9uLm1pbi5qcz9mYjA3Il0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGxpY2Vuc2UgUmVhY3RcbiAqIHNjaGVkdWxlci5wcm9kdWN0aW9uLm1pbi5qc1xuICpcbiAqIENvcHlyaWdodCAoYykgRmFjZWJvb2ssIEluYy4gYW5kIGl0cyBhZmZpbGlhdGVzLlxuICpcbiAqIFRoaXMgc291cmNlIGNvZGUgaXMgbGljZW5zZWQgdW5kZXIgdGhlIE1JVCBsaWNlbnNlIGZvdW5kIGluIHRoZVxuICogTElDRU5TRSBmaWxlIGluIHRoZSByb290IGRpcmVjdG9yeSBvZiB0aGlzIHNvdXJjZSB0cmVlLlxuICovXG4ndXNlIHN0cmljdCc7ZnVuY3Rpb24g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HkodGhpcyxhcmd1bWVudHMpfWZpbmFsbHl7eT1jfX19O1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///53\n')},840:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nif (true) {\n module.exports = __webpack_require__(53);\n} else {}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODQwLmpzIiwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9yZWFjdC1xdWl6LWNvbXBvbmVudC8uL25vZGVfbW9kdWxlcy9zY2hlZHVsZXIvaW5kZXguanM/NDAyOSJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG5cbmlmIChwcm9jZXNzLmVudi5OT0RFX0VOViA9PT0gJ3Byb2R1Y3Rpb24nKSB7XG4gIG1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9janMvc2NoZWR1bGVyLnByb2R1Y3Rpb24ubWluLmpzJyk7XG59IGVsc2Uge1xuICBtb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4vY2pzL3NjaGVkdWxlci5kZXZlbG9wbWVudC5qcycpO1xufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///840\n")}},__webpack_module_cache__={};function __webpack_require__(e){var n=__webpack_module_cache__[e];if(void 0!==n)return n.exports;var l=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(l.exports,l,l.exports,__webpack_require__),l.exports}__webpack_require__.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(n,{a:n}),n},__webpack_require__.d=(e,n)=>{for(var l in n)__webpack_require__.o(n,l)&&!__webpack_require__.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:n[l]})},__webpack_require__.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n);var __webpack_exports__=__webpack_require__(412)})(); \ No newline at end of file +(()=>{var __webpack_modules__={920:(__unused_webpack_module,__unused_webpack___webpack_exports__,__webpack_require__)=>{"use strict";eval('\n// EXTERNAL MODULE: ./node_modules/react/index.js\nvar react = __webpack_require__(504);\n// EXTERNAL MODULE: ./node_modules/react-dom/client.js\nvar client = __webpack_require__(352);\n;// CONCATENATED MODULE: ./node_modules/nanoid/url-alphabet/index.js\nconst urlAlphabet =\n \'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict\'\n\n;// CONCATENATED MODULE: ./node_modules/nanoid/index.browser.js\n\n\nlet random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\nlet customRandom = (alphabet, defaultSize, getRandom) => {\n let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1\n let step = -~((1.6 * mask * defaultSize) / alphabet.length)\n return (size = defaultSize) => {\n let id = \'\'\n while (true) {\n let bytes = getRandom(step)\n let j = step\n while (j--) {\n id += alphabet[bytes[j] & mask] || \'\'\n if (id.length === size) return id\n }\n }\n }\n}\nlet customAlphabet = (alphabet, size = 21) =>\n customRandom(alphabet, size, random)\nlet nanoid = (size = 21) => {\n let id = \'\'\n let bytes = crypto.getRandomValues(new Uint8Array(size))\n while (size--) {\n id += urlAlphabet[bytes[size] & 63]\n }\n return id\n}\n\n;// CONCATENATED MODULE: ./src/lib/core-components/QuizResultFilter.jsx\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction QuizResultFilter(_ref) {\n var filteredValue = _ref.filteredValue,\n handleChange = _ref.handleChange,\n appLocale = _ref.appLocale;\n var _useState = (0,react.useState)(false),\n _useState2 = _slicedToArray(_useState, 2),\n isOpen = _useState2[0],\n setIsOpen = _useState2[1];\n var dropdownRef = (0,react.useRef)(null);\n var toggleDropdown = function toggleDropdown() {\n setIsOpen(!isOpen);\n };\n var handleOptionClick = function handleOptionClick(value) {\n handleChange({\n target: {\n value: value\n }\n });\n setIsOpen(false);\n };\n var selectedOptionClass = isOpen ? \'selected-open\' : \'\';\n (0,react.useEffect)(function () {\n var handleOutsideClick = function handleOutsideClick(e) {\n if (isOpen && dropdownRef.current && !dropdownRef.current.contains(e.target)) {\n setIsOpen(false);\n }\n };\n document.addEventListener(\'click\', handleOutsideClick);\n return function () {\n document.removeEventListener(\'click\', handleOutsideClick);\n };\n }, [isOpen]);\n return /*#__PURE__*/react.createElement("div", {\n className: "quiz-result-filter"\n }, /*#__PURE__*/react.createElement("div", {\n ref: dropdownRef,\n className: "filter-dropdown-select ".concat(isOpen ? \'open\' : \'\'),\n onClick: toggleDropdown,\n onKeyDown: function onKeyDown(e) {\n if (e.key === \'Enter\') {\n toggleDropdown();\n }\n },\n role: "button",\n tabIndex: 0\n }, /*#__PURE__*/react.createElement("div", {\n className: "selected-option ".concat(selectedOptionClass)\n }, filteredValue === \'all\' ? appLocale.resultFilterAll : filteredValue), /*#__PURE__*/react.createElement("span", {\n className: "arrow ".concat(isOpen ? \'up\' : \'down\')\n })), isOpen && /*#__PURE__*/react.createElement("div", {\n className: "dropdown-options",\n role: "menu",\n "aria-labelledby": "quiz-filter"\n }, /*#__PURE__*/react.createElement("div", {\n className: "dropdown-options-item ".concat(filteredValue === \'all\' ? \'selected\' : \'\'),\n onClick: function onClick() {\n return handleOptionClick(\'all\');\n },\n onKeyDown: function onKeyDown(e) {\n if (e.key === \'Enter\') {\n handleOptionClick(\'all\');\n }\n },\n role: "menuitem",\n tabIndex: 0\n }, appLocale.resultFilterAll), /*#__PURE__*/react.createElement("div", {\n className: "dropdown-options-item ".concat(filteredValue === \'correct\' ? \'selected\' : \'\'),\n onClick: function onClick() {\n return handleOptionClick(\'correct\');\n },\n onKeyDown: function onKeyDown(e) {\n if (e.key === \'Enter\') {\n handleOptionClick(\'correct\');\n }\n },\n role: "menuitem",\n tabIndex: 0\n }, appLocale.resultFilterCorrect), /*#__PURE__*/react.createElement("div", {\n className: "dropdown-options-item ".concat(filteredValue === \'incorrect\' ? \'selected\' : \'\'),\n onClick: function onClick() {\n return handleOptionClick(\'incorrect\');\n },\n onKeyDown: function onKeyDown(e) {\n if (e.key === \'Enter\') {\n handleOptionClick(\'incorrect\');\n }\n },\n role: "menuitem",\n tabIndex: 0\n }, appLocale.resultFilterIncorrect), /*#__PURE__*/react.createElement("div", {\n className: "dropdown-options-item ".concat(filteredValue === \'unanswered\' ? \'selected\' : \'\'),\n onClick: function onClick() {\n return handleOptionClick(\'unanswered\');\n },\n onKeyDown: function onKeyDown(e) {\n if (e.key === \'Enter\') {\n handleOptionClick(\'unanswered\');\n }\n },\n role: "menuitem",\n tabIndex: 0\n }, appLocale.resultFilterUnanswered)));\n}\n/* harmony default export */ const core_components_QuizResultFilter = (QuizResultFilter);\n;// CONCATENATED MODULE: ./node_modules/snarkdown/dist/snarkdown.es.js\nvar e={"":["",""],_:["",""],"*":["",""],"~":["",""],"\\n":["
    "]," ":["
    "],"-":["
    "]};function n(e){return e.replace(RegExp("^"+(e.match(/^(\\t| )+/)||"")[0],"gm"),"")}function r(e){return(e+"").replace(/"/g,""").replace(//g,">")}function t(a,c){var o,l,g,s,p,u=/((?:^|\\n+)(?:\\n---+|\\* \\*(?: \\*)+)\\n)|(?:^``` *(\\w*)\\n([\\s\\S]*?)\\n```$)|((?:(?:^|\\n+)(?:\\t| {2,}).+)+\\n*)|((?:(?:^|\\n)([>*+-]|\\d+\\.)\\s+.*)+)|(?:!\\[([^\\]]*?)\\]\\(([^)]+?)\\))|(\\[)|(\\](?:\\(([^)]+?)\\))?)|(?:(?:^|\\n+)([^\\s].*)\\n(-{3,}|={3,})(?:\\n+|$))|(?:(?:^|\\n+)(#{1,6})\\s*(.+)(?:\\n+|$))|(?:`([^`].*?)`)|( \\n\\n*|\\n{2,}|__|\\*\\*|[_*]|~~)/gm,m=[],h="",i=c||{},d=0;function f(n){var r=e[n[1]||""],t=m[m.length-1]==n;return r?r[1]?(t?m.pop():m.push(n),r[0|t]):r[0]:n}function $(){for(var e="";m.length;)e+=f(m[m.length-1]);return e}for(a=a.replace(/^\\[(.+?)\\]:\\s*(.+)$/gm,function(e,n,r){return i[n.toLowerCase()]=r,""}).replace(/^\\n+|\\n+$/g,"");g=u.exec(a);)l=a.substring(d,g.index),d=u.lastIndex,o=g[0],l.match(/[^\\\\](\\\\\\\\)*\\\\$/)||((p=g[3]||g[4])?o=\'
    "+n(r(p).replace(/^\\n+|\\n+$/g,""))+"
    ":(p=g[6])?(p.match(/\\./)&&(g[5]=g[5].replace(/^\\d+/gm,"")),s=t(n(g[5].replace(/^\\s*[>*+.-]/gm,""))),">"==p?p="blockquote":(p=p.match(/\\./)?"ol":"ul",s=s.replace(/^(.*)(\\n|$)/gm,"
  • $1
  • ")),o="<"+p+">"+s+""):g[8]?o=\'\'+r(g[7])+\'\':g[10]?(h=h.replace("
    ",\'\'),o=$()+""):g[9]?o="":g[12]||g[14]?o="<"+(p="h"+(g[14]?g[14].length:g[13]>"="?1:2))+">"+t(g[12]||g[15],i)+"":g[16]?o=""+r(g[16])+"":(g[17]||g[1])&&(o=f(g[17]||"--"))),h+=l,h+=o;return(h+a.substring(d)+$()).replace(/^\\n+|\\n+$/g,"")}\n//# sourceMappingURL=snarkdown.es.js.map\n\n// EXTERNAL MODULE: ./node_modules/dompurify/dist/purify.js\nvar purify = __webpack_require__(300);\nvar purify_default = /*#__PURE__*/__webpack_require__.n(purify);\n;// CONCATENATED MODULE: ./src/lib/core-components/helpers.jsx\nfunction _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = helpers_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || helpers_unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction helpers_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return helpers_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return helpers_arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return helpers_arrayLikeToArray(arr); }\nfunction helpers_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\n\n\nvar rawMarkup = function rawMarkup(data) {\n var sanitizer = (purify_default()).sanitize;\n return {\n __html: t(sanitizer(data))\n };\n};\nvar checkAnswer = function checkAnswer(index, correctAnswer, answerSelectionType, answers, _ref) {\n var userInput = _ref.userInput,\n userAttempt = _ref.userAttempt,\n currentQuestionIndex = _ref.currentQuestionIndex,\n continueTillCorrect = _ref.continueTillCorrect,\n showNextQuestionButton = _ref.showNextQuestionButton,\n incorrect = _ref.incorrect,\n correct = _ref.correct,\n setButtons = _ref.setButtons,\n setIsCorrect = _ref.setIsCorrect,\n setIncorrectAnswer = _ref.setIncorrectAnswer,\n setCorrect = _ref.setCorrect,\n setIncorrect = _ref.setIncorrect,\n setShowNextQuestionButton = _ref.setShowNextQuestionButton,\n setUserInput = _ref.setUserInput,\n setUserAttempt = _ref.setUserAttempt;\n var indexStr = "".concat(index);\n var disabledAll = Object.keys(answers).map(function () {\n return {\n disabled: true\n };\n });\n var userInputCopy = _toConsumableArray(userInput);\n if (answerSelectionType === \'single\') {\n if (userInputCopy[currentQuestionIndex] === undefined) {\n userInputCopy[currentQuestionIndex] = index;\n }\n if (indexStr === correctAnswer) {\n if (incorrect.indexOf(currentQuestionIndex) < 0 && correct.indexOf(currentQuestionIndex) < 0) {\n correct.push(currentQuestionIndex);\n }\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread(_objectSpread({}, prevState), disabledAll), {}, _defineProperty({}, index - 1, {\n className: indexStr === correctAnswer ? \'correct\' : \'incorrect\'\n }));\n });\n setIsCorrect(true);\n setIncorrectAnswer(false);\n setCorrect(correct);\n setShowNextQuestionButton(true);\n } else {\n if (correct.indexOf(currentQuestionIndex) < 0 && incorrect.indexOf(currentQuestionIndex) < 0) {\n incorrect.push(currentQuestionIndex);\n }\n if (continueTillCorrect) {\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread({}, prevState), {}, _defineProperty({}, index - 1, {\n disabled: !prevState[index - 1]\n }));\n });\n } else {\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread(_objectSpread({}, prevState), disabledAll), {}, _defineProperty({}, index - 1, {\n className: indexStr === correctAnswer ? \'correct\' : \'incorrect\'\n }));\n });\n setShowNextQuestionButton(true);\n }\n setIncorrectAnswer(true);\n setIsCorrect(false);\n setIncorrect(incorrect);\n }\n } else {\n var maxNumberOfMultipleSelection = correctAnswer.length;\n if (userInputCopy[currentQuestionIndex] === undefined) {\n userInputCopy[currentQuestionIndex] = [];\n }\n if (userInputCopy[currentQuestionIndex].length < maxNumberOfMultipleSelection) {\n userInputCopy[currentQuestionIndex].push(index);\n if (correctAnswer.includes(index)) {\n if (userInputCopy[currentQuestionIndex].length <= maxNumberOfMultipleSelection) {\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread({}, prevState), {}, _defineProperty({}, index - 1, {\n disabled: !prevState[index - 1],\n className: correctAnswer.includes(index) ? \'correct\' : \'incorrect\'\n }));\n });\n }\n } else if (userInputCopy[currentQuestionIndex].length <= maxNumberOfMultipleSelection) {\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread({}, prevState), {}, _defineProperty({}, index - 1, {\n className: correctAnswer.includes(index) ? \'correct\' : \'incorrect\'\n }));\n });\n }\n }\n if (maxNumberOfMultipleSelection === userAttempt) {\n var cnt = 0;\n for (var i = 0; i < correctAnswer.length; i += 1) {\n if (userInputCopy[currentQuestionIndex].includes(correctAnswer[i])) {\n cnt += 1;\n }\n }\n var _loop = function _loop(_i) {\n if (correctAnswer.includes(_i + 1)) {\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread({}, prevState), {}, _defineProperty({}, _i, {}));\n });\n }\n };\n for (var _i = 0; _i < answers.length; _i += 1) {\n _loop(_i);\n }\n if (cnt === maxNumberOfMultipleSelection) {\n correct.push(currentQuestionIndex);\n setIsCorrect(true);\n setIncorrectAnswer(false);\n setCorrect(correct);\n setShowNextQuestionButton(true);\n setUserAttempt(1);\n } else {\n incorrect.push(currentQuestionIndex);\n setIncorrectAnswer(true);\n setIsCorrect(false);\n setIncorrect(incorrect);\n setShowNextQuestionButton(true);\n setUserAttempt(1);\n }\n } else if (!showNextQuestionButton) {\n setUserAttempt(userAttempt + 1);\n }\n }\n setUserInput(userInputCopy);\n};\nvar selectAnswer = function selectAnswer(index, correctAnswer, answerSelectionType, answers, _ref2) {\n var userInput = _ref2.userInput,\n currentQuestionIndex = _ref2.currentQuestionIndex,\n setButtons = _ref2.setButtons,\n setShowNextQuestionButton = _ref2.setShowNextQuestionButton,\n incorrect = _ref2.incorrect,\n correct = _ref2.correct,\n setCorrect = _ref2.setCorrect,\n setIncorrect = _ref2.setIncorrect,\n setUserInput = _ref2.setUserInput;\n var selectedButtons = Object.keys(answers).map(function () {\n return {\n selected: false\n };\n });\n var userInputCopy = _toConsumableArray(userInput);\n if (answerSelectionType === \'single\') {\n correctAnswer = Number(correctAnswer);\n userInputCopy[currentQuestionIndex] = index;\n if (index === correctAnswer) {\n if (correct.indexOf(currentQuestionIndex) < 0) {\n correct.push(currentQuestionIndex);\n }\n if (incorrect.indexOf(currentQuestionIndex) >= 0) {\n incorrect.splice(incorrect.indexOf(currentQuestionIndex), 1);\n }\n } else {\n if (incorrect.indexOf(currentQuestionIndex) < 0) {\n incorrect.push(currentQuestionIndex);\n }\n if (correct.indexOf(currentQuestionIndex) >= 0) {\n correct.splice(correct.indexOf(currentQuestionIndex), 1);\n }\n }\n setCorrect(correct);\n setIncorrect(incorrect);\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread(_objectSpread({}, prevState), selectedButtons), {}, _defineProperty({}, index - 1, {\n className: \'selected\'\n }));\n });\n setShowNextQuestionButton(true);\n } else {\n if (userInputCopy[currentQuestionIndex] === undefined) {\n userInputCopy[currentQuestionIndex] = [];\n }\n if (userInputCopy[currentQuestionIndex].includes(index)) {\n userInputCopy[currentQuestionIndex].splice(userInputCopy[currentQuestionIndex].indexOf(index), 1);\n } else {\n userInputCopy[currentQuestionIndex].push(index);\n }\n if (userInputCopy[currentQuestionIndex].length === correctAnswer.length) {\n var exactMatch = true;\n // eslint-disable-next-line no-restricted-syntax\n var _iterator = _createForOfIteratorHelper(userInput[currentQuestionIndex]),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var input = _step.value;\n if (!correctAnswer.includes(input)) {\n exactMatch = false;\n if (incorrect.indexOf(currentQuestionIndex) < 0) {\n incorrect.push(currentQuestionIndex);\n }\n if (correct.indexOf(currentQuestionIndex) >= 0) {\n correct.splice(correct.indexOf(currentQuestionIndex), 1);\n }\n break;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n if (exactMatch) {\n if (correct.indexOf(currentQuestionIndex) < 0) {\n correct.push(currentQuestionIndex);\n }\n if (incorrect.indexOf(currentQuestionIndex) >= 0) {\n incorrect.splice(incorrect.indexOf(currentQuestionIndex), 1);\n }\n }\n } else {\n if (incorrect.indexOf(currentQuestionIndex) < 0) {\n incorrect.push(currentQuestionIndex);\n }\n if (correct.indexOf(currentQuestionIndex) >= 0) {\n correct.splice(correct.indexOf(currentQuestionIndex), 1);\n }\n }\n setCorrect(correct);\n setIncorrect(incorrect);\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread({}, prevState), {}, _defineProperty({}, index - 1, {\n className: userInputCopy[currentQuestionIndex].includes(index) ? \'selected\' : undefined\n }));\n });\n if (userInputCopy[currentQuestionIndex].length > 0) {\n setShowNextQuestionButton(true);\n }\n }\n setUserInput(userInputCopy);\n};\n;// CONCATENATED MODULE: ./src/lib/core-components/Explanation.jsx\n\nfunction Explanation(_ref) {\n var question = _ref.question,\n isResultPage = _ref.isResultPage;\n var explanation = question.explanation;\n if (!explanation) {\n return null;\n }\n if (isResultPage) {\n return /*#__PURE__*/react.createElement("div", {\n className: "explanation"\n }, explanation);\n }\n return /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("br", null), explanation);\n}\n/* harmony default export */ const core_components_Explanation = (Explanation);\n;// CONCATENATED MODULE: ./src/lib/core-components/InstantFeedback.jsx\n\n\nvar renderMessageForCorrectAnswer = function renderMessageForCorrectAnswer(question) {\n var defaultMessage = \'You are correct. Please click Next to continue.\';\n return question.messageForCorrectAnswer || defaultMessage;\n};\nvar renderMessageForIncorrectAnswer = function renderMessageForIncorrectAnswer(question) {\n var defaultMessage = \'Incorrect answer. Please try again.\';\n return question.messageForIncorrectAnswer || defaultMessage;\n};\nfunction InstantFeedback(_ref) {\n var showInstantFeedback = _ref.showInstantFeedback,\n incorrectAnswer = _ref.incorrectAnswer,\n correctAnswer = _ref.correctAnswer,\n question = _ref.question,\n onQuestionSubmit = _ref.onQuestionSubmit,\n userAnswer = _ref.userAnswer;\n (0,react.useEffect)(function () {\n if (onQuestionSubmit && (correctAnswer || incorrectAnswer)) {\n onQuestionSubmit({\n question: question,\n userAnswer: userAnswer,\n isCorrect: correctAnswer\n });\n }\n }, [correctAnswer, incorrectAnswer]);\n return /*#__PURE__*/react.createElement(react.Fragment, null, incorrectAnswer && showInstantFeedback && /*#__PURE__*/react.createElement("div", {\n className: "alert incorrect"\n }, renderMessageForIncorrectAnswer(question)), correctAnswer && showInstantFeedback && /*#__PURE__*/react.createElement("div", {\n className: "alert correct"\n }, renderMessageForCorrectAnswer(question), /*#__PURE__*/react.createElement(core_components_Explanation, {\n question: question,\n isResultPage: false\n })));\n}\n/* harmony default export */ const core_components_InstantFeedback = (InstantFeedback);\n;// CONCATENATED MODULE: ./src/lib/Core.jsx\nfunction Core_toConsumableArray(arr) { return Core_arrayWithoutHoles(arr) || Core_iterableToArray(arr) || Core_unsupportedIterableToArray(arr) || Core_nonIterableSpread(); }\nfunction Core_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction Core_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }\nfunction Core_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return Core_arrayLikeToArray(arr); }\nfunction Core_typeof(o) { "@babel/helpers - typeof"; return Core_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, Core_typeof(o); }\nfunction Core_slicedToArray(arr, i) { return Core_arrayWithHoles(arr) || Core_iterableToArrayLimit(arr, i) || Core_unsupportedIterableToArray(arr, i) || Core_nonIterableRest(); }\nfunction Core_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction Core_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Core_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Core_arrayLikeToArray(o, minLen); }\nfunction Core_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction Core_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction Core_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\n\n\n\nfunction Core(_ref) {\n var questions = _ref.questions,\n appLocale = _ref.appLocale,\n showDefaultResult = _ref.showDefaultResult,\n onComplete = _ref.onComplete,\n customResultPage = _ref.customResultPage,\n showInstantFeedback = _ref.showInstantFeedback,\n continueTillCorrect = _ref.continueTillCorrect,\n revealAnswerOnSubmit = _ref.revealAnswerOnSubmit,\n allowNavigation = _ref.allowNavigation,\n onQuestionSubmit = _ref.onQuestionSubmit,\n timer = _ref.timer,\n allowPauseTimer = _ref.allowPauseTimer;\n var _useState = (0,react.useState)(false),\n _useState2 = Core_slicedToArray(_useState, 2),\n incorrectAnswer = _useState2[0],\n setIncorrectAnswer = _useState2[1];\n var _useState3 = (0,react.useState)(false),\n _useState4 = Core_slicedToArray(_useState3, 2),\n isCorrect = _useState4[0],\n setIsCorrect = _useState4[1];\n var _useState5 = (0,react.useState)(false),\n _useState6 = Core_slicedToArray(_useState5, 2),\n showNextQuestionButton = _useState6[0],\n setShowNextQuestionButton = _useState6[1];\n var _useState7 = (0,react.useState)(false),\n _useState8 = Core_slicedToArray(_useState7, 2),\n endQuiz = _useState8[0],\n setEndQuiz = _useState8[1];\n var _useState9 = (0,react.useState)(0),\n _useState10 = Core_slicedToArray(_useState9, 2),\n currentQuestionIndex = _useState10[0],\n setCurrentQuestionIndex = _useState10[1];\n var _useState11 = (0,react.useState)({}),\n _useState12 = Core_slicedToArray(_useState11, 2),\n buttons = _useState12[0],\n setButtons = _useState12[1];\n var _useState13 = (0,react.useState)([]),\n _useState14 = Core_slicedToArray(_useState13, 2),\n correct = _useState14[0],\n setCorrect = _useState14[1];\n var _useState15 = (0,react.useState)([]),\n _useState16 = Core_slicedToArray(_useState15, 2),\n incorrect = _useState16[0],\n setIncorrect = _useState16[1];\n var _useState17 = (0,react.useState)([]),\n _useState18 = Core_slicedToArray(_useState17, 2),\n unanswered = _useState18[0],\n setUnanswered = _useState18[1];\n var _useState19 = (0,react.useState)([]),\n _useState20 = Core_slicedToArray(_useState19, 2),\n userInput = _useState20[0],\n setUserInput = _useState20[1];\n var _useState21 = (0,react.useState)(\'all\'),\n _useState22 = Core_slicedToArray(_useState21, 2),\n filteredValue = _useState22[0],\n setFilteredValue = _useState22[1];\n var _useState23 = (0,react.useState)(1),\n _useState24 = Core_slicedToArray(_useState23, 2),\n userAttempt = _useState24[0],\n setUserAttempt = _useState24[1];\n var _useState25 = (0,react.useState)(true),\n _useState26 = Core_slicedToArray(_useState25, 2),\n showDefaultResultState = _useState26[0],\n setShowDefaultResult = _useState26[1];\n var _useState27 = (0,react.useState)(undefined),\n _useState28 = Core_slicedToArray(_useState27, 2),\n answerSelectionTypeState = _useState28[0],\n setAnswerSelectionType = _useState28[1];\n var _useState29 = (0,react.useState)(0),\n _useState30 = Core_slicedToArray(_useState29, 2),\n totalPoints = _useState30[0],\n setTotalPoints = _useState30[1];\n var _useState31 = (0,react.useState)(0),\n _useState32 = Core_slicedToArray(_useState31, 2),\n correctPoints = _useState32[0],\n setCorrectPoints = _useState32[1];\n var _useState33 = (0,react.useState)(questions[currentQuestionIndex]),\n _useState34 = Core_slicedToArray(_useState33, 2),\n activeQuestion = _useState34[0],\n setActiveQuestion = _useState34[1];\n var _useState35 = (0,react.useState)(undefined),\n _useState36 = Core_slicedToArray(_useState35, 2),\n questionSummary = _useState36[0],\n setQuestionSummary = _useState36[1];\n var _useState37 = (0,react.useState)(timer),\n _useState38 = Core_slicedToArray(_useState37, 2),\n timeRemaining = _useState38[0],\n setTimeRemaining = _useState38[1];\n var _useState39 = (0,react.useState)(true),\n _useState40 = Core_slicedToArray(_useState39, 2),\n isRunning = _useState40[0],\n setIsRunning = _useState40[1];\n (0,react.useEffect)(function () {\n setShowDefaultResult(showDefaultResult !== undefined ? showDefaultResult : true);\n }, [showDefaultResult]);\n (0,react.useEffect)(function () {\n setActiveQuestion(questions[currentQuestionIndex]);\n }, [currentQuestionIndex, questions]);\n (0,react.useEffect)(function () {\n var answerSelectionType = activeQuestion.answerSelectionType;\n // Default single to avoid code breaking due to automatic version upgrade\n setAnswerSelectionType(answerSelectionType || \'single\');\n }, [activeQuestion, currentQuestionIndex]);\n (0,react.useEffect)(function () {\n if (endQuiz) {\n setIsRunning(false);\n var totalPointsTemp = 0;\n var correctPointsTemp = 0;\n for (var i = 0; i < questions.length; i += 1) {\n var point = questions[i].point || 0;\n if (typeof point === \'string\' || point instanceof String) {\n point = parseInt(point, 10);\n }\n totalPointsTemp += point;\n if (correct.includes(i)) {\n correctPointsTemp += point;\n }\n }\n setTotalPoints(totalPointsTemp);\n setCorrectPoints(correctPointsTemp);\n }\n }, [endQuiz]);\n (0,react.useEffect)(function () {\n setQuestionSummary({\n numberOfQuestions: questions.length,\n numberOfCorrectAnswers: correct.length,\n numberOfIncorrectAnswers: incorrect.length,\n questions: questions,\n userInput: userInput,\n totalPoints: totalPoints,\n correctPoints: correctPoints\n });\n }, [totalPoints, correctPoints]);\n (0,react.useEffect)(function () {\n if (endQuiz && onComplete !== undefined && questionSummary !== undefined) {\n onComplete(questionSummary);\n }\n }, [questionSummary]);\n var nextQuestion = function nextQuestion(currentQuestionIdx) {\n setIncorrectAnswer(false);\n setIsCorrect(false);\n setShowNextQuestionButton(false);\n setButtons({});\n if (currentQuestionIdx + 1 === questions.length) {\n if (userInput.length !== questions.length) {\n alert(\'Quiz is incomplete\');\n } else if (allowNavigation) {\n var submitQuiz = confirm(\'You have finished all the questions. Submit Quiz now?\');\n if (submitQuiz) {\n setEndQuiz(true);\n }\n } else {\n setEndQuiz(true);\n }\n } else {\n setCurrentQuestionIndex(currentQuestionIdx + 1);\n }\n };\n var handleChange = function handleChange(event) {\n setFilteredValue(event.target.value);\n };\n var renderAnswerInResult = function renderAnswerInResult(question, userInputIndex) {\n var answers = question.answers,\n correctAnswer = question.correctAnswer,\n questionType = question.questionType;\n var answerSelectionType = question.answerSelectionType;\n var answerBtnCorrectClassName;\n var answerBtnIncorrectClassName;\n\n // Default single to avoid code breaking due to automatic version upgrade\n answerSelectionType = answerSelectionType || \'single\';\n return answers.map(function (answer, index) {\n if (answerSelectionType === \'single\') {\n // correctAnswer - is string\n answerBtnCorrectClassName = "".concat(index + 1) === correctAnswer ? \'correct\' : \'\';\n answerBtnIncorrectClassName = "".concat(userInputIndex) !== correctAnswer && "".concat(index + 1) === "".concat(userInputIndex) ? \'incorrect\' : \'\';\n if (userInputIndex === undefined && "".concat(index + 1) !== correctAnswer) {\n answerBtnIncorrectClassName = \'unanswered\';\n }\n } else {\n // correctAnswer - is array of numbers\n answerBtnCorrectClassName = correctAnswer.includes(index + 1) ? \'correct\' : \'\';\n answerBtnIncorrectClassName = !correctAnswer.includes(index + 1) && userInputIndex !== null && userInputIndex !== void 0 && userInputIndex.includes(index + 1) ? \'incorrect\' : \'\';\n if (userInputIndex === undefined && !correctAnswer.includes(index + 1)) {\n answerBtnIncorrectClassName = \'unanswered\';\n }\n }\n return /*#__PURE__*/react.createElement("div", {\n key: nanoid()\n }, /*#__PURE__*/react.createElement("button", {\n type: "button",\n disabled: true,\n className: "answerBtn btn ".concat(answerBtnCorrectClassName).concat(answerBtnIncorrectClassName)\n }, questionType === \'text\' && /*#__PURE__*/react.createElement("span", null, answer), questionType === \'photo\' && /*#__PURE__*/react.createElement("img", {\n src: answer,\n alt: "answer"\n })));\n });\n };\n var renderTags = function renderTags(answerSelectionType, numberOfSelection, segment) {\n var singleSelectionTagText = appLocale.singleSelectionTagText,\n multipleSelectionTagText = appLocale.multipleSelectionTagText,\n pickNumberOfSelection = appLocale.pickNumberOfSelection;\n return /*#__PURE__*/react.createElement("div", {\n className: "tag-container"\n }, answerSelectionType === \'single\' && /*#__PURE__*/react.createElement("span", {\n className: "single selection-tag"\n }, singleSelectionTagText), answerSelectionType === \'multiple\' && /*#__PURE__*/react.createElement("span", {\n className: "multiple selection-tag"\n }, multipleSelectionTagText), /*#__PURE__*/react.createElement("span", {\n className: "number-of-selection"\n }, pickNumberOfSelection.replace(\'\', numberOfSelection)), segment && /*#__PURE__*/react.createElement("span", {\n className: "selection-tag segment"\n }, segment));\n };\n var isCorrectCheck = function isCorrectCheck(index, correctAnswerIndex) {\n if (typeof correctAnswerIndex === \'string\') {\n return index === Number(correctAnswerIndex);\n }\n if (Core_typeof(correctAnswerIndex) === \'object\') {\n return correctAnswerIndex.find(function (element) {\n return element === index;\n }) !== undefined;\n }\n return false;\n };\n var renderQuizResultQuestions = (0,react.useCallback)(function () {\n var filteredQuestions;\n var filteredUserInput;\n if (filteredValue !== \'all\') {\n var targetQuestions = unanswered;\n if (filteredValue === \'correct\') {\n targetQuestions = correct;\n } else if (filteredValue === \'incorrect\') {\n targetQuestions = incorrect;\n }\n filteredQuestions = questions.filter(function (_, index) {\n return targetQuestions.indexOf(index) !== -1;\n });\n filteredUserInput = userInput.filter(function (_, index) {\n return targetQuestions.indexOf(index) !== -1;\n });\n }\n return (filteredQuestions || questions).map(function (question, index) {\n var userInputIndex = filteredUserInput ? filteredUserInput[index] : userInput[index];\n\n // Default single to avoid code breaking due to automatic version upgrade\n var answerSelectionType = question.answerSelectionType || \'single\';\n return /*#__PURE__*/react.createElement("div", {\n className: "result-answer-wrapper",\n key: nanoid()\n }, /*#__PURE__*/react.createElement("h3", {\n dangerouslySetInnerHTML: rawMarkup("Q".concat(question.questionIndex, ": ").concat(question.question, " ").concat(appLocale.marksOfQuestion.replace(\'\', question.point)))\n }), question.questionPic && /*#__PURE__*/react.createElement("img", {\n src: question.questionPic,\n alt: "question"\n }), renderTags(answerSelectionType, question.correctAnswer.length, question.segment), /*#__PURE__*/react.createElement("div", {\n className: "result-answer"\n }, renderAnswerInResult(question, userInputIndex)), /*#__PURE__*/react.createElement(core_components_Explanation, {\n question: question,\n isResultPage: true\n }));\n });\n }, [endQuiz, filteredValue]);\n var renderAnswers = function renderAnswers(question, answerButtons) {\n var answers = question.answers,\n correctAnswer = question.correctAnswer,\n questionType = question.questionType,\n questionIndex = question.questionIndex;\n var answerSelectionType = question.answerSelectionType;\n var onClickAnswer = function onClickAnswer(index) {\n return checkAnswer(index + 1, correctAnswer, answerSelectionType, answers, {\n userInput: userInput,\n userAttempt: userAttempt,\n currentQuestionIndex: currentQuestionIndex,\n continueTillCorrect: continueTillCorrect,\n showNextQuestionButton: showNextQuestionButton,\n incorrect: incorrect,\n correct: correct,\n setButtons: setButtons,\n setIsCorrect: setIsCorrect,\n setIncorrectAnswer: setIncorrectAnswer,\n setCorrect: setCorrect,\n setIncorrect: setIncorrect,\n setShowNextQuestionButton: setShowNextQuestionButton,\n setUserInput: setUserInput,\n setUserAttempt: setUserAttempt\n });\n };\n var onSelectAnswer = function onSelectAnswer(index) {\n return selectAnswer(index + 1, correctAnswer, answerSelectionType, answers, {\n userInput: userInput,\n currentQuestionIndex: currentQuestionIndex,\n setButtons: setButtons,\n setShowNextQuestionButton: setShowNextQuestionButton,\n incorrect: incorrect,\n correct: correct,\n setCorrect: setCorrect,\n setIncorrect: setIncorrect,\n setUserInput: setUserInput\n });\n };\n var checkSelectedAnswer = function checkSelectedAnswer(index) {\n if (userInput[questionIndex - 1] === undefined) {\n return false;\n }\n if (answerSelectionType === \'single\') {\n return userInput[questionIndex - 1] === index;\n }\n return Array.isArray(userInput[questionIndex - 1]) && userInput[questionIndex - 1].includes(index);\n };\n\n // Default single to avoid code breaking due to automatic version upgrade\n answerSelectionType = answerSelectionType || \'single\';\n return answers.map(function (answer, index) {\n return /*#__PURE__*/react.createElement(react.Fragment, {\n key: nanoid()\n }, answerButtons[index] !== undefined ? /*#__PURE__*/react.createElement("button", {\n type: "button",\n disabled: answerButtons[index].disabled || false,\n className: "".concat(answerButtons[index].className, " answerBtn btn ").concat(isCorrectCheck(index + 1, correctAnswer) && showInstantFeedback ? \'correct\' : \'\'),\n onClick: function onClick() {\n return revealAnswerOnSubmit ? onSelectAnswer(index) : onClickAnswer(index);\n }\n }, questionType === \'text\' && /*#__PURE__*/react.createElement("span", null, answer), questionType === \'photo\' && /*#__PURE__*/react.createElement("img", {\n src: answer,\n alt: "answer"\n })) : /*#__PURE__*/react.createElement("button", {\n type: "button",\n onClick: function onClick() {\n return revealAnswerOnSubmit ? onSelectAnswer(index) : onClickAnswer(index);\n },\n className: "answerBtn btn ".concat(allowNavigation && checkSelectedAnswer(index + 1) ? \'selected\' : null)\n }, questionType === \'text\' && answer, questionType === \'photo\' && /*#__PURE__*/react.createElement("img", {\n src: answer,\n alt: "answer"\n })));\n });\n };\n var getUnansweredQuestions = function getUnansweredQuestions() {\n questions.forEach(function (question, index) {\n if (userInput[index] === undefined) {\n setUnanswered(function (oldArray) {\n return [].concat(Core_toConsumableArray(oldArray), [index]);\n });\n }\n });\n };\n var renderResult = function renderResult() {\n return /*#__PURE__*/react.createElement("div", {\n className: "card-body"\n }, /*#__PURE__*/react.createElement("h2", null, appLocale.resultPageHeaderText.replace(\'\', correct.length).replace(\'\', questions.length)), /*#__PURE__*/react.createElement("h2", null, appLocale.resultPagePoint.replace(\'\', correctPoints).replace(\'\', totalPoints)), /*#__PURE__*/react.createElement("br", null), /*#__PURE__*/react.createElement(core_components_QuizResultFilter, {\n filteredValue: filteredValue,\n handleChange: handleChange,\n appLocale: appLocale\n }), renderQuizResultQuestions());\n };\n (0,react.useEffect)(function () {\n var countdown;\n if (timer && isRunning && timeRemaining > 0) {\n countdown = setInterval(function () {\n setTimeRemaining(function (prevTime) {\n return prevTime - 1;\n });\n }, 1000);\n }\n return function () {\n return timer && clearInterval(countdown);\n };\n }, [isRunning, timeRemaining, timer]);\n var toggleTimer = function toggleTimer() {\n setIsRunning(!isRunning);\n };\n var formatTime = function formatTime(time) {\n return time < 10 ? \'0\' : \'\';\n };\n var displayTime = function displayTime(time) {\n var hours = Math.floor(time / 3600);\n var minutes = Math.floor(time % 3600 / 60);\n var seconds = time % 60;\n return "".concat(formatTime(hours)).concat(hours, ":").concat(formatTime(minutes)).concat(minutes, ":").concat(formatTime(seconds)).concat(seconds);\n };\n var handleTimeUp = function handleTimeUp() {\n setIsRunning(false);\n setEndQuiz(true);\n getUnansweredQuestions();\n };\n return /*#__PURE__*/react.createElement("div", {\n className: "questionWrapper"\n }, timer && !isRunning && /*#__PURE__*/react.createElement("div", null, appLocale.timerTimeTaken, ":", \' \', /*#__PURE__*/react.createElement("b", null, displayTime(timer - timeRemaining))), timer && isRunning && /*#__PURE__*/react.createElement("div", null, appLocale.timerTimeRemaining, ":", \' \', /*#__PURE__*/react.createElement("b", null, displayTime(timeRemaining))), timer && timeRemaining === 0 && isRunning && handleTimeUp(), !endQuiz && /*#__PURE__*/react.createElement("div", {\n className: "questionWrapperBody"\n }, /*#__PURE__*/react.createElement("div", null, "".concat(appLocale.question, " ").concat(currentQuestionIndex + 1, " / ").concat(questions.length, ":"), /*#__PURE__*/react.createElement("br", null), timer && allowPauseTimer && /*#__PURE__*/react.createElement("button", {\n type: "button",\n className: "timerBtn",\n onClick: toggleTimer\n }, isRunning ? appLocale.pauseScreenPause : appLocale.pauseScreenResume)), isRunning ? /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("h3", {\n dangerouslySetInnerHTML: rawMarkup("".concat(activeQuestion && activeQuestion.question, " ").concat(appLocale.marksOfQuestion.replace(\'\', activeQuestion.point)))\n }), activeQuestion && activeQuestion.questionPic && /*#__PURE__*/react.createElement("img", {\n src: activeQuestion.questionPic,\n alt: "question"\n }), activeQuestion && renderTags(answerSelectionTypeState, activeQuestion.correctAnswer.length, activeQuestion.segment), /*#__PURE__*/react.createElement("div", {\n className: "questionModal"\n }, /*#__PURE__*/react.createElement(core_components_InstantFeedback, {\n question: activeQuestion,\n showInstantFeedback: showInstantFeedback,\n correctAnswer: isCorrect,\n incorrectAnswer: incorrectAnswer,\n onQuestionSubmit: onQuestionSubmit,\n userAnswer: Core_toConsumableArray(userInput).pop()\n })), activeQuestion && renderAnswers(activeQuestion, buttons), (showNextQuestionButton || allowNavigation) && /*#__PURE__*/react.createElement("div", {\n className: "questionBtnContainer"\n }, allowNavigation && currentQuestionIndex > 0 && /*#__PURE__*/react.createElement("button", {\n onClick: function onClick() {\n return nextQuestion(currentQuestionIndex - 2);\n },\n className: "prevQuestionBtn btn",\n type: "button"\n }, appLocale.prevQuestionBtn), /*#__PURE__*/react.createElement("button", {\n onClick: function onClick() {\n return nextQuestion(currentQuestionIndex);\n },\n className: "nextQuestionBtn btn",\n type: "button"\n }, appLocale.nextQuestionBtn))) : /*#__PURE__*/react.createElement("span", {\n className: "timerPauseScreen dark:text-white text-black"\n }, /*#__PURE__*/react.createElement("br", null), /*#__PURE__*/react.createElement("br", null), appLocale.pauseScreenDisplay)), endQuiz && showDefaultResultState && customResultPage === undefined && renderResult(), endQuiz && !showDefaultResultState && customResultPage !== undefined && customResultPage(questionSummary));\n}\n/* harmony default export */ const lib_Core = (Core);\n;// CONCATENATED MODULE: ./src/lib/Locale.jsx\nvar defaultLocale = {\n landingHeaderText: \' Questions\',\n question: \'Question\',\n startQuizBtn: \'Start Quiz\',\n resultFilterAll: \'All\',\n resultFilterCorrect: \'Correct\',\n resultFilterIncorrect: \'Incorrect\',\n resultFilterUnanswered: \'Unanswered\',\n nextQuestionBtn: \'Next\',\n prevQuestionBtn: \'Prev\',\n resultPageHeaderText: \'You have completed the quiz. You got out of questions.\',\n resultPagePoint: \'You scored out of .\',\n pauseScreenDisplay: \'Test is paused. Clicked the Resume button to continue\',\n timerTimeRemaining: \'Time Remaining\',\n timerTimeTaken: \'Time Taken\',\n pauseScreenPause: \'Pause\',\n pauseScreenResume: \'Resume\',\n singleSelectionTagText: \'Single Selection\',\n multipleSelectionTagText: \'Multiple Selection\',\n pickNumberOfSelection: \'Pick \',\n marksOfQuestion: \'( marks)\'\n};\n/* harmony default export */ const Locale = (defaultLocale);\n;// CONCATENATED MODULE: ./src/lib/Quiz.jsx\nfunction Quiz_typeof(o) { "@babel/helpers - typeof"; return Quiz_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, Quiz_typeof(o); }\nfunction Quiz_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction Quiz_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? Quiz_ownKeys(Object(t), !0).forEach(function (r) { Quiz_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Quiz_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction Quiz_defineProperty(obj, key, value) { key = Quiz_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction Quiz_toPropertyKey(arg) { var key = Quiz_toPrimitive(arg, "string"); return Quiz_typeof(key) === "symbol" ? key : String(key); }\nfunction Quiz_toPrimitive(input, hint) { if (Quiz_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (Quiz_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }\nfunction Quiz_slicedToArray(arr, i) { return Quiz_arrayWithHoles(arr) || Quiz_iterableToArrayLimit(arr, i) || Quiz_unsupportedIterableToArray(arr, i) || Quiz_nonIterableRest(); }\nfunction Quiz_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction Quiz_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Quiz_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Quiz_arrayLikeToArray(o, minLen); }\nfunction Quiz_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction Quiz_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction Quiz_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\n\nfunction Quiz(_ref) {\n var quiz = _ref.quiz,\n shuffle = _ref.shuffle,\n shuffleAnswer = _ref.shuffleAnswer,\n showDefaultResult = _ref.showDefaultResult,\n onComplete = _ref.onComplete,\n customResultPage = _ref.customResultPage,\n showInstantFeedback = _ref.showInstantFeedback,\n continueTillCorrect = _ref.continueTillCorrect,\n revealAnswerOnSubmit = _ref.revealAnswerOnSubmit,\n allowNavigation = _ref.allowNavigation,\n onQuestionSubmit = _ref.onQuestionSubmit,\n disableSynopsis = _ref.disableSynopsis,\n timer = _ref.timer,\n allowPauseTimer = _ref.allowPauseTimer;\n var _useState = (0,react.useState)(false),\n _useState2 = Quiz_slicedToArray(_useState, 2),\n start = _useState2[0],\n setStart = _useState2[1];\n var _useState3 = (0,react.useState)(quiz.questions),\n _useState4 = Quiz_slicedToArray(_useState3, 2),\n questions = _useState4[0],\n setQuestions = _useState4[1];\n var nrOfQuestions = quiz.nrOfQuestions && quiz.nrOfQuestions < quiz.questions.length ? quiz.nrOfQuestions : quiz.questions.length;\n\n // Shuffle answers funtion here\n var shuffleAnswerSequence = function shuffleAnswerSequence() {\n var oldQuestions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var newQuestions = oldQuestions.map(function (question) {\n var _question$answers;\n var answerWithIndex = (_question$answers = question.answers) === null || _question$answers === void 0 ? void 0 : _question$answers.map(function (ans, i) {\n return [ans, i];\n });\n var shuffledAnswersWithIndex = answerWithIndex.sort(function () {\n return Math.random() - 0.5;\n });\n var shuffledAnswers = shuffledAnswersWithIndex.map(function (ans) {\n return ans[0];\n });\n if (question.answerSelectionType === \'single\') {\n var oldCorrectAnswer = question.correctAnswer;\n var newCorrectAnswer = shuffledAnswersWithIndex.findIndex(function (ans) {\n return "".concat(ans[1] + 1) === "".concat(oldCorrectAnswer);\n }) + 1;\n return Quiz_objectSpread(Quiz_objectSpread({}, question), {}, {\n correctAnswer: "".concat(newCorrectAnswer),\n answers: shuffledAnswers\n });\n }\n if (question.answerSelectionType === \'multiple\') {\n var _oldCorrectAnswer = question.correctAnswer;\n var _newCorrectAnswer = _oldCorrectAnswer.map(function (cans) {\n return shuffledAnswersWithIndex.findIndex(function (ans) {\n return "".concat(ans[1] + 1) === "".concat(cans);\n }) + 1;\n });\n return Quiz_objectSpread(Quiz_objectSpread({}, question), {}, {\n correctAnswer: _newCorrectAnswer,\n answers: shuffledAnswers\n });\n }\n return question;\n });\n return newQuestions;\n };\n var shuffleQuestions = (0,react.useCallback)(function (q) {\n for (var i = q.length - 1; i > 0; i -= 1) {\n var j = Math.floor(Math.random() * (i + 1));\n var _ref2 = [q[j], q[i]];\n q[i] = _ref2[0];\n q[j] = _ref2[1];\n }\n return q;\n }, []);\n (0,react.useEffect)(function () {\n if (disableSynopsis) setStart(true);\n }, []);\n (0,react.useEffect)(function () {\n var newQuestions = quiz.questions;\n if (shuffle) {\n newQuestions = shuffleQuestions(newQuestions);\n }\n if (shuffleAnswer) {\n newQuestions = shuffleAnswerSequence(newQuestions);\n }\n newQuestions.length = nrOfQuestions;\n newQuestions = newQuestions.map(function (question, index) {\n return Quiz_objectSpread(Quiz_objectSpread({}, question), {}, {\n questionIndex: index + 1\n });\n });\n setQuestions(newQuestions);\n }, [start]);\n var validateQuiz = function validateQuiz(q) {\n if (!q) {\n console.error(\'Quiz object is required.\');\n return false;\n }\n if (timer && typeof timer !== \'number\' || timer < 1) {\n console.error(timer && typeof timer !== \'number\' ? \'timer must be a number\' : \'timer must be a number greater than 0\');\n return false;\n }\n if (allowPauseTimer && typeof allowPauseTimer !== \'boolean\') {\n console.error(\'allowPauseTimer must be a Boolean\');\n return false;\n }\n for (var i = 0; i < questions.length; i += 1) {\n var _questions$i = questions[i],\n question = _questions$i.question,\n questionType = _questions$i.questionType,\n answerSelectionType = _questions$i.answerSelectionType,\n answers = _questions$i.answers,\n correctAnswer = _questions$i.correctAnswer;\n if (!question) {\n console.error("Field \'question\' is required.");\n return false;\n }\n if (!questionType) {\n console.error("Field \'questionType\' is required.");\n return false;\n }\n if (questionType !== \'text\' && questionType !== \'photo\') {\n console.error("The value of \'questionType\' is either \'text\' or \'photo\'.");\n return false;\n }\n if (!answers) {\n console.error("Field \'answers\' is required.");\n return false;\n }\n if (!Array.isArray(answers)) {\n console.error("Field \'answers\' has to be an Array");\n return false;\n }\n if (!correctAnswer) {\n console.error("Field \'correctAnswer\' is required.");\n return false;\n }\n var selectType = answerSelectionType;\n if (!answerSelectionType) {\n // Default single to avoid code breaking due to automatic version upgrade\n console.warn(\'Field answerSelectionType should be defined since v0.3.0. Use single by default.\');\n selectType = answerSelectionType || \'single\';\n }\n if (selectType === \'single\' && !(typeof selectType === \'string\' || selectType instanceof String)) {\n console.error(\'answerSelectionType is single but expecting String in the field correctAnswer\');\n return false;\n }\n if (selectType === \'multiple\' && !Array.isArray(correctAnswer)) {\n console.error(\'answerSelectionType is multiple but expecting Array in the field correctAnswer\');\n return false;\n }\n }\n return true;\n };\n if (!validateQuiz(quiz)) {\n return null;\n }\n var appLocale = Quiz_objectSpread(Quiz_objectSpread({}, Locale), quiz.appLocale);\n return /*#__PURE__*/react.createElement("div", {\n className: "react-quiz-container"\n }, !start && /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("h2", null, quiz.quizTitle), /*#__PURE__*/react.createElement("div", null, appLocale.landingHeaderText.replace(\'\', nrOfQuestions)), quiz.quizSynopsis && /*#__PURE__*/react.createElement("div", {\n className: "quiz-synopsis"\n }, quiz.quizSynopsis), /*#__PURE__*/react.createElement("div", {\n className: "startQuizWrapper"\n }, /*#__PURE__*/react.createElement("button", {\n type: "button",\n onClick: function onClick() {\n return setStart(true);\n },\n className: "startQuizBtn btn"\n }, appLocale.startQuizBtn))), start && /*#__PURE__*/react.createElement(lib_Core, {\n questions: questions,\n showDefaultResult: showDefaultResult,\n onComplete: onComplete,\n customResultPage: customResultPage,\n showInstantFeedback: showInstantFeedback,\n continueTillCorrect: continueTillCorrect,\n revealAnswerOnSubmit: revealAnswerOnSubmit,\n allowNavigation: allowNavigation,\n appLocale: appLocale,\n onQuestionSubmit: onQuestionSubmit,\n timer: timer,\n allowPauseTimer: allowPauseTimer\n }));\n}\n/* harmony default export */ const lib_Quiz = (Quiz);\n;// CONCATENATED MODULE: ./src/docs/quiz.jsx\nvar segment = {\n basic: \'Basic\',\n medium: \'Medium\',\n advanced: \'Advanced\'\n};\nvar quiz = {\n quizTitle: \'React Quiz Component Demo\',\n quizSynopsis: \'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim\',\n nrOfQuestions: \'6\',\n questions: [{\n question: \'How can you access the state of a component from inside of a member function?\',\n questionPic: \'https://dummyimage.com/600x400/000/fff&text=X\',\n questionType: \'text\',\n answerSelectionType: \'single\',\n answers: [\'this.getState()\', \'this.prototype.stateValue\', \'this.state\', \'this.values\'],\n correctAnswer: \'3\',\n messageForCorrectAnswer: \'Correct answer. Good job.\',\n messageForIncorrectAnswer: \'Incorrect answer. Please try again.\',\n explanation: \'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\',\n point: \'20\',\n segment: segment.advanced\n }, {\n question: \'ReactJS is developed by ?\',\n questionType: \'text\',\n answerSelectionType: \'single\',\n answers: [\'Google Engineers\', \'Facebook Engineers\'],\n correctAnswer: \'2\',\n messageForCorrectAnswer: \'Correct answer. Good job.\',\n messageForIncorrectAnswer: \'Incorrect answer. Please try again.\',\n explanation: \'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\',\n point: \'20\',\n segment: segment.basic\n }, {\n question: \'ReactJS is an MVC based framework?\',\n questionType: \'text\',\n answerSelectionType: \'single\',\n answers: [\'True\', \'False\'],\n correctAnswer: \'2\',\n messageForCorrectAnswer: \'Correct answer. Good job.\',\n messageForIncorrectAnswer: \'Incorrect answer. Please try again.\',\n explanation: \'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\',\n point: \'10\'\n }, {\n question: \'Which of the following concepts is/are key to ReactJS?\',\n questionType: \'text\',\n answerSelectionType: \'single\',\n answers: [\'Component-oriented design\', \'Event delegation model\', \'Both of the above\'],\n correctAnswer: \'3\',\n messageForCorrectAnswer: \'Correct answer. Good job.\',\n messageForIncorrectAnswer: \'Incorrect answer. Please try again.\',\n explanation: \'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\',\n point: \'30\',\n segment: segment.medium\n }, {\n question: \'How does the initial page of any react project looks like if we create the project using vite\',\n questionType: \'photo\',\n answerSelectionType: \'single\',\n answers: [\'https://github.com/wingkwong/react-quiz-component/assets/35857179/e169cd44-13a7-4301-9d30-6c0859d3ac35\', \'https://github.com/wingkwong/react-quiz-component/assets/35857179/30b4aa3d-2523-4d73-9e3b-27ce44ffd50a\', \'https://github.com/wingkwong/react-quiz-component/assets/35857179/64da0348-30b7-4a13-9fea-791537c49109\', \'https://github.com/wingkwong/react-quiz-component/assets/35857179/660e9255-8a16-4e0f-a7e4-81ba6ac0f9bc\'],\n correctAnswer: \'1\',\n messageForCorrectAnswer: \'Correct answer. Good job.\',\n messageForIncorrectAnswer: \'Incorrect answer. Please try again.\',\n explanation: \'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\',\n point: \'20\'\n }, {\n question: \'What are the advantages of React JS?\',\n questionType: \'text\',\n answerSelectionType: \'multiple\',\n answers: [\'React can be used on client and as well as server side too\', \'Using React increases readability and makes maintainability easier. Component, Data patterns improves readability and thus makes it easier for manitaining larger apps\', \'React components have lifecycle events that fall into State/Property Updates\', \'React can be used with any other framework (Backbone.js, Angular.js) as it is only a view layer\'],\n correctAnswer: [1, 2, 4],\n messageForCorrectAnswer: \'Correct answer. Good job.\',\n messageForIncorrectAnswer: \'Incorrect answer. Please try again.\',\n explanation: \'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\',\n point: \'20\'\n }]\n};\n/* harmony default export */ const docs_quiz = (quiz);\n;// CONCATENATED MODULE: ./src/docs/index.jsx\nfunction docs_slicedToArray(arr, i) { return docs_arrayWithHoles(arr) || docs_iterableToArrayLimit(arr, i) || docs_unsupportedIterableToArray(arr, i) || docs_nonIterableRest(); }\nfunction docs_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction docs_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return docs_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return docs_arrayLikeToArray(o, minLen); }\nfunction docs_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction docs_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction docs_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\n\nvar container = document.getElementById(\'app\');\nvar root = (0,client/* createRoot */.C)(container);\nfunction App() {\n var _useState = (0,react.useState)(),\n _useState2 = docs_slicedToArray(_useState, 2),\n quizResult = _useState2[0],\n setQuizResult = _useState2[1];\n return /*#__PURE__*/react.createElement("div", {\n style: {\n margin: \'auto\',\n width: \'500px\'\n }\n }, /*#__PURE__*/react.createElement(lib_Quiz, {\n quiz: docs_quiz,\n shuffle: true,\n shuffleAnswer: true,\n showInstantFeedback: true\n // continueTillCorrect\n ,\n onComplete: setQuizResult,\n onQuestionSubmit: function onQuestionSubmit(obj) {\n return console.log(\'user question results:\', obj);\n },\n disableSynopsis: true,\n timer: 60,\n allowPauseTimer: true\n }));\n}\nroot.render( /*#__PURE__*/react.createElement(App, null));//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTIwLmpzIiwibWFwcGluZ3MiOiI7Ozs7OztBQUFBO0FBQ0E7OztBQ0RBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7Ozs7Ozs7QUMzQkE7QUFFQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBRUE7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUFBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFBQTtBQUVBO0FBQUE7QUFHQTtBQUFBO0FBSUE7QUFDQTtBQUNBO0FBQUE7QUFHQTtBQUdBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQUE7QUFLQTtBQUdBO0FBQUE7QUFBQTtBQ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mIChlLmtleSA9PT0gJ0VudGVyJykge1xuICAgICAgICAgICAgdG9nZ2xlRHJvcGRvd24oKTtcbiAgICAgICAgICB9XG4gICAgICAgIH19XG4gICAgICAgIHJvbGU9XCJidXR0b25cIlxuICAgICAgICB0YWJJbmRleD17MH1cbiAgICAgID5cbiAgICAgICAgPGRpdiBjbGFzc05hbWU9e2BzZWxlY3RlZC1vcHRpb24gJHtzZWxlY3RlZE9wdGlvbkNsYXNzfWB9PlxuICAgICAgICAgIHtmaWx0ZXJlZFZhbHVlID09PSAnYWxsJyA/IGFwcExvY2FsZS5yZXN1bHRGaWx0ZXJBbGwgOiBmaWx0ZXJlZFZhbHVlfVxuICAgICAgICA8L2Rpdj5cbiAgICAgICAgPHNwYW4gY2xhc3NOYW1lPXtgYXJyb3cgJHtpc09wZW4gPyAndXAnIDogJ2Rvd24nfWB9IC8+XG4gICAgICA8L2Rpdj5cbiAgICAgIHtpc09wZW4gJiYgKFxuICAgICAgICA8ZGl2XG4gICAgICAgICAgY2xhc3NOYW1lPVwiZHJvcGRvd24tb3B0aW9uc1wiXG4gICAgICAgICAgcm9sZT1cIm1lbnVcIlxuICAgICAgICAgIGFyaWEtbGFiZWxsZWRieT1cInF1aXotZmlsdGVyXCJcbiAgICAgICAgPlxuICAgICAgICAgIDxkaXZcbiAgICAgICAgICAgIGNsYXNzTmFtZT17YGRyb3Bkb3duLW9wdGlvbnMtaXRlbSAke1xuICAgICAgICAgICAgICBmaWx0ZXJlZFZhbHVlID09PSAnYWxsJyA/ICdzZWxlY3RlZCcgOiAnJ1xuICAgICAgICAgICAgfWB9XG4gICAgICAgICAgICBvbkNsaWNrPXsoKSA9PiBoYW5kbGVPcHRpb25DbGljaygnYWxsJyl9XG4gICAgICAgICAgICBvbktleURvd249eyhlKSA9PiB7XG4gICAgICAgICAgICAgIGlmIChlLmtleSA9PT0gJ0VudGVyJykge1xuICAgICAgICAgICAgICAgIGhhbmRsZU9wdGlvbkNsaWNrKCdhbGwnKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfX1cbiAgICAgICAgICAgIHJvbGU9XCJtZW51aXRlbVwiXG4gICAgICAgICAgICB0YWJJbmRleD17MH1cbiAgICAgICAgICA+XG4gICAgICAgICAgICB7YXBwTG9jYWxlLnJlc3VsdEZpbHRlckFsbH1cbiAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICA8ZGl2XG4gICAgICAgICAgICBjbGFzc05hbWU9e2Bkcm9wZG93bi1vcHRpb25zLWl0ZW0gJHtcbiAgICAgICAgICAgICAgZmlsdGVyZWRWYWx1ZSA9PT0gJ2NvcnJlY3QnID8gJ3NlbGVjdGVkJyA6ICcnXG4gICAgICAgICAgICB9YH1cbiAgICAgICAgICAgIG9uQ2xpY2s9eygpID0+IGhhbmRsZU9wdGlvbkNsaWNrKCdjb3JyZWN0Jyl9XG4gICAgICAgICAgICBvbktleURvd249eyhlKSA9PiB7XG4gICAgICAgICAgICAgIGlmIChlLmtleSA9PT0gJ0VudGVyJykge1xuICAgICAgICAgICAgICAgIGhhbmRsZU9wdGlvbkNsaWNrKCdjb3JyZWN0Jyk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH19XG4gICAgICAgICAgICByb2xlPVwibWVudWl0ZW1cIlxuICAgICAgICAgICAgdGFiSW5kZXg9ezB9XG4gICAgICAgICAgPlxuICAgICAgICAgICAge2FwcExvY2FsZS5yZXN1bHRGaWx0ZXJDb3JyZWN0fVxuICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgIDxkaXZcbiAgICAgICAgICAgIGNsYXNzTmFtZT17YGRyb3Bkb3duLW9wdGlvbnMtaXRlbSAke1xuICAgICAgICAgICAgICBmaWx0ZXJlZFZhbHVlID09PSAnaW5jb3JyZWN0JyA/ICdzZWxlY3RlZCcgOiAnJ1xuICAgICAgICAgICAgfWB9XG4gICAgICAgICAgICBvbkNsaWNrPXsoKSA9PiBoYW5kbGVPcHRpb25DbGljaygnaW5jb3JyZWN0Jyl9XG4gICAgICAgICAgICBvbktleURvd249eyhlKSA9PiB7XG4gICAgICAgICAgICAgIGlmIChlLmtleSA9PT0gJ0VudGVyJykge1xuICAgICAgICAgICAgICAgIGhhbmRsZU9wdGlvbkNsaWNrKCdpbmNvcnJlY3QnKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfX1cbiAgICAgICAgICAgIHJvbGU9XCJtZW51aXRlbVwiXG4gICAgICAgICAgICB0YWJJbmRleD17MH1cbiAgICAgICAgICA+XG4gICAgICAgICAgICB7YXBwTG9jYWxlLnJlc3VsdEZpbHRlckluY29ycmVjdH1cbiAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICA8ZGl2XG4gICAgICAgICAgICBjbGFzc05hbWU9e2Bkcm9wZG93bi1vcHRpb25zLWl0ZW0gJHtcbiAgICAgICAgICAgICAgZmlsdGVyZWRWYWx1ZSA9PT0gJ3VuYW5zd2VyZWQnID8gJ3NlbGVjdGVkJyA6ICcnXG4gICAgICAgICAgICB9YH1cbiAgICAgICAgICAgIG9uQ2xpY2s9eygpID0+IGhhbmRsZU9wdGlvbkNsaWNrKCd1bmFuc3dlcmVkJyl9XG4gICAgICAgICAgICBvbktleURvd249eyhlKSA9PiB7XG4gICAgICAgICAgICAgIGlmIChlLmtleSA9PT0gJ0VudGVyJykge1xuICAgICAgICAgICAgICAgIGhhbmRsZU9wdGlvbkNsaWNrKCd1bmFuc3dlcmVkJyk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH19XG4gICAgICAgICAgICByb2xlPVwibWVudWl0ZW1cIlxuICAgICAgICAgICAgdGFiSW5kZXg9ezB9XG4gICAgICAgICAgPlxuICAgICAgICAgICAge2FwcExvY2FsZS5yZXN1bHRGaWx0ZXJVbmFuc3dlcmVkfVxuICAgICAgICAgIDwvZGl2PlxuICAgICAgICA8L2Rpdj5cbiAgICAgICl9XG4gICAgPC9kaXY+XG4gICk7XG59XG5cbmV4cG9ydCBkZWZhdWx0IFF1aXpSZXN1bHR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xuICAgICAgfVxuXG4gICAgICBzZXRCdXR0b25zKChwcmV2U3RhdGUpID0+ICh7XG4gICAgICAgIC4uLnByZXZTdGF0ZSxcbiAgICAgICAgLi4uZGlzYWJsZWRBbGwsXG4gICAgICAgIFtpbmRleCAtIDFdOiB7XG4gICAgICAgICAgY2xhc3NOYW1lOiAoaW5kZXhTdHIgPT09IGNvcnJlY3RBbnN3ZXIpID8gJ2NvcnJlY3QnIDogJ2luY29ycmVjdCcsXG4gICAgICAgIH0sXG4gICAgICB9KSk7XG5cbiAgICAgIHNldElzQ29ycmVjdCh0cnVlKTtcbiAgICAgIHNldEluY29ycmVjdEFuc3dlcihmYWxzZSk7XG4gICAgICBzZXRDb3JyZWN0KGNvcnJlY3QpO1xuICAgICAgc2V0U2hvd05leHRRdWVzdGlvbkJ1dHRvbih0cnVlKTtcbiAgICB9IGVsc2Uge1xuICAgICAgaWYgKGNvcnJlY3QuaW5kZXhPZihjdXJyZW50UXVlc3Rpb25JbmRleCkgPCAwICYmIGluY29ycmVjdC5pbmRleE9mKGN1cnJlbnRRdWVzdGlvbkluZGV4KSA8IDApIHtcbiAgICAgICAgaW5jb3JyZWN0LnB1c2goY3VycmVudFF1ZXN0aW9uSW5kZXgpO1xuICAgICAgfVxuXG4gICAgICBpZiAoY29udGludWVUaWxsQ29ycmVjdCkge1xuICAgICAgICBzZXRCdXR0b25zKChwcmV2U3RhdGUpID0+IChcbiAgICAgICAgICB7XG5cbiAgICAgICAgICAgIC4uLnByZXZTdGF0ZSxcbiAgICAgICAgICAgIFtpbmRleCAtIDFdOiB7XG4gICAgICAgICAgICAgIGRpc2FibGVkOiAhcHJldlN0YXRlW2luZGV4IC0gMV0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgIH1cbiAgICAgICAgKSk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBzZXRCdXR0b25zKChwcmV2U3RhdGUpID0+IChcbiAgICAgICAgICB7XG5cbiAgICAgICAgICAgIC4uLnByZXZTdGF0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nV0dG9uc1tpbmRleF0gIT09IHVuZGVmaW5lZClcbiAgICAgICAgICA/IChcbiAgICAgICAgICAgIDxidXR0b25cbiAgICAgICAgICAgICAgdHlwZT1cImJ1dHRvblwiXG4gICAgICAgICAgICAgIGRpc2FibGVkPXthbnN3ZXJCdXR0b25zW2luZGV4XS5kaXNhYmxlZCB8fCBmYWxzZX1cbiAgICAgICAgICAgICAgY2xhc3NOYW1lPXtgJHthbnN3ZXJCdXR0b25zW2luZGV4XS5jbGFzc05hbWV9IGFuc3dlckJ0biBidG4gJHtcbiAgICAgICAgICAgICAgICBpc0NvcnJlY3RDaGVjayhpbmRleCArIDEsIGNvcnJlY3RBbnN3ZXIpICYmIHNob3dJbnN0YW50RmVlZGJhY2tcbiAgICAgICAgICAgICAgICAgID8gJ2NvcnJlY3QnXG4gICAgICAgICAgICAgICAgICA6ICcnXG4gICAgICAgICAgICAgIH1gfVxuICAgICAgICAgICAgICBvbkNsaWNrPXsoKSA9PiAocmV2ZWFsQW5zd2VyT25TdWJtaXQgPyBvblNlbGVjdEFuc3dlcihpbmRleCkgOiBvbkNsaWNrQW5zd2VyKGluZGV4KSl9XG4gICAgICAgICAgICA+XG4gICAgICAgICAgICAgIHtxdWVzdGlvblR5cGUgPT09ICd0ZXh0JyAmJiA8c3Bhbj57YW5zd2VyfTwvc3Bhbj59XG4gICAgICAgICAgICAgIHtxdWVzdGlvblR5cGUgPT09ICdwaG90bycgJiYgPGltZyBzcmM9e2Fuc3dlcn0gYWx0PVwiYW5zd2VyXCIgLz59XG4gICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICApXG4gICAgICAgICAgOiAoXG4gICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgIHR5cGU9XCJidXR0b25cIlxuICAgICAgICAgICAgICBvbkNsaWNrPXsoKSA9PiAocmV2ZWFsQW5zd2VyT25TdWJtaXQgPyBvblNlbGVjdEFuc3dlcihpbmRleCkgOiBvbkNsaWNrQW5zd2VyKGluZG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gY29uc3QgaG91cnMgPSBNYXRoLmZsb29yKHRpbWUgLyAzNjAwKTtcbiAgICBjb25zdCBtaW51dGVzID0gTWF0aC5mbG9vcigodGltZSAlIDM2MDApIC8gNjApO1xuICAgIGNvbnN0IHNlY29uZHMgPSB0aW1lICUgNjA7XG5cbiAgICByZXR1cm4gYCR7Zm9ybWF0VGltZShob3Vycyl9JHtob3Vyc306JHtmb3JtYXRUaW1lKG1pbnV0ZXMpfSR7bWludXRlc306JHtcbiAgICAgIGZvcm1hdFRpbWUoc2Vjb25kcylcbiAgICB9JHtzZWNvbmRzfWA7XG4gIH07XG5cbiAgY29uc3QgaGFuZGxlVGltZVVwID0gKCkgPT4ge1xuICAgIHNldElzUnVubmluZyhmYWxzZSk7XG4gICAgc2V0RW5kUXVpeih0cnVlKTtcbiAgICBnZXRVbmFuc3dlcmVkUXVlc3Rpb25zKCk7XG4gIH07XG5cbiAgcmV0dXJuIChcbiAgICA8ZGl2IGNsYXNzTmFtZT1cInF1ZXN0aW9uV3JhcHBlclwiPlxuICAgICAge3RpbWVyICYmICFpc1J1bm5pbmcgJiYgKFxuICAgICAgICA8ZGl2PlxuICAgICAgICAgIHthcHBMb2NhbGUudGltZXJUaW1lVGFrZW59XG4gICAgICAgICAgOlxuICAgICAgICAgIHsnICd9XG4gICAgICAgICAgPGI+e2Rpc3BsYXlUaW1lKHRpbWVyIC0gdGltZVJlbWFpbmluZyl9PC9iPlxuICAgICAgICA8L2Rpdj5cbiAgICAgICl9XG5cbiAgICAgIHt0aW1lciAmJiBpc1J1bm5pbmcgJiYgKFxuICAgICAgICA8ZGl2PlxuICAgICAgICAgIHthcHBMb2NhbGUudGltZXJUaW1lUmVtYWluaW5nfVxuICAgICAgICAgIDpcbiAgICAgICAgICB7JyAnfVxuICAgICAgICAgIDxiPlxuICAgICAgICAgICAge2Rpc3BsYXlUaW1lKHRpbWVSZW1haW5pbmcpfVxuICAgICAgICAgIDwvYj5cbiAgICAgICAgPC9kaXY+XG4gICAgICApfVxuICAgICAge3RpbWVyICYmIHRpbWVSZW1haW5pbmcgPT09IDAgJiYgaXNSdW5uaW5nICYmIGhhbmRsZVRpbWVVcCgpfVxuXG4gICAgICB7IWVuZFF1aXogJiYgKFxuICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cInF1ZXN0aW9uV3JhcHBlckJvZHlcIj5cbiAgICAgICAgICA8ZGl2PlxuICAgICAgICAgICAge2Ake2FwcExvY2FsZS5xdWVzdGlvbn0gJHtjdXJyZW50UXVlc3Rpb25JbmRleCArIDF9IC8gJHtcbiAgICAgICAgICAgICAgcXVlc3Rpb25zLmxlbmd0aFxuICAgICAgICAgICAgfTpgfVxuICAgICAgICAgICAgPGJyIC8+XG4gICAgICAgICAgICB7dGltZXIgJiYgYWxsb3dQYXVzZVRpbWVyICYmIChcbiAgICAgICAgICAgICAgPGJ1dHRvbiB0eXBlPVwiYnV0dG9uXCIgY2xhc3NOYW1lPVwidGltZXJCdG5cIiBvbkNsaWNrPXt0b2dnbGVUaW1lcn0+XG4gICAgICAgICAgICAgICAge2lzUnVubmluZyA/IGFwcExvY2FsZS5wYXVzZVNjcmVlblBhdXNlIDogYXBwTG9jYWxlLnBhdXNlU2NyZWVuUmVzdW1lfVxuICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICl9XG4gICAgICAgICAgPC9kaXY+XG4gICAgICAgICAge2lzUnVubmluZyA/IChcbiAgICAgICAgICAgIDw+XG4gICAgICAgICAgICAgIDxoM1xuICAgICAgICAgICAgICAgIGRhbmdlcm91c2x5U2V0SW5uZXJIVE1MPXtyYXdNYXJrdXAoXG4gICAgICAgICAgICAgICAgICBgJHtcbiAgICAgICAgICAgICAgICAgICAgYWN0aXZlUXVlc3Rpb24gJiYgYWN0aXZlUXVlc3Rpb24ucXVlc3Rpb25cbiAgICAgICAgICAgICAgICAgIH0gJHthcHBMb2NhbGUubWFya3NPZlF1ZXN0aW9uLnJlcGxhY2UoXG4gICAgICAgICAgICAgICAgICAgICc8bWFya3M+JyxcbiAgICAgICAgICAgICAgICAgICAgYWN0aXZlUXVlc3Rpb24ucG9pbnQsXG4gICAgICAgICAgICAgICAgICApfWAsXG4gICAgICAgICAgICAgICAgKX1cbiAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAge2FjdGl2ZVF1ZXN0aW9uICYmIGFjdGl2ZVF1ZXN0aW9uLnF1ZXN0aW9uUGljICYmIChcbiAgICAgICAgICAgICAgICA8aW1nIHNyYz17YWN0aXZlUXVlc3Rpb24ucXVlc3Rpb25QaWN9IGFsdD1cInF1ZXN0aW9uXCIgLz5cbiAgICAgICAgICAgICAgKX1cbiAgICAgICAgICAgICAge2FjdGl2ZVF1ZXN0aW9uXG4gICAgICAgICAgICAgICAgJiYgcmVuZGVyVGFncyhcbiAgICAgICAgICAgICAgICAgIGFuc3dlclNlbGVjdGlvblR5cGVTdGF0ZSxcbiAgICAgICAgICAgICAgICAgIGFjdGl2ZVF1ZXN0aW9uLmNvcnJlY3RBbnN3ZXIubGVuZ3RoLFxuICAgICAgICAgICAgICAgICAgYWN0aXZlUXVlc3Rpb24uc2VnbWVudCxcbiAgICAgICAgICAgICAgICApfVxuICAgICAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cInF1ZXN0aW9uTW9kYWxcIj5cbiAgICAgICAgICAgICAgICA8SW5zdGFudEZlZWRiYWNrXG4gICAgICAgICAgICAgICAgICBxdWVzdGlvbj17YWN0aXZlUXVlc3Rpb259XG4gICAgICAgICAgICAgICAgICBzaG93SW5zdGFudEZlZWRiYWNrPXtzaG93SW5zdGFudEZlZWRiYWNrfVxuICAgICAgICAgICAgICAgICAgY29ycmVjdEFuc3dlcj17aXNDb3JyZWN0fVxuICAgICAgICAgICAgICAgICAgaW5jb3JyZWN0QW5zd2VyPXtpbmNvcnJlY3RBbnN3ZXJ9XG4gICAgICAgICAgICAgICAgICBvblF1ZXN0aW9uU3VibWl0PXtvblF1ZXN0aW9uU3VibWl0fVxuICAgICAgICAgICAgICAgICAgdXNlckFuc3dlcj17Wy4uLnVzZXJJbnB1dF0ucG9wKCl9XG4gICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgIHthY3RpdmVRdWVzdGlvbiAmJiByZW5kZXJBbnN3ZXJzKGFjdGl2ZVF1ZXN0aW9uLCBidXR0b25zKX1cbiAgICAgICAgICAgICAgeyhzaG93TmV4dFF1ZXN0aW9uQnV0dG9uIHx8IGFsbG93TmF2aWdhdGlvbikgJiYgKFxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPVwicXVlc3Rpb25CdG5Db250YWluZXJcIj5cbiAgICAgICAgICAgICAgICAgIHthbGxvd05hdmlnYXRpb24gJiYgY3VycmVudFF1ZXN0aW9uSW5kZXggPiAwICYmIChcbiAgICAgICAgICAgICAgICAgICAgPGJ1dHRvblxuICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s9eygpID0+IG5leHRRdWVzdGlvbihjdXJyZW50UXVlc3Rpb25JbmRleCAtIDIpfVxuICAgICAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZT1cInByZXZRdWVzdGlvbkJ0biBidG5cIlxuICAgICAgICAgICAgICAgICAgICAgIHR5cGU9XCJidXR0b25cIlxuICAgICAgICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgICAgICAge2FwcExvY2FsZS5wcmV2UXVlc3Rpb25CdG59XG4gICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgICAgICAgKX1cblxuICAgICAgICAgICAgICAgICAgPGJ1dHRvblxuICAgICAgICAgICAgICAgICAgICBvbkNsaWNrPXsoKSA9PiBuZXh0UXVlc3Rpb24oY3VycmVudFF1ZXN0aW9uSW5kZXgpfVxuICAgICAgICAgICAgICAgICAgICBjbGFzc05hbWU9XCJuZXh0UXVlc3Rpb25CdG4gYnRuXCJcbiAgICAgICAgICAgICAgICAgICAgdHlwZT1cImJ1dHRvblwiXG4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bGxvd1BhdXNlVGltZXJcbiAgICAgIC8+XG4gICAgPC9kaXY+XG4gICk7XG59XG5cbnJvb3QucmVuZGVyKDxBcHAgLz4pO1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///920\n')},300:function(module){eval("/*! @license DOMPurify 3.0.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.8/LICENSE */\n\n(function (global, factory) {\n true ? module.exports = factory() :\n 0;\n})(this, (function () { 'use strict';\n\n const {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor\n } = Object;\n let {\n freeze,\n seal,\n create\n } = Object; // eslint-disable-line import/no-mutable-exports\n let {\n apply,\n construct\n } = typeof Reflect !== 'undefined' && Reflect;\n if (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n }\n if (!seal) {\n seal = function seal(x) {\n return x;\n };\n }\n if (!apply) {\n apply = function apply(fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n }\n if (!construct) {\n construct = function construct(Func, args) {\n return new Func(...args);\n };\n }\n const arrayForEach = unapply(Array.prototype.forEach);\n const arrayPop = unapply(Array.prototype.pop);\n const arrayPush = unapply(Array.prototype.push);\n const stringToLowerCase = unapply(String.prototype.toLowerCase);\n const stringToString = unapply(String.prototype.toString);\n const stringMatch = unapply(String.prototype.match);\n const stringReplace = unapply(String.prototype.replace);\n const stringIndexOf = unapply(String.prototype.indexOf);\n const stringTrim = unapply(String.prototype.trim);\n const regExpTest = unapply(RegExp.prototype.test);\n const typeErrorCreate = unconstruct(TypeError);\n\n /**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param {Function} func - The function to be wrapped and called.\n * @returns {Function} A new function that calls the given function with a specified thisArg and arguments.\n */\n function unapply(func) {\n return function (thisArg) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return apply(func, thisArg, args);\n };\n }\n\n /**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param {Function} func - The constructor function to be wrapped and called.\n * @returns {Function} A new function that constructs an instance of the given constructor function with the provided arguments.\n */\n function unconstruct(func) {\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return construct(func, args);\n };\n }\n\n /**\n * Add properties to a lookup table\n *\n * @param {Object} set - The set to which elements will be added.\n * @param {Array} array - The array containing elements to be added to the set.\n * @param {Function} transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns {Object} The modified set with added elements.\n */\n function addToSet(set, array) {\n let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n element = lcElement;\n }\n }\n set[element] = true;\n }\n return set;\n }\n\n /**\n * Clean up an array to harden against CSPP\n *\n * @param {Array} array - The array to be cleaned.\n * @returns {Array} The cleaned version of the array\n */\n function cleanArray(array) {\n for (let index = 0; index < array.length; index++) {\n if (getOwnPropertyDescriptor(array, index) === undefined) {\n array[index] = null;\n }\n }\n return array;\n }\n\n /**\n * Shallow clone an object\n *\n * @param {Object} object - The object to be cloned.\n * @returns {Object} A new object that copies the original.\n */\n function clone(object) {\n const newObject = create(null);\n for (const [property, value] of entries(object)) {\n if (getOwnPropertyDescriptor(object, property) !== undefined) {\n if (Array.isArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (value && typeof value === 'object' && value.constructor === Object) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n return newObject;\n }\n\n /**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param {Object} object - The object to look up the getter function in its prototype chain.\n * @param {String} prop - The property name for which to find the getter function.\n * @returns {Function} The getter function found in the prototype chain or a fallback function.\n */\n function lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n object = getPrototypeOf(object);\n }\n function fallbackValue(element) {\n console.warn('fallback value for', element);\n return null;\n }\n return fallbackValue;\n }\n\n const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\n\n // SVG\n const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\n const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);\n\n // List of SVG elements that are disallowed by default.\n // We still need to know them so that we can do namespace\n // checks properly in case one wants to add them to\n // allow-list.\n const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\n const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);\n\n // Similarly to SVG, we want to know all MathML elements,\n // even those that we disallow by default.\n const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\n const text = freeze(['#text']);\n\n const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns', 'slot']);\n const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\n const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\n const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n // eslint-disable-next-line unicorn/better-regex\n const MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\n const ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\n const TMPLIT_EXPR = seal(/\\${[\\w\\W]*}/gm);\n const DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\n const ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\n const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n );\n\n const IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\n const ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n );\n\n const DOCTYPE_NAME = seal(/^html$/i);\n\n var EXPRESSIONS = /*#__PURE__*/Object.freeze({\n __proto__: null,\n MUSTACHE_EXPR: MUSTACHE_EXPR,\n ERB_EXPR: ERB_EXPR,\n TMPLIT_EXPR: TMPLIT_EXPR,\n DATA_ATTR: DATA_ATTR,\n ARIA_ATTR: ARIA_ATTR,\n IS_ALLOWED_URI: IS_ALLOWED_URI,\n IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE: ATTR_WHITESPACE,\n DOCTYPE_NAME: DOCTYPE_NAME\n });\n\n const getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n };\n\n /**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\n const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n }\n\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n }\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n };\n function createDOMPurify() {\n let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n const DOMPurify = root => createDOMPurify(root);\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n DOMPurify.version = '3.0.8';\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n DOMPurify.removed = [];\n if (!window || !window.document || window.document.nodeType !== 9) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n return DOMPurify;\n }\n let {\n document\n } = window;\n const originalDocument = document;\n const currentScript = originalDocument.currentScript;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes\n } = window;\n const ElementPrototype = Element.prototype;\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n let trustedTypesPolicy;\n let emptyHTML = '';\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName\n } = document;\n const {\n importNode\n } = originalDocument;\n let hooks = {};\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE\n } = EXPRESSIONS;\n let {\n IS_ALLOWED_URI: IS_ALLOWED_URI$1\n } = EXPRESSIONS;\n\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);\n\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);\n\n /*\n * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false\n }\n }));\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n\n /* Decide if document with ... should be returned */\n let WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, ['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']);\n\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc = null;\n\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n const formElement = document.createElement('form');\n const isRegexOrFunction = function isRegexOrFunction(testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function _parseConfig() {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n\n /* Set configuration parameters */\n ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = 'ALLOWED_NAMESPACES' in cfg ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES),\n // eslint-disable-line indent\n cfg.ADD_URI_SAFE_ATTR,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS),\n // eslint-disable-line indent\n cfg.ADD_DATA_URI_TAGS,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = 'FORBID_CONTENTS' in cfg ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};\n FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};\n USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, text);\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html$1);\n addToSet(ALLOWED_ATTR, html);\n }\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg$1);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl$1);\n addToSet(ALLOWED_ATTR, mathMl);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');\n }\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');\n }\n\n // Overwrite existing TrustedTypes policy.\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\n // Sign local variables required by `sanitize`.\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n }\n\n // If creating the internal policy succeeded sign internal variables.\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n CONFIG = cfg;\n };\n const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n const HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'desc', 'title', 'annotation-xml']);\n\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);\n const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n\n /**\n * @param {Element} element a DOM element whose namespace is being checked\n * @returns {boolean} Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function _checkValidNamespace(element) {\n let parent = getParentNode(element);\n\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template'\n };\n }\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n }\n\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n\n // The only way to switch from SVG to MathML is via\n // and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n }\n\n // For XHTML and XML documents that support custom namespaces\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {\n return true;\n }\n\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n\n /**\n * _forceRemove\n *\n * @param {Node} node a DOM node\n */\n const _forceRemove = function _forceRemove(node) {\n arrayPush(DOMPurify.removed, {\n element: node\n });\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n node.parentNode.removeChild(node);\n } catch (_) {\n node.remove();\n }\n };\n\n /**\n * _removeAttribute\n *\n * @param {String} name an Attribute name\n * @param {Node} node a DOM node\n */\n const _removeAttribute = function _removeAttribute(name, node) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: node.getAttributeNode(name),\n from: node\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: node\n });\n }\n node.removeAttribute(name);\n\n // We void attribute values for unremovable \"is\"\" attributes\n if (name === 'is' && !ALLOWED_ATTR[name]) {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(node);\n } catch (_) {}\n } else {\n try {\n node.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n\n /**\n * _initDocument\n *\n * @param {String} dirty a string of dirty markup\n * @return {Document} a DOM, filled with the dirty markup\n */\n const _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n if (FORCE_BODY) {\n dirty = '' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty = '' + dirty + '';\n }\n const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n const body = doc.body || doc.documentElement;\n if (dirty && leadingWhitespace) {\n body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n }\n\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n }\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param {Node} root The root element or node to start traversing on.\n * @return {NodeIterator} The created NodeIterator\n */\n const _createNodeIterator = function _createNodeIterator(root) {\n return createNodeIterator.call(root.ownerDocument || root, root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, null);\n };\n\n /**\n * _isClobbered\n *\n * @param {Node} elm element to check for clobbering attacks\n * @return {Boolean} true if clobbered, false if safe\n */\n const _isClobbered = function _isClobbered(elm) {\n return elm instanceof HTMLFormElement && (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function');\n };\n\n /**\n * Checks whether the given object is a DOM node.\n *\n * @param {Node} object object to check whether it's a DOM node\n * @return {Boolean} true is object is a DOM node\n */\n const _isNode = function _isNode(object) {\n return typeof Node === 'function' && object instanceof Node;\n };\n\n /**\n * _executeHook\n * Execute user configurable hooks\n *\n * @param {String} entryPoint Name of the hook's entry point\n * @param {Node} currentNode node to work on with the hook\n * @param {Object} data additional hook parameters\n */\n const _executeHook = function _executeHook(entryPoint, currentNode, data) {\n if (!hooks[entryPoint]) {\n return;\n }\n arrayForEach(hooks[entryPoint], hook => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n };\n\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n *\n * @param {Node} currentNode to check for permission to exist\n * @return {Boolean} true if node was killed, false if left alive\n */\n const _sanitizeElements = function _sanitizeElements(currentNode) {\n let content = null;\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeElements', currentNode, null);\n\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(currentNode.nodeName);\n\n /* Execute a hook if present */\n _executeHook('uponSanitizeElement', currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS\n });\n\n /* Detect mXSS attempts abusing namespace confusion */\n if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\\w]/g, currentNode.innerHTML) && regExpTest(/<[/\\w]/g, currentNode.textContent)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {\n return false;\n }\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {\n return false;\n }\n }\n\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n for (let i = childCount - 1; i >= 0; --i) {\n parentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));\n }\n }\n }\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {\n /* Get the element's text content */\n content = currentNode.textContent;\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n content = stringReplace(content, expr, ' ');\n });\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, {\n element: currentNode.cloneNode()\n });\n currentNode.textContent = content;\n }\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeElements', currentNode, null);\n return false;\n };\n\n /**\n * _isValidAttribute\n *\n * @param {string} lcTag Lowercase tag name of containing element.\n * @param {string} lcName Lowercase attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n return false;\n }\n\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {\n return false;\n } else ;\n return true;\n };\n\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param {string} tagName name of the tag of the node to sanitize\n * @returns {boolean} Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n return tagName.indexOf('-') > 0;\n };\n\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param {Node} currentNode to sanitize\n */\n const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n /* Execute a hook if present */\n _executeHook('beforeSanitizeAttributes', currentNode, null);\n const {\n attributes\n } = currentNode;\n\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes) {\n return;\n }\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR\n };\n let l = attributes.length;\n\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const {\n name,\n namespaceURI,\n value: attrValue\n } = attr;\n const lcName = transformCaseFunc(name);\n let value = name === 'value' ? attrValue : stringTrim(attrValue);\n\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n value = hookEvent.attrValue;\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n\n /* Remove attribute */\n _removeAttribute(name, currentNode);\n\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n value = stringReplace(value, expr, ' ');\n });\n }\n\n /* Is `value` valid for this attribute? */\n const lcTag = transformCaseFunc(currentNode.nodeName);\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n\n /* Handle attributes that require Trusted Types */\n if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {\n if (namespaceURI) ; else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML':\n {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n case 'TrustedScriptURL':\n {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n }\n }\n }\n\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n arrayPop(DOMPurify.removed);\n } catch (_) {}\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeAttributes', currentNode, null);\n };\n\n /**\n * _sanitizeShadowDOM\n *\n * @param {DocumentFragment} fragment to iterate over recursively\n */\n const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeShadowDOM', fragment, null);\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHook('uponSanitizeShadowNode', shadowNode, null);\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(shadowNode)) {\n continue;\n }\n\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(shadowNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(shadowNode);\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeShadowDOM', fragment, null);\n };\n\n /**\n * Sanitize\n * Public method providing core sanitation functionality\n *\n * @param {String|Node} dirty string or DOM node\n * @param {Object} cfg object\n */\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty) {\n let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '\x3c!--\x3e';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if (dirty.nodeName) {\n const tagName = transformCaseFunc(dirty.nodeName);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('\x3c!----\x3e');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while (currentNode = nodeIterator.nextNode()) {\n /* Sanitize tags and elements */\n if (_sanitizeElements(currentNode)) {\n continue;\n }\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(currentNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(currentNode);\n }\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n return returnNode;\n }\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n /* Serialize doctype if allowed */\n if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {\n serializedHTML = '\\n' + serializedHTML;\n }\n\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n serializedHTML = stringReplace(serializedHTML, expr, ' ');\n });\n }\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;\n };\n\n /**\n * Public method to set the configuration once\n * setConfig\n *\n * @param {Object} cfg configuration object\n */\n DOMPurify.setConfig = function () {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n /**\n * Public method to remove the configuration\n * clearConfig\n *\n */\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n /**\n * Public method to check if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n * isValidAttribute\n *\n * @param {String} tag Tag name of containing element.\n * @param {String} attr Attribute name.\n * @param {String} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n */\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n /**\n * AddHook\n * Public method to add DOMPurify hooks\n *\n * @param {String} entryPoint entry point for the hook to add\n * @param {Function} hookFunction function to execute\n */\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n hooks[entryPoint] = hooks[entryPoint] || [];\n arrayPush(hooks[entryPoint], hookFunction);\n };\n\n /**\n * RemoveHook\n * Public method to remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if more are present)\n *\n * @param {String} entryPoint entry point for the hook to remove\n * @return {Function} removed(popped) hook\n */\n DOMPurify.removeHook = function (entryPoint) {\n if (hooks[entryPoint]) {\n return arrayPop(hooks[entryPoint]);\n }\n };\n\n /**\n * RemoveHooks\n * Public method to remove all DOMPurify hooks at a given entryPoint\n *\n * @param {String} entryPoint entry point for the hooks to remove\n */\n DOMPurify.removeHooks = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint] = [];\n }\n };\n\n /**\n * RemoveAllHooks\n * Public method to remove all DOMPurify hooks\n */\n DOMPurify.removeAllHooks = function () {\n hooks = {};\n };\n return DOMPurify;\n }\n var purify = createDOMPurify();\n\n return purify;\n\n}));\n//# sourceMappingURL=purify.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzAwLmpzIiwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTt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lbW92ZUFsbEhvb2tzID0gZnVuY3Rpb24gKCkge1xuICAgICAgaG9va3MgPSB7fTtcbiAgICB9O1xuICAgIHJldHVybiBET01QdXJpZnk7XG4gIH1cbiAgdmFyIHB1cmlmeSA9IGNyZWF0ZURPTVB1cmlmeSgpO1xuXG4gIHJldHVybiBwdXJpZnk7XG5cbn0pKTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXB1cmlmeS5qcy5tYXBcbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///300\n")},516:(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('/**\n * @license React\n * react-dom.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n/*\n Modernizr 3.0.0pre (Custom Build) | MIT\n*/\nvar aa=__webpack_require__(504),ca=__webpack_require__(712);function p(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;cb}return!1}function v(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var z={};\n"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){z[a]=new v(a,0,!1,a,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];z[b]=new v(b,1,!1,a[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){z[a]=new v(a,2,!1,a.toLowerCase(),null,!1,!1)});\n["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){z[a]=new v(a,2,!1,a,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){z[a]=new v(a,3,!1,a.toLowerCase(),null,!1,!1)});\n["checked","multiple","muted","selected"].forEach(function(a){z[a]=new v(a,3,!0,a,null,!1,!1)});["capture","download"].forEach(function(a){z[a]=new v(a,4,!1,a,null,!1,!1)});["cols","rows","size","span"].forEach(function(a){z[a]=new v(a,6,!1,a,null,!1,!1)});["rowSpan","start"].forEach(function(a){z[a]=new v(a,5,!1,a.toLowerCase(),null,!1,!1)});var ra=/[\\-:]([a-z])/g;function sa(a){return a[1].toUpperCase()}\n"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var b=a.replace(ra,\nsa);z[b]=new v(b,1,!1,a,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!1,!1)});\nz.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!0,!0)});\nfunction ta(a,b,c,d){var e=z.hasOwnProperty(b)?z[b]:null;if(null!==e?0!==e.type:d||!(2h||e[g]!==f[h]){var k="\\n"+e[g].replace(" at new "," at ");a.displayName&&k.includes("")&&(k=k.replace("",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{Na=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:"")?Ma(a):""}\nfunction Pa(a){switch(a.tag){case 5:return Ma(a.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return a=Oa(a.type,!1),a;case 11:return a=Oa(a.type.render,!1),a;case 1:return a=Oa(a.type,!0),a;default:return""}}\nfunction Qa(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case ya:return"Fragment";case wa:return"Portal";case Aa:return"Profiler";case za:return"StrictMode";case Ea:return"Suspense";case Fa:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case Ca:return(a.displayName||"Context")+".Consumer";case Ba:return(a._context.displayName||"Context")+".Provider";case Da:var b=a.render;a=a.displayName;a||(a=b.displayName||\nb.name||"",a=""!==a?"ForwardRef("+a+")":"ForwardRef");return a;case Ga:return b=a.displayName||null,null!==b?b:Qa(a.type)||"Memo";case Ha:b=a._payload;a=a._init;try{return Qa(a(b))}catch(c){}}return null}\nfunction Ra(a){var b=a.type;switch(a.tag){case 24:return"Cache";case 9:return(b.displayName||"Context")+".Consumer";case 10:return(b._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=b.render,a=a.displayName||a.name||"",b.displayName||(""!==a?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return b;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa(b);case 8:return b===za?"StrictMode":"Mode";case 22:return"Offscreen";\ncase 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof b)return b.displayName||b.name||null;if("string"===typeof b)return b}return null}function Sa(a){switch(typeof a){case "boolean":case "number":case "string":case "undefined":return a;case "object":return a;default:return""}}\nfunction Ta(a){var b=a.type;return(a=a.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===b||"radio"===b)}\nfunction Ua(a){var b=Ta(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=""+a[b];if(!a.hasOwnProperty(b)&&"undefined"!==typeof c&&"function"===typeof c.get&&"function"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=""+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=""+a},stopTracking:function(){a._valueTracker=\nnull;delete a[b]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d="";a&&(d=Ta(a)?a.checked?"true":"false":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}\nfunction Ya(a,b){var c=b.checked;return A({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?"":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:"checkbox"===b.type||"radio"===b.type?null!=b.checked:null!=b.value}}function ab(a,b){b=b.checked;null!=b&&ta(a,"checked",b,!1)}\nfunction bb(a,b){ab(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if("number"===d){if(0===c&&""===a.value||a.value!=c)a.value=""+c}else a.value!==""+c&&(a.value=""+c);else if("submit"===d||"reset"===d){a.removeAttribute("value");return}b.hasOwnProperty("value")?cb(a,b.type,c):b.hasOwnProperty("defaultValue")&&cb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}\nfunction db(a,b,c){if(b.hasOwnProperty("value")||b.hasOwnProperty("defaultValue")){var d=b.type;if(!("submit"!==d&&"reset"!==d||void 0!==b.value&&null!==b.value))return;b=""+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;""!==c&&(a.name="");a.defaultChecked=!!a._wrapperState.initialChecked;""!==c&&(a.name=c)}\nfunction cb(a,b,c){if("number"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+c&&(a.defaultValue=""+c)}var eb=Array.isArray;\nfunction fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e"+b.valueOf().toString()+"";for(b=mb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction ob(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}\nvar pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,\nzoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=["Webkit","ms","Moz","O"];Object.keys(pb).forEach(function(a){qb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);pb[b]=pb[a]})});function rb(a,b,c){return null==b||"boolean"===typeof b||""===b?"":c||"number"!==typeof b||0===b||pb.hasOwnProperty(a)&&pb[a]?(""+b).trim():b+"px"}\nfunction sb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--"),e=rb(c,b[c],d);"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e}}var tb=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});\nfunction ub(a,b){if(b){if(tb[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(p(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(p(60));if("object"!==typeof b.dangerouslySetInnerHTML||!("__html"in b.dangerouslySetInnerHTML))throw Error(p(61));}if(null!=b.style&&"object"!==typeof b.style)throw Error(p(62));}}\nfunction vb(a,b){if(-1===a.indexOf("-"))return"string"===typeof b.is;switch(a){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return!1;default:return!0}}var wb=null;function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null;\nfunction Bb(a){if(a=Cb(a)){if("function"!==typeof yb)throw Error(p(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;a>>=0;return 0===a?32:31-(pc(a)/qc|0)|0}var rc=64,sc=4194304;\nfunction tc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;\ndefault:return a}}function uc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=tc(h):(f&=g,0!==f&&(d=tc(f)))}else g=c&~e,0!==g?d=tc(g):0!==f&&(d=tc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&&(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0c;c++)b.push(a);return b}\nfunction Ac(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-oc(b);a[b]=c}function Bc(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0=be),ee=String.fromCharCode(32),fe=!1;\nfunction ge(a,b){switch(a){case "keyup":return-1!==$d.indexOf(b.keyCode);case "keydown":return 229!==b.keyCode;case "keypress":case "mousedown":case "focusout":return!0;default:return!1}}function he(a){a=a.detail;return"object"===typeof a&&"data"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case "compositionend":return he(b);case "keypress":if(32!==b.which)return null;fe=!0;return ee;case "textInput":return a=b.data,a===ee&&fe?null:a;default:return null}}\nfunction ke(a,b){if(ie)return"compositionend"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case "paste":return null;case "keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Je(c)}}function Le(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Le(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}\nfunction Me(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c="string"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Xa(a.document)}return b}function Ne(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)}\nfunction Oe(a){var b=Me(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Le(c.ownerDocument.documentElement,c)){if(null!==d&&Ne(c))if(b=d.start,a=d.end,void 0===a&&(a=b),"selectionStart"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Ke(c,f);var g=Ke(c,\nd);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});"function"===typeof c.focus&&c.focus();for(c=0;c=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;\nfunction Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,"selectionStart"in d&&Ne(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Ie(Se,d)||(Se=d,d=oe(Re,"onSelect"),0Tf||(a.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(a,b){Tf++;Sf[Tf]=a.current;a.current=b}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(a,b){var c=a.type.contextTypes;if(!c)return Vf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}\nfunction Zf(a){a=a.childContextTypes;return null!==a&&void 0!==a}function $f(){E(Wf);E(H)}function ag(a,b,c){if(H.current!==Vf)throw Error(p(168));G(H,b);G(Wf,c)}function bg(a,b,c){var d=a.stateNode;b=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(p(108,Ra(a)||"Unknown",e));return A({},c,d)}\nfunction cg(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Vf;Xf=H.current;G(H,a);G(Wf,Wf.current);return!0}function dg(a,b,c){var d=a.stateNode;if(!d)throw Error(p(169));c?(a=bg(a,b,Xf),d.__reactInternalMemoizedMergedChildContext=a,E(Wf),E(H),G(H,a)):E(Wf);G(Wf,c)}var eg=null,fg=!1,gg=!1;function hg(a){null===eg?eg=[a]:eg.push(a)}function ig(a){fg=!0;hg(a)}\nfunction jg(){if(!gg&&null!==eg){gg=!0;var a=0,b=C;try{var c=eg;for(C=1;a>=g;e-=g;rg=1<<32-oc(b)+e|c<w?(x=u,u=null):x=u.sibling;var n=r(e,u,h[w],k);if(null===n){null===u&&(u=x);break}a&&u&&null===n.alternate&&b(e,u);g=f(n,g,w);null===m?l=n:m.sibling=n;m=n;u=x}if(w===h.length)return c(e,u),I&&tg(e,w),l;if(null===u){for(;ww?(x=m,m=null):x=m.sibling;var t=r(e,m,n.value,k);if(null===t){null===m&&(m=x);break}a&&m&&null===t.alternate&&b(e,m);g=f(t,g,w);null===u?l=t:u.sibling=t;u=t;m=x}if(n.done)return c(e,\nm),I&&tg(e,w),l;if(null===m){for(;!n.done;w++,n=h.next())n=q(e,n.value,k),null!==n&&(g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);I&&tg(e,w);return l}for(m=d(e,m);!n.done;w++,n=h.next())n=y(m,e,w,n.value,k),null!==n&&(a&&null!==n.alternate&&m.delete(null===n.key?w:n.key),g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);a&&m.forEach(function(a){return b(e,a)});I&&tg(e,w);return l}function J(a,d,f,h){"object"===typeof f&&null!==f&&f.type===ya&&null===f.key&&(f=f.props.children);if("object"===typeof f&&null!==f){switch(f.$$typeof){case va:a:{for(var k=\nf.key,l=d;null!==l;){if(l.key===k){k=f.type;if(k===ya){if(7===l.tag){c(a,l.sibling);d=e(l,f.props.children);d.return=a;a=d;break a}}else if(l.elementType===k||"object"===typeof k&&null!==k&&k.$$typeof===Ha&&uh(k)===l.type){c(a,l.sibling);d=e(l,f.props);d.ref=sh(a,l,f);d.return=a;a=d;break a}c(a,l);break}else b(a,l);l=l.sibling}f.type===ya?(d=Ah(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=yh(f.type,f.key,f.props,null,a.mode,h),h.ref=sh(a,d,f),h.return=a,a=h)}return g(a);case wa:a:{for(l=f.key;null!==\nd;){if(d.key===l)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=zh(f,a.mode,h);d.return=a;a=d}return g(a);case Ha:return l=f._init,J(a,d,l(f._payload),h)}if(eb(f))return n(a,d,f,h);if(Ka(f))return t(a,d,f,h);th(a,f)}return"string"===typeof f&&""!==f||"number"===typeof f?(f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):\n(c(a,d),d=xh(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return J}var Bh=vh(!0),Ch=vh(!1),Dh={},Eh=Uf(Dh),Fh=Uf(Dh),Gh=Uf(Dh);function Hh(a){if(a===Dh)throw Error(p(174));return a}function Ih(a,b){G(Gh,b);G(Fh,a);G(Eh,Dh);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:lb(null,"");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=lb(b,a)}E(Eh);G(Eh,b)}function Jh(){E(Eh);E(Fh);E(Gh)}\nfunction Kh(a){Hh(Gh.current);var b=Hh(Eh.current);var c=lb(b,a.type);b!==c&&(G(Fh,a),G(Eh,c))}function Lh(a){Fh.current===a&&(E(Eh),E(Fh))}var M=Uf(0);\nfunction Mh(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||"$?"===c.data||"$!"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&128))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}var Nh=[];\nfunction Oh(){for(var a=0;ac?c:4;a(!0);var d=Qh.transition;Qh.transition={};try{a(!1),b()}finally{C=c,Qh.transition=d}}function Fi(){return di().memoizedState}\nfunction Gi(a,b,c){var d=lh(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,c);else if(c=Yg(a,b,c,d),null!==c){var e=L();mh(c,a,d,e);Ji(c,b,d)}}\nfunction ri(a,b,c){var d=lh(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(He(h,g)){var k=b.interleaved;null===k?(e.next=e,Xg(b)):(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(l){}finally{}c=Yg(a,b,e,d);null!==c&&(e=L(),mh(c,a,d,e),Ji(c,b,d))}}\nfunction Hi(a){var b=a.alternate;return a===N||null!==b&&b===N}function Ii(a,b){Th=Sh=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function Ji(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}}\nvar ai={readContext:Vg,useCallback:Q,useContext:Q,useEffect:Q,useImperativeHandle:Q,useInsertionEffect:Q,useLayoutEffect:Q,useMemo:Q,useReducer:Q,useRef:Q,useState:Q,useDebugValue:Q,useDeferredValue:Q,useTransition:Q,useMutableSource:Q,useSyncExternalStore:Q,useId:Q,unstable_isNewReconciler:!1},Yh={readContext:Vg,useCallback:function(a,b){ci().memoizedState=[a,void 0===b?null:b];return a},useContext:Vg,useEffect:vi,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ti(4194308,\n4,yi.bind(null,b,a),c)},useLayoutEffect:function(a,b){return ti(4194308,4,a,b)},useInsertionEffect:function(a,b){return ti(4,2,a,b)},useMemo:function(a,b){var c=ci();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=ci();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};d.queue=a;a=a.dispatch=Gi.bind(null,N,a);return[d.memoizedState,a]},useRef:function(a){var b=\nci();a={current:a};return b.memoizedState=a},useState:qi,useDebugValue:Ai,useDeferredValue:function(a){return ci().memoizedState=a},useTransition:function(){var a=qi(!1),b=a[0];a=Ei.bind(null,a[1]);ci().memoizedState=a;return[b,a]},useMutableSource:function(){},useSyncExternalStore:function(a,b,c){var d=N,e=ci();if(I){if(void 0===c)throw Error(p(407));c=c()}else{c=b();if(null===R)throw Error(p(349));0!==(Rh&30)||ni(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};e.queue=f;vi(ki.bind(null,d,\nf,a),[a]);d.flags|=2048;li(9,mi.bind(null,d,f,c,b),void 0,null);return c},useId:function(){var a=ci(),b=R.identifierPrefix;if(I){var c=sg;var d=rg;c=(d&~(1<<32-oc(d)-1)).toString(32)+c;b=":"+b+"R"+c;c=Uh++;0\\x3c/script>",a=a.removeChild(a.firstChild)):\n"string"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),"select"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Of]=b;a[Pf]=d;Aj(a,b,!1,!1);b.stateNode=a;a:{g=vb(c,d);switch(c){case "dialog":D("cancel",a);D("close",a);e=d;break;case "iframe":case "object":case "embed":D("load",a);e=d;break;case "video":case "audio":for(e=0;eHj&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304)}else{if(!d)if(a=Mh(g),null!==a){if(b.flags|=128,d=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Ej(f,!0),null===f.tail&&"hidden"===f.tailMode&&!g.alternate&&!I)return S(b),null}else 2*B()-f.renderingStartTime>Hj&&1073741824!==c&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304);f.isBackwards?(g.sibling=b.child,b.child=g):(c=f.last,null!==c?c.sibling=g:b.child=g,f.last=g)}if(null!==f.tail)return b=f.tail,f.rendering=\nb,f.tail=b.sibling,f.renderingStartTime=B(),b.sibling=null,c=M.current,G(M,d?c&1|2:c&1),b;S(b);return null;case 22:case 23:return Ij(),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!==(b.mode&1)?0!==(gj&1073741824)&&(S(b),b.subtreeFlags&6&&(b.flags|=8192)):S(b),null;case 24:return null;case 25:return null}throw Error(p(156,b.tag));}\nfunction Jj(a,b){wg(b);switch(b.tag){case 1:return Zf(b.type)&&$f(),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return Jh(),E(Wf),E(H),Oh(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return Lh(b),null;case 13:E(M);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(p(340));Ig()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return E(M),null;case 4:return Jh(),null;case 10:return Rg(b.type._context),null;case 22:case 23:return Ij(),\nnull;case 24:return null;default:return null}}var Kj=!1,U=!1,Lj="function"===typeof WeakSet?WeakSet:Set,V=null;function Mj(a,b){var c=a.ref;if(null!==c)if("function"===typeof c)try{c(null)}catch(d){W(a,b,d)}else c.current=null}function Nj(a,b,c){try{c()}catch(d){W(a,b,d)}}var Oj=!1;\nfunction Pj(a,b){Cf=dd;a=Me();if(Ne(a)){if("selectionStart"in a)var c={start:a.selectionStart,end:a.selectionEnd};else a:{c=(c=a.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();if(d&&0!==d.rangeCount){c=d.anchorNode;var e=d.anchorOffset,f=d.focusNode;d=d.focusOffset;try{c.nodeType,f.nodeType}catch(F){c=null;break a}var g=0,h=-1,k=-1,l=0,m=0,q=a,r=null;b:for(;;){for(var y;;){q!==c||0!==e&&3!==q.nodeType||(h=g+e);q!==f||0!==d&&3!==q.nodeType||(k=g+d);3===q.nodeType&&(g+=\nq.nodeValue.length);if(null===(y=q.firstChild))break;r=q;q=y}for(;;){if(q===a)break b;r===c&&++l===e&&(h=g);r===f&&++m===d&&(k=g);if(null!==(y=q.nextSibling))break;q=r;r=q.parentNode}q=y}c=-1===h||-1===k?null:{start:h,end:k}}else c=null}c=c||{start:0,end:0}}else c=null;Df={focusedElem:a,selectionRange:c};dd=!1;for(V=b;null!==V;)if(b=V,a=b.child,0!==(b.subtreeFlags&1028)&&null!==a)a.return=b,V=a;else for(;null!==V;){b=V;try{var n=b.alternate;if(0!==(b.flags&1024))switch(b.tag){case 0:case 11:case 15:break;\ncase 1:if(null!==n){var t=n.memoizedProps,J=n.memoizedState,x=b.stateNode,w=x.getSnapshotBeforeUpdate(b.elementType===b.type?t:Lg(b.type,t),J);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var u=b.stateNode.containerInfo;1===u.nodeType?u.textContent="":9===u.nodeType&&u.documentElement&&u.removeChild(u.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163));}}catch(F){W(b,b.return,F)}a=b.sibling;if(null!==a){a.return=b.return;V=a;break}V=b.return}n=Oj;Oj=!1;return n}\nfunction Qj(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&Nj(b,c,f)}e=e.next}while(e!==d)}}function Rj(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Sj(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=c;break;default:a=c}"function"===typeof b?b(a):b.current=a}}\nfunction Tj(a){var b=a.alternate;null!==b&&(a.alternate=null,Tj(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&(delete b[Of],delete b[Pf],delete b[of],delete b[Qf],delete b[Rf]));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}function Uj(a){return 5===a.tag||3===a.tag||4===a.tag}\nfunction Vj(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Uj(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}\nfunction Wj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=Bf));else if(4!==d&&(a=a.child,null!==a))for(Wj(a,b,c),a=a.sibling;null!==a;)Wj(a,b,c),a=a.sibling}\nfunction Xj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(Xj(a,b,c),a=a.sibling;null!==a;)Xj(a,b,c),a=a.sibling}var X=null,Yj=!1;function Zj(a,b,c){for(c=c.child;null!==c;)ak(a,b,c),c=c.sibling}\nfunction ak(a,b,c){if(lc&&"function"===typeof lc.onCommitFiberUnmount)try{lc.onCommitFiberUnmount(kc,c)}catch(h){}switch(c.tag){case 5:U||Mj(c,b);case 6:var d=X,e=Yj;X=null;Zj(a,b,c);X=d;Yj=e;null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?a.parentNode.removeChild(c):a.removeChild(c)):X.removeChild(c.stateNode));break;case 18:null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?Kf(a.parentNode,c):1===a.nodeType&&Kf(a,c),bd(a)):Kf(X,c.stateNode));break;case 4:d=X;e=Yj;X=c.stateNode.containerInfo;Yj=!0;\nZj(a,b,c);X=d;Yj=e;break;case 0:case 11:case 14:case 15:if(!U&&(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?Nj(c,b,g):0!==(f&4)&&Nj(c,b,g));e=e.next}while(e!==d)}Zj(a,b,c);break;case 1:if(!U&&(Mj(c,b),d=c.stateNode,"function"===typeof d.componentWillUnmount))try{d.props=c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){W(c,b,h)}Zj(a,b,c);break;case 21:Zj(a,b,c);break;case 22:c.mode&1?(U=(d=U)||null!==\nc.memoizedState,Zj(a,b,c),U=d):Zj(a,b,c);break;default:Zj(a,b,c)}}function bk(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Lj);b.forEach(function(b){var d=ck.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}\nfunction dk(a,b){var c=b.deletions;if(null!==c)for(var d=0;de&&(e=g);d&=~f}d=e;d=B()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*mk(d/1960))-d;if(10a?16:a;if(null===xk)var d=!1;else{a=xk;xk=null;yk=0;if(0!==(K&6))throw Error(p(331));var e=K;K|=4;for(V=a.current;null!==V;){var f=V,g=f.child;if(0!==(V.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;kB()-gk?Lk(a,0):sk|=c);Ek(a,b)}function Zk(a,b){0===b&&(0===(a.mode&1)?b=1:(b=sc,sc<<=1,0===(sc&130023424)&&(sc=4194304)));var c=L();a=Zg(a,b);null!==a&&(Ac(a,b,c),Ek(a,c))}function vj(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);Zk(a,c)}\nfunction ck(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane);break;case 19:d=a.stateNode;break;default:throw Error(p(314));}null!==d&&d.delete(b);Zk(a,c)}var Wk;\nWk=function(a,b,c){if(null!==a)if(a.memoizedProps!==b.pendingProps||Wf.current)Ug=!0;else{if(0===(a.lanes&c)&&0===(b.flags&128))return Ug=!1,zj(a,b,c);Ug=0!==(a.flags&131072)?!0:!1}else Ug=!1,I&&0!==(b.flags&1048576)&&ug(b,ng,b.index);b.lanes=0;switch(b.tag){case 2:var d=b.type;jj(a,b);a=b.pendingProps;var e=Yf(b,H.current);Tg(b,c);e=Xh(null,b,d,a,e,c);var f=bi();b.flags|=1;"object"===typeof e&&null!==e&&"function"===typeof e.render&&void 0===e.$$typeof?(b.tag=1,b.memoizedState=null,b.updateQueue=\nnull,Zf(d)?(f=!0,cg(b)):f=!1,b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,ah(b),e.updater=nh,b.stateNode=e,e._reactInternals=b,rh(b,d,a,c),b=kj(null,b,d,!0,f,c)):(b.tag=0,I&&f&&vg(b),Yi(null,b,e,c),b=b.child);return b;case 16:d=b.elementType;a:{jj(a,b);a=b.pendingProps;e=d._init;d=e(d._payload);b.type=d;e=b.tag=$k(d);a=Lg(d,a);switch(e){case 0:b=dj(null,b,d,a,c);break a;case 1:b=ij(null,b,d,a,c);break a;case 11:b=Zi(null,b,d,a,c);break a;case 14:b=aj(null,b,d,Lg(d.type,a),c);break a}throw Error(p(306,\nd,""));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),dj(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),ij(a,b,d,e,c);case 3:a:{lj(b);if(null===a)throw Error(p(387));d=b.pendingProps;f=b.memoizedState;e=f.element;bh(a,b);gh(b,d,null,c);var g=b.memoizedState;d=g.element;if(f.isDehydrated)if(f={element:d,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},b.updateQueue.baseState=\nf,b.memoizedState=f,b.flags&256){e=Ki(Error(p(423)),b);b=mj(a,b,d,c,e);break a}else if(d!==e){e=Ki(Error(p(424)),b);b=mj(a,b,d,c,e);break a}else for(yg=Lf(b.stateNode.containerInfo.firstChild),xg=b,I=!0,zg=null,c=Ch(b,null,d,c),b.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{Ig();if(d===e){b=$i(a,b,c);break a}Yi(a,b,d,c)}b=b.child}return b;case 5:return Kh(b),null===a&&Eg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Ef(d,e)?g=null:null!==f&&Ef(d,f)&&(b.flags|=32),\nhj(a,b),Yi(a,b,g,c),b.child;case 6:return null===a&&Eg(b),null;case 13:return pj(a,b,c);case 4:return Ih(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Bh(b,null,d,c):Yi(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),Zi(a,b,d,e,c);case 7:return Yi(a,b,b.pendingProps,c),b.child;case 8:return Yi(a,b,b.pendingProps.children,c),b.child;case 12:return Yi(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;f=b.memoizedProps;\ng=e.value;G(Mg,d._currentValue);d._currentValue=g;if(null!==f)if(He(f.value,g)){if(f.children===e.children&&!Wf.current){b=$i(a,b,c);break a}}else for(f=b.child,null!==f&&(f.return=b);null!==f;){var h=f.dependencies;if(null!==h){g=f.child;for(var k=h.firstContext;null!==k;){if(k.context===d){if(1===f.tag){k=ch(-1,c&-c);k.tag=2;var l=f.updateQueue;if(null!==l){l=l.shared;var m=l.pending;null===m?k.next=k:(k.next=m.next,m.next=k);l.pending=k}}f.lanes|=c;k=f.alternate;null!==k&&(k.lanes|=c);Sg(f.return,\nc,b);h.lanes|=c;break}k=k.next}}else if(10===f.tag)g=f.type===b.type?null:f.child;else if(18===f.tag){g=f.return;if(null===g)throw Error(p(341));g.lanes|=c;h=g.alternate;null!==h&&(h.lanes|=c);Sg(g,c,b);g=f.sibling}else g=f.child;if(null!==g)g.return=f;else for(g=f;null!==g;){if(g===b){g=null;break}f=g.sibling;if(null!==f){f.return=g.return;g=f;break}g=g.return}f=g}Yi(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,d=b.pendingProps.children,Tg(b,c),e=Vg(e),d=d(e),b.flags|=1,Yi(a,b,d,c),\nb.child;case 14:return d=b.type,e=Lg(d,b.pendingProps),e=Lg(d.type,e),aj(a,b,d,e,c);case 15:return cj(a,b,b.type,b.pendingProps,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),jj(a,b),b.tag=1,Zf(d)?(a=!0,cg(b)):a=!1,Tg(b,c),ph(b,d,e),rh(b,d,e,c),kj(null,b,d,!0,a,c);case 19:return yj(a,b,c);case 22:return ej(a,b,c)}throw Error(p(156,b.tag));};function Gk(a,b){return ac(a,b)}\nfunction al(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function Bg(a,b,c,d){return new al(a,b,c,d)}function bj(a){a=a.prototype;return!(!a||!a.isReactComponent)}\nfunction $k(a){if("function"===typeof a)return bj(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Da)return 11;if(a===Ga)return 14}return 2}\nfunction wh(a,b){var c=a.alternate;null===c?(c=Bg(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};\nc.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}\nfunction yh(a,b,c,d,e,f){var g=2;d=a;if("function"===typeof a)bj(a)&&(g=1);else if("string"===typeof a)g=5;else a:switch(a){case ya:return Ah(c.children,e,f,b);case za:g=8;e|=8;break;case Aa:return a=Bg(12,c,b,e|2),a.elementType=Aa,a.lanes=f,a;case Ea:return a=Bg(13,c,b,e),a.elementType=Ea,a.lanes=f,a;case Fa:return a=Bg(19,c,b,e),a.elementType=Fa,a.lanes=f,a;case Ia:return qj(c,e,f,b);default:if("object"===typeof a&&null!==a)switch(a.$$typeof){case Ba:g=10;break a;case Ca:g=9;break a;case Da:g=11;\nbreak a;case Ga:g=14;break a;case Ha:g=16;d=null;break a}throw Error(p(130,null==a?a:typeof a,""));}b=Bg(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function Ah(a,b,c,d){a=Bg(7,a,d,b);a.lanes=c;return a}function qj(a,b,c,d){a=Bg(22,a,d,b);a.elementType=Ia;a.lanes=c;a.stateNode={isHidden:!1};return a}function xh(a,b,c){a=Bg(6,a,null,b);a.lanes=c;return a}\nfunction zh(a,b,c){b=Bg(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}\nfunction bl(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=0;this.eventTimes=zc(0);this.expirationTimes=zc(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=zc(0);this.identifierPrefix=d;this.onRecoverableError=e;this.mutableSourceEagerHydrationData=\nnull}function cl(a,b,c,d,e,f,g,h,k){a=new bl(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=Bg(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null};ah(f);return a}function dl(a,b,c){var d=3{"use strict";eval("var __webpack_unused_export__;\n\n\nvar m = __webpack_require__(104);\nif (true) {\n exports.C = m.createRoot;\n __webpack_unused_export__ = m.hydrateRoot;\n} else { var i; }\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzUyLmpzIiwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZXMiOlsid2VicGFjazovL3JlYWN0LXF1aXotY29tcG9uZW50Ly4vbm9kZV9tb2R1bGVzL3JlYWN0LWRvbS9jbGllbnQuanM/MTFiMSJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG5cbnZhciBtID0gcmVxdWlyZSgncmVhY3QtZG9tJyk7XG5pZiAocHJvY2Vzcy5lbnYuTk9ERV9FTlYgPT09ICdwcm9kdWN0aW9uJykge1xuICBleHBvcnRzLmNyZWF0ZVJvb3QgPSBtLmNyZWF0ZVJvb3Q7XG4gIGV4cG9ydHMuaHlkcmF0ZVJvb3QgPSBtLmh5ZHJhdGVSb290O1xufSBlbHNlIHtcbiAgdmFyIGkgPSBtLl9fU0VDUkVUX0lOVEVSTkFMU19ET19OT1RfVVNFX09SX1lPVV9XSUxMX0JFX0ZJUkVEO1xuICBleHBvcnRzLmNyZWF0ZVJvb3QgPSBmdW5jdGlvbihjLCBvKSB7XG4gICAgaS51c2luZ0NsaWVudEVudHJ5UG9pbnQgPSB0cnVlO1xuICAgIHRyeSB7XG4gICAgICByZXR1cm4gbS5jcmVhdGVSb290KGMsIG8pO1xuICAgIH0gZmluYWxseSB7XG4gICAgICBpLnVzaW5nQ2xpZW50RW50cnlQb2ludCA9IGZhbHNlO1xuICAgIH1cbiAgfTtcbiAgZXhwb3J0cy5oeWRyYXRlUm9vdCA9IGZ1bmN0aW9uKGMsIGgsIG8pIHtcbiAgICBpLnVzaW5nQ2xpZW50RW50cnlQb2ludCA9IHRydWU7XG4gICAgdHJ5IHtcbiAgICAgIHJldHVybiBtLmh5ZHJhdGVSb290KGMsIGgsIG8pO1xuICAgIH0gZmluYWxseSB7XG4gICAgICBpLnVzaW5nQ2xpZW50RW50cnlQb2ludCA9IGZhbHNlO1xuICAgIH1cbiAgfTtcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///352\n")},104:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (false) {}\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (true) {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = __webpack_require__(516);\n} else {}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA0LmpzIiwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFVQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FB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webpack-internal:///104\n")},28:(__unused_webpack_module,exports)=>{"use strict";eval('/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nvar l=Symbol.for("react.element"),n=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),t=Symbol.for("react.provider"),u=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),z=Symbol.iterator;function A(a){if(null===a||"object"!==typeof a)return null;a=z&&a[z]||a["@@iterator"];return"function"===typeof a?a:null}\nvar B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};\nE.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,a,b,"setState")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;\nH.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=""+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1{"use strict";eval("\n\nif (true) {\n module.exports = __webpack_require__(28);\n} else {}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTA0LmpzIiwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9yZWFjdC1xdWl6LWNvbXBvbmVudC8uL25vZGVfbW9kdWxlcy9yZWFjdC9pbmRleC5qcz9hYjViIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcblxuaWYgKHByb2Nlc3MuZW52Lk5PREVfRU5WID09PSAncHJvZHVjdGlvbicpIHtcbiAgbW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL2Nqcy9yZWFjdC5wcm9kdWN0aW9uLm1pbi5qcycpO1xufSBlbHNlIHtcbiAgbW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL2Nqcy9yZWFjdC5kZXZlbG9wbWVudC5qcycpO1xufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///504\n")},328:(__unused_webpack_module,exports)=>{"use strict";eval('/**\n * @license React\n * scheduler.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nfunction f(a,b){var c=a.length;a.push(b);a:for(;0>>1,e=a[d];if(0>>1;dg(C,c))ng(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(ng(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}\nfunction g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if("object"===typeof performance&&"function"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D="function"===typeof setTimeout?setTimeout:null,E="function"===typeof clearTimeout?clearTimeout:null,F="undefined"!==typeof setImmediate?setImmediate:null;\n"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}\nfunction J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if("function"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();"function"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;\nfunction M(){return exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzI4LmpzIiwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vcmVhY3QtcXVpei1jb21wb25lbnQvLi9ub2RlX21vZHVsZXMvc2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bGxiYWNrOmIscHJpb3JpdHlMZXZlbDphLHN0YXJ0VGltZTpjLGV4cGlyYXRpb25UaW1lOmUsc29ydEluZGV4Oi0xfTtjPmQ/KGEuc29ydEluZGV4PWMsZih0LGEpLG51bGw9PT1oKHIpJiZhPT09aCh0KSYmKEI/KEUoTCksTD0tMSk6Qj0hMCxLKEgsYy1kKSkpOihhLnNvcnRJbmRleD1lLGYocixhKSxBfHx6fHwoQT0hMCxJKEopKSk7cmV0dXJuIGF9O1xuZXhwb3J0cy51bnN0YWJsZV9zaG91bGRZaWVsZD1NO2V4cG9ydHMudW5zdGFibGVfd3JhcENhbGxiYWNrPWZ1bmN0aW9uKGEpe3ZhciBiPXk7cmV0dXJuIGZ1bmN0aW9uKCl7dmFyIGM9eTt5PWI7dHJ5e3JldHVybiBhLmFwcGx5KHRoaXMsYXJndW1lbnRzKX1maW5hbGx5e3k9Y319fTtcbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///328\n')},712:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nif (true) {\n module.exports = __webpack_require__(328);\n} else {}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzEyLmpzIiwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9yZWFjdC1xdWl6LWNvbXBvbmVudC8uL25vZGVfbW9kdWxlcy9zY2hlZHVsZXIvaW5kZXguanM/NDAyOSJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG5cbmlmIChwcm9jZXNzLmVudi5OT0RFX0VOViA9PT0gJ3Byb2R1Y3Rpb24nKSB7XG4gIG1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9janMvc2NoZWR1bGVyLnByb2R1Y3Rpb24ubWluLmpzJyk7XG59IGVsc2Uge1xuICBtb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4vY2pzL3NjaGVkdWxlci5kZXZlbG9wbWVudC5qcycpO1xufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///712\n")}},__webpack_module_cache__={};function __webpack_require__(e){var n=__webpack_module_cache__[e];if(void 0!==n)return n.exports;var l=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(l.exports,l,l.exports,__webpack_require__),l.exports}__webpack_require__.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(n,{a:n}),n},__webpack_require__.d=(e,n)=>{for(var l in n)__webpack_require__.o(n,l)&&!__webpack_require__.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:n[l]})},__webpack_require__.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n);var __webpack_exports__=__webpack_require__(920)})(); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 198fe4b..9fd3475 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "react-quiz-component", - "version": "0.8.0", + "version": "0.8.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "react-quiz-component", - "version": "0.8.0", + "version": "0.8.1", "license": "MIT", "dependencies": { "dompurify": "^3.0.0", diff --git a/package.json b/package.json index 62cf53e..b5c26b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-quiz-component", - "version": "0.8.0", + "version": "0.8.1", "description": "React Quiz Component", "main": "dist/index.js", "module": "dist/index.es.js",