(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{23:function(t,e,n){"use strict";n.r(e),e.default={data:function(){return console.log(this.$route.context),this.$route.context},methods:{addFeaturedRepo:function(t){var e=t.target;null==e.dataset.repo&&(e=e.parentElement),this.addRepo(e.dataset.repo)},addRepoPrompt:function(){var t=this;this.$app.dialog.prompt("Enter a URL to a repo",(function(e){t.addRepo(e)}))},addRepo:function(t){var e=this,n=this;console.log(t),t=patchXSS(t),this.$app.preloader.show();var a=new URL(t);fetch("localhost"==a.hostname?t:"https://api.zenithdevs.com/eclipse/download/?dl=".concat(encodeURI(t.replace("http://","https://")))).then((function(t){return e.$app.methods.repo.update(t.json())})).then((function(a){if(a=patchXSS(a),n.$app.preloader.hide(),403==a.code)n.$app.dialog.alert(a.message);else{var o=localStorage.getItem("repos"),i=[];null!=o&&(i=JSON.parse(o)),-1==i.indexOf(t)?(i.push(t),e.$app.methods.storage.set("repos",JSON.stringify(i)),n.$app.toast.create({text:'"'.concat(n.$app.methods.repo.update(a).info.name,'" was added to your repos.'),closeTimeout:2e3}).open(),n.updateState()):n.$app.dialog.alert("You already have this repo added.")}})).catch((function(t){console.error(t),n.$app.preloader.hide(),n.$app.dialog.alert("There was an issue while trying to add that repo")}))},removeRepo:function(t){var e=localStorage.getItem("repos"),n=[];null!=e&&(n=JSON.parse(e));var a=this;n.forEach((function(e,o){e.replace("http://","https://")==t.target.dataset.repo&&(n.splice(o,1),a.$app.methods.storage.set("repos",JSON.stringify(n)))}))},repoMenu:function(t){var e=this;t.preventDefault();var n=t.target;null==n.dataset.index&&(n=n.parentElement),null==n.dataset.index&&(n=n.parentElement),null==n.dataset.index&&(n=n.parentElement);var a=patchXSS(n.dataset);this.$app.actions.create({buttons:[[{text:a.name,label:!0},"Unknown Repo"!=a.name&&"Blocked Repo"!=a.name?{text:"View",onClick:function(){e.$router.navigate("/game-hub/repo/".concat(encodeURIComponent(a.url),"/"))}}:null,{text:"Remove",color:"red",onClick:function(){e.removeRepo({target:{dataset:{repo:a.url}}}),e.updateState()}}].filter((function(t){if(t)return t})),[{text:"Cancel",bold:!0}]]}).open()},updateState:function(){var t=this;this.$app.preloader.show(),this.$app.methods.repo.list().then((function(e){t.$app.preloader.hide(),t.$setState(e)}))},openDropbox:function(){this.$app.methods.cloud.dropbox.launch()}},id:"d62081f8db",render:function(){return'\n\t
\n\t\t\n\t\t
\n\t\t\t
Featured
\n\t\t\t\n\t\t\t
\n\t\t\t\t

What happened to repos?

\n\t\t\t\t
Custom sources are officially depreciated. We are not responsible for what shows up\n\t\t\t\t\tand will be depreciating this entirely in a future update.
\n\t\t\t
\n\t\t\t
Repos
\n\t\t\t').concat(0==this.repos.length?'\n\t\t\t
\n\t\t\t\t

No Repos

\n\t\t\t\t

Tap a featured repo above to discover some homebrew games.

\n\t\t\t
\n\t\t\t':'\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t\t"),"\n\t
\n")},styleScoped:!1}}}]); //# sourceMappingURL=11.app.js.map