(function(){'use strict';const ba=["DEBUG","INFO","WARN","ERROR"];var da="main",ea=null;function fa(a,b,d){if(!(1>a)){var c="EagRuntimeJS: ["+(new Date).toLocaleTimeString()+"]["+da+"/"+(ba[a]||"UNKNOWN")+"] ";a:{if(0",[a])}function na(a){return function(){g("Unsupported function called: {}.{}",a);return 0}}function C(a,b){a[b]=na(b)}function oa(a){return new Promise(function(b){setTimeout(b,a)})} class qa{constructor(){this.G=this.o=null;this.u=0}K(){return this.u}push(a){this.G&&(this.G._next=a);this.G=a;this.o||(this.o=a);++this.u}j(){if(this.o){const a=this.o;(this.o=a._next||null)?a._next=null:this.G=null;--this.u;return a}return null}};var ra={},G={},wa={},xa={},ya={},I={},za={},J={},Ca={},Da={},Ea={},M={},Fa={},Ja={},Ka={},La=null,Ma=null,Na=null,Oa=null,Pa=null,Qa=null,Sa=null,Ta=null,N=null,Ua=null,Va=null,P=null,R=null,Wa=null,Xa=!1,Ya=0,Za=null,$a=!1,ab=null,bb=null,cb=!1;const db=[];var eb=null,fb="_eaglercraftX",gb=!1,hb=!1,zb=!1,Ab=!0,Bb=!1,Cb=!1,Db=!0,Eb=!0,Fb=!1; function Gb(){"string"===typeof N.localStorageNamespace&&(fb=N.localStorageNamespace);"boolean"===typeof N.openDebugConsoleOnLaunch&&(gb=N.openDebugConsoleOnLaunch);"boolean"===typeof N.fixDebugConsoleUnloadListener&&(hb=N.fixDebugConsoleUnloadListener);"boolean"===typeof N.forceWebViewSupport&&(zb=N.forceWebViewSupport);"boolean"===typeof N.enableWebViewCSP&&(Ab=N.enableWebViewCSP);"boolean"===typeof N.forceWebGL1&&(Bb=N.forceWebGL1);"boolean"===typeof N.forceWebGL2&&(Cb=N.forceWebGL2);"boolean"=== typeof N.allowExperimentalWebGL1&&(Db=N.allowExperimentalWebGL1);"boolean"===typeof N.useWebGLExt&&(Eb=N.useWebGLExt);"boolean"===typeof N.useDelayOnSwap&&(Fb=N.useDelayOnSwap)} async function Hb(){function a(){try{h=new AudioContext}catch(t){ia("Could not initialize audio context",t)}}Gb();ea=Ib;window.__curEaglerX188UnloadListenerCB=function(){};"yes"!==window.__isEaglerX188UnloadListenerSet&&(window.onbeforeunload=function(){window.__curEaglerX188UnloadListenerCB&&window.__curEaglerX188UnloadListenerCB();return!1},window.__isEaglerX188UnloadListenerSet="yes");e("Initializing EagRuntime JS context...");await Jb();Kb();Lb();Mb();Nb();Ob();Pb();C(Ka,"sendPacket");C(Ka,"getAvailablePackets"); C(Ka,"getNextPacket");C(Ka,"setCrashCallback");Va.classList.add("_eaglercraftX_root_element");Va.style.overflow="hidden";for(var b=null,d;d=Va.lastChild;)b||=d,Va.removeChild(d);P=document.createElement("div");P.classList.add("_eaglercraftX_wrapper_element");P.style.position="relative";P.style.width="100%";P.style.height="100%";P.style.overflow="hidden";P.style.backgroundColor="black";Va.appendChild(P);b&&(b.style.position="absolute",b.style.top="0px",b.style.left="0px",b.style.right="0px",b.style.bottom= "0px",b.style.zIndex="2",b.classList.add("_eaglercraftX_early_splash_element"),P.appendChild(b));await oa(10);d=window.devicePixelRatio;b=d*P.clientWidth|0;d=d*P.clientHeight|0;e("Initializing audio context");if("function"===typeof document.exitPointerLock){var c=navigator.userAgent;null!==c?(c=c.toLowerCase(),$a=-1!==c.indexOf("mobi")||-1!==c.indexOf("tablet")):$a=!1}else $a=!0;var h=null;!$a&&navigator.userActivation&&navigator.userActivation.hasBeenActive?a():(c=document.createElement("div"),c.classList.add("_eaglercraftX_press_any_key_image"), c.style.position="absolute",c.style.top="0px",c.style.left="0px",c.style.right="0px",c.style.bottom="0px",c.style.width="100%",c.style.height="100%",c.style.zIndex="3",c.style.touchAction="pan-x pan-y",c.style.background='center / contain no-repeat url("'+Qa+'"), left / 1000000% 100% no-repeat url("'+Qa+'") white',c.style.setProperty("image-rendering","pixelated"),P.appendChild(c),await new Promise(function(t,D){function y(){if(!B){B=!0;$a?P.removeChild(v):(window.removeEventListener("keydown",y), P.removeEventListener("mousedown",y),P.removeEventListener("touchstart",y));try{a()}catch(S){D(S);return}t()}}var B=!1;if($a){var v=document.createElement("div");v.classList.add("_eaglercraftX_mobile_press_any_key");v.setAttribute("style","position:absolute;background-color:white;font-family:sans-serif;top:10%;left:10%;right:10%;bottom:10%;border:5px double black;padding:calc(5px + 7vh) 15px;text-align:center;font-size:20px;user-select:none;z-index:10;");v.innerHTML='

Mobile Browser Detected

Warning: EaglercraftX WASM-GC requires a lot of memory and may not be stable on most mobile devices!

(Tablets and phones with large screens work best)

'; v.querySelector("._eaglercraftX_mobile_launch_client").addEventListener("click",y);P.appendChild(v)}else window.addEventListener("keydown",y),P.addEventListener("mousedown",y),P.addEventListener("touchstart",y)}),P.removeChild(c));h?Qb(h):Rb();e("Creating main canvas");R=document.createElement("canvas");R.classList.add("_eaglercraftX_canvas_element");R.style.width="100%";R.style.height="100%";R.style.zIndex="1";R.style.touchAction="pan-x pan-y";R.style.setProperty("-webkit-touch-callout","none"); R.style.setProperty("-webkit-tap-highlight-color","rgba(255, 255, 255, 0)");R.style.setProperty("image-rendering","pixelated");R.width=b;R.height=d;P.appendChild(R);await Sb();e("Creating WebGL context");P.addEventListener("webglcontextcreationerror",function(t){g("[WebGL Error]: {}",t.statusMessage)});b={antialias:!1,depth:!1,powerPreference:"high-performance",desynchronized:!0,preserveDrawingBuffer:!1,premultipliedAlpha:!1,alpha:!1};c=!1;if(Cb){e("Note: Forcing WebGL 2.0 context");d=300;var l=R.getContext("webgl2", b);if(!l)return Tb("WebGL 2.0 is not supported on this device!"),!1}else if(Bb){if(e("Note: Forcing WebGL 1.0 context"),d=200,l=R.getContext("webgl",b),!l)if(Db){if(c=!0,l=R.getContext("experimental-webgl",b),!l)return Tb("WebGL is not supported on this device!"),!1}else return Tb("WebGL is not supported on this device!"),!1}else if(d=300,l=R.getContext("webgl2",b),!l&&(d=200,l=R.getContext("webgl",b),!l))if(Db){if(c=!0,l=R.getContext("experimental-webgl",b),!l)return Tb("WebGL is not supported on this device!"), !1}else return Tb("WebGL is not supported on this device!"),!1;c&&alert('WARNING: Detected "experimental" WebGL 1.0 support, certain graphics API features may be missing, and therefore EaglercraftX may malfunction and crash!');Ya=d;Wa=l;Xa=c;Ub(l,d);e("OpenGL Version: {}",J.glGetString(7938));e("OpenGL Renderer: {}",J.glGetString(7937));b=J.dumpActiveExtensions();if(0===b.length)e("Unlocked the following OpenGL ES extensions: (NONE)");else for(b.sort(),e("Unlocked the following OpenGL ES extensions:"), d=0;d


Things you can try:

  1. Just try using Eaglercraft on a different device, it isn\'t a bug it\'s common sense
  2. If this screen just appeared randomly, try restarting your browser or device
  3. If you are not using Chrome/Edge, try installing the latest Google Chrome
  4. If your browser is out of date, please update it to the latest version
'; c.querySelector("#_eaglercraftX_crashReason").appendChild(document.createTextNode(a));try{var h=window.navigator.userAgent}catch(t){h=""}c.querySelector("#_eaglercraftX_crashUserAgent").appendChild(document.createTextNode(h));eb&&eb();window.__curEaglerX188UnloadListenerCB=null;a="No GL_RENDERER string could be queried";try{const t=document.createElement("canvas");t.width=64;t.height=64;const D=t.getContext("webgl");if(D){if(D.getExtension("WEBGL_debug_renderer_info"))var l=D.getParameter(37446); else(l=D.getParameter(WebGLRenderingContext.RENDERER))&&(l+=" [masked]");l&&(a=l)}}catch(t){}c.querySelector("#_eaglercraftX_crashWebGL").appendChild(document.createTextNode(a))}else alert("Compatibility error: "+a)}}var ic=null; function cc(){if(ic)return ic;try{var a=Wa,b=Xa;if(!a){b=!1;var d=document.createElement("canvas");d.width=64;d.height=64;a=d.getContext("webgl2");a||(a=d.getContext("webgl"),a||(b=!0,a=d.getContext("experimental-webgl")))}return a?(d="",0"}return"window.navigator."+a+" = "+b+"\n"}function ec(){try{var a=[];if("object"===typeof navigator.plugins){var b=navigator.plugins.length;if(0"}return"window.navigator.plugins = "+h+"\n"} function gc(a){try{var b=window.screen[a]}catch(d){b=""}return"window.screen."+a+" = "+b+"\n"}function hc(){try{var a=window.location.href}catch(b){a=""}return"window.location.href = "+a+"\n"}function fc(a){try{var b=window[a]}catch(d){b=""}return"window."+a+" = "+b+"\n"};function jc(a,b,d){const c=document.createElement("a");c.style.position="absolute";c.style.left="0px";c.style.top="0px";c.style.zIndex="-100";c.style.color="transparent";c.innerText="Download File";c.href=b;c.target="_blank";c.download=a;P.appendChild(c);setTimeout(function(){c.click();setTimeout(function(){P.removeChild(c)},50);d&&setTimeout(d,6E4)},50)}var kc=0,lc=null,mc=null,nc=null,oc=null; function Ib(a,b){if(nc)oc&&oc(a,b);else for(a={msg:a,err:b,next:null},mc&&(mc.next=a),lc||=a,mc=a,++kc;256Debug Console

'); v.close();S=v.body;U=v.getElementById("loggerMessageContainer");for(m=lc;m;)h(m.msg+"\n",m.err?"#DD0000":"#000000"),m=m.next;mc=lc=null;kc=0;l();m=()=>{null!=nc&&(nc=null,b(!1))};nc.addEventListener("beforeunload",m);nc.addEventListener("unload",m)}else g("Logger popup was blocked!"),window.alert("ERROR: Popup blocked!\n\nPlease make sure you have popups enabled for this site!")}}function h(m,u){var w=v.createElement("span");w.innerText=m;w.style.color=u;U.appendChild(w);for(m=U.children;2048{nc.scrollTo(0,S.scrollHeight||S.clientHeight)},1)}G.setClipboard=function(m){try{if(window.navigator.clipboard)return window.navigator.clipboard.writeText(m),!0}catch(u){g("Failed to set clipboard data!")}return!1};G.getClipboard=new WebAssembly.Suspending(async function(){var m=null;try{window.navigator.clipboard&&(m=await navigator.clipboard.readText())}catch(u){g("Failed to read clipboard data!")}return m});var t=!1,D=null,y=null,B=null;G.displayFileChooser=function(m, u){a();if($a){const f=B=document.createElement("div");f.classList.add("_eaglercraftX_mobile_file_chooser_popup");f.style.position="absolute";f.style.backgroundColor="white";f.style.fontFamily="sans-serif";f.style.top="10%";f.style.left="10%";f.style.right="10%";f.style.border="5px double black";f.style.padding="15px";f.style.textAlign="left";f.style.fontSize="20px";f.style.userSelect="none";f.style.zIndex="150";var w=document.createElement("h3");w.appendChild(document.createTextNode("File Chooser")); f.appendChild(w);w=document.createElement("p");const x=y=document.createElement("input");x.type="file";x.accept=null===m?"."+u:m;x.multiple=!1;w.appendChild(x);f.appendChild(w);m=document.createElement("p");u=document.createElement("button");u.classList.add("_eaglercraftX_mobile_file_chooser_btn_cancel");u.style.fontSize="1.0em";u.addEventListener("click",function(){B===f&&(P.removeChild(f),y=B=null)});u.appendChild(document.createTextNode("Cancel"));m.appendChild(u);m.appendChild(document.createTextNode(" ")); u=document.createElement("button");u.classList.add("_eaglercraftX_mobile_file_chooser_btn_done");u.style.fontSize="1.0em";u.style.fontWeight="bold";u.addEventListener("click",function(){if(B===f){if(0{if(nc){var m=nc;U=S=v=nc=null;m.close()}})}catch(m){}(gb||d())&&c();oc=function(m,u){var w=nc.innerHeight+nc.pageYOffset>=S.offsetHeight;h(m+"\n",u?"#DD0000":"#000000");w&&l()};G.showDebugConsole=function(){b(!0);c()};G.addLogMessage=Ib;G.isShowingDebugConsole=function(){return!!nc};G.getFaviconURL=function(){return Ta}};wa.getEPKFileData=function(a){const b=Pa[a];Pa[a]=null;return b};wa.getEPKFileCount=function(){return Pa.length}; if("undefined"!==typeof window){wa.loadImageFile0=new WebAssembly.Suspending(function(a,b){return new Promise(function(d){const c=URL.createObjectURL(new Blob([a],{type:b}));if(c){const h=document.createElement("img");h.addEventListener("load",function(){URL.revokeObjectURL(c);d({width:h.width,height:h.height,img:h})});h.addEventListener("error",function(){URL.revokeObjectURL(c);d(null)});h.src=c}else d(null)})});var pc=null,qc=null;wa.loadImageFile1=function(a,b){const d=a.width,c=a.height;if(a= a.img)pc||=document.createElement("canvas"),pc.widthk&&(k=1);U=S=0;for(var A=R;A&&!isNaN(A.offsetLeft)&&!isNaN(A.offsetTop);)S+=A.offsetLeft-A.scrollLeft,U+=A.offsetTop-A.scrollTop,A=A.offsetParent;A=P.clientWidth*k|0;var V=P.clientHeight*k|0,W=0,ca=0,sa=A,ja=V;if(O){ja=window.visualViewport;var Y=ja.scale;W=ja.pageLeft*k*Y;ca=ja.pageTop*k*Y;sa=ja.width*k*Y;ja=ja.height*k*Y;1>sa&&(sa=1);1>ja&&(ja=1);0>W?(sa+=W,W=0):W>=A&&(W=A-1);0>ca?(ja+=ca,ca=0):ca>=V&&(ca=V-1);W+sa>A&&(sa=A-W);ca+ ja>V&&(ja=V-ca)}Y={eventTypeMask:0};H!==k&&(H=k,Y.eventTypeMask|=4,Y.windowDPI=k);if(z!==A||E!==V)z=A,E=V,Y.eventTypeMask|=1,Y.windowWidth=A,Y.windowHeight=V;if(ma!==W||Z!==ca||X!==sa||Ga!==ja)ma=W,Z=ca,X=sa,Ga=ja,Y.eventTypeMask|=2,Y.visualViewportX=W,Y.visualViewportY=ca,Y.visualViewportW=sa,Y.visualViewportH=ja;0!==Y.eventTypeMask&&T(0,9,Y)}function b(k){const A=k.length,V=Array(A);for(var W=0;WA-Ha&&(ta=window.setTimeout(function(){try{R.requestPointerLock()}catch(V){}},3100-(A-Ha)))}else{-1!==ta&&window.clearTimeout(ta);ta=-1;try{document.exitPointerLock()}catch(V){}}}}function t(){if(Ia)if(ua.matches){if(ka)try{navigator.keyboard.unlock()}catch(k){}try{document.exitFullscreen()}catch(k){}}else{if(ka)try{navigator.keyboard.lock()}catch(k){}try{R.requestFullscreen()}catch(k){}}} function D(){B()?y():r?(r.blur(),r.value="",setTimeout(function(){r&&(K?K.removeChild(r):r.remove(),r=null);K&&(P.removeChild(K),K=null)},10)):(K&&(P.removeChild(K),K=null),K=document.createElement("form"),K.setAttribute("autocomplete","off"),K.classList.add("_eaglercraftX_text_input_wrapper"),K.style.position="absolute",K.style.top="0px",K.style.left="0px",K.style.right="0px",K.style.bottom="0px",K.style.zIndex="-100",K.style.margin="0px",K.style.padding="0px",K.style.border="none",K.addEventListener("submit", function(k){k.preventDefault();k.stopPropagation();k=k.timeStamp;k&&(0!==f&&10>k-f||0!==x&&10>k-x||0!==p&&10>k-p)||(w||(e("Note: Generating return keystroke from submit event on form, this browser probably doesn't generate keydown/beforeinput/input when enter/return is pressed on the on-screen keyboard"),w=!0),T(0,3,{eventType:0,absoluteCode:28,absoluteChar:10}))}),r=document.createElement("input"),r.type="password",r.value=" ",r.classList.add("_eaglercraftX_text_input_element"),r.setAttribute("autocomplete", "off"),r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style.right="0px",r.style.bottom="0px",r.style.zIndex="-100",r.style.margin="0px",r.style.padding="0px",r.style.border="none",r.style.setProperty("-webkit-touch-callout","default"),r.addEventListener("beforeinput",function(k){if(r===k.target){m||(e("Note: Caught beforeinput event from on-screen keyboard, browser probably does not generate global keydown/keyup events on text fields, or does not respond to cancelling keydown"), m=!0);var A=k.timeStamp;if(A){if(0!==f&&10>A-f)return;x=A}k.preventDefault();k.stopPropagation();switch(k.inputType){case "insertParagraph":case "insertLineBreak":T(0,3,{eventType:0,absoluteCode:28,absoluteChar:10});break;case "deleteWordBackward":case "deleteSoftLineBackward":case "deleteHardLineBackward":case "deleteEntireSoftLine":case "deleteContentBackward":case "deleteContent":T(0,3,{eventType:0,absoluteCode:14,absoluteChar:0});break;case "deleteWordForward":case "deleteSoftLineForward":case "deleteHardLineForward":case "deleteContentForward":T(0, 3,{eventType:0,absoluteCode:211,absoluteChar:0});break;case "insertText":case "insertCompositionText":case "insertReplacementText":(k=k.data)&&0k-f||0!==x&&10>k-x)return;p=k}k=r.value;var A=k.length;0===A?T(0,3,{eventType:0,absoluteCode:14,absoluteChar:0}):1===A?T(0,3,{eventType:1,codepoints:k}):(k=k.trim(),A=k.length,0===A?T(0,3,{eventType:0,absoluteCode:57, absoluteChar:32}):T(0,3,{eventType:1,codepoints:k.charAt(A-1)}));r.value=" ";r.setSelectionRange(1,1)}}),r.addEventListener("focus",function(k){r===k.target&&(r.value=" ",r.setSelectionRange(1,1))}),r.addEventListener("select",function(k){r===k.target&&(k.preventDefault(),k.stopPropagation(),r.value=" ",r.setSelectionRange(1,1))}),K.appendChild(r),P.appendChild(K),r.value=" ",r.focus(),r.select(),r.setSelectionRange(1,1))}function y(){if(r){r.blur();r.value="";const k=r,A=K;window.setTimeout(function(){null!== A?(A.removeChild(k),A.remove()):k.remove()},10);K=r=null}else K&&(P?P.removeChild(K):K.remove(),K=null)}function B(){return!!r&&document.activeElement===r}var v=null,S=0,U=0,K=null,r=null,m=!1,u=!1,w=!1,f=0,x=0,p=0,z=-1,E=-1,H=-1,O=!1,ma=-1,Z=-1,X=-1,Ga=-1,Aa=!1,Ba=!1,Ha=0,ta=-1,Ia=!1,ua=null,ka=!1,n=!1,q=-1,F=!1,L=null,Q=null,aa=null,pa=null,Ra=null,ib=null,jb=null,kb=null,lb=null,mb=null,nb=null,ob=null,pb=null,qb=null,rb=null,sb=null,tb=null,ub=null,vb=null,wb=null,xb=null,yb=null;v=document.createElement("div"); v.classList.add("_eaglercraftX_keyboard_open_zone");v.style.display="none";v.style.position="absolute";v.style.backgroundColor="transparent";v.style.top="0px";v.style.left="0px";v.style.width="0px";v.style.height="0px";v.style.zIndex="100";v.style.touchAction="pan-x pan-y";v.style.setProperty("-webkit-touch-callout","none");v.style.setProperty("-webkit-tap-highlight-color","rgba(255, 255, 255, 0)");P.appendChild(v);a();P.addEventListener("contextmenu",L=function(k){k.preventDefault();k.stopPropagation()}); R.addEventListener("mousedown",Q=function(k){k.preventDefault();k.stopPropagation();Aa&&Ba&&document.pointerLockElement!==R?l(1):T(0,0,{eventType:0,posX:k.offsetX,posY:k.offsetY,button:k.button})});R.addEventListener("mouseup",aa=function(k){k.preventDefault();k.stopPropagation();T(0,0,{eventType:1,posX:k.offsetX,posY:k.offsetY,button:k.button})});R.addEventListener("mousemove",pa=function(k){k.preventDefault();k.stopPropagation();T(0,0,{eventType:2,posX:k.offsetX,posY:k.offsetY,movementX:k.movementX, movementY:k.movementY})});R.addEventListener("mouseenter",Ra=function(){T(0,7,null)});R.addEventListener("mouseleave",ib=function(){T(0,8,null)});R.addEventListener("touchstart",jb=function(k){k.preventDefault();k.stopPropagation();T(0,2,{eventType:0,changedTouches:b(k.changedTouches),targetTouches:b(k.targetTouches)});y()});R.addEventListener("touchend",kb=function(k){k.preventDefault();k.stopPropagation();T(0,2,{eventType:2,changedTouches:b(k.changedTouches),targetTouches:b(k.targetTouches)})}); R.addEventListener("touchmove",lb=function(k){k.preventDefault();k.stopPropagation();T(0,2,{eventType:1,changedTouches:b(k.changedTouches),targetTouches:b(k.targetTouches)})});R.addEventListener("touchcancel",mb=function(k){T(0,2,{eventType:2,changedTouches:b(k.changedTouches),targetTouches:b(k.targetTouches)})});R.addEventListener("wheel",ub=function(k){k.preventDefault();k.stopPropagation();T(0,0,{eventType:3,posX:k.offsetX,posY:k.offsetY,wheel:k.deltaY})});window.addEventListener("blur",wb=function(){T(0, 6,null)});window.addEventListener("focus",vb=function(){T(0,5,null)});window.addEventListener("keydown",pb=function(k){k.preventDefault();k.stopPropagation();"F11"!==k.key||k.repeat?(T(0,1,d(k.repeat?2:0,k)),k.timeStamp&&"Unidentified"!==k.key&&(f=k.timeStamp)):t()});window.addEventListener("keyup",qb=function(k){k.preventDefault();k.stopPropagation();T(0,1,d(1,k))});v.addEventListener("touchstart",rb=function(k){k.preventDefault();k.stopPropagation()});v.addEventListener("touchend",sb=function(k){k.preventDefault(); k.stopPropagation();D()});v.addEventListener("touchmove",tb=function(k){k.preventDefault();k.stopPropagation()});(Aa="function"===typeof document.exitPointerLock)?document.addEventListener("pointerlockchange",xb=function(){window.setTimeout(function(){const k=document.pointerLockElement===R;k||Ba&&(Ha=performance.now()|0);Ba=k},60)}):g("Pointer lock is not supported on this browser");(Ia="function"===typeof document.exitFullscreen)?(ua=window.matchMedia("(display-mode: fullscreen)"),(ka=!(!navigator.keyboard|| !navigator.keyboard.lock))&&ua.addEventListener("change",yb=function(){ua.matches||navigator.keyboard.unlock()})):g("Fullscreen is not supported on this browser");if("undefined"!==typeof window.visualViewport)if("body"===Va.tagName.toLowerCase())O=!0;else{const k=document.body;10>=Math.abs(k.clientWidth-P.clientWidth)&&10>=Math.abs(k.clientHeight-P.clientHeight)&&(O=!0)}else O=!1;O&&e("Note: Detected game is embedded in body, some screens may be resized to window.visualViewport instead for a better mobile experience"); try{await c(),n=!0}catch(k){n=!1}n||g("VSync is not supported on this browser");(F="function"===typeof navigator.getGamepads)?(window.addEventListener("gamepadconnected",nb=function(){T(0,10,{eventType:0})}),window.addEventListener("gamepaddisconnected",ob=function(k){T(0,10,{eventType:1,gamepad:k.gamepad})})):g("Gamepad detected as unsupported!");I.keyboardLayoutSupported=function(){return!(!navigator.keyboard||!navigator.keyboard.getLayoutMap)};I.iterateKeyboardLayout=new WebAssembly.Suspending(async function(){const k= [];try{const A=await navigator.keyboard.getLayoutMap();A&&A.forEach&&A.forEach(function(V,W){k.push({key:V,value:W})})}catch(A){}return k});I.updateCanvasSize=function(k,A){R.width!==k&&(R.width=k);R.height!==A&&(R.height=A)};var va=0;I.updatePlatformAndSleep=new WebAssembly.Suspending(function(k,A){a();if("string"!==typeof document.visibilityState||"visible"===document.visibilityState){if(n&&A)return va=0,c();if(0>=k)return va=0,Fb?xc(0):yc();a:{if(0k)if(0===va)va=performance.now();else{A= performance.now();const V=1E3/k;k=A-va;2E3k?(k=V,va=A):va+=V;if(0<=k&&k{l.hasOwnProperty("type")&&"offer"===l.type&&this._peerConnection.createAnswer().then(t=>{this._peerConnection.setLocalDescription(t).then(()=>{T(2,1,{objId:this.objId,data:JSON.stringify(t)})}).catch(D=>{g('Failed to set local description for "{}"! {}',this.objId,D.message);T(2,3,{objId:this.objId})})}).catch(t=>{g('Failed to create answer for "{}"! {}',this.objId,t.message);T(2,3,{objId:this.objId})})}).catch(t=> {g('Failed to set remote description for "{}"! {}',this.objId,t.message);T(2,3,{objId:this.objId})})}catch(l){g(l.message),T(2,3,{objId:this.objId})}}function b(h){try{this._peerConnection.addIceCandidate(new RTCIceCandidate(JSON.parse(h))).catch(l=>{g('Failed to parse ice candidate for "{}"! {}',this.objId,l.message);T(2,3,{objId:this.objId})})}catch(l){g(l.message),T(2,3,{objId:this.objId})}}function d(){this._peerConnection.close()}Ea.isSupported=function(){return"undefined"!==typeof navigator.mediaDevices&& "undefined"!==typeof navigator.mediaDevices.getUserMedia&&"srcObject"in HTMLAudioElement.prototype};let c=0;Ea.createRTCPeerConnection=function(h,l,t){try{const y=c++;var D;const B=new RTCPeerConnection({iceServers:JSON.parse(h),optional:[{DtlsSrtpKeyAgreement:!0}]});B.addEventListener("icecandidate",v=>{v.candidate&&T(2,0,{objId:y,data:JSON.stringify({sdpMLineIndex:""+v.candidate.sdpMLineIndex,candidate:v.candidate.candidate})})});B.addEventListener("track",v=>{v=v.streams[0];D._aud=document.createElement("audio"); D._aud.autoplay=!0;D._aud.muted=!0;D._aud.srcObject=v;T(2,2,{objId:y,stream:v})});t.getTracks().forEach(function(v){B.addTrack(v,t)});l&&B.createOffer().then(v=>{B.setLocalDescription(v).then(()=>{T(2,1,{objId:y,data:JSON.stringify(v)})}).catch(S=>{g('Failed to set local description for "{}"! {}',y,S.message);T(2,3,{objId:y})})}).catch(v=>{g('Failed to set create offer for "{}"! {}',y,v.message);T(2,3,{objId:y})});B.addEventListener("connectionstatechange",()=>{const v=B.connectionState;"disconnected"!== v&&"failed"!==v||T(2,3,{objId:y})});return D={objId:y,_peerConnection:B,setRemoteDescription:a,addRemoteICECandidate:b,closeHandle:d}}catch(y){return g(y.message),null}}};function Nb(){const a=new qa;let b;b={iceServers:[],g:null,h:null,readyState:1,v:null,description:null,D:!1,C:!0,disconnect:function(c){if(b.h){try{b.h.close()}catch(h){}b.h=null}if(b.g){try{b.g.close()}catch(h){}b.g=null}c||(b.C=!0);b.readyState=0}};M.supported=function(){return"undefined"!==typeof RTCPeerConnection};M.clientLANReadyState=function(){return b.readyState};M.clientLANCloseConnection=function(){b.disconnect(!1)};M.clientLANSendPacket=function(c){if(null!==b.h&&"open"===b.h.readyState)try{b.h.send(c)}catch(h){b.disconnect(!1)}else b.disconnect(!1)}; M.clientLANReadPacket=function(){const c=a.j();return c?new Uint8Array(c.data):null};M.clientLANAvailable=function(){return a.u};M.clientLANSetICEServersAndConnect=function(c){b.iceServers.length=0;for(let h of c)c=h.split(";"),1===c.length?b.iceServers.push({urls:c[0]}):3===c.length&&b.iceServers.push({urls:c[0],username:c[1],credential:c[2]});2!==b.readyState&&1!==b.readyState||b.disconnect(!0);try{if(b.h){try{b.h.close()}catch(h){}b.h=null}if(b.g)try{b.g.close()}catch(h){}b.g=new RTCPeerConnection({iceServers:b.iceServers, optional:[{DtlsSrtpKeyAgreement:!0}]});b.readyState=1}catch(h){ia("Could not create LAN client RTCPeerConnection!",h);b.readyState=-2;return}try{const h=[];b.g.addEventListener("icecandidate",t=>{if(t.candidate){if(0===h.length){const D=[0,0],y=()=>{if(null!==b.g&&"disconnected"!==b.g.connectionState){const B=++D[1];D[0]!==h.length&&3>B?(D[0]=h.length,setTimeout(y,2E3)):(b.v=JSON.stringify(h),h.length=0)}};setTimeout(y,2E3)}h.push({sdpMLineIndex:t.candidate.sdpMLineIndex,candidate:t.candidate.candidate})}}); b.h=b.g.createDataChannel("lan");b.h.binaryType="arraybuffer";let l;l=()=>{0{a.push({data:t.data,_next:null})});b.g.createOffer().then(t=>{b.g.setLocalDescription(t).then(()=>{b.description=JSON.stringify(t)}).catch(D=>{g("Failed to set local description! {}",D.message);b.readyState=-1;b.disconnect(!1)})}).catch(t=>{g("Failed to set create offer! {}",t.message);b.readyState=-1;b.disconnect(!1)}); b.g.addEventListener("connectionstatechange",()=>{var t=b.g.connectionState;"disconnected"===t?b.disconnect(!1):"connected"===t?b.readyState=2:"failed"===t&&(b.readyState=-1,b.disconnect(!1))})}catch(h){if(b.h){try{b.h.close()}catch(l){}b.h=null}if(b.g){try{b.g.close()}catch(l){}b.g=null}ia("Could not create LAN client RTCDataChannel!",h);b.readyState=-2}};M.clearLANClientState=function(){b.v=b.description=null;b.D=!1;b.C=!0};M.clientLANAwaitICECandidate=function(){if(null===b.v)return null;const c= b.v;b.v=null;return c};M.clientLANAwaitDescription=function(){if(null===b.description)return null;const c=b.description;b.description=null;return c};M.clientLANAwaitChannel=function(){return b.D?(b.D=!1,!0):!1};M.clientLANClosed=function(){return b.C};M.clientLANSetICECandidate=function(c){try{const h=JSON.parse(c);for(c=0;c{if(y.candidate){if(0=== t.length){const B=[0,0],v=()=>{if(null!==l.g&&"disconnected"!==l.g.connectionState){const S=++B[1];B[0]!==t.length&&3>S?(B[0]=t.length,setTimeout(v,2E3)):(l.s(0,JSON.stringify(t)),t.length=0)}};setTimeout(v,2E3)}t.push({sdpMLineIndex:y.candidate.sdpMLineIndex,candidate:y.candidate.candidate})}});let D;D=y=>{0{B=B.data;l.l?bb(l.l,B):l.s(3,new Uint8Array(B))})))};l.g.addEventListener("datachannel", D);l.g.addEventListener("connectionstatechange",()=>{const y=l.g.connectionState;"disconnected"!==y&&"failed"!==y||d.disconnect(l.i)});return{peerId:l.i,countAvailableEvents:function(){return h.u},nextEvent:function(){return h.j()},writePacket:function(y){let B=!1;if(null!==l.h&&"open"===l.h.readyState)try{l.h.send(y)}catch(v){B=!0}else B=!0;B&&d.disconnect(l.i)},handleRemoteICECandidates:function(y){try{const B=JSON.parse(y);for(let v of B)l.g.addIceCandidate(new RTCIceCandidate(v))}catch(B){g('Failed to parse ice candidate for "{}"! {}', l.i,B.message),d.disconnect(l.i)}},handleRemoteDescription:function(y){try{const B=JSON.parse(y);l.g.setRemoteDescription(B).then(()=>{B.hasOwnProperty("type")&&"offer"===B.type&&l.g.createAnswer().then(v=>{l.g.setLocalDescription(v).then(()=>{l.s(1,JSON.stringify(v))}).catch(S=>{g('Failed to set local description for "{}"! {}',l.i,S.message);d.disconnect(l.i)})}).catch(v=>{g('Failed to create answer for "{}"! {}',l.i,v.message);d.disconnect(l.i)})}).catch(v=>{g('Failed to set remote description for "{}"! {}', l.i,v.message);d.disconnect(l.i)})}catch(B){g('Failed to parse remote description for "{}"! {}',l.i,B.message),d.disconnect(l.i)}},mapIPC:function(y){l.l?y||(d.F.delete(l.l),l.l=null):y&&(l.l=y,d.F.set(y,l))},disconnect:function(){d.disconnect(l.i)}}}catch(h){return ia("Failed to create WebRTC LAN peer!",h),null}};ab=function(c,h){if(c=d.F.get(c)){let l=!1;if(c.h&&"open"===c.h.readyState)try{c.h.send(h)}catch(t){l=!0}else l=!0;l&&d.disconnect(c.i);return!0}return!1}};function Ob(){function a(p,z){p.allow=z;return p.allow===z}function b(p,z){const E=p.sandbox;for(var H=0;HO===E[H]))return!1;return!0}function d(p){if(S)f=document.createElement("iframe"),f.allow="",f.referrerPolicy="strict-origin",f.sandbox.add("allow-downloads"),p.scriptEnabled&&(f.sandbox.add("allow-scripts"),f.sandbox.add("allow-pointer-lock"));else{f=document.createElement("iframe"); f.referrerPolicy="strict-origin";var z=["allow-downloads"];p.scriptEnabled&&(z.push("allow-scripts"),z.push("allow-pointer-lock"));if(!a(f,"")||!b(f,z)){g("Caught safety exception while opening webview!");null!==f&&(f.remove(),f=null);g("Things you can try:");g("1. Set window.eaglercraftXOpts.forceWebViewSupport to true");g("2. Set window.eaglercraftXOpts.enableWebViewCSP to false");g("(these settings may compromise security)");c();w.innerHTML='

 IFrame Safety Error

The content cannot be displayed safely!

Check console for more details

';return}}f.j=!0;f.o="lazy";z=!1;if(1===p.contentMode){if(U&&v)if("string"===typeof f.csp){var E="default-src 'none';",H=p.strictCSPEnable?"":r?" https:":" http: https:";E=p.scriptEnabled?E+(" script-src 'unsafe-eval' 'unsafe-inline' data: blob:"+H+"; style-src 'unsafe-eval' 'unsafe-inline' data: blob:")+(H+"; img-src data: blob:")+ (H+"; font-src data: blob:")+(H+"; child-src data: blob:")+(H+"; frame-src data: blob:; media-src data: mediastream: blob:")+(H+"; connect-src data: blob:")+(H+"; worker-src data: blob:")+(H+";"):E+(" style-src data: 'unsafe-inline'"+H+"; img-src data:")+(H+"; font-src data:")+(H+"; media-src data:")+(H+";");f.csp=E}else ha("This browser does not support CSP attribute on iframes! (try Chrome)"),z=!0;else z=!0;z&&p.strictCSPEnable&&ha("Strict CSP was requested for this webview, but that feature is not available!")}else z= !0;f.style.border="none";f.style.backgroundColor="white";f.style.width="100%";f.style.height="100%";f.classList.add("_eaglercraftX_webview_iframe_element");u.appendChild(f);1===p.contentMode?(E=y.decode(p.blob),p.blob=null,f.srcdoc=E):f.src=p.uri;const O=m,ma=f;let Z=!1;f.addEventListener("mouseover",function(){O!==m||ma!==f||Z||(Z=!0,f.contentWindow.focus())});f.addEventListener("mouseout",function(){O===m&&ma===f&&Z&&(Z=!1,window.focus())});p.scriptEnabled&&p.serverMessageAPIEnabled&&(x=function(X){if(O=== m&&ma===f&&X.source===ma.contentWindow){X=X.data;if("object"===typeof X&&1===X.ver&&"string"===typeof X.channel&&0 Allow JavaScript

Strict CSP: '+(1!==p.contentMode?'Impossible':v&&U?p.strictCSPEnable?'Enabled':'Disabled':'Unsupported')+" | Message API: "+(p.serverMessageAPIEnabled?'Enabled': 'Disabled')+'

Remember my choice

';const z=m;if(1!==p.contentMode){const E=p.url;w.querySelector("._eaglercraftX_permission_target_url").innerText=255 Content Blocked

You chose to block JavaScript execution for this embed

';const z=m;w.querySelector("._eaglercraftX_re_evaluate_javascript").addEventListener("click",function(){m===z&&null!==w&&(T(3,4,null),h(p))})}function t(p,z,E,H){if(u){const O=window.devicePixelRatio;u.style.top=""+z/O+"px";u.style.left=""+ p/O+"px";u.style.width=""+(E/O-10)+"px";u.style.height=""+(H/O-10)+"px"}}function D(){++m;f&&(f.remove(),f=null);x=null;w&&(w.remove(),w=null);u&&(u.remove(),u=null);window.focus()}const y=new TextDecoder("utf-8");var B=!1,v=!1,S=zb,U=Ab;if(S)v=B=!0;else{v=B=!1;try{var K=document.createElement("iframe");B=null!=K&&"string"===typeof K.allow&&"object"===typeof K.sandbox;v=U&&B&&"string"===typeof K.csp}catch(p){g("Error checking iframe support"),g(p)}}B?!v&&U&&ha("This browser does not support CSP attribute on iframes! (try Chrome)"): g("This browser does not meet the safety requirements for webview support, this feature will be disabled");const r=location.protocol&&"https:"===location.protocol.toLowerCase();var m=0,u=null,w=null,f=null,x=null;window.addEventListener("message",function(p){x&&p.source!==window&&x(p)});Fa.checkSupported=function(){return B};Fa.checkCSPSupported=function(){return v};Fa.sendStringMessage=function(p,z){try{var E;null!=f&&null!=(E=f.contentWindow)?E.postMessage({ver:1,channel:p,type:"string",data:z}, "*"):g("Server tried to send the WebView a message, but the message channel is not open!")}catch(H){ia("Failed to send string message to WebView!",H)}};Fa.sendBinaryMessage=function(p,z){try{var E;if(null!=f&&null!=(E=f.contentWindow)){const H=new Uint8Array(z.length);H.set(z,0);E.postMessage({ver:1,channel:p,type:"binary",data:H.buffer},"*")}else g("Server tried to send the WebView a message, but the message channel is not open!")}catch(H){ia("Failed to send string message to WebView!",H)}};Fa.beginShowing= function(p,z,E,H,O,ma){if(B)try{switch(null!==u&&D(),u=document.createElement("div"),u.classList.add("_eaglercraftX_webview_container_element"),u.style.border="5px solid #333333",u.style.zIndex="11",u.style.position="absolute",u.style.backgroundColor="#DDDDDD",u.style.fontFamily="sans-serif",t(E,H,O,ma),P.appendChild(u),p){case 0:d(z);break;case 1:if(1===z.contentMode){const Z=new Uint8Array(z.blob.length);Z.set(z.blob,0);z.blob=Z}h(z);break;case 2:if(1===z.contentMode){const Z=new Uint8Array(z.blob.length); Z.set(z.blob,0);z.blob=Z}l(z)}}catch(Z){ia("Failed to begin showing WebView!",Z)}};Fa.resize=t;Fa.endShowing=D};function Pb(){var a=null;const b=new qa;var d=null;Ja.startIntegratedServer=new WebAssembly.Suspending(async function(){d||=URL.createObjectURL(new Blob(['"use strict"; (function(ctx, globals) {globals.__eaglerXOnMessage = function(o) {globals.__eaglerXOnMessage = function(oo) { console.error("Dropped IPC packet that was sent too early!"); };const eagRuntimeJSURL = URL.createObjectURL(new Blob([ o.eagruntimeJS ], { type: "text/javascript;charset=utf-8" }));ctx.getEaglercraftXOpts = function() { return o.eaglercraftXOpts; };ctx.getEagRuntimeJSURL = function() { return eagRuntimeJSURL; };ctx.getClassesWASMURL = function() { return o.classesWASM; };ctx.getClassesDeobfWASMURL = function() { return o.classesDeobfWASM; };ctx.getClassesTEADBGURL = function() { return o.classesTEADBG; };ctx.getEPKFiles = function() { return null; };ctx.getRootElement = function() { return null; };ctx.getMainArgs = function() { return ["_worker_process_"]; };ctx.getImageURL = function(idx) { return null; };ctx.runMain = function(mainFunc) { mainFunc(); };importScripts(eagRuntimeJSURL);};addEventListener("message", function(evt) { globals.__eaglerXOnMessage(evt.data); });})(self.__eaglercraftXLoaderContext = {}, self);'], {type:"text/javascript;charset=utf8"}));try{a=new Worker(d)}catch(t){return ia("Failed to create worker",t),!1}a.addEventListener("error",function(t){ia("Worker Error",t.error)});a.addEventListener("message",function(t){const D=t.data.ch;D?"~!LOGGER"===D?Ib(t.data.txt,t.data.err):(t=t.data.dat)?ab(D,t)||b.push({ch:D,data:new Uint8Array(t),_next:null}):g("Recieved IPC packet with null buffer"):g("Recieved IPC packet with null channel")});const h=new Int8Array(Na.length);h.set(Na,0);try{var l=await fetch(Ua, {cache:"force-cache"}).then(t=>t.arrayBuffer())}catch(t){ia("Failed to fetch eagruntime.js contents",t);try{a.terminate()}catch(D){}return!1}a.postMessage({eaglercraftXOpts:N,eagruntimeJS:l,classesWASM:La,classesDeobfWASM:Ma,classesTEADBG:h.buffer});return!0});Ja.sendPacket=function(h,l){if(a){const t=new Uint8Array(l.length);t.set(l,0);a.postMessage({ch:h,dat:t.buffer})}};bb=function(h,l){a&&a.postMessage({ch:h,dat:l})};Ja.getAvailablePackets=b.K.bind(b);Ja.getNextPacket=b.j.bind(b);Ja.killWorker= function(){a&&(a.terminate(),a=null)};var c=null;Ja.showCrashReportOverlay=function(h,l,t,D,y){c||(c=document.createElement("div"),c.setAttribute("style","z-index:99;position:absolute;background-color:black;color:white;overflow-x:hidden;overflow-y:scroll;overflow-wrap:break-word;white-space:pre-wrap;font:18px sans-serif;padding:20px;display:none;"),c.classList.add("_eaglercraftX_integratedserver_crash_element"),P.appendChild(c));c.innerText="";c.innerText="CURRENT DATE: "+(new Date).toLocaleString()+ "\n\n"+h;h=window.devicePixelRatio;c.style.top=""+t/h+"px";c.style.left=""+l/h+"px";c.style.width=""+(D/h-20)+"px";c.style.height=""+(y/h-20)+"px";c.style.display="block"};Ja.hideCrashReportOverlay=function(){c&&(c.style.display="none")}};var bc=null;function Wb(){const a=new qa;self.__eaglerXOnMessage=function(b){const d=b.ch;b=b.dat;d?b?a.push({ch:d,data:new Uint8Array(b),_next:null}):g("Recieved IPC packet with null buffer"):g("Recieved IPC packet with null channel")};Ka.sendPacket=function(b,d){const c=new Uint8Array(d.length);c.set(d,0);postMessage({ch:b,dat:c.buffer})};Ka.getAvailablePackets=a.K.bind(a);Ka.getNextPacket=a.j.bind(a);Ka.setCrashCallback=function(){return{call:function(b){bc=b}}}};ra.getByteBufferView=function(a,b){return new Int8Array(Za,a,b)};ra.getUnsignedByteBufferView=function(a,b){return new Uint8Array(Za,a,b)};ra.getUnsignedClampedByteBufferView=function(a,b){return new Uint8ClampedArray(Za,a,b)};ra.getShortBufferView=function(a,b){return new Int16Array(Za,a,b)};ra.getUnsignedShortBufferView=function(a,b){return new Uint16Array(Za,a,b)};ra.getIntBufferView=function(a,b){return new Int32Array(Za,a,b)};ra.getFloatBufferView=function(a,b){return new Float32Array(Za,a,b)};const Ic={172351395:{name:"EBML",type:"Container"},646:{name:"EBMLVersion",type:"Uint"},759:{name:"EBMLReadVersion",type:"Uint"},754:{name:"EBMLMaxIDLength",type:"Uint"},755:{name:"EBMLMaxSizeLength",type:"Uint"},642:{name:"DocType",type:"String"},647:{name:"DocTypeVersion",type:"Uint"},645:{name:"DocTypeReadVersion",type:"Uint"},108:{name:"Void",type:"Binary"},63:{name:"CRC-32",type:"Binary"},190023271:{name:"SignatureSlot",type:"Container"},16010:{name:"SignatureAlgo",type:"Uint"},16026:{name:"SignatureHash", type:"Uint"},16037:{name:"SignaturePublicKey",type:"Binary"},16053:{name:"Signature",type:"Binary"},15963:{name:"SignatureElements",type:"Container"},15995:{name:"SignatureElementList",type:"Container"},9522:{name:"SignedElement",type:"Binary"},139690087:{name:"Segment",type:"Container"},21863284:{name:"SeekHead",type:"Container"},3515:{name:"Seek",type:"Container"},5035:{name:"SeekID",type:"Binary"},5036:{name:"SeekPosition",type:"Uint"},88713574:{name:"Info",type:"Container"},13220:{name:"SegmentUID", type:"Binary"},13188:{name:"SegmentFilename",type:"String"},1882403:{name:"PrevUID",type:"Binary"},1868715:{name:"PrevFilename",type:"String"},2013475:{name:"NextUID",type:"Binary"},1999803:{name:"NextFilename",type:"String"},1092:{name:"SegmentFamily",type:"Binary"},10532:{name:"ChapterTranslate",type:"Container"},10748:{name:"ChapterTranslateEditionUID",type:"Uint"},10687:{name:"ChapterTranslateCodec",type:"Uint"},10661:{name:"ChapterTranslateID",type:"Binary"},710577:{name:"TimecodeScale",type:"Uint"}, 1161:{name:"Duration",type:"Float"},1121:{name:"DateUTC",type:"Date"},15273:{name:"Title",type:"String"},3456:{name:"MuxingApp",type:"String"},5953:{name:"WritingApp",type:"String"},103:{name:"Timecode",type:"Uint"},6228:{name:"SilentTracks",type:"Container"},6359:{name:"SilentTrackNumber",type:"Uint"},39:{name:"Position",type:"Uint"},43:{name:"PrevSize",type:"Uint"},35:{name:"SimpleBlock",type:"Binary"},32:{name:"BlockGroup",type:"Container"},33:{name:"Block",type:"Binary"},34:{name:"BlockVirtual", type:"Binary"},13729:{name:"BlockAdditions",type:"Container"},38:{name:"BlockMore",type:"Container"},110:{name:"BlockAddID",type:"Uint"},37:{name:"BlockAdditional",type:"Binary"},27:{name:"BlockDuration",type:"Uint"},122:{name:"ReferencePriority",type:"Uint"},123:{name:"ReferenceBlock",type:"Int"},125:{name:"ReferenceVirtual",type:"Int"},36:{name:"CodecState",type:"Binary"},13730:{name:"DiscardPadding",type:"Int"},14:{name:"Slices",type:"Container"},104:{name:"TimeSlice",type:"Container"},76:{name:"LaceNumber", type:"Uint"},77:{name:"FrameNumber",type:"Uint"},75:{name:"BlockAdditionID",type:"Uint"},78:{name:"Delay",type:"Uint"},79:{name:"SliceDuration",type:"Uint"},72:{name:"ReferenceFrame",type:"Container"},73:{name:"ReferenceOffset",type:"Uint"},74:{name:"ReferenceTimeCode",type:"Uint"},47:{name:"EncryptedBlock",type:"Binary"},106212971:{name:"Tracks",type:"Container"},46:{name:"TrackEntry",type:"Container"},87:{name:"TrackNumber",type:"Uint"},13253:{name:"TrackUID",type:"Uint"},3:{name:"TrackType",type:"Uint"}, 57:{name:"FlagEnabled",type:"Uint"},8:{name:"FlagDefault",type:"Uint"},5546:{name:"FlagForced",type:"Uint"},28:{name:"FlagLacing",type:"Uint"},11751:{name:"MinCache",type:"Uint"},11768:{name:"MaxCache",type:"Uint"},254851:{name:"DefaultDuration",type:"Uint"},216698:{name:"DefaultDecodedFieldDuration",type:"Uint"},209231:{name:"TrackTimecodeScale",type:"Float"},4991:{name:"TrackOffset",type:"Int"},5614:{name:"MaxBlockAdditionID",type:"Uint"},4974:{name:"Name",type:"String"},177564:{name:"Language", type:"String"},6:{name:"CodecID",type:"String"},9122:{name:"CodecPrivate",type:"Binary"},362120:{name:"CodecName",type:"String"},13382:{name:"AttachmentLink",type:"Uint"},1742487:{name:"CodecSettings",type:"String"},1785920:{name:"CodecInfoURL",type:"String"},438848:{name:"CodecDownloadURL",type:"String"},42:{name:"CodecDecodeAll",type:"Uint"},12203:{name:"TrackOverlay",type:"Uint"},5802:{name:"CodecDelay",type:"Uint"},5819:{name:"SeekPreRoll",type:"Uint"},9764:{name:"TrackTranslate",type:"Container"}, 9980:{name:"TrackTranslateEditionUID",type:"Uint"},9919:{name:"TrackTranslateCodec",type:"Uint"},9893:{name:"TrackTranslateTrackID",type:"Binary"},96:{name:"Video",type:"Container"},26:{name:"FlagInterlaced",type:"Uint"},5048:{name:"StereoMode",type:"Uint"},5056:{name:"AlphaMode",type:"Uint"},5049:{name:"OldStereoMode",type:"Uint"},48:{name:"PixelWidth",type:"Uint"},58:{name:"PixelHeight",type:"Uint"},5290:{name:"PixelCropBottom",type:"Uint"},5307:{name:"PixelCropTop",type:"Uint"},5324:{name:"PixelCropLeft", type:"Uint"},5341:{name:"PixelCropRight",type:"Uint"},5296:{name:"DisplayWidth",type:"Uint"},5306:{name:"DisplayHeight",type:"Uint"},5298:{name:"DisplayUnit",type:"Uint"},5299:{name:"AspectRatioType",type:"Uint"},963876:{name:"ColourSpace",type:"Binary"},1029411:{name:"GammaValue",type:"Float"},230371:{name:"FrameRate",type:"Float"},97:{name:"Audio",type:"Container"},53:{name:"SamplingFrequency",type:"Float"},14517:{name:"OutputSamplingFrequency",type:"Float"},31:{name:"Channels",type:"Uint"},15739:{name:"ChannelPositions", type:"Binary"},8804:{name:"BitDepth",type:"Uint"},98:{name:"TrackOperation",type:"Container"},99:{name:"TrackCombinePlanes",type:"Container"},100:{name:"TrackPlane",type:"Container"},101:{name:"TrackPlaneUID",type:"Uint"},102:{name:"TrackPlaneType",type:"Uint"},105:{name:"TrackJoinBlocks",type:"Container"},109:{name:"TrackJoinUID",type:"Uint"},64:{name:"TrickTrackUID",type:"Uint"},65:{name:"TrickTrackSegmentUID",type:"Binary"},70:{name:"TrickTrackFlag",type:"Uint"},71:{name:"TrickMasterTrackUID", type:"Uint"},68:{name:"TrickMasterTrackSegmentUID",type:"Binary"},11648:{name:"ContentEncodings",type:"Container"},8768:{name:"ContentEncoding",type:"Container"},4145:{name:"ContentEncodingOrder",type:"Uint"},4146:{name:"ContentEncodingScope",type:"Uint"},4147:{name:"ContentEncodingType",type:"Uint"},4148:{name:"ContentCompression",type:"Container"},596:{name:"ContentCompAlgo",type:"Uint"},597:{name:"ContentCompSettings",type:"Binary"},4149:{name:"ContentEncryption",type:"Container"},2017:{name:"ContentEncAlgo", type:"Uint"},2018:{name:"ContentEncKeyID",type:"Binary"},2019:{name:"ContentSignature",type:"Binary"},2020:{name:"ContentSigKeyID",type:"Binary"},2021:{name:"ContentSigAlgo",type:"Uint"},2022:{name:"ContentSigHashAlgo",type:"Uint"},206814059:{name:"Cues",type:"Container"},59:{name:"CuePoint",type:"Container"},51:{name:"CueTime",type:"Uint"},55:{name:"CueTrackPositions",type:"Container"},119:{name:"CueTrack",type:"Uint"},113:{name:"CueClusterPosition",type:"Uint"},112:{name:"CueRelativePosition",type:"Uint"}, 50:{name:"CueDuration",type:"Uint"},4984:{name:"CueBlockNumber",type:"Uint"},106:{name:"CueCodecState",type:"Uint"},91:{name:"CueReference",type:"Container"},22:{name:"CueRefTime",type:"Uint"},23:{name:"CueRefCluster",type:"Uint"},4959:{name:"CueRefNumber",type:"Uint"},107:{name:"CueRefCodecState",type:"Uint"},155296873:{name:"Attachments",type:"Container"},8615:{name:"AttachedFile",type:"Container"},1662:{name:"FileDescription",type:"String"},1646:{name:"FileName",type:"String"},1632:{name:"FileMimeType", type:"String"},1628:{name:"FileData",type:"Binary"},1710:{name:"FileUID",type:"Uint"},1653:{name:"FileReferral",type:"Binary"},1633:{name:"FileUsedStartTime",type:"Uint"},1634:{name:"FileUsedEndTime",type:"Uint"},4433776:{name:"Chapters",type:"Container"},1465:{name:"EditionEntry",type:"Container"},1468:{name:"EditionUID",type:"Uint"},1469:{name:"EditionFlagHidden",type:"Uint"},1499:{name:"EditionFlagDefault",type:"Uint"},1501:{name:"EditionFlagOrdered",type:"Uint"},54:{name:"ChapterAtom",type:"Container"}, 13252:{name:"ChapterUID",type:"Uint"},5716:{name:"ChapterStringUID",type:"String"},17:{name:"ChapterTimeStart",type:"Uint"},18:{name:"ChapterTimeEnd",type:"Uint"},24:{name:"ChapterFlagHidden",type:"Uint"},1432:{name:"ChapterFlagEnabled",type:"Uint"},11879:{name:"ChapterSegmentUID",type:"Binary"},11964:{name:"ChapterSegmentEditionUID",type:"Uint"},9155:{name:"ChapterPhysicalEquiv",type:"Uint"},15:{name:"ChapterTrack",type:"Container"},9:{name:"ChapterTrackNumber",type:"Uint"},0:{name:"ChapterDisplay", type:"Container"},5:{name:"ChapString",type:"String"},892:{name:"ChapLanguage",type:"String"},894:{name:"ChapCountry",type:"String"},10564:{name:"ChapProcess",type:"Container"},10581:{name:"ChapProcessCodecID",type:"Uint"},1293:{name:"ChapProcessPrivate",type:"Binary"},10513:{name:"ChapProcessCommand",type:"Container"},10530:{name:"ChapProcessTime",type:"Uint"},10547:{name:"ChapProcessData",type:"Binary"},39109479:{name:"Tags",type:"Container"},13171:{name:"Tag",type:"Container"},9152:{name:"Targets", type:"Container"},10442:{name:"TargetTypeValue",type:"Uint"},9162:{name:"TargetType",type:"String"},9157:{name:"TagTrackUID",type:"Uint"},9161:{name:"TagEditionUID",type:"Uint"},9156:{name:"TagChapterUID",type:"Uint"},9158:{name:"TagAttachmentUID",type:"Uint"},10184:{name:"SimpleTag",type:"Container"},1443:{name:"TagName",type:"String"},1146:{name:"TagLanguage",type:"String"},1156:{name:"TagDefault",type:"Uint"},1159:{name:"TagString",type:"String"},1157:{name:"TagBinary",type:"Binary"}}; function Jc(a,b){a.prototype=Object.create(b.prototype);a.prototype.constructor=a}function Kc(a,b){this.name=a||"Unknown";this.type=b||"Unknown"}Kc.prototype.j=function(){};Kc.prototype.m=function(){};function Lc(a,b){Kc.call(this,a,b||"Uint")}Jc(Lc,Kc);Lc.prototype.j=function(){this.data="";for(var a=0;a=h&&8>c;c++,h*=128);if(!d)for(b=h+b,d=c-1;0<=d;d--)h=b%256,a.source[a.offset+d]=h,b=(b-h)/256;a.offset+=c}function Qc(a,b){for(var d=a.offset=0;d=t.L())d("[fix-webm-duration] Duration section is present, but the value is empty"),t.H(b);else return d("[fix-webm-duration] Duration section is present"), !1;else d("[fix-webm-duration] Duration section is missing"),t=new Mc("Duration","Float"),t.H(b),h.data.push({id:1161,data:t});l.H(1E6);h.m();c.m();a.m();return!0}function Hc(a,b,d,c){try{var h=new FileReader;h.onloadend=function(){try{var l=new Sc(new Uint8Array(h.result));Tc(l,b,c)&&(a=new Blob([l.source.buffer],{type:a.type||"video/webm"}))}catch(t){}d(a)};h.readAsArrayBuffer(a)}catch(l){d(a)}};var Uc; (function(){function a(r){let m=v.get(r);"undefined"===typeof m&&(m=new Function("return "+r+";"),v.set(r,m));return m()}function b(r){let m={exports:null,B:null,I:null};d(r);c(r);h(r,m);l(r,m);r.teavmMath=Math;return{O(u){m.exports=u},Y(u){m.B=u},X(u){m.I=u}}}function d(r){r.teavmDate={currentTimeMillis:()=>(new Date).getTime(),dateToString:m=>(new Date(m)).toString(),getYear:m=>(new Date(m)).getFullYear(),setYear:(m,u)=>{m=new Date(m);m.setFullYear(u);return m.getTime()},getMonth:m=>(new Date(m)).getMonth(),setMonth:(m, u)=>{m=new Date(m);m.setMonth(u);return m.getTime()},getDate:m=>(new Date(m)).getDate(),setDate:(m,u)=>{m=new Date(m);m.setDate(u);return m.getTime()},create:(m,u,w,f,x,p)=>(new Date(m,u,w,f,x,p)).getTime(),createFromUTC:(m,u,w,f,x,p)=>Date.UTC(m,u,w,f,x,p)}}function c(r){let m=[],u=[];r.teavmConsole={putcharStderr:function(w){10===w?(w=String.fromCharCode(...m),console.error(w),ea&&ea(w,!0),m.length=0):m.push(w)},putcharStdout:function(w){10===w?(w=String.fromCharCode(...u),console.log(w),ea&&ea(w, !1),u.length=0):u.push(w)}}}function h(r,m){let u=new FinalizationRegistry(f=>{let x=m.exports["teavm.reportGarbageCollectedValue"];"undefined"!==typeof x&&m.I(function(){x(f.V,f.W)})}),w=new FinalizationRegistry(f=>{let x=m.exports["teavm.reportGarbageCollectedString"];"function"===typeof x&&m.I(function(){x(f)})});r.teavm={createWeakRef:(f,x,p)=>{null!==p&&u.register(f,{W:x,V:p});return new WeakRef(f)},deref:f=>f.deref(),createStringWeakRef:(f,x)=>{w.register(f,x);return new WeakRef(f)},stringDeref:f=> f.deref(),takeStackTrace:()=>{var f=Error().stack;let x=[];for(let p of f.split("\n"))f=S.exec(p),null!==f&&2<=f.length&&x.push(parseInt(f[1],16));return{getStack:function(){let p;if(m.B)try{p=m.B(x)}catch(z){console.warn("Could not deobfuscate stack",z)}p||=x.map(z=>({className:"java.lang.Throwable$FakeClass",method:"fakeMethod",file:"Throwable.java",line:z}));return p}}},decorateException:f=>{new K(m,f)}}}function l(r,m){function u(n){return n}function w(n){var q=n.charAt(0);var F=""+(f(q)?q:"_"); for(q=1;q=L;F+=L?Q:"_"}return F}function f(n){return"A"<=n&&"Z">=n||"a"<=n&&"z">=n||"_"===n||"$"===n}function x(n,q,F){null===n?(new Function("value",q+" = value;"))(F):n[q]=F}function p(n){m.exports["teavm.js.throwException"](U in n?n[U]:m.exports["teavm.js.wrapException"](n))}function z(n){a:{if(n instanceof WebAssembly.Exception){var q=m.exports["teavm.javaException"];var F=m.exports["teavm.getJsException"];if(n.is(q)){n=n.getArg(q,0); q=m.exports["teavm.js.extractException"](n);if(null!==q){F=q;break a}F=F(n);"undefined"===typeof F&&(F=new K(m,n));break a}}F=n}throw F;}function E(n){var q=[];for(let F=0;FHa.delete(n)),Ia=new WeakMap,ua=2463534242;r.teavmJso={emptyString:()=>"",stringFromCharCode:n=>String.fromCharCode(n),concatStrings:(n,q)=>n+q,stringLength:n=>n.length,charAt:(n,q)=>n.charCodeAt(q),emptyArray:()=> [],appendToArray:(n,q)=>n.push(q),unwrapBoolean:n=>n?1:0,wrapBoolean:n=>!!n,getProperty:function(n,q){try{return null!==n?n[q]:a(q)}catch(F){p(F)}},setProperty:x,setPropertyPure:x,global:n=>{try{return a(n)}catch(q){p(q)}},createClass:(n,q,F)=>{n=w(n||"JavaObject");let L;L=null===q?function(aa){this[ma]=aa;this[Z]=null}:function(aa){q.call(this,aa)};let Q=H(n,function(aa,pa){if(aa===Ga)L.call(this,pa);else{if(null===F)throw Error("This class can't be instantiated directly");try{return F.apply(null, arguments)}catch(Ra){z(Ra)}}});Q.prototype=Object.create(q||Object.prototype);Q.prototype.constructor=Q;n=H(n,function(aa){return Q.call(this,Ga,aa)});n[Ga]=Q;n.prototype=Q.prototype;return n},exportClass:n=>n[Ga],defineMethod:(n,q,F)=>{let L=[];for(let Q=1;Q{n[q]=E(F)},defineFunction:E,defineProperty:(n,q,F,L)=>{let Q={get(){try{return F(this)}catch(aa){z(aa)}}};null!==L&&(Q.set=function(aa){try{L(this,aa)}catch(pa){z(pa)}});Object.defineProperty(n.prototype,q,Q)},defineStaticProperty:(n,q,F,L)=>{let Q={get(){try{return F()}catch(aa){z(aa)}}};null!==L&&(Q.set=function(aa){try{L(aa)}catch(pa){z(pa)}});Object.defineProperty(n,q,Q)},javaObjectToJS:(n,q)=>{if(null===n)return null;var F=Aa.get(n);if("undefined"!=typeof F&& (F=F.deref(),"undefined"!==typeof F))return F;q=new q(n);Aa.set(n,new WeakRef(q));return q},unwrapJavaObject:n=>n[ma],asFunction:(n,q)=>{let F=n[Z];null===F&&(F=Object.create(null),n[Z]=F);let L=F[q];"function"!==typeof L&&(L=function(){return n[q].apply(n,arguments)},L[X]=n,F[q]=L);return L},functionAsObject:(n,q)=>{let F=n[X];if("undefined"!==typeof F){let L=F[Z];if(void 0!==L&&L[q]===n)return F}return{[q]:function(...L){try{return n(...L)}catch(Q){z(Q)}}}},wrapObject:n=>{if(null===n)return null; if("object"===typeof n||"function"===typeof n){var q=n[ma];if("object"===typeof q)return q;q=Ba.get(n);if(void 0!==q&&(q=q.deref(),void 0!==q))return q;q=m.exports["teavm.jso.createWrapper"](n);Ba.set(n,new WeakRef(q));return q}q=Ha.get(n);if(void 0!==q&&(q=q.deref(),void 0!==q))return q;q=m.exports["teavm.jso.createWrapper"](n);Ha.set(n,new WeakRef(q));ta.register(q,n);return q},isPrimitive:(n,q)=>typeof n===q,instanceOf:(n,q)=>n instanceof q,instanceOfOrNull:(n,q)=>null===n||n instanceof q,sameRef:(n, q)=>n===q,hashCode:n=>{if("object"===typeof n||"function"===typeof n||"symbol"===typeof n){var q=Ia.get(n);if("number"===typeof q)return q;q=ua;q^=q<<13;q^=q>>>17;ua=q^=q<<5;Ia.set(n,q);return q}return"number"===typeof n?n|0:"bigint"===typeof n?BigInt.asIntN(32,n):"boolean"===typeof n?n?1:0:0},apply:(n,q,F)=>{try{return null===n?a(q)(...F):n[q](...F)}catch(L){p(L)}},concatArray:(n,q)=>n.concat(q),getJavaException:n=>n[U]};for(var ka of"wrapByte wrapShort wrapChar wrapInt wrapFloat wrapDouble unwrapByte unwrapShort unwrapChar unwrapInt unwrapFloat unwrapDouble".split(" "))r.teavmJso[ka]= u;ka=[];for(let n=0;32>n;++n){let q=0===ka.length?"":ka.join(", "),F=[...ka,"body"].join(", ");r.teavmJso["createFunction"+n]=(new Function("wrapCallFromJavaToJs",...ka,"body",`return new Function('wrapCallFromJavaToJs', ${F}).bind(this, wrapCallFromJavaToJs);`)).bind(null,O);r.teavmJso["bindFunction"+n]=(L,...Q)=>L.bind(null,...Q);r.teavmJso["callFunction"+n]=(new Function("rethrowJsAsJava","fn",...ka,"try {\n"+` return fn(${q});\n`+"} catch (e) {\n rethrowJsAsJava(e);\n}")).bind(null,p);r.teavmJso["callMethod"+ n]=(new Function("rethrowJsAsJava","getGlobalName","instance","method",...ka,"try {\n return instance !== null\n"+` ? instance[method](${q})\n`+` : getGlobalName(method)(${q});\n`+"} catch (e) {\n rethrowJsAsJava(e);\n}")).bind(null,p,a);r.teavmJso["construct"+n]=(new Function("rethrowJsAsJava","constructor",...ka,"try {\n"+` return new constructor(${q});\n`+"} catch (e) {\n rethrowJsAsJava(e);\n}")).bind(null,p);r.teavmJso["arrayOf"+n]=new Function(...ka,"return ["+q+"]"); ka.push("p"+(n+1))}}async function t(r){try{const m={},u=b(m),w=r.path instanceof WebAssembly.Module?r.path:await WebAssembly.compileStreaming(fetch(r.path)),f=new WebAssembly.Instance(w,m);u.O(f.exports);return{module:w,instance:f}}catch(m){return console.warn("Could not load deobfuscator",m),null}}function D(r,m,u){let w=null,f=!1;return x=>{if(!f){f=!0;if(null!==m)try{w=u.exports.createFromExternalFile.value(m)}catch(p){console.warn("Could not load create deobfuscator",p)}if(null==w&&null!==r)try{w= u.exports.createForModule.value(r)}catch(p){console.warn("Could not create deobfuscator from module data",p)}}return null!==w?w.deobfuscate(x):[]}}async function y(r,m){if(!m.enabled||"auto"!==r&&"external"!==r)return null;if(m.J instanceof ArrayBuffer)return new Int8Array(m.J);r=await fetch(m.J);return r.ok?new Int8Array(await r.arrayBuffer()):null}function B(r){const m=new qa;r.teavm.pollAsyncCallbacks=function(){for(var u;u=m.j();)u.fn()};return function(u){m.push({fn:u,_next:null})}}let v=new Map, S=/.+:wasm-function\[[0-9]+]:0x([0-9a-f]+).*/,U=Symbol("javaException");class K extends Error{constructor(r,m){super();this.j=r;this[U]=m;r.exports["teavm.setJsException"](m,this)}get message(){var r=this.j.exports["teavm.exceptionMessage"];return"function"===typeof r&&(r=r(this[U]),null!=r)?r:"(could not fetch message)"}}Uc={load:async function(r,m){m||={};var u=m.B||{};let [w,f,x]=await Promise.all([u.enabled?t(u):Promise.resolve(null),r instanceof WebAssembly.Module?Promise.resolve(r):WebAssembly.compileStreaming(fetch(r)), y(u.T,u)]);u={};r=b(u);"undefined"!==typeof m.M&&m.M(u);r.X(B(u));m=await WebAssembly.instantiate(f,u);u={};r.O(m.exports);if(w){let p=D(null,x,w.instance);null!==p&&(r.Y(p),u.deobfuscator=p)}r={exports:u,instance:m,N:{P:f,S:w?w.module:null}};for(let p in m.exports){let z=m.exports[p];z instanceof WebAssembly.Global?Object.defineProperty(u,p,{get:()=>z.value}):"function"===typeof z&&(u[p]=z)}u.memory=m.exports["teavm.memory"];u.R=x;return r},Z:b,aa:function(r){return new Proxy(r,{get(m,u){return new WebAssembly.Global({value:"externref", mutable:!1},m[u])}})}}})();async function Vc(){try{N=self.__eaglercraftXLoaderContext.getEaglercraftXOpts();Ua=self.__eaglercraftXLoaderContext.getEagRuntimeJSURL();const a=self.__eaglercraftXLoaderContext.getClassesWASMURL(),b=self.__eaglercraftXLoaderContext.getClassesDeobfWASMURL(),d=self.__eaglercraftXLoaderContext.getClassesTEADBGURL();Pa=self.__eaglercraftXLoaderContext.getEPKFiles();Va=self.__eaglercraftXLoaderContext.getRootElement();self.__eaglercraftXLoaderContext.getImageURL(0);Qa=self.__eaglercraftXLoaderContext.getImageURL(1); Sa=self.__eaglercraftXLoaderContext.getImageURL(2);Ta=self.__eaglercraftXLoaderContext.getImageURL(3);const c=self.__eaglercraftXLoaderContext.getMainArgs();if("_worker_process_"!==c[0]){if(!await Hb())return}else da="worker",await Vb();e("Loading EaglercraftX WASM GC binary...");const h=await Uc.load(a,{B:{enabled:!0,path:b,T:"external",J:d},M:function(l){l.WASMGCBufferAllocator=ra;l.platformApplication=G;l.platformAssets=wa;l.platformAudio=xa;l.platformFilesystem=ya;l.platformInput=I;l.platformNetworking= za;l.platformOpenGL=J;l.platformRuntime=Ca;l.platformScreenRecord=Da;l.platformVoiceClient=Ea;l.platformWebRTC=M;l.platformWebView=Fa;l.clientPlatformSingleplayer=Ja;l.serverPlatformSingleplayer=Ka;l.teavm.notifyHeapResized=function(){Xb(h.exports.memory)}}});La=h.N.P;Ma=h.N.S;Na=h.exports.R;Xb(h.exports.memory);Oa=h.exports.deobfuscator;e("Calling entry point with args: {}",JSON.stringify(c));try{await WebAssembly.promising(h.exports.main.__impl)(c)}catch(l){h.exports.main.__rethrow(l)}finally{ha("Main function has returned!")}}catch(a){$b(a)}} "object"===typeof self.__eaglercraftXLoaderContext?self.__eaglercraftXLoaderContext.runMain(Vc):console.error("???");}).call(this);