From a1030bc324bcb1068db762f172c80526aed8137e Mon Sep 17 00:00:00 2001
From: Mafrans
Date: Thu, 21 May 2020 17:34:19 +0200
Subject: [PATCH] 2.3.3
---
dist/app.js | 4 ++--
dist/popup.js | 8 ++++----
manifest.json | 2 +-
src/popup/src/App.vue | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/dist/app.js b/dist/app.js
index 6ec8802e..cb8f5ef8 100644
--- a/dist/app.js
+++ b/dist/app.js
@@ -1,2 +1,2 @@
-!function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=90)}([function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var i=n(2),o=n(1),a=n(6),s=n(7),r=n(8),l=n(9),c=n(10),d=n(11),p=n(12),u=n(13),h=n(14),m=n(15),f=n(16),g=(window.chrome,function(){function e(e,t,n){this.data={},this.tag=t,this.name=e,this.data=n}return e.prototype.register=function(){e.languages.push(this)},e.prototype.get=function(e,t){for(var n=e.split(/\./g),i=this.data,o=0,a=n;o=5&&(void 0===e.default||t!==e.default.tag)}))},e.init=function(){new e("Deutsche (DE)","de-DE",d).register(),new e("Español (ES)","es-ES",c).register();var t=new e("English (US)","en-US",a);t.register(),t.setDefault(),new e("Français (FR)","fr-FR",r).register(),new e("Italiano (IT)","it-IT",l).register(),new e("Svenska (SE)","sv-SE",s).register(),new e("Українська (UA)","uk-UA",p).register(),new e("Euskara (EU)","eu-ES",u).register(),new e("Galego (GL)","gl-ES",h).register(),new e("русский (RU)","ru-RU",m).register(),new e("Nederlands (BE)","nl-BE",f).register()},e.get=function(e,t){return void 0===this.current&&(this.current=this.default),this.current.get(e,t)},e.languages=[],e}())},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return s}));var i=window.chrome,o=function(){function e(e,t){this.name=e,this.tag=t}return e.prototype.get=function(e){void 0===e&&(e=function(){}),i.storage.local.get([this.tag],e)},e.prototype.set=function(e,t){var n;void 0===t&&(t=function(){}),i.storage.local.set(((n={})[this.tag]=e,n),t)},e.get=function(e,t){void 0===t&&(t=function(){}),i.storage.local.get(e.map((function(e){return e.tag})),t)},e.set=function(e,t){void 0===t&&(t=function(){}),i.storage.local.set(e,t)},e.clear=function(){i.storage.local.clear()},e.CODEC=new e("Codec","codec"),e.RESOLUTION=new e("Resolution","resolution"),e.MONITOR_STATS=new e("Monitor Stats","monitor-stats"),e.CACHE_VERSION=new e("Cache Version","cache-version"),e}(),a=function(){function e(e,t){this.name=e,this.tag=t}return e.prototype.get=function(e){void 0===e&&(e=function(){}),i.storage.sync.get([this.tag],e)},e.prototype.set=function(e,t){var n;void 0===t&&(t=function(){}),i.storage.sync.set(((n={})[this.tag]=e,n),t)},e.get=function(e,t){void 0===t&&(t=function(){}),i.storage.sync.get(e.map((function(e){return e.tag})),t)},e.set=function(e,t){void 0===t&&(t=function(){}),i.storage.sync.set(e,t)},e.clear=function(){i.storage.sync.clear()},e.LIBRARY_GAMES=new e("Library Games","games"),e.LIBRARY_SORT_ORDER=new e("Sort Order","sort-order"),e.LIBRARY_SORT_DIRECTION=new e("Sort Direction","sort-direction"),e.LANGUAGE=new e("Language","language"),e.COMPONENTS=new e("Components","components"),e}(),s=function(){function e(e){this.appdata=e}return e.prototype.checkCacheVersion=function(e){var t=this;o.CACHE_VERSION.get((function(e){var n=e[o.CACHE_VERSION.tag];(void 0===n||t.appdata["cache-version"]>n)&&(t.appdata["clear-keys"].local.forEach((function(e){var t;o.set(((t={})[e]=null,t))})),t.appdata["clear-keys"].sync.forEach((function(e){var t;a.set(((t={})[e]=null,t))}))),o.CACHE_VERSION.set(t.appdata["cache-version"])}))},e}()},function(e,t,n){"use strict";var i="[Stadia+]",o=function(){this.info=function(){for(var e=[],t=0;t=window.innerHeight?"above":n?t:"below"},t.debounce=function(e,t,n){var i;return void 0===t&&(t=100),void 0===n&&(n=!1),function(){for(var o=[],a=0;a[^<>]*)","i");if(!e.match(o))return e;var a=e.match(o).index,s=a+e.match(o)[0].toString().length,r=e.substring(a,s);return i.replace(o,''+r+" ")},"function"!=typeof(o=window).CustomEvent&&(i.prototype=o.Event.prototype,o.CustomEvent=i)},function(e,t,n){"use strict";t.__esModule=!0;var i=(o.prototype.newOption=function(e){return{id:e.id?e.id:String(Math.floor(1e8*Math.random())),value:e.value?e.value:"",text:e.text?e.text:"",innerHTML:e.innerHTML?e.innerHTML:"",selected:!!e.selected&&e.selected,display:void 0===e.display||e.display,disabled:!!e.disabled&&e.disabled,placeholder:!!e.placeholder&&e.placeholder,class:e.class?e.class:void 0,data:e.data?e.data:{}}},o.prototype.add=function(e){this.data.push({id:String(Math.floor(1e8*Math.random())),value:e.value,text:e.text,innerHTML:"",selected:!1,display:!0,disabled:!1,placeholder:!1,class:void 0,data:{}})},o.prototype.parseSelectData=function(){this.data=[];for(var e=0,t=this.main.select.element.childNodes;e2096103.424&&h!==u))return navigator.msSaveBlob?navigator.msSaveBlob(g(c),m):b(c);l=(c=g(c)).type||r}function g(e){for(var t=e.split(/[:;,]/),n=t[1],i=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),o=i.length,a=0,s=new Uint8Array(o);ac-wiz");this.renderer=Array.from(e).find((function(e){return"0"!==e.style.opacity}))},e.prototype.exists=function(){return"0"!==this.renderer.style.opacity&&null!==document.querySelector("#"+this.id)},e.prototype.unload=function(){this.onStop()},e.prototype.onStart=function(){},e.prototype.onStop=function(){},e.prototype.onUpdate=function(){},e}(),d=(n(41),i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),p=function(e){function t(){var t=e.call(this)||this;return t.tag="clock",t.createElement(),t}return d(t,e),t.prototype.createElement=function(){this.element=document.createElement("span"),this.element.classList.add("stadiaplus_clock")},t.prototype.onStart=function(){this.active=!0,this.element.id=this.id,a.a.component(l.a.get("component.enabled",{name:this.name}))},t.prototype.onStop=function(){this.active=!1,this.element.remove(),a.a.component(l.a.get("component.disabled",{name:this.name}))},t.prototype.onUpdate=function(){var e=this;if(s.isMenuOpen()){if(!this.exists())document.querySelector(".hxhAyf").prepend(this.element);var t=(new Date).toLocaleTimeString();window.requestAnimationFrame((function(){e.element.innerHTML=t}))}},t}(c),u=function(){function e(){this.buttons=[],this.id="button-container-"+Math.floor(9999*Math.random()),this.container=document.querySelector(".TZ0BN"),this.wrapper=document.createElement("div"),this.wrapper.id=this.id,this.wrapper.classList.add("ZgUMo","stadiaplus_ui-btn-wrapper"),this.element=document.createElement("div"),this.element.classList.add("E0Zk9b","stadiaplus_ui-btn-container")}return e.prototype.exists=function(){return null!==document.getElementById(this.id)},e.prototype.create=function(e){var t=this;this.exists()||(this.container=document.querySelector(".TZ0BN"),this.wrapper.appendChild(this.element),this.container.appendChild(this.wrapper)),this.buttons.forEach((function(e){e.exists()||t.element.appendChild(e.element)})),e&&e()},e.prototype.addButton=function(e){-1===this.buttons.indexOf(e)&&this.buttons.push(e)},e.prototype.removeButton=function(e){this.buttons=this.buttons.filter((function(t){return t.id!==e.id}))},e}(),h=function(){function e(e,t,n){this.id=n,this.html='\n \n
\n
\n \n \n
'+t+" \n
\n
\n ",this.element=document.createElement("div"),this.element.id=n,this.element.classList.add("Pyf1bb","stadiaplus_ui-button"),this.button=document.createElement("div"),this.button.setAttribute("role","button"),this.button.setAttribute("tabindex","0"),this.button.classList.add("CTvDXd","QAAyWd","Pjpac","zcMYd"),this.button.innerHTML=this.html,this.element.appendChild(this.button)}return e.prototype.create=function(t){for(var n=0,i=e.buttonContainers;n\n \n arrow_back \n
\n \n '+e+'
\n \n \n\n \n '+t+"\n
\n ",this.element=document.createElement("div"),this.element.id=this.id,this.element.classList.add("stadiaplus_ui-component")}return e.prototype.create=function(){var e=document.querySelector(".hxhAyf");if(e){this.element.innerHTML=this.html,e.appendChild(this.element),this.element=document.getElementById(this.id);var t=document.querySelector("#"+this.id+" > header > .rkvT7c"),n=this;t.addEventListener("click",(function(){n.closeTab()}))}},e.prototype.openTab=function(){this.element.classList.add("open"),this.open=!0,this.openListeners.forEach((function(e){return e()}))},e.prototype.closeTab=function(){a.a.info("Closing",this.id),this.element.classList.remove("open"),this.open=!1,this.closeListeners.forEach((function(e){return e()}))},e.prototype.onOpen=function(e){e&&this.openListeners.push(e)},e.prototype.onClose=function(e){e&&this.closeListeners.push(e)},e}(),f=(n(43),n(36),n(46),n(48),function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}()),g=window.chrome,b=function(e){function t(){var t=e.call(this)||this;return t.tag="ui-tab",t.rows=[],t.motdList=[' ',"Don't look here, look below!","Reality can be whatever I want.","If you ask nicely, Stadia might even do your laundry for you!","Have you tried asking customer support?","Follow u/mafrans on Reddit!","Stadia+, like Google+ but still alive.","Stadia is DOA, believe me.","Get a load of this guy, using chrome extensions to improve his Stadia experience.","I'm telling you, don't trust that guy. You know, the guy.","Shoutout to Chris and Grace!","Have you tried Splitlings yet?","Always check the ratings before you buy a new game.","Have you tried GeForce Now?","A hot dog is definitely not a sandwich.","Idk about you, but I really want one of those fancy smart toilets.","Chris is typing guys!!","Does anyone have a buddy pass I could borrow?","I paid $139 for this?","Is Fortnite on Stadia yet?","u/baconrules was the first to see 4k!","So did the person that made the stadia+ extension give up on stadia?","It's like GFN, but without any pulled games.","Long live Geforce Now+","Spend your money before it runs out.","When does Stadia 2 come out?"],t}return f(t,e),t.prototype.createElement=function(){this.component=new m("Stadia+",'\n \n '+this.motdList[Math.floor(Math.random()*this.motdList.length)]+"\n \n ",this.id);var e=g.runtime.getURL("images/icons/stadiaplus.svg");this.button=new h(e,l.a.get("ui-tab.button-label"),this.id+"-button")},t.prototype.createRows=function(e){var t=this,n=0;this.rows.forEach((function(i){i.exists()?e&&i.reload():i.append(t.component,n>0),n++}))},t.prototype.reloadRows=function(){this.rows.forEach((function(e){return e.reload()}))},t.prototype.addRow=function(e){this.rows.push(e)},t.prototype.clearRows=function(){for(var e=0,t=this.rows;e"+this.title+"
\n \n "+this.content+"\n
\n ",this.element.classList.add("stadiaplus_ui-row")}return e.prototype.exists=function(){return document.getElementById(this.id)},e.prototype.destroy=function(){this.options.onDestroy(this),this.element.remove()},e.prototype.reload=function(){this.options.onReload(this)},e.prototype.append=function(e,t){void 0===t&&(t=!1),t&&e.element.appendChild(document.createElement("hr")),e.element.appendChild(this.element),this.options.onCreate(this)},e}()),y=n(5),w=n(1),k=(n(52),function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}()),S=(window.chrome,function(e){function t(t,n){var i=e.call(this)||this;return i.tag="force-resolution",i.resolution=x.AUTOMATIC,i.tab=t,i.snackbar=n,i.getStorage(),i}return k(t,e),t.prototype.getStorage=function(e){var t=this;void 0===e&&(e=function(){}),w.a.RESOLUTION.get((function(n){t.resolution=n.resolution,e()}))},t.prototype.setStorage=function(e){void 0===e&&(e=function(){}),w.a.RESOLUTION.set(this.resolution,e)},t.prototype.onStart=function(){var e=this;this.active=!0,t.setResolution(this.resolution);var n=this;this.tab.addRow(new v(this.name,"\n \n
\n \n '+l.a.get("automatic")+' \n '+l.a.get("4k")+' \n '+l.a.get("1080p")+' \n \n
\n
'+l.a.get("apply")+' \n
\n\n '+l.a.get("force-resolution.note")+"
\n ",this.id+"-row",{onCreate:function(t){n.select=new y.a(t.element.querySelector("select"),{placeholder:x.AUTOMATIC}),t.element.querySelector(".stadiaplus_button-small").addEventListener("click",(function(){n.resolution=parseInt(n.select.get()[0]),n.setStorage((function(){n.snackbar.activate(l.a.get("snackbar.reload-to-update"))}))})),n.getStorage((function(){e.select.set(n.resolution)}))},onReload:function(e){n.select.destroy(),n.select=new y.a(e.element.querySelector("select"),{placeholder:x.AUTOMATIC}),n.select.set(n.resolution)}})),a.a.component(l.a.get("component.enabled",{name:this.name}))},t.setResolution=function(e){var t,n,i=document.createElement("script");switch(e){case x.UHD_4K:n=3840,t=2160;break;case x.FHD:n=1920,t=1080;break;case x.AUTOMATIC:default:return}i.innerHTML="\n Object.defineProperty(window.screen, 'availWidth', { value: "+n+" });\n Object.defineProperty(window.screen, 'availHeight', { value: "+t+" });\n Object.defineProperty(window.screen, 'width', { value: "+n+" });\n Object.defineProperty(window.screen, 'height', { value: "+t+" });\n ",document.body.appendChild(i)},t.prototype.onStop=function(){this.active=!1,a.a.component(l.a.get("component.disabled",{name:this.name}))},t.prototype.onUpdate=function(){},t}(c)),x=function(){function e(){}return e.AUTOMATIC=0,e.UHD_4K=1,e.FHD=2,e}(),C=function(){function e(){}return e.init=function(){for(var e=navigator.appVersion.split(" ").find((function(e){return-1!=e.indexOf("Chrome")})).split("/")[1].split("."),t=0,n=0;n\n \n \n '+l.a.get("automatic")+' \n '+l.a.get("vp9")+' \n '+l.a.get("h264")+' \n \n
\n '+l.a.get("apply")+" \n \n "+l.a.get("force-codec.4k-tooltip")+"
\n ",this.id+"-row",{onCreate:function(i){n.select=new y.a(i.element.querySelector("select"),{placeholder:_.AUTOMATIC}),i.element.querySelector(".stadiaplus_button-small").addEventListener("click",(function(){n.codec=parseInt(n.select.get()[0]),n.setStorage((function(){n.snackbar.activate(l.a.get("snackbar.reload-to-update"))}))})),n.getStorage((function(){w.a.RESOLUTION.get((function(i){(n.select.enable(),i.resolution===x.UHD_4K)&&(n.codec=_.VP9,n.select.disable(),document.getElementById(e.id+"-4k-tooltip").style.display="block");n.select.set(n.codec),t.setCodec(n.codec)}))}))},onReload:function(e){n.select.destroy(),n.select=new y.a(e.element.querySelector("select"),{placeholder:_.AUTOMATIC}),n.select.set(n.codec)}})),a.a.component(l.a.get("component.enabled",{name:this.name}))},t.setCodec=function(e){var t=document.createElement("script"),n=C.getVersion()>=84414402?'{"vp9": "libvpx"}':'{"vp9":"ExternalDecoder"}',i=C.getVersion()>=84414402?'{"vp9":"libvpx","h264":"FFmpeg"}':'{"h264":"ExternalDecoder", "vp9":"libvpx"}';switch(e){case _.VP9:t.innerHTML='\n localStorage.setItem("video_codec_implementation_by_codec_key", \''+n+"');\n ";break;case _.H264:t.innerHTML='\n localStorage.setItem("video_codec_implementation_by_codec_key", \''+i+"');\n ";break;case _.AUTOMATIC:default:t.innerHTML='\n localStorage.removeItem("video_codec_implementation_by_codec_key");\n '}document.body.appendChild(t)},t.prototype.onStop=function(){this.active=!1,a.a.component(l.a.get("component.disabled",{name:this.name}))},t.prototype.onUpdate=function(){},t}(c)),_=function(){function e(){}return e.AUTOMATIC=0,e.VP9=1,e.H264=2,e}(),E=(n(54),n(33),function(){function e(e){this.shape=O.DEFAULT,this.style=M.DEFAULT,this.border=!0,this.label=e}return e.prototype.setShape=function(e){return this.shape=e,this},e.prototype.setStyle=function(e){return this.style=e,this},e.prototype.setColor=function(e){return this.color=e,this},e.prototype.setAnimation=function(e){return this.animation=e,this},e.prototype.setBorder=function(e){return this.border=e,this},e.prototype.setIcon=function(e){return this.icon=e,this},e.prototype.setDisabled=function(e){return this.disabled=e,this},e.prototype.setBigger=function(e){return this.bigger=e,this},e.prototype.build=function(){var e=document.createElement("div");e.classList.add("pretty","p-default"),this.shape&&e.classList.add(this.shape),this.style&&e.classList.add(this.style),this.animation&&e.classList.add(this.animation),this.bigger&&e.classList.add("p-bigger"),this.border||e.classList.add("p-plain");var t=document.createElement("input");t.type="checkbox",t.disabled=this.disabled,e.appendChild(t);var n=document.createElement("div");if(n.classList.add("state"),this.color&&n.classList.add(this.color),this.icon){e.classList.add("p-icon");var i=document.createElement("span");i.classList.add("material-icons"),i.innerHTML=this.icon,n.appendChild(i)}var o=document.createElement("label");return o.innerHTML=this.label,n.appendChild(o),e.appendChild(n),{pretty:e,checkbox:t}},e}()),O=function(){function e(){}return e.DEFAULT=null,e.CURVED="p-curve",e.ROUND="p-round",e}(),M=function(){function e(){}return e.DEFAULT=null,e.FILL="p-fill",e.THICK="p-thick",e}(),A=(function(){function e(){}e.BLUE="p-primary",e.GREEN="p-success",e.YELLOW="p-warning",e.CYAN="p-info",e.RED="p-danger"}(),function(){function e(){}return e.SMOOTH="p-smooth",e.JELLY="p-jelly",e.TADA="p-tada",e.ROTATE="p-rotate",e.PULSE="p-pulse",e}()),R=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),D=window,I=D.chrome,P=(D.RTCPeerConnection,function(e){function t(){var t=e.call(this)||this;return t.tag="network-monitor",t.active=!1,t.monitorOpen=!1,t.visible=[],t.element=document.createElement("div"),t.element.classList.add("stadiaplus_network-monitor"),document.addEventListener("DOMContentLoaded",(function(){t.startRunnable()})),t}return R(t,e),t.prototype.createUI=function(){var e=this;this.component=new m(l.a.get("network-monitor.name"),"\n "+l.a.get("network-monitor.toggle-button.show")+"
\n \n "+l.a.get("network-monitor.heading-visible")+" \n \n ",this.id),this.component.element.classList.add("stadiaplus_networkmonitor-tab");var t=I.runtime.getURL("images/icons/network-monitor.svg");this.button=new h(t,l.a.get("network-monitor.button-label"),this.id+"-button"),this.getStorage((function(){e.updateVisible()}))},t.prototype.startRunnable=function(){s.desandbox("const MonitorRunnable = function () {\r\n this.enabled = false;\r\n this.peerConnections = [];\r\n this.originalRTC;\r\n this.startTime;\r\n this.element;\r\n this.editable = false;\r\n this.x = 0;\r\n this.y = 0;\r\n\r\n const self = this;\r\n this.originalRTC = RTCPeerConnection;\r\n (function (OriginalRTCConnection) {\r\n self.originalRTC = OriginalRTCConnection;\r\n\r\n RTCPeerConnection = function (args) {\r\n const connection = new OriginalRTCConnection(args);\r\n self.peerConnections.push(connection);\r\n return connection;\r\n };\r\n RTCPeerConnection.prototype = OriginalRTCConnection.prototype;\r\n })(RTCPeerConnection);\r\n\r\n this.start = function () {\r\n this.enabled = true;\r\n this.element = document.createElement('div');\r\n this.element.classList.add('stadiaplus_networkmonitor');\r\n this.element.id =\r\n 'networkmonitor-' + Math.floor(Math.random() * 999999);\r\n document.body.appendChild(this.element);\r\n\r\n this.startTime = Date.now();\r\n\r\n this.setEditable(true);\r\n this.updatePosition();\r\n this.update();\r\n };\r\n\r\n this.setPosition = function (x, y) {\r\n this.x = x;\r\n this.y = y;\r\n this.updatePosition();\r\n };\r\n\r\n this.updatePosition = function () {\r\n this.element.style.left = this.x + 'px';\r\n this.element.style.top = this.y + 'px';\r\n\r\n const corners = {\r\n tl: 10,\r\n tr: 10,\r\n bl: 10,\r\n br: 10,\r\n };\r\n\r\n if (this.x < 10) {\r\n corners.tl = 0;\r\n corners.bl = 0;\r\n }\r\n\r\n if (this.y < 10) {\r\n corners.tl = 0;\r\n corners.tr = 0;\r\n }\r\n\r\n if (this.x > window.innerWidth - this.element.clientWidth - 10) {\r\n corners.tr = 0;\r\n corners.br = 0;\r\n }\r\n\r\n if (this.y > window.innerHeight - this.element.clientHeight - 10) {\r\n corners.bl = 0;\r\n corners.br = 0;\r\n }\r\n\r\n this.element.style[\r\n 'border-radius'\r\n ] = `${corners.tl}px ${corners.tr}px ${corners.br}px ${corners.bl}px`;\r\n };\r\n\r\n this.mouseEvents = [];\r\n this.moving = false;\r\n this.offset = { x: 0, y: 0 };\r\n this.setEditable = function (editable) {\r\n this.editable = editable;\r\n this.element.classList.toggle('editable', editable);\r\n\r\n if (editable) {\r\n this.mouseEvents.push(\r\n {\r\n target: document,\r\n type: 'mousemove',\r\n fn: (event) => {\r\n if (this.moving) {\r\n this.x = Math.max(\r\n 0, // Minimum x value\r\n Math.min(\r\n window.innerWidth -\r\n this.element.clientWidth, // Maximum x value\r\n event.clientX - this.offset.x,\r\n ),\r\n );\r\n this.y = Math.max(\r\n 0, // Minimum y value\r\n Math.min(\r\n window.innerHeight -\r\n this.element.clientHeight, // Maximum y value\r\n event.clientY - this.offset.y,\r\n ),\r\n );\r\n\r\n this.updatePosition();\r\n }\r\n },\r\n },\r\n {\r\n target: this.element,\r\n type: 'mousedown',\r\n fn: (event) => {\r\n this.moving = true;\r\n this.offset.x = event.clientX - this.x;\r\n this.offset.y = event.clientY - this.y;\r\n },\r\n },\r\n {\r\n target: document,\r\n type: 'mouseup',\r\n fn: (event) => {\r\n this.moving = false;\r\n },\r\n },\r\n );\r\n this.mouseEvents.forEach((event) =>\r\n event.target.addEventListener(event.type, event.fn),\r\n );\r\n } else {\r\n this.mouseEvents.forEach((event) =>\r\n event.target.removeEventListener(event.type, event.fn),\r\n );\r\n }\r\n };\r\n\r\n this.setVisible = function (visible) {\r\n visible.forEach(e => this.visible[e.id] = e);\r\n };\r\n\r\n this.stop = function () {\r\n this.enabled = false;\r\n this.setEditable(false);\r\n this.element.remove();\r\n\r\n RTCPeerConnection = this.originalRTC;\r\n peerConnections = [];\r\n };\r\n\r\n this.visible = {};\r\n\r\n this.stats = [];\r\n this.update = function () {\r\n if (this.peerConnections.length > 1) {\r\n const index = this.peerConnections.length - 1;\r\n\r\n this.peerConnections[index].getStats().then((_stats) => {\r\n this.stats = Array.from(_stats);\r\n\r\n const RTCInboundRTPVideoStream = this.getStat((stat) =>\r\n stat[0].startsWith('RTCInboundRTPVideoStream'),\r\n );\r\n const RTCIceCandidatePair = this.getStat((stat) =>\r\n stat[0].startsWith('RTCIceCandidatePair'),\r\n );\r\n const RTCMediaStreamTrack_receiver = this.getStat(\r\n (stat) =>\r\n stat[0].startsWith('RTCMediaStreamTrack_receiver') &&\r\n stat[1].kind === 'video',\r\n );\r\n\r\n const resolution = this.getResolution(\r\n RTCMediaStreamTrack_receiver,\r\n );\r\n const fps = this.getFPS(RTCInboundRTPVideoStream);\r\n const latency = this.getLatency(RTCIceCandidatePair) + ' ms';\r\n const codec = this.getCodec(RTCInboundRTPVideoStream);\r\n const totalTraffic = this.translateByteUnits(\r\n this.getTotalDownload(RTCIceCandidatePair),\r\n );\r\n const currentTraffic =\r\n this.translateBitUnits(\r\n this.getDownloadSpeed(RTCIceCandidatePair),\r\n ) + '/s';\r\n const averageTraffic =\r\n this.translateBitUnits(\r\n this.getAverageDownloadSpeed(RTCIceCandidatePair),\r\n ) + '/s';\r\n const packetsLost = this.getPacketsLost(\r\n RTCInboundRTPVideoStream,\r\n );\r\n const averagePacketLoss =\r\n this.getAveragePacketLoss(RTCInboundRTPVideoStream) + '%';\r\n const jitterBuffer =\r\n this.getJitterBuffer(RTCMediaStreamTrack_receiver) + ' ms';\r\n\r\n let html = '';\r\n if (this.visible['time'].enabled) {\r\n let time = new Date();\r\n let timeString = time.toLocaleString();\r\n html += `${timeString} `;\r\n }\r\n\r\n html += '';\r\n if (this.visible['resolution'].enabled) {\r\n html += `${this.visible['resolution'].name}: ${resolution.width}x${resolution.height} `;\r\n }\r\n\r\n if (this.visible['fps'].enabled) {\r\n html += `${this.visible['fps'].name}: ${fps} `;\r\n }\r\n\r\n if (this.visible['latency'].enabled) {\r\n html += `${this.visible['latency'].name}: ${latency} `;\r\n }\r\n\r\n if (this.visible['codec'].enabled) {\r\n html += `${this.visible['codec'].name}: ${codec} `;\r\n }\r\n\r\n if (this.visible['traffic'].enabled) {\r\n html += `${this.visible['traffic'].name}: ${totalTraffic} `;\r\n }\r\n\r\n if (this.visible['current-traffic'].enabled) {\r\n html += `${this.visible['current-traffic'].name}: ${currentTraffic} `;\r\n }\r\n\r\n if (this.visible['average-traffic'].enabled) {\r\n html += `${this.visible['average-traffic'].name}: ${averageTraffic} `;\r\n }\r\n\r\n if (this.visible['packets-lost'].enabled) {\r\n html += `${this.visible['packets-lost'].name}: ${packetsLost} `;\r\n }\r\n\r\n if (this.visible['average-packet-loss'].enabled) {\r\n html += `${this.visible['average-packet-loss'].name}: ${averagePacketLoss} `;\r\n }\r\n\r\n if (this.visible['jitter-buffer'].enabled) {\r\n html += `${this.visible['jitter-buffer'].name}: ${jitterBuffer} `;\r\n }\r\n\r\n html += ' ';\r\n\r\n this.element.innerHTML = html;\r\n });\r\n } else {\r\n this.startTime = Date.now();\r\n this.element.innerHTML = `\r\n Error \r\n \r\n Uh oh, something went terribly wrong. \r\n This feature is still very unstable and \r\n the developer knows there are problems, \r\n please understand that this issue is \r\n actively being worked on.\r\n
\r\n Error Code: 001 - Stats unavailable
\r\n `;\r\n }\r\n\r\n if (this.enabled) {\r\n setTimeout(() => {\r\n this.update();\r\n }, 1000);\r\n }\r\n };\r\n\r\n this.getStat = function (filter) {\r\n return this.stats.find(filter)[1];\r\n };\r\n\r\n this.translateBitUnits = function (value) {\r\n const units = ['bit', 'kbit', 'Mbit', 'Gbit'];\r\n\r\n let i = 0;\r\n while (value / 1000 >= 1) {\r\n i++;\r\n value /= 1000;\r\n }\r\n\r\n return (\r\n value.toPrecision(4) + ' ' + units[Math.min(units.length - 1, i)]\r\n );\r\n };\r\n\r\n this.translateByteUnits = function (value) {\r\n const units = ['B', 'kB', 'MB', 'GB'];\r\n\r\n let i = 0;\r\n while (value / 1000 >= 1) {\r\n i++;\r\n value /= 1000;\r\n }\r\n\r\n return (\r\n value.toPrecision(4) + ' ' + units[Math.min(units.length - 1, i)]\r\n );\r\n };\r\n\r\n this.getLatency = function (RTCIceCandidatePair) {\r\n return RTCIceCandidatePair.currentRoundTripTime * 1000;\r\n };\r\n\r\n this.getJitterBuffer = function (RTCMediaStreamTrack_receiver) {\r\n return (\r\n (RTCMediaStreamTrack_receiver.jitterBufferDelay * 1000) /\r\n RTCMediaStreamTrack_receiver.jitterBufferEmittedCount\r\n ).toPrecision(4);\r\n };\r\n\r\n this.getPacketsLost = function (RTCInboundRTPVideoStream) {\r\n return RTCInboundRTPVideoStream.packetsLost;\r\n };\r\n\r\n this.getAveragePacketLoss = function (RTCInboundRTPVideoStream) {\r\n return (\r\n (RTCInboundRTPVideoStream.packetsLost /\r\n (RTCInboundRTPVideoStream.packetsReceived +\r\n RTCInboundRTPVideoStream.packetsLost)) *\r\n 100\r\n ).toPrecision(2);\r\n };\r\n\r\n this.lastDownload = 0;\r\n this.getDownloadSpeed = function (RTCIceCandidatePair) {\r\n const download = this.getTotalDownload(RTCIceCandidatePair);\r\n const speed = download - this.lastDownload;\r\n this.lastDownload = download;\r\n return speed * 8;\r\n };\r\n\r\n this.getAverageDownloadSpeed = function (RTCIceCandidatePair) {\r\n return (\r\n this.getTotalDownload(RTCIceCandidatePair) * 8 /\r\n (this.timeSinceStart() / 1000)\r\n );\r\n };\r\n\r\n this.getTotalDownload = function (RTCIceCandidatePair) {\r\n return RTCIceCandidatePair.bytesReceived;\r\n };\r\n\r\n this.getResolution = function (RTCMediaStreamTrack_receiver) {\r\n return {\r\n width: RTCMediaStreamTrack_receiver.frameWidth,\r\n height: RTCMediaStreamTrack_receiver.frameHeight,\r\n };\r\n };\r\n\r\n this.getCodec = function (RTCInboundRTPVideoStream) {\r\n const codecStat = this.getStat(\r\n (stat) => stat[0] === RTCInboundRTPVideoStream.codecId,\r\n );\r\n return codecStat.mimeType.substring('video/'.length);\r\n };\r\n\r\n this.lastFrames = 0;\r\n this.getFPS = function (RTCInboundRTPVideoStream) {\r\n const fps = RTCInboundRTPVideoStream.framesDecoded - this.lastFrames;\r\n this.lastFrames = RTCInboundRTPVideoStream.framesDecoded;\r\n return fps;\r\n };\r\n\r\n this.timeSinceStart = function () {\r\n return Date.now() - this.startTime;\r\n };\r\n};\r\n\r\nStadiaPlusMonitor = new MonitorRunnable();\r\n")},t.prototype.openMonitor=function(){this.monitorOpen=!0,s.desandbox("StadiaPlusMonitor.start()")},t.prototype.closeMonitor=function(){this.monitorOpen=!1,s.desandbox("StadiaPlusMonitor.stop()")},t.prototype.getStorage=function(e){var t=this;void 0===e&&(e=function(){}),w.a.MONITOR_STATS.get((function(n){n[w.a.MONITOR_STATS.tag]&&(t.visible=n[w.a.MONITOR_STATS.tag]),e()}))},t.prototype.setStorage=function(e){void 0===e&&(e=function(){}),w.a.MONITOR_STATS.set(this.visible,e)},t.prototype.onStart=function(){this.active=!0,this.startRunnable(),this.createUI(),this.visible=[{id:"time",enabled:!0,name:l.a.get("network-monitor.stats.time")},{id:"resolution",enabled:!0,name:l.a.get("network-monitor.stats.resolution")},{id:"fps",enabled:!0,name:l.a.get("network-monitor.stats.fps")},{id:"latency",enabled:!0,name:l.a.get("network-monitor.stats.latency")},{id:"codec",enabled:!0,name:l.a.get("network-monitor.stats.codec")},{id:"traffic",enabled:!0,name:l.a.get("network-monitor.stats.traffic")},{id:"current-traffic",enabled:!0,name:l.a.get("network-monitor.stats.current-traffic")},{id:"average-traffic",enabled:!0,name:l.a.get("network-monitor.stats.average-traffic")},{id:"packets-lost",enabled:!0,name:l.a.get("network-monitor.stats.packets-lost")},{id:"average-packet-loss",enabled:!0,name:l.a.get("network-monitor.stats.average-packet-loss")},{id:"jitter-buffer",enabled:!0,name:l.a.get("network-monitor.stats.jitter-buffer")}],a.a.component(l.a.get("component.enabled",{name:this.name}))},t.prototype.onStop=function(){this.active=!1,this.button.element.remove(),this.button.destroy(),this.component.element.remove(),this.closeMonitor(),s.desandbox("StadiaPlusMonitor = null"),a.a.component(l.a.get("component.disabled",{name:this.name}))},t.prototype.updateVisible=function(){s.desandbox("StadiaPlusMonitor.setVisible("+JSON.stringify(this.visible)+")")},t.prototype.onUpdate=function(){var e=this;if(s.isMenuOpen()&&s.isInGame()){if(!this.exists()){var t=this;this.updateRenderer(),this.component.create(),this.component.onOpen((function(){s.desandbox("StadiaPlusMonitor.setEditable(true)")})),this.component.onClose((function(){s.desandbox("StadiaPlusMonitor.setEditable(false)")}));for(var n=document.getElementById(this.id+"-visiblelist"),i=function(t){var i=o.visible[t],a=document.createElement("li"),s=new E(i.name).setBigger(!0).setAnimation(A.SMOOTH).build(),r=s.pretty,l=s.checkbox;r.classList.add("stadiaplus_networkmonitor-checkbox"),a.appendChild(r),n.appendChild(a),l.checked=i.enabled,l.addEventListener("click",function(){e.visible[t].enabled=l.checked,e.updateVisible(),e.setStorage()}.bind(o))},o=this,a=0;a.stadiaplus_networkmonitor")&&this.closeMonitor()},t}(c)),N=(n(56),function(){function e(){this.element=document.createElement("div"),this.element.classList.add("stadiaplus_snackbar"),this.label=document.createElement("div"),this.label.classList.add("stadiaplus_snackbar-label"),this.closeButton=document.createElement("i"),this.closeButton.innerHTML="close",this.closeButton.classList.add("material-icons","stadiaplus_snackbar-close");var e=this;this.closeButton.addEventListener("click",(function(){e.element.classList.remove("active")}))}return e.prototype.create=function(){document.body.appendChild(this.element),this.element.appendChild(this.label),this.element.appendChild(this.closeButton)},e.prototype.activate=function(e){this.label.innerHTML=e,this.element.classList.add("active");var t=this;window.setTimeout((function(){t.element.classList.remove("active")}),5e3)},e}()),j=(n(58),n(37)),H=function(){function e(e,t){this.url=e,this.name=t}return e.prototype.save=function(){j.a.download('