let socket=null;const MessageHandler={Error:{INVALID_USER_INPUT:()=>{console.log("WS Message ERR: Entrada de usuario no válida")},INVALID_PIN:()=>(new LoginPage(!1),new ErrorHandler("PIN inválido")),MAX_SESSION_COUNT:()=>{setTimeout((()=>{new ErrorHandler("Su dirección IP tiene demasiadas sesiones / pestañas conectadas actualmente."),activateLoading(!0,!0,"Demasiadas sesiones. Por favor espera."),setTimeout((()=>{resetGame()}),3e4)}),5e3)},INVALID_NAME:e=>(clearTimeout(game.handshakeTimeout),"Duplicate name"!==e.description?(new ErrorHandler("No se pudo conectar: "+(e.error||e)),new LoginPage):(new ErrorHandler("Nombre inválido."),new LoginPage(!0))),SESSION_NOT_CONNECTED:()=>{new ErrorHandler("No puedes hacer eso todavía; no te has unido a un juego.")},EMPTY_NAME:()=>{new ErrorHandler("No se ha proporcionado ningún nombre de prueba. El servidor no buscará hasta que se proporcione esta información.")},HANDSHAKE:()=>{let e;switch(clearTimeout(game.handshakeTimeout),new ErrorHandler("Se bloqueó la conexión al servidor de Kahoot. ¯\\_(ツ)_/¯"),document.getElementById("handshake-fail-div")&&(document.getElementById("handshake-fail-div").outerHTML=""),detectPlatform()){case"Windows":e="https://www.mediafire.com/file/ju7sv43qn9pcio6/kahoot-win-win.zip/file";break;case"MacOS":e="https://www.mediafire.com/file/bcvxlwlfvbswe62/Kahoot_Winner.dmg/file";break;default:e="https://www.mediafire.com/file/zb5blm6a8dyrwtb/kahoot-win-linux.tar.gz/file"}const t=document.createElement("div");t.innerHTML=`<span>Hmm, parece que estamos teniendo problemas por nuestra parte. Prueba <span class="mobihide"> descargando nuestra aplicación o </span> presionando el botón de informe a continuación.</span>\n      <br>\n      <a class="mobihide" href="${e}" onclick="dataLayer.push({event:'download_app'})" target="_blank">Descargar aplicación</a>\n      <br>\n      <button onclick="send({type:'HANDSHAKE_ISSUES',message:'AAAA!'});this.innerHTML = 'Se ha informado de un problema.';this.onclick = null;dataLayer.push({event:'report_error'});" title="Este botón puede reducir la cantidad de tiempo para restablecer el servidor.">Informar problemas</button>`,t.id="handshake-fail-div",t.style="\n        position: fixed;\n        top: 4rem;\n        z-index: 1000;\n        width: 100%;\n        color: white;\n        background: #888;\n        text-align: center;\n        border-radius: 5rem;\n      ",document.body.append(t)},PRIVATE_ID:()=>{new ErrorHandler("La ID de prueba proporcionada no es válida o pertenece a una prueba privada")}},Message:{SetName:e=>{document.getElementById("loginInput").value=e},PinGood:e=>{const t=e.match(/\d+/g)[0];t!=game.pin&&(game.pin=t);try{TutorialDiv.innerHTML=""}catch(e){}return new LoginPage(!0)},JoinSuccess:e=>("Music"===game.theme?game.playSound("/resource/music/lobby.m4a"):"Minecraft"===game.theme&&game.playSound("/resource/music/Minecraft.mp3"),e=JSON.parse(e),game.cid=e.cid,game.quizEnded=!1,dataLayer.push({event:"join_game"}),activateLoading(!1,!1),clearTimeout(game.handshakeTimeout),new LobbyPage),QuizStart:()=>{try{game.music.pause()}catch(e){}return new QuizStartPage},QuestionGet:e=>{const t=JSON.parse(e);return new GetReadyPage(t)},QuestionBegin:e=>(game.questionAnswered=!1,new QuestionAnswererPage(JSON.parse(e))),QuestionSubmit:e=>(game.questionAnswered=!0,new QuestionSnarkPage(e)),QuestionEnd:e=>{try{game.music.pause()}catch(e){}return new QuestionEndPage(e)},QuizFinish:e=>{game.quizEnded=!0,game.end.info=JSON.parse(e),dataLayer.push(Object.assign({event:"quiz_finish"},JSON.parse(e)))},FinishText:e=>("Music"===game.theme?game.playSound("/resource/music/podium.m4a"):"Minecraft"===game.theme&&game.playSound("/resource/music/Pigstep.m4a"),new QuizEndPage(e)),QuizEnd:e=>(game.quizEnded=!0,resetGame(),setTimeout((function(){new ErrorHandler("Prueba terminada o pateada. ("+e+")")}),300)),RunTwoSteps:()=>(game.two=[],new TwoStepPage),Ping:()=>{console.log("Recieved ping from server")},FailTwoStep:()=>new TwoStepPage(!0),TwoStepSuccess:()=>new LobbyPage,Maintainance:e=>new ErrorHandler("Maintainance Alert: "+e),OK:()=>{game.ready=!0},GameReset:()=>{new LobbyPage,delete game.question,delete game.guesses,delete game.answers,delete game.rawData,delete game.ans,delete game.got_answers,game.index=0,game.streak=0,game.score=0,game.quizEnded=!1},NameAccept:e=>{const t=JSON.parse(e);game.name=t.playerName;try{document.getElementById("L2").innerHTML=`<p>${t.playerName}</p>`}catch(e){}},TimeOver:()=>{new TimeUpPage},Feedback:()=>{new FeedbackPage},TeamTalk:e=>{new TeamTalkPage(JSON.parse(e))}}};class Game{constructor(){this.socket=null,this.oldQuizUUID="",this.name="",this.streak=0,this.ready=!1,this.cid="",this.pin=0,this.score=0,this.answers=[],this.quizEnded=!0,this.total=0,this.index=0,this.end={},this.two=[],this.errorTimeout=null,this.jumbleAnswer=[],this.multiAnswer={0:!1,1:!1,2:!1,3:!1},this.theme="Kahoot",this.opts={},this.correctIndex=null,this.questionStarted=!1,this.questionAnswered=!1}sendPin(pin){return new Promise((res=>{this.pin=pin,grecaptcha.ready((()=>{grecaptcha.execute("6LcyeLEZAAAAAGlTegNXayibatWwSysprt2Fb22n",{action:"submit"}).then((token=>{this.socket=new WebSocket(`${"http:"==location.protocol?"ws://":"wss://"}${location.host}?token=${token}`),socket=this.socket,socket.onmessage=evt=>{evt=evt.data;const data=JSON.parse(evt);if("Error"==data.type)return MessageHandler.Error[data.message](data.data);eval(`MessageHandler.${data.type}("${data.message.replace(/\\/gim,"\\\\").replace(/"/gim,'\\"')}")`)},socket.onclose=()=>{game.disconnectTime=Date.now(),new ErrorHandler("Session disconnected."),activateLoading(!0,!0,"<br><br><br><br><p>Reconnecting</p>");let e=0;!function t(a){const n=new XMLHttpRequest;n.open("GET","/up"),n.send(),n.onerror=n.ontimeout=function(){if(++e>10)return location.href="https://theusaf.github.io/kahoot%20winner%20error.html";(a*=2)>30&&(a=30),setTimeout((function(){t(a)}),1e3*a)},n.onload=function(){if(200!=n.status||!/^-?\d+ (hours|minutes) until expected reset.*$/.test(n.response))return n.onerror(a);activateLoading(!1,!1),game.quizEnded||"0"==game.pin[0]?resetGame():resetGame(!0)}}(.5)},socket.onopen=()=>{const e=setInterval((()=>{this.ready&&(res(),send({type:"SET_PIN",message:pin}),this.loadOptions(),clearInterval(e))}),500)}})).catch((e=>{new ErrorHandler("Captcha failed: "+e),new LoginPage,activateLoading(!1)}))})),activateLoading(!0,!0)}))}join(e){this.name=e,send({type:"JOIN_GAME",message:e}),activateLoading(!0,!0),this.handshakeTimeout=setTimeout((()=>{let e;switch(document.getElementById("handshake-fail-div")&&(document.getElementById("handshake-fail-div").outerHTML=""),MessageHandler.Error.HANDSHAKE(),detectPlatform()){case"Windows":e="https://www.mediafire.com/file/ju7sv43qn9pcio6/kahoot-win-win.zip/file";break;case"MacOS":e="https://www.mediafire.com/file/bcvxlwlfvbswe62/Kahoot_Winner.dmg/file";break;default:e="https://www.mediafire.com/file/zb5blm6a8dyrwtb/kahoot-win-linux.tar.gz/file"}const t=document.createElement("div");t.innerHTML=`<span>Hmm, parece que estamos teniendo problemas por nuestra parte. Prueba <span class="mobihide"> descargando nuestra aplicación o </span> presionando el botón de informe a continuación.</span>\n      <br>\n      <a href="${e}" onclick="dataLayer.push({event:'download_app'})" target="_blank">Descargar aplicación</a>`,t.className="shortcut",t.id="handshake-fail-div",t.style="\n        position: fixed;\n        top: 4rem;\n        z-index: 1000;\n        width: 100%;\n        color: white;\n        background: #888;\n        text-align: center;\n        border-radius: 5rem;\n      ",document.body.append(t)}),1e4)}getRandom(){dataLayer.push({event:"get_random_name"}),send({type:"GET_RANDOM_NAME",message:"please?"})}saveOptions(){const e=SettingDiv.querySelectorAll("input,select"),t={};for(let a=0;a<e.length;++a)t[e[a].id]="checkbox"==e[a].type?e[a].checked:e[a].value;localStorage.options=JSON.stringify({manual:t.manual,timeout:t.timeout,brute:t.brute,fail:t.fail,teamtalk:t.teamtalk,teamMembers:t.teamMembers,theme:t.theme,previewQuestion:t.previewQuestion,searchLoosely:t.searchLoosely,ChallengeDisableAutoplay:t.ChallengeDisableAutoplay,ChallengeDisableTimer:t.ChallengeDisableTimer,div_game_options:t.div_game_options,div_search_options:t.div_search_options,div_challenge_options:t.div_search_options});const a=game.opts;game.theme=t.theme,game.opts=t,send({type:"SET_OPTS",message:JSON.stringify(t)}),game.questionStarted&&!game.questionAnswered&&a.manual&&!game.opts.manual&&send({type:"ANSWER_QUESTION",message:null})}loadOptions(){let e;try{e=JSON.parse(localStorage.options),game.opts=e,game.theme=e.theme}catch(e){return}if(e){for(const t in e){const a=document.getElementById(t);"checkbox"==a.type?a.checked=e[t]:a.value=e[t]}if(socket&&1===socket.readyState)return game.saveOptions(),dataLayer.push(Object.assign({event:"load_options"},e)),new ErrorHandler("¡Opciones restauradas!",{isNotice:!0});null!==socket&&setTimeout((()=>{this.loadOptions()}),3e3)}}answer(e){activateLoading(!0,!0),send({type:"ANSWER_QUESTION",message:e}),dataLayer.push({event:"answer",value:e,type:this.question.type})}answer2(e,t){if(t.className="faded",-1==this.two.indexOf(e))return this.two.push(e),4==this.two.length?(send({type:"DO_TWO_STEP",message:JSON.stringify(this.two)}),void activateLoading(!0,!0,"")):void 0}answerJ(e){const t=[];for(let a=0;a<e.length;a++)t.push(Number(e[a].getAttribute("index")));this.answer(t)}answerM(e,t){this.multiAnswer[e]=!this.multiAnswer[e],-1!=t.className.indexOf("correct")?t.className=this.multiAnswer[e]?"fadedm correct":"correct":t.className=this.multiAnswer[e]?"fadedm":""}updateName(){clearTimeout(this.saveTimeout);const e=/[a-f0-9]{8}(-[a-f0-9]{4}){3}-[a-f0-9]{12}/i;e.test(document.getElementById("searchTerm").value)&&(document.getElementById("uuid").value=document.getElementById("searchTerm").value.match(e)[0]),this.saveTimeout=setTimeout(this.saveOptions,500)}playSound(e){this.music||(this.music=new Audio,this.music.addEventListener("timeupdate",(()=>{this.music.currentTime>this.music.duration-.44&&(this.music.currentTime=0,this.music.play())}))),this.music.pause(),this.music.src=e,this.music.play()}}function send(e){null!==socket&&socket.send(JSON.stringify(e))}function setCookie(e){document.cookie=`lang=${e}; expires=${new Date(Date.now()+31536e6).toGMTString()}; path=/`,"serviceWorker"in navigator?navigator.serviceWorker.getRegistrations().then((async function(t){for(const e of t)await e.unregister();location.href="en"!==e?"/"+e:"/"})).catch((()=>{location.href="en"!==e?"/"+e:"/"})):location.href="en"!==e?"/"+e:"/"}let game=null;game=new Game;const eggstyle=document.createElement("style");let egg="";eggstyle.innerHTML="p,.sm span,img,h1,h2,.About h3,.tut_cont h3,h4{\n  animation: infinite windance 1s;\n}";let shouldStop=!1;function detectPlatform(){let e="Linux";return-1!=navigator.appVersion.indexOf("Win")&&(e="Windows"),-1!=navigator.appVersion.indexOf("Mac")&&(e="MacOS"),-1!=navigator.appVersion.indexOf("X11")&&(e="UNIX"),-1!=navigator.appVersion.indexOf("Linux")&&(e="Linux"),e}window.addEventListener("keydown",(e=>{"Escape"==e.key&&(0==closePage?SettingSwitch.click():1==closePage?AboutSwitch.click():ChangelogSwitch.click()),egg+=e.key;try{if(0!="winner".search(egg)&&0!="return by death".search(egg)&&0!="behold an unthinkable present".search(egg)&&0!="explosion".search(egg)){egg="",shouldStop&&(game.music.pause(),shouldStop=!1);try{document.body.removeChild(eggstyle)}catch(e){}}else if("winner"==egg)document.body.append(eggstyle);else if("return by death"==egg)"ReZero"===game.theme&&(game.playSound("/resource/music/return_by_death.mp3"),shouldStop=!0,document.body.style="box-shadow:inset 0 0 10rem 5rem darkviolet;",setTimeout((()=>{game.music.pause(),document.body.style=""}),2e4*Math.random()+1e4));else if("behold an unthinkable present"==egg)"ReZero"===game.theme&&(game.playSound("/resource/music/behold_unthinkable_present.m4a"),shouldStop=!0);else if("explosion"==egg&&"KonoSuba"===game.theme&&0===game.pin){game.playSound("/resource/music/megumin_explosion.mp3"),document.body.style="box-shadow:inset 0 0 0.7rem 0.7rem #451b0e,inset 0 0 1.4rem 1.4rem #973716,inset 0 0 1.8rem 1.8rem #cd4606,inset 0 0 2.1rem 2.1rem #ec760c,inset 0 0 2.4rem 2.4rem #ffae34,inset 0 0 2.7rem 2.7rem #fefcc9";const e=document.createElement("img");e.src="/resource/red-konosuba.svg",e.style="position:fixed;top:calc(50% - 5rem);left:100%;width:10rem;transition:left 4s;",document.body.append(e),setTimeout((()=>{e.style.left="calc(75% - 5rem)"})),setTimeout((()=>{e.style.left="150%"}),16e3),setTimeout((()=>{document.body.style="";const t=document.createElement("div");document.body.append(t),t.style="position:fixed;top:0;left:0;width:100%;height:100%;z-index:5000;transition:background 2s",t.style.background="darkorange",setTimeout((()=>{t.style.background="beige",setTimeout((()=>{e.outerHTML="",t.style.background="black",game.music.pause(),setTimeout((()=>{t.outerHTML=""}),3e3)}),3e3)}),2e3)}),21e3)}}catch(e){egg="",shouldStop&&(game.music.pause(),shouldStop=!1)}})),localStorage.KW_Version="v4.0.2";const checkVersion=new XMLHttpRequest;checkVersion.open("GET","/up"),checkVersion.send(),checkVersion.onload=function(){const e=checkVersion.response.split(": ")[1],t=localStorage.KW_Version||e;"false"!=localStorage.KW_Update&&(e!=t&&new ErrorHandler("Hay una nueva actualización disponible.",{permanent:!0,onclick:(t,a)=>{a.outerHTML="";const n=document.createElement("div");n.id="UpdateDiv",n.innerHTML='<h2>Hay una nueva actualización disponible.</h2>\n        <h4>¿Te gustaría actualizar ahora?</h4>\n        <p>Si este mensaje sigue apareciendo, intente actualizar su página o borrar su caché.</p>\n        <button id="UpdateYes">Sí</button><button id="UpdateNo">Aún no</button><br>\n        <button onclick="localStorage.KW_Update = false;this.parentElement.outerHTML = \'\';">Deshabilitar la notificación de actualización</button>',document.body.append(n),document.getElementById("UpdateYes").onclick=function(){"serviceWorker"in navigator?(document.getElementById("UpdateYes").innerHTML="Por favor espera...",navigator.serviceWorker.getRegistrations().then((async function(t){for(const e of t)await e.unregister();setTimeout((function(){localStorage.KW_Version=e,location.reload()}),3e3)})).catch((function(){document.getElementById("UpdateDiv").outerHTML="",new ErrorHandler("Hubo un error al forzar una actualización. Borre o vuelva a cargar la caché de la página manualmente.")}))):(document.getElementById("UpdateDiv").outerHTML="",new ErrorHandler("Hubo un error al forzar una actualización. Borre o vuelva a cargar la caché de la página manualmente."))},document.getElementById("UpdateNo").onclick=function(){document.getElementById("UpdateDiv").outerHTML=""}}}),localStorage.KW_Version||(localStorage.KW_Version=e))};const KahootThemes={Kahoot:{red:"red.svg",blue:"blue.svg",green:"green.svg",yellow:"yellow.svg",logo:"logo-xmas.svg"},KonoSuba:{red:"red-konosuba.svg",blue:"blue-konosuba.svg",green:"green-konosuba.svg",yellow:"yellow-konosuba.svg",logo:"logo-konosuba.svg"},get Rainbow(){return KahootThemes.Kahoot},get Music(){return KahootThemes.Kahoot},FRANXX:{red:"red-franxx.svg",blue:"blue-franxx.svg",green:"green-franxx.svg",yellow:"yellow-franxx.svg",get logo(){return KahootThemes.Kahoot.logo}},ReZero:{red:"red-rezero.svg",blue:"blue-rezero.svg",green:"green-rezero.svg",yellow:"yellow-rezero.svg",logo:"logo-rezero.svg"},Minecraft:{red:"red-mc.svg",blue:"blue-mc.svg",green:"green-mc.svg",yellow:"yellow-mc.svg",logo:"logo-mc.png"}};function Element(e,t){const n=document.createElement(e);for(const e in t||{})n[e]=t[e];return n}function RemoveHandshakeFail(){document.getElementById("handshake-fail-div")&&(document.getElementById("handshake-fail-div").outerHTML="")}function NotFoundDiv(){const e=Element("div",{className:"ChallengeQuestion noQuiz"}),t=Element("span");return t.innerHTML=`<input id="nameInput" placeholder="Ingrese el nombre de la prueba" value="${document.getElementById("searchTerm").value.replace(/&/g,"&amp;").replace(/"/g,"&quot;")||""}" oninput="document.getElementById('searchTerm').value = this.value;game.updateName();"></input>`,e.append(Element("br"),Element("br"),t),e}class LoginPage{constructor(e){document.body.className="rainbow",Themer(),QuizResult.className="disabled button",QuizResult.removeAttribute("url"),ChallengeContinueButton.style.display="none",RemoveHandshakeFail(),-1==(new Date).toString().search("Apr 1")&&-1==(new Date).toString().search("Mar 31")||(game.theme="KonoSuba");const t=clearUI();t.className="Login",t.setAttribute("ui-event","Login");const n=Element("img",{alt:"Kahoot logo",src:`/resource/${KahootThemes[game.theme].logo}`}),a=Element("p",{id:"logotext",innerHTML:"WINNER",onclick:()=>{a.style.display="none"}}),s=Element("input",{type:e?"text":"tel",id:"loginInput",placeholder:e?"Apodo":"PIN del juego",onkeydown:e?e=>{if("Enter"===e.code)return game.join(s.value)}:e=>{if("Enter"===e.code)return game.sendPin(s.value)}}),o=Element("button",{innerHTML:e?"¡OK ve!":"Entrar",id:"loginButton",onclick:e?()=>game.join(s.value):()=>game.sendPin(s.value)});if(e){try{document.getElementById("lang").outerHTML=""}catch(e){}const e=Element("button",{innerHTML:"Obtener nombre aleatorio",onclick:()=>{game.getRandom()}});e.style.marginBottom="0.5rem",t.append(n,a,s,e,o),document.getElementsByClassName("grecaptcha-badge")[0].style.visibility="hidden","0"!=game.pin[0]&&(document.getElementById("div_challenge_options").parentElement.className="fadedm")}else{document.getElementById("div_challenge_options").parentElement.className="";const e=Element("label",{htmlFor:"about",innerHTML:"About",id:"abtlnk"}),l=Element("div",{id:"chnge"}),r=Element("label",{htmlFor:"changelog",innerHTML:"Changelog"}),i=Element("span",{innerHTML:"¡Kahoot! y la K! logo son marcas registradas de Kahoot! AS."}),c=Element("span",{innerHTML:'<a href="/privacy/">Privada</a> | <a href="/terms/">Condiciones</a>'}),m=Element("div",{id:"lang"});m.innerHTML='<label for="langToggle"><img src="/resource/language.svg"/></label>\n      <input class="ch" id="langToggle" type="checkbox"/>\n      <div class="lang">\n        <button onclick="setCookie(\'en\')">English</button>\n        <button onclick="setCookie(\'es\')">Español</button>\n        <button onclick="setCookie(\'zh\')">中文</button>\n      </div>',document.getElementById("lang")||document.body.append(m),l.append(r,i,c),t.append(n,a,s,o,e,l)}const l=Element("div",{className:"sm sidebar correct"});l.innerHTML='<div class="mobihide2 mobihide">\n    <a href="/creator" target="_blank"><img src="/resource/icon-kahoot.svg" alt="create"><span>Creador</span></a>\n    <a href="/api" target="_blank"><img src="/resource/icon-api.svg" alt="api"><span>API de Kahoot</span></a>\n    <a href="/blog" target="_blank"><img src="/resource/icon-blog.svg" alt="Icon made from http://www.onlinewebfonts.com/icon is licensed by CC BY 3.0"><span>Blog</span></a>\n    <a href="/blog/download" target="_blank" class="mobihide2 mobihide"><img src="/resource/icon192.png" alt="download mark"><span>Descarga de la aplicación</span></a>\n    </div>\n    <a href="https://discord.gg/58SHzC2" target="_blank"><img src="/resource/logo-discord.svg" alt="discord"><span>Discord</span></a>\n    <a href="https://twitter.com/theusafyt" target="_blank"><img src="/resource/logo-twitter.svg" alt="twitter"><span>Twitter</span></a>\n    <a href="https://www.facebook.com/theusafmc" target="_blank"><img src="/resource/logo-fbook.svg" alt="facebook"><span>Facebook</span></a>',e||t.append(l),UIDiv.append(t)}}class TwoStepPage{constructor(e){new ErrorHandler(e?"2 Step Auth Failed.":"2 Step Auth Required");const t=new LobbyPage;t.mid.innerHTML="",t.main.setAttribute("ui-event","TwoFactorAuth"),document.body.className="Rainbow"==game.theme?"rainbow":"purple";const n=Element("p",{innerHTML:"PIN: "+game.pin});t.top.append(n);const a=Element("div",{className:"Answers"}),s=Element("img",{src:`/resource/${KahootThemes[game.theme].red}`,alt:"Red",onclick:()=>{game.answer2(0,s)}}),o=Element("img",{src:`/resource/${KahootThemes[game.theme].blue}`,alt:"Blue",onclick:()=>{game.answer2(1,o)}}),l=Element("img",{src:`/resource/${KahootThemes[game.theme].green}`,alt:"Green",onclick:()=>{game.answer2(2,l)}}),r=Element("img",{src:`/resource/${KahootThemes[game.theme].yellow}`,alt:"Yellow",onclick:()=>{game.answer2(3,r)}});a.append(s,o,r,l),t.main.append(a),e&&activateLoading(!1,!0)}}class ErrorHandler{constructor(e,t){const n=Element("div",{className:(t=t||{}).isNotice?"NotError":"",onclick:t.onclick?e=>{t.onclick(e,n)}:null}),a=Element("span",{innerHTML:e}),s=Element("span",{innerHTML:"X",onclick:e=>{n.outerHTML="",e.preventDefault(),e.stopPropagation()},className:"ErrorCloser"});n.append(a,s),UIError.insertBefore(n,UIError.querySelector("div"));let o=7e3;n.onclick&&(o=3e4,n.className+=" Clickable"),t.time&&(o=t.time),t.permanent||setTimeout((()=>{n.style.opacity=0,setTimeout((()=>{try{n.outerHTML=""}catch(e){}}),1e3)}),o)}}class LobbyPage{constructor(){try{document.getElementById("lang").outerHTML=""}catch(e){}RemoveHandshakeFail(),window.onbeforeunload=function(e){e.returnValue="¿Estás seguro de que quieres salir de la página?"},document.querySelector(".ad-container").style.display="none",document.querySelector(".ad-container-2").style.display="none","0"==game.pin[0]&&game.opts.ChallengeDisableAutoplay&&(ChallengeContinueButton.style.display="");const e=clearUI();e.className="lobby",e.setAttribute("ui-event","Lobby"),document.body.className="Rainbow"==game.theme?"rainbow":"green";const t=Element("div",{id:"L1",className:"extra"}),n=Element("div",{id:"L2",className:"extra"});"Rainbow"==game.theme&&(t.className="extra rainbow");const a=Element("p",{innerText:game.name}),s=Element("h1",{className:"shadow",innerHTML:"¡Estas en!"}),o=Element("h2",{innerHTML:"¿Ves tu apodo en la pantalla?",className:"shadow"}),l=Element("div",{id:"UIMid"}),r=Element("div");return s.setAttribute("text","¡Estas en!"),o.setAttribute("text","¿Ves tu apodo en la pantalla?"),n.append(a),r.append(s,o),l.append(r),e.append(t,n,l),void 0===game.guesses&&e.append(NotFoundDiv()),UIDiv.append(e),{main:e,top:t,mid:l,bottom:n}}}class GetReadyPage{constructor(e,t){game.recievedTime=Date.now(),game.questionStarted=!1,game.jumbleAnswer=[],game.question=e;const n=new LobbyPage;try{document.querySelector(".noQuiz").outerHTML=""}catch(e){}ChallengeContinueButton.style.display="none",document.body.className="blue",n.main.setAttribute("ui-event","GetReady"),n.mid.innerHTML="";const a=Element("h1",{innerHTML:`Pregunta ${(e.index||0)+1}`,className:"shadow"});a.setAttribute("text",a.innerText),game.answers=e.data,game.got_answers=e.cans,game.guesses=e.currentGuesses,game.total=e.ans.length,game.index=e.index||0,game.ans=e.ans,game.rawData=e.raw;const s={time:e.raw.timeAvailable||2e4};if(game.guesses.length>=1?(QuizResult.className="button",QuizResult.setAttribute("url",`https://create.kahoot.it/details/${game.guesses[0].uuid}`)):(QuizResult.className="disabled button",QuizResult.removeAttribute("url")),""!==document.getElementById("timeout_custom_1").value){const e=calculateTimeout(Number(document.getElementById("timeout_custom_1").value),s.time,0);document.getElementById("timeout").value=e/1e3,game.saveOptions()}else if(""!==document.getElementById("timeout_custom_2").value){const e=Number(document.getElementById("timeout_custom_2").value)-game.score,t=game.total-game.index;let n=0;n=e/t<500?s.time+500:calculateTimeout(e/t,s.time,game.streak),document.getElementById("timeout").value=n/1e3,game.saveOptions()}game.guesses&&game.guesses.length&&game.guesses[0].uuid!=game.oldQuizUUID&&(game.oldQuizUUID=game.guesses[0].uuid,dataLayer.push({event:"find_quiz",value:game.oldQuizUUID}));const o=Element("h2",{innerHTML:"Listo...",className:"shadow"});o.setAttribute("text","Listo...");const l=Element("p",{innerHTML:""+game.score,className:"dark"}),r=Element("p",{innerHTML:`${game.index+1} de ${game.total}`}),i=Element("img",{alt:"",src:`/resource/type/${e.type}.svg`}),c=Element("span",{innerHTML:{quiz:"Examen",open_ended:"Abierto",survey:"Encuesta",jumble:"Rompecabezas",word_cloud:"Nube de palabras",content:"Diapositivas",multiple_select_poll:"Encuesta",multiple_select_quiz:"Examen"}[e.type]}),m=Element("div",{id:"quizTypeImage"});if("multiple_select_quiz"===e.type?i.src="/resource/type/quiz.svg":"multiple_select_poll"===e.type?i.src="/resource/type/survey.svg":"quiz"===e.type&&"TRUE_FALSE"===game.rawData.gameBlockLayout&&(i.src="/resource/type/true_false.svg",c.innerHTML="Verdadero o falso"),m.append(i,c),n.top.append(r,m),n.bottom.append(l),"content"==game.question.type){document.body.className="blue2";const e=Element("div"),t=Element("h1",{innerHTML:"Buscar",className:"shadow"});t.setAttribute("text","Buscar");const a=Element("h2",{innerHTML:"¡No es necesario que respondas esta vez!",className:"shadow"});a.setAttribute("text","¡No es necesario que respondas esta vez!");const s=Element("img",{src:"/resource/content-slide.svg",id:"ContentImage"});return e.append(t,s,a),n.mid.append(e),n}if(t)return n;const u=Element("h2",{id:"timer",innerHTML:game.question.timeLeft||"5"}),d=Element("div"),g=Element("div"),p=Element("img",{src:"/resource/load-large.svg",className:"load_circle",alt:"load_circle"});g.append(p,u),d.append(a,g,o),n.mid.append(d);let h=game.question.timeLeft||5;const y=setInterval((()=>{try{--h<0?clearInterval(y):(u.innerHTML=h,o.innerHTML=["¡Vamos!","Listos.","Listo..."][h>=3?2:h],o.setAttribute("text",o.innerText))}catch(e){clearInterval(y)}}),1e3);if(+game.opts.searchLoosely){if(2==+game.opts.searchLoosely){const e=Element("div",{innerHTML:"<span>¡Listo!</span>",className:"next"});e.addEventListener("click",(()=>{e.innerHTML="<span>Esperando...</span>",e.className="faded next",function e(){if(game.questionStarted)return new QuestionAnswererPage;setTimeout((function(){e()}),500)}()})),n.main.append(e)}if(activateLoading(!1,!1),clearInterval(y),u.outerHTML="",d.outerHTML="",0==game.guesses.length)n.main.append(NotFoundDiv());else{const e=game.guesses[0].questions,t=[];for(let n=0;n<e.length;n++)if(e[n].type==game.question.type&&(e[n].layout==game.rawData.gameBlockLayout||!e[n].layout)&&("object"==typeof e[n].choices&&e[n].choices.length||null)==game.ans[game.index]){let a=!0,s=0;const o=game.got_answers.slice(0);for(let t=0;t<o.length;t++){function b(e){const{text:n,correct:a,type:s,choice:l}=o[t];switch(s){case"quiz":return null!==l&&(n===e.answer&&e.correct===a);case"open_ended":return!!a&&(n===e.answer&&e.correct);case"jumble":case"multiple_select_poll":case"multiple_select_quiz":return!!n.split("|").includes(l.answer);default:return n===e.answer&&e.correct===a}}if(e[n].choices&&e[n].choices.filter(b).length){a=!1;for(let t=0;t<e.length;t++)e[t].choices.filter(b).length&&s++;break}}if(!a&&1===s)continue;t.push({i:n,q:e[n]})}const a=Element("input",{className:"looseInput",placeholder:"Pregunta"}),s=Element("div",{className:"looseDiv"}),o=Element("div",{className:"looseOptions"}),l=e=>{o.innerHTML="";let n=!1;for(let a=0;a<t.length;a++){const s=t[a].q.question||t[a].q.title,l=/<\/?[ib]>|[^a-z0-9\s]/gim,r=/<\/?[ib]>/gim;const i=s.replace(l," ").replace(/\s+/gm," ").match(new RegExp(e.replace(l," ").replace(/\s+/gm," "),"gmi")),c=s.replace(r,"").match(new RegExp(e.replace(r,"").replace(/\[/gm,"\\[").replace(/\(/gm,"\\(").replace(/\{/gm,"\\{").replace(/\*/gm,"\\*").replace(/\+/gm,"\\+").replace(/\?/gm,"\\?").replace(/\|/gm,"\\|").replace(/\^/gm,"\\^").replace(/\$/gm,"\\$").replace(/\./gm,"\\.").replace(/\\/gm,"\\\\"),"gmi")),m=s.replace(l,"").match(new RegExp(e.replace(l,""),"gmi"));if(i||c||m){n||(game.correctIndex==t[a].i||(send({type:"CHOOSE_QUESTION_INDEX",message:t[a].i}),game.correctIndex=t[a].i,game.question.data=game.guesses[0].questions[t[a].i].choices,game.question.ans=game.ans),n=!0);const e=i||c||m,l=Element("p");let r=s;for(let t=0;t<e.length;t++)r=s.replace(e[t],"<b>"+e[t]+"</b>");l.innerHTML=r,l.addEventListener("click",(()=>{send({type:"CHOOSE_QUESTION_INDEX",message:t[a].i}),game.correctIndex=t[a].i,game.question.data=game.guesses[0].questions[t[a].i].choices,game.ans[game.index]=game.question.data?game.question.data.length:4,game.question.ans=game.ans,Array.from(o.children).forEach((e=>{e.className=""})),l.className="looseChoice"})),0===o.children.length&&(l.className="looseChoice"),o.append(l)}}};l(""),s.append(a,o),n.main.append(s),a.addEventListener("input",(()=>{l(a.value)})),a.focus()}}else if(game.opts.previewQuestion){activateLoading(!1,!1),clearInterval(y),u.outerHTML="",d.outerHTML="";const e=Element("div",{className:"ChallengeQuestion"}),t=Element("span");0==game.guesses.length?(e.className="ChallengeQuestion noQuiz",t.innerHTML=`<input id="nameInput" placeholder="Ingrese el nombre de la prueba" value="${document.getElementById("searchTerm").value.replace(/&/g,"&amp;").replace(/"/g,"&quot;")||""}" oninput="document.getElementById('searchTerm').value = this.value;game.updateName();"></input><a href="https://kahoot-win.herokuapp.com/blog/quiz-not-found" target="_blank" class="error-info">[?]</a>`):t.innerHTML="Pregunta: "+(game.guesses[0].questions[game.index].question||game.guesses[0].questions[game.index].title),e.append(Element("br"),Element("br"),t);const a=Element("div",{className:"questionPreviewAnswers",innerHTML:"<h4>Respuestas correctas</h4>"}),s=[];for(const e in game.answers)game.answers[e].correct&&s.push(e);for(const e in s){const t=["red","blue","yellow","green"],n=Element("template");n.innerHTML=`<div class="${game.answers[s[e]].correct?"correct":""}">\n          <img class="icon${t[s[e]]}" src="/resource/${KahootThemes[game.theme][t[s[e]]]}" alt="answer choice icon">\n          <span>${game.answers[s[e]].answer}</span>\n        </div>`,a.append(n.content.cloneNode(!0))}n.main.append(a),n.main.append(e)}else 0==game.guesses.length&&n.main.append(NotFoundDiv());if(2==game.opts.fail){const e=Element("div",{className:"failChoice"}),t=Element("input",{type:"radio",name:"fail",id:"fail1"}),a=Element("input",{type:"radio",name:"fail",id:"fail2",checked:!0}),s=Element("label",{htmlFor:"fail1",innerHTML:"&nbsp;Falla&nbsp;"}),o=Element("label",{htmlFor:"fail2",innerHTML:"No falles"});e.append(t,s,a,o),n.main.append(e),s.onclick=o.onclick=function(){setTimeout((()=>{t.checked?send({type:"FAIL_CURRENT_QUESTION",message:!0}):send({type:"FAIL_CURRENT_QUESTION",message:!1})}))}}return n}}class QuizStartPage{constructor(){const e=new LobbyPage;ChallengeContinueButton.style.display="none",e.main.setAttribute("ui-event","QuizStart"),e.mid.innerHTML="";const t=Element("h1",{innerHTML:"¡Prepararse!",className:"shadow"});t.setAttribute("text","¡Prepararse!");const n=Element("h2",{innerHTML:"Cargando...",className:"shadow"});n.setAttribute("text","Cargando...");const a=Element("img",{src:"/resource/load-hole.svg",alt:"loading...",className:"load_circle"}),s=Element("div");s.append(t,a,n),e.mid.append(s),document.body.className="purple2"}}class QuestionAnswererPage{constructor(e){if(!0===game.isAnswerPage)return game.isAnswerPage=!1;if(ChallengeContinueButton.style.display="none",2==game.opts.searchLoosely&&!game.questionStarted)return void(game.questionStarted=!0);2!=game.opts.searchLoosely||game.opts.manual||setTimeout((()=>{send({type:"ANSWER_QUESTION",message:null})}),1e3*game.opts.timeout-(Date.now()-game.recievedTime));const t=new GetReadyPage(e||game.question,!0);if(t.main.setAttribute("ui-event","QuestionAnswer"),game.receivedQuestion=!0,game.questionStarted=!0,document.body.className="Rainbow"==game.theme?"rainbow":"",t.mid.innerHTML="","content"==game.question.type){document.body.className="blue2";const e=Element("div"),n=Element("h1",{innerHTML:"Buscar",className:"shadow"});n.setAttribute("text","Buscar");const a=Element("h2",{innerHTML:"¡No es necesario que respondas esta vez!",className:"shadow"});a.setAttribute("text","¡No es necesario que respondas esta vez!");const s=Element("img",{src:"/resource/content-slide.svg",id:"ContentImage"});return e.append(n,s,a),void t.mid.append(e)}const n=Element("div",{className:"Answers"});if("open_ended"==game.question.type||"word_cloud"==game.question.type){const e=game.answers.filter((e=>e.correct))[0],a=Element("input",{className:"openended",placeholder:e?e.answer:"",onkeydown:e=>{"Enter"===e.code&&game.answer(a.value)}}),s=Element("div",{onclick:()=>{game.answer(a.value)},innerHTML:"Submit"}),o=Element("div",{style:"margin: auto;"});HideAnswers.checked&&(a.placeholder=""),o.append(a,s),n.append(o),t.main.append(n),a.focus(),activateLoading(!1,!document.getElementById("manual").checked)}else{const e=Element("img",{src:`/resource/${KahootThemes[game.theme].red}`,alt:"Red"}),s=Element("img",{src:`/resource/${KahootThemes[game.theme].blue}`,alt:"Blue"}),o=Element("img",{src:`/resource/${KahootThemes[game.theme].green}`,alt:"Green"}),l=Element("img",{src:`/resource/${KahootThemes[game.theme].yellow}`,alt:"Yellow"}),r=[e,s,l,o],i=game.ans[game.index];for(let e=0;e<i;e++)r[e].setAttribute("draggable","false"),n.append(r[e]);if(2==game.ans[game.index]&&(e.style.maxHeight="100%",s.style.maxHeight="100%","TRUE_FALSE"==game.rawData.gameBlockLayout&&(e.setAttribute("css","layout-tfb"),s.setAttribute("css","layout-tfr"),e.src=s.src=`/resource/${KahootThemes[game.theme].blue}`,s.src=`/resource/${KahootThemes[game.theme].red}`)),t.main.append(n),activateLoading(!1,!document.getElementById("manual").checked),"jumble"==game.question.type){function a(e,t){const a=e.cloneNode(!0);n.append(a),a.style.left=(t.x||t.touches[0].clientX)+"px",e.style.visibility="hidden",a.className="draggable";const s=function(e){a.style.left=(e.x||e.touches[0].clientX)-16+"px",function(e,t){const a=[];let s=0,o=0;for(let e=0;e<t.length;e++){"hidden"===t[e].style.visibility&&(o=e);const n=t[e].getBoundingClientRect();s=n.width/2-16,a.push([n.x,n.x+n.width])}const l=(e.x||e.touches[0].clientX)+s;let r=0,i=1/0;for(let e=0;e<a.length;e++)Math.abs(l-a[e][0])<i&&(i=Math.abs(l-a[e][0]),r=e),Math.abs(l-a[e][1])<i&&(i=Math.abs(l-a[e][1]),r=e);"hidden"!==t[r].style.visibility&&(o>r?n.insertBefore(t[o],t[r]):n.insertBefore(t[o],t[r].nextSibling))}(e,n.querySelectorAll("img.jumble"))},o=function(){a.outerHTML="",e.style.visibility="",window.removeEventListener("mousemove",s),window.removeEventListener("touchmove",s),window.removeEventListener("mouseup",o),window.removeEventListener("touchend",o)};window.addEventListener("mousemove",s),window.addEventListener("touchmove",s),window.addEventListener("mouseup",o),window.addEventListener("touchend",o)}[e,s,l,o].forEach(((e,t)=>{e.className="jumble",e.setAttribute("index",t);const n=function(t){a(e,t)};e.addEventListener("touchstart",n),e.addEventListener("mousedown",n)})),n.className="Answers jumble";const t=Element("div",{className:"AnswerOptions"}),r=Element("img",{src:"/resource/check.svg",onclick:()=>{game.answerJ(n.querySelectorAll("img.jumble"))}}),i=Element("img",{src:"/resource/reset.svg",onclick:()=>{game.jumbleAnswer=[],new QuestionAnswererPage}});t.append(r,i),n.append(t)}else if("multiple_select_quiz"==game.question.type||"multiple_select_poll"==game.question.type){game.multiAnswer={0:!1,1:!1,2:!1,3:!1},e.onclick=()=>{game.answerM(0,e)},s.onclick=()=>{game.answerM(1,s)},l.onclick=()=>{game.answerM(2,l)},o.onclick=()=>{game.answerM(3,o)};const t=Element("div",{className:"AnswerOptions"}),a=Element("img",{src:"/resource/check.svg",onclick:()=>{const e=[];for(const t in game.multiAnswer)game.multiAnswer[t]&&e.push(Number(t));game.answer(e)}}),r=Element("img",{src:"/resource/reset.svg",onclick:()=>{game.multiAnswer={0:!1,1:!1,2:!1,3:!1},new QuestionAnswererPage}});t.append(a,r),n.append(t)}else e.onclick=()=>{game.answer(0)},s.onclick=()=>{game.answer(1)},l.onclick=()=>{game.answer(2)},o.onclick=()=>{game.answer(3)};if(HideAnswers.checked&&"0"!=game.pin[0])return;const c=Element("div",{className:"textAnswer"});n.append(c);for(let e=0;e<game.answers.length;e++){game.answers[e].image&&(r[e].style.backgroundRepeat="no-repeat",r[e].style.backgroundSize="50% 50%",r[e].style.backgroundPosition="50% 50%",r[e].style.backgroundImage="url(https://media.kahoot.it/"+game.answers[e].image.id+")",r[e].src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),game.answers[e].correct&&(r[e].className=("jumble"===game.question.type?"jumble ":"")+"correct");const t=Element("p");void 0===game.answers[e].answer?t.innerHTML="":t.innerHTML=("jumble"===game.question.type?e+1+". ":"")+game.answers[e].answer,c.append(t)}}try{if("Music"===game.theme)if(e.raw.timeAvailable<=5e3){const e=["005","005-1"];game.playSound(`/resource/music/${e[Math.floor(Math.random()*e.length)]}.m4a`)}else if(e.raw.timeAvailable<=1e4)game.playSound("/resource/music/010.m4a");else if(e.raw.timeAvailable<=2e4){const e=["020","020-1","020-2"];game.playSound(`/resource/music/${e[Math.floor(Math.random()*e.length)]}.m4a`)}else if(e.raw.timeAvailable<=3e4)game.playSound("/resource/music/030.m4a");else if(e.raw.timeAvailable<=6e4)game.playSound("/resource/music/060.m4a");else{const e=["120","120-1"];game.playSound(`/resource/music/${e[Math.floor(Math.random()*e.length)]}.m4a`)}}catch(e){console.warn("[MUSIC] - Failed to play.\n"+e)}if("0"==game.pin[0]){const a=Element("div",{className:"ChallengeQuestion"}),s=Element("span",{innerHTML:game.rawData.question||game.rawData.title});if(a.append(s),n.append(a),game.options.ChallengeDisableTimer)return;let o=e.raw.timeAvailable/1e3;const l=Element("p",{className:"chtimer",innerHTML:o}),r=setInterval((()=>{l.innerHTML=--o,l.isConnected||clearInterval(r)}),1e3);t.bottom.prepend(l)}else 0===game.guesses.length&&t.main.append(NotFoundDiv())}}class QuestionSnarkPage{constructor(e){const t=new GetReadyPage(game.question,!0);t.main.setAttribute("ui-event","Answered"),document.body.className="rainbow",ChallengeContinueButton.style.display="none",t.top.querySelector("div").outerHTML="";const n=Element("h2",{innerHTML:e});n.setAttribute("text",n.innerText);const a=Element("div"),s=Element("img",{src:"/resource/load-hole.svg",className:"load_circle"});a.append(n,s),t.mid.append(a),0===game.guesses.length&&t.main.append(NotFoundDiv()),activateLoading(!1,!1,"",!1)}}class QuestionEndPage{constructor(e){(e=JSON.parse(e)).isCorrect?game.streak++:game.streak=0,game.score=e.totalScore;const t=new GetReadyPage(game.question||e,!0);t.main.setAttribute("ui-event","QuestionEnd"),"0"==game.pin[0]&&game.opts.ChallengeDisableAutoplay?ChallengeContinueButton.style.display="":0===game.guesses.length&&t.main.append(NotFoundDiv()),t.mid.innerHTML="",document.body.className=e.isCorrect?"green":"red",t.bottom.querySelector(".dark").innerHTML=e.totalScore;const n=Element("h1",{innerHTML:e.isCorrect?"Correcto":"Incorrecto",className:"shadow"});n.setAttribute("text",n.innerText);const a=Element("h2",{innerHTML:`Estás dentro ${e.rank||0}${1==e.rank?"st":2==e.rank?"nd":3==e.rank?"rd":"th"} lugar`,className:"shadow"});a.setAttribute("text",a.innerText);const s=Element("h2",{className:"shadow"});try{s.innerHTML=e.nemesis.name.replace(/</gm,"&lt;")?`Just ${e.nemesis.totalScore-e.totalScore} from ${e.nemesis.name}`:"",s.setAttribute("text",s.innerHTML)}catch(e){}const o=Element("img",{id:"correctMark",src:e.isCorrect?"/resource/check.svg":"/resource/cross.svg"}),l=Element("h3",{innerHTML:e.isCorrect?"+"+(e.points+e.pointsData.answerStreakPoints.streakBonus):"¡Sigue intentándolo!",className:"shadow"}),r=Element("img",{src:"/resource/fire.svg"}),i=Element("div",{id:"streakImage"}),c=Element("div"),m=Element("h2",{innerHTML:"Racha de respuestas",className:"shadow",style:"display: inline-block; font-size: 1.5rem; margin: 0"});m.setAttribute("text","Racha de respuestas"),c.style.position="relative",c.append(m);const u=Element("p",{innerHTML:e.pointsData.answerStreakPoints.streakLevel});i.append(r),i.append(u),c.append(i),e.pointsData.answerStreakPoints.streakLevel<1?(m.style.display="none",game.hadStreak&&(m.style.display="inline-block",m.innerHTML="Racha de respuestas perdida",m.setAttribute("text","Racha de respuestas perdida"),game.hadStreak=!1),i.style.display="none"):(game.hadStreak=!0,i.style.display="inline-block");const d=Element("div");d.append(n,o,c,l,a,s),t.mid.append(d),activateLoading(!1,!1)}}class QuizEndPage{constructor(e){let t;e=JSON.parse(e),game.endData=e,t=1==game.end.info.rank?"1<sup>st</sup>place!":2==game.end.info.rank?"2<sup>nd</sup>place!":3==game.end.info.rank?"3<sup>rd</sup>place!":game.end.info.rank<=5?"¡Los 5 primeros!":"¡Casi lo tengo!";const n=new GetReadyPage(game.question,!0);n.main.setAttribute("ui-event","QuizEnd"),n.mid.innerHTML="","0"==game.pin[0]&&game.opts.ChallengeDisableAutoplay&&(ChallengeContinueButton.style.display=""),document.body.className="purple";const a=Element("h1",{innerHTML:t}),s=Element("h2",{innerHTML:"¡Buen juego!"}),o=Element("p",{innerText:"¿Disfrutaste de Kahoot Winner? 🔥 Comparte este sitio web con tus amigos y gana más Kahoot! S"});if(game.endData.podiumMedalType){const e=Element("img",{src:`/resource/${game.endData.podiumMedalType}.svg`,alt:"Victory Medal",id:"resultMedal"});n.main.append(e)}if(n.main.append(a,s,o),!game.opts.hideAnswers){const e=Element("div",{id:"finalGuess"});e.innerHTML=`<span id="closeend">X</span>\n      <span id="kahootguess" class="out block" url="https://create.kahoot.it/details/${game.end.info.quizId}">Prueba de Kahoot</span>\n      ${game.guesses.length?`<span id="outguess" class="out block" url="https://create.kahoot.it/details/${game.guesses[0].uuid}">Prueba adivinada</span>`:'<span class="block disabled out">(Extraviado)</span>'}`,n.main.append(e),document.getElementById("closeend").addEventListener("click",(()=>{e.outerHTML=""}));const t=Array.from(document.getElementsByClassName("out"));if(document.getElementById("outguess")){const e=document.getElementById("outguess"),t=document.getElementById("kahootguess");e.getAttribute("url")===t.getAttribute("url")&&(e.className="out block correct")}for(const e of t)e.addEventListener("click",(()=>{e.getAttribute("url")&&window.open(e.getAttribute("url"),"_blank")}))}activateLoading(!1,!1)}}class TeamTalkPage{constructor(e){if(game.opts.teamtalk){const t=new QuestionAnswererPage(this.question||e);return game.isAnswerPage=!0,t}const{main:t,mid:n}=new GetReadyPage(this.question||e,!0);t.setAttribute("ui-event","TeamTalk"),n.innerHTML="",document.body.className="Rainbow"==game.theme?"rainbow":"cyan";const a=Element("h2",{innerHTML:"5"}),s=Element("h1",{innerHTML:"Charla de equipo",className:"shadow"});s.setAttribute("text","Charla de equipo");const o=Element("h2",{innerHTML:"¡Discuta la respuesta!",className:"shadow"});o.setAttribute("text","¡Discuta la respuesta!"),a.id="timer";const l=Element("img",{src:"/resource/load-large.svg",className:"load_circle",alt:"load_circle"}),r=Element("div"),i=Element("div");i.append(l,a),r.append(s,i,o),n.append(r);let c=game.question.teamTalkDuration||5;const m=setInterval((()=>{try{--c<0?clearInterval(m):a.innerHTML=c}catch(e){clearInterval(m)}}),1e3)}}class TimeUpPage{constructor(){if(game.receivedQuestion)return;const{main:e,mid:t}=new LobbyPage;e.setAttribute("ui-event","TimeUp"),t.innerHTML="";try{document.querySelector(".noQuiz").outerHTML=""}catch(e){}game.guesses&&0!==game.guesses.length||e.append(NotFoundDiv()),document.body.className="Rainbow"==game.theme?"rainbow":"red";const n=Element("h1",{innerHTML:"Se acabó el tiempo",className:"shadow"});n.setAttribute("text","Se acabó el tiempo");const a=Element("h2",{innerHTML:"Estás dentro 0th lugar",className:"shadow"});a.setAttribute("text","Estás dentro 0th lugar");const s=Element("h3",{innerHTML:"Nosotros creemos en ti"});s.setAttribute("text","Nosotros creemos en ti");const o=Element("div");o.append(n,a,s),t.append(o)}}class FeedbackPage{constructor(){const{main:e,mid:t,top:n,bottom:a}=new LobbyPage;e.setAttribute("ui-event","Feedback"),t.innerHTML="";try{document.querySelector(".noQuiz").outerHTML=""}catch(e){}document.body.className="Rainbow"==game.theme?"rainbow":"",a.outerHTML="",n.className="gameOver",n.innerHTML="<p>Juego terminado</p>";try{document.querySelector("noQuiz").outerHTML=""}catch(e){}e.className="Feedback",e.style.padding="0";const s=Element("div",{className:"feedback"});s.innerHTML='\n    <p>¿Cómo calificas este Kahoot?</p>\n    <div class="star-container">\n      <input id="star1" type="radio" name="star" value="1"/>\n      <label for="star1"></label>\n      <input id="star2" type="radio" name="star" value="2"/>\n      <label for="star2"></label>\n      <input id="star3" type="radio" name="star" value="3"/>\n      <label for="star3"></label>\n      <input id="star4" type="radio" name="star" value="4"/>\n      <label for="star4"></label>\n      <input id="star5" type="radio" name="star" value="5"/>\n      <label for="star5"></label>\n    </div>\n    <div class="thumb-container">\n      <p>¿Aprendiste algo?</p>\n      <div>\n        <input type="radio" name="learn" id="learn1" value="1"/>\n        <label for="learn1"></label>\n        <input type="radio" name="learn" id="learn2" value="0"/>\n        <label for="learn2"></label>\n      </div>\n    </div>\n    <div class="thumb-container">\n      <p>¿Lo recomiendas?</p>\n      <div>\n        <input type="radio" name="rec" id="rec1" value="1"/>\n        <label for="rec1"></label>\n        <input type="radio" name="rec" id="rec2" value="0"/>\n        <label for="rec2"></label>\n      </div>\n    </div>\n    <p>Para continuar, cuéntanos como te sientes</p>\n    <div class="face-container">\n      <input type="radio" name="feel" id="feel1" value="1"/>\n      <label for="feel1"></label>\n      <input type="radio" name="feel" id="feel2" value="0"/>\n      <label for="feel2"></label>\n      <input type="radio" name="feel" id="feel3" value="-1"/>\n      <label for="feel3"></label>\n    </div>',e.append(s);const o=Array.from(document.querySelectorAll('[name="star"]'));for(const e of o)e.addEventListener("click",(()=>{for(const e of o)e.className="";for(let t=+e.id.split("star")[1];t>0;t--)document.getElementById("star"+t).className="selected"}));const l=document.getElementById("feel1"),r=document.getElementById("feel2"),i=document.getElementById("feel3");l.onclick=i.onclick=r.onclick=()=>{const e=(document.querySelector('input[name="star"]:checked')||{}).value,t=(document.querySelector('input[name="learn"]:checked')||{}).value,n=(document.querySelector('input[name="rec"]:checked')||{}).value,a=document.querySelector('input[name="feel"]:checked').value;return send({type:"SEND_FEEDBACK",message:{fun:+e,learn:+t,recommend:+n,overall:+a}}),new QuizEndPage(JSON.stringify(game.endData))}}}function calculateTimeout(e,t){const n=-2*t*(e/1e3-1);return n<.1?0:n}function activateLoading(e,t,n,a){HideDiv.style.background=t?"rgba(0,0,0,0.3)":"transparent",HideDiv.style.pointerEvents=t?"all":"none",HideDiv.children[0].children[0].style.display=e?"inline-block":"none",LoadingText.innerHTML=n||"",HideDiv.children[0].children[0].src=a?"/resource/load-large.svg":"/resource/load-hole.svg"}function setSchema(e,t,n,a){n&&e.setAttribute("itemscope",""),a&&e.setAttribute("itemtype","https://schema.org/"+t),a&&e.setAttribute("itemprop",a)}function sleep(e){return new Promise((t=>{setTimeout(t,1e3*e)}))}async function resetGame(e){try{game.music.pause()}catch(e){}const t=game;if(socket&&(socket.onclose=null,socket.close(),socket=null),game=new Game,e){await game.sendPin(t.pin);const e=async n=>{n=n.data;if("Message.PinGood"==JSON.parse(n).type){new LobbyPage;let e=(25e3-(Date.now()-t.disconnectTime))/1e3;e<=2&&(e=2),new ErrorHandler("Reconnecting... Please wait. You should be reconnected when this message dissappears.",{time:1e3*e}),await sleep(e),send({message:{cid:t.cid,answers:t.got_answers},type:"RECOVER_DATA"}),t.oldQuizUUID&&(document.getElementById("uuid").value=t.oldQuizUUID),game.saveOptions()}else resetGame();socket.removeEventListener("message",e)};socket.addEventListener("message",e)}else new LoginPage,document.body.className="rainbow",document.getElementById("author").value="",document.getElementById("uuid").value="",document.getElementById("searchTerm").value="",document.getElementById("timeout_custom_1").value="",document.getElementById("timeout_custom_2").value="",game.loadOptions()}function clearUI(){return activateLoading(!1,!1),UIDiv.innerHTML="",Element("div")}let presetNumber=0;function loadSetting(e,t){for(const t in e){const n=document.getElementById(t);"checkbox"==n.type||"radio"==n.type?n.checked=e[t]:n.value=e[t]}game.saveOptions(),new ErrorHandler("Preajuste restaurado '"+t+"'",{isNotice:!0})}function addPreset(e){game.saveOptions(),document.querySelectorAll(".preset.remove").forEach((e=>{e.outerHTML=""}));let t=[];if(localStorage.presets)try{t=JSON.parse(localStorage.presets)}catch(e){}t.push({name:e,options:{brute:game.opts.brute,fail:game.opts.fail,teamtalk:game.opts.teamtalk,manual:game.opts.manual,previewQuestion:game.opts.previewQuestion,searchLoosely:game.opts.searchLoosely,teamMembers:game.opts.teamMembers,theme:game.opts.theme,timeout:game.opts.timeout}}),localStorage.presets=JSON.stringify(t),loadPresets()}function loadPresets(){document.querySelectorAll(".preset.remove").forEach((e=>{e.outerHTML=""}));try{const e=JSON.parse(localStorage.presets),t=document.getElementById("preset_add_div");for(const n of e){const e=n.options,a=Element("template");a.innerHTML=`<div class="preset flex remove">\n        <div class="center">\n          <span class="presetTitle">${n.name} <label for="preset_${presetNumber}">(?)</label></span>\n          <input type="checkbox" id="preset_${presetNumber}" class="ch nosend">\n          <div>\n            <p>Tema <span class="yellow">${e.theme}</span></p>\n            <p>El descanso <span class="yellow">${e.timeout||"0"}</span></p>\n            <p>Equipo <span class="yellow">${e.teamMembers||"(unset)"}</span></p>\n            <p>Fallar <span class="${Number(e.fail)?"green":"red"}">${Number(e.fail)?"ENCENDIDO":"APAGADO"}</span></p>\n            <p>Suelto <span class="${Number(e.searchLoosely)?"green":"red"}">${Number(e.searchLoosely)?"ENCENDIDO":"APAGADO"}</span></p>\n            <p>Bruto <span class="${e.brute?"green":"red"}">${e.brute?"ENCENDIDO":"APAGADO"}</span></p>\n            <p>Manual <span class="${e.manual?"green":"red"}">${e.manual?"ENCENDIDO":"APAGADO"}</span></p>\n            <p>Avance <span class="${e.previewQuestion?"green":"red"}">${e.previewQuestion?"ENCENDIDO":"APAGADO"}</span></p>\n            <p>Saltar charla de equipo <span class="${e.teamtalk?"green":"red"}">${e.teamtalk?"ENCENDIDO":"APAGADO"}</span></p>\n          </div>\n          <button id="restore_${presetNumber}" class="block">Restaurar</button>\n          <img src="/resource/cross.svg" alt="delete" id="delete_${presetNumber}">\n        </div>\n      </div>`,document.getElementById("preset_container").insertBefore(a.content.cloneNode(!0),t),document.getElementById("restore_"+presetNumber).onclick=function(){loadSetting({theme:e.theme,timeout:e.timeout,teamMembers:e.teamMembers,fail:e.fail,searchLoosely:e.searchLoosely,brute:e.brute,manual:e.manual,previewQuestion:e.previewQuestion},n.name)},document.getElementById("delete_"+presetNumber).onclick=function(){try{let e=JSON.parse(localStorage.presets);e=e.filter((e=>e.name!=n.name)),localStorage.presets=JSON.stringify(e),loadPresets()}catch(e){}},presetNumber++}}catch(e){}}const ChallengeContinueButton=document.getElementById("ChallengeNext"),SettingDiv=document.getElementById("settings"),SettingSwitch=document.getElementById("menu_toggle"),AboutSwitch=document.getElementById("about"),ChangelogSwitch=document.getElementById("changelog"),HideDiv=document.getElementsByClassName("Loading")[0],UIError=document.getElementsByClassName("Error")[0],UIDiv=document.getElementsByClassName("Main")[0],HideAnswers=document.getElementById("hideAnswers"),LoadingText=document.getElementById("loadingText"),ThemeChooser=document.getElementById("theme"),QuizResult=document.getElementById("quizresult");new LoginPage(!1),loadPresets();let closePage=0;const SearchDivSettings=document.getElementById("div_search_options"),GameDivSettings=document.getElementById("div_game_options"),ChallengeDivSettings=document.getElementById("div_challenge_options"),dso=document.getElementById("dso"),dgo=document.getElementById("dgo"),dco=document.getElementById("dco");function Themer(){game.theme=ThemeChooser.value,"Rainbow"===game.theme?(SettingDiv.className="rainbow correct",document.querySelector(".About").className="About rainbow"):"FRANXX"===game.theme?(SettingDiv.className="franxx",document.querySelector(".About").className="About"):(SettingDiv.className="",document.querySelector(".About").className="About");const e=document.querySelector('.Login>img[alt="Kahoot logo"]');e&&(e.src="/resource/"+KahootThemes[game.theme].logo)}SearchDivSettings.onchange=GameDivSettings.onchange=ChallengeDivSettings.onchange=function(e){switch(e.target.id){case"div_search_options":dso.className="flex selected",dgo.className="flex",dco.className="flex";break;case"div_game_options":dso.className="flex",dgo.className="flex selected",dco.className="flex";break;case"div_challenge_options":dso.className="flex",dgo.className="flex",dco.className="flex selected"}},dgo.className="flex selected",AboutSwitch.addEventListener("click",(()=>{closePage=AboutSwitch.checked?1:0})),ChangelogSwitch.addEventListener("click",(()=>{closePage=ChangelogSwitch.checked?2:0})),ChallengeContinueButton.addEventListener("click",(()=>{send({message:"",type:"NEXT_CHALLENGE"})})),SettingSwitch.onclick=()=>{SettingSwitch.checked||(dataLayer.push({event:"toggle_settings"}),document.getElementById("preset_toggle").checked&&(document.getElementById("preset_toggle").checked=!1),game.saveOptions()),closePage=0},ThemeChooser.addEventListener("change",Themer),QuizResult.addEventListener("click",(e=>{"LABEL"!==e.target.nodeName&&QuizResult.getAttribute("url")&&window.open(QuizResult.getAttribute("url"),"_blank")}));const shortcuts=e=>{if(e.ctrlKey){switch(e.key){case"e":send({type:"RECONNECT",message:"I think i lost connection"}),dataLayer.push({type:"reconnect",value:""});break;case"b":document.getElementById("brute").click(),new ErrorHandler("Fuerza bruta 2FA: "+(document.getElementById("brute").checked?"ENCENDIDO":"APAGADO"),{isNotice:!0}),dataLayer.push({type:"brute",value:document.getElementById("brute").checked});break;case"p":document.getElementById("fail").value=0==document.getElementById("fail").value?.9:0,new ErrorHandler("Fracasar a propósito: "+(0!=document.getElementById("fail").value?"ENCENDIDO":"APAGADO"),{isNotice:!0}),dataLayer.push({type:"fail",value:document.getElementById("fail").value});break;case"m":document.getElementById("manual").click(),new ErrorHandler("Control manual: "+(document.getElementById("manual").checked?"ENCENDIDO":"APAGADO"),{isNotice:!0}),dataLayer.push({type:"manual",value:document.getElementById("manual").checked});break;case"h":document.getElementById("hideAnswers").click(),new ErrorHandler("Ocultar correcto: "+(document.getElementById("hideAnswers").checked?"ENCENDIDO":"APAGADO"),{isNotice:!0}),dataLayer.push({type:"hide",value:document.getElementById("hideAnswers").checked});break;case"o":document.getElementById("challengeCorrect").click(),new ErrorHandler("Desafío siempre correcto: "+(document.getElementById("challengeCorrect").checked?"ENCENDIDO":"APAGADO"),{isNotice:!0}),dataLayer.push({type:"correct",value:document.getElementById("challengeCorrect").checked});break;case"u":document.getElementById("previewQuestion").click(),new ErrorHandler("Pregunta de vista previa: "+(document.getElementById("previewQuestion").checked?"ENCENDIDO":"APAGADO"),{isNotice:!0}),dataLayer.push({type:"preview",value:document.getElementById("previewQuestion").checked});break;case"j":try{if(SettingDiv.style.display){SettingDiv.style="",document.querySelector(".Changelog").style="",document.querySelector(".About").style="",document.getElementById("tutorial").style="",document.querySelector(".misc").style="",document.querySelector(".Error").style="";try{document.getElementById("logotext").style=""}catch(e){}try{document.querySelector(".sm.sidebar").style=""}catch(e){}try{document.getElementById("abtlnk").style=""}catch(e){}try{document.getElementById("chnge").style=""}catch(e){}try{document.getElementById("lang").style=""}catch(e){}}else{SettingDiv.style="display: none",document.querySelector(".Changelog").style="display: none",document.querySelector(".About").style="display: none",document.getElementById("tutorial").style="display: none",document.querySelector(".misc").style="opacity: 0",document.querySelector(".Error").style="display: none";try{document.getElementById("logotext").style="display: none"}catch(e){}try{document.querySelector(".sm.sidebar").style="display: none"}catch(e){}try{document.getElementById("abtlnk").style="display: none"}catch(e){}try{document.getElementById("chnge").style="display: none"}catch(e){}try{document.getElementById("lang").style="display: none"}catch(e){}try{document.querySelector(".grecaptcha-badge").style.visibility="hidden"}catch(e){}try{document.querySelector(".ad-container").style.display="none",document.querySelector(".ad-container-2").style.display="none"}catch(e){}}}catch(e){console.log(e)}finally{const e=document.head.querySelector('[rel="shortcut icon"]')||Element("link");e.isConnected||(e.rel="shortcut icon",e.href="https://kahoot.it/favicon.ico",document.head.append(e),document.title="Play Kahoot!"),document.getElementById("manual").checked=!0,document.getElementById("hideAnswers").checked=Boolean(SettingDiv.style.display),game.saveOptions(),dataLayer.push({type:"panick",value:""})}break;case"d":document.getElementById("ChallengeDisableAutoplay").click(),new ErrorHandler("Reproducción automática de desafíos: "+(document.getElementById("ChallengeDisableAutoplay").checked?"APAGADO":"ENCENDIDO"),{isNotice:!0}),dataLayer.push({type:"autoplay",value:document.getElementById("ChallengeDisableAutoplay").checked});break;case"k":document.getElementById("searchLoosely").value=Number(document.getElementById("searchLoosely").value)?0:1,new ErrorHandler("Búsqueda suelta: "+(Number(document.getElementById("searchLoosely").value)?"ENCENDIDO":"APAGADO"),{isNotice:!0}),dataLayer.push({type:"loose",value:document.getElementById("searchLoosely").value});break;case"t":document.getElementById("teamtalk").click(),new ErrorHandler("Saltar charla de equipo: "+(Number(document.getElementById("teamtalk").checked)?"ENCENDIDO":"APAGADO"),{isNotice:!0}),dataLayer.push({type:"teamtalk",value:document.getElementById("teamtalk").checked});break;default:return}dataLayer.push({event:"shortcut"}),e.preventDefault(),e.stopPropagation(),game.saveOptions()}};window.addEventListener("keydown",shortcuts),window.addEventListener("keydown",(e=>{if(game.question&&["quiz","multiple_select_quiz","multiple_select_poll","survey"].includes(game.question.type)&&document.querySelector('[alt="Red"]')&&+e.code.split("Digit")[1]<=4)switch(+e.code.split("Digit")[1]){case 0:send({type:"ANSWER_QUESTION",message:null});break;case 1:document.querySelector('[alt="Red"]').click();break;case 2:document.querySelector('[alt="Blue"]').click();break;case 3:document.querySelector('[alt="Yellow"]').click();break;case 4:document.querySelector('[alt="Green"]').click()}})),UIError.addEventListener("click",(()=>{clearTimeout(game.errorTimeout),UIError.style.right="",dataLayer.push({event:"close_error"})}));let pressTime=-1;SettingSwitch.addEventListener("click",(()=>{if(Date.now()-pressTime<500)return pressTime=-1,void shortcuts({ctrlKey:!0,key:"j",preventDefault:()=>{},stopPropagation:()=>{}});pressTime=Date.now()}));const SearchInput=document.getElementById("sub-quiz-input"),SearchOutput=document.getElementById("sub-quiz-output");let SearchIndex=0;function Search(e,t){SearchOutput.innerHTML="Cargando...";const n=new XMLHttpRequest;n.open("GET",`/search?q=${encodeURIComponent(e)}&c=${Number(t)}`),n.send(),n.onload=function(){const a=JSON.parse(n.response);if(0===a.length)return void(SearchOutput.innerHTML="No hay resultados.");FormatSearch(a),document.getElementById("sub-quiz-next").addEventListener("click",(()=>{Search(e,(t||0)+25)}));Array.from(document.getElementsByClassName("sub-quiz-button")).forEach((e=>{e.addEventListener("click",(()=>{const t=e.nextElementSibling.value;document.getElementById("uuid").value=t,document.getElementById("sub-uuid").checked=!1}))}))}}function FormatSearch(e){SearchOutput.innerHTML='\n  <span>\n    <span class="sub-quiz-img"><img src="/resource/red-konosuba.svg"/></span>\n    <span class="sub-quiz-title">Título de la prueba</span>\n    <span class="sub-quiz-author">Creador de cuestionarios</span>\n    <span class="sub-quiz-questions"># de preguntas</span>\n    <button id="sub-quiz-next">Próximo</button>\n  </span>\n  <hr/>\n  ';for(const t in e){const n=e[t],a=Element("template");a.innerHTML=`<span>\n      <span class="sub-quiz-img"><img src="${n.cover}"/></span>\n      <span class="sub-quiz-title">${n.title}</span>\n      <span class="sub-quiz-author">${n.creator_username}</span>\n      <span class="sub-quiz-questions">${n.questions.length}</span>\n      <button class="sub-quiz-button">Use</button>\n      <input type="text" class="ch" value="${n.uuid}"/>\n    </span>`,SearchOutput.append(a.content.cloneNode(!0))}}SearchInput.addEventListener("keydown",(e=>{"Enter"===e.code&&(SearchIndex=0,Search(SearchInput.value,SearchIndex))})),game.loadOptions(),game.theme=ThemeChooser.value,"Kahoot"!=game.theme&&new LoginPage;window.addEventListener("load",(()=>{"4.0.0"!==localStorage.seenNotice&&new ErrorHandler("Important Notice! Click to show",{isNotice:!0,onclick:(e,n)=>{n.outerHTML="",showNotice()},permanent:!0}),"3.3.0"!==localStorage.returningUser&&activateTutorial()}));const TutorialDiv=document.getElementById("tutorial");function activateTutorial(){if(localStorage.returningUser="3.3.0",TutorialDiv&&TutorialDiv.innerHTML)return;AboutSwitch.checked&&AboutSwitch.click();const e=document.createElement("template");e.innerHTML='\n    <div class="tut_cont">\n      <div id="tut_data">\n        <div id="tut_info">\n          <strong>¡Hola! Parece que eres nuevo aquí. ¿Quieres un tutorial?</strong>\n        </div>\n        <button id="tut_next" tut-step="0" onclick="tutorialSteps(this.getAttribute(\'tut-step\'))">¡Sí por favor!</button>\n        <button onclick="dataLayer.push({event:\'close_tutorial\'});document.getElementById(\'tutorial\').innerHTML = \'\';new ErrorHandler(\'Si alguna vez me necesitas de nuevo, haz clic en el botón de tutorial en la sección \\\'acerca de\\\'.\',{isNotice:true});resetGame();">No gracias.</button>\n      </div>\n    </div>\n  ',TutorialDiv.append(e.content.cloneNode(!0))}function tutorialSteps(e){dataLayer.push({event:"do_tutorial",value:e});const n=document.getElementById("tut_data"),[a,o]=Array.from(document.querySelectorAll("#tut_data>button")),t=document.getElementById("tut_info");switch(a.setAttribute("tut-step",+e+1),a.innerHTML="Próximo",o.innerHTML="Hecho",e+""){case"0":SettingSwitch.checked&&SettingSwitch.click(),t.innerHTML='<em>Nota: en realidad, no realice ninguna acción en este tutorial. Simplemente presione "Siguiente" y "Listo".</em>\n      <p><strong>Unirse a un juego: PIN</strong></p>\n      <p>Para unirse al juego, primero ingrese el pin del juego.</p>\n      <p>Los pines válidos del juego incluyen:</p>\n      <ul>\n        <li>Pines de juego en vivo <code>12345</code></li>\n        <li>Pines de juego de desafío <code>012345</code></li>\n        <li>Enlaces de juegos de desafío <code>https://kahoot.it/challenge/012345?challenge-id=really-long-string</code></li>\n        <li>Juegos de desafíos especiales <code>weekly</code>, <code>weekly-previous</code></li>\n      </ul>';break;case"1":SettingSwitch.checked&&SettingSwitch.click(),new LoginPage(!0),t.innerHTML='<strong>Unirse a un juego: Nombre</strong>\n      <p>Luego, ingrese un nombre. También puede presionar el botón "Nombre aleatorio".</p>\n      <p>Cuando esté listo, presione "¡OK ve!"</p>';break;case"2":SettingSwitch.checked&&SettingSwitch.click(),game.name="Tutorial",game.pin="12345-LUGGAGE",new LobbyPage,n.style.marginTop="8rem",n.style.height="calc(100% - 10rem)",t.innerHTML='<p><strong>En el juego: proporcionar el nombre de la prueba</strong></p>\n      <p>Cuando te unas al juego, es posible que veas la entrada anterior. Esta entrada es donde debe colocar el nombre de la prueba o la identificación de la prueba.</p>\n      <p>No es necesario que el nombre de la prueba sea exacto. Si conoce el tema general del cuestionario, puede intentar ponerlo como "nombre del cuestionario"</p>\n      <p><strong>Cómo obtener el nombre / identificación de la prueba:</strong></p>\n      <p>El nombre de la prueba aparece en la pantalla del anfitrión antes de que se cargue la prueba (la página de inicio) y durante unos segundos al comienzo de la prueba.</p>\n      <p>La identificación de la prueba se encuentra en la URL de la pantalla del anfitrión. Es la cadena larga que sigue <code>quizId=</code></p>';break;case"3":SettingSwitch.checked&&SettingSwitch.click(),t.innerHTML="<p><strong>En el juego: proporcionar el nombre de la prueba</strong></p>\n      <p>Esta entrada seguirá estando en la parte superior hasta que se encuentre una prueba.</p>\n      <p>Si no proporciona un nombre o identificación de prueba, Kahoot Winner utilizará una gran lista de más de 50.000 pruebas para intentar encontrar su prueba. Es probable que esto solo funcione en cuestionarios muy populares.</p>";break;case"4":SettingSwitch.checked&&SettingSwitch.click(),n.style.marginTop="",game.question={type:"quiz",index:0,data:[{answer:"Correcto",correct:!0},{answer:"Incorrecto",correct:!1},{answer:"Tutorial",correct:!1},{answer:"",correct:!1,image:{id:"dfa9fc36-1122-4dc2-a00b-04d490c07765"}}],total:"42.069",currentGuesses:[{questions:[{time:2e4}]}],raw:{},ans:[4]},game.score=-1/0,new QuestionAnswererPage,activateLoading(!1),t.innerHTML="<p><strong>Responder: descripción básica</strong></p>\n      <p>De forma predeterminada, Kahoot Winner simplemente responderá automáticamente a la pregunta utilizando la mejor respuesta.</p>\n      <p>Si desea responder la pregunta usted mismo, habilite el control manual en la configuración.</p>";break;case"5":SettingSwitch.checked&&SettingSwitch.click(),t.innerHTML="<p><strong>Respondiendo: Información</strong></p>\n      <p>Como se ve a continuación, las respuestas correctas tendrán un borde de arco iris alrededor. Además, el texto de cada opción se enumera encima de cada opción.</p>\n      <p>Cuando la elección usa una imagen, la imagen reemplazará la forma.</p>";break;case"6":SettingSwitch.checked||SettingSwitch.click(),document.querySelector('[for="div_search_options"]').click(),n.style.position="absolute",t.innerHTML="<p><strong>Configuración: Opciones de búsqueda</strong></p>\n      <p>Las opciones de búsqueda controlan cómo el servidor encuentra su cuestionario.</p>\n      <p>Autor de la prueba: especifica el creador para filtrar las pruebas.</p>\n      <p>UUID de prueba: especifica la identificación de prueba que se utilizará. También puede buscar directamente un cuestionario en el área de configuración secundaria.</p>\n      <p>Término de búsqueda: especifica el nombre / las palabras clave de la prueba para buscar pruebas</p>\n      <p>Conjetura actual: este botón muestra la prueba actual que Kahoot Winner está usando. Puede bloquearlo presionando el bloqueo.</p>";break;case"7":SettingSwitch.checked||SettingSwitch.click(),document.querySelector('[for="div_game_options"]').click(),t.innerHTML="<p><strong>Configuración: Opciones de juego</strong></p>\n      <p>Las opciones de juego controlan cómo Kahoot Winner interactúa con el juego.</p>\n      <p>Tiempo de espera de respuesta: retrasa el tiempo de respuesta del servidor, lo que le permite sospechar menos.</p>\n      <p>Miembros del equipo: personaliza a los miembros de tu equipo en modo equipo</p>\n      <p>Fallar a propósito: falla la pregunta a propósito</p>\n      <p>Buscar libremente: se utiliza cuando el orden de las preguntas es aleatorio. Requiere la entrada del usuario para seleccionar la pregunta correcta.</p>\n      <p>Omitir 2FA: se usa para omitir el paso de dos factores si está habilitado</p>\n      <p>Control manual: le permite responder preguntas en lugar del servidor</p>\n      <p>Omitir conversación en equipo: le permite responder durante el tiempo de conversación en equipo</p>\n      <p>Vista previa de la pregunta: le permite ver las preguntas / respuestas que surgen</p>\n      <p>Hide Correct: se usa para hacer que Kahoot Winner parezca un Kahoot normal al responder.</p>";break;case"8":SettingSwitch.checked||SettingSwitch.click(),document.querySelector('[for="div_challenge_options"]').click(),t.innerHTML="<p><strong>Configuración: Opciones de desafío</strong></p>\n      <p>Nota: estas opciones no tienen ningún efecto en <b>JUEGOS EN VIVO</b>.</p>\n      <p>Puntos: le permite personalizar la cantidad de puntos / pregunta en una pregunta de desafío.</p>\n      <p>Siempre correcto: hace que todas sus respuestas sean correctas, incluso si intencionalmente lo estableció como incorrecto.</p>\n      <p>Habilitar puntos de racha: utiliza rayas al calcular puntos</p>\n      <p>Desactivar el temporizador de preguntas: puede esperar mientras responde preguntas sin preocuparse por el temporizador.</p>";break;case"9":n.style.position="",t.innerHTML='<p><strong>Configuración: Más información</strong></p>\n      <p>Si necesita más explicaciones, abra la configuración y presione "?" Junto a cada opción.</p>';break;case"10":o.addEventListener("click",(function e(){dataLayer.push({event:"complete_tutorial"}),setTimeout((function(){return new ErrorHandler("Tutorial terminado! ¡Camino a seguir!",{isNotice:!0})}),300);try{o.removeEventListener(e)}catch(e){}})),SettingSwitch.checked&&SettingSwitch.click(),game.end={info:{rank:1}},new QuizEndPage(JSON.stringify({metal:"upvote-filled"})),a.outerHTML="",t.innerHTML="<p><strong>¡No funciona!</strong></p>\n      <p>Por lo general, cuando Kahoot Winner no funciona, es uno de los siguientes problemas:</p>\n      <ol>\n        <li>El cuestionario es privado.</li>\n        <ul><li>No hay solución para esto. Kahoot Winner no funcionará en juegos privados en vivo.</li></ul>\n        <li>No proporcionaste el nombre de la prueba</li>\n        <ul><li>Si bien Kahoot Winner almacena en caché muchos cuestionarios, hay muchos más que no están en la base de datos. Proporcione el nombre del cuestionario para asegurarse de que Kahoot Winner pueda encontrarlo.</li></ul>\n        <li>El cuestionario no es popular</li>\n        <ul><li>Si su cuestionario tiene un nombre común y no es popular, es posible que esté demasiado abajo en la lista de Kahoots para que Kahoot Winner pueda encontrarlo.</li></ul>\n        <li>Las preguntas son aleatorias</li>\n        <ul><li>Si las preguntas son aleatorias, habilite <code>Buscar libremente</code> y escriba la pregunta cuando comience.</li></ul>\n        <li>Las respuestas son aleatorias</li>\n        <ul><li>Si las respuestas son aleatorias, habilite <code>Control manual</code> y responda la pregunta correctamente.</li></ul>\n      </ol>"}}function showNotice(){localStorage.seenNotice="4.0.0";const e=document.createElement("template");e.innerHTML='<div class="notice">\n    <button onclick="document.querySelector(\'.notice\').outerHTML = \'\';">OK</button>\n    <h3><b>Noticia importante: </b><span class="red">Kahoot ya no envía el nombre del cuestionario al cliente.</span></h3>\n    <h4>¿Qué significa esto?</h4>\n    <p>Ahora debe ingresar el nombre de la prueba usted mismo. Puede tener suerte si el cuestionario es muy popular, ya que ahora almacenamos cuestionarios de Kahoot que se han jugado en la base de datos.</p>\n    <p>Puede poner el nombre de la prueba en la entrada en la parte superior:</p>\n    <div>\n      <img src="/resource/misc/notice-2020-07-03.png" alt="input at the top">\n    </div>\n  </div>',document.body.append(e.content.cloneNode(!0))}