\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]"));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(j("score_panel.upgrades_picked")," ".concat(j("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(j("gameOver.test_run"),"
"):"","\n").concat(t,"
\n").concat(j("gameOver.cumulative_total",{startTs:s,endTs:o}),"
\n ").concat(l," \n "),{value:null,text:j("gameOver.restart"),help:""},' \n '.concat(ew(tK),"\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(W({},e.runStatistics),{perks:e.perks,mode:e.mode,appVersion:$})),e.isCreativeModeRun||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,S(s)),u=(l=Math).max.apply(l,S(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(j("gameOver.stats.intro",{count:_.length-1}),"
")+t)}catch(e){console.warn(e)}return t}(tK)," \n ")]}).then(function(){return tQ({levelToAvoid:eS(tK).name})})}}function t_(e){var t=C(),_=(u=(null==e?void 0:e.level)?et.filter(function(t){return t.name===(null==e?void 0:e.level)}):[],c=et.filter(function(e){return t>=e.threshold}).filter(function(t){return t.name!==(null==e?void 0:e.level)}).filter(function(t){return t.name!==(null==e?void 0:e.levelToAvoid)}).sort(function(){return Math.random()-.5}),u.concat(c.slice(0,10).sort(function(e,t){return e.sortKey-t.sortKey}))),r=W({},eb(e_),(null==e?void 0:e.perks)||{}),a=w(W({runLevels:_,level:_[0],currentLevel:0,upgradesOfferedFor:-1,perks:r,bannedPerks:eb(e_),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-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,isCreativeModeRun:eh(r)>1,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),!eh(a.perks)){var n=ek(a).filter(function(e){return e.giftable}),l=ea("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=e_[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 y=v("5mG9B"),z=v("6QuVk");function tr(){return(tr=(0,y._)(function(e,t){var _,r,a;return(0,z.__generator)(this,function(n){switch(n.label){case 0:e.readyToRender=!1,_=L("creativeModePerks_"+t,{}),e_.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,e7({title:j("lab.title",{lvl:t+1}),actionsAsGrid:!0,content:[j("lab.instructions")].concat(S(e_.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)}})),[j("lab.select_level")],S(et.map(function(e){return{icon:ee[e.name],text:e.name,value:e,tooltip:eg(e)}})))})];case 2:if(!(r=n.sent()))return[3,3];if("bricks"in r)return B("creativeModePerks_"+t,_),e_.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(_,S(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=D(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)*V(e.perks.soft_reset)));var a=Math.max(0,r-e.combo);if(a){for(var n=0;nT()&&(t=1);for(var n=0;n".concat(j("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(j("level_up.after_buttons",{level:e.currentLevel+1,max:eW(e)}),"
\n").concat(ex(e),"
\n")].concat(S(o),[ew(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 tR(e,t){return ey(tK,Math.floor(t/tK.brickWidth),Math.floor((e-tK.offsetX)/tK.brickWidth))}function tL(e){if(tK.bricks[e])return e}function tB(e,t,_){var r,a,n;return null!==(n=null!==(a=null!==(r=tL(tR(e-_,t-_)))&&void 0!==r?r:tL(tR(e+_,t-_)))&&void 0!==a?a:tL(tR(e+_,t+_)))&&void 0!==n?n:tL(tR(e-_,t+_))}window.addEventListener("resize",tP),window.addEventListener("fullscreenchange",tP),setInterval(function(){var e=eC.getBoundingClientRect(),t=e.width,_=e.height;(t!==tK.canvasWidth||_!==tK.canvasHeight)&&tP()},1e3),eC.addEventListener("mouseup",function(e){0===e.button&&(tK.running?tq(!0):(tG(),ea("pointerLock")&&eC.requestPointerLock&&eC.requestPointerLock().then()))}),eC.addEventListener("mousemove",function(e){document.pointerLockElement===eC?ta(tK,tK.puckPosition+e.movementX):ta(tK,e.x)}),eC.addEventListener("touchstart",function(e){var t;e.preventDefault(),(null===(t=e.touches)||void 0===t?void 0:t.length)&&(ta(tK,e.touches[0].pageX),tl(tK),tG())}),eC.addEventListener("touchend",function(e){e.preventDefault(),tq(!0)}),eC.addEventListener("touchcancel",function(e){e.preventDefault(),tq(!0)}),eC.addEventListener("touchmove",function(e){var t;(null===(t=e.touches)||void 0===t?void 0:t.length)&&ta(tK,e.touches[0].pageX)});var tC=0,tO=60;function tT(){return tA.apply(this,arguments)}function tA(){return(tA=(0,y._)(function(){return(0,z.__generator)(this,function(e){switch(e.label){case 0:return tq(!0),[4,e8({title:tK.loop?j("score_panel.title_looped",{loop:tK.loop,score:tK.score,level:tK.currentLevel+1,max:eW(tK)}):j("score_panel.title",{score:tK.score,level:tK.currentLevel+1,max:eW(tK)}),content:[tK.isCreativeModeRun?"".concat(j("score_panel.test_run"),"
"):"",ew(tK),ex(tK),tK.rerolls?j("score_panel.rerolls_count",{rerolls:tK.rerolls}):""],allowClose:!0})];case 1:return e.sent(),[2]}})})).apply(this,arguments)}setInterval(function(){tO=tC,tC=0},1e3),window.addEventListener("visibilitychange",function(){document.hidden&&tq(!0)}),eY.addEventListener("click",function(e){e.preventDefault(),e2||tT()}),document.addEventListener("visibilitychange",function(){document.hidden&&tq(!0)}),document.getElementById("menu").addEventListener("click",function(e){e.preventDefault(),e2||tj()});var tE=(p=Math).max.apply(p,S(e_.map(function(e){return e.threshold})));function tj(){return tD.apply(this,arguments)}function tD(){return(tD=(0,y._)(function(){var e,t;return(0,z.__generator)(this,function(_){switch(_.label){case 0:return tq(!0),e=[{icon:ee["icon:7_levels_run"],text:j("main_menu.normal"),help:eR("short")||j("main_menu.normal_help"),value:function(){tQ({levelToAvoid:eS(tK).name,mode:"short"})}},{icon:ee["icon:loop"],text:j("main_menu.loop_run"),help:eR("long")||C()\n ").concat(e.name,"
\n ").concat(e.help(1),"\n
\n ").concat(e.name,'
\n ').concat(e.credit," \n
".concat(j("unlocks.intro",{ts:e}),"\n ").concat(r<100?j("unlocks.greyed_out_help"):"","
")].concat(S(t),[j("unlocks.level")],S(_)),allowClose:!0,actionsAsGrid:!0})];case 1:if(!(a=n.sent()))return[3,3];return[4,tN(tK)];case 2:n.sent()&&tQ(w(W({},a),{mode:"short"})),n.label=3;case 3:return[2]}})})).apply(this,arguments)}function tN(e){return tU.apply(this,arguments)}function tU(){return(tU=(0,y._)(function(e){return(0,z.__generator)(this,function(t){return!e.currentLevel||e2?[2,!0]:[2,e8({title:j("confirmRestart.title"),content:[j("confirmRestart.text"),{value:!0,text:j("confirmRestart.yes")},{value:!1,text:j("confirmRestart.no")}]})]})})).apply(this,arguments)}var tX={ArrowLeft:0,ArrowRight:0,Shift:0};function tY(e,t){tX[e]=t,tK.keyboardPuckSpeed=(tX.ArrowRight-tX.ArrowLeft)*(1+2*tX.Shift)*tK.gameZoneWidth/50}document.addEventListener("keydown",(_=(0,y._)(function(e){return(0,z.__generator)(this,function(t){return"f"!==e.key.toLowerCase()||e.ctrlKey||e.metaKey?e.key in tX&&tY(e.key,1):(en("fullscreen"),tI())," "!==e.key||e2||(tK.running?tq(!0):tG(),e.preventDefault()),[2]})}),function(e){return _.apply(this,arguments)}));var tJ=new Date;document.addEventListener("keyup",(r=(0,y._)(function(e){var t,_,r,a,n;return(0,z.__generator)(this,function(l){switch(l.label){case 0:if(n=document.querySelector("button:focus"),!(e.key in tX))return[3,1];return tY(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&&e4))return[3,4];return e4(),[3,10];case 4:if(!("Escape"===e.key&&tK.running))return[3,5];return tq(!0),[3,10];case 5:if(!("m"===e.key.toLowerCase()&&!e2))return[3,6];return tj().then(),[3,10];case 6:if(!("s"===e.key.toLowerCase()&&!e2))return[3,7];return tT().then(),[3,10];case 7:if(!("r"===e.key.toLowerCase()&&!e2&&tJ>Date.now()+1e3))return[3,9];return[4,tN(tK)];case 8:return l.sent()&&tQ({levelToAvoid:eS(tK).name,mode:tK.mode}),[3,10];case 9:return[2];case 10:return e.preventDefault(),[2]}})}),function(e){return r.apply(this,arguments)}));var tK=t_({mode:"short"});function tQ(e){tP(),Object.assign(tK,t_(e)),e0(),tg(tK,0)}tQ(window.location.search.includes("stressTest")&&{perks:{pierce:2,bigger_explosions:10,sapper:3},mode:"short"}||{mode:"short"}),function e(){var t=performance.now(),_=t-tK.lastTick;tK.lastTick=t;var r=Math.min(4,_/(1e3/60));tK.keyboardPuckSpeed&&ta(tK,tK.puckPosition+tK.keyboardPuckSpeed),tl(tK),tK.running&&(tK.levelTime+=_,tK.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