From cc98aba1e592063c51bf844950db92afc06a1efd Mon Sep 17 00:00:00 2001
From: Anthony <62391911+ajwood1965@users.noreply.github.com>
Date: Tue, 26 Mar 2024 09:18:14 -0500
Subject: [PATCH] rename api executeC to callC
---
azure/examples/balls/async.html | 4 +-
azure/examples/balls/dist/async.html | 2 +-
azure/examples/balls/dist/index.528b9ee5.js | 2 +-
.../examples/balls/dist/index.528b9ee5.js.map | 2 +-
azure/examples/balls/dist/index.html | 2 +-
.../balls/dist/twrmodworker.2165e649.js | 2 +-
.../balls/dist/twrmodworker.2165e649.js.map | 2 +-
azure/examples/balls/index.html | 4 +-
azure/examples/fft/dist/index.html | 2 +-
.../fft/dist/twrmodworker.2165e649.js | 2 +-
.../fft/dist/twrmodworker.2165e649.js.map | 2 +-
azure/examples/fft/fft-script.js | 8 +--
azure/examples/fft/fft-script.ts | 8 +--
azure/examples/function-calls/async.html | 8 +--
azure/examples/function-calls/dist/async.html | 2 +-
.../function-calls/dist/index.528b9ee5.js | 2 +-
.../function-calls/dist/index.528b9ee5.js.map | 2 +-
azure/examples/function-calls/dist/index.html | 2 +-
.../dist/twrmodworker.2165e649.js | 2 +-
.../dist/twrmodworker.2165e649.js.map | 2 +-
azure/examples/function-calls/index.html | 8 +--
azure/examples/helloworld/dist/index.html | 2 +-
.../helloworld/dist/twrmodworker.2165e649.js | 2 +-
.../dist/twrmodworker.2165e649.js.map | 2 +-
azure/examples/helloworld/index.html | 2 +-
azure/examples/maze/dist/index.html | 2 +-
.../maze/dist/twrmodworker.2165e649.js | 2 +-
.../maze/dist/twrmodworker.2165e649.js.map | 2 +-
azure/examples/maze/maze-script.js | 6 +--
azure/examples/maze/maze-script.ts | 6 +--
azure/examples/stdio-canvas/dist/index.html | 2 +-
.../dist/twrmodworker.2165e649.js | 2 +-
.../dist/twrmodworker.2165e649.js.map | 2 +-
azure/examples/stdio-canvas/index.html | 4 +-
azure/examples/stdio-div/dist/index.html | 2 +-
.../stdio-div/dist/twrmodworker.2165e649.js | 2 +-
.../dist/twrmodworker.2165e649.js.map | 2 +-
azure/examples/stdio-div/index.html | 2 +-
azure/examples/tests/dist/index.html | 2 +-
.../tests/dist/twrmodworker.2165e649.js | 2 +-
.../tests/dist/twrmodworker.2165e649.js.map | 2 +-
azure/examples/tests/index.html | 4 +-
azure/lib-js/twrmodasync.d.ts | 8 +--
azure/lib-js/twrmodasync.js | 34 ++++++------
azure/lib-js/twrmodbase.d.ts | 4 +-
azure/lib-js/twrmodbase.js | 22 ++++----
azure/lib-js/twrmodworker.js | 10 ++--
.../twr-wasm-ts/twr-wasm-ts/twrmodasync.ts | 34 ++++++------
.../twr-wasm-ts/twr-wasm-ts/twrmodbase.ts | 22 ++++----
.../twr-wasm-ts/twr-wasm-ts/twrmodworker.ts | 10 ++--
examples/balls/async.html | 4 +-
examples/balls/index.html | 4 +-
examples/fft/fft-script.ts | 8 +--
examples/function-calls/async.html | 8 +--
examples/function-calls/index.html | 8 +--
examples/helloworld/index.html | 2 +-
examples/maze/maze-script.ts | 6 +--
examples/stdio-canvas/index.html | 4 +-
examples/stdio-div/index.html | 2 +-
examples/tests/index.html | 4 +-
lib-js/twrcanvas.js | 2 +-
lib-js/twrcanvas.js.map | 2 +-
lib-js/twrmodasync.d.ts | 8 +--
lib-js/twrmodasync.d.ts.map | 2 +-
lib-js/twrmodasync.js | 34 ++++++------
lib-js/twrmodasync.js.map | 2 +-
lib-js/twrmodbase.d.ts | 4 +-
lib-js/twrmodbase.d.ts.map | 2 +-
lib-js/twrmodbase.js | 22 ++++----
lib-js/twrmodbase.js.map | 2 +-
lib-js/twrmodworker.js | 10 ++--
lib-js/twrmodworker.js.map | 2 +-
notes-to-self.txt | 6 +--
readme.md | 52 ++++++++++---------
source/twr-wasm-ts/twrmodasync.ts | 34 ++++++------
source/twr-wasm-ts/twrmodbase.ts | 22 ++++----
source/twr-wasm-ts/twrmodworker.ts | 10 ++--
77 files changed, 267 insertions(+), 267 deletions(-)
diff --git a/azure/examples/balls/async.html b/azure/examples/balls/async.html
index 112a732b..cba68c73 100644
--- a/azure/examples/balls/async.html
+++ b/azure/examples/balls/async.html
@@ -64,7 +64,7 @@
tiny-wasm-runtime
const mod=new twrWasmModuleAsync();
await mod.loadWasm('balls-a.wasm');
- await mod.executeC(["bounce_balls_init", ballSpeed]);
+ await mod.callC(["bounce_balls_init", ballSpeed]);
let lastTime;
@@ -75,7 +75,7 @@ tiny-wasm-runtime
else
intervalTimeMs=timeStamp-lastTime;
lastTime=timeStamp;
- mod.executeC(["bounce_balls_move", intervalTimeMs]).then(()=>{
+ mod.callC(["bounce_balls_move", intervalTimeMs]).then(()=>{
window.requestAnimationFrame(moveBalls);
});
}
diff --git a/azure/examples/balls/dist/async.html b/azure/examples/balls/dist/async.html
index 7469231c..42742955 100644
--- a/azure/examples/balls/dist/async.html
+++ b/azure/examples/balls/dist/async.html
@@ -5,4 +5,4 @@
"whatkey": "../../lib-js/whatkey.js"
}
}
- Bouncing Balls
tiny-wasm-runtime
\ No newline at end of file
+ Bouncing Balls
tiny-wasm-runtime
\ No newline at end of file
diff --git a/azure/examples/balls/dist/index.528b9ee5.js b/azure/examples/balls/dist/index.528b9ee5.js
index 9e933366..b6682d4b 100644
--- a/azure/examples/balls/dist/index.528b9ee5.js
+++ b/azure/examples/balls/dist/index.528b9ee5.js
@@ -1,2 +1,2 @@
-function e(e,t,r,i){Object.defineProperty(e,t,{get:r,set:i,enumerable:!0,configurable:!0})}var t=globalThis,r={},i={},s=t.parcelRequire94c2;null==s&&((s=function(e){if(e in r)return r[e].exports;if(e in i){var t=i[e];delete i[e];var s={id:e,exports:{}};return r[e]=s,t.call(s.exports,s,s.exports),s.exports}var o=Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}).register=function(e,t){i[e]=t},t.parcelRequire94c2=s);var o=s.register;o("eZoLj",function(t,r){e(t.exports,"register",()=>i,e=>i=e);var i,s=new Map;i=function(e,t){for(var r=0;rs("3bkoq").twrWasmModule),e(t.exports,"twrWasmModuleAsync",()=>s("baOio").twrWasmModuleAsync),s("3bkoq"),s("baOio")}),o("3bkoq",function(t,r){e(t.exports,"twrWasmModule",()=>a);var i=s("9FI45"),o=s("aGUWE"),n=s("lsUl2");class a extends o.twrWasmModuleInJSMain{malloc;constructor(e={}){let t;super(e,!0),this.malloc=e=>{throw Error("error - un-init malloc called")},t=this.d2dcanvas.isValid()?this.d2dcanvas:this.iocanvas,this.modParams.imports={twrDebugLog:i.twrDebugLogImpl,twrTime:n.twrTimeImpl,twrDivCharOut:this.iodiv.charOut.bind(this.iodiv),twrCanvasGetProp:t.getProp.bind(t),twrCanvasDrawSeq:t.drawSeq.bind(t),twrCanvasCharIn:this.null,twrCanvasInkey:this.null,twrDivCharIn:this.null,twrSleep:this.null,twrSin:Math.sin,twrCos:Math.cos,twrTan:Math.tan,twrFAbs:Math.abs,twrACos:Math.acos,twrASin:Math.asin,twrATan:Math.atan,twrExp:Math.exp,twrFloor:Math.floor,twrCeil:Math.ceil,twrFMod:function(e,t){return e%t},twrLog:Math.log,twrPow:Math.pow,twrSqrt:Math.sqrt,twrTrunc:Math.trunc,twrDtoa:this.floatUtil.dtoa.bind(this.floatUtil),twrToFixed:this.floatUtil.toFixed.bind(this.floatUtil),twrToExponential:this.floatUtil.toExponential.bind(this.floatUtil),twrAtod:this.floatUtil.atod.bind(this.floatUtil),twrFcvtS:this.floatUtil.fcvtS.bind(this.floatUtil)}}null(e){throw Error("call to unimplemented twrXXX import in twrWasmModule. Use twrWasmModuleAsync ?")}}}),o("9FI45",function(t,r){e(t.exports,"twrDebugLogImpl",()=>s);let i="";function s(e){10==e||3==e?(console.log(i),i=""):(i+=String.fromCharCode(e)).length>=200&&(console.log(i),i="")}}),o("aGUWE",function(t,r){e(t.exports,"twrWasmModuleInJSMain",()=>a);var i=s("fDEU7"),o=s("5hO33"),n=s("5LsZ0");class a extends o.twrWasmModuleBase{iocanvas;d2dcanvas;iodiv;modParams;constructor(e={},t=!1){if(super(t),"undefined"==typeof document)throw Error("twrWasmModuleJSMain should only be created in JavaScript Main.");let r=document.getElementById("twr_iodiv"),s=document.getElementById("twr_iocanvas"),o=document.getElementById("twr_d2dcanvas");if(s&&o)throw Error("Both twr_iocanvas and twr_d2dcanvas defined. Currently only one canvas allowed.");if("div"==e.stdio&&!r)throw Error("twrWasmModuleBase opts=='div' but twr_iodiv not defined");if("canvas"==e.stdio&&!s)throw Error("twrWasmModuleBase, opts=='canvas' but twr_iocanvas not defined");if(e.isd2dcanvas&&!o)throw Error("twrWasmModuleBase, opts.isdrawcanvas==true but twr_d2dcanvas not defined");e=r?{stdio:"div",...e}:s?{stdio:"canvas",...e}:{stdio:"debug",...e},r||s?console.log("tiny-wasm-runtime: stdio set to: ",e.stdio):console.log("Since neither twr_iocanvas nor twr_iodiv is defined, stdout directed to debug console."),(e=s?{windim:[64,16],...e}:{windim:[0,0],...e}).imports||(e.imports={});let a=!1;e.backcolor||(a=!0,e.backcolor="black"),e.forecolor||(a=!0,e.forecolor="white"),e.fontsize||(a=!0,e.fontsize=16),void 0===e.isd2dcanvas&&(o?e.isd2dcanvas=!0:e.isd2dcanvas=!1),this.modParams={stdio:e.stdio,windim:e.windim,imports:e.imports,forecolor:e.forecolor,backcolor:e.backcolor,styleIsDefault:a,fontsize:e.fontsize,isd2dcanvas:e.isd2dcanvas},this.iodiv=new i.twrDiv(r,this.modParams,this),this.iocanvas=new n.twrCanvas(s,this.modParams,this),this.d2dcanvas=new n.twrCanvas(o,this.modParams,this)}divLog(...e){for(var t=0;to);var i=s("ghrAp");class o{div;divKeys;CURSOR=String.fromCharCode(9611);cursorOn=!1;lastChar=0;extraBR=!1;owner;constructor(e,t,r){this.div=e,this.owner=r,this.owner.isWasmModule||(this.divKeys=new i.twrSharedCircularBuffer),this.div&&!t.styleIsDefault&&(this.div.style.backgroundColor=t.backcolor,this.div.style.color=t.forecolor,this.div.style.font=t.fontsize.toString()+"px arial")}isValid(){return!!this.div}getProxyParams(){if(!this.divKeys)throw Error("internal error in getProxyParams.");return[this.divKeys.sharedArray]}charOut(e){if(this.div){switch(this.extraBR&&(this.extraBR=!1,this.cursorOn&&(this.div.innerHTML=this.div.innerHTML.slice(0,-1)),this.div.innerHTML=this.div.innerHTML.slice(0,-4),this.cursorOn&&(this.div.innerHTML+=this.CURSOR)),e){case 10:case 13:if(10==e&&13==this.lastChar)break;this.cursorOn&&(this.div.innerHTML=this.div.innerHTML.slice(0,-1)),this.div.innerHTML+="
",this.extraBR=!0,this.cursorOn&&(this.div.innerHTML+=this.CURSOR);let t=this.div.getBoundingClientRect();window.scrollTo(0,t.height+100);break;case 8:this.cursorOn&&(this.div.innerHTML=this.div.innerHTML.slice(0,-1)),this.div.innerHTML=this.div.innerHTML.slice(0,-1),this.cursorOn&&(this.div.innerHTML+=this.CURSOR);break;case 14:this.cursorOn||(this.cursorOn=!0,this.div.innerHTML+=this.CURSOR,this.div.focus());break;case 15:this.cursorOn&&(this.cursorOn=!1,this.div.innerHTML=this.div.innerHTML.slice(0,-1));break;default:this.cursorOn&&(this.div.innerHTML=this.div.innerHTML.slice(0,-1)),this.div.innerHTML+=String.fromCharCode(e),this.cursorOn&&(this.div.innerHTML+=this.CURSOR)}this.lastChar=e}}stringOut(e){for(let t=0;ti);class i{sharedArray;buf;constructor(e){if("undefined"!=typeof window&&!crossOriginIsolated&&"file:"!==window.location.protocol)throw Error("twrSharedCircularBuffer constructor, crossOriginIsolated="+crossOriginIsolated+". See SharedArrayBuffer docs.");e?this.sharedArray=e:this.sharedArray=new SharedArrayBuffer(1032),this.buf=new Int32Array(this.sharedArray),this.buf[256]=0,this.buf[257]=0}write(e){let t=this.buf[257];this.buf[t]=e,256==++t&&(t=0),this.buf[257]=t,Atomics.notify(this.buf,257)}read(){if(this.isEmpty())return -1;{let e=this.buf[256],t=this.buf[e];return e++,this.buf[256]=e,t}}readWait(){if(this.isEmpty()){let e=this.buf[256];Atomics.wait(this.buf,257,e)}return this.read()}isEmpty(){return this.buf[256]==this.buf[257]}}}),o("5hO33",function(t,r){e(t.exports,"twrWasmModuleBase",()=>o);var i=s("2Xdsi");class o{memory;mem8;mem32;memD;exports;isWorker=!1;isWasmModule;floatUtil;constructor(e=!1){this.isWasmModule=e,this.mem8=new Uint8Array,this.mem32=new Uint32Array,this.memD=new Float64Array,this.floatUtil=new i.twrFloatUtil(this)}async loadWasm(e){let t;try{t=await fetch(e)}catch(t){throw console.log("loadWasm() failed to fetch: "+e),t}if(!t.ok)throw Error("fetch response error on file '"+e+"'\n"+t.statusText);try{let e=await t.arrayBuffer(),r={...this.modParams.imports},i=await WebAssembly.instantiate(e,{env:r});if(this.exports=i.instance.exports,!this.exports)throw Error("Unexpected error - undefined instance.exports");if(this.memory)throw Error("unexpected error -- this.memory already set");if(this.memory=this.exports.memory,!this.memory)throw Error("Unexpected error - undefined exports.memory");this.mem8=new Uint8Array(this.memory.buffer),this.mem32=new Uint32Array(this.memory.buffer),this.memD=new Float64Array(this.memory.buffer),this.isWorker&&(this.memory.buffer instanceof ArrayBuffer&&console.log("twrWasmModuleAsync requires shared Memory. Add wasm-ld --shared-memory --no-check-features (see docs)"),postMessage(["setmemory",this.memory])),!this.isWasmModule||this.memory.buffer instanceof ArrayBuffer||console.log("twrWasmModule does not require shared Memory. Okay to remove wasm-ld --shared-memory --no-check-features"),this.malloc=e=>new Promise(t=>{let r=this.exports.twr_malloc;t(r(e))}),this.init()}catch(e){throw console.log("WASM instantiate error: "+e+(e.stack?"\n"+e.stack:"")),e}}init(){let e;switch(this.modParams.stdio){case"debug":default:e=0;break;case"div":e=1;break;case"canvas":e=2;break;case"null":e=3}(0,this.exports.twr_wasm_init)(e,this.mem8.length)}async executeC(e){let t=await this.preCallC(e),r=this.executeCImpl(e[0],t);return this.postCallC(t,e),r}async executeCImpl(e,t=[]){if(!this.exports)throw Error("this.exports undefined");if(!this.exports[e])throw Error("executeC: function '"+e+"' not in export table. Use --export wasm-ld flag.");return(0,this.exports[e])(...t)}async preCallC(e){if(e.constructor!==Array)throw Error("executeC: params must be array, first arg is function name");if(0==e.length)throw Error("executeC: missing function name");let t=[],r=0;for(let i=1;i=this.mem32.length)throw Error("invalid index passed to getLong: "+e+", this.mem32.length: "+this.mem32.length);return this.mem32[t]}setLong(e,t){let r=Math.floor(e/4);if(4*r!=e)throw Error("setLong passed non long aligned address");if(r<0||r>=this.mem32.length)throw Error("invalid index passed to setLong: "+e+", this.mem32.length: "+this.mem32.length);this.mem32[r]=t}getDouble(e){let t=Math.floor(e/8);if(8*t!=e)throw Error("getLong passed non Float64 aligned address");return this.memD[t]}setDouble(e,t){let r=Math.floor(e/8);if(8*r!=e)throw Error("setDouble passed non Float64 aligned address");this.memD[r]=t}getShort(e){if(e<0||e>=this.mem8.length)throw Error("invalid index passed to getShort: "+e);return this.mem8[e]+256*this.mem8[e+1]}getString(e,t){let r="",i=0;for(;this.mem8[e+i]&&(void 0===t||i=this.mem8.length)throw Error("invalid index passed to getU8: "+e);let t=new Uint32Array(this.mem8.slice(e,e+8).buffer),r=t[0],i=t[1];if(i<0||i>=this.mem8.length)throw Error("invalid idx.dataptr passed to getU8");if(r<0||r>this.mem8.length-i)throw Error("invalid idx.size passed to getU8");return this.mem8.slice(i,i+r)}getU32Arr(e){if(e<0||e>=this.mem8.length)throw Error("invalid index passed to getU32: "+e);let t=new Uint32Array(this.mem8.slice(e,e+8).buffer),r=t[0],i=t[1];if(i<0||i>=this.mem8.length)throw Error("invalid idx.dataptr passed to getU32");if(r<0||r>this.mem8.length-i)throw Error("invalid idx.size passed to getU32");if(r%4!=0)throw Error("idx.size is not an integer number of 32 bit words");return new Uint32Array(this.mem8.slice(i,i+r).buffer)}}}),o("2Xdsi",function(t,r){e(t.exports,"twrFloatUtil",()=>i);class i{mod;constructor(e){this.mod=e}atod(e){let t=this.mod.getString(e),r=t.trimStart().toUpperCase();return"INF"==r||"+INF"==r?Number.POSITIVE_INFINITY:"-INF"==r?Number.NEGATIVE_INFINITY:Number.parseFloat(t.replaceAll("D","e").replaceAll("d","e"))}dtoa(e,t,r,i){if(-1==i){let i=r.toString();this.mod.copyString(e,t,i)}else{let s=r.toString();s.length>i&&(s=r.toPrecision(i)),this.mod.copyString(e,t,s)}}toFixed(e,t,r,i){let s=r.toFixed(i);this.mod.copyString(e,t,s)}toExponential(e,t,r,i){let s=r.toExponential(i);this.mod.copyString(e,t,s)}fcvtS(e,t,r,i,s,o){let n,a;if(0==e||0==o||0==s||t<1)return 1;let l=0;if(Number.isNaN(r))n="1#QNAN00000000000000000000000000000".slice(0,i+1),a=1;else if(Number.isFinite(r)){if(0==r)n="000000000000000000000000000000000000".slice(0,i),a=0;else{if(r<0&&(l=1,r=Math.abs(r)),i>100||r>1e21||r<1e-99)return this.mod.copyString(e,t,""),this.mod.mem32[s]=0,1;let[o="",h=""]=r.toFixed(i).split(".");"0"==o&&(o=""),o.length>0?(a=o.length,n=o+h):a=(n=h.replace(/^0+/,"")).length-h.length}}else n="1#INF00000000000000000000000000000".slice(0,i+1),a=1;return t-1l);var i,o,n=s("ghrAp"),a=s("47Wdp");(i=o||(o={}))[i.D2D_FILLRECT=1]="D2D_FILLRECT",i[i.D2D_FILLCHAR=5]="D2D_FILLCHAR",i[i.D2D_SETLINEWIDTH=10]="D2D_SETLINEWIDTH",i[i.D2D_SETFILLSTYLERGBA=11]="D2D_SETFILLSTYLERGBA",i[i.D2D_SETFONT=12]="D2D_SETFONT",i[i.D2D_BEGINPATH=13]="D2D_BEGINPATH",i[i.D2D_MOVETO=14]="D2D_MOVETO",i[i.D2D_LINETO=15]="D2D_LINETO",i[i.D2D_FILL=16]="D2D_FILL",i[i.D2D_STROKE=17]="D2D_STROKE",i[i.D2D_SETSTROKESTYLERGBA=18]="D2D_SETSTROKESTYLERGBA",i[i.D2D_ARC=19]="D2D_ARC",i[i.D2D_STROKERECT=20]="D2D_STROKERECT",i[i.D2D_FILLTEXT=21]="D2D_FILLTEXT",i[i.D2D_IMAGEDATA=22]="D2D_IMAGEDATA",i[i.D2D_PUTIMAGEDATA=23]="D2D_PUTIMAGEDATA",i[i.D2D_BEZIERTO=24]="D2D_BEZIERTO",i[i.D2D_MEASURETEXT=25]="D2D_MEASURETEXT",i[i.D2D_SAVE=26]="D2D_SAVE",i[i.D2D_RESTORE=27]="D2D_RESTORE",i[i.D2D_CREATERADIALGRADIENT=28]="D2D_CREATERADIALGRADIENT",i[i.D2D_SETCOLORSTOP=29]="D2D_SETCOLORSTOP",i[i.D2D_SETFILLSTYLEGRADIENT=30]="D2D_SETFILLSTYLEGRADIENT",i[i.D2D_RELEASEID=31]="D2D_RELEASEID",i[i.D2D_CREATELINEARGRADIENT=32]="D2D_CREATELINEARGRADIENT",i[i.D2D_SETFILLSTYLE=33]="D2D_SETFILLSTYLE",i[i.D2D_SETSTROKESTYLE=34]="D2D_SETSTROKESTYLE";class l{ctx;props={charWidth:0,charHeight:0,foreColor:0,backColor:0,widthInChars:0,heightInChars:0,canvasHeight:0,canvasWidth:0};owner;cmdCompleteSignal;canvasKeys;precomputedObjects;constructor(e,t,r){let{forecolor:i,backcolor:s,fontsize:o,isd2dcanvas:l}=t;if(this.owner=r,this.props.widthInChars=t.windim[0],this.props.heightInChars=t.windim[1],this.owner.isWasmModule||(this.cmdCompleteSignal=new a.twrSignal,this.canvasKeys=new n.twrSharedCircularBuffer),this.precomputedObjects={},e){if(!e.getContext)throw Error("attempted to create new twrCanvas with an element that is not a valid HTMLCanvasElement");let t=e.getContext("2d");if(!t)throw Error("canvas 2D context not found in twrCanvasConstructor");t.font=o.toString()+"px Courier New",t.textBaseline="top";let r=" ",n=t.measureText(r);this.props.charWidth=Math.ceil(n.width/r.length);let a=t.measureText("X");this.props.charHeight=Math.ceil(a.fontBoundingBoxAscent+a.fontBoundingBoxDescent),l||(e.width=this.props.charWidth*this.props.widthInChars,e.height=this.props.charHeight*this.props.heightInChars),this.props.canvasHeight=e.height,this.props.canvasWidth=e.width;let h=e.getContext("2d");if(!h)throw Error("canvas 2D context not found in twrCanvas.constructor (2nd time)");this.ctx=h,this.ctx.font=o.toString()+"px Courier New",this.ctx.textBaseline="top",h.fillStyle=s,this.props.backColor=Number("0x"+h.fillStyle.slice(1)),h.fillStyle=i,this.props.foreColor=Number("0x"+h.fillStyle.slice(1))}}isValid(){return!!this.ctx}getProxyParams(){if(!this.cmdCompleteSignal||!this.canvasKeys)throw Error("internal error in getProxyParams.");return[this.props,this.cmdCompleteSignal.sharedArray,this.canvasKeys.sharedArray]}getProp(e){this.isValid()||console.log("internal error - getProp called on invalid twrCanvas");let t=this.owner.getString(e);return this.props[t]}drawSeq(e){let t;if(this.isValid()||console.log("internal error - drawSeq called on invalid twrCanvas"),!this.ctx)return;let r=this.owner.getLong(e),i=this.owner.getLong(e+4);for(;;){let e=this.owner.getLong(r+4);switch(e){case o.D2D_FILLRECT:{let e=this.owner.getDouble(r+8),t=this.owner.getDouble(r+16),i=this.owner.getDouble(r+24),s=this.owner.getDouble(r+32);this.ctx.fillRect(e,t,i,s)}break;case o.D2D_STROKERECT:{let e=this.owner.getDouble(r+8),t=this.owner.getDouble(r+16),i=this.owner.getDouble(r+24),s=this.owner.getDouble(r+32);this.ctx.strokeRect(e,t,i,s)}break;case o.D2D_FILLCHAR:{let e=this.owner.getDouble(r+8),t=this.owner.getDouble(r+16),i=String.fromCharCode(this.owner.getShort(r+24));this.ctx.fillText(i,e,t)}break;case o.D2D_FILLTEXT:{let e=this.owner.getDouble(r+8),t=this.owner.getDouble(r+16),i=this.owner.getString(this.owner.getLong(r+24));this.ctx.fillText(i,e,t)}break;case o.D2D_MEASURETEXT:{let e=this.owner.getString(this.owner.getLong(r+8)),t=this.owner.getLong(r+12),i=this.ctx.measureText(e);this.owner.setDouble(t+0,i.actualBoundingBoxAscent),this.owner.setDouble(t+8,i.actualBoundingBoxDescent),this.owner.setDouble(t+16,i.actualBoundingBoxLeft),this.owner.setDouble(t+24,i.actualBoundingBoxRight),this.owner.setDouble(t+32,i.fontBoundingBoxAscent),this.owner.setDouble(t+40,i.fontBoundingBoxDescent),this.owner.setDouble(t+48,i.width)}break;case o.D2D_SETFONT:{let e=this.owner.getString(this.owner.getLong(r+8));this.ctx.font=e}break;case o.D2D_SETFILLSTYLERGBA:{let e="#"+("00000000"+this.owner.getLong(r+8).toString(16)).slice(-8);this.ctx.fillStyle=e}break;case o.D2D_SETSTROKESTYLERGBA:{let e="#"+("00000000"+this.owner.getLong(r+8).toString(16)).slice(-8);this.ctx.strokeStyle=e}break;case o.D2D_SETFILLSTYLE:{let e=this.owner.getString(this.owner.getLong(r+8));this.ctx.fillStyle=e}break;case o.D2D_SETSTROKESTYLE:{let e=this.owner.getString(this.owner.getLong(r+8));this.ctx.strokeStyle=e}break;case o.D2D_SETLINEWIDTH:{let e=this.owner.getShort(r+8);this.ctx.lineWidth=e}break;case o.D2D_MOVETO:{let e=this.owner.getDouble(r+8),t=this.owner.getDouble(r+16);this.ctx.moveTo(e,t)}break;case o.D2D_LINETO:{let e=this.owner.getDouble(r+8),t=this.owner.getDouble(r+16);this.ctx.lineTo(e,t)}break;case o.D2D_BEZIERTO:{let e=this.owner.getDouble(r+8),t=this.owner.getDouble(r+16),i=this.owner.getDouble(r+24),s=this.owner.getDouble(r+32),o=this.owner.getDouble(r+40),n=this.owner.getDouble(r+48);this.ctx.bezierCurveTo(e,t,i,s,o,n)}break;case o.D2D_BEGINPATH:this.ctx.beginPath();break;case o.D2D_FILL:this.ctx.fill();break;case o.D2D_SAVE:this.ctx.save();break;case o.D2D_RESTORE:this.ctx.restore();break;case o.D2D_STROKE:this.ctx.stroke();break;case o.D2D_ARC:{let e=this.owner.getDouble(r+8),t=this.owner.getDouble(r+16),i=this.owner.getDouble(r+24),s=this.owner.getDouble(r+32),o=this.owner.getDouble(r+40),n=0!=this.owner.getLong(r+48);this.ctx.arc(e,t,i,s,o,n)}break;case o.D2D_IMAGEDATA:{let e=this.owner.getLong(r+8),t=this.owner.getLong(r+12),i=this.owner.getLong(r+16),s=this.owner.getLong(r+20),o=this.owner.getLong(r+24);if(o in this.precomputedObjects&&console.log("warning: D2D_IMAGEDATA ID already exists."),this.owner.isWasmModule){let r=new Uint8ClampedArray(this.owner.memory.buffer,e,t);this.precomputedObjects[o]=new ImageData(r,i,s)}else this.precomputedObjects[o]={mem8:new Uint8Array(this.owner.memory.buffer,e,t),width:i,height:s}}break;case o.D2D_CREATERADIALGRADIENT:{let e=this.owner.getDouble(r+8),t=this.owner.getDouble(r+16),i=this.owner.getDouble(r+24),s=this.owner.getDouble(r+32),o=this.owner.getDouble(r+40),n=this.owner.getDouble(r+48),a=this.owner.getLong(r+56),l=this.ctx.createRadialGradient(e,t,i,s,o,n);a in this.precomputedObjects&&console.log("warning: D2D_CREATERADIALGRADIENT ID already exists."),this.precomputedObjects[a]=l}break;case o.D2D_CREATELINEARGRADIENT:{let e=this.owner.getDouble(r+8),t=this.owner.getDouble(r+16),i=this.owner.getDouble(r+24),s=this.owner.getDouble(r+32),o=this.owner.getLong(r+40),n=this.ctx.createLinearGradient(e,t,i,s);o in this.precomputedObjects&&console.log("warning: D2D_CREATELINEARGRADIENT ID already exists."),this.precomputedObjects[o]=n}break;case o.D2D_SETCOLORSTOP:{let e=this.owner.getLong(r+8),t=this.owner.getLong(r+12),i=this.owner.getString(this.owner.getLong(r+16));if(!(e in this.precomputedObjects))throw Error("D2D_SETCOLORSTOP with invalid ID: "+e);this.precomputedObjects[e].addColorStop(t,i)}break;case o.D2D_SETFILLSTYLEGRADIENT:{let e=this.owner.getLong(r+8);if(!(e in this.precomputedObjects))throw Error("D2D_SETFILLSTYLEGRADIENT with invalid ID: "+e);let t=this.precomputedObjects[e];this.ctx.fillStyle=t}break;case o.D2D_RELEASEID:{let e=this.owner.getLong(r+8);this.precomputedObjects[e]?delete this.precomputedObjects[e]:console.log("warning: D2D_RELEASEID with undefined ID ",e)}break;case o.D2D_PUTIMAGEDATA:{let e;let t=this.owner.getLong(r+8),i=this.owner.getLong(r+12),s=this.owner.getLong(r+16),o=this.owner.getLong(r+20),n=this.owner.getLong(r+24),a=this.owner.getLong(r+28),l=this.owner.getLong(r+32);if(!(t in this.precomputedObjects))throw Error("D2D_PUTIMAGEDATA with invalid ID: "+t);if(this.owner.isWasmModule)e=this.precomputedObjects[t];else{let r=this.precomputedObjects[t];e=new ImageData(Uint8ClampedArray.from(r.mem8),r.width,r.height)}0==a&&0==l?this.ctx.putImageData(e,i,s):this.ctx.putImageData(e,i,s,o,n,a,l)}break;default:throw Error("unimplemented or unknown Sequence Type in drawSeq: "+e)}if(0==(t=this.owner.getLong(r))){if(r!=i)throw Error("assert type error in twrcanvas, ins!=lastins");break}r=t}this.cmdCompleteSignal&&this.cmdCompleteSignal.signal()}}}),o("47Wdp",function(t,r){var i,s;e(t.exports,"twrSignal",()=>o),(s=i||(i={}))[s.WAITING=0]="WAITING",s[s.SIGNALED=1]="SIGNALED";class o{sharedArray;buf;constructor(e){if("undefined"!=typeof window&&!crossOriginIsolated&&"file:"!==window.location.protocol)throw Error("twrSignal constructor, crossOriginIsolated="+crossOriginIsolated+". See SharedArrayBuffer docs.");e?this.sharedArray=e:this.sharedArray=new SharedArrayBuffer(4),this.buf=new Int32Array(this.sharedArray),this.buf[0]=i.WAITING}signal(){this.buf[0]=i.SIGNALED,Atomics.notify(this.buf,0)}wait(){this.buf[0]==i.WAITING&&Atomics.wait(this.buf,0,i.WAITING)}isSignaled(){return this.buf[0]==i.SIGNALED}reset(){this.buf[0]=i.WAITING}}}),o("lsUl2",function(t,r){e(t.exports,"twrTimeImpl",()=>i);function i(){return Date.now()}}),o("baOio",function(t,r){e(t.exports,"twrWasmModuleAsync",()=>l);var i=s("9FI45"),o=s("aGUWE"),n=s("2vKdq"),a=s("bqeaG");class l extends o.twrWasmModuleInJSMain{myWorker;malloc;loadWasmResolve;loadWasmReject;executeCResolve;executeCReject;initLW=!1;waitingcalls;constructor(e){if(super(e),this.malloc=e=>{throw Error("Error - un-init malloc called.")},!window.Worker)throw Error("This browser doesn't support web workers.");this.myWorker=new Worker(s("aRHnW")),this.myWorker.onmessage=this.processMsg.bind(this)}async loadWasm(e){if(this.initLW)throw Error("twrWasmAsyncModule::loadWasm can only be called once per twrWasmAsyncModule instance");return this.initLW=!0,new Promise((t,r)=>{let i;this.loadWasmResolve=t,this.loadWasmReject=r,this.malloc=e=>this.executeCImpl("twr_malloc",[e]),this.waitingcalls=new n.twrWaitingCalls,i=this.d2dcanvas.isValid()?this.d2dcanvas:this.iocanvas;let s={divProxyParams:this.iodiv.getProxyParams(),canvasProxyParams:i.getProxyParams(),waitingCallsProxyParams:this.waitingcalls.getProxyParams()},o={urlToLoad:new URL(e,document.URL).href,modWorkerParams:s,modParams:this.modParams};this.myWorker.postMessage(["startup",o])})}async executeC(e){let t=await this.preCallC(e);return this.executeCImpl(e[0],t)}async executeCImpl(e,t=[]){return new Promise((r,i)=>{this.executeCResolve=r,this.executeCReject=i,this.myWorker.postMessage(["executeC",e,t])})}keyDownDiv(e){if(!this.iodiv||!this.iodiv.divKeys)throw Error("unexpected undefined twrWasmAsyncModule.divKeys");this.iodiv.divKeys.write((0,a.default)(e).char.charCodeAt(0))}keyDownCanvas(e){if(!this.iocanvas||!this.iocanvas.canvasKeys)throw Error("unexpected undefined twrWasmAsyncModule.canvasKeys");this.iocanvas.canvasKeys.write((0,a.default)(e).char.charCodeAt(0))}processMsg(e){let t=e.data[0],r=e.data[1];switch(t){case"divout":this.iodiv.isValid()?this.iodiv.charOut(r):console.log("error - msg divout received but iodiv is undefined.");break;case"debug":(0,i.twrDebugLogImpl)(r);break;case"drawseq":{let[e]=r;if(this.iocanvas.isValid())this.iocanvas.drawSeq(e);else if(this.d2dcanvas.isValid())this.d2dcanvas.drawSeq(e);else throw Error("msg drawseq received but canvas is undefined.");break}case"setmemory":if(this.memory=r,!this.memory)throw Error("unexpected error - undefined memory in startupOkay msg");this.mem8=new Uint8Array(this.memory.buffer),this.mem32=new Uint32Array(this.memory.buffer),this.memD=new Float64Array(this.memory.buffer);break;case"startupFail":if(this.loadWasmReject)this.loadWasmReject(r);else throw Error("twrWasmAsyncModule.processMsg unexpected error (undefined loadWasmReject)");break;case"startupOkay":if(this.loadWasmResolve)this.loadWasmResolve(void 0);else throw Error("twrWasmAsyncModule.processMsg unexpected error (undefined loadWasmResolve)");break;case"executeCFail":if(this.executeCReject)this.executeCReject(r);else throw Error("twrWasmAsyncModule.processMsg unexpected error (undefined executeCReject)");break;case"executeCOkay":if(this.executeCResolve)this.executeCResolve(r);else throw Error("twrWasmAsyncModule.processMsg unexpected error (undefined executeCResolve)");break;default:if(!this.waitingcalls)throw Error("internal error: this.waitingcalls undefined.");if(!this.waitingcalls.processMessage(t,r))throw Error("twrWasmAsyncModule - unknown and unexpected msgType: "+t)}}}}),o("2vKdq",function(t,r){e(t.exports,"twrWaitingCalls",()=>n);var i=s("47Wdp"),o=s("lsUl2");class n{callCompleteSignal;parameters;constructor(){this.callCompleteSignal=new i.twrSignal,this.parameters=new Uint32Array(new SharedArrayBuffer(4))}startSleep(e){setTimeout(()=>{this.callCompleteSignal.signal()},e)}time(){let e=(0,o.twrTimeImpl)();this.parameters[0]=e,this.callCompleteSignal.signal()}getProxyParams(){return[this.callCompleteSignal.sharedArray,this.parameters.buffer]}processMessage(e,t){switch(e){case"sleep":let[r]=t;this.startSleep(r);break;case"time":this.time();break;default:return!1}return!0}}}),o("bqeaG",function(t,r){e(t.exports,"default",()=>m);let i={a:"selectAll",c:"copy",s:"save",v:"paste",x:"cut",y:"redo",z:"undo"},s={"/":"?",".":">",",":"<","'":'"',";":":","[":"{","]":"}","\\":"|","`":"~","=":"+","-":"_",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")",a:"A",b:"B",c:"C",d:"D",e:"E",f:"F",g:"G",h:"H",i:"I",j:"J",k:"K",l:"L",m:"M",n:"N",o:"O",p:"P",q:"q",r:"R",s:"S",t:"T",u:"U",v:"V",w:"W",x:"X",y:"Y",z:"Z"},o={};for(let e in s)o[s[e]]=e;let n={0:"\\",8:"backspace",9:"tab",12:"num",13:"enter",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"caps",27:"esc",32:" ",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",44:"print",45:"insert",46:"delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",91:"meta",92:"meta",93:"meta",96:"num0",97:"num1",98:"num2",99:"num3",100:"num4",101:"num5",102:"num6",103:"num7",104:"num8",105:"num9",106:"*",107:"+",108:"num_enter",109:"num_subtract",110:"num_decimal",111:"num_divide",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",124:"print",144:"num",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",223:"`",224:"cmd",225:"alt",57392:"ctrl",63289:"num"},a={"\r":"enter"},l=JSON.parse(JSON.stringify(n));for(let e of Object.keys(a))l[e]=a[e];let h={num_subtract:"-",num_enter:"\n",num_decimal:".",num_divide:"/",enter:"\n",tab:" ",backspace:"\b"},c=["keydown","keyup"],d=()=>{let e=navigator.userAgent;return 0!==(/IEMobile|Windows Phone|Lumia/i.test(e)?"w":/iPhone|iP[oa]d/.test(e)?"i":/Android/.test(e)?"a":/BlackBerry|PlayBook|BB10/.test(e)?"b":/Mobile Safari/.test(e)?"s":/webOS|Mobile|Tablet|Opera Mini|\bCrMo\/|Opera Mobi/i.test(e)?1:0)};function u(e){let t=String.fromCharCode(e);return d()?t:t in o?o[t]:t in l?l[t]:t}function m(e){let t;if("keypress"!==e.type||d()){if("keypress"===e.type&&d())t=u(e.keyCode);else{if(!(c.indexOf(e.type)>-1))return!1;t=void 0!==e.which?n[e.which]:void 0!==e.keyCode?n[e.keyCode]:"enter"}}else t=u(e.charCode);let r=t;return e.shiftKey&&t in s?r=s[t]:e.ctrlKey&&t in i?r=i[t]:t in h&&(r=h[t]),{char:r,key:t}}}),o("aRHnW",function(e,t){var r=s("hoqmg");let i=new URL("twrmodworker.2165e649.js",import.meta.url);e.exports=r(i.toString(),i.origin,!0)}),o("hoqmg",function(e,t){e.exports=function(e,t,r){if(t===self.location.origin)return e;var i=r?"import "+JSON.stringify(e)+";":"importScripts("+JSON.stringify(e)+");";return URL.createObjectURL(new Blob([i],{type:"application/javascript"}))}}),s("eZoLj").register(new URL("",import.meta.url).toString(),JSON.parse('["kjr0c","index.528b9ee5.js","cTHdP","twrmodworker.2165e649.js"]'));
+function e(e,t,r,i){Object.defineProperty(e,t,{get:r,set:i,enumerable:!0,configurable:!0})}var t=globalThis,r={},i={},s=t.parcelRequire94c2;null==s&&((s=function(e){if(e in r)return r[e].exports;if(e in i){var t=i[e];delete i[e];var s={id:e,exports:{}};return r[e]=s,t.call(s.exports,s,s.exports),s.exports}var o=Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}).register=function(e,t){i[e]=t},t.parcelRequire94c2=s);var o=s.register;o("eZoLj",function(t,r){e(t.exports,"register",()=>i,e=>i=e);var i,s=new Map;i=function(e,t){for(var r=0;rs("3bkoq").twrWasmModule),e(t.exports,"twrWasmModuleAsync",()=>s("baOio").twrWasmModuleAsync),s("3bkoq"),s("baOio")}),o("3bkoq",function(t,r){e(t.exports,"twrWasmModule",()=>a);var i=s("9FI45"),o=s("aGUWE"),n=s("lsUl2");class a extends o.twrWasmModuleInJSMain{malloc;constructor(e={}){let t;super(e,!0),this.malloc=e=>{throw Error("error - un-init malloc called")},t=this.d2dcanvas.isValid()?this.d2dcanvas:this.iocanvas,this.modParams.imports={twrDebugLog:i.twrDebugLogImpl,twrTime:n.twrTimeImpl,twrDivCharOut:this.iodiv.charOut.bind(this.iodiv),twrCanvasGetProp:t.getProp.bind(t),twrCanvasDrawSeq:t.drawSeq.bind(t),twrCanvasCharIn:this.null,twrCanvasInkey:this.null,twrDivCharIn:this.null,twrSleep:this.null,twrSin:Math.sin,twrCos:Math.cos,twrTan:Math.tan,twrFAbs:Math.abs,twrACos:Math.acos,twrASin:Math.asin,twrATan:Math.atan,twrExp:Math.exp,twrFloor:Math.floor,twrCeil:Math.ceil,twrFMod:function(e,t){return e%t},twrLog:Math.log,twrPow:Math.pow,twrSqrt:Math.sqrt,twrTrunc:Math.trunc,twrDtoa:this.floatUtil.dtoa.bind(this.floatUtil),twrToFixed:this.floatUtil.toFixed.bind(this.floatUtil),twrToExponential:this.floatUtil.toExponential.bind(this.floatUtil),twrAtod:this.floatUtil.atod.bind(this.floatUtil),twrFcvtS:this.floatUtil.fcvtS.bind(this.floatUtil)}}null(e){throw Error("call to unimplemented twrXXX import in twrWasmModule. Use twrWasmModuleAsync ?")}}}),o("9FI45",function(t,r){e(t.exports,"twrDebugLogImpl",()=>s);let i="";function s(e){10==e||3==e?(console.log(i),i=""):(i+=String.fromCharCode(e)).length>=200&&(console.log(i),i="")}}),o("aGUWE",function(t,r){e(t.exports,"twrWasmModuleInJSMain",()=>a);var i=s("fDEU7"),o=s("5hO33"),n=s("5LsZ0");class a extends o.twrWasmModuleBase{iocanvas;d2dcanvas;iodiv;modParams;constructor(e={},t=!1){if(super(t),"undefined"==typeof document)throw Error("twrWasmModuleJSMain should only be created in JavaScript Main.");let r=document.getElementById("twr_iodiv"),s=document.getElementById("twr_iocanvas"),o=document.getElementById("twr_d2dcanvas");if(s&&o)throw Error("Both twr_iocanvas and twr_d2dcanvas defined. Currently only one canvas allowed.");if("div"==e.stdio&&!r)throw Error("twrWasmModuleBase opts=='div' but twr_iodiv not defined");if("canvas"==e.stdio&&!s)throw Error("twrWasmModuleBase, opts=='canvas' but twr_iocanvas not defined");if(e.isd2dcanvas&&!o)throw Error("twrWasmModuleBase, opts.isdrawcanvas==true but twr_d2dcanvas not defined");e=r?{stdio:"div",...e}:s?{stdio:"canvas",...e}:{stdio:"debug",...e},r||s?console.log("tiny-wasm-runtime: stdio set to: ",e.stdio):console.log("Since neither twr_iocanvas nor twr_iodiv is defined, stdout directed to debug console."),(e=s?{windim:[64,16],...e}:{windim:[0,0],...e}).imports||(e.imports={});let a=!1;e.backcolor||(a=!0,e.backcolor="black"),e.forecolor||(a=!0,e.forecolor="white"),e.fontsize||(a=!0,e.fontsize=16),void 0===e.isd2dcanvas&&(o?e.isd2dcanvas=!0:e.isd2dcanvas=!1),this.modParams={stdio:e.stdio,windim:e.windim,imports:e.imports,forecolor:e.forecolor,backcolor:e.backcolor,styleIsDefault:a,fontsize:e.fontsize,isd2dcanvas:e.isd2dcanvas},this.iodiv=new i.twrDiv(r,this.modParams,this),this.iocanvas=new n.twrCanvas(s,this.modParams,this),this.d2dcanvas=new n.twrCanvas(o,this.modParams,this)}divLog(...e){for(var t=0;to);var i=s("ghrAp");class o{div;divKeys;CURSOR=String.fromCharCode(9611);cursorOn=!1;lastChar=0;extraBR=!1;owner;constructor(e,t,r){this.div=e,this.owner=r,this.owner.isWasmModule||(this.divKeys=new i.twrSharedCircularBuffer),this.div&&!t.styleIsDefault&&(this.div.style.backgroundColor=t.backcolor,this.div.style.color=t.forecolor,this.div.style.font=t.fontsize.toString()+"px arial")}isValid(){return!!this.div}getProxyParams(){if(!this.divKeys)throw Error("internal error in getProxyParams.");return[this.divKeys.sharedArray]}charOut(e){if(this.div){switch(this.extraBR&&(this.extraBR=!1,this.cursorOn&&(this.div.innerHTML=this.div.innerHTML.slice(0,-1)),this.div.innerHTML=this.div.innerHTML.slice(0,-4),this.cursorOn&&(this.div.innerHTML+=this.CURSOR)),e){case 10:case 13:if(10==e&&13==this.lastChar)break;this.cursorOn&&(this.div.innerHTML=this.div.innerHTML.slice(0,-1)),this.div.innerHTML+="
",this.extraBR=!0,this.cursorOn&&(this.div.innerHTML+=this.CURSOR);let t=this.div.getBoundingClientRect();window.scrollTo(0,t.height+100);break;case 8:this.cursorOn&&(this.div.innerHTML=this.div.innerHTML.slice(0,-1)),this.div.innerHTML=this.div.innerHTML.slice(0,-1),this.cursorOn&&(this.div.innerHTML+=this.CURSOR);break;case 14:this.cursorOn||(this.cursorOn=!0,this.div.innerHTML+=this.CURSOR,this.div.focus());break;case 15:this.cursorOn&&(this.cursorOn=!1,this.div.innerHTML=this.div.innerHTML.slice(0,-1));break;default:this.cursorOn&&(this.div.innerHTML=this.div.innerHTML.slice(0,-1)),this.div.innerHTML+=String.fromCharCode(e),this.cursorOn&&(this.div.innerHTML+=this.CURSOR)}this.lastChar=e}}stringOut(e){for(let t=0;ti);class i{sharedArray;buf;constructor(e){if("undefined"!=typeof window&&!crossOriginIsolated&&"file:"!==window.location.protocol)throw Error("twrSharedCircularBuffer constructor, crossOriginIsolated="+crossOriginIsolated+". See SharedArrayBuffer docs.");e?this.sharedArray=e:this.sharedArray=new SharedArrayBuffer(1032),this.buf=new Int32Array(this.sharedArray),this.buf[256]=0,this.buf[257]=0}write(e){let t=this.buf[257];this.buf[t]=e,256==++t&&(t=0),this.buf[257]=t,Atomics.notify(this.buf,257)}read(){if(this.isEmpty())return -1;{let e=this.buf[256],t=this.buf[e];return e++,this.buf[256]=e,t}}readWait(){if(this.isEmpty()){let e=this.buf[256];Atomics.wait(this.buf,257,e)}return this.read()}isEmpty(){return this.buf[256]==this.buf[257]}}}),o("5hO33",function(t,r){e(t.exports,"twrWasmModuleBase",()=>o);var i=s("2Xdsi");class o{memory;mem8;mem32;memD;exports;isWorker=!1;isWasmModule;floatUtil;constructor(e=!1){this.isWasmModule=e,this.mem8=new Uint8Array,this.mem32=new Uint32Array,this.memD=new Float64Array,this.floatUtil=new i.twrFloatUtil(this)}async loadWasm(e){let t;try{t=await fetch(e)}catch(t){throw console.log("loadWasm() failed to fetch: "+e),t}if(!t.ok)throw Error("fetch response error on file '"+e+"'\n"+t.statusText);try{let e=await t.arrayBuffer(),r={...this.modParams.imports},i=await WebAssembly.instantiate(e,{env:r});if(this.exports=i.instance.exports,!this.exports)throw Error("Unexpected error - undefined instance.exports");if(this.memory)throw Error("unexpected error -- this.memory already set");if(this.memory=this.exports.memory,!this.memory)throw Error("Unexpected error - undefined exports.memory");this.mem8=new Uint8Array(this.memory.buffer),this.mem32=new Uint32Array(this.memory.buffer),this.memD=new Float64Array(this.memory.buffer),this.isWorker&&(this.memory.buffer instanceof ArrayBuffer&&console.log("twrWasmModuleAsync requires shared Memory. Add wasm-ld --shared-memory --no-check-features (see docs)"),postMessage(["setmemory",this.memory])),!this.isWasmModule||this.memory.buffer instanceof ArrayBuffer||console.log("twrWasmModule does not require shared Memory. Okay to remove wasm-ld --shared-memory --no-check-features"),this.malloc=e=>new Promise(t=>{let r=this.exports.twr_malloc;t(r(e))}),this.init()}catch(e){throw console.log("WASM instantiate error: "+e+(e.stack?"\n"+e.stack:"")),e}}init(){let e;switch(this.modParams.stdio){case"debug":default:e=0;break;case"div":e=1;break;case"canvas":e=2;break;case"null":e=3}(0,this.exports.twr_wasm_init)(e,this.mem8.length)}async callC(e){let t=await this.preCallC(e),r=this.callCImpl(e[0],t);return this.postCallC(t,e),r}async callCImpl(e,t=[]){if(!this.exports)throw Error("this.exports undefined");if(!this.exports[e])throw Error("callC: function '"+e+"' not in export table. Use --export wasm-ld flag.");return(0,this.exports[e])(...t)}async preCallC(e){if(e.constructor!==Array)throw Error("callC: params must be array, first arg is function name");if(0==e.length)throw Error("callC: missing function name");let t=[],r=0;for(let i=1;i=this.mem32.length)throw Error("invalid index passed to getLong: "+e+", this.mem32.length: "+this.mem32.length);return this.mem32[t]}setLong(e,t){let r=Math.floor(e/4);if(4*r!=e)throw Error("setLong passed non long aligned address");if(r<0||r>=this.mem32.length)throw Error("invalid index passed to setLong: "+e+", this.mem32.length: "+this.mem32.length);this.mem32[r]=t}getDouble(e){let t=Math.floor(e/8);if(8*t!=e)throw Error("getLong passed non Float64 aligned address");return this.memD[t]}setDouble(e,t){let r=Math.floor(e/8);if(8*r!=e)throw Error("setDouble passed non Float64 aligned address");this.memD[r]=t}getShort(e){if(e<0||e>=this.mem8.length)throw Error("invalid index passed to getShort: "+e);return this.mem8[e]+256*this.mem8[e+1]}getString(e,t){let r="",i=0;for(;this.mem8[e+i]&&(void 0===t||i=this.mem8.length)throw Error("invalid index passed to getU8: "+e);let t=new Uint32Array(this.mem8.slice(e,e+8).buffer),r=t[0],i=t[1];if(i<0||i>=this.mem8.length)throw Error("invalid idx.dataptr passed to getU8");if(r<0||r>this.mem8.length-i)throw Error("invalid idx.size passed to getU8");return this.mem8.slice(i,i+r)}getU32Arr(e){if(e<0||e>=this.mem8.length)throw Error("invalid index passed to getU32: "+e);let t=new Uint32Array(this.mem8.slice(e,e+8).buffer),r=t[0],i=t[1];if(i<0||i>=this.mem8.length)throw Error("invalid idx.dataptr passed to getU32");if(r<0||r>this.mem8.length-i)throw Error("invalid idx.size passed to getU32");if(r%4!=0)throw Error("idx.size is not an integer number of 32 bit words");return new Uint32Array(this.mem8.slice(i,i+r).buffer)}}}),o("2Xdsi",function(t,r){e(t.exports,"twrFloatUtil",()=>i);class i{mod;constructor(e){this.mod=e}atod(e){let t=this.mod.getString(e),r=t.trimStart().toUpperCase();return"INF"==r||"+INF"==r?Number.POSITIVE_INFINITY:"-INF"==r?Number.NEGATIVE_INFINITY:Number.parseFloat(t.replaceAll("D","e").replaceAll("d","e"))}dtoa(e,t,r,i){if(-1==i){let i=r.toString();this.mod.copyString(e,t,i)}else{let s=r.toString();s.length>i&&(s=r.toPrecision(i)),this.mod.copyString(e,t,s)}}toFixed(e,t,r,i){let s=r.toFixed(i);this.mod.copyString(e,t,s)}toExponential(e,t,r,i){let s=r.toExponential(i);this.mod.copyString(e,t,s)}fcvtS(e,t,r,i,s,o){let n,a;if(0==e||0==o||0==s||t<1)return 1;let l=0;if(Number.isNaN(r))n="1#QNAN00000000000000000000000000000".slice(0,i+1),a=1;else if(Number.isFinite(r)){if(0==r)n="000000000000000000000000000000000000".slice(0,i),a=0;else{if(r<0&&(l=1,r=Math.abs(r)),i>100||r>1e21||r<1e-99)return this.mod.copyString(e,t,""),this.mod.mem32[s]=0,1;let[o="",h=""]=r.toFixed(i).split(".");"0"==o&&(o=""),o.length>0?(a=o.length,n=o+h):a=(n=h.replace(/^0+/,"")).length-h.length}}else n="1#INF00000000000000000000000000000".slice(0,i+1),a=1;return t-1l);var i,o,n=s("ghrAp"),a=s("47Wdp");(i=o||(o={}))[i.D2D_FILLRECT=1]="D2D_FILLRECT",i[i.D2D_FILLCHAR=5]="D2D_FILLCHAR",i[i.D2D_SETLINEWIDTH=10]="D2D_SETLINEWIDTH",i[i.D2D_SETFILLSTYLERGBA=11]="D2D_SETFILLSTYLERGBA",i[i.D2D_SETFONT=12]="D2D_SETFONT",i[i.D2D_BEGINPATH=13]="D2D_BEGINPATH",i[i.D2D_MOVETO=14]="D2D_MOVETO",i[i.D2D_LINETO=15]="D2D_LINETO",i[i.D2D_FILL=16]="D2D_FILL",i[i.D2D_STROKE=17]="D2D_STROKE",i[i.D2D_SETSTROKESTYLERGBA=18]="D2D_SETSTROKESTYLERGBA",i[i.D2D_ARC=19]="D2D_ARC",i[i.D2D_STROKERECT=20]="D2D_STROKERECT",i[i.D2D_FILLTEXT=21]="D2D_FILLTEXT",i[i.D2D_IMAGEDATA=22]="D2D_IMAGEDATA",i[i.D2D_PUTIMAGEDATA=23]="D2D_PUTIMAGEDATA",i[i.D2D_BEZIERTO=24]="D2D_BEZIERTO",i[i.D2D_MEASURETEXT=25]="D2D_MEASURETEXT",i[i.D2D_SAVE=26]="D2D_SAVE",i[i.D2D_RESTORE=27]="D2D_RESTORE",i[i.D2D_CREATERADIALGRADIENT=28]="D2D_CREATERADIALGRADIENT",i[i.D2D_SETCOLORSTOP=29]="D2D_SETCOLORSTOP",i[i.D2D_SETFILLSTYLEGRADIENT=30]="D2D_SETFILLSTYLEGRADIENT",i[i.D2D_RELEASEID=31]="D2D_RELEASEID",i[i.D2D_CREATELINEARGRADIENT=32]="D2D_CREATELINEARGRADIENT",i[i.D2D_SETFILLSTYLE=33]="D2D_SETFILLSTYLE",i[i.D2D_SETSTROKESTYLE=34]="D2D_SETSTROKESTYLE";class l{ctx;props={charWidth:0,charHeight:0,foreColor:0,backColor:0,widthInChars:0,heightInChars:0,canvasHeight:0,canvasWidth:0};owner;cmdCompleteSignal;canvasKeys;precomputedObjects;constructor(e,t,r){let{forecolor:i,backcolor:s,fontsize:o,isd2dcanvas:l}=t;if(this.owner=r,this.props.widthInChars=t.windim[0],this.props.heightInChars=t.windim[1],this.owner.isWasmModule||(this.cmdCompleteSignal=new a.twrSignal,this.canvasKeys=new n.twrSharedCircularBuffer),this.precomputedObjects={},e){if(!e.getContext)throw Error("attempted to create new twrCanvas with an element that is not a valid HTMLCanvasElement");let t=e.getContext("2d");if(!t)throw Error("canvas 2D context not found in twrCanvasConstructor");t.font=o.toString()+"px Courier New",t.textBaseline="top";let r=" ",n=t.measureText(r);this.props.charWidth=Math.ceil(n.width/r.length);let a=t.measureText("X");this.props.charHeight=Math.ceil(a.fontBoundingBoxAscent+a.fontBoundingBoxDescent),l||(e.width=this.props.charWidth*this.props.widthInChars,e.height=this.props.charHeight*this.props.heightInChars),this.props.canvasHeight=e.height,this.props.canvasWidth=e.width;let h=e.getContext("2d");if(!h)throw Error("canvas 2D context not found in twrCanvas.constructor (2nd time)");this.ctx=h,this.ctx.font=o.toString()+"px Courier New",this.ctx.textBaseline="top",h.fillStyle=s,this.props.backColor=Number("0x"+h.fillStyle.slice(1)),h.fillStyle=i,this.props.foreColor=Number("0x"+h.fillStyle.slice(1))}}isValid(){return!!this.ctx}getProxyParams(){if(!this.cmdCompleteSignal||!this.canvasKeys)throw Error("internal error in getProxyParams.");return[this.props,this.cmdCompleteSignal.sharedArray,this.canvasKeys.sharedArray]}getProp(e){this.isValid()||console.log("internal error - getProp called on invalid twrCanvas");let t=this.owner.getString(e);return this.props[t]}drawSeq(e){let t;if(this.isValid()||console.log("internal error - drawSeq called on invalid twrCanvas"),!this.ctx)return;let r=this.owner.getLong(e),i=this.owner.getLong(e+4);for(;;){let e=this.owner.getLong(r+4);switch(e){case o.D2D_FILLRECT:{let e=this.owner.getDouble(r+8),t=this.owner.getDouble(r+16),i=this.owner.getDouble(r+24),s=this.owner.getDouble(r+32);this.ctx.fillRect(e,t,i,s)}break;case o.D2D_STROKERECT:{let e=this.owner.getDouble(r+8),t=this.owner.getDouble(r+16),i=this.owner.getDouble(r+24),s=this.owner.getDouble(r+32);this.ctx.strokeRect(e,t,i,s)}break;case o.D2D_FILLCHAR:{let e=this.owner.getDouble(r+8),t=this.owner.getDouble(r+16),i=String.fromCharCode(this.owner.getShort(r+24));this.ctx.fillText(i,e,t)}break;case o.D2D_FILLTEXT:{let e=this.owner.getDouble(r+8),t=this.owner.getDouble(r+16),i=this.owner.getString(this.owner.getLong(r+24));this.ctx.fillText(i,e,t)}break;case o.D2D_MEASURETEXT:{let e=this.owner.getString(this.owner.getLong(r+8)),t=this.owner.getLong(r+12),i=this.ctx.measureText(e);this.owner.setDouble(t+0,i.actualBoundingBoxAscent),this.owner.setDouble(t+8,i.actualBoundingBoxDescent),this.owner.setDouble(t+16,i.actualBoundingBoxLeft),this.owner.setDouble(t+24,i.actualBoundingBoxRight),this.owner.setDouble(t+32,i.fontBoundingBoxAscent),this.owner.setDouble(t+40,i.fontBoundingBoxDescent),this.owner.setDouble(t+48,i.width)}break;case o.D2D_SETFONT:{let e=this.owner.getString(this.owner.getLong(r+8));this.ctx.font=e}break;case o.D2D_SETFILLSTYLERGBA:{let e="#"+("00000000"+this.owner.getLong(r+8).toString(16)).slice(-8);this.ctx.fillStyle=e}break;case o.D2D_SETSTROKESTYLERGBA:{let e="#"+("00000000"+this.owner.getLong(r+8).toString(16)).slice(-8);this.ctx.strokeStyle=e}break;case o.D2D_SETFILLSTYLE:{let e=this.owner.getString(this.owner.getLong(r+8));this.ctx.fillStyle=e}break;case o.D2D_SETSTROKESTYLE:{let e=this.owner.getString(this.owner.getLong(r+8));this.ctx.strokeStyle=e}break;case o.D2D_SETLINEWIDTH:{let e=this.owner.getShort(r+8);this.ctx.lineWidth=e}break;case o.D2D_MOVETO:{let e=this.owner.getDouble(r+8),t=this.owner.getDouble(r+16);this.ctx.moveTo(e,t)}break;case o.D2D_LINETO:{let e=this.owner.getDouble(r+8),t=this.owner.getDouble(r+16);this.ctx.lineTo(e,t)}break;case o.D2D_BEZIERTO:{let e=this.owner.getDouble(r+8),t=this.owner.getDouble(r+16),i=this.owner.getDouble(r+24),s=this.owner.getDouble(r+32),o=this.owner.getDouble(r+40),n=this.owner.getDouble(r+48);this.ctx.bezierCurveTo(e,t,i,s,o,n)}break;case o.D2D_BEGINPATH:this.ctx.beginPath();break;case o.D2D_FILL:this.ctx.fill();break;case o.D2D_SAVE:this.ctx.save();break;case o.D2D_RESTORE:this.ctx.restore();break;case o.D2D_STROKE:this.ctx.stroke();break;case o.D2D_ARC:{let e=this.owner.getDouble(r+8),t=this.owner.getDouble(r+16),i=this.owner.getDouble(r+24),s=this.owner.getDouble(r+32),o=this.owner.getDouble(r+40),n=0!=this.owner.getLong(r+48);this.ctx.arc(e,t,i,s,o,n)}break;case o.D2D_IMAGEDATA:{let e=this.owner.getLong(r+8),t=this.owner.getLong(r+12),i=this.owner.getLong(r+16),s=this.owner.getLong(r+20),o=this.owner.getLong(r+24);if(o in this.precomputedObjects&&console.log("warning: D2D_IMAGEDATA ID already exists."),this.owner.isWasmModule){let r=new Uint8ClampedArray(this.owner.memory.buffer,e,t);this.precomputedObjects[o]=new ImageData(r,i,s)}else this.precomputedObjects[o]={mem8:new Uint8Array(this.owner.memory.buffer,e,t),width:i,height:s}}break;case o.D2D_CREATERADIALGRADIENT:{let e=this.owner.getDouble(r+8),t=this.owner.getDouble(r+16),i=this.owner.getDouble(r+24),s=this.owner.getDouble(r+32),o=this.owner.getDouble(r+40),n=this.owner.getDouble(r+48),a=this.owner.getLong(r+56),l=this.ctx.createRadialGradient(e,t,i,s,o,n);a in this.precomputedObjects&&console.log("warning: D2D_CREATERADIALGRADIENT ID already exists."),this.precomputedObjects[a]=l}break;case o.D2D_CREATELINEARGRADIENT:{let e=this.owner.getDouble(r+8),t=this.owner.getDouble(r+16),i=this.owner.getDouble(r+24),s=this.owner.getDouble(r+32),o=this.owner.getLong(r+40),n=this.ctx.createLinearGradient(e,t,i,s);o in this.precomputedObjects&&console.log("warning: D2D_CREATELINEARGRADIENT ID already exists."),this.precomputedObjects[o]=n}break;case o.D2D_SETCOLORSTOP:{let e=this.owner.getLong(r+8),t=this.owner.getLong(r+12),i=this.owner.getString(this.owner.getLong(r+16));if(!(e in this.precomputedObjects))throw Error("D2D_SETCOLORSTOP with invalid ID: "+e);this.precomputedObjects[e].addColorStop(t,i)}break;case o.D2D_SETFILLSTYLEGRADIENT:{let e=this.owner.getLong(r+8);if(!(e in this.precomputedObjects))throw Error("D2D_SETFILLSTYLEGRADIENT with invalid ID: "+e);let t=this.precomputedObjects[e];this.ctx.fillStyle=t}break;case o.D2D_RELEASEID:{let e=this.owner.getLong(r+8);this.precomputedObjects[e]?delete this.precomputedObjects[e]:console.log("warning: D2D_RELEASEID with undefined ID ",e)}break;case o.D2D_PUTIMAGEDATA:{let e;let t=this.owner.getLong(r+8),i=this.owner.getLong(r+12),s=this.owner.getLong(r+16),o=this.owner.getLong(r+20),n=this.owner.getLong(r+24),a=this.owner.getLong(r+28),l=this.owner.getLong(r+32);if(!(t in this.precomputedObjects))throw Error("D2D_PUTIMAGEDATA with invalid ID: "+t);if(this.owner.isWasmModule)e=this.precomputedObjects[t];else{let r=this.precomputedObjects[t];e=new ImageData(Uint8ClampedArray.from(r.mem8),r.width,r.height)}0==a&&0==l?this.ctx.putImageData(e,i,s):this.ctx.putImageData(e,i,s,o,n,a,l)}break;default:throw Error("unimplemented or unknown Sequence Type in drawSeq: "+e)}if(0==(t=this.owner.getLong(r))){if(r!=i)throw Error("assert type error in twrcanvas, ins!=lastins");break}r=t}this.cmdCompleteSignal&&this.cmdCompleteSignal.signal()}}}),o("47Wdp",function(t,r){var i,s;e(t.exports,"twrSignal",()=>o),(s=i||(i={}))[s.WAITING=0]="WAITING",s[s.SIGNALED=1]="SIGNALED";class o{sharedArray;buf;constructor(e){if("undefined"!=typeof window&&!crossOriginIsolated&&"file:"!==window.location.protocol)throw Error("twrSignal constructor, crossOriginIsolated="+crossOriginIsolated+". See SharedArrayBuffer docs.");e?this.sharedArray=e:this.sharedArray=new SharedArrayBuffer(4),this.buf=new Int32Array(this.sharedArray),this.buf[0]=i.WAITING}signal(){this.buf[0]=i.SIGNALED,Atomics.notify(this.buf,0)}wait(){this.buf[0]==i.WAITING&&Atomics.wait(this.buf,0,i.WAITING)}isSignaled(){return this.buf[0]==i.SIGNALED}reset(){this.buf[0]=i.WAITING}}}),o("lsUl2",function(t,r){e(t.exports,"twrTimeImpl",()=>i);function i(){return Date.now()}}),o("baOio",function(t,r){e(t.exports,"twrWasmModuleAsync",()=>l);var i=s("9FI45"),o=s("aGUWE"),n=s("2vKdq"),a=s("bqeaG");class l extends o.twrWasmModuleInJSMain{myWorker;malloc;loadWasmResolve;loadWasmReject;callCResolve;callCReject;initLW=!1;waitingcalls;constructor(e){if(super(e),this.malloc=e=>{throw Error("Error - un-init malloc called.")},!window.Worker)throw Error("This browser doesn't support web workers.");this.myWorker=new Worker(s("aRHnW")),this.myWorker.onmessage=this.processMsg.bind(this)}async loadWasm(e){if(this.initLW)throw Error("twrWasmAsyncModule::loadWasm can only be called once per twrWasmAsyncModule instance");return this.initLW=!0,new Promise((t,r)=>{let i;this.loadWasmResolve=t,this.loadWasmReject=r,this.malloc=e=>this.callCImpl("twr_malloc",[e]),this.waitingcalls=new n.twrWaitingCalls,i=this.d2dcanvas.isValid()?this.d2dcanvas:this.iocanvas;let s={divProxyParams:this.iodiv.getProxyParams(),canvasProxyParams:i.getProxyParams(),waitingCallsProxyParams:this.waitingcalls.getProxyParams()},o={urlToLoad:new URL(e,document.URL).href,modWorkerParams:s,modParams:this.modParams};this.myWorker.postMessage(["startup",o])})}async callC(e){let t=await this.preCallC(e);return this.callCImpl(e[0],t)}async callCImpl(e,t=[]){return new Promise((r,i)=>{this.callCResolve=r,this.callCReject=i,this.myWorker.postMessage(["callC",e,t])})}keyDownDiv(e){if(!this.iodiv||!this.iodiv.divKeys)throw Error("unexpected undefined twrWasmAsyncModule.divKeys");this.iodiv.divKeys.write((0,a.default)(e).char.charCodeAt(0))}keyDownCanvas(e){if(!this.iocanvas||!this.iocanvas.canvasKeys)throw Error("unexpected undefined twrWasmAsyncModule.canvasKeys");this.iocanvas.canvasKeys.write((0,a.default)(e).char.charCodeAt(0))}processMsg(e){let t=e.data[0],r=e.data[1];switch(t){case"divout":this.iodiv.isValid()?this.iodiv.charOut(r):console.log("error - msg divout received but iodiv is undefined.");break;case"debug":(0,i.twrDebugLogImpl)(r);break;case"drawseq":{let[e]=r;if(this.iocanvas.isValid())this.iocanvas.drawSeq(e);else if(this.d2dcanvas.isValid())this.d2dcanvas.drawSeq(e);else throw Error("msg drawseq received but canvas is undefined.");break}case"setmemory":if(this.memory=r,!this.memory)throw Error("unexpected error - undefined memory in startupOkay msg");this.mem8=new Uint8Array(this.memory.buffer),this.mem32=new Uint32Array(this.memory.buffer),this.memD=new Float64Array(this.memory.buffer);break;case"startupFail":if(this.loadWasmReject)this.loadWasmReject(r);else throw Error("twrWasmAsyncModule.processMsg unexpected error (undefined loadWasmReject)");break;case"startupOkay":if(this.loadWasmResolve)this.loadWasmResolve(void 0);else throw Error("twrWasmAsyncModule.processMsg unexpected error (undefined loadWasmResolve)");break;case"callCFail":if(this.callCReject)this.callCReject(r);else throw Error("twrWasmAsyncModule.processMsg unexpected error (undefined callCReject)");break;case"callCOkay":if(this.callCResolve)this.callCResolve(r);else throw Error("twrWasmAsyncModule.processMsg unexpected error (undefined callCResolve)");break;default:if(!this.waitingcalls)throw Error("internal error: this.waitingcalls undefined.");if(!this.waitingcalls.processMessage(t,r))throw Error("twrWasmAsyncModule - unknown and unexpected msgType: "+t)}}}}),o("2vKdq",function(t,r){e(t.exports,"twrWaitingCalls",()=>n);var i=s("47Wdp"),o=s("lsUl2");class n{callCompleteSignal;parameters;constructor(){this.callCompleteSignal=new i.twrSignal,this.parameters=new Uint32Array(new SharedArrayBuffer(4))}startSleep(e){setTimeout(()=>{this.callCompleteSignal.signal()},e)}time(){let e=(0,o.twrTimeImpl)();this.parameters[0]=e,this.callCompleteSignal.signal()}getProxyParams(){return[this.callCompleteSignal.sharedArray,this.parameters.buffer]}processMessage(e,t){switch(e){case"sleep":let[r]=t;this.startSleep(r);break;case"time":this.time();break;default:return!1}return!0}}}),o("bqeaG",function(t,r){e(t.exports,"default",()=>m);let i={a:"selectAll",c:"copy",s:"save",v:"paste",x:"cut",y:"redo",z:"undo"},s={"/":"?",".":">",",":"<","'":'"',";":":","[":"{","]":"}","\\":"|","`":"~","=":"+","-":"_",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")",a:"A",b:"B",c:"C",d:"D",e:"E",f:"F",g:"G",h:"H",i:"I",j:"J",k:"K",l:"L",m:"M",n:"N",o:"O",p:"P",q:"q",r:"R",s:"S",t:"T",u:"U",v:"V",w:"W",x:"X",y:"Y",z:"Z"},o={};for(let e in s)o[s[e]]=e;let n={0:"\\",8:"backspace",9:"tab",12:"num",13:"enter",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"caps",27:"esc",32:" ",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",44:"print",45:"insert",46:"delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",91:"meta",92:"meta",93:"meta",96:"num0",97:"num1",98:"num2",99:"num3",100:"num4",101:"num5",102:"num6",103:"num7",104:"num8",105:"num9",106:"*",107:"+",108:"num_enter",109:"num_subtract",110:"num_decimal",111:"num_divide",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",124:"print",144:"num",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",223:"`",224:"cmd",225:"alt",57392:"ctrl",63289:"num"},a={"\r":"enter"},l=JSON.parse(JSON.stringify(n));for(let e of Object.keys(a))l[e]=a[e];let h={num_subtract:"-",num_enter:"\n",num_decimal:".",num_divide:"/",enter:"\n",tab:" ",backspace:"\b"},c=["keydown","keyup"],d=()=>{let e=navigator.userAgent;return 0!==(/IEMobile|Windows Phone|Lumia/i.test(e)?"w":/iPhone|iP[oa]d/.test(e)?"i":/Android/.test(e)?"a":/BlackBerry|PlayBook|BB10/.test(e)?"b":/Mobile Safari/.test(e)?"s":/webOS|Mobile|Tablet|Opera Mini|\bCrMo\/|Opera Mobi/i.test(e)?1:0)};function u(e){let t=String.fromCharCode(e);return d()?t:t in o?o[t]:t in l?l[t]:t}function m(e){let t;if("keypress"!==e.type||d()){if("keypress"===e.type&&d())t=u(e.keyCode);else{if(!(c.indexOf(e.type)>-1))return!1;t=void 0!==e.which?n[e.which]:void 0!==e.keyCode?n[e.keyCode]:"enter"}}else t=u(e.charCode);let r=t;return e.shiftKey&&t in s?r=s[t]:e.ctrlKey&&t in i?r=i[t]:t in h&&(r=h[t]),{char:r,key:t}}}),o("aRHnW",function(e,t){var r=s("hoqmg");let i=new URL("twrmodworker.2165e649.js",import.meta.url);e.exports=r(i.toString(),i.origin,!0)}),o("hoqmg",function(e,t){e.exports=function(e,t,r){if(t===self.location.origin)return e;var i=r?"import "+JSON.stringify(e)+";":"importScripts("+JSON.stringify(e)+");";return URL.createObjectURL(new Blob([i],{type:"application/javascript"}))}}),s("eZoLj").register(new URL("",import.meta.url).toString(),JSON.parse('["kjr0c","index.528b9ee5.js","cTHdP","twrmodworker.2165e649.js"]'));
//# sourceMappingURL=index.528b9ee5.js.map
diff --git a/azure/examples/balls/dist/index.528b9ee5.js.map b/azure/examples/balls/dist/index.528b9ee5.js.map
index 15cd86a4..717bc7c2 100644
--- a/azure/examples/balls/dist/index.528b9ee5.js.map
+++ b/azure/examples/balls/dist/index.528b9ee5.js.map
@@ -1 +1 @@
-{"mappings":"A,S,E,C,C,C,C,C,C,C,E,O,c,C,E,E,C,I,E,I,E,W,C,E,a,C,C,E,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,I,E,E,Q,C,E,Q,S,C,C,C,E,E,E,O,C,W,I,E,A,G,E,GCEA,IAgBA,EAhBI,EAAU,IAAI,IAgBlB,EAfA,SAAkB,CAAO,CAAE,CAAQ,EACjC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAS,MAAM,CAAG,EAAG,GAAK,EAC5C,EAAQ,GAAG,CAAC,CAAQ,CAAC,EAAE,CAAE,CACvB,QAAS,EACT,KAAM,CAAQ,CAAC,EAAI,EAAE,AACvB,EAEJ,C,G,E,Q,S,C,C,C,E,E,E,O,C,gB,I,A,E,S,a,E,E,E,O,C,qB,I,A,E,S,kB,E,E,S,E,Q,G,E,Q,S,C,C,C,E,E,E,O,C,gB,I,G,I,E,E,S,E,E,S,E,E,QGFM,OAAO,UAAsB,EAAA,qBAAA,CACjC,MAAsC,AAGvC,aAAY,EAAc,CAAA,CAAE,CAA5B,KAIK,EAHJ,KAAK,CAAC,EAAM,CAAA,GACZ,IAAI,CAAC,MAAM,CAAC,AAAC,IAAe,MAAM,AA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AM,OAAO,EAAI,KAAO,EACjC,EAAO,CAAe,CAAC,EAAI,CAClB,KAAO,GAChB,CAAA,EAAO,CAAmB,CAAC,EAAI,AAAJ,EAGtB,CACL,KAAA,EACA,IAAA,CACF,CACF,C,G,E,Q,S,C,C,C,E,I,E,E,SCjRA,IAAI,EAAA,IAAA,IAA0B,4CAA9B,YAAA,GAAA,CACA,CAAA,EAAA,OAAA,CAAiB,EAAU,EAAI,QAAQ,GAAI,EAAI,MAAM,CAAE,CAAA,E,G,E,Q,S,C,C,C,ECAvD,EAAA,OAAA,CAAiB,SAAU,CAAS,CAAE,CAAM,CAAE,CAAK,EACjD,GAAI,IAAW,KAAK,QAAQ,CAAC,MAAM,CAGjC,OAAO,EAGP,IAAI,EAAS,EAAQ,UAAY,KAAK,SAAS,CAAC,GAAa,IAAM,iBAAmB,KAAK,SAAS,CAAC,GAAa,KAClH,OAAO,IAAI,eAAe,CAAC,IAAI,KAAK,CAAC,EAAO,CAAE,CAC5C,KAAM,wBACR,GAEJ,C,GCdA,AAAA,EAAA,SAAA,QAAA,CAA8C,IAAA,IAAoB,GAAA,YAAA,GAAA,EAAI,QAAQ,GAAG,KAAK,KAAK,CAAC","sources":["","../../../../Users/awood/AppData/Roaming/npm/node_modules/parcel/node_modules/@parcel/runtime-js/lib/helpers/bundle-manifest.js","../../source/twr-wasm-ts/index.ts","../../lib-js/twrmod.js","../../source/twr-wasm-ts/twrmod.ts","../../lib-js/twrdebug.js","../../source/twr-wasm-ts/twrdebug.ts","../../lib-js/twrmodjsmain.js","../../source/twr-wasm-ts/twrmodjsmain.ts","../../lib-js/twrdiv.js","../../source/twr-wasm-ts/twrdiv.ts","../../lib-js/twrcircular.js","../../source/twr-wasm-ts/twrcircular.ts","../../lib-js/twrmodbase.js","../../source/twr-wasm-ts/twrmodbase.ts","../../lib-js/twrfloat.js","../../source/twr-wasm-ts/twrfloat.ts","../../lib-js/twrcanvas.js","../../source/twr-wasm-ts/twrcanvas.ts","../../lib-js/twrsignal.js","../../source/twr-wasm-ts/twrsignal.ts","../../lib-js/twrdate.js","../../source/twr-wasm-ts/twrdate.ts","../../lib-js/twrmodasync.js","../../source/twr-wasm-ts/twrmodasync.ts","../../lib-js/twrwaitingcalls.js","../../source/twr-wasm-ts/twrwaitingcalls.ts","../../lib-js/whatkey.js","../../../../Users/awood/AppData/Roaming/npm/node_modules/parcel/node_modules/@parcel/runtime-js/lib/runtime-f762b97648513f2d.js","../../../../Users/awood/AppData/Roaming/npm/node_modules/parcel/node_modules/@parcel/runtime-js/lib/helpers/get-worker-url.js","../../../../Users/awood/AppData/Roaming/npm/node_modules/parcel/node_modules/@parcel/runtime-js/lib/runtime-8b48cd52cfa83e88.js"],"sourcesContent":["\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequire94c2\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequire94c2\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"eZoLj\", function(module, exports) {\n\n$parcel$export(module.exports, \"register\", () => $ae99f86db55f9acd$export$6503ec6e8aabbaf, (v) => $ae99f86db55f9acd$export$6503ec6e8aabbaf = v);\nvar $ae99f86db55f9acd$export$6503ec6e8aabbaf;\nvar $ae99f86db55f9acd$export$f7ad0328861e2f03;\n\"use strict\";\nvar $ae99f86db55f9acd$var$mapping = new Map();\nfunction $ae99f86db55f9acd$var$register(baseUrl, manifest) {\n for(var i = 0; i < manifest.length - 1; i += 2)$ae99f86db55f9acd$var$mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n}\nfunction $ae99f86db55f9acd$var$resolve(id) {\n var resolved = $ae99f86db55f9acd$var$mapping.get(id);\n if (resolved == null) throw new Error(\"Could not resolve bundle with id \" + id);\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\n$ae99f86db55f9acd$export$6503ec6e8aabbaf = $ae99f86db55f9acd$var$register;\n$ae99f86db55f9acd$export$f7ad0328861e2f03 = $ae99f86db55f9acd$var$resolve;\n\n});\n\nparcelRegister(\"4mNsm\", function(module, exports) {\n\n$parcel$export(module.exports, \"twrWasmModule\", () => (parcelRequire(\"3bkoq\")).twrWasmModule);\n$parcel$export(module.exports, \"twrWasmModuleAsync\", () => (parcelRequire(\"baOio\")).twrWasmModuleAsync);\n\nvar $3bkoq = parcelRequire(\"3bkoq\");\n\nvar $baOio = parcelRequire(\"baOio\");\n\n});\nparcelRegister(\"3bkoq\", function(module, exports) {\n\n$parcel$export(module.exports, \"twrWasmModule\", () => $251237c7cf144eb4$export$3298af74d75b595c);\n\nvar $9FI45 = parcelRequire(\"9FI45\");\n\nvar $aGUWE = parcelRequire(\"aGUWE\");\n\nvar $lsUl2 = parcelRequire(\"lsUl2\");\nclass $251237c7cf144eb4$export$3298af74d75b595c extends (0, $aGUWE.twrWasmModuleInJSMain) {\n malloc;\n constructor(opts = {}){\n super(opts, true);\n this.malloc = (size)=>{\n throw new Error(\"error - un-init malloc called\");\n };\n let canvas;\n if (this.d2dcanvas.isValid()) canvas = this.d2dcanvas;\n else canvas = this.iocanvas;\n this.modParams.imports = {\n twrDebugLog: (0, $9FI45.twrDebugLogImpl),\n twrTime: (0, $lsUl2.twrTimeImpl),\n twrDivCharOut: this.iodiv.charOut.bind(this.iodiv),\n twrCanvasGetProp: canvas.getProp.bind(canvas),\n twrCanvasDrawSeq: canvas.drawSeq.bind(canvas),\n twrCanvasCharIn: this.null,\n twrCanvasInkey: this.null,\n twrDivCharIn: this.null,\n twrSleep: this.null,\n twrSin: Math.sin,\n twrCos: Math.cos,\n twrTan: Math.tan,\n twrFAbs: Math.abs,\n twrACos: Math.acos,\n twrASin: Math.asin,\n twrATan: Math.atan,\n twrExp: Math.exp,\n twrFloor: Math.floor,\n twrCeil: Math.ceil,\n twrFMod: function(x, y) {\n return x % y;\n },\n twrLog: Math.log,\n twrPow: Math.pow,\n twrSqrt: Math.sqrt,\n twrTrunc: Math.trunc,\n twrDtoa: this.floatUtil.dtoa.bind(this.floatUtil),\n twrToFixed: this.floatUtil.toFixed.bind(this.floatUtil),\n twrToExponential: this.floatUtil.toExponential.bind(this.floatUtil),\n twrAtod: this.floatUtil.atod.bind(this.floatUtil),\n twrFcvtS: this.floatUtil.fcvtS.bind(this.floatUtil)\n };\n }\n null(inval) {\n throw new Error(\"call to unimplemented twrXXX import in twrWasmModule. Use twrWasmModuleAsync ?\");\n }\n}\n\n});\nparcelRegister(\"9FI45\", function(module, exports) {\n\n$parcel$export(module.exports, \"twrDebugLogImpl\", () => $70aa1fbe63deeaae$export$16b4216ec014493d);\nlet $70aa1fbe63deeaae$var$logline = \"\";\nfunction $70aa1fbe63deeaae$export$16b4216ec014493d(char) {\n if (char == 10 || char == 3) {\n console.log($70aa1fbe63deeaae$var$logline); // ideally without a linefeed, but there is no way to not have a LF with console.log API.\n $70aa1fbe63deeaae$var$logline = \"\";\n } else {\n $70aa1fbe63deeaae$var$logline = $70aa1fbe63deeaae$var$logline + String.fromCharCode(char);\n if ($70aa1fbe63deeaae$var$logline.length >= 200) {\n console.log($70aa1fbe63deeaae$var$logline);\n $70aa1fbe63deeaae$var$logline = \"\";\n }\n }\n}\nfunction $70aa1fbe63deeaae$export$485af4d0039b3389(ch) {\n postMessage([\n \"debug\",\n ch\n ]);\n}\n\n});\n\nparcelRegister(\"aGUWE\", function(module, exports) {\n\n$parcel$export(module.exports, \"twrWasmModuleInJSMain\", () => $7c89ffbd74fdad5b$export$2366c14363f3adb5);\n// This class extends base to handle options when called in the main Java Script thread\n\nvar $fDEU7 = parcelRequire(\"fDEU7\");\n\nvar $5hO33 = parcelRequire(\"5hO33\");\n\nvar $5LsZ0 = parcelRequire(\"5LsZ0\");\nclass $7c89ffbd74fdad5b$export$2366c14363f3adb5 extends (0, $5hO33.twrWasmModuleBase) {\n iocanvas;\n d2dcanvas;\n iodiv;\n modParams;\n constructor(opts = {}, isWasmModule = false){\n super(isWasmModule);\n if (typeof document === \"undefined\") throw new Error(\"twrWasmModuleJSMain should only be created in JavaScript Main.\");\n const eiodiv = document.getElementById(\"twr_iodiv\");\n const eiocanvas = document.getElementById(\"twr_iocanvas\");\n const ed2dcanvas = document.getElementById(\"twr_d2dcanvas\");\n if (eiocanvas && ed2dcanvas) throw new Error(\"Both twr_iocanvas and twr_d2dcanvas defined. Currently only one canvas allowed.\");\n if (opts.stdio == \"div\" && !eiodiv) throw new Error(\"twrWasmModuleBase opts=='div' but twr_iodiv not defined\");\n if (opts.stdio == \"canvas\" && !eiocanvas) throw new Error(\"twrWasmModuleBase, opts=='canvas' but twr_iocanvas not defined\");\n if (opts.isd2dcanvas && !ed2dcanvas) throw new Error(\"twrWasmModuleBase, opts.isdrawcanvas==true but twr_d2dcanvas not defined\");\n // set default opts based on elements found\n if (eiodiv) opts = {\n stdio: \"div\",\n ...opts\n };\n else if (eiocanvas) opts = {\n stdio: \"canvas\",\n ...opts\n };\n else opts = {\n stdio: \"debug\",\n ...opts\n };\n if (!eiodiv && !eiocanvas) console.log(\"Since neither twr_iocanvas nor twr_iodiv is defined, stdout directed to debug console.\");\n else console.log(\"tiny-wasm-runtime: stdio set to: \", opts.stdio);\n if (eiocanvas) opts = {\n windim: [\n 64,\n 16\n ],\n ...opts\n };\n else opts = {\n windim: [\n 0,\n 0\n ],\n ...opts\n };\n if (!opts.imports) opts.imports = {};\n let styleIsDefault = false;\n if (!opts.backcolor) {\n styleIsDefault = true;\n opts.backcolor = \"black\";\n }\n if (!opts.forecolor) {\n styleIsDefault = true;\n opts.forecolor = \"white\";\n }\n if (!opts.fontsize) {\n styleIsDefault = true;\n opts.fontsize = 16;\n }\n if (opts.isd2dcanvas === undefined) {\n if (ed2dcanvas) opts.isd2dcanvas = true;\n else opts.isd2dcanvas = false;\n }\n this.modParams = {\n stdio: opts.stdio,\n windim: opts.windim,\n imports: opts.imports,\n forecolor: opts.forecolor,\n backcolor: opts.backcolor,\n styleIsDefault: styleIsDefault,\n fontsize: opts.fontsize,\n isd2dcanvas: opts.isd2dcanvas\n };\n this.iodiv = new (0, $fDEU7.twrDiv)(eiodiv, this.modParams, this);\n this.iocanvas = new (0, $5LsZ0.twrCanvas)(eiocanvas, this.modParams, this);\n this.d2dcanvas = new (0, $5LsZ0.twrCanvas)(ed2dcanvas, this.modParams, this);\n }\n divLog(...params) {\n for(var i = 0; i < params.length; i++){\n this.iodiv.stringOut(params[i].toString());\n this.iodiv.charOut(32); // space\n }\n this.iodiv.charOut(10);\n }\n}\n\n});\nparcelRegister(\"fDEU7\", function(module, exports) {\n\n$parcel$export(module.exports, \"twrDiv\", () => $b62a3a4493ce3043$export$dd376bb3f10f6896);\n\nvar $ghrAp = parcelRequire(\"ghrAp\");\nclass $b62a3a4493ce3043$export$dd376bb3f10f6896 {\n div;\n divKeys;\n CURSOR = String.fromCharCode(9611);\n cursorOn = false;\n lastChar = 0;\n extraBR = false;\n owner;\n constructor(element, modParams, modbase){\n this.div = element;\n this.owner = modbase;\n if (!this.owner.isWasmModule) this.divKeys = new (0, $ghrAp.twrSharedCircularBuffer)(); // tsconfig, lib must be set to 2017 or higher\n if (this.div && !modParams.styleIsDefault) {\n this.div.style.backgroundColor = modParams.backcolor;\n this.div.style.color = modParams.forecolor;\n this.div.style.font = modParams.fontsize.toString() + \"px arial\";\n }\n }\n isValid() {\n return !!this.div;\n }\n getProxyParams() {\n if (!this.divKeys) throw new Error(\"internal error in getProxyParams.\");\n return [\n this.divKeys.sharedArray\n ];\n }\n /*\n * add character to div. Supports the following control codes:\n * any of CRLF, CR (/r), or LF(/n) will cause a new line\n * 0xE cursor on\n * 0x8 backspace\n * 0xF cursor off\n */ charOut(ch) {\n if (!this.div) return;\n //console.log(\"div::charout: \", ch);\n if (this.extraBR) {\n this.extraBR = false;\n if (this.cursorOn) this.div.innerHTML = this.div.innerHTML.slice(0, -1);\n this.div.innerHTML = this.div.innerHTML.slice(0, -4);\n if (this.cursorOn) this.div.innerHTML += this.CURSOR;\n }\n switch(ch){\n case 10:\n case 13:\n if (ch == 10 && this.lastChar == 13) break; // detect CR LF and treat as single new line\n if (this.cursorOn) this.div.innerHTML = this.div.innerHTML.slice(0, -1);\n this.div.innerHTML += \"
\"; //2nd break is a place holder for next line (fixes scroll issue at bottom)\n this.extraBR = true;\n if (this.cursorOn) this.div.innerHTML += this.CURSOR;\n //element.scrollIntoView();\n //element.scrollTop = element.scrollHeight;\n let p = this.div.getBoundingClientRect();\n window.scrollTo(0, p.height + 100);\n break;\n case 8:\n if (this.cursorOn) this.div.innerHTML = this.div.innerHTML.slice(0, -1);\n this.div.innerHTML = this.div.innerHTML.slice(0, -1);\n if (this.cursorOn) this.div.innerHTML += this.CURSOR;\n break;\n case 0xE:\n if (!this.cursorOn) {\n this.cursorOn = true;\n this.div.innerHTML += this.CURSOR;\n this.div.focus();\n }\n break;\n case 0xF:\n if (this.cursorOn) {\n this.cursorOn = false;\n this.div.innerHTML = this.div.innerHTML.slice(0, -1);\n }\n break;\n default:\n if (this.cursorOn) this.div.innerHTML = this.div.innerHTML.slice(0, -1);\n this.div.innerHTML += String.fromCharCode(ch);\n if (this.cursorOn) this.div.innerHTML += this.CURSOR;\n break;\n }\n this.lastChar = ch;\n }\n stringOut(str) {\n for(let i = 0; i < str.length; i++)this.charOut(str.charCodeAt(i));\n }\n}\nclass $b62a3a4493ce3043$export$b377f0bbf2c7581e {\n divKeys;\n constructor(params){\n const [divKeysBuffer] = params;\n this.divKeys = new (0, $ghrAp.twrSharedCircularBuffer)(divKeysBuffer);\n }\n charIn() {\n return this.divKeys.readWait(); // wait for a key, then read it\n }\n inkey() {\n if (this.divKeys.isEmpty()) return 0;\n else return this.charIn();\n }\n charOut(ch) {\n postMessage([\n \"divout\",\n ch\n ]);\n }\n}\n\n});\nparcelRegister(\"ghrAp\", function(module, exports) {\n\n$parcel$export(module.exports, \"twrSharedCircularBuffer\", () => $bda3a1eb26e567b5$export$a01cca24f011573a);\n//\n// This class implements a circular buffer that the main javascript thread can write to, \n// and a blocking WebWorker thread can read from. This allows keyboard characters to be transferred from the main JS thread to a WebWorker thread.\n// The WebWorker can use the readWait() function to sleep, w/o participating in the normal \n// async callback dispatch method. This allows a C program that is a single blocking loop to receive input from the primary javascript thread.\n// readWait() is used used when io_getc() or io_getstr() is called from a C function.\n//\nconst $bda3a1eb26e567b5$var$RDIDX = 256;\nconst $bda3a1eb26e567b5$var$WRIDX = 257;\nconst $bda3a1eb26e567b5$var$LEN = 256;\nclass $bda3a1eb26e567b5$export$a01cca24f011573a {\n sharedArray;\n buf;\n constructor(sa){\n if (typeof window !== \"undefined\") {\n if (!crossOriginIsolated && !(window.location.protocol === \"file:\")) throw new Error(\"twrSharedCircularBuffer constructor, crossOriginIsolated=\" + crossOriginIsolated + \". See SharedArrayBuffer docs.\");\n }\n if (sa) this.sharedArray = sa;\n else this.sharedArray = new SharedArrayBuffer(1032);\n this.buf = new Int32Array(this.sharedArray);\n this.buf[$bda3a1eb26e567b5$var$RDIDX] = 0;\n this.buf[$bda3a1eb26e567b5$var$WRIDX] = 0;\n }\n write(n) {\n let i = this.buf[$bda3a1eb26e567b5$var$WRIDX];\n this.buf[i] = n;\n i++;\n if (i == $bda3a1eb26e567b5$var$LEN) i = 0;\n this.buf[$bda3a1eb26e567b5$var$WRIDX] = i;\n Atomics.notify(this.buf, $bda3a1eb26e567b5$var$WRIDX);\n }\n read() {\n if (!this.isEmpty()) {\n let i = this.buf[$bda3a1eb26e567b5$var$RDIDX];\n let n = this.buf[i];\n i++;\n this.buf[$bda3a1eb26e567b5$var$RDIDX] = i;\n return n;\n } else return -1;\n }\n readWait() {\n if (this.isEmpty()) {\n const rdptr = this.buf[$bda3a1eb26e567b5$var$RDIDX];\n // verifies that a shared memory location still contains a given value and if so sleeps until notified.\n Atomics.wait(this.buf, $bda3a1eb26e567b5$var$WRIDX, rdptr);\n }\n return this.read();\n }\n isEmpty() {\n return this.buf[$bda3a1eb26e567b5$var$RDIDX] == this.buf[$bda3a1eb26e567b5$var$WRIDX];\n }\n}\n\n});\n\n\nparcelRegister(\"5hO33\", function(module, exports) {\n\n$parcel$export(module.exports, \"twrWasmModuleBase\", () => $3d955ccf8fb141b7$export$c83a0a3bffe07399);\n\nvar $2Xdsi = parcelRequire(\"2Xdsi\");\nclass $3d955ccf8fb141b7$export$c83a0a3bffe07399 {\n memory;\n mem8;\n mem32;\n memD;\n exports;\n isWorker = false;\n isWasmModule;\n floatUtil;\n constructor(isWasmModule = false){\n this.isWasmModule = isWasmModule; // as opposed to twrWasmModuleAsync, twrWasmModuleInWorker\n this.mem8 = new Uint8Array(); // avoid type errors\n this.mem32 = new Uint32Array(); // avoid type errors\n this.memD = new Float64Array(); // avoid type errors\n this.floatUtil = new (0, $2Xdsi.twrFloatUtil)(this);\n //console.log(\"size of mem8 after constructor\",this.mem8.length);\n }\n /*********************************************************************/ /*********************************************************************/ async loadWasm(pathToLoad) {\n //console.log(\"fileToLoad\",fileToLoad)\n let response;\n try {\n response = await fetch(pathToLoad);\n } catch (err) {\n console.log(\"loadWasm() failed to fetch: \" + pathToLoad);\n throw err;\n }\n if (!response.ok) throw new Error(\"fetch response error on file '\" + pathToLoad + \"'\\n\" + response.statusText);\n try {\n let wasmBytes = await response.arrayBuffer();\n let allimports = {\n ...this.modParams.imports\n };\n let instance = await WebAssembly.instantiate(wasmBytes, {\n env: allimports\n });\n this.exports = instance.instance.exports;\n if (!this.exports) throw new Error(\"Unexpected error - undefined instance.exports\");\n if (this.memory) throw new Error(\"unexpected error -- this.memory already set\");\n this.memory = this.exports.memory;\n if (!this.memory) throw new Error(\"Unexpected error - undefined exports.memory\");\n this.mem8 = new Uint8Array(this.memory.buffer);\n this.mem32 = new Uint32Array(this.memory.buffer);\n this.memD = new Float64Array(this.memory.buffer);\n // instanceof SharedArrayBuffer doesn't work when crossOriginIsolated not enable, and will cause a runtime error\n if (this.isWorker) {\n if (this.memory.buffer instanceof ArrayBuffer) console.log(\"twrWasmModuleAsync requires shared Memory. Add wasm-ld --shared-memory --no-check-features (see docs)\");\n postMessage([\n \"setmemory\",\n this.memory\n ]);\n }\n if (this.isWasmModule) // here if twrWasmModule, twrWasmModuleAsync overrides this function\n // instanceof SharedArrayBuffer doesn't work when crossOriginIsolated not enable, and will cause a runtime error\n {\n if (!(this.memory.buffer instanceof ArrayBuffer)) console.log(\"twrWasmModule does not require shared Memory. Okay to remove wasm-ld --shared-memory --no-check-features\");\n }\n this.malloc = (size)=>{\n return new Promise((resolve)=>{\n const m = this.exports.twr_malloc;\n resolve(m(size));\n });\n };\n this.init();\n } catch (err) {\n console.log(\"WASM instantiate error: \" + err + (err.stack ? \"\\n\" + err.stack : \"\"));\n throw err;\n }\n }\n init() {\n //console.log(\"loadWasm.init() enter\")\n let p;\n switch(this.modParams.stdio){\n case \"debug\":\n p = 0;\n break;\n case \"div\":\n p = 1;\n break;\n case \"canvas\":\n p = 2;\n break;\n case \"null\":\n p = 3;\n break;\n default:\n p = 0; // debug\n }\n const twrInit = this.exports.twr_wasm_init;\n //console.log(\"twrInit:\",twrInit)\n twrInit(p, this.mem8.length);\n }\n /* executeC takes an array where:\n * the first entry is the name of the C function in the wasm module to call (must be exported, typically via the --export clang flag)\n * and the next entries are a variable number of parameters to pass to the C function, of type\n * number - converted to int32 or float64 as appropriate\n * string - converted to a an index (ptr) into a module Memory returned via stringToMem()\n * URL - the file contents are loaded into module Memory via urlToMem(), and two C parameters are generated - index (pointer) to the memory, and length\n * Uint8Array - the array is loaded into module memory via uint8ArrayToMem(), and two parameters are generated - index (pointer) to the memory, and length\n */ async executeC(params) {\n const cparams = await this.preCallC(params);\n let retval = this.executeCImpl(params[0], cparams);\n this.postCallC(cparams, params);\n return retval;\n }\n async executeCImpl(fname, cparams = []) {\n if (!this.exports) throw new Error(\"this.exports undefined\");\n if (!this.exports[fname]) throw new Error(\"executeC: function '\" + fname + \"' not in export table. Use --export wasm-ld flag.\");\n const f = this.exports[fname];\n let cr = f(...cparams);\n return cr;\n }\n // convert an array of parameters to numbers by stuffing contents into malloc'd wasm memory\n async preCallC(params) {\n if (!(params.constructor === Array)) throw new Error(\"executeC: params must be array, first arg is function name\");\n if (params.length == 0) throw new Error(\"executeC: missing function name\");\n let cparams = [];\n let ci = 0;\n for(let i = 1; i < params.length; i++){\n const p = params[i];\n switch(typeof p){\n case \"number\":\n cparams[ci++] = p;\n break;\n case \"string\":\n cparams[ci++] = await this.putString(p);\n break;\n case \"object\":\n if (p instanceof URL) {\n const r = await this.fetchAndPutURL(p);\n cparams[ci++] = r[0]; // mem index\n cparams[ci++] = r[1]; // len\n break;\n } else if (p instanceof ArrayBuffer) {\n const r = await this.putArrayBuffer(p);\n cparams[ci++] = r; // mem index\n break;\n }\n default:\n throw new Error(\"executeC: invalid object type passed in\");\n }\n }\n return cparams;\n }\n // free the mallocs; copy array buffer data from malloc back to arraybuffer\n async postCallC(cparams, params) {\n let ci = 0;\n for(let i = 1; i < params.length; i++){\n const p = params[i];\n switch(typeof p){\n case \"number\":\n ci++;\n break;\n case \"string\":\n this.executeCImpl(\"twr_free\", [\n cparams[ci]\n ]);\n ci++;\n break;\n case \"object\":\n if (p instanceof URL) {\n this.executeCImpl(\"twr_free\", [\n cparams[ci]\n ]);\n ci = ci + 2;\n break;\n } else if (p instanceof ArrayBuffer) {\n let u8 = new Uint8Array(p);\n for(let j = 0; j < u8.length; j++)u8[j] = this.mem8[cparams[ci] + j]; // mod.mem8 is a Uint8Array view of the module's Web Assembly Memory\n this.executeCImpl(\"twr_free\", [\n cparams[ci]\n ]);\n ci++;\n break;\n } else throw new Error(\"postCallC: internal error A\");\n default:\n throw new Error(\"postCallC: internal error B\");\n }\n }\n return cparams;\n }\n /*********************************************************************/ /*********************************************************************/ // copy a string into existing buffer in the webassembly module memory\n copyString(buffer, buffer_size, sin) {\n let i;\n for(i = 0; i < sin.length && i < buffer_size - 1; i++)this.mem8[buffer + i] = sin.charCodeAt(i);\n this.mem8[buffer + i] = 0;\n }\n // allocate and copy a string into the webassembly module memory\n async putString(sin) {\n let strIndex = await this.malloc(sin.length);\n this.copyString(strIndex, sin.length, sin);\n return strIndex;\n }\n async putU8(u8a) {\n let dest = await this.malloc(u8a.length);\n for(let i = 0; i < u8a.length; i++)this.mem8[dest + i] = u8a[i];\n return dest;\n }\n async putArrayBuffer(ab) {\n const u8 = new Uint8Array(ab);\n return this.putU8(u8);\n }\n // given a url, load its contents, and stuff into wasm memory similar to Unint8Array\n async fetchAndPutURL(fnin) {\n if (!(typeof fnin === \"object\" && fnin instanceof URL)) throw new Error(\"fetchAndPutURL param must be URL\");\n try {\n let response = await fetch(fnin);\n let buffer = await response.arrayBuffer();\n let src = new Uint8Array(buffer);\n let dest = await this.putU8(src);\n return [\n dest,\n src.length\n ];\n } catch (err) {\n console.log(\"fetchAndPutURL Error. URL: \" + fnin + \"\\n\" + err + (err.stack ? \"\\n\" + err.stack : \"\"));\n throw err;\n }\n }\n getLong(idx) {\n const idx32 = Math.floor(idx / 4);\n if (idx32 * 4 != idx) throw new Error(\"getLong passed non long aligned address\");\n if (idx32 < 0 || idx32 >= this.mem32.length) throw new Error(\"invalid index passed to getLong: \" + idx + \", this.mem32.length: \" + this.mem32.length);\n const long = this.mem32[idx32];\n return long;\n }\n setLong(idx, value) {\n const idx32 = Math.floor(idx / 4);\n if (idx32 * 4 != idx) throw new Error(\"setLong passed non long aligned address\");\n if (idx32 < 0 || idx32 >= this.mem32.length) throw new Error(\"invalid index passed to setLong: \" + idx + \", this.mem32.length: \" + this.mem32.length);\n this.mem32[idx32] = value;\n }\n getDouble(idx) {\n const idx64 = Math.floor(idx / 8);\n if (idx64 * 8 != idx) throw new Error(\"getLong passed non Float64 aligned address\");\n const long = this.memD[idx64];\n return long;\n }\n setDouble(idx, value) {\n const idx64 = Math.floor(idx / 8);\n if (idx64 * 8 != idx) throw new Error(\"setDouble passed non Float64 aligned address\");\n this.memD[idx64] = value;\n }\n getShort(idx) {\n if (idx < 0 || idx >= this.mem8.length) throw new Error(\"invalid index passed to getShort: \" + idx);\n const short = this.mem8[idx] + this.mem8[idx + 1] * 256;\n return short;\n }\n // get a string out of module memory\n // null terminated, up until max of (optional) len\n getString(strIndex, len) {\n let sout = \"\";\n let i = 0;\n while(this.mem8[strIndex + i] && (len === undefined ? true : i < len) && strIndex + i < this.mem8.length){\n sout = sout + String.fromCharCode(this.mem8[strIndex + i]);\n i++;\n }\n return sout;\n }\n // get a byte array out of module memory when passed in index to [size, dataptr]\n getU8Arr(idx) {\n if (idx < 0 || idx >= this.mem8.length) throw new Error(\"invalid index passed to getU8: \" + idx);\n const rv = new Uint32Array(this.mem8.slice(idx, idx + 8).buffer);\n let size = rv[0];\n let dataptr = rv[1];\n if (dataptr < 0 || dataptr >= this.mem8.length) throw new Error(\"invalid idx.dataptr passed to getU8\");\n if (size < 0 || size > this.mem8.length - dataptr) throw new Error(\"invalid idx.size passed to getU8\");\n const u8 = this.mem8.slice(dataptr, dataptr + size);\n return u8;\n }\n // get a int32 array out of module memory when passed in index to [size, dataptr]\n getU32Arr(idx) {\n if (idx < 0 || idx >= this.mem8.length) throw new Error(\"invalid index passed to getU32: \" + idx);\n const rv = new Uint32Array(this.mem8.slice(idx, idx + 8).buffer);\n let size = rv[0];\n let dataptr = rv[1];\n if (dataptr < 0 || dataptr >= this.mem8.length) throw new Error(\"invalid idx.dataptr passed to getU32\");\n if (size < 0 || size > this.mem8.length - dataptr) throw new Error(\"invalid idx.size passed to getU32\");\n if (size % 4 != 0) throw new Error(\"idx.size is not an integer number of 32 bit words\");\n const u32 = new Uint32Array(this.mem8.slice(dataptr, dataptr + size).buffer);\n return u32;\n }\n}\n\n});\nparcelRegister(\"2Xdsi\", function(module, exports) {\n\n$parcel$export(module.exports, \"twrFloatUtil\", () => $226b87658a7c840f$export$918ffb7e046a537b);\nclass $226b87658a7c840f$export$918ffb7e046a537b {\n mod;\n constructor(mod){\n this.mod = mod;\n }\n atod(strptr) {\n const str = this.mod.getString(strptr);\n const upper = str.trimStart().toUpperCase();\n if (upper == \"INF\" || upper == \"+INF\") return Number.POSITIVE_INFINITY;\n else if (upper == \"-INF\") return Number.NEGATIVE_INFINITY;\n else {\n // allow D for exponent -- old microsoft format they still support in fctv and I support in my awbasic\n const r = Number.parseFloat(str.replaceAll(\"D\", \"e\").replaceAll(\"d\", \"e\"));\n return r;\n }\n }\n dtoa(buffer, buffer_size, value, max_precision) {\n if (max_precision == -1) {\n const r = value.toString();\n this.mod.copyString(buffer, buffer_size, r);\n } else {\n let r = value.toString();\n if (r.length > max_precision) r = value.toPrecision(max_precision);\n this.mod.copyString(buffer, buffer_size, r);\n }\n }\n toFixed(buffer, buffer_size, value, decdigits) {\n const r = value.toFixed(decdigits);\n this.mod.copyString(buffer, buffer_size, r);\n }\n toExponential(buffer, buffer_size, value, decdigits) {\n const r = value.toExponential(decdigits);\n this.mod.copyString(buffer, buffer_size, r);\n }\n // emulates the C lib function -fcvt_s, but doesn't support all ranges of number.\n // Number.toFixed() has a max size of 100 fractional digits, and values must be less than 1e+21\n // Negative exponents must be now smaller than 1e-99\n // fully-function C version also int he source, but this is the version enabled by default\n fcvtS(buffer, sizeInBytes, value, fracpart_numdigits, dec, sign // int *\n ) {\n if (buffer == 0 || sign == 0 || dec == 0 || sizeInBytes < 1) return 1;\n let digits;\n let decpos;\n let s = 0; // default to positive\n if (Number.isNaN(value)) {\n digits = \"1#QNAN00000000000000000000000000000\".slice(0, fracpart_numdigits + 1);\n decpos = 1;\n } else if (!Number.isFinite(value)) {\n digits = \"1#INF00000000000000000000000000000\".slice(0, fracpart_numdigits + 1);\n decpos = 1;\n } else if (value == 0) {\n digits = \"000000000000000000000000000000000000\".slice(0, fracpart_numdigits);\n decpos = 0;\n } else {\n if (value < 0) {\n s = 1; // negative\n value = Math.abs(value);\n }\n if (fracpart_numdigits > 100 || value > 1e+21 || value < 1e-99) {\n this.mod.copyString(buffer, sizeInBytes, \"\");\n this.mod.mem32[dec] = 0;\n return 1;\n }\n const roundValStr = value.toFixed(fracpart_numdigits);\n let [intPart = \"\", fracPart = \"\"] = roundValStr.split(\".\");\n if (intPart == \"0\") intPart = \"\";\n if (intPart.length > 0) {\n decpos = intPart.length;\n digits = intPart + fracPart;\n } else {\n digits = fracPart.replace(/^0+/, \"\"); // remove leading zeros\n decpos = digits.length - fracPart.length;\n }\n }\n if (sizeInBytes - 1 < digits.length) return 1;\n this.mod.copyString(buffer, sizeInBytes, digits);\n this.mod.setLong(dec, decpos);\n this.mod.setLong(sign, s);\n return 0;\n /*\n this version 'works' with larger numbers than using toFixed, but doesn't round correctly\n\n let decpos=0;\n let digits:string;\n if (value!=0) decpos=Math.floor(Math.log10(value))+1;\n \n if (decpos>0) { // has integer part\n const intlen=Math.max(decpos, 0);\n console.log(\"intlen=\",intlen, \"decpos=\",decpos);\n const [nonExponent, exponent=0] = value.toPrecision(intlen+fracpart_numdigits).split('e');\n digits=nonExponent.replace('.', '');\n digits=digits.replace(/^0+/,\"\"); // remove leading zeros\n }\n else { // only a fraction\n const intpart=Math.trunc(value);\n const fracpart=value-intpart;\n const prec=fracpart_numdigits- (-decpos);\n console.log(\"prec=\",prec);\n if (prec<1) {\n digits=\"\";\n }\n else {\n const [nonExponent, exponent=0] = fracpart.toPrecision(prec).split('e');\n digits=nonExponent.replace('.', '');\n digits=digits.replace(/^0+/,\"\");\n }\n }\n\n console.log(\"fcvtS value\",value,\"fracpart_numdigits\",fracpart_numdigits);\n console.log('digits=',digits);\n console.log('dec=',decpos);\n console.log(\"sign=\",s);\n */ }\n}\n\n});\n\n\nparcelRegister(\"5LsZ0\", function(module, exports) {\n\n$parcel$export(module.exports, \"twrCanvas\", () => $4327d2f23f608609$export$2f298dd69cef3c34);\n\nvar $ghrAp = parcelRequire(\"ghrAp\");\n\nvar $47Wdp = parcelRequire(\"47Wdp\");\nvar $4327d2f23f608609$var$D2DType;\n(function(D2DType) {\n D2DType[D2DType[\"D2D_FILLRECT\"] = 1] = \"D2D_FILLRECT\";\n D2DType[D2DType[\"D2D_FILLCHAR\"] = 5] = \"D2D_FILLCHAR\";\n D2DType[D2DType[\"D2D_SETLINEWIDTH\"] = 10] = \"D2D_SETLINEWIDTH\";\n D2DType[D2DType[\"D2D_SETFILLSTYLERGBA\"] = 11] = \"D2D_SETFILLSTYLERGBA\";\n D2DType[D2DType[\"D2D_SETFONT\"] = 12] = \"D2D_SETFONT\";\n D2DType[D2DType[\"D2D_BEGINPATH\"] = 13] = \"D2D_BEGINPATH\";\n D2DType[D2DType[\"D2D_MOVETO\"] = 14] = \"D2D_MOVETO\";\n D2DType[D2DType[\"D2D_LINETO\"] = 15] = \"D2D_LINETO\";\n D2DType[D2DType[\"D2D_FILL\"] = 16] = \"D2D_FILL\";\n D2DType[D2DType[\"D2D_STROKE\"] = 17] = \"D2D_STROKE\";\n D2DType[D2DType[\"D2D_SETSTROKESTYLERGBA\"] = 18] = \"D2D_SETSTROKESTYLERGBA\";\n D2DType[D2DType[\"D2D_ARC\"] = 19] = \"D2D_ARC\";\n D2DType[D2DType[\"D2D_STROKERECT\"] = 20] = \"D2D_STROKERECT\";\n D2DType[D2DType[\"D2D_FILLTEXT\"] = 21] = \"D2D_FILLTEXT\";\n D2DType[D2DType[\"D2D_IMAGEDATA\"] = 22] = \"D2D_IMAGEDATA\";\n D2DType[D2DType[\"D2D_PUTIMAGEDATA\"] = 23] = \"D2D_PUTIMAGEDATA\";\n D2DType[D2DType[\"D2D_BEZIERTO\"] = 24] = \"D2D_BEZIERTO\";\n D2DType[D2DType[\"D2D_MEASURETEXT\"] = 25] = \"D2D_MEASURETEXT\";\n D2DType[D2DType[\"D2D_SAVE\"] = 26] = \"D2D_SAVE\";\n D2DType[D2DType[\"D2D_RESTORE\"] = 27] = \"D2D_RESTORE\";\n D2DType[D2DType[\"D2D_CREATERADIALGRADIENT\"] = 28] = \"D2D_CREATERADIALGRADIENT\";\n D2DType[D2DType[\"D2D_SETCOLORSTOP\"] = 29] = \"D2D_SETCOLORSTOP\";\n D2DType[D2DType[\"D2D_SETFILLSTYLEGRADIENT\"] = 30] = \"D2D_SETFILLSTYLEGRADIENT\";\n D2DType[D2DType[\"D2D_RELEASEID\"] = 31] = \"D2D_RELEASEID\";\n D2DType[D2DType[\"D2D_CREATELINEARGRADIENT\"] = 32] = \"D2D_CREATELINEARGRADIENT\";\n D2DType[D2DType[\"D2D_SETFILLSTYLE\"] = 33] = \"D2D_SETFILLSTYLE\";\n D2DType[D2DType[\"D2D_SETSTROKESTYLE\"] = 34] = \"D2D_SETSTROKESTYLE\";\n})($4327d2f23f608609$var$D2DType || ($4327d2f23f608609$var$D2DType = {}));\nclass $4327d2f23f608609$export$2f298dd69cef3c34 {\n ctx;\n props = {\n charWidth: 0,\n charHeight: 0,\n foreColor: 0,\n backColor: 0,\n widthInChars: 0,\n heightInChars: 0,\n canvasHeight: 0,\n canvasWidth: 0\n };\n owner;\n cmdCompleteSignal;\n canvasKeys;\n precomputedObjects;\n constructor(element, modParams, modbase){\n const { forecolor: forecolor, backcolor: backcolor, fontsize: fontsize, isd2dcanvas: isd2dcanvas } = modParams;\n this.owner = modbase;\n this.props.widthInChars = modParams.windim[0];\n this.props.heightInChars = modParams.windim[1];\n if (!this.owner.isWasmModule) {\n this.cmdCompleteSignal = new (0, $47Wdp.twrSignal)();\n this.canvasKeys = new (0, $ghrAp.twrSharedCircularBuffer)(); // tsconfig, lib must be set to 2017 or higher\n }\n this.precomputedObjects = {};\n if (element) {\n if (!element.getContext) throw new Error(\"attempted to create new twrCanvas with an element that is not a valid HTMLCanvasElement\");\n let c = element.getContext(\"2d\");\n if (!c) throw new Error(\"canvas 2D context not found in twrCanvasConstructor\");\n c.font = fontsize.toString() + \"px Courier New\";\n c.textBaseline = \"top\";\n const sampleText = \" \";\n const tm = c.measureText(sampleText);\n this.props.charWidth = Math.ceil(tm.width / sampleText.length); // ceil rounds up (eg .9 -> 1)\n let fM = c.measureText(\"X\");\n this.props.charHeight = Math.ceil(fM.fontBoundingBoxAscent + fM.fontBoundingBoxDescent);\n if (!isd2dcanvas) {\n element.width = this.props.charWidth * this.props.widthInChars;\n element.height = this.props.charHeight * this.props.heightInChars;\n }\n this.props.canvasHeight = element.height;\n this.props.canvasWidth = element.width;\n //console.log(\"this.props.canvasHeight, this.props.canvasWidth\",this.props.canvasHeight,this.props.canvasWidth);\n // reset after dims changed. Not sure if ctx is needed to rest, but others do\n let c2 = element.getContext(\"2d\");\n if (!c2) throw new Error(\"canvas 2D context not found in twrCanvas.constructor (2nd time)\");\n this.ctx = c2;\n this.ctx.font = fontsize.toString() + \"px Courier New\";\n this.ctx.textBaseline = \"top\";\n c2.fillStyle = backcolor;\n this.props.backColor = Number(\"0x\" + c2.fillStyle.slice(1));\n c2.fillStyle = forecolor;\n this.props.foreColor = Number(\"0x\" + c2.fillStyle.slice(1));\n }\n //console.log(\"Create New twrCanvas: \",this.isValid(), element, this);\n //console.log(\"twrCanvas.constructor props: \", this.props);\n }\n isValid() {\n return !!this.ctx;\n }\n getProxyParams() {\n if (!this.cmdCompleteSignal || !this.canvasKeys) throw new Error(\"internal error in getProxyParams.\");\n return [\n this.props,\n this.cmdCompleteSignal.sharedArray,\n this.canvasKeys.sharedArray\n ];\n }\n getProp(pn) {\n if (!this.isValid()) console.log(\"internal error - getProp called on invalid twrCanvas\");\n const propName = this.owner.getString(pn);\n //console.log(\"enter twrCanvas.getprop: \", pn, propName, this.props[propName], this.props);\n return this.props[propName];\n }\n /* see draw2d.h for structs that match */ drawSeq(ds) {\n //console.log(\"twr::Canvas enter drawSeq\");\n if (!this.isValid()) console.log(\"internal error - drawSeq called on invalid twrCanvas\");\n if (!this.ctx) return;\n let ins = this.owner.getLong(ds); /* ds->start */ \n const lastins = this.owner.getLong(ds + 4); /* ds->last */ \n //console.log(\"instruction start, last \",ins.toString(16), lastins.toString(16));\n let next;\n //let insCount=0;\n while(true){\n //insCount++;\n const type = this.owner.getLong(ins + 4); /* hdr->type */ \n switch(type){\n case $4327d2f23f608609$var$D2DType.D2D_FILLRECT:\n {\n const x = this.owner.getDouble(ins + 8);\n const y = this.owner.getDouble(ins + 16);\n const w = this.owner.getDouble(ins + 24);\n const h = this.owner.getDouble(ins + 32);\n this.ctx.fillRect(x, y, w, h);\n }\n break;\n case $4327d2f23f608609$var$D2DType.D2D_STROKERECT:\n {\n const x = this.owner.getDouble(ins + 8);\n const y = this.owner.getDouble(ins + 16);\n const w = this.owner.getDouble(ins + 24);\n const h = this.owner.getDouble(ins + 32);\n this.ctx.strokeRect(x, y, w, h);\n }\n break;\n case $4327d2f23f608609$var$D2DType.D2D_FILLCHAR:\n {\n const x = this.owner.getDouble(ins + 8);\n const y = this.owner.getDouble(ins + 16);\n const c = this.owner.getShort(ins + 24);\n let txt = String.fromCharCode(c);\n this.ctx.fillText(txt, x, y);\n }\n break;\n case $4327d2f23f608609$var$D2DType.D2D_FILLTEXT:\n {\n const x = this.owner.getDouble(ins + 8);\n const y = this.owner.getDouble(ins + 16);\n const str = this.owner.getString(this.owner.getLong(ins + 24));\n //console.log(\"filltext \",x,y,str)\n this.ctx.fillText(str, x, y);\n }\n break;\n case $4327d2f23f608609$var$D2DType.D2D_MEASURETEXT:\n {\n const str = this.owner.getString(this.owner.getLong(ins + 8));\n const tmidx = this.owner.getLong(ins + 12);\n const tm = this.ctx.measureText(str);\n this.owner.setDouble(tmidx + 0, tm.actualBoundingBoxAscent);\n this.owner.setDouble(tmidx + 8, tm.actualBoundingBoxDescent);\n this.owner.setDouble(tmidx + 16, tm.actualBoundingBoxLeft);\n this.owner.setDouble(tmidx + 24, tm.actualBoundingBoxRight);\n this.owner.setDouble(tmidx + 32, tm.fontBoundingBoxAscent);\n this.owner.setDouble(tmidx + 40, tm.fontBoundingBoxDescent);\n this.owner.setDouble(tmidx + 48, tm.width);\n }\n break;\n case $4327d2f23f608609$var$D2DType.D2D_SETFONT:\n {\n const str = this.owner.getString(this.owner.getLong(ins + 8));\n this.ctx.font = str;\n }\n break;\n case $4327d2f23f608609$var$D2DType.D2D_SETFILLSTYLERGBA:\n {\n const color = this.owner.getLong(ins + 8);\n const cssColor = \"#\" + (\"00000000\" + color.toString(16)).slice(-8);\n this.ctx.fillStyle = cssColor;\n //console.log(\"fillstyle: \", this.ctx.fillStyle, \":\", cssColor,\":\", color)\n }\n break;\n case $4327d2f23f608609$var$D2DType.D2D_SETSTROKESTYLERGBA:\n {\n const color = this.owner.getLong(ins + 8);\n const cssColor = \"#\" + (\"00000000\" + color.toString(16)).slice(-8);\n this.ctx.strokeStyle = cssColor;\n }\n break;\n case $4327d2f23f608609$var$D2DType.D2D_SETFILLSTYLE:\n {\n const cssColor = this.owner.getString(this.owner.getLong(ins + 8));\n this.ctx.fillStyle = cssColor;\n }\n break;\n case $4327d2f23f608609$var$D2DType.D2D_SETSTROKESTYLE:\n {\n const cssColor = this.owner.getString(this.owner.getLong(ins + 8));\n this.ctx.strokeStyle = cssColor;\n }\n break;\n case $4327d2f23f608609$var$D2DType.D2D_SETLINEWIDTH:\n {\n const width = this.owner.getShort(ins + 8);\n this.ctx.lineWidth = width;\n //console.log(\"twrCanvas D2D_SETLINEWIDTH: \", this.ctx.lineWidth);\n }\n break;\n case $4327d2f23f608609$var$D2DType.D2D_MOVETO:\n {\n const x = this.owner.getDouble(ins + 8);\n const y = this.owner.getDouble(ins + 16);\n this.ctx.moveTo(x, y);\n }\n break;\n case $4327d2f23f608609$var$D2DType.D2D_LINETO:\n {\n const x = this.owner.getDouble(ins + 8);\n const y = this.owner.getDouble(ins + 16);\n this.ctx.lineTo(x, y);\n }\n break;\n case $4327d2f23f608609$var$D2DType.D2D_BEZIERTO:\n {\n const cp1x = this.owner.getDouble(ins + 8);\n const cp1y = this.owner.getDouble(ins + 16);\n const cp2x = this.owner.getDouble(ins + 24);\n const cp2y = this.owner.getDouble(ins + 32);\n const x = this.owner.getDouble(ins + 40);\n const y = this.owner.getDouble(ins + 48);\n this.ctx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);\n }\n break;\n case $4327d2f23f608609$var$D2DType.D2D_BEGINPATH:\n this.ctx.beginPath();\n break;\n case $4327d2f23f608609$var$D2DType.D2D_FILL:\n this.ctx.fill();\n break;\n case $4327d2f23f608609$var$D2DType.D2D_SAVE:\n this.ctx.save();\n break;\n case $4327d2f23f608609$var$D2DType.D2D_RESTORE:\n this.ctx.restore();\n break;\n case $4327d2f23f608609$var$D2DType.D2D_STROKE:\n this.ctx.stroke();\n break;\n case $4327d2f23f608609$var$D2DType.D2D_ARC:\n {\n const x = this.owner.getDouble(ins + 8);\n const y = this.owner.getDouble(ins + 16);\n const radius = this.owner.getDouble(ins + 24);\n const startAngle = this.owner.getDouble(ins + 32);\n const endAngle = this.owner.getDouble(ins + 40);\n const counterClockwise = this.owner.getLong(ins + 48) != 0;\n this.ctx.arc(x, y, radius, startAngle, endAngle, counterClockwise);\n }\n break;\n case $4327d2f23f608609$var$D2DType.D2D_IMAGEDATA:\n {\n const start = this.owner.getLong(ins + 8);\n const length = this.owner.getLong(ins + 12);\n const width = this.owner.getLong(ins + 16);\n const height = this.owner.getLong(ins + 20);\n const id = this.owner.getLong(ins + 24);\n if (id in this.precomputedObjects) console.log(\"warning: D2D_IMAGEDATA ID already exists.\");\n if (this.owner.isWasmModule) {\n const z = new Uint8ClampedArray(this.owner.memory.buffer, start, length);\n this.precomputedObjects[id] = new ImageData(z, width, height);\n } else this.precomputedObjects[id] = {\n mem8: new Uint8Array(this.owner.memory.buffer, start, length),\n width: width,\n height: height\n };\n //console.log(\"D2D_IMAGEDATA\",start, length, width, height, this.imageData[start]);\n }\n break;\n case $4327d2f23f608609$var$D2DType.D2D_CREATERADIALGRADIENT:\n {\n const x0 = this.owner.getDouble(ins + 8);\n const y0 = this.owner.getDouble(ins + 16);\n const radius0 = this.owner.getDouble(ins + 24);\n const x1 = this.owner.getDouble(ins + 32);\n const y1 = this.owner.getDouble(ins + 40);\n const radius1 = this.owner.getDouble(ins + 48);\n const id = this.owner.getLong(ins + 56);\n let gradient = this.ctx.createRadialGradient(x0, y0, radius0, x1, y1, radius1);\n if (id in this.precomputedObjects) console.log(\"warning: D2D_CREATERADIALGRADIENT ID already exists.\");\n this.precomputedObjects[id] = gradient;\n }\n break;\n case $4327d2f23f608609$var$D2DType.D2D_CREATELINEARGRADIENT:\n {\n const x0 = this.owner.getDouble(ins + 8);\n const y0 = this.owner.getDouble(ins + 16);\n const x1 = this.owner.getDouble(ins + 24);\n const y1 = this.owner.getDouble(ins + 32);\n const id = this.owner.getLong(ins + 40);\n let gradient = this.ctx.createLinearGradient(x0, y0, x1, y1);\n if (id in this.precomputedObjects) console.log(\"warning: D2D_CREATELINEARGRADIENT ID already exists.\");\n this.precomputedObjects[id] = gradient;\n }\n break;\n case $4327d2f23f608609$var$D2DType.D2D_SETCOLORSTOP:\n {\n const id = this.owner.getLong(ins + 8);\n const pos = this.owner.getLong(ins + 12);\n const cssColor = this.owner.getString(this.owner.getLong(ins + 16));\n if (!(id in this.precomputedObjects)) throw new Error(\"D2D_SETCOLORSTOP with invalid ID: \" + id);\n const gradient = this.precomputedObjects[id];\n gradient.addColorStop(pos, cssColor);\n }\n break;\n case $4327d2f23f608609$var$D2DType.D2D_SETFILLSTYLEGRADIENT:\n {\n const id = this.owner.getLong(ins + 8);\n if (!(id in this.precomputedObjects)) throw new Error(\"D2D_SETFILLSTYLEGRADIENT with invalid ID: \" + id);\n const gradient = this.precomputedObjects[id];\n this.ctx.fillStyle = gradient;\n }\n break;\n case $4327d2f23f608609$var$D2DType.D2D_RELEASEID:\n {\n const id = this.owner.getLong(ins + 8);\n if (this.precomputedObjects[id]) delete this.precomputedObjects[id];\n else console.log(\"warning: D2D_RELEASEID with undefined ID \", id);\n }\n break;\n case $4327d2f23f608609$var$D2DType.D2D_PUTIMAGEDATA:\n {\n const id = this.owner.getLong(ins + 8);\n const dx = this.owner.getLong(ins + 12);\n const dy = this.owner.getLong(ins + 16);\n const dirtyX = this.owner.getLong(ins + 20);\n const dirtyY = this.owner.getLong(ins + 24);\n const dirtyWidth = this.owner.getLong(ins + 28);\n const dirtyHeight = this.owner.getLong(ins + 32);\n if (!(id in this.precomputedObjects)) throw new Error(\"D2D_PUTIMAGEDATA with invalid ID: \" + id);\n //console.log(\"D2D_PUTIMAGEDATA\",start, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight, this.imageData[start]);\n let imgData;\n if (this.owner.isWasmModule) //console.log(\"D2D_PUTIMAGEDATA isWasmModule\");\n imgData = this.precomputedObjects[id];\n else {\n //console.log(\"D2D_PUTIMAGEDATA wasmModuleAsync\");\n const z = this.precomputedObjects[id]; // Uint8Array\n const ca = Uint8ClampedArray.from(z.mem8); // shallow copy\n imgData = new ImageData(ca, z.width, z.height);\n }\n if (dirtyWidth == 0 && dirtyHeight == 0) this.ctx.putImageData(imgData, dx, dy);\n else this.ctx.putImageData(imgData, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight);\n }\n break;\n default:\n throw new Error(\"unimplemented or unknown Sequence Type in drawSeq: \" + type);\n }\n next = this.owner.getLong(ins); /* hdr->next */ \n if (next == 0) {\n if (ins != lastins) throw new Error(\"assert type error in twrcanvas, ins!=lastins\");\n break;\n }\n ins = next;\n }\n if (this.cmdCompleteSignal) this.cmdCompleteSignal.signal();\n //console.log(\"Canvas.drawSeq() completed with instruction count of \", insCount);\n }\n}\nclass $4327d2f23f608609$export$c779b2cd00544976 {\n canvasKeys;\n drawCompleteSignal;\n props;\n owner;\n constructor(params, owner){\n const [props, signalBuffer, canvasKeysBuffer] = params;\n this.drawCompleteSignal = new (0, $47Wdp.twrSignal)(signalBuffer);\n this.canvasKeys = new (0, $ghrAp.twrSharedCircularBuffer)(canvasKeysBuffer);\n this.props = props;\n this.owner = owner;\n //console.log(\"Create New twrCanvasProxy: \",this.props)\n }\n charIn() {\n //ctx.commit(); not avail in chrome\n //postMessage([\"debug\", 'x']);\n return this.canvasKeys.readWait(); // wait for a key, then read it\n }\n inkey() {\n if (this.canvasKeys.isEmpty()) return 0;\n else return this.charIn();\n }\n getProp(pn) {\n const propName = this.owner.getString(pn);\n //console.log(\"enter twrCanvasProxy.getprop: \", pn, propName, this.props[propName], this.props);\n return this.props[propName];\n }\n drawSeq(ds) {\n this.drawCompleteSignal.reset();\n postMessage([\n \"drawseq\",\n [\n ds\n ]\n ]);\n this.drawCompleteSignal.wait();\n }\n}\n\n});\nparcelRegister(\"47Wdp\", function(module, exports) {\n\n$parcel$export(module.exports, \"twrSignal\", () => $3014f93b5ceae902$export$e37a7b7b851b97f3);\n//\n// This class implements a simple signal/wait mechanism\n// It is used by the WebWorker thread to block/wait, and the main JS thread to signal when to unblock\n//\nvar $3014f93b5ceae902$var$twrSignalState;\n(function(twrSignalState) {\n twrSignalState[twrSignalState[\"WAITING\"] = 0] = \"WAITING\";\n twrSignalState[twrSignalState[\"SIGNALED\"] = 1] = \"SIGNALED\";\n})($3014f93b5ceae902$var$twrSignalState || ($3014f93b5ceae902$var$twrSignalState = {}));\nclass $3014f93b5ceae902$export$e37a7b7b851b97f3 {\n sharedArray;\n buf;\n constructor(sa){\n if (typeof window !== \"undefined\") {\n if (!crossOriginIsolated && !(window.location.protocol === \"file:\")) throw new Error(\"twrSignal constructor, crossOriginIsolated=\" + crossOriginIsolated + \". See SharedArrayBuffer docs.\");\n }\n if (sa) this.sharedArray = sa;\n else this.sharedArray = new SharedArrayBuffer(4);\n this.buf = new Int32Array(this.sharedArray);\n this.buf[0] = $3014f93b5ceae902$var$twrSignalState.WAITING;\n }\n signal() {\n this.buf[0] = $3014f93b5ceae902$var$twrSignalState.SIGNALED;\n //console.log(\"about to signal\");\n Atomics.notify(this.buf, 0);\n }\n wait() {\n if (this.buf[0] == $3014f93b5ceae902$var$twrSignalState.WAITING) //console.log(\"waiting...\");\n Atomics.wait(this.buf, 0, $3014f93b5ceae902$var$twrSignalState.WAITING);\n }\n isSignaled() {\n return this.buf[0] == $3014f93b5ceae902$var$twrSignalState.SIGNALED;\n }\n reset() {\n this.buf[0] = $3014f93b5ceae902$var$twrSignalState.WAITING;\n }\n}\n\n});\n\n\n\nparcelRegister(\"lsUl2\", function(module, exports) {\n\n$parcel$export(module.exports, \"twrTimeImpl\", () => $fa07ea1a08a5d6be$export$78724cdcf7ebea1d);\nfunction $fa07ea1a08a5d6be$export$78724cdcf7ebea1d() {\n return Date.now();\n}\n\n});\n\n\nparcelRegister(\"baOio\", function(module, exports) {\n\n$parcel$export(module.exports, \"twrWasmModuleAsync\", () => $8227a48f951b1cca$export$678fe6e36ab9a6ff);\n\nvar $9FI45 = parcelRequire(\"9FI45\");\n\nvar $aGUWE = parcelRequire(\"aGUWE\");\n\nvar $2vKdq = parcelRequire(\"2vKdq\");\n\nvar $bqeaG = parcelRequire(\"bqeaG\");\n\nclass $8227a48f951b1cca$export$678fe6e36ab9a6ff extends (0, $aGUWE.twrWasmModuleInJSMain) {\n myWorker;\n malloc;\n loadWasmResolve;\n loadWasmReject;\n executeCResolve;\n executeCReject;\n initLW = false;\n waitingcalls;\n constructor(opts){\n super(opts);\n this.malloc = (size)=>{\n throw new Error(\"Error - un-init malloc called.\");\n };\n if (!window.Worker) throw new Error(\"This browser doesn't support web workers.\");\n this.myWorker = new Worker((parcelRequire(\"aRHnW\")));\n this.myWorker.onmessage = this.processMsg.bind(this);\n }\n // overrides base implementation\n async loadWasm(pathToLoad) {\n if (this.initLW) throw new Error(\"twrWasmAsyncModule::loadWasm can only be called once per twrWasmAsyncModule instance\");\n this.initLW = true;\n return new Promise((resolve, reject)=>{\n this.loadWasmResolve = resolve;\n this.loadWasmReject = reject;\n this.malloc = (size)=>{\n return this.executeCImpl(\"twr_malloc\", [\n size\n ]);\n };\n this.waitingcalls = new (0, $2vKdq.twrWaitingCalls)(); // handle's calls that cross the worker thread - main js thread boundary\n let canvas;\n if (this.d2dcanvas.isValid()) canvas = this.d2dcanvas;\n else canvas = this.iocanvas;\n const modWorkerParams = {\n divProxyParams: this.iodiv.getProxyParams(),\n canvasProxyParams: canvas.getProxyParams(),\n waitingCallsProxyParams: this.waitingcalls.getProxyParams()\n };\n const urlToLoad = new URL(pathToLoad, document.URL);\n const startMsg = {\n urlToLoad: urlToLoad.href,\n modWorkerParams: modWorkerParams,\n modParams: this.modParams\n };\n this.myWorker.postMessage([\n \"startup\",\n startMsg\n ]);\n });\n }\n async executeC(params) {\n const cparams = await this.preCallC(params); // will also validate params[0]\n return this.executeCImpl(params[0], cparams);\n }\n async executeCImpl(fname, cparams = []) {\n return new Promise((resolve, reject)=>{\n this.executeCResolve = resolve;\n this.executeCReject = reject;\n this.myWorker.postMessage([\n \"executeC\",\n fname,\n cparams\n ]);\n });\n }\n // this function should be called from HTML \"keydown\" event from \n keyDownDiv(ev) {\n if (!this.iodiv || !this.iodiv.divKeys) throw new Error(\"unexpected undefined twrWasmAsyncModule.divKeys\");\n this.iodiv.divKeys.write((0, $bqeaG.default)(ev).char.charCodeAt(0));\n }\n // this function should be called from HTML \"keydown\" event from