!function(e){var o={};function i(a){if(o[a])return o[a].exports;var r=o[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=o,i.d=function(e,o,a){i.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:a})},i.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},i.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(o,"a",o),o},i.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},i.p="",i(i.s=15)}([function(e,o,i){!function(){"use strict";var o=i(8);e.exports=function(e){return o[e]?escapeHtml(o[e][0]):"Unknown Game"}}()},,,,,,function(e,o,i){!function(){"use strict";function o(e){this.el=e,this.currentlyBinding=!1,this.initialHTML=e.innerHTML,this.el.addEventListener("keydown",this.onKeyDown.bind(this)),this.paused=!1}o.prototype=Object.create(Object.prototype),o.prototype.constructor=o,o.prototype.setPausedState=function(e){this.paused=e,this.el.querySelector(".load-rom-section").style.display=e?"none":"",this.el.querySelector(".paused-section").style.display=e?"":"none"},o.prototype.reset=function(){var e;this.el.innerHTML=this.initialHTML,this.currentlyBinding=!1;var o=this.el.querySelector(".saves-list"),a="",r=window.vbaSaves.listSaves();for(e=0;e";r.length||(a+=""),window.isShittyLocalstorage&&(a+=""),a+="
["+r[e].romCode+"] "+i(0)(r[e].romCode)+"ExportDelete
None
Saving will not be possible because the 'LocalStorage'
feature of your browser is disabled.
",o.innerHTML=a;var s=this.el.querySelector(".keyboard-bindings"),n="",t=window.vbaInput.listBindings();function m(e){return e.join(", ").replace(/Key/im,"Key ").replace(/Arrow/im,"Arrow ").replace(/Digit/im,"Digit ").replace(/Numpad/im,"Numpad ").replace(/Left/im," Left").replace(/Right/im," Right")}for(e=0;e","PAUSE"===t[e].name&&(this.el.querySelector(".unpause-key-prompt").innerText=m(t[e].codes));n+="
"+t[e].friendlyName+""+m(t[e].codes)+"Rebind
",s.innerHTML=n,this.setPausedState(this.paused)},o.prototype.export=function(){vbaSaves.exportSave()},o.prototype.onKeyDown=function(e){if(this.currentlyBinding){var o=vbaInput.bindings[this.currentlyBinding].codes.join();vbaInput.setBinding(this.currentlyBinding,e.code,e.keyCode);var i=vbaInput.bindings[this.currentlyBinding].codes.join();gtag("event","rebind_key_1",{event_label:"Change "+this.currentlyBinding+" from "+o+" to "+i}),this.reset()}},o.prototype.startRebinding=function(e,o){this.currentlyBinding=o,this.el.querySelectorAll(".rebind-key-button").forEach(function(e){e.innerText="Rebind"}),e.innerText="Rebinding..."},o.prototype.resetBindings=function(){gtag("event","reset_bindings_1",{}),vbaInput.resetBindings(),this.reset()},o.prototype.exportSave=function(e){vbaSaves.exportSave(e),this.reset(),gtag("event","export_save_1",{event_label:e+" "+i(0)(e)})},o.prototype.deleteSave=function(e){var o=modal("Are you sure you want to delete your save for ["+e+"] "+i(0)(e)+"?",{title:"Confirm Deletion",leftButtonText:"Delete",leftButtonFn:function(){vbaSaves.deleteSave(e),this.reset(),gtag("event","delete_save_1",{event_label:e+" "+i(0)(e)})}.bind(this),rightButtonText:"Cancel",rightButtonFn:function(){o.hideModal()}})},e.exports=o}()},function(e,o){!function(){"use strict";var o={};function i(){this.downCodes={},this.downKeyCodes={},window.addEventListener("keydown",function(e){var o=this.isKeyDown(this.bindings.PERF_STATS),i=this.isKeyDown(this.bindings.PAUSE);this.downCodes[e.code]=1,this.downKeyCodes[e.keyCode]=1;var a=this.isKeyDown(this.bindings.PERF_STATS);!o&&a&&window.doPerfCalc();var r=this.isKeyDown(this.bindings.PAUSE);return!i&&r&&window.togglePause(),!1}.bind(this)),window.addEventListener("keyup",function(e){var o=this.isKeyDown(this.bindings.PERF_STATS);this.downCodes[e.code]=0,this.downKeyCodes[e.keyCode]=0;var i=this.isKeyDown(this.bindings.PERF_STATS);return o&&!i&&window.doPerfCalc(),!1}.bind(this)),this.bindings=null,this.loadBindings(),null===this.bindings&&this.resetBindings()}o.KEY_BUTTON_A={friendlyName:"A",codes:["KeyZ"],keyCodes:[90]},o.KEY_BUTTON_B={friendlyName:"B",codes:["KeyX"],keyCodes:[88]},o.KEY_BUTTON_SELECT={friendlyName:"Select",codes:["Backspace"],keyCodes:[8]},o.KEY_BUTTON_START={friendlyName:"Start",codes:["Enter"],keyCodes:[13]},o.KEY_RIGHT={friendlyName:"Right",codes:["ArrowRight"],keyCodes:[39]},o.KEY_LEFT={friendlyName:"Left",codes:["ArrowLeft"],keyCodes:[37]},o.KEY_UP={friendlyName:"Up",codes:["ArrowUp"],keyCodes:[38]},o.KEY_DOWN={friendlyName:"Down",codes:["ArrowDown"],keyCodes:[40]},o.KEY_BUTTON_R={friendlyName:"R",codes:["Control"],keyCodes:[17]},o.KEY_BUTTON_L={friendlyName:"L",codes:["Shift"],keyCodes:[16]},o.PERF_STATS={friendlyName:"Performance Stats",codes:["Backquote"],keyCodes:[192]},o.PAUSE={friendlyName:"Pause",codes:["Escape"],keyCodes:[27]},i.prototype=Object.create(Object.prototype),i.prototype.constructor=i,i.prototype.listBindings=function(){return Object.keys(this.bindings).map(function(e){return{name:e,friendlyName:this.bindings[e].friendlyName,codes:this.bindings[e].codes}}.bind(this))},i.prototype.setBinding=function(e,o,i){this.bindings[e].codes=[o],this.bindings[e].keyCodes=[i],this.saveBindings()},i.prototype.loadBindings=function(e){if(this.bindings=JSON.parse(localStorage.VBABindings||"null")||o,Object.keys(this.bindings).sort().join()!==Object.keys(o).sort().join()){if(e)return;this.resetBindings(!0)}},i.prototype.saveBindings=function(){localStorage.VBABindings=JSON.stringify(this.bindings)},i.prototype.resetBindings=function(e){this.bindings=o,this.saveBindings(),this.loadBindings(e)},i.prototype.isKeyDown=function(e){var o;for(o=0;o