\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]"));function j(e){for(var _=0,t=0;t ".concat(C("score_panel.upcoming_levels")," ").concat(_,"
\n '.concat(c.title,'\n \n
\n\n'),i.slice(i.indexOf(c)+1).slice(0,3).forEach(function(e){n+='\n\n '.concat(e.title," \n
\n")})}var h=i.filter(function(e){return e.threshold>o&&e.threshold".concat(C("gameOver.test_run"),"
"):"","\n").concat(_,"
\n").concat(C("gameOver.cumulative_total",{startTs:o,endTs:l}),"
\n ").concat(n," \n "),actions:[{value:null,text:C("gameOver.restart"),help:""}],textAfterButtons:'\n'.concat(C("gameOver.upgrades_picked"),"
\n").concat(ed(_T),"
\n ").concat(function(){var e="";try{var _=JSON.parse(localStorage.getItem("breakout_71_runs_history")||"[]");_.sort(function(e,_){return e.score-_.score}).reverse(),(_=_.slice(0,100)).push(W(k({},_T.runStatistics),{perks:_T.perks,appVersion:F})),_T.isCreativeModeRun||localStorage.setItem("breakout_71_runs_history",JSON.stringify(_,null,2));var t=function(e,t,r){var a,s,n,l=_.map(function(e){return t(e)||0}),o=(a=Math).min.apply(a,f(l)),i=(s=Math).max.apply(s,f(l));if(o===i)return"";i-o<10&&(o=Math.max(0,i-10),i=Math.max(i,o+10));var u=Math.min(l.length,10);if(u<3)return"";for(var c=[],p=[],d=0;d1?"s":""," between ").concat(Math.floor(o+_*m)," and ").concat(Math.floor(o+(_+1)*m)).concat(r,'"\n >').concat(!e&&" "||_==v&&b+r||Math.round(p[_]/e)+r,"")}).join("");return'".concat(C("gameOver.stats.intro",{count:_.length-1}),"
")+e)}catch(e){console.warn(e)}return e}()," \n ")}).then(function(){return _A({levelToAvoid:eh(_T).name})})}}var g=m("5mG9B"),y=m("6QuVk");function e$(){return(e$=(0,g._)(function(e){var _,t,r,a;return(0,y.__generator)(this,function(s){for(_=3,t=(e.score-e.levelStartScore)/(e.levelSpawnedCoins||1),0==e.levelWallBounces&&_++,e.levelTime<3e4&&_++,1===t&&_++,0===e.levelMisses&&_++,r=[],a=0;a<_;a++)r.push({});return[2]})})).apply(this,arguments)}function e0(e,_){e.puckPosition=_,e.needsRender=!0}function e1(e){e2(e);var _,t=1+((null===(_=e.perks)||void 0===_?void 0:_.multiball)||0),r=e.puckWidth/(t+1);e.balls=[],e.ballsColor="#FFF",(e.perks.picky_eater||e.perks.pierce_color)&&(e.ballsColor=function(e){var _,t,r={};e.forEach(function(e){return r[e]=(r[e]||0)+1});var a=(t=Math).max.apply(t,f(Object.keys(r).map(function(e){return r[e]})));return(_=Object.keys(r).filter(function(e){return r[e]==a}))[Math.floor(_.length*Math.random())]}(e.bricks.filter(function(e){return e}))||"#FFF");for(var a=0;a".concat(C("level_up.after_buttons",{level:e.currentLevel+1,max:ep(e)}),"
\n").concat(ed(e),'
\n \n \n '),i=r&&a&&n&&s&&C("level_up.compliment_perfect")||(r||a||n||s)&&C("level_up.compliment_good")||C("level_up.compliment_advice"),[4,eY({title:C("level_up.pick_upgrade_title")+(t?" ("+(t+1)+")":""),actions:l,text:"".concat(C("level_up.before_buttons",{score:e.score-e.levelStartScore,catchGain:a,levelSpawnedCoins:e.levelSpawnedCoins,time:Math.round(e.levelTime/1e3),timeGain:r,levelMisses:e.levelMisses,missesGain:n,levelWallBounces:e.levelWallBounces,wallHitsGain:s,compliment:i}),"\n
\n\n").concat(em(e),"
\n"),allowClose:!1,textAfterButtons:o})];case 2:return"reroll"===(u=c.sent())?(t++,e.rerolls--):(e.perks[u]++,"instant_upgrade"===u&&(t+=2),e.runStatistics.upgrades_picked++),[3,1];case 3:return[2]}})})).apply(this,arguments)}function _y(e,_){return eu(_T,Math.floor(_/_T.brickWidth),Math.floor((e-_T.offsetX)/_T.brickWidth))}function _k(e){if(_T.bricks[e])return e}function _W(e,_,t){var r,a,s;return null!==(s=null!==(a=null!==(r=_k(_y(e-t,_-t)))&&void 0!==r?r:_k(_y(e+t,_-t)))&&void 0!==a?a:_k(_y(e+t,_+t)))&&void 0!==s?s:_k(_y(e-t,_+t))}window.addEventListener("resize",_v),window.addEventListener("fullscreenchange",_v),setInterval(function(){var e=eS.getBoundingClientRect(),_=e.width,t=e.height;(_!==_T.canvasWidth||t!==_T.canvasHeight)&&_v()},1e3),eS.addEventListener("mouseup",function(e){0===e.button&&(_T.running?_b(!0):(_g(),J("pointerLock")&&eS.requestPointerLock&&eS.requestPointerLock().then()))}),eS.addEventListener("mousemove",function(e){document.pointerLockElement===eS?e0(_T,_T.puckPosition+e.movementX):e0(_T,e.x)}),eS.addEventListener("touchstart",function(e){var _;e.preventDefault(),(null===(_=e.touches)||void 0===_?void 0:_.length)&&(e0(_T,e.touches[0].pageX),e2(_T),_g())}),eS.addEventListener("touchend",function(e){e.preventDefault(),_b(!0)}),eS.addEventListener("touchcancel",function(e){e.preventDefault(),_b(!0)}),eS.addEventListener("touchmove",function(e){var _;(null===(_=e.touches)||void 0===_?void 0:_.length)&&e0(_T,e.touches[0].pageX)});var _w=0,_x=document.getElementById("FPSDisplay");function _S(){return _z.apply(this,arguments)}function _z(){return(_z=(0,g._)(function(){return(0,y.__generator)(this,function(e){switch(e.label){case 0:return _b(!0),[4,eY({title:C("score_panel.title",{score:_T.score,level:_T.currentLevel+1,max:ep(_T)}),text:"\n ".concat(_T.isCreativeModeRun?"".concat(C("score_panel.test_run"),"
"):"","\n").concat(C("score_panel.upgrades_picked"),"
\n").concat(ed(_T),"
\n \n").concat(em(_T),"
\n "),allowClose:!0})];case 1:return e.sent(),[2]}})})).apply(this,arguments)}function _M(){return _G.apply(this,arguments)}function _G(){return(_G=(0,g._)(function(){var e,_,t,r;return(0,y.__generator)(this,function(a){switch(a.label){case 0:return _b(!0),_=(e=Math).max.apply(e,f(U.map(function(e){return e.threshold}))),t=[{icon:X["icon:7_levels_run"],text:C("main_menu.normal"),help:C("main_menu.normal_help"),value:function(){_A({levelToAvoid:eh(_T).name})}},{icon:X["icon:unlocks"],text:C("main_menu.unlocks"),help:C("main_menu.unlocks_help"),value:function(){(function(){_H.apply(this,arguments)})()}},{icon:X["icon:sandbox"],text:C("sandbox.title"),help:H()<_?C("sandbox.unlocks_at",{score:_}):C("sandbox.help"),disabled:H()<_,value:function(){return(0,g._)(function(){var e,_;return(0,y.__generator)(this,function(t){switch(t.label){case 0:e=B("creativeModePerks",{}),t.label=1;case 1:return[4,eY({title:C("sandbox.title"),text:C("sandbox.instructions"),actionsAsGrid:!0,actions:f(U.map(function(_){return{icon:_.icon,text:_.name,help:(e[_.id]||0)+"/"+_.max,value:_,className:e[_.id]?"":"grey-out-unless-hovered"}})).concat([{text:C("sandbox.start"),value:"start",icon:X["icon:continue"]}])})];case 2:if(!(_=t.sent()))return[3,3];if("start"===_)return _A({perks:e}),[3,3];return _&&(e[_.id]=((e[_.id]||0)+1)%(_.max+1),R("creativeModePerks",e)),[3,1];case 3:return[2]}})})()}},{text:C("main_menu.settings_title"),help:C("main_menu.settings_help"),icon:X["icon:settings"],value:function(){_B()}}],[4,eY({title:C("main_menu.title"),text:"",allowClose:!0,actions:t,textAfterButtons:C("main_menu.footer_html",{appVersion:F})})];case 1:return(r=a.sent())&&(r(),_T.needsRender=!0),[2]}})})).apply(this,arguments)}function _B(){return _R.apply(this,arguments)}function _R(){return(_R=(0,g._)(function(){var e,_,t,r,a,s,n,l;return(0,y.__generator)(this,function(o){switch(o.label){case 0:_b(!0),e=[],_=!0,t=!1,r=void 0;try{for(a=function(){var _=n.value;Y[_]&&e.push({icon:J(_)?X["icon:checkmark_checked"]:X["icon:checkmark_unchecked"],text:Y[_].name,help:Y[_].help,value:function(){R("breakout-settings-enable-"+_,!J(_)),"mobile-mode"===_&&_v(),_B()}})},s=Object.keys(Y)[Symbol.iterator]();!(_=(n=s.next()).done);_=!0)a()}catch(e){t=!0,r=e}finally{try{_||null==s.return||s.return()}finally{if(t)throw r}}return(document.fullscreenEnabled||document.webkitFullscreenEnabled)&&(null!==document.fullscreenElement?e.push({text:C("main_menu.fullscreen_exit"),help:C("main_menu.fullscreen_exit_help"),icon:X["icon:exit_fullscreen"],value:function(){_P(),_B()}}):e.push({text:C("main_menu.fullscreen"),help:C("main_menu.fullscreen_help"),icon:X["icon:fullscreen"],value:function(){_P(),_B()}})),e.push({text:C("main_menu.reset"),help:C("main_menu.reset_help"),value:function(){return(0,g._)(function(){return(0,y.__generator)(this,function(e){switch(e.label){case 0:return[4,eY({title:C("main_menu.reset"),text:C("main_menu.reset_instruction"),actions:[{text:C("main_menu.reset_confirm"),value:!0},{text:C("main_menu.reset_cancel"),value:!1}],allowClose:!0})];case 1:return e.sent()&&(localStorage.clear(),window.location.reload()),[2]}})})()}}),e.push({text:C("main_menu.download_save_file"),help:C("main_menu.download_save_file_help"),value:function(){return(0,g._)(function(){var e,_,t,r,a,s;return(0,y.__generator)(this,function(n){for(_=0,e={};_".concat(C("unlocks.intro",{ts:e}),"\n ").concat(t<100?C("unlocks.greyed_out_help"):"","
\n "),textAfterButtons:"\nYour high score is ".concat(_T.highScore,". \nClick an item above to start a run with it.\n
"),actions:_,allowClose:!0,actionsAsGrid:!0})];case 1:if(!(r=a.sent()))return[3,3];return[4,_q(_T)];case 2:a.sent()&&_A(r),a.label=3;case 3:return[2]}})})).apply(this,arguments)}function _q(e){return _L.apply(this,arguments)}function _L(){return(_L=(0,g._)(function(e){return(0,y.__generator)(this,function(_){return e.currentLevel?[2,eY({title:C("confirmRestart.title"),text:C("confirmRestart.text"),actions:[{value:!0,text:C("confirmRestart.yes")},{value:!1,text:C("confirmRestart.no")}]})]:[2,!0]})})).apply(this,arguments)}function _P(){try{if(null!==document.fullscreenElement)document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen();else{var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()}}catch(e){console.warn(e)}}setInterval(function(){J("show_fps")?_x.innerText=_w+" FPS "+_p(_T.coins)+" COINS "+(_p(_T.particles)+_p(_T.texts)+_p(_T.lights))+" PARTICLES ":_x.innerText="",_w=0},1e3),window.addEventListener("visibilitychange",function(){document.hidden&&_b(!0)}),eA.addEventListener("click",function(e){e.preventDefault(),eI||_S()}),document.addEventListener("visibilitychange",function(){document.hidden&&_b(!0)}),document.getElementById("menu").addEventListener("click",function(e){e.preventDefault(),eI||_M()});var _O={ArrowLeft:0,ArrowRight:0,Shift:0};function _C(e,_){_O[e]=_,_T.keyboardPuckSpeed=(_O.ArrowRight-_O.ArrowLeft)*(1+2*_O.Shift)*_T.gameZoneWidth/50}document.addEventListener("keydown",function(e){"f"!==e.key.toLowerCase()||e.ctrlKey||e.metaKey?e.key in _O&&_C(e.key,1):_P()," "===e.key&&!eI&&(_T.running?_b(!0):_g(),e.preventDefault())}),document.addEventListener("keyup",(t=(0,g._)(function(e){var _,t,r,a,s;return(0,y.__generator)(this,function(n){switch(n.label){case 0:if(s=document.querySelector("button:focus"),!(e.key in _O))return[3,1];return _C(e.key,0),[3,10];case 1:if("ArrowDown"!==e.key||(null==s?void 0:null===(_=s.nextElementSibling)||void 0===_?void 0:_.tagName)!=="BUTTON")return[3,2];return null==s||null===(t=s.nextElementSibling)||void 0===t||t.focus(),[3,10];case 2:if("ArrowUp"!==e.key||(null==s?void 0:null===(r=s.previousElementSibling)||void 0===r?void 0:r.tagName)!=="BUTTON")return[3,3];return null==s||null===(a=s.previousElementSibling)||void 0===a||a.focus(),[3,10];case 3:if(!("Escape"===e.key&&eF))return[3,4];return eF(),[3,10];case 4:if(!("Escape"===e.key&&_T.running))return[3,5];return _b(!0),[3,10];case 5:if(!("m"===e.key.toLowerCase()&&!eI))return[3,6];return _M().then(),[3,10];case 6:if(!("s"===e.key.toLowerCase()&&!eI))return[3,7];return _S().then(),[3,10];case 7:if(!("r"===e.key.toLowerCase()&&!eI))return[3,9];return[4,_q(_T)];case 8:return n.sent()&&_A({levelToAvoid:eh(_T).name}),[3,10];case 9:return[2];case 10:return e.preventDefault(),[2]}})}),function(e){return t.apply(this,arguments)}));var _T=_h({});function _A(e){_v(),Object.assign(_T,_h(e)),eZ(),__(_T,0)}_A(window.location.search.includes("stressTest")?{level:"Bird",perks:{sapper:10,bigger_explosions:1,unbounded:1,pierce_color:1,pierce:20,multiball:6,base_combo:100,telekinesis:2,yoyo:2,metamorphosis:1,implosions:1}}:{}),function e(){var _=performance.now(),t=_-_T.lastTick;_T.lastTick=_;var r=Math.min(4,t/(1e3/60));_T.keyboardPuckSpeed&&e0(_T,_T.puckPosition+_T.keyboardPuckSpeed),e2(_T),_T.running&&(_T.levelTime+=t,_T.runStatistics.runTime+=t,function(e){var _=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;e.runStatistics.max_combo=Math.max(e.runStatistics.max_combo,e.combo),e.balls=e.balls.filter(function(e){return!e.destroyed});var t=e.bricks.filter(function(e){return e&&"black"!==e}).length;e.levelTime>e.lastTickDown+1e3&&e.perks.hot_start&&(e.lastTickDown=e.levelTime,e3(e,e.perks.hot_start,e.puckPosition,e.gameZoneHeight-2*e.puckHeight)),t<=e.perks.skip_last&&!e.autoCleanUses&&(e.bricks.forEach(function(_,t){_&&e8(e,t,e.balls[0],!0)}),e.autoCleanUses++);var r=e.perks.respawn&&e.balls.find(function(e){return e.hitItem.length>1});if(!e.running||t||r?e.winAt=0:e.winAt||(e.winAt=e.levelTime+5e3),e.winAt&&e.levelTime>e.winAt||e.running&&e.levelTime&&!t&&!_p(e.coins))e.currentLevel+1