diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 0000000..6c256fc --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +x64.halb.it diff --git a/docs/about.md b/docs/about.md deleted file mode 100644 index c4ceba0..0000000 --- a/docs/about.md +++ /dev/null @@ -1,9 +0,0 @@ -# about - -This project is still under heavy development, you’re welcome to contribute or give feedback on [Github]( https://github.com/robalb/x86-64-playground) - -This is a browser-based x86-64 assembly playground, powered by a WebAssembly port of the [blink](https://github.com/jart/blink/) emulator.
-Everything runs entirely client-side in your browser, there is no backend server. The whole runtime is just ~200Kb. -The assemblers provided by the webapp are the latest versions of `gnu as` and `Fasm`, emulated in blink. - -Upcoming features will include links for code sharing, breakpoints, and stack frames highlighting. diff --git a/docs/apple-touch-icon.png b/docs/apple-touch-icon.png new file mode 100644 index 0000000..12bb480 Binary files /dev/null and b/docs/apple-touch-icon.png differ diff --git a/docs/assets/blinkenlib-BXzj4hbY.wasm b/docs/assets/blinkenlib-BXzj4hbY.wasm new file mode 100644 index 0000000..1b5a7ef Binary files /dev/null and b/docs/assets/blinkenlib-BXzj4hbY.wasm differ diff --git a/docs/assets/fasm.1.73.32-Cxcbx2ne.elf b/docs/assets/fasm.1.73.32-Cxcbx2ne.elf new file mode 100644 index 0000000..a4e7ebe Binary files /dev/null and b/docs/assets/fasm.1.73.32-Cxcbx2ne.elf differ diff --git a/docs/assets/gnu-as.2.43.50-B1tG8GyF.elf b/docs/assets/gnu-as.2.43.50-B1tG8GyF.elf new file mode 100644 index 0000000..a93db5f Binary files /dev/null and b/docs/assets/gnu-as.2.43.50-B1tG8GyF.elf differ diff --git a/docs/assets/gnu-ld.2.43.50-SsngYt5K.elf b/docs/assets/gnu-ld.2.43.50-SsngYt5K.elf new file mode 100644 index 0000000..56d3879 Binary files /dev/null and b/docs/assets/gnu-ld.2.43.50-SsngYt5K.elf differ diff --git a/docs/assets/index-CC88yzUR.js b/docs/assets/index-CC88yzUR.js new file mode 100644 index 0000000..7eeb53b --- /dev/null +++ b/docs/assets/index-CC88yzUR.js @@ -0,0 +1,195 @@ +var vf=Object.defineProperty;var Cs=t=>{throw TypeError(t)};var bf=(t,e,n)=>e in t?vf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ji=(t,e,n)=>bf(t,typeof e!="symbol"?e+"":e,n),Qi=(t,e,n)=>e.has(t)||Cs("Cannot "+n);var $t=(t,e,n)=>(Qi(t,e,"read from private field"),n?n.call(t):e.get(t)),Fn=(t,e,n)=>e.has(t)?Cs("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),qt=(t,e,n,r)=>(Qi(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),De=(t,e,n)=>(Qi(t,e,"access private method"),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function Ee(){}function Te(t,e){for(const n in e)t[n]=e[n];return t}function Ya(t){return t()}function Os(){return Object.create(null)}function Pt(t){t.forEach(Ya)}function Vr(t){return typeof t=="function"}function ct(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function yf(t){return Object.keys(t).length===0}function Uo(t,...e){if(t==null){for(const r of e)r(void 0);return Ee}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function we(t){let e;return Uo(t,n=>e=n)(),e}function Ne(t,e,n){t.$$.on_destroy.push(Uo(e,n))}function Bo(t,e,n,r){if(t){const o=Xa(t,e,n,r);return t[0](o)}}function Xa(t,e,n,r){return t[1]&&r?Te(n.ctx.slice(),t[1](r(e))):n.ctx}function Go(t,e,n,r){if(t[2]&&r){const o=t[2](r(n));if(e.dirty===void 0)return o;if(typeof o=="object"){const s=[],a=Math.max(e.dirty.length,o.length);for(let c=0;c32){const e=[],n=t.ctx.length/32;for(let r=0;rt.removeEventListener(e,n,r)}function j(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}const wf=["width","height"];function Le(t,e){const n=Object.getOwnPropertyDescriptors(t.__proto__);for(const r in e)e[r]==null?t.removeAttribute(r):r==="style"?t.style.cssText=e[r]:r==="__value"?t.value=t[r]=e[r]:n[r]&&n[r].set&&wf.indexOf(r)===-1?t[r]=e[r]:j(t,r,e[r])}function jt(t,e){for(const n in e)j(t,n,e[n])}function Ef(t){return Array.from(t.childNodes)}function En(t,e){e=""+e,t.data!==e&&(t.data=e)}function Sf(t,e){t.value=e??""}function Ms(t,e,n){for(let r=0;rt.indexOf(r)===-1?e.push(r):n.push(r)),n.forEach(r=>r()),mr=e}const yi=new Set;let Dn;function yr(){Dn={r:0,c:[],p:Dn}}function _r(){Dn.r||Pt(Dn.c),Dn=Dn.p}function ge(t,e){t&&t.i&&(yi.delete(t),t.i(e))}function be(t,e,n,r){if(t&&t.o){if(yi.has(t))return;yi.add(t),Dn.c.push(()=>{yi.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}else r&&r()}function Ut(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function lt(t,e){const n={},r={},o={$$scope:1};let s=t.length;for(;s--;){const a=t[s],c=e[s];if(c){for(const f in a)f in c||(r[f]=1);for(const f in c)o[f]||(n[f]=c[f],o[f]=1);t[s]=c}else for(const f in a)o[f]=1}for(const a in r)a in n||(n[a]=void 0);return n}function je(t){t&&t.c()}function ze(t,e,n){const{fragment:r,after_update:o}=t.$$;r&&r.m(e,n),jr(()=>{const s=t.$$.on_mount.map(Ya).filter(Vr);t.$$.on_destroy?t.$$.on_destroy.push(...s):Pt(s),t.$$.on_mount=[]}),o.forEach(jr)}function Ue(t,e){const n=t.$$;n.fragment!==null&&(Ff(n.after_update),Pt(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Rf(t,e){t.$$.dirty[0]===-1&&(or.push(t),Qa(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const k=y.length?y[0]:w;return h.ctx&&o(h.ctx[g],h.ctx[g]=k)&&(!h.skip_bound&&h.bound[g]&&h.bound[g](k),d&&Rf(t,g)),w}):[],h.update(),d=!0,Pt(h.before_update),h.fragment=r?r(h.ctx):!1,e.target){if(e.hydrate){const g=Ef(e.target);h.fragment&&h.fragment.l(g),g.forEach(J)}else h.fragment&&h.fragment.c();e.intro&&ge(t.$$.fragment),ze(t,e.target,e.anchor),el()}Lr(f)}class gt{constructor(){Ji(this,"$$");Ji(this,"$$set")}$destroy(){Ue(this,1),this.$destroy=Ee}$on(e,n){if(!Vr(n))return Ee;const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{const o=r.indexOf(n);o!==-1&&r.splice(o,1)}}$set(e){this.$$set&&!yf(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const If="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(If);function tl(t){try{Za(t)}catch{return t()}}const tr=[];function Ln(t,e){return{subscribe:$e(t,e).subscribe}}function $e(t,e=Ee){let n;const r=new Set;function o(c){if(ct(t,c)&&(t=c,n)){const f=!tr.length;for(const h of r)h[1](),tr.push(h,t);if(f){for(let h=0;h{r.delete(h),r.size===0&&n&&(n(),n=null)}}return{set:o,update:s,subscribe:a}}function Ct(t,e,n){const r=!Array.isArray(t),o=r?[t]:t;if(!o.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return Ln(n,(a,c)=>{let f=!1;const h=[];let d=0,g=Ee;const w=()=>{if(d)return;g();const k=e(r?h[0]:h,a,c);s?a(k):g=Vr(k)?k:Ee},y=o.map((k,v)=>Uo(k,b=>{h[v]=b,d&=~(1<{d|=1<{n.push(c)},o=()=>{n.forEach(c=>c()),n=[]},s=Ct(t,c=>(o(),e(c,r)));return tl(o),{...s,subscribe:(...c)=>{const f=s.subscribe(...c);return()=>{f(),o()}}}}function to(t,e){if(!qr)return()=>{};const n=Cf(t,(r,o)=>({stores:r,onUnsubscribe:o})).subscribe(({stores:r,onUnsubscribe:o})=>{const s=e(r);s&&o(s)});return tl(n),n}function Of(t){const e={};return Object.keys(t).forEach(n=>{const r=n,o=t[r];e[r]=$e(o)}),e}function Mf(t){return function(e,n){if(n===void 0)return;const r=t[e];r&&r.set(n)}}function Wo(t){return Object.keys(t).reduce((e,n)=>t[n]===void 0?e:e+`${n}:${t[n]};`,"")}let go=null,Nn=null;function nl(t){switch(t){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function Df(){Nn!==null&&(document.head.removeChild(Nn),go=null,Nn=null)}function no(t){if(go===t)return;go=t;const e=nl(t);Nn===null&&(Nn=document.createElement("style"),document.head.appendChild(Nn)),Nn.innerHTML=`*{cursor: ${e}!important;}`}function Lf({defaultSize:t,dragState:e,layout:n,paneData:r,paneIndex:o,precision:s=3}){const a=n[o];let c;return a==null?c=t??"1":r.length===1?c="1":c=a.toPrecision(s),Wo({"flex-basis":0,"flex-grow":c,"flex-shrink":1,overflow:"hidden","pointer-events":e!==null?"none":void 0})}function Nf({layout:t,panesArray:e,pivotIndices:n}){let r=0,o=100,s=0,a=0;const c=n[0];for(let g=0;g{let e="",n=t;for(;n--;)e+=zf[Math.random()*64|0];return e};function Ko(t=null){return t??Uf(10)}const Bf=100,Vo=10;function Ls(t){try{if(typeof localStorage>"u")throw new Error("localStorage is not supported in this environment");t.getItem=e=>localStorage.getItem(e),t.setItem=(e,n)=>localStorage.setItem(e,n)}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function rl(t){return`paneforge:${t}`}function il(t){return t.map(n=>{const{constraints:r,id:o,idIsFromProps:s,order:a}=n;return s?o:a?`${a}:${JSON.stringify(r)}`:JSON.stringify(r)}).sort().join(",")}function ol(t,e){try{const n=rl(t),r=e.getItem(n),o=JSON.parse(r||"");if(typeof o=="object"&&o!==null)return o}catch{}return null}function Gf(t,e,n){const r=ol(t,n)||{},o=il(e);return r[o]||null}function jf(t,e,n,r,o){const s=rl(t),a=il(e),c=ol(t,o)||{};c[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(s,JSON.stringify(c))}catch(f){console.error(f)}}const Ns={};function Hf(t,e=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...o)},e)}}function Wf({autoSaveId:t,layout:e,storage:n,paneDataArrayStore:r,paneSizeBeforeCollapseStore:o}){const s=we(r);if(e.length===0||e.length!==s.length)return;let a=Ns[t];a==null&&(a=Hf(jf,Bf),Ns[t]=a);const c=[...s],f=we(o),h=new Map(f);a(t,c,h,e,n)}function sl(t){const e={};for(const n in t){const r=t[n];r!==void 0&&(e[n]=r)}return e}function Kf(...t){return(...e)=>{for(const n of t)typeof n=="function"&&n(...e)}}function Cn(t,e,n,r){const o=Array.isArray(e)?e:[e];return o.forEach(s=>t.addEventListener(s,n,r)),()=>{o.forEach(s=>t.removeEventListener(s,n,r))}}function Dt(t,e,n=Vo){return Hr(t,e,n)===0}function Hr(t,e,n=Vo){const r=zs(t,n),o=zs(e,n);return Math.sign(r-o)}function xr(t,e){if(t.length!==e.length)return!1;for(let n=0;n0&&(t=t<0?0-b:b)}}}{const d=t<0?a:c,g=n[d];ot(g);const{collapsible:w}=g;if(w){const y=e[d];ot(y!=null);const k=n[d];ot(k);const{collapsedSize:v=0,minSize:b=0}=k;if(Dt(y,b)){const E=y-v;Hr(E,Math.abs(t))>0&&(t=t<0?0-E:E)}}}}{const d=t<0?1:-1;let g=t<0?c:a,w=0;for(;;){const k=e[g];ot(k!=null);const b=ur({paneConstraints:n,paneIndex:g,initialSize:100})-k;if(w+=b,g+=d,g<0||g>=n.length)break}const y=Math.min(Math.abs(t),Math.abs(w));t=t<0?0-y:y}{let g=t<0?a:c;for(;g>=0&&g=0))break;t<0?g--:g++}}if(Dt(f,0))return e;{const d=t<0?c:a,g=e[d];ot(g!=null);const w=g+f,y=ur({paneConstraints:n,paneIndex:d,initialSize:w});if(s[d]=y,!Dt(y,w)){let k=w-y,b=t<0?c:a;for(;b>=0&&b0?b--:b++}}}const h=s.reduce((d,g)=>g+d,0);return Dt(h,100)?s:e}const qr=typeof document<"u";function $f(t){return t instanceof HTMLElement}function al(t){return t.type==="keydown"}function ll(t){return t.type.startsWith("mouse")}function cl(t){return t.type.startsWith("touch")}const fr={getItem:t=>(Ls(fr),fr.getItem(t)),setItem:(t,e)=>{Ls(fr),fr.setItem(t,e)}},qf={id:null,onLayout:null,keyboardResizeBy:null,autoSaveId:null,direction:"horizontal",storage:fr};function Yf(t){const e={...qf,...sl(t)},n=Of(e),{autoSaveId:r,direction:o,keyboardResizeBy:s,storage:a,onLayout:c}=n,f=$e(Ko()),h=$e(null),d=$e([]),g=$e([]),w=$e(!1),y=$e({}),k=$e(new Map),v=$e(0);to([f,d,g],([V,I,H])=>Xf({groupId:V,layout:I,paneDataArray:H})),br(()=>U()),to([r,d,a],([V,I,H])=>{V&&Wf({autoSaveId:V,layout:I,storage:H,paneDataArrayStore:g,paneSizeBeforeCollapseStore:k})});function b(V){const I=we(d),H=we(g);if(!V.constraints.collapsible)return;const B=H.map(Ae=>Ae.constraints),{collapsedSize:ne=0,paneSize:re,pivotIndices:fe}=nr(H,V,I);if(ot(re!=null),re===ne)return;k.update(Ae=>(Ae.set(V.id,re),Ae));const Oe=sr(H,V)===H.length-1?re-ne:ne-re,He=Ar({delta:Oe,layout:I,paneConstraints:B,pivotIndices:fe,trigger:"imperative-api"});if(xr(I,He))return;d.set(He);const qe=we(c);qe&&qe(He),Pr(H,He,we(y))}function E(V){const I=we(d),H=we(g),{paneSize:B}=nr(H,V,I);return B}const x=Ct([g,d,h],([V,I,H])=>(B,ne)=>{const re=sr(V,B);return Lf({defaultSize:ne,dragState:H,layout:I,paneData:V,paneIndex:re})});function S(V){const I=we(g),H=we(d),{collapsedSize:B=0,collapsible:ne,paneSize:re}=nr(I,V,H);return!ne||re>B}function R(V){g.update(I=>{const H=[...I,V];return H.sort((B,ne)=>{const re=B.order,fe=ne.order;return re==null&&fe==null?0:re==null?-1:fe==null?1:re-fe}),H}),w.set(!0)}to([w],([V])=>{if(!V)return;w.set(!1);const I=we(r),H=we(a),B=we(d),ne=we(g);let re=null;if(I){const Oe=Gf(I,ne,H);Oe&&(k.set(new Map(Object.entries(Oe.expandToSizes))),re=Oe.layout)}re==null&&(re=Qf({paneDataArray:ne}));const fe=ed({layout:re,paneConstraints:ne.map(Oe=>Oe.constraints)});if(xr(B,fe))return;d.set(fe);const ye=we(c);ye&&ye(fe),Pr(ne,fe,we(y))});function M(V){return function(H){H.preventDefault();const B=we(o),ne=we(h),re=we(f),fe=we(s),ye=we(d),Oe=we(g),{initialLayout:He}=ne??{},qe=Bs(re,V);let Ae=td(H,V,B,ne,fe);if(Ae===0)return;const Ze=B==="horizontal";document.dir==="rtl"&&Ze&&(Ae=-Ae);const at=Oe.map(Et=>Et.constraints),Je=Ar({delta:Ae,layout:He??ye,paneConstraints:at,pivotIndices:qe,trigger:al(H)?"keyboard":"mouse-or-touch"}),wt=!xr(ye,Je);if((ll(H)||cl(H))&&we(v)!=Ae&&(v.set(Ae),no(wt?Ze?"horizontal":"vertical":Ze?Ae<0?"horizontal-min":"horizontal-max":Ae<0?"vertical-min":"vertical-max")),wt){d.set(Je);const Et=we(c);Et&&Et(Je),Pr(Oe,Je,we(y))}}}function G(V,I){const H=we(d),B=we(g),ne=B.map(Ae=>Ae.constraints),{paneSize:re,pivotIndices:fe}=nr(B,V,H);ot(re!=null);const Oe=sr(B,V)===B.length-1?re-I:I-re,He=Ar({delta:Oe,layout:H,paneConstraints:ne,pivotIndices:fe,trigger:"imperative-api"});if(xr(H,He))return;d.set(He);const qe=we(c);qe==null||qe(He),Pr(B,He,we(y))}function N(V,I){const H=we(o),B=we(d),ne=$o(V);ot(ne);const re=fl(H,I);h.set({dragHandleId:V,dragHandleRect:ne.getBoundingClientRect(),initialCursorPosition:re,initialLayout:B})}function A(){Df(),h.set(null)}function z(V){const I=we(g),H=sr(I,V);H<0||g.update(B=>(B.splice(H,1),y.update(ne=>(delete ne[V.id],ne)),w.set(!0),B))}function q(V){const I=we(g),H=we(d),{collapsedSize:B=0,collapsible:ne,paneSize:re}=nr(I,V,H);return ne===!0&&re===B}function L(V){const I=we(d),H=we(g);if(!V.constraints.collapsible)return;const B=H.map(Je=>Je.constraints),{collapsedSize:ne=0,paneSize:re,minSize:fe=0,pivotIndices:ye}=nr(H,V,I);if(re!==ne)return;const Oe=we(k).get(V.id),He=Oe!=null&&Oe>=fe?Oe:fe,Ae=sr(H,V)===H.length-1?re-He:He-re,Ze=Ar({delta:Ae,layout:I,paneConstraints:B,pivotIndices:ye,trigger:"imperative-api"});if(xr(I,Ze))return;d.set(Ze);const at=we(c);at==null||at(Ze),Pr(H,Ze,we(y))}const O=Ct([o],([V])=>Wo({display:"flex","flex-direction":V==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"})),P=Ct([o,f],([V,I])=>({"data-pane-group":"","data-direction":V,"data-pane-group-id":I})),D=Ct([O,P],([V,I])=>({style:V,...I}));function U(){const V=we(f),H=Yr(V).map(B=>{const ne=B.getAttribute("data-pane-resizer-id");if(!ne)return Us;const[re,fe]=Jf(V,ne,we(g));if(re==null||fe==null)return Us;const Oe=Cn(B,"keydown",He=>{if(He.defaultPrevented||He.key!=="Enter")return;He.preventDefault();const qe=we(g),Ae=qe.findIndex(on=>on.id===re);if(Ae<0)return;const Ze=qe[Ae];ot(Ze);const at=we(d),Je=at[Ae],{collapsedSize:wt=0,collapsible:Et,minSize:Qt=0}=Ze.constraints;if(!(Je!=null&&Et))return;const rt=Ar({delta:Dt(Je,wt)?Qt-Je:wt-Je,layout:at,paneConstraints:qe.map(on=>on.constraints),pivotIndices:Bs(V,ne),trigger:"keyboard"});at!==rt&&d.set(rt)});return()=>{Oe()}});return()=>{H.forEach(B=>B())}}function Z(V){d.set(V)}function Y(){return we(d)}return{methods:{collapsePane:b,expandPane:L,getSize:E,getPaneStyle:x,isCollapsed:q,isExpanded:S,registerPane:R,registerResizeHandle:M,resizePane:G,startDragging:N,stopDragging:A,unregisterPane:z,setLayout:Z,getLayout:Y},states:{direction:o,dragState:h,groupId:f,paneGroupAttrs:D,paneGroupSelectors:P,paneGroupStyle:O,layout:d},options:n}}function Xf({groupId:t,layout:e,paneDataArray:n}){const r=Yr(t);for(let o=0;o{r.forEach(o=>{o.removeAttribute("aria-controls"),o.removeAttribute("aria-valuemax"),o.removeAttribute("aria-valuemin"),o.removeAttribute("aria-valuenow")})}}function Yr(t){return qr?Array.from(document.querySelectorAll(`[data-pane-resizer-id][data-pane-group-id="${t}"]`)):[]}function Zf(t){if(!qr)return null;const e=document.querySelector(`[data-pane-group][data-pane-group-id="${t}"]`);return e||null}function Us(){}function Jf(t,e,n){var f,h;const r=$o(e),o=Yr(t),s=r?o.indexOf(r):-1,a=((f=n[s])==null?void 0:f.id)??null,c=((h=n[s+1])==null?void 0:h.id)??null;return[a,c]}function $o(t){if(!qr)return null;const e=document.querySelector(`[data-pane-resizer-id="${t}"]`);return e||null}function ul(t,e){return qr?Yr(t).findIndex(o=>o.getAttribute("data-pane-resizer-id")===e)??null:null}function Bs(t,e){const n=ul(t,e);return n!=null?[n,n+1]:[-1,-1]}function nr(t,e,n){const r=t.map(h=>h.constraints),o=sr(t,e),s=r[o],c=o===t.length-1?[o-1,o]:[o,o+1],f=n[o];return{...s,paneSize:f,pivotIndices:c}}function sr(t,e){return t.findIndex(n=>n.id===e.id)}function Pr(t,e,n){e.forEach((r,o)=>{const s=t[o];ot(s);const{callbacks:a,constraints:c,id:f}=s,{collapsedSize:h=0,collapsible:d}=c,g=n[f];if(!(g==null||r!==g))return;n[f]=r;const{onCollapse:w,onExpand:y,onResize:k}=a;k==null||k(r,g),d&&(w||y)&&(y&&(g==null||g===h)&&r!==h&&y(),w&&(g==null||g!==h)&&r===h&&w())})}function Qf({paneDataArray:t}){const e=Array(t.length),n=t.map(s=>s.constraints);let r=0,o=100;for(let s=0;ss+a,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} pane layout: ${n.map(s=>`${s}%`).join(", ")}`);if(!Dt(r,100))for(let s=0;s container`);return xf(vo)}function id(t){let e,n;const r=t[18].default,o=Bo(r,t,t[17],null);let s=[{id:t[2]},t[3],{style:t[1]},t[7]],a={};for(let c=0;cn(16,a=L)),Ne(t,M,L=>n(3,f=L)),Ne(t,G,L=>n(2,c=L)),x={getLayout:A,setLayout:N,getId:()=>c};function q(L){fn[L?"unshift":"push"](()=>{E=L,n(0,E)})}return t.$$set=L=>{e=Te(Te({},e),At(L)),n(7,s=hr(e,o)),"autoSaveId"in L&&n(9,g=L.autoSaveId),"direction"in L&&n(10,w=L.direction),"id"in L&&n(11,y=L.id),"keyboardResizeBy"in L&&n(12,k=L.keyboardResizeBy),"onLayoutChange"in L&&n(13,v=L.onLayoutChange),"storage"in L&&n(14,b=L.storage),"el"in L&&n(0,E=L.el),"paneGroup"in L&&n(8,x=L.paneGroup),"style"in L&&n(15,S=L.style),"$$scope"in L&&n(17,d=L.$$scope)},t.$$.update=()=>{t.$$.dirty&512&&z("autoSaveId",g),t.$$.dirty&1024&&z("direction",w),t.$$.dirty&2048&&z("id",y),t.$$.dirty&4096&&z("keyboardResizeBy",k),t.$$.dirty&8192&&z("onLayout",v),t.$$.dirty&16384&&z("storage",b),t.$$.dirty&98304&&n(1,r=a+(S??""))},[E,r,c,f,R,M,G,s,x,g,w,y,k,v,b,S,a,d,h,q]}class ml extends gt{constructor(e){super(),ht(this,e,od,id,ct,{autoSaveId:9,direction:10,id:11,keyboardResizeBy:12,onLayoutChange:13,storage:14,el:0,paneGroup:8,style:15})}}function sd(t){let e,n;const r=t[22].default,o=Bo(r,t,t[21],null);let s=[{style:t[2]},t[1],t[5]],a={};for(let c=0;cn(20,f=B)),Ne(t,Y,B=>n(19,c=B));const V=Ko(G);let I;M={collapse:()=>{L(I)},expand:()=>O(I),getSize:()=>P(I),isCollapsed:()=>D(I),isExpanded:()=>U(I),resize:B=>Z(I,B),getId:()=>V},br(()=>(z(I),()=>{q(I)}));function H(B){fn[B?"unshift":"push"](()=>{R=B,n(0,R)})}return t.$$set=B=>{e=Te(Te({},e),At(B)),n(5,a=hr(e,s)),"collapsedSize"in B&&n(7,g=B.collapsedSize),"collapsible"in B&&n(8,w=B.collapsible),"defaultSize"in B&&n(9,y=B.defaultSize),"maxSize"in B&&n(10,k=B.maxSize),"minSize"in B&&n(11,v=B.minSize),"onCollapse"in B&&n(12,b=B.onCollapse),"onExpand"in B&&n(13,E=B.onExpand),"onResize"in B&&n(14,x=B.onResize),"order"in B&&n(15,S=B.order),"el"in B&&n(0,R=B.el),"pane"in B&&n(6,M=B.pane),"id"in B&&n(16,G=B.id),"style"in B&&n(17,N=B.style),"$$scope"in B&&n(21,d=B.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&130944&&n(18,I={callbacks:{onCollapse:b,onExpand:E,onResize:x},constraints:{collapsedSize:g,collapsible:w,defaultSize:y,maxSize:k,minSize:v},id:V,idIsFromProps:G!==void 0,order:S}),t.$$.dirty[0]&1442304&&n(2,r=f(I,y)+(N??"")),t.$$.dirty[0]&524288&&n(1,o={"data-pane":"","data-pane-id":V,"data-pane-group-id":c})},[R,o,r,A,Y,a,M,g,w,y,k,v,b,E,x,S,G,N,I,c,f,d,h,H]}class dr extends gt{constructor(e){super(),ht(this,e,ad,sd,ct,{collapsedSize:7,collapsible:8,defaultSize:9,maxSize:10,minSize:11,onCollapse:12,onExpand:13,onResize:14,order:15,el:0,pane:6,id:16,style:17},null,[-1,-1])}}function ld(t,e){let n=()=>{};function r(o){n();const{disabled:s,resizeHandler:a,isDragging:c,stopDragging:f,onDragging:h=void 0}=o;if(s||a===null||!c)return;const d=y=>{a(y)},g=y=>{a(y)},w=()=>{t.blur(),f(),h&&h(!1)};n=Kf(Cn(document.body,"contextmenu",w),Cn(document.body,"mousemove",d),Cn(document.body,"touchmove",d,{passive:!1}),Cn(document.body,"mouseleave",g),Cn(window,"mouseup",w),Cn(window,"touchend",w))}return r(e),{update:r,onDestroy(){n()}}}function cd(t){let e,n,r,o,s;const a=t[24].default,c=Bo(a,t,t[23],null);let f=[{role:"separator"},{style:t[8]},{tabindex:t[3]},t[7],t[17]],h={};for(let d=0;dn(21,h=I)),Ne(t,N,I=>n(22,d=I)),Ne(t,A,I=>n(20,f=I));const z=Ko(E);let q=!1,L=null;function O(){const I=b;I&&(I.blur(),M(),k==null||k(!1))}br(()=>{y?n(6,L=null):n(6,L=S(z))});function P(I){if(y||!L||I.defaultPrevented)return;if(["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","End","Home"].includes(I.key)){I.preventDefault(),L(I);return}if(I.key!=="F6")return;I.preventDefault();const B=Yr(f),ne=ul(f,z);if(ne===null)return;const re=I.shiftKey?ne>0?ne-1:B.length-1:ne+1{b=I,n(0,b)})}const U=()=>n(4,q=!1),Z=()=>n(4,q=!0),Y=I=>{I.preventDefault(),R(z,I),k==null||k(!0)},V=I=>{I.preventDefault(),R(z,I),k==null||k(!0)};return t.$$set=I=>{e=Te(Te({},e),At(I)),n(17,c=hr(e,a)),"disabled"in I&&n(1,y=I.disabled),"onDraggingChange"in I&&n(2,k=I.onDraggingChange),"tabIndex"in I&&n(3,v=I.tabIndex),"el"in I&&n(0,b=I.el),"id"in I&&n(18,E=I.id),"style"in I&&n(19,x=I.style),"$$scope"in I&&n(23,w=I.$$scope)},t.$$.update=()=>{t.$$.dirty&4194304&&n(5,r=(d==null?void 0:d.dragHandleId)===z),t.$$.dirty&2&&(y?n(6,L=null):n(6,L=S(z))),t.$$.dirty&2621440&&n(8,o=Wo({cursor:nl(h),"touch-action":"none","user-select":"none","-webkit-user-select":"none","-webkit-touch-callout":"none"})+x),t.$$.dirty&3145778&&n(7,s={"data-direction":h,"data-pane-group-id":f,"data-active":r?"pointer":q?"keyboard":void 0,"data-enabled":!y,"data-pane-resizer-id":z,"data-pane-resizer":""})},[b,y,k,v,q,r,L,s,o,R,M,G,N,A,z,O,P,c,E,x,f,h,d,w,g,D,U,Z,Y,V]}class _i extends gt{constructor(e){super(),ht(this,e,ud,cd,ct,{disabled:1,onDraggingChange:2,tabIndex:3,el:0,id:18,style:19})}}var fd=(()=>{var t=import.meta.url;return function(e={}){var n,r=e,o,s,a=new Promise((i,l)=>{o=i,s=l});["_memory","___indirect_function_table","_blinkenlib_run_fast","_blinkenlib_run","_blinkenlib_starti","_blinkenlib_start","_blinkenlib_stepi","_blinkenlib_continue","_blinkenlib_get_clstruct","_blinkenlib_get_argc_string","_blinkenlib_get_argv_string","_blinkenlib_get_progname_string","_blinkenlib_spy_address","_main","onRuntimeInitialized"].forEach(i=>{Object.getOwnPropertyDescriptor(a,i)||Object.defineProperty(a,i,{get:()=>rt("You are getting "+i+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>rt("You are setting "+i+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})});var c=!1,f=!1,h=!1;if(r.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var d=Object.assign({},r),g=[],w="./this.program",y=(i,l)=>{throw l},k="";function v(i){return r.locateFile?r.locateFile(i,k):k+i}var b,E;{if(typeof document<"u"&&document.currentScript&&(k=document.currentScript.src),t&&(k=t),k.startsWith("blob:")?k="":k=k.substr(0,k.replace(/[?#].*/,"").lastIndexOf("/")+1),!(typeof window=="object"||typeof importScripts=="function"))throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");b=i=>(A(!Jr(i),"readAsync does not work with file:// URLs"),fetch(i,{credentials:"same-origin"}).then(l=>l.ok?l.arrayBuffer():Promise.reject(new Error(l.status+" : "+l.url))))}var x=r.print||console.log.bind(console),S=r.printErr||console.error.bind(console);Object.assign(r,d),d=null,ef(),r.arguments&&(g=r.arguments),Se("arguments","arguments_"),r.thisProgram&&(w=r.thisProgram),Se("thisProgram","thisProgram"),r.quit&&(y=r.quit),Se("quit","quit_"),A(typeof r.memoryInitializerPrefixURL>"u","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),A(typeof r.pthreadMainPrefixURL>"u","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),A(typeof r.cdInitializerPrefixURL>"u","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),A(typeof r.filePackagePrefixURL>"u","Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),A(typeof r.read>"u","Module.read option was removed"),A(typeof r.readAsync>"u","Module.readAsync option was removed (modify readAsync in JS)"),A(typeof r.readBinary>"u","Module.readBinary option was removed (modify readBinary in JS)"),A(typeof r.setWindowTitle>"u","Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"),A(typeof r.TOTAL_MEMORY>"u","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),Se("asm","wasmExports"),Se("readAsync","readAsync"),Se("readBinary","readBinary"),Se("setWindowTitle","setWindowTitle"),A(!c,"worker environment detected but not enabled at build time. Add `worker` to `-sENVIRONMENT` to enable."),A(!f,"node environment detected but not enabled at build time. Add `node` to `-sENVIRONMENT` to enable."),A(!h,"shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable.");var R;r.wasmBinary&&(R=r.wasmBinary),Se("wasmBinary","wasmBinary"),typeof WebAssembly!="object"&&S("no native wasm support detected");var M,G=!1,N;function A(i,l){i||rt("Assertion failed"+(l?": "+l:""))}var z,q,L,O,P;function D(){var i=M.buffer;r.HEAP8=z=new Int8Array(i),r.HEAP16=L=new Int16Array(i),r.HEAPU8=q=new Uint8Array(i),r.HEAPU16=new Uint16Array(i),r.HEAP32=O=new Int32Array(i),r.HEAPU32=P=new Uint32Array(i),r.HEAPF32=new Float32Array(i),r.HEAPF64=new Float64Array(i)}A(!r.STACK_SIZE,"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"),A(typeof Int32Array<"u"&&typeof Float64Array<"u"&&Int32Array.prototype.subarray!=null&&Int32Array.prototype.set!=null,"JS engine does not provide full typed array support"),A(!r.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),A(!r.INITIAL_MEMORY,"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically");function U(){var i=Xi();A((i&3)==0),i==0&&(i+=4),P[i>>2]=34821223,P[i+4>>2]=2310721022,P[0]=1668509029}function Z(){if(!G){var i=Xi();i==0&&(i+=4);var l=P[i>>2],u=P[i+4>>2];(l!=34821223||u!=2310721022)&&rt(`Stack overflow! Stack cookie has been overwritten at ${bt(i)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${bt(u)} ${bt(l)}`),P[0]!=1668509029&&rt("Runtime error: The application has corrupted its heap memory area (address zero)!")}}(function(){var i=new Int16Array(1),l=new Int8Array(i.buffer);if(i[0]=25459,l[0]!==115||l[1]!==99)throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"})();var Y=[],V=[],I=[],H=[],B=!1;function ne(){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)Oe(r.preRun.shift());Ge(Y)}function re(){A(!B),B=!0,Z(),!r.noFSInit&&!p.init.initialized&&p.init(),p.ignorePermissions=!1,ut.root=p.mount(ut,{},null),Ge(V)}function fe(){Z(),Ge(I)}function ye(){if(Z(),r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)qe(r.postRun.shift());Ge(H)}function Oe(i){Y.unshift(i)}function He(i){V.unshift(i)}function qe(i){H.unshift(i)}A(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),A(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),A(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),A(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Ae=0,Ze=null,at=null,Je={};function wt(i){for(var l=i;;){if(!Je[i])return i;i=l+Math.random()}}function Et(i){var l;Ae++,(l=r.monitorRunDependencies)==null||l.call(r,Ae),i?(A(!Je[i]),Je[i]=1,Ze===null&&typeof setInterval<"u"&&(Ze=setInterval(()=>{if(G){clearInterval(Ze),Ze=null;return}var u=!1;for(var m in Je)u||(u=!0,S("still waiting on run dependencies:")),S(`dependency: ${m}`);u&&S("(end of list)")},1e4))):S("warning: run dependency added without ID")}function Qt(i){var u;if(Ae--,(u=r.monitorRunDependencies)==null||u.call(r,Ae),i?(A(Je[i]),delete Je[i]):S("warning: run dependency removed without ID"),Ae==0&&(Ze!==null&&(clearInterval(Ze),Ze=null),at)){var l=at;at=null,l()}}function rt(i){var u;(u=r.onAbort)==null||u.call(r,i),i="Aborted("+i+")",S(i),G=!0,N=1;var l=new WebAssembly.RuntimeError(i);throw s(l),l}var on="data:application/octet-stream;base64,",qn=i=>i.startsWith(on),Jr=i=>i.startsWith("file://");function Ye(i,l){return(...u)=>{A(B,`native function \`${i}\` called before runtime initialization`);var m=Ot[i];return A(m,`exported native function \`${i}\` not found`),A(u.length<=l,`native function \`${i}\` called with ${u.length} args but expects ${l}`),m(...u)}}function Qr(){if(r.locateFile){var i="blinkenlib.wasm";return qn(i)?i:v(i)}return new URL("/assets/blinkenlib-BXzj4hbY.wasm",import.meta.url).href}var $;function oe(i){if(i==$&&R)return new Uint8Array(R);throw"both async and sync fetching of the wasm failed"}function se(i){return R?Promise.resolve().then(()=>oe(i)):b(i).then(l=>new Uint8Array(l),()=>oe(i))}function ue(i,l,u){return se(i).then(m=>WebAssembly.instantiate(m,l)).then(u,m=>{S(`failed to asynchronously prepare wasm: ${m}`),Jr($)&&S(`warning: Loading from a file URI (${$}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`),rt(m)})}function Ie(i,l,u,m){return!i&&typeof WebAssembly.instantiateStreaming=="function"&&!qn(l)&&typeof fetch=="function"?fetch(l,{credentials:"same-origin"}).then(_=>{var T=WebAssembly.instantiateStreaming(_,u);return T.then(m,function(F){return S(`wasm streaming compile failed: ${F}`),S("falling back to ArrayBuffer instantiation"),ue(l,u,m)})}):ue(l,u,m)}function dt(){return{env:ks,wasi_snapshot_preview1:ks}}function Tt(){var i=dt();function l(_,T){return Ot=_.exports,r.wasmExports=Ot,M=Ot.memory,A(M,"memory not found in wasm exports"),D(),Ve=Ot.__indirect_function_table,A(Ve,"table not found in wasm exports"),He(Ot.__wasm_call_ctors),Qt("wasm-instantiate"),Ot}Et("wasm-instantiate");var u=r;function m(_){A(r===u,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),u=null,l(_.instance)}if(r.instantiateWasm)try{return r.instantiateWasm(i,l)}catch(_){S(`Module.instantiateWasm callback failed with error: ${_}`),s(_)}return $||($=Qr()),Ie(R,$,i,m).catch(s),{}}var ee,le;function Se(i,l,u=!0){Object.getOwnPropertyDescriptor(r,i)||Object.defineProperty(r,i,{configurable:!0,get(){let m=u?" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)":"";rt(`\`Module.${i}\` has been replaced by \`${l}\``+m)}})}function Pe(i){Object.getOwnPropertyDescriptor(r,i)&&rt(`\`Module.${i}\` was supplied but \`${i}\` not included in INCOMING_MODULE_JS_API`)}function Be(i){return i==="FS_createPath"||i==="FS_createDataFile"||i==="FS_createPreloadedFile"||i==="FS_unlink"||i==="addRunDependency"||i==="FS_createLazyFile"||i==="FS_createDevice"||i==="removeRunDependency"}function Ht(i,l){typeof globalThis<"u"&&Object.defineProperty(globalThis,i,{configurable:!0,get(){Me(`\`${i}\` is not longer defined by emscripten. ${l}`)}})}Ht("buffer","Please use HEAP8.buffer or wasmMemory.buffer"),Ht("asm","Please use wasmExports instead");function Gi(i){typeof globalThis<"u"&&!Object.getOwnPropertyDescriptor(globalThis,i)&&Object.defineProperty(globalThis,i,{configurable:!0,get(){var l=`\`${i}\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`,u=i;u.startsWith("_")||(u="$"+i),l+=` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${u}')`,Be(i)&&(l+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),Me(l)}}),ei(i)}function ei(i){Object.getOwnPropertyDescriptor(r,i)||Object.defineProperty(r,i,{configurable:!0,get(){var l=`'${i}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;Be(i)&&(l+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),rt(l)}})}function ti(i){this.name="ExitStatus",this.message=`Program terminated with exit(${i})`,this.status=i}var Ge=i=>{for(;i.length>0;)i.shift()(r)},vt=r.noExitRuntime||!0,bt=i=>(A(typeof i=="number"),i>>>=0,"0x"+i.toString(16).padStart(8,"0")),Fe=i=>As(i),ve=()=>Zi(),Me=i=>{Me.shown||(Me.shown={}),Me.shown[i]||(Me.shown[i]=1,S(i))},et=[],Ve,Wt=i=>{var l=et[i];return l||(i>=et.length&&(et.length=i+1),et[i]=l=Ve.get(i)),A(Ve.get(i)==l,"JavaScript-side Wasm function table mirror is out of date!"),l},dn=(i,l)=>Wt(i)(l),We={isAbs:i=>i.charAt(0)==="/",splitPath:i=>{var l=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return l.exec(i).slice(1)},normalizeArray:(i,l)=>{for(var u=0,m=i.length-1;m>=0;m--){var _=i[m];_==="."?i.splice(m,1):_===".."?(i.splice(m,1),u++):u&&(i.splice(m,1),u--)}if(l)for(;u;u--)i.unshift("..");return i},normalize:i=>{var l=We.isAbs(i),u=i.substr(-1)==="/";return i=We.normalizeArray(i.split("/").filter(m=>!!m),!l).join("/"),!i&&!l&&(i="."),i&&u&&(i+="/"),(l?"/":"")+i},dirname:i=>{var l=We.splitPath(i),u=l[0],m=l[1];return!u&&!m?".":(m&&(m=m.substr(0,m.length-1)),u+m)},basename:i=>{if(i==="/")return"/";i=We.normalize(i),i=i.replace(/\/$/,"");var l=i.lastIndexOf("/");return l===-1?i:i.substr(l+1)},join:(...i)=>We.normalize(i.join("/")),join2:(i,l)=>We.normalize(i+"/"+l)},ni=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return i=>crypto.getRandomValues(i);rt("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: (array) => { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")},as=i=>(as=ni())(i),sn={resolve:(...i)=>{for(var l="",u=!1,m=i.length-1;m>=-1&&!u;m--){var _=m>=0?i[m]:p.cwd();if(typeof _!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!_)return"";l=_+"/"+l,u=We.isAbs(_)}return l=We.normalizeArray(l.split("/").filter(T=>!!T),!u).join("/"),(u?"/":"")+l||"."},relative:(i,l)=>{i=sn.resolve(i).substr(1),l=sn.resolve(l).substr(1);function u(te){for(var he=0;he=0&&te[xe]==="";xe--);return he>xe?[]:te.slice(he,xe-he+1)}for(var m=u(i.split("/")),_=u(l.split("/")),T=Math.min(m.length,_.length),F=T,C=0;C{for(var m=l+u,_=l;i[_]&&!(_>=m);)++_;if(_-l>16&&i.buffer&&ls)return ls.decode(i.subarray(l,_));for(var T="";l<_;){var F=i[l++];if(!(F&128)){T+=String.fromCharCode(F);continue}var C=i[l++]&63;if((F&224)==192){T+=String.fromCharCode((F&31)<<6|C);continue}var K=i[l++]&63;if((F&240)==224?F=(F&15)<<12|C<<6|K:((F&248)!=240&&Me("Invalid UTF-8 leading byte "+bt(F)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),F=(F&7)<<18|C<<12|K<<6|i[l++]&63),F<65536)T+=String.fromCharCode(F);else{var te=F-65536;T+=String.fromCharCode(55296|te>>10,56320|te&1023)}}return T},ji=[],mn=i=>{for(var l=0,u=0;u=55296&&m<=57343?(l+=4,++u):l+=3}return l},Hi=(i,l,u,m)=>{if(A(typeof i=="string",`stringToUTF8Array expects a string (got ${typeof i})`),!(m>0))return 0;for(var _=u,T=u+m-1,F=0;F=55296&&C<=57343){var K=i.charCodeAt(++F);C=65536+((C&1023)<<10)|K&1023}if(C<=127){if(u>=T)break;l[u++]=C}else if(C<=2047){if(u+1>=T)break;l[u++]=192|C>>6,l[u++]=128|C&63}else if(C<=65535){if(u+2>=T)break;l[u++]=224|C>>12,l[u++]=128|C>>6&63,l[u++]=128|C&63}else{if(u+3>=T)break;C>1114111&&Me("Invalid Unicode code point "+bt(C)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),l[u++]=240|C>>18,l[u++]=128|C>>12&63,l[u++]=128|C>>6&63,l[u++]=128|C&63}}return l[u]=0,u-_};function cs(i,l,u){var m=mn(i)+1,_=new Array(m),T=Hi(i,_,0,_.length);return _.length=T,_}var wc=()=>{if(!ji.length){var i=null;if(typeof window<"u"&&typeof window.prompt=="function"&&(i=window.prompt("Input: "),i!==null&&(i+=` +`)),!i)return null;ji=cs(i)}return ji.shift()},pn={ttys:[],init(){},shutdown(){},register(i,l){pn.ttys[i]={input:[],output:[],ops:l},p.registerDevice(i,pn.stream_ops)},stream_ops:{open(i){var l=pn.ttys[i.node.rdev];if(!l)throw new p.ErrnoError(43);i.tty=l,i.seekable=!1},close(i){i.tty.ops.fsync(i.tty)},fsync(i){i.tty.ops.fsync(i.tty)},read(i,l,u,m,_){if(!i.tty||!i.tty.ops.get_char)throw new p.ErrnoError(60);for(var T=0,F=0;F0&&(x(Yn(i.output,0)),i.output=[])},ioctl_tcgets(i){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(i,l,u){return 0},ioctl_tiocgwinsz(i){return[24,80]}},default_tty1_ops:{put_char(i,l){l===null||l===10?(S(Yn(i.output,0)),i.output=[]):l!=0&&i.output.push(l)},fsync(i){i.output&&i.output.length>0&&(S(Yn(i.output,0)),i.output=[])}}},Ec=(i,l)=>(q.fill(0,i,i+l),i),Sc=(i,l)=>(A(l,"alignment argument is required"),Math.ceil(i/l)*l),us=i=>{i=Sc(i,65536);var l=of(65536,i);return l?Ec(l,i):0},ke={ops_table:null,mount(i){return ke.createNode(null,"/",16895,0)},createNode(i,l,u,m){if(p.isBlkdev(u)||p.isFIFO(u))throw new p.ErrnoError(63);ke.ops_table||(ke.ops_table={dir:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr,lookup:ke.node_ops.lookup,mknod:ke.node_ops.mknod,rename:ke.node_ops.rename,unlink:ke.node_ops.unlink,rmdir:ke.node_ops.rmdir,readdir:ke.node_ops.readdir,symlink:ke.node_ops.symlink},stream:{llseek:ke.stream_ops.llseek}},file:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr},stream:{llseek:ke.stream_ops.llseek,read:ke.stream_ops.read,write:ke.stream_ops.write,allocate:ke.stream_ops.allocate,mmap:ke.stream_ops.mmap,msync:ke.stream_ops.msync}},link:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr,readlink:ke.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr},stream:p.chrdev_stream_ops}});var _=p.createNode(i,l,u,m);return p.isDir(_.mode)?(_.node_ops=ke.ops_table.dir.node,_.stream_ops=ke.ops_table.dir.stream,_.contents={}):p.isFile(_.mode)?(_.node_ops=ke.ops_table.file.node,_.stream_ops=ke.ops_table.file.stream,_.usedBytes=0,_.contents=null):p.isLink(_.mode)?(_.node_ops=ke.ops_table.link.node,_.stream_ops=ke.ops_table.link.stream):p.isChrdev(_.mode)&&(_.node_ops=ke.ops_table.chrdev.node,_.stream_ops=ke.ops_table.chrdev.stream),_.timestamp=Date.now(),i&&(i.contents[l]=_,i.timestamp=_.timestamp),_},getFileDataAsTypedArray(i){return i.contents?i.contents.subarray?i.contents.subarray(0,i.usedBytes):new Uint8Array(i.contents):new Uint8Array(0)},expandFileStorage(i,l){var u=i.contents?i.contents.length:0;if(!(u>=l)){var m=1024*1024;l=Math.max(l,u*(u>>0),u!=0&&(l=Math.max(l,256));var _=i.contents;i.contents=new Uint8Array(l),i.usedBytes>0&&i.contents.set(_.subarray(0,i.usedBytes),0)}},resizeFileStorage(i,l){if(i.usedBytes!=l)if(l==0)i.contents=null,i.usedBytes=0;else{var u=i.contents;i.contents=new Uint8Array(l),u&&i.contents.set(u.subarray(0,Math.min(l,i.usedBytes))),i.usedBytes=l}},node_ops:{getattr(i){var l={};return l.dev=p.isChrdev(i.mode)?i.id:1,l.ino=i.id,l.mode=i.mode,l.nlink=1,l.uid=0,l.gid=0,l.rdev=i.rdev,p.isDir(i.mode)?l.size=4096:p.isFile(i.mode)?l.size=i.usedBytes:p.isLink(i.mode)?l.size=i.link.length:l.size=0,l.atime=new Date(i.timestamp),l.mtime=new Date(i.timestamp),l.ctime=new Date(i.timestamp),l.blksize=4096,l.blocks=Math.ceil(l.size/l.blksize),l},setattr(i,l){l.mode!==void 0&&(i.mode=l.mode),l.timestamp!==void 0&&(i.timestamp=l.timestamp),l.size!==void 0&&ke.resizeFileStorage(i,l.size)},lookup(i,l){throw p.genericErrors[44]},mknod(i,l,u,m){return ke.createNode(i,l,u,m)},rename(i,l,u){if(p.isDir(i.mode)){var m;try{m=p.lookupNode(l,u)}catch{}if(m)for(var _ in m.contents)throw new p.ErrnoError(55)}delete i.parent.contents[i.name],i.parent.timestamp=Date.now(),i.name=u,l.contents[u]=i,l.timestamp=i.parent.timestamp},unlink(i,l){delete i.contents[l],i.timestamp=Date.now()},rmdir(i,l){var u=p.lookupNode(i,l);for(var m in u.contents)throw new p.ErrnoError(55);delete i.contents[l],i.timestamp=Date.now()},readdir(i){var l=[".",".."];for(var u of Object.keys(i.contents))l.push(u);return l},symlink(i,l,u){var m=ke.createNode(i,l,41471,0);return m.link=u,m},readlink(i){if(!p.isLink(i.mode))throw new p.ErrnoError(28);return i.link}},stream_ops:{read(i,l,u,m,_){var T=i.node.contents;if(_>=i.node.usedBytes)return 0;var F=Math.min(i.node.usedBytes-_,m);if(A(F>=0),F>8&&T.subarray)l.set(T.subarray(_,_+F),u);else for(var C=0;C0||u+l{var _=wt(`al ${i}`);b(i).then(T=>{A(T,`Loading data file "${i}" failed (no arrayBuffer).`),l(new Uint8Array(T)),_&&Qt(_)},T=>{if(u)u();else throw`Loading data file "${i}" failed.`}),_&&Et(_)},Tc=(i,l,u,m,_,T)=>{p.createDataFile(i,l,u,m,_,T)},xc=r.preloadPlugins||[],Ac=(i,l,u,m)=>{typeof Browser<"u"&&Browser.init();var _=!1;return xc.forEach(T=>{_||T.canHandle(l)&&(T.handle(i,l,u,m),_=!0)}),_},Pc=(i,l,u,m,_,T,F,C,K,te)=>{var he=l?sn.resolve(We.join2(i,l)):i,xe=wt(`cp ${he}`);function me(ie){function Re(it){te==null||te(),C||Tc(i,l,it,m,_,K),T==null||T(),Qt(xe)}Ac(ie,he,Re,()=>{F==null||F(),Qt(xe)})||Re(ie)}Et(xe),typeof u=="string"?kc(u,me,F):me(u)},Fc=i=>{var l={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},u=l[i];if(typeof u>"u")throw new Error(`Unknown file open mode: ${i}`);return u},Wi=(i,l)=>{var u=0;return i&&(u|=365),l&&(u|=146),u},ri=(i,l)=>(A(typeof i=="number",`UTF8ToString expects a number (got ${typeof i})`),i?Yn(q,i,l):""),Rc=i=>ri(rf(i)),fs={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135},p={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class extends Error{constructor(i){super(B?Rc(i):""),this.name="ErrnoError",this.errno=i;for(var l in fs)if(fs[l]===i){this.code=l;break}}},genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(i){this.node=i}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(i){this.shared.flags=i}get position(){return this.shared.position}set position(i){this.shared.position=i}},FSNode:class{constructor(i,l,u,m){i||(i=this),this.parent=i,this.mount=i.mount,this.mounted=null,this.id=p.nextInode++,this.name=l,this.mode=u,this.node_ops={},this.stream_ops={},this.rdev=m,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(i){i?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(i){i?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return p.isDir(this.mode)}get isDevice(){return p.isChrdev(this.mode)}},lookupPath(i,l={}){if(i=sn.resolve(i),!i)return{path:"",node:null};var u={follow_mount:!0,recurse_count:0};if(l=Object.assign(u,l),l.recurse_count>8)throw new p.ErrnoError(32);for(var m=i.split("/").filter(xe=>!!xe),_=p.root,T="/",F=0;F40)throw new p.ErrnoError(32)}}return{path:T,node:_}},getPath(i){for(var l;;){if(p.isRoot(i)){var u=i.mount.mountpoint;return l?u[u.length-1]!=="/"?`${u}/${l}`:u+l:u}l=l?`${i.name}/${l}`:i.name,i=i.parent}},hashName(i,l){for(var u=0,m=0;m>>0)%p.nameTable.length},hashAddNode(i){var l=p.hashName(i.parent.id,i.name);i.name_next=p.nameTable[l],p.nameTable[l]=i},hashRemoveNode(i){var l=p.hashName(i.parent.id,i.name);if(p.nameTable[l]===i)p.nameTable[l]=i.name_next;else for(var u=p.nameTable[l];u;){if(u.name_next===i){u.name_next=i.name_next;break}u=u.name_next}},lookupNode(i,l){var u=p.mayLookup(i);if(u)throw new p.ErrnoError(u);for(var m=p.hashName(i.id,l),_=p.nameTable[m];_;_=_.name_next){var T=_.name;if(_.parent.id===i.id&&T===l)return _}return p.lookup(i,l)},createNode(i,l,u,m){A(typeof i=="object");var _=new p.FSNode(i,l,u,m);return p.hashAddNode(_),_},destroyNode(i){p.hashRemoveNode(i)},isRoot(i){return i===i.parent},isMountpoint(i){return!!i.mounted},isFile(i){return(i&61440)===32768},isDir(i){return(i&61440)===16384},isLink(i){return(i&61440)===40960},isChrdev(i){return(i&61440)===8192},isBlkdev(i){return(i&61440)===24576},isFIFO(i){return(i&61440)===4096},isSocket(i){return(i&49152)===49152},flagsToPermissionString(i){var l=["r","w","rw"][i&3];return i&512&&(l+="w"),l},nodePermissions(i,l){return p.ignorePermissions?0:l.includes("r")&&!(i.mode&292)||l.includes("w")&&!(i.mode&146)||l.includes("x")&&!(i.mode&73)?2:0},mayLookup(i){if(!p.isDir(i.mode))return 54;var l=p.nodePermissions(i,"x");return l||(i.node_ops.lookup?0:2)},mayCreate(i,l){try{var u=p.lookupNode(i,l);return 20}catch{}return p.nodePermissions(i,"wx")},mayDelete(i,l,u){var m;try{m=p.lookupNode(i,l)}catch(T){return T.errno}var _=p.nodePermissions(i,"wx");if(_)return _;if(u){if(!p.isDir(m.mode))return 54;if(p.isRoot(m)||p.getPath(m)===p.cwd())return 10}else if(p.isDir(m.mode))return 31;return 0},mayOpen(i,l){return i?p.isLink(i.mode)?32:p.isDir(i.mode)&&(p.flagsToPermissionString(l)!=="r"||l&512)?31:p.nodePermissions(i,p.flagsToPermissionString(l)):44},MAX_OPEN_FDS:4096,nextfd(){for(var i=0;i<=p.MAX_OPEN_FDS;i++)if(!p.streams[i])return i;throw new p.ErrnoError(33)},getStreamChecked(i){var l=p.getStream(i);if(!l)throw new p.ErrnoError(8);return l},getStream:i=>p.streams[i],createStream(i,l=-1){return A(l>=-1),i=Object.assign(new p.FSStream,i),l==-1&&(l=p.nextfd()),i.fd=l,p.streams[l]=i,i},closeStream(i){p.streams[i]=null},dupStream(i,l=-1){var m,_;var u=p.createStream(i,l);return(_=(m=u.stream_ops)==null?void 0:m.dup)==null||_.call(m,u),u},chrdev_stream_ops:{open(i){var u,m;var l=p.getDevice(i.node.rdev);i.stream_ops=l.stream_ops,(m=(u=i.stream_ops).open)==null||m.call(u,i)},llseek(){throw new p.ErrnoError(70)}},major:i=>i>>8,minor:i=>i&255,makedev:(i,l)=>i<<8|l,registerDevice(i,l){p.devices[i]={stream_ops:l}},getDevice:i=>p.devices[i],getMounts(i){for(var l=[],u=[i];u.length;){var m=u.pop();l.push(m),u.push(...m.mounts)}return l},syncfs(i,l){typeof i=="function"&&(l=i,i=!1),p.syncFSRequests++,p.syncFSRequests>1&&S(`warning: ${p.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var u=p.getMounts(p.root.mount),m=0;function _(F){return A(p.syncFSRequests>0),p.syncFSRequests--,l(F)}function T(F){if(F)return T.errored?void 0:(T.errored=!0,_(F));++m>=u.length&&_(null)}u.forEach(F=>{if(!F.type.syncfs)return T(null);F.type.syncfs(F,i,T)})},mount(i,l,u){if(typeof i=="string")throw i;var m=u==="/",_=!u,T;if(m&&p.root)throw new p.ErrnoError(10);if(!m&&!_){var F=p.lookupPath(u,{follow_mount:!1});if(u=F.path,T=F.node,p.isMountpoint(T))throw new p.ErrnoError(10);if(!p.isDir(T.mode))throw new p.ErrnoError(54)}var C={type:i,opts:l,mountpoint:u,mounts:[]},K=i.mount(C);return K.mount=C,C.root=K,m?p.root=K:T&&(T.mounted=C,T.mount&&T.mount.mounts.push(C)),K},unmount(i){var l=p.lookupPath(i,{follow_mount:!1});if(!p.isMountpoint(l.node))throw new p.ErrnoError(28);var u=l.node,m=u.mounted,_=p.getMounts(m);Object.keys(p.nameTable).forEach(F=>{for(var C=p.nameTable[F];C;){var K=C.name_next;_.includes(C.mount)&&p.destroyNode(C),C=K}}),u.mounted=null;var T=u.mount.mounts.indexOf(m);A(T!==-1),u.mount.mounts.splice(T,1)},lookup(i,l){return i.node_ops.lookup(i,l)},mknod(i,l,u){var m=p.lookupPath(i,{parent:!0}),_=m.node,T=We.basename(i);if(!T||T==="."||T==="..")throw new p.ErrnoError(28);var F=p.mayCreate(_,T);if(F)throw new p.ErrnoError(F);if(!_.node_ops.mknod)throw new p.ErrnoError(63);return _.node_ops.mknod(_,T,l,u)},create(i,l){return l=l!==void 0?l:438,l&=4095,l|=32768,p.mknod(i,l,0)},mkdir(i,l){return l=l!==void 0?l:511,l&=1023,l|=16384,p.mknod(i,l,0)},mkdirTree(i,l){for(var u=i.split("/"),m="",_=0;_"u"&&(u=l,l=438),l|=8192,p.mknod(i,l,u)},symlink(i,l){if(!sn.resolve(i))throw new p.ErrnoError(44);var u=p.lookupPath(l,{parent:!0}),m=u.node;if(!m)throw new p.ErrnoError(44);var _=We.basename(l),T=p.mayCreate(m,_);if(T)throw new p.ErrnoError(T);if(!m.node_ops.symlink)throw new p.ErrnoError(63);return m.node_ops.symlink(m,_,i)},rename(i,l){var u=We.dirname(i),m=We.dirname(l),_=We.basename(i),T=We.basename(l),F,C,K;if(F=p.lookupPath(i,{parent:!0}),C=F.node,F=p.lookupPath(l,{parent:!0}),K=F.node,!C||!K)throw new p.ErrnoError(44);if(C.mount!==K.mount)throw new p.ErrnoError(75);var te=p.lookupNode(C,_),he=sn.relative(i,m);if(he.charAt(0)!==".")throw new p.ErrnoError(28);if(he=sn.relative(l,u),he.charAt(0)!==".")throw new p.ErrnoError(55);var xe;try{xe=p.lookupNode(K,T)}catch{}if(te!==xe){var me=p.isDir(te.mode),ie=p.mayDelete(C,_,me);if(ie)throw new p.ErrnoError(ie);if(ie=xe?p.mayDelete(K,T,me):p.mayCreate(K,T),ie)throw new p.ErrnoError(ie);if(!C.node_ops.rename)throw new p.ErrnoError(63);if(p.isMountpoint(te)||xe&&p.isMountpoint(xe))throw new p.ErrnoError(10);if(K!==C&&(ie=p.nodePermissions(C,"w"),ie))throw new p.ErrnoError(ie);p.hashRemoveNode(te);try{C.node_ops.rename(te,K,T),te.parent=K}catch(Re){throw Re}finally{p.hashAddNode(te)}}},rmdir(i){var l=p.lookupPath(i,{parent:!0}),u=l.node,m=We.basename(i),_=p.lookupNode(u,m),T=p.mayDelete(u,m,!0);if(T)throw new p.ErrnoError(T);if(!u.node_ops.rmdir)throw new p.ErrnoError(63);if(p.isMountpoint(_))throw new p.ErrnoError(10);u.node_ops.rmdir(u,m),p.destroyNode(_)},readdir(i){var l=p.lookupPath(i,{follow:!0}),u=l.node;if(!u.node_ops.readdir)throw new p.ErrnoError(54);return u.node_ops.readdir(u)},unlink(i){var l=p.lookupPath(i,{parent:!0}),u=l.node;if(!u)throw new p.ErrnoError(44);var m=We.basename(i),_=p.lookupNode(u,m),T=p.mayDelete(u,m,!1);if(T)throw new p.ErrnoError(T);if(!u.node_ops.unlink)throw new p.ErrnoError(63);if(p.isMountpoint(_))throw new p.ErrnoError(10);u.node_ops.unlink(u,m),p.destroyNode(_)},readlink(i){var l=p.lookupPath(i),u=l.node;if(!u)throw new p.ErrnoError(44);if(!u.node_ops.readlink)throw new p.ErrnoError(28);return sn.resolve(p.getPath(u.parent),u.node_ops.readlink(u))},stat(i,l){var u=p.lookupPath(i,{follow:!l}),m=u.node;if(!m)throw new p.ErrnoError(44);if(!m.node_ops.getattr)throw new p.ErrnoError(63);return m.node_ops.getattr(m)},lstat(i){return p.stat(i,!0)},chmod(i,l,u){var m;if(typeof i=="string"){var _=p.lookupPath(i,{follow:!u});m=_.node}else m=i;if(!m.node_ops.setattr)throw new p.ErrnoError(63);m.node_ops.setattr(m,{mode:l&4095|m.mode&-4096,timestamp:Date.now()})},lchmod(i,l){p.chmod(i,l,!0)},fchmod(i,l){var u=p.getStreamChecked(i);p.chmod(u.node,l)},chown(i,l,u,m){var _;if(typeof i=="string"){var T=p.lookupPath(i,{follow:!m});_=T.node}else _=i;if(!_.node_ops.setattr)throw new p.ErrnoError(63);_.node_ops.setattr(_,{timestamp:Date.now()})},lchown(i,l,u){p.chown(i,l,u,!0)},fchown(i,l,u){var m=p.getStreamChecked(i);p.chown(m.node,l,u)},truncate(i,l){if(l<0)throw new p.ErrnoError(28);var u;if(typeof i=="string"){var m=p.lookupPath(i,{follow:!0});u=m.node}else u=i;if(!u.node_ops.setattr)throw new p.ErrnoError(63);if(p.isDir(u.mode))throw new p.ErrnoError(31);if(!p.isFile(u.mode))throw new p.ErrnoError(28);var _=p.nodePermissions(u,"w");if(_)throw new p.ErrnoError(_);u.node_ops.setattr(u,{size:l,timestamp:Date.now()})},ftruncate(i,l){var u=p.getStreamChecked(i);if(!(u.flags&2097155))throw new p.ErrnoError(28);p.truncate(u.node,l)},utime(i,l,u){var m=p.lookupPath(i,{follow:!0}),_=m.node;_.node_ops.setattr(_,{timestamp:Math.max(l,u)})},open(i,l,u){if(i==="")throw new p.ErrnoError(44);l=typeof l=="string"?Fc(l):l,l&64?(u=typeof u>"u"?438:u,u=u&4095|32768):u=0;var m;if(typeof i=="object")m=i;else{i=We.normalize(i);try{var _=p.lookupPath(i,{follow:!(l&131072)});m=_.node}catch{}}var T=!1;if(l&64)if(m){if(l&128)throw new p.ErrnoError(20)}else m=p.mknod(i,u,0),T=!0;if(!m)throw new p.ErrnoError(44);if(p.isChrdev(m.mode)&&(l&=-513),l&65536&&!p.isDir(m.mode))throw new p.ErrnoError(54);if(!T){var F=p.mayOpen(m,l);if(F)throw new p.ErrnoError(F)}l&512&&!T&&p.truncate(m,0),l&=-131713;var C=p.createStream({node:m,path:p.getPath(m),flags:l,seekable:!0,position:0,stream_ops:m.stream_ops,ungotten:[],error:!1});return C.stream_ops.open&&C.stream_ops.open(C),r.logReadFiles&&!(l&1)&&(p.readFiles||(p.readFiles={}),i in p.readFiles||(p.readFiles[i]=1)),C},close(i){if(p.isClosed(i))throw new p.ErrnoError(8);i.getdents&&(i.getdents=null);try{i.stream_ops.close&&i.stream_ops.close(i)}catch(l){throw l}finally{p.closeStream(i.fd)}i.fd=null},isClosed(i){return i.fd===null},llseek(i,l,u){if(p.isClosed(i))throw new p.ErrnoError(8);if(!i.seekable||!i.stream_ops.llseek)throw new p.ErrnoError(70);if(u!=0&&u!=1&&u!=2)throw new p.ErrnoError(28);return i.position=i.stream_ops.llseek(i,l,u),i.ungotten=[],i.position},read(i,l,u,m,_){if(A(u>=0),m<0||_<0)throw new p.ErrnoError(28);if(p.isClosed(i))throw new p.ErrnoError(8);if((i.flags&2097155)===1)throw new p.ErrnoError(8);if(p.isDir(i.node.mode))throw new p.ErrnoError(31);if(!i.stream_ops.read)throw new p.ErrnoError(28);var T=typeof _<"u";if(!T)_=i.position;else if(!i.seekable)throw new p.ErrnoError(70);var F=i.stream_ops.read(i,l,u,m,_);return T||(i.position+=F),F},write(i,l,u,m,_,T){if(A(u>=0),m<0||_<0)throw new p.ErrnoError(28);if(p.isClosed(i))throw new p.ErrnoError(8);if(!(i.flags&2097155))throw new p.ErrnoError(8);if(p.isDir(i.node.mode))throw new p.ErrnoError(31);if(!i.stream_ops.write)throw new p.ErrnoError(28);i.seekable&&i.flags&1024&&p.llseek(i,0,2);var F=typeof _<"u";if(!F)_=i.position;else if(!i.seekable)throw new p.ErrnoError(70);var C=i.stream_ops.write(i,l,u,m,_,T);return F||(i.position+=C),C},allocate(i,l,u){if(p.isClosed(i))throw new p.ErrnoError(8);if(l<0||u<=0)throw new p.ErrnoError(28);if(!(i.flags&2097155))throw new p.ErrnoError(8);if(!p.isFile(i.node.mode)&&!p.isDir(i.node.mode))throw new p.ErrnoError(43);if(!i.stream_ops.allocate)throw new p.ErrnoError(138);i.stream_ops.allocate(i,l,u)},mmap(i,l,u,m,_){if(m&2&&!(_&2)&&(i.flags&2097155)!==2)throw new p.ErrnoError(2);if((i.flags&2097155)===1)throw new p.ErrnoError(2);if(!i.stream_ops.mmap)throw new p.ErrnoError(43);return i.stream_ops.mmap(i,l,u,m,_)},msync(i,l,u,m,_){return A(u>=0),i.stream_ops.msync?i.stream_ops.msync(i,l,u,m,_):0},ioctl(i,l,u){if(!i.stream_ops.ioctl)throw new p.ErrnoError(59);return i.stream_ops.ioctl(i,l,u)},readFile(i,l={}){if(l.flags=l.flags||0,l.encoding=l.encoding||"binary",l.encoding!=="utf8"&&l.encoding!=="binary")throw new Error(`Invalid encoding type "${l.encoding}"`);var u,m=p.open(i,l.flags),_=p.stat(i),T=_.size,F=new Uint8Array(T);return p.read(m,F,0,T,0),l.encoding==="utf8"?u=Yn(F,0):l.encoding==="binary"&&(u=F),p.close(m),u},writeFile(i,l,u={}){u.flags=u.flags||577;var m=p.open(i,u.flags,u.mode);if(typeof l=="string"){var _=new Uint8Array(mn(l)+1),T=Hi(l,_,0,_.length);p.write(m,_,0,T,void 0,u.canOwn)}else if(ArrayBuffer.isView(l))p.write(m,l,0,l.byteLength,void 0,u.canOwn);else throw new Error("Unsupported data type");p.close(m)},cwd:()=>p.currentPath,chdir(i){var l=p.lookupPath(i,{follow:!0});if(l.node===null)throw new p.ErrnoError(44);if(!p.isDir(l.node.mode))throw new p.ErrnoError(54);var u=p.nodePermissions(l.node,"x");if(u)throw new p.ErrnoError(u);p.currentPath=l.path},createDefaultDirectories(){p.mkdir("/tmp"),p.mkdir("/home"),p.mkdir("/home/web_user")},createDefaultDevices(){p.mkdir("/dev"),p.registerDevice(p.makedev(1,3),{read:()=>0,write:(m,_,T,F,C)=>F}),p.mkdev("/dev/null",p.makedev(1,3)),pn.register(p.makedev(5,0),pn.default_tty_ops),pn.register(p.makedev(6,0),pn.default_tty1_ops),p.mkdev("/dev/tty",p.makedev(5,0)),p.mkdev("/dev/tty1",p.makedev(6,0));var i=new Uint8Array(1024),l=0,u=()=>(l===0&&(l=as(i).byteLength),i[--l]);p.createDevice("/dev","random",u),p.createDevice("/dev","urandom",u),p.mkdir("/dev/shm"),p.mkdir("/dev/shm/tmp")},createSpecialDirectories(){p.mkdir("/proc");var i=p.mkdir("/proc/self");p.mkdir("/proc/self/fd"),p.mount({mount(){var l=p.createNode(i,"fd",16895,73);return l.node_ops={lookup(u,m){var _=+m,T=p.getStreamChecked(_),F={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>T.path}};return F.parent=F,F}},l}},{},"/proc/self/fd")},createStandardStreams(){r.stdin?p.createDevice("/dev","stdin",r.stdin):p.symlink("/dev/tty","/dev/stdin"),r.stdout?p.createDevice("/dev","stdout",null,r.stdout):p.symlink("/dev/tty","/dev/stdout"),r.stderr?p.createDevice("/dev","stderr",null,r.stderr):p.symlink("/dev/tty1","/dev/stderr");var i=p.open("/dev/stdin",0),l=p.open("/dev/stdout",1),u=p.open("/dev/stderr",1);A(i.fd===0,`invalid handle for stdin (${i.fd})`),A(l.fd===1,`invalid handle for stdout (${l.fd})`),A(u.fd===2,`invalid handle for stderr (${u.fd})`)},staticInit(){[44].forEach(i=>{p.genericErrors[i]=new p.ErrnoError(i),p.genericErrors[i].stack=""}),p.nameTable=new Array(4096),p.mount(ke,{},"/"),p.createDefaultDirectories(),p.createDefaultDevices(),p.createSpecialDirectories(),p.filesystems={MEMFS:ke}},init(i,l,u){A(!p.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),p.init.initialized=!0,r.stdin=i||r.stdin,r.stdout=l||r.stdout,r.stderr=u||r.stderr,p.createStandardStreams()},quit(){p.init.initialized=!1,Ts(0);for(var i=0;ithis.length-1||ie<0)){var Re=ie%this.chunkSize,it=ie/this.chunkSize|0;return this.getter(it)[Re]}}setDataGetter(ie){this.getter=ie}cacheLength(){var ie=new XMLHttpRequest;if(ie.open("HEAD",u,!1),ie.send(null),!(ie.status>=200&&ie.status<300||ie.status===304))throw new Error("Couldn't load "+u+". Status: "+ie.status);var Re=Number(ie.getResponseHeader("Content-length")),it,Kt=(it=ie.getResponseHeader("Accept-Ranges"))&&it==="bytes",Mt=(it=ie.getResponseHeader("Content-Encoding"))&&it==="gzip",Bt=1024*1024;Kt||(Bt=Re);var Vt=(en,Qn)=>{if(en>Qn)throw new Error("invalid range ("+en+", "+Qn+") or no bytes requested!");if(Qn>Re-1)throw new Error("only "+Re+" bytes available! programmer error!");var St=new XMLHttpRequest;if(St.open("GET",u,!1),Re!==Bt&&St.setRequestHeader("Range","bytes="+en+"-"+Qn),St.responseType="arraybuffer",St.overrideMimeType&&St.overrideMimeType("text/plain; charset=x-user-defined"),St.send(null),!(St.status>=200&&St.status<300||St.status===304))throw new Error("Couldn't load "+u+". Status: "+St.status);return St.response!==void 0?new Uint8Array(St.response||[]):cs(St.responseText||"")},Tr=this;Tr.setDataGetter(en=>{var Qn=en*Bt,St=(en+1)*Bt-1;if(St=Math.min(St,Re-1),typeof Tr.chunks[en]>"u"&&(Tr.chunks[en]=Vt(Qn,St)),typeof Tr.chunks[en]>"u")throw new Error("doXHR failed!");return Tr.chunks[en]}),(Mt||!Re)&&(Bt=Re=1,Re=this.getter(0).length,Bt=Re,x("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=Re,this._chunkSize=Bt,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest<"u"){throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var F,C}else var C={isDevice:!1,url:u};var K=p.createFile(i,l,C,m,_);C.contents?K.contents=C.contents:C.url&&(K.contents=null,K.url=C.url),Object.defineProperties(K,{usedBytes:{get:function(){return this.contents.length}}});var te={},he=Object.keys(K.stream_ops);he.forEach(me=>{var ie=K.stream_ops[me];te[me]=(...Re)=>(p.forceLoadFile(K),ie(...Re))});function xe(me,ie,Re,it,Kt){var Mt=me.node.contents;if(Kt>=Mt.length)return 0;var Bt=Math.min(Mt.length-Kt,it);if(A(Bt>=0),Mt.slice)for(var Vt=0;Vt(p.forceLoadFile(K),xe(me,ie,Re,it,Kt)),te.mmap=(me,ie,Re,it,Kt)=>{p.forceLoadFile(K);var Mt=us(ie);if(!Mt)throw new p.ErrnoError(48);return xe(me,z,Mt,ie,Re),{ptr:Mt,allocated:!0}},K.stream_ops=te,K},absolutePath(){rt("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder(){rt("FS.createFolder has been removed; use FS.mkdir instead")},createLink(){rt("FS.createLink has been removed; use FS.symlink instead")},joinPath(){rt("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc(){rt("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath(){rt("FS.standardizePath has been removed; use PATH.normalize instead")}},ce={DEFAULT_POLLMASK:5,calculateAt(i,l,u){if(We.isAbs(l))return l;var m;if(i===-100)m=p.cwd();else{var _=ce.getStreamFromFD(i);m=_.path}if(l.length==0){if(!u)throw new p.ErrnoError(44);return m}return We.join2(m,l)},doStat(i,l,u){var m=i(l);O[u>>2]=m.dev,O[u+4>>2]=m.mode,P[u+8>>2]=m.nlink,O[u+12>>2]=m.uid,O[u+16>>2]=m.gid,O[u+20>>2]=m.rdev,le=[m.size>>>0,(ee=m.size,+Math.abs(ee)>=1?ee>0?+Math.floor(ee/4294967296)>>>0:~~+Math.ceil((ee-+(~~ee>>>0))/4294967296)>>>0:0)],O[u+24>>2]=le[0],O[u+28>>2]=le[1],O[u+32>>2]=4096,O[u+36>>2]=m.blocks;var _=m.atime.getTime(),T=m.mtime.getTime(),F=m.ctime.getTime();return le=[Math.floor(_/1e3)>>>0,(ee=Math.floor(_/1e3),+Math.abs(ee)>=1?ee>0?+Math.floor(ee/4294967296)>>>0:~~+Math.ceil((ee-+(~~ee>>>0))/4294967296)>>>0:0)],O[u+40>>2]=le[0],O[u+44>>2]=le[1],P[u+48>>2]=_%1e3*1e3,le=[Math.floor(T/1e3)>>>0,(ee=Math.floor(T/1e3),+Math.abs(ee)>=1?ee>0?+Math.floor(ee/4294967296)>>>0:~~+Math.ceil((ee-+(~~ee>>>0))/4294967296)>>>0:0)],O[u+56>>2]=le[0],O[u+60>>2]=le[1],P[u+64>>2]=T%1e3*1e3,le=[Math.floor(F/1e3)>>>0,(ee=Math.floor(F/1e3),+Math.abs(ee)>=1?ee>0?+Math.floor(ee/4294967296)>>>0:~~+Math.ceil((ee-+(~~ee>>>0))/4294967296)>>>0:0)],O[u+72>>2]=le[0],O[u+76>>2]=le[1],P[u+80>>2]=F%1e3*1e3,le=[m.ino>>>0,(ee=m.ino,+Math.abs(ee)>=1?ee>0?+Math.floor(ee/4294967296)>>>0:~~+Math.ceil((ee-+(~~ee>>>0))/4294967296)>>>0:0)],O[u+88>>2]=le[0],O[u+92>>2]=le[1],0},doMsync(i,l,u,m,_){if(!p.isFile(l.node.mode))throw new p.ErrnoError(43);if(m&2)return 0;var T=q.slice(i,i+u);p.msync(l,T,_,u,m)},getStreamFromFD(i){var l=p.getStreamChecked(i);return l},varargs:void 0,getStr(i){var l=ri(i);return l}};function Ic(i){try{return i=ce.getStr(i),p.chdir(i),0}catch(l){if(typeof p>"u"||l.name!=="ErrnoError")throw l;return-l.errno}}function Cc(i,l){try{return i=ce.getStr(i),p.chmod(i,l),0}catch(u){if(typeof p>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}function Oc(i){try{var l=ce.getStreamFromFD(i);return p.dupStream(l).fd}catch(u){if(typeof p>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}function Mc(i,l,u){try{var m=ce.getStreamFromFD(i);if(A(!u),m.fd===l)return-28;if(l<0||l>=p.MAX_OPEN_FDS)return-8;var _=p.getStream(l);return _&&p.close(_),p.dupStream(m,l).fd}catch(T){if(typeof p>"u"||T.name!=="ErrnoError")throw T;return-T.errno}}function Dc(i,l,u,m){try{if(l=ce.getStr(l),A(m===0),l=ce.calculateAt(i,l),u&-8)return-28;var _=p.lookupPath(l,{follow:!0}),T=_.node;if(!T)return-44;var F="";return u&4&&(F+="r"),u&2&&(F+="w"),u&1&&(F+="x"),F&&p.nodePermissions(T,F)?-2:0}catch(C){if(typeof p>"u"||C.name!=="ErrnoError")throw C;return-C.errno}}function Lc(i){try{var l=ce.getStreamFromFD(i);return p.chdir(l.path),0}catch(u){if(typeof p>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}function Nc(i,l){try{return p.fchmod(i,l),0}catch(u){if(typeof p>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}function zc(i,l,u,m){try{var _=m&256;return l=ce.getStr(l),l=ce.calculateAt(i,l),p.chmod(l,u,_),0}catch(T){if(typeof p>"u"||T.name!=="ErrnoError")throw T;return-T.errno}}function Uc(i,l,u){try{return p.fchown(i,l,u),0}catch(m){if(typeof p>"u"||m.name!=="ErrnoError")throw m;return-m.errno}}function Bc(i,l,u,m,_){try{l=ce.getStr(l);var T=_&256;return _=_&-257,A(_===0),l=ce.calculateAt(i,l),(T?p.lchown:p.chown)(l,u,m),0}catch(F){if(typeof p>"u"||F.name!=="ErrnoError")throw F;return-F.errno}}function ii(){A(ce.varargs!=null);var i=O[+ce.varargs>>2];return ce.varargs+=4,i}var Xn=ii;function Gc(i,l,u){ce.varargs=u;try{var m=ce.getStreamFromFD(i);switch(l){case 0:{var _=ii();if(_<0)return-28;for(;p.streams[_];)_++;var T;return T=p.dupStream(m,_),T.fd}case 1:case 2:return 0;case 3:return m.flags;case 4:{var _=ii();return m.flags|=_,0}case 12:{var _=Xn(),F=0;return L[_+F>>1]=2,0}case 13:case 14:return 0}return-28}catch(C){if(typeof p>"u"||C.name!=="ErrnoError")throw C;return-C.errno}}function jc(i){try{var l=ce.getStreamFromFD(i);return 0}catch(u){if(typeof p>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}function Hc(i,l){try{var u=ce.getStreamFromFD(i);return ce.doStat(p.stat,u.path,l)}catch(m){if(typeof p>"u"||m.name!=="ErrnoError")throw m;return-m.errno}}function ds(i,l,u){try{return i=ce.getStr(i),A(l===64),O[u+4>>2]=4096,O[u+40>>2]=4096,O[u+8>>2]=1e6,O[u+12>>2]=5e5,O[u+16>>2]=5e5,O[u+20>>2]=p.nextInode,O[u+24>>2]=1e6,O[u+28>>2]=42,O[u+44>>2]=2,O[u+36>>2]=255,0}catch(m){if(typeof p>"u"||m.name!=="ErrnoError")throw m;return-m.errno}}function Wc(i,l,u){try{var m=ce.getStreamFromFD(i);return ds(0,l,u)}catch(_){if(typeof p>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}var hn=(i,l)=>(A(i==i>>>0||i==(i|0)),A(l===(l|0)),l+2097152>>>0<4194305-!!i?(i>>>0)+l*4294967296:NaN);function Kc(i,l,u){var m=hn(l,u);try{return isNaN(m)?61:(p.ftruncate(i,m),0)}catch(_){if(typeof p>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}var an=(i,l,u)=>(A(typeof u=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),Hi(i,q,l,u));function Vc(i,l){try{if(l===0)return-28;var u=p.cwd(),m=mn(u)+1;return l"u"||_.name!=="ErrnoError")throw _;return-_.errno}}function $c(i,l,u){try{var m=ce.getStreamFromFD(i);m.getdents||(m.getdents=p.readdir(m.path));for(var _=280,T=0,F=p.llseek(m,0,1),C=Math.floor(F/_);C>>0,(ee=K,+Math.abs(ee)>=1?ee>0?+Math.floor(ee/4294967296)>>>0:~~+Math.ceil((ee-+(~~ee>>>0))/4294967296)>>>0:0)],O[l+T>>2]=le[0],O[l+T+4>>2]=le[1],le=[(C+1)*_>>>0,(ee=(C+1)*_,+Math.abs(ee)>=1?ee>0?+Math.floor(ee/4294967296)>>>0:~~+Math.ceil((ee-+(~~ee>>>0))/4294967296)>>>0:0)],O[l+T+8>>2]=le[0],O[l+T+12>>2]=le[1],L[l+T+16>>1]=280,z[l+T+18]=te,an(he,l+T+19,256),T+=_,C+=1}return p.llseek(m,C*_,0),T}catch(ie){if(typeof p>"u"||ie.name!=="ErrnoError")throw ie;return-ie.errno}}function qc(i,l,u){ce.varargs=u;try{var m=ce.getStreamFromFD(i);switch(l){case 21509:return m.tty?0:-59;case 21505:{if(!m.tty)return-59;if(m.tty.ops.ioctl_tcgets){var _=m.tty.ops.ioctl_tcgets(m),T=Xn();O[T>>2]=_.c_iflag||0,O[T+4>>2]=_.c_oflag||0,O[T+8>>2]=_.c_cflag||0,O[T+12>>2]=_.c_lflag||0;for(var F=0;F<32;F++)z[T+F+17]=_.c_cc[F]||0;return 0}return 0}case 21510:case 21511:case 21512:return m.tty?0:-59;case 21506:case 21507:case 21508:{if(!m.tty)return-59;if(m.tty.ops.ioctl_tcsets){for(var T=Xn(),C=O[T>>2],K=O[T+4>>2],te=O[T+8>>2],he=O[T+12>>2],xe=[],F=0;F<32;F++)xe.push(z[T+F+17]);return m.tty.ops.ioctl_tcsets(m.tty,l,{c_iflag:C,c_oflag:K,c_cflag:te,c_lflag:he,c_cc:xe})}return 0}case 21519:{if(!m.tty)return-59;var T=Xn();return O[T>>2]=0,0}case 21520:return m.tty?-28:-59;case 21531:{var T=Xn();return p.ioctl(m,l,T)}case 21523:{if(!m.tty)return-59;if(m.tty.ops.ioctl_tiocgwinsz){var me=m.tty.ops.ioctl_tiocgwinsz(m.tty),T=Xn();L[T>>1]=me[0],L[T+2>>1]=me[1]}return 0}case 21524:return m.tty?0:-59;case 21515:return m.tty?0:-59;default:return-28}}catch(ie){if(typeof p>"u"||ie.name!=="ErrnoError")throw ie;return-ie.errno}}function Yc(i,l){try{return i=ce.getStr(i),ce.doStat(p.lstat,i,l)}catch(u){if(typeof p>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}function Xc(i,l,u){try{return l=ce.getStr(l),l=ce.calculateAt(i,l),l=We.normalize(l),l[l.length-1]==="/"&&(l=l.substr(0,l.length-1)),p.mkdir(l,u,0),0}catch(m){if(typeof p>"u"||m.name!=="ErrnoError")throw m;return-m.errno}}function Zc(i,l,u,m){try{l=ce.getStr(l);var _=m&256,T=m&4096;return m=m&-6401,A(!m,`unknown flags in __syscall_newfstatat: ${m}`),l=ce.calculateAt(i,l,T),ce.doStat(_?p.lstat:p.stat,l,u)}catch(F){if(typeof p>"u"||F.name!=="ErrnoError")throw F;return-F.errno}}function Jc(i,l,u,m){ce.varargs=m;try{l=ce.getStr(l),l=ce.calculateAt(i,l);var _=m?ii():0;return p.open(l,u,_).fd}catch(T){if(typeof p>"u"||T.name!=="ErrnoError")throw T;return-T.errno}}var ut={BUCKET_BUFFER_SIZE:8192,mount(i){return p.createNode(null,"/",16895,0)},createPipe(){var i={buckets:[],refcnt:2};i.buckets.push({buffer:new Uint8Array(ut.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var l=ut.nextname(),u=ut.nextname(),m=p.createNode(ut.root,l,4096,0),_=p.createNode(ut.root,u,4096,0);m.pipe=i,_.pipe=i;var T=p.createStream({path:l,node:m,flags:0,seekable:!1,stream_ops:ut.stream_ops});m.stream=T;var F=p.createStream({path:u,node:_,flags:1,seekable:!1,stream_ops:ut.stream_ops});return _.stream=F,{readable_fd:T.fd,writable_fd:F.fd}},stream_ops:{poll(i){var l=i.node.pipe;if((i.flags&2097155)===1)return 260;if(l.buckets.length>0)for(var u=0;u0)return 65}return 0},ioctl(i,l,u){return 28},fsync(i){return 28},read(i,l,u,m,_){for(var T=i.node.pipe,F=0,C=0;C=C)return K.buffer.set(F,K.offset),K.offset+=C,C;te>0&&(K.buffer.set(F.subarray(0,te),K.offset),K.offset+=te,F=F.subarray(te,F.byteLength));for(var he=F.byteLength/ut.BUCKET_BUFFER_SIZE|0,xe=F.byteLength%ut.BUCKET_BUFFER_SIZE,me=0;me0){var ie={buffer:new Uint8Array(ut.BUCKET_BUFFER_SIZE),offset:F.byteLength,roffset:0};T.buckets.push(ie),ie.buffer.set(F)}return C},close(i){var l=i.node.pipe;l.refcnt--,l.refcnt===0&&(l.buckets=null)}},nextname(){return ut.nextname.current||(ut.nextname.current=0),"pipe["+ut.nextname.current+++"]"}};function Qc(i){try{if(i==0)throw new p.ErrnoError(21);var l=ut.createPipe();return O[i>>2]=l.readable_fd,O[i+4>>2]=l.writable_fd,0}catch(u){if(typeof p>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}function eu(i,l,u){try{for(var m=0,_=0;_>2],C=L[T+4>>1],K=32,te=p.getStream(F);te&&(K=ce.DEFAULT_POLLMASK,te.stream_ops.poll&&(K=te.stream_ops.poll(te,-1))),K&=C|8|16,K&&m++,L[T+6>>1]=K}return m}catch(he){if(typeof p>"u"||he.name!=="ErrnoError")throw he;return-he.errno}}function tu(i,l,u,m){try{if(l=ce.getStr(l),l=ce.calculateAt(i,l),m<=0)return-28;var _=p.readlink(l),T=Math.min(m,mn(_)),F=z[u+T];return an(_,u,m+1),z[u+T]=F,T}catch(C){if(typeof p>"u"||C.name!=="ErrnoError")throw C;return-C.errno}}function nu(i,l,u,m){try{return l=ce.getStr(l),m=ce.getStr(m),l=ce.calculateAt(i,l),m=ce.calculateAt(u,m),p.rename(l,m),0}catch(_){if(typeof p>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}function ru(i,l){try{return i=ce.getStr(i),ce.doStat(p.stat,i,l)}catch(u){if(typeof p>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}function iu(i,l,u){try{return u=ce.calculateAt(l,u),p.symlink(i,u),0}catch(m){if(typeof p>"u"||m.name!=="ErrnoError")throw m;return-m.errno}}function ou(i,l,u){try{return l=ce.getStr(l),l=ce.calculateAt(i,l),u===0?p.unlink(l):u===512?p.rmdir(l):rt("Invalid flags passed to unlinkat"),0}catch(m){if(typeof p>"u"||m.name!=="ErrnoError")throw m;return-m.errno}}var ms=i=>P[i>>2]+O[i+4>>2]*4294967296;function su(i,l,u,m){try{if(l=ce.getStr(l),A(m===0),l=ce.calculateAt(i,l,!0),u){var F=ms(u),C=O[u+8>>2];_=F*1e3+C/(1e3*1e3),u+=16,F=ms(u),C=O[u+8>>2],T=F*1e3+C/(1e3*1e3)}else var _=Date.now(),T=_;return p.utime(l,_,T),0}catch(K){if(typeof p>"u"||K.name!=="ErrnoError")throw K;return-K.errno}}var au=()=>{rt("native code called abort()")},lu=1,cu=()=>lu,uu=(i,l,u)=>q.copyWithin(i,l,l+u),fu=()=>{vt=!1,Vi=0},du=()=>{throw 1/0},mu=i=>i%4===0&&(i%100!==0||i%400===0),pu=[0,31,60,91,121,152,182,213,244,274,305,335],hu=[0,31,59,90,120,151,181,212,243,273,304,334],gu=i=>{var l=mu(i.getFullYear()),u=l?pu:hu,m=u[i.getMonth()]+i.getDate()-1;return m};function vu(i,l,u){var m=hn(i,l),_=new Date(m*1e3);O[u>>2]=_.getSeconds(),O[u+4>>2]=_.getMinutes(),O[u+8>>2]=_.getHours(),O[u+12>>2]=_.getDate(),O[u+16>>2]=_.getMonth(),O[u+20>>2]=_.getFullYear()-1900,O[u+24>>2]=_.getDay();var T=gu(_)|0;O[u+28>>2]=T,O[u+36>>2]=-(_.getTimezoneOffset()*60);var F=new Date(_.getFullYear(),0,1),C=new Date(_.getFullYear(),6,1).getTimezoneOffset(),K=F.getTimezoneOffset(),te=(C!=K&&_.getTimezoneOffset()==Math.min(K,C))|0;O[u+32>>2]=te}function bu(i,l,u,m,_,T,F,C){var K=hn(_,T);try{if(isNaN(K))return 61;var te=ce.getStreamFromFD(m),he=p.mmap(te,i,K,l,u),xe=he.ptr;return O[F>>2]=he.allocated,P[C>>2]=xe,0}catch(me){if(typeof p>"u"||me.name!=="ErrnoError")throw me;return-me.errno}}function yu(i,l,u,m,_,T,F){var C=hn(T,F);try{return isNaN(C)?61:(ce.doMsync(i,ce.getStreamFromFD(_),l,m,C),0)}catch(K){if(typeof p>"u"||K.name!=="ErrnoError")throw K;return-K.errno}}function _u(i,l,u,m,_,T,F){var C=hn(T,F);try{var K=ce.getStreamFromFD(_);u&2&&ce.doMsync(i,K,l,m,C)}catch(te){if(typeof p>"u"||te.name!=="ErrnoError")throw te;return-te.errno}}var Zn={},Ki=i=>{if(i instanceof ti||i=="unwind")return N;Z(),i instanceof WebAssembly.RuntimeError&&Zi()<=0&&S("Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 65536)"),y(1,i)},Vi=0,$i=()=>vt||Vi>0,ps=i=>{var l;N=i,$i()||((l=r.onExit)==null||l.call(r,i),G=!0),y(i,new ti(i))},hs=(i,l)=>{if(N=i,gf(),$i()&&!l){var u=`program exited (with status: ${i}), but keepRuntimeAlive() is set (counter=${Vi}) due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)`;s(u),S(u)}ps(i)},gs=hs,wu=()=>{if(!$i())try{gs(N)}catch(i){Ki(i)}},Eu=i=>{if(G){S("user callback triggered after runtime exited or application aborted. Ignoring.");return}try{i(),wu()}catch(l){Ki(l)}},qi;qi=()=>performance.now();var Su=(i,l)=>{if(Zn[i]&&(clearTimeout(Zn[i].id),delete Zn[i]),!l)return 0;var u=setTimeout(()=>{A(i in Zn),delete Zn[i],Eu(()=>sf(i,qi()))},l);return Zn[i]={id:u,timeout_ms:l},0},ku=(i,l,u,m)=>{var _=new Date().getFullYear(),T=new Date(_,0,1),F=new Date(_,6,1),C=T.getTimezoneOffset(),K=F.getTimezoneOffset(),te=Math.max(C,K);P[i>>2]=te*60,O[l>>2]=+(C!=K);var he=ie=>{var Re=ie>=0?"-":"+",it=Math.abs(ie),Kt=String(Math.floor(it/60)).padStart(2,"0"),Mt=String(it%60).padStart(2,"0");return`UTC${Re}${Kt}${Mt}`},xe=he(C),me=he(K);A(xe),A(me),A(mn(xe)<=16,`timezone name truncated to fit in TZNAME_MAX (${xe})`),A(mn(me)<=16,`timezone name truncated to fit in TZNAME_MAX (${me})`),KDate.now(),xu=i=>S(ri(i)),vs=()=>2147483648,Au=()=>vs(),Pu=()=>1e3,Fu=i=>{var l=M.buffer,u=(i-l.byteLength+65535)/65536;try{return M.grow(u),D(),1}catch(m){S(`growMemory: Attempted to grow heap from ${l.byteLength} bytes to ${i} bytes, but got error: ${m}`)}},Ru=i=>{var l=q.length;i>>>=0,A(i>l);var u=vs();if(i>u)return S(`Cannot enlarge memory, requested ${i} bytes, but the limit is ${u} bytes!`),!1;for(var m=(K,te)=>K+(te-K%te)%te,_=1;_<=4;_*=2){var T=l*(1+.2/_);T=Math.min(T,i+100663296);var F=Math.min(u,m(Math.max(i,T),65536)),C=Fu(F);if(C)return!0}return S(`Failed to grow the heap from ${l} bytes to ${F} bytes, not enough memory!`),!1},Iu=()=>{throw"Please compile your program with async support in order to use asynchronous operations like emscripten_sleep"},Yi={},Cu=()=>w||"./this.program",kr=()=>{if(!kr.strings){var i=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",l={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:i,_:Cu()};for(var u in Yi)Yi[u]===void 0?delete l[u]:l[u]=Yi[u];var m=[];for(var u in l)m.push(`${u}=${l[u]}`);kr.strings=m}return kr.strings},Ou=(i,l)=>{for(var u=0;u{var u=0;return kr().forEach((m,_)=>{var T=l+u;P[i+_*4>>2]=T,Ou(m,T),u+=m.length+1}),0},Du=(i,l)=>{var u=kr();P[i>>2]=u.length;var m=0;return u.forEach(_=>m+=_.length+1),P[l>>2]=m,0};function Lu(i){try{var l=ce.getStreamFromFD(i);return p.close(l),0}catch(u){if(typeof p>"u"||u.name!=="ErrnoError")throw u;return u.errno}}function Nu(i,l){try{var u=0,m=0,_=0,T=ce.getStreamFromFD(i),F=T.tty?2:p.isDir(T.mode)?3:p.isLink(T.mode)?7:4;return z[l]=F,L[l+2>>1]=_,le=[u>>>0,(ee=u,+Math.abs(ee)>=1?ee>0?+Math.floor(ee/4294967296)>>>0:~~+Math.ceil((ee-+(~~ee>>>0))/4294967296)>>>0:0)],O[l+8>>2]=le[0],O[l+12>>2]=le[1],le=[m>>>0,(ee=m,+Math.abs(ee)>=1?ee>0?+Math.floor(ee/4294967296)>>>0:~~+Math.ceil((ee-+(~~ee>>>0))/4294967296)>>>0:0)],O[l+16>>2]=le[0],O[l+20>>2]=le[1],0}catch(C){if(typeof p>"u"||C.name!=="ErrnoError")throw C;return C.errno}}var bs=(i,l,u,m)=>{for(var _=0,T=0;T>2],C=P[l+4>>2];l+=8;var K=p.read(i,z,F,C,m);if(K<0)return-1;if(_+=K,K>2]=K,0}catch(te){if(typeof p>"u"||te.name!=="ErrnoError")throw te;return te.errno}}var ys=(i,l,u,m)=>{for(var _=0,T=0;T>2],C=P[l+4>>2];l+=8;var K=p.write(i,z,F,C,m);if(K<0)return-1;_+=K,typeof m<"u"&&(m+=K)}return _};function Uu(i,l,u,m,_,T){var F=hn(m,_);try{if(isNaN(F))return 61;var C=ce.getStreamFromFD(i),K=ys(C,l,u,F);return P[T>>2]=K,0}catch(te){if(typeof p>"u"||te.name!=="ErrnoError")throw te;return te.errno}}function Bu(i,l,u,m){try{var _=ce.getStreamFromFD(i),T=bs(_,l,u);return P[m>>2]=T,0}catch(F){if(typeof p>"u"||F.name!=="ErrnoError")throw F;return F.errno}}function Gu(i,l,u,m,_){var T=hn(l,u);try{if(isNaN(T))return 61;var F=ce.getStreamFromFD(i);return p.llseek(F,T,m),le=[F.position>>>0,(ee=F.position,+Math.abs(ee)>=1?ee>0?+Math.floor(ee/4294967296)>>>0:~~+Math.ceil((ee-+(~~ee>>>0))/4294967296)>>>0:0)],O[_>>2]=le[0],O[_+4>>2]=le[1],F.getdents&&T===0&&m===0&&(F.getdents=null),0}catch(C){if(typeof p>"u"||C.name!=="ErrnoError")throw C;return C.errno}}function ju(i){var u;try{var l=ce.getStreamFromFD(i);return(u=l.stream_ops)!=null&&u.fsync?l.stream_ops.fsync(l):0}catch(m){if(typeof p>"u"||m.name!=="ErrnoError")throw m;return m.errno}}function Hu(i,l,u,m){try{var _=ce.getStreamFromFD(i),T=ys(_,l,u);return P[m>>2]=T,0}catch(F){if(typeof p>"u"||F.name!=="ErrnoError")throw F;return F.errno}}var _s=i=>Ps(i),Wu=i=>{var l=mn(i)+1,u=_s(l);return an(i,u,l),u},Ku=i=>{var l=mn(i)+1,u=nf(l);return u&&an(i,u,l),u},Vu=i=>{for(var l="";;){var u=q[i++];if(!u)return l;l+=String.fromCharCode(u)}},ws=(i,l)=>{A(i<16384),i<128?l.push(i):l.push(i%128|128,i>>7)},$u=i=>{A(!i.includes("j"),"i64 not permitted in function signatures when WASM_BIGINT is disabled");for(var l={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},u={parameters:[],results:i[0]=="v"?[]:[l[i[0]]]},m=1;m{var u=i.slice(0,1),m=i.slice(1),_={i:127,p:127,j:126,f:125,d:124,e:111};l.push(96),ws(m.length,l);for(var T=0;T{if(A(!l.includes("j"),"i64 not permitted in function signatures when WASM_BIGINT is disabled"),typeof WebAssembly.Function=="function")return new WebAssembly.Function($u(l),i);var u=[1];qu(l,u);var m=[0,97,115,109,1,0,0,0,1];ws(u.length,m),m.push(...u),m.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var _=new WebAssembly.Module(new Uint8Array(m)),T=new WebAssembly.Instance(_,{e:{f:i}}),F=T.exports.f;return F},Xu=(i,l)=>{if(Jn)for(var u=i;u(Jn||(Jn=new WeakMap,Xu(0,Ve.length)),Jn.get(i)||0),Es=[],Ju=()=>{if(Es.length)return Es.pop();try{Ve.grow(1)}catch(i){throw i instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":i}return Ve.length-1},Ss=(i,l)=>{Ve.set(i,l),et[i]=Ve.get(i)},Qu=(i,l)=>{A(typeof i<"u");var u=Zu(i);if(u)return u;var m=Ju();try{Ss(m,i)}catch(T){if(!(T instanceof TypeError))throw T;A(typeof l<"u","Missing signature argument to addFunction: "+i);var _=Yu(i,l);Ss(m,_)}return Jn.set(i,m),m};p.createPreloadedFile=Pc,p.staticInit();function ef(){Pe("fetchSettings")}var ks={__call_sighandler:dn,__syscall_chdir:Ic,__syscall_chmod:Cc,__syscall_dup:Oc,__syscall_dup3:Mc,__syscall_faccessat:Dc,__syscall_fchdir:Lc,__syscall_fchmod:Nc,__syscall_fchmodat2:zc,__syscall_fchown32:Uc,__syscall_fchownat:Bc,__syscall_fcntl64:Gc,__syscall_fdatasync:jc,__syscall_fstat64:Hc,__syscall_fstatfs64:Wc,__syscall_ftruncate64:Kc,__syscall_getcwd:Vc,__syscall_getdents64:$c,__syscall_ioctl:qc,__syscall_lstat64:Yc,__syscall_mkdirat:Xc,__syscall_newfstatat:Zc,__syscall_openat:Jc,__syscall_pipe:Qc,__syscall_poll:eu,__syscall_readlinkat:tu,__syscall_renameat:nu,__syscall_stat64:ru,__syscall_statfs64:ds,__syscall_symlinkat:iu,__syscall_unlinkat:ou,__syscall_utimensat:su,_abort_js:au,_emscripten_get_now_is_monotonic:cu,_emscripten_memcpy_js:uu,_emscripten_runtime_keepalive_clear:fu,_emscripten_throw_longjmp:du,_localtime_js:vu,_mmap_js:bu,_msync_js:yu,_munmap_js:_u,_setitimer_js:Su,_tzset_js:ku,emscripten_date_now:Tu,emscripten_err:xu,emscripten_get_heap_max:Au,emscripten_get_now:qi,emscripten_get_now_res:Pu,emscripten_resize_heap:Ru,emscripten_sleep:Iu,environ_get:Mu,environ_sizes_get:Du,exit:gs,fd_close:Lu,fd_fdstat_get:Nu,fd_pread:zu,fd_pwrite:Uu,fd_read:Bu,fd_seek:Gu,fd_sync:ju,fd_write:Hu,invoke_ji:ff,invoke_vi:cf,invoke_vii:uf,invoke_vij:df,proc_exit:ps},Ot=Tt();r._blinkenlib_run_fast=Ye("blinkenlib_run_fast",0),r._blinkenlib_run=Ye("blinkenlib_run",0),r._blinkenlib_starti=Ye("blinkenlib_starti",0),r._blinkenlib_start=Ye("blinkenlib_start",0),r._blinkenlib_stepi=Ye("blinkenlib_stepi",0),r._blinkenlib_continue=Ye("blinkenlib_continue",0),r._blinkenlib_get_clstruct=Ye("blinkenlib_get_clstruct",0),r._blinkenlib_get_argc_string=Ye("blinkenlib_get_argc_string",0),r._blinkenlib_get_argv_string=Ye("blinkenlib_get_argv_string",0),r._blinkenlib_get_progname_string=Ye("blinkenlib_get_progname_string",0),r._blinkenlib_spy_address=Ye("blinkenlib_spy_address",2);var tf=r._main=Ye("__main_argc_argv",2),nf=Ye("malloc",1),rf=Ye("strerror",1),Ts=Ye("fflush",1),of=Ye("emscripten_builtin_memalign",2),sf=Ye("_emscripten_timeout",2),oi=Ye("setThrew",2),xs=()=>(xs=Ot.emscripten_stack_init)(),Xi=()=>(Xi=Ot.emscripten_stack_get_end)(),As=i=>(As=Ot._emscripten_stack_restore)(i),Ps=i=>(Ps=Ot._emscripten_stack_alloc)(i),Zi=()=>(Zi=Ot.emscripten_stack_get_current)(),af=r.dynCall_ji=Ye("dynCall_ji",2),lf=r.dynCall_vij=Ye("dynCall_vij",4);r.dynCall_iiji=Ye("dynCall_iiji",5),r.dynCall_jijj=Ye("dynCall_jijj",6),r.dynCall_vijjj=Ye("dynCall_vijjj",8),r.dynCall_jji=Ye("dynCall_jji",4),r.dynCall_jiji=Ye("dynCall_jiji",5);function cf(i,l){var u=ve();try{Wt(i)(l)}catch(m){if(Fe(u),m!==m+0)throw m;oi(1,0)}}function uf(i,l,u){var m=ve();try{Wt(i)(l,u)}catch(_){if(Fe(m),_!==_+0)throw _;oi(1,0)}}function ff(i,l){var u=ve();try{return af(i,l)}catch(m){if(Fe(u),m!==m+0)throw m;oi(1,0)}}function df(i,l,u,m){var _=ve();try{lf(i,l,u,m)}catch(T){if(Fe(_),T!==T+0)throw T;oi(1,0)}}r.callMain=Fs,r.wasmExports=Ot,r.addFunction=Qu,r.UTF8ToString=ri,r.AsciiToString=Vu,r.stringToNewUTF8=Ku,r.FS=p;var mf=["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromU64","convertI32PairToI53","convertU32PairToI53","getTempRet0","setTempRet0","arraySum","addDays","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","emscriptenLog","readEmAsmArgs","jstoi_q","listenOnce","autoResumeAudioContext","dynCallLegacy","getDynCaller","dynCall","runtimeKeepalivePush","runtimeKeepalivePop","asmjsMangle","HandleAllocator","getNativeTypeSize","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","getCFunc","ccall","cwrap","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","intArrayToString","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","writeArrayToMemory","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","jsStackTrace","getCallstack","convertPCtoSourceLocation","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","createDyncallWrapper","safeSetTimeout","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","getPromise","makePromise","idsToPromises","makePromiseCallback","ExceptionInfo","findMatchingCatch","Browser_asyncPrepareDataCounter","setMainLoop","getSocketFromFD","getSocketAddress","FS_unlink","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","toTypedArrayIndex","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","registerWebGlEventCallback","runAndAbortIfError","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory","setErrNo","demangle","stackTrace"];mf.forEach(Gi);var pf=["run","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","out","err","abort","wasmMemory","writeStackCookie","checkStackCookie","readI53FromI64","convertI32PairToI53Checked","stackSave","stackRestore","stackAlloc","ptrToString","zeroMemory","exitJS","getHeapMax","growMemory","ENV","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","isLeapYear","ydayFromDate","ERRNO_CODES","strError","DNS","Protocols","Sockets","initRandomFill","randomFill","timers","warnOnce","readEmAsmArgsArray","jstoi_s","getExecutableName","handleException","keepRuntimeAlive","callUserCallback","maybeExit","asyncLoad","alignMemory","mmapAlloc","wasmTable","noExitRuntime","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","freeTableIndexes","functionsInTableMap","getEmptyTableSlot","updateTableMap","getFunctionAddress","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","intArrayFromString","stringToAscii","UTF16Decoder","stringToUTF8OnStack","JSEvents","specialHTMLTargets","findCanvasEventTarget","currentFullscreenStrategy","restoreOldWindowedStyle","UNWIND_CACHE","ExitStatus","getEnvStrings","doReadv","doWritev","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","Browser","getPreloadedImageData__data","wget","SYSCALLS","preloadPlugins","FS_createPreloadedFile","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar_buffer","FS_stdin_getChar","FS_createPath","FS_createDevice","FS_readFile","FS_createDataFile","FS_createLazyFile","MEMFS","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","AL","GLUT","EGL","GLEW","IDBStore","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack","print","printErr"];pf.forEach(ei);var si;at=function i(){si||Rs(),si||(at=i)};function Fs(i=[]){A(Ae==0,'cannot call main when async dependencies remain! (listen on Module["onRuntimeInitialized"])'),A(Y.length==0,"cannot call main when preRun functions remain to be called");var l=tf;i.unshift(w);var u=i.length,m=_s((u+1)*4),_=m;i.forEach(F=>{P[_>>2]=Wu(F),_+=4}),P[_>>2]=0;try{var T=l(u,m);return hs(T,!0),T}catch(F){return Ki(F)}}function hf(){xs(),U()}function Rs(i=g){if(Ae>0||(hf(),ne(),Ae>0))return;function l(){var u;si||(si=!0,r.calledRun=!0,!G&&(re(),fe(),o(r),(u=r.onRuntimeInitialized)==null||u.call(r),Is&&Fs(i),ye()))}r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),l()},1)):l(),Z()}function gf(){var i=x,l=S,u=!1;x=S=m=>{u=!0};try{Ts(0),["stdout","stderr"].forEach(function(m){var K;var _=p.analyzePath("/dev/"+m);if(_){var T=_.object,F=T.rdev,C=pn.ttys[F];(K=C==null?void 0:C.output)!=null&&K.length&&(u=!0)}})}catch{}x=i,S=l,u&&Me("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the Emscripten FAQ), or make sure to emit a newline when you printf etc.")}if(r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();var Is=!0;r.noInitialRun&&(Is=!1),Rs(),n=a;for(const i of Object.keys(r))i in e||Object.defineProperty(e,i,{configurable:!0,get(){rt(`Access to module property ('${i}') is no longer possible via the module constructor argument; Instead, use the result of the module constructor.`)}});return n}})();class dd{constructor(e,n){this.version=1,this.sizeof_key=4,this.keys={version:{index:0,pointer:!1},codemem:{index:1,pointer:!0},stackmem:{index:2,pointer:!0},readaddr:{index:3,pointer:!0},readsize:{index:4,pointer:!1},writeaddr:{index:5,pointer:!0},writesize:{index:6,pointer:!1},flags:{index:7,pointer:!1},cs__base:{index:8,pointer:!0},rip:{index:9,pointer:!0},rsp:{index:10,pointer:!0},rbp:{index:11,pointer:!0},rsi:{index:12,pointer:!0},rdi:{index:13,pointer:!0},r8:{index:14,pointer:!0},r9:{index:15,pointer:!0},r10:{index:16,pointer:!0},r11:{index:17,pointer:!0},r12:{index:18,pointer:!0},r13:{index:19,pointer:!0},r14:{index:20,pointer:!0},r15:{index:21,pointer:!0},rax:{index:22,pointer:!0},rbx:{index:23,pointer:!0},rcx:{index:24,pointer:!0},rdx:{index:25,pointer:!0},dis__max_lines:{index:26,pointer:!1},dis__max_line_len:{index:27,pointer:!1},dis__current_line:{index:28,pointer:!1},dis__buffer:{index:29,pointer:!0}},this.memory=e,this.struct_pointer=n,this.growMemory();let r=this.version,o=this.getPtr("version");if(r!=o)throw new Error("shared struct version mismatch")}growMemory(){let e=Object.keys(this.keys).length*this.sizeof_key;this.memView=new DataView(this.memory.buffer),this.structView=new DataView(this.memory.buffer,this.struct_pointer,e)}stringReadBytes(e,n){let r=this.getPtr(e),o="";for(let s=0;s=0;o--){let s=this.memView.getUint8(n+o);(r||s||o==0)&&(r+=s.toString(16).padStart(2,"0"))}return"0x"+r}readU64(e){let n=this.getPtr(e);return this.memView.getBigUint64(n,!0)}getPtr(e){this.structView.buffer.byteLength||(console.log("blink: memory grew"),this.growMemory());let n=this.keys[e].index*this.sizeof_key;return this.structView.getUint32(n,!0)}writeStringToHeap(e,n,r){if(this.structView.buffer.byteLength||(console.log("blink: memory grew"),this.growMemory()),e==0){console.log("blink: write to null ptr");return}let o=Math.min(n.length,r-1);for(var s=0;s=32&&a<=126?this.memView.setUint8(e+s,a):this.memView.setUint8(e+s,32)}this.memView.setUint8(e+o,0)}}let md={SIGHUP:1,SIGINT:2,SIGQUIT:3,SIGILL:4,SIGTRAP:5,SIGABRT:6,SIGBUS:7,SIGFPE:8,SIGKILL:9,SIGUSR1:10,SIGSEGV:11,SIGUSR2:12,SIGPIPE:13,SIGALRM:14,SIGTERM:15,SIGSTKFLT:16,SIGCHLD:17,SIGCONT:18,SIGSTOP:19,SIGTSTP:20,SIGTTIN:21,SIGTTOU:22,SIGURG:23,SIGXCPU:24,SIGXFSZ:25,SIGVTALRM:26,SIGPROF:27,SIGWINCH:28,SIGIO:29,SIGPWR:30,SIGSYS:31},ro={1:{name:"SIGHUP",description:"Hang up controlling terminal or process."},2:{name:"SIGINT",description:"Interrupt from keyboard, Control-C."},3:{name:"SIGQUIT",description:"Quit from keyboard, Control-\\."},4:{name:"SIGILL",description:"Illegal instruction."},5:{name:"SIGTRAP",description:"Breakpoint for debugging."},6:{name:"SIGABRT",description:"Abnormal termination."},7:{name:"SIGBUS",description:"Bus error."},8:{name:"SIGFPE",description:"Floating-point exception."},9:{name:"SIGKILL",description:"Forced-process termination."},10:{name:"SIGUSR1",description:"Available to processes."},11:{name:"SIGSEGV",description:"Invalid memory reference."},12:{name:"SIGUSR2",description:"Available to processes."},13:{name:"SIGPIPE",description:"Write to pipe with no readers."},14:{name:"SIGALRM",description:"Real-timer clock."},15:{name:"SIGTERM",description:"Process termination."},16:{name:"SIGSTKFLT",description:"Coprocessor stack error."},17:{name:"SIGCHLD",description:"Child process stopped or terminated or got a signal if traced."},18:{name:"SIGCONT",description:"Resume execution, if stopped."},19:{name:"SIGSTOP",description:"Stop process execution, Ctrl-Z."},20:{name:"SIGTSTP",description:"Stop process issued from tty."},21:{name:"SIGTTIN",description:"Background process requires input."},22:{name:"SIGTTOU",description:"Background process requires output."},23:{name:"SIGURG",description:"Urgent condition on socket."},24:{name:"SIGXCPU",description:"CPU time limit exceeded."},25:{name:"SIGXFSZ",description:"File size limit exceeded."},26:{name:"SIGVTALRM",description:"Virtual timer clock."},27:{name:"SIGPROF",description:"Profile timer clock."},28:{name:"SIGWINCH",description:"Window resizing."},29:{name:"SIGIO",description:"I/O now possible."},30:{name:"SIGPWR",description:"Power supply failure."},31:{name:"SIGSYS",description:"Bad system call."}};var zn,Un,Bn,Gn,jn,_e,pl,bo,yt,hl,gl,ar,yo,vl,bl,yl,_l,wl;class pd{constructor(e,n,r,o,s,a){Fn(this,_e);Fn(this,zn);Fn(this,Un);Fn(this,Bn);Fn(this,Gn);Fn(this,jn);this.states={NOT_READY:"NOT_READY",READY:"READY",ASSEMBLING:"ASSEMBLING",LINKING:"LINKING",PROGRAM_LOADED:"PROGRAM_LOADED",PROGRAM_RUNNING:"PROGRAM_RUNNING",PROGRAM_STOPPED:"PROGRAM_STOPPED"},this.state=this.states.NOT_READY,this.max_argc_len=200,this.max_argv_len=200,this.max_progname_len=200,this.argc_ptr=0,this.argv_ptr=0,this.progname_ptr=0,this.default_argc="/program",this.default_argv="",this.assembler_logs="",this.assembler_errors=[],this.setCallbacks(n,r,o,s,a),De(this,_e,pl).call(this,e)}setCallbacks(e,n,r,o,s){e&&qt(this,zn,e),n&&qt(this,Un,n),r&&qt(this,Bn,r),o&&qt(this,Gn,o),s&&qt(this,jn,s),$t(this,zn)||qt(this,zn,De(this,_e,bl)),$t(this,Un)||qt(this,Un,De(this,_e,yl)),$t(this,Bn)||qt(this,Bn,De(this,_e,_l)),$t(this,Gn)||qt(this,Gn,De(this,_e,vl)),$t(this,jn)||qt(this,jn,De(this,_e,wl))}async setMode(e){this.mode=e,De(this,_e,yt).call(this,this.states.NOT_READY),this.assembler_logs="",this.assembler_errors=[];let n=await De(this,_e,yo).call(this,e.binaries.assembler.fileurl),r=new Uint8Array(n),o=this.Module.FS,s=o.open("/assembler","w+");if(o.write(s,r,0,r.length,0),o.close(s),o.chmod("/assembler",511),e.binaries.linker){let a=await De(this,_e,yo).call(this,this.mode.binaries.linker.fileurl),c=new Uint8Array(a),f=this.Module.FS,h=f.open("/linker","w+");f.write(h,c,0,c.length,0),f.close(h),f.chmod("/linker",511)}De(this,_e,yt).call(this,this.states.READY)}loadElf(e){if(this.state==this.states.NOT_READY)return!1;let n=new Uint8Array(e),r=this.Module.FS,o=r.open("/program","w+");r.write(o,n,0,n.length,0),r.close(o),r.chmod("/program",511),this.starti()}loadASM(e){if(this.state==this.states.NOT_READY)return!1;this.assembler_logs="",this.assembler_errors=[],De(this,_e,yt).call(this,this.states.ASSEMBLING),this.Module.FS.writeFile("/assembly.s",e),requestAnimationFrame(()=>{De(this,_e,ar).call(this,"/assembler",this.mode.binaries.assembler.commands,""),this.Module._blinkenlib_run_fast()})}loadASM_assembler_exit_callback(e){if(e!=0){console.log("blink: assembler failed"),this.mode.diagnosticsParser&&(console.log("blink: assembler diagnostics parsed"),this.assembler_errors=this.mode.diagnosticsParser(this.assembler_logs),console.log(this.assembler_logs),console.log(this.assembler_errors)),De(this,_e,yt).call(this,this.states.READY);return}this.mode.binaries.linker?(De(this,_e,yt).call(this,this.states.LINKING),requestAnimationFrame(()=>{De(this,_e,ar).call(this,"/linker",this.mode.binaries.linker.commands,""),this.Module._blinkenlib_run_fast()})):(this.Module.FS.chmod("/program",511),De(this,_e,yt).call(this,this.states.PROGRAM_LOADED),this.starti())}loadASM_linker_exit_callback(e){if(e!=0){console.log("linker failed"),De(this,_e,yt).call(this,this.states.READY);return}this.Module.FS.chmod("/program",511),De(this,_e,yt).call(this,this.states.PROGRAM_LOADED),this.starti()}run(){try{De(this,_e,yt).call(this,this.states.PROGRAM_RUNNING),De(this,_e,ar).call(this,"/program",this.default_argc,this.default_argv),this.Module._blinkenlib_run()}catch{this.stopReason={loadFail:!0,exitCode:0,details:"invalid ELF"},De(this,_e,yt).call(this,this.states.PROGRAM_STOPPED)}}start(){try{De(this,_e,ar).call(this,"/program",this.default_argc,this.default_argv),this.Module._blinkenlib_start(),De(this,_e,yt).call(this,this.states.PROGRAM_RUNNING)}catch{this.stopReason={loadFail:!0,exitCode:0,details:"invalid ELF"},De(this,_e,yt).call(this,this.states.PROGRAM_STOPPED)}}starti(){try{De(this,_e,ar).call(this,"/program",this.default_argc,this.default_argv),this.Module._blinkenlib_starti(),De(this,_e,yt).call(this,this.states.PROGRAM_RUNNING)}catch{this.stopReason={loadFail:!0,exitCode:0,details:"invalid ELF"},De(this,_e,yt).call(this,this.states.PROGRAM_STOPPED)}}stepi(){this.Module._blinkenlib_stepi()}continue(){this.Module._blinkenlib_continue()}setready(){De(this,_e,yt).call(this,this.states.READY)}}zn=new WeakMap,Un=new WeakMap,Bn=new WeakMap,Gn=new WeakMap,jn=new WeakMap,_e=new WeakSet,pl=async function(e){this.mode=e,this.Module=await fd({noInitialRun:!0,preRun:h=>{h.FS.init($t(this,zn),d=>{De(this,_e,bo).call(this,d),$t(this,Un).call(this,d)},d=>{De(this,_e,bo).call(this,d),$t(this,Bn).call(this,d)}),h.FS.createPreloadedFile("/","assembler",e.binaries.assembler.fileurl,!0,!0),e.binaries.linker&&h.FS.createPreloadedFile("/","linker",e.binaries.linker.fileurl,!0,!0)}});let n=De(this,_e,hl).bind(this),o=this.Module.addFunction(n,"vii"),s=De(this,_e,gl).bind(this),c=this.Module.addFunction(s,"vi");this.Module.callMain([o.toString(),c.toString()]),this.memory=this.Module.wasmExports.memory;let f=this.Module._blinkenlib_get_clstruct();this.m=new dd(this.memory,f),this.argc_ptr=this.Module._blinkenlib_get_argc_string(),this.argv_ptr=this.Module._blinkenlib_get_argv_string(),this.progname_ptr=this.Module._blinkenlib_get_progname_string(),De(this,_e,yt).call(this,this.states.READY)},bo=function(e){this.state==this.states.ASSEMBLING&&(this.assembler_logs+=String.fromCharCode(e))},yt=function(e){this.state!=e&&(console.log("blink: "+e),$t(this,jn).call(this,e,this.state),this.state=e)},hl=function(e,n){if(e!=md.SIGTRAP){let r=128+e,o=`Program terminated with Exit(${r}) Due to signal ${e}`;if(ro.hasOwnProperty(e)){let s=ro[e].name,a=ro[e].description;o=`Program terminated with Exit(${r}) due to signal ${s}: ${a}`}this.stopReason={loadFail:!1,exitCode:r,details:o},De(this,_e,yt).call(this,this.states.PROGRAM_STOPPED)}$t(this,Gn).call(this,e,n)},gl=function(e){if(this.state==this.states.ASSEMBLING){this.loadASM_assembler_exit_callback(e);return}if(this.state==this.states.LINKING){this.loadASM_linker_exit_callback(e);return}this.stopReason={loadFail:!1,exitCode:e,details:`program terminated with Exit(${e})`},De(this,_e,yt).call(this,this.states.PROGRAM_STOPPED),console.log("exit callback called")},ar=function(e,n,r){this.m.writeStringToHeap(this.progname_ptr,e,this.max_progname_len),this.m.writeStringToHeap(this.argc_ptr,n,this.max_argc_len),this.m.writeStringToHeap(this.argv_ptr,r,this.max_argv_len)},yo=async function(e){try{const n=await fetch(e);if(!n.ok)throw new Error(`HTTP error! Status: ${n.status}`);return await n.arrayBuffer()}catch(n){console.error("Failed to fetch binary file:",n)}},vl=function(e,n){console.log(`received signal: ${e} code: ${n}`)},bl=function(){return console.log("stdin requested, EOF returned"),null},yl=function(e){console.log(`stdout: ${String.fromCharCode(e)}`)},_l=function(e){console.log(`stderr: ${String.fromCharCode(e)}`)},wl=function(e,n){console.log(`state change: ${n} -> ${e}`)};const hd="/assets/fasm.1.73.32-Cxcbx2ne.elf",gd="/assets/gnu-as.2.43.50-B1tG8GyF.elf",vd="/assets/gnu-ld.2.43.50-SsngYt5K.elf",Nr={GNU_trunk:{id:"GNU_trunk",display_name:"GNU as",description:"GNU as + GNU ld, version 2.43.50. Compiled as a static MUSL binary",diagnosticsParser:bd,binaries:{assembler:{fileurl:gd,commands:"/assembler /assembly.s -o /program.o"},linker:{fileurl:vd,commands:"/linker /program.o -o /program"}}},FASM_trunk:{id:"FASM_trunk",display_name:"Fasm",description:"Flat assembler version 1.73.32",diagnosticsParser:yd,binaries:{assembler:{fileurl:hd,commands:"/assembler /assembly.s /program"}}}};function bd(t){const e=[],n=t.split(` +`),r=/\/assembly\.s:(\d+): (Error: .+)/;for(const o of n){const s=o.match(r);s&&e.push({line:parseInt(s[1],10),error:s[2]})}return e}function yd(t){const e=/\/assembly\.s \[(\d+)\]:/,n=/error: .+/,r=[],o=t.split(` +`);let s=null,a=null;for(const c of o){const f=c.match(e),h=c.match(n);f&&(s=parseInt(f[1])),h&&(a=h[0],s!==null&&a!==null&&(r.push({line:s,error:a}),s=null,a=null))}return r}var kt=Uint8Array,Nt=Uint16Array,qo=Int32Array,Mi=new kt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Di=new kt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),_o=new kt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),El=function(t,e){for(var n=new Nt(31),r=0;r<31;++r)n[r]=e+=1<>1|(st&21845)<<1;gn=(gn&52428)>>2|(gn&13107)<<2,gn=(gn&61680)>>4|(gn&3855)<<4,Eo[st]=((gn&65280)>>8|(gn&255)<<8)>>1}var tn=function(t,e,n){for(var r=t.length,o=0,s=new Nt(e);o>f]=h}else for(c=new Nt(r),o=0;o>15-t[o]);return c},Sn=new kt(288);for(var st=0;st<144;++st)Sn[st]=8;for(var st=144;st<256;++st)Sn[st]=9;for(var st=256;st<280;++st)Sn[st]=7;for(var st=280;st<288;++st)Sn[st]=8;var Wr=new kt(32);for(var st=0;st<32;++st)Wr[st]=5;var wd=tn(Sn,9,0),Ed=tn(Sn,9,1),Sd=tn(Wr,5,0),kd=tn(Wr,5,1),io=function(t){for(var e=t[0],n=1;ne&&(e=t[n]);return e},Yt=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(e&7)&n},oo=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},Yo=function(t){return(t+7)/8|0},xl=function(t,e,n){return(n==null||n>t.length)&&(n=t.length),new kt(t.subarray(e,n))},Td=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Xt=function(t,e,n){var r=new Error(e||Td[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,Xt),!n)throw r;return r},xd=function(t,e,n,r){var o=t.length,s=0;if(!o||e.f&&!e.l)return n||new kt(0);var a=!n,c=a||e.i!=2,f=e.i;a&&(n=new kt(o*3));var h=function(at){var Je=n.length;if(at>Je){var wt=new kt(Math.max(Je*2,at));wt.set(n),n=wt}},d=e.f||0,g=e.p||0,w=e.b||0,y=e.l,k=e.d,v=e.m,b=e.n,E=o*8;do{if(!y){d=Yt(t,g,1);var x=Yt(t,g+1,3);if(g+=3,x)if(x==1)y=Ed,k=kd,v=9,b=5;else if(x==2){var G=Yt(t,g,31)+257,N=Yt(t,g+10,15)+4,A=G+Yt(t,g+5,31)+1;g+=14;for(var z=new kt(A),q=new kt(19),L=0;L>4;if(S<16)z[L++]=S;else{var Z=0,Y=0;for(S==16?(Y=3+Yt(t,g,3),g+=2,Z=z[L-1]):S==17?(Y=3+Yt(t,g,7),g+=3):S==18&&(Y=11+Yt(t,g,127),g+=7);Y--;)z[L++]=Z}}var V=z.subarray(0,G),I=z.subarray(G);v=io(V),b=io(I),y=tn(V,v,1),k=tn(I,b,1)}else Xt(1);else{var S=Yo(g)+4,R=t[S-4]|t[S-3]<<8,M=S+R;if(M>o){f&&Xt(0);break}c&&h(w+R),n.set(t.subarray(S,M),w),e.b=w+=R,e.p=g=M*8,e.f=d;continue}if(g>E){f&&Xt(0);break}}c&&h(w+131072);for(var H=(1<>4;if(g+=Z&15,g>E){f&&Xt(0);break}if(Z||Xt(2),re<256)n[w++]=re;else if(re==256){ne=g,y=null;break}else{var fe=re-254;if(re>264){var L=re-257,ye=Mi[L];fe=Yt(t,g,(1<>4;Oe||Xt(3),g+=Oe&15;var I=_d[He];if(He>3){var ye=Di[He];I+=oo(t,g)&(1<E){f&&Xt(0);break}c&&h(w+131072);var qe=w+fe;if(w>8},Fr=function(t,e,n){n<<=e&7;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8,t[r+2]|=n>>16},so=function(t,e){for(var n=[],r=0;rw&&(w=s[r].s);var y=new Nt(w+1),k=So(n[d-1],y,0);if(k>e){var r=0,v=0,b=k-e,E=1<e)v+=E-(1<>=b;v>0;){var S=s[r].s;y[S]=0&&v;--r){var R=s[r].s;y[R]==e&&(--y[R],++v)}k=e}return{t:new kt(y),l:k}},So=function(t,e,n){return t.s==-1?Math.max(So(t.l,e,n+1),So(t.r,e,n+1)):e[t.s]=n},js=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Nt(++e),r=0,o=t[0],s=1,a=function(f){n[r++]=f},c=1;c<=e;++c)if(t[c]==o&&c!=e)++s;else{if(!o&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(o),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(o);s=1,o=t[c]}return{c:n.subarray(0,r),n:e}},Rr=function(t,e){for(var n=0,r=0;r>8,t[o+2]=t[o]^255,t[o+3]=t[o+1]^255;for(var s=0;s4&&!q[_o[O-1]];--O);var P=h+5<<3,D=Rr(o,Sn)+Rr(s,Wr)+a,U=Rr(o,w)+Rr(s,v)+a+14+3*O+Rr(N,q)+2*N[16]+3*N[17]+7*N[18];if(f>=0&&P<=D&&P<=U)return Al(e,d,t.subarray(f,f+h));var Z,Y,V,I;if(ln(e,d,1+(U15&&(ln(e,d,re[A]>>5&127),d+=re[A]>>12)}}else Z=wd,Y=Sn,V=Sd,I=Wr;for(var A=0;A255){var fe=ye>>18&31;Fr(e,d,Z[fe+257]),d+=Y[fe+257],fe>7&&(ln(e,d,ye>>23&31),d+=Mi[fe]);var Oe=ye&31;Fr(e,d,V[Oe]),d+=I[Oe],Oe>3&&(Fr(e,d,ye>>5&8191),d+=Di[Oe])}else Fr(e,d,Z[ye]),d+=Y[ye]}return Fr(e,d,Z[256]),d+Y[256]},Ad=new qo([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Pl=new kt(0),Pd=function(t,e,n,r,o,s){var a=s.z||t.length,c=new kt(r+a+5*(1+Math.ceil(a/7e3))+o),f=c.subarray(r,c.length-o),h=s.l,d=(s.r||0)&7;if(e){d&&(f[0]=s.r>>3);for(var g=Ad[e-1],w=g>>13,y=g&8191,k=(1<7e3||q>24576)&&(Z>423||!h)){d=Hs(t,f,0,R,M,G,A,q,O,z-O,d),q=N=A=0,O=z;for(var Y=0;Y<286;++Y)M[Y]=0;for(var Y=0;Y<30;++Y)G[Y]=0}var V=2,I=0,H=y,B=D-U&32767;if(Z>2&&P==S(z-B))for(var ne=Math.min(w,Z)-1,re=Math.min(32767,z),fe=Math.min(258,Z);B<=re&&--H&&D!=U;){if(t[z+V]==t[z+V-B]){for(var ye=0;yeV){if(V=ye,I=B,ye>ne)break;for(var Oe=Math.min(B,ye-2),He=0,Y=0;YHe&&(He=Ze,U=qe)}}}D=U,U=v[D],B+=D-U&32767}if(I){R[q++]=268435456|wo[V]<<18|Gs[I];var at=wo[V]&31,Je=Gs[I]&31;A+=Mi[at]+Di[Je],++M[257+at],++G[Je],L=z+V,++N}else R[q++]=t[z],++M[t[z]]}}for(z=Math.max(z,L);z=a&&(f[d/8|0]=h,wt=a),d=Al(f,d+1,t.subarray(z,wt))}s.i=a}return xl(c,0,r+Yo(d)+o)},Fd=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(n&1&&-306674912)^n>>>1;t[e]=n}return t}(),Rd=function(){var t=-1;return{p:function(e){for(var n=t,r=0;r>>8;t=n},d:function(){return~t}}},Id=function(t,e,n,r,o){if(!o&&(o={l:1},e.dictionary)){var s=e.dictionary.subarray(-32768),a=new kt(s.length+t.length);a.set(s),a.set(t,s.length),t=a,o.w=s.length}return Pd(t,e.level==null?6:e.level,e.mem==null?o.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,n,r,o)},ko=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},Cd=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:e.level==9?2:0,t[9]=3,e.mtime!=0&&ko(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var r=0;r<=n.length;++r)t[r+10]=n.charCodeAt(r)}},Od=function(t){(t[0]!=31||t[1]!=139||t[2]!=8)&&Xt(6,"invalid gzip data");var e=t[3],n=10;e&4&&(n+=(t[10]|t[11]<<8)+2);for(var r=(e>>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(e&2)},Md=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},Dd=function(t){return 10+(t.filename?t.filename.length+1:0)};function Ld(t,e){e||(e={});var n=Rd(),r=t.length;n.p(t);var o=Id(t,e,Dd(e),8),s=o.length;return Cd(o,e),ko(o,s-8,n.d()),ko(o,s-4,r),o}function Nd(t,e){var n=Od(t);return n+8>t.length&&Xt(6,"invalid gzip data"),xd(t.subarray(n,-8),{i:2},new kt(Md(t)),e)}var zd=typeof TextDecoder<"u"&&new TextDecoder,Ud=0;try{zd.decode(Pl,{stream:!0}),Ud=1}catch{}function Bd(t){const e=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\./g,"="),n=atob(e);return Uint8Array.from(n,r=>r.codePointAt(0))}function Gd(t){const e=Array.from(t,r=>String.fromCodePoint(r)).join("");return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,".")}function jd(t){const n=new TextEncoder().encode(t),r=Ld(n,{filename:"",mtime:"9/1/16 2:00 PM"});return Gd(r)}function Hd(t){const e=Bd(t),n=Nd(e);return new TextDecoder().decode(n)}const Wd=1,Fl={1:function(t){let e=null,n=t.data;return typeof n=="object"&&n!==null&&typeof n.editorContent=="string"&&typeof n.mode=="string"&&Nr.hasOwnProperty(n.mode)&&(e={editorContent:n.editorContent,mode:n.mode}),e}};function Kd(t){return typeof t=="object"&&t!==null&&typeof t.version=="number"&&Fl.hasOwnProperty(t.version)&&typeof t.magic=="string"&&t.magic=="it.halb.x64"&&typeof t.data=="object"&&t.data!=null}function Rl(t){const n=JSON.stringify({magic:"it.halb.x64",version:Wd,data:t});return jd(n)}function Il(t){if(!t)return null;try{const e=Hd(t),n=JSON.parse(e);return Kd(n)?Fl[n.version](n):(console.error("Deserialized object does not match SerializedAppState shape"),null)}catch(e){return console.error("Failed to deserialize blob:",e),null}}function Cl(t){return{editorContent:t.editorContent,mode:t.mode}}function Ws(t){try{localStorage.setItem("appstate",Rl(t))}catch(e){console.error(e)}}function Vd(){let t=localStorage.getItem("appstate");return t==null?null:Il(t)}function $d(t,e=!1){let n=Rl(t);return e?`${window.location.origin+window.location.pathname}?appstate=${n}`:n}function qd(){const e=new URLSearchParams(document.location.search).get("appstate");return Il(e)}let Yd=`;#--------------------- +;# GNU Assembler file +;# Syscall Hello World +;#--------------------- +.intel_syntax noprefix +.global _start +.text +_start: + + ;# sys_write + mov rax, 1 + mov rdi, 1 + lea rsi, hello_string + mov rdx, 14 + syscall + + ;# sys_exit + mov rax, 60 + xor rdi, rdi + syscall + +.data +hello_string: + .asciz "Hello, world!\\n" +`,Xd=`;--------------------- +; Flat Assembler file +; Syscall Hello World +;--------------------- +format ELF64 executable 3 +segment readable executable +entry $ + + ; sys_write + mov edx,msg_size + lea rsi,[msg] + mov edi,1 + mov eax,1 + syscall + + ; sys_exit + xor edi,edi + mov eax,60 + syscall + +segment readable writeable +msg db 'Hello 64-bit world!',0xA +msg_size = $-msg +`,Zd=`;#--------------------- +;# GNU Assembler file +;# Function calls demo +;#--------------------- +.intel_syntax noprefix +.global _start +.text + +_start: + ;# Set up arguments for print function + mov rdi, 1 + lea rsi, hello_string + mov rdx, 14 + call print + + ;# Set up arguments for exit function + xor rdi, rdi + call exit + +;# Print function +;# Arguments: +;# rdi - File descriptor (1 for stdout) +;# rsi - Pointer to the string to print +;# rdx - Length of the string +;# Return: +;# None +print: + push rbp + mov rbp, rsp + mov rax, 1 + syscall + pop rbp + ret + +;# Exit function +;# Arguments: +;# rdi - Exit code +;# Return: +;# None +exit: + push rbp + mov rbp, rsp + mov rax, 60 + syscall + pop rbp + ret + +.data +hello_string: + .asciz "Hello, world!\\n" + +`,Jd=`;--------------------- +; Flat Assembler file +; Function calls demo +;--------------------- +format ELF64 executable 3 +segment readable executable +entry $ + +_start: + ; Set up arguments for print function + mov rdi, 1 + lea rsi, [msg] + mov rdx, msg_size + call print + + ; Set up arguments for exit function + xor rdi, rdi + call exit + +; Print function +; Arguments: +; rdi - File descriptor (1 for stdout) +; rsi - Pointer to the string to print +; rdx - Length of the string +; Return: +; None +print: + push rbp + mov rbp, rsp + mov rax, 1 + syscall + pop rbp + ret + +; Exit function +; Arguments: +; rdi - Exit code +; Return: +; None +exit: + push rbp + mov rbp, rsp + mov rax, 60 + syscall + pop rbp + ret + + +segment readable writeable +msg db 'Hello 64-bit world!',0xA +msg_size = $-msg + +`,To={syscall_GNU:{id:"syscall_GNU",display_name:"Syscall (GNU as)",description:"A simple program that prints Hello World using raw syscalls, then quits. written for the Gnu Assembler, using the Intel syntax flavour",mode:"GNU_trunk",editorContent:Yd},syscall_FASM:{id:"syscall_FASM",display_name:"Syscall (Fasm)",description:"A simple program that prints Hello World using raw syscalls, then quits. written for the Flat Assembler",mode:"FASM_trunk",editorContent:Xd},functions_GNU:{id:"functions_GNU",display_name:"Functions (GNU as)",description:"Hello world using function calls. written for the Gnu Assembler, using the Intel syntax flavour",mode:"GNU_trunk",editorContent:Zd},functions_FASM:{id:"functions_FASM",display_name:"Functions (Fasm)",description:"Hello world using function calls. written for the Flat Assembler",mode:"FASM_trunk",editorContent:Jd}},Qd="syscall_FASM";function Pn(t,e){return Ct(t,n=>n[e])}function em(){let t=qd();if(t||(t=Vd()),!t){let k=To[Qd];t=Cl(k)}window.history.replaceState(null,"",window.location.pathname);const e=$e({term_buffer:"",state:"",signal:"",manual_render:0,mode:t.mode,uploadedElf:"",editorContent_write:t.editorContent,editorContent_read:t.editorContent}),{subscribe:n,update:r}=e;let o;n(()=>{clearTimeout(o),o=setTimeout(s,5*1e3)});function s(){console.log("store: autosave"),Ws(y())}let a=()=>null,c=k=>{r(v=>{let b=String.fromCharCode(k);return v.term_buffer+=b,v})},f=k=>{r(v=>{let b=String.fromCharCode(k);return v.term_buffer+=b,v})},h=(k,v)=>{r(b=>({...b,manual_render:b.manual_render+1}))},d=(k,v)=>{r(b=>({...b,state:k,manual_render:b.manual_render+1}))};const g=new pd(Nr[t.mode],a,c,f,h,d);r(k=>({...k,state:g.state}));function w(k){r(v=>({...v,manual_render:v.manual_render+1,mode:k.mode,editorContent_read:k.editorContent,editorContent_write:k.editorContent})),g.setMode(Nr[k.mode]),Ws(k)}function y(){let k=we(e);return{editorContent:k.editorContent_read,mode:k.mode}}return{subscribe:n,setAppState:w,getAppState:y,getInstance(){return g},notifyEditorContent(k){r(v=>({...v,editorContent_read:k}))},setEditorContent(k){r(v=>({...v,editorContent_write:k}))},setUploadedElfName(k){r(v=>({...v,uploadedElf:k}))},setMode(k){r(v=>({...v,mode:k})),g.setMode(Nr[k])}}}const nt=em(),Xo=Pn(nt,"manual_render"),tm=Pn(nt,"term_buffer"),Li=Pn(nt,"state");Pn(nt,"signal");const nm=Pn(nt,"mode");Pn(nt,"uploadedElf");const rm=Pn(nt,"editorContent_write");Pn(nt,"editorContent_read");function Ks(t,e,n){const r=t.slice();return r[13]=e[n],r[15]=n,r}function Vs(t,e,n){const r=t.slice();return r[13]=e[n],r[15]=n,r}function $s(t,e,n){const r=t.slice();return r[17]=e[n],r[15]=n,r}function qs(t){let e,n=(BigInt(t[15])+t[4]).toString(16).padStart(16,"0")+"",r;return{c(){e=X("div"),r=Xe(n),j(e,"class","svelte-1yg3joy")},m(o,s){Q(o,e,s),W(e,r)},p(o,s){s&16&&n!==(n=(BigInt(o[15])+o[4]).toString(16).padStart(16,"0")+"")&&En(r,n)},d(o){o&&J(e)}}}function Ys(t){let e,n=("0"+t[13].toString(16)).slice(-2)+"",r,o;return{c(){e=X("span"),r=Xe(n),j(e,"data-range",o=ta(t[13])),j(e,"data-index",t[15]),j(e,"data-color",t[7](t[15])),j(e,"data-rounded",t[8](t[15])),j(e,"class","svelte-1yg3joy"),ae(e,"highlight",t[15]==t[6])},m(s,a){Q(s,e,a),W(e,r)},p(s,a){a&32&&n!==(n=("0"+s[13].toString(16)).slice(-2)+"")&&En(r,n),a&32&&o!==(o=ta(s[13]))&&j(e,"data-range",o),a&64&&ae(e,"highlight",s[15]==s[6])},d(s){s&&J(e)}}}function Xs(t){let e,n=Ut(t[5]),r=[];for(let o=0;o=32&&t<=126?String.fromCharCode(t):"."}function ta(t){return t==0?"00":t==255?"ff":t>128?"large":"small"}function om(t,e,n){let r;Ne(t,Xo,b=>n(10,r=b));let{centered:o=!1}=e,{bytesPerRow:s=16}=e,{colorRegions:a={}}=e,{showAscii:c=!0}=e,f=nt.getInstance(),h=0n,d=Array(ea).fill(0),g=-1;function w(){if(!(!f.m||!(f.state==f.states.PROGRAM_RUNNING||f.state==f.states.PROGRAM_STOPPED))){n(4,h=f.m.readU64("rsp"));for(let b=0;b{"centered"in b&&n(0,o=b.centered),"bytesPerRow"in b&&n(1,s=b.bytesPerRow),"colorRegions"in b&&n(2,a=b.colorRegions),"showAscii"in b&&n(3,c=b.showAscii)},t.$$.update=()=>{t.$$.dirty&1024&&r&&w()},[o,s,a,c,h,d,g,y,k,v,r]}class Ol extends gt{constructor(e){super(),ht(this,e,om,im,ct,{centered:0,bytesPerRow:1,colorRegions:2,showAscii:3})}}var li={},na=Symbol(),sm=Symbol(),Ml=t=>typeof t=="string"?ki[t]:t,ki={plain:li,plaintext:li,text:li,txt:li},Dl=(t,e)=>(e[sm]||am)(t,e),am=(t,e)=>{for(var n=[t],r,o=[],s=0;r=Ml(e[na]);)delete e[na],Object.assign(e,r);for(zl(t,e,n,0);o[s++]=n[0],n=n[1];);return o},ra="",ci="",Ir="",Ll=t=>{for(var e="",n=t.length,r=0;r{if(t instanceof Dr){var{type:e,alias:n,content:r}=t,o=ci,s=Ir,a=``;Ir+=ra,ci+=a;var c=Nl(r);return ci=o,Ir=s,a+c+ra}return typeof t!="string"?Ll(t):(t=t.replace(/&/g,"&").replace(/{for(var s in e)if(e[s])for(var a=0,c=e[s],f=Array.isArray(c)?c:[c];a=b+(G=v[0].length);v=v[1],b+=G);if(v[0]instanceof Dr)continue;for(var N=v,c=b;(c+=N[0].length)o[2]&&(o[2]=L)}}}}};function Dr(t,e,n,r){this.type=t,this.content=e,this.alias=r,this.length=n.length}const lm=(t,e,...n)=>{var V;let r,o,s=[],a,c="",f,h=!1,d=!1,g=!0,w=[],y,k=0;const v=um(),b=v.firstChild,E=b.children,x=E[0],S=x.firstChild,R={language:"text",value:c},M=new Set(n),G={},N=I=>{if(Object.assign(R,I),c=I.value??c,r=R.language,!ki[r])throw Error(`Language '${r}' has no grammar.`);y=!!R.readOnly,v.style.tabSize=R.tabSize||2,S.inputMode=y?"none":"",S.setAttribute("aria-readonly",y),q(),z(),(o!=(o=ki[r])||c!=S.value)&&(D(),S.value=c,S.selectionEnd=0,A())},A=()=>{w=Dl(c=S.value,o),U("tokenize",w,r,c);let I=Ll(w).split(` +`),H=0,B=k,ne=k=I.length;for(;I[H]==s[H]&&H