parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),h=n.call(a,"finallyLoc");if(u&&h){if(this.prev=0;--e){var o=this.tryEntries[e];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),O(e),y}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;O(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:G(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),y}},t}("object"==typeof module?module.exports:{});try{regeneratorRuntime=t}catch(r){Function("r","regeneratorRuntime = r")(t)} },{}],"NFhs":[function(require,module,exports) { module.exports=require("regenerator-runtime"); },{"regenerator-runtime":"SM7r"}],"fNvc":[function(require,module,exports) { function n(n,t,o,r,e,i,u){try{var c=n[i](u),v=c.value}catch(a){return void o(a)}c.done?t(v):Promise.resolve(v).then(r,e)}function t(t){return function(){var o=this,r=arguments;return new Promise(function(e,i){var u=t.apply(o,r);function c(t){n(u,e,i,c,v,"next",t)}function v(t){n(u,e,i,c,v,"throw",t)}c(void 0)})}}module.exports=t; },{}],"vKFU":[function(require,module,exports) { },{}],"rEFh":[function(require,module,exports) { module.exports="/debugger-ui/blue-icon.7726c7b7.png"; },{}],"LwPU":[function(require,module,exports) { module.exports="/debugger-ui/gray-icon.c1916de4.png"; },{}],"iMdP":[function(require,module,exports) { module.exports="/debugger-ui/orange-icon.f455ca44.png"; },{}],"Focm":[function(require,module,exports) { "use strict";var e=a(require("@babel/runtime/regenerator")),t=a(require("@babel/runtime/helpers/asyncToGenerator"));require("./index.css");var n=a(require("./assets/blue-icon.png")),i=a(require("./assets/gray-icon.png")),r=a(require("./assets/orange-icon.png"));function a(e){return e&&e.__esModule?e:{default:e}}var o=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),s=o?"⌘R":"Ctrl R";window.onload=function(){o||(document.getElementById("shortcut").innerHTML="Ctrl⇧J"),c.render()},window.onReloadClicked=function(){var e=new XMLHttpRequest;e.open("GET","".concat(window.location.origin,"/reload"),!0),e.send()};var c=window.Page={state:{isDark:null===localStorage.getItem("darkTheme")?window.matchMedia("(prefers-color-scheme: dark)").matches:"on"===localStorage.getItem("darkTheme"),isPriorityMaintained:"on"===localStorage.getItem("maintainPriority"),status:{type:"disconnected"},visibilityState:document.visibilityState},setState:function(e){c.state=Object.assign({},c.state,e),c.render()},render:function(){var e=c.state,t=e.isDark,a=e.isPriorityMaintained,o=e.status,d=e.visibilityState,u=document.getElementById("status");switch(o.type){case"connected":u.innerHTML="Debugger session #"+o.id+" active.";break;case"error":u.innerHTML=o.error.reason||"Disconnected from proxy. Attempting reconnection. Is node server running?";break;case"connecting":case"disconnected":default:u.innerHTML='Waiting, press '+s+" in simulator to reload and connect."}var l=document.querySelector("link[rel=icon]");"disconnected"===o.type||"error"===o.type?l.href=i.default:l.href="visible"===d||a?n.default:r.default;var g=document.getElementById("dark");document.body.classList.toggle("dark",t),g.checked=t,localStorage.setItem("darkTheme",t?"on":"");var m=document.getElementById("maintain-priority"),y=document.getElementById("silence");y.volume=.1,a?y.play():y.pause(),m.checked=a,localStorage.setItem("maintainPriority",a?"on":"")},toggleDarkTheme:function(){c.setState({isDark:!c.state.isDark})},togglePriorityMaintenance:function(){c.setState({isPriorityMaintained:!c.state.isPriorityMaintained})}};function d(){var n,i=new WebSocket("ws://"+window.location.host+"/debugger-proxy?role=debugger&name=Chrome");function r(){n&&(n.terminate(),n=null,window.onbeforeunload=null)}function a(){n&&!c.state.isPriorityMaintained&&n.postMessage({method:"setDebuggerVisibility",visibilityState:document.visibilityState}),c.setState({visibilityState:document.visibilityState})}i.onopen=function(){c.setState({status:{type:"connecting"}})},i.onmessage=function(){var o=(0,t.default)(e.default.mark(function t(o){var d;return e.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o.data){e.next=2;break}return e.abrupt("return");case 2:if("client-disconnected"!==(d=JSON.parse(o.data)).$event){e.next=7;break}return r(),c.setState({status:{type:"disconnected"}}),e.abrupt("return");case 7:if(d.method){e.next=9;break}return e.abrupt("return");case 9:"prepareJSRuntime"===d.method?(r(),console.clear(),(n=new Worker("/debugger-ui/debuggerWorker.aca173c4.js")).onmessage=function(e){i.send(JSON.stringify(e.data))},window.onbeforeunload=function(){return"If you reload this page, it is going to break the debugging session. Press "+s+" on the device to reload."},a(),i.send(JSON.stringify({replyID:d.id})),c.setState({status:{type:"connected",id:d.id}})):"$disconnected"===d.method?(r(),c.setState({status:{type:"disconnected"}})):n.postMessage(d);case 10:case"end":return e.stop()}},t)}));return function(e){return o.apply(this,arguments)}}(),i.onclose=function(e){r(),c.setState({status:{type:"error",error:e}}),e.reason&&console.warn(e.reason),setTimeout(d,500)},document.addEventListener("visibilitychange",a,!1)}d(); },{"@babel/runtime/regenerator":"NFhs","@babel/runtime/helpers/asyncToGenerator":"fNvc","./index.css":"vKFU","./assets/blue-icon.png":"rEFh","./assets/gray-icon.png":"LwPU","./assets/orange-icon.png":"iMdP","./debuggerWorker.js":[["debuggerWorker.aca173c4.js","sYUN"],"debuggerWorker.aca173c4.js.map","sYUN"]}]},{},["Focm"], null) //# sourceMappingURL=/debugger-ui/ui.e31bb0bc.js.map