<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="EaglercraftX 1.8 Offline" />
<meta name="keywords" content="eaglercraft, eaglercraftx, minecraft, 1.8, 1.8.8" />
<title>EaglercraftX 1.8</title>
<meta property="og:locale" content="en-US" />
<meta property="og:type" content="website" />
<meta property="og:title" content="EaglercraftX 1.8" />
<meta property="og:description" content="Play minecraft 1.8 in your browser" />
<script type="text/javascript">
"use strict";
const relayId = Math.floor(Math.random() * 3);

// %%%%%%%%% launch options %%%%%%%%%%%%

window.eaglercraftXOptsHints = {
	hintsVersion: 1,
	container: "game_frame",
	worldsDB: "worlds",
	relays: [
		{ addr: "wss://relay.deev.is/", comment: "lax1dude relay #1", primary: relayId === 0 },
		{ addr: "wss://relay.lax1dude.net/", comment: "lax1dude relay #2", primary: relayId === 1 },
		{ addr: "wss://relay.shhnowisnottheti.me/", comment: "ayunami relay #1", primary: relayId === 2 }
	],
	checkRelaysForUpdates: true
};

// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

</script>
<style type="eaglercraft" id="eaglercraftXClientSignature">data:application/octet-stream;base64,${client_signature}</style>
<style type="eaglercraft" id="eaglercraftXClientBundle">data:application/octet-stream;base64,${client_bundle}</style>
<script type="text/javascript">
"use strict";
(function(){
	function eaglerBundleUnwrap(tagIn) { const e = document.getElementById(tagIn); const ret = e.innerText; e.remove(); return ret;  }
	window.eaglercraftXClientSignature = eaglerBundleUnwrap("eaglercraftXClientSignature");
	window.eaglercraftXClientBundle = eaglerBundleUnwrap("eaglercraftXClientBundle");
})();
</script>
<script type="text/javascript">
"use strict";
(function(){
	function fetchB64PayloadSafe() {
		const dataURL = window.eaglercraftXClientBundle;
		if(!dataURL.startsWith("data:application/octet-stream;base64,")) {
			return fetch(dataURL, { cache: "force-cache" }).then((response) => response.blob());
		}
		return new Promise((resolve) => {
			fetch(dataURL)
				.then((response) => response.blob())
				.then((blob) => { resolve(blob); })
				.catch((err) => {
					console.error("Caught an error decoding base64 via fetch, doing it the slow way instead...");
					// MIT License - https://github.com/beatgammit/base64-js
					const base64js = (function(){return function(){function b(d,e,g){function a(j,i){if(!e[j]){if(!d[j]){var f="function"==typeof require&&require;if(!i&&f)return f(j,!0);if(h)return h(j,!0);var c=new Error("Cannot find module '"+j+"'");throw c.code="MODULE_NOT_FOUND",c}var k=e[j]={exports:{}};d[j][0].call(k.exports,function(b){var c=d[j][1][b];return a(c||b)},k,k.exports,b,d,e,g)}return e[j].exports}for(var h="function"==typeof require&&require,c=0;c<g.length;c++)a(g[c]);return a}return b}()({"/":[function(a,b,c){"use strict";function d(a){var b=a.length;if(0<b%4)throw new Error("Invalid string. Length must be a multiple of 4");var c=a.indexOf("=");-1===c&&(c=b);var d=c===b?0:4-c%4;return[c,d]}function e(a,b,c){return 3*(b+c)/4-c}function f(a){var b,c,f=d(a),g=f[0],j=f[1],k=new Uint8Array(e(a,g,j)),l=0,m=0<j?g-4:g;for(c=0;c<m;c+=4)b=h[a.charCodeAt(c)]<<18|h[a.charCodeAt(c+1)]<<12|h[a.charCodeAt(c+2)]<<6|h[a.charCodeAt(c+3)],k[l++]=255&b>>16,k[l++]=255&b>>8,k[l++]=255&b;return 2===j&&(b=h[a.charCodeAt(c)]<<2|h[a.charCodeAt(c+1)]>>4,k[l++]=255&b),1===j&&(b=h[a.charCodeAt(c)]<<10|h[a.charCodeAt(c+1)]<<4|h[a.charCodeAt(c+2)]>>2,k[l++]=255&b>>8,k[l++]=255&b),k}c.byteLength=function b(a){var c=d(a),e=c[0],f=c[1];return 3*(e+f)/4-f},c.toByteArray=f;for(var g=[],h=[],j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",k=0,l=j.length;k<l;++k)g[k]=j[k],h[j.charCodeAt(k)]=k;h[45]=62,h[95]=63},{}]},{},[])("/")})();
					const bytesDec = base64js.toByteArray(dataURL.substring(37)).buffer;
					const bytesBlob = new Blob([bytesDec], { type: "application/octet-stream" });
					window.eaglercraftXClientBundle = URL.createObjectURL(bytesBlob);
					console.error("Created " + bytesDec.byteLength + " byte object URL: " + window.eaglercraftXClientBundle);
					resolve(bytesBlob);
				});
		});
	}
	var ds = new DecompressionStream("gzip");
	var result = [];
	function fetchStream(reader) {
		reader.read().then(function processData({ done, value }) {
			if (done) {
				window.clientScriptSrcURL = URL.createObjectURL(new Blob(result, { type: "text/javascript;charset=utf-8" }));
				result = [];
				ds = null;
				return;
			}
			result.push(value);
			return reader.read().then(processData);
		});
	}
	fetchB64PayloadSafe().then((blob) => fetchStream(blob.stream().pipeThrough(ds).getReader()));
})();
</script>
<script type="text/javascript">
"use strict";
(function(){
	var launchInterval = -1;
	var launchCounter = 1;
	var launchCountdownNumberElement = null;
	var launchCountdownProgressElement = null;
	function launchTick() {
		if(launchCounter > 100) {
			if(window.clientScriptSrcURL) {
				clearInterval(launchInterval);
				setTimeout(() => {
					document.getElementById("launch_countdown_screen").remove();
					const script = document.createElement("script");
					script.type = "text/javascript";
					script.src = window.clientScriptSrcURL;
					window.clientScriptSrcURL = null;
					document.head.appendChild(script);
				}, 50);
			}
			return;
		}
		launchCountdownNumberElement.innerText = "" + Math.floor(6.0 - launchCounter * 0.06);
		launchCountdownProgressElement.style.width = "" + launchCounter + "%";
		++launchCounter;
	}
	window.addEventListener("load", () => {
		launchCountdownNumberElement = document.getElementById("launchCountdownNumber");
		launchCountdownProgressElement = document.getElementById("launchCountdownProgress");
		launchInterval = setInterval(launchTick, 50);
	});
})();
</script>
<link type="image/png" rel="shortcut icon" href="data:image/png;base64, " />
</head>
<body style="margin:0px;width:100vw;height:100vh;overflow:hidden;" id="game_frame">
<div style="margin:0px;width:100%;height:100%;font-family:sans-serif;display:flex;align-items:center;user-select:none;" id="launch_countdown_screen">
<div style="margin:auto;text-align:center;">
<h1>This file is from <span style="color:#AA0000;">${date}</span></h1>
<h2>Game will launch in <span id="launchCountdownNumber">5</span>...</h2>
<div style="border:2px solid black;width:100%;height:15px;padding:1px;margin-bottom:20vh;"><div id="launchCountdownProgress" style="background-color:#555555;width:0%;height:100%;"></div></div>
</div>
</div>
</body>
</html>
