\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]"));function X(e){for(var _=0,t=0;t')}(t,e.size,e.color);return $[e.name]=n,W(k({},e),{bricks:t,bricksCount:r,icon:n,svg:(_=null!==e.svg&&N[e.svg%N.length],e.color||_||(_=N[X(e.name)%N.length]),_)})}).filter(function(e){return!e.name.startsWith("icon:")}).map(function(e,_){return W(k({},e),{threshold:_<8?0:Math.round(Math.min(10*Math.pow(10,1+(_+e.size)/30),5e3)*_),sortKey:(Math.random()+3)/3.5*e.bricksCount})}),e_=I.map(function(e){return W(k({},e),{icon:$["icon:"+e.id]})}),et={sound:{default:!0,name:E("main_menu.sounds"),help:E("main_menu.sounds_help")},"mobile-mode":{default:window.innerHeight>window.innerWidth,name:E("main_menu.mobile"),help:E("main_menu.mobile_help")},basic:{default:!1,name:E("main_menu.basic"),help:E("main_menu.basic_help")},colorful_coins:{default:!1,name:E("main_menu.colorful_coins"),help:E("main_menu.colorful_coins_help")},show_fps:{default:!1,name:E("main_menu.show_fps"),help:E("main_menu.show_fps_help")},show_stats:{default:!1,name:E("main_menu.show_stats"),help:E("main_menu.show_stats_help")},pointerLock:{default:!1,name:E("main_menu.pointer_lock"),help:E("main_menu.pointer_lock_help")},easy:{default:!1,name:E("main_menu.kid"),help:E("main_menu.kid_help")},record:{default:!1,name:E("main_menu.record"),help:E("main_menu.record_help")},fullscreen:{default:!1,name:E("main_menu.fullscreen"),help:E("main_menu.fullscreen_help")},donation_reminder:{default:V()>5,name:E("main_menu.donation_reminder"),help:E("main_menu.donation_reminder_help")},red_miss:{default:!1,name:E("main_menu.red_miss"),help:E("main_menu.red_miss_help")},comboIncreaseTexts:{default:!1,name:E("main_menu.comboIncreaseTexts"),help:E("main_menu.comboIncreaseTexts_help")}};function er(e){var _;return R("breakout-settings-enable-"+e,null===(_=et[e])||void 0===_?void 0:_.default)}function en(e){L("breakout-settings-enable-"+e,!er(e))}var ea=Date.now(),es={wallBeep:function(e,_,t){er("sound")&&el(800,_,e)},comboIncreaseMaybe:function(e,_,t){if(er("sound")){var r=0;!isNaN(eu)&&(eut&&(r=-1)),ep(r,_,e),eu=t}},comboDecrease:function(e,_,t){er("sound")&&ep(-1,_,e)},coinBounce:function(e,_,t){er("sound")&&el(1200,_,e,.1,"triangle")},explode:function(e,_,t){er("sound")&&function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5,_=eo();if(_){var t=_.createBufferSource();t.buffer=ei(_);var r=_.createGain();t.connect(r);var n=_.createBiquadFilter();n.type="lowpass",n.frequency.setValueAtTime(1e3,_.currentTime),r.connect(n);var s=_.createStereoPanner();s.pan.setValueAtTime(2*e-1,_.currentTime),n.connect(s),s.connect(_.destination),s.connect(a),r.gain.setValueAtTime(1,_.currentTime),r.gain.exponentialRampToValueAtTime(.01,_.currentTime+1),n.frequency.exponentialRampToValueAtTime(60,_.currentTime+1),t.start(_.currentTime),t.stop(_.currentTime+1)}}(_)},lifeLost:function(e,_,t){er("sound")&&function(e){var _=eo();if(_){var t=[ed(_,3e3,"square"),ed(_,4500,"square"),ed(_,6e3,"square")],r=_.createGain(),n=_.createBufferSource();n.buffer=ei(_),t.forEach(function(e){return e.connect(r)}),n.connect(r),r.gain.setValueAtTime(.2,_.currentTime),t.forEach(function(e){return e.start()}),n.start(),t.forEach(function(e){return e.stop(_.currentTime+.2)}),n.stop(_.currentTime+.2),r.gain.exponentialRampToValueAtTime(.001,_.currentTime+.2);var s=_.createStereoPanner();s.pan.setValueAtTime(2*e-1,_.currentTime),r.connect(s),s.connect(_.destination),s.connect(a),r.connect(s)}}(_)},coinCatch:function(e,_,t){er("sound")&&el(900,_,e,.1,"triangle")},colorChange:function(e,_,t){el(400,_,e,.5,"sine"),el(800,_,.5*e,.2,"square")}};function eo(){if(!n){if(!er("sound"))return null;a=(n=new(window.AudioContext||window.webkitAudioContext)).createMediaStreamDestination()}return n}function el(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:800,_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.1,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"sine",s=eo();if(s){var o=ed(s,e,n),l=s.createGain();o.connect(l);var i=s.createStereoPanner();i.pan.setValueAtTime(2*_-1,s.currentTime),l.connect(i),i.connect(s.destination),i.connect(a),l.gain.setValueAtTime(.8*t,s.currentTime),l.gain.exponentialRampToValueAtTime(.001,s.currentTime+r),o.start(s.currentTime),o.stop(s.currentTime+r)}}function ei(e){if(!s)for(var _=2*e.sampleRate,t=(s=e.createBuffer(1,_,e.sampleRate)).getChannelData(0),r=0;r<_;r++)t[r]=2*Math.random()-1;return s}var eu=NaN,ec=6;function ep(e,_,t){(ec+=e)>11&&(ec=0),ec<0&&(ec=11);var r=function(e){var r=392*Math.pow(1.05945594920268,e),n=Math.abs(e-5.5),a=Math.max(0,t*(1-n/16.5));return el(r,_,a),r.toFixed(2)+" at "+Math.floor(100*a)+"% diff "+n};r(12+ec),r(ec),r(-12+ec)}function ed(e,_,t){var r=e.createOscillator();return r.type=t,r.frequency.setValueAtTime(_,e.currentTime),r}function em(e){var _=0,t=new Set,r=0;return e.bricks.forEach(function(e){if(e){if("black"===e){r++;return}t.add(e),_++}}),E("unlocks.level_description",{size:e.size,bricks:_,colors:t.size,bombs:r})}function eg(e){var _;return e&&(null===(_=Object.values(e))||void 0===_?void 0:_.reduce(function(e,_){return e+_},0))||0}var eh=function(e){var _={};return e.forEach(function(e){return _[e.id]=0}),_};function eb(e,_){return e.offsetX+(_%e.gridSize+.5)*e.brickWidth}function ev(e,_){return(Math.floor(_/e.gridSize)+.5)*e.brickWidth}function ef(e,_,t){return _<0||t<0||_>=e.gridSize||t>=e.gridSize?-1:_*e.gridSize+t}function ey(e){return e_.filter(function(_){return e.totalScoreAtRunStart>=_.threshold}).filter(function(_){return!(null==_?void 0:_.requires)||e.perks[null==_?void 0:_.requires]})}function ek(e){return"creative"===e.mode?3:Math.max(7+e.perks.extra_levels-e.loop,1)}function eW(e){var _=ey(e).map(function(_){for(var t=Math.max(0,_.max-e.bannedPerks[_.id]),r=[],n=0;n'):n'):r.push('');var a=e.perks[_.id]&&1||!t&&2||3;return{state:a,html:'\n \n ').concat(_.icon,"\n
\n ").concat(_.name,"\n ").concat(_.help(Math.max(1,e.perks[_.id])),"\n
\n ").concat(r.reverse().join(""),"\n
\n ")}}).sort(function(e,_){return e.state-_.state}).map(function(e){return e.html});return" ".concat(E("score_panel.upgrades_picked"),"
")+_.join("")}function ew(e){if(!e.perks.clairvoyant||"creative"===e.mode)return"";for(var _="",t=0;t').concat($[e.runLevels[t].name],"");return"".concat(E("score_panel.upcoming_levels"),"
").concat(_,"
")}function ex(e){return e.level}function eS(e){return -1!==e.bricks.indexOf(e.ballsColor)}function ez(e){if(!e.perks.reach)return -1;for(var _=e.level.size,t=-1,r=-1,n=-1,a=0;a<_;a++)for(var s=0;s<_;s++)e.bricks[s+a*_]&&(-1==t&&(t=a),r0}function eq(e,_){return Math.pow(e.x-_.x,2)+Math.pow(e.y-_.y,2)}function eP(e,_){return Math.sqrt(eq(e,_))}function eH(e){return!!(e.lastPuckMove&&e.perks.passive_income&&e.lastPuckMove>e.levelTime-250*e.perks.passive_income)}function eR(e){try{var _=parseInt(localStorage.getItem("breakout-3-hs-"+e)||"0");if(_)return E("main_menu.high_score",{score:_})}catch(e){}return""}var eL={};if(eL=b("kqXj6").getBundleURL("1foiJ")+"sw-b71.0327fc94.js","serviceWorker"in navigator&&window.location.href.endsWith("/index.html?isPWA=true")){var eO=new URL(eL);navigator.serviceWorker.register(eO)}var f=b("5mG9B"),S=b("6QuVk"),eB=document.getElementById("game"),eC=eB.getContext("2d",{alpha:!1}),eT=document.createElement("img");eT.src="data:image/svg+xml;base64,"+btoa(''),eT.onload=function(){return _6.needsRender=!0};var eA=document.createElement("img");eA.onload=function(){return _6.needsRender=!0};var eE=document.createElement("canvas");function ej(e,_,t,r,n,a,s){var o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1;e.globalAlpha=o,t&&("red"==t?(e.strokeStyle="red",e.lineDashOffset=e$(_),e.lineWidth=2,e.setLineDash(eQ)):(e.strokeStyle="white",e.lineWidth=1),e.beginPath(),e.moveTo(r,n),e.lineTo(a,s),e.stroke(),"red"==t&&(e.setLineDash(eK),e.lineWidth=1),e.globalAlpha=1)}var eD=document.createElement("canvas"),eV="",eZ={};function eI(e,_,t,r,n){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",s="ball"+_+"_"+t+"_"+a,o=Math.round(t);if(!eZ[s]){var l=document.createElement("canvas");l.width=o,l.height=o;var i=l.getContext("2d");i.beginPath(),i.arc(o/2,o/2,Math.round(o/2)-1,0,2*Math.PI),i.fillStyle=_,i.fill(),a&&(i.lineWidth=2,i.strokeStyle=a,i.stroke()),eZ[s]=l}e.drawImage(eZ[s],Math.round(r-o/2),Math.round(n-o/2))}function eF(e,_,t,r,n,a,s){var o=(Math.round(s/Math.PI*64)%32+32)%32,l="coin with halo_"+_+"_"+t+"_"+a+"_"+("gold"===_?o:"whatever");if(!eZ[l]){var i=document.createElement("canvas");i.width=t,i.height=t;var u=i.getContext("2d");u.beginPath(),u.arc(t/2,t/2,t/2,0,2*Math.PI),u.fillStyle=_,u.fill(),u.strokeStyle=a,"red"==a&&(u.lineWidth=2,u.setLineDash(eQ)),u.stroke(),"gold"===_&&(u.beginPath(),u.arc(t/2,t/2,t/2*.6,0,2*Math.PI),u.fillStyle="rgba(255,255,255,0.5)",u.fill(),u.translate(t/2,t/2),u.rotate(o/16),u.translate(-t/2,-t/2),u.globalCompositeOperation="multiply",eU(u,"$",_,t-2,t/2,t/2+1),eU(u,"$",_,t-2,t/2,t/2+1)),eZ[l]=i}e.drawImage(eZ[l],Math.round(r-t/2),Math.round(n-t/2))}function eN(e,_,t,r,n){var a="fuzzy-circle"+_+"_"+t,s=Math.round(3*t);if(!eZ[a]){var o=document.createElement("canvas");o.width=s,o.height=s;var l=o.getContext("2d"),i=l.createRadialGradient(s/2,s/2,0,s/2,s/2,s/2);i.addColorStop(0,_),i.addColorStop(1,"transparent"),l.fillStyle=i,l.fillRect(0,0,s,s),eZ[a]=o}e.drawImage(eZ[a],Math.round(r-s/2),Math.round(n-s/2))}function eX(e,_,t,r){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,s=Math.ceil(t-_6.brickWidth/2),o=Math.ceil(r-_6.brickWidth/2),l=Math.ceil(t+_6.brickWidth/2)-1,i=Math.ceil(r+_6.brickWidth/2)-1,u=l-s,c=i-o,p="brick"+_+"__"+u+"_"+c+"_"+n+"_"+a;if(!eZ[p]){var d,m,g,h,b,v,f=document.createElement("canvas");f.width=u,f.height=c;var y=f.getContext("2d");y.fillStyle=_,y.setLineDash(-1!==n?eQ:eK),y.lineDashOffset=n,y.strokeStyle=-1!==n?"red":_,y.lineJoin="round",y.lineWidth=4,d=y,m=2,g=2,h=u-4,b=c-4,v=2,d.beginPath(),d.moveTo(4,2),d.lineTo(m+h-v,g),d.quadraticCurveTo(m+h,g,m+h,g+v),d.lineTo(m+h,g+b-v),d.quadraticCurveTo(m+h,g+b,m+h-v,g+b),d.lineTo(m+v,g+b),d.quadraticCurveTo(m,g+b,m,g+b-v),d.lineTo(m,g+v),d.quadraticCurveTo(m,g,m+v,g),d.closePath(),a||y.fill(),y.stroke(),eZ[p]=f}e.drawImage(eZ[p],s,o,u,c)}function eU(e,_,t,r,n,a){var s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],o="text"+_+"_"+t+"_"+r+"_"+s;if(!eZ[o]){var l=document.createElement("canvas");l.width=r*_.length,l.height=r;var i=l.getContext("2d");i.fillStyle=t,i.textAlign=s?"left":"center",i.textBaseline="middle",i.font=r+"px monospace",i.fillText(_,s?0:l.width/2,l.height/2,l.width),eZ[o]=l}e.drawImage(eZ[o],s?n:Math.round(n-eZ[o].width/2),Math.round(a-eZ[o].height/2))}var eY=document.getElementById("score"),eJ=document.getElementById("menuLabel"),eK=[],eQ=[5,5];function e$(e){return er("basic")?0:Math.floor(e.levelTime%500/500*10)%10}var f=b("5mG9B"),S=b("6QuVk");function e0(){er("record")&&(null==o?void 0:o.state)==="recording"&&(null==o||o.pause())}function e1(){er("record")&&o&&(null==o||o.stop(),o=null)}var f=b("5mG9B"),S=b("6QuVk"),e2=0,e4=null,e5=document.getElementById("popup"),e3=document.getElementById("close-modale");e3.addEventListener("click",function(e){e.preventDefault(),e4&&e4()}),e3.title=E("play.close_modale_window_tooltip");var e6=-1;function e7(e){return e8(W(k({},e),{allowClose:!1}))}function e8(e){return e9.apply(this,arguments)}function e9(){return(e9=(0,f._)(function(e){var _,t,r,n,a,s,o;return(0,S.__generator)(this,function(l){return _=e.title,r=void 0===(t=e.content)?[]:t,a=void 0===(n=e.allowClose)||n,o=void 0!==(s=e.actionsAsGrid)&&s,_e(1),[2,new Promise(function(e){var t,n=function(_){l||(l=!0,Array.prototype.forEach.call(s.querySelectorAll("button:not([disabled])"),function(e){return e.disabled=!0}),document.body.style.minHeight=document.body.scrollHeight+"px",setTimeout(function(){return document.body.style.minHeight=""},0),s.remove(),e(_))};e5.className=o?" actionsAsGrid":"",e3.style.display=a?"":"none";var s=document.createElement("div"),l=!1;if(e4=a?function(){n(void 0)}:null,_){var i=document.createElement("h2");i.innerHTML=_,s.appendChild(i)}null==r||r.filter(function(e){return e}).forEach(function(e,_){if(e){if("string"==typeof e){var t,r,a=document.createElement("div");a.innerHTML=e,s.appendChild(a);return}(null===(t=s.lastChild)||void 0===t?void 0:t.nodeName)=="SECTION"?r=s.lastChild:((r=document.createElement("section")).className="actions",s.appendChild(r));var o=e.text,l=e.value,i=e.help,u=e.disabled,c=e.className,p=e.icon,d=e.tooltip,m=document.createElement("button");m.innerHTML="\n".concat(void 0===p?"":p,"\n\n ").concat(o,"\n ").concat(i||"","\n
"),d&&m.setAttribute("data-tooltip",d),u?m.setAttribute("disabled","disabled"):m.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),n(l),e6=_}),m.className=(void 0===c?"":c)+(e6===_?" needs-focus":""),r.appendChild(m)}}),e5.appendChild(s),null===(t=e5.querySelector("section.actions > button.needs-focus"))||void 0===t||t.focus(),e6=-1}).then(function(e){return _e(-1),e4=null,e},function(){e4=null,_e(-1)})]})})).apply(this,arguments)}function _e(e){(e2+=e)>1&&alert("Two alerts where opened at once"),document.body.classList[e2?"add":"remove"]("has-alert-open")}function __(e,_){if(_6.running&&!_6.isGameOver){_6.isGameOver=!0,_T(!0),e1(),function(e){try{localStorage.setItem("breakout_71_total_play_time",JSON.stringify(JSON.parse(localStorage.getItem("breakout_71_total_play_time")||"0")+e))}catch(e){}}(_6.runStatistics.runTime),_6.runStatistics.max_level=_6.currentLevel+1;var t,r,n=-300,a=function(){return"animation-delay:"+(n+=800)+"ms;"},s="",o=O(),l=o-_6.score,i=(t=[],e_.forEach(function(e){e.threshold&&t.push({threshold:e.threshold,title:e.name+" "+E("level_up.unlocked_perk")})}),ee.forEach(function(e){t.push({threshold:e.threshold,title:e.name+" "+E("level_up.unlocked_level")})}),t.filter(function(e){return e.threshold}).sort(function(e,_){return e.threshold-_.threshold}));i.filter(function(e){return e.threshold>l&&e.threshold\n '.concat(e.title,'\n \n
\n')});var u=(null===(r=function(e,_){for(var t=e.length;--t;)if(_(e[t],t,e))return e[t]}(i,function(e){return e.threshold<=o}))||void 0===r?void 0:r.threshold)||0,c=i.find(function(e){return e.threshold>o});if(c){var p=(null==c?void 0:c.threshold)-u,d=o-u;_+=E("gameOver.next_unlock",{points:c.threshold-o});var m=(d/p).toFixed(2);s+='\n \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 g=i.filter(function(e){return e.threshold>l&&e.threshold".concat(E("gameOver.unlocked_count",{count:g.length})," ").concat(g.map(function(e){return e.title}).join(", "),"")),_6.combo=1,e8({allowClose:!0,title:e,content:["\n ".concat(_,"
\n ").concat(E("gameOver.cumulative_total",{startTs:l,endTs:o}),"
\n ").concat(s," \n "),{value:null,text:E("gameOver.restart"),help:""},' \n '.concat(eW(_6),"\n ").concat(function(e){var _="";try{var t=JSON.parse(localStorage.getItem("breakout_71_runs_history")||"[]");t.sort(function(e,_){return e.score-_.score}).reverse(),(t=t.slice(0,100)).push(W(k({},e.runStatistics),{perks:e.perks,mode:e.mode,appVersion:Q})),localStorage.setItem("breakout_71_runs_history",JSON.stringify(t,null,2));var r=function(_,r,n){var a,s,o,l=t.filter(function(_){return(_.mode||"short")===e.mode}).map(function(e){return r(e)||0}),i=(a=Math).min.apply(a,x(l)),u=(s=Math).max.apply(s,x(l));if(i===u)return"";u-i<10&&(i=Math.max(0,u-10),u=Math.max(u,i+10));var c=Math.min(l.length,10);if(c<3)return"";for(var p=[],d=[],m=0;m1?"s":""," between ").concat(Math.floor(i+_*g)," and ").concat(Math.floor(i+(_+1)*g)).concat(n,'"\n >').concat(!e&&" "||_==f&&v+n||Math.round(d[_]/e)+n,"")}).join("");return''.concat(_," : ").concat(v).concat(n,'
\n ').concat(y,"
\n ")};_+=r(E("gameOver.stats.total_score"),function(e){return e.score},""),_+=r(E("gameOver.stats.catch_rate"),function(e){return Math.round(e.score/e.coins_spawned*100)},"%"),_+=r(E("gameOver.stats.bricks_broken"),function(e){return e.bricks_broken},""),_+=r(E("gameOver.stats.bricks_per_minute"),function(e){return Math.round(e.bricks_broken/e.runTime*6e4)},""),_+=r(E("gameOver.stats.hit_rate"),function(e){return Math.round((1-e.misses/e.puck_bounces)*100)},"%"),_+=r(E("gameOver.stats.duration_per_level"),function(e){return Math.round(e.runTime/1e3/e.levelsPlayed)},"s"),_+=r(E("gameOver.stats.level_reached"),function(e){return e.levelsPlayed},""),_+=r(E("gameOver.stats.upgrades_applied"),function(e){return e.upgrades_picked},""),_+=r(E("gameOver.stats.balls_lost"),function(e){return e.balls_lost},""),_+=r(E("gameOver.stats.combo_avg"),function(e){return Math.round(e.coins_spawned/e.bricks_broken)},""),_+=r(E("gameOver.stats.combo_max"),function(e){return e.max_combo},""),(_+=r(E("gameOver.stats.loops"),function(e){return e.loops},""))&&(_="".concat(E("gameOver.stats.intro",{count:t.length-1}),"
")+_)}catch(e){console.warn(e)}return _}(_6)," \n ")]}).then(function(){return _7({levelToAvoid:ex(_6).name,mode:_6.mode})})}}function _t(e,_){var t=(null==_?void 0:_.level)?ee.filter(function(e){return e.name===(null==_?void 0:_.level)}):[],r=ee.filter(function(_){return e>=_.threshold}).filter(function(e){return e.name!==(null==_?void 0:_.level)}).filter(function(e){return e.name!==(null==_?void 0:_.levelToAvoid)}).sort(function(){return Math.random()-.5});return t.concat(r.slice(0,10).sort(function(e,_){return e.sortKey-_.sortKey}))}function _r(e){var _=O(),t=_t(_,e),r=k({},eh(e_),(null==e?void 0:e.perks)||{}),n=W(k({runLevels:t,level:t[0],currentLevel:0,upgradesOfferedFor:-1,perks:r,bannedPerks:eh(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:_,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(_s(n),!eg(n.perks)){var a=ey(n).filter(function(e){return e.giftable}),s=er("easy")&&"slow_down"||a[Math.floor(Math.random()*a.length)].id;r[s]=1,_g(n,s)}var o=!0,l=!1,i=void 0;try{for(var u,c=e_[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var p=u.value;n.perks[p.id]&&_g(n,p.id)}}catch(e){l=!0,i=e}finally{try{o||null==c.return||c.return()}finally{if(l)throw i}}return n}var f=b("5mG9B"),S=b("6QuVk");function _n(){return(_n=(0,f._)(function(e,_){var t,r,n;return(0,S.__generator)(this,function(a){switch(a.label){case 0:e.readyToRender=!1,t=R("creativeModePerks_"+_,{}),e_.forEach(function(_){t[_.id]=Math.min(t[_.id]||0,_.max-e.bannedPerks[_.id])}),n=["extra_levels","shunt","one_more_choice","instant_upgrade"],a.label=1;case 1:return[4,e7({title:E("lab.title",{lvl:_+1}),actionsAsGrid:!0,content:[E("lab.instructions"),{value:"reset",text:E("lab.reset"),disabled:!eg(t)}].concat(x(e_.filter(function(e){return!n.includes(e.id)}).map(function(_){return{icon:_.icon,text:_.name,help:(t[_.id]||0)+"/"+(_.max-e.bannedPerks[_.id]),value:_,disabled:_.max-e.bannedPerks[_.id]<=0,className:t[_.id]?"sandbox":"sandbox grey-out-unless-hovered",tooltip:_.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=a.sent()))return[3,3];if("reset"===r)e_.forEach(function(e){t[e.id]=0});else{if("bricks"in r)return L("creativeModePerks_"+_,t),e_.forEach(function(_){e.perks[_.id]=t[_.id],e.bannedPerks[_.id]+=t[_.id]}),e.runLevels[_]=r,[3,3];r&&(t[r.id]=((t[r.id]||0)+1)%(r.max-e.bannedPerks[r.id]+1))}return[3,1];case 3:return[2]}})})).apply(this,arguments)}function _a(e,_){e.puckPosition=_,e.needsRender=!0}function _s(e){_o(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 n=(t=Math).max.apply(t,x(Object.keys(r).map(function(e){return r[e]})));return(_=Object.keys(r).filter(function(e){return r[e]==n}))[Math.floor(_.length*Math.random())]}(e.bricks.filter(function(e){return e}))||"#FFF");for(var n=0;n.5?e.baseSpeed:-e.baseSpeed);e.balls.push({x:a,previousX:a,y:e.gameZoneHeight-1.5*e.ballSize,previousY:e.gameZoneHeight-1.5*e.ballSize,vx:s,previousVX:s,vy:-e.baseSpeed,previousVY:-e.baseSpeed,piercePoints:3*e.perks.pierce,hitSinceBounce:0,brokenSinceBounce:0,sapperUses:0})}e.ballStickToPuck=!0}function _o(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 _=e.levelTime?e.perks.corner_shot:0,t=e.offsetXRoundedDown+e.puckWidth/2-e.puckWidth*_,r=e.offsetXRoundedDown+e.gameZoneWidthRoundedUp-e.puckWidth/2+e.puckWidth*_;e.puckPosition=j(e.puckPosition,t,r),e.ballStickToPuck&&function(e){var _=e.balls.length,t=e.puckWidth/(_+1);e.balls.forEach(function(_,r){var n=e.puckPosition-e.puckWidth/2+t*(r+1);_.x=n,_.previousX=n,_.y=e.gameZoneHeight-1.5*e.ballSize,_.previousY=_.y,_.hitSinceBounce=0,_.brokenSinceBounce=0,_.piercePoints=3*e.perks.pierce})}(e),Math.abs(e.lastPuckPosition-e.puckPosition)>1&&e.running&&(e.lastPuckMove=e.levelTime),e.lastPuckPosition=e.puckPosition}function _l(e){return e.baseCombo+3*e.perks.base_combo+5*e.perks.smaller_puck}function _i(e,_,t){var r=e.combo;e.combo=_l(e),r>e.combo&&e.perks.soft_reset&&(e.combo+=Math.floor((r-e.combo)*D(e.perks.soft_reset)));var n=Math.max(0,r-e.combo);if(n){for(var a=0;aC()&&(_=1);for(var a=0;a<_;a++)_x(e,t+(Math.random()-.5)*e.brickWidth/2,r+(Math.random()-.5)*e.brickWidth/2,(Math.random()-.5)*30,(Math.random()-.5)*30,n,!1)}}function _d(e,_,t,r,n){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=1+e.perks.bigger_explosions+Math.max(0,e.perks.implosions-1)+a;if(_h(e,"explode",n.x,1),-1!==_)for(var o=_%e.gridSize,l=Math.floor(_/e.gridSize),i=-s;i<=s;i++)for(var u=-s;u<=s;u++){var c=ef(e,l+u,o+i);e.bricks[c]&&-1!==c&&(e.brickHP[c]--,e.brickHP[c]<=0&&_m(e,c,n,!0))}var p=e.perks.implosions?-1:1;_P(e.coins,function(_){var n=_.x-t,a=_.y-r,o=Math.max(e.brickWidth,Math.abs(n)+Math.abs(a));_.vx+=n/o*10*s/_.weight*p,_.vy+=a/o*10*s/_.weight*p}),e.lastExplosion=Date.now(),e.perks.implosions?function(e,_,t,r,n){if(!er("basic")){_G(e.particles)>C()&&(_=1);for(var a=0;a<_;a++){var s=(Math.random()-.5)*e.brickWidth/2,o=(Math.random()-.5)*e.brickWidth/2;_x(e,t-10*s,r-10*o,s,o,n,!1)}}}(e,7*s,t,r,"white"):_p(e,7*s,t,r,"white"),e.runStatistics.bricks_broken++,e.perks.zen&&_i(e,t,r)}function _m(e,_,t,r){var n=e.bricks[_];if(n){var a=e.perks.picky_eater&&eS(e),s=ez(e);if(e.lastBrickBroken=e.levelTime,"black"===n){var o=eb(e,_),l=ev(e,_);_y(e,_,""),_d(e,_,o,l,t,0)}else if(n){var i=eb(e,_),u=ev(e,_);_y(e,_,"");var c=e.combo;e.perks.sturdy_bricks&&(c+=Math.ceil((2+e.perks.sturdy_bricks)/2*c)),e.levelSpawnedCoins+=c,e.runStatistics.coins_spawned+=c,e.runStatistics.bricks_broken++;for(var p=B()*(er("basic")?.5:1),d=Math.max(1,Math.ceil(c/(_G(e.coins)>B()?1:Math.floor(p-_G(e.coins))/3)));c>0;){var m=Math.min(d,c);(m<0||isNaN(m))&&console.error({points:m}),c-=m;var g=i+(Math.random()-.5)*(e.brickWidth-e.coinSize),h=u+(Math.random()-.5)*(e.brickWidth-e.coinSize);!function(e,_,t,r,n){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"gold",s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,o=.8+.2*Math.random()+Math.min(2,.01*s);o*=5/(5+e.perks.etherealcoins),_z(e.coins,function(l){l.x=_,l.y=t,l.collidedLastFrame=!0,l.size=e.coinSize,l.previousX=_,l.previousY=t,l.vx=r,l.vy=n,l.color=a,l.a=Math.random()*Math.PI*2,l.sa=Math.random()-.5,l.points=s,l.weight=o,l.metamorphosisPoints=e.perks.metamorphosis})}(e,g,h,t.previousVX*(.5+Math.random()),t.previousVY*(.5+Math.random()),e.perks.metamorphosis||er("colorful_coins")?n:"gold",m)}if(_u(e,e.perks.streak_shots+e.perks.compound_interest+e.perks.left_is_lava+e.perks.right_is_lava+e.perks.top_is_lava+e.perks.picky_eater+3*e.perks.asceticism+e.perks.zen+e.perks.passive_income+e.perks.addiction+e.perks.unbounded,t.x,t.y),e.perks.side_kick&&(Math.abs(t.vx)>Math.abs(t.vy)?_u(e,e.perks.side_kick,t.x,t.y):_c(e,e.perks.side_kick,t.x,t.y)),-1!==s){if(Math.floor(_/e.level.size)===s)_i(e,i,u);else for(var b=0;b=_)return[2,console.warn("Extra upgrade request ignored ")];if(e.upgradesOfferedFor=_,_T(!1),e1(),s=e.score-e.levelStartScore,(-1===(o=e.runStatistics).best_level_score||o.best_level_scores)&&(o.worst_level_score=s),"creative"!==e.mode)return[3,2];return[4,function(e,_){return _n.apply(this,arguments)}(e,_)];case 1:return a.sent(),[3,4];case 2:if(!(_>0))return[3,4];return[4,function(e){return _E.apply(this,arguments)}(e)];case 3:a.sent(),a.label=4;case 4:for(e.currentLevel=_,e.level=e.runLevels[_],e.levelTime=0,e.winAt=0,e.levelWallBounces=0,e.lastPuckMove=0,e.autoCleanUses=0,e.lastTickDown=e.levelTime,e.levelStartScore=e.score,e.levelSpawnedCoins=0,e.levelLostCoins=0,e.levelMisses=0,e.lastBrickBroken=0,e.runStatistics.levelsPlayed++,t=e.combo,e.combo=_l(e),e.perks.shunt&&(e.combo+=Math.round(Math.max(0,(t-e.combo)*D(e.perks.shunt)))),e.combo+=30*e.perks.hot_start,(r=ex(e)).size!==e.gridSize&&(e.gridSize=r.size,_A()),e.levelLostCoins+=_q(e.coins),_q(e.particles),_q(e.lights),_q(e.texts),_q(e.respawns),e.bricks=[],n=0;ns)){var o=(_.x-t.x)/a,l=(_.y-t.y)/a,i=-r*(s-a)/(1.2*s)/3*Math.min(500,e.levelTime)/500;n&&void 0!==t.vx&&void 0!==t.vy&&(t.vx+=o*i,t.vy+=l*i),_.vx-=o*i,_.vy-=l*i,_x(e,_.x,_.y,-(10*o)+_.vx+(Math.random()-.5)*2,-(10*l)+_.vy+(Math.random()-.5)*2,_k(),!0,e.coinSize/2,100),n&&void 0!==t.vx&&void 0!==t.vy&&_x(e,t.x,t.y,10*o+t.vx+(Math.random()-.5)*2,10*l+t.vy+(Math.random()-.5)*2,_k(),!0,e.coinSize/2,100)}}function _w(e,_,t,r){if(!_.destroyed){_.previousX=_.x,_.previousY=_.y,_.x+=_.vx*r,_.y+=_.vy*r,e.perks.wind&&(_.vx+=(e.puckPosition-(e.offsetX+e.gameZoneWidth/2))/e.gameZoneWidth*e.perks.wind*.5);var n=0,a=0;return _.xe.canvasWidth-e.offsetXRoundedDown-t&&!e.perks.unbounded&&(_.x=e.canvasWidth-e.offsetXRoundedDown-t-(_.x-(e.canvasWidth-e.offsetXRoundedDown-t)),_.vx*=-1,a=1),a+2*n}}function _x(e,_,t,r,n,a){var s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:8,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:150;_z(e.particles,function(i){i.time=e.levelTime,i.x=_,i.y=t,i.vx=r,i.vy=n,i.color=a,i.size=o,i.duration=l,i.ethereal=s})}function _S(e,_,t,r,n){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:20,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:500;_z(e.texts,function(o){o.time=e.levelTime,o.x=_,o.y=t,o.color=r,o.size=a,o.duration=j(s,400,2e3),o.text=n})}function _z(e,_){for(;e.list[e.indexMin]&&!e.list[e.indexMin].destroyed&&e.indexMin0&&void 0!==arguments[0]?arguments[0]:"webm";return"breakout-71-capture-"+new Date().toISOString().replace(/[^0-9\-]+/gi,"-")+"."+e}("webm"),n.target="_blank",!window.location.href.endsWith("index.html?isInWebView=true"))return[3,5];return[4,(s=_,new Promise(function(e,_){var t=new FileReader;t.onload=function(){e(t.result)},t.onerror=function(e){console.error(e),_(Error("Failed to readAsDataURL of the video "))},t.readAsDataURL(s)}))];case 4:return n.href=a.sent(),[3,6];case 5:n.href=r.src,a.label=6;case 6:return n.textContent=E("main_menu.record_download",{size:(_.size/1e6).toFixed(2)}),e.appendChild(n),[2]}})})}}(_6),null===(e=eo())||void 0===e||e.resume(),er("record")&&(null==o?void 0:o.state)==="paused"&&o.resume(),[2]}})})).apply(this,arguments)}function _T(e){if(_6.running&&!_6.pauseTimeout){var _=function(){_6.running=!1,setTimeout(function(){var e;_6.running||null===(e=eo())||void 0===e||e.suspend()},1e3),e0(),_6.pauseTimeout=null,eY.className="",_6.needsRender=!0};e?(_6.pauseUsesDuringRun++,_6.pauseTimeout=setTimeout(_,Math.min(50*Math.max(0,_6.pauseUsesDuringRun-5),500))):_(),document.exitPointerLock&&document.exitPointerLock()}}_O("migrate_high_scores",function(){var e=localStorage.getItem("breakout-3-hs");e&&(localStorage.setItem("breakout-3-hs-short",e),localStorage.removeItem("breakout-3-hs"))}),_O("recover_high_scores",function(){JSON.parse(localStorage.getItem("breakout_71_runs_history")||"[]").forEach(function(e){var _=parseInt(localStorage.getItem("breakout-3-hs-"+(e.mode||"short"))||"0");e.score>_&&localStorage.setItem("breakout-3-hs-"+(e.mode||"short"),""+e.score)})});var _A=function(){var e,_=function(e){e.x=_6.offsetXRoundedDown+(e.x-r)/n*_6.gameZoneWidthRoundedUp,e.y=e.y/a*_6.gameZoneHeight},t=function(e){e.x=_6.offsetXRoundedDown+(e.x-r)/n*_6.gameZoneWidthRoundedUp,e.y=e.y/a*_6.gameZoneHeight,e.previousX=e.x,e.previousY=e.y},r=_6.offsetXRoundedDown,n=_6.gameZoneWidthRoundedUp,a=_6.gameZoneHeight,s=eB.getBoundingClientRect(),o=s.width,l=s.height;_6.canvasWidth=o,_6.canvasHeight=l,eB.width=o,eB.height=l,eC.fillStyle=(null===(e=ex(_6))||void 0===e?void 0:e.color)||"black",eC.globalAlpha=1,eC.fillRect(0,0,o,l),eE.width=o,eE.height=l,_6.gameZoneHeight=er("mobile-mode")?80*l/100:l;var i=Math.round(Math.min(_6.canvasWidth,.73*_6.gameZoneHeight));_6.brickWidth=2*Math.floor(i/_6.gridSize/2),_6.gameZoneWidth=_6.brickWidth*_6.gridSize,_6.offsetX=Math.floor((_6.canvasWidth-_6.gameZoneWidth)/2),_6.offsetXRoundedDown=_6.offsetX,_6.offsetX<_6.ballSize&&(_6.offsetXRoundedDown=0),_6.gameZoneWidthRoundedUp=o-2*_6.offsetXRoundedDown,eE.title="resized",_a(_6,_6.puckPosition),_6.balls.forEach(t),_P(_6.coins,t),_P(_6.particles,_),_P(_6.texts,_),_P(_6.lights,_),_T(!0),document.documentElement.style.setProperty("--vh","".concat(.01*window.innerHeight,"px"))};function _E(){return(_E=(0,f._)(function(e){var _,t,r,n,a,s,o,l,i;return(0,S.__generator)(this,function(u){switch(u.label){case 0:_=(e.score-e.levelStartScore)/(e.levelSpawnedCoins||1),t=1,r="",n="",a="",s="",e.levelWallBounces<3?(t++,e.rerolls++,a=E("level_up.plus_one_upgrade_and_reroll")):e.levelWallBounces<10&&(t++,a=E("level_up.plus_one_upgrade")),e.levelTime<3e4?(t++,e.rerolls++,r=E("level_up.plus_one_upgrade_and_reroll")):e.levelTime<6e4&&(t++,r=E("level_up.plus_one_upgrade")),_>.95?(t++,e.rerolls++,n=E("level_up.plus_one_upgrade_and_reroll")):_>.9&&(t++,n=E("level_up.plus_one_upgrade")),e.levelMisses<3?(t++,e.rerolls++,s=E("level_up.plus_one_upgrade_and_reroll")):e.levelMisses<6&&(t++,s=E("level_up.plus_one_upgrade")),u.label=1;case 1:var c,p;if(!t--||(c=3+e.perks.one_more_choice-e.perks.instant_upgrade,(p=ey(e).map(function(_){return W(k({},_),{score:Math.random()+(e.lastOffered[_.id]||0)})}).sort(function(e,_){return e.score-_.score}).filter(function(_){return e.perks[_.id]<_.max-e.bannedPerks[_.id]}).slice(0,c).sort(function(e,_){return e.id>_.id?1:-1})).forEach(function(_){_g(e,_.id)}),!(o=p.map(function(_){return{text:_.name+(e.perks[_.id]?E("level_up.upgrade_perk_to_level",{level:e.perks[_.id]+1}):""),icon:$["icon:"+_.id],value:_.id,help:_.help(e.perks[_.id]+1)}})).length))return[3,3];return e.rerolls&&o.push({text:E("level_up.reroll",{count:e.rerolls}),help:E("level_up.reroll_help"),value:"reroll",icon:$["icon:reroll"]}),l=r&&n&&s&&a&&E("level_up.compliment_perfect")||(r||n||s||a)&&E("level_up.compliment_good")||E("level_up.compliment_advice"),[4,e7({title:E("level_up.pick_upgrade_title")+(t?" ("+(t+1)+")":""),content:["".concat(E("level_up.before_buttons",{score:e.score-e.levelStartScore,catchGain:n,levelSpawnedCoins:e.levelSpawnedCoins,time:Math.round(e.levelTime/1e3),timeGain:r,levelMisses:e.levelMisses,missesGain:s,levelWallBounces:e.levelWallBounces,wallHitsGain:a,compliment:l}),"\n
\n ").concat(E("level_up.after_buttons",{level:e.currentLevel+1,max:ek(e)}),"
\n ").concat(ew(e),"
\n")].concat(x(o),[eW(e),''])})];case 2:return"reroll"===(i=u.sent())?(t++,e.rerolls--):(e.perks[i]++,"instant_upgrade"===i&&(t+=2),e.runStatistics.upgrades_picked++),[3,1];case 3:return[2]}})})).apply(this,arguments)}function _j(e,_){return ef(_6,Math.floor(_/_6.brickWidth),Math.floor((e-_6.offsetX)/_6.brickWidth))}function _D(e){if(_6.bricks[e])return e}function _V(e,_,t){var r,n,a;return null!==(a=null!==(n=null!==(r=_D(_j(e-t,_-t)))&&void 0!==r?r:_D(_j(e+t,_-t)))&&void 0!==n?n:_D(_j(e+t,_+t)))&&void 0!==a?a:_D(_j(e-t,_+t))}window.addEventListener("resize",_A),window.addEventListener("fullscreenchange",_A),setInterval(function(){var e=eB.getBoundingClientRect(),_=e.width,t=e.height;(_!==_6.canvasWidth||t!==_6.canvasHeight)&&_A()},1e3),eB.addEventListener("mouseup",function(e){0===e.button&&(_6.running?_T(!0):(_B(),er("pointerLock")&&eB.requestPointerLock&&eB.requestPointerLock().then()))}),eB.addEventListener("mousemove",function(e){document.pointerLockElement===eB?_a(_6,_6.puckPosition+e.movementX):_a(_6,e.x)}),eB.addEventListener("touchstart",function(e){var _;e.preventDefault(),(null===(_=e.touches)||void 0===_?void 0:_.length)&&(_a(_6,e.touches[0].pageX),_o(_6),_B())}),eB.addEventListener("touchend",function(e){e.preventDefault(),_T(!0)}),eB.addEventListener("touchcancel",function(e){e.preventDefault(),_T(!0)}),eB.addEventListener("touchmove",function(e){var _;(null===(_=e.touches)||void 0===_?void 0:_.length)&&_a(_6,e.touches[0].pageX)});var _Z=0,_I=60;function _F(){return _N.apply(this,arguments)}function _N(){return(_N=(0,f._)(function(){return(0,S.__generator)(this,function(e){switch(e.label){case 0:return _T(!0),[4,e8({title:_6.loop?E("score_panel.title_looped",{loop:_6.loop,score:_6.score,level:_6.currentLevel+1,max:ek(_6)}):E("score_panel.title",{score:_6.score,level:_6.currentLevel+1,max:ek(_6)}),content:[eW(_6),ew(_6),_6.rerolls?E("score_panel.rerolls_count",{rerolls:_6.rerolls}):""],allowClose:!0})];case 1:return e.sent(),[2]}})})).apply(this,arguments)}setInterval(function(){_I=_Z,_Z=0},1e3),window.addEventListener("visibilitychange",function(){document.hidden&&_T(!0)}),eY.addEventListener("click",function(e){e.preventDefault(),e2||_F()}),document.addEventListener("visibilitychange",function(){document.hidden&&_T(!0)}),document.getElementById("menu").addEventListener("click",function(e){e.preventDefault(),e2||_U()});var _X=(p=Math).max.apply(p,x(e_.map(function(e){return e.threshold})));function _U(){return _Y.apply(this,arguments)}function _Y(){return(_Y=(0,f._)(function(){var e,_;return(0,S.__generator)(this,function(t){switch(t.label){case 0:return _T(!0),e=[{icon:$["icon:7_levels_run"],text:E("main_menu.normal"),help:eR("short")||E("main_menu.normal_help"),value:function(){_7({levelToAvoid:ex(_6).name,mode:"short"})}},{icon:$["icon:loop"],text:E("main_menu.loop_run"),help:eR("long")||O()<_X&&E("lab.unlocks_at",{score:_X})||E("main_menu.loop_run_help"),value:function(){_7({levelToAvoid:ex(_6).name,mode:"long"})},disabled:O()<_X},{icon:$["icon:sandbox"],text:E("lab.menu_entry"),help:eR("creative")||O()<_X&&E("lab.unlocks_at",{score:_X})||E("lab.help"),disabled:O()<_X,value:function(){return(0,f._)(function(){return(0,S.__generator)(this,function(e){switch(e.label){case 0:return[4,_1(_6)];case 1:return e.sent()&&_7({mode:"creative"}),[2]}})})()}},{icon:$["icon:unlocks"],text:E("main_menu.unlocks"),help:E("main_menu.unlocks_help"),value:function(){(function(){_0.apply(this,arguments)})()}}].concat(x(function(e){if(!er("donation_reminder"))return[];var _=V();return[{text:E("main_menu.donate",{hours:_}),help:E("main_menu.donate_help",{suggestion:Math.min(20,Math.max(1,.2*_)).toFixed(0)}),icon:$["icon:premium"],value:function(){window.open("https://paypal.me/renanlecaro","_blank")}}]}(0)),[{text:E("main_menu.settings_title"),help:E("main_menu.settings_help"),icon:$["icon:settings"],value:function(){_J()}},{icon:$["icon:help"],text:E("main_menu.help_title"),help:E("main_menu.help_help"),value:function(){return(0,f._)(function(){return(0,S.__generator)(this,function(e){switch(e.label){case 0:return[4,e8({title:E("main_menu.help_title"),allowClose:!0,content:[Z(E("main_menu.help_content")),E("main_menu.help_upgrades")].concat(x(e_.map(function(e){return'\n\n '.concat(e.icon,"\n
\n ").concat(e.name,"
\n ").concat(e.help(1),"\n
\n
\n \n ").concat(Z(e.fullHelp),"\n")})),[Z(E("main_menu.credits")),E("main_menu.credit_levels")],x(ee.filter(function(e){var _;return null===(_=e.credit)||void 0===_?void 0:_.startsWith("http")}).map(function(e){return'\n")})))})];case 1:return e.sent(),[2]}})})()}}]),[4,e8({title:E("main_menu.title"),content:x(e).concat([E("main_menu.footer_html",{appVersion:Q})]),allowClose:!0})];case 1:return(_=t.sent())&&(_(),_6.needsRender=!0),[2]}})})).apply(this,arguments)}function _J(){return _K.apply(this,arguments)}function _K(){return(_K=(0,f._)(function(){var e,_,t,r,n,a,s,o,l,i;return(0,S.__generator)(this,function(u){switch(u.label){case 0:_T(!0),_=[{icon:$["icon:starting_perks"],text:E("main_menu.starting_perks"),help:E("main_menu.starting_perks_help"),value:function(){return(0,f._)(function(){return(0,S.__generator)(this,function(e){switch(e.label){case 0:return[4,_R()];case 1:return e.sent(),[2]}})})()}}],t=[{text:"English",value:"en",icon:$.UK},{text:"Français",value:"fr",icon:$.France}],_.push({icon:null===(e=t.find(function(e){return e.value===A()}))||void 0===e?void 0:e.icon,text:E("main_menu.language"),help:E("main_menu.language_help"),value:function(){return(0,f._)(function(){var e,_;return(0,S.__generator)(this,function(r){switch(r.label){case 0:return[4,e8({title:E("main_menu.language"),content:[E("main_menu.language_help")].concat(x(t)),allowClose:!0})];case 1:if(!(_=(e=r.sent())&&e!==A()))return[3,3];return[4,_1(_6)];case 2:_=r.sent(),r.label=3;case 3:return _&&(L("lang",e),window.location.reload()),[2]}})})()}}),r=!0,n=!1,a=void 0;try{for(s=function(){var e=l.value;et[e]&&_.push({icon:er(e)?$["icon:checkmark_checked"]:$["icon:checkmark_unchecked"],text:et[e].name,help:et[e].help,value:function(){en(e),_A(),_Q(),_J()}})},o=Object.keys(et)[Symbol.iterator]();!(r=(l=o.next()).done);r=!0)s()}catch(e){n=!0,a=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw a}}return _.push({icon:$["icon:download"],text:E("main_menu.download_save_file"),help:E("main_menu.download_save_file_help"),value:function(){return(0,f._)(function(){var e,_,t,r,n,a;return(0,S.__generator)(this,function(s){for(_=0,e={};_Q)throw Error("Please update your app first, this file is for version "+s+" or newer.");if(l!==X("Security by obscurity, but really the game is oss so eh"+o))throw Error("Key does not match content.");for(var c in i=JSON.parse(o),localStorage.clear(),i)localStorage.setItem(c,i[c]);return[4,e8({title:E("main_menu.save_file_loaded"),content:[E("main_menu.save_file_loaded_help"),{text:E("main_menu.save_file_loaded_ok")}]})];case 2:e.sent(),window.location.reload(),e.label=3;case 3:return[3,6];case 4:return u=e.sent(),[4,e8({title:E("main_menu.save_file_error"),content:[u.message,{text:E("main_menu.save_file_loaded_ok")}]})];case 5:return e.sent(),[3,6];case 6:return _.value="",[2]}})}),function(e){return r.apply(this,arguments)})),document.body.appendChild(_)}return null===(e=document.getElementById("save_file_picker"))||void 0===e||e.click(),[2]})})()}}),_.push({icon:$["icon:coins"],text:E("main_menu.max_coins",{max:B()}),help:E("main_menu.max_coins_help"),value:function(){return(0,f._)(function(){return(0,S.__generator)(this,function(e){switch(e.label){case 0:return L("max_coins",(R("max_coins",1)+1)%6),[4,_J()];case 1:return e.sent(),[2]}})})()}}),_.push({icon:$["icon:particles"],text:E("main_menu.max_particles",{max:C()}),help:E("main_menu.max_particles_help"),value:function(){return(0,f._)(function(){return(0,S.__generator)(this,function(e){switch(e.label){case 0:return L("max_particles",(R("max_particles",1)+1)%6),[4,_J()];case 1:return e.sent(),[2]}})})()}}),_.push({icon:$["icon:reset"],text:E("main_menu.reset"),help:E("main_menu.reset_help"),value:function(){return(0,f._)(function(){return(0,S.__generator)(this,function(e){switch(e.label){case 0:return[4,e8({title:E("main_menu.reset"),content:[E("main_menu.reset_instruction"),{text:E("main_menu.reset_confirm"),value:!0},{text:E("main_menu.reset_cancel"),value:!1}],allowClose:!0})];case 1:return e.sent()&&(localStorage.clear(),window.location.reload()),[2]}})})()}}),[4,e8({title:E("main_menu.settings_title"),content:[E("main_menu.settings_help")].concat(x(_)),allowClose:!0})];case 1:return(i=u.sent())&&(i(),_6.needsRender=!0),[2]}})})).apply(this,arguments)}function _Q(){return _$.apply(this,arguments)}function _$(){return(_$=(0,f._)(function(){var e;return(0,S.__generator)(this,function(_){switch(_.label){case 0:if(_.trys.push([0,10,,11]),!(document.fullscreenEnabled||document.webkitFullscreenEnabled))return[2,!1];if(!(null!==document.fullscreenElement&&!er("fullscreen")))return[3,5];if(!document.exitFullscreen)return[3,2];return[4,document.exitFullscreen()];case 1:case 3:case 6:case 8:return _.sent(),[2,!0];case 2:if(!document.webkitCancelFullScreen)return[3,4];return[4,document.webkitCancelFullScreen()];case 4:return[3,9];case 5:if(!(er("fullscreen")&&!document.fullscreenElement))return[3,9];if(!(e=document.documentElement).requestFullscreen)return[3,7];return[4,e.requestFullscreen()];case 7:if(!e.webkitRequestFullscreen)return[3,9];return[4,e.webkitRequestFullscreen()];case 9:return[3,11];case 10:return console.warn(_.sent()),[3,11];case 11:return[2,!1]}})})).apply(this,arguments)}function _0(){return(_0=(0,f._)(function(){var e,_,t,r,n;return(0,S.__generator)(this,function(a){switch(a.label){case 0:return e=O(),_=e_.sort(function(e,_){return e.threshold-_.threshold}).map(function(_){var t=_.name,r=_.id,n=_.threshold,a=_.icon,s=_.help;return{text:t,disabled:e=_.threshold;return{text:_.name,disabled:!t,value:{level:_.name},icon:$[_.name],tooltip:em(_)}}),[4,e8({title:E("unlocks.title",{percentUnlock:r=Math.round(x(_).concat(x(t)).filter(function(e){return!e.disabled}).length/(_.length+t.length)*100)}),content:["".concat(E("unlocks.intro",{ts:e}),"\n ").concat(r<100?E("unlocks.greyed_out_help"):"","
")].concat(x(_),[E("unlocks.level")],x(t)),allowClose:!0,actionsAsGrid:!0})];case 1:if(!(n=a.sent()))return[3,3];return[4,_1(_6)];case 2:a.sent()&&_7(W(k({},n),{mode:"short"})),a.label=3;case 3:return[2]}})})).apply(this,arguments)}function _1(e){return _2.apply(this,arguments)}function _2(){return(_2=(0,f._)(function(e){return(0,S.__generator)(this,function(_){return!e.currentLevel||e2?[2,!0]:[2,e8({title:E("confirmRestart.title"),content:[E("confirmRestart.text"),{value:!0,text:E("confirmRestart.yes")},{value:!1,text:E("confirmRestart.no")}]})]})})).apply(this,arguments)}var _4={ArrowLeft:0,ArrowRight:0,Shift:0};function _5(e,_){_4[e]=_,_6.keyboardPuckSpeed=(_4.ArrowRight-_4.ArrowLeft)*(1+2*_4.Shift)*_6.gameZoneWidth/50}document.addEventListener("keydown",(t=(0,f._)(function(e){return(0,S.__generator)(this,function(_){return"f"!==e.key.toLowerCase()||e.ctrlKey||e.metaKey?e.key in _4&&_5(e.key,1):(en("fullscreen"),_Q())," "!==e.key||e2||(_6.running?_T(!0):_B(),e.preventDefault()),[2]})}),function(e){return t.apply(this,arguments)}));var _3=new Date;document.addEventListener("keyup",(r=(0,f._)(function(e){var _,t,r,n,a;return(0,S.__generator)(this,function(s){switch(s.label){case 0:if(a=document.querySelector("button:focus"),!(e.key in _4))return[3,1];return _5(e.key,0),[3,10];case 1:if("ArrowDown"!==e.key||(null==a?void 0:null===(_=a.nextElementSibling)||void 0===_?void 0:_.tagName)!=="BUTTON")return[3,2];return null==a||null===(t=a.nextElementSibling)||void 0===t||t.focus(),[3,10];case 2:if("ArrowUp"!==e.key||(null==a?void 0:null===(r=a.previousElementSibling)||void 0===r?void 0:r.tagName)!=="BUTTON")return[3,3];return null==a||null===(n=a.previousElementSibling)||void 0===n||n.focus(),[3,10];case 3:if(!("Escape"===e.key&&e4))return[3,4];return e4(),[3,10];case 4:if(!("Escape"===e.key&&_6.running))return[3,5];return _T(!0),[3,10];case 5:if(!("m"===e.key.toLowerCase()&&!e2))return[3,6];return _U().then(),[3,10];case 6:if(!("s"===e.key.toLowerCase()&&!e2))return[3,7];return _F().then(),[3,10];case 7:if(!("r"===e.key.toLowerCase()&&!e2&&_31&&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.lastBrickBrokene.lastTickDown+1e3&&e.perks.hot_start&&(e.lastTickDown=e.levelTime,_c(e,e.perks.hot_start,e.puckPosition,e.gameZoneHeight-2*e.puckHeight)),t<=e.perks.skip_last&&!e.autoCleanUses&&(e.bricks.forEach(function(_,t){_&&_m(e,t,e.balls[0],!0)}),e.autoCleanUses++);var r=_G(e.respawns);if(!e.running||t||r?e.winAt=0:e.winAt||(e.winAt=e.levelTime+5e3),e.running&&e.winAt&&e.levelTime>e.winAt||e.levelTime&&!t&&!_G(e.coins))e.currentLevel+17*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,!e.perks.etherealcoins){var i=e.perks.helium>0&&2*Math.abs(t.x-e.puckPosition)>e.puckWidth+t.size;t.vy+=_*t.weight*.8*(i?-e.perks.helium:1),i&&!er("basic")&&.1>Math.random()&&_x(e,t.x,t.y,0,e.baseSpeed,t.color,!0,5,250)}var u=(Math.abs(t.vx)+Math.abs(t.vy))*10,c=_w(e,t,t.size/2,_);t.y>e.gameZoneHeight-n-e.puckHeight&&t.ye.highScore&&(e.highScore=e.score,localStorage.setItem("breakout-3-hs-"+e.mode,e.score.toString())),er("basic")||_x(e,t.previousX,t.previousY,(e.canvasWidth-t.x)/100,-t.y/100,t.color,!0,e.coinSize/2,100+50*Math.random()),_h(e,"coinCatch",t.x,1),e.runStatistics.score+=t.points,e.perks.asceticism&&_i(e,t.x,t.y),_M(e.coins,r)):t.y>e.canvasHeight+n?(e.levelLostCoins+=t.points,_M(e.coins,r),e.perks.compound_interest&&_i(e,t.x,e.gameZoneHeight-20)):e.perks.unbounded&&(t.x<-e.gameZoneWidth/2||t.x>e.canvasWidth+e.gameZoneWidth/2||t.y<-e.gameZoneWidth)&&(e.levelLostCoins+=t.points,_M(e.coins,r));var p=function(e,_){var t,r,n=_.size/2,a=_.x,s=_.y,o=_.previousX,l=_.previousY,i=_V(o,s,n),u=_V(a,l,n),c=void 0===i&&void 0===u&&_V(a,s,n)||void 0;if(e.perks.ghost_coins)void 0!==(null!==(t=null!=i?i:u)&&void 0!==t?t:c)&&(_.vy*=1-.2/e.perks.ghost_coins,_.vx*=1-.2/e.perks.ghost_coins);else{if(void 0!==i||void 0!==c){_.y=_.previousY,_.vy*=-1;var p=e.bricks[_j(a-n,s+n)],d=e.bricks[_j(a+n,s+n)];p&&!d&&(_.vx+=1,_.sa-=1),!p&&d&&(_.vx-=1,_.sa+=1)}(void 0!==u||void 0!==c)&&(_.x=_.previousX,_.vx*=-1)}return null!==(r=null!=i?i:u)&&void 0!==r?r:c}(e,t);e.perks.metamorphosis&&void 0!==p&&e.bricks[p]&&t.color!==e.bricks[p]&&"black"!==e.bricks[p]&&t.metamorphosisPoints&&(e.bricks[p]=t.color,t.metamorphosisPoints--,_h(e,"colorChange",t.x,.3)),!e.perks.ghost_coins&&void 0!==p||c?(t.vx*=.8,t.vy*=.8,t.sa*=.9,u>20&&!t.collidedLastFrame&&_h(e,"coinBounce",t.x,.2),t.collidedLastFrame=!0,3>Math.abs(t.vy)&&(t.vy=0)):t.collidedLastFrame=!1}),e.balls.forEach(function(t){return function(e,_,t){_.previousVX=_.vx,_.previousVY=_.vy;var r,n=1+e.perks.telekinesis+e.perks.ball_repulse_ball+e.perks.puck_repulse_ball+e.perks.ball_attract_ball;eM(e,_)&&(n+=3,_.vx+=(e.puckPosition-_.x)/1e3*t*e.perks.telekinesis),eG(e,_)&&(n+=3,_.vx+=(e.puckPosition-_.x)/1e3*t*e.perks.yoyo),_.vx*_.vx+_.vy*_.vy0?1:-1)*.02/n);var a=!0,s=!1,o=void 0;if(e.perks.ball_repulse_ball)try{for(var l,i=e.balls[Symbol.iterator]();!(a=(l=i.next()).done);a=!0){var u=l.value;u.x>=_.x||_W(e,_,u,e.perks.ball_repulse_ball,!0)}}catch(e){s=!0,o=e}finally{try{a||null==i.return||i.return()}finally{if(s)throw o}}var c=!0,p=!1,d=void 0;if(e.perks.ball_attract_ball)try{for(var m,g=e.balls[Symbol.iterator]();!(c=(m=g.next()).done);c=!0){var h=m.value;h.x>=_.x||function(e,_,t,r){var n=eP(_,t),a=3*e.gameZoneWidth/4;if(!(ne.offsetX+e.gameZoneWidth/2&&_i(e,_.x,_.y),e.perks.top_is_lava&&b>=2&&_i(e,_.x,_.y+e.ballSize),e.perks.trampoline&&_c(e,e.perks.trampoline,_.x,_.y+e.ballSize),_h(e,"wallBeep",_.x,1),e.levelWallBounces++,e.runStatistics.wall_bounces++);var v=e.gameZoneHeight-e.puckHeight-e.ballSize/2,f=Math.abs(_.x-e.puckPosition)v&&_.vy>0&&(f||e.perks.extra_life&&_.y>v+e.puckHeight/2)){if(f){var y=Math.sqrt(_.vx*_.vx+_.vy*_.vy),k=Math.atan2(-e.puckWidth/2,(_.x-e.puckPosition)*(e.perks.concave_puck?-1/(1+e.perks.concave_puck):1));_.vx=y*Math.cos(k),_.vy=y*Math.sin(k),_h(e,"wallBeep",_.x,1)}else _.vy*=-1,function(e,_,t,r){if(e.perks.extra_life-=1,e.perks.extra_life<0?e.perks.extra_life=0:e.perks.sacrifice&&(e.combo*=e.perks.sacrifice,e.bricks.forEach(function(t,r){return t&&_m(e,r,_,!0)})),_h(e,"lifeLost",_.x,1),!er("basic"))for(var n=0;n<10;n++)_x(e,t,r,Math.random()*e.baseSpeed*3,3*e.baseSpeed,"red",!1,e.coinSize/2,150)}(e,_,_.x,_.y);if(e.perks.streak_shots&&_i(e,_.x,_.y),e.perks.trampoline&&_u(e,e.perks.trampoline,_.x,_.y),e.perks.nbricks&&_.hitSinceBouncee.canvasWidth+e.gameZoneWidth/2,x=e.perks.unbounded>1&&_.y<-e.gameZoneWidth/2;e.running&&(_.y>e.gameZoneHeight+e.ballSize/2||w||x)&&(_.destroyed=!0,e.runStatistics.balls_lost++,e.balls.find(function(e){return!e.destroyed})||__(E("gameOver.lost.title"),E("gameOver.lost.summary",{score:e.score})));var S=e.ballSize/2,z=_.x,M=_.y,G=_.previousX,q=_.previousY,P=_V(G,M,S),H=_V(z,q,S),R=void 0===P&&void 0===H&&_V(z,M,S)||void 0,L=null!==(r=null!=P?P:H)&&void 0!==r?r:R;if(void 0!==L){var O=e.bricks[L];_.hitSinceBounce++,e.perks.nbricks&&(_.hitSinceBounce>e.perks.nbricks?_i(e,_.x,_.y):_u(e,e.perks.nbricks,_.x,_.y));var B=!1,C=1+(e.perks.pierce_color&&(void 0===P||e.bricks[P]===e.ballsColor)&&(void 0===H||e.bricks[H]===e.ballsColor)&&(void 0===R||e.bricks[R]===e.ballsColor)?e.perks.pierce_color:0);e.brickHP[L]-=C;var T=Math.min(_.piercePoints,Math.max(1,e.brickHP[L]+1));e.brickHP[L]-=T,_.piercePoints-=T,e.brickHP[L]<0&&(e.brickHP[L]=0,B=!0),void 0===P&&void 0===R||B||(_.y=_.previousY,_.vy*=-1),void 0===H&&void 0===R||B||(_.x=_.previousX,_.vx*=-1),e.brickHP[L]?(_h(e,"wallBeep",z,1),function(e,_,t,r){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:8,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:150;_z(e.lights,function(s){s.time=e.levelTime,s.x=_,s.y=t,s.color=r,s.size=n,s.duration=a})}(e,eb(e,L),ev(e,L),"white",e.brickWidth+2,50*e.brickHP[L])):(_.brokenSinceBounce++,_m(e,L,_,!1),_.sapperUses0&&!_.hitSinceBounce,V=e.combo-1;if(D||V&&Math.random()>.1/(1+V)||j&&Math.random()>.1/(1+j)||V&&Math.random()>.1/(1+V)){var Z=j&&(Math.random()>.5?"orange":"red")||D&&"red"||e.ballsColor;_x(e,_.x,_.y,e.perks.pierce_color||A?-_.vx+(Math.random()-.5)*e.baseSpeed/3:(Math.random()-.5)*e.baseSpeed,e.perks.pierce_color||A?-_.vy+(Math.random()-.5)*e.baseSpeed/3:(Math.random()-.5)*e.baseSpeed,Z,!0,e.coinSize/2,100)}}}(e,t,_)}),e.perks.shocks&&e.balls.forEach(function(_,t){return e.balls.forEach(function(r,n){if(t.5&&_x(e,e.offsetXRoundedDown+Math.random()*e.gameZoneWidthRoundedUp,Math.random()*e.gameZoneHeight,8*a,0,_k(),!0,e.coinSize/2,150);_P(e.particles,function(t,r){t.x+=t.vx*_,t.y+=t.vy*_,!t.ethereal&&(t.vy+=.5,_D(_j(t.x,t.y))&&_M(e.particles,r))})}if(e.combo>_l(e)&&!er("basic")&&(e.combo-_l(e))*Math.random()>5){if(e.perks.top_is_lava&&_x(e,e.offsetXRoundedDown+Math.random()*e.gameZoneWidthRoundedUp,0,(Math.random()-.5)*10,5,"red",!0,e.coinSize/2,100*(Math.random()+1)),e.perks.left_is_lava&&_x(e,e.offsetXRoundedDown,Math.random()*e.gameZoneHeight,5,(Math.random()-.5)*10,"red",!0,e.coinSize/2,100*(Math.random()+1)),e.perks.right_is_lava&&_x(e,e.offsetXRoundedDown+e.gameZoneWidthRoundedUp,Math.random()*e.gameZoneHeight,-5,(Math.random()-.5)*10,"red",!0,e.coinSize/2,100*(Math.random()+1)),e.perks.compound_interest){var o=e.puckPosition,l=0;do o=e.offsetXRoundedDown+e.gameZoneWidthRoundedUp*Math.random(),l++;while(Math.abs(o-e.puckPosition)_.time)_y(e,_.index,_.color),_M(e.respawns,t);else if(!er("basic")){var r=_.index,n=_.color,a=Math.random()>.5,s=Math.random()>.5?1:-1,o=Math.random()>.5?1:-1;_x(e,eb(e,r)+s*e.brickWidth/2,ev(e,r)+o*e.brickWidth/2,a?0:-s*e.baseSpeed,a?-o*e.baseSpeed:0,n,!0,e.coinSize/2,250)}}),_P(e.particles,function(_,t){e.levelTime>_.time+_.duration&&_M(e.particles,t)}),_P(e.texts,function(_,t){e.levelTime>_.time+_.duration&&_M(e.texts,t)}),_P(e.lights,function(_,t){e.levelTime>_.time+_.duration&&_M(e.lights,t)})}(_6,r)),(_6.running||_6.needsRender)&&(_6.needsRender=!1,function(e){if(e.readyToRender){var _=ex(e),t=e.combo>_l(e),r=eB.width,n=eB.height;if(r&&n){e.currentLevel||e.levelTime?eJ.innerText=e.loop?E("play.current_lvl_loop",{level:e.currentLevel+1,max:ek(e),loop:e.loop}):E("play.current_lvl",{level:e.currentLevel+1,max:ek(e)}):eJ.innerText=E("play.menu_label");var a=e.levelSpawnedCoins?(e.levelSpawnedCoins-e.levelLostCoins)/e.levelSpawnedCoins:1;if(eY.innerHTML=(er("show_fps")?' \n Math.abs(_I-60)&&"good"||"bad",'">\n ').concat(_I," FPS\n / \n \n "):"")+(er("show_stats")?' \n .9&&"good"||"",'" data-tooltip="').concat(E("play.stats.coins_catch_rate"),'">\n ').concat(Math.floor(100*a),'%\n / \n \n ').concat(Math.ceil(e.levelTime/1e3),'s \n / \n \n ').concat(e.levelWallBounces,' B \n / \n \n ').concat(e.levelMisses," M\n / \n "):"")+'$').concat(e.score,""),eY.className=e.lastScoreIncrease>e.levelTime-500?"active":"",er("basic")||_.color||!_.svg)eC.globalAlpha=1,eC.globalCompositeOperation="source-over",eC.fillStyle=_.color||"#000",eC.fillRect(0,0,r,n),_P(e.particles,function(_){var t=_.x,r=_.y,n=_.time,a=_.color,s=_.size,o=_.duration;eC.globalAlpha=Math.min(1,2-(e.levelTime-n)/o*2),eI(eC,a,s,t,r)});else if(eC.globalCompositeOperation="source-over",eC.globalAlpha=1,eC.fillStyle="#000",eC.fillRect(0,0,r,n),eC.globalCompositeOperation="screen",eC.globalAlpha=.6,_P(e.coins,function(_){eN(eC,_.color,2*e.coinSize,_.x,_.y)}),e.balls.forEach(function(_){eN(eC,e.ballsColor,2*e.ballSize,_.x,_.y)}),eC.globalAlpha=.5,e.bricks.forEach(function(_,t){if(_){var r=eb(e,t),n=ev(e,t);eN(eC,"black"==_?"#666":_,e.brickWidth,r,n)}}),eC.globalAlpha=1,_P(e.particles,function(_){var t=_.x,r=_.y,n=_.time,a=_.color,s=_.size,o=_.duration;eC.globalAlpha=Math.min(1,2-(e.levelTime-n)/o*2),eN(eC,a,3*s,t,r)}),eC.globalAlpha=.2,eC.globalCompositeOperation="multiply",eC.fillStyle="black",eC.fillRect(0,0,r,n),eC.globalAlpha=.8,eC.globalCompositeOperation="multiply",_.svg&&eA.width&&eA.complete){if(eE.title!==_.name){eE.title=_.name,eE.width=e.canvasWidth,eE.height=e.canvasHeight;var s=eE.getContext("2d");if(s.fillStyle=_.color||"#000",s.fillRect(0,0,e.canvasWidth,e.canvasHeight),e.perks.clairvoyant>=3)for(var o=document.body.innerHTML.replace(/\s+/gi,""),l=Math.ceil(e.canvasWidth/15),i=Math.ceil(e.canvasHeight/20),u=Math.ceil(Math.random()*(o.length-l*i)),c=0;c_l(_6),_=e&&_6.perks.picky_eater&&eS(_6),t=e&&eH(_6),r=ez(_6),n=e$(_6);_||t||-1!==r||_6.perks.zen||(n=0);var a=_6.perks.clairvoyant&&_6.brickHP.reduce(function(e,_){return e+_},0),s=_6.gameZoneWidth+"_"+_6.bricks.join("_")+eT.complete+"_"+r+"_"+_+"_"+t+"_"+_6.ballsColor+"_"+_6.perks.pierce_color+"_"+a+"_"+n;if(s!==eV){eV=s,eD.width=_6.gameZoneWidth,eD.height=_6.gameZoneWidth+1;var o=eD.getContext("2d");o.clearRect(0,0,_6.gameZoneWidth,_6.gameZoneWidth),o.resetTransform(),o.translate(-_6.offsetX,0),_6.bricks.forEach(function(a,s){var l=eb(_6,s),i=ev(_6,s);if(a){var u=r===Math.floor(s/_6.level.size),c=_6.ballsColor!==a&&"black"!==a&&_||e&&_6.perks.zen&&"black"===a||u||t;o.globalCompositeOperation="source-over",eX(o,a,l,i,c?n:-1,_6.perks.clairvoyant>=2),_6.brickHP[s]>1&&_6.perks.clairvoyant&&(o.globalCompositeOperation=_6.perks.clairvoyant>=2?"source-over":"destination-out",eU(o,_6.brickHP[s].toString(),a,_6.puckHeight,l,i)),"black"===a&&(o.globalCompositeOperation="source-over",function(e,_,t,r,n){var a="svg"+_+"_"+t+"_"+_.complete;if(!eZ[a]){var s=document.createElement("canvas");s.width=t,s.height=t;var o=s.getContext("2d"),l=t/Math.max(_.width,_.height),i=_.width*l,u=_.height*l;o.drawImage(_,(t-i)/2,(t-u)/2,i,u),eZ[a]=s}e.drawImage(eZ[a],Math.round(r-t/2),Math.round(n-t/2))}(o,eT,_6.brickWidth,l,i))}})}eC.drawImage(eD,_6.offsetX,0)}(),eC.globalCompositeOperation="screen",_P(e.lights,function(_){var t=_.x,r=_.y,n=_.time,a=_.color,s=(_.size,_.duration);eC.globalAlpha=.5*Math.min(1,2-(e.levelTime-n)/s*2),eX(eC,a,t,r,-1,e.perks.clairvoyant>=2)}),eC.globalCompositeOperation="screen",_P(e.texts,function(_){var t=_.x,r=_.y,n=_.time,a=_.color,s=_.size,o=_.duration,l=e.levelTime-n;eC.globalAlpha=Math.max(0,Math.min(1,2-l/o*2)),eC.globalCompositeOperation="source-over",eU(eC,_.text,a,s,t,r-l/10)}),_P(e.particles,function(_){var t=_.x,r=_.y,n=_.time,a=_.color,s=_.size,o=_.duration;eC.globalAlpha=Math.max(0,Math.min(1,2-(e.levelTime-n)/o*2)),eC.globalCompositeOperation="screen",eI(eC,a,s,t,r),eN(eC,a,s,t,r)}),e.perks.extra_life){eC.globalAlpha=1,eC.globalCompositeOperation="source-over",eC.fillStyle=e.puckColor;for(var h=0;h4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0,o="puck"+_+"_"+t+"_"+r+"_"+a+"_"+s;if(!eZ[o]){var l=document.createElement("canvas");l.width=t,l.height=2*r;var i=l.getContext("2d");i.fillStyle=_,i.beginPath(),i.moveTo(0,2*r),a?(i.lineTo(0,.75*r),i.bezierCurveTo(t/2,r*(2+a)/3,t/2,r*(2+a)/3,t,.75*r)):(i.lineTo(0,1.25*r),i.bezierCurveTo(0,.75*r,t,.75*r,t,1.25*r)),i.lineTo(t,2*r),i.fill(),-1!==s&&(i.strokeStyle="red",i.lineWidth=4,i.setLineDash(eQ),i.lineDashOffset=s,i.stroke()),eZ[o]=l}e.drawImage(eZ[o],Math.round(_6.puckPosition-t/2),_6.gameZoneHeight-2*r+n)}(eC,e.puckColor,e.puckWidth,e.puckHeight,0,e.perks.concave_puck,e.perks.streak_shots&&t?e$(e):-1),e.combo>1){eC.globalCompositeOperation="source-over";var b="x "+e.combo,v=b.length*e.puckHeight/1.8,f=v+2*e.coinSize,y=e.puckPosition-f/2;fe.puckWidth?e.combo.toString():b,"#000",v>e.puckWidth?12:20,e.puckPosition,e.gameZoneHeight-e.puckHeight/2,!1)}eC.globalCompositeOperation="source-over",eC.globalAlpha=e.perks.unbounded?.1:1;var k=t&&!e.perks.unbounded&&(e.perks.left_is_lava||e.perks.trampoline),W=t&&!e.perks.unbounded&&(e.perks.right_is_lava||e.perks.trampoline),w=t&&e.perks.unbounded<=2&&(e.perks.top_is_lava||e.perks.trampoline);e.offsetXRoundedDown?(ej(eC,e,k&&"red"||"white",e.offsetX-1,0,e.offsetX-1,n,e.perks.unbounded?.1:1),ej(eC,e,W&&"red"||"white",r-e.offsetX+1,0,r-e.offsetX+1,n,e.perks.unbounded?.1:1)):(ej(eC,e,k&&"red"||"",0,0,0,n,1),ej(eC,e,W&&"red"||"",r-1,0,r-1,n,1)),w&&ej(eC,e,"red",e.perks.unbounded?0:e.offsetXRoundedDown,1,e.perks.unbounded?r:r-e.offsetXRoundedDown,1,1),eC.globalAlpha=1,ej(eC,e,t&&e.perks.compound_interest&&"red"||er("mobile-mode")&&"white"||"",e.offsetXRoundedDown,e.gameZoneHeight,r-e.offsetXRoundedDown,e.gameZoneHeight,1),er("mobile-mode")&&!e.running&&eU(eC,E("play.mobile_press_to_play"),e.puckColor,e.puckHeight,e.canvasWidth/2,e.gameZoneHeight+(e.canvasHeight-e.gameZoneHeight)/2),m&&eC.resetTransform()}}}(_6)),_6.running&&function(e){if(er("record")){var _;l&&(_=e,c&&(c.drawImage(eB,_.offsetXRoundedDown,0,_.gameZoneWidthRoundedUp,_.gameZoneHeight,0,0,u.width,u.height),c.fillStyle="#FFF",c.textBaseline="top",c.font="12px monospace",c.textAlign="right",c.fillText(_.score.toString(),u.width-12,12),c.textAlign="left",c.fillText("Level "+(_.currentLevel+1)+"/"+ek(_),12,12)),(null==i?void 0:i.requestFrame)?null==i||i.requestFrame():(null==l?void 0:l.requestFrame)&&l.requestFrame())}}(_6),er("sound")&&function(e){if(!(ea>Date.now()-60))for(var _ in ea=Date.now(),e.aboutToPlaySound){var t,r=e.aboutToPlaySound[_];r.vol&&(es[_](Math.min(2,r.vol),(t=e,Math.max(0,Math.min(1,(r.x-t.offsetXRoundedDown)/t.gameZoneWidthRoundedUp))),e.combo),r.vol=0)}}(_6),requestAnimationFrame(e),_Z++}(),function(){var e=document.getElementById("tooltip");if(er("mobile-mode")){e.style.display="none";return}function _(_){e.style.transform="translate(".concat(_.clientX,"px,").concat(_.clientY+20,"px) ")+(_.clientX>window.innerWidth/2?" translate(-100%,0)":"")}function t(){e.style.display="none",r=null}var r=null;document.body.addEventListener("mouseenter",function(n){for(var a=n.target;a&&!a.hasAttribute("data-tooltip");)a=a.parentElement;(null==a?void 0:a.hasAttribute("data-tooltip"))?(e.innerHTML=(r=a).getAttribute("data-tooltip")||"",e.style.display="",_(n)):t()},!0),setInterval(function(){r&&!document.body.contains(r)&&t()},200),document.body.addEventListener("mousemove",function(t){e.style.display||_(t)},!0),document.body.addEventListener("mouseleave",function(e){t()})}(),null===(d=document.getElementById("menu"))||void 0===d||d.setAttribute("data-tooltip",E("play.menu_tooltip"))}();