\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]"));function A(e){for(var t=0,_=0;_
\n '.concat(c.title,'\n \n
\n\n'),i.slice(i.indexOf(c)+1).slice(0,3).forEach(function(e){s+='\n\n '.concat(e.title," \n
\n")})}var h=i.filter(function(e){return e.threshold>o&&e.threshold".concat(O("gameOver.test_run"),"
"):"","\n").concat(t,"
\n").concat(O("gameOver.cumulative_total",{startTs:o,endTs:l}),"
\n ").concat(s," \n "),actions:[{value:null,text:O("gameOver.restart"),help:""}],textAfterButtons:'\n '.concat(function(){var e="";try{var t=JSON.parse(localStorage.getItem("breakout_71_runs_history")||"[]");t.sort(function(e,t){return e.score-t.score}).reverse(),(t=t.slice(0,100)).push(W(k({},th.runStatistics),{perks:th.perks,appVersion:j})),th.isCreativeModeRun||localStorage.setItem("breakout_71_runs_history",JSON.stringify(t,null,2));var _=function(e,_,r){var a,n,s,l=t.map(function(e){return _(e)||0}),o=(a=Math).min.apply(a,f(l)),i=(n=Math).max.apply(n,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+t*m)," and ").concat(Math.floor(o+(t+1)*m)).concat(r,'"\n >').concat(!e&&" "||t==v&&b+r||Math.round(p[t]/e)+r,"")}).join("");return'".concat(O("gameOver.stats.intro",{count:t.length-1}),"
")+e)}catch(e){console.warn(e)}return e}()," \n ")}).then(function(){return tg({levelToAvoid:ep(th).name})})}}function eA(e,t){e.puckPosition=t,e.needsRender=!0}function eE(e){return+!e.perks.concave_puck*(Math.random()>.5?e.baseSpeed:-e.baseSpeed)}function eD(e){var t,_=1+((null===(t=e.perks)||void 0===t?void 0:t.multiball)||0),r=e.puckWidth/(_+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=(_=Math).max.apply(_,f(Object.keys(r).map(function(e){return r[e]})));return(t=Object.keys(r).filter(function(e){return r[e]==a}))[Math.floor(t.length*Math.random())]}(e.bricks.filter(function(e){return e}))||"#FFF");for(var a=0;a<_;a++){var n=e.puckPosition-e.puckWidth/2+r*(a+1),s=eE(e);e.balls.push({x:n,previousX:n,y:e.gameZoneHeight-1.5*e.ballSize,previousY:e.gameZoneHeight-1.5*e.ballSize,vx:s,previousVX:s,vy:-e.baseSpeed,previousVY:-e.baseSpeed,sx:0,sy:0,piercedSinceBounce:0,hitSinceBounce:0,hitItem:[],sapperUses:0})}e.ballStickToPuck=!0}function eV(e){e.baseSpeed=Math.max(3,e.gameZoneWidth/12/10+e.currentLevel/3+e.levelTime/3e4-2*e.perks.slow_down),e.puckWidth=e.gameZoneWidth/12*(3-e.perks.smaller_puck+e.perks.bigger_puck),e.puckPosition".concat(O("level_up.after_buttons",{level:e.currentLevel+1,max:eu(e)}),"
\n").concat(ec(e),'
\n \n \n '),u=a&&n&&l&&s&&O("level_up.compliment_perfect")||(a||n||l||s)&&O("level_up.compliment_good")||O("level_up.compliment_advice"),[4,eP({title:O("level_up.pick_upgrade_title")+(_?" ("+(_+1)+")":""),actions:o,text:"".concat(O("level_up.before_buttons",{score:e.score-e.levelStartScore,catchGain:n,levelSpawnedCoins:e.levelSpawnedCoins,time:Math.round(e.levelTime/1e3),timeGain:a,levelMisses:e.levelMisses,missesGain:l,levelWallBounces:e.levelWallBounces,wallHitsGain:s,compliment:u}),"\n
"),allowClose:!1,textAfterButtons:i})];case 2:return c=p.sent(),e.perks[c]++,"instant_upgrade"===c&&(_+=2),e.runStatistics.upgrades_picked++,[3,1];case 3:return[2]}})})).apply(this,arguments)}function tt(e,t){return eo(th,Math.floor(t/th.brickWidth),Math.floor((e-th.offsetX)/th.brickWidth))}function t_(e){if(th.bricks[e])return e}function tr(e,t,_){var r,a,n;return null!==(n=null!==(a=null!==(r=t_(tt(e-_,t-_)))&&void 0!==r?r:t_(tt(e+_,t-_)))&&void 0!==a?a:t_(tt(e+_,t+_)))&&void 0!==n?n:t_(tt(e-_,t+_))}function ta(e,t,_){if(!e.destroyed){e.previousX=e.x,e.previousY=e.y,e.x+=e.vx*_,e.y+=e.vy*_,e.sx||(e.sx=0),e.sy||(e.sy=0),e.sx+=e.previousX-e.x,e.sy+=e.previousY-e.y,e.sx*=.9,e.sy*=.9,th.perks.wind&&(e.vx+=(th.puckPosition-(th.offsetX+th.gameZoneWidth/2))/th.gameZoneWidth*th.perks.wind*.5);var r=0,a=0;return e.x${t('score_panel.test_run}
":"","\n").concat(O("score_panel.upgrades_picked"),"
\n").concat(ec(th),"
\n "),allowClose:!0,actions:[{text:O("score_panel.resume"),help:O("score_panel.resume_help"),value:function(){}},{text:O("score_panel.restart"),help:O("score_panel.restart_help"),value:function(){tg({levelToAvoid:ep(th).name})}}]})];case 1:return(e=t.sent())&&e(),[2]}})})).apply(this,arguments)}function tl(){return to.apply(this,arguments)}function to(){return(to=(0,g._)(function(){var e,t,_,r,a,n,s,l,o,i;return(0,y.__generator)(this,function(u){switch(u.label){case 0:e8(!0),t=[{text:O("main_menu.resume"),help:O("main_menu.resume_help"),value:function(){}},{text:O("main_menu.unlocks"),help:O("main_menu.unlocks_help"),value:function(){(function(){ti.apply(this,arguments)})()}}],_=!0,r=!1,a=void 0;try{for(n=function(){var e=l.value;N[e]&&t.push({icon:U(e)?I["icon:checkmark_checked"]:I["icon:checkmark_unchecked"],text:N[e].name,help:N[e].help,value:function(){G("breakout-settings-enable-"+e,!U(e)),"mobile-mode"===e&&e9(),tl()}})},s=Object.keys(N)[Symbol.iterator]();!(_=(l=s.next()).done);_=!0)n()}catch(e){r=!0,a=e}finally{try{_||null==s.return||s.return()}finally{if(r)throw a}}return o=(e=Math).max.apply(e,f(F.map(function(e){return e.threshold}))),(document.fullscreenEnabled||document.webkitFullscreenEnabled)&&(null!==document.fullscreenElement?t.push({text:O("main_menu.fullscreen_exit"),help:O("main_menu.fullscreen_exit_help"),icon:I["icon:exit_fullscreen"],value:function(){tp()}}):t.push({text:O("main_menu.fullscreen"),help:O("main_menu.fullscreen_help"),icon:I["icon:fullscreen"],value:function(){tp()}})),t.push({text:O("sandbox.title"),help:q()".concat(O("unlocks.intro",{ts:e}),"\n ").concat(_<100?O("unlocks.greyed_out_help"):"","
\n "),textAfterButtons:"\nYour high score is ".concat(th.highScore,". \nClick an item above to start a run with it.\n
"),actions:t,allowClose:!0})];case 1:if(!(r=a.sent()))return[3,3];return[4,tu()];case 2:a.sent()&&tg(r),a.label=3;case 3:return[2]}})})).apply(this,arguments)}function tu(){return tc.apply(this,arguments)}function tc(){return(tc=(0,g._)(function(){return(0,y.__generator)(this,function(e){return th.currentLevel?[2,eP({title:O("confirmRestart.title"),text:O("confirmRestart.text"),actions:[{value:!0,text:O("confirmRestart.yes")},{value:!1,text:O("confirmRestart.no")}]})]:[2,!0]})})).apply(this,arguments)}function tp(){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)}}window.addEventListener("resize",e9),window.addEventListener("fullscreenchange",e9),setInterval(function(){var e=eb.getBoundingClientRect(),t=e.width,_=e.height;(t!==th.canvasWidth||_!==th.canvasHeight)&&e9()},1e3),eb.addEventListener("mouseup",function(e){0===e.button&&(th.running?e8(!0):(e7(),U("pointerLock")&&eb.requestPointerLock&&eb.requestPointerLock().then()))}),eb.addEventListener("mousemove",function(e){document.pointerLockElement===eb?eA(th,th.puckPosition+e.movementX):eA(th,e.x)}),eb.addEventListener("touchstart",function(e){var t;e.preventDefault(),(null===(t=e.touches)||void 0===t?void 0:t.length)&&(eA(th,e.touches[0].pageX),eV(th),e7())}),eb.addEventListener("touchend",function(e){e.preventDefault(),e8(!0)}),eb.addEventListener("touchcancel",function(e){e.preventDefault(),e8(!0)}),eb.addEventListener("touchmove",function(e){var t;(null===(t=e.touches)||void 0===t?void 0:t.length)&&eA(th,e.touches[0].pageX)}),window.addEventListener("visibilitychange",function(){document.hidden&&e8(!0)}),eG.addEventListener("click",function(e){e.preventDefault(),tn()}),document.addEventListener("visibilitychange",function(){document.hidden&&e8(!0)}),document.getElementById("menu").addEventListener("click",function(e){e.preventDefault(),tl()});var td={ArrowLeft:0,ArrowRight:0,Shift:0};function tm(e,t){td[e]=t,th.keyboardPuckSpeed=(td.ArrowRight-td.ArrowLeft)*(1+2*td.Shift)*th.gameZoneWidth/50}document.addEventListener("keydown",function(e){"f"!==e.key.toLowerCase()||e.ctrlKey||e.metaKey?e.key in td&&tm(e.key,1):tp()," "===e.key&&!eO&&(th.running?e8(!0):e7(),e.preventDefault())}),document.addEventListener("keyup",(_=(0,g._)(function(e){var t,_,r,a,n;return(0,y.__generator)(this,function(s){switch(s.label){case 0:if(n=document.querySelector("button:focus"),!(e.key in td))return[3,1];return tm(e.key,0),[3,10];case 1:if("ArrowDown"!==e.key||(null==n?void 0:null===(t=n.nextElementSibling)||void 0===t?void 0:t.tagName)!=="BUTTON")return[3,2];return null==n||null===(_=n.nextElementSibling)||void 0===_||_.focus(),[3,10];case 2:if("ArrowUp"!==e.key||(null==n?void 0:null===(r=n.previousElementSibling)||void 0===r?void 0:r.tagName)!=="BUTTON")return[3,3];return null==n||null===(a=n.previousElementSibling)||void 0===a||a.focus(),[3,10];case 3:if(!("Escape"===e.key&&eC))return[3,4];return eC(),[3,10];case 4:if(!("Escape"===e.key&&th.running))return[3,5];return e8(!0),[3,10];case 5:if(!("m"===e.key.toLowerCase()&&!eO))return[3,6];return tl().then(),[3,10];case 6:if(!("s"===e.key.toLowerCase()&&!eO))return[3,7];return tn().then(),[3,10];case 7:if(!("r"===e.key.toLowerCase()&&!eO))return[3,9];return[4,tu()];case 8:return s.sent()&&tg({levelToAvoid:ep(th).name}),[3,10];case 9:return[2];case 10:return e.preventDefault(),[2]}})}),function(e){return _.apply(this,arguments)}));var th=e6({});function tg(e){Object.assign(th,e6(e)),eL(),eU(th,0)}tg({}),e9(),function e(){var t=performance.now(),_=t-th.lastTick;th.lastTick=t;var r=Math.min(4,_/(1e3/60));th.keyboardPuckSpeed&&eA(th,th.puckPosition+th.keyboardPuckSpeed),eV(th),th.running&&(th.levelTime+=_,th.runStatistics.runTime+=_,function(e){var t,_,r,a,n,s=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 l=e.bricks.filter(function(e){return e&&"black"!==e}).length;if(e.levelTime>e.lastTickDown+1e3&&e.perks.hot_start&&(e.lastTickDown=e.levelTime,t=e.perks.hot_start,_=e.puckPosition,r=e.gameZoneHeight-2*e.puckHeight,a=e.combo,e.combo=Math.max(eZ(e),e.combo-t),(n=Math.max(0,a-e.combo))&&(eN(e,"comboDecrease",_,1),void 0!==_&&void 0!==r&&eQ(e,_,r,"red","-"+n,20,300))),l<=e.perks.skip_last&&!e.autoCleanUses&&(e.bricks.forEach(function(t,_){t&&eX(e,_,e.balls[0],!0)}),e.autoCleanUses++),l||e4(e.coins)){if(e.running||e.levelTime){var o=Math.round(e.coinSize/2);if(e3(e.coins,function(t,_){if(e.perks.coin_magnet){var r,a=s*(e.puckPosition-t.x)/(100+Math.pow(t.y-e.gameZoneHeight,2)+Math.pow(t.x-e.puckPosition,2))*e.perks.coin_magnet*100;t.vx+=a,t.sa-=a/10}var n=1-(.03*e.perks.viscosity+.005)*s;t.vy*=n,t.vx*=n,t.vx>7*e.baseSpeed&&(t.vx=7*e.baseSpeed),t.vx<-7*e.baseSpeed&&(t.vx=-7*e.baseSpeed),t.vy>7*e.baseSpeed&&(t.vy=7*e.baseSpeed),t.vy<-7*e.baseSpeed&&(t.vy=-7*e.baseSpeed),t.a+=t.sa,t.vy+=s*t.weight*.8;var l=Math.abs(t.sx)+Math.abs(t.sx),i=ta(t,t.size/2,s);t.y>e.gameZoneHeight-o-e.puckHeight&&t.y