\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]"));function X(e){for(var t=0,_=0;_ \n ").concat(t.name,"\n ").concat(t.help(Math.max(1,e.perks[t.id])),"\n ".concat(E("score_panel.upgrades_picked")," ".concat(E("score_panel.upcoming_levels")," ").concat(t,"
\n '.concat(c.title,'\n \n
\n\n'),i.slice(i.indexOf(c)+1).slice(0,3).forEach(function(e){l+='\n\n '.concat(e.title," \n
\n")})}var g=i.filter(function(e){return e.threshold>s&&e.threshold".concat(t,"
\n").concat(E("gameOver.cumulative_total",{startTs:s,endTs:o}),"
\n ").concat(l," \n "),{value:null,text:E("gameOver.restart"),help:""},' \n '.concat(ek(tQ),"\n ").concat(function(e){var t="";try{var _=JSON.parse(localStorage.getItem("breakout_71_runs_history")||"[]");_.sort(function(e,t){return e.score-t.score}).reverse(),(_=_.slice(0,100)).push(W(k({},e.runStatistics),{perks:e.perks,mode:e.mode,appVersion:Q})),localStorage.setItem("breakout_71_runs_history",JSON.stringify(_,null,2));var r=function(t,r,a){var n,l,o,s=_.filter(function(t){return(t.mode||"short")===e.mode}).map(function(e){return r(e)||0}),i=(n=Math).min.apply(n,x(s)),u=(l=Math).max.apply(l,x(s));if(i===u)return"";u-i<10&&(i=Math.max(0,u-10),u=Math.max(u,i+10));var c=Math.min(s.length,10);if(c<3)return"";for(var p=[],d=[],m=0;m".concat(E("gameOver.stats.intro",{count:_.length-1}),"
")+t)}catch(e){console.warn(e)}return t}(tQ)," \n ")]}).then(function(){return t$({levelToAvoid:ew(tQ).name})})}}function tt(e,t){var _=(null==t?void 0:t.level)?ee.filter(function(e){return e.name===(null==t?void 0:t.level)}):[],r=ee.filter(function(t){return e>=t.threshold}).filter(function(e){return e.name!==(null==t?void 0:t.level)}).filter(function(e){return e.name!==(null==t?void 0:t.levelToAvoid)}).sort(function(){return Math.random()-.5});return _.concat(r.slice(0,10).sort(function(e,t){return e.sortKey-t.sortKey}))}function t_(e){var t=B(),_=tt(t,e),r=k({},eg(et),(null==e?void 0:e.perks)||{}),a=W(k({runLevels:_,level:_[0],currentLevel:0,upgradesOfferedFor:-1,perks:r,bannedPerks:eg(et),puckWidth:200,baseSpeed:12,combo:1,gridSize:12,running:!1,isGameOver:!1,ballStickToPuck:!0,puckPosition:400,lastPuckPosition:400,lastPuckMove:0,pauseTimeout:null,canvasWidth:0,canvasHeight:0,offsetX:0,offsetXRoundedDown:0,gameZoneWidth:0,gameZoneWidthRoundedUp:0,gameZoneHeight:0,brickWidth:0,score:0,lastScoreIncrease:-1e3,lastExplosion:-1e3,lastBrickBroken:0,highScore:parseFloat(localStorage.getItem("breakout-3-hsbreakout-3-hs-"+(null==e?void 0:e.mode))||"0"),balls:[],ballsColor:"white",bricks:[],brickHP:[],lights:{indexMin:0,total:0,list:[]},particles:{indexMin:0,total:0,list:[]},texts:{indexMin:0,total:0,list:[]},coins:{indexMin:0,total:0,list:[]},respawns:{indexMin:0,total:0,list:[]},levelStartScore:0,levelMisses:0,levelSpawnedCoins:0,puckColor:"#FFF",ballSize:20,coinSize:14,puckHeight:20,totalScoreAtRunStart:t,pauseUsesDuringRun:0,keyboardPuckSpeed:0,lastTick:performance.now(),lastTickDown:0,runStatistics:{started:Date.now(),levelsPlayed:0,runTime:0,coins_spawned:0,score:0,best_level_score:-1,worst_level_score:-1,bricks_broken:0,misses:0,balls_lost:0,puck_bounces:0,wall_bounces:0,upgrades_picked:1,max_combo:1,max_level:0},lastOffered:{},levelTime:0,winAt:0,levelWallBounces:0,needsRender:!0,autoCleanUses:0},{aboutToPlaySound:{wallBeep:{vol:0,x:0},comboIncreaseMaybe:{vol:0,x:0},comboDecrease:{vol:0,x:0},coinBounce:{vol:0,x:0},explode:{vol:0,x:0},lifeLost:{vol:0,x:0},coinCatch:{vol:0,x:0},colorChange:{vol:0,x:0}}}),{rerolls:0,loop:0,baseCombo:1,mode:(null==e?void 0:e.mode)||"short",readyToRender:!0});if(tn(a),!((u=a.perks)&&(null===(c=Object.values(u))||void 0===c?void 0:c.reduce(function(e,t){return e+t},0)))){var n=ef(a).filter(function(e){return e.giftable}),l=er("easy")&&"slow_down"||n[Math.floor(Math.random()*n.length)].id;r[l]=1,td(a,l)}var o=!0,s=!1,i=void 0;try{for(var u,c,p,d=et[Symbol.iterator]();!(o=(p=d.next()).done);o=!0){var m=p.value;a.perks[m.id]&&td(a,m.id)}}catch(e){s=!0,i=e}finally{try{o||null==d.return||d.return()}finally{if(s)throw i}}return a}var f=b("5mG9B"),S=b("6QuVk");function tr(){return(tr=(0,f._)(function(e,t){var _,r,a;return(0,S.__generator)(this,function(n){switch(n.label){case 0:e.readyToRender=!1,_=R("creativeModePerks_"+t,{}),et.forEach(function(t){_[t.id]=Math.min(_[t.id]||0,t.max-e.bannedPerks[t.id])}),a=["extra_levels","shunt","one_more_choice","instant_upgrade"],n.label=1;case 1:return[4,e6({title:E("lab.title",{lvl:t+1}),actionsAsGrid:!0,content:[E("lab.instructions")].concat(x(et.filter(function(e){return!a.includes(e.id)}).map(function(t){return{icon:t.icon,text:t.name,help:(_[t.id]||0)+"/"+(t.max-e.bannedPerks[t.id]),value:t,disabled:t.max-e.bannedPerks[t.id]<=0,className:_[t.id]?"sandbox":"sandbox grey-out-unless-hovered",tooltip:t.help(_[t.id]||1)}})),[E("lab.select_level")],x(ee.map(function(e){return{icon:$[e.name],text:e.name,value:e,tooltip:em(e)}})))})];case 2:if(!(r=n.sent()))return[3,3];if("bricks"in r)return L("creativeModePerks_"+t,_),et.forEach(function(t){e.perks[t.id]=_[t.id],e.bannedPerks[t.id]+=_[t.id]}),e.runLevels[t]=r,[3,3];return r&&(_[r.id]=((_[r.id]||0)+1)%(r.max-e.bannedPerks[r.id]+1)),[3,1];case 3:return[2]}})})).apply(this,arguments)}function ta(e,t){e.puckPosition=t,e.needsRender=!0}function tn(e){tl(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(_,x(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),l=+!e.perks.concave_puck*(Math.random()>.5?e.baseSpeed:-e.baseSpeed);e.balls.push({x:n,previousX:n,y:e.gameZoneHeight-1.5*e.ballSize,previousY:e.gameZoneHeight-1.5*e.ballSize,vx:l,previousVX:l,vy:-e.baseSpeed,previousVY:-e.baseSpeed,piercePoints:3*e.perks.pierce,hitSinceBounce:0,brokenSinceBounce:0,sapperUses:0})}e.ballStickToPuck=!0}function tl(e){e.baseSpeed=Math.max(3,e.gameZoneWidth/12/10+e.currentLevel/3+e.levelTime/3e4-2*e.perks.slow_down+e.loop),e.puckWidth=Math.max(e.ballSize,e.gameZoneWidth/12*Math.min(12,3-e.perks.smaller_puck+e.perks.bigger_puck));var t=e.levelTime?e.perks.corner_shot:0,_=e.offsetXRoundedDown+e.puckWidth/2-e.puckWidth*t,r=e.offsetXRoundedDown+e.gameZoneWidthRoundedUp-e.puckWidth/2+e.puckWidth*t;e.puckPosition=j(e.puckPosition,_,r),e.ballStickToPuck&&function(e){var t=e.balls.length,_=e.puckWidth/(t+1);e.balls.forEach(function(t,r){var a=e.puckPosition-e.puckWidth/2+_*(r+1);t.x=a,t.previousX=a,t.y=e.gameZoneHeight-1.5*e.ballSize,t.previousY=t.y,t.hitSinceBounce=0,t.brokenSinceBounce=0,t.piercePoints=3*e.perks.pierce})}(e),Math.abs(e.lastPuckPosition-e.puckPosition)>1&&e.running&&(e.lastPuckMove=e.levelTime),e.lastPuckPosition=e.puckPosition}function to(e){return e.baseCombo+3*e.perks.base_combo+5*e.perks.smaller_puck}function ts(e,t,_){var r=e.combo;e.combo=to(e),r>e.combo&&e.perks.soft_reset&&(e.combo+=Math.floor((r-e.combo)*D(e.perks.soft_reset)));var a=Math.max(0,r-e.combo);if(a){for(var n=0;nO()&&(t=1);for(var n=0;n".concat(E("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:l,levelWallBounces:e.levelWallBounces,wallHitsGain:n,compliment:s}),"\n
\n").concat(E("level_up.after_buttons",{level:e.currentLevel+1,max:ey(e)}),"
\n").concat(eW(e),"
\n")].concat(x(o),[ek(e),''])})];case 2:return"reroll"===(i=u.sent())?(_++,e.rerolls--):(e.perks[i]++,"instant_upgrade"===i&&(_+=2),e.runStatistics.upgrades_picked++),[3,1];case 3:return[2]}})})).apply(this,arguments)}function tL(e,t){return ev(tQ,Math.floor(t/tQ.brickWidth),Math.floor((e-tQ.offsetX)/tQ.brickWidth))}function tB(e){if(tQ.bricks[e])return e}function tC(e,t,_){var r,a,n;return null!==(n=null!==(a=null!==(r=tB(tL(e-_,t-_)))&&void 0!==r?r:tB(tL(e+_,t-_)))&&void 0!==a?a:tB(tL(e+_,t+_)))&&void 0!==n?n:tB(tL(e-_,t+_))}window.addEventListener("resize",tH),window.addEventListener("fullscreenchange",tH),setInterval(function(){var e=eB.getBoundingClientRect(),t=e.width,_=e.height;(t!==tQ.canvasWidth||_!==tQ.canvasHeight)&&tH()},1e3),eB.addEventListener("mouseup",function(e){0===e.button&&(tQ.running?tP(!0):(tq(),er("pointerLock")&&eB.requestPointerLock&&eB.requestPointerLock().then()))}),eB.addEventListener("mousemove",function(e){document.pointerLockElement===eB?ta(tQ,tQ.puckPosition+e.movementX):ta(tQ,e.x)}),eB.addEventListener("touchstart",function(e){var t;e.preventDefault(),(null===(t=e.touches)||void 0===t?void 0:t.length)&&(ta(tQ,e.touches[0].pageX),tl(tQ),tq())}),eB.addEventListener("touchend",function(e){e.preventDefault(),tP(!0)}),eB.addEventListener("touchcancel",function(e){e.preventDefault(),tP(!0)}),eB.addEventListener("touchmove",function(e){var t;(null===(t=e.touches)||void 0===t?void 0:t.length)&&ta(tQ,e.touches[0].pageX)});var tO=0,tT=60;function tA(){return tE.apply(this,arguments)}function tE(){return(tE=(0,f._)(function(){return(0,S.__generator)(this,function(e){switch(e.label){case 0:return tP(!0),[4,e7({title:tQ.loop?E("score_panel.title_looped",{loop:tQ.loop,score:tQ.score,level:tQ.currentLevel+1,max:ey(tQ)}):E("score_panel.title",{score:tQ.score,level:tQ.currentLevel+1,max:ey(tQ)}),content:[ek(tQ),eW(tQ),tQ.rerolls?E("score_panel.rerolls_count",{rerolls:tQ.rerolls}):""],allowClose:!0})];case 1:return e.sent(),[2]}})})).apply(this,arguments)}setInterval(function(){tT=tO,tO=0},1e3),window.addEventListener("visibilitychange",function(){document.hidden&&tP(!0)}),eU.addEventListener("click",function(e){e.preventDefault(),e1||tA()}),document.addEventListener("visibilitychange",function(){document.hidden&&tP(!0)}),document.getElementById("menu").addEventListener("click",function(e){e.preventDefault(),e1||tD()});var tj=(p=Math).max.apply(p,x(et.map(function(e){return e.threshold})));function tD(){return tV.apply(this,arguments)}function tV(){return(tV=(0,f._)(function(){var e,t;return(0,S.__generator)(this,function(_){switch(_.label){case 0:return tP(!0),e=[{icon:$["icon:7_levels_run"],text:E("main_menu.normal"),help:eP("short")||E("main_menu.normal_help"),value:function(){t$({levelToAvoid:ew(tQ).name,mode:"short"})}},{icon:$["icon:loop"],text:E("main_menu.loop_run"),help:eP("long")||B()\n ").concat(e.name,"
\n ").concat(e.help(1),"\n
\n ").concat(e.name,'
\n ').concat(e.credit," \n
".concat(E("unlocks.intro",{ts:e}),"\n ").concat(r<100?E("unlocks.greyed_out_help"):"","
")].concat(x(t),[E("unlocks.level")],x(_)),allowClose:!0,actionsAsGrid:!0})];case 1:if(!(a=n.sent()))return[3,3];return[4,tX(tQ)];case 2:n.sent()&&t$(W(k({},a),{mode:"short"})),n.label=3;case 3:return[2]}})})).apply(this,arguments)}function tX(e){return tU.apply(this,arguments)}function tU(){return(tU=(0,f._)(function(e){return(0,S.__generator)(this,function(t){return!e.currentLevel||e1?[2,!0]:[2,e7({title:E("confirmRestart.title"),content:[E("confirmRestart.text"),{value:!0,text:E("confirmRestart.yes")},{value:!1,text:E("confirmRestart.no")}]})]})})).apply(this,arguments)}var tY={ArrowLeft:0,ArrowRight:0,Shift:0};function tJ(e,t){tY[e]=t,tQ.keyboardPuckSpeed=(tY.ArrowRight-tY.ArrowLeft)*(1+2*tY.Shift)*tQ.gameZoneWidth/50}document.addEventListener("keydown",(_=(0,f._)(function(e){return(0,S.__generator)(this,function(t){return"f"!==e.key.toLowerCase()||e.ctrlKey||e.metaKey?e.key in tY&&tJ(e.key,1):(ea("fullscreen"),tF())," "!==e.key||e1||(tQ.running?tP(!0):tq(),e.preventDefault()),[2]})}),function(e){return _.apply(this,arguments)}));var tK=new Date;document.addEventListener("keyup",(r=(0,f._)(function(e){var t,_,r,a,n;return(0,S.__generator)(this,function(l){switch(l.label){case 0:if(n=document.querySelector("button:focus"),!(e.key in tY))return[3,1];return tJ(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&&e2))return[3,4];return e2(),[3,10];case 4:if(!("Escape"===e.key&&tQ.running))return[3,5];return tP(!0),[3,10];case 5:if(!("m"===e.key.toLowerCase()&&!e1))return[3,6];return tD().then(),[3,10];case 6:if(!("s"===e.key.toLowerCase()&&!e1))return[3,7];return tA().then(),[3,10];case 7:if(!("r"===e.key.toLowerCase()&&!e1&&tK>Date.now()+1e3))return[3,9];return[4,tX(tQ)];case 8:return l.sent()&&t$({levelToAvoid:ew(tQ).name,mode:tQ.mode}),[3,10];case 9:return[2];case 10:return e.preventDefault(),[2]}})}),function(e){return r.apply(this,arguments)}));var tQ=t_({mode:"short"});function t$(e){tH(),Object.assign(tQ,t_(e)),e$(),th(tQ,0)}t$(window.location.search.includes("stressTest")&&{perks:{pierce:2,bigger_explosions:10,sapper:3},mode:"long"}||{mode:"short"}),function e(){var t=performance.now(),_=t-tQ.lastTick;tQ.lastTick=t;var r=Math.min(4,_/(1e3/60));tQ.keyboardPuckSpeed&&ta(tQ,tQ.puckPosition+tQ.keyboardPuckSpeed),tl(tQ),tQ.running&&(tQ.levelTime+=_,tQ.runStatistics.runTime+=_,function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;e.runStatistics.max_combo=Math.max(e.runStatistics.max_combo,e.combo),e.perks.addiction&&e.lastBrickBroken&&e.lastBrickBroken