\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]"));function j(e){for(var r=0,t=0;t')}(t,e.size,e.color);return Y[e.name]=n,w(W({},e),{bricks:t,bricksCount:_,icon:n,svg:(r=null!==e.svg&&V[e.svg%V.length],e.color||r||(r=V[j(e.name)%V.length]),r)})}).filter(function(e){return!e.name.startsWith("icon:")}).map(function(e,r){return w(W({},e),{threshold:r<8?0:Math.round(Math.min(10*Math.pow(10,1+(r+e.size)/30),5e3)*r),sortKey:(Math.random()+3)/3.5*e.bricksCount})}),K=D.map(function(e){return w(W({},e),{icon:Y["icon:"+e.id]})}),Q={sound:{default:!0,name:T("main_menu.sounds"),help:T("main_menu.sounds_help")},"mobile-mode":{default:window.innerHeight>window.innerWidth,name:T("main_menu.mobile"),help:T("main_menu.mobile_help")},basic:{default:!1,name:T("main_menu.basic"),help:T("main_menu.basic_help")},colorful_coins:{default:!1,name:T("main_menu.colorful_coins"),help:T("main_menu.colorful_coins_help")},show_fps:{default:!1,name:T("main_menu.show_fps"),help:T("main_menu.show_fps_help")},show_stats:{default:!1,name:T("main_menu.show_stats"),help:T("main_menu.show_stats_help")},pointerLock:{default:!1,name:T("main_menu.pointer_lock"),help:T("main_menu.pointer_lock_help")},easy:{default:!1,name:T("main_menu.kid"),help:T("main_menu.kid_help")},record:{default:!1,name:T("main_menu.record"),help:T("main_menu.record_help")},fullscreen:{default:!1,name:T("main_menu.fullscreen"),help:T("main_menu.fullscreen_help")}};function $(e){var r;return H("breakout-settings-enable-"+e,null===(r=Q[e])||void 0===r?void 0:r.default)}function ee(e){q("breakout-settings-enable-"+e,!$(e))}var er=Date.now(),et={wallBeep:function(e,r,t){$("sound")&&en(800,r,e)},comboIncreaseMaybe:function(e,r,t){if($("sound")){var _=0;!isNaN(el)&&(elt&&(_=-1)),eo(_,r,e),el=t}},comboDecrease:function(e,r,t){$("sound")&&eo(-1,r,e)},coinBounce:function(e,r,t){$("sound")&&en(1200,r,e,.1,"triangle")},void:function(e,r){$("sound")&&(en(1200,r,e,.5,"sawtooth"),en(600,r,e,.3,"sawtooth"))},freeze:function(e,r){$("sound")&&(en(220,r,e,.5,"square"),en(440,r,e,.5,"square"))},explode:function(e,r,t){$("sound")&&function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5,r=e_();if(r){var t=r.createBufferSource();t.buffer=ea(r);var _=r.createGain();t.connect(_);var a=r.createBiquadFilter();a.type="lowpass",a.frequency.setValueAtTime(1e3,r.currentTime),_.connect(a);var l=r.createStereoPanner();l.pan.setValueAtTime(2*e-1,r.currentTime),a.connect(l),l.connect(r.destination),l.connect(n),_.gain.setValueAtTime(1,r.currentTime),_.gain.exponentialRampToValueAtTime(.01,r.currentTime+1),a.frequency.exponentialRampToValueAtTime(60,r.currentTime+1),t.start(r.currentTime),t.stop(r.currentTime+1)}}(r)},lifeLost:function(e,r,t){$("sound")&&function(e){var r=e_();if(r){var t=[ei(r,3e3,"square"),ei(r,4500,"square"),ei(r,6e3,"square")],_=r.createGain(),a=r.createBufferSource();a.buffer=ea(r),t.forEach(function(e){return e.connect(_)}),a.connect(_),_.gain.setValueAtTime(.2,r.currentTime),t.forEach(function(e){return e.start()}),a.start(),t.forEach(function(e){return e.stop(r.currentTime+.2)}),a.stop(r.currentTime+.2),_.gain.exponentialRampToValueAtTime(.001,r.currentTime+.2);var l=r.createStereoPanner();l.pan.setValueAtTime(2*e-1,r.currentTime),_.connect(l),l.connect(r.destination),l.connect(n),_.connect(l)}}(r)},coinCatch:function(e,r,t){$("sound")&&en(900,r,e,.1,"triangle")},colorChange:function(e,r,t){en(400,r,e,.5,"sine"),en(800,r,.5*e,.2,"square")}};function e_(){if(!_){if(!$("sound"))return null;n=(_=new(window.AudioContext||window.webkitAudioContext)).createMediaStreamDestination()}return _}function en(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:800,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,_=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"sine",l=e_();if(l){var s=ei(l,e,a),o=l.createGain();s.connect(o);var i=l.createStereoPanner();i.pan.setValueAtTime(2*r-1,l.currentTime),o.connect(i),i.connect(l.destination),i.connect(n),o.gain.setValueAtTime(.8*t,l.currentTime),o.gain.exponentialRampToValueAtTime(.001,l.currentTime+_),s.start(l.currentTime),s.stop(l.currentTime+_)}}function ea(e){if(!a)for(var r=2*e.sampleRate,t=(a=e.createBuffer(1,r,e.sampleRate)).getChannelData(0),_=0;_11&&(es=0),es<0&&(es=11);var _=function(e){var _=392*Math.pow(1.05945594920268,e),n=Math.abs(e-5.5),a=Math.max(0,t*(1-n/16.5));return en(_,r,a),_.toFixed(2)+" at "+Math.floor(100*a)+"% diff "+n};_(12+es),_(es),_(-12+es)}function ei(e,r,t){var _=e.createOscillator();return _.type=t,_.frequency.setValueAtTime(r,e.currentTime),_}function eu(e){var r;return e&&(null===(r=Object.values(e))||void 0===r?void 0:r.reduce(function(e,r){return e+r},0))||0}var ec=function(e){var r={};return e.forEach(function(e){return r[e.id]=0}),r};function ep(e,r){return e.offsetX+(r%e.gridSize+.5)*e.brickWidth}function ed(e,r){return(Math.floor(r/e.gridSize)+.5)*e.brickWidth}function em(e,r,t){return r<0||t<0||r>=e.gridSize||t>=e.gridSize?-1:r*e.gridSize+t}function eh(e){return K.filter(function(r){return e.totalScoreAtRunStart>=r.threshold||e.loop>0}).filter(function(r){return!(null==r?void 0:r.requires)||e.perks[null==r?void 0:r.requires]})}function eg(e){return e.levelsPerLoop+e.perks.extra_levels}function eb(e){var r="",t=!0,_=!1,n=void 0;try{for(var a,l=K[Symbol.iterator]();!(t=(a=l.next()).done);t=!0)for(var s=a.value,o=0;o').concat(Y["icon:"+s.id],"")}catch(e){_=!0,n=e}finally{try{t||null==l.return||l.return()}finally{if(_)throw n}}return r?" ".concat(T("score_panel.upgrades_picked"),"
").concat(r,"
"):""}function ev(e){if(!e.perks.clairvoyant)return"";for(var r="",t=0;t').concat(Y[e.runLevels[t].name],"");return"".concat(T("score_panel.upcoming_levels"),"
").concat(r,"
")}function ef(e){return e.level}function ey(e,r){return e.perks.telekinesis&&r.vy<0}function ek(e,r){return e.perks.yoyo&&r.vy>0}function eW(e,r){return Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2)}function ew(e,r){return Math.sqrt(eW(e,r))}function ex(e,r){for(var t=r%e.gridSize,_=Math.floor(r/e.gridSize),n=0,a=0;a<_;a++)e.bricks[t+a*e.gridSize]&&n++;return n}function eS(e,r){for(var t=r%e.gridSize,_=Math.floor(r/e.gridSize),n=0,a=_+1;a\n \n'),eH.onload=function(){return rJ.needsRender=!0};var eq=document.createElement("img"),eR=document.createElement("canvas");function eL(e,r,t,_,n,a,l){var s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1;e.globalAlpha=s,t&&("red"==t?(e.strokeStyle="red",e.lineDashOffset=eX(r),e.lineWidth=2,e.setLineDash(eF)):(e.strokeStyle="white",e.lineWidth=1),e.beginPath(),e.moveTo(_,n),e.lineTo(a,l),e.stroke(),"red"==t&&(e.setLineDash(eI),e.lineWidth=1),e.globalAlpha=1)}var eP=document.createElement("canvas"),eC="",eO={};function eT(e,r,t,_,n){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",l="ball"+r+"_"+t+"_"+a,s=Math.round(t);if(!eO[l]){var o=document.createElement("canvas");o.width=s,o.height=s;var i=o.getContext("2d");i.beginPath(),i.arc(s/2,s/2,Math.round(s/2)-1,0,2*Math.PI),i.fillStyle=r,i.fill(),a&&(i.lineWidth=2,i.strokeStyle=a,i.stroke()),eO[l]=o}e.drawImage(eO[l],Math.round(_-s/2),Math.round(n-s/2))}function eA(e,r,t,_,n,a,l){var s=(Math.round(l/Math.PI*64)%32+32)%32,o="coin with halo_"+r+"_"+t+"_"+a+"_"+("gold"===r?s:"whatever");if(!eO[o]){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=r,u.fill(),u.strokeStyle=a,"red"==a&&(u.lineWidth=2,u.setLineDash(eF)),u.stroke(),"gold"===r&&(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(s/16),u.translate(-t/2,-t/2),u.globalCompositeOperation="multiply",eZ(u,"$",r,t-2,t/2,t/2+1),eZ(u,"$",r,t-2,t/2,t/2+1)),eO[o]=i}e.drawImage(eO[o],Math.round(_-t/2),Math.round(n-t/2))}function eE(e,r,t,_,n){var a="fuzzy-circle"+r+"_"+t,l=Math.round(3*t);if(!eO[a]){var s=document.createElement("canvas");s.width=l,s.height=l;var o=s.getContext("2d"),i=o.createRadialGradient(l/2,l/2,0,l/2,l/2,l/2);i.addColorStop(0,r),i.addColorStop(1,"transparent"),o.fillStyle=i,o.fillRect(0,0,l,l),eO[a]=s}e.drawImage(eO[a],Math.round(_-l/2),Math.round(n-l/2))}function eD(e,r,t,_){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,l=Math.ceil(t-rJ.brickWidth/2),s=Math.ceil(_-rJ.brickWidth/2),o=Math.ceil(t+rJ.brickWidth/2)-1,i=Math.ceil(_+rJ.brickWidth/2)-1,u=o-l,c=i-s,p="brick"+r+"__"+u+"_"+c+"_"+n+"_"+a;if(!eO[p]){var d,m,h,g,b,v,f=document.createElement("canvas");f.width=u,f.height=c;var y=f.getContext("2d");y.fillStyle=r,y.setLineDash(-1!==n?eF:eI),y.lineDashOffset=n,y.strokeStyle=-1!==n?"red":r,y.lineJoin="round",y.lineWidth=4,d=y,m=2,h=2,g=u-4,b=c-4,v=2,d.beginPath(),d.moveTo(4,2),d.lineTo(m+g-v,h),d.quadraticCurveTo(m+g,h,m+g,h+v),d.lineTo(m+g,h+b-v),d.quadraticCurveTo(m+g,h+b,m+g-v,h+b),d.lineTo(m+v,h+b),d.quadraticCurveTo(m,h+b,m,h+b-v),d.lineTo(m,h+v),d.quadraticCurveTo(m,h,m+v,h),d.closePath(),a||y.fill(),y.stroke(),eO[p]=f}e.drawImage(eO[p],l,s,u,c)}function eZ(e,r,t,_,n,a){var l=arguments.length>6&&void 0!==arguments[6]&&arguments[6],s="text"+r+"_"+t+"_"+_+"_"+l;if(!eO[s]){var o=document.createElement("canvas");o.width=_*r.length,o.height=_;var i=o.getContext("2d");i.fillStyle=t,i.textAlign=l?"left":"center",i.textBaseline="middle",i.font=_+"px monospace",i.fillText(r,l?0:o.width/2,o.height/2,o.width),eO[s]=o}e.drawImage(eO[s],l?n:Math.round(n-eO[s].width/2),Math.round(a-eO[s].height/2))}var eV=document.getElementById("score"),ej=document.getElementById("menuLabel"),eI=[],eF=[5,5];function eX(e){return $("basic")?0:Math.floor(e.levelTime%500/500*10)%10}var g=m("5mG9B"),k=m("6QuVk");function eN(){$("record")&&(null==l?void 0:l.state)==="recording"&&(null==l||l.pause())}function eU(){$("record")&&l&&(null==l||l.stop(),l=null)}var g=m("5mG9B"),k=m("6QuVk"),eY=0,eJ=null,eK=document.getElementById("popup"),eQ=document.getElementById("close-modale");eQ.addEventListener("click",function(e){e.preventDefault(),eJ&&eJ()}),eQ.title=T("play.close_modale_window_tooltip");var e$=-1;function e0(e){return e1(w(W({},e),{allowClose:!1}))}function e1(e){return e2.apply(this,arguments)}function e2(){return(e2=(0,g._)(function(e){var r,t,_,n,a,l,s;return(0,k.__generator)(this,function(o){return r=e.title,_=void 0===(t=e.content)?[]:t,a=void 0===(n=e.allowClose)||n,s=void 0!==(l=e.actionsAsGrid)&&l,e4(1),[2,new Promise(function(e){var t,n=function(r){o||(o=!0,Array.prototype.forEach.call(l.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),l.remove(),e(r))};eK.className=s?" actionsAsGrid":"",eQ.style.display=a?"":"none";var l=document.createElement("div"),o=!1;if(eJ=a?function(){n(void 0)}:null,r){var i=document.createElement("h2");i.innerHTML=r,l.appendChild(i)}null==_||_.filter(function(e){return e}).forEach(function(e,r){if(e){if("string"==typeof e){var t,_,a=document.createElement("div");a.innerHTML=e,l.appendChild(a);return}(null===(t=l.lastChild)||void 0===t?void 0:t.nodeName)=="SECTION"?_=l.lastChild:((_=document.createElement("section")).className="actions",l.appendChild(_));var s=e.text,o=e.value,i=e.help,u=e.disabled,c=e.className,p=e.icon,d=document.createElement("button");d.innerHTML="\n".concat(void 0===p?"":p,"\n\n ").concat(s,"\n ").concat(i||"","\n
"),u?d.setAttribute("disabled","disabled"):d.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),n(o),e$=r}),d.className=(void 0===c?"":c)+(e$===r?" needs-focus":""),_.appendChild(d)}}),eK.appendChild(l),null===(t=eK.querySelector("section.actions > button.needs-focus"))||void 0===t||t.focus(),e$=-1}).then(function(e){return e4(-1),eJ=null,e},function(){eJ=null,e4(-1)})]})})).apply(this,arguments)}function e4(e){(eY+=e)>1&&alert("Two alerts where opened at once"),document.body.classList[eY?"add":"remove"]("has-alert-open")}function e5(e,r){if(rJ.running&&!rJ.isGameOver){rJ.isGameOver=!0,rH(!0),eU(),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){}}(rJ.runStatistics.runTime),rJ.runStatistics.max_level=rJ.currentLevel+1;var t,_,n=-300,a=function(){return"animation-delay:"+(n+=800)+"ms;"},l="",s=R(),o=s-rJ.score,i=(t=[],K.forEach(function(e){e.threshold&&t.push({threshold:e.threshold,title:e.name+" "+T("level_up.unlocked_perk")})}),J.forEach(function(e){t.push({threshold:e.threshold,title:e.name+" "+T("level_up.unlocked_level")})}),t.filter(function(e){return e.threshold}).sort(function(e,r){return e.threshold-r.threshold}));i.filter(function(e){return e.threshold>o&&e.threshold\n '.concat(e.title,'\n \n
\n')});var u=(null===(_=function(e,r){for(var t=e.length;--t;)if(r(e[t],t,e))return e[t]}(i,function(e){return e.threshold<=s}))||void 0===_?void 0:_.threshold)||0,c=i.find(function(e){return e.threshold>s});if(c){var p=(null==c?void 0:c.threshold)-u,d=s-u;r+=T("gameOver.next_unlock",{points:c.threshold-s});var m=(d/p).toFixed(2);l+='\n \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 h=i.filter(function(e){return e.threshold>o&&e.threshold".concat(T("gameOver.unlocked_count",{count:h.length})," ").concat(h.map(function(e){return e.title}).join(", "),"")),rJ.combo=1,e1({allowClose:!0,title:e,content:["\n ".concat(rJ.isCreativeModeRun?"".concat(T("gameOver.test_run"),"
"):"","\n ").concat(r,"
\n ").concat(T("gameOver.cumulative_total",{startTs:o,endTs:s}),"
\n ").concat(l," \n "),{value:null,text:T("gameOver.restart"),help:""},' \n '.concat(eb(rJ),"\n ").concat(function(){var e="";try{var r=JSON.parse(localStorage.getItem("breakout_71_runs_history")||"[]");r.sort(function(e,r){return e.score-r.score}).reverse(),(r=r.slice(0,100)).push(w(W({},rJ.runStatistics),{perks:rJ.perks,appVersion:U})),rJ.isCreativeModeRun||localStorage.setItem("breakout_71_runs_history",JSON.stringify(r,null,2));var t=function(e,t,_){var n,a,l,s=r.map(function(e){return t(e)||0}),o=(n=Math).min.apply(n,y(s)),i=(a=Math).max.apply(a,y(s));if(o===i)return"";i-o<10&&(o=Math.max(0,i-10),i=Math.max(i,o+10));var u=Math.min(s.length,10);if(u<3)return"";for(var c=[],p=[],d=0;d1?"s":""," between ").concat(Math.floor(o+r*m)," and ").concat(Math.floor(o+(r+1)*m)).concat(_,'"\n >').concat(!e&&" "||r==v&&b+_||Math.round(p[r]/e)+_,"")}).join("");return''.concat(e," : ").concat(b).concat(_,'
\n ').concat(f,"
\n ")};e+=t(T("gameOver.stats.total_score"),function(e){return e.score},""),e+=t(T("gameOver.stats.catch_rate"),function(e){return Math.round(e.score/e.coins_spawned*100)},"%"),e+=t(T("gameOver.stats.bricks_broken"),function(e){return e.bricks_broken},""),e+=t(T("gameOver.stats.bricks_per_minute"),function(e){return Math.round(e.bricks_broken/e.runTime*6e4)},""),e+=t(T("gameOver.stats.hit_rate"),function(e){return Math.round((1-e.misses/e.puck_bounces)*100)},"%"),e+=t(T("gameOver.stats.duration_per_level"),function(e){return Math.round(e.runTime/1e3/e.levelsPlayed)},"s"),e+=t(T("gameOver.stats.level_reached"),function(e){return e.levelsPlayed},""),e+=t(T("gameOver.stats.upgrades_applied"),function(e){return e.upgrades_picked},""),e+=t(T("gameOver.stats.balls_lost"),function(e){return e.balls_lost},""),e+=t(T("gameOver.stats.combo_avg"),function(e){return Math.round(e.coins_spawned/e.bricks_broken)},""),e+=t(T("gameOver.stats.combo_max"),function(e){return e.max_combo},""),(e+=t(T("gameOver.stats.loops"),function(e){return e.loops},""))&&(e="".concat(T("gameOver.stats.intro",{count:r.length-1}),"
")+e)}catch(e){console.warn(e)}return e}()," \n ")]}).then(function(){return rK({levelToAvoid:ef(rJ).name})})}}var g=m("5mG9B"),k=m("6QuVk");function e3(){return(e3=(0,g._)(function(e,r){var t,_,n,a,l,s,o;return(0,k.__generator)(this,function(i){switch(i.label){case 0:var u;return _=(t=function(e){if(Array.isArray(e))return e}(u=e.split(":"))||function(e,r){var t,_,n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a=[],l=!0,s=!1;try{for(n=n.call(e);!(l=(t=n.next()).done)&&(a.push(t.value),a.length!==r);l=!0);}catch(e){s=!0,_=e}finally{try{l||null==n.return||n.return()}finally{if(s)throw _}}return a}}(u,3)||f(u,3)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],n=t[1],a=t[2],l="".concat(_,":").concat(n),s=function(e){for(var r=atob(e.replace(/-----BEGIN PUBLIC KEY-----/,"").replace(/-----END PUBLIC KEY-----/,"").replace(/\s+/g,"")),t=new Uint8Array(r.length),_=0;_=r.threshold}).filter(function(e){return e.name!==(null==r?void 0:r.level)}).filter(function(e){return e.name!==(null==r?void 0:r.levelToAvoid)}).sort(function(){return Math.random()-.5});return t.concat(_.slice(0,10).sort(function(e,r){return e.sortKey-r.sortKey}))}function r_(e){var r=R(),t=rt(r,e),_=W({},ec(K),(null==e?void 0:e.perks)||{}),n=w(W({runLevels:t,level:t[0],currentLevel:0,upgradesOfferedFor:-1,perks:_,bannedPerks:ec(K),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,highScore:parseFloat(localStorage.getItem("breakout-3-hs")||"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:r,isCreativeModeRun:eu(_)>1,pauseUsesDuringRun:0,keyboardPuckSpeed:0,lastTick:performance.now(),lastTickDown:0,runStatistics:{started:Date.now(),levelsPlayed:0,runTime:0,coins_spawned:0,score:0,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},void:{vol:0,x:0},freeze:{vol:0,x:0}}}),{rerolls:0,loop:0,baseCombo:1,levelsPerLoop:null!==(u=null==e?void 0:e.levelsPerLoop)&&void 0!==u?u:7});if(ra(n),!eu(n.perks)){var a=eh(n).filter(function(e){return e.giftable}),l=$("easy")&&"slow_down"||a[Math.floor(Math.random()*a.length)].id;_[l]=1,rd(n,l)}var s=!0,o=!1,i=void 0;try{for(var u,c,p=K[Symbol.iterator]();!(s=(c=p.next()).done);s=!0){var d=c.value;n.perks[d.id]&&rd(n,d.id)}}catch(e){o=!0,i=e}finally{try{s||null==p.return||p.return()}finally{if(o)throw i}}return n}function rn(e,r){e.puckPosition=r,e.needsRender=!0}function ra(e){rl(e);var r,t=1+((null===(r=e.perks)||void 0===r?void 0:r.multiball)||0),_=e.puckWidth/(t+1);e.balls=[],e.ballsColor="#FFF",(e.perks.picky_eater||e.perks.pierce_color)&&(e.ballsColor=function(e){var r,t,_={};e.forEach(function(e){return _[e]=(_[e]||0)+1});var n=(t=Math).max.apply(t,y(Object.keys(_).map(function(e){return _[e]})));return(r=Object.keys(_).filter(function(e){return _[e]==n}))[Math.floor(r.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:l,previousVX:l,vy:-e.baseSpeed,previousVY:-e.baseSpeed,piercePoints:3*e.perks.pierce,hitSinceBounce:0,brokenSinceBounce:0,sapperUses:0})}e.ballStickToPuck=!0}function rl(e){e.baseSpeed=Math.max(3,e.gameZoneWidth/12/10+e.currentLevel/3+e.levelTime/3e4-2*e.perks.slow_down),e.puckWidth=Math.max(e.ballSize,e.gameZoneWidth/12*Math.min(12,3-e.perks.smaller_puck+e.perks.bigger_puck));var r=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*r;e.puckPosition=A(e.puckPosition,t,_),e.ballStickToPuck&&function(e){var r=e.balls.length,t=e.puckWidth/(r+1);e.balls.forEach(function(r,_){var n=e.puckPosition-e.puckWidth/2+t*(_+1);r.x=n,r.previousX=n,r.y=e.gameZoneHeight-1.5*e.ballSize,r.previousY=r.y,r.hitSinceBounce=0,r.brokenSinceBounce=0,r.piercePoints=3*e.perks.pierce})}(e),Math.abs(e.lastPuckPosition-e.puckPosition)>1&&e.running&&(e.lastPuckMove=e.levelTime),e.lastPuckPosition=e.puckPosition}function rs(e){return e.baseCombo+3*e.perks.base_combo+5*e.perks.smaller_puck}function ro(e,r,t){var _=e.combo;e.combo=rs(e),_>e.combo&&e.perks.soft_reset&&(e.combo+=Math.floor((_-e.combo)*E(e.perks.soft_reset)));var n=Math.max(0,_-e.combo);if(n){for(var a=0;aP()&&(r=1);for(var a=0;a5&&void 0!==arguments[5]?arguments[5]:0,l=1+e.perks.bigger_explosions+Math.max(0,e.perks.implosions-1)+a;if(rm(e,"explode",n.x,1),-1!==r)for(var s=r%e.gridSize,o=Math.floor(r/e.gridSize),i=-l;i<=l;i++)for(var u=-l;u<=l;u++){var c=em(e,o+u,s+i);e.bricks[c]&&-1!==c&&(e.brickHP[c]--,e.brickHP[c]<=0&&rp(e,c,n,!0))}var p=e.perks.implosions?-1:1;rG(e.coins,function(r){var n=r.x-t,a=r.y-_,s=Math.max(e.brickWidth,Math.abs(n)+Math.abs(a));r.vx+=n/s*10*l/r.weight*p,r.vy+=a/s*10*l/r.weight*p}),e.lastExplosion=Date.now(),e.perks.implosions?function(e,r,t,_,n){if(!$("basic")){rz(e.particles)>P()&&(r=1);for(var a=0;aL()?1:Math.floor(u-rz(e.coins))/3)));i>0;){var p=Math.min(c,i);(p<0||isNaN(p))&&console.error({points:p}),i-=p;var d=s+(Math.random()-.5)*(e.brickWidth-e.coinSize),m=o+(Math.random()-.5)*(e.brickWidth-e.coinSize);!function(e,r,t,_,n){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"gold",l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,s=.8+.2*Math.random()+Math.min(2,.01*l);s*=5/(5+e.perks.etherealcoins),rx(e.coins,function(o){o.x=r,o.y=t,o.collidedLastFrame=!0,o.size=e.coinSize,o.previousX=r,o.previousY=t,o.vx=_,o.vy=n,o.color=a,o.a=Math.random()*Math.PI*2,o.sa=Math.random()-.5,o.points=l,o.weight=s,o.metamorphosisPoints=e.perks.metamorphosis})}(e,d,m,t.previousVX*(.5+Math.random()),t.previousVY*(.5+Math.random()),e.perks.metamorphosis||$("colorful_coins")?n:"gold",p)}e.combo+=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.nbricks+e.perks.unbounded,e.perks.side_kick&&(Math.abs(t.vx)>Math.abs(t.vy)?e.combo+=e.perks.side_kick:ri(e,e.perks.side_kick,t.x,t.y)),e.perks.reach&&(ex(e,r)&&!eS(e,r)?ro(e,s,o):e.combo+=e.perks.reach),e.lastPuckMove&&e.perks.passive_income&&e.lastPuckMove>e.levelTime-250*e.perks.passive_income&&ro(e,s,o),e.perks.nbricks&&t.brokenSinceBounce>e.perks.nbricks&&ro(e,t.x,t.y),_||((e.perks.picky_eater||e.perks.pierce_color)&&n!==e.ballsColor&&n?(e.perks.picky_eater&&ro(e,t.x,t.y),rm(e,"colorChange",t.x,.8),e.lastExplosion=e.levelTime,e.ballsColor=n,$("basic")||e.balls.forEach(function(r){ru(e,7,r.previousX,r.previousY,n)})):rm(e,"comboIncreaseMaybe",t.x,1)),ru(e,5+Math.min(e.combo,30),s,o,n)}e.perks.respawn&&"black"!==n&&!e.bricks[r]&&Math.random()=r)return[2,console.warn("Extra upgrade request ignored ")];if(e.upgradesOfferedFor=r,rH(!1),eU(),!(r>0))return[3,2];return[4,function(e){return rR.apply(this,arguments)}(e)];case 1:a.sent(),a.label=2;case 2:for(e.currentLevel=r,e.level=e.runLevels[r],e.levelTime=0,e.winAt=0,e.levelWallBounces=0,e.autoCleanUses=0,e.lastTickDown=e.levelTime,e.levelStartScore=e.score,e.levelSpawnedCoins=0,e.levelLostCoins=0,e.levelMisses=0,e.runStatistics.levelsPlayed++,t=e.combo,e.combo=rs(e),e.perks.shunt&&(e.combo+=Math.round(Math.max(0,(t-e.combo)*E(e.perks.shunt)))),e.combo+=15*e.perks.hot_start,(_=ef(e)).size!==e.gridSize&&(e.gridSize=_.size,rq()),e.levelLostCoins+=rM(e.coins),rM(e.particles),rM(e.lights),rM(e.texts),rM(e.respawns),e.bricks=[],n=0;n<_.size*_.size;n++)rv(e,n,_.bricks[n]);return ra(e),e.needsRender=!0,eq.src="data:image/svg+xml;UTF8,"+_.svg,[2]}})})).apply(this,arguments)}function rv(e,r,t){e.bricks[r]=t||"",e.brickHP[r]="black"===t&&1||t&&1+e.perks.sturdy_bricks||0}function rf(){return"hsl(".concat(2*Math.round(rJ.levelTime/4)%360,",100%,70%)")}function ry(e,r,t,_,n){var a=ew(r,t),l=e.gameZoneWidth/4;if(!(a>l)){var s=(r.x-t.x)/a,o=(r.y-t.y)/a,i=-_*(l-a)/(1.2*l)/3*Math.min(500,e.levelTime)/500;n&&void 0!==t.vx&&void 0!==t.vy&&(t.vx+=s*i,t.vy+=o*i),r.vx-=s*i,r.vy-=o*i,rW(e,r.x,r.y,-(10*s)+r.vx+(Math.random()-.5)*2,-(10*o)+r.vy+(Math.random()-.5)*2,rf(),!0,e.coinSize/2,100),n&&void 0!==t.vx&&void 0!==t.vy&&rW(e,t.x,t.y,10*s+t.vx+(Math.random()-.5)*2,10*o+t.vy+(Math.random()-.5)*2,rf(),!0,e.coinSize/2,100)}}function rk(e,r,t,_){if(!r.destroyed){r.previousX=r.x,r.previousY=r.y,r.x+=r.vx*_,r.y+=r.vy*_,e.perks.wind&&(r.vx+=(e.puckPosition-(e.offsetX+e.gameZoneWidth/2))/e.gameZoneWidth*e.perks.wind*.5);var n=0,a=0;return r.xe.canvasWidth-e.offsetXRoundedDown-t&&!e.perks.unbounded&&(r.x=e.canvasWidth-e.offsetXRoundedDown-t-(r.x-(e.canvasWidth-e.offsetXRoundedDown-t)),r.vx*=-1,a=1),a+2*n}}function rW(e,r,t,_,n,a){var l=arguments.length>6&&void 0!==arguments[6]&&arguments[6],s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:8,o=arguments.length>8&&void 0!==arguments[8]?arguments[8]:150;rx(e.particles,function(i){i.time=e.levelTime,i.x=r,i.y=t,i.vx=_,i.vy=n,i.color=a,i.size=s,i.duration=o,i.ethereal=l})}function rw(e,r,t,_,n){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:20,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:500;rx(e.texts,function(s){s.time=e.levelTime,s.x=r,s.y=t,s.color=_,s.size=a,s.duration=A(l,400,2e3),s.text=n})}function rx(e,r){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,(l=r,new Promise(function(e,r){var t=new FileReader;t.onload=function(){e(t.result)},t.onerror=function(e){console.error(e),r(Error("Failed to readAsDataURL of the video "))},t.readAsDataURL(l)}))];case 4:return n.href=a.sent(),[3,6];case 5:n.href=_.src,a.label=6;case 6:return n.textContent=T("main_menu.record_download",{size:(r.size/1e6).toFixed(2)}),e.appendChild(n),[2]}})})}}(rJ),null===(e=e_())||void 0===e||e.resume(),$("record")&&(null==l?void 0:l.state)==="paused"&&l.resume()))}function rH(e){if(rJ.running&&!rJ.pauseTimeout){var r=function(){rJ.running=!1,setTimeout(function(){var e;rJ.running||null===(e=e_())||void 0===e||e.suspend()},1e3),eN(),rJ.pauseTimeout=null,eV.className="",rJ.needsRender=!0};e?(rJ.pauseUsesDuringRun++,rJ.pauseTimeout=setTimeout(r,Math.min(50*Math.max(0,rJ.pauseUsesDuringRun-5),500))):r(),document.exitPointerLock&&document.exitPointerLock()}}var rq=function(){var e,r=function(e){e.x=rJ.offsetXRoundedDown+(e.x-_)/n*rJ.gameZoneWidthRoundedUp,e.y=e.y/a*rJ.gameZoneHeight},t=function(e){e.x=rJ.offsetXRoundedDown+(e.x-_)/n*rJ.gameZoneWidthRoundedUp,e.y=e.y/a*rJ.gameZoneHeight,e.previousX=e.x,e.previousY=e.y},_=rJ.offsetXRoundedDown,n=rJ.gameZoneWidthRoundedUp,a=rJ.gameZoneHeight,l=eG.getBoundingClientRect(),s=l.width,o=l.height;rJ.canvasWidth=s,rJ.canvasHeight=o,eG.width=s,eG.height=o,eB.fillStyle=(null===(e=ef(rJ))||void 0===e?void 0:e.color)||"black",eB.globalAlpha=1,eB.fillRect(0,0,s,o),eR.width=s,eR.height=o,rJ.gameZoneHeight=$("mobile-mode")?80*o/100:o;var i=Math.round(Math.min(rJ.canvasWidth,.73*rJ.gameZoneHeight));rJ.brickWidth=2*Math.floor(i/rJ.gridSize/2),rJ.gameZoneWidth=rJ.brickWidth*rJ.gridSize,rJ.offsetX=Math.floor((rJ.canvasWidth-rJ.gameZoneWidth)/2),rJ.offsetXRoundedDown=rJ.offsetX,rJ.offsetX.9&&(e.rerolls++,n=T("level_up.plus_one_choice")),0===e.levelMisses?(t++,e.rerolls++,l=T("level_up.plus_one_upgrade")):e.levelMisses<=3&&(e.rerolls++,l=T("level_up.plus_one_choice")),c.label=1;case 1:var p,d;if(!t--||(p=3+e.perks.one_more_choice-e.perks.instant_upgrade,(d=eh(e).map(function(r){return w(W({},r),{score:Math.random()+(e.lastOffered[r.id]||0)})}).sort(function(e,r){return e.score-r.score}).filter(function(r){return e.perks[r.id]r.id?1:-1})).forEach(function(r){rd(e,r.id)}),!(s=d.map(function(r){return{text:r.name+(e.perks[r.id]?T("level_up.upgrade_perk_to_level",{level:e.perks[r.id]+1}):""),icon:Y["icon:"+r.id],value:r.id,help:r.help(e.perks[r.id]+1)}})).length))return[3,3];return e.rerolls&&s.push({text:T("level_up.reroll",{count:e.rerolls}),help:T("level_up.reroll_help"),value:"reroll",icon:Y["icon:reroll"]}),o="\n ".concat(T("level_up.after_buttons",{level:e.currentLevel+1,max:eg(e)}),"
\n \n ").concat(eb(e),'\n \n \n '),i=_&&n&&l&&a&&T("level_up.compliment_perfect")||(_||n||l||a)&&T("level_up.compliment_good")||T("level_up.compliment_advice"),[4,e0({title:T("level_up.pick_upgrade_title")+(t?" ("+(t+1)+")":""),content:["".concat(T("level_up.before_buttons",{score:e.score-e.levelStartScore,catchGain:n,levelSpawnedCoins:e.levelSpawnedCoins,time:Math.round(e.levelTime/1e3),timeGain:_,levelMisses:e.levelMisses,missesGain:l,levelWallBounces:e.levelWallBounces,wallHitsGain:a,compliment:i}),"\n
\n\n ").concat(ev(e),"
\n")].concat(y(s),[o])})];case 2:return"reroll"===(u=c.sent())?(t++,e.rerolls--):(e.perks[u]++,"instant_upgrade"===u&&(t+=2),e.runStatistics.upgrades_picked++),[3,1];case 3:return[2]}})})).apply(this,arguments)}function rL(e,r){return em(rJ,Math.floor(r/rJ.brickWidth),Math.floor((e-rJ.offsetX)/rJ.brickWidth))}function rP(e){if(rJ.bricks[e])return e}function rC(e,r,t){var _,n,a;return null!==(a=null!==(n=null!==(_=rP(rL(e-t,r-t)))&&void 0!==_?_:rP(rL(e+t,r-t)))&&void 0!==n?n:rP(rL(e+t,r+t)))&&void 0!==a?a:rP(rL(e-t,r+t))}window.addEventListener("resize",rq),window.addEventListener("fullscreenchange",rq),setInterval(function(){var e=eG.getBoundingClientRect(),r=e.width,t=e.height;(r!==rJ.canvasWidth||t!==rJ.canvasHeight)&&rq()},1e3),eG.addEventListener("mouseup",function(e){0===e.button&&(rJ.running?rH(!0):(rB(),$("pointerLock")&&eG.requestPointerLock&&eG.requestPointerLock().then()))}),eG.addEventListener("mousemove",function(e){document.pointerLockElement===eG?rn(rJ,rJ.puckPosition+e.movementX):rn(rJ,e.x)}),eG.addEventListener("touchstart",function(e){var r;e.preventDefault(),(null===(r=e.touches)||void 0===r?void 0:r.length)&&(rn(rJ,e.touches[0].pageX),rl(rJ),rB())}),eG.addEventListener("touchend",function(e){e.preventDefault(),rH(!0)}),eG.addEventListener("touchcancel",function(e){e.preventDefault(),rH(!0)}),eG.addEventListener("touchmove",function(e){var r;(null===(r=e.touches)||void 0===r?void 0:r.length)&&rn(rJ,e.touches[0].pageX)});var rO=0,rT=60;function rA(){return rE.apply(this,arguments)}function rE(){return(rE=(0,g._)(function(){var e;return(0,k.__generator)(this,function(r){switch(r.label){case 0:return rH(!0),e=K.filter(function(e){return rJ.bannedPerks[e.id]}).map(function(e){return e.name}).join(", "),[4,e1({title:rJ.loop?T("score_panel.title_looped",{loop:rJ.loop,score:rJ.score,level:rJ.currentLevel+1,max:eg(rJ)}):T("score_panel.title",{score:rJ.score,level:rJ.currentLevel+1,max:eg(rJ)}),content:[rJ.isCreativeModeRun?"".concat(T("score_panel.test_run"),"
"):"",eb(rJ),ev(rJ),rJ.rerolls?T("score_panel.rerolls_count",{rerolls:rJ.rerolls}):"",e&&T("score_panel.banned",{banned:e})],allowClose:!0})];case 1:return r.sent(),[2]}})})).apply(this,arguments)}function rD(){return rZ.apply(this,arguments)}function rZ(){return(rZ=(0,g._)(function(){var e,r,t,_;return(0,k.__generator)(this,function(n){switch(n.label){case 0:return rH(!0),r=(e=Math).max.apply(e,y(K.map(function(e){return e.threshold}))),t=[{icon:Y["icon:7_levels_run"],text:T("main_menu.normal"),help:T("main_menu.normal_help"),value:function(){rK({levelToAvoid:ef(rJ).name})}},{icon:Y["icon:unlocks"],text:T("main_menu.unlocks"),help:T("main_menu.unlocks_help"),value:function(){(function(){rF.apply(this,arguments)})()}},{icon:Y["icon:sandbox"],text:T("sandbox.title"),help:R()0&&a<.5&&(r=T("premium.per_hours",l),t=T("premium.per_hours_help",l))}}catch(e){console.warn(e)}return{icon:Y["icon:premium"],text:r,help:t,value:function(){return re("")}}}(0),{text:T("main_menu.settings_title"),help:T("main_menu.settings_help"),icon:Y["icon:settings"],value:function(){rV()}}],[4,e1({title:T("main_menu.title"),content:y(t).concat([T("main_menu.footer_html",{appVersion:U})]),allowClose:!0})];case 1:return(_=n.sent())&&(_(),rJ.needsRender=!0),[2]}})})).apply(this,arguments)}function rV(){return rj.apply(this,arguments)}function rj(){return(rj=(0,g._)(function(){var e,r,t,_,n,a,l,s;return(0,k.__generator)(this,function(o){switch(o.label){case 0:rH(!0),e=[],r=!0,t=!1,_=void 0;try{for(n=function(){var r=l.value;Q[r]&&e.push({icon:$(r)?Y["icon:checkmark_checked"]:Y["icon:checkmark_unchecked"],text:Q[r].name,help:Q[r].help,value:function(){ee(r),rq(),rI(),rV()}})},a=Object.keys(Q)[Symbol.iterator]();!(r=(l=a.next()).done);r=!0)n()}catch(e){t=!0,_=e}finally{try{r||null==a.return||a.return()}finally{if(t)throw _}}return e.push({text:T("main_menu.reset"),help:T("main_menu.reset_help"),value:function(){return(0,g._)(function(){return(0,k.__generator)(this,function(e){switch(e.label){case 0:return[4,e1({title:T("main_menu.reset"),content:[T("main_menu.reset_instruction"),{text:T("main_menu.reset_confirm"),value:!0},{text:T("main_menu.reset_cancel"),value:!1}],allowClose:!0})];case 1:return e.sent()&&(localStorage.clear(),window.location.reload()),[2]}})})()}}),e.push({text:T("main_menu.download_save_file"),help:T("main_menu.download_save_file_help"),value:function(){return(0,g._)(function(){var e,r,t,_,n,a;return(0,k.__generator)(this,function(l){for(r=0,e={};rU)throw Error("Please update your app first, this file is for version "+l+" or newer.");if(o!==j("Security by obscurity, but really the game is oss so eh"+s))throw Error("Key does not match content.");for(var c in i=JSON.parse(s),localStorage.clear(),i)localStorage.setItem(c,i[c]);return[4,e1({title:T("main_menu.save_file_loaded"),content:[T("main_menu.save_file_loaded_help"),{text:T("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,e1({title:T("main_menu.save_file_error"),content:[u.message,{text:T("main_menu.save_file_loaded_ok")}]})];case 5:return e.sent(),[3,6];case 6:return r.value="",[2]}})}),function(e){return _.apply(this,arguments)})),document.body.appendChild(r)}return null===(e=document.getElementById("save_file_picker"))||void 0===e||e.click(),[2]})})()}}),e.push({text:T("main_menu.language"),help:T("main_menu.language_help"),value:function(){return(0,g._)(function(){var e,r;return(0,k.__generator)(this,function(t){switch(t.label){case 0:return[4,e1({title:T("main_menu.language"),content:[T("main_menu.language_help"),{text:"English",value:"en"},{text:"Français",value:"fr"}],allowClose:!0})];case 1:if(!(r=(e=t.sent())&&e!==O()))return[3,3];return[4,rX(rJ)];case 2:r=t.sent(),t.label=3;case 3:return r&&(q("lang",e),window.location.reload()),[2]}})})()}}),e.push({text:T("main_menu.max_coins",{max:L()}),help:T("main_menu.max_coins_help"),value:function(){return(0,g._)(function(){return(0,k.__generator)(this,function(e){switch(e.label){case 0:return q("max_coins",(H("max_coins",1)+1)%6),[4,rV()];case 1:return e.sent(),[2]}})})()}}),e.push({text:T("main_menu.max_particles",{max:P()}),help:T("main_menu.max_particles_help"),value:function(){return(0,g._)(function(){return(0,k.__generator)(this,function(e){switch(e.label){case 0:return q("max_particles",(H("max_particles",1)+1)%6),[4,rV()];case 1:return e.sent(),[2]}})})()}}),[4,e1({title:T("main_menu.settings_title"),content:[T("main_menu.settings_help")].concat(y(e)),allowClose:!0})];case 1:return(s=o.sent())&&(s(),rJ.needsRender=!0),[2]}})})).apply(this,arguments)}function rI(){try{if(!(document.fullscreenEnabled||document.webkitFullscreenEnabled))return!1;if(null===document.fullscreenElement||$("fullscreen")){if($("fullscreen")&&!document.fullscreenElement){var e=document.documentElement;if(e.requestFullscreen)return e.requestFullscreen(),!0;if(e.webkitRequestFullscreen)return e.webkitRequestFullscreen(),!0}}else{if(document.exitFullscreen)return document.exitFullscreen(),!0;if(document.webkitCancelFullScreen)return document.webkitCancelFullScreen(),!0}}catch(e){console.warn(e)}return!1}function rF(){return(rF=(0,g._)(function(){var e,r,t,_,n;return(0,k.__generator)(this,function(a){switch(a.label){case 0:return e=R(),r=K.sort(function(e,r){return e.threshold-r.threshold}).map(function(r){var t=r.name,_=r.id,n=r.threshold,a=r.icon;return r.help,{text:t,disabled:e=r.threshold;return{text:r.name,disabled:!t,value:{level:r.name},icon:Y[r.name]}}),[4,e1({title:T("unlocks.title",{percentUnlock:_=Math.round(y(r).concat(y(t)).filter(function(e){return!e.disabled}).length/(r.length+t.length)*100)}),content:["".concat(T("unlocks.intro",{ts:e,highScore:rJ.highScore}),"\n ").concat(_<100?T("unlocks.greyed_out_help"):"","
")].concat(y(r),[T("unlocks.level")],y(t)),allowClose:!0,actionsAsGrid:!0})];case 1:if(!(n=a.sent()))return[3,3];return[4,rX(rJ)];case 2:a.sent()&&rK(n),a.label=3;case 3:return[2]}})})).apply(this,arguments)}function rX(e){return rN.apply(this,arguments)}function rN(){return(rN=(0,g._)(function(e){return(0,k.__generator)(this,function(r){return e.currentLevel?[2,e1({title:T("confirmRestart.title"),content:[T("confirmRestart.text"),{value:!0,text:T("confirmRestart.yes")},{value:!1,text:T("confirmRestart.no")}]})]:[2,!0]})})).apply(this,arguments)}setInterval(function(){rT=rO,rO=0},1e3),window.addEventListener("visibilitychange",function(){document.hidden&&rH(!0)}),eV.addEventListener("click",function(e){e.preventDefault(),eY||rA()}),document.addEventListener("visibilitychange",function(){document.hidden&&rH(!0)}),document.getElementById("menu").addEventListener("click",function(e){e.preventDefault(),eY||rD()});var rU={ArrowLeft:0,ArrowRight:0,Shift:0};function rY(e,r){rU[e]=r,rJ.keyboardPuckSpeed=(rU.ArrowRight-rU.ArrowLeft)*(1+2*rU.Shift)*rJ.gameZoneWidth/50}document.addEventListener("keydown",function(e){"f"!==e.key.toLowerCase()||e.ctrlKey||e.metaKey?e.key in rU&&rY(e.key,1):(ee("fullscreen"),rI())," "===e.key&&!eY&&(rJ.running?rH(!0):rB(),e.preventDefault())}),document.addEventListener("keyup",(t=(0,g._)(function(e){var r,t,_,n,a;return(0,k.__generator)(this,function(l){switch(l.label){case 0:if(a=document.querySelector("button:focus"),!(e.key in rU))return[3,1];return rY(e.key,0),[3,10];case 1:if("ArrowDown"!==e.key||(null==a?void 0:null===(r=a.nextElementSibling)||void 0===r?void 0:r.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===(_=a.previousElementSibling)||void 0===_?void 0:_.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&&eJ))return[3,4];return eJ(),[3,10];case 4:if(!("Escape"===e.key&&rJ.running))return[3,5];return rH(!0),[3,10];case 5:if(!("m"===e.key.toLowerCase()&&!eY))return[3,6];return rD().then(),[3,10];case 6:if(!("s"===e.key.toLowerCase()&&!eY))return[3,7];return rA().then(),[3,10];case 7:if(!("r"===e.key.toLowerCase()&&!eY))return[3,9];return[4,rX(rJ)];case 8:return l.sent()&&rK({levelToAvoid:ef(rJ).name}),[3,10];case 9:return[2];case 10:return e.preventDefault(),[2]}})}),function(e){return t.apply(this,arguments)}));var rJ=r_({});function rK(e){rq(),Object.assign(rJ,r_(e)),eN(),rg(rJ,0)}rK(window.location.search.includes("stressTest")&&{level:"Bird",perks:{shocks:10,multiball:6,telekinesis:2,ghost_coins:1,pierce:4,clairvoyant:3,bigger_explosions:2,sapper:2,unbounded:1},levelsPerLoop:2}||{}),function e(){var r=performance.now(),t=r-rJ.lastTick;rJ.lastTick=r;var _=Math.min(4,t/(1e3/60));rJ.keyboardPuckSpeed&&rn(rJ,rJ.puckPosition+rJ.keyboardPuckSpeed),rl(rJ),rJ.running&&(rJ.levelTime+=t,rJ.runStatistics.runTime+=t,function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;e.runStatistics.max_combo=Math.max(e.runStatistics.max_combo,e.combo),e.balls=e.balls.filter(function(e){return!e.destroyed});var t=e.bricks.filter(function(e){return e&&"black"!==e}).length;e.levelTime>e.lastTickDown+1e3&&e.perks.hot_start&&(e.lastTickDown=e.levelTime,ri(e,e.perks.hot_start,e.puckPosition,e.gameZoneHeight-2*e.puckHeight)),t<=e.perks.skip_last&&!e.autoCleanUses&&(e.bricks.forEach(function(r,t){r&&rp(e,t,e.balls[0],!0)}),e.autoCleanUses++);var _=rz(e.respawns);if(!e.running||t||_?e.winAt=0:e.winAt||(e.winAt=e.levelTime+5e3),e.running&&e.winAt&&e.levelTime>e.winAt||e.levelTime&&!t&&!rz(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+=r*t.weight*.8*(i?-e.perks.helium:1),i&&!$("basic")&&.1>Math.random()&&rW(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=rk(e,t,t.size/2,r);t.y>e.gameZoneHeight-n-e.puckHeight&&t.ye.highScore&&!e.isCreativeModeRun&&(e.highScore=e.score,localStorage.setItem("breakout-3-hs",e.score.toString())),$("basic")||rW(e,t.previousX,t.previousY,(e.canvasWidth-t.x)/100,-t.y/100,t.color,!0,e.coinSize/2,100+50*Math.random()),rm(e,"coinCatch",t.x,1),e.runStatistics.score+=t.points,e.perks.asceticism&&ro(e,t.x,t.y),rS(e.coins,_)):t.y>e.canvasHeight+n?(e.levelLostCoins+=t.points,rS(e.coins,_),e.perks.compound_interest&&ro(e,t.x,t.y)):e.perks.unbounded&&(t.x<-e.gameZoneWidth/2||t.x>e.canvasWidth+e.gameZoneWidth/2||t.y<-e.gameZoneWidth)&&(e.levelLostCoins+=t.points,rS(e.coins,_));var p=function(e,r){var t,_,n=r.size/2,a=r.x,l=r.y,s=r.previousX,o=r.previousY,i=rC(s,l,n),u=rC(a,o,n),c=void 0===i&&void 0===u&&rC(a,l,n)||void 0;if(e.perks.ghost_coins)void 0!==(null!==(t=null!=i?i:u)&&void 0!==t?t:c)&&(r.vy*=1-.2/e.perks.ghost_coins,r.vx*=1-.2/e.perks.ghost_coins);else{if(void 0!==i||void 0!==c){r.y=r.previousY,r.vy*=-1;var p=e.bricks[rL(a-n,l+n)],d=e.bricks[rL(a+n,l+n)];p&&!d&&(r.vx+=1,r.sa-=1),!p&&d&&(r.vx-=1,r.sa+=1)}(void 0!==u||void 0!==c)&&(r.x=r.previousX,r.vx*=-1)}return null!==(_=null!=i?i:u)&&void 0!==_?_: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--,rm(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&&rm(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,r,t){r.previousVX=r.vx,r.previousVY=r.vy;var _,n=1+e.perks.telekinesis+e.perks.ball_repulse_ball+e.perks.puck_repulse_ball+e.perks.ball_attract_ball;ey(e,r)&&(n+=3,r.vx+=(e.puckPosition-r.x)/1e3*t*e.perks.telekinesis),ek(e,r)&&(n+=3,r.vx+=(e.puckPosition-r.x)/1e3*t*e.perks.yoyo),r.vx*r.vx+r.vy*r.vy0?1:-1)*.02/n);var a=!0,l=!1,s=void 0;if(e.perks.ball_repulse_ball)try{for(var o,i=e.balls[Symbol.iterator]();!(a=(o=i.next()).done);a=!0){var u=o.value;u.x>=r.x||ry(e,r,u,e.perks.ball_repulse_ball,!0)}}catch(e){l=!0,s=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw s}}var c=!0,p=!1,d=void 0;if(e.perks.ball_attract_ball)try{for(var m,h=e.balls[Symbol.iterator]();!(c=(m=h.next()).done);c=!0){var g=m.value;g.x>=r.x||function(e,r,t,_){var n=ew(r,t),a=3*e.gameZoneWidth/4;if(!(ne.offsetX+e.gameZoneWidth/2&&ro(e,r.x,r.y),e.perks.top_is_lava&&b>=2&&ro(e,r.x,r.y+e.ballSize),e.perks.trampoline&&b>=2&&ri(e,e.perks.trampoline,r.x,r.y+e.ballSize),rm(e,"wallBeep",r.x,1),e.levelWallBounces++,e.runStatistics.wall_bounces++);var v=e.gameZoneHeight-e.puckHeight-e.ballSize/2,f=Math.abs(r.x-e.puckPosition)v&&r.vy>0&&(f||e.perks.extra_life&&r.y>v+e.puckHeight/2)){if(f){var y=Math.sqrt(r.vx*r.vx+r.vy*r.vy),k=Math.atan2(-e.puckWidth/2,(r.x-e.puckPosition)*(e.perks.concave_puck?-1/(1+e.perks.concave_puck):1));r.vx=y*Math.cos(k),r.vy=y*Math.sin(k),rm(e,"wallBeep",r.x,1)}else r.vy*=-1,function(e,r,t,_){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,_){return t&&rp(e,_,r,!0)})),rm(e,"lifeLost",r.x,1),!$("basic"))for(var n=0;n<10;n++)rW(e,t,_,Math.random()*e.baseSpeed*3,3*e.baseSpeed,"red",!1,e.coinSize/2,150)}(e,r,r.x,r.y);if(e.perks.streak_shots&&ro(e,r.x,r.y),e.perks.trampoline&&(e.combo+=e.perks.trampoline),e.perks.nbricks&&r.brokenSinceBouncee.canvasWidth+e.gameZoneWidth/2,x=e.perks.unbounded>1&&r.y<-e.gameZoneWidth/2;e.running&&(r.y>e.gameZoneHeight+e.ballSize/2||w||x)&&(r.destroyed=!0,e.runStatistics.balls_lost++,e.balls.find(function(e){return!e.destroyed})||e5(T("gameOver.lost.title"),T("gameOver.lost.summary",{score:e.score})));var S=e.ballSize/2,z=r.x,M=r.y,G=r.previousX,B=r.previousY,H=rC(G,M,S),q=rC(z,B,S),R=void 0===H&&void 0===q&&rC(z,M,S)||void 0,L=null!==(_=null!=H?H:q)&&void 0!==_?_:R;if(void 0!==L){r.hitSinceBounce++;var P=!1,C=1+(e.perks.pierce_color&&(void 0===H||e.bricks[H]===e.ballsColor)&&(void 0===q||e.bricks[q]===e.ballsColor)&&(void 0===R||e.bricks[R]===e.ballsColor)?e.perks.pierce_color:0);e.brickHP[L]-=C;var O=Math.min(r.piercePoints,Math.max(1,e.brickHP[L]));if(e.brickHP[L]-=O,r.piercePoints-=O,e.brickHP[L]<0&&(e.brickHP[L]=0,P=!0),void 0===H&&void 0===R||P||(r.y=r.previousY,r.vy*=-1),void 0===q&&void 0===R||P||(r.x=r.previousX,r.vx*=-1),e.brickHP[L])rm(e,"wallBeep",z,1),function(e,r,t,_){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:8,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:150;rx(e.lights,function(l){l.time=e.levelTime,l.x=r,l.y=t,l.color=_,l.size=n,l.duration=a})}(e,ep(e,L),ed(e,L),"white",e.brickWidth+2,50*e.brickHP[L]);else{var A=e.bricks[L];r.brokenSinceBounce++,rp(e,L,r,!1),r.sapperUses.1/(1+Z)||D&&Math.random()>.1/(1+D)||Z&&Math.random()>.1/(1+Z)){var V=D?Math.random()>.5?"orange":"red":e.ballsColor;rW(e,r.x,r.y,e.perks.pierce_color||E?-r.vx+(Math.random()-.5)*e.baseSpeed/3:(Math.random()-.5)*e.baseSpeed,e.perks.pierce_color||E?-r.vy+(Math.random()-.5)*e.baseSpeed/3:(Math.random()-.5)*e.baseSpeed,V,!0,e.coinSize/2,100)}}}(e,t,r)}),e.perks.shocks&&e.balls.forEach(function(r,t){return e.balls.forEach(function(_,n){if(t.5&&rW(e,e.offsetXRoundedDown+Math.random()*e.gameZoneWidthRoundedUp,Math.random()*e.gameZoneHeight,8*a,0,rf(),!0,e.coinSize/2,150);rG(e.particles,function(t,_){t.x+=t.vx*r,t.y+=t.vy*r,!t.ethereal&&(t.vy+=.5,rP(rL(t.x,t.y))&&rS(e.particles,_))})}if(e.combo>rs(e)&&!$("basic")&&(e.combo-rs(e))*Math.random()>5){if(e.perks.top_is_lava&&rW(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&&rW(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&&rW(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 s=e.puckPosition,o=0;do s=e.offsetXRoundedDown+e.gameZoneWidthRoundedUp*Math.random(),o++;while(Math.abs(s-e.puckPosition)r.time)rv(e,r.index,r.color),rS(e.respawns,t);else if(!$("basic")){var _=r.index,n=r.color,a=Math.random()>.5,l=Math.random()>.5?1:-1,s=Math.random()>.5?1:-1;rW(e,ep(e,_)+l*e.brickWidth/2,ed(e,_)+s*e.brickWidth/2,a?0:-l*e.baseSpeed,a?-s*e.baseSpeed:0,n,!0,e.coinSize/2,250)}}),rG(e.particles,function(r,t){e.levelTime>r.time+r.duration&&rS(e.particles,t)}),rG(e.texts,function(r,t){e.levelTime>r.time+r.duration&&rS(e.texts,t)}),rG(e.lights,function(r,t){e.levelTime>r.time+r.duration&&rS(e.lights,t)})}(rJ,_)),(rJ.running||rJ.needsRender)&&(rJ.needsRender=!1,function(e){var r=ef(e),t=e.combo>rs(e),_=eG.width,n=eG.height;if(_&&n){e.currentLevel||e.levelTime?ej.innerText=e.loop?T("play.current_lvl_loop",{level:e.currentLevel+1,max:eg(e),loop:e.loop}):T("play.current_lvl",{level:e.currentLevel+1,max:eg(e)}):ej.innerText=T("play.menu_label");var a=e.levelSpawnedCoins?(e.levelSpawnedCoins-e.levelLostCoins)/e.levelSpawnedCoins:1;if(eV.innerHTML=($("show_fps")?' \n Math.abs(rT-60)&&"good"||"bad",'">\n ').concat(rT," FPS\n / \n \n "):"")+($("show_stats")?' \n .9&&"good"||"",'">\n ').concat(Math.floor(100*a),'%\n / \n \n ').concat(e.levelWallBounces,' B \n / \n \n ').concat(Math.ceil(e.levelTime/1e3),'s \n / \n \n ').concat(e.levelMisses," M\n / \n "):"")+"$".concat(e.score),eV.className=e.lastScoreIncrease>e.levelTime-500?"active":"",$("basic")||r.color||!r.svg)eB.globalAlpha=1,eB.globalCompositeOperation="source-over",eB.fillStyle=r.color||"#000",eB.fillRect(0,0,_,n),rG(e.particles,function(r){var t=r.x,_=r.y,n=r.time,a=r.color,l=r.size,s=r.duration;eB.globalAlpha=Math.min(1,2-(e.levelTime-n)/s*2),eT(eB,a,l,t,_)});else if(eB.globalCompositeOperation="source-over",eB.globalAlpha=1,eB.fillStyle="#000",eB.fillRect(0,0,_,n),eB.globalCompositeOperation="screen",eB.globalAlpha=.6,rG(e.coins,function(r){eE(eB,r.color,2*e.coinSize,r.x,r.y)}),e.balls.forEach(function(r){eE(eB,e.ballsColor,2*e.ballSize,r.x,r.y)}),eB.globalAlpha=.5,e.bricks.forEach(function(r,t){if(r){var _=ep(e,t),n=ed(e,t);eE(eB,"black"==r?"#666":r,e.brickWidth,_,n)}}),eB.globalAlpha=1,rG(e.particles,function(r){var t=r.x,_=r.y,n=r.time,a=r.color,l=r.size,s=r.duration;eB.globalAlpha=Math.min(1,2-(e.levelTime-n)/s*2),eE(eB,a,3*l,t,_)}),eB.globalAlpha=.2,eB.globalCompositeOperation="multiply",eB.fillStyle="black",eB.fillRect(0,0,_,n),eB.globalAlpha=.8,eB.globalCompositeOperation="multiply",r.svg&&eq.width&&eq.complete){if(eR.title!==r.name){eR.title=r.name,eR.width=e.canvasWidth,eR.height=e.canvasHeight;var l=eR.getContext("2d");if(l.fillStyle=r.color||"#000",l.fillRect(0,0,e.canvasWidth,e.canvasHeight),e.perks.clairvoyant>=3)for(var s=document.body.innerHTML.replace(/\s+/gi,""),o=Math.ceil(e.canvasWidth/15),i=Math.ceil(e.canvasHeight/20),u=Math.ceil(Math.random()*(s.length-o*i)),c=0;crs(rJ),r=e&&rJ.perks.picky_eater&&!$("basic"),t=!!(rJ.lastPuckMove&&rJ.perks.passive_income&&e&&rJ.lastPuckMove>rJ.levelTime-250*rJ.perks.passive_income),_=eX(rJ);r||t||rJ.perks.reach||rJ.perks.zen||(_=0);var n=rJ.perks.clairvoyant&&rJ.brickHP.reduce(function(e,r){return e+r},0),a=rJ.gameZoneWidth+"_"+rJ.bricks.join("_")+eH.complete+"_"+r+"_"+t+"_"+rJ.ballsColor+"_"+rJ.perks.pierce_color+"_"+n+"_"+_;if(a!==eC){eC=a,eP.width=rJ.gameZoneWidth,eP.height=rJ.gameZoneWidth+1;var l=eP.getContext("2d");l.clearRect(0,0,rJ.gameZoneWidth,rJ.gameZoneWidth),l.resetTransform(),l.translate(-rJ.offsetX,0),rJ.bricks.forEach(function(n,a){var s=ep(rJ,a),o=ed(rJ,a);if(n){var i=rJ.perks.reach&&ex(rJ,a)&&!eS(rJ,a),u=rJ.ballsColor!==n&&"black"!==n&&r||e&&rJ.perks.zen&&"black"===n||i||t;l.globalCompositeOperation="source-over",eD(l,n,s,o,u?_:-1,rJ.perks.clairvoyant>=2),rJ.brickHP[a]>1&&rJ.perks.clairvoyant&&(l.globalCompositeOperation="destination-out",eZ(l,rJ.brickHP[a].toString(),"white",rJ.puckHeight,s,o)),"black"===n&&(l.globalCompositeOperation="source-over",function(e,r,t,_,n){var a="svg"+r+"_"+t+"_"+r.complete;if(!eO[a]){var l=document.createElement("canvas");l.width=t,l.height=t;var s=l.getContext("2d"),o=t/Math.max(r.width,r.height),i=r.width*o,u=r.height*o;s.drawImage(r,(t-i)/2,(t-u)/2,i,u),eO[a]=l}e.drawImage(eO[a],Math.round(_-t/2),Math.round(n-t/2))}(l,eH,rJ.brickWidth,s,o))}})}eB.drawImage(eP,rJ.offsetX,0)}(),eB.globalCompositeOperation="screen",rG(e.lights,function(r){var t=r.x,_=r.y,n=r.time,a=r.color,l=(r.size,r.duration);eB.globalAlpha=.5*Math.min(1,2-(e.levelTime-n)/l*2),eD(eB,a,t,_,-1,e.perks.clairvoyant>=2)}),eB.globalCompositeOperation="screen",rG(e.texts,function(r){var t=r.x,_=r.y,n=r.time,a=r.color,l=r.size,s=r.duration,o=e.levelTime-n;eB.globalAlpha=Math.max(0,Math.min(1,2-o/s*2)),eB.globalCompositeOperation="source-over",eZ(eB,r.text,a,l,t,_-o/10)}),rG(e.particles,function(r){var t=r.x,_=r.y,n=r.time,a=r.color,l=r.size,s=r.duration;eB.globalAlpha=Math.max(0,Math.min(1,2-(e.levelTime-n)/s*2)),eB.globalCompositeOperation="screen",eT(eB,a,l,t,_),eE(eB,a,l,t,_)}),e.perks.extra_life){eB.globalAlpha=1,eB.globalCompositeOperation="source-over",eB.fillStyle=e.puckColor;for(var g=0;g4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0,s="puck"+r+"_"+t+"_"+_+"_"+a+"_"+l;if(!eO[s]){var o=document.createElement("canvas");o.width=t,o.height=2*_;var i=o.getContext("2d");i.fillStyle=r,i.beginPath(),i.moveTo(0,2*_),a?(i.lineTo(0,.75*_),i.bezierCurveTo(t/2,_*(2+a)/3,t/2,_*(2+a)/3,t,.75*_)):(i.lineTo(0,1.25*_),i.bezierCurveTo(0,.75*_,t,.75*_,t,1.25*_)),i.lineTo(t,2*_),i.fill(),-1!==l&&(i.strokeStyle="red",i.lineWidth=4,i.setLineDash(eF),i.lineDashOffset=l,i.stroke()),eO[s]=o}e.drawImage(eO[s],Math.round(rJ.puckPosition-t/2),rJ.gameZoneHeight-2*_+n)}(eB,e.puckColor,e.puckWidth,e.puckHeight,0,e.perks.concave_puck,e.perks.streak_shots&&t?eX(e):-1),e.combo>1){eB.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)}eB.globalCompositeOperation="source-over",eB.globalAlpha=e.perks.unbounded?.1:1,e.offsetXRoundedDown?(eB.fillStyle=t&&e.perks.left_is_lava?"red":e.puckColor,eL(eB,e,t&&e.perks.left_is_lava&&!e.perks.unbounded&&"red"||"white",e.offsetX-1,0,e.offsetX-1,n,e.perks.unbounded?.1:1),eL(eB,e,t&&e.perks.right_is_lava&&!e.perks.unbounded&&"red"||"white",_-e.offsetX+1,0,_-e.offsetX+1,n,e.perks.unbounded?.1:1)):(eB.fillStyle="red",eL(eB,e,t&&e.perks.left_is_lava&&!e.perks.unbounded&&"red"||"",0,0,0,n,1),eL(eB,e,t&&e.perks.right_is_lava&&!e.perks.unbounded&&"red"||"",_-1,0,_-1,n,1)),eB.globalAlpha=e.perks.unbounded>1?.1:1,eL(eB,e,t&&e.perks.top_is_lava&&"red"||"",e.offsetXRoundedDown,1,_-e.offsetXRoundedDown,1,1),eB.globalAlpha=1,eL(eB,e,t&&e.perks.compound_interest&&"red"||$("mobile-mode")&&"white"||"",e.offsetXRoundedDown,e.gameZoneHeight,_-e.offsetXRoundedDown,e.gameZoneHeight,1),$("mobile-mode")&&!e.running&&eZ(eB,T("play.mobile_press_to_play"),e.puckColor,e.puckHeight,e.canvasWidth/2,e.gameZoneHeight+(e.canvasHeight-e.gameZoneHeight)/2),m&&eB.resetTransform()}}(rJ)),rJ.running&&function(e){if($("record")){var r;s&&(r=e,u&&(u.drawImage(eG,r.offsetXRoundedDown,0,r.gameZoneWidthRoundedUp,r.gameZoneHeight,0,0,i.width,i.height),u.fillStyle="#FFF",u.textBaseline="top",u.font="12px monospace",u.textAlign="right",u.fillText(r.score.toString(),i.width-12,12),u.textAlign="left",u.fillText("Level "+(r.currentLevel+1)+"/"+eg(r),12,12)),(null==o?void 0:o.requestFrame)?null==o||o.requestFrame():(null==s?void 0:s.requestFrame)&&s.requestFrame())}}(rJ),$("sound")&&function(e){if(!(er>Date.now()-60))for(var r in er=Date.now(),e.aboutToPlaySound){var t,_=e.aboutToPlaySound[r];_.vol&&(et[r](Math.min(2,_.vol),(t=e,Math.max(0,Math.min(1,(_.x-t.offsetXRoundedDown)/t.gameZoneWidthRoundedUp))),e.combo),_.vol=0)}}(rJ),requestAnimationFrame(e),rO++}()}();