@cesdk/node 1.19.0-rc.0 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(global,(()=>(()=>{var e={502:(e,t,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||__filename,function(e={}){var t,o,i,a,s=e;if(void 0===globalThis.BigInt64Array){function u(e){return[0|Number(BigInt(e)&BigInt(4294967295)),0|Number(BigInt(e)>>32n)]}function l(e){return function t(r){var n;"number"==typeof r&&(r=new Uint32Array(2*r)),ArrayBuffer.isView(r)||(r.constructor&&"ArrayBuffer"===r.constructor.name?r=new Uint32Array(r):(n=r,r=new Uint32Array(2*r.length)));var o=new Proxy({slice:(e,n)=>(void 0===n&&(n=r.length),t(r.slice(2*e,2*n))),subarray:(e,n)=>t(r.subarray(2*e,2*n)),[Symbol.iterator]:function*(){for(var t=0;t<r.length/2;t++)yield e(r[2*t],r[2*t+1])},BYTES_PER_ELEMENT:2*r.BYTES_PER_ELEMENT,buffer:r.buffer,byteLength:r.byteLength,byteOffset:r.byteOffset,length:r.length/2,copyWithin:function(e,t,n){return r.copyWithin(2*e,2*t,2*n),o},set(e,t){if(void 0===t&&(t=0),2*(e.length+t)>r.length)throw new RangeError("offset is out of bounds");for(var n=0;n<e.length;n++){var o=u(e[n]);r.set(o,2*(t+n))}}},{get(t,n,o){if("string"!=typeof n||!/^\d+$/.test(n))return Reflect.get(t,n,o);var i=r[2*n],a=r[2*n+1];return e(i,a)},set(e,t,n,o){if("string"!=typeof t||!/^\d+$/.test(t))return Reflect.set(e,t,n,o);if("bigint"!=typeof n)throw new TypeError(`Cannot convert ${n} to a BigInt`);var i=u(n);return r.set(i,2*t),!0}});return n&&o.set(n),o}}globalThis.BigUint64Array=l((function(e,t){return BigInt(e)|BigInt(t)<<32n})),globalThis.BigInt64Array=l((function(e,t){return BigInt(e)|BigInt(t+2*(2147483648&t))<<32n}))}s.ready=new Promise(((e,r)=>{t=e,o=r})),s.expectedDataFileDownloads||(s.expectedDataFileDownloads=0),s.expectedDataFileDownloads++,s.ENVIRONMENT_IS_PTHREAD||s.$ww||function(e){"object"==typeof window?window.encodeURIComponent(window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/"):"undefined"==typeof process&&"undefined"!=typeof location&&encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/");var t="cesdk.data";"function"!=typeof s.locateFilePackage||s.locateFile||(s.locateFile=s.locateFilePackage,k("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)"));var n=s.locateFile?s.locateFile(t,""):t,o=e.remote_package_size,i=null,a=s.getPreloadedPackage?s.getPreloadedPackage(n,o):null;function u(){function t(e,t){if(!e)throw t+(new Error).stack}function r(e,t,r){this.start=e,this.end=t,this.audio=r}s.FS_createPath("/","ly.img.cesdk",!0,!0),s.FS_createPath("/ly.img.cesdk","fonts",!0,!0),s.FS_createPath("/ly.img.cesdk","icons",!0,!0),s.FS_createPath("/ly.img.cesdk","icu",!0,!0),s.FS_createPath("/ly.img.cesdk","presets",!0,!0),s.FS_createPath("/ly.img.cesdk","shaders",!0,!0),s.FS_createPath("/ly.img.cesdk/shaders","common",!0,!0),r.prototype={requests:{},open:function(e,t){this.name=t,this.requests[t]=this,s.addRunDependency(`fp ${this.name}`)},send:function(){},onload:function(){var e=this.byteArray.subarray(this.start,this.end);this.finish(e)},finish:function(e){s.FS_createDataFile(this.name,null,e,!0,!0,!0),s.removeRunDependency(`fp ${this.name}`),this.requests[this.name]=null}};for(var n=e.files,o=0;o<n.length;++o)new r(n[o].start,n[o].end,n[o].audio||0).open("GET",n[o].filename);function u(n){t(n,"Loading data file failed."),t(n.constructor.name===ArrayBuffer.name,"bad input to processPackageData");var o=new Uint8Array(n);r.prototype.byteArray=o;for(var i=e.files,a=0;a<i.length;++a)r.prototype.requests[i[a].filename].onload();s.removeRunDependency("datafile_cesdk.data")}s.addRunDependency("datafile_cesdk.data"),s.preloadResults||(s.preloadResults={}),s.preloadResults["cesdk.data"]={fromCache:!1},a?(u(a),a=null):i=u}a||function(e,t,n,o){if("object"!=typeof process||"object"!=typeof process.versions||"string"!=typeof process.versions.node){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onprogress=function(r){var n=e,o=t;if(r.total&&(o=r.total),r.loaded){i.addedTotal?s.dataFileDownloads[n].loaded=r.loaded:(i.addedTotal=!0,s.dataFileDownloads||(s.dataFileDownloads={}),s.dataFileDownloads[n]={loaded:r.loaded,total:o});var a=0,u=0,l=0;for(var c in s.dataFileDownloads){var d=s.dataFileDownloads[c];a+=d.total,u+=d.loaded,l++}a=Math.ceil(a*s.expectedDataFileDownloads/l),s.setStatus&&s.setStatus(`Downloading data... (${u}/${a})`)}else s.dataFileDownloads||s.setStatus&&s.setStatus("Downloading data...")},i.onerror=function(t){throw new Error("NetworkError for: "+e)},i.onload=function(e){if(!(200==i.status||304==i.status||206==i.status||0==i.status&&i.response))throw new Error(i.statusText+" : "+i.responseURL);var t=i.response;n(t)},i.send(null)}else r(147).readFile(e,(function(e,t){var r;e?(r=e,console.error("package error:",r)):n(t.buffer)}))}(n,o,(function(e){i?(i(e),i=null):a=e})),s.calledRun?u():(s.preRun||(s.preRun=[]),s.preRun.push(u))}({files:[{filename:"/ly.img.cesdk/fonts/imgly_font_inter_semibold.otf",start:0,end:270760},{filename:"/ly.img.cesdk/icons/ErrorAudio.svg",start:270760,end:271672},{filename:"/ly.img.cesdk/icons/ErrorConnection.svg",start:271672,end:272620},{filename:"/ly.img.cesdk/icons/ErrorVideo.svg",start:272620,end:273473},{filename:"/ly.img.cesdk/icons/Move.svg",start:273473,end:274748},{filename:"/ly.img.cesdk/icons/RotateIndicator.svg",start:274748,end:275745},{filename:"/ly.img.cesdk/icu/icudt71l.dat",start:275745,end:710017},{filename:"/ly.img.cesdk/presets/.keep",start:710017,end:710017},{filename:"/ly.img.cesdk/shaders/adjustments.sksl",start:710017,end:713906},{filename:"/ly.img.cesdk/shaders/black_and_white_color_mixer.sksl",start:713906,end:720223},{filename:"/ly.img.cesdk/shaders/common/ubq_adjustments.sksl",start:720223,end:724814},{filename:"/ly.img.cesdk/shaders/common/ubq_color_conversions.sksl",start:724814,end:734799},{filename:"/ly.img.cesdk/shaders/common/ubq_constants.sksl",start:734799,end:735289},{filename:"/ly.img.cesdk/shaders/common/ubq_hue_constants.sksl",start:735289,end:738456},{filename:"/ly.img.cesdk/shaders/common/ubq_noise.sksl",start:738456,end:741094},{filename:"/ly.img.cesdk/shaders/cross_cut.sksl",start:741094,end:742041},{filename:"/ly.img.cesdk/shaders/dot_pattern.sksl",start:742041,end:742556},{filename:"/ly.img.cesdk/shaders/duotone_filter.sksl",start:742556,end:743520},{filename:"/ly.img.cesdk/shaders/extrude_blur.sksl",start:743520,end:745637},{filename:"/ly.img.cesdk/shaders/glow.sksl",start:745637,end:746604},{filename:"/ly.img.cesdk/shaders/half_tone.sksl",start:746604,end:747098},{filename:"/ly.img.cesdk/shaders/hsp_selective_adjustments.sksl",start:747098,end:760698},{filename:"/ly.img.cesdk/shaders/linocut.sksl",start:760698,end:761483},{filename:"/ly.img.cesdk/shaders/liquid.sksl",start:761483,end:761965},{filename:"/ly.img.cesdk/shaders/lut_filter.sksl",start:761965,end:764828},{filename:"/ly.img.cesdk/shaders/mask_color.sksl",start:764828,end:765333},{filename:"/ly.img.cesdk/shaders/mirror.sksl",start:765333,end:765787},{filename:"/ly.img.cesdk/shaders/outliner.sksl",start:765787,end:767424},{filename:"/ly.img.cesdk/shaders/pixelize.sksl",start:767424,end:767724},{filename:"/ly.img.cesdk/shaders/placeholder_overlay_lines.sksl",start:767724,end:768412},{filename:"/ly.img.cesdk/shaders/posterize.sksl",start:768412,end:768624},{filename:"/ly.img.cesdk/shaders/radial_pixel.sksl",start:768624,end:769187},{filename:"/ly.img.cesdk/shaders/sharpie.sksl",start:769187,end:771492},{filename:"/ly.img.cesdk/shaders/shifter.sksl",start:771492,end:772176},{filename:"/ly.img.cesdk/shaders/tiltshift.sksl",start:772176,end:772758},{filename:"/ly.img.cesdk/shaders/tv_glitch.sksl",start:772758,end:773476},{filename:"/ly.img.cesdk/shaders/vignette.sksl",start:773476,end:773848}],remote_package_size:773848}),"object"==typeof window&&"object"==typeof window.performance?s.performance=performance:"object"==typeof global&&"object"==typeof global.perf_hooks&&"object"==typeof global.perf_hooks.performance?s.performance=global.perf_hooks.performance:s.performance={mark:function(){},measure:function(){}},function(e){e[e.PENDING=0]="PENDING",e[e.FINISHED=1]="FINISHED",e[e.ALLOCATED=2]="ALLOCATED",e[e.ERROR=3]="ERROR"}(i||(i={})),function(e){e[e.GET=0]="GET",e[e.POST=1]="POST"}(a||(a={}));class c{constructor(e,t){this.state=i.PENDING,this.totalBytes=0,this.receivedLength=0,this.handle=e,this.uri=t}async readChunks(e){let t=0;const r=[],n=e=>{r.push(e),t+=e.length,this.receivedLength=t};if(null==e);else if("getReader"in e){const t=e.getReader();for(;;){const{done:e,value:r}=await t.read();if(e)break;n(r)}}else await new Promise(((t,r)=>{e.on("data",n),e.on("end",(()=>t())),e.on("error",(e=>r(e)))}));const o=new Uint8Array(t);let i=0;for(const e of r)o.set(e,i),i+=e.length;return this.finish(o)}isPending(){return this.state===i.PENDING}isError(){return this.state===i.ERROR}isFinished(){return this.state===i.FINISHED}isAllocated(){return this.state===i.ALLOCATED}allocate(){if(this.isAllocated())return this;if(this.isFinished()){const e=this.result.length,t=s._malloc(e);s.HEAPU8.set(this.result,t);const r=Object.assign(Object.assign({},this),{state:i.ALLOCATED,resultAddress:t,resultLength:e});return Object.assign(this,r),r}return null}finish(e){const t=Object.assign(Object.assign({},this),{state:i.FINISHED,result:e,totalBytes:e.length});return Object.assign(this,t)}fail(e){const t=Object.assign(Object.assign({},this),{state:i.ERROR,error:e});return Object.assign(this,t)}}s.emscripten_ubq_asyncFetchManager=new class{constructor(){this._nextHandle=0,this._nextHeaderHandle=0,this._processes=new Map,this._headers=new Map,this._fetchImpl=null}_fetch(e,t){return this._fetchImpl?this._fetchImpl(e,t):fetch(e,t)}setFetch(e){this._fetchImpl=e}getProcess(e){return this._processes.get(e)}deleteProcess(e){return this._processes.delete(e)}fetch(e,t,r,n,o,i,a,u,l){const d=s.UTF8ToString(t,r),f=this._nextHandle++,p=new c(f,d);return this._processes.set(f,p),d.match(/^file:/)?this._fetchFile(p).catch((e=>(p.fail(e),Promise.reject(e)))):this._fetchRemote(p,e,n,o,i,a,u,l).catch((e=>(p.fail(e),Promise.reject(e)))),p}async _fetchFile(e){if("undefined"!=typeof window)throw new Error("File URLs supported only in Node.JS");const t=r(147),{fileURLToPath:n}=r(310),o=t.createReadStream(n(e.uri));return e.readChunks(o)}async _fetchRemote(e,t,r,n,o,i,u,l){const c=s.UTF8ToString(u,l),d=this.getHeaders(r,n),f=t===a.POST?new Uint8Array(s.HEAPU8.buffer,o,i):void 0,p=await this._fetch(e.uri,{method:a[t],headers:d,body:f,mode:"cors",credentials:c});if(p.status>=200&&p.status<=209){let t=0;return p.headers.has("Content-Length")&&(t=+p.headers.get("Content-Length")),e.totalBytes=t,e.readChunks(p.body)}return e.fail(p.statusText)}getHeaders(e,t){const r={};for(let n=0;n<t;n++){const t=s.getValue(e+4*n,"i32"),o=this._headers.get(t);r[o.key]=o.value}return r}createHeader(e,t,r,n){const o=s.UTF8ToString(e,t),i=s.UTF8ToString(r,n),a=this._nextHeaderHandle++;return this._headers.set(a,{key:o,value:i}),a}deleteHeader(e){return this._headers.delete(e)}},s.emscripten_ubq_codec_videoDecoders=new Map,s.emscripten_ubq_codec_audioDecoders=new Map,s.emscripten_ubq_codec_videoEncoders=new Map,s.emscripten_ubq_codec_audioEncoders=new Map,s.emscripten_ubq_codec_videoDecoderNextHandle=1,s.emscripten_ubq_codec_audioDecoderNextHandle=1,s.emscripten_ubq_codec_videoEncoderNextHandle=1,s.emscripten_ubq_codec_audioEncoderNextHandle=1,s.emscripten_ubq_codec_createNativeResult=function(e){const t=s._malloc(8),r=s.HEAPU32.subarray(t/4,t/4+2);if(r[0]=e.handle?e.handle:e.code?e.code:0,e.error){const t=(new TextEncoder).encode(e.error),n=s._malloc(t.length+1),o=s.HEAPU8.subarray(n,n+t.length+1);for(let e=0;e<t.length;e++)o[e]=t[e];o[t.length]=0,r[1]=n}else r[1]=0;return t},s.emscripten_ubq_codec_createVideoDecoder=function(e,t){const r=new VideoDecoder({output:n=>{const o=r.textures;let i=!1;if((r.shouldDropFrames||r.decodedFrames<r.requestedFrame||r.decodeQueueSize>=o.length)&&(i=!0),!i){var a=s.ctx;const e=r.decodedFrames%o.length;a.bindTexture(a.TEXTURE_2D,o[e]),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,n)}n.close(),r.decodedFrames++,s.emscripten_ubq_codec_onOutputDecodedVideoFrame(e,r.decodedFrames,i,t)},error:e=>{r.unexpectedError=e,console.error(e)}});return r.decodedFrames=0,r.requestedFrame=0,r.shouldDropFrames=!1,r},s.emscripten_ubq_codec_createAudioDecoder=function(e,t,r){const n=new AudioDecoder({output:o=>{if(n.flushing)return void o.close();const i=s.HEAPF32.subarray(e/4,e/4+r),a=s.HEAPF32.subarray(t/4,t/4+r),u=1===o.numberOfChannels?0:1;if("f32-planar"===o.format){let e=n.writtenFrames%r;if(e+o.numberOfFrames<=r)o.copyTo(i.subarray(e),{planeIndex:0,frameCount:o.numberOfFrames}),o.copyTo(a.subarray(e),{planeIndex:u,frameCount:o.numberOfFrames});else{const t=r-e;o.copyTo(i.subarray(e),{planeIndex:0,frameCount:t}),o.copyTo(a.subarray(e),{planeIndex:u,frameCount:t}),o.copyTo(i,{planeIndex:0,frameOffset:t}),o.copyTo(a,{planeIndex:u,frameOffset:t})}n.writtenFrames+=o.numberOfFrames}else if("s16-planar"===o.format)if(1===o.numberOfChannels){const e=new Int16Array(o.numberOfFrames);o.copyTo(e,{planeIndex:0});for(let t=0;t<o.numberOfFrames;t++){const o=e[t]/32768;let s=n.writtenFrames%r;i[s]=o,a[s]=o,n.writtenFrames++}}else{const e=new Int16Array(o.numberOfFrames),t=new Int16Array(o.numberOfFrames);o.copyTo(e,{planeIndex:0}),o.copyTo(t,{planeIndex:1});for(let s=0;s<o.numberOfFrames;s++){let o=n.writtenFrames%r;i[o]=e[s]/32768,a[o]=t[s]/32768,n.writtenFrames++}}else if("s16"===o.format){const e=new Int16Array(o.numberOfFrames*o.numberOfChannels);if(o.copyTo(e,{planeIndex:0}),1===o.numberOfChannels)for(let t=0;t<o.numberOfFrames;t++){const o=e[t]/32768;let s=n.writtenFrames%r;i[s]=o,a[s]=o,n.writtenFrames++}else for(let t=0;t<o.numberOfFrames;t++){let s=n.writtenFrames%r;i[s]=e[t*o.numberOfChannels+0]/32768,a[s]=e[t*o.numberOfChannels+1]/32768,n.writtenFrames++}}else console.error("Unsupported audio format:",o.format);o.close()},error:e=>{n.unexpectedError=e,console.error(e)}});return n.writtenFrames=0,n},s.emscripten_ubq_settings_forceWebGL1=!1;var d,f,p,h=Object.assign({},s),m="./this.program",g=(e,t)=>{throw t},y="object"==typeof window,v="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,w="";if(b){var E=r(147),_=r(17);w=v?_.dirname(w)+"/":__dirname+"/",d=(e,t)=>(e=ie(e)?new URL(e):_.normalize(e),E.readFileSync(e,t?void 0:"utf8")),p=e=>{var t=d(e,!0);return t.buffer||(t=new Uint8Array(t)),t},f=(e,t,r,n=!0)=>{e=ie(e)?new URL(e):_.normalize(e),E.readFile(e,n?void 0:"utf8",((e,o)=>{e?r(e):t(n?o.buffer:o)}))},!s.thisProgram&&process.argv.length>1&&(m=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),g=(e,t)=>{throw process.exitCode=e,t},s.inspect=()=>"[Emscripten Module object]"}else(y||v)&&(v?w=self.location.href:"undefined"!=typeof document&&document.currentScript&&(w=document.currentScript.src),n&&(w=n),w=0!==w.indexOf("blob:")?w.substr(0,w.replace(/[?#].*/,"").lastIndexOf("/")+1):"",d=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},v&&(p=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),f=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)});var C,S=s.print||console.log.bind(console),k=s.printErr||console.error.bind(console);Object.assign(s,h),h=null,s.arguments&&s.arguments,s.thisProgram&&(m=s.thisProgram),s.quit&&(g=s.quit),s.wasmBinary&&(C=s.wasmBinary);var x,P,T=s.noExitRuntime||!0;"object"!=typeof WebAssembly&&ne("no native wasm support detected");var A,F,D,B,L,R,M,O,I,U,j,$=!1;function N(e,t){e||ne(t)}function H(){var e=x.buffer;s.HEAP8=F=new Int8Array(e),s.HEAP16=B=new Int16Array(e),s.HEAP32=R=new Int32Array(e),s.HEAPU8=D=new Uint8Array(e),s.HEAPU16=L=new Uint16Array(e),s.HEAPU32=M=new Uint32Array(e),s.HEAPF32=O=new Float32Array(e),s.HEAPF64=j=new Float64Array(e),s.HEAP64=I=new BigInt64Array(e),s.HEAPU64=U=new BigUint64Array(e)}var q,V=s.INITIAL_MEMORY||16777216;N(V>=65536,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+V+"! (STACK_SIZE=65536)"),x=s.wasmMemory?s.wasmMemory:new WebAssembly.Memory({initial:V/65536,maximum:32768}),H(),V=x.buffer.byteLength;var W=[],G=[],z=[],Y=[];function X(){return T||!1}var K,Q,Z=0,J=null,ee=null;function te(e){Z++,s.monitorRunDependencies&&s.monitorRunDependencies(Z)}function re(e){if(Z--,s.monitorRunDependencies&&s.monitorRunDependencies(Z),0==Z&&(null!==J&&(clearInterval(J),J=null),ee)){var t=ee;ee=null,t()}}function ne(e){s.onAbort&&s.onAbort(e),k(e="Aborted("+e+")"),$=!0,A=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}function oe(e){return e.startsWith("data:application/octet-stream;base64,")}function ie(e){return e.startsWith("file://")}function ae(e){if(e==K&&C)return new Uint8Array(C);if(p)return p(e);throw"both async and sync fetching of the wasm failed"}function se(e,t,r){return function(e){return C||!y&&!v||"function"!=typeof fetch?Promise.resolve().then((()=>ae(e))):fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()})).catch((()=>ae(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then((e=>e)).then(r,(e=>{k("failed to asynchronously prepare wasm: "+e),ne(e)}))}oe(K="cesdk.wasm")||(Q=K,K=s.locateFile?s.locateFile(Q,w):w+Q);var ue={2347432:(e,t,r,n,o)=>"undefined"==typeof window||void 0===(window.AudioContext||window.webkitAudioContext)?0:(void 0===window.miniaudio&&(window.miniaudio={referenceCount:0},window.miniaudio.device_type={},window.miniaudio.device_type.playback=e,window.miniaudio.device_type.capture=t,window.miniaudio.device_type.duplex=r,window.miniaudio.device_state={},window.miniaudio.device_state.stopped=n,window.miniaudio.device_state.started=o,miniaudio.devices=[],miniaudio.track_device=function(e){for(var t=0;t<miniaudio.devices.length;++t)if(null==miniaudio.devices[t])return miniaudio.devices[t]=e,t;return miniaudio.devices.push(e),miniaudio.devices.length-1},miniaudio.untrack_device_by_index=function(e){for(miniaudio.devices[e]=null;miniaudio.devices.length>0&&null==miniaudio.devices[miniaudio.devices.length-1];)miniaudio.devices.pop()},miniaudio.untrack_device=function(e){for(var t=0;t<miniaudio.devices.length;++t)if(miniaudio.devices[t]==e)return miniaudio.untrack_device_by_index(t)},miniaudio.get_device_by_index=function(e){return miniaudio.devices[e]},miniaudio.unlock_event_types=["touchstart","touchend","click"],miniaudio.unlock=function(){for(var e=0;e<miniaudio.devices.length;++e){var t=miniaudio.devices[e];null!=t&&null!=t.webaudio&&2===t.state&&t.webaudio.resume()}miniaudio.unlock_event_types.map((function(e){document.removeEventListener(e,miniaudio.unlock,!0)}))},miniaudio.unlock_event_types.map((function(e){document.addEventListener(e,miniaudio.unlock,!0)}))),window.miniaudio.referenceCount+=1,1),2349422:()=>{void 0!==window.miniaudio&&(window.miniaudio.referenceCount-=1,0===window.miniaudio.referenceCount&&delete window.miniaudio)},2349586:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,2349690:()=>{try{var e=new(window.AudioContext||window.webkitAudioContext),t=e.sampleRate;return e.close(),t}catch(e){return 0}},2349861:(e,t,r,n,o,i)=>{var a=e,u=t,l=r,c=n,d=o,f=i;if(void 0===window.miniaudio)return-1;var p={},h={};a==window.miniaudio.device_type.playback&&(h.sampleRate=l),p.webaudio=new(window.AudioContext||window.webkitAudioContext)(h),p.webaudio.suspend(),p.state=window.miniaudio.device_state.stopped;var m=0,g=u;return a!=window.miniaudio.device_type.playback&&(m=u),p.scriptNode=p.webaudio.createScriptProcessor(c,m,g),p.scriptNode.onaudioprocess=function(e){if(null!=p.intermediaryBufferView&&0!=p.intermediaryBufferView.length||(p.intermediaryBufferView=new Float32Array(s.HEAPF32.buffer,d,c*u)),a==miniaudio.device_type.capture||a==miniaudio.device_type.duplex){for(var t=0;t<u;t+=1)for(var r=e.inputBuffer.getChannelData(t),n=p.intermediaryBufferView,o=0;o<c;o+=1)n[o*u+t]=r[o];Qn(f,c,d)}if(a==miniaudio.device_type.playback||a==miniaudio.device_type.duplex)for(Zn(f,c,d),t=0;t<e.outputBuffer.numberOfChannels;++t){var i=e.outputBuffer.getChannelData(t);for(n=p.intermediaryBufferView,o=0;o<c;o+=1)i[o]=n[o*u+t]}else for(t=0;t<e.outputBuffer.numberOfChannels;++t)e.outputBuffer.getChannelData(t).fill(0)},a!=miniaudio.device_type.capture&&a!=miniaudio.device_type.duplex||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(e){p.streamNode=p.webaudio.createMediaStreamSource(e),p.streamNode.connect(p.scriptNode),p.scriptNode.connect(p.webaudio.destination)})).catch((function(e){console.log("Failed to get user media: "+e)})),a==miniaudio.device_type.playback&&p.scriptNode.connect(p.webaudio.destination),miniaudio.track_device(p)},2352644:e=>miniaudio.get_device_by_index(e).webaudio.sampleRate,2352710:e=>{var t=miniaudio.get_device_by_index(e);void 0!==t.scriptNode&&(t.scriptNode.onaudioprocess=function(e){},t.scriptNode.disconnect(),t.scriptNode=void 0),void 0!==t.streamNode&&(t.streamNode.disconnect(),t.streamNode=void 0),t.webaudio.close(),t.webaudio=void 0},2353075:e=>{miniaudio.untrack_device_by_index(e)},2353118:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.resume(),t.state=miniaudio.device_state.started},2353243:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.suspend(),t.state=miniaudio.device_state.stopped},2353369:()=>!!globalThis.ubq_browserTabHidden,2353415:()=>F.length};function le(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var ce=e=>{for(;e.length>0;)e.shift()(s)},de=[],fe=0;function pe(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){M[this.ptr+4>>2]=e},this.get_type=function(){return M[this.ptr+4>>2]},this.set_destructor=function(e){M[this.ptr+8>>2]=e},this.get_destructor=function(){return M[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,F[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=F[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,F[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=F[this.ptr+13>>0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)},this.set_adjusted_ptr=function(e){M[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return M[this.ptr+16>>2]},this.get_exception_ptr=function(){if(lo(this.get_type()))return M[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var he=e=>{var t=fe;if(!t)return Jn(0),0;var r=new pe(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Jn(0),t;for(var o in e){var i=e[o];if(0===i||i===n)break;var a=r.ptr+16;if(uo(i,n,a))return Jn(i),t}return Jn(n),t},me={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=me.isAbs(e),r="/"===e.substr(-1);return(e=me.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=me.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=me.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return me.normalize(e.join("/"))},join2:(e,t)=>me.normalize(e+"/"+t)},ge=e=>(ge=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(b)try{var e=r(113);if(e.randomFillSync)return t=>e.randomFillSync(t);var t=e.randomBytes;return e=>(e.set(t(e.byteLength)),e)}catch(e){}ne("initRandomDevice")})())(e),ye={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:Ae.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=me.isAbs(n)}return(t?"/":"")+(e=me.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,t)=>{function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=ye.resolve(e).substr(1),t=ye.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},ve="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,be=(e,t,r)=>{for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&ve)return ve.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var u=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&e[t++])<65536)i+=String.fromCharCode(a);else{var l=a-65536;i+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i},we=[],Ee=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},_e=(e,t,r,n)=>{if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(r>=i)break;t[r++]=s}else if(s<=2047){if(r+1>=i)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=i)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o};function Ce(e,t,r){var n=r>0?r:Ee(e)+1,o=new Array(n),i=_e(e,o,0,o.length);return t&&(o.length=i),o}var Se={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){Se.ttys[e]={input:[],output:[],ops:t},Ae.registerDevice(e,Se.stream_ops)},stream_ops:{open:function(e){var t=Se.ttys[e.node.rdev];if(!t)throw new Ae.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.fsync(e.tty)},fsync:function(e){e.tty.ops.fsync(e.tty)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new Ae.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new Ae.ErrnoError(29)}if(void 0===s&&0===i)throw new Ae.ErrnoError(6);if(null==s)break;i++,t[r+a]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new Ae.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new Ae.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){return(()=>{if(!we.length){var e=null;if(b){var t=Buffer.alloc(256),r=0,n=process.stdin.fd;try{r=E.readSync(n,t,0,256,-1)}catch(e){if(!e.toString().includes("EOF"))throw e;r=0}e=r>0?t.slice(0,r).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;we=Ce(e,!0)}return we.shift()})()},put_char:function(e,t){null===t||10===t?(S(be(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(S(be(e.output,0)),e.output=[])},ioctl_tcgets:function(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets:function(e,t,r){return 0},ioctl_tiocgwinsz:function(e){return[24,80]}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(k(be(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(k(be(e.output,0)),e.output=[])}}},ke=e=>{e=((e,t)=>65536*Math.ceil(e/65536))(e);var t=to(65536,e);return t?((e,t)=>(D.fill(0,e,e+t),e))(t,e):0},xe={ops_table:null,mount:e=>xe.createNode(null,"/",16895,0),createNode(e,t,r,n){if(Ae.isBlkdev(r)||Ae.isFIFO(r))throw new Ae.ErrnoError(63);xe.ops_table||(xe.ops_table={dir:{node:{getattr:xe.node_ops.getattr,setattr:xe.node_ops.setattr,lookup:xe.node_ops.lookup,mknod:xe.node_ops.mknod,rename:xe.node_ops.rename,unlink:xe.node_ops.unlink,rmdir:xe.node_ops.rmdir,readdir:xe.node_ops.readdir,symlink:xe.node_ops.symlink},stream:{llseek:xe.stream_ops.llseek}},file:{node:{getattr:xe.node_ops.getattr,setattr:xe.node_ops.setattr},stream:{llseek:xe.stream_ops.llseek,read:xe.stream_ops.read,write:xe.stream_ops.write,allocate:xe.stream_ops.allocate,mmap:xe.stream_ops.mmap,msync:xe.stream_ops.msync}},link:{node:{getattr:xe.node_ops.getattr,setattr:xe.node_ops.setattr,readlink:xe.node_ops.readlink},stream:{}},chrdev:{node:{getattr:xe.node_ops.getattr,setattr:xe.node_ops.setattr},stream:Ae.chrdev_stream_ops}});var o=Ae.createNode(e,t,r,n);return Ae.isDir(o.mode)?(o.node_ops=xe.ops_table.dir.node,o.stream_ops=xe.ops_table.dir.stream,o.contents={}):Ae.isFile(o.mode)?(o.node_ops=xe.ops_table.file.node,o.stream_ops=xe.ops_table.file.stream,o.usedBytes=0,o.contents=null):Ae.isLink(o.mode)?(o.node_ops=xe.ops_table.link.node,o.stream_ops=xe.ops_table.link.stream):Ae.isChrdev(o.mode)&&(o.node_ops=xe.ops_table.chrdev.node,o.stream_ops=xe.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=Ae.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,Ae.isDir(e.mode)?t.size=4096:Ae.isFile(e.mode)?t.size=e.usedBytes:Ae.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&xe.resizeFileStorage(e,t.size)},lookup(e,t){throw Ae.genericErrors[44]},mknod:(e,t,r,n)=>xe.createNode(e,t,r,n),rename(e,t,r){if(Ae.isDir(e.mode)){var n;try{n=Ae.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new Ae.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var r=Ae.lookupNode(e,t);for(var n in r.contents)throw new Ae.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink(e,t,r){var n=xe.createNode(e,t,41471,0);return n.link=r,n},readlink(e){if(!Ae.isLink(e.mode))throw new Ae.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(a>8&&i.subarray)t.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)t[r+s]=i[o+s];return a},write(e,t,r,n,o,i){if(t.buffer===F.buffer&&(i=!1),!n)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=t.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=t.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(t.subarray(r,r+n),o),n}if(xe.expandFileStorage(a,o+n),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=t[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&Ae.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new Ae.ErrnoError(28);return n},allocate(e,t,r){xe.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap(e,t,r,n,o){if(!Ae.isFile(e.node.mode))throw new Ae.ErrnoError(43);var i,a,s=e.node.contents;if(2&o||s.buffer!==F.buffer){if((r>0||r+t<s.length)&&(s=s.subarray?s.subarray(r,r+t):Array.prototype.slice.call(s,r,r+t)),a=!0,!(i=ke(t)))throw new Ae.ErrnoError(48);F.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:(e,t,r,n,o)=>(xe.stream_ops.write(e,t,0,n,r,!1),0)}},Pe=s.preloadPlugins||[];function Te(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}var Ae={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(e,t={})=>{if(!(e=ye.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new Ae.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),n=Ae.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&t.parent)break;if(n=Ae.lookupNode(n,r[i]),o=me.join2(o,r[i]),Ae.isMountpoint(n)&&(!a||a&&t.follow_mount)&&(n=n.mounted.root),!a||t.follow)for(var s=0;Ae.isLink(n.mode);){var u=Ae.readlink(o);if(o=ye.resolve(me.dirname(o),u),n=Ae.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new Ae.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var t;;){if(Ae.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?`${r}/${t}`:r+t:r}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName:(e,t)=>{for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%Ae.nameTable.length},hashAddNode:e=>{var t=Ae.hashName(e.parent.id,e.name);e.name_next=Ae.nameTable[t],Ae.nameTable[t]=e},hashRemoveNode:e=>{var t=Ae.hashName(e.parent.id,e.name);if(Ae.nameTable[t]===e)Ae.nameTable[t]=e.name_next;else for(var r=Ae.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=Ae.mayLookup(e);if(r)throw new Ae.ErrnoError(r,e);for(var n=Ae.hashName(e.id,t),o=Ae.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return Ae.lookup(e,t)},createNode:(e,t,r,n)=>{var o=new Ae.FSNode(e,t,r,n);return Ae.hashAddNode(o),o},destroyNode:e=>{Ae.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagsToPermissionString:e=>{var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>Ae.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>Ae.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate:(e,t)=>{try{return Ae.lookupNode(e,t),20}catch(e){}return Ae.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var n;try{n=Ae.lookupNode(e,t)}catch(e){return e.errno}var o=Ae.nodePermissions(e,"wx");if(o)return o;if(r){if(!Ae.isDir(n.mode))return 54;if(Ae.isRoot(n)||Ae.getPath(n)===Ae.cwd())return 10}else if(Ae.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?Ae.isLink(e.mode)?32:Ae.isDir(e.mode)&&("r"!==Ae.flagsToPermissionString(t)||512&t)?31:Ae.nodePermissions(e,Ae.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:()=>{for(var e=0;e<=Ae.MAX_OPEN_FDS;e++)if(!Ae.streams[e])return e;throw new Ae.ErrnoError(33)},getStreamChecked:e=>{var t=Ae.getStream(e);if(!t)throw new Ae.ErrnoError(8);return t},getStream:e=>Ae.streams[e],createStream:(e,t=-1)=>(Ae.FSStream||(Ae.FSStream=function(){this.shared={}},Ae.FSStream.prototype={},Object.defineProperties(Ae.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return 0!=(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new Ae.FSStream,e),-1==t&&(t=Ae.nextfd()),e.fd=t,Ae.streams[t]=e,e),closeStream:e=>{Ae.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=Ae.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new Ae.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{Ae.devices[e]={stream_ops:t}},getDevice:e=>Ae.devices[e],getMounts:e=>{for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs:(e,t)=>{"function"==typeof e&&(t=e,e=!1),Ae.syncFSRequests++,Ae.syncFSRequests>1&&k(`warning: ${Ae.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=Ae.getMounts(Ae.root.mount),n=0;function o(e){return Ae.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount:(e,t,r)=>{var n,o="/"===r,i=!r;if(o&&Ae.root)throw new Ae.ErrnoError(10);if(!o&&!i){var a=Ae.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,Ae.isMountpoint(n))throw new Ae.ErrnoError(10);if(!Ae.isDir(n.mode))throw new Ae.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?Ae.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:e=>{var t=Ae.lookupPath(e,{follow_mount:!1});if(!Ae.isMountpoint(t.node))throw new Ae.ErrnoError(28);var r=t.node,n=r.mounted,o=Ae.getMounts(n);Object.keys(Ae.nameTable).forEach((e=>{for(var t=Ae.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&Ae.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod:(e,t,r)=>{var n=Ae.lookupPath(e,{parent:!0}).node,o=me.basename(e);if(!o||"."===o||".."===o)throw new Ae.ErrnoError(28);var i=Ae.mayCreate(n,o);if(i)throw new Ae.ErrnoError(i);if(!n.node_ops.mknod)throw new Ae.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,Ae.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,Ae.mknod(e,t,0)),mkdirTree:(e,t)=>{for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{Ae.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,Ae.mknod(e,t,r)),symlink:(e,t)=>{if(!ye.resolve(e))throw new Ae.ErrnoError(44);var r=Ae.lookupPath(t,{parent:!0}).node;if(!r)throw new Ae.ErrnoError(44);var n=me.basename(t),o=Ae.mayCreate(r,n);if(o)throw new Ae.ErrnoError(o);if(!r.node_ops.symlink)throw new Ae.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:(e,t)=>{var r,n,o=me.dirname(e),i=me.dirname(t),a=me.basename(e),s=me.basename(t);if(r=Ae.lookupPath(e,{parent:!0}).node,n=Ae.lookupPath(t,{parent:!0}).node,!r||!n)throw new Ae.ErrnoError(44);if(r.mount!==n.mount)throw new Ae.ErrnoError(75);var u,l=Ae.lookupNode(r,a),c=ye.relative(e,i);if("."!==c.charAt(0))throw new Ae.ErrnoError(28);if("."!==(c=ye.relative(t,o)).charAt(0))throw new Ae.ErrnoError(55);try{u=Ae.lookupNode(n,s)}catch(e){}if(l!==u){var d=Ae.isDir(l.mode),f=Ae.mayDelete(r,a,d);if(f)throw new Ae.ErrnoError(f);if(f=u?Ae.mayDelete(n,s,d):Ae.mayCreate(n,s))throw new Ae.ErrnoError(f);if(!r.node_ops.rename)throw new Ae.ErrnoError(63);if(Ae.isMountpoint(l)||u&&Ae.isMountpoint(u))throw new Ae.ErrnoError(10);if(n!==r&&(f=Ae.nodePermissions(r,"w")))throw new Ae.ErrnoError(f);Ae.hashRemoveNode(l);try{r.node_ops.rename(l,n,s)}catch(e){throw e}finally{Ae.hashAddNode(l)}}},rmdir:e=>{var t=Ae.lookupPath(e,{parent:!0}).node,r=me.basename(e),n=Ae.lookupNode(t,r),o=Ae.mayDelete(t,r,!0);if(o)throw new Ae.ErrnoError(o);if(!t.node_ops.rmdir)throw new Ae.ErrnoError(63);if(Ae.isMountpoint(n))throw new Ae.ErrnoError(10);t.node_ops.rmdir(t,r),Ae.destroyNode(n)},readdir:e=>{var t=Ae.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Ae.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=Ae.lookupPath(e,{parent:!0}).node;if(!t)throw new Ae.ErrnoError(44);var r=me.basename(e),n=Ae.lookupNode(t,r),o=Ae.mayDelete(t,r,!1);if(o)throw new Ae.ErrnoError(o);if(!t.node_ops.unlink)throw new Ae.ErrnoError(63);if(Ae.isMountpoint(n))throw new Ae.ErrnoError(10);t.node_ops.unlink(t,r),Ae.destroyNode(n)},readlink:e=>{var t=Ae.lookupPath(e).node;if(!t)throw new Ae.ErrnoError(44);if(!t.node_ops.readlink)throw new Ae.ErrnoError(28);return ye.resolve(Ae.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=Ae.lookupPath(e,{follow:!t}).node;if(!r)throw new Ae.ErrnoError(44);if(!r.node_ops.getattr)throw new Ae.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>Ae.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?Ae.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Ae.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{Ae.chmod(e,t,!0)},fchmod:(e,t)=>{var r=Ae.getStreamChecked(e);Ae.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?Ae.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new Ae.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{Ae.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=Ae.getStreamChecked(e);Ae.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new Ae.ErrnoError(28);var r;if(!(r="string"==typeof e?Ae.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Ae.ErrnoError(63);if(Ae.isDir(r.mode))throw new Ae.ErrnoError(31);if(!Ae.isFile(r.mode))throw new Ae.ErrnoError(28);var n=Ae.nodePermissions(r,"w");if(n)throw new Ae.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=Ae.getStreamChecked(e);if(0==(2097155&r.flags))throw new Ae.ErrnoError(28);Ae.truncate(r.node,t)},utime:(e,t,r)=>{var n=Ae.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r)=>{if(""===e)throw new Ae.ErrnoError(44);var n;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?function(e){var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===t)throw new Error(`Unknown file open mode: ${e}`);return t}(t):t)?4095&r|32768:0,"object"==typeof e)n=e;else{e=me.normalize(e);try{n=Ae.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(n){if(128&t)throw new Ae.ErrnoError(20)}else n=Ae.mknod(e,r,0),o=!0;if(!n)throw new Ae.ErrnoError(44);if(Ae.isChrdev(n.mode)&&(t&=-513),65536&t&&!Ae.isDir(n.mode))throw new Ae.ErrnoError(54);if(!o){var i=Ae.mayOpen(n,t);if(i)throw new Ae.ErrnoError(i)}512&t&&!o&&Ae.truncate(n,0),t&=-131713;var a=Ae.createStream({node:n,path:Ae.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return a.stream_ops.open&&a.stream_ops.open(a),!s.logReadFiles||1&t||(Ae.readFiles||(Ae.readFiles={}),e in Ae.readFiles||(Ae.readFiles[e]=1)),a},close:e=>{if(Ae.isClosed(e))throw new Ae.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Ae.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(Ae.isClosed(e))throw new Ae.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Ae.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Ae.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:(e,t,r,n,o)=>{if(n<0||o<0)throw new Ae.ErrnoError(28);if(Ae.isClosed(e))throw new Ae.ErrnoError(8);if(1==(2097155&e.flags))throw new Ae.ErrnoError(8);if(Ae.isDir(e.node.mode))throw new Ae.ErrnoError(31);if(!e.stream_ops.read)throw new Ae.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new Ae.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=a),a},write:(e,t,r,n,o,i)=>{if(n<0||o<0)throw new Ae.ErrnoError(28);if(Ae.isClosed(e))throw new Ae.ErrnoError(8);if(0==(2097155&e.flags))throw new Ae.ErrnoError(8);if(Ae.isDir(e.node.mode))throw new Ae.ErrnoError(31);if(!e.stream_ops.write)throw new Ae.ErrnoError(28);e.seekable&&1024&e.flags&&Ae.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new Ae.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,i);return a||(e.position+=s),s},allocate:(e,t,r)=>{if(Ae.isClosed(e))throw new Ae.ErrnoError(8);if(t<0||r<=0)throw new Ae.ErrnoError(28);if(0==(2097155&e.flags))throw new Ae.ErrnoError(8);if(!Ae.isFile(e.node.mode)&&!Ae.isDir(e.node.mode))throw new Ae.ErrnoError(43);if(!e.stream_ops.allocate)throw new Ae.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:(e,t,r,n,o)=>{if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new Ae.ErrnoError(2);if(1==(2097155&e.flags))throw new Ae.ErrnoError(2);if(!e.stream_ops.mmap)throw new Ae.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o)},msync:(e,t,r,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0,munmap:e=>0,ioctl:(e,t,r)=>{if(!e.stream_ops.ioctl)throw new Ae.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile:(e,t={})=>{if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error(`Invalid encoding type "${t.encoding}"`);var r,n=Ae.open(e,t.flags),o=Ae.stat(e).size,i=new Uint8Array(o);return Ae.read(n,i,0,o,0),"utf8"===t.encoding?r=be(i,0):"binary"===t.encoding&&(r=i),Ae.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=Ae.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(Ee(t)+1),i=_e(t,o,0,o.length);Ae.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Ae.write(n,t,0,t.byteLength,void 0,r.canOwn)}Ae.close(n)},cwd:()=>Ae.currentPath,chdir:e=>{var t=Ae.lookupPath(e,{follow:!0});if(null===t.node)throw new Ae.ErrnoError(44);if(!Ae.isDir(t.node.mode))throw new Ae.ErrnoError(54);var r=Ae.nodePermissions(t.node,"x");if(r)throw new Ae.ErrnoError(r);Ae.currentPath=t.path},createDefaultDirectories:()=>{Ae.mkdir("/tmp"),Ae.mkdir("/home"),Ae.mkdir("/home/web_user")},createDefaultDevices:()=>{Ae.mkdir("/dev"),Ae.registerDevice(Ae.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),Ae.mkdev("/dev/null",Ae.makedev(1,3)),Se.register(Ae.makedev(5,0),Se.default_tty_ops),Se.register(Ae.makedev(6,0),Se.default_tty1_ops),Ae.mkdev("/dev/tty",Ae.makedev(5,0)),Ae.mkdev("/dev/tty1",Ae.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(t=ge(e).byteLength),e[--t]);Ae.createDevice("/dev","random",r),Ae.createDevice("/dev","urandom",r),Ae.mkdir("/dev/shm"),Ae.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{Ae.mkdir("/proc");var e=Ae.mkdir("/proc/self");Ae.mkdir("/proc/self/fd"),Ae.mount({mount:()=>{var t=Ae.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=Ae.getStreamChecked(r),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{s.stdin?Ae.createDevice("/dev","stdin",s.stdin):Ae.symlink("/dev/tty","/dev/stdin"),s.stdout?Ae.createDevice("/dev","stdout",null,s.stdout):Ae.symlink("/dev/tty","/dev/stdout"),s.stderr?Ae.createDevice("/dev","stderr",null,s.stderr):Ae.symlink("/dev/tty1","/dev/stderr"),Ae.open("/dev/stdin",0),Ae.open("/dev/stdout",1),Ae.open("/dev/stderr",1)},ensureErrnoError:()=>{Ae.ErrnoError||(Ae.ErrnoError=function(e,t){this.name="ErrnoError",this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},Ae.ErrnoError.prototype=new Error,Ae.ErrnoError.prototype.constructor=Ae.ErrnoError,[44].forEach((e=>{Ae.genericErrors[e]=new Ae.ErrnoError(e),Ae.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{Ae.ensureErrnoError(),Ae.nameTable=new Array(4096),Ae.mount(xe,{},"/"),Ae.createDefaultDirectories(),Ae.createDefaultDevices(),Ae.createSpecialDirectories(),Ae.filesystems={MEMFS:xe}},init:(e,t,r)=>{Ae.init.initialized=!0,Ae.ensureErrnoError(),s.stdin=e||s.stdin,s.stdout=t||s.stdout,s.stderr=r||s.stderr,Ae.createStandardStreams()},quit:()=>{Ae.init.initialized=!1;for(var e=0;e<Ae.streams.length;e++){var t=Ae.streams[e];t&&Ae.close(t)}},findObject:(e,t)=>{var r=Ae.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=Ae.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Ae.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=me.basename(e),n=Ae.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath:(e,t,r,n)=>{e="string"==typeof e?e:Ae.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=me.join2(e,i);try{Ae.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,r,n,o)=>{var i=me.join2("string"==typeof e?e:Ae.getPath(e),t),a=Te(n,o);return Ae.create(i,a)},createDataFile:(e,t,r,n,o,i)=>{var a=t;e&&(e="string"==typeof e?e:Ae.getPath(e),a=t?me.join2(e,t):e);var s=Te(n,o),u=Ae.create(a,s);if(r){if("string"==typeof r){for(var l=new Array(r.length),c=0,d=r.length;c<d;++c)l[c]=r.charCodeAt(c);r=l}Ae.chmod(u,146|s);var f=Ae.open(u,577);Ae.write(f,r,0,r.length,0,i),Ae.close(f),Ae.chmod(u,s)}return u},createDevice:(e,t,r,n)=>{var o=me.join2("string"==typeof e?e:Ae.getPath(e),t),i=Te(!!r,!!n);Ae.createDevice.major||(Ae.createDevice.major=64);var a=Ae.makedev(Ae.createDevice.major++,0);return Ae.registerDevice(a,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,t,n,o,i)=>{for(var a=0,s=0;s<o;s++){var u;try{u=r()}catch(e){throw new Ae.ErrnoError(29)}if(void 0===u&&0===a)throw new Ae.ErrnoError(6);if(null==u)break;a++,t[n+s]=u}return a&&(e.node.timestamp=Date.now()),a},write:(e,t,r,o,i)=>{for(var a=0;a<o;a++)try{n(t[r+a])}catch(e){throw new Ae.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),Ae.mkdev(o,i,a)},forceLoadFile:e=>{if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!d)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=Ce(d(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new Ae.ErrnoError(29)}},createLazyFile:(e,t,r,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;o||(a=n);var s=this;s.setDataGetter((e=>{var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+e+"-"+t),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Ce(o.responseText||"",!0)})(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,S("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!v)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var u=Ae.createFile(e,t,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var l={};function c(e,t,r,n,o){var i=e.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s<a;s++)t[r+s]=i[o+s];else for(s=0;s<a;s++)t[r+s]=i.get(o+s);return a}return Object.keys(u.stream_ops).forEach((e=>{var t=u.stream_ops[e];l[e]=function(){return Ae.forceLoadFile(u),t.apply(null,arguments)}})),l.read=(e,t,r,n,o)=>(Ae.forceLoadFile(u),c(e,t,r,n,o)),l.mmap=(e,t,r,n,o)=>{Ae.forceLoadFile(u);var i=ke(t);if(!i)throw new Ae.ErrnoError(48);return c(e,F,i,t,r),{ptr:i,allocated:!0}},u.stream_ops=l,u}},Fe=(e,t)=>e?be(D,e,t):"",De={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(me.isAbs(t))return t;var n;if(n=-100===e?Ae.cwd():De.getStreamFromFD(e).path,0==t.length){if(!r)throw new Ae.ErrnoError(44);return n}return me.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&me.normalize(t)!==me.normalize(Ae.getPath(e.node)))return-54;throw e}R[r>>2]=n.dev,R[r+4>>2]=n.mode,M[r+8>>2]=n.nlink,R[r+12>>2]=n.uid,R[r+16>>2]=n.gid,R[r+20>>2]=n.rdev,I[r+24>>3]=BigInt(n.size),R[r+32>>2]=4096,R[r+36>>2]=n.blocks;var o=n.atime.getTime(),i=n.mtime.getTime(),a=n.ctime.getTime();return I[r+40>>3]=BigInt(Math.floor(o/1e3)),M[r+48>>2]=o%1e3*1e3,I[r+56>>3]=BigInt(Math.floor(i/1e3)),M[r+64>>2]=i%1e3*1e3,I[r+72>>3]=BigInt(Math.floor(a/1e3)),M[r+80>>2]=a%1e3*1e3,I[r+88>>3]=BigInt(n.ino),0},doMsync:function(e,t,r,n,o){if(!Ae.isFile(t.node.mode))throw new Ae.ErrnoError(43);if(2&n)return 0;var i=D.slice(e,e+r);Ae.msync(t,i,o,r,n)},varargs:void 0,get:()=>(De.varargs+=4,R[De.varargs-4>>2]),getStr:e=>Fe(e),getStreamFromFD:function(e){return Ae.getStreamChecked(e)}},Be={};function Le(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function Re(e){return this.fromWireType(R[e>>2])}var Me={},Oe={},Ie={},Ue=void 0;function je(e){throw new Ue(e)}function $e(e,t,r){function n(t){var n=r(t);n.length!==e.length&&je("Mismatched type converter count");for(var o=0;o<e.length;++o)ze(e[o],n[o])}e.forEach((function(e){Ie[e]=t}));var o=new Array(t.length),i=[],a=0;t.forEach(((e,t)=>{Oe.hasOwnProperty(e)?o[t]=Oe[e]:(i.push(e),Me.hasOwnProperty(e)||(Me[e]=[]),Me[e].push((()=>{o[t]=Oe[e],++a===i.length&&n(o)})))})),0===i.length&&n(o)}var Ne={};function He(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}var qe=void 0;function Ve(e){for(var t="",r=e;D[r];)t+=qe[D[r++]];return t}var We=void 0;function Ge(e){throw new We(e)}function ze(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,t,r={}){var n=t.name;if(e||Ge(`type "${n}" must have a positive integer typeid pointer`),Oe.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;Ge(`Cannot register type '${n}' twice`)}if(Oe[e]=t,delete Ie[e],Me.hasOwnProperty(e)){var o=Me[e];delete Me[e],o.forEach((e=>e()))}}(e,t,r)}function Ye(e,t,r){switch(t){case 0:return r?function(e){return F[e]}:function(e){return D[e]};case 1:return r?function(e){return B[e>>1]}:function(e){return L[e>>1]};case 2:return r?function(e){return R[e>>2]}:function(e){return M[e>>2]};case 3:return r?function(e){return I[e>>3]}:function(e){return U[e>>3]};default:throw new TypeError("Unknown integer type: "+e)}}function Xe(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError(`Unknown type size: ${e}`)}}function Ke(e){Ge(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Qe=!1;function Ze(e){}function Je(e){e.count.value-=1,0===e.count.value&&function(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}(e)}function et(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=et(e,t,r.baseClass);return null===n?null:r.downcast(n)}var tt={};var rt=[];function nt(){for(;rt.length;){var e=rt.pop();e.$$.deleteScheduled=!1,e.delete()}}var ot=void 0;var it={};function at(e,t){return t.ptrType&&t.ptr||je("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&je("Both smartPtrType and smartPtr must be specified"),t.count={value:1},st(Object.create(e,{$$:{value:t}}))}var st=function(e){return"undefined"==typeof FinalizationRegistry?(st=e=>e,e):(Qe=new FinalizationRegistry((e=>{Je(e.$$)})),st=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};Qe.register(e,r,e)}return e},Ze=e=>Qe.unregister(e),st(e))};function ut(){}function lt(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?`_${e}`:e}function ct(e,t){return{[e=lt(e)]:function(){return t.apply(this,arguments)}}[e]}function dt(e,t,r){if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||Ge(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}}function ft(e,t,r){s.hasOwnProperty(e)?((void 0===r||void 0!==s[e].overloadTable&&void 0!==s[e].overloadTable[r])&&Ge(`Cannot register public name '${e}' twice`),dt(s,e,e),s.hasOwnProperty(r)&&Ge(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),s[e].overloadTable[r]=t):(s[e]=t,void 0!==r&&(s[e].numArguments=r))}function pt(e,t,r,n,o,i,a,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}function ht(e,t,r){for(;t!==r;)t.upcast||Ge(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e}function mt(e,t){if(null===t)return this.isReference&&Ge(`null is not a valid ${this.name}`),0;t.$$||Ge(`Cannot pass "${He(t)}" as a ${this.name}`),t.$$.ptr||Ge(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return ht(t.$$.ptr,r,this.registeredClass)}function gt(e,t){var r;if(null===t)return this.isReference&&Ge(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||Ge(`Cannot pass "${He(t)}" as a ${this.name}`),t.$$.ptr||Ge(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&Ge(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=ht(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&Ge("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:Ge(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var o=t.clone();r=this.rawShare(r,Bt.toHandle((function(){o.delete()}))),null!==e&&e.push(this.rawDestructor,r)}break;default:Ge("Unsupporting sharing policy")}return r}function yt(e,t){if(null===t)return this.isReference&&Ge(`null is not a valid ${this.name}`),0;t.$$||Ge(`Cannot pass "${He(t)}" as a ${this.name}`),t.$$.ptr||Ge(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&Ge(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return ht(t.$$.ptr,r,this.registeredClass)}function vt(e,t,r,n,o,i,a,s,u,l,c){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=l,this.rawDestructor=c,o||void 0!==t.baseClass?this.toWireType=gt:n?(this.toWireType=mt,this.destructorFunction=null):(this.toWireType=yt,this.destructorFunction=null)}function bt(e,t,r){s.hasOwnProperty(e)||je("Replacing nonexistant public symbol"),void 0!==s[e].overloadTable&&void 0!==r?s[e].overloadTable[r]=t:(s[e]=t,s[e].argCount=r)}var wt=[],Et=e=>{var t=wt[e];return t||(e>=wt.length&&(wt.length=e+1),wt[e]=t=q.get(e)),t};function _t(e,t){e=Ve(e);var r=Et(t);return"function"!=typeof r&&Ge(`unknown function pointer with signature ${e}: ${t}`),r}var Ct=void 0;function St(e){var t=eo(e),r=Ve(t);return Xn(t),r}function kt(e,t){var r=[],n={};throw t.forEach((function e(t){n[t]||Oe[t]||(Ie[t]?Ie[t].forEach(e):(r.push(t),n[t]=!0))})),new Ct(`${e}: `+r.map(St).join([", "]))}function xt(e,t){for(var r=[],n=0;n<e;n++)r.push(M[t+4*n>>2]);return r}function Pt(e,t){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var r=ct(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var n=new r,o=e.apply(n,t);return o instanceof Object?o:n}function Tt(e,t,r,n,o,i){var a=t.length;a<2&&Ge("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==t[1]&&null!==r,u=!1,l=1;l<t.length;++l)if(null!==t[l]&&void 0===t[l].destructorFunction){u=!0;break}var c="void"!==t[0].name,d="",f="";for(l=0;l<a-2;++l)d+=(0!==l?", ":"")+"arg"+l,f+=(0!==l?", ":"")+"arg"+l+"Wired";var p=`\n return function ${lt(e)}(${d}) {\n if (arguments.length !== ${a-2}) {\n throwBindingError('function ${e} called with ${arguments.length} arguments, expected ${a-2} args!');\n }`;u&&(p+="var destructors = [];\n");var h=u?"destructors":"null",m=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],g=[Ge,n,o,Le,t[0],t[1]];for(s&&(p+="var thisWired = classParam.toWireType("+h+", this);\n"),l=0;l<a-2;++l)p+="var arg"+l+"Wired = argType"+l+".toWireType("+h+", arg"+l+"); // "+t[l+2].name+"\n",m.push("argType"+l),g.push(t[l+2]);if(s&&(f="thisWired"+(f.length>0?", ":"")+f),p+=(c||i?"var rv = ":"")+"invoker(fn"+(f.length>0?", ":"")+f+");\n",u)p+="runDestructors(destructors);\n";else for(l=s?1:2;l<t.length;++l){var y=1===l?"thisWired":"arg"+(l-2)+"Wired";null!==t[l].destructorFunction&&(p+=y+"_dtor("+y+"); // "+t[l].name+"\n",m.push(y+"_dtor"),g.push(t[l].destructorFunction))}return c&&(p+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),p+="}\n",m.push(p),Pt(Function,m).apply(null,g)}function At(){this.allocated=[void 0],this.freelist=[]}var Ft=new At;function Dt(e){e>=Ft.reserved&&0==--Ft.get(e).refcount&&Ft.free(e)}var Bt={toValue:e=>(e||Ge("Cannot use deleted val. handle = "+e),Ft.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return Ft.allocate({refcount:1,value:e})}}};function Lt(e,t,r){switch(t){case 0:return function(e){var t=r?F:D;return this.fromWireType(t[e])};case 1:return function(e){var t=r?B:L;return this.fromWireType(t[e>>1])};case 2:return function(e){var t=r?R:M;return this.fromWireType(t[e>>2])};default:throw new TypeError("Unknown integer type: "+e)}}function Rt(e,t){var r=Oe[e];return void 0===r&&Ge(t+" has unknown type "+St(e)),r}function Mt(e,t){switch(t){case 2:return function(e){return this.fromWireType(O[e>>2])};case 3:return function(e){return this.fromWireType(j[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}var Ot=(e,t,r)=>_e(e,D,t,r),It="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Ut=(e,t)=>{for(var r=e,n=r>>1,o=n+t/2;!(n>=o)&&L[n];)++n;if((r=n<<1)-e>32&&It)return It.decode(D.subarray(e,r));for(var i="",a=0;!(a>=t/2);++a){var s=B[e+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i},jt=(e,t,r)=>{if(void 0===r&&(r=2147483647),r<2)return 0;for(var n=t,o=(r-=2)<2*e.length?r/2:e.length,i=0;i<o;++i){var a=e.charCodeAt(i);B[t>>1]=a,t+=2}return B[t>>1]=0,t-n},$t=e=>2*e.length,Nt=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var o=R[e+4*r>>2];if(0==o)break;if(++r,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(o)}return n},Ht=(e,t,r)=>{if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=t,o=n+r-4,i=0;i<e.length;++i){var a=e.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),R[t>>2]=a,(t+=4)+4>o)break}return R[t>>2]=0,t-n},qt=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t};function Vt(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=Rt(M[t+4*n>>2],"parameter "+n);return r}var Wt={};function Gt(e){var t=Wt[e];return void 0===t?Ve(e):t}var zt=[];function Yt(){return"object"==typeof globalThis?globalThis:Function("return this")()}var Xt=[],Kt={};function Qt(e){return e<-9007199254740992||e>9007199254740992?NaN:Number(e)}var Zt,Jt=e=>e%4==0&&(e%100!=0||e%400==0),er=[0,31,60,91,121,152,182,213,244,274,305,335],tr=[0,31,59,90,120,151,181,212,243,273,304,334],rr=e=>(Jt(e.getFullYear())?er:tr)[e.getMonth()]+e.getDate()-1,nr=e=>{var t=Ee(e)+1,r=Yn(t);return r&&Ot(e,r,t),r};function or(e,t){if(lr.mainLoop.timingMode=e,lr.mainLoop.timingValue=t,!lr.mainLoop.func)return 1;if(lr.mainLoop.running||(lr.mainLoop.running=!0),0==e)lr.mainLoop.scheduler=function(){var e=0|Math.max(0,lr.mainLoop.tickStartTime+t-Zt());setTimeout(lr.mainLoop.runner,e)},lr.mainLoop.method="timeout";else if(1==e)lr.mainLoop.scheduler=function(){lr.requestAnimationFrame(lr.mainLoop.runner)},lr.mainLoop.method="rAF";else if(2==e){if("undefined"==typeof setImmediate){var r=[],n="setimmediate";addEventListener("message",(e=>{e.data!==n&&e.data.target!==n||(e.stopPropagation(),r.shift()())}),!0),setImmediate=function(e){r.push(e),v?(void 0===s.setImmediates&&(s.setImmediates=[]),s.setImmediates.push(e),postMessage({target:n})):postMessage(n,"*")}}lr.mainLoop.scheduler=function(){setImmediate(lr.mainLoop.runner)},lr.mainLoop.method="immediate"}return 0}Zt=()=>performance.now();var ir=e=>{if(e instanceof le||"unwind"==e)return A;g(1,e)},ar=(e,t)=>{var r;A=e,A=r=e,X()||(s.onExit&&s.onExit(r),$=!0),g(r,new le(r))},sr=e=>{if(!$)try{e(),(()=>{if(!X())try{ar(A)}catch(e){ir(e)}})()}catch(e){ir(e)}},ur=(e,t)=>setTimeout((()=>{sr(e)}),t),lr={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){lr.mainLoop.scheduler=null,lr.mainLoop.currentlyRunningMainloop++},resume:function(){lr.mainLoop.currentlyRunningMainloop++;var e=lr.mainLoop.timingMode,t=lr.mainLoop.timingValue,r=lr.mainLoop.func;lr.mainLoop.func=null,function(e,t,r,n,o){N(!lr.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),lr.mainLoop.func=e,lr.mainLoop.arg=n;var i=lr.mainLoop.currentlyRunningMainloop;function a(){return!(i<lr.mainLoop.currentlyRunningMainloop)}lr.mainLoop.running=!1,lr.mainLoop.runner=function(){if(!$)if(lr.mainLoop.queue.length>0){var t=Date.now(),r=lr.mainLoop.queue.shift();if(r.func(r.arg),lr.mainLoop.remainingBlockers){var n=lr.mainLoop.remainingBlockers,o=n%1==0?n-1:Math.floor(n);r.counted?lr.mainLoop.remainingBlockers=o:(o+=.5,lr.mainLoop.remainingBlockers=(8*n+o)/9)}if(S('main loop blocker "'+r.name+'" took '+(Date.now()-t)+" ms"),lr.mainLoop.updateStatus(),!a())return;setTimeout(lr.mainLoop.runner,0)}else a()&&(lr.mainLoop.currentFrameNumber=lr.mainLoop.currentFrameNumber+1|0,1==lr.mainLoop.timingMode&&lr.mainLoop.timingValue>1&&lr.mainLoop.currentFrameNumber%lr.mainLoop.timingValue!=0?lr.mainLoop.scheduler():(0==lr.mainLoop.timingMode&&(lr.mainLoop.tickStartTime=Zt()),lr.mainLoop.runIter(e),a()&&("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),lr.mainLoop.scheduler())))}}(r,0,0,lr.mainLoop.arg),or(e,t),lr.mainLoop.scheduler()},updateStatus:function(){if(s.setStatus){var e=s.statusMessage||"Please wait...",t=lr.mainLoop.remainingBlockers,r=lr.mainLoop.expectedBlockers;t?t<r?s.setStatus(e+" ("+(r-t)+"/"+r+")"):s.setStatus(e):s.setStatus("")}},runIter:function(e){if(!$){if(s.preMainLoop&&!1===s.preMainLoop())return;sr(e),s.postMainLoop&&s.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(!lr.initted){lr.initted=!0;var e={canHandle:function(e){return!s.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,t,r,n){var o=new Blob([e],{type:lr.getMimetype(t)});o.size!==e.length&&(o=new Blob([new Uint8Array(e).buffer],{type:lr.getMimetype(t)}));var i=URL.createObjectURL(o),a=new Image;a.onload=()=>{N(a.complete,"Image "+t+" could not be decoded");var n=document.createElement("canvas");n.width=a.width,n.height=a.height,n.getContext("2d").drawImage(a,0,0),Nn[t]=n,URL.revokeObjectURL(i),r&&r(e)},a.onerror=e=>{S("Image "+i+" could not be decoded"),n&&n()},a.src=i}};Pe.push(e);var t={canHandle:function(e){return!s.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,t,r,n){var o=!1;function i(n){o||(o=!0,Hn[t]=n,r&&r(e))}var a=new Blob([e],{type:lr.getMimetype(t)}),s=URL.createObjectURL(a),u=new Audio;u.addEventListener("canplaythrough",(()=>i(u)),!1),u.onerror=function(r){o||(k("warning: browser could not fully decode audio "+t+", trying slower base64 approach"),u.src="data:audio/x-"+t.substr(-3)+";base64,"+function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="",n=0,o=0,i=0;i<e.length;i++)for(n=n<<8|e[i],o+=8;o>=6;){var a=n>>o-6&63;o-=6,r+=t[a]}return 2==o?(r+=t[(3&n)<<4],r+="=="):4==o&&(r+=t[(15&n)<<2],r+="="),r}(e),i(u))},u.src=s,ur((()=>{i(u)}),1e4)}};Pe.push(t);var r=s.canvas;r&&(r.requestPointerLock=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||(()=>{}),r.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||(()=>{}),r.exitPointerLock=r.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",n,!1),document.addEventListener("mozpointerlockchange",n,!1),document.addEventListener("webkitpointerlockchange",n,!1),document.addEventListener("mspointerlockchange",n,!1),s.elementPointerLock&&r.addEventListener("click",(e=>{!lr.pointerLock&&s.canvas.requestPointerLock&&(s.canvas.requestPointerLock(),e.preventDefault())}),!1))}function n(){lr.pointerLock=document.pointerLockElement===s.canvas||document.mozPointerLockElement===s.canvas||document.webkitPointerLockElement===s.canvas||document.msPointerLockElement===s.canvas}},createContext:function(e,t,r,n){if(t&&s.ctx&&e==s.canvas)return s.ctx;var o,i;if(t){var a={antialias:!1,alpha:!1,majorVersion:"undefined"!=typeof WebGL2RenderingContext?2:1};if(n)for(var u in n)a[u]=n[u];void 0!==yr&&(i=yr.createContext(e,a))&&(o=yr.getContext(i).GLctx)}else o=e.getContext("2d");return o?(r&&(t||N(void 0===$n,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),s.ctx=o,t&&yr.makeContextCurrent(i),s.useWebGL=t,lr.moduleContextCreatedCallbacks.forEach((e=>e())),lr.init()),o):null},destroyContext:function(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(e,t){lr.lockPointer=e,lr.resizeCanvas=t,void 0===lr.lockPointer&&(lr.lockPointer=!0),void 0===lr.resizeCanvas&&(lr.resizeCanvas=!1);var r=s.canvas;function n(){lr.isFullscreen=!1;var e=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(r.exitFullscreen=lr.exitFullscreen,lr.lockPointer&&r.requestPointerLock(),lr.isFullscreen=!0,lr.resizeCanvas?lr.setFullscreenCanvasSize():lr.updateCanvasDimensions(r)):(e.parentNode.insertBefore(r,e),e.parentNode.removeChild(e),lr.resizeCanvas?lr.setWindowedCanvasSize():lr.updateCanvasDimensions(r)),s.onFullScreen&&s.onFullScreen(lr.isFullscreen),s.onFullscreen&&s.onFullscreen(lr.isFullscreen)}lr.fullscreenHandlersInstalled||(lr.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var o=document.createElement("div");r.parentNode.insertBefore(o,r),o.appendChild(r),o.requestFullscreen=o.requestFullscreen||o.mozRequestFullScreen||o.msRequestFullscreen||(o.webkitRequestFullscreen?()=>o.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):null)||(o.webkitRequestFullScreen?()=>o.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT):null),o.requestFullscreen()},exitFullscreen:function(){return!!lr.isFullscreen&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||(()=>{})).apply(document,[]),!0)},nextRAF:0,fakeRequestAnimationFrame:function(e){var t=Date.now();if(0===lr.nextRAF)lr.nextRAF=t+1e3/60;else for(;t+2>=lr.nextRAF;)lr.nextRAF+=1e3/60;var r=Math.max(lr.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame:function(e){"function"!=typeof requestAnimationFrame?(0,lr.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeSetTimeout:function(e,t){return ur(e,t)},safeRequestAnimationFrame:function(e){return lr.requestAnimationFrame((()=>{sr(e)}))},getMimetype:function(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]},getUserMedia:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta:function(e){var t=0;switch(e.type){case"DOMMouseScroll":t=e.detail/3;break;case"mousewheel":t=e.wheelDelta/120;break;case"wheel":switch(t=e.deltaY,e.deltaMode){case 0:t/=100;break;case 1:t/=3;break;case 2:t*=80;break;default:throw"unrecognized mouse wheel delta mode: "+e.deltaMode}break;default:throw"unrecognized mouse wheel event: "+e.type}return t},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(e){if(lr.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?lr.mouseMovementX=lr.mouseMovementY=0:(lr.mouseMovementX=lr.getMovementX(e),lr.mouseMovementY=lr.getMovementY(e)),"undefined"!=typeof SDL?(lr.mouseX=SDL.mouseX+lr.mouseMovementX,lr.mouseY=SDL.mouseY+lr.mouseMovementY):(lr.mouseX+=lr.mouseMovementX,lr.mouseY+=lr.mouseMovementY);else{var t=s.canvas.getBoundingClientRect(),r=s.canvas.width,n=s.canvas.height,o=void 0!==window.scrollX?window.scrollX:window.pageXOffset,i=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var a=e.touch;if(void 0===a)return;var u=a.pageX-(o+t.left),l=a.pageY-(i+t.top),c={x:u*=r/t.width,y:l*=n/t.height};if("touchstart"===e.type)lr.lastTouches[a.identifier]=c,lr.touches[a.identifier]=c;else if("touchend"===e.type||"touchmove"===e.type){var d=lr.touches[a.identifier];d||(d=c),lr.lastTouches[a.identifier]=d,lr.touches[a.identifier]=c}return}var f=e.pageX-(o+t.left),p=e.pageY-(i+t.top);f*=r/t.width,p*=n/t.height,lr.mouseMovementX=f-lr.mouseX,lr.mouseMovementY=p-lr.mouseY,lr.mouseX=f,lr.mouseY=p}},resizeListeners:[],updateResizeListeners:function(){var e=s.canvas;lr.resizeListeners.forEach((t=>t(e.width,e.height)))},setCanvasSize:function(e,t,r){var n=s.canvas;lr.updateCanvasDimensions(n,e,t),r||lr.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=M[SDL.screen>>2];e|=8388608,R[SDL.screen>>2]=e}lr.updateCanvasDimensions(s.canvas),lr.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=M[SDL.screen>>2];e&=-8388609,R[SDL.screen>>2]=e}lr.updateCanvasDimensions(s.canvas),lr.updateResizeListeners()},updateCanvasDimensions:function(e,t,r){t&&r?(e.widthNative=t,e.heightNative=r):(t=e.widthNative,r=e.heightNative);var n=t,o=r;if(s.forcedAspectRatio&&s.forcedAspectRatio>0&&(n/o<s.forcedAspectRatio?n=Math.round(o*s.forcedAspectRatio):o=Math.round(n/s.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var i=Math.min(screen.width/n,screen.height/o);n=Math.round(n*i),o=Math.round(o*i)}lr.resizeCanvas?(e.width!=n&&(e.width=n),e.height!=o&&(e.height=o),void 0!==e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=t&&(e.width=t),e.height!=r&&(e.height=r),void 0!==e.style&&(n!=t||o!=r?(e.style.setProperty("width",n+"px","important"),e.style.setProperty("height",o+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))}},cr={errorCode:12288,defaultDisplayInitialized:!1,currentContext:0,currentReadSurface:0,currentDrawSurface:0,contextAttributes:{alpha:!1,depth:!1,stencil:!1,antialias:!1},stringCache:{},setErrorCode:function(e){cr.errorCode=e},chooseConfig:function(e,t,r,n,o){if(62e3!=e)return cr.setErrorCode(12296),0;if(t)for(;;){var i=R[t>>2];if(12321==i){var a=R[t+4>>2];cr.contextAttributes.alpha=a>0}else if(12325==i){var s=R[t+4>>2];cr.contextAttributes.depth=s>0}else if(12326==i){var u=R[t+4>>2];cr.contextAttributes.stencil=u>0}else if(12337==i){var l=R[t+4>>2];cr.contextAttributes.antialias=l>0}else if(12338==i)l=R[t+4>>2],cr.contextAttributes.antialias=1==l;else if(12544==i){var c=R[t+4>>2];cr.contextAttributes.lowLatency=12547!=c}else if(12344==i)break;t+=8}return r&&n||o?(o&&(R[o>>2]=1),r&&n>0&&(R[r>>2]=62002),cr.setErrorCode(12288),1):(cr.setErrorCode(12300),0)}};function dr(e){var t=e.getExtension("ANGLE_instanced_arrays");if(t)return e.vertexAttribDivisor=function(e,r){t.vertexAttribDivisorANGLE(e,r)},e.drawArraysInstanced=function(e,r,n,o){t.drawArraysInstancedANGLE(e,r,n,o)},e.drawElementsInstanced=function(e,r,n,o,i){t.drawElementsInstancedANGLE(e,r,n,o,i)},1}function fr(e){var t=e.getExtension("OES_vertex_array_object");if(t)return e.createVertexArray=function(){return t.createVertexArrayOES()},e.deleteVertexArray=function(e){t.deleteVertexArrayOES(e)},e.bindVertexArray=function(e){t.bindVertexArrayOES(e)},e.isVertexArray=function(e){return t.isVertexArrayOES(e)},1}function pr(e){var t=e.getExtension("WEBGL_draw_buffers");if(t)return e.drawBuffers=function(e,r){t.drawBuffersWEBGL(e,r)},1}function hr(e){return!!(e.dibvbi=e.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"))}function mr(e){return!!(e.mdibvbi=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"))}function gr(e){return!!(e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw"))}var yr={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){yr.lastError||(yr.lastError=e)},getNewId:function(e){for(var t=yr.counter++,r=e.length;r<t;r++)e[r]=null;return t},getSource:function(e,t,r,n){for(var o="",i=0;i<t;++i){var a=n?R[n+4*i>>2]:-1;o+=Fe(R[r+4*i>>2],a<0?void 0:a)}return o},createContext:function(e,t){e.getContextSafariWebGL2Fixed||(e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=function(t,r){var n=e.getContextSafariWebGL2Fixed(t,r);return"webgl"==t==n instanceof WebGLRenderingContext?n:null});var r=t.majorVersion>1?e.getContext("webgl2",t):e.getContext("webgl",t);return r?yr.registerContext(r,t):0},registerContext:function(e,t){var r=yr.getNewId(yr.contexts),n={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),yr.contexts[r]=n,(void 0===t.enableExtensionsByDefault||t.enableExtensionsByDefault)&&yr.initExtensions(n),r},makeContextCurrent:function(e){return yr.currentContext=yr.contexts[e],s.ctx=$n=yr.currentContext&&yr.currentContext.GLctx,!(e&&!$n)},getContext:function(e){return yr.contexts[e]},deleteContext:function(e){yr.currentContext===yr.contexts[e]&&(yr.currentContext=null),"object"==typeof Tn&&Tn.removeAllHandlersOnTarget(yr.contexts[e].GLctx.canvas),yr.contexts[e]&&yr.contexts[e].GLctx.canvas&&(yr.contexts[e].GLctx.canvas.GLctxObject=void 0),yr.contexts[e]=null},initExtensions:function(e){if(e||(e=yr.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var t=e.GLctx;dr(t),fr(t),pr(t),hr(t),mr(t),e.version>=2&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query_webgl2")),(e.version<2||!t.disjointTimerQueryExt)&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query")),gr(t),(t.getSupportedExtensions()||[]).forEach((function(e){e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}}},vr=[];function br(e){$n.bindVertexArray(yr.vaos[e])}var wr=br,Er=br;function _r(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2];$n.deleteVertexArray(yr.vaos[n]),yr.vaos[n]=null}}var Cr=_r,Sr=_r;function kr(e,t,r,n){$n.drawArraysInstanced(e,t,r,n)}var xr=kr,Pr=kr,Tr=kr,Ar=kr,Fr=kr,Dr=[];function Br(e,t){for(var r=Dr[e],n=0;n<e;n++)r[n]=R[t+4*n>>2];$n.drawBuffers(r)}var Lr=Br,Rr=Br,Mr=Br;function Or(e,t,r,n){$n.drawElements(e,t,r,n)}var Ir=Or;function Ur(e,t,r,n,o){$n.drawElementsInstanced(e,t,r,n,o)}var jr=Ur,$r=Ur,Nr=Ur,Hr=Ur,qr=Ur;function Vr(e,t,r,n){for(var o=0;o<e;o++){var i=$n[r](),a=i&&yr.getNewId(n);i?(i.name=a,n[a]=i):yr.recordError(1282),R[t+4*o>>2]=a}}function Wr(e,t){Vr(e,t,"createVertexArray",yr.vaos)}var Gr=Wr,zr=Wr;function Yr(e,t,r,n,o,i,a,s){t=yr.programs[t];var u=$n[e](t,r);if(u){var l=s&&Ot(u.name,s,n);o&&(R[o>>2]=l),i&&(R[i>>2]=u.size),a&&(R[a>>2]=u.type)}}function Xr(e,t){M[e>>2]=t,M[e+4>>2]=(t-M[e>>2])/4294967296}function Kr(e,t,r){if(t){var n=void 0;switch(e){case 36346:n=1;break;case 36344:return void(0!=r&&1!=r&&yr.recordError(1280));case 34814:case 36345:n=0;break;case 34466:var o=$n.getParameter(34467);n=o?o.length:0;break;case 33309:if(yr.currentContext.version<2)return void yr.recordError(1282);n=2*($n.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(yr.currentContext.version<2)return void yr.recordError(1280);n=33307==e?3:0}if(void 0===n){var i=$n.getParameter(e);switch(typeof i){case"number":n=i;break;case"boolean":n=i?1:0;break;case"string":return void yr.recordError(1280);case"object":if(null===i)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:n=0;break;default:return void yr.recordError(1280)}else{if(i instanceof Float32Array||i instanceof Uint32Array||i instanceof Int32Array||i instanceof Array){for(var a=0;a<i.length;++a)switch(r){case 0:R[t+4*a>>2]=i[a];break;case 2:O[t+4*a>>2]=i[a];break;case 4:F[t+a>>0]=i[a]?1:0}return}try{n=0|i.name}catch(t){return yr.recordError(1280),void k("GL_INVALID_ENUM in glGet"+r+"v: Unknown object returned from WebGL getParameter("+e+")! (error: "+t+")")}}break;default:return yr.recordError(1280),void k("GL_INVALID_ENUM in glGet"+r+"v: Native code calling glGet"+r+"v("+e+") and it returns "+i+" of type "+typeof i+"!")}}switch(r){case 1:Xr(t,n);break;case 0:R[t>>2]=n;break;case 2:O[t>>2]=n;break;case 4:F[t>>0]=n?1:0}}else yr.recordError(1281)}function Qr(e,t,r,n){if(r){var o,i=$n.getIndexedParameter(e,t);switch(typeof i){case"boolean":o=i?1:0;break;case"number":o=i;break;case"object":if(null===i)switch(e){case 35983:case 35368:o=0;break;default:return void yr.recordError(1280)}else{if(!(i instanceof WebGLBuffer))return void yr.recordError(1280);o=0|i.name}break;default:return void yr.recordError(1280)}switch(n){case 1:Xr(r,o);break;case 0:R[r>>2]=o;break;case 2:O[r>>2]=o;break;case 4:F[r>>0]=o?1:0;break;default:throw"internal emscriptenWebGLGetIndexed() error, bad type: "+n}}else yr.recordError(1281)}function Zr(e,t,r){if(r){var n,o=yr.queries[e];Xr(r,"boolean"==typeof(n=yr.currentContext.version<2?$n.disjointTimerQueryExt.getQueryObjectEXT(o,t):$n.getQueryParameter(o,t))?n?1:0:n)}else yr.recordError(1281)}var Jr=Zr;function en(e,t,r){if(r){var n,o=yr.queries[e],i=$n.disjointTimerQueryExt.getQueryObjectEXT(o,t);n="boolean"==typeof i?i?1:0:i,R[r>>2]=n}else yr.recordError(1281)}var tn=en,rn=Zr,nn=en;function on(e){return"]"==e.slice(-1)&&e.lastIndexOf("[")}function an(e){var t,r,n=e.uniformLocsById,o=e.uniformSizeAndIdsByName;if(!n)for(e.uniformLocsById=n={},e.uniformArrayNamesById={},t=0;t<$n.getProgramParameter(e,35718);++t){var i=$n.getActiveUniform(e,t),a=i.name,s=i.size,u=on(a),l=u>0?a.slice(0,u):a,c=e.uniformIdCounter;for(e.uniformIdCounter+=s,o[l]=[s,c],r=0;r<s;++r)n[c]=r,e.uniformArrayNamesById[c++]=l}}function sn(e){var t=$n.currentProgram;if(t){var r=t.uniformLocsById[e];return"number"==typeof r&&(t.uniformLocsById[e]=r=$n.getUniformLocation(t,t.uniformArrayNamesById[e]+(r>0?"["+r+"]":""))),r}yr.recordError(1282)}function un(e,t,r,n){if(r){an(e=yr.programs[e]);var o=$n.getUniform(e,sn(t));if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:R[r>>2]=o;break;case 2:O[r>>2]=o}else for(var i=0;i<o.length;i++)switch(n){case 0:R[r+4*i>>2]=o[i];break;case 2:O[r+4*i>>2]=o[i]}}else yr.recordError(1281)}function ln(e,t,r,n){if(r){var o=$n.getVertexAttrib(e,t);if(34975==t)R[r>>2]=o&&o.name;else if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:R[r>>2]=o;break;case 2:O[r>>2]=o;break;case 5:R[r>>2]=Math.fround(o)}else for(var i=0;i<o.length;i++)switch(n){case 0:R[r+4*i>>2]=o[i];break;case 2:O[r+4*i>>2]=o[i];break;case 5:R[r+4*i>>2]=Math.fround(o[i])}}else yr.recordError(1281)}function cn(e,t,r){ln(e,t,r,0)}var dn=cn,fn=cn;function pn(e){var t=yr.vaos[e];return t?$n.isVertexArray(t):0}var hn=pn,mn=pn;function gn(e){return 0==(e-=5120)?F:1==e?D:2==e?B:4==e?R:6==e?O:5==e||28922==e||28520==e||30779==e||30782==e?M:L}function yn(e){return 31-Math.clz32(e.BYTES_PER_ELEMENT)}function vn(e,t,r,n,o,i){var a=gn(e),s=yn(a),u=1<<s,l=function(e){return{5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[e-6402]||1}(t)*u,c=function(e,t,r,n){var o;return t*(e*r+(o=n)-1&-o)}(r,n,l,yr.unpackAlignment);return a.subarray(o>>s,o+c>>s)}var bn=[],wn=[];function En(e,t){$n.vertexAttribDivisor(e,t)}var _n=En,Cn=En,Sn=En,kn=En,xn=En,Pn=e=>{var t=e-x.buffer.byteLength+65535>>>16;try{return x.grow(t),H(),1}catch(e){}},Tn={inEventHandler:0,removeAllEventListeners:function(){for(var e=Tn.eventHandlers.length-1;e>=0;--e)Tn._removeHandler(e);Tn.eventHandlers=[],Tn.deferredCalls=[]},registerRemoveEventListeners:function(){Tn.removeEventListenersRegistered||(z.push(Tn.removeAllEventListeners),Tn.removeEventListenersRegistered=!0)},deferredCalls:[],deferCall:function(e,t,r){function n(e,t){if(e.length!=t.length)return!1;for(var r in e)if(e[r]!=t[r])return!1;return!0}for(var o in Tn.deferredCalls){var i=Tn.deferredCalls[o];if(i.targetFunction==e&&n(i.argsList,r))return}Tn.deferredCalls.push({targetFunction:e,precedence:t,argsList:r}),Tn.deferredCalls.sort((function(e,t){return e.precedence<t.precedence}))},removeDeferredCalls:function(e){for(var t=0;t<Tn.deferredCalls.length;++t)Tn.deferredCalls[t].targetFunction==e&&(Tn.deferredCalls.splice(t,1),--t)},canPerformEventHandlerRequests:function(){return navigator.userActivation?navigator.userActivation.isActive:Tn.inEventHandler&&Tn.currentEventHandler.allowsDeferredCalls},runDeferredCalls:function(){if(Tn.canPerformEventHandlerRequests())for(var e=0;e<Tn.deferredCalls.length;++e){var t=Tn.deferredCalls[e];Tn.deferredCalls.splice(e,1),--e,t.targetFunction.apply(null,t.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:function(e,t){for(var r=0;r<Tn.eventHandlers.length;++r)Tn.eventHandlers[r].target!=e||t&&t!=Tn.eventHandlers[r].eventTypeString||Tn._removeHandler(r--)},_removeHandler:function(e){var t=Tn.eventHandlers[e];t.target.removeEventListener(t.eventTypeString,t.eventListenerFunc,t.useCapture),Tn.eventHandlers.splice(e,1)},registerOrRemoveHandler:function(e){if(!e.target)return-4;var t=function(t){++Tn.inEventHandler,Tn.currentEventHandler=e,Tn.runDeferredCalls(),e.handlerFunc(t),Tn.runDeferredCalls(),--Tn.inEventHandler};if(e.callbackfunc)e.eventListenerFunc=t,e.target.addEventListener(e.eventTypeString,t,e.useCapture),Tn.eventHandlers.push(e),Tn.registerRemoveEventListeners();else for(var r=0;r<Tn.eventHandlers.length;++r)Tn.eventHandlers[r].target==e.target&&Tn.eventHandlers[r].eventTypeString==e.eventTypeString&&Tn._removeHandler(r--);return 0},getNodeNameForTarget:function(e){return e?e==window?"#window":e==screen?"#screen":e&&e.nodeName?e.nodeName:"":""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}},An=["default","low-power","high-performance"],Fn=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0];var Dn,Bn,Ln={},Rn=()=>{if(!Rn.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:m||"./this.program"};for(var t in Ln)void 0===Ln[t]?delete e[t]:e[t]=Ln[t];var r=[];for(var t in e)r.push(`${t}=${e[t]}`);Rn.strings=r}return Rn.strings},Mn=(e,t,r,n)=>{for(var o=0,i=0;i<r;i++){var a=M[t>>2],s=M[t+4>>2];t+=8;var u=Ae.read(e,F,a,s,n);if(u<0)return-1;if(o+=u,u<s)break;void 0!==n&&(n+=u)}return o},On=[31,29,31,30,31,30,31,31,30,31,30,31],In=[31,28,31,30,31,30,31,31,30,31,30,31],Un=(e,t)=>{F.set(e,t)},jn=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Ae.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n};Object.defineProperties(jn.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return Ae.isDir(this.mode)}},isDevice:{get:function(){return Ae.isChrdev(this.mode)}}}),Ae.FSNode=jn,Ae.createPreloadedFile=function(e,t,r,n,o,i,a,s,u,l){var c=t?ye.resolve(me.join2(e,t)):e;function d(r){function d(r){l&&l(),s||Ae.createDataFile(e,t,r,n,o,u),i&&i(),re()}(function(e,t,r,n){void 0!==lr&&lr.init();var o=!1;return Pe.forEach((function(i){o||i.canHandle(t)&&(i.handle(e,t,r,n),o=!0)})),o})(r,c,d,(()=>{a&&a(),re()}))||d(r)}te(),"string"==typeof r?((e,t,r,n)=>{var o=`al ${e}`;f(e,(t=>{N(t,`Loading data file "${e}" failed (no arrayBuffer).`),d(new Uint8Array(t)),o&&re()}),(t=>{if(!r)throw`Loading data file "${e}" failed.`;r()})),o&&te()})(r,0,a):d(r)},Ae.staticInit(),s.FS_createPath=Ae.createPath,s.FS_createDataFile=Ae.createDataFile,s.FS_createPreloadedFile=Ae.createPreloadedFile,s.FS_unlink=Ae.unlink,s.FS_createLazyFile=Ae.createLazyFile,s.FS_createDevice=Ae.createDevice,Ue=s.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},function(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);qe=e}(),We=s.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},ut.prototype.isAliasOf=function(e){if(!(this instanceof ut))return!1;if(!(e instanceof ut))return!1;for(var t=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return t===n&&r===o},ut.prototype.clone=function(){if(this.$$.ptr||Ke(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=st(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},ut.prototype.delete=function(){this.$$.ptr||Ke(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ge("Object already scheduled for deletion"),Ze(this),Je(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},ut.prototype.isDeleted=function(){return!this.$$.ptr},ut.prototype.deleteLater=function(){return this.$$.ptr||Ke(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ge("Object already scheduled for deletion"),rt.push(this),1===rt.length&&ot&&ot(nt),this.$$.deleteScheduled=!0,this},s.getInheritedInstanceCount=function(){return Object.keys(it).length},s.getLiveInheritedInstances=function(){var e=[];for(var t in it)it.hasOwnProperty(t)&&e.push(it[t]);return e},s.flushPendingDeletes=nt,s.setDelayFunction=function(e){ot=e,rt.length&&ot&&ot(nt)},vt.prototype.getPointee=function(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},vt.prototype.destructor=function(e){this.rawDestructor&&this.rawDestructor(e)},vt.prototype.argPackAdvance=8,vt.prototype.readValueFromPointer=Re,vt.prototype.deleteObject=function(e){null!==e&&e.delete()},vt.prototype.fromWireType=function(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=function(e,t){return t=function(e,t){for(void 0===t&&Ge("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),it[t]}(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?at(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):at(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,a=this.registeredClass.getActualType(t),s=tt[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=et(t,this.registeredClass,i.registeredClass);return null===u?o.call(this):this.isSmartPointer?at(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:e}):at(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})},Ct=s.UnboundTypeError=(Dn=Error,(Bn=ct("UnboundTypeError",(function(e){this.name="UnboundTypeError",this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(Dn.prototype),Bn.prototype.constructor=Bn,Bn.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},Bn),Object.assign(At.prototype,{get(e){return this.allocated[e]},has(e){return void 0!==this.allocated[e]},allocate(e){var t=this.freelist.pop()||this.allocated.length;return this.allocated[t]=e,t},free(e){this.allocated[e]=void 0,this.freelist.push(e)}}),Ft.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),Ft.reserved=Ft.allocated.length,s.count_emval_handles=function(){for(var e=0,t=Ft.reserved;t<Ft.allocated.length;++t)void 0!==Ft.allocated[t]&&++e;return e},s.requestFullscreen=function(e,t){lr.requestFullscreen(e,t)},s.requestAnimationFrame=function(e){lr.requestAnimationFrame(e)},s.setCanvasSize=function(e,t,r){lr.setCanvasSize(e,t,r)},s.pauseMainLoop=function(){lr.mainLoop.pause()},s.resumeMainLoop=function(){lr.mainLoop.resume()},s.getUserMedia=function(){lr.getUserMedia()},s.createContext=function(e,t,r,n){return lr.createContext(e,t,r,n)};for(var $n,Nn={},Hn={},qn=0;qn<32;++qn)Dr.push(new Array(qn));var Vn=new Float32Array(288);for(qn=0;qn<288;++qn)bn[qn]=Vn.subarray(0,qn+1);var Wn=new Int32Array(288);for(qn=0;qn<288;++qn)wn[qn]=Wn.subarray(0,qn+1);var Gn,zn={Ha:function(e){var t=new pe(e);return t.get_caught()||t.set_caught(!0),t.set_rethrown(!1),de.push(t),so(t.excPtr),t.get_exception_ptr()},Ga:function(){ro(0,0);var e=de.pop();ao(e.excPtr),fe=0},o:()=>he([]),_:e=>he([e]),j:function(e,t,r){throw new pe(e).init(t,r),fe=e},M:function(e){throw fe||(fe=e),fe},ca:function(e,t,r){De.varargs=r;try{var n=De.getStreamFromFD(e);switch(t){case 0:return(o=De.get())<0?-28:Ae.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=De.get();return n.flags|=o,0;case 5:return o=De.get(),B[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return 28,R[Kn()>>2]=28,-1}}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},yb:function(e,t){try{var r=De.getStreamFromFD(e);return De.doStat(Ae.stat,r.path,t)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},Db:function(e,t,r){De.varargs=r;try{var n=De.getStreamFromFD(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),i=De.get();R[i>>2]=o.c_iflag||0,R[i+4>>2]=o.c_oflag||0,R[i+8>>2]=o.c_cflag||0,R[i+12>>2]=o.c_lflag||0;for(var a=0;a<32;a++)F[i+a+17>>0]=o.c_cc[a]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){i=De.get();var s=R[i>>2],u=R[i+4>>2],l=R[i+8>>2],c=R[i+12>>2],d=[];for(a=0;a<32;a++)d.push(F[i+a+17>>0]);return n.tty.ops.ioctl_tcsets(n.tty,t,{c_iflag:s,c_oflag:u,c_cflag:l,c_lflag:c,c_cc:d})}return 0;case 21519:return n.tty?(i=De.get(),R[i>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return i=De.get(),Ae.ioctl(n,t,i);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var f=n.tty.ops.ioctl_tiocgwinsz(n.tty);i=De.get(),B[i>>1]=f[0],B[i+2>>1]=f[1]}return 0;default:return-28}}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},vb:function(e,t){try{return e=De.getStr(e),De.doStat(Ae.lstat,e,t)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},wb:function(e,t,r,n){try{t=De.getStr(t);var o=256&n,i=4096&n;return n&=-6401,t=De.calculateAt(e,t,i),De.doStat(o?Ae.lstat:Ae.stat,t,r)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},qa:function(e,t,r,n){De.varargs=n;try{t=De.getStr(t),t=De.calculateAt(e,t);var o=n?De.get():0;return Ae.open(t,r,o).fd}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},xb:function(e,t){try{return e=De.getStr(e),De.doStat(Ae.stat,e,t)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},ua:function(e){var t=Be[e];delete Be[e];var r=t.elements,n=r.length,o=r.map((function(e){return e.getterReturnType})).concat(r.map((function(e){return e.setterArgumentType}))),i=t.rawConstructor,a=t.rawDestructor;$e([e],o,(function(e){return r.forEach(((t,r)=>{var o=e[r],i=t.getter,a=t.getterContext,s=e[r+n],u=t.setter,l=t.setterContext;t.read=e=>o.fromWireType(i(a,e)),t.write=(e,t)=>{var r=[];u(l,e,s.toWireType(r,t)),Le(r)}})),[{name:t.name,fromWireType:function(e){for(var t=new Array(n),o=0;o<n;++o)t[o]=r[o].read(e);return a(e),t},toWireType:function(e,o){if(n!==o.length)throw new TypeError(`Incorrect number of tuple elements for ${t.name}: expected=${n}, actual=${o.length}`);for(var s=i(),u=0;u<n;++u)r[u].write(s,o[u]);return null!==e&&e.push(a,s),s},argPackAdvance:8,readValueFromPointer:Re,destructorFunction:a}]}))},y:function(e){var t=Ne[e];delete Ne[e];var r=t.rawConstructor,n=t.rawDestructor,o=t.fields;$e([e],o.map((e=>e.getterReturnType)).concat(o.map((e=>e.setterArgumentType))),(e=>{var i={};return o.forEach(((t,r)=>{var n=t.fieldName,a=e[r],s=t.getter,u=t.getterContext,l=e[r+o.length],c=t.setter,d=t.setterContext;i[n]={read:e=>a.fromWireType(s(u,e)),write:(e,t)=>{var r=[];c(d,e,l.toWireType(r,t)),Le(r)}}})),[{name:t.name,fromWireType:function(e){var t={};for(var r in i)t[r]=i[r].read(e);return n(e),t},toWireType:function(e,t){for(var o in i)if(!(o in t))throw new TypeError(`Missing field: "${o}"`);var a=r();for(o in i)i[o].write(a,t[o]);return null!==e&&e.push(n,a),a},argPackAdvance:8,readValueFromPointer:Re,destructorFunction:n}]}))},ya:function(e,t,r,n,o){t=Ve(t);var i=Xe(r),a=-1!=t.indexOf("u");a&&(o=(1n<<64n)-1n),ze(e,{name:t,fromWireType:function(e){return e},toWireType:function(e,r){if("bigint"!=typeof r&&"number"!=typeof r)throw new TypeError(`Cannot convert "${He(r)}" to ${this.name}`);if(r<n||r>o)throw new TypeError(`Passing a number "${He(r)}" from JS side to C/C++ side to an argument of type "${t}", which is outside the valid range [${n}, ${o}]!`);return r},argPackAdvance:8,readValueFromPointer:Ye(t,i,!a),destructorFunction:null})},je:function(e,t,r,n,o){var i=Xe(r);ze(e,{name:t=Ve(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:o},argPackAdvance:8,readValueFromPointer:function(e){var n;if(1===r)n=F;else if(2===r)n=B;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+t);n=R}return this.fromWireType(n[e>>i])},destructorFunction:null})},v:function(e,t,r,n,o,i,a,s,u,l,c,d,f){c=Ve(c),i=_t(o,i),s&&(s=_t(a,s)),l&&(l=_t(u,l)),f=_t(d,f);var p=lt(c);ft(p,(function(){kt(`Cannot construct ${c} due to unbound types`,[n])})),$e([e,t,r],n?[n]:[],(function(t){var r,o;t=t[0],o=n?(r=t.registeredClass).instancePrototype:ut.prototype;var a=ct(p,(function(){if(Object.getPrototypeOf(this)!==u)throw new We("Use 'new' to construct "+c);if(void 0===d.constructor_body)throw new We(c+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new We(`Tried to invoke ctor of ${c} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return e.apply(this,arguments)})),u=Object.create(o,{constructor:{value:a}});a.prototype=u;var d=new pt(c,a,u,f,r,i,s,l);d.baseClass&&(void 0===d.baseClass.__derivedClasses&&(d.baseClass.__derivedClasses=[]),d.baseClass.__derivedClasses.push(d));var h=new vt(c,d,!0,!1,!1),m=new vt(c+"*",d,!1,!1,!1),g=new vt(c+" const*",d,!1,!0,!1);return tt[e]={pointerType:m,constPointerType:g},bt(p,a),[h,m,g]}))},w:function(e,t,r,n,o,i){var a=xt(t,r);o=_t(n,o),$e([],[e],(function(e){var r=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new We(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{kt(`Cannot construct ${e.name} due to unbound types`,a)},$e([],a,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Tt(r,n,null,o,i),[]})),[]}))},d:function(e,t,r,n,o,i,a,s,u){var l=xt(r,n);t=Ve(t),i=_t(o,i),$e([],[e],(function(e){var n=`${(e=e[0]).name}.${t}`;function o(){kt(`Cannot call ${n} due to unbound types`,l)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var c=e.registeredClass.instancePrototype,d=c[t];return void 0===d||void 0===d.overloadTable&&d.className!==e.name&&d.argCount===r-2?(o.argCount=r-2,o.className=e.name,c[t]=o):(dt(c,t,n),c[t].overloadTable[r-2]=o),$e([],l,(function(o){var s=Tt(n,o,e,i,a,u);return void 0===c[t].overloadTable?(s.argCount=r-2,c[t]=s):c[t].overloadTable[r-2]=s,[]})),[]}))},ie:function(e,t){ze(e,{name:t=Ve(t),fromWireType:function(e){var t=Bt.toValue(e);return Dt(e),t},toWireType:function(e,t){return Bt.toHandle(t)},argPackAdvance:8,readValueFromPointer:Re,destructorFunction:null})},V:function(e,t,r,n){var o=Xe(r);function i(){}t=Ve(t),i.values={},ze(e,{name:t,constructor:i,fromWireType:function(e){return this.constructor.values[e]},toWireType:function(e,t){return t.value},argPackAdvance:8,readValueFromPointer:Lt(t,o,n),destructorFunction:null}),ft(t,i)},A:function(e,t,r){var n=Rt(e,"enum");t=Ve(t);var o=n.constructor,i=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:ct(`${n.name}_${t}`,(function(){}))}});o.values[r]=i,o[t]=i},xa:function(e,t,r){var n=Xe(r);ze(e,{name:t=Ve(t),fromWireType:function(e){return e},toWireType:function(e,t){return t},argPackAdvance:8,readValueFromPointer:Mt(t,n),destructorFunction:null})},L:function(e,t,r,n,o,i,a){var s=xt(t,r);e=Ve(e),o=_t(n,o),ft(e,(function(){kt(`Cannot call ${e} due to unbound types`,s)}),t-1),$e([],s,(function(r){var n=[r[0],null].concat(r.slice(1));return bt(e,Tt(e,n,null,o,i,a),t-1),[]}))},Q:function(e,t,r,n,o){t=Ve(t),-1===o&&(o=4294967295);var i=Xe(r),a=e=>e;if(0===n){var s=32-8*r;a=e=>e<<s>>>s}var u=t.includes("unsigned");ze(e,{name:t,fromWireType:a,toWireType:u?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:8,readValueFromPointer:Ye(t,i,0!==n),destructorFunction:null})},D:function(e,t,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];function o(e){var t=M,r=t[e>>=2],o=t[e+1];return new n(t.buffer,o,r)}ze(e,{name:r=Ve(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Ge:function(e,t,r,n,o,i,a,s,u,l,c,d){r=Ve(r),i=_t(o,i),s=_t(a,s),l=_t(u,l),d=_t(c,d),$e([e],[t],(function(e){return e=e[0],[new vt(r,e.registeredClass,!1,!1,!0,e,n,i,s,l,d)]}))},wa:function(e,t){var r="std::string"===(t=Ve(t));ze(e,{name:t,fromWireType:function(e){var t,n=M[e>>2],o=e+4;if(r)for(var i=o,a=0;a<=n;++a){var s=o+a;if(a==n||0==D[s]){var u=Fe(i,s-i);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),i=s+1}}else{var l=new Array(n);for(a=0;a<n;++a)l[a]=String.fromCharCode(D[o+a]);t=l.join("")}return Xn(e),t},toWireType:function(e,t){var n;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var o="string"==typeof t;o||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||Ge("Cannot pass non-string to std::string"),n=r&&o?Ee(t):t.length;var i=Yn(4+n+1),a=i+4;if(M[i>>2]=n,r&&o)Ot(t,a,n+1);else if(o)for(var s=0;s<n;++s){var u=t.charCodeAt(s);u>255&&(Xn(a),Ge("String has UTF-16 code units that do not fit in 8 bits")),D[a+s]=u}else for(s=0;s<n;++s)D[a+s]=t[s];return null!==e&&e.push(Xn,i),i},argPackAdvance:8,readValueFromPointer:Re,destructorFunction:function(e){Xn(e)}})},ea:function(e,t,r){var n,o,i,a,s;r=Ve(r),2===t?(n=Ut,o=jt,a=$t,i=()=>L,s=1):4===t&&(n=Nt,o=Ht,a=qt,i=()=>M,s=2),ze(e,{name:r,fromWireType:function(e){for(var r,o=M[e>>2],a=i(),u=e+4,l=0;l<=o;++l){var c=e+4+l*t;if(l==o||0==a[c>>s]){var d=n(u,c-u);void 0===r?r=d:(r+=String.fromCharCode(0),r+=d),u=c+t}}return Xn(e),r},toWireType:function(e,n){"string"!=typeof n&&Ge(`Cannot pass non-string to C++ string type ${r}`);var i=a(n),u=Yn(4+i+t);return M[u>>2]=i>>s,o(n,u+4,i+t),null!==e&&e.push(Xn,u),u},argPackAdvance:8,readValueFromPointer:Re,destructorFunction:function(e){Xn(e)}})},va:function(e,t,r,n,o,i){Be[e]={name:Ve(t),rawConstructor:_t(r,n),rawDestructor:_t(o,i),elements:[]}},P:function(e,t,r,n,o,i,a,s,u){Be[e].elements.push({getterReturnType:t,getter:_t(r,n),getterContext:o,setterArgumentType:i,setter:_t(a,s),setterContext:u})},z:function(e,t,r,n,o,i){Ne[e]={name:Ve(t),rawConstructor:_t(r,n),rawDestructor:_t(o,i),fields:[]}},n:function(e,t,r,n,o,i,a,s,u,l){Ne[e].fields.push({fieldName:Ve(t),getterReturnType:r,getter:_t(n,o),getterContext:i,setterArgumentType:a,setter:_t(s,u),setterContext:l})},ke:function(e,t){ze(e,{isVoid:!0,name:t=Ve(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})},Bb:()=>!0,hb:()=>{throw 1/0},k:function(e,t,r){e=Bt.toValue(e),t=Rt(t,"emval::as");var n=[],o=Bt.toHandle(n);return M[r>>2]=o,t.toWireType(n,e)},u:function(e,t,r,n){e=Bt.toValue(e);for(var o=Vt(t,r),i=new Array(t),a=0;a<t;++a){var s=o[a];i[a]=s.readValueFromPointer(n),n+=s.argPackAdvance}var u=e.apply(void 0,i);return Bt.toHandle(u)},X:function(e,t,r,n,o){return(e=zt[e])(t=Bt.toValue(t),r=Gt(r),function(e){var t=[];return M[e>>2]=Bt.toHandle(t),t}(n),o)},R:function(e,t,r,n){(e=zt[e])(t=Bt.toValue(t),r=Gt(r),null,n)},c:Dt,de:function(e,t){return(e=Bt.toValue(e))==Bt.toValue(t)},G:function(e){return 0===e?Bt.toHandle(Yt()):(e=Gt(e),Bt.toHandle(Yt()[e]))},J:function(e,t){var r=Vt(e,t),n=r[0],o=n.name+"_$"+r.slice(1).map((function(e){return e.name})).join("_")+"$",i=Xt[o];if(void 0!==i)return i;for(var a=["retType"],s=[n],u="",l=0;l<e-1;++l)u+=(0!==l?", ":"")+"arg"+l,a.push("argType"+l),s.push(r[1+l]);var c,d,f="return function "+lt("methodCaller_"+o)+"(handle, name, destructors, args) {\n",p=0;for(l=0;l<e-1;++l)f+=" var arg"+l+" = argType"+l+".readValueFromPointer(args"+(p?"+"+p:"")+");\n",p+=r[l+1].argPackAdvance;for(f+=" var rv = handle[name]("+u+");\n",l=0;l<e-1;++l)r[l+1].deleteObject&&(f+=" argType"+l+".deleteObject(arg"+l+");\n");return n.isVoid||(f+=" return retType.toWireType(destructors, rv);\n"),f+="};\n",a.push(f),c=Pt(Function,a).apply(null,s),d=zt.length,zt.push(c),i=d,Xt[o]=i,i},h:function(e,t){return e=Bt.toValue(e),t=Bt.toValue(t),Bt.toHandle(e[t])},e:function(e){e>4&&(Ft.get(e).refcount+=1)},ha:function(e,t){return(e=Bt.toValue(e))instanceof Bt.toValue(t)},da:function(e){return"number"==typeof(e=Bt.toValue(e))},N:function(e){return"string"==typeof(e=Bt.toValue(e))},ze:function(e,t,r,n){e=Bt.toValue(e);var o=Kt[t];return o||(o=function(e){for(var t="",r=0;r<e;++r)t+=(0!==r?", ":"")+"arg"+r;var n="return function emval_allocator_"+e+"(constructor, argTypes, args) {\n var HEAPU32 = getMemory();\n";for(r=0;r<e;++r)n+="var argType"+r+" = requireRegisteredType(HEAPU32[((argTypes)>>2)], 'parameter "+r+"');\nvar arg"+r+" = argType"+r+".readValueFromPointer(args);\nargs += argType"+r+"['argPackAdvance'];\nargTypes += 4;\n";return n+="var obj = new constructor("+t+");\nreturn valueToHandle(obj);\n}\n",new Function("requireRegisteredType","Module","valueToHandle","getMemory",n)(Rt,s,Bt.toHandle,(()=>M))}(t),Kt[t]=o),o(e,r,n)},K:function(){return Bt.toHandle([])},g:function(e){return Bt.toHandle(Gt(e))},C:function(){return Bt.toHandle({})},i:function(e){Le(Bt.toValue(e)),Dt(e)},m:function(e,t,r){e=Bt.toValue(e),t=Bt.toValue(t),r=Bt.toValue(r),e[t]=r},f:function(e,t){var r=(e=Rt(e,"_emval_take_value")).readValueFromPointer(t);return Bt.toHandle(r)},se:function(e){throw Bt.toValue(e)},Oc:function(e){return e=Bt.toValue(e),Bt.toHandle(typeof e)},pb:function(e,t){e=Qt(e),t=Qt(t);var r=new Date(1e3*e);R[t>>2]=r.getUTCSeconds(),R[t+4>>2]=r.getUTCMinutes(),R[t+8>>2]=r.getUTCHours(),R[t+12>>2]=r.getUTCDate(),R[t+16>>2]=r.getUTCMonth(),R[t+20>>2]=r.getUTCFullYear()-1900,R[t+24>>2]=r.getUTCDay();var n=Date.UTC(r.getUTCFullYear(),0,1,0,0,0,0),o=(r.getTime()-n)/864e5|0;R[t+28>>2]=o},qb:function(e,t){e=Qt(e),t=Qt(t);var r=new Date(1e3*e);R[t>>2]=r.getSeconds(),R[t+4>>2]=r.getMinutes(),R[t+8>>2]=r.getHours(),R[t+12>>2]=r.getDate(),R[t+16>>2]=r.getMonth(),R[t+20>>2]=r.getFullYear()-1900,R[t+24>>2]=r.getDay();var n=0|rr(r);R[t+28>>2]=n,R[t+36>>2]=-60*r.getTimezoneOffset();var o=new Date(r.getFullYear(),0,1),i=new Date(r.getFullYear(),6,1).getTimezoneOffset(),a=o.getTimezoneOffset(),s=0|(i!=a&&r.getTimezoneOffset()==Math.min(a,i));R[t+32>>2]=s},rb:function(e){e=Qt(e);var t=(()=>{var t=new Date(R[e+20>>2]+1900,R[e+16>>2],R[e+12>>2],R[e+8>>2],R[e+4>>2],R[e>>2],0),r=R[e+32>>2],n=t.getTimezoneOffset(),o=new Date(t.getFullYear(),0,1),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=o.getTimezoneOffset(),s=Math.min(a,i);if(r<0)R[e+32>>2]=Number(i!=a&&s==n);else if(r>0!=(s==n)){var u=Math.max(a,i),l=r>0?s:u;t.setTime(t.getTime()+6e4*(l-n))}R[e+24>>2]=t.getDay();var c=0|rr(t);return R[e+28>>2]=c,R[e>>2]=t.getSeconds(),R[e+4>>2]=t.getMinutes(),R[e+8>>2]=t.getHours(),R[e+12>>2]=t.getDate(),R[e+16>>2]=t.getMonth(),R[e+20>>2]=t.getYear(),t.getTime()/1e3})();return BigInt(t)},mb:function(e,t,r,n,o,i,a){e=Qt(e),o=Qt(o),i=Qt(i),a=Qt(a);try{if(isNaN(o))return 61;var s=De.getStreamFromFD(n),u=Ae.mmap(s,e,o,t,r),l=u.ptr;return R[i>>2]=u.allocated,M[a>>2]=l,0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},nb:function(e,t,r,n,o,i){e=Qt(e),t=Qt(t),i=Qt(i);try{if(isNaN(i))return 61;var a=De.getStreamFromFD(o);2&r&&De.doMsync(e,a,t,n,i),Ae.munmap(a)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},ib:(e,t,r)=>{var n=(new Date).getFullYear(),o=new Date(n,0,1),i=new Date(n,6,1),a=o.getTimezoneOffset(),s=i.getTimezoneOffset(),u=Math.max(a,s);function l(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}M[e>>2]=60*u,R[t>>2]=Number(a!=s);var c=l(o),d=l(i),f=nr(c),p=nr(d);s<a?(M[r>>2]=f,M[r+4>>2]=p):(M[r>>2]=p,M[r+4>>2]=f)},b:()=>{ne("")},oa:function(e,t,r,n,o){return cr.chooseConfig(e,t,r,n,o)},pa:function(e,t,r,n){if(62e3!=e)return cr.setErrorCode(12296),0;for(var o=1;;){var i=R[n>>2];if(12440!=i){if(12344==i)break;return cr.setErrorCode(12292),0}o=R[n+4>>2],n+=8}return o<2||o>3?(cr.setErrorCode(12293),0):(cr.contextAttributes.majorVersion=o-1,cr.contextAttributes.minorVersion=0,cr.context=yr.createContext(s.canvas,cr.contextAttributes),0!=cr.context?(cr.setErrorCode(12288),yr.makeContextCurrent(cr.context),s.useWebGL=!0,lr.moduleContextCreatedCallbacks.forEach((function(e){e()})),yr.makeContextCurrent(null),62004):(cr.setErrorCode(12297),0))},$a:function(e,t,r,n){return 62e3!=e?(cr.setErrorCode(12296),0):62002!=t?(cr.setErrorCode(12293),0):(cr.setErrorCode(12288),62006)},ic:function(e,t){return 62e3!=e?(cr.setErrorCode(12296),0):62004!=t?(cr.setErrorCode(12294),0):(yr.deleteContext(cr.context),cr.setErrorCode(12288),cr.currentContext==t&&(cr.currentContext=0),1)},Zb:function(e,t){return 62e3!=e?(cr.setErrorCode(12296),0):62006!=t?(cr.setErrorCode(12301),1):(cr.currentReadSurface==t&&(cr.currentReadSurface=0),cr.currentDrawSurface==t&&(cr.currentDrawSurface=0),cr.setErrorCode(12288),1)},T:function(e,t,r,n){if(62e3!=e)return cr.setErrorCode(12296),0;if(62002!=t)return cr.setErrorCode(12293),0;if(!n)return cr.setErrorCode(12300),0;switch(cr.setErrorCode(12288),r){case 12320:return R[n>>2]=cr.contextAttributes.alpha?32:24,1;case 12321:return R[n>>2]=cr.contextAttributes.alpha?8:0,1;case 12322:case 12323:case 12324:return R[n>>2]=8,1;case 12325:return R[n>>2]=cr.contextAttributes.depth?24:0,1;case 12326:return R[n>>2]=cr.contextAttributes.stencil?8:0,1;case 12327:case 12335:case 12340:return R[n>>2]=12344,1;case 12328:return R[n>>2]=62002,1;case 12329:case 12333:case 12334:case 12345:case 12346:case 12347:case 12349:case 12350:case 12354:return R[n>>2]=0,1;case 12330:case 12332:return R[n>>2]=4096,1;case 12331:return R[n>>2]=16777216,1;case 12337:return R[n>>2]=cr.contextAttributes.antialias?4:0,1;case 12338:return R[n>>2]=cr.contextAttributes.antialias?1:0,1;case 12339:case 12352:return R[n>>2]=4,1;case 12341:case 12342:case 12343:return R[n>>2]=-1,1;case 12348:return R[n>>2]=1,1;case 12351:return R[n>>2]=12430,1;default:return cr.setErrorCode(12292),0}},ob:function(e){return cr.setErrorCode(12288),62e3},ta:function(){return cr.errorCode},eb:function(e,t,r){return 62e3!=e?(cr.setErrorCode(12296),0):(t&&(R[t>>2]=1),r&&(R[r>>2]=4),cr.defaultDisplayInitialized=!0,cr.setErrorCode(12288),1)},zb:function(e,t,r,n){return 62e3!=e?(cr.setErrorCode(12296),0):0!=n&&62004!=n?(cr.setErrorCode(12294),0):0!=r&&62006!=r||0!=t&&62006!=t?(cr.setErrorCode(12301),0):(yr.makeContextCurrent(n?cr.context:null),cr.currentContext=n,cr.currentDrawSurface=t,cr.currentReadSurface=r,cr.setErrorCode(12288),1)},tc:function(e,t){if(cr.defaultDisplayInitialized)if(s.ctx){if(!s.ctx.isContextLost())return cr.setErrorCode(12288),1;cr.setErrorCode(12302)}else cr.setErrorCode(12290);else cr.setErrorCode(12289);return 0},Ob:function(e){return 62e3!=e?(cr.setErrorCode(12296),0):(cr.currentContext=0,cr.currentReadSurface=0,cr.currentDrawSurface=0,cr.defaultDisplayInitialized=!1,cr.setErrorCode(12288),1)},I:(e,t,r)=>((e,t,r)=>{var n=((e,t)=>{var r;for(vr.length=0,t>>=2;r=D[e++];)t+=105!=r&t,vr.push(105==r?R[t]:(106==r?I:j)[t++>>1]),++t;return vr})(t,r);return ue[e].apply(null,n)})(e,t,r),we:e=>{console.error(Fe(e))},xe:e=>{console.log(Fe(e))},ga:e=>{console.warn(Fe(e))},aa:function(){return Date.now()},me:function(){},jb:()=>2147483648,Ab:Zt,Wf:function(e){$n.activeTexture(e)},Xf:function(e,t){$n.attachShader(yr.programs[e],yr.shaders[t])},Yc:function(e,t){$n.beginQuery(e,yr.queries[t])},ee:function(e,t){$n.disjointTimerQueryExt.beginQueryEXT(e,yr.queries[t])},Kc:function(e){$n.beginTransformFeedback(e)},Yf:function(e,t,r){$n.bindAttribLocation(yr.programs[e],t,Fe(r))},Zf:function(e,t){35051==e?$n.currentPixelPackBufferBinding=t:35052==e&&($n.currentPixelUnpackBufferBinding=t),$n.bindBuffer(e,yr.buffers[t])},Hc:function(e,t,r){$n.bindBufferBase(e,t,yr.buffers[r])},Ic:function(e,t,r,n,o){$n.bindBufferRange(e,t,yr.buffers[r],n,o)},Ye:function(e,t){$n.bindFramebuffer(e,yr.framebuffers[t])},Ze:function(e,t){$n.bindRenderbuffer(e,yr.renderbuffers[t])},Ie:function(e,t){$n.bindSampler(e,yr.samplers[t])},_f:function(e,t){$n.bindTexture(e,yr.textures[t])},Vb:function(e,t){$n.bindTransformFeedback(e,yr.transformFeedbacks[t])},sf:wr,vf:Er,$f:function(e,t,r,n){$n.blendColor(e,t,r,n)},ag:function(e){$n.blendEquation(e)},Sd:function(e,t){$n.blendEquationSeparate(e,t)},bg:function(e,t){$n.blendFunc(e,t)},Rd:function(e,t,r,n){$n.blendFuncSeparate(e,t,r,n)},Se:function(e,t,r,n,o,i,a,s,u,l){$n.blitFramebuffer(e,t,r,n,o,i,a,s,u,l)},cg:function(e,t,r,n){yr.currentContext.version>=2?r&&t?$n.bufferData(e,D,n,r,t):$n.bufferData(e,t,n):$n.bufferData(e,r?D.subarray(r,r+t):t,n)},dg:function(e,t,r,n){yr.currentContext.version>=2?r&&$n.bufferSubData(e,t,D,n,r):$n.bufferSubData(e,t,D.subarray(n,n+r))},_e:function(e){return $n.checkFramebufferStatus(e)},eg:function(e){$n.clear(e)},kc:function(e,t,r,n){$n.clearBufferfi(e,t,r,n)},lc:function(e,t,r){$n.clearBufferfv(e,t,O,r>>2)},nc:function(e,t,r){$n.clearBufferiv(e,t,R,r>>2)},mc:function(e,t,r){$n.clearBufferuiv(e,t,M,r>>2)},fg:function(e,t,r,n){$n.clearColor(e,t,r,n)},Qd:function(e){$n.clearDepth(e)},gg:function(e){$n.clearStencil(e)},Da:function(e,t,r){return r=Number(r),$n.clientWaitSync(yr.syncs[e],t,r)},hg:function(e,t,r,n){$n.colorMask(!!e,!!t,!!r,!!n)},ig:function(e){$n.compileShader(yr.shaders[e])},jg:function(e,t,r,n,o,i,a,s){yr.currentContext.version>=2?$n.currentPixelUnpackBufferBinding||!a?$n.compressedTexImage2D(e,t,r,n,o,i,a,s):$n.compressedTexImage2D(e,t,r,n,o,i,D,s,a):$n.compressedTexImage2D(e,t,r,n,o,i,s?D.subarray(s,s+a):null)},bd:function(e,t,r,n,o,i,a,s,u){$n.currentPixelUnpackBufferBinding?$n.compressedTexImage3D(e,t,r,n,o,i,a,s,u):$n.compressedTexImage3D(e,t,r,n,o,i,a,D,u,s)},kg:function(e,t,r,n,o,i,a,s,u){yr.currentContext.version>=2?$n.currentPixelUnpackBufferBinding||!s?$n.compressedTexSubImage2D(e,t,r,n,o,i,a,s,u):$n.compressedTexSubImage2D(e,t,r,n,o,i,a,D,u,s):$n.compressedTexSubImage2D(e,t,r,n,o,i,a,u?D.subarray(u,u+s):null)},ad:function(e,t,r,n,o,i,a,s,u,l,c){$n.currentPixelUnpackBufferBinding?$n.compressedTexSubImage3D(e,t,r,n,o,i,a,s,u,l,c):$n.compressedTexSubImage3D(e,t,r,n,o,i,a,s,u,D,c,l)},Qe:function(e,t,r,n,o){$n.copyBufferSubData(e,t,r,n,o)},Pd:function(e,t,r,n,o,i,a,s){$n.copyTexImage2D(e,t,r,n,o,i,a,s)},lg:function(e,t,r,n,o,i,a,s){$n.copyTexSubImage2D(e,t,r,n,o,i,a,s)},cd:function(e,t,r,n,o,i,a,s,u){$n.copyTexSubImage3D(e,t,r,n,o,i,a,s,u)},mg:function(){var e=yr.getNewId(yr.programs),t=$n.createProgram();return t.name=e,t.maxUniformLength=t.maxAttributeLength=t.maxUniformBlockNameLength=0,t.uniformIdCounter=1,yr.programs[e]=t,e},ng:function(e){var t=yr.getNewId(yr.shaders);return yr.shaders[t]=$n.createShader(e),t},og:function(e){$n.cullFace(e)},pg:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.buffers[n];o&&($n.deleteBuffer(o),o.name=0,yr.buffers[n]=null,n==$n.currentPixelPackBufferBinding&&($n.currentPixelPackBufferBinding=0),n==$n.currentPixelUnpackBufferBinding&&($n.currentPixelUnpackBufferBinding=0))}},$e:function(e,t){for(var r=0;r<e;++r){var n=R[t+4*r>>2],o=yr.framebuffers[n];o&&($n.deleteFramebuffer(o),o.name=0,yr.framebuffers[n]=null)}},qg:function(e){if(e){var t=yr.programs[e];t?($n.deleteProgram(t),t.name=0,yr.programs[e]=null):yr.recordError(1281)}},_c:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.queries[n];o&&($n.deleteQuery(o),yr.queries[n]=null)}},ge:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.queries[n];o&&($n.disjointTimerQueryExt.deleteQueryEXT(o),yr.queries[n]=null)}},af:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.renderbuffers[n];o&&($n.deleteRenderbuffer(o),o.name=0,yr.renderbuffers[n]=null)}},Je:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.samplers[n];o&&($n.deleteSampler(o),o.name=0,yr.samplers[n]=null)}},rg:function(e){if(e){var t=yr.shaders[e];t?($n.deleteShader(t),yr.shaders[e]=null):yr.recordError(1281)}},Re:function(e){if(e){var t=yr.syncs[e];t?($n.deleteSync(t),t.name=0,yr.syncs[e]=null):yr.recordError(1281)}},sg:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.textures[n];o&&($n.deleteTexture(o),o.name=0,yr.textures[n]=null)}},Ub:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.transformFeedbacks[n];o&&($n.deleteTransformFeedback(o),o.name=0,yr.transformFeedbacks[n]=null)}},tf:Cr,wf:Sr,Od:function(e){$n.depthFunc(e)},tg:function(e){$n.depthMask(!!e)},Nd:function(e,t){$n.depthRange(e,t)},Md:function(e,t){$n.detachShader(yr.programs[e],yr.shaders[t])},ug:function(e){$n.disable(e)},vg:function(e){$n.disableVertexAttribArray(e)},wg:function(e,t,r){$n.drawArrays(e,t,r)},qf:xr,Vd:Pr,Gb:Tr,of:function(e,t,r,n,o){$n.dibvbi.drawArraysInstancedBaseInstanceWEBGL(e,t,r,n,o)},hd:Ar,Hb:Fr,mf:Lr,fd:Rr,Wd:Mr,xg:Ir,rf:jr,Ud:$r,Eb:Nr,pf:function(e,t,r,n,o,i,a){$n.dibvbi.drawElementsInstancedBaseVertexBaseInstanceWEBGL(e,t,r,n,o,i,a)},Fb:Hr,gd:qr,ff:function(e,t,r,n,o,i){Or(e,n,o,i)},yg:function(e){$n.enable(e)},zg:function(e){$n.enableVertexAttribArray(e)},Xc:function(e){$n.endQuery(e)},ce:function(e){$n.disjointTimerQueryExt.endQueryEXT(e)},Jc:function(){$n.endTransformFeedback()},Oe:function(e,t){var r=$n.fenceSync(e,t);if(r){var n=yr.getNewId(yr.syncs);return r.name=n,yr.syncs[n]=r,n}return 0},Ag:function(){$n.finish()},Bg:function(){$n.flush()},bf:function(e,t,r,n){$n.framebufferRenderbuffer(e,t,r,yr.renderbuffers[n])},cf:function(e,t,r,n,o){$n.framebufferTexture2D(e,t,r,yr.textures[n],o)},Nc:function(e,t,r,n,o){$n.framebufferTextureLayer(e,t,yr.textures[r],n,o)},Cg:function(e){$n.frontFace(e)},Dg:function(e,t){Vr(e,t,"createBuffer",yr.buffers)},df:function(e,t){Vr(e,t,"createFramebuffer",yr.framebuffers)},$c:function(e,t){Vr(e,t,"createQuery",yr.queries)},he:function(e,t){for(var r=0;r<e;r++){var n=$n.disjointTimerQueryExt.createQueryEXT();if(!n){for(yr.recordError(1282);r<e;)R[t+4*r++>>2]=0;return}var o=yr.getNewId(yr.queries);n.name=o,yr.queries[o]=n,R[t+4*r>>2]=o}},ef:function(e,t){Vr(e,t,"createRenderbuffer",yr.renderbuffers)},Ke:function(e,t){Vr(e,t,"createSampler",yr.samplers)},Eg:function(e,t){Vr(e,t,"createTexture",yr.textures)},Tb:function(e,t){Vr(e,t,"createTransformFeedback",yr.transformFeedbacks)},uf:Gr,xf:zr,Ue:function(e){$n.generateMipmap(e)},Ld:function(e,t,r,n,o,i,a){Yr("getActiveAttrib",e,t,r,n,o,i,a)},Kd:function(e,t,r,n,o,i,a){Yr("getActiveUniform",e,t,r,n,o,i,a)},ec:function(e,t,r,n,o){e=yr.programs[e];var i=$n.getActiveUniformBlockName(e,t);if(i)if(o&&r>0){var a=Ot(i,o,r);n&&(R[n>>2]=a)}else n&&(R[n>>2]=0)},fc:function(e,t,r,n){if(n)if(e=yr.programs[e],35393!=r){var o=$n.getActiveUniformBlockParameter(e,t,r);if(null!==o)if(35395==r)for(var i=0;i<o.length;i++)R[n+4*i>>2]=o[i];else R[n>>2]=o}else{var a=$n.getActiveUniformBlockName(e,t);R[n>>2]=a.length+1}else yr.recordError(1281)},hc:function(e,t,r,n,o){if(o)if(t>0&&0==r)yr.recordError(1281);else{e=yr.programs[e];for(var i=[],a=0;a<t;a++)i.push(R[r+4*a>>2]);var s=$n.getActiveUniforms(e,i,n);if(s){var u=s.length;for(a=0;a<u;a++)R[o+4*a>>2]=s[a]}}else yr.recordError(1281)},Jd:function(e,t,r,n){var o=$n.getAttachedShaders(yr.programs[e]),i=o.length;i>t&&(i=t),R[r>>2]=i;for(var a=0;a<i;++a){var s=yr.shaders.indexOf(o[a]);R[n+4*a>>2]=s}},Id:function(e,t){return $n.getAttribLocation(yr.programs[e],Fe(t))},Hd:function(e,t){Kr(e,t,4)},$b:function(e,t,r){r?Xr(r,$n.getBufferParameter(e,t)):yr.recordError(1281)},Fg:function(e,t,r){r?R[r>>2]=$n.getBufferParameter(e,t):yr.recordError(1281)},Gg:function(){var e=$n.getError()||yr.lastError;return yr.lastError=0,e},Hg:function(e,t){Kr(e,t,2)},xc:function(e,t){return $n.getFragDataLocation(yr.programs[e],Fe(t))},Ve:function(e,t,r,n){var o=$n.getFramebufferAttachmentParameter(e,t,r);(o instanceof WebGLRenderbuffer||o instanceof WebGLTexture)&&(o=0|o.name),R[n>>2]=o},ac:function(e,t,r){Qr(e,t,r,1)},cc:function(e,t){Kr(e,t,1)},Lc:function(e,t,r){Qr(e,t,r,0)},gh:function(e,t){Kr(e,t,0)},Kb:function(e,t,r,n,o){if(n<0)yr.recordError(1281);else if(o){var i=$n.getInternalformatParameter(e,t,r);if(null!==i)for(var a=0;a<i.length&&a<n;++a)R[o+4*a>>2]=i[a]}else yr.recordError(1281)},Pb:function(e,t,r,n,o){yr.recordError(1282)},Ig:function(e,t,r,n){var o=$n.getProgramInfoLog(yr.programs[e]);null===o&&(o="(unknown error)");var i=t>0&&n?Ot(o,n,t):0;r&&(R[r>>2]=i)},Jg:function(e,t,r){if(r)if(e>=yr.counter)yr.recordError(1281);else if(e=yr.programs[e],35716==t){var n=$n.getProgramInfoLog(e);null===n&&(n="(unknown error)"),R[r>>2]=n.length+1}else if(35719==t){if(!e.maxUniformLength)for(var o=0;o<$n.getProgramParameter(e,35718);++o)e.maxUniformLength=Math.max(e.maxUniformLength,$n.getActiveUniform(e,o).name.length+1);R[r>>2]=e.maxUniformLength}else if(35722==t){if(!e.maxAttributeLength)for(o=0;o<$n.getProgramParameter(e,35721);++o)e.maxAttributeLength=Math.max(e.maxAttributeLength,$n.getActiveAttrib(e,o).name.length+1);R[r>>2]=e.maxAttributeLength}else if(35381==t){if(!e.maxUniformBlockNameLength)for(o=0;o<$n.getProgramParameter(e,35382);++o)e.maxUniformBlockNameLength=Math.max(e.maxUniformBlockNameLength,$n.getActiveUniformBlockName(e,o).length+1);R[r>>2]=e.maxUniformBlockNameLength}else R[r>>2]=$n.getProgramParameter(e,t);else yr.recordError(1281)},Zd:Jr,$d:tn,Yd:rn,Vc:function(e,t,r){if(r){var n,o=yr.queries[e],i=$n.getQueryParameter(o,t);n="boolean"==typeof i?i?1:0:i,R[r>>2]=n}else yr.recordError(1281)},_d:nn,Wc:function(e,t,r){r?R[r>>2]=$n.getQuery(e,t):yr.recordError(1281)},ae:function(e,t,r){r?R[r>>2]=$n.disjointTimerQueryExt.getQueryEXT(e,t):yr.recordError(1281)},We:function(e,t,r){r?R[r>>2]=$n.getRenderbufferParameter(e,t):yr.recordError(1281)},Wb:function(e,t,r){r?O[r>>2]=$n.getSamplerParameter(yr.samplers[e],t):yr.recordError(1281)},Xb:function(e,t,r){r?R[r>>2]=$n.getSamplerParameter(yr.samplers[e],t):yr.recordError(1281)},Kg:function(e,t,r,n){var o=$n.getShaderInfoLog(yr.shaders[e]);null===o&&(o="(unknown error)");var i=t>0&&n?Ot(o,n,t):0;r&&(R[r>>2]=i)},Ee:function(e,t,r,n){var o=$n.getShaderPrecisionFormat(e,t);R[r>>2]=o.rangeMin,R[r+4>>2]=o.rangeMax,R[n>>2]=o.precision},Gd:function(e,t,r,n){var o=$n.getShaderSource(yr.shaders[e]);if(o){var i=t>0&&n?Ot(o,n,t):0;r&&(R[r>>2]=i)}},Lg:function(e,t,r){if(r)if(35716==t){var n=$n.getShaderInfoLog(yr.shaders[e]);null===n&&(n="(unknown error)");var o=n?n.length+1:0;R[r>>2]=o}else if(35720==t){var i=$n.getShaderSource(yr.shaders[e]),a=i?i.length+1:0;R[r>>2]=a}else R[r>>2]=$n.getShaderParameter(yr.shaders[e],t);else yr.recordError(1281)},Ca:function(e){var t=yr.stringCache[e];if(!t){switch(e){case 7939:var r=$n.getSupportedExtensions()||[];r=r.concat(r.map((function(e){return"GL_"+e}))),t=nr(r.join(" "));break;case 7936:case 7937:case 37445:case 37446:var n=$n.getParameter(e);n||yr.recordError(1280),t=n&&nr(n);break;case 7938:var o=$n.getParameter(7938);o=yr.currentContext.version>=2?"OpenGL ES 3.0 ("+o+")":"OpenGL ES 2.0 ("+o+")",t=nr(o);break;case 35724:var i=$n.getParameter(35724),a=i.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==a&&(3==a[1].length&&(a[1]=a[1]+"0"),i="OpenGL ES GLSL ES "+a[1]+" ("+i+")"),t=nr(i);break;default:yr.recordError(1280)}yr.stringCache[e]=t}return t},hh:function(e,t){if(yr.currentContext.version<2)return yr.recordError(1282),0;var r=yr.stringiCache[e];if(r)return t<0||t>=r.length?(yr.recordError(1281),0):r[t];if(7939===e){var n=$n.getSupportedExtensions()||[];return n=(n=n.concat(n.map((function(e){return"GL_"+e})))).map((function(e){return nr(e)})),r=yr.stringiCache[e]=n,t<0||t>=r.length?(yr.recordError(1281),0):r[t]}return yr.recordError(1280),0},bc:function(e,t,r,n,o){if(r<0)yr.recordError(1281);else if(o){var i=$n.getSyncParameter(yr.syncs[e],t);null!==i&&(R[o>>2]=i,n&&(R[n>>2]=1))}else yr.recordError(1281)},Fd:function(e,t,r){r?O[r>>2]=$n.getTexParameter(e,t):yr.recordError(1281)},Ed:function(e,t,r){r?R[r>>2]=$n.getTexParameter(e,t):yr.recordError(1281)},Fc:function(e,t,r,n,o,i,a){e=yr.programs[e];var s=$n.getTransformFeedbackVarying(e,t);if(s){if(a&&r>0){var u=Ot(s.name,a,r);n&&(R[n>>2]=u)}else n&&(R[n>>2]=0);o&&(R[o>>2]=s.size),i&&(R[i>>2]=s.type)}},gc:function(e,t){return $n.getUniformBlockIndex(yr.programs[e],Fe(t))},jc:function(e,t,r,n){if(n)if(t>0&&(0==r||0==n))yr.recordError(1281);else{e=yr.programs[e];for(var o=[],i=0;i<t;i++)o.push(Fe(R[r+4*i>>2]));var a=$n.getUniformIndices(e,o);if(a){var s=a.length;for(i=0;i<s;i++)R[n+4*i>>2]=a[i]}}else yr.recordError(1281)},Mg:function(e,t){if(t=Fe(t),e=yr.programs[e]){an(e);var r=e.uniformLocsById,n=0,o=t,i=on(t);i>0&&(s=t.slice(i+1),n=parseInt(s)>>>0,o=t.slice(0,i));var a=e.uniformSizeAndIdsByName[o];if(a&&n<a[0]&&(r[n+=a[1]]=r[n]||$n.getUniformLocation(e,t)))return n}else yr.recordError(1281);var s;return-1},Dd:function(e,t,r){un(e,t,r,2)},Cd:function(e,t,r){un(e,t,r,0)},yc:function(e,t,r){un(e,t,r,0)},Ec:dn,Dc:fn,zd:function(e,t,r){r?R[r>>2]=$n.getVertexAttribOffset(e,t):yr.recordError(1281)},Bd:function(e,t,r){ln(e,t,r,2)},Ad:function(e,t,r){ln(e,t,r,5)},yd:function(e,t){$n.hint(e,t)},Fe:function(e,t,r){for(var n=Dr[t],o=0;o<t;o++)n[o]=R[r+4*o>>2];$n.invalidateFramebuffer(e,n)},He:function(e,t,r,n,o,i,a){for(var s=Dr[t],u=0;u<t;u++)s[u]=R[r+4*u>>2];$n.invalidateSubFramebuffer(e,s,n,o,i,a)},xd:function(e){var t=yr.buffers[e];return t?$n.isBuffer(t):0},wd:function(e){return $n.isEnabled(e)},vd:function(e){var t=yr.framebuffers[e];return t?$n.isFramebuffer(t):0},ud:function(e){return(e=yr.programs[e])?$n.isProgram(e):0},Zc:function(e){var t=yr.queries[e];return t?$n.isQuery(t):0},fe:function(e){var t=yr.queries[e];return t?$n.disjointTimerQueryExt.isQueryEXT(t):0},td:function(e){var t=yr.renderbuffers[e];return t?$n.isRenderbuffer(t):0},_b:function(e){var t=yr.samplers[e];return t?$n.isSampler(t):0},sd:function(e){var t=yr.shaders[e];return t?$n.isShader(t):0},Pe:function(e){return $n.isSync(yr.syncs[e])},Ng:function(e){var t=yr.textures[e];return t?$n.isTexture(t):0},Sb:function(e){return $n.isTransformFeedback(yr.transformFeedbacks[e])},Mc:hn,Xd:mn,Og:function(e){$n.lineWidth(e)},Pg:function(e){e=yr.programs[e],$n.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},kf:function(e,t,r,n,o,i){$n.mdibvbi.multiDrawArraysInstancedBaseInstanceWEBGL(e,R,t>>2,R,r>>2,R,n>>2,M,o>>2,i)},lf:function(e,t,r,n,o,i,a,s){$n.mdibvbi.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(e,R,t>>2,r,R,n>>2,R,o>>2,R,i>>2,M,a>>2,s)},Rb:function(){$n.pauseTransformFeedback()},Qg:function(e,t){3317==e&&(yr.unpackAlignment=t),$n.pixelStorei(e,t)},rd:function(e,t){$n.polygonOffset(e,t)},Nb:function(e,t,r,n){yr.recordError(1280)},Mb:function(e,t,r){yr.recordError(1280)},be:function(e,t){$n.disjointTimerQueryExt.queryCounterEXT(yr.queries[e],t)},nf:function(e){$n.readBuffer(e)},Rg:function(e,t,r,n,o,i,a){if(yr.currentContext.version>=2)if($n.currentPixelPackBufferBinding)$n.readPixels(e,t,r,n,o,i,a);else{var s=gn(i);$n.readPixels(e,t,r,n,o,i,s,a>>yn(s))}else{var u=vn(i,o,r,n,a);u?$n.readPixels(e,t,r,n,o,i,u):yr.recordError(1280)}},qd:function(){},Xe:function(e,t,r,n){$n.renderbufferStorage(e,t,r,n)},Te:function(e,t,r,n,o){$n.renderbufferStorageMultisample(e,t,r,n,o)},Qb:function(){$n.resumeTransformFeedback()},pd:function(e,t){$n.sampleCoverage(e,!!t)},Le:function(e,t,r){$n.samplerParameterf(yr.samplers[e],t,r)},Yb:function(e,t,r){var n=O[r>>2];$n.samplerParameterf(yr.samplers[e],t,n)},Me:function(e,t,r){$n.samplerParameteri(yr.samplers[e],t,r)},Ne:function(e,t,r){var n=R[r>>2];$n.samplerParameteri(yr.samplers[e],t,n)},Sg:function(e,t,r,n){$n.scissor(e,t,r,n)},od:function(e,t,r,n,o){yr.recordError(1280)},Tg:function(e,t,r,n){var o=yr.getSource(e,t,r,n);if(yr.currentContext.version>=2&&o.includes("#version 100")){var i="";(o=(o=o.replace(/#extension GL_OES_standard_derivatives : enable/g,"")).replace(/#extension GL_EXT_shader_texture_lod : enable/g,"")).includes("gl_FragColor")&&(i+="out mediump vec4 GL_FragColor;\n",o=o.replace(/gl_FragColor/g,"GL_FragColor")),o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=o.includes("attribute")?(o=o.replace(/attribute/g,"in")).replace(/varying/g,"out"):o.replace(/varying/g,"in")).replace(/textureCubeLodEXT/g,"textureCubeLod")).replace(/texture2DLodEXT/g,"texture2DLod")).replace(/texture2DProjLodEXT/g,"texture2DProjLod")).replace(/texture2DGradEXT/g,"texture2DGrad")).replace(/texture2DProjGradEXT/g,"texture2DProjGrad")).replace(/textureCubeGradEXT/g,"textureCubeGrad")).replace(/textureCube/g,"texture")).replace(/texture1D/g,"texture")).replace(/texture2D/g,"texture")).replace(/texture3D/g,"texture")).replace(/#version 100/g,"#version 300 es\n"+i)}$n.shaderSource(yr.shaders[e],o)},Ug:function(e,t,r){$n.stencilFunc(e,t,r)},Vg:function(e,t,r,n){$n.stencilFuncSeparate(e,t,r,n)},Wg:function(e){$n.stencilMask(e)},Xg:function(e,t){$n.stencilMaskSeparate(e,t)},Yg:function(e,t,r){$n.stencilOp(e,t,r)},Zg:function(e,t,r,n){$n.stencilOpSeparate(e,t,r,n)},_g:function(e,t,r,n,o,i,a,s,u){if(yr.currentContext.version>=2&&(6402==a&&6402==r&&5125==s&&(r=33190),36193==s&&(s=5131,6408==a&&6408==r&&(r=34842)),34041==r&&(r=35056)),yr.currentContext.version>=2)if($n.currentPixelUnpackBufferBinding)$n.texImage2D(e,t,r,n,o,i,a,s,u);else if(u){var l=gn(s);$n.texImage2D(e,t,r,n,o,i,a,s,l,u>>yn(l))}else $n.texImage2D(e,t,r,n,o,i,a,s,null);else $n.texImage2D(e,t,r,n,o,i,a,s,u?vn(s,a,n,o,u):null)},ed:function(e,t,r,n,o,i,a,s,u,l){if($n.currentPixelUnpackBufferBinding)$n.texImage3D(e,t,r,n,o,i,a,s,u,l);else if(l){var c=gn(u);$n.texImage3D(e,t,r,n,o,i,a,s,u,c,l>>yn(c))}else $n.texImage3D(e,t,r,n,o,i,a,s,u,null)},$g:function(e,t,r){$n.texParameterf(e,t,r)},ah:function(e,t,r){var n=O[r>>2];$n.texParameterf(e,t,n)},bh:function(e,t,r){$n.texParameteri(e,t,r)},ch:function(e,t,r){var n=R[r>>2];$n.texParameteri(e,t,n)},gf:function(e,t,r,n,o){$n.texStorage2D(e,t,r,n,o)},Lb:function(e,t,r,n,o,i){$n.texStorage3D(e,t,r,n,o,i)},dh:function(e,t,r,n,o,i,a,s,u){if(yr.currentContext.version>=2&&36193==s&&(s=5131),yr.currentContext.version>=2)if($n.currentPixelUnpackBufferBinding)$n.texSubImage2D(e,t,r,n,o,i,a,s,u);else if(u){var l=gn(s);$n.texSubImage2D(e,t,r,n,o,i,a,s,l,u>>yn(l))}else $n.texSubImage2D(e,t,r,n,o,i,a,s,null);else{var c=null;u&&(c=vn(s,a,o,i,u)),$n.texSubImage2D(e,t,r,n,o,i,a,s,c)}},dd:function(e,t,r,n,o,i,a,s,u,l,c){if($n.currentPixelUnpackBufferBinding)$n.texSubImage3D(e,t,r,n,o,i,a,s,u,l,c);else if(c){var d=gn(l);$n.texSubImage3D(e,t,r,n,o,i,a,s,u,l,d,c>>yn(d))}else $n.texSubImage3D(e,t,r,n,o,i,a,s,u,l,null)},Gc:function(e,t,r,n){e=yr.programs[e];for(var o=[],i=0;i<t;i++)o.push(Fe(R[r+4*i>>2]));$n.transformFeedbackVaryings(e,o,n)},eh:function(e,t){$n.uniform1f(sn(e),t)},fh:function(e,t,r){if(yr.currentContext.version>=2)t&&$n.uniform1fv(sn(e),O,r>>2,t);else{if(t<=288)for(var n=bn[t-1],o=0;o<t;++o)n[o]=O[r+4*o>>2];else n=O.subarray(r>>2,r+4*t>>2);$n.uniform1fv(sn(e),n)}},Sf:function(e,t){$n.uniform1i(sn(e),t)},Tf:function(e,t,r){if(yr.currentContext.version>=2)t&&$n.uniform1iv(sn(e),R,r>>2,t);else{if(t<=288)for(var n=wn[t-1],o=0;o<t;++o)n[o]=R[r+4*o>>2];else n=R.subarray(r>>2,r+4*t>>2);$n.uniform1iv(sn(e),n)}},wc:function(e,t){$n.uniform1ui(sn(e),t)},rc:function(e,t,r){t&&$n.uniform1uiv(sn(e),M,r>>2,t)},Uf:function(e,t,r){$n.uniform2f(sn(e),t,r)},Vf:function(e,t,r){if(yr.currentContext.version>=2)t&&$n.uniform2fv(sn(e),O,r>>2,2*t);else{if(t<=144)for(var n=bn[2*t-1],o=0;o<2*t;o+=2)n[o]=O[r+4*o>>2],n[o+1]=O[r+(4*o+4)>>2];else n=O.subarray(r>>2,r+8*t>>2);$n.uniform2fv(sn(e),n)}},Rf:function(e,t,r){$n.uniform2i(sn(e),t,r)},Qf:function(e,t,r){if(yr.currentContext.version>=2)t&&$n.uniform2iv(sn(e),R,r>>2,2*t);else{if(t<=144)for(var n=wn[2*t-1],o=0;o<2*t;o+=2)n[o]=R[r+4*o>>2],n[o+1]=R[r+(4*o+4)>>2];else n=R.subarray(r>>2,r+8*t>>2);$n.uniform2iv(sn(e),n)}},vc:function(e,t,r){$n.uniform2ui(sn(e),t,r)},qc:function(e,t,r){t&&$n.uniform2uiv(sn(e),M,r>>2,2*t)},Pf:function(e,t,r,n){$n.uniform3f(sn(e),t,r,n)},Of:function(e,t,r){if(yr.currentContext.version>=2)t&&$n.uniform3fv(sn(e),O,r>>2,3*t);else{if(t<=96)for(var n=bn[3*t-1],o=0;o<3*t;o+=3)n[o]=O[r+4*o>>2],n[o+1]=O[r+(4*o+4)>>2],n[o+2]=O[r+(4*o+8)>>2];else n=O.subarray(r>>2,r+12*t>>2);$n.uniform3fv(sn(e),n)}},Nf:function(e,t,r,n){$n.uniform3i(sn(e),t,r,n)},Mf:function(e,t,r){if(yr.currentContext.version>=2)t&&$n.uniform3iv(sn(e),R,r>>2,3*t);else{if(t<=96)for(var n=wn[3*t-1],o=0;o<3*t;o+=3)n[o]=R[r+4*o>>2],n[o+1]=R[r+(4*o+4)>>2],n[o+2]=R[r+(4*o+8)>>2];else n=R.subarray(r>>2,r+12*t>>2);$n.uniform3iv(sn(e),n)}},uc:function(e,t,r,n){$n.uniform3ui(sn(e),t,r,n)},pc:function(e,t,r){t&&$n.uniform3uiv(sn(e),M,r>>2,3*t)},Lf:function(e,t,r,n,o){$n.uniform4f(sn(e),t,r,n,o)},Kf:function(e,t,r){if(yr.currentContext.version>=2)t&&$n.uniform4fv(sn(e),O,r>>2,4*t);else{if(t<=72){var n=bn[4*t-1],o=O;r>>=2;for(var i=0;i<4*t;i+=4){var a=r+i;n[i]=o[a],n[i+1]=o[a+1],n[i+2]=o[a+2],n[i+3]=o[a+3]}}else n=O.subarray(r>>2,r+16*t>>2);$n.uniform4fv(sn(e),n)}},yf:function(e,t,r,n,o){$n.uniform4i(sn(e),t,r,n,o)},zf:function(e,t,r){if(yr.currentContext.version>=2)t&&$n.uniform4iv(sn(e),R,r>>2,4*t);else{if(t<=72)for(var n=wn[4*t-1],o=0;o<4*t;o+=4)n[o]=R[r+4*o>>2],n[o+1]=R[r+(4*o+4)>>2],n[o+2]=R[r+(4*o+8)>>2],n[o+3]=R[r+(4*o+12)>>2];else n=R.subarray(r>>2,r+16*t>>2);$n.uniform4iv(sn(e),n)}},sc:function(e,t,r,n,o){$n.uniform4ui(sn(e),t,r,n,o)},oc:function(e,t,r){t&&$n.uniform4uiv(sn(e),M,r>>2,4*t)},dc:function(e,t,r){e=yr.programs[e],$n.uniformBlockBinding(e,t,r)},Af:function(e,t,r,n){if(yr.currentContext.version>=2)t&&$n.uniformMatrix2fv(sn(e),!!r,O,n>>2,4*t);else{if(t<=72)for(var o=bn[4*t-1],i=0;i<4*t;i+=4)o[i]=O[n+4*i>>2],o[i+1]=O[n+(4*i+4)>>2],o[i+2]=O[n+(4*i+8)>>2],o[i+3]=O[n+(4*i+12)>>2];else o=O.subarray(n>>2,n+16*t>>2);$n.uniformMatrix2fv(sn(e),!!r,o)}},Uc:function(e,t,r,n){t&&$n.uniformMatrix2x3fv(sn(e),!!r,O,n>>2,6*t)},Sc:function(e,t,r,n){t&&$n.uniformMatrix2x4fv(sn(e),!!r,O,n>>2,8*t)},Bf:function(e,t,r,n){if(yr.currentContext.version>=2)t&&$n.uniformMatrix3fv(sn(e),!!r,O,n>>2,9*t);else{if(t<=32)for(var o=bn[9*t-1],i=0;i<9*t;i+=9)o[i]=O[n+4*i>>2],o[i+1]=O[n+(4*i+4)>>2],o[i+2]=O[n+(4*i+8)>>2],o[i+3]=O[n+(4*i+12)>>2],o[i+4]=O[n+(4*i+16)>>2],o[i+5]=O[n+(4*i+20)>>2],o[i+6]=O[n+(4*i+24)>>2],o[i+7]=O[n+(4*i+28)>>2],o[i+8]=O[n+(4*i+32)>>2];else o=O.subarray(n>>2,n+36*t>>2);$n.uniformMatrix3fv(sn(e),!!r,o)}},Tc:function(e,t,r,n){t&&$n.uniformMatrix3x2fv(sn(e),!!r,O,n>>2,6*t)},Qc:function(e,t,r,n){t&&$n.uniformMatrix3x4fv(sn(e),!!r,O,n>>2,12*t)},Cf:function(e,t,r,n){if(yr.currentContext.version>=2)t&&$n.uniformMatrix4fv(sn(e),!!r,O,n>>2,16*t);else{if(t<=18){var o=bn[16*t-1],i=O;n>>=2;for(var a=0;a<16*t;a+=16){var s=n+a;o[a]=i[s],o[a+1]=i[s+1],o[a+2]=i[s+2],o[a+3]=i[s+3],o[a+4]=i[s+4],o[a+5]=i[s+5],o[a+6]=i[s+6],o[a+7]=i[s+7],o[a+8]=i[s+8],o[a+9]=i[s+9],o[a+10]=i[s+10],o[a+11]=i[s+11],o[a+12]=i[s+12],o[a+13]=i[s+13],o[a+14]=i[s+14],o[a+15]=i[s+15]}}else o=O.subarray(n>>2,n+64*t>>2);$n.uniformMatrix4fv(sn(e),!!r,o)}},Rc:function(e,t,r,n){t&&$n.uniformMatrix4x2fv(sn(e),!!r,O,n>>2,8*t)},Pc:function(e,t,r,n){t&&$n.uniformMatrix4x3fv(sn(e),!!r,O,n>>2,12*t)},Df:function(e){e=yr.programs[e],$n.useProgram(e),$n.currentProgram=e},nd:function(e){$n.validateProgram(yr.programs[e])},Ef:function(e,t){$n.vertexAttrib1f(e,t)},md:function(e,t){$n.vertexAttrib1f(e,O[t>>2])},ld:function(e,t,r){$n.vertexAttrib2f(e,t,r)},Ff:function(e,t){$n.vertexAttrib2f(e,O[t>>2],O[t+4>>2])},kd:function(e,t,r,n){$n.vertexAttrib3f(e,t,r,n)},Gf:function(e,t){$n.vertexAttrib3f(e,O[t>>2],O[t+4>>2],O[t+8>>2])},jd:function(e,t,r,n,o){$n.vertexAttrib4f(e,t,r,n,o)},Hf:function(e,t){$n.vertexAttrib4f(e,O[t>>2],O[t+4>>2],O[t+8>>2],O[t+12>>2])},hf:_n,Td:Cn,Ib:Sn,id:kn,Jb:xn,Cc:function(e,t,r,n,o){$n.vertexAttribI4i(e,t,r,n,o)},Ac:function(e,t){$n.vertexAttribI4i(e,R[t>>2],R[t+4>>2],R[t+8>>2],R[t+12>>2])},Bc:function(e,t,r,n,o){$n.vertexAttribI4ui(e,t,r,n,o)},zc:function(e,t){$n.vertexAttribI4ui(e,M[t>>2],M[t+4>>2],M[t+8>>2],M[t+12>>2])},jf:function(e,t,r,n,o){$n.vertexAttribIPointer(e,t,r,n,o)},If:function(e,t,r,n,o,i){$n.vertexAttribPointer(e,t,r,!!n,o,i)},Jf:function(e,t,r,n){$n.viewport(e,t,r,n)},Ea:function(e,t,r){r=Number(r),$n.waitSync(yr.syncs[e],t,r)},Cb:(e,t,r)=>D.copyWithin(e,t,t+r),kb:e=>{var t=D.length,r=2147483648;if((e>>>=0)>r)return!1;for(var n,o=1;o<=4;o*=2){var i=t*(1+.2/o);i=Math.min(i,e+100663296);var a=Math.min(r,(n=Math.max(e,i))+(65536-n%65536)%65536);if(Pn(a))return!0}return!1},Va:function(e,t,r,n,o,i,a,u,l){const c=s.UTF8ToString(e,e+t),d=s.HEAPU8.subarray(o,o+i),f=s.emscripten_ubq_codec_audioDecoderNextHandle++,p={codec:c,sampleRate:r,numberOfChannels:n,description:d};try{const e=s.emscripten_ubq_codec_createAudioDecoder(a,u,l);AudioDecoder.isConfigSupported(p).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(p),s.emscripten_ubq_codec_audioDecoders.set(f,{audioDecoder:e,decoderConfig:p,leftBufferPtr:a,rightBufferPtr:u,bufferLength:l})}catch(e){return s.emscripten_ubq_codec_createNativeResult({error:e})}return s.emscripten_ubq_codec_createNativeResult({handle:f})},Ma:function(e,t,r,n,o,i){const a=s.UTF8ToString(e,e+t),u=s.emscripten_ubq_codec_audioEncoderNextHandle++,l={codec:a,sampleRate:r,numberOfChannels:n,bitrate:o};try{const e=new AudioEncoder({output:e=>{const t=s._malloc(e.byteLength),r=s.HEAPU8.subarray(t,t+e.byteLength);e.copyTo(r),s.emscripten_ubq_codec_onOutputEncodedAudioChunk(u,t,e.byteLength,i),s._free(t)},error:e=>console.error(e)});e.configure(l),s.emscripten_ubq_codec_audioEncoders.set(u,{audioEncoder:e,audioEncoderConfig:l,frameIndex:0})}catch(e){return e+=' Requested codec: "'+a+'"',e+="; sample rate: "+r,e+="; channels: "+n,e+="; bit rate: "+o,s.emscripten_ubq_codec_createNativeResult({error:e})}return s.emscripten_ubq_codec_createNativeResult({handle:u})},_a:function(e,t,r,n,o,i,a){const u=s.UTF8ToString(e,e+t),l=s.HEAPU8.subarray(o,o+i),c=s.emscripten_ubq_codec_videoDecoderNextHandle++,d={codec:u,codedWidth:r,codedHeight:n,description:l,optimizeForLatency:!0};try{const e=s.emscripten_ubq_codec_createVideoDecoder(c,a);VideoDecoder.isConfigSupported(d).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(d),s.emscripten_ubq_codec_videoDecoders.set(c,{videoDecoder:e,decoderConfig:d,codecServicePtr:a})}catch(e){return s.emscripten_ubq_codec_createNativeResult({error:e})}return s.emscripten_ubq_codec_createNativeResult({handle:c})},Qa:function(e,t,r,n,o,i){const a=s.UTF8ToString(e,e+t),u=s.emscripten_ubq_codec_videoEncoderNextHandle++,l=s.specialHTMLTargets["!canvas"];l.width=r,l.height=n;const c={codec:a,width:r,height:n,avc:{format:"annexb"},framerate:o};try{const e=new VideoEncoder({output:e=>{const t=s._malloc(e.byteLength),r=s.HEAPU8.subarray(t,t+e.byteLength);e.copyTo(r),s.emscripten_ubq_codec_onOutputEncodedVideoChunk(u,t,e.byteLength,i),s._free(t)},error:e=>console.error(e)});VideoEncoder.isConfigSupported(c).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(c),s.emscripten_ubq_codec_videoEncoders.set(u,{videoEncoder:e,encoderConfig:c,groupOfPictures:150,frameIndex:0})}catch(e){return e+=' Requested codec: "'+a+'"',e+="; resolution: "+r+"x"+n,s.emscripten_ubq_codec_createNativeResult({error:e})}return s.emscripten_ubq_codec_createNativeResult({handle:u})},Ra:function(e,t,r,n,o,i){const a=s.emscripten_ubq_codec_audioDecoders.get(e);if(a.audioDecoder.unexpectedError)return s.emscripten_ubq_codec_createNativeResult({code:2,error:a.audioDecoder.unexpectedError});"closed"===a.audioDecoder.state&&(a.audioDecoder=s.emscripten_ubq_codec_createAudioDecoder(a.leftBufferPtr,a.rightBufferPtr,a.bufferLength),a.audioDecoder.configure(a.decoderConfig));const u=a.audioDecoder,l=s.HEAPU8.subarray(o,o+i),c=new EncodedAudioChunk({type:t?"key":"delta",timestamp:r,duration:n,data:l});try{u.decode(c)}catch(e){return u.configUnsupported?s.emscripten_ubq_codec_createNativeResult({code:2,error:e}):s.emscripten_ubq_codec_createNativeResult({code:1,error:e})}return s.emscripten_ubq_codec_createNativeResult({code:0})},Ia:function(e,t,r,n,o,i){const a=s.emscripten_ubq_codec_videoDecoders.get(e);if(a.videoDecoder.unexpectedError)return s.emscripten_ubq_codec_createNativeResult({code:2,error:a.videoDecoder.unexpectedError});if("closed"===a.videoDecoder.state){const t=a.videoDecoder.textures;return a.videoDecoder=s.emscripten_ubq_codec_createVideoDecoder(e,a.codecServicePtr),a.videoDecoder.textures=t,a.videoDecoder.configure(a.decoderConfig),s.emscripten_ubq_codec_createNativeResult({code:1,error:"VideoDecoder was closed"})}const u=a.videoDecoder,l=s.HEAPU8.subarray(o,o+i),c=new EncodedVideoChunk({type:t?"key":"delta",timestamp:r,duration:n,data:l});try{u.decode(c)}catch(e){return u.configUnsupported?s.emscripten_ubq_codec_createNativeResult({code:2,error:e}):s.emscripten_ubq_codec_createNativeResult({code:1,error:e})}return s.emscripten_ubq_codec_createNativeResult({code:0})},Ua:function(e){if(s.emscripten_ubq_codec_audioDecoders.has(e)){const t=s.emscripten_ubq_codec_audioDecoders.get(e);"closed"!==t.audioDecoder.state&&t.audioDecoder.close(),s.emscripten_ubq_codec_audioDecoders.delete(e)}},La:function(e){const t=s.emscripten_ubq_codec_audioEncoders.get(e);"closed"!==t.audioEncoder.state&&t.audioEncoder.close(),s.emscripten_ubq_codec_audioEncoders.delete(e)},Ya:function(e){if(s.emscripten_ubq_codec_videoDecoders.has(e)){const t=s.emscripten_ubq_codec_videoDecoders.get(e);"closed"!==t.videoDecoder.state&&t.videoDecoder.close(),s.emscripten_ubq_codec_videoDecoders.delete(e)}},Pa:function(e){const t=s.emscripten_ubq_codec_videoEncoders.get(e);"closed"!==t.videoEncoder.state&&t.videoEncoder.close(),s.emscripten_ubq_codec_videoEncoders.delete(e)},Ka:function(e,t,r){const n=1e6,o=s.emscripten_ubq_codec_audioEncoders.get(e),i=o.audioEncoderConfig.sampleRate,a=o.audioEncoderConfig.numberOfChannels,u=r/a,l=Math.round(n*(o.frameIndex*u/i)),c=Math.round(n*(u/i)),d=s.HEAPF32.subarray(t/4,t/4+r),f=new AudioData({format:"f32",sampleRate:i,numberOfFrames:u,numberOfChannels:a,duration:c,timestamp:l,data:d});o.audioEncoder.encode(f),o.frameIndex++,f.close()},Oa:function(e,t,r){const n=1e6,o=s.emscripten_ubq_codec_videoEncoders.get(e),i=Math.round(n*(o.frameIndex/o.encoderConfig.framerate)),a=o.frameIndex%o.groupOfPictures==0,u=Math.round(n/o.encoderConfig.framerate),l=s.specialHTMLTargets["!canvas"],c=new VideoFrame(l,{timestamp:i,duration:u});o.videoEncoder.encode(c,{keyFrame:a}),c.close(),o.frameIndex++},Ja:async function(e,t){const r=s.emscripten_ubq_codec_audioEncoders.get(e);await r.audioEncoder.flush(),s.emscripten_ubq_codec_onFinalizedAudioEncoding(e,t)},Na:async function(e,t){const r=s.emscripten_ubq_codec_videoEncoders.get(e);await r.videoEncoder.flush(),s.emscripten_ubq_codec_onFinalizedVideoEncoding(e,t)},Ta:async function(e,t){const r=s.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder;r.flushing=!0;try{await r.flush()}catch{}r.flushing=!1,r.writtenFrames=t},Y:async function(e,t,r){const n=s.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder;n.shouldDropFrames=r,n.flushing=!0;try{await n.flush()}catch{}n.flushing=!1,n.shouldDropFrames=!1,n.decodedFrames=t},ka:function(e){return s.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.decodeQueueSize},la:function(e){return s.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.decodedFrames},$:function(e){return s.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.writtenFrames},Sa:function(e){return s.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.flushing},Xa:function(e){return s.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.flushing},Z:function(){return"undefined"!=typeof VideoFrame&&"undefined"!=typeof VideoDecoder&&"undefined"!=typeof VideoEncoder&&"undefined"!=typeof AudioDecoder&&"undefined"!=typeof AudioEncoder},Wa:function(e,t){s.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.requestedFrame=t},Za:function(e,t,r){const n=s.emscripten_ubq_codec_videoDecoders.get(e),o=s.HEAPU32.subarray(t/4,t/4+r);n.videoDecoder.textures=[];for(let e=0;e<r;e++)n.videoDecoder.textures[e]=yr.textures[o[e]]},qe:function(e){const t=s.emscripten_ubq_asyncFetchManager.getProcess(e);return!!(null==t?void 0:t.allocate())},fa:function(e,t,r,n){return s.emscripten_ubq_asyncFetchManager.createHeader(e,t,r,n)},ue:function(e){s.emscripten_ubq_asyncFetchManager.deleteHeader(e)},ve:function(e,t,r,n,o,i,a,u,l){return s.emscripten_ubq_asyncFetchManager.fetch(e,t,r,n,o,i,a,u,l).handle},ne:function(e){return s.emscripten_ubq_asyncFetchManager.deleteProcess(e)},te:function(e){var t,r;return null!==(r=null===(t=s.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.receivedLength)&&void 0!==r?r:0},pe:function(e){const t=s.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultAddress:-1},oe:function(e){const t=s.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultLength:-1},za:function(e){var t,r;return null!==(r=null===(t=s.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.state)&&void 0!==r?r:-1},re:function(e){var t,r;return null!==(r=null===(t=s.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.totalBytes)&&void 0!==r?r:0},bb:function(){return!!s.emscripten_ubq_settings_forceWebGL1},na:function(e,t){var r=t>>2,n=R[r+6],o={alpha:!!R[r+0],depth:!!R[r+1],stencil:!!R[r+2],antialias:!!R[r+3],premultipliedAlpha:!!R[r+4],preserveDrawingBuffer:!!R[r+5],powerPreference:An[n],failIfMajorPerformanceCaveat:!!R[r+7],majorVersion:R[r+8],minorVersion:R[r+9],enableExtensionsByDefault:R[r+10],explicitSwapControl:R[r+11],proxyContextToMainThread:R[r+12],renderViaOffscreenBackBuffer:R[r+13]},i=function(e){return function(e){var t;return e=(t=e)>2?Fe(t):t,Fn[e]||("undefined"!=typeof document?document.querySelector(e):void 0)}(e)}(e);return i?o.explicitSwapControl?0:yr.createContext(i,o):0},ma:function(e){yr.currentContext==e&&(yr.currentContext=0),yr.deleteContext(e)},cb:function(e,t){var r=yr.getContext(e),n=Fe(t);return n.startsWith("GL_")&&(n=n.substr(3)),"ANGLE_instanced_arrays"==n&&dr($n),"OES_vertex_array_object"==n&&fr($n),"WEBGL_draw_buffers"==n&&pr($n),"WEBGL_draw_instanced_base_vertex_base_instance"==n&&hr($n),"WEBGL_multi_draw_instanced_base_vertex_base_instance"==n&&mr($n),"WEBGL_multi_draw"==n&&gr($n),!!r.GLctx.getExtension(n)},ab:function(e){for(var t=e>>2,r=0;r<14;++r)R[t+r]=0;R[t+0]=R[t+1]=R[t+3]=R[t+4]=R[t+8]=R[t+10]=1},db:function(e){return yr.makeContextCurrent(e)?0:-5},tb:(e,t)=>{var r=0;return Rn().forEach((function(n,o){var i=t+r;M[e+4*o>>2]=i,((e,t)=>{for(var r=0;r<e.length;++r)F[t++>>0]=e.charCodeAt(r);F[t>>0]=0})(n,i),r+=n.length+1})),0},ub:(e,t)=>{var r=Rn();M[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),M[t>>2]=n,0},ye:ar,ba:function(e){try{var t=De.getStreamFromFD(e);return Ae.close(t),0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},lb:function(e,t,r,n,o){t=Qt(t),r=Qt(r),n=Qt(n),o=Qt(o);try{if(isNaN(n))return 61;var i=De.getStreamFromFD(e),a=Mn(i,t,r,n);return M[o>>2]=a,0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},sa:function(e,t,r,n){try{var o=De.getStreamFromFD(e),i=Mn(o,t,r);return M[n>>2]=i,0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},sb:function(e,t,r,n){t=Qt(t),n=Qt(n);try{if(isNaN(t))return 61;var o=De.getStreamFromFD(e);return Ae.llseek(o,t,r),I[n>>3]=BigInt(o.position),o.getdents&&0===t&&0===r&&(o.getdents=null),0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},ra:function(e,t,r,n){try{var o=((e,t,r,n)=>{for(var o=0,i=0;i<r;i++){var a=M[t>>2],s=M[t+4>>2];t+=8;var u=Ae.write(e,F,a,s,n);if(u<0)return-1;o+=u,void 0!==n&&(n+=u)}return o})(De.getStreamFromFD(e),t,r);return M[n>>2]=o,0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},le:function(){return"undefined"!=typeof window?nr(window.location.hostname):nr("")},fb:(e,t)=>(ge(D.subarray(e,e+t)),0),x:function(e,t,r){var n=no();try{return Et(e)(t,r)}catch(e){if(oo(n),e!==e+0)throw e;ro(1,0)}},O:function(e,t){var r=no();try{return Et(e)(t)}catch(e){if(oo(r),e!==e+0)throw e;ro(1,0)}},H:function(e,t,r){var n=no();try{return Et(e)(t,r)}catch(e){if(oo(n),e!==e+0)throw e;ro(1,0)}},l:function(e,t,r,n){var o=no();try{return Et(e)(t,r,n)}catch(e){if(oo(o),e!==e+0)throw e;ro(1,0)}},Fa:function(e){var t=no();try{return Et(e)()}catch(e){if(oo(t),e!==e+0)throw e;ro(1,0)}},ia:function(e,t,r){var n=no();try{return Et(e)(t,r)}catch(e){if(oo(n),e!==e+0)throw e;ro(1,0)}},r:function(e,t){var r=no();try{return Et(e)(t)}catch(e){if(oo(r),e!==e+0)throw e;ro(1,0)}},W:function(e,t,r,n,o,i,a,s,u,l,c,d,f,p,h,m){var g=no();try{return Et(e)(t,r,n,o,i,a,s,u,l,c,d,f,p,h,m)}catch(e){if(oo(g),e!==e+0)throw e;ro(1,0)}},q:function(e,t,r){var n=no();try{return Et(e)(t,r)}catch(e){if(oo(n),e!==e+0)throw e;ro(1,0)}},s:function(e,t,r,n){var o=no();try{return Et(e)(t,r,n)}catch(e){if(oo(o),e!==e+0)throw e;ro(1,0)}},U:function(e,t,r,n,o){var i=no();try{return Et(e)(t,r,n,o)}catch(e){if(oo(i),e!==e+0)throw e;ro(1,0)}},De:function(e,t,r,n,o,i){var a=no();try{return Et(e)(t,r,n,o,i)}catch(e){if(oo(a),e!==e+0)throw e;ro(1,0)}},Ba:function(e,t,r,n,o,i,a){var s=no();try{return Et(e)(t,r,n,o,i,a)}catch(e){if(oo(s),e!==e+0)throw e;ro(1,0)}},Aa:function(e,t,r,n,o,i,a,s,u,l){var c=no();try{return Et(e)(t,r,n,o,i,a,s,u,l)}catch(e){if(oo(c),e!==e+0)throw e;ro(1,0)}},S:function(e){var t=no();try{Et(e)()}catch(e){if(oo(t),e!==e+0)throw e;ro(1,0)}},t:function(e,t){var r=no();try{Et(e)(t)}catch(e){if(oo(r),e!==e+0)throw e;ro(1,0)}},B:function(e,t,r,n){var o=no();try{Et(e)(t,r,n)}catch(e){if(oo(o),e!==e+0)throw e;ro(1,0)}},F:function(e,t,r){var n=no();try{Et(e)(t,r)}catch(e){if(oo(n),e!==e+0)throw e;ro(1,0)}},p:function(e,t,r,n){var o=no();try{Et(e)(t,r,n)}catch(e){if(oo(o),e!==e+0)throw e;ro(1,0)}},E:function(e,t,r,n,o){var i=no();try{Et(e)(t,r,n,o)}catch(e){if(oo(i),e!==e+0)throw e;ro(1,0)}},Ce:function(e,t,r,n,o,i){var a=no();try{Et(e)(t,r,n,o,i)}catch(e){if(oo(a),e!==e+0)throw e;ro(1,0)}},Ae:function(e,t,r,n,o,i,a){var s=no();try{Et(e)(t,r,n,o,i,a)}catch(e){if(oo(s),e!==e+0)throw e;ro(1,0)}},ih:function(e,t,r,n,o,i,a,s){var u=no();try{Et(e)(t,r,n,o,i,a,s)}catch(e){if(oo(u),e!==e+0)throw e;ro(1,0)}},Be:function(e,t,r,n,o,i,a,s,u,l){var c=no();try{Et(e)(t,r,n,o,i,a,s,u,l)}catch(e){if(oo(c),e!==e+0)throw e;ro(1,0)}},ja:function(e,t){const r=Bt.toValue(t),n=s.ctx;n.bindTexture(n.TEXTURE_2D,yr.textures[e]),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r)},a:x,gb:(e,t,r,n,o)=>((e,t,r,n)=>{var o=R[n+40>>2],i={tm_sec:R[n>>2],tm_min:R[n+4>>2],tm_hour:R[n+8>>2],tm_mday:R[n+12>>2],tm_mon:R[n+16>>2],tm_year:R[n+20>>2],tm_wday:R[n+24>>2],tm_yday:R[n+28>>2],tm_isdst:R[n+32>>2],tm_gmtoff:R[n+36>>2],tm_zone:o?Fe(o):""},a=Fe(r),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)a=a.replace(new RegExp(u,"g"),s[u]);var l=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],c=["January","February","March","April","May","June","July","August","September","October","November","December"];function d(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length<t;)n=r[0]+n;return n}function f(e,t){return d(e,t,"0")}function p(e,t){function r(e){return e<0?-1:e>0?1:0}var n;return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.getDate())),n}function h(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function m(e){var t=((e,t)=>{for(var r=new Date(e.getTime());t>0;){var n=Jt(r.getFullYear()),o=r.getMonth(),i=(n?On:In)[o];if(!(t>i-r.getDate()))return r.setDate(r.getDate()+t),r;t-=i-r.getDate()+1,r.setDate(1),o<11?r.setMonth(o+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r})(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),o=h(r),i=h(n);return p(o,t)<=0?p(i,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var g={"%a":e=>l[e.tm_wday].substring(0,3),"%A":e=>l[e.tm_wday],"%b":e=>c[e.tm_mon].substring(0,3),"%B":e=>c[e.tm_mon],"%C":e=>f((e.tm_year+1900)/100|0,2),"%d":e=>f(e.tm_mday,2),"%e":e=>d(e.tm_mday,2," "),"%g":e=>m(e).toString().substring(2),"%G":e=>m(e),"%H":e=>f(e.tm_hour,2),"%I":e=>{var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),f(t,2)},"%j":e=>f(e.tm_mday+((e,t)=>{for(var r=0,n=0;n<=t;r+=e[n++]);return r})(Jt(e.tm_year+1900)?On:In,e.tm_mon-1),3),"%m":e=>f(e.tm_mon+1,2),"%M":e=>f(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>f(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var t=e.tm_yday+7-e.tm_wday;return f(Math.floor(t/7),2)},"%V":e=>{var t=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&t++,t){if(53==t){var r=(e.tm_wday+371-e.tm_yday)%7;4==r||3==r&&Jt(e.tm_year)||(t=1)}}else{t=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&Jt(e.tm_year%400-1))&&t++}return f(t,2)},"%w":e=>e.tm_wday,"%W":e=>{var t=e.tm_yday+7-(e.tm_wday+6)%7;return f(Math.floor(t/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var t=e.tm_gmtoff,r=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+String("0000"+t).slice(-4)},"%Z":e=>e.tm_zone,"%%":()=>"%"};for(var u in a=a.replace(/%%/g,"\0\0"),g)a.includes(u)&&(a=a.replace(new RegExp(u,"g"),g[u](i)));var y=Ce(a=a.replace(/\0\0/g,"%"),!1);return y.length>t?0:(Un(y,e),y.length-1)})(e,t,r,n)},Yn=(function(){var e,t,r,n,i={a:zn};function a(e,t){var r,n=e.exports;return q=(P=n).lh,r=P.jh,G.unshift(r),re(),n}if(te(),s.instantiateWasm)try{return s.instantiateWasm(i,a)}catch(e){k("Module.instantiateWasm callback failed with error: "+e),o(e)}(e=C,t=K,r=i,n=function(e){a(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||oe(t)||b||"function"!=typeof fetch?se(t,r,n):fetch(t,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,r).then(n,(function(e){return k("wasm streaming compile failed: "+e),k("falling back to ArrayBuffer instantiation"),se(t,r,n)}))))).catch(o)}(),s._malloc=e=>(Yn=s._malloc=P.kh)(e)),Xn=s._free=e=>(Xn=s._free=P.mh)(e),Kn=()=>(Kn=P.nh)(),Qn=(s._ma_malloc_emscripten=(e,t)=>(s._ma_malloc_emscripten=P.oh)(e,t),s._ma_free_emscripten=(e,t)=>(s._ma_free_emscripten=P.ph)(e,t),s._ma_device_process_pcm_frames_capture__webaudio=(e,t,r)=>(Qn=s._ma_device_process_pcm_frames_capture__webaudio=P.qh)(e,t,r)),Zn=s._ma_device_process_pcm_frames_playback__webaudio=(e,t,r)=>(Zn=s._ma_device_process_pcm_frames_playback__webaudio=P.rh)(e,t,r),Jn=e=>(Jn=P.sh)(e),eo=e=>(eo=P.th)(e),to=(s.__embind_initialize_bindings=()=>(s.__embind_initialize_bindings=P.uh)(),(e,t)=>(to=P.vh)(e,t)),ro=(e,t)=>(ro=P.wh)(e,t),no=()=>(no=P.xh)(),oo=e=>(oo=P.yh)(e),io=e=>(io=P.zh)(e),ao=e=>(ao=P.Ah)(e),so=e=>(so=P.Bh)(e),uo=(e,t,r)=>(uo=P.Ch)(e,t,r),lo=e=>(lo=P.Dh)(e);function co(){function e(){Gn||(Gn=!0,s.calledRun=!0,$||(s.noFSInit||Ae.init.initialized||Ae.init(),Ae.ignorePermissions=!1,Se.init(),ce(G),t(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),function(){if(s.postRun)for("function"==typeof s.postRun&&(s.postRun=[s.postRun]);s.postRun.length;)e=s.postRun.shift(),Y.unshift(e);var e;ce(Y)}()))}Z>0||(function(){if(s.preRun)for("function"==typeof s.preRun&&(s.preRun=[s.preRun]);s.preRun.length;)e=s.preRun.shift(),W.unshift(e);var e;ce(W)}(),Z>0||(s.setStatus?(s.setStatus("Running..."),setTimeout((function(){setTimeout((function(){s.setStatus("")}),1),e()}),1)):e()))}if(s.___start_em_js=2353435,s.___stop_em_js=2353799,s.addRunDependency=te,s.removeRunDependency=re,s.FS_createPath=Ae.createPath,s.FS_createDataFile=Ae.createDataFile,s.FS_createLazyFile=Ae.createLazyFile,s.FS_createDevice=Ae.createDevice,s.FS_unlink=Ae.unlink,s.ccall=function(e,t,r,n,o){var i={string:e=>{var t=0;return null!=e&&0!==e&&(t=(e=>{var t=Ee(e)+1,r=io(t);return Ot(e,r,t),r})(e)),t},array:e=>{var t=io(e.length);return Un(e,t),t}},a=function(e){return s["_"+e]}(e),u=[],l=0;if(n)for(var c=0;c<n.length;c++){var d=i[r[c]];d?(0===l&&(l=no()),u[c]=d(n[c])):u[c]=n[c]}var f=a.apply(null,u);return function(e){return 0!==l&&oo(l),function(e){return"string"===t?Fe(e):"boolean"===t?Boolean(e):e}(e)}(f)},s.getValue=function(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":case"i8":return F[e>>0];case"i16":return B[e>>1];case"i32":return R[e>>2];case"i64":return I[e>>3];case"float":return O[e>>2];case"double":return j[e>>3];case"*":return M[e>>2];default:ne(`invalid type for getValue: ${t}`)}},s.UTF8ToString=Fe,s.specialHTMLTargets=Fn,s.FS_createPreloadedFile=Ae.createPreloadedFile,ee=function e(){Gn||co(),Gn||(ee=e)},s.preInit)for("function"==typeof s.preInit&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return co(),e.ready});e.exports=o},809:e=>{"use strict";e.exports=require("node-fetch")},300:e=>{"use strict";e.exports=require("buffer")},113:e=>{"use strict";e.exports=require("crypto")},147:e=>{"use strict";e.exports=require("fs")},17:e=>{"use strict";e.exports=require("path")},310:e=>{"use strict";e.exports=require("url")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.p="";var n={};return(()=>{"use strict";r.d(n,{default:()=>Ke});const e=Symbol("PROXY");function t(t,r){Object.defineProperty(t[r],e,{value:{type:"getter"},writable:!1})}function o(t,r){Object.defineProperty(t[r],e,{value:{type:"setter"},writable:!1})}var i,a,s,u,l,c,d,f,p,h,m,g,y,v;Symbol("RESTORE"),function(e){let t;!function(e){e[e.sRGB=0]="sRGB",e[e.CMYK=1]="CMYK",e[e.SpotColor=2]="SpotColor"}(t=e.ColorSpace||(e.ColorSpace={})),e.toColor=function(e){switch(e.colorSpace){case t.sRGB:return{r:e.components.x,g:e.components.y,b:e.components.z,a:e.components.w};case t.SpotColor:return{name:e.spotColorName,tint:e.tint,externalReference:e.externalReference};case t.CMYK:return{c:e.components.x,m:e.components.y,y:e.components.z,k:e.components.w,tint:e.tint};default:throw new Error("Unknown color space!")}},e.fromColor=function(e){if(function(e){return"r"in e&&"a"in e&&void 0!==e.r&&void 0!==e.a}(e))return{colorSpace:t.sRGB,components:{x:e.r,y:e.g,z:e.b,w:e.a},spotColorName:"",tint:1,externalReference:""};if(function(e){return"c"in e&&"m"in e&&"y"in e&&"k"in e&&void 0!==e.c&&void 0!==e.m&&void 0!==e.y&&void 0!==e.k}(e))return{colorSpace:t.CMYK,components:{x:e.c,y:e.m,z:e.y,w:e.k},spotColorName:"",tint:e.tint,externalReference:""};if(function(e){return"name"in e&&void 0!==e.name}(e))return{colorSpace:t.SpotColor,components:{x:0,y:0,z:0,w:0},spotColorName:e.name,tint:e.tint,externalReference:e.externalReference};throw new Error("Unknown color space!")}}(i||(i={})),function(e){e[e.Pending=0]="Pending",e[e.Ready=1]="Ready",e[e.Error=2]="Error"}(a||(a={})),function(e){e.Added="DesignBlockAddedEvent",e.Updated="DesignBlockUpdatedEvent",e.Removed="DesignBlockRemovedEvent"}(s||(s={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Middle=2]="Middle",e[e.Unknown=255]="Unknown"}(u||(u={})),function(e){e[e.Pixel=0]="Pixel",e[e.Line=1]="Line",e[e.Page=2]="Page"}(l||(l={})),function(e){e[e.Up=0]="Up",e[e.Down=1]="Down"}(c||(c={})),function(e){e[e.Key0=0]="Key0",e[e.Key1=1]="Key1",e[e.Key2=2]="Key2",e[e.Key3=3]="Key3",e[e.Key4=4]="Key4",e[e.Key5=5]="Key5",e[e.Key6=6]="Key6",e[e.Key7=7]="Key7",e[e.Key8=8]="Key8",e[e.Key9=9]="Key9",e[e.A=10]="A",e[e.B=11]="B",e[e.C=12]="C",e[e.D=13]="D",e[e.E=14]="E",e[e.F=15]="F",e[e.G=16]="G",e[e.H=17]="H",e[e.I=18]="I",e[e.J=19]="J",e[e.K=20]="K",e[e.L=21]="L",e[e.M=22]="M",e[e.N=23]="N",e[e.O=24]="O",e[e.P=25]="P",e[e.Q=26]="Q",e[e.R=27]="R",e[e.S=28]="S",e[e.T=29]="T",e[e.U=30]="U",e[e.V=31]="V",e[e.W=32]="W",e[e.X=33]="X",e[e.Y=34]="Y",e[e.Z=35]="Z",e[e.ArrowLeft=36]="ArrowLeft",e[e.ArrowRight=37]="ArrowRight",e[e.ArrowUp=38]="ArrowUp",e[e.ArrowDown=39]="ArrowDown",e[e.Backspace=40]="Backspace",e[e.Enter=41]="Enter",e[e.Space=42]="Space",e[e.Escape=43]="Escape",e[e.Delete=44]="Delete",e[e.Control=45]="Control",e[e.Option=46]="Option",e[e.Shift=47]="Shift",e[e.Unknown=255]="Unknown"}(d||(d={})),function(e){e[e.Thin=100]="Thin",e[e.ExtraLight=200]="ExtraLight",e[e.Light=300]="Light",e[e.Normal=400]="Normal",e[e.Medium=500]="Medium",e[e.SemiBold=600]="SemiBold",e[e.Bold=700]="Bold",e[e.ExtraBold=800]="ExtraBold",e[e.Heavy=900]="Heavy"}(f||(f={})),function(e){e[e.Normal=0]="Normal",e[e.Italic=1]="Italic"}(p||(p={})),function(e){e.Bold="bold",e.Italic="italic"}(h||(h={})),function(e){e[e.Undefined=0]="Undefined",e[e.DesignUnit=1]="DesignUnit",e[e.Percent=2]="Percent",e[e.Auto=3]="Auto"}(m||(m={})),function(e){e[e.Free=0]="Free",e[e.VerticalStack=1]="VerticalStack",e[e.HorizontalStack=2]="HorizontalStack",e[e.DepthStack=3]="DepthStack"}(g||(g={})),function(e){e[e.Began=0]="Began",e[e.Changed=1]="Changed",e[e.Ended=2]="Ended"}(y||(y={})),function(e){e[e.Creator=0]="Creator",e[e.Adopter=1]="Adopter",e[e.Viewer=2]="Viewer",e[e.Presenter=3]="Presenter"}(v||(v={}));var b=function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};class w{constructor(e){Object.defineProperty(this,"ubq",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.ubq=e}useInternalAPI(e){const t=this.ubq.getInternalAPI();try{return e(t)}finally{t.delete()}}setValue(e,t,r,n){return this.useInternalAPI((o=>E(o.setValue(e,t,r,n))))}getValue(e,t,r){return this.useInternalAPI((n=>E(n.getValue(e,t,r))))}async execute(e,t){return new Promise(((r,n)=>{this.useInternalAPI((o=>o.ubqExecute(e,t,(e=>{try{const t=E(e);r(t)}catch(e){n(e)}})))).delete()}))}}function E(e){if(e.isValid()){const t=e.value();return e.delete(),t}{const t=e.error(),r=t.publicMessage();throw t.delete(),e.delete(),new Error(r)}}function _(e){return new Promise(((t,r)=>{e((e=>{try{const r=E(e);t(r)}catch(e){r(e)}}))}))}b([o],w.prototype,"setValue",null),b([t],w.prototype,"getValue",null);const C=(e,t=!0)=>{const r=[];for(let t=0;t<e.size();t+=1)r.push(e.get(t));return t&&e.delete(),r};var S,k,x,P,T,A=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};const F=new WeakMap,D={assets:[],total:0,currentPage:0,nextPage:void 0};class B{constructor(e){S.add(this),k.set(this,void 0),Object.defineProperty(this,"onAssetSourceAdded",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=A(this,k,"f").subscribeToAssetSourceAdded(e);return()=>{A(this,k,"f").isDeleted()||E(A(this,k,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onAssetSourceRemoved",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=A(this,k,"f").subscribeToAssetSourceRemoved(e);return()=>{A(this,k,"f").isDeleted()||E(A(this,k,"f").unsubscribe(t))}}}),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,k,e,"f")}addSource(e){var t,r,n,o,i,a;const s=null===(t=e.getSupportedMimeTypes)||void 0===t?void 0:t.bind(e),u=null===(r=e.getGroups)||void 0===r?void 0:r.bind(e),l=null===(n=e.applyAsset)||void 0===n?void 0:n.bind(e),c=null===(o=e.applyAssetToBlock)||void 0===o?void 0:o.bind(e),d=null===(i=e.addAsset)||void 0===i?void 0:i.bind(e),f=null===(a=e.removeAsset)||void 0===a?void 0:a.bind(e),p=e.credits,h=e.license;E(A(this,k,"f").addAssetSource(e.id,(async(t,r)=>{var n;try{const n=Object.assign(Object.assign({},t),{tags:C(t.tags),groups:C(t.groups),excludeGroups:C(t.excludeGroups)}),o=await e.findAssets(n);if(o){const t=Object.assign(Object.assign({},o),{assets:o.assets.map((t=>L(t,e.id)))});r.invoke(t)}else r.invoke(D)}catch(e){r.invoke(null!==(n=e.message)&&void 0!==n?n:"Unknown error in user-defined `findAssets`")}}),u?async e=>{var t;try{const t=await u();e.invoke(t)}catch(r){e.invoke(null!==(t=r.message)&&void 0!==t?t:"Unknown error in user-defined `getGroups`")}}:null,p?()=>{var e;return{name:p.name,url:null!==(e=p.url)&&void 0!==e?e:""}}:null,h?()=>{var e;return{name:h.name,url:null!==(e=h.url)&&void 0!==e?e:""}}:null,s?()=>{var e;return null!==(e=s())&&void 0!==e?e:[]}:null,l?async(e,t)=>{var r;try{const r=await l(A(this,S,"m",x).call(this,e));t.invoke(r)}catch(e){t.invoke(null!==(r=e.message)&&void 0!==r?r:"Unknown error in user-defined `applyAsset`")}}:null,c?async(e,t,r)=>{var n;try{await c(A(this,S,"m",x).call(this,e),t),r.invoke({})}catch(e){r.invoke(null!==(n=e.message)&&void 0!==n?n:"Unknown error in user-defined `applyAssetToBlock`")}}:null,d?async e=>{d(e)}:null,f?async e=>{f(e)}:null)),A(this,S,"m",P).call(this,e.id,e)}addLocalSource(e,t,r,n){E(A(this,k,"f").addLocalAssetSource(e,null!=t?t:[],r?async(e,t)=>{var n;try{const n=await r(A(this,S,"m",x).call(this,e));t.invoke(n)}catch(e){t.invoke(null!==(n=e.message)&&void 0!==n?n:"Unknown error in user-defined `applyAsset`")}}:null,n?async(e,t,r)=>{var o;try{await n(A(this,S,"m",x).call(this,e),t),r.invoke({})}catch(e){r.invoke(null!==(o=e.message)&&void 0!==o?o:"Unknown error in user-defined `applyAssetToBlock`")}}:null))}removeSource(e){E(A(this,k,"f").removeAssetSource(e)),A(this,S,"m",T).call(this,e)}findAllSources(){return C(A(this,k,"f").findAllAssetSources())}findAssets(e,t){return new Promise(((r,n)=>{var o,i,a,s,u,l,c;let d=null!==(o=null==t?void 0:t.tags)&&void 0!==o?o:[];Array.isArray(d)||(d=[d]);const f={perPage:null!==(i=null==t?void 0:t.perPage)&&void 0!==i?i:0,page:null!==(a=null==t?void 0:t.page)&&void 0!==a?a:0,query:null!==(s=null==t?void 0:t.query)&&void 0!==s?s:"",tags:d,groups:null!==(u=null==t?void 0:t.groups)&&void 0!==u?u:[],excludeGroups:null!==(l=null==t?void 0:t.excludeGroups)&&void 0!==l?l:[],locale:null!==(c=null==t?void 0:t.locale)&&void 0!==c?c:""};A(this,k,"f").findAssetSourceAssets(e,f,(e=>{try{const t=E(e);r(Object.assign(Object.assign({},t),{nextPage:-1===t.nextPage?void 0:t.nextPage}))}catch(e){n(e)}}))}))}async getGroups(e){return _((t=>A(this,k,"f").getAssetSourceGroups(e,t))).then((e=>C(e)))}getSupportedMimeTypes(e){return C(E(A(this,k,"f").getAssetSourceSupportedMimeTypes(e)))}getCredits(e){const t=E(A(this,k,"f").getAssetSourceCredits(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}getLicense(e){const t=E(A(this,k,"f").getAssetSourceLicense(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}canManageAssets(e){var t,r;return!!(null===(r=null===(t=F.get(A(this,k,"f")))||void 0===t?void 0:t.get(e))||void 0===r?void 0:r.canManageAssets)}addAssetToSource(e,t){E(A(this,k,"f").addAssetToSource(e,t))}removeAssetFromSource(e,t){E(A(this,k,"f").removeAssetFromSource(e,t))}async apply(e,t){return new Promise(((r,n)=>{A(this,k,"f").applyAssetSourceAsset(e,L(t,e),(e=>{try{const t=E(e);A(this,k,"f").isValid(t)?r(t):r(void 0)}catch(e){n(e)}}))}))}async applyToBlock(e,t,r){return _((n=>A(this,k,"f").applyAssetSourceAssetToBlock(e,L(t,e),r,n)))}async defaultApplyAsset(e){return new Promise(((t,r)=>{A(this,k,"f").defaultApplyAsset(L(e,""),(e=>{try{const r=E(e);A(this,k,"f").isValid(r)?t(r):t(void 0)}catch(e){r(e)}}))}))}async defaultApplyAssetToBlock(e,t){return _((r=>A(this,k,"f").defaultApplyAssetToBlock(L(e,""),t,r)))}dispose(){F.delete(A(this,k,"f"))}}function L(e,t){return"context"in e&&e.context.sourceId===t?e:Object.assign(Object.assign({},e),{context:{sourceId:t}})}function R(e,t){const r=`[UBQ] ${e}`;switch(t){case"Warning":console.warn(r);break;case"Error":console.error(r);break;case"Info":console.info(r);break;default:console.log(r)}}k=new WeakMap,S=new WeakSet,x=function(e){var t,r,n,o,i,a,s,u;const l=Object.assign({},e);return 0===(null===(t=l.groups)||void 0===t?void 0:t.length)&&delete l.groups,l.locale||delete l.locale,l.label||delete l.label,0===(null===(r=l.tags)||void 0===r?void 0:r.length)&&delete l.tags,(null===(n=l.credits)||void 0===n?void 0:n.name)||(null===(o=l.credits)||void 0===o?void 0:o.url)?l.credits.url||delete l.credits.url:delete l.credits,(null===(i=l.license)||void 0===i?void 0:i.name)||(null===(a=l.license)||void 0===a?void 0:a.url)?l.license.url||delete l.license.url:delete l.license,(null===(s=l.utm)||void 0===s?void 0:s.source)||(null===(u=l.utm)||void 0===u?void 0:u.medium)?(l.utm.source||delete l.utm.source,l.utm.medium||delete l.utm.medium):delete l.utm,l},P=function(e,t){F.has(A(this,k,"f"))||F.set(A(this,k,"f"),new Map),t.canManageAssets&&console.warn(`\nDEPRECATION WARNING:\n\n'canManageAssets' flag was found for asset source with the id '${e}'.\n\nThis flag is deprecated and will be removed in the next version. If you have used it to control if an upload buttons is rendered in the asset library, use the 'canAdd' options on an asset library entry. See documentation here: https://img.ly/docs/cesdk/ui/guides/customize-asset-library/`),F.get(A(this,k,"f")).set(e,{canManageAssets:t.canManageAssets})},T=function(e){var t;null===(t=F.get(A(this,k,"f")))||void 0===t||t.delete(e)};const M={baseURL:"/extensions/",entries:["ly.img.cesdk.fonts"]};function O(e,t=("undefined"==typeof window?"":window.location.href)){return new URL(e,""===t?void 0:t).href}function I(e){return"/"!==e[e.length-1]?`${e}/`:e}const U=async function(e,t,r=fetch,n,o=new Set(n.findAllSources())){const i=e.map((async e=>{const i=function(e,t){const r=e.endsWith("/"),n=t.startsWith("/");return r&&n?`${e.substring(0,e.length-1)}${t}`:r||n?`${e}${t}`:`${e}/${t}`}(t,`/${e}/content.json`);return r(i).then((e=>{if(!e.ok)throw new Error(e.statusText);return e.json()})).then((r=>{if(void 0===r.assets)throw new Error(`Invalid content.json for assets: ${e}`);const i=r.assets;o.has(e)||n.addLocalSource(e),i.forEach((r=>{r.meta&&Object.entries(r.meta).forEach((([e,n])=>{const o=n.toString();if(o.includes("{{base_url}}")){const n=o.replace("{{base_url}}",t);r.meta&&(r.meta[e]=n)}})),n.addAssetToSource(e,r)}))}))}));await Promise.all(i)};class j extends TypeError{constructor(e,t){let r;const{message:n,...o}=e,{path:i}=e;super(0===i.length?n:"At path: "+i.join(".")+" -- "+n),this.value=void 0,this.key=void 0,this.type=void 0,this.refinement=void 0,this.path=void 0,this.branch=void 0,this.failures=void 0,Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>{var n;return null!=(n=r)?n:r=[e,...t()]}}}function $(e){return"object"==typeof e&&null!=e}function N(e){return"string"==typeof e?JSON.stringify(e):""+e}function H(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:o,branch:i}=t,{type:a}=r,{refinement:s,message:u="Expected a value of type `"+a+"`"+(s?" with refinement `"+s+"`":"")+", but received: `"+N(n)+"`"}=e;return{value:n,type:a,refinement:s,key:o[o.length-1],path:o,branch:i,...e,message:u}}function*q(e,t,r,n){var o;$(o=e)&&"function"==typeof o[Symbol.iterator]||(e=[e]);for(const o of e){const e=H(o,t,r,n);e&&(yield e)}}function*V(e,t,r={}){const{path:n=[],branch:o=[e],coerce:i=!1,mask:a=!1}=r,s={path:n,branch:o};if(i&&(e=t.coercer(e,s),a&&"type"!==t.type&&$(t.schema)&&$(e)&&!Array.isArray(e)))for(const r in e)void 0===t.schema[r]&&delete e[r];let u=!0;for(const r of t.validator(e,s))u=!1,yield[r,void 0];for(let[r,l,c]of t.entries(e,s)){const t=V(l,c,{path:void 0===r?n:[...n,r],branch:void 0===r?o:[...o,l],coerce:i,mask:a});for(const n of t)n[0]?(u=!1,yield[n[0],void 0]):i&&(l=n[1],void 0===r?e=l:e instanceof Map?e.set(r,l):e instanceof Set?e.add(l):$(e)&&(e[r]=l))}if(u)for(const r of t.refiner(e,s))u=!1,yield[r,void 0];u&&(yield[void 0,e])}class W{constructor(e){this.TYPE=void 0,this.type=void 0,this.schema=void 0,this.coercer=void 0,this.validator=void 0,this.refiner=void 0,this.entries=void 0;const{type:t,schema:r,validator:n,refiner:o,coercer:i=(e=>e),entries:a=function*(){}}=e;this.type=t,this.schema=r,this.entries=a,this.coercer=i,this.validator=n?(e,t)=>q(n(e,t),t,this,e):()=>[],this.refiner=o?(e,t)=>q(o(e,t),t,this,e):()=>[]}assert(e){return function(e,t){const r=G(e,t);if(r[0])throw r[0]}(e,this)}create(e){return function(e,t){const r=G(e,t,{coerce:!0});if(r[0])throw r[0];return r[1]}(e,this)}is(e){return function(e,t){return!G(e,t)[0]}(e,this)}mask(e){return function(e,t){const r=G(e,t,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}(e,this)}validate(e,t={}){return G(e,this,t)}}function G(e,t,r={}){const n=V(e,t,r),o=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);return o[0]?[new j(o[0],(function*(){for(const e of n)e[0]&&(yield e[0])})),void 0]:[void 0,o[1]]}function z(e,t){return new W({type:e,schema:null,validator:t})}function Y(e){return new W({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||"Expected an array value, but received: "+N(e)})}function X(){return z("boolean",(e=>"boolean"==typeof e))}function K(){return z("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||"Expected an integer, but received: "+N(e)))}function Q(){return z("number",(e=>"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+N(e)))}function Z(e){const t=e?Object.keys(e):[],r=z("never",(()=>!1));return new W({type:"object",schema:e||null,*entries(n){if(e&&$(n)){const o=new Set(Object.keys(n));for(const r of t)o.delete(r),yield[r,n[r],e[r]];for(const e of o)yield[e,n[e],r]}},validator:e=>$(e)||"Expected an object, but received: "+N(e),coercer:e=>$(e)?{...e}:e})}function J(){return z("string",(e=>"string"==typeof e||"Expected a string, but received: "+N(e)))}function ee(e,t,r={}){const{exclusive:n}=r;return ne(e,"max",(r=>n?r<t:r<=t||"Expected a "+e.type+" less than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function te(e,t,r={}){const{exclusive:n}=r;return ne(e,"min",(r=>n?r>t:r>=t||"Expected a "+e.type+" greater than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function re(e){return ne(e,"nonempty",(t=>function(e){return e instanceof Map||e instanceof Set?e.size:e.length}(t)>0||"Expected a nonempty "+e.type+" but received an empty one"))}function ne(e,t,r){return new W({...e,*refiner(n,o){yield*e.refiner(n,o);const i=q(r(n,o),o,e,n);for(const e of i)yield{...e,refinement:t}}})}function oe(e,t,r){const[n]=G(t,r);if(n)throw n.message=`Error in argument '${e}': ${n.message}`,n}function ie(){const e=/image\/(png|jpeg|webp|x-tga)|video\/(mp4|quicktime)|application\/octet-stream|application\/pdf/;return z("MimeType",(t=>!("string"!=typeof t||!e.test(t))||{message:`expected one of "image/png", "image/jpeg", "image/webp", "image/x-tga", "video/mp4", "video/quicktime", "application/pdf" or "application/octet-stream", but got "${t}"`}))}function ae(){const e=["Free","VerticalStack","HorizontalStack","DepthStack"];return z("SceneLayout",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}var se;!function(e){e.Png="image/png",e.Jpeg="image/jpeg",e.WebP="image/webp",e.Tga="image/x-tga",e.Mp4="video/mp4",e.QuickTime="video/quicktime",e.Binary="application/octet-stream",e.Pdf="application/pdf",e.Zip="application/zip"}(se||(se={}));const ue=se,le="undefined"!=typeof Blob?Blob:(()=>{try{return r(300).Blob}catch(e){return function(){throw new Error("Could not find Blob constructor and failed to require('buffer').Blob")}}})();var ce,de=function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},fe=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class pe{constructor(e){ce.set(this,void 0),Object.defineProperty(this,"onZoomLevelChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=fe(this,ce,"f").subscribeToZoomLevel(e);return()=>{fe(this,ce,"f").isDeleted()||E(fe(this,ce,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onActiveChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=fe(this,ce,"f").subscribeToActiveSceneChange(e);return()=>{fe(this,ce,"f").isDeleted()||E(fe(this,ce,"f").unsubscribe(t))}}}),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,ce,e,"f")}async loadFromString(e){return oe("sceneContent",e,J()),_((t=>fe(this,ce,"f").loadSceneFromString(e,t)))}async loadFromURL(e){return oe("url",e,J()),_((t=>fe(this,ce,"f").loadSceneFromURL(e,t)))}async saveToString(){const e=this.get();if(null==e)throw new Error("No scene available.");return _((t=>{fe(this,ce,"f").saveSceneToString(e,t)}))}async saveToArchive(){return new Promise(((e,t)=>{const r=this.get();null==r?t(new Error("No scene available.")):fe(this,ce,"f").saveSceneToArchive(r,(r=>{"error"in r?t(r.error):e(new le([r],{type:ue.Zip}))}))}))}create(e="Free"){return oe("sceneLayout",e,ae()),E(fe(this,ce,"f").createScene(e))}createVideo(){return E(fe(this,ce,"f").createVideoScene())}createFromImage(e,t=300,r=1,n="Free",o=0,i=!1){return oe("url",e,J()),oe("dpi",t,te(Q(),0)),oe("pixelScaleFactor",r,te(Q(),0)),oe("sceneLayout",n,ae()),_((a=>fe(this,ce,"f").createSceneFromImage(e,t,r,n,o,i,a)))}createFromVideo(e){return oe("url",e,J()),_((t=>fe(this,ce,"f").createSceneFromVideo(e,t)))}get(){const e=E(fe(this,ce,"f").findByType("scene")),t=C(e);return t.length>0?t[0]:null}async applyTemplateFromString(e){return oe("content",e,J()),_((t=>fe(this,ce,"f").applyTemplateFromString(e,t)))}async applyTemplateFromURL(e){return oe("url",e,J()),_((t=>fe(this,ce,"f").applyTemplateFromURL(e,t)))}getMode(){const e=this.get();return E(fe(this,ce,"f").getSceneMode(e))}setDesignUnit(e){oe("designUnit",e,function(){const e=["Pixel","Millimeter","Inch"];return z("DesignUnit",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}());const t=this.get();E(fe(this,ce,"f").setDesignUnit(t,e))}getDesignUnit(){const e=this.get();return E(fe(this,ce,"f").getDesignUnit(e))}getPages(){return C(E(fe(this,ce,"f").getPages()))}getCurrentPage(){const e=this.get();if(null==e)return null;const t=E(fe(this,ce,"f").findNearestToViewPortCenterByKind(e,"page")),r=C(t);return r.length>0?r[0]:null}findNearestToViewPortCenterByType(e){oe("type",e,J());const t=this.get();if(null==t)return[];const r=E(fe(this,ce,"f").findNearestToViewPortCenterByType(t,e));return C(r)}findNearestToViewPortCenterByKind(e){oe("kind",e,J());const t=this.get();if(null==t)return[];const r=E(fe(this,ce,"f").findNearestToViewPortCenterByKind(t,e));return C(r)}setZoomLevel(e=1){const t=this.get();oe("zoomLevel",e,te(Q(),0)),fe(this,ce,"f").setZoomLevel(t,e)}getZoomLevel(){const e=this.get();return E(fe(this,ce,"f").getZoomLevel(e))}async zoomToBlock(e,t=0,r=0,n=0,o=0){return oe("id",e,K()),_((i=>fe(this,ce,"f").zoomToBlock(e,t,r,n,o,i)))}enableZoomAutoFit(e,t,r=0,n=0,o=0,i=0){return oe("id",e,K()),oe("axis",t,function(){const e=["Horizontal","Vertical","Both"];return z("ZoomAutoFitAxis",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}()),"Horizontal"===t?(oe("paddingBefore",r,Q()),oe("paddingAfter",n,Q()),E(fe(this,ce,"f").enableZoomAutoFit(e,t,r,0,n,0))):"Vertical"===t?(oe("paddingBefore",r,Q()),oe("paddingAfter",n,Q()),E(fe(this,ce,"f").enableZoomAutoFit(e,t,0,r,0,n))):(oe("paddingLeft",r,Q()),oe("paddingTop",n,Q()),oe("paddingRight",o,Q()),oe("paddingBottom",i,Q()),E(fe(this,ce,"f").enableZoomAutoFit(e,t,r,n,o,i)))}disableZoomAutoFit(e){return oe("blockOrScene",e,K()),E(fe(this,ce,"f").disableZoomAutoFit(e))}isZoomAutoFitEnabled(e){return oe("blockOrScene",e,K()),E(fe(this,ce,"f").isZoomAutoFitEnabled(e))}unstable_enableCameraPositionClamping(e,t=0,r=0,n=0,o=0,i=0,a=0,s=0,u=0){return oe("ids",e,Y(Q())),oe("paddingLeft",t,Q()),oe("paddingTop",r,Q()),oe("paddingRight",n,Q()),oe("paddingBottom",o,Q()),oe("scaledPaddingLeft",t,Q()),oe("scaledPaddingTop",r,Q()),oe("scaledPaddingRight",n,Q()),oe("scaledPaddingBottom",o,Q()),E(fe(this,ce,"f").unstable_enableCameraPositionClamping(e,t,r,n,o,i,a,s,u))}unstable_disableCameraPositionClamping(e=this.get()){if(null==e)throw new Error("No scene available.");return E(fe(this,ce,"f").unstable_disableCameraPositionClamping(e))}unstable_isCameraPositionClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return E(fe(this,ce,"f").unstable_isCameraPositionClampingEnabled(e))}unstable_enableCameraZoomClamping(e,t=-1,r=-1,n=0,o=0,i=0,a=0){return oe("ids",e,Y(Q())),oe("minZoomLimit",t,Q()),oe("maxZoomLimit",r,Q()),oe("paddingLeft",n,Q()),oe("paddingTop",o,Q()),oe("paddingRight",i,Q()),oe("paddingBottom",a,Q()),E(fe(this,ce,"f").unstable_enableCameraZoomClamping(e,t,r,n,o,i,a))}unstable_disableCameraZoomClamping(e=this.get()){if(null==e)throw new Error("No scene available.");return E(fe(this,ce,"f").unstable_disableCameraZoomClamping(e))}unstable_isCameraZoomClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return E(fe(this,ce,"f").unstable_isCameraZoomClampingEnabled(e))}}ce=new WeakMap,de([o],pe.prototype,"loadFromString",null),de([o],pe.prototype,"loadFromURL",null),de([o],pe.prototype,"create",null),de([o],pe.prototype,"createVideo",null),de([o],pe.prototype,"createFromImage",null),de([o],pe.prototype,"createFromVideo",null),de([t],pe.prototype,"get",null),de([o],pe.prototype,"applyTemplateFromString",null),de([o],pe.prototype,"applyTemplateFromURL",null),de([t],pe.prototype,"getMode",null),de([o],pe.prototype,"setDesignUnit",null),de([t],pe.prototype,"getDesignUnit",null),de([t],pe.prototype,"getPages",null),de([t],pe.prototype,"getCurrentPage",null),de([t],pe.prototype,"findNearestToViewPortCenterByType",null),de([t],pe.prototype,"findNearestToViewPortCenterByKind",null),de([o],pe.prototype,"setZoomLevel",null),de([t],pe.prototype,"getZoomLevel",null),de([o],pe.prototype,"zoomToBlock",null),de([o],pe.prototype,"enableZoomAutoFit",null),de([o],pe.prototype,"disableZoomAutoFit",null),de([t],pe.prototype,"isZoomAutoFitEnabled",null);var he,me=function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},ge=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class ye{constructor(e){he.set(this,void 0),Object.defineProperty(this,"onSelectionChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=ge(this,he,"f").subscribeToSelectionChange(e);return()=>{ge(this,he,"f").isDeleted()||E(ge(this,he,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onClicked",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=ge(this,he,"f").subscribeToBlockClicked(e);return()=>{ge(this,he,"f").isDeleted()||E(ge(this,he,"f").unsubscribe(t))}}}),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,he,e,"f")}async export(e,t=ue.Png,r={}){var n,o,i;oe("handle",e,Q()),oe("mimeType",t,ie()),oe("options",r,Z());const a=null!=r.targetWidth&&null!=r.targetHeight,s=null!==(n=r.jpegQuality)&&void 0!==n?n:.9,u=null!==(o=r.webpQuality)&&void 0!==o?o:1,l=null!==(i=r.pngCompressionLevel)&&void 0!==i?i:5;return oe("jpegQuality",s,te(ee(Q(),1),0,{exclusive:!0})),oe("webpQuality",u,te(ee(Q(),1),0,{exclusive:!0})),oe("pngCompressionLevel",l,te(ee(K(),9),0)),null==r.targetWidth&&null==r.targetHeight||(oe("targetWidth",r.targetWidth,Q()),oe("targetHeight",r.targetHeight,Q())),new Promise(((n,o)=>{var i,c,d;ge(this,he,"f").exportToBuffer(e,t,(e=>{"error"in e?o(e.error):n(new le([e],{type:t}))}),{pngCompressionLevel:l,jpegQuality:s,webpQuality:u,useTargetSize:a,targetWidth:null!==(i=r.targetWidth)&&void 0!==i?i:0,targetHeight:null!==(c=r.targetHeight)&&void 0!==c?c:0,exportPdfWithHighCompatibility:null===(d=r.exportPdfWithHighCompatibility)||void 0===d||d})}))}async exportWithColorMask(e,t=ue.Png,r,n,o,i={}){var a,s,u;oe("handle",e,Q()),oe("mimeType",t,ie()),oe("options",i,Z());const l=null!=i.targetWidth&&null!=i.targetHeight,c=null!==(a=i.jpegQuality)&&void 0!==a?a:.9,d=null!==(s=i.webpQuality)&&void 0!==s?s:1,f=null!==(u=i.pngCompressionLevel)&&void 0!==u?u:5;return oe("jpegQuality",c,te(ee(Q(),1),0,{exclusive:!0})),oe("webpQuality",d,te(ee(Q(),1),0,{exclusive:!0})),oe("pngCompressionLevel",f,te(ee(K(),9),0)),null==i.targetWidth&&null==i.targetHeight||(oe("targetWidth",i.targetWidth,Q()),oe("targetHeight",i.targetHeight,Q())),new Promise(((a,s)=>{var u,p,h;ge(this,he,"f").exportWithColorMaskToBuffer(e,t,r,n,o,((e,r)=>{if("error"in e)s(e.error);else if("error"in r)s(r.error);else{const n=new le([e],{type:t}),o=new le([r],{type:t});a([n,o])}}),{pngCompressionLevel:f,jpegQuality:c,webpQuality:d,useTargetSize:l,targetWidth:null!==(u=i.targetWidth)&&void 0!==u?u:0,targetHeight:null!==(p=i.targetHeight)&&void 0!==p?p:0,exportPdfWithHighCompatibility:null===(h=i.exportPdfWithHighCompatibility)||void 0===h||h})}))}async exportVideo(e,t=ue.Mp4,r,n){throw new Error("Method not implemented. An implementation is available on the BlockAPI at engine.block or cesdk.engine.block")}async loadFromString(e){return oe("content",e,J()),_((t=>ge(this,he,"f").loadBlocksFromString(e,t))).then((e=>C(e)))}async saveToString(e){return oe("blocks",e,Y(Q())),_((t=>ge(this,he,"f").saveBlocksToString(e,t)))}create(e){return oe("type",e,J()),E(ge(this,he,"f").create(e))}createFill(e){return oe("type",e,J()),E(ge(this,he,"f").createFill(e))}getType(e){return oe("id",e,K()),E(ge(this,he,"f").getType(e))}getKind(e){return oe("id",e,K()),E(ge(this,he,"f").getKind(e))}setKind(e,t){oe("id",e,K()),E(ge(this,he,"f").setKind(e,t))}select(e){return oe("id",e,K()),E(ge(this,he,"f").select(e))}setSelected(e,t){return oe("id",e,K()),oe("selected",t,X()),E(ge(this,he,"f").setSelected(e,t))}isSelected(e){return oe("id",e,K()),E(ge(this,he,"f").isSelected(e))}findAllSelected(){return C(ge(this,he,"f").findAllSelected())}isGroupable(e){return oe("ids",e,Y(Q())),E(ge(this,he,"f").isGroupable(e))}group(e){return oe("ids",e,re(Y(Q()))),E(ge(this,he,"f").group(e))}ungroup(e){return oe("id",e,Q()),E(ge(this,he,"f").ungroup(e))}enterGroup(e){return oe("id",e,Q()),E(ge(this,he,"f").enterGroup(e))}exitGroup(e){return oe("id",e,Q()),E(ge(this,he,"f").exitGroup(e))}setName(e,t){return oe("id",e,K()),oe("name",t,J()),E(ge(this,he,"f").setName(e,t))}getName(e){return oe("id",e,K()),E(ge(this,he,"f").getName(e))}getUUID(e){return oe("id",e,K()),E(ge(this,he,"f").getUUID(e))}findByName(e){oe("name",e,J());const t=ge(this,he,"f").findByName(e);return C(t)}findByType(e){oe("type",e,J());const t=E(ge(this,he,"f").findByType(e));return C(t)}findByKind(e){oe("kind",e,J());const t=E(ge(this,he,"f").findByKind(e));return C(t)}findAll(){return C(ge(this,he,"f").findAll())}findAllPlaceholders(){return C(ge(this,he,"f").findAllPlaceholders())}createShape(e){return oe("type",e,J()),E(ge(this,he,"f").createShape(e))}hasShape(e){return oe("id",e,K()),E(ge(this,he,"f").hasShape(e))}getShape(e){return oe("id",e,K()),E(ge(this,he,"f").getShape(e))}setShape(e,t){return oe("id",e,K()),oe("shape",t,K()),E(ge(this,he,"f").setShape(e,t))}isVisible(e){return oe("id",e,K()),E(ge(this,he,"f").isVisible(e))}setVisible(e,t){return oe("id",e,K()),oe("visible",t,X()),E(ge(this,he,"f").setVisible(e,t))}isClipped(e){return oe("id",e,K()),E(ge(this,he,"f").isClipped(e))}setClipped(e,t){return oe("id",e,K()),oe("clipped",t,X()),E(ge(this,he,"f").setClipped(e,t))}isTransformLocked(e){return oe("id",e,K()),E(ge(this,he,"f").isTransformLocked(e))}setTransformLocked(e,t){return oe("id",e,K()),oe("locked",t,X()),E(ge(this,he,"f").setTransformLocked(e,t))}getPositionX(e){return oe("id",e,K()),E(ge(this,he,"f").getPositionX(e))}getPositionXMode(e){return oe("id",e,K()),E(ge(this,he,"f").getPositionXMode(e))}getPositionY(e){return oe("id",e,K()),E(ge(this,he,"f").getPositionY(e))}getPositionYMode(e){return oe("id",e,K()),E(ge(this,he,"f").getPositionYMode(e))}setPositionX(e,t){return oe("id",e,K()),oe("value",t,Q()),E(ge(this,he,"f").setPositionX(e,t))}setPositionXMode(e,t){return oe("id",e,K()),E(ge(this,he,"f").setPositionXMode(e,t))}setPositionY(e,t){return oe("id",e,K()),oe("value",t,Q()),E(ge(this,he,"f").setPositionY(e,t))}setPositionYMode(e,t){return oe("id",e,K()),E(ge(this,he,"f").setPositionYMode(e,t))}setAlwaysOnTop(e,t){return oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setAlwaysOnTop(e,t))}setAlwaysOnBottom(e,t){return oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setAlwaysOnBottom(e,t))}isAlwaysOnTop(e){return oe("id",e,K()),E(ge(this,he,"f").isAlwaysOnTop(e))}isAlwaysOnBottom(e){return oe("id",e,K()),E(ge(this,he,"f").isAlwaysOnBottom(e))}bringToFront(e){return oe("id",e,Q()),E(ge(this,he,"f").bringToFront(e))}sendToBack(e){return oe("id",e,Q()),E(ge(this,he,"f").sendToBack(e))}bringForward(e){return oe("id",e,Q()),E(ge(this,he,"f").bringForward(e))}sendBackward(e){return oe("id",e,Q()),E(ge(this,he,"f").sendBackward(e))}getRotation(e){return oe("id",e,K()),E(ge(this,he,"f").getRotation(e))}setRotation(e,t){return oe("id",e,K()),oe("radians",t,Q()),E(ge(this,he,"f").setRotation(e,t))}getFlipHorizontal(e){return oe("id",e,K()),E(ge(this,he,"f").getFlip(e)).horizontal}getFlipVertical(e){return oe("id",e,K()),E(ge(this,he,"f").getFlip(e)).vertical}setFlipHorizontal(e,t){return oe("id",e,K()),oe("flip",t,X()),E(ge(this,he,"f").setFlipHorizontal(e,t))}setFlipVertical(e,t){return oe("id",e,K()),oe("flip",t,X()),E(ge(this,he,"f").setFlipVertical(e,t))}hasContentFillMode(e){return oe("id",e,K()),E(ge(this,he,"f").hasContentFillMode(e))}getWidth(e){return oe("id",e,K()),E(ge(this,he,"f").getWidth(e))}getWidthMode(e){return oe("id",e,K()),E(ge(this,he,"f").getWidthMode(e))}getHeight(e){return oe("id",e,K()),E(ge(this,he,"f").getHeight(e))}getHeightMode(e){return oe("id",e,K()),E(ge(this,he,"f").getHeightMode(e))}setWidth(e,t){return oe("id",e,K()),oe("value",t,Q()),E(ge(this,he,"f").setWidth(e,t))}setWidthMode(e,t){return oe("id",e,K()),E(ge(this,he,"f").setWidthMode(e,t))}setHeight(e,t){return oe("id",e,K()),oe("value",t,Q()),E(ge(this,he,"f").setHeight(e,t))}setHeightMode(e,t){return oe("id",e,K()),E(ge(this,he,"f").setHeightMode(e,t))}getFrameX(e){return oe("id",e,K()),E(ge(this,he,"f").getLastFrameX(e))}getFrameY(e){return oe("id",e,K()),E(ge(this,he,"f").getLastFrameY(e))}getFrameWidth(e){return oe("id",e,K()),E(ge(this,he,"f").getLastFrameWidth(e))}getFrameHeight(e){return oe("id",e,K()),E(ge(this,he,"f").getLastFrameHeight(e))}setContentFillMode(e,t){return oe("id",e,K()),E(ge(this,he,"f").setContentFillMode(e,t))}getContentFillMode(e){return oe("id",e,K()),E(ge(this,he,"f").getContentFillMode(e))}duplicate(e){return oe("id",e,K()),E(ge(this,he,"f").duplicate(e))}destroy(e){return oe("id",e,K()),E(ge(this,he,"f").destroy(e))}isValid(e){return oe("id",e,K()),ge(this,he,"f").isValid(e)}getParent(e){return oe("id",e,K()),E(ge(this,he,"f").hasParent(e))?E(ge(this,he,"f").getParent(e)):null}getChildren(e){oe("id",e,K());const t=E(ge(this,he,"f").getChildren(e));return C(t)}insertChild(e,t,r){return oe("parent",e,Q()),oe("child",t,Q()),oe("index",r,te(Q(),0)),E(ge(this,he,"f").insertChild(e,t,r))}appendChild(e,t){return oe("parent",e,Q()),oe("child",t,Q()),E(ge(this,he,"f").appendChild(e,t))}referencesAnyVariables(e){return oe("id",e,K()),E(ge(this,he,"f").referencesAnyVariables(e))}getGlobalBoundingBoxX(e){return oe("id",e,K()),E(ge(this,he,"f").getGlobalBoundingBoxX(e))}getGlobalBoundingBoxY(e){return oe("id",e,K()),E(ge(this,he,"f").getGlobalBoundingBoxY(e))}getGlobalBoundingBoxWidth(e){return oe("id",e,K()),E(ge(this,he,"f").getGlobalBoundingBoxWidth(e))}getGlobalBoundingBoxHeight(e){return oe("id",e,K()),E(ge(this,he,"f").getGlobalBoundingBoxHeight(e))}getScreenSpaceBoundingBoxXYWH(e){return oe("ids",e,Y(Q())),E(ge(this,he,"f").getScreenSpaceBoundingBoxXYWH(e))}alignHorizontally(e,t){return oe("ids",e,re(Y(Q()))),E(ge(this,he,"f").alignHorizontally(e,t))}alignVertically(e,t){return oe("ids",e,re(Y(Q()))),E(ge(this,he,"f").alignVertically(e,t))}isAlignable(e){return oe("ids",e,Y(Q())),E(ge(this,he,"f").isAlignable(e))}distributeHorizontally(e){return oe("ids",e,re(Y(Q()))),E(ge(this,he,"f").distributeHorizontally(e))}distributeVertically(e){return oe("ids",e,re(Y(Q()))),E(ge(this,he,"f").distributeVertically(e))}isDistributable(e){return oe("ids",e,Y(Q())),E(ge(this,he,"f").isDistributable(e))}fillParent(e){return oe("id",e,K()),E(ge(this,he,"f").fillParent(e))}resizeContentAware(e,t,r){return oe("ids",e,Y(Q())),oe("width",t,Q()),oe("height",r,Q()),E(ge(this,he,"f").resizeContentAware(e,t,r))}scale(e,t,r=0,n=0){return oe("id",e,K()),E(ge(this,he,"f").scale(e,t,r,n))}findAllProperties(e){return oe("id",e,K()),C(E(ge(this,he,"f").findAllProperties(e)))}isPropertyReadable(e){return oe("property",e,J()),ge(this,he,"f").isPropertyReadable(e)}isPropertyWritable(e){return oe("property",e,J()),ge(this,he,"f").isPropertyWritable(e)}getPropertyType(e){return oe("property",e,J()),E(ge(this,he,"f").getPropertyType(e))}getEnumValues(e){return oe("enumProperty",e,J()),C(E(ge(this,he,"f").getEnumValues(e)))}setBool(e,t,r){return oe("id",e,K()),oe("property",t,J()),oe("value",r,X()),E(ge(this,he,"f").setBool(e,t,r))}getBool(e,t){return oe("id",e,K()),oe("property",t,J()),E(ge(this,he,"f").getBool(e,t))}setInt(e,t,r){return oe("id",e,K()),oe("property",t,J()),oe("value",r,K()),E(ge(this,he,"f").setInt(e,t,r))}getInt(e,t){return oe("id",e,K()),oe("property",t,J()),E(ge(this,he,"f").getInt(e,t))}setFloat(e,t,r){return oe("id",e,K()),oe("property",t,J()),oe("value",r,Q()),E(ge(this,he,"f").setFloat(e,t,r))}getFloat(e,t){return oe("id",e,K()),oe("property",t,J()),E(ge(this,he,"f").getFloat(e,t))}setDouble(e,t,r){return oe("id",e,K()),oe("property",t,J()),oe("value",r,Q()),E(ge(this,he,"f").setDouble(e,t,r))}getDouble(e,t){return oe("id",e,K()),oe("property",t,J()),E(ge(this,he,"f").getDouble(e,t))}setString(e,t,r){return oe("id",e,K()),oe("property",t,J()),oe("value",r,J()),E(ge(this,he,"f").setString(e,t,r))}getString(e,t){return oe("id",e,K()),oe("property",t,J()),E(ge(this,he,"f").getString(e,t))}setColor(e,t,r){return oe("id",e,K()),oe("property",t,J()),E(ge(this,he,"f").setColor(e,t,i.fromColor(r)))}getColor(e,t){return oe("id",e,K()),oe("property",t,J()),i.toColor(E(ge(this,he,"f").getColor(e,t)))}setColorRGBA(e,t,r,n,o,i=1){return oe("id",e,K()),oe("property",t,J()),oe("r",r,Q()),oe("g",n,Q()),oe("b",o,Q()),oe("a",i,Q()),E(ge(this,he,"f").setColorRGBA(e,t,r,n,o,i))}getColorRGBA(e,t){return oe("id",e,K()),oe("property",t,J()),E(ge(this,he,"f").getColorRGBA(e,t))}setColorSpot(e,t,r,n=1){return oe("id",e,K()),oe("property",t,J()),oe("name",r,J()),oe("tint",n,Q()),E(ge(this,he,"f").setColorSpot(e,t,r,n))}getColorSpotName(e,t){return oe("id",e,K()),oe("property",t,J()),E(ge(this,he,"f").getColorSpotName(e,t))}getColorSpotTint(e,t){return oe("id",e,K()),oe("property",t,J()),E(ge(this,he,"f").getColorSpotTint(e,t))}setGradientColorStops(e,t,r){oe("id",e,K()),oe("property",t,J());const n=r.map((e=>({color:i.fromColor(e.color),stop:e.stop})));return E(ge(this,he,"f").setGradientColorStops(e,t,n))}getGradientColorStops(e,t){oe("id",e,K()),oe("property",t,J());const r=E(ge(this,he,"f").getGradientColorStops(e,t));return C(r).map((e=>({color:i.toColor(e.color),stop:e.stop})))}setEnum(e,t,r){return oe("id",e,K()),oe("property",t,J()),oe("value",r,J()),E(ge(this,he,"f").setEnum(e,t,r))}getEnum(e,t){return oe("id",e,K()),oe("property",t,J()),E(ge(this,he,"f").getEnum(e,t))}hasCrop(e){return oe("id",e,K()),E(ge(this,he,"f").hasCrop(e))}setCropScaleX(e,t){return oe("id",e,K()),oe("scaleX",t,Q()),E(ge(this,he,"f").setCropScaleX(e,t))}setCropScaleY(e,t){return oe("id",e,K()),oe("scaleY",t,Q()),E(ge(this,he,"f").setCropScaleY(e,t))}setCropRotation(e,t){return oe("id",e,K()),oe("rotation",t,Q()),E(ge(this,he,"f").setCropRotation(e,t))}setCropScaleRatio(e,t){return oe("id",e,K()),oe("scaleRatio",t,Q()),E(ge(this,he,"f").setCropScaleRatio(e,t))}setCropTranslationX(e,t){return oe("id",e,K()),oe("translationX",t,Q()),E(ge(this,he,"f").setCropTranslationX(e,t))}setCropTranslationY(e,t){return oe("id",e,K()),oe("translationY",t,Q()),E(ge(this,he,"f").setCropTranslationY(e,t))}resetCrop(e){return oe("id",e,K()),E(ge(this,he,"f").resetCrop(e))}getCropScaleX(e){return oe("id",e,K()),E(ge(this,he,"f").getCropScaleX(e))}getCropScaleY(e){return oe("id",e,K()),E(ge(this,he,"f").getCropScaleY(e))}getCropRotation(e){return oe("id",e,K()),E(ge(this,he,"f").getCropRotation(e))}getCropScaleRatio(e){return oe("id",e,K()),E(ge(this,he,"f").getCropScaleRatio(e))}getCropTranslationX(e){return oe("id",e,K()),E(ge(this,he,"f").getCropTranslationX(e))}getCropTranslationY(e){return oe("id",e,K()),E(ge(this,he,"f").getCropTranslationY(e))}adjustCropToFillFrame(e,t){return oe("id",e,K()),oe("minScaleRatio",t,Q()),E(ge(this,he,"f").adjustCropToFillFrame(e,t))}flipCropHorizontal(e){return oe("id",e,K()),E(ge(this,he,"f").flipCropHorizontal(e))}flipCropVertical(e){return oe("id",e,K()),E(ge(this,he,"f").flipCropVertical(e))}hasOpacity(e){return oe("id",e,K()),E(ge(this,he,"f").hasOpacity(e))}setOpacity(e,t){return oe("id",e,K()),oe("opacity",t,Q()),E(ge(this,he,"f").setOpacity(e,t))}getOpacity(e){return oe("id",e,K()),E(ge(this,he,"f").getOpacity(e))}hasBlendMode(e){return oe("id",e,K()),E(ge(this,he,"f").hasBlendMode(e))}setBlendMode(e,t){return oe("id",e,K()),oe("blendMode",t,J()),E(ge(this,he,"f").setBlendMode(e,t))}getBlendMode(e){return oe("id",e,K()),E(ge(this,he,"f").getBlendMode(e))}hasFillColor(e){return oe("id",e,K()),E(ge(this,he,"f").hasFillColor(e))}isIncludedInExport(e){return oe("id",e,K()),E(ge(this,he,"f").isIncludedInExport(e))}setIncludedInExport(e,t){return oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setIncludedInExport(e,t))}setFillColorRGBA(e,t,r,n,o=1){return oe("id",e,K()),oe("r",t,Q()),oe("g",r,Q()),oe("b",n,Q()),oe("a",o,Q()),E(ge(this,he,"f").setFillColorRGBA(e,t,r,n,o))}getFillColorRGBA(e){return oe("id",e,K()),E(ge(this,he,"f").getFillColorRGBA(e))}setFillColorEnabled(e,t){return oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setFillColorEnabled(e,t))}isFillColorEnabled(e){return oe("id",e,K()),E(ge(this,he,"f").isFillColorEnabled(e))}createEffect(e){return oe("type",e,J()),E(ge(this,he,"f").createEffect(e))}hasEffects(e){return oe("id",e,K()),E(ge(this,he,"f").hasEffects(e))}getEffects(e){oe("id",e,K());const t=E(ge(this,he,"f").getEffects(e));return C(t)}insertEffect(e,t,r){oe("id",e,K()),oe("effectId",t,K()),oe("index",r,te(K(),0)),E(ge(this,he,"f").insertEffect(e,t,r))}appendEffect(e,t){oe("id",e,K()),oe("effectId",t,K()),E(ge(this,he,"f").appendEffect(e,t))}removeEffect(e,t){oe("id",e,K()),oe("index",t,te(K(),0)),E(ge(this,he,"f").removeEffect(e,t))}hasEffectEnabled(e){return oe("effectId",e,K()),E(ge(this,he,"f").hasEffectEnabled(e))}setEffectEnabled(e,t){oe("effectId",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setEffectEnabled(e,t))}isEffectEnabled(e){return oe("effectId",e,K()),E(ge(this,he,"f").isEffectEnabled(e))}createBlur(e){return oe("type",e,J()),E(ge(this,he,"f").createBlur(e))}hasBlur(e){return oe("id",e,K()),E(ge(this,he,"f").hasBlur(e))}setBlur(e,t){oe("id",e,K()),oe("blurId",t,K()),E(ge(this,he,"f").setBlur(e,t))}getBlur(e){return oe("id",e,K()),E(ge(this,he,"f").getBlur(e))}setBlurEnabled(e,t){oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setBlurEnabled(e,t))}isBlurEnabled(e){return oe("id",e,K()),E(ge(this,he,"f").isBlurEnabled(e))}hasBackgroundColor(e){return oe("id",e,K()),E(ge(this,he,"f").hasBackgroundColor(e))}setBackgroundColorRGBA(e,t,r,n,o=1){return oe("id",e,K()),oe("r",t,Q()),oe("g",r,Q()),oe("b",n,Q()),oe("a",o,Q()),E(ge(this,he,"f").setBackgroundColorRGBA(e,t,r,n,o))}getBackgroundColorRGBA(e){return oe("id",e,K()),E(ge(this,he,"f").getBackgroundColorRGBA(e))}setBackgroundColorEnabled(e,t){return oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setBackgroundColorEnabled(e,t))}isBackgroundColorEnabled(e){return oe("id",e,K()),E(ge(this,he,"f").isBackgroundColorEnabled(e))}hasStroke(e){return oe("id",e,K()),E(ge(this,he,"f").hasStroke(e))}setStrokeEnabled(e,t){return oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setStrokeEnabled(e,t))}isStrokeEnabled(e){return oe("id",e,K()),E(ge(this,he,"f").isStrokeEnabled(e))}setStrokeColorRGBA(e,t,r,n,o=1){return oe("id",e,K()),oe("r",t,Q()),oe("g",r,Q()),oe("b",n,Q()),oe("a",o,Q()),E(ge(this,he,"f").setStrokeColorRGBA(e,t,r,n,o))}setStrokeColor(e,t){return oe("id",e,K()),E(ge(this,he,"f").setStrokeColor(e,i.fromColor(t)))}getStrokeColorRGBA(e){return oe("id",e,K()),E(ge(this,he,"f").getStrokeColorRGBA(e))}getStrokeColor(e){return oe("id",e,K()),i.toColor(E(ge(this,he,"f").getStrokeColor(e)))}setStrokeWidth(e,t){return oe("id",e,K()),oe("width",t,Q()),E(ge(this,he,"f").setStrokeWidth(e,t))}getStrokeWidth(e){return oe("id",e,K()),E(ge(this,he,"f").getStrokeWidth(e))}setStrokeStyle(e,t){return oe("id",e,K()),E(ge(this,he,"f").setStrokeStyle(e,t))}getStrokeStyle(e){return oe("id",e,K()),E(ge(this,he,"f").getStrokeStyle(e))}setStrokePosition(e,t){return oe("id",e,K()),E(ge(this,he,"f").setStrokePosition(e,t))}getStrokePosition(e){return oe("id",e,K()),E(ge(this,he,"f").getStrokePosition(e))}setStrokeCornerGeometry(e,t){return oe("id",e,K()),E(ge(this,he,"f").setStrokeCornerGeometry(e,t))}getStrokeCornerGeometry(e){return oe("id",e,K()),E(ge(this,he,"f").getStrokeCornerGeometry(e))}hasDropShadow(e){return oe("id",e,K()),E(ge(this,he,"f").hasDropShadow(e))}setDropShadowEnabled(e,t){return oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setDropShadowEnabled(e,t))}isDropShadowEnabled(e){return oe("id",e,K()),E(ge(this,he,"f").isDropShadowEnabled(e))}setDropShadowColorRGBA(e,t,r,n,o=1){return oe("id",e,K()),oe("r",t,Q()),oe("g",r,Q()),oe("b",n,Q()),oe("a",o,Q()),E(ge(this,he,"f").setDropShadowColorRGBA(e,t,r,n,o))}setDropShadowColor(e,t){return oe("id",e,K()),E(ge(this,he,"f").setDropShadowColor(e,i.fromColor(t)))}getDropShadowColorRGBA(e){return oe("id",e,K()),E(ge(this,he,"f").getDropShadowColorRGBA(e))}getDropShadowColor(e){return oe("id",e,K()),i.toColor(E(ge(this,he,"f").getDropShadowColor(e)))}setDropShadowOffsetX(e,t){return oe("id",e,K()),oe("offsetX",t,Q()),E(ge(this,he,"f").setDropShadowOffsetX(e,t))}getDropShadowOffsetX(e){return oe("id",e,K()),E(ge(this,he,"f").getDropShadowOffsetX(e))}setDropShadowOffsetY(e,t){return oe("id",e,K()),oe("offsetY",t,Q()),E(ge(this,he,"f").setDropShadowOffsetY(e,t))}getDropShadowOffsetY(e){return oe("id",e,K()),E(ge(this,he,"f").getDropShadowOffsetY(e))}setDropShadowBlurRadiusX(e,t){return oe("id",e,K()),oe("blurRadiusX",t,Q()),E(ge(this,he,"f").setDropShadowBlurRadiusX(e,t))}getDropShadowBlurRadiusX(e){return oe("id",e,K()),E(ge(this,he,"f").getDropShadowBlurRadiusX(e))}setDropShadowBlurRadiusY(e,t){return oe("id",e,K()),oe("blurRadiusY",t,Q()),E(ge(this,he,"f").setDropShadowBlurRadiusY(e,t))}getDropShadowBlurRadiusY(e){return oe("id",e,K()),E(ge(this,he,"f").getDropShadowBlurRadiusY(e))}setDropShadowClip(e,t){return oe("id",e,K()),E(ge(this,he,"f").setDropShadowClip(e,t))}getDropShadowClip(e){return oe("id",e,K()),E(ge(this,he,"f").getDropShadowClip(e))}createCutoutFromBlocks(e,t=2,r=4){return oe("ids",e,Y(K())),oe("vectorizeDistanceThreshold",t,Q()),oe("maxSmoothingDistance",r,Q()),E(ge(this,he,"f").createCutoutFromBlocks(e,t,r))}createCutoutFromPath(e){return oe("path",e,J()),E(ge(this,he,"f").createCutoutFromPath(e))}createCutoutFromOperation(e,t){return oe("ids",e,Y(K())),oe("op",t,function(){const e=["Difference","Intersection","Union","XOR"];return z("CutoutOperation",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}()),E(ge(this,he,"f").createCutoutFromOperation(e,t))}replaceText(e,t,r=-1,n=-1){oe("id",e,K()),oe("text",t,J()),oe("from",r,K()),oe("to",n,K()),E(ge(this,he,"f").replaceText(e,t,r,n))}removeText(e,t=-1,r=-1){oe("id",e,K()),oe("from",t,K()),oe("to",r,K()),E(ge(this,he,"f").removeText(e,t,r))}setTextColor(e,t,r=-1,n=-1){oe("id",e,K()),oe("from",r,K()),oe("to",n,K()),E(ge(this,he,"f").setTextColor(e,i.fromColor(t),r,n))}getTextColors(e,t=-1,r=-1){oe("id",e,K()),oe("from",t,K()),oe("to",r,K());const n=ge(this,he,"f").getTextColors(e,t,r);return C(E(n)).map((e=>i.toColor(e)))}getTextFontWeights(e,t=-1,r=-1){return oe("id",e,K()),oe("from",t,K()),oe("to",r,K()),C(E(ge(this,he,"f").getTextFontWeights(e,t,r)))}getTextFontStyles(e,t=-1,r=-1){return oe("id",e,K()),oe("from",t,K()),oe("to",r,K()),C(E(ge(this,he,"f").getTextFontStyles(e,t,r)))}getTextCases(e,t=-1,r=-1){return oe("id",e,K()),oe("from",t,K()),oe("to",r,K()),C(E(ge(this,he,"f").getTextCases(e,t,r)))}setTextCase(e,t,r=-1,n=-1){oe("id",e,K()),oe("textCase",t,J()),oe("from",r,K()),oe("to",n,K()),E(ge(this,he,"f").setTextCase(e,t,r,n))}getTextCursorRange(){return E(ge(this,he,"f").getTextCursorRange())}hasFill(e){return oe("id",e,K()),E(ge(this,he,"f").hasFill(e))}isFillEnabled(e){return oe("id",e,K()),E(ge(this,he,"f").isFillEnabled(e))}setFillEnabled(e,t){return oe("id",e,K()),E(ge(this,he,"f").setFillEnabled(e,t))}getFill(e){return oe("id",e,K()),E(ge(this,he,"f").getFill(e))}setFill(e,t){return oe("id",e,K()),oe("fill",t,K()),E(ge(this,he,"f").setFill(e,t))}setFillSolidColor(e,t,r,n,o=1){oe("id",e,K()),E(ge(this,he,"f").setFillSolidColor(e,t,r,n,o))}getFillSolidColor(e){return oe("id",e,K()),E(ge(this,he,"f").getFillSolidColor(e))}setPlaceholderEnabled(e,t){oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setPlaceholderEnabled(e,t))}isPlaceholderEnabled(e){return oe("id",e,K()),E(ge(this,he,"f").isPlaceholderEnabled(e))}hasPlaceholderBehavior(e){return oe("id",e,K()),E(ge(this,he,"f").hasPlaceholderBehavior(e))}setPlaceholderBehaviorEnabled(e,t){oe("id",e,K()),E(ge(this,he,"f").setPlaceholderBehaviorEnabled(e,t))}isPlaceholderBehaviorEnabled(e){return oe("id",e,K()),E(ge(this,he,"f").isPlaceholderBehaviorEnabled(e))}hasPlaceholderControls(e){return oe("id",e,K()),E(ge(this,he,"f").hasPlaceholderControls(e))}setPlaceholderControlsOverlayEnabled(e,t){return oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setPlaceholderControlsOverlayEnabled(e,t))}isPlaceholderControlsOverlayEnabled(e){return oe("id",e,K()),E(ge(this,he,"f").isPlaceholderControlsOverlayEnabled(e))}setPlaceholderControlsButtonEnabled(e,t){return oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setPlaceholderControlsButtonEnabled(e,t))}isPlaceholderControlsButtonEnabled(e){return oe("id",e,K()),E(ge(this,he,"f").isPlaceholderControlsButtonEnabled(e))}setMetadata(e,t,r){oe("id",e,K()),oe("key",t,J()),oe("value",r,J()),E(ge(this,he,"f").setMetadata(e,t,r))}getMetadata(e,t){return oe("id",e,K()),oe("key",t,J()),E(ge(this,he,"f").getMetadata(e,t))}hasMetadata(e,t){return oe("id",e,K()),oe("key",t,J()),E(ge(this,he,"f").hasMetadata(e,t))}findAllMetadata(e){return oe("id",e,K()),C(E(ge(this,he,"f").findAllMetadata(e)))}removeMetadata(e,t){oe("id",e,K()),oe("key",t,J()),E(ge(this,he,"f").removeMetadata(e,t))}setScopeEnabled(e,t,r){oe("id",e,K()),oe("key",t,J()),oe("enabled",r,X()),E(ge(this,he,"f").setScopeEnabled(e,t,r))}isScopeEnabled(e,t){return oe("id",e,K()),oe("key",t,J()),E(ge(this,he,"f").isScopeEnabled(e,t))}isAllowedByScope(e,t){return oe("id",e,K()),oe("key",t,J()),E(ge(this,he,"f").isAllowedByScope(e,t))}hasDuration(e){return oe("id",e,K()),E(ge(this,he,"f").hasDuration(e))}setDuration(e,t){return oe("id",e,K()),oe("duration",t,Q()),E(ge(this,he,"f").setDuration(e,t))}getDuration(e){return oe("id",e,K()),E(ge(this,he,"f").getDuration(e))}hasTimeOffset(e){return oe("id",e,K()),E(ge(this,he,"f").hasTimeOffset(e))}setTimeOffset(e,t){return oe("id",e,K()),oe("offset",t,Q()),E(ge(this,he,"f").setTimeOffset(e,t))}getTimeOffset(e){return oe("id",e,K()),E(ge(this,he,"f").getTimeOffset(e))}hasTrim(e){return oe("id",e,K()),E(ge(this,he,"f").hasTrim(e))}setTrimOffset(e,t){return oe("id",e,K()),oe("offset",t,Q()),E(ge(this,he,"f").setTrimOffset(e,t))}getTrimOffset(e){return oe("id",e,K()),E(ge(this,he,"f").getTrimOffset(e))}setTrimLength(e,t){return oe("id",e,K()),oe("length",t,Q()),E(ge(this,he,"f").setTrimLength(e,t))}getTrimLength(e){return oe("id",e,K()),E(ge(this,he,"f").getTrimLength(e))}getTotalSceneDuration(e){return oe("scene",e,K()),E(ge(this,he,"f").getTotalSceneDuration(e))}setPlaying(e,t){return oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setPlaying(e,t))}isPlaying(e){return oe("id",e,K()),E(ge(this,he,"f").isPlaying(e))}hasPlaybackTime(e){return oe("id",e,K()),E(ge(this,he,"f").hasPlaybackTime(e))}setPlaybackTime(e,t){return oe("id",e,K()),oe("time",t,Q()),E(ge(this,he,"f").setPlaybackTime(e,t))}getPlaybackTime(e){return oe("id",e,K()),E(ge(this,he,"f").getPlaybackTime(e))}setSoloPlaybackEnabled(e,t){return oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setSoloPlaybackEnabled(e,t))}isSoloPlaybackEnabled(e){return oe("id",e,K()),E(ge(this,he,"f").isSoloPlaybackEnabled(e))}hasPlaybackControl(e){return oe("id",e,K()),E(ge(this,he,"f").hasPlaybackControl(e))}setLooping(e,t){oe("id",e,K()),oe("looping",t,X()),E(ge(this,he,"f").setLooping(e,t))}isLooping(e){return oe("id",e,K()),E(ge(this,he,"f").isLooping(e))}setMuted(e,t){oe("id",e,K()),oe("muted",t,X()),E(ge(this,he,"f").setMuted(e,t))}isMuted(e){return oe("id",e,K()),E(ge(this,he,"f").isMuted(e))}setVolume(e,t){oe("id",e,K()),oe("volume",t,Q()),E(ge(this,he,"f").setVolume(e,t))}getVolume(e){return oe("id",e,K()),E(ge(this,he,"f").getVolume(e))}async forceLoadAVResource(e){return oe("id",e,K()),_((t=>ge(this,he,"f").forceLoadAVResource(e,t)))}getAVResourceTotalDuration(e){return oe("id",e,K()),E(ge(this,he,"f").getAVResourceTotalDuration(e))}getVideoWidth(e){return oe("id",e,K()),E(ge(this,he,"f").getVideoWidth(e))}getVideoHeight(e){return oe("id",e,K()),E(ge(this,he,"f").getVideoHeight(e))}generateVideoThumbnailSequence(e,t,r,n,o,i){return oe("id",e,K()),oe("thumbnailHeight",t,K()),oe("timeBegin",r,Q()),oe("timeEnd",n,Q()),oe("numberOfFrames",o,K()),ge(this,he,"f").generateVideoThumbnailSequence(e,t,r,n,o,(e=>{"error"in e?i(0,new Error(e.error)):i(e.frameIndex,new ImageData(new Uint8ClampedArray(e.imageData),e.width,e.height))})),()=>{E(ge(this,he,"f").cancelVideoThumbnailSequenceGeneration(e))}}async getVideoFillThumbnail(e,t){return oe("id",e,K()),oe("thumbnailHeight",t,K()),new Promise(((r,n)=>{ge(this,he,"f").getVideoFillThumbnail(e,t,(e=>{"error"in e?n(e.error):r(new le([e],{type:"image/jpeg"}))}))}))}async getVideoFillThumbnailAtlas(e,t,r,n){return oe("id",e,K()),oe("numberOfColumns",t,K()),oe("numberOfRows",r,K()),oe("thumbnailHeight",n,K()),new Promise(((o,i)=>{ge(this,he,"f").getVideoFillThumbnailAtlas(e,t,r,n,(e=>{"error"in e?i(e.error):o(new le([e],{type:"image/jpeg"}))}))}))}async getPageThumbnailAtlas(e,t,r,n){return oe("id",e,K()),oe("numberOfColumns",t,K()),oe("numberOfRows",r,K()),new Promise(((o,i)=>{ge(this,he,"f").getPageThumbnailAtlas(e,t,r,n,(e=>{"error"in e?i(e.error):o(new le([e],{type:"image/jpeg"}))}))}))}setNativePixelBuffer(e,t){t instanceof HTMLVideoElement&&(t.width=t.videoWidth,t.height=t.videoHeight),E(ge(this,he,"f").setNativePixelBuffer(e,t))}}he=new WeakMap,me([o],ye.prototype,"loadFromString",null),me([o],ye.prototype,"create",null),me([o],ye.prototype,"createFill",null),me([t],ye.prototype,"getType",null),me([o],ye.prototype,"select",null),me([o],ye.prototype,"setSelected",null),me([t],ye.prototype,"isSelected",null),me([t],ye.prototype,"findAllSelected",null),me([t],ye.prototype,"isGroupable",null),me([o],ye.prototype,"group",null),me([o],ye.prototype,"ungroup",null),me([o],ye.prototype,"enterGroup",null),me([o],ye.prototype,"exitGroup",null),me([o],ye.prototype,"setName",null),me([t],ye.prototype,"getName",null),me([t],ye.prototype,"getUUID",null),me([t],ye.prototype,"findByName",null),me([t],ye.prototype,"findByType",null),me([t],ye.prototype,"findAll",null),me([t],ye.prototype,"findAllPlaceholders",null),me([o],ye.prototype,"createShape",null),me([t],ye.prototype,"hasShape",null),me([t],ye.prototype,"getShape",null),me([o],ye.prototype,"setShape",null),me([t],ye.prototype,"isVisible",null),me([o],ye.prototype,"setVisible",null),me([t],ye.prototype,"isClipped",null),me([o],ye.prototype,"setClipped",null),me([t],ye.prototype,"isTransformLocked",null),me([o],ye.prototype,"setTransformLocked",null),me([t],ye.prototype,"getPositionX",null),me([t],ye.prototype,"getPositionXMode",null),me([t],ye.prototype,"getPositionY",null),me([t],ye.prototype,"getPositionYMode",null),me([o],ye.prototype,"setPositionX",null),me([o],ye.prototype,"setPositionXMode",null),me([o],ye.prototype,"setPositionY",null),me([o],ye.prototype,"setPositionYMode",null),me([o],ye.prototype,"setAlwaysOnTop",null),me([o],ye.prototype,"setAlwaysOnBottom",null),me([t],ye.prototype,"isAlwaysOnTop",null),me([t],ye.prototype,"isAlwaysOnBottom",null),me([o],ye.prototype,"bringToFront",null),me([o],ye.prototype,"sendToBack",null),me([o],ye.prototype,"bringForward",null),me([o],ye.prototype,"sendBackward",null),me([t],ye.prototype,"getRotation",null),me([o],ye.prototype,"setRotation",null),me([t],ye.prototype,"getFlipHorizontal",null),me([t],ye.prototype,"getFlipVertical",null),me([o],ye.prototype,"setFlipHorizontal",null),me([o],ye.prototype,"setFlipVertical",null),me([t],ye.prototype,"hasContentFillMode",null),me([t],ye.prototype,"getWidth",null),me([t],ye.prototype,"getWidthMode",null),me([t],ye.prototype,"getHeight",null),me([t],ye.prototype,"getHeightMode",null),me([o],ye.prototype,"setWidth",null),me([o],ye.prototype,"setWidthMode",null),me([o],ye.prototype,"setHeight",null),me([o],ye.prototype,"setHeightMode",null),me([t],ye.prototype,"getFrameX",null),me([t],ye.prototype,"getFrameY",null),me([t],ye.prototype,"getFrameWidth",null),me([t],ye.prototype,"getFrameHeight",null),me([o],ye.prototype,"setContentFillMode",null),me([t],ye.prototype,"getContentFillMode",null),me([o],ye.prototype,"duplicate",null),me([o],ye.prototype,"destroy",null),me([t],ye.prototype,"isValid",null),me([t],ye.prototype,"getParent",null),me([t],ye.prototype,"getChildren",null),me([o],ye.prototype,"insertChild",null),me([o],ye.prototype,"appendChild",null),me([t],ye.prototype,"referencesAnyVariables",null),me([t],ye.prototype,"getGlobalBoundingBoxX",null),me([t],ye.prototype,"getGlobalBoundingBoxY",null),me([t],ye.prototype,"getGlobalBoundingBoxWidth",null),me([t],ye.prototype,"getGlobalBoundingBoxHeight",null),me([t],ye.prototype,"getScreenSpaceBoundingBoxXYWH",null),me([o],ye.prototype,"alignHorizontally",null),me([o],ye.prototype,"alignVertically",null),me([t],ye.prototype,"isAlignable",null),me([o],ye.prototype,"distributeHorizontally",null),me([o],ye.prototype,"distributeVertically",null),me([o],ye.prototype,"isDistributable",null),me([o],ye.prototype,"fillParent",null),me([o],ye.prototype,"resizeContentAware",null),me([o],ye.prototype,"scale",null),me([t],ye.prototype,"findAllProperties",null),me([t],ye.prototype,"isPropertyReadable",null),me([t],ye.prototype,"isPropertyWritable",null),me([t],ye.prototype,"getPropertyType",null),me([t],ye.prototype,"getEnumValues",null),me([o],ye.prototype,"setBool",null),me([t],ye.prototype,"getBool",null),me([o],ye.prototype,"setInt",null),me([t],ye.prototype,"getInt",null),me([o],ye.prototype,"setFloat",null),me([t],ye.prototype,"getFloat",null),me([o],ye.prototype,"setDouble",null),me([t],ye.prototype,"getDouble",null),me([o],ye.prototype,"setString",null),me([t],ye.prototype,"getString",null),me([o],ye.prototype,"setColor",null),me([t],ye.prototype,"getColor",null),me([o],ye.prototype,"setColorRGBA",null),me([t],ye.prototype,"getColorRGBA",null),me([o],ye.prototype,"setColorSpot",null),me([t],ye.prototype,"getColorSpotName",null),me([t],ye.prototype,"getColorSpotTint",null),me([o],ye.prototype,"setGradientColorStops",null),me([t],ye.prototype,"getGradientColorStops",null),me([o],ye.prototype,"setEnum",null),me([t],ye.prototype,"getEnum",null),me([t],ye.prototype,"hasCrop",null),me([o],ye.prototype,"setCropScaleX",null),me([o],ye.prototype,"setCropScaleY",null),me([o],ye.prototype,"setCropRotation",null),me([o],ye.prototype,"setCropScaleRatio",null),me([o],ye.prototype,"setCropTranslationX",null),me([o],ye.prototype,"setCropTranslationY",null),me([o],ye.prototype,"resetCrop",null),me([t],ye.prototype,"getCropScaleX",null),me([t],ye.prototype,"getCropScaleY",null),me([t],ye.prototype,"getCropRotation",null),me([t],ye.prototype,"getCropScaleRatio",null),me([t],ye.prototype,"getCropTranslationX",null),me([t],ye.prototype,"getCropTranslationY",null),me([o],ye.prototype,"adjustCropToFillFrame",null),me([o],ye.prototype,"flipCropHorizontal",null),me([o],ye.prototype,"flipCropVertical",null),me([t],ye.prototype,"hasOpacity",null),me([o],ye.prototype,"setOpacity",null),me([t],ye.prototype,"getOpacity",null),me([t],ye.prototype,"hasBlendMode",null),me([o],ye.prototype,"setBlendMode",null),me([t],ye.prototype,"getBlendMode",null),me([t],ye.prototype,"hasFillColor",null),me([t],ye.prototype,"isIncludedInExport",null),me([o],ye.prototype,"setIncludedInExport",null),me([o],ye.prototype,"setFillColorRGBA",null),me([t],ye.prototype,"getFillColorRGBA",null),me([o],ye.prototype,"setFillColorEnabled",null),me([t],ye.prototype,"isFillColorEnabled",null),me([o],ye.prototype,"createEffect",null),me([t],ye.prototype,"hasEffects",null),me([t],ye.prototype,"getEffects",null),me([o],ye.prototype,"insertEffect",null),me([o],ye.prototype,"appendEffect",null),me([o],ye.prototype,"removeEffect",null),me([t],ye.prototype,"hasEffectEnabled",null),me([o],ye.prototype,"setEffectEnabled",null),me([t],ye.prototype,"isEffectEnabled",null),me([o],ye.prototype,"createBlur",null),me([t],ye.prototype,"hasBlur",null),me([o],ye.prototype,"setBlur",null),me([t],ye.prototype,"getBlur",null),me([o],ye.prototype,"setBlurEnabled",null),me([t],ye.prototype,"isBlurEnabled",null),me([t],ye.prototype,"hasBackgroundColor",null),me([o],ye.prototype,"setBackgroundColorRGBA",null),me([t],ye.prototype,"getBackgroundColorRGBA",null),me([o],ye.prototype,"setBackgroundColorEnabled",null),me([t],ye.prototype,"isBackgroundColorEnabled",null),me([t],ye.prototype,"hasStroke",null),me([o],ye.prototype,"setStrokeEnabled",null),me([t],ye.prototype,"isStrokeEnabled",null),me([o],ye.prototype,"setStrokeColorRGBA",null),me([o],ye.prototype,"setStrokeColor",null),me([t],ye.prototype,"getStrokeColorRGBA",null),me([t],ye.prototype,"getStrokeColor",null),me([o],ye.prototype,"setStrokeWidth",null),me([t],ye.prototype,"getStrokeWidth",null),me([o],ye.prototype,"setStrokeStyle",null),me([t],ye.prototype,"getStrokeStyle",null),me([o],ye.prototype,"setStrokePosition",null),me([t],ye.prototype,"getStrokePosition",null),me([o],ye.prototype,"setStrokeCornerGeometry",null),me([t],ye.prototype,"getStrokeCornerGeometry",null),me([t],ye.prototype,"hasDropShadow",null),me([o],ye.prototype,"setDropShadowEnabled",null),me([t],ye.prototype,"isDropShadowEnabled",null),me([o],ye.prototype,"setDropShadowColorRGBA",null),me([o],ye.prototype,"setDropShadowColor",null),me([t],ye.prototype,"getDropShadowColorRGBA",null),me([t],ye.prototype,"getDropShadowColor",null),me([o],ye.prototype,"setDropShadowOffsetX",null),me([t],ye.prototype,"getDropShadowOffsetX",null),me([o],ye.prototype,"setDropShadowOffsetY",null),me([t],ye.prototype,"getDropShadowOffsetY",null),me([o],ye.prototype,"setDropShadowBlurRadiusX",null),me([t],ye.prototype,"getDropShadowBlurRadiusX",null),me([o],ye.prototype,"setDropShadowBlurRadiusY",null),me([t],ye.prototype,"getDropShadowBlurRadiusY",null),me([o],ye.prototype,"setDropShadowClip",null),me([t],ye.prototype,"getDropShadowClip",null),me([o],ye.prototype,"createCutoutFromBlocks",null),me([o],ye.prototype,"createCutoutFromPath",null),me([o],ye.prototype,"createCutoutFromOperation",null),me([o],ye.prototype,"replaceText",null),me([o],ye.prototype,"removeText",null),me([o],ye.prototype,"setTextColor",null),me([t],ye.prototype,"getTextColors",null),me([t],ye.prototype,"getTextFontWeights",null),me([t],ye.prototype,"getTextFontStyles",null),me([t],ye.prototype,"getTextCases",null),me([o],ye.prototype,"setTextCase",null),me([t],ye.prototype,"getTextCursorRange",null),me([t],ye.prototype,"hasFill",null),me([t],ye.prototype,"isFillEnabled",null),me([o],ye.prototype,"setFillEnabled",null),me([t],ye.prototype,"getFill",null),me([o],ye.prototype,"setFill",null),me([o],ye.prototype,"setFillSolidColor",null),me([t],ye.prototype,"getFillSolidColor",null),me([o],ye.prototype,"setPlaceholderEnabled",null),me([t],ye.prototype,"isPlaceholderEnabled",null),me([t],ye.prototype,"hasPlaceholderBehavior",null),me([o],ye.prototype,"setPlaceholderBehaviorEnabled",null),me([t],ye.prototype,"isPlaceholderBehaviorEnabled",null),me([t],ye.prototype,"hasPlaceholderControls",null),me([o],ye.prototype,"setPlaceholderControlsOverlayEnabled",null),me([t],ye.prototype,"isPlaceholderControlsOverlayEnabled",null),me([o],ye.prototype,"setPlaceholderControlsButtonEnabled",null),me([t],ye.prototype,"isPlaceholderControlsButtonEnabled",null),me([o],ye.prototype,"setMetadata",null),me([t],ye.prototype,"getMetadata",null),me([t],ye.prototype,"hasMetadata",null),me([t],ye.prototype,"findAllMetadata",null),me([o],ye.prototype,"removeMetadata",null),me([o],ye.prototype,"setScopeEnabled",null),me([t],ye.prototype,"isScopeEnabled",null),me([t],ye.prototype,"isAllowedByScope",null),me([t],ye.prototype,"hasDuration",null),me([o],ye.prototype,"setDuration",null),me([t],ye.prototype,"getDuration",null),me([t],ye.prototype,"hasTimeOffset",null),me([o],ye.prototype,"setTimeOffset",null),me([t],ye.prototype,"getTimeOffset",null),me([t],ye.prototype,"hasTrim",null),me([o],ye.prototype,"setTrimOffset",null),me([t],ye.prototype,"getTrimOffset",null),me([o],ye.prototype,"setTrimLength",null),me([t],ye.prototype,"getTrimLength",null),me([t],ye.prototype,"getTotalSceneDuration",null),me([o],ye.prototype,"setPlaying",null),me([t],ye.prototype,"isPlaying",null),me([t],ye.prototype,"hasPlaybackTime",null),me([o],ye.prototype,"setPlaybackTime",null),me([t],ye.prototype,"getPlaybackTime",null),me([o],ye.prototype,"setSoloPlaybackEnabled",null),me([t],ye.prototype,"isSoloPlaybackEnabled",null),me([t],ye.prototype,"hasPlaybackControl",null),me([o],ye.prototype,"setLooping",null),me([t],ye.prototype,"isLooping",null),me([o],ye.prototype,"setMuted",null),me([t],ye.prototype,"isMuted",null),me([o],ye.prototype,"setVolume",null),me([t],ye.prototype,"getVolume",null),me([o],ye.prototype,"forceLoadAVResource",null),me([t],ye.prototype,"getAVResourceTotalDuration",null),me([t],ye.prototype,"getVideoWidth",null),me([t],ye.prototype,"getVideoHeight",null),me([t],ye.prototype,"getVideoFillThumbnail",null),me([t],ye.prototype,"getVideoFillThumbnailAtlas",null),me([t],ye.prototype,"getPageThumbnailAtlas",null);var ve,be=function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},we=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class Ee{constructor(e){ve.set(this,void 0),Object.defineProperty(this,"onStateChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=we(this,ve,"f").subscribeToEditorState(e);return()=>{we(this,ve,"f").isDeleted()||E(we(this,ve,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onHistoryUpdated",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=we(this,ve,"f").subscribeToHistory(e);return()=>{we(this,ve,"f").isDeleted()||we(this,ve,"f").unsubscribe(t)}}}),Object.defineProperty(this,"onSettingsChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=we(this,ve,"f").subscribeToSettings(e);return()=>{we(this,ve,"f").isDeleted()||E(we(this,ve,"f").unsubscribe(t))}}}),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,ve,e,"f")}unlockWithLicense(e){E(we(this,ve,"f").unlockWithLicense(e))}getActiveLicense(){return E(we(this,ve,"f").getActiveLicense())}setEditMode(e){oe("keypath",e,J()),we(this,ve,"f").setEditMode(e)}getEditMode(){return we(this,ve,"f").getEditMode()}getCursorType(){return we(this,ve,"f").getCursorType()}getCursorRotation(){return we(this,ve,"f").getCursorRotation()}getTextCursorPositionInScreenSpaceX(){return we(this,ve,"f").getTextCursorPositionInScreenSpaceX()}getTextCursorPositionInScreenSpaceY(){return we(this,ve,"f").getTextCursorPositionInScreenSpaceY()}createHistory(){return we(this,ve,"f").createHistory()}destroyHistory(e){E(we(this,ve,"f").destroyHistory(e))}setActiveHistory(e){E(we(this,ve,"f").setActiveHistory(e))}getActiveHistory(){return we(this,ve,"f").getActiveHistory()}addUndoStep(){E(we(this,ve,"f").addUndoStep())}undo(){E(we(this,ve,"f").undo())}redo(){E(we(this,ve,"f").redo())}canUndo(){return E(we(this,ve,"f").canUndo())}canRedo(){return E(we(this,ve,"f").canRedo())}setSettingBool(e,t){return oe("keypath",e,J()),oe("value",t,X()),E(we(this,ve,"f").setSettingBool(e,t))}getSettingBool(e){return oe("keypath",e,J()),E(we(this,ve,"f").getSettingBool(e))}setSettingInt(e,t){return oe("keypath",e,J()),oe("value",t,K()),E(we(this,ve,"f").setSettingInt(e,t))}getSettingInt(e){return oe("keypath",e,J()),E(we(this,ve,"f").getSettingInt(e))}setSettingFloat(e,t){return oe("keypath",e,J()),oe("value",t,Q()),E(we(this,ve,"f").setSettingFloat(e,t))}getSettingFloat(e){return oe("keypath",e,J()),E(we(this,ve,"f").getSettingFloat(e))}setSettingString(e,t){return oe("keypath",e,J()),oe("value",t,J()),E(we(this,ve,"f").setSettingString(e,t))}getSettingString(e){return oe("keypath",e,J()),E(we(this,ve,"f").getSettingString(e))}setSettingColor(e,t){return oe("keypath",e,J()),E(we(this,ve,"f").setSettingColor(e,i.fromColor(t)))}getSettingColor(e){return oe("keypath",e,J()),i.toColor(E(we(this,ve,"f").getSettingColor(e)))}setSettingColorRGBA(e,t,r,n,o=1){return oe("keypath",e,J()),oe("r",t,Q()),oe("g",r,Q()),oe("b",n,Q()),oe("a",o,Q()),E(we(this,ve,"f").setSettingColorRGBA(e,t,r,n,o))}getSettingColorRGBA(e){return oe("keypath",e,J()),E(we(this,ve,"f").getSettingColorRGBA(e))}setSettingEnum(e,t){return oe("keypath",e,J()),oe("value",t,J()),E(we(this,ve,"f").setSettingEnum(e,t))}getSettingEnum(e){return oe("keypath",e,J()),E(we(this,ve,"f").getSettingEnum(e))}getSettingEnumOptions(e){return oe("keypath",e,J()),C(E(we(this,ve,"f").getSettingEnumOptions(e)))}findAllSettings(){return C(we(this,ve,"f").findAllSettings())}getSettingType(e){return oe("keypath",e,J()),E(we(this,ve,"f").getSettingType(e))}getAvailableMemory(){return E(we(this,ve,"f").getAvailableMemory())}getUsedMemory(){return E(we(this,ve,"f").getUsedMemory())}setURIResolver(e){return E(we(this,ve,"f").setURIResolver(e))}defaultURIResolver(e){return we(this,ve,"f").defaultURIResolver(e)}getAbsoluteURI(e){return E(we(this,ve,"f").getAbsoluteURI(e))}setGlobalScope(e,t){oe("key",e,J()),oe("value",t,J()),E(we(this,ve,"f").setGlobalScope(e,t))}getGlobalScope(e){return oe("key",e,J()),E(we(this,ve,"f").getGlobalScope(e))}findAllSpotColors(){return C(we(this,ve,"f").findAllSpotColors())}getSpotColorRGBA(e){return oe("name",e,J()),we(this,ve,"f").getSpotColorRGB(e)}getSpotColorCMYK(e){return oe("name",e,J()),we(this,ve,"f").getSpotColorCMYK(e)}setSpotColorRGB(e,t,r,n){return oe("name",e,J()),oe("r",t,Q()),oe("g",r,Q()),oe("b",n,Q()),we(this,ve,"f").setSpotColorRGB(e,t,r,n)}setSpotColorCMYK(e,t,r,n,o){return oe("name",e,J()),oe("c",t,Q()),oe("m",r,Q()),oe("y",n,Q()),oe("k",o,Q()),we(this,ve,"f").setSpotColorCMYK(e,t,r,n,o)}removeSpotColor(e){return oe("name",e,J()),E(we(this,ve,"f").removeSpotColor(e))}setSpotColorForCutoutType(e,t){return oe("type",e,J()),oe("color",t,J()),E(we(this,ve,"f").setSpotColorForCutoutType(e,t))}getSpotColorForCutoutType(e){return oe("type",e,J()),E(we(this,ve,"f").getSpotColorForCutoutType(e))}convertColorToColorSpace(e,t){return oe("colorSpace",t,J()),i.toColor(E(we(this,ve,"f").convertColorToColorSpace(i.fromColor(e),t)))}}ve=new WeakMap,be([o],Ee.prototype,"setEditMode",null),be([t],Ee.prototype,"getEditMode",null),be([t],Ee.prototype,"getCursorType",null),be([t],Ee.prototype,"getCursorRotation",null),be([t],Ee.prototype,"getTextCursorPositionInScreenSpaceX",null),be([t],Ee.prototype,"getTextCursorPositionInScreenSpaceY",null),be([o],Ee.prototype,"createHistory",null),be([o],Ee.prototype,"destroyHistory",null),be([o],Ee.prototype,"setActiveHistory",null),be([t],Ee.prototype,"getActiveHistory",null),be([o],Ee.prototype,"addUndoStep",null),be([o],Ee.prototype,"undo",null),be([o],Ee.prototype,"redo",null),be([t],Ee.prototype,"canUndo",null),be([t],Ee.prototype,"canRedo",null),be([o],Ee.prototype,"setSettingBool",null),be([t],Ee.prototype,"getSettingBool",null),be([o],Ee.prototype,"setSettingInt",null),be([t],Ee.prototype,"getSettingInt",null),be([o],Ee.prototype,"setSettingFloat",null),be([t],Ee.prototype,"getSettingFloat",null),be([o],Ee.prototype,"setSettingString",null),be([t],Ee.prototype,"getSettingString",null),be([o],Ee.prototype,"setSettingColor",null),be([t],Ee.prototype,"getSettingColor",null),be([o],Ee.prototype,"setSettingColorRGBA",null),be([t],Ee.prototype,"getSettingColorRGBA",null),be([o],Ee.prototype,"setSettingEnum",null),be([t],Ee.prototype,"getSettingEnum",null),be([t],Ee.prototype,"getAvailableMemory",null),be([t],Ee.prototype,"getUsedMemory",null),be([o],Ee.prototype,"setURIResolver",null),be([t],Ee.prototype,"defaultURIResolver",null),be([t],Ee.prototype,"getAbsoluteURI",null),be([o],Ee.prototype,"setGlobalScope",null),be([t],Ee.prototype,"getGlobalScope",null),be([t],Ee.prototype,"findAllSpotColors",null),be([t],Ee.prototype,"getSpotColorRGBA",null),be([t],Ee.prototype,"getSpotColorCMYK",null),be([o],Ee.prototype,"setSpotColorRGB",null),be([o],Ee.prototype,"setSpotColorCMYK",null),be([o],Ee.prototype,"removeSpotColor",null),be([o],Ee.prototype,"setSpotColorForCutoutType",null),be([o],Ee.prototype,"getSpotColorForCutoutType",null);var _e,Ce=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class Se{constructor(e){_e.set(this,void 0),Object.defineProperty(this,"subscribe",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>{oe("blocks",e,Y());const r=Ce(this,_e,"f").subscribe(e,(e=>{try{t(C(e,!0))}catch(e){console.error(e)}}));return()=>{Ce(this,_e,"f").isDeleted()||E(Ce(this,_e,"f").unsubscribe(r))}}}),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,_e,e,"f")}}_e=new WeakMap;var ke,xe=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class Pe{constructor(e){ke.set(this,void 0),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,ke,e,"f")}findAll(){return C(xe(this,ke,"f").findAllVariables())}setString(e,t){return oe("key",e,J()),oe("value",t,J()),E(xe(this,ke,"f").setVariableString(e,t))}getString(e){return oe("key",e,J()),E(xe(this,ke,"f").getVariableString(e))}remove(e){return oe("key",e,J()),E(xe(this,ke,"f").removeVariable(e))}}ke=new WeakMap;const Te=require("fs/promises");var Ae=r.n(Te),Fe=r(310);const De=function(){if("undefined"!=typeof fetch)return fetch;if("undefined"!=typeof window)throw new Error("Could not find `fetch` API");try{return r(809)}catch(e){throw new Error("Could not find a `fetch` implementation. Please make sure you're using Node.JS >= 18, or install the node-fetch@cjs package, or provide another polyfill.")}}();async function Be(e){if(!e.match(/^file:/))return De(e);try{const t=await Ae().readFile((0,Fe.fileURLToPath)(e),{encoding:"utf8"}),r=JSON.parse(t);return{ok:!0,json:async()=>r}}catch(e){return{ok:!1,statusText:e.message}}}const Le=De;var Re=r(502),Me=r.n(Re);const Oe=r.p+"assets/core/cesdk-v1.19.0-rc.0-d92fadafda0b5129818d.data",Ie=r.p+"assets/core/cesdk-v1.19.0-rc.0-481c33794ece8bac477f.wasm",Ue=Me();function je(e,t){const r=t.split("/").pop(),n=new URL(r,e.core.baseURL);return"file:"===n.protocol?(0,Fe.fileURLToPath)(n):new URL(r,e.core.baseURL).toString()}var $e,Ne,He,qe,Ve,We,Ge,ze=function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},Ye=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class Xe{constructor(e,t){$e.add(this),Object.defineProperty(this,"asset",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"block",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"editor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scene",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"variable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Ne.set(this,void 0),He.set(this,void 0),qe.set(this,void 0),ze(this,He,e,"f"),ze(this,Ne,new w(e),"f"),this.asset=new B(e),this.block=new ye(e),this.editor=new Ee(e),this.event=new Se(e),this.scene=new pe(e),this.variable=new Pe(e),this.block.exportVideo=()=>{throw new Error("Exporting video is currently not supported on Node.JS")},Ye(this,$e,"m",Ve).call(this),"undefined"!=typeof window&&window.Cypress&&(this.config=t,this.helper=Ye(this,Ne,"f"))}update(){Ye(this,He,"f").update()}dispose(){Ye(this,$e,"m",Ge).call(this),ze(this,Ne,null,"f"),this.block=null,this.scene=null,this.variable=null,Ye(this,He,"f").delete(),ze(this,He,null,"f")}static async init(e){console.log("[CreativeEngine] Revision 57abbc94d7a784f626833b0a8c4b3ca78b717111");const t=function(e){var t;return e&&"callbacks"in e&&(null===(t=e.callbacks)||void 0===t?void 0:t.log)&&!e.logger?Object.assign(Object.assign({},e),{logger:e.callbacks.log}):e}(e),r=function(e={},t="https://cdn.img.ly/packages/imgly/cesdk-engine/1.19.0-rc.0/assets"){var r,n,o,i,a,s,u,l,c,d,f;const p=Object.assign(Object.assign({},e),{license:null!==(r=e.license)&&void 0!==r?r:"",featureFlags:null!==(n=e.featureFlags)&&void 0!==n?n:{},baseURL:null!==(o=e.baseURL)&&void 0!==o?o:t,core:null!==(i=e.core)&&void 0!==i?i:{baseURL:"core/"},extensions:null!==(a=e.extensions)&&void 0!==a?a:Object.assign({},M),logger:null!==(s=e.logger)&&void 0!==s?s:R,presets:null!==(u=e.presets)&&void 0!==u?u:{}});return null!==(l=(d=p.extensions).baseURL)&&void 0!==l||(d.baseURL=M.baseURL),null!==(c=(f=p.extensions).entries)&&void 0!==c||(f.entries=Object.assign({},M.entries)),p.baseURL=O(p.baseURL),p.baseURL=I(p.baseURL),p.core.baseURL=O(p.core.baseURL,p.baseURL),p.core.baseURL=I(p.core.baseURL),p.extensions.baseURL=I(p.extensions.baseURL),p.extensions.entries=p.extensions.entries.map((e=>I(e))),p}(t,`file://${__dirname}/assets/`);for(const t of function(e){var t;const r=[];return e?("callbacks"in e&&(null===(t=e.callbacks)||void 0===t?void 0:t.log)&&r.push("config.callbacks.log has been moved to config.logger"),e.scene&&r.push("config.scene options have been removed. You can set a scene's dpi and pixelScaleFactor via the BlockApi's setInt(sceneId, 'scene/dpi', dpi) and setInt(sceneId, 'scene/pixelScaleFactor', factor)."),e.page&&r.push("config.page options have been moved to the EditorAPI"),e.variables&&r.push("config.variables has been removed. Please use the VariableAPI instead"),r):r}(e))r.logger(t,"Warning");const n=new this(await async function(e){const t=e.logger,r=function(e,t=window.fetch){if(!e.license)throw new Error("Missing license key in config");return e.license.length<128?t("https://api.img.ly/activate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:e.license,userId:e.userId})}).then((e=>{if(e.ok)return e.json();throw new Error("Unfortunately we are experiencing a server down time and your License key cannot be validated. We're already working on a fix and will restore service soon. Should services not restore within the hour, kindly get in touch with our support team.")})).then((e=>{if("valid"===e.status)return e.license;throw"expired"===e.status?new Error("Thanks for using IMG.LY for creative editing. Please note that your license file or commercial use is expired. Please get in touch with our sales team to discuss extension of your commercial license."):new Error("The License Key (API Key) you are using to access the IMG.LY SDK is invalid. Please ensure that you are using the license key tied to your subscription and get in touch with our support team.")})):Promise.resolve(e.license)}(e,Le),{getPreloadedPackage:n,instantiateWasm:o}=await async function(e){if(!e.core.baseURL.startsWith("http"))return{};const t=je(e,Oe),r=je(e,Ie),n=Le(t).then((e=>{if(e.status>=400)throw new Error(`Failed to fetch DATA package: ${e.status} ${e.statusText}`);return e.arrayBuffer()})),o=await n;return{getPreloadedPackage:function(e,r){if(e===t){if(r!==o.byteLength)throw new Error(`Attempt to get preloaded data package of incorrect size. Expected: ${r} Actual: ${o.byteLength}`);return o}return null},instantiateWasm:function(e,t){const n=e,o=Le(r).then((e=>{if(e.status>=400)throw new Error(`Failed to fetch WASM package: ${e.status} ${e.statusText}`);return e}));return void 0!==WebAssembly.instantiateStreaming?o.then((e=>WebAssembly.instantiateStreaming(e,n))).then((({instance:e})=>t(e))):o.then((e=>e.arrayBuffer())).then((e=>WebAssembly.compile(e))).then((e=>WebAssembly.instantiate(e,n))).then(t),{}}}}(e),i={locateFile:t=>t.endsWith(".wasm")?je(e,Ie):t.endsWith(".data")?je(e,Oe):je(e,t),instantiateWasm:o,getPreloadedPackage:n,print:e=>{e&&t(e,"Info")},printErr:e=>{e&&t(e,"Error")},onRuntimeInitialized:()=>{t("Engine has been initialized.","Info")},logReadFiles:!1,printWithColors:!0},a=await Ue(i);a.emscripten_ubq_asyncFetchManager.setFetch(Le);const s=E(a.createEngine("","auto"));return function(e,t){if(!t)throw new Error("Missing license key");E(e.unlockWithLicense(t))}(s,await r),function(e,t){var r,n;const o=new w(e),i=new Ee(e),a=new B(e);i.setSettingEnum("role",null!==(r=t.role)&&void 0!==r?r:"Creator"),"Adopter"===t.role&&i.setSettingEnum("doubleClickSelectionMode","Direct"),i.setSettingString("basePath",t.baseURL),i.setSettingBool("showBuildVersion",!1),(null===(n=t.featureFlags)||void 0===n?void 0:n.preventScrolling)&&(i.setSettingBool("touch/singlePointPanning",!1),i.setSettingBool("touch/dragStartCanSelect",!1)),a.addLocalSource("ly.img.text"),Object.entries(t.presets.typefaces||{}).forEach((([e,t])=>{(t.fonts||[]).forEach((r=>{const n=`${e}_${r.weight}_${r.style}`;o.execute("ubq/assets/registerFont",[n,r.fontURL,t.family,r.weight,r.style])}))})),function(){var e;const r=!!(null===(e=t.featureFlags)||void 0===e?void 0:e.singlePageMode);i.setSettingBool("features/singlePageModeEnabled",r),i.setSettingBool("features/effectsEnabled",!0)}(),function(){var e;const r=null!==(e=t.extensions)&&void 0!==e?e:[];r.entries.forEach((e=>{o.execute("ubq/extension/register",`${r.baseURL+e}`)}))}(),function(){const t=new Pe(e);"undefined"!=typeof window&&window.Cypress&&(t.setString("company_name","img.ly"),t.setString("first_name","Charly"),t.setString("last_name","Williams"),t.setString("address","742 Evergreen Terrace"),t.setString("city","Springfield"))}()}(s,e),s}(r),r);return function(e,t){var r,n,o,i,a,s,u,l;if(e)try{const c=t.editor;if(null!=(null===(n=null===(r=e.page)||void 0===r?void 0:r.title)||void 0===n?void 0:n.show)&&c.setSettingBool("page/title/show",e.page.title.show),null!=(null===(i=null===(o=e.page)||void 0===o?void 0:o.title)||void 0===i?void 0:i.fontFileUri)&&c.setSettingString("page/title/fontFileUri",null===(s=null===(a=e.page)||void 0===a?void 0:a.title)||void 0===s?void 0:s.fontFileUri),null!=(null===(u=e.page)||void 0===u?void 0:u.dimOutOfPageAreas)&&c.setSettingBool("page/dimOutOfPageAreas",null===(l=e.page)||void 0===l?void 0:l.dimOutOfPageAreas),e.variables)for(const r in e.variables)if(Object.prototype.hasOwnProperty.call(e.variables,r)){const n=e.variables[r];t.variable.setString(r,String(n.value))}}catch(e){console.error(e)}}(e,n),n}async addDefaultAssetSources({baseURL:e="https://cdn.img.ly/assets/v2",excludeAssetSourceIds:t=[]}={}){return async function(e,t,r,n){const o=["ly.img.sticker","ly.img.vectorpath","ly.img.colors.defaultPalette","ly.img.filter.lut","ly.img.filter.duotone","ly.img.effect","ly.img.blur"].filter((e=>!r.includes(e)));await U(o,t,n,e)}(this.asset,e,t,Be)}async addDemoAssetSources({excludeAssetSourceIds:e=[],sceneMode:t="Design",withUploadAssetSources:r=!1}={}){return async function(e,t,r,n,o,i,a="https://cdn.img.ly/assets/demo/v2"){const s=new Set(e.findAllSources()),u="ly.img.image.upload";!o||r.includes(u)||s.has(u)||e.addLocalSource(u,["image/jpeg","image/png","image/webp","image/svg+xml","image/gif","image/bmp"]);const l="ly.img.video.upload";"Video"!==n||!o||r.includes(l)||s.has(l)||e.addLocalSource(l,["video/mp4","video/quicktime"]);const c="ly.img.audio.upload";"Video"!==n||!o||r.includes(c)||s.has(c)||e.addLocalSource(c,["audio/mpeg","audio/x-m4a","audio/m4a","audio/mp3"]);const d=["ly.img.image","ly.img.video","ly.img.audio"].filter((e=>!r.includes(e)));s.has("ly.img.template")||r.includes("ly.img.template")||(e.addLocalSource("ly.img.template",void 0,(async e=>{var r;const n=null===(r=e.meta)||void 0===r?void 0:r.uri;if(n)if(n.startsWith("UBQ1"))t.applyTemplateFromString(n);else{const e=new URL(n,window.location.href);t.applyTemplateFromURL(e.href)}})),d.push("ly.img.template")),await U(d,a,i,e)}(this.asset,this.scene,e,t,r,Be)}}Ne=new WeakMap,He=new WeakMap,qe=new WeakMap,$e=new WeakSet,Ve=function(){Ye(this,$e,"m",We).call(this)},We=function(){if(Ye(this,qe,"f"))return;const e=()=>{this.update(),ze(this,qe,setTimeout(e,16),"f")};ze(this,qe,setTimeout(e,16),"f")},Ge=function(){Ye(this,qe,"f")&&(clearTimeout(Ye(this,qe,"f")),ze(this,qe,null,"f"))};const Ke=Xe,Qe=Xe;Object.defineProperty(Qe,"__esModule",{value:!0}),Object.defineProperty(Qe,"default",{value:Xe}),Object.defineProperty(Qe,"LogLevel",{value:{Info:"Info",Warning:"Warning",Error:"Error"}}),Object.defineProperty(Qe,"MimeType",{value:ue})})(),n.default})()));
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(global,(()=>(()=>{var e={502:(e,t,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||__filename,function(e={}){var t,o,i,a,s=e;if(void 0===globalThis.BigInt64Array){function u(e){return[0|Number(BigInt(e)&BigInt(4294967295)),0|Number(BigInt(e)>>32n)]}function l(e){return function t(r){var n;"number"==typeof r&&(r=new Uint32Array(2*r)),ArrayBuffer.isView(r)||(r.constructor&&"ArrayBuffer"===r.constructor.name?r=new Uint32Array(r):(n=r,r=new Uint32Array(2*r.length)));var o=new Proxy({slice:(e,n)=>(void 0===n&&(n=r.length),t(r.slice(2*e,2*n))),subarray:(e,n)=>t(r.subarray(2*e,2*n)),[Symbol.iterator]:function*(){for(var t=0;t<r.length/2;t++)yield e(r[2*t],r[2*t+1])},BYTES_PER_ELEMENT:2*r.BYTES_PER_ELEMENT,buffer:r.buffer,byteLength:r.byteLength,byteOffset:r.byteOffset,length:r.length/2,copyWithin:function(e,t,n){return r.copyWithin(2*e,2*t,2*n),o},set(e,t){if(void 0===t&&(t=0),2*(e.length+t)>r.length)throw new RangeError("offset is out of bounds");for(var n=0;n<e.length;n++){var o=u(e[n]);r.set(o,2*(t+n))}}},{get(t,n,o){if("string"!=typeof n||!/^\d+$/.test(n))return Reflect.get(t,n,o);var i=r[2*n],a=r[2*n+1];return e(i,a)},set(e,t,n,o){if("string"!=typeof t||!/^\d+$/.test(t))return Reflect.set(e,t,n,o);if("bigint"!=typeof n)throw new TypeError(`Cannot convert ${n} to a BigInt`);var i=u(n);return r.set(i,2*t),!0}});return n&&o.set(n),o}}globalThis.BigUint64Array=l((function(e,t){return BigInt(e)|BigInt(t)<<32n})),globalThis.BigInt64Array=l((function(e,t){return BigInt(e)|BigInt(t+2*(2147483648&t))<<32n}))}s.ready=new Promise(((e,r)=>{t=e,o=r})),s.expectedDataFileDownloads||(s.expectedDataFileDownloads=0),s.expectedDataFileDownloads++,s.ENVIRONMENT_IS_PTHREAD||s.$ww||function(e){"object"==typeof window?window.encodeURIComponent(window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/"):"undefined"==typeof process&&"undefined"!=typeof location&&encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/");var t="cesdk.data";"function"!=typeof s.locateFilePackage||s.locateFile||(s.locateFile=s.locateFilePackage,k("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)"));var n=s.locateFile?s.locateFile(t,""):t,o=e.remote_package_size,i=null,a=s.getPreloadedPackage?s.getPreloadedPackage(n,o):null;function u(){function t(e,t){if(!e)throw t+(new Error).stack}function r(e,t,r){this.start=e,this.end=t,this.audio=r}s.FS_createPath("/","ly.img.cesdk",!0,!0),s.FS_createPath("/ly.img.cesdk","fonts",!0,!0),s.FS_createPath("/ly.img.cesdk","icons",!0,!0),s.FS_createPath("/ly.img.cesdk","icu",!0,!0),s.FS_createPath("/ly.img.cesdk","presets",!0,!0),s.FS_createPath("/ly.img.cesdk","shaders",!0,!0),s.FS_createPath("/ly.img.cesdk/shaders","common",!0,!0),r.prototype={requests:{},open:function(e,t){this.name=t,this.requests[t]=this,s.addRunDependency(`fp ${this.name}`)},send:function(){},onload:function(){var e=this.byteArray.subarray(this.start,this.end);this.finish(e)},finish:function(e){s.FS_createDataFile(this.name,null,e,!0,!0,!0),s.removeRunDependency(`fp ${this.name}`),this.requests[this.name]=null}};for(var n=e.files,o=0;o<n.length;++o)new r(n[o].start,n[o].end,n[o].audio||0).open("GET",n[o].filename);function u(n){t(n,"Loading data file failed."),t(n.constructor.name===ArrayBuffer.name,"bad input to processPackageData");var o=new Uint8Array(n);r.prototype.byteArray=o;for(var i=e.files,a=0;a<i.length;++a)r.prototype.requests[i[a].filename].onload();s.removeRunDependency("datafile_cesdk.data")}s.addRunDependency("datafile_cesdk.data"),s.preloadResults||(s.preloadResults={}),s.preloadResults["cesdk.data"]={fromCache:!1},a?(u(a),a=null):i=u}a||function(e,t,n,o){if("object"!=typeof process||"object"!=typeof process.versions||"string"!=typeof process.versions.node){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onprogress=function(r){var n=e,o=t;if(r.total&&(o=r.total),r.loaded){i.addedTotal?s.dataFileDownloads[n].loaded=r.loaded:(i.addedTotal=!0,s.dataFileDownloads||(s.dataFileDownloads={}),s.dataFileDownloads[n]={loaded:r.loaded,total:o});var a=0,u=0,l=0;for(var c in s.dataFileDownloads){var d=s.dataFileDownloads[c];a+=d.total,u+=d.loaded,l++}a=Math.ceil(a*s.expectedDataFileDownloads/l),s.setStatus&&s.setStatus(`Downloading data... (${u}/${a})`)}else s.dataFileDownloads||s.setStatus&&s.setStatus("Downloading data...")},i.onerror=function(t){throw new Error("NetworkError for: "+e)},i.onload=function(e){if(!(200==i.status||304==i.status||206==i.status||0==i.status&&i.response))throw new Error(i.statusText+" : "+i.responseURL);var t=i.response;n(t)},i.send(null)}else r(147).readFile(e,(function(e,t){var r;e?(r=e,console.error("package error:",r)):n(t.buffer)}))}(n,o,(function(e){i?(i(e),i=null):a=e})),s.calledRun?u():(s.preRun||(s.preRun=[]),s.preRun.push(u))}({files:[{filename:"/ly.img.cesdk/fonts/imgly_font_inter_semibold.otf",start:0,end:270760},{filename:"/ly.img.cesdk/icons/ErrorAudio.svg",start:270760,end:271672},{filename:"/ly.img.cesdk/icons/ErrorConnection.svg",start:271672,end:272620},{filename:"/ly.img.cesdk/icons/ErrorVideo.svg",start:272620,end:273473},{filename:"/ly.img.cesdk/icons/Move.svg",start:273473,end:274748},{filename:"/ly.img.cesdk/icons/RotateIndicator.svg",start:274748,end:275745},{filename:"/ly.img.cesdk/icu/icudt71l.dat",start:275745,end:710017},{filename:"/ly.img.cesdk/presets/.keep",start:710017,end:710017},{filename:"/ly.img.cesdk/shaders/adjustments.sksl",start:710017,end:713906},{filename:"/ly.img.cesdk/shaders/black_and_white_color_mixer.sksl",start:713906,end:720223},{filename:"/ly.img.cesdk/shaders/common/ubq_adjustments.sksl",start:720223,end:724814},{filename:"/ly.img.cesdk/shaders/common/ubq_color_conversions.sksl",start:724814,end:734799},{filename:"/ly.img.cesdk/shaders/common/ubq_constants.sksl",start:734799,end:735289},{filename:"/ly.img.cesdk/shaders/common/ubq_hue_constants.sksl",start:735289,end:738456},{filename:"/ly.img.cesdk/shaders/common/ubq_noise.sksl",start:738456,end:741094},{filename:"/ly.img.cesdk/shaders/cross_cut.sksl",start:741094,end:742041},{filename:"/ly.img.cesdk/shaders/dot_pattern.sksl",start:742041,end:742556},{filename:"/ly.img.cesdk/shaders/duotone_filter.sksl",start:742556,end:743520},{filename:"/ly.img.cesdk/shaders/extrude_blur.sksl",start:743520,end:745637},{filename:"/ly.img.cesdk/shaders/glow.sksl",start:745637,end:746604},{filename:"/ly.img.cesdk/shaders/half_tone.sksl",start:746604,end:747098},{filename:"/ly.img.cesdk/shaders/hsp_selective_adjustments.sksl",start:747098,end:760698},{filename:"/ly.img.cesdk/shaders/linocut.sksl",start:760698,end:761483},{filename:"/ly.img.cesdk/shaders/liquid.sksl",start:761483,end:761965},{filename:"/ly.img.cesdk/shaders/lut_filter.sksl",start:761965,end:764828},{filename:"/ly.img.cesdk/shaders/mask_color.sksl",start:764828,end:765333},{filename:"/ly.img.cesdk/shaders/mirror.sksl",start:765333,end:765787},{filename:"/ly.img.cesdk/shaders/outliner.sksl",start:765787,end:767424},{filename:"/ly.img.cesdk/shaders/pixelize.sksl",start:767424,end:767724},{filename:"/ly.img.cesdk/shaders/placeholder_overlay_lines.sksl",start:767724,end:768412},{filename:"/ly.img.cesdk/shaders/posterize.sksl",start:768412,end:768624},{filename:"/ly.img.cesdk/shaders/radial_pixel.sksl",start:768624,end:769187},{filename:"/ly.img.cesdk/shaders/sharpie.sksl",start:769187,end:771492},{filename:"/ly.img.cesdk/shaders/shifter.sksl",start:771492,end:772176},{filename:"/ly.img.cesdk/shaders/tiltshift.sksl",start:772176,end:772758},{filename:"/ly.img.cesdk/shaders/tv_glitch.sksl",start:772758,end:773476},{filename:"/ly.img.cesdk/shaders/vignette.sksl",start:773476,end:773848}],remote_package_size:773848}),"object"==typeof window&&"object"==typeof window.performance?s.performance=performance:"object"==typeof global&&"object"==typeof global.perf_hooks&&"object"==typeof global.perf_hooks.performance?s.performance=global.perf_hooks.performance:s.performance={mark:function(){},measure:function(){}},function(e){e[e.PENDING=0]="PENDING",e[e.FINISHED=1]="FINISHED",e[e.ALLOCATED=2]="ALLOCATED",e[e.ERROR=3]="ERROR"}(i||(i={})),function(e){e[e.GET=0]="GET",e[e.POST=1]="POST"}(a||(a={}));class c{constructor(e,t){this.state=i.PENDING,this.totalBytes=0,this.receivedLength=0,this.handle=e,this.uri=t}async readChunks(e){let t=0;const r=[],n=e=>{r.push(e),t+=e.length,this.receivedLength=t};if(null==e);else if("getReader"in e){const t=e.getReader();for(;;){const{done:e,value:r}=await t.read();if(e)break;n(r)}}else await new Promise(((t,r)=>{e.on("data",n),e.on("end",(()=>t())),e.on("error",(e=>r(e)))}));const o=new Uint8Array(t);let i=0;for(const e of r)o.set(e,i),i+=e.length;return this.finish(o)}isPending(){return this.state===i.PENDING}isError(){return this.state===i.ERROR}isFinished(){return this.state===i.FINISHED}isAllocated(){return this.state===i.ALLOCATED}allocate(){if(this.isAllocated())return this;if(this.isFinished()){const e=this.result.length,t=s._malloc(e);s.HEAPU8.set(this.result,t);const r=Object.assign(Object.assign({},this),{state:i.ALLOCATED,resultAddress:t,resultLength:e});return Object.assign(this,r),r}return null}finish(e){const t=Object.assign(Object.assign({},this),{state:i.FINISHED,result:e,totalBytes:e.length});return Object.assign(this,t)}fail(e){const t=Object.assign(Object.assign({},this),{state:i.ERROR,error:e});return Object.assign(this,t)}}s.emscripten_ubq_asyncFetchManager=new class{constructor(){this._nextHandle=0,this._nextHeaderHandle=0,this._processes=new Map,this._headers=new Map,this._fetchImpl=null}_fetch(e,t){return this._fetchImpl?this._fetchImpl(e,t):fetch(e,t)}setFetch(e){this._fetchImpl=e}getProcess(e){return this._processes.get(e)}deleteProcess(e){return this._processes.delete(e)}fetch(e,t,r,n,o,i,a,u,l){const d=s.UTF8ToString(t,r),f=this._nextHandle++,p=new c(f,d);return this._processes.set(f,p),d.match(/^file:/)?this._fetchFile(p).catch((e=>(p.fail(e),Promise.reject(e)))):this._fetchRemote(p,e,n,o,i,a,u,l).catch((e=>(p.fail(e),Promise.reject(e)))),p}async _fetchFile(e){if("undefined"!=typeof window)throw new Error("File URLs supported only in Node.JS");const t=r(147),{fileURLToPath:n}=r(310),o=t.createReadStream(n(e.uri));return e.readChunks(o)}async _fetchRemote(e,t,r,n,o,i,u,l){const c=s.UTF8ToString(u,l),d=this.getHeaders(r,n),f=t===a.POST?new Uint8Array(s.HEAPU8.buffer,o,i):void 0,p=await this._fetch(e.uri,{method:a[t],headers:d,body:f,mode:"cors",credentials:c});if(p.status>=200&&p.status<=209){let t=0;return p.headers.has("Content-Length")&&(t=+p.headers.get("Content-Length")),e.totalBytes=t,e.readChunks(p.body)}return e.fail(p.statusText)}getHeaders(e,t){const r={};for(let n=0;n<t;n++){const t=s.getValue(e+4*n,"i32"),o=this._headers.get(t);r[o.key]=o.value}return r}createHeader(e,t,r,n){const o=s.UTF8ToString(e,t),i=s.UTF8ToString(r,n),a=this._nextHeaderHandle++;return this._headers.set(a,{key:o,value:i}),a}deleteHeader(e){return this._headers.delete(e)}},s.emscripten_ubq_codec_videoDecoders=new Map,s.emscripten_ubq_codec_audioDecoders=new Map,s.emscripten_ubq_codec_videoEncoders=new Map,s.emscripten_ubq_codec_audioEncoders=new Map,s.emscripten_ubq_codec_videoDecoderNextHandle=1,s.emscripten_ubq_codec_audioDecoderNextHandle=1,s.emscripten_ubq_codec_videoEncoderNextHandle=1,s.emscripten_ubq_codec_audioEncoderNextHandle=1,s.emscripten_ubq_codec_createNativeResult=function(e){const t=s._malloc(8),r=s.HEAPU32.subarray(t/4,t/4+2);if(r[0]=e.handle?e.handle:e.code?e.code:0,e.error){const t=(new TextEncoder).encode(e.error),n=s._malloc(t.length+1),o=s.HEAPU8.subarray(n,n+t.length+1);for(let e=0;e<t.length;e++)o[e]=t[e];o[t.length]=0,r[1]=n}else r[1]=0;return t},s.emscripten_ubq_codec_createVideoDecoder=function(e,t){const r=new VideoDecoder({output:n=>{const o=r.textures;let i=!1;if((r.shouldDropFrames||r.decodedFrames<r.requestedFrame||r.decodeQueueSize>=o.length)&&(i=!0),!i){var a=s.ctx;const e=r.decodedFrames%o.length;a.bindTexture(a.TEXTURE_2D,o[e]),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,n)}n.close(),r.decodedFrames++,s.emscripten_ubq_codec_onOutputDecodedVideoFrame(e,r.decodedFrames,i,t)},error:e=>{r.unexpectedError=e,console.error(e)}});return r.decodedFrames=0,r.requestedFrame=0,r.shouldDropFrames=!1,r},s.emscripten_ubq_codec_createAudioDecoder=function(e,t,r){const n=new AudioDecoder({output:o=>{if(n.flushing)return void o.close();const i=s.HEAPF32.subarray(e/4,e/4+r),a=s.HEAPF32.subarray(t/4,t/4+r),u=1===o.numberOfChannels?0:1;if("f32-planar"===o.format){let e=n.writtenFrames%r;if(e+o.numberOfFrames<=r)o.copyTo(i.subarray(e),{planeIndex:0,frameCount:o.numberOfFrames}),o.copyTo(a.subarray(e),{planeIndex:u,frameCount:o.numberOfFrames});else{const t=r-e;o.copyTo(i.subarray(e),{planeIndex:0,frameCount:t}),o.copyTo(a.subarray(e),{planeIndex:u,frameCount:t}),o.copyTo(i,{planeIndex:0,frameOffset:t}),o.copyTo(a,{planeIndex:u,frameOffset:t})}n.writtenFrames+=o.numberOfFrames}else if("s16-planar"===o.format)if(1===o.numberOfChannels){const e=new Int16Array(o.numberOfFrames);o.copyTo(e,{planeIndex:0});for(let t=0;t<o.numberOfFrames;t++){const o=e[t]/32768;let s=n.writtenFrames%r;i[s]=o,a[s]=o,n.writtenFrames++}}else{const e=new Int16Array(o.numberOfFrames),t=new Int16Array(o.numberOfFrames);o.copyTo(e,{planeIndex:0}),o.copyTo(t,{planeIndex:1});for(let s=0;s<o.numberOfFrames;s++){let o=n.writtenFrames%r;i[o]=e[s]/32768,a[o]=t[s]/32768,n.writtenFrames++}}else if("s16"===o.format){const e=new Int16Array(o.numberOfFrames*o.numberOfChannels);if(o.copyTo(e,{planeIndex:0}),1===o.numberOfChannels)for(let t=0;t<o.numberOfFrames;t++){const o=e[t]/32768;let s=n.writtenFrames%r;i[s]=o,a[s]=o,n.writtenFrames++}else for(let t=0;t<o.numberOfFrames;t++){let s=n.writtenFrames%r;i[s]=e[t*o.numberOfChannels+0]/32768,a[s]=e[t*o.numberOfChannels+1]/32768,n.writtenFrames++}}else console.error("Unsupported audio format:",o.format);o.close()},error:e=>{n.unexpectedError=e,console.error(e)}});return n.writtenFrames=0,n},s.emscripten_ubq_settings_forceWebGL1=!1;var d,f,p,h=Object.assign({},s),m="./this.program",g=(e,t)=>{throw t},y="object"==typeof window,v="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,w="";if(b){var E=r(147),_=r(17);w=v?_.dirname(w)+"/":__dirname+"/",d=(e,t)=>(e=ie(e)?new URL(e):_.normalize(e),E.readFileSync(e,t?void 0:"utf8")),p=e=>{var t=d(e,!0);return t.buffer||(t=new Uint8Array(t)),t},f=(e,t,r,n=!0)=>{e=ie(e)?new URL(e):_.normalize(e),E.readFile(e,n?void 0:"utf8",((e,o)=>{e?r(e):t(n?o.buffer:o)}))},!s.thisProgram&&process.argv.length>1&&(m=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),g=(e,t)=>{throw process.exitCode=e,t},s.inspect=()=>"[Emscripten Module object]"}else(y||v)&&(v?w=self.location.href:"undefined"!=typeof document&&document.currentScript&&(w=document.currentScript.src),n&&(w=n),w=0!==w.indexOf("blob:")?w.substr(0,w.replace(/[?#].*/,"").lastIndexOf("/")+1):"",d=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},v&&(p=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),f=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)});var C,S=s.print||console.log.bind(console),k=s.printErr||console.error.bind(console);Object.assign(s,h),h=null,s.arguments&&s.arguments,s.thisProgram&&(m=s.thisProgram),s.quit&&(g=s.quit),s.wasmBinary&&(C=s.wasmBinary);var x,P,T=s.noExitRuntime||!0;"object"!=typeof WebAssembly&&ne("no native wasm support detected");var A,F,D,B,L,R,M,O,I,U,j,$=!1;function N(e,t){e||ne(t)}function H(){var e=x.buffer;s.HEAP8=F=new Int8Array(e),s.HEAP16=B=new Int16Array(e),s.HEAP32=R=new Int32Array(e),s.HEAPU8=D=new Uint8Array(e),s.HEAPU16=L=new Uint16Array(e),s.HEAPU32=M=new Uint32Array(e),s.HEAPF32=O=new Float32Array(e),s.HEAPF64=j=new Float64Array(e),s.HEAP64=I=new BigInt64Array(e),s.HEAPU64=U=new BigUint64Array(e)}var q,V=s.INITIAL_MEMORY||16777216;N(V>=65536,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+V+"! (STACK_SIZE=65536)"),x=s.wasmMemory?s.wasmMemory:new WebAssembly.Memory({initial:V/65536,maximum:32768}),H(),V=x.buffer.byteLength;var W=[],G=[],z=[],Y=[];function X(){return T||!1}var K,Q,Z=0,J=null,ee=null;function te(e){Z++,s.monitorRunDependencies&&s.monitorRunDependencies(Z)}function re(e){if(Z--,s.monitorRunDependencies&&s.monitorRunDependencies(Z),0==Z&&(null!==J&&(clearInterval(J),J=null),ee)){var t=ee;ee=null,t()}}function ne(e){s.onAbort&&s.onAbort(e),k(e="Aborted("+e+")"),$=!0,A=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}function oe(e){return e.startsWith("data:application/octet-stream;base64,")}function ie(e){return e.startsWith("file://")}function ae(e){if(e==K&&C)return new Uint8Array(C);if(p)return p(e);throw"both async and sync fetching of the wasm failed"}function se(e,t,r){return function(e){return C||!y&&!v||"function"!=typeof fetch?Promise.resolve().then((()=>ae(e))):fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()})).catch((()=>ae(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then((e=>e)).then(r,(e=>{k("failed to asynchronously prepare wasm: "+e),ne(e)}))}oe(K="cesdk.wasm")||(Q=K,K=s.locateFile?s.locateFile(Q,w):w+Q);var ue={2348072:(e,t,r,n,o)=>"undefined"==typeof window||void 0===(window.AudioContext||window.webkitAudioContext)?0:(void 0===window.miniaudio&&(window.miniaudio={referenceCount:0},window.miniaudio.device_type={},window.miniaudio.device_type.playback=e,window.miniaudio.device_type.capture=t,window.miniaudio.device_type.duplex=r,window.miniaudio.device_state={},window.miniaudio.device_state.stopped=n,window.miniaudio.device_state.started=o,miniaudio.devices=[],miniaudio.track_device=function(e){for(var t=0;t<miniaudio.devices.length;++t)if(null==miniaudio.devices[t])return miniaudio.devices[t]=e,t;return miniaudio.devices.push(e),miniaudio.devices.length-1},miniaudio.untrack_device_by_index=function(e){for(miniaudio.devices[e]=null;miniaudio.devices.length>0&&null==miniaudio.devices[miniaudio.devices.length-1];)miniaudio.devices.pop()},miniaudio.untrack_device=function(e){for(var t=0;t<miniaudio.devices.length;++t)if(miniaudio.devices[t]==e)return miniaudio.untrack_device_by_index(t)},miniaudio.get_device_by_index=function(e){return miniaudio.devices[e]},miniaudio.unlock_event_types=["touchstart","touchend","click"],miniaudio.unlock=function(){for(var e=0;e<miniaudio.devices.length;++e){var t=miniaudio.devices[e];null!=t&&null!=t.webaudio&&2===t.state&&t.webaudio.resume()}miniaudio.unlock_event_types.map((function(e){document.removeEventListener(e,miniaudio.unlock,!0)}))},miniaudio.unlock_event_types.map((function(e){document.addEventListener(e,miniaudio.unlock,!0)}))),window.miniaudio.referenceCount+=1,1),2350062:()=>{void 0!==window.miniaudio&&(window.miniaudio.referenceCount-=1,0===window.miniaudio.referenceCount&&delete window.miniaudio)},2350226:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,2350330:()=>{try{var e=new(window.AudioContext||window.webkitAudioContext),t=e.sampleRate;return e.close(),t}catch(e){return 0}},2350501:(e,t,r,n,o,i)=>{var a=e,u=t,l=r,c=n,d=o,f=i;if(void 0===window.miniaudio)return-1;var p={},h={};a==window.miniaudio.device_type.playback&&(h.sampleRate=l),p.webaudio=new(window.AudioContext||window.webkitAudioContext)(h),p.webaudio.suspend(),p.state=window.miniaudio.device_state.stopped;var m=0,g=u;return a!=window.miniaudio.device_type.playback&&(m=u),p.scriptNode=p.webaudio.createScriptProcessor(c,m,g),p.scriptNode.onaudioprocess=function(e){if(null!=p.intermediaryBufferView&&0!=p.intermediaryBufferView.length||(p.intermediaryBufferView=new Float32Array(s.HEAPF32.buffer,d,c*u)),a==miniaudio.device_type.capture||a==miniaudio.device_type.duplex){for(var t=0;t<u;t+=1)for(var r=e.inputBuffer.getChannelData(t),n=p.intermediaryBufferView,o=0;o<c;o+=1)n[o*u+t]=r[o];Qn(f,c,d)}if(a==miniaudio.device_type.playback||a==miniaudio.device_type.duplex)for(Zn(f,c,d),t=0;t<e.outputBuffer.numberOfChannels;++t){var i=e.outputBuffer.getChannelData(t);for(n=p.intermediaryBufferView,o=0;o<c;o+=1)i[o]=n[o*u+t]}else for(t=0;t<e.outputBuffer.numberOfChannels;++t)e.outputBuffer.getChannelData(t).fill(0)},a!=miniaudio.device_type.capture&&a!=miniaudio.device_type.duplex||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(e){p.streamNode=p.webaudio.createMediaStreamSource(e),p.streamNode.connect(p.scriptNode),p.scriptNode.connect(p.webaudio.destination)})).catch((function(e){console.log("Failed to get user media: "+e)})),a==miniaudio.device_type.playback&&p.scriptNode.connect(p.webaudio.destination),miniaudio.track_device(p)},2353284:e=>miniaudio.get_device_by_index(e).webaudio.sampleRate,2353350:e=>{var t=miniaudio.get_device_by_index(e);void 0!==t.scriptNode&&(t.scriptNode.onaudioprocess=function(e){},t.scriptNode.disconnect(),t.scriptNode=void 0),void 0!==t.streamNode&&(t.streamNode.disconnect(),t.streamNode=void 0),t.webaudio.close(),t.webaudio=void 0},2353715:e=>{miniaudio.untrack_device_by_index(e)},2353758:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.resume(),t.state=miniaudio.device_state.started},2353883:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.suspend(),t.state=miniaudio.device_state.stopped},2354009:()=>!!globalThis.ubq_browserTabHidden,2354055:()=>F.length};function le(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var ce=e=>{for(;e.length>0;)e.shift()(s)},de=[],fe=0;function pe(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){M[this.ptr+4>>2]=e},this.get_type=function(){return M[this.ptr+4>>2]},this.set_destructor=function(e){M[this.ptr+8>>2]=e},this.get_destructor=function(){return M[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,F[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=F[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,F[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=F[this.ptr+13>>0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)},this.set_adjusted_ptr=function(e){M[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return M[this.ptr+16>>2]},this.get_exception_ptr=function(){if(lo(this.get_type()))return M[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var he=e=>{var t=fe;if(!t)return Jn(0),0;var r=new pe(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Jn(0),t;for(var o in e){var i=e[o];if(0===i||i===n)break;var a=r.ptr+16;if(uo(i,n,a))return Jn(i),t}return Jn(n),t},me={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=me.isAbs(e),r="/"===e.substr(-1);return(e=me.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=me.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=me.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return me.normalize(e.join("/"))},join2:(e,t)=>me.normalize(e+"/"+t)},ge=e=>(ge=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(b)try{var e=r(113);if(e.randomFillSync)return t=>e.randomFillSync(t);var t=e.randomBytes;return e=>(e.set(t(e.byteLength)),e)}catch(e){}ne("initRandomDevice")})())(e),ye={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:Ae.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=me.isAbs(n)}return(t?"/":"")+(e=me.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,t)=>{function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=ye.resolve(e).substr(1),t=ye.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},ve="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,be=(e,t,r)=>{for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&ve)return ve.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var u=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&e[t++])<65536)i+=String.fromCharCode(a);else{var l=a-65536;i+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i},we=[],Ee=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},_e=(e,t,r,n)=>{if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(r>=i)break;t[r++]=s}else if(s<=2047){if(r+1>=i)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=i)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o};function Ce(e,t,r){var n=r>0?r:Ee(e)+1,o=new Array(n),i=_e(e,o,0,o.length);return t&&(o.length=i),o}var Se={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){Se.ttys[e]={input:[],output:[],ops:t},Ae.registerDevice(e,Se.stream_ops)},stream_ops:{open:function(e){var t=Se.ttys[e.node.rdev];if(!t)throw new Ae.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.fsync(e.tty)},fsync:function(e){e.tty.ops.fsync(e.tty)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new Ae.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new Ae.ErrnoError(29)}if(void 0===s&&0===i)throw new Ae.ErrnoError(6);if(null==s)break;i++,t[r+a]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new Ae.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new Ae.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){return(()=>{if(!we.length){var e=null;if(b){var t=Buffer.alloc(256),r=0,n=process.stdin.fd;try{r=E.readSync(n,t,0,256,-1)}catch(e){if(!e.toString().includes("EOF"))throw e;r=0}e=r>0?t.slice(0,r).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;we=Ce(e,!0)}return we.shift()})()},put_char:function(e,t){null===t||10===t?(S(be(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(S(be(e.output,0)),e.output=[])},ioctl_tcgets:function(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets:function(e,t,r){return 0},ioctl_tiocgwinsz:function(e){return[24,80]}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(k(be(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(k(be(e.output,0)),e.output=[])}}},ke=e=>{e=((e,t)=>65536*Math.ceil(e/65536))(e);var t=to(65536,e);return t?((e,t)=>(D.fill(0,e,e+t),e))(t,e):0},xe={ops_table:null,mount:e=>xe.createNode(null,"/",16895,0),createNode(e,t,r,n){if(Ae.isBlkdev(r)||Ae.isFIFO(r))throw new Ae.ErrnoError(63);xe.ops_table||(xe.ops_table={dir:{node:{getattr:xe.node_ops.getattr,setattr:xe.node_ops.setattr,lookup:xe.node_ops.lookup,mknod:xe.node_ops.mknod,rename:xe.node_ops.rename,unlink:xe.node_ops.unlink,rmdir:xe.node_ops.rmdir,readdir:xe.node_ops.readdir,symlink:xe.node_ops.symlink},stream:{llseek:xe.stream_ops.llseek}},file:{node:{getattr:xe.node_ops.getattr,setattr:xe.node_ops.setattr},stream:{llseek:xe.stream_ops.llseek,read:xe.stream_ops.read,write:xe.stream_ops.write,allocate:xe.stream_ops.allocate,mmap:xe.stream_ops.mmap,msync:xe.stream_ops.msync}},link:{node:{getattr:xe.node_ops.getattr,setattr:xe.node_ops.setattr,readlink:xe.node_ops.readlink},stream:{}},chrdev:{node:{getattr:xe.node_ops.getattr,setattr:xe.node_ops.setattr},stream:Ae.chrdev_stream_ops}});var o=Ae.createNode(e,t,r,n);return Ae.isDir(o.mode)?(o.node_ops=xe.ops_table.dir.node,o.stream_ops=xe.ops_table.dir.stream,o.contents={}):Ae.isFile(o.mode)?(o.node_ops=xe.ops_table.file.node,o.stream_ops=xe.ops_table.file.stream,o.usedBytes=0,o.contents=null):Ae.isLink(o.mode)?(o.node_ops=xe.ops_table.link.node,o.stream_ops=xe.ops_table.link.stream):Ae.isChrdev(o.mode)&&(o.node_ops=xe.ops_table.chrdev.node,o.stream_ops=xe.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=Ae.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,Ae.isDir(e.mode)?t.size=4096:Ae.isFile(e.mode)?t.size=e.usedBytes:Ae.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&xe.resizeFileStorage(e,t.size)},lookup(e,t){throw Ae.genericErrors[44]},mknod:(e,t,r,n)=>xe.createNode(e,t,r,n),rename(e,t,r){if(Ae.isDir(e.mode)){var n;try{n=Ae.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new Ae.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var r=Ae.lookupNode(e,t);for(var n in r.contents)throw new Ae.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink(e,t,r){var n=xe.createNode(e,t,41471,0);return n.link=r,n},readlink(e){if(!Ae.isLink(e.mode))throw new Ae.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(a>8&&i.subarray)t.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)t[r+s]=i[o+s];return a},write(e,t,r,n,o,i){if(t.buffer===F.buffer&&(i=!1),!n)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=t.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=t.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(t.subarray(r,r+n),o),n}if(xe.expandFileStorage(a,o+n),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=t[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&Ae.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new Ae.ErrnoError(28);return n},allocate(e,t,r){xe.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap(e,t,r,n,o){if(!Ae.isFile(e.node.mode))throw new Ae.ErrnoError(43);var i,a,s=e.node.contents;if(2&o||s.buffer!==F.buffer){if((r>0||r+t<s.length)&&(s=s.subarray?s.subarray(r,r+t):Array.prototype.slice.call(s,r,r+t)),a=!0,!(i=ke(t)))throw new Ae.ErrnoError(48);F.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:(e,t,r,n,o)=>(xe.stream_ops.write(e,t,0,n,r,!1),0)}},Pe=s.preloadPlugins||[];function Te(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}var Ae={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(e,t={})=>{if(!(e=ye.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new Ae.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),n=Ae.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&t.parent)break;if(n=Ae.lookupNode(n,r[i]),o=me.join2(o,r[i]),Ae.isMountpoint(n)&&(!a||a&&t.follow_mount)&&(n=n.mounted.root),!a||t.follow)for(var s=0;Ae.isLink(n.mode);){var u=Ae.readlink(o);if(o=ye.resolve(me.dirname(o),u),n=Ae.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new Ae.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var t;;){if(Ae.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?`${r}/${t}`:r+t:r}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName:(e,t)=>{for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%Ae.nameTable.length},hashAddNode:e=>{var t=Ae.hashName(e.parent.id,e.name);e.name_next=Ae.nameTable[t],Ae.nameTable[t]=e},hashRemoveNode:e=>{var t=Ae.hashName(e.parent.id,e.name);if(Ae.nameTable[t]===e)Ae.nameTable[t]=e.name_next;else for(var r=Ae.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=Ae.mayLookup(e);if(r)throw new Ae.ErrnoError(r,e);for(var n=Ae.hashName(e.id,t),o=Ae.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return Ae.lookup(e,t)},createNode:(e,t,r,n)=>{var o=new Ae.FSNode(e,t,r,n);return Ae.hashAddNode(o),o},destroyNode:e=>{Ae.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagsToPermissionString:e=>{var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>Ae.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>Ae.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate:(e,t)=>{try{return Ae.lookupNode(e,t),20}catch(e){}return Ae.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var n;try{n=Ae.lookupNode(e,t)}catch(e){return e.errno}var o=Ae.nodePermissions(e,"wx");if(o)return o;if(r){if(!Ae.isDir(n.mode))return 54;if(Ae.isRoot(n)||Ae.getPath(n)===Ae.cwd())return 10}else if(Ae.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?Ae.isLink(e.mode)?32:Ae.isDir(e.mode)&&("r"!==Ae.flagsToPermissionString(t)||512&t)?31:Ae.nodePermissions(e,Ae.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:()=>{for(var e=0;e<=Ae.MAX_OPEN_FDS;e++)if(!Ae.streams[e])return e;throw new Ae.ErrnoError(33)},getStreamChecked:e=>{var t=Ae.getStream(e);if(!t)throw new Ae.ErrnoError(8);return t},getStream:e=>Ae.streams[e],createStream:(e,t=-1)=>(Ae.FSStream||(Ae.FSStream=function(){this.shared={}},Ae.FSStream.prototype={},Object.defineProperties(Ae.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return 0!=(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new Ae.FSStream,e),-1==t&&(t=Ae.nextfd()),e.fd=t,Ae.streams[t]=e,e),closeStream:e=>{Ae.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=Ae.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new Ae.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{Ae.devices[e]={stream_ops:t}},getDevice:e=>Ae.devices[e],getMounts:e=>{for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs:(e,t)=>{"function"==typeof e&&(t=e,e=!1),Ae.syncFSRequests++,Ae.syncFSRequests>1&&k(`warning: ${Ae.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=Ae.getMounts(Ae.root.mount),n=0;function o(e){return Ae.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount:(e,t,r)=>{var n,o="/"===r,i=!r;if(o&&Ae.root)throw new Ae.ErrnoError(10);if(!o&&!i){var a=Ae.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,Ae.isMountpoint(n))throw new Ae.ErrnoError(10);if(!Ae.isDir(n.mode))throw new Ae.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?Ae.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:e=>{var t=Ae.lookupPath(e,{follow_mount:!1});if(!Ae.isMountpoint(t.node))throw new Ae.ErrnoError(28);var r=t.node,n=r.mounted,o=Ae.getMounts(n);Object.keys(Ae.nameTable).forEach((e=>{for(var t=Ae.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&Ae.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod:(e,t,r)=>{var n=Ae.lookupPath(e,{parent:!0}).node,o=me.basename(e);if(!o||"."===o||".."===o)throw new Ae.ErrnoError(28);var i=Ae.mayCreate(n,o);if(i)throw new Ae.ErrnoError(i);if(!n.node_ops.mknod)throw new Ae.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,Ae.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,Ae.mknod(e,t,0)),mkdirTree:(e,t)=>{for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{Ae.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,Ae.mknod(e,t,r)),symlink:(e,t)=>{if(!ye.resolve(e))throw new Ae.ErrnoError(44);var r=Ae.lookupPath(t,{parent:!0}).node;if(!r)throw new Ae.ErrnoError(44);var n=me.basename(t),o=Ae.mayCreate(r,n);if(o)throw new Ae.ErrnoError(o);if(!r.node_ops.symlink)throw new Ae.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:(e,t)=>{var r,n,o=me.dirname(e),i=me.dirname(t),a=me.basename(e),s=me.basename(t);if(r=Ae.lookupPath(e,{parent:!0}).node,n=Ae.lookupPath(t,{parent:!0}).node,!r||!n)throw new Ae.ErrnoError(44);if(r.mount!==n.mount)throw new Ae.ErrnoError(75);var u,l=Ae.lookupNode(r,a),c=ye.relative(e,i);if("."!==c.charAt(0))throw new Ae.ErrnoError(28);if("."!==(c=ye.relative(t,o)).charAt(0))throw new Ae.ErrnoError(55);try{u=Ae.lookupNode(n,s)}catch(e){}if(l!==u){var d=Ae.isDir(l.mode),f=Ae.mayDelete(r,a,d);if(f)throw new Ae.ErrnoError(f);if(f=u?Ae.mayDelete(n,s,d):Ae.mayCreate(n,s))throw new Ae.ErrnoError(f);if(!r.node_ops.rename)throw new Ae.ErrnoError(63);if(Ae.isMountpoint(l)||u&&Ae.isMountpoint(u))throw new Ae.ErrnoError(10);if(n!==r&&(f=Ae.nodePermissions(r,"w")))throw new Ae.ErrnoError(f);Ae.hashRemoveNode(l);try{r.node_ops.rename(l,n,s)}catch(e){throw e}finally{Ae.hashAddNode(l)}}},rmdir:e=>{var t=Ae.lookupPath(e,{parent:!0}).node,r=me.basename(e),n=Ae.lookupNode(t,r),o=Ae.mayDelete(t,r,!0);if(o)throw new Ae.ErrnoError(o);if(!t.node_ops.rmdir)throw new Ae.ErrnoError(63);if(Ae.isMountpoint(n))throw new Ae.ErrnoError(10);t.node_ops.rmdir(t,r),Ae.destroyNode(n)},readdir:e=>{var t=Ae.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Ae.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=Ae.lookupPath(e,{parent:!0}).node;if(!t)throw new Ae.ErrnoError(44);var r=me.basename(e),n=Ae.lookupNode(t,r),o=Ae.mayDelete(t,r,!1);if(o)throw new Ae.ErrnoError(o);if(!t.node_ops.unlink)throw new Ae.ErrnoError(63);if(Ae.isMountpoint(n))throw new Ae.ErrnoError(10);t.node_ops.unlink(t,r),Ae.destroyNode(n)},readlink:e=>{var t=Ae.lookupPath(e).node;if(!t)throw new Ae.ErrnoError(44);if(!t.node_ops.readlink)throw new Ae.ErrnoError(28);return ye.resolve(Ae.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=Ae.lookupPath(e,{follow:!t}).node;if(!r)throw new Ae.ErrnoError(44);if(!r.node_ops.getattr)throw new Ae.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>Ae.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?Ae.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Ae.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{Ae.chmod(e,t,!0)},fchmod:(e,t)=>{var r=Ae.getStreamChecked(e);Ae.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?Ae.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new Ae.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{Ae.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=Ae.getStreamChecked(e);Ae.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new Ae.ErrnoError(28);var r;if(!(r="string"==typeof e?Ae.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Ae.ErrnoError(63);if(Ae.isDir(r.mode))throw new Ae.ErrnoError(31);if(!Ae.isFile(r.mode))throw new Ae.ErrnoError(28);var n=Ae.nodePermissions(r,"w");if(n)throw new Ae.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=Ae.getStreamChecked(e);if(0==(2097155&r.flags))throw new Ae.ErrnoError(28);Ae.truncate(r.node,t)},utime:(e,t,r)=>{var n=Ae.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r)=>{if(""===e)throw new Ae.ErrnoError(44);var n;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?function(e){var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===t)throw new Error(`Unknown file open mode: ${e}`);return t}(t):t)?4095&r|32768:0,"object"==typeof e)n=e;else{e=me.normalize(e);try{n=Ae.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(n){if(128&t)throw new Ae.ErrnoError(20)}else n=Ae.mknod(e,r,0),o=!0;if(!n)throw new Ae.ErrnoError(44);if(Ae.isChrdev(n.mode)&&(t&=-513),65536&t&&!Ae.isDir(n.mode))throw new Ae.ErrnoError(54);if(!o){var i=Ae.mayOpen(n,t);if(i)throw new Ae.ErrnoError(i)}512&t&&!o&&Ae.truncate(n,0),t&=-131713;var a=Ae.createStream({node:n,path:Ae.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return a.stream_ops.open&&a.stream_ops.open(a),!s.logReadFiles||1&t||(Ae.readFiles||(Ae.readFiles={}),e in Ae.readFiles||(Ae.readFiles[e]=1)),a},close:e=>{if(Ae.isClosed(e))throw new Ae.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Ae.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(Ae.isClosed(e))throw new Ae.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Ae.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Ae.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:(e,t,r,n,o)=>{if(n<0||o<0)throw new Ae.ErrnoError(28);if(Ae.isClosed(e))throw new Ae.ErrnoError(8);if(1==(2097155&e.flags))throw new Ae.ErrnoError(8);if(Ae.isDir(e.node.mode))throw new Ae.ErrnoError(31);if(!e.stream_ops.read)throw new Ae.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new Ae.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=a),a},write:(e,t,r,n,o,i)=>{if(n<0||o<0)throw new Ae.ErrnoError(28);if(Ae.isClosed(e))throw new Ae.ErrnoError(8);if(0==(2097155&e.flags))throw new Ae.ErrnoError(8);if(Ae.isDir(e.node.mode))throw new Ae.ErrnoError(31);if(!e.stream_ops.write)throw new Ae.ErrnoError(28);e.seekable&&1024&e.flags&&Ae.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new Ae.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,i);return a||(e.position+=s),s},allocate:(e,t,r)=>{if(Ae.isClosed(e))throw new Ae.ErrnoError(8);if(t<0||r<=0)throw new Ae.ErrnoError(28);if(0==(2097155&e.flags))throw new Ae.ErrnoError(8);if(!Ae.isFile(e.node.mode)&&!Ae.isDir(e.node.mode))throw new Ae.ErrnoError(43);if(!e.stream_ops.allocate)throw new Ae.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:(e,t,r,n,o)=>{if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new Ae.ErrnoError(2);if(1==(2097155&e.flags))throw new Ae.ErrnoError(2);if(!e.stream_ops.mmap)throw new Ae.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o)},msync:(e,t,r,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0,munmap:e=>0,ioctl:(e,t,r)=>{if(!e.stream_ops.ioctl)throw new Ae.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile:(e,t={})=>{if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error(`Invalid encoding type "${t.encoding}"`);var r,n=Ae.open(e,t.flags),o=Ae.stat(e).size,i=new Uint8Array(o);return Ae.read(n,i,0,o,0),"utf8"===t.encoding?r=be(i,0):"binary"===t.encoding&&(r=i),Ae.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=Ae.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(Ee(t)+1),i=_e(t,o,0,o.length);Ae.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Ae.write(n,t,0,t.byteLength,void 0,r.canOwn)}Ae.close(n)},cwd:()=>Ae.currentPath,chdir:e=>{var t=Ae.lookupPath(e,{follow:!0});if(null===t.node)throw new Ae.ErrnoError(44);if(!Ae.isDir(t.node.mode))throw new Ae.ErrnoError(54);var r=Ae.nodePermissions(t.node,"x");if(r)throw new Ae.ErrnoError(r);Ae.currentPath=t.path},createDefaultDirectories:()=>{Ae.mkdir("/tmp"),Ae.mkdir("/home"),Ae.mkdir("/home/web_user")},createDefaultDevices:()=>{Ae.mkdir("/dev"),Ae.registerDevice(Ae.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),Ae.mkdev("/dev/null",Ae.makedev(1,3)),Se.register(Ae.makedev(5,0),Se.default_tty_ops),Se.register(Ae.makedev(6,0),Se.default_tty1_ops),Ae.mkdev("/dev/tty",Ae.makedev(5,0)),Ae.mkdev("/dev/tty1",Ae.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(t=ge(e).byteLength),e[--t]);Ae.createDevice("/dev","random",r),Ae.createDevice("/dev","urandom",r),Ae.mkdir("/dev/shm"),Ae.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{Ae.mkdir("/proc");var e=Ae.mkdir("/proc/self");Ae.mkdir("/proc/self/fd"),Ae.mount({mount:()=>{var t=Ae.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=Ae.getStreamChecked(r),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{s.stdin?Ae.createDevice("/dev","stdin",s.stdin):Ae.symlink("/dev/tty","/dev/stdin"),s.stdout?Ae.createDevice("/dev","stdout",null,s.stdout):Ae.symlink("/dev/tty","/dev/stdout"),s.stderr?Ae.createDevice("/dev","stderr",null,s.stderr):Ae.symlink("/dev/tty1","/dev/stderr"),Ae.open("/dev/stdin",0),Ae.open("/dev/stdout",1),Ae.open("/dev/stderr",1)},ensureErrnoError:()=>{Ae.ErrnoError||(Ae.ErrnoError=function(e,t){this.name="ErrnoError",this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},Ae.ErrnoError.prototype=new Error,Ae.ErrnoError.prototype.constructor=Ae.ErrnoError,[44].forEach((e=>{Ae.genericErrors[e]=new Ae.ErrnoError(e),Ae.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{Ae.ensureErrnoError(),Ae.nameTable=new Array(4096),Ae.mount(xe,{},"/"),Ae.createDefaultDirectories(),Ae.createDefaultDevices(),Ae.createSpecialDirectories(),Ae.filesystems={MEMFS:xe}},init:(e,t,r)=>{Ae.init.initialized=!0,Ae.ensureErrnoError(),s.stdin=e||s.stdin,s.stdout=t||s.stdout,s.stderr=r||s.stderr,Ae.createStandardStreams()},quit:()=>{Ae.init.initialized=!1;for(var e=0;e<Ae.streams.length;e++){var t=Ae.streams[e];t&&Ae.close(t)}},findObject:(e,t)=>{var r=Ae.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=Ae.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Ae.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=me.basename(e),n=Ae.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath:(e,t,r,n)=>{e="string"==typeof e?e:Ae.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=me.join2(e,i);try{Ae.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,r,n,o)=>{var i=me.join2("string"==typeof e?e:Ae.getPath(e),t),a=Te(n,o);return Ae.create(i,a)},createDataFile:(e,t,r,n,o,i)=>{var a=t;e&&(e="string"==typeof e?e:Ae.getPath(e),a=t?me.join2(e,t):e);var s=Te(n,o),u=Ae.create(a,s);if(r){if("string"==typeof r){for(var l=new Array(r.length),c=0,d=r.length;c<d;++c)l[c]=r.charCodeAt(c);r=l}Ae.chmod(u,146|s);var f=Ae.open(u,577);Ae.write(f,r,0,r.length,0,i),Ae.close(f),Ae.chmod(u,s)}return u},createDevice:(e,t,r,n)=>{var o=me.join2("string"==typeof e?e:Ae.getPath(e),t),i=Te(!!r,!!n);Ae.createDevice.major||(Ae.createDevice.major=64);var a=Ae.makedev(Ae.createDevice.major++,0);return Ae.registerDevice(a,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,t,n,o,i)=>{for(var a=0,s=0;s<o;s++){var u;try{u=r()}catch(e){throw new Ae.ErrnoError(29)}if(void 0===u&&0===a)throw new Ae.ErrnoError(6);if(null==u)break;a++,t[n+s]=u}return a&&(e.node.timestamp=Date.now()),a},write:(e,t,r,o,i)=>{for(var a=0;a<o;a++)try{n(t[r+a])}catch(e){throw new Ae.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),Ae.mkdev(o,i,a)},forceLoadFile:e=>{if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!d)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=Ce(d(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new Ae.ErrnoError(29)}},createLazyFile:(e,t,r,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;o||(a=n);var s=this;s.setDataGetter((e=>{var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+e+"-"+t),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Ce(o.responseText||"",!0)})(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,S("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!v)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var u=Ae.createFile(e,t,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var l={};function c(e,t,r,n,o){var i=e.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s<a;s++)t[r+s]=i[o+s];else for(s=0;s<a;s++)t[r+s]=i.get(o+s);return a}return Object.keys(u.stream_ops).forEach((e=>{var t=u.stream_ops[e];l[e]=function(){return Ae.forceLoadFile(u),t.apply(null,arguments)}})),l.read=(e,t,r,n,o)=>(Ae.forceLoadFile(u),c(e,t,r,n,o)),l.mmap=(e,t,r,n,o)=>{Ae.forceLoadFile(u);var i=ke(t);if(!i)throw new Ae.ErrnoError(48);return c(e,F,i,t,r),{ptr:i,allocated:!0}},u.stream_ops=l,u}},Fe=(e,t)=>e?be(D,e,t):"",De={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(me.isAbs(t))return t;var n;if(n=-100===e?Ae.cwd():De.getStreamFromFD(e).path,0==t.length){if(!r)throw new Ae.ErrnoError(44);return n}return me.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&me.normalize(t)!==me.normalize(Ae.getPath(e.node)))return-54;throw e}R[r>>2]=n.dev,R[r+4>>2]=n.mode,M[r+8>>2]=n.nlink,R[r+12>>2]=n.uid,R[r+16>>2]=n.gid,R[r+20>>2]=n.rdev,I[r+24>>3]=BigInt(n.size),R[r+32>>2]=4096,R[r+36>>2]=n.blocks;var o=n.atime.getTime(),i=n.mtime.getTime(),a=n.ctime.getTime();return I[r+40>>3]=BigInt(Math.floor(o/1e3)),M[r+48>>2]=o%1e3*1e3,I[r+56>>3]=BigInt(Math.floor(i/1e3)),M[r+64>>2]=i%1e3*1e3,I[r+72>>3]=BigInt(Math.floor(a/1e3)),M[r+80>>2]=a%1e3*1e3,I[r+88>>3]=BigInt(n.ino),0},doMsync:function(e,t,r,n,o){if(!Ae.isFile(t.node.mode))throw new Ae.ErrnoError(43);if(2&n)return 0;var i=D.slice(e,e+r);Ae.msync(t,i,o,r,n)},varargs:void 0,get:()=>(De.varargs+=4,R[De.varargs-4>>2]),getStr:e=>Fe(e),getStreamFromFD:function(e){return Ae.getStreamChecked(e)}},Be={};function Le(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function Re(e){return this.fromWireType(R[e>>2])}var Me={},Oe={},Ie={},Ue=void 0;function je(e){throw new Ue(e)}function $e(e,t,r){function n(t){var n=r(t);n.length!==e.length&&je("Mismatched type converter count");for(var o=0;o<e.length;++o)ze(e[o],n[o])}e.forEach((function(e){Ie[e]=t}));var o=new Array(t.length),i=[],a=0;t.forEach(((e,t)=>{Oe.hasOwnProperty(e)?o[t]=Oe[e]:(i.push(e),Me.hasOwnProperty(e)||(Me[e]=[]),Me[e].push((()=>{o[t]=Oe[e],++a===i.length&&n(o)})))})),0===i.length&&n(o)}var Ne={};function He(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}var qe=void 0;function Ve(e){for(var t="",r=e;D[r];)t+=qe[D[r++]];return t}var We=void 0;function Ge(e){throw new We(e)}function ze(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,t,r={}){var n=t.name;if(e||Ge(`type "${n}" must have a positive integer typeid pointer`),Oe.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;Ge(`Cannot register type '${n}' twice`)}if(Oe[e]=t,delete Ie[e],Me.hasOwnProperty(e)){var o=Me[e];delete Me[e],o.forEach((e=>e()))}}(e,t,r)}function Ye(e,t,r){switch(t){case 0:return r?function(e){return F[e]}:function(e){return D[e]};case 1:return r?function(e){return B[e>>1]}:function(e){return L[e>>1]};case 2:return r?function(e){return R[e>>2]}:function(e){return M[e>>2]};case 3:return r?function(e){return I[e>>3]}:function(e){return U[e>>3]};default:throw new TypeError("Unknown integer type: "+e)}}function Xe(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError(`Unknown type size: ${e}`)}}function Ke(e){Ge(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Qe=!1;function Ze(e){}function Je(e){e.count.value-=1,0===e.count.value&&function(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}(e)}function et(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=et(e,t,r.baseClass);return null===n?null:r.downcast(n)}var tt={};var rt=[];function nt(){for(;rt.length;){var e=rt.pop();e.$$.deleteScheduled=!1,e.delete()}}var ot=void 0;var it={};function at(e,t){return t.ptrType&&t.ptr||je("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&je("Both smartPtrType and smartPtr must be specified"),t.count={value:1},st(Object.create(e,{$$:{value:t}}))}var st=function(e){return"undefined"==typeof FinalizationRegistry?(st=e=>e,e):(Qe=new FinalizationRegistry((e=>{Je(e.$$)})),st=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};Qe.register(e,r,e)}return e},Ze=e=>Qe.unregister(e),st(e))};function ut(){}function lt(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?`_${e}`:e}function ct(e,t){return{[e=lt(e)]:function(){return t.apply(this,arguments)}}[e]}function dt(e,t,r){if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||Ge(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}}function ft(e,t,r){s.hasOwnProperty(e)?((void 0===r||void 0!==s[e].overloadTable&&void 0!==s[e].overloadTable[r])&&Ge(`Cannot register public name '${e}' twice`),dt(s,e,e),s.hasOwnProperty(r)&&Ge(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),s[e].overloadTable[r]=t):(s[e]=t,void 0!==r&&(s[e].numArguments=r))}function pt(e,t,r,n,o,i,a,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}function ht(e,t,r){for(;t!==r;)t.upcast||Ge(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e}function mt(e,t){if(null===t)return this.isReference&&Ge(`null is not a valid ${this.name}`),0;t.$$||Ge(`Cannot pass "${He(t)}" as a ${this.name}`),t.$$.ptr||Ge(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return ht(t.$$.ptr,r,this.registeredClass)}function gt(e,t){var r;if(null===t)return this.isReference&&Ge(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||Ge(`Cannot pass "${He(t)}" as a ${this.name}`),t.$$.ptr||Ge(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&Ge(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=ht(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&Ge("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:Ge(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var o=t.clone();r=this.rawShare(r,Bt.toHandle((function(){o.delete()}))),null!==e&&e.push(this.rawDestructor,r)}break;default:Ge("Unsupporting sharing policy")}return r}function yt(e,t){if(null===t)return this.isReference&&Ge(`null is not a valid ${this.name}`),0;t.$$||Ge(`Cannot pass "${He(t)}" as a ${this.name}`),t.$$.ptr||Ge(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&Ge(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return ht(t.$$.ptr,r,this.registeredClass)}function vt(e,t,r,n,o,i,a,s,u,l,c){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=l,this.rawDestructor=c,o||void 0!==t.baseClass?this.toWireType=gt:n?(this.toWireType=mt,this.destructorFunction=null):(this.toWireType=yt,this.destructorFunction=null)}function bt(e,t,r){s.hasOwnProperty(e)||je("Replacing nonexistant public symbol"),void 0!==s[e].overloadTable&&void 0!==r?s[e].overloadTable[r]=t:(s[e]=t,s[e].argCount=r)}var wt=[],Et=e=>{var t=wt[e];return t||(e>=wt.length&&(wt.length=e+1),wt[e]=t=q.get(e)),t};function _t(e,t){e=Ve(e);var r=Et(t);return"function"!=typeof r&&Ge(`unknown function pointer with signature ${e}: ${t}`),r}var Ct=void 0;function St(e){var t=eo(e),r=Ve(t);return Xn(t),r}function kt(e,t){var r=[],n={};throw t.forEach((function e(t){n[t]||Oe[t]||(Ie[t]?Ie[t].forEach(e):(r.push(t),n[t]=!0))})),new Ct(`${e}: `+r.map(St).join([", "]))}function xt(e,t){for(var r=[],n=0;n<e;n++)r.push(M[t+4*n>>2]);return r}function Pt(e,t){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var r=ct(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var n=new r,o=e.apply(n,t);return o instanceof Object?o:n}function Tt(e,t,r,n,o,i){var a=t.length;a<2&&Ge("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==t[1]&&null!==r,u=!1,l=1;l<t.length;++l)if(null!==t[l]&&void 0===t[l].destructorFunction){u=!0;break}var c="void"!==t[0].name,d="",f="";for(l=0;l<a-2;++l)d+=(0!==l?", ":"")+"arg"+l,f+=(0!==l?", ":"")+"arg"+l+"Wired";var p=`\n return function ${lt(e)}(${d}) {\n if (arguments.length !== ${a-2}) {\n throwBindingError('function ${e} called with ${arguments.length} arguments, expected ${a-2} args!');\n }`;u&&(p+="var destructors = [];\n");var h=u?"destructors":"null",m=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],g=[Ge,n,o,Le,t[0],t[1]];for(s&&(p+="var thisWired = classParam.toWireType("+h+", this);\n"),l=0;l<a-2;++l)p+="var arg"+l+"Wired = argType"+l+".toWireType("+h+", arg"+l+"); // "+t[l+2].name+"\n",m.push("argType"+l),g.push(t[l+2]);if(s&&(f="thisWired"+(f.length>0?", ":"")+f),p+=(c||i?"var rv = ":"")+"invoker(fn"+(f.length>0?", ":"")+f+");\n",u)p+="runDestructors(destructors);\n";else for(l=s?1:2;l<t.length;++l){var y=1===l?"thisWired":"arg"+(l-2)+"Wired";null!==t[l].destructorFunction&&(p+=y+"_dtor("+y+"); // "+t[l].name+"\n",m.push(y+"_dtor"),g.push(t[l].destructorFunction))}return c&&(p+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),p+="}\n",m.push(p),Pt(Function,m).apply(null,g)}function At(){this.allocated=[void 0],this.freelist=[]}var Ft=new At;function Dt(e){e>=Ft.reserved&&0==--Ft.get(e).refcount&&Ft.free(e)}var Bt={toValue:e=>(e||Ge("Cannot use deleted val. handle = "+e),Ft.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return Ft.allocate({refcount:1,value:e})}}};function Lt(e,t,r){switch(t){case 0:return function(e){var t=r?F:D;return this.fromWireType(t[e])};case 1:return function(e){var t=r?B:L;return this.fromWireType(t[e>>1])};case 2:return function(e){var t=r?R:M;return this.fromWireType(t[e>>2])};default:throw new TypeError("Unknown integer type: "+e)}}function Rt(e,t){var r=Oe[e];return void 0===r&&Ge(t+" has unknown type "+St(e)),r}function Mt(e,t){switch(t){case 2:return function(e){return this.fromWireType(O[e>>2])};case 3:return function(e){return this.fromWireType(j[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}var Ot=(e,t,r)=>_e(e,D,t,r),It="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Ut=(e,t)=>{for(var r=e,n=r>>1,o=n+t/2;!(n>=o)&&L[n];)++n;if((r=n<<1)-e>32&&It)return It.decode(D.subarray(e,r));for(var i="",a=0;!(a>=t/2);++a){var s=B[e+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i},jt=(e,t,r)=>{if(void 0===r&&(r=2147483647),r<2)return 0;for(var n=t,o=(r-=2)<2*e.length?r/2:e.length,i=0;i<o;++i){var a=e.charCodeAt(i);B[t>>1]=a,t+=2}return B[t>>1]=0,t-n},$t=e=>2*e.length,Nt=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var o=R[e+4*r>>2];if(0==o)break;if(++r,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(o)}return n},Ht=(e,t,r)=>{if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=t,o=n+r-4,i=0;i<e.length;++i){var a=e.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),R[t>>2]=a,(t+=4)+4>o)break}return R[t>>2]=0,t-n},qt=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t};function Vt(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=Rt(M[t+4*n>>2],"parameter "+n);return r}var Wt={};function Gt(e){var t=Wt[e];return void 0===t?Ve(e):t}var zt=[];function Yt(){return"object"==typeof globalThis?globalThis:Function("return this")()}var Xt=[],Kt={};function Qt(e){return e<-9007199254740992||e>9007199254740992?NaN:Number(e)}var Zt,Jt=e=>e%4==0&&(e%100!=0||e%400==0),er=[0,31,60,91,121,152,182,213,244,274,305,335],tr=[0,31,59,90,120,151,181,212,243,273,304,334],rr=e=>(Jt(e.getFullYear())?er:tr)[e.getMonth()]+e.getDate()-1,nr=e=>{var t=Ee(e)+1,r=Yn(t);return r&&Ot(e,r,t),r};function or(e,t){if(lr.mainLoop.timingMode=e,lr.mainLoop.timingValue=t,!lr.mainLoop.func)return 1;if(lr.mainLoop.running||(lr.mainLoop.running=!0),0==e)lr.mainLoop.scheduler=function(){var e=0|Math.max(0,lr.mainLoop.tickStartTime+t-Zt());setTimeout(lr.mainLoop.runner,e)},lr.mainLoop.method="timeout";else if(1==e)lr.mainLoop.scheduler=function(){lr.requestAnimationFrame(lr.mainLoop.runner)},lr.mainLoop.method="rAF";else if(2==e){if("undefined"==typeof setImmediate){var r=[],n="setimmediate";addEventListener("message",(e=>{e.data!==n&&e.data.target!==n||(e.stopPropagation(),r.shift()())}),!0),setImmediate=function(e){r.push(e),v?(void 0===s.setImmediates&&(s.setImmediates=[]),s.setImmediates.push(e),postMessage({target:n})):postMessage(n,"*")}}lr.mainLoop.scheduler=function(){setImmediate(lr.mainLoop.runner)},lr.mainLoop.method="immediate"}return 0}Zt=()=>performance.now();var ir=e=>{if(e instanceof le||"unwind"==e)return A;g(1,e)},ar=(e,t)=>{var r;A=e,A=r=e,X()||(s.onExit&&s.onExit(r),$=!0),g(r,new le(r))},sr=e=>{if(!$)try{e(),(()=>{if(!X())try{ar(A)}catch(e){ir(e)}})()}catch(e){ir(e)}},ur=(e,t)=>setTimeout((()=>{sr(e)}),t),lr={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){lr.mainLoop.scheduler=null,lr.mainLoop.currentlyRunningMainloop++},resume:function(){lr.mainLoop.currentlyRunningMainloop++;var e=lr.mainLoop.timingMode,t=lr.mainLoop.timingValue,r=lr.mainLoop.func;lr.mainLoop.func=null,function(e,t,r,n,o){N(!lr.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),lr.mainLoop.func=e,lr.mainLoop.arg=n;var i=lr.mainLoop.currentlyRunningMainloop;function a(){return!(i<lr.mainLoop.currentlyRunningMainloop)}lr.mainLoop.running=!1,lr.mainLoop.runner=function(){if(!$)if(lr.mainLoop.queue.length>0){var t=Date.now(),r=lr.mainLoop.queue.shift();if(r.func(r.arg),lr.mainLoop.remainingBlockers){var n=lr.mainLoop.remainingBlockers,o=n%1==0?n-1:Math.floor(n);r.counted?lr.mainLoop.remainingBlockers=o:(o+=.5,lr.mainLoop.remainingBlockers=(8*n+o)/9)}if(S('main loop blocker "'+r.name+'" took '+(Date.now()-t)+" ms"),lr.mainLoop.updateStatus(),!a())return;setTimeout(lr.mainLoop.runner,0)}else a()&&(lr.mainLoop.currentFrameNumber=lr.mainLoop.currentFrameNumber+1|0,1==lr.mainLoop.timingMode&&lr.mainLoop.timingValue>1&&lr.mainLoop.currentFrameNumber%lr.mainLoop.timingValue!=0?lr.mainLoop.scheduler():(0==lr.mainLoop.timingMode&&(lr.mainLoop.tickStartTime=Zt()),lr.mainLoop.runIter(e),a()&&("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),lr.mainLoop.scheduler())))}}(r,0,0,lr.mainLoop.arg),or(e,t),lr.mainLoop.scheduler()},updateStatus:function(){if(s.setStatus){var e=s.statusMessage||"Please wait...",t=lr.mainLoop.remainingBlockers,r=lr.mainLoop.expectedBlockers;t?t<r?s.setStatus(e+" ("+(r-t)+"/"+r+")"):s.setStatus(e):s.setStatus("")}},runIter:function(e){if(!$){if(s.preMainLoop&&!1===s.preMainLoop())return;sr(e),s.postMainLoop&&s.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(!lr.initted){lr.initted=!0;var e={canHandle:function(e){return!s.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,t,r,n){var o=new Blob([e],{type:lr.getMimetype(t)});o.size!==e.length&&(o=new Blob([new Uint8Array(e).buffer],{type:lr.getMimetype(t)}));var i=URL.createObjectURL(o),a=new Image;a.onload=()=>{N(a.complete,"Image "+t+" could not be decoded");var n=document.createElement("canvas");n.width=a.width,n.height=a.height,n.getContext("2d").drawImage(a,0,0),Nn[t]=n,URL.revokeObjectURL(i),r&&r(e)},a.onerror=e=>{S("Image "+i+" could not be decoded"),n&&n()},a.src=i}};Pe.push(e);var t={canHandle:function(e){return!s.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,t,r,n){var o=!1;function i(n){o||(o=!0,Hn[t]=n,r&&r(e))}var a=new Blob([e],{type:lr.getMimetype(t)}),s=URL.createObjectURL(a),u=new Audio;u.addEventListener("canplaythrough",(()=>i(u)),!1),u.onerror=function(r){o||(k("warning: browser could not fully decode audio "+t+", trying slower base64 approach"),u.src="data:audio/x-"+t.substr(-3)+";base64,"+function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="",n=0,o=0,i=0;i<e.length;i++)for(n=n<<8|e[i],o+=8;o>=6;){var a=n>>o-6&63;o-=6,r+=t[a]}return 2==o?(r+=t[(3&n)<<4],r+="=="):4==o&&(r+=t[(15&n)<<2],r+="="),r}(e),i(u))},u.src=s,ur((()=>{i(u)}),1e4)}};Pe.push(t);var r=s.canvas;r&&(r.requestPointerLock=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||(()=>{}),r.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||(()=>{}),r.exitPointerLock=r.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",n,!1),document.addEventListener("mozpointerlockchange",n,!1),document.addEventListener("webkitpointerlockchange",n,!1),document.addEventListener("mspointerlockchange",n,!1),s.elementPointerLock&&r.addEventListener("click",(e=>{!lr.pointerLock&&s.canvas.requestPointerLock&&(s.canvas.requestPointerLock(),e.preventDefault())}),!1))}function n(){lr.pointerLock=document.pointerLockElement===s.canvas||document.mozPointerLockElement===s.canvas||document.webkitPointerLockElement===s.canvas||document.msPointerLockElement===s.canvas}},createContext:function(e,t,r,n){if(t&&s.ctx&&e==s.canvas)return s.ctx;var o,i;if(t){var a={antialias:!1,alpha:!1,majorVersion:"undefined"!=typeof WebGL2RenderingContext?2:1};if(n)for(var u in n)a[u]=n[u];void 0!==yr&&(i=yr.createContext(e,a))&&(o=yr.getContext(i).GLctx)}else o=e.getContext("2d");return o?(r&&(t||N(void 0===$n,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),s.ctx=o,t&&yr.makeContextCurrent(i),s.useWebGL=t,lr.moduleContextCreatedCallbacks.forEach((e=>e())),lr.init()),o):null},destroyContext:function(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(e,t){lr.lockPointer=e,lr.resizeCanvas=t,void 0===lr.lockPointer&&(lr.lockPointer=!0),void 0===lr.resizeCanvas&&(lr.resizeCanvas=!1);var r=s.canvas;function n(){lr.isFullscreen=!1;var e=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(r.exitFullscreen=lr.exitFullscreen,lr.lockPointer&&r.requestPointerLock(),lr.isFullscreen=!0,lr.resizeCanvas?lr.setFullscreenCanvasSize():lr.updateCanvasDimensions(r)):(e.parentNode.insertBefore(r,e),e.parentNode.removeChild(e),lr.resizeCanvas?lr.setWindowedCanvasSize():lr.updateCanvasDimensions(r)),s.onFullScreen&&s.onFullScreen(lr.isFullscreen),s.onFullscreen&&s.onFullscreen(lr.isFullscreen)}lr.fullscreenHandlersInstalled||(lr.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var o=document.createElement("div");r.parentNode.insertBefore(o,r),o.appendChild(r),o.requestFullscreen=o.requestFullscreen||o.mozRequestFullScreen||o.msRequestFullscreen||(o.webkitRequestFullscreen?()=>o.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):null)||(o.webkitRequestFullScreen?()=>o.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT):null),o.requestFullscreen()},exitFullscreen:function(){return!!lr.isFullscreen&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||(()=>{})).apply(document,[]),!0)},nextRAF:0,fakeRequestAnimationFrame:function(e){var t=Date.now();if(0===lr.nextRAF)lr.nextRAF=t+1e3/60;else for(;t+2>=lr.nextRAF;)lr.nextRAF+=1e3/60;var r=Math.max(lr.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame:function(e){"function"!=typeof requestAnimationFrame?(0,lr.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeSetTimeout:function(e,t){return ur(e,t)},safeRequestAnimationFrame:function(e){return lr.requestAnimationFrame((()=>{sr(e)}))},getMimetype:function(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]},getUserMedia:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta:function(e){var t=0;switch(e.type){case"DOMMouseScroll":t=e.detail/3;break;case"mousewheel":t=e.wheelDelta/120;break;case"wheel":switch(t=e.deltaY,e.deltaMode){case 0:t/=100;break;case 1:t/=3;break;case 2:t*=80;break;default:throw"unrecognized mouse wheel delta mode: "+e.deltaMode}break;default:throw"unrecognized mouse wheel event: "+e.type}return t},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(e){if(lr.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?lr.mouseMovementX=lr.mouseMovementY=0:(lr.mouseMovementX=lr.getMovementX(e),lr.mouseMovementY=lr.getMovementY(e)),"undefined"!=typeof SDL?(lr.mouseX=SDL.mouseX+lr.mouseMovementX,lr.mouseY=SDL.mouseY+lr.mouseMovementY):(lr.mouseX+=lr.mouseMovementX,lr.mouseY+=lr.mouseMovementY);else{var t=s.canvas.getBoundingClientRect(),r=s.canvas.width,n=s.canvas.height,o=void 0!==window.scrollX?window.scrollX:window.pageXOffset,i=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var a=e.touch;if(void 0===a)return;var u=a.pageX-(o+t.left),l=a.pageY-(i+t.top),c={x:u*=r/t.width,y:l*=n/t.height};if("touchstart"===e.type)lr.lastTouches[a.identifier]=c,lr.touches[a.identifier]=c;else if("touchend"===e.type||"touchmove"===e.type){var d=lr.touches[a.identifier];d||(d=c),lr.lastTouches[a.identifier]=d,lr.touches[a.identifier]=c}return}var f=e.pageX-(o+t.left),p=e.pageY-(i+t.top);f*=r/t.width,p*=n/t.height,lr.mouseMovementX=f-lr.mouseX,lr.mouseMovementY=p-lr.mouseY,lr.mouseX=f,lr.mouseY=p}},resizeListeners:[],updateResizeListeners:function(){var e=s.canvas;lr.resizeListeners.forEach((t=>t(e.width,e.height)))},setCanvasSize:function(e,t,r){var n=s.canvas;lr.updateCanvasDimensions(n,e,t),r||lr.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=M[SDL.screen>>2];e|=8388608,R[SDL.screen>>2]=e}lr.updateCanvasDimensions(s.canvas),lr.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=M[SDL.screen>>2];e&=-8388609,R[SDL.screen>>2]=e}lr.updateCanvasDimensions(s.canvas),lr.updateResizeListeners()},updateCanvasDimensions:function(e,t,r){t&&r?(e.widthNative=t,e.heightNative=r):(t=e.widthNative,r=e.heightNative);var n=t,o=r;if(s.forcedAspectRatio&&s.forcedAspectRatio>0&&(n/o<s.forcedAspectRatio?n=Math.round(o*s.forcedAspectRatio):o=Math.round(n/s.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var i=Math.min(screen.width/n,screen.height/o);n=Math.round(n*i),o=Math.round(o*i)}lr.resizeCanvas?(e.width!=n&&(e.width=n),e.height!=o&&(e.height=o),void 0!==e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=t&&(e.width=t),e.height!=r&&(e.height=r),void 0!==e.style&&(n!=t||o!=r?(e.style.setProperty("width",n+"px","important"),e.style.setProperty("height",o+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))}},cr={errorCode:12288,defaultDisplayInitialized:!1,currentContext:0,currentReadSurface:0,currentDrawSurface:0,contextAttributes:{alpha:!1,depth:!1,stencil:!1,antialias:!1},stringCache:{},setErrorCode:function(e){cr.errorCode=e},chooseConfig:function(e,t,r,n,o){if(62e3!=e)return cr.setErrorCode(12296),0;if(t)for(;;){var i=R[t>>2];if(12321==i){var a=R[t+4>>2];cr.contextAttributes.alpha=a>0}else if(12325==i){var s=R[t+4>>2];cr.contextAttributes.depth=s>0}else if(12326==i){var u=R[t+4>>2];cr.contextAttributes.stencil=u>0}else if(12337==i){var l=R[t+4>>2];cr.contextAttributes.antialias=l>0}else if(12338==i)l=R[t+4>>2],cr.contextAttributes.antialias=1==l;else if(12544==i){var c=R[t+4>>2];cr.contextAttributes.lowLatency=12547!=c}else if(12344==i)break;t+=8}return r&&n||o?(o&&(R[o>>2]=1),r&&n>0&&(R[r>>2]=62002),cr.setErrorCode(12288),1):(cr.setErrorCode(12300),0)}};function dr(e){var t=e.getExtension("ANGLE_instanced_arrays");if(t)return e.vertexAttribDivisor=function(e,r){t.vertexAttribDivisorANGLE(e,r)},e.drawArraysInstanced=function(e,r,n,o){t.drawArraysInstancedANGLE(e,r,n,o)},e.drawElementsInstanced=function(e,r,n,o,i){t.drawElementsInstancedANGLE(e,r,n,o,i)},1}function fr(e){var t=e.getExtension("OES_vertex_array_object");if(t)return e.createVertexArray=function(){return t.createVertexArrayOES()},e.deleteVertexArray=function(e){t.deleteVertexArrayOES(e)},e.bindVertexArray=function(e){t.bindVertexArrayOES(e)},e.isVertexArray=function(e){return t.isVertexArrayOES(e)},1}function pr(e){var t=e.getExtension("WEBGL_draw_buffers");if(t)return e.drawBuffers=function(e,r){t.drawBuffersWEBGL(e,r)},1}function hr(e){return!!(e.dibvbi=e.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"))}function mr(e){return!!(e.mdibvbi=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"))}function gr(e){return!!(e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw"))}var yr={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){yr.lastError||(yr.lastError=e)},getNewId:function(e){for(var t=yr.counter++,r=e.length;r<t;r++)e[r]=null;return t},getSource:function(e,t,r,n){for(var o="",i=0;i<t;++i){var a=n?R[n+4*i>>2]:-1;o+=Fe(R[r+4*i>>2],a<0?void 0:a)}return o},createContext:function(e,t){e.getContextSafariWebGL2Fixed||(e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=function(t,r){var n=e.getContextSafariWebGL2Fixed(t,r);return"webgl"==t==n instanceof WebGLRenderingContext?n:null});var r=t.majorVersion>1?e.getContext("webgl2",t):e.getContext("webgl",t);return r?yr.registerContext(r,t):0},registerContext:function(e,t){var r=yr.getNewId(yr.contexts),n={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),yr.contexts[r]=n,(void 0===t.enableExtensionsByDefault||t.enableExtensionsByDefault)&&yr.initExtensions(n),r},makeContextCurrent:function(e){return yr.currentContext=yr.contexts[e],s.ctx=$n=yr.currentContext&&yr.currentContext.GLctx,!(e&&!$n)},getContext:function(e){return yr.contexts[e]},deleteContext:function(e){yr.currentContext===yr.contexts[e]&&(yr.currentContext=null),"object"==typeof Tn&&Tn.removeAllHandlersOnTarget(yr.contexts[e].GLctx.canvas),yr.contexts[e]&&yr.contexts[e].GLctx.canvas&&(yr.contexts[e].GLctx.canvas.GLctxObject=void 0),yr.contexts[e]=null},initExtensions:function(e){if(e||(e=yr.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var t=e.GLctx;dr(t),fr(t),pr(t),hr(t),mr(t),e.version>=2&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query_webgl2")),(e.version<2||!t.disjointTimerQueryExt)&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query")),gr(t),(t.getSupportedExtensions()||[]).forEach((function(e){e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}}},vr=[];function br(e){$n.bindVertexArray(yr.vaos[e])}var wr=br,Er=br;function _r(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2];$n.deleteVertexArray(yr.vaos[n]),yr.vaos[n]=null}}var Cr=_r,Sr=_r;function kr(e,t,r,n){$n.drawArraysInstanced(e,t,r,n)}var xr=kr,Pr=kr,Tr=kr,Ar=kr,Fr=kr,Dr=[];function Br(e,t){for(var r=Dr[e],n=0;n<e;n++)r[n]=R[t+4*n>>2];$n.drawBuffers(r)}var Lr=Br,Rr=Br,Mr=Br;function Or(e,t,r,n){$n.drawElements(e,t,r,n)}var Ir=Or;function Ur(e,t,r,n,o){$n.drawElementsInstanced(e,t,r,n,o)}var jr=Ur,$r=Ur,Nr=Ur,Hr=Ur,qr=Ur;function Vr(e,t,r,n){for(var o=0;o<e;o++){var i=$n[r](),a=i&&yr.getNewId(n);i?(i.name=a,n[a]=i):yr.recordError(1282),R[t+4*o>>2]=a}}function Wr(e,t){Vr(e,t,"createVertexArray",yr.vaos)}var Gr=Wr,zr=Wr;function Yr(e,t,r,n,o,i,a,s){t=yr.programs[t];var u=$n[e](t,r);if(u){var l=s&&Ot(u.name,s,n);o&&(R[o>>2]=l),i&&(R[i>>2]=u.size),a&&(R[a>>2]=u.type)}}function Xr(e,t){M[e>>2]=t,M[e+4>>2]=(t-M[e>>2])/4294967296}function Kr(e,t,r){if(t){var n=void 0;switch(e){case 36346:n=1;break;case 36344:return void(0!=r&&1!=r&&yr.recordError(1280));case 34814:case 36345:n=0;break;case 34466:var o=$n.getParameter(34467);n=o?o.length:0;break;case 33309:if(yr.currentContext.version<2)return void yr.recordError(1282);n=2*($n.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(yr.currentContext.version<2)return void yr.recordError(1280);n=33307==e?3:0}if(void 0===n){var i=$n.getParameter(e);switch(typeof i){case"number":n=i;break;case"boolean":n=i?1:0;break;case"string":return void yr.recordError(1280);case"object":if(null===i)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:n=0;break;default:return void yr.recordError(1280)}else{if(i instanceof Float32Array||i instanceof Uint32Array||i instanceof Int32Array||i instanceof Array){for(var a=0;a<i.length;++a)switch(r){case 0:R[t+4*a>>2]=i[a];break;case 2:O[t+4*a>>2]=i[a];break;case 4:F[t+a>>0]=i[a]?1:0}return}try{n=0|i.name}catch(t){return yr.recordError(1280),void k("GL_INVALID_ENUM in glGet"+r+"v: Unknown object returned from WebGL getParameter("+e+")! (error: "+t+")")}}break;default:return yr.recordError(1280),void k("GL_INVALID_ENUM in glGet"+r+"v: Native code calling glGet"+r+"v("+e+") and it returns "+i+" of type "+typeof i+"!")}}switch(r){case 1:Xr(t,n);break;case 0:R[t>>2]=n;break;case 2:O[t>>2]=n;break;case 4:F[t>>0]=n?1:0}}else yr.recordError(1281)}function Qr(e,t,r,n){if(r){var o,i=$n.getIndexedParameter(e,t);switch(typeof i){case"boolean":o=i?1:0;break;case"number":o=i;break;case"object":if(null===i)switch(e){case 35983:case 35368:o=0;break;default:return void yr.recordError(1280)}else{if(!(i instanceof WebGLBuffer))return void yr.recordError(1280);o=0|i.name}break;default:return void yr.recordError(1280)}switch(n){case 1:Xr(r,o);break;case 0:R[r>>2]=o;break;case 2:O[r>>2]=o;break;case 4:F[r>>0]=o?1:0;break;default:throw"internal emscriptenWebGLGetIndexed() error, bad type: "+n}}else yr.recordError(1281)}function Zr(e,t,r){if(r){var n,o=yr.queries[e];Xr(r,"boolean"==typeof(n=yr.currentContext.version<2?$n.disjointTimerQueryExt.getQueryObjectEXT(o,t):$n.getQueryParameter(o,t))?n?1:0:n)}else yr.recordError(1281)}var Jr=Zr;function en(e,t,r){if(r){var n,o=yr.queries[e],i=$n.disjointTimerQueryExt.getQueryObjectEXT(o,t);n="boolean"==typeof i?i?1:0:i,R[r>>2]=n}else yr.recordError(1281)}var tn=en,rn=Zr,nn=en;function on(e){return"]"==e.slice(-1)&&e.lastIndexOf("[")}function an(e){var t,r,n=e.uniformLocsById,o=e.uniformSizeAndIdsByName;if(!n)for(e.uniformLocsById=n={},e.uniformArrayNamesById={},t=0;t<$n.getProgramParameter(e,35718);++t){var i=$n.getActiveUniform(e,t),a=i.name,s=i.size,u=on(a),l=u>0?a.slice(0,u):a,c=e.uniformIdCounter;for(e.uniformIdCounter+=s,o[l]=[s,c],r=0;r<s;++r)n[c]=r,e.uniformArrayNamesById[c++]=l}}function sn(e){var t=$n.currentProgram;if(t){var r=t.uniformLocsById[e];return"number"==typeof r&&(t.uniformLocsById[e]=r=$n.getUniformLocation(t,t.uniformArrayNamesById[e]+(r>0?"["+r+"]":""))),r}yr.recordError(1282)}function un(e,t,r,n){if(r){an(e=yr.programs[e]);var o=$n.getUniform(e,sn(t));if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:R[r>>2]=o;break;case 2:O[r>>2]=o}else for(var i=0;i<o.length;i++)switch(n){case 0:R[r+4*i>>2]=o[i];break;case 2:O[r+4*i>>2]=o[i]}}else yr.recordError(1281)}function ln(e,t,r,n){if(r){var o=$n.getVertexAttrib(e,t);if(34975==t)R[r>>2]=o&&o.name;else if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:R[r>>2]=o;break;case 2:O[r>>2]=o;break;case 5:R[r>>2]=Math.fround(o)}else for(var i=0;i<o.length;i++)switch(n){case 0:R[r+4*i>>2]=o[i];break;case 2:O[r+4*i>>2]=o[i];break;case 5:R[r+4*i>>2]=Math.fround(o[i])}}else yr.recordError(1281)}function cn(e,t,r){ln(e,t,r,0)}var dn=cn,fn=cn;function pn(e){var t=yr.vaos[e];return t?$n.isVertexArray(t):0}var hn=pn,mn=pn;function gn(e){return 0==(e-=5120)?F:1==e?D:2==e?B:4==e?R:6==e?O:5==e||28922==e||28520==e||30779==e||30782==e?M:L}function yn(e){return 31-Math.clz32(e.BYTES_PER_ELEMENT)}function vn(e,t,r,n,o,i){var a=gn(e),s=yn(a),u=1<<s,l=function(e){return{5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[e-6402]||1}(t)*u,c=function(e,t,r,n){var o;return t*(e*r+(o=n)-1&-o)}(r,n,l,yr.unpackAlignment);return a.subarray(o>>s,o+c>>s)}var bn=[],wn=[];function En(e,t){$n.vertexAttribDivisor(e,t)}var _n=En,Cn=En,Sn=En,kn=En,xn=En,Pn=e=>{var t=e-x.buffer.byteLength+65535>>>16;try{return x.grow(t),H(),1}catch(e){}},Tn={inEventHandler:0,removeAllEventListeners:function(){for(var e=Tn.eventHandlers.length-1;e>=0;--e)Tn._removeHandler(e);Tn.eventHandlers=[],Tn.deferredCalls=[]},registerRemoveEventListeners:function(){Tn.removeEventListenersRegistered||(z.push(Tn.removeAllEventListeners),Tn.removeEventListenersRegistered=!0)},deferredCalls:[],deferCall:function(e,t,r){function n(e,t){if(e.length!=t.length)return!1;for(var r in e)if(e[r]!=t[r])return!1;return!0}for(var o in Tn.deferredCalls){var i=Tn.deferredCalls[o];if(i.targetFunction==e&&n(i.argsList,r))return}Tn.deferredCalls.push({targetFunction:e,precedence:t,argsList:r}),Tn.deferredCalls.sort((function(e,t){return e.precedence<t.precedence}))},removeDeferredCalls:function(e){for(var t=0;t<Tn.deferredCalls.length;++t)Tn.deferredCalls[t].targetFunction==e&&(Tn.deferredCalls.splice(t,1),--t)},canPerformEventHandlerRequests:function(){return navigator.userActivation?navigator.userActivation.isActive:Tn.inEventHandler&&Tn.currentEventHandler.allowsDeferredCalls},runDeferredCalls:function(){if(Tn.canPerformEventHandlerRequests())for(var e=0;e<Tn.deferredCalls.length;++e){var t=Tn.deferredCalls[e];Tn.deferredCalls.splice(e,1),--e,t.targetFunction.apply(null,t.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:function(e,t){for(var r=0;r<Tn.eventHandlers.length;++r)Tn.eventHandlers[r].target!=e||t&&t!=Tn.eventHandlers[r].eventTypeString||Tn._removeHandler(r--)},_removeHandler:function(e){var t=Tn.eventHandlers[e];t.target.removeEventListener(t.eventTypeString,t.eventListenerFunc,t.useCapture),Tn.eventHandlers.splice(e,1)},registerOrRemoveHandler:function(e){if(!e.target)return-4;var t=function(t){++Tn.inEventHandler,Tn.currentEventHandler=e,Tn.runDeferredCalls(),e.handlerFunc(t),Tn.runDeferredCalls(),--Tn.inEventHandler};if(e.callbackfunc)e.eventListenerFunc=t,e.target.addEventListener(e.eventTypeString,t,e.useCapture),Tn.eventHandlers.push(e),Tn.registerRemoveEventListeners();else for(var r=0;r<Tn.eventHandlers.length;++r)Tn.eventHandlers[r].target==e.target&&Tn.eventHandlers[r].eventTypeString==e.eventTypeString&&Tn._removeHandler(r--);return 0},getNodeNameForTarget:function(e){return e?e==window?"#window":e==screen?"#screen":e&&e.nodeName?e.nodeName:"":""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}},An=["default","low-power","high-performance"],Fn=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0];var Dn,Bn,Ln={},Rn=()=>{if(!Rn.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:m||"./this.program"};for(var t in Ln)void 0===Ln[t]?delete e[t]:e[t]=Ln[t];var r=[];for(var t in e)r.push(`${t}=${e[t]}`);Rn.strings=r}return Rn.strings},Mn=(e,t,r,n)=>{for(var o=0,i=0;i<r;i++){var a=M[t>>2],s=M[t+4>>2];t+=8;var u=Ae.read(e,F,a,s,n);if(u<0)return-1;if(o+=u,u<s)break;void 0!==n&&(n+=u)}return o},On=[31,29,31,30,31,30,31,31,30,31,30,31],In=[31,28,31,30,31,30,31,31,30,31,30,31],Un=(e,t)=>{F.set(e,t)},jn=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Ae.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n};Object.defineProperties(jn.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return Ae.isDir(this.mode)}},isDevice:{get:function(){return Ae.isChrdev(this.mode)}}}),Ae.FSNode=jn,Ae.createPreloadedFile=function(e,t,r,n,o,i,a,s,u,l){var c=t?ye.resolve(me.join2(e,t)):e;function d(r){function d(r){l&&l(),s||Ae.createDataFile(e,t,r,n,o,u),i&&i(),re()}(function(e,t,r,n){void 0!==lr&&lr.init();var o=!1;return Pe.forEach((function(i){o||i.canHandle(t)&&(i.handle(e,t,r,n),o=!0)})),o})(r,c,d,(()=>{a&&a(),re()}))||d(r)}te(),"string"==typeof r?((e,t,r,n)=>{var o=`al ${e}`;f(e,(t=>{N(t,`Loading data file "${e}" failed (no arrayBuffer).`),d(new Uint8Array(t)),o&&re()}),(t=>{if(!r)throw`Loading data file "${e}" failed.`;r()})),o&&te()})(r,0,a):d(r)},Ae.staticInit(),s.FS_createPath=Ae.createPath,s.FS_createDataFile=Ae.createDataFile,s.FS_createPreloadedFile=Ae.createPreloadedFile,s.FS_unlink=Ae.unlink,s.FS_createLazyFile=Ae.createLazyFile,s.FS_createDevice=Ae.createDevice,Ue=s.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},function(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);qe=e}(),We=s.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},ut.prototype.isAliasOf=function(e){if(!(this instanceof ut))return!1;if(!(e instanceof ut))return!1;for(var t=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return t===n&&r===o},ut.prototype.clone=function(){if(this.$$.ptr||Ke(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=st(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},ut.prototype.delete=function(){this.$$.ptr||Ke(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ge("Object already scheduled for deletion"),Ze(this),Je(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},ut.prototype.isDeleted=function(){return!this.$$.ptr},ut.prototype.deleteLater=function(){return this.$$.ptr||Ke(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ge("Object already scheduled for deletion"),rt.push(this),1===rt.length&&ot&&ot(nt),this.$$.deleteScheduled=!0,this},s.getInheritedInstanceCount=function(){return Object.keys(it).length},s.getLiveInheritedInstances=function(){var e=[];for(var t in it)it.hasOwnProperty(t)&&e.push(it[t]);return e},s.flushPendingDeletes=nt,s.setDelayFunction=function(e){ot=e,rt.length&&ot&&ot(nt)},vt.prototype.getPointee=function(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},vt.prototype.destructor=function(e){this.rawDestructor&&this.rawDestructor(e)},vt.prototype.argPackAdvance=8,vt.prototype.readValueFromPointer=Re,vt.prototype.deleteObject=function(e){null!==e&&e.delete()},vt.prototype.fromWireType=function(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=function(e,t){return t=function(e,t){for(void 0===t&&Ge("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),it[t]}(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?at(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):at(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,a=this.registeredClass.getActualType(t),s=tt[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=et(t,this.registeredClass,i.registeredClass);return null===u?o.call(this):this.isSmartPointer?at(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:e}):at(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})},Ct=s.UnboundTypeError=(Dn=Error,(Bn=ct("UnboundTypeError",(function(e){this.name="UnboundTypeError",this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(Dn.prototype),Bn.prototype.constructor=Bn,Bn.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},Bn),Object.assign(At.prototype,{get(e){return this.allocated[e]},has(e){return void 0!==this.allocated[e]},allocate(e){var t=this.freelist.pop()||this.allocated.length;return this.allocated[t]=e,t},free(e){this.allocated[e]=void 0,this.freelist.push(e)}}),Ft.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),Ft.reserved=Ft.allocated.length,s.count_emval_handles=function(){for(var e=0,t=Ft.reserved;t<Ft.allocated.length;++t)void 0!==Ft.allocated[t]&&++e;return e},s.requestFullscreen=function(e,t){lr.requestFullscreen(e,t)},s.requestAnimationFrame=function(e){lr.requestAnimationFrame(e)},s.setCanvasSize=function(e,t,r){lr.setCanvasSize(e,t,r)},s.pauseMainLoop=function(){lr.mainLoop.pause()},s.resumeMainLoop=function(){lr.mainLoop.resume()},s.getUserMedia=function(){lr.getUserMedia()},s.createContext=function(e,t,r,n){return lr.createContext(e,t,r,n)};for(var $n,Nn={},Hn={},qn=0;qn<32;++qn)Dr.push(new Array(qn));var Vn=new Float32Array(288);for(qn=0;qn<288;++qn)bn[qn]=Vn.subarray(0,qn+1);var Wn=new Int32Array(288);for(qn=0;qn<288;++qn)wn[qn]=Wn.subarray(0,qn+1);var Gn,zn={Ha:function(e){var t=new pe(e);return t.get_caught()||t.set_caught(!0),t.set_rethrown(!1),de.push(t),so(t.excPtr),t.get_exception_ptr()},Ga:function(){ro(0,0);var e=de.pop();ao(e.excPtr),fe=0},o:()=>he([]),_:e=>he([e]),j:function(e,t,r){throw new pe(e).init(t,r),fe=e},M:function(e){throw fe||(fe=e),fe},ca:function(e,t,r){De.varargs=r;try{var n=De.getStreamFromFD(e);switch(t){case 0:return(o=De.get())<0?-28:Ae.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=De.get();return n.flags|=o,0;case 5:return o=De.get(),B[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return 28,R[Kn()>>2]=28,-1}}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},yb:function(e,t){try{var r=De.getStreamFromFD(e);return De.doStat(Ae.stat,r.path,t)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},Db:function(e,t,r){De.varargs=r;try{var n=De.getStreamFromFD(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),i=De.get();R[i>>2]=o.c_iflag||0,R[i+4>>2]=o.c_oflag||0,R[i+8>>2]=o.c_cflag||0,R[i+12>>2]=o.c_lflag||0;for(var a=0;a<32;a++)F[i+a+17>>0]=o.c_cc[a]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){i=De.get();var s=R[i>>2],u=R[i+4>>2],l=R[i+8>>2],c=R[i+12>>2],d=[];for(a=0;a<32;a++)d.push(F[i+a+17>>0]);return n.tty.ops.ioctl_tcsets(n.tty,t,{c_iflag:s,c_oflag:u,c_cflag:l,c_lflag:c,c_cc:d})}return 0;case 21519:return n.tty?(i=De.get(),R[i>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return i=De.get(),Ae.ioctl(n,t,i);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var f=n.tty.ops.ioctl_tiocgwinsz(n.tty);i=De.get(),B[i>>1]=f[0],B[i+2>>1]=f[1]}return 0;default:return-28}}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},vb:function(e,t){try{return e=De.getStr(e),De.doStat(Ae.lstat,e,t)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},wb:function(e,t,r,n){try{t=De.getStr(t);var o=256&n,i=4096&n;return n&=-6401,t=De.calculateAt(e,t,i),De.doStat(o?Ae.lstat:Ae.stat,t,r)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},qa:function(e,t,r,n){De.varargs=n;try{t=De.getStr(t),t=De.calculateAt(e,t);var o=n?De.get():0;return Ae.open(t,r,o).fd}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},xb:function(e,t){try{return e=De.getStr(e),De.doStat(Ae.stat,e,t)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},ua:function(e){var t=Be[e];delete Be[e];var r=t.elements,n=r.length,o=r.map((function(e){return e.getterReturnType})).concat(r.map((function(e){return e.setterArgumentType}))),i=t.rawConstructor,a=t.rawDestructor;$e([e],o,(function(e){return r.forEach(((t,r)=>{var o=e[r],i=t.getter,a=t.getterContext,s=e[r+n],u=t.setter,l=t.setterContext;t.read=e=>o.fromWireType(i(a,e)),t.write=(e,t)=>{var r=[];u(l,e,s.toWireType(r,t)),Le(r)}})),[{name:t.name,fromWireType:function(e){for(var t=new Array(n),o=0;o<n;++o)t[o]=r[o].read(e);return a(e),t},toWireType:function(e,o){if(n!==o.length)throw new TypeError(`Incorrect number of tuple elements for ${t.name}: expected=${n}, actual=${o.length}`);for(var s=i(),u=0;u<n;++u)r[u].write(s,o[u]);return null!==e&&e.push(a,s),s},argPackAdvance:8,readValueFromPointer:Re,destructorFunction:a}]}))},y:function(e){var t=Ne[e];delete Ne[e];var r=t.rawConstructor,n=t.rawDestructor,o=t.fields;$e([e],o.map((e=>e.getterReturnType)).concat(o.map((e=>e.setterArgumentType))),(e=>{var i={};return o.forEach(((t,r)=>{var n=t.fieldName,a=e[r],s=t.getter,u=t.getterContext,l=e[r+o.length],c=t.setter,d=t.setterContext;i[n]={read:e=>a.fromWireType(s(u,e)),write:(e,t)=>{var r=[];c(d,e,l.toWireType(r,t)),Le(r)}}})),[{name:t.name,fromWireType:function(e){var t={};for(var r in i)t[r]=i[r].read(e);return n(e),t},toWireType:function(e,t){for(var o in i)if(!(o in t))throw new TypeError(`Missing field: "${o}"`);var a=r();for(o in i)i[o].write(a,t[o]);return null!==e&&e.push(n,a),a},argPackAdvance:8,readValueFromPointer:Re,destructorFunction:n}]}))},ya:function(e,t,r,n,o){t=Ve(t);var i=Xe(r),a=-1!=t.indexOf("u");a&&(o=(1n<<64n)-1n),ze(e,{name:t,fromWireType:function(e){return e},toWireType:function(e,r){if("bigint"!=typeof r&&"number"!=typeof r)throw new TypeError(`Cannot convert "${He(r)}" to ${this.name}`);if(r<n||r>o)throw new TypeError(`Passing a number "${He(r)}" from JS side to C/C++ side to an argument of type "${t}", which is outside the valid range [${n}, ${o}]!`);return r},argPackAdvance:8,readValueFromPointer:Ye(t,i,!a),destructorFunction:null})},je:function(e,t,r,n,o){var i=Xe(r);ze(e,{name:t=Ve(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:o},argPackAdvance:8,readValueFromPointer:function(e){var n;if(1===r)n=F;else if(2===r)n=B;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+t);n=R}return this.fromWireType(n[e>>i])},destructorFunction:null})},v:function(e,t,r,n,o,i,a,s,u,l,c,d,f){c=Ve(c),i=_t(o,i),s&&(s=_t(a,s)),l&&(l=_t(u,l)),f=_t(d,f);var p=lt(c);ft(p,(function(){kt(`Cannot construct ${c} due to unbound types`,[n])})),$e([e,t,r],n?[n]:[],(function(t){var r,o;t=t[0],o=n?(r=t.registeredClass).instancePrototype:ut.prototype;var a=ct(p,(function(){if(Object.getPrototypeOf(this)!==u)throw new We("Use 'new' to construct "+c);if(void 0===d.constructor_body)throw new We(c+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new We(`Tried to invoke ctor of ${c} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return e.apply(this,arguments)})),u=Object.create(o,{constructor:{value:a}});a.prototype=u;var d=new pt(c,a,u,f,r,i,s,l);d.baseClass&&(void 0===d.baseClass.__derivedClasses&&(d.baseClass.__derivedClasses=[]),d.baseClass.__derivedClasses.push(d));var h=new vt(c,d,!0,!1,!1),m=new vt(c+"*",d,!1,!1,!1),g=new vt(c+" const*",d,!1,!0,!1);return tt[e]={pointerType:m,constPointerType:g},bt(p,a),[h,m,g]}))},w:function(e,t,r,n,o,i){var a=xt(t,r);o=_t(n,o),$e([],[e],(function(e){var r=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new We(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{kt(`Cannot construct ${e.name} due to unbound types`,a)},$e([],a,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Tt(r,n,null,o,i),[]})),[]}))},d:function(e,t,r,n,o,i,a,s,u){var l=xt(r,n);t=Ve(t),i=_t(o,i),$e([],[e],(function(e){var n=`${(e=e[0]).name}.${t}`;function o(){kt(`Cannot call ${n} due to unbound types`,l)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var c=e.registeredClass.instancePrototype,d=c[t];return void 0===d||void 0===d.overloadTable&&d.className!==e.name&&d.argCount===r-2?(o.argCount=r-2,o.className=e.name,c[t]=o):(dt(c,t,n),c[t].overloadTable[r-2]=o),$e([],l,(function(o){var s=Tt(n,o,e,i,a,u);return void 0===c[t].overloadTable?(s.argCount=r-2,c[t]=s):c[t].overloadTable[r-2]=s,[]})),[]}))},ie:function(e,t){ze(e,{name:t=Ve(t),fromWireType:function(e){var t=Bt.toValue(e);return Dt(e),t},toWireType:function(e,t){return Bt.toHandle(t)},argPackAdvance:8,readValueFromPointer:Re,destructorFunction:null})},V:function(e,t,r,n){var o=Xe(r);function i(){}t=Ve(t),i.values={},ze(e,{name:t,constructor:i,fromWireType:function(e){return this.constructor.values[e]},toWireType:function(e,t){return t.value},argPackAdvance:8,readValueFromPointer:Lt(t,o,n),destructorFunction:null}),ft(t,i)},A:function(e,t,r){var n=Rt(e,"enum");t=Ve(t);var o=n.constructor,i=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:ct(`${n.name}_${t}`,(function(){}))}});o.values[r]=i,o[t]=i},xa:function(e,t,r){var n=Xe(r);ze(e,{name:t=Ve(t),fromWireType:function(e){return e},toWireType:function(e,t){return t},argPackAdvance:8,readValueFromPointer:Mt(t,n),destructorFunction:null})},L:function(e,t,r,n,o,i,a){var s=xt(t,r);e=Ve(e),o=_t(n,o),ft(e,(function(){kt(`Cannot call ${e} due to unbound types`,s)}),t-1),$e([],s,(function(r){var n=[r[0],null].concat(r.slice(1));return bt(e,Tt(e,n,null,o,i,a),t-1),[]}))},Q:function(e,t,r,n,o){t=Ve(t),-1===o&&(o=4294967295);var i=Xe(r),a=e=>e;if(0===n){var s=32-8*r;a=e=>e<<s>>>s}var u=t.includes("unsigned");ze(e,{name:t,fromWireType:a,toWireType:u?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:8,readValueFromPointer:Ye(t,i,0!==n),destructorFunction:null})},D:function(e,t,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];function o(e){var t=M,r=t[e>>=2],o=t[e+1];return new n(t.buffer,o,r)}ze(e,{name:r=Ve(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Ge:function(e,t,r,n,o,i,a,s,u,l,c,d){r=Ve(r),i=_t(o,i),s=_t(a,s),l=_t(u,l),d=_t(c,d),$e([e],[t],(function(e){return e=e[0],[new vt(r,e.registeredClass,!1,!1,!0,e,n,i,s,l,d)]}))},wa:function(e,t){var r="std::string"===(t=Ve(t));ze(e,{name:t,fromWireType:function(e){var t,n=M[e>>2],o=e+4;if(r)for(var i=o,a=0;a<=n;++a){var s=o+a;if(a==n||0==D[s]){var u=Fe(i,s-i);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),i=s+1}}else{var l=new Array(n);for(a=0;a<n;++a)l[a]=String.fromCharCode(D[o+a]);t=l.join("")}return Xn(e),t},toWireType:function(e,t){var n;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var o="string"==typeof t;o||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||Ge("Cannot pass non-string to std::string"),n=r&&o?Ee(t):t.length;var i=Yn(4+n+1),a=i+4;if(M[i>>2]=n,r&&o)Ot(t,a,n+1);else if(o)for(var s=0;s<n;++s){var u=t.charCodeAt(s);u>255&&(Xn(a),Ge("String has UTF-16 code units that do not fit in 8 bits")),D[a+s]=u}else for(s=0;s<n;++s)D[a+s]=t[s];return null!==e&&e.push(Xn,i),i},argPackAdvance:8,readValueFromPointer:Re,destructorFunction:function(e){Xn(e)}})},ea:function(e,t,r){var n,o,i,a,s;r=Ve(r),2===t?(n=Ut,o=jt,a=$t,i=()=>L,s=1):4===t&&(n=Nt,o=Ht,a=qt,i=()=>M,s=2),ze(e,{name:r,fromWireType:function(e){for(var r,o=M[e>>2],a=i(),u=e+4,l=0;l<=o;++l){var c=e+4+l*t;if(l==o||0==a[c>>s]){var d=n(u,c-u);void 0===r?r=d:(r+=String.fromCharCode(0),r+=d),u=c+t}}return Xn(e),r},toWireType:function(e,n){"string"!=typeof n&&Ge(`Cannot pass non-string to C++ string type ${r}`);var i=a(n),u=Yn(4+i+t);return M[u>>2]=i>>s,o(n,u+4,i+t),null!==e&&e.push(Xn,u),u},argPackAdvance:8,readValueFromPointer:Re,destructorFunction:function(e){Xn(e)}})},va:function(e,t,r,n,o,i){Be[e]={name:Ve(t),rawConstructor:_t(r,n),rawDestructor:_t(o,i),elements:[]}},P:function(e,t,r,n,o,i,a,s,u){Be[e].elements.push({getterReturnType:t,getter:_t(r,n),getterContext:o,setterArgumentType:i,setter:_t(a,s),setterContext:u})},z:function(e,t,r,n,o,i){Ne[e]={name:Ve(t),rawConstructor:_t(r,n),rawDestructor:_t(o,i),fields:[]}},n:function(e,t,r,n,o,i,a,s,u,l){Ne[e].fields.push({fieldName:Ve(t),getterReturnType:r,getter:_t(n,o),getterContext:i,setterArgumentType:a,setter:_t(s,u),setterContext:l})},ke:function(e,t){ze(e,{isVoid:!0,name:t=Ve(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})},Bb:()=>!0,hb:()=>{throw 1/0},k:function(e,t,r){e=Bt.toValue(e),t=Rt(t,"emval::as");var n=[],o=Bt.toHandle(n);return M[r>>2]=o,t.toWireType(n,e)},u:function(e,t,r,n){e=Bt.toValue(e);for(var o=Vt(t,r),i=new Array(t),a=0;a<t;++a){var s=o[a];i[a]=s.readValueFromPointer(n),n+=s.argPackAdvance}var u=e.apply(void 0,i);return Bt.toHandle(u)},X:function(e,t,r,n,o){return(e=zt[e])(t=Bt.toValue(t),r=Gt(r),function(e){var t=[];return M[e>>2]=Bt.toHandle(t),t}(n),o)},R:function(e,t,r,n){(e=zt[e])(t=Bt.toValue(t),r=Gt(r),null,n)},c:Dt,de:function(e,t){return(e=Bt.toValue(e))==Bt.toValue(t)},G:function(e){return 0===e?Bt.toHandle(Yt()):(e=Gt(e),Bt.toHandle(Yt()[e]))},J:function(e,t){var r=Vt(e,t),n=r[0],o=n.name+"_$"+r.slice(1).map((function(e){return e.name})).join("_")+"$",i=Xt[o];if(void 0!==i)return i;for(var a=["retType"],s=[n],u="",l=0;l<e-1;++l)u+=(0!==l?", ":"")+"arg"+l,a.push("argType"+l),s.push(r[1+l]);var c,d,f="return function "+lt("methodCaller_"+o)+"(handle, name, destructors, args) {\n",p=0;for(l=0;l<e-1;++l)f+=" var arg"+l+" = argType"+l+".readValueFromPointer(args"+(p?"+"+p:"")+");\n",p+=r[l+1].argPackAdvance;for(f+=" var rv = handle[name]("+u+");\n",l=0;l<e-1;++l)r[l+1].deleteObject&&(f+=" argType"+l+".deleteObject(arg"+l+");\n");return n.isVoid||(f+=" return retType.toWireType(destructors, rv);\n"),f+="};\n",a.push(f),c=Pt(Function,a).apply(null,s),d=zt.length,zt.push(c),i=d,Xt[o]=i,i},h:function(e,t){return e=Bt.toValue(e),t=Bt.toValue(t),Bt.toHandle(e[t])},e:function(e){e>4&&(Ft.get(e).refcount+=1)},ha:function(e,t){return(e=Bt.toValue(e))instanceof Bt.toValue(t)},da:function(e){return"number"==typeof(e=Bt.toValue(e))},N:function(e){return"string"==typeof(e=Bt.toValue(e))},ze:function(e,t,r,n){e=Bt.toValue(e);var o=Kt[t];return o||(o=function(e){for(var t="",r=0;r<e;++r)t+=(0!==r?", ":"")+"arg"+r;var n="return function emval_allocator_"+e+"(constructor, argTypes, args) {\n var HEAPU32 = getMemory();\n";for(r=0;r<e;++r)n+="var argType"+r+" = requireRegisteredType(HEAPU32[((argTypes)>>2)], 'parameter "+r+"');\nvar arg"+r+" = argType"+r+".readValueFromPointer(args);\nargs += argType"+r+"['argPackAdvance'];\nargTypes += 4;\n";return n+="var obj = new constructor("+t+");\nreturn valueToHandle(obj);\n}\n",new Function("requireRegisteredType","Module","valueToHandle","getMemory",n)(Rt,s,Bt.toHandle,(()=>M))}(t),Kt[t]=o),o(e,r,n)},K:function(){return Bt.toHandle([])},g:function(e){return Bt.toHandle(Gt(e))},C:function(){return Bt.toHandle({})},i:function(e){Le(Bt.toValue(e)),Dt(e)},m:function(e,t,r){e=Bt.toValue(e),t=Bt.toValue(t),r=Bt.toValue(r),e[t]=r},f:function(e,t){var r=(e=Rt(e,"_emval_take_value")).readValueFromPointer(t);return Bt.toHandle(r)},se:function(e){throw Bt.toValue(e)},Oc:function(e){return e=Bt.toValue(e),Bt.toHandle(typeof e)},pb:function(e,t){e=Qt(e),t=Qt(t);var r=new Date(1e3*e);R[t>>2]=r.getUTCSeconds(),R[t+4>>2]=r.getUTCMinutes(),R[t+8>>2]=r.getUTCHours(),R[t+12>>2]=r.getUTCDate(),R[t+16>>2]=r.getUTCMonth(),R[t+20>>2]=r.getUTCFullYear()-1900,R[t+24>>2]=r.getUTCDay();var n=Date.UTC(r.getUTCFullYear(),0,1,0,0,0,0),o=(r.getTime()-n)/864e5|0;R[t+28>>2]=o},qb:function(e,t){e=Qt(e),t=Qt(t);var r=new Date(1e3*e);R[t>>2]=r.getSeconds(),R[t+4>>2]=r.getMinutes(),R[t+8>>2]=r.getHours(),R[t+12>>2]=r.getDate(),R[t+16>>2]=r.getMonth(),R[t+20>>2]=r.getFullYear()-1900,R[t+24>>2]=r.getDay();var n=0|rr(r);R[t+28>>2]=n,R[t+36>>2]=-60*r.getTimezoneOffset();var o=new Date(r.getFullYear(),0,1),i=new Date(r.getFullYear(),6,1).getTimezoneOffset(),a=o.getTimezoneOffset(),s=0|(i!=a&&r.getTimezoneOffset()==Math.min(a,i));R[t+32>>2]=s},rb:function(e){e=Qt(e);var t=(()=>{var t=new Date(R[e+20>>2]+1900,R[e+16>>2],R[e+12>>2],R[e+8>>2],R[e+4>>2],R[e>>2],0),r=R[e+32>>2],n=t.getTimezoneOffset(),o=new Date(t.getFullYear(),0,1),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=o.getTimezoneOffset(),s=Math.min(a,i);if(r<0)R[e+32>>2]=Number(i!=a&&s==n);else if(r>0!=(s==n)){var u=Math.max(a,i),l=r>0?s:u;t.setTime(t.getTime()+6e4*(l-n))}R[e+24>>2]=t.getDay();var c=0|rr(t);return R[e+28>>2]=c,R[e>>2]=t.getSeconds(),R[e+4>>2]=t.getMinutes(),R[e+8>>2]=t.getHours(),R[e+12>>2]=t.getDate(),R[e+16>>2]=t.getMonth(),R[e+20>>2]=t.getYear(),t.getTime()/1e3})();return BigInt(t)},mb:function(e,t,r,n,o,i,a){e=Qt(e),o=Qt(o),i=Qt(i),a=Qt(a);try{if(isNaN(o))return 61;var s=De.getStreamFromFD(n),u=Ae.mmap(s,e,o,t,r),l=u.ptr;return R[i>>2]=u.allocated,M[a>>2]=l,0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},nb:function(e,t,r,n,o,i){e=Qt(e),t=Qt(t),i=Qt(i);try{if(isNaN(i))return 61;var a=De.getStreamFromFD(o);2&r&&De.doMsync(e,a,t,n,i),Ae.munmap(a)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},ib:(e,t,r)=>{var n=(new Date).getFullYear(),o=new Date(n,0,1),i=new Date(n,6,1),a=o.getTimezoneOffset(),s=i.getTimezoneOffset(),u=Math.max(a,s);function l(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}M[e>>2]=60*u,R[t>>2]=Number(a!=s);var c=l(o),d=l(i),f=nr(c),p=nr(d);s<a?(M[r>>2]=f,M[r+4>>2]=p):(M[r>>2]=p,M[r+4>>2]=f)},b:()=>{ne("")},oa:function(e,t,r,n,o){return cr.chooseConfig(e,t,r,n,o)},pa:function(e,t,r,n){if(62e3!=e)return cr.setErrorCode(12296),0;for(var o=1;;){var i=R[n>>2];if(12440!=i){if(12344==i)break;return cr.setErrorCode(12292),0}o=R[n+4>>2],n+=8}return o<2||o>3?(cr.setErrorCode(12293),0):(cr.contextAttributes.majorVersion=o-1,cr.contextAttributes.minorVersion=0,cr.context=yr.createContext(s.canvas,cr.contextAttributes),0!=cr.context?(cr.setErrorCode(12288),yr.makeContextCurrent(cr.context),s.useWebGL=!0,lr.moduleContextCreatedCallbacks.forEach((function(e){e()})),yr.makeContextCurrent(null),62004):(cr.setErrorCode(12297),0))},$a:function(e,t,r,n){return 62e3!=e?(cr.setErrorCode(12296),0):62002!=t?(cr.setErrorCode(12293),0):(cr.setErrorCode(12288),62006)},ic:function(e,t){return 62e3!=e?(cr.setErrorCode(12296),0):62004!=t?(cr.setErrorCode(12294),0):(yr.deleteContext(cr.context),cr.setErrorCode(12288),cr.currentContext==t&&(cr.currentContext=0),1)},Zb:function(e,t){return 62e3!=e?(cr.setErrorCode(12296),0):62006!=t?(cr.setErrorCode(12301),1):(cr.currentReadSurface==t&&(cr.currentReadSurface=0),cr.currentDrawSurface==t&&(cr.currentDrawSurface=0),cr.setErrorCode(12288),1)},T:function(e,t,r,n){if(62e3!=e)return cr.setErrorCode(12296),0;if(62002!=t)return cr.setErrorCode(12293),0;if(!n)return cr.setErrorCode(12300),0;switch(cr.setErrorCode(12288),r){case 12320:return R[n>>2]=cr.contextAttributes.alpha?32:24,1;case 12321:return R[n>>2]=cr.contextAttributes.alpha?8:0,1;case 12322:case 12323:case 12324:return R[n>>2]=8,1;case 12325:return R[n>>2]=cr.contextAttributes.depth?24:0,1;case 12326:return R[n>>2]=cr.contextAttributes.stencil?8:0,1;case 12327:case 12335:case 12340:return R[n>>2]=12344,1;case 12328:return R[n>>2]=62002,1;case 12329:case 12333:case 12334:case 12345:case 12346:case 12347:case 12349:case 12350:case 12354:return R[n>>2]=0,1;case 12330:case 12332:return R[n>>2]=4096,1;case 12331:return R[n>>2]=16777216,1;case 12337:return R[n>>2]=cr.contextAttributes.antialias?4:0,1;case 12338:return R[n>>2]=cr.contextAttributes.antialias?1:0,1;case 12339:case 12352:return R[n>>2]=4,1;case 12341:case 12342:case 12343:return R[n>>2]=-1,1;case 12348:return R[n>>2]=1,1;case 12351:return R[n>>2]=12430,1;default:return cr.setErrorCode(12292),0}},ob:function(e){return cr.setErrorCode(12288),62e3},ta:function(){return cr.errorCode},eb:function(e,t,r){return 62e3!=e?(cr.setErrorCode(12296),0):(t&&(R[t>>2]=1),r&&(R[r>>2]=4),cr.defaultDisplayInitialized=!0,cr.setErrorCode(12288),1)},zb:function(e,t,r,n){return 62e3!=e?(cr.setErrorCode(12296),0):0!=n&&62004!=n?(cr.setErrorCode(12294),0):0!=r&&62006!=r||0!=t&&62006!=t?(cr.setErrorCode(12301),0):(yr.makeContextCurrent(n?cr.context:null),cr.currentContext=n,cr.currentDrawSurface=t,cr.currentReadSurface=r,cr.setErrorCode(12288),1)},tc:function(e,t){if(cr.defaultDisplayInitialized)if(s.ctx){if(!s.ctx.isContextLost())return cr.setErrorCode(12288),1;cr.setErrorCode(12302)}else cr.setErrorCode(12290);else cr.setErrorCode(12289);return 0},Ob:function(e){return 62e3!=e?(cr.setErrorCode(12296),0):(cr.currentContext=0,cr.currentReadSurface=0,cr.currentDrawSurface=0,cr.defaultDisplayInitialized=!1,cr.setErrorCode(12288),1)},I:(e,t,r)=>((e,t,r)=>{var n=((e,t)=>{var r;for(vr.length=0,t>>=2;r=D[e++];)t+=105!=r&t,vr.push(105==r?R[t]:(106==r?I:j)[t++>>1]),++t;return vr})(t,r);return ue[e].apply(null,n)})(e,t,r),we:e=>{console.error(Fe(e))},xe:e=>{console.log(Fe(e))},ga:e=>{console.warn(Fe(e))},aa:function(){return Date.now()},me:function(){},jb:()=>2147483648,Ab:Zt,Wf:function(e){$n.activeTexture(e)},Xf:function(e,t){$n.attachShader(yr.programs[e],yr.shaders[t])},Yc:function(e,t){$n.beginQuery(e,yr.queries[t])},ee:function(e,t){$n.disjointTimerQueryExt.beginQueryEXT(e,yr.queries[t])},Kc:function(e){$n.beginTransformFeedback(e)},Yf:function(e,t,r){$n.bindAttribLocation(yr.programs[e],t,Fe(r))},Zf:function(e,t){35051==e?$n.currentPixelPackBufferBinding=t:35052==e&&($n.currentPixelUnpackBufferBinding=t),$n.bindBuffer(e,yr.buffers[t])},Hc:function(e,t,r){$n.bindBufferBase(e,t,yr.buffers[r])},Ic:function(e,t,r,n,o){$n.bindBufferRange(e,t,yr.buffers[r],n,o)},Ye:function(e,t){$n.bindFramebuffer(e,yr.framebuffers[t])},Ze:function(e,t){$n.bindRenderbuffer(e,yr.renderbuffers[t])},Ie:function(e,t){$n.bindSampler(e,yr.samplers[t])},_f:function(e,t){$n.bindTexture(e,yr.textures[t])},Vb:function(e,t){$n.bindTransformFeedback(e,yr.transformFeedbacks[t])},sf:wr,vf:Er,$f:function(e,t,r,n){$n.blendColor(e,t,r,n)},ag:function(e){$n.blendEquation(e)},Sd:function(e,t){$n.blendEquationSeparate(e,t)},bg:function(e,t){$n.blendFunc(e,t)},Rd:function(e,t,r,n){$n.blendFuncSeparate(e,t,r,n)},Se:function(e,t,r,n,o,i,a,s,u,l){$n.blitFramebuffer(e,t,r,n,o,i,a,s,u,l)},cg:function(e,t,r,n){yr.currentContext.version>=2?r&&t?$n.bufferData(e,D,n,r,t):$n.bufferData(e,t,n):$n.bufferData(e,r?D.subarray(r,r+t):t,n)},dg:function(e,t,r,n){yr.currentContext.version>=2?r&&$n.bufferSubData(e,t,D,n,r):$n.bufferSubData(e,t,D.subarray(n,n+r))},_e:function(e){return $n.checkFramebufferStatus(e)},eg:function(e){$n.clear(e)},kc:function(e,t,r,n){$n.clearBufferfi(e,t,r,n)},lc:function(e,t,r){$n.clearBufferfv(e,t,O,r>>2)},nc:function(e,t,r){$n.clearBufferiv(e,t,R,r>>2)},mc:function(e,t,r){$n.clearBufferuiv(e,t,M,r>>2)},fg:function(e,t,r,n){$n.clearColor(e,t,r,n)},Qd:function(e){$n.clearDepth(e)},gg:function(e){$n.clearStencil(e)},Da:function(e,t,r){return r=Number(r),$n.clientWaitSync(yr.syncs[e],t,r)},hg:function(e,t,r,n){$n.colorMask(!!e,!!t,!!r,!!n)},ig:function(e){$n.compileShader(yr.shaders[e])},jg:function(e,t,r,n,o,i,a,s){yr.currentContext.version>=2?$n.currentPixelUnpackBufferBinding||!a?$n.compressedTexImage2D(e,t,r,n,o,i,a,s):$n.compressedTexImage2D(e,t,r,n,o,i,D,s,a):$n.compressedTexImage2D(e,t,r,n,o,i,s?D.subarray(s,s+a):null)},bd:function(e,t,r,n,o,i,a,s,u){$n.currentPixelUnpackBufferBinding?$n.compressedTexImage3D(e,t,r,n,o,i,a,s,u):$n.compressedTexImage3D(e,t,r,n,o,i,a,D,u,s)},kg:function(e,t,r,n,o,i,a,s,u){yr.currentContext.version>=2?$n.currentPixelUnpackBufferBinding||!s?$n.compressedTexSubImage2D(e,t,r,n,o,i,a,s,u):$n.compressedTexSubImage2D(e,t,r,n,o,i,a,D,u,s):$n.compressedTexSubImage2D(e,t,r,n,o,i,a,u?D.subarray(u,u+s):null)},ad:function(e,t,r,n,o,i,a,s,u,l,c){$n.currentPixelUnpackBufferBinding?$n.compressedTexSubImage3D(e,t,r,n,o,i,a,s,u,l,c):$n.compressedTexSubImage3D(e,t,r,n,o,i,a,s,u,D,c,l)},Qe:function(e,t,r,n,o){$n.copyBufferSubData(e,t,r,n,o)},Pd:function(e,t,r,n,o,i,a,s){$n.copyTexImage2D(e,t,r,n,o,i,a,s)},lg:function(e,t,r,n,o,i,a,s){$n.copyTexSubImage2D(e,t,r,n,o,i,a,s)},cd:function(e,t,r,n,o,i,a,s,u){$n.copyTexSubImage3D(e,t,r,n,o,i,a,s,u)},mg:function(){var e=yr.getNewId(yr.programs),t=$n.createProgram();return t.name=e,t.maxUniformLength=t.maxAttributeLength=t.maxUniformBlockNameLength=0,t.uniformIdCounter=1,yr.programs[e]=t,e},ng:function(e){var t=yr.getNewId(yr.shaders);return yr.shaders[t]=$n.createShader(e),t},og:function(e){$n.cullFace(e)},pg:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.buffers[n];o&&($n.deleteBuffer(o),o.name=0,yr.buffers[n]=null,n==$n.currentPixelPackBufferBinding&&($n.currentPixelPackBufferBinding=0),n==$n.currentPixelUnpackBufferBinding&&($n.currentPixelUnpackBufferBinding=0))}},$e:function(e,t){for(var r=0;r<e;++r){var n=R[t+4*r>>2],o=yr.framebuffers[n];o&&($n.deleteFramebuffer(o),o.name=0,yr.framebuffers[n]=null)}},qg:function(e){if(e){var t=yr.programs[e];t?($n.deleteProgram(t),t.name=0,yr.programs[e]=null):yr.recordError(1281)}},_c:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.queries[n];o&&($n.deleteQuery(o),yr.queries[n]=null)}},ge:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.queries[n];o&&($n.disjointTimerQueryExt.deleteQueryEXT(o),yr.queries[n]=null)}},af:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.renderbuffers[n];o&&($n.deleteRenderbuffer(o),o.name=0,yr.renderbuffers[n]=null)}},Je:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.samplers[n];o&&($n.deleteSampler(o),o.name=0,yr.samplers[n]=null)}},rg:function(e){if(e){var t=yr.shaders[e];t?($n.deleteShader(t),yr.shaders[e]=null):yr.recordError(1281)}},Re:function(e){if(e){var t=yr.syncs[e];t?($n.deleteSync(t),t.name=0,yr.syncs[e]=null):yr.recordError(1281)}},sg:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.textures[n];o&&($n.deleteTexture(o),o.name=0,yr.textures[n]=null)}},Ub:function(e,t){for(var r=0;r<e;r++){var n=R[t+4*r>>2],o=yr.transformFeedbacks[n];o&&($n.deleteTransformFeedback(o),o.name=0,yr.transformFeedbacks[n]=null)}},tf:Cr,wf:Sr,Od:function(e){$n.depthFunc(e)},tg:function(e){$n.depthMask(!!e)},Nd:function(e,t){$n.depthRange(e,t)},Md:function(e,t){$n.detachShader(yr.programs[e],yr.shaders[t])},ug:function(e){$n.disable(e)},vg:function(e){$n.disableVertexAttribArray(e)},wg:function(e,t,r){$n.drawArrays(e,t,r)},qf:xr,Vd:Pr,Gb:Tr,of:function(e,t,r,n,o){$n.dibvbi.drawArraysInstancedBaseInstanceWEBGL(e,t,r,n,o)},hd:Ar,Hb:Fr,mf:Lr,fd:Rr,Wd:Mr,xg:Ir,rf:jr,Ud:$r,Eb:Nr,pf:function(e,t,r,n,o,i,a){$n.dibvbi.drawElementsInstancedBaseVertexBaseInstanceWEBGL(e,t,r,n,o,i,a)},Fb:Hr,gd:qr,ff:function(e,t,r,n,o,i){Or(e,n,o,i)},yg:function(e){$n.enable(e)},zg:function(e){$n.enableVertexAttribArray(e)},Xc:function(e){$n.endQuery(e)},ce:function(e){$n.disjointTimerQueryExt.endQueryEXT(e)},Jc:function(){$n.endTransformFeedback()},Oe:function(e,t){var r=$n.fenceSync(e,t);if(r){var n=yr.getNewId(yr.syncs);return r.name=n,yr.syncs[n]=r,n}return 0},Ag:function(){$n.finish()},Bg:function(){$n.flush()},bf:function(e,t,r,n){$n.framebufferRenderbuffer(e,t,r,yr.renderbuffers[n])},cf:function(e,t,r,n,o){$n.framebufferTexture2D(e,t,r,yr.textures[n],o)},Nc:function(e,t,r,n,o){$n.framebufferTextureLayer(e,t,yr.textures[r],n,o)},Cg:function(e){$n.frontFace(e)},Dg:function(e,t){Vr(e,t,"createBuffer",yr.buffers)},df:function(e,t){Vr(e,t,"createFramebuffer",yr.framebuffers)},$c:function(e,t){Vr(e,t,"createQuery",yr.queries)},he:function(e,t){for(var r=0;r<e;r++){var n=$n.disjointTimerQueryExt.createQueryEXT();if(!n){for(yr.recordError(1282);r<e;)R[t+4*r++>>2]=0;return}var o=yr.getNewId(yr.queries);n.name=o,yr.queries[o]=n,R[t+4*r>>2]=o}},ef:function(e,t){Vr(e,t,"createRenderbuffer",yr.renderbuffers)},Ke:function(e,t){Vr(e,t,"createSampler",yr.samplers)},Eg:function(e,t){Vr(e,t,"createTexture",yr.textures)},Tb:function(e,t){Vr(e,t,"createTransformFeedback",yr.transformFeedbacks)},uf:Gr,xf:zr,Ue:function(e){$n.generateMipmap(e)},Ld:function(e,t,r,n,o,i,a){Yr("getActiveAttrib",e,t,r,n,o,i,a)},Kd:function(e,t,r,n,o,i,a){Yr("getActiveUniform",e,t,r,n,o,i,a)},ec:function(e,t,r,n,o){e=yr.programs[e];var i=$n.getActiveUniformBlockName(e,t);if(i)if(o&&r>0){var a=Ot(i,o,r);n&&(R[n>>2]=a)}else n&&(R[n>>2]=0)},fc:function(e,t,r,n){if(n)if(e=yr.programs[e],35393!=r){var o=$n.getActiveUniformBlockParameter(e,t,r);if(null!==o)if(35395==r)for(var i=0;i<o.length;i++)R[n+4*i>>2]=o[i];else R[n>>2]=o}else{var a=$n.getActiveUniformBlockName(e,t);R[n>>2]=a.length+1}else yr.recordError(1281)},hc:function(e,t,r,n,o){if(o)if(t>0&&0==r)yr.recordError(1281);else{e=yr.programs[e];for(var i=[],a=0;a<t;a++)i.push(R[r+4*a>>2]);var s=$n.getActiveUniforms(e,i,n);if(s){var u=s.length;for(a=0;a<u;a++)R[o+4*a>>2]=s[a]}}else yr.recordError(1281)},Jd:function(e,t,r,n){var o=$n.getAttachedShaders(yr.programs[e]),i=o.length;i>t&&(i=t),R[r>>2]=i;for(var a=0;a<i;++a){var s=yr.shaders.indexOf(o[a]);R[n+4*a>>2]=s}},Id:function(e,t){return $n.getAttribLocation(yr.programs[e],Fe(t))},Hd:function(e,t){Kr(e,t,4)},$b:function(e,t,r){r?Xr(r,$n.getBufferParameter(e,t)):yr.recordError(1281)},Fg:function(e,t,r){r?R[r>>2]=$n.getBufferParameter(e,t):yr.recordError(1281)},Gg:function(){var e=$n.getError()||yr.lastError;return yr.lastError=0,e},Hg:function(e,t){Kr(e,t,2)},xc:function(e,t){return $n.getFragDataLocation(yr.programs[e],Fe(t))},Ve:function(e,t,r,n){var o=$n.getFramebufferAttachmentParameter(e,t,r);(o instanceof WebGLRenderbuffer||o instanceof WebGLTexture)&&(o=0|o.name),R[n>>2]=o},ac:function(e,t,r){Qr(e,t,r,1)},cc:function(e,t){Kr(e,t,1)},Lc:function(e,t,r){Qr(e,t,r,0)},gh:function(e,t){Kr(e,t,0)},Kb:function(e,t,r,n,o){if(n<0)yr.recordError(1281);else if(o){var i=$n.getInternalformatParameter(e,t,r);if(null!==i)for(var a=0;a<i.length&&a<n;++a)R[o+4*a>>2]=i[a]}else yr.recordError(1281)},Pb:function(e,t,r,n,o){yr.recordError(1282)},Ig:function(e,t,r,n){var o=$n.getProgramInfoLog(yr.programs[e]);null===o&&(o="(unknown error)");var i=t>0&&n?Ot(o,n,t):0;r&&(R[r>>2]=i)},Jg:function(e,t,r){if(r)if(e>=yr.counter)yr.recordError(1281);else if(e=yr.programs[e],35716==t){var n=$n.getProgramInfoLog(e);null===n&&(n="(unknown error)"),R[r>>2]=n.length+1}else if(35719==t){if(!e.maxUniformLength)for(var o=0;o<$n.getProgramParameter(e,35718);++o)e.maxUniformLength=Math.max(e.maxUniformLength,$n.getActiveUniform(e,o).name.length+1);R[r>>2]=e.maxUniformLength}else if(35722==t){if(!e.maxAttributeLength)for(o=0;o<$n.getProgramParameter(e,35721);++o)e.maxAttributeLength=Math.max(e.maxAttributeLength,$n.getActiveAttrib(e,o).name.length+1);R[r>>2]=e.maxAttributeLength}else if(35381==t){if(!e.maxUniformBlockNameLength)for(o=0;o<$n.getProgramParameter(e,35382);++o)e.maxUniformBlockNameLength=Math.max(e.maxUniformBlockNameLength,$n.getActiveUniformBlockName(e,o).length+1);R[r>>2]=e.maxUniformBlockNameLength}else R[r>>2]=$n.getProgramParameter(e,t);else yr.recordError(1281)},Zd:Jr,$d:tn,Yd:rn,Vc:function(e,t,r){if(r){var n,o=yr.queries[e],i=$n.getQueryParameter(o,t);n="boolean"==typeof i?i?1:0:i,R[r>>2]=n}else yr.recordError(1281)},_d:nn,Wc:function(e,t,r){r?R[r>>2]=$n.getQuery(e,t):yr.recordError(1281)},ae:function(e,t,r){r?R[r>>2]=$n.disjointTimerQueryExt.getQueryEXT(e,t):yr.recordError(1281)},We:function(e,t,r){r?R[r>>2]=$n.getRenderbufferParameter(e,t):yr.recordError(1281)},Wb:function(e,t,r){r?O[r>>2]=$n.getSamplerParameter(yr.samplers[e],t):yr.recordError(1281)},Xb:function(e,t,r){r?R[r>>2]=$n.getSamplerParameter(yr.samplers[e],t):yr.recordError(1281)},Kg:function(e,t,r,n){var o=$n.getShaderInfoLog(yr.shaders[e]);null===o&&(o="(unknown error)");var i=t>0&&n?Ot(o,n,t):0;r&&(R[r>>2]=i)},Ee:function(e,t,r,n){var o=$n.getShaderPrecisionFormat(e,t);R[r>>2]=o.rangeMin,R[r+4>>2]=o.rangeMax,R[n>>2]=o.precision},Gd:function(e,t,r,n){var o=$n.getShaderSource(yr.shaders[e]);if(o){var i=t>0&&n?Ot(o,n,t):0;r&&(R[r>>2]=i)}},Lg:function(e,t,r){if(r)if(35716==t){var n=$n.getShaderInfoLog(yr.shaders[e]);null===n&&(n="(unknown error)");var o=n?n.length+1:0;R[r>>2]=o}else if(35720==t){var i=$n.getShaderSource(yr.shaders[e]),a=i?i.length+1:0;R[r>>2]=a}else R[r>>2]=$n.getShaderParameter(yr.shaders[e],t);else yr.recordError(1281)},Ca:function(e){var t=yr.stringCache[e];if(!t){switch(e){case 7939:var r=$n.getSupportedExtensions()||[];r=r.concat(r.map((function(e){return"GL_"+e}))),t=nr(r.join(" "));break;case 7936:case 7937:case 37445:case 37446:var n=$n.getParameter(e);n||yr.recordError(1280),t=n&&nr(n);break;case 7938:var o=$n.getParameter(7938);o=yr.currentContext.version>=2?"OpenGL ES 3.0 ("+o+")":"OpenGL ES 2.0 ("+o+")",t=nr(o);break;case 35724:var i=$n.getParameter(35724),a=i.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==a&&(3==a[1].length&&(a[1]=a[1]+"0"),i="OpenGL ES GLSL ES "+a[1]+" ("+i+")"),t=nr(i);break;default:yr.recordError(1280)}yr.stringCache[e]=t}return t},hh:function(e,t){if(yr.currentContext.version<2)return yr.recordError(1282),0;var r=yr.stringiCache[e];if(r)return t<0||t>=r.length?(yr.recordError(1281),0):r[t];if(7939===e){var n=$n.getSupportedExtensions()||[];return n=(n=n.concat(n.map((function(e){return"GL_"+e})))).map((function(e){return nr(e)})),r=yr.stringiCache[e]=n,t<0||t>=r.length?(yr.recordError(1281),0):r[t]}return yr.recordError(1280),0},bc:function(e,t,r,n,o){if(r<0)yr.recordError(1281);else if(o){var i=$n.getSyncParameter(yr.syncs[e],t);null!==i&&(R[o>>2]=i,n&&(R[n>>2]=1))}else yr.recordError(1281)},Fd:function(e,t,r){r?O[r>>2]=$n.getTexParameter(e,t):yr.recordError(1281)},Ed:function(e,t,r){r?R[r>>2]=$n.getTexParameter(e,t):yr.recordError(1281)},Fc:function(e,t,r,n,o,i,a){e=yr.programs[e];var s=$n.getTransformFeedbackVarying(e,t);if(s){if(a&&r>0){var u=Ot(s.name,a,r);n&&(R[n>>2]=u)}else n&&(R[n>>2]=0);o&&(R[o>>2]=s.size),i&&(R[i>>2]=s.type)}},gc:function(e,t){return $n.getUniformBlockIndex(yr.programs[e],Fe(t))},jc:function(e,t,r,n){if(n)if(t>0&&(0==r||0==n))yr.recordError(1281);else{e=yr.programs[e];for(var o=[],i=0;i<t;i++)o.push(Fe(R[r+4*i>>2]));var a=$n.getUniformIndices(e,o);if(a){var s=a.length;for(i=0;i<s;i++)R[n+4*i>>2]=a[i]}}else yr.recordError(1281)},Mg:function(e,t){if(t=Fe(t),e=yr.programs[e]){an(e);var r=e.uniformLocsById,n=0,o=t,i=on(t);i>0&&(s=t.slice(i+1),n=parseInt(s)>>>0,o=t.slice(0,i));var a=e.uniformSizeAndIdsByName[o];if(a&&n<a[0]&&(r[n+=a[1]]=r[n]||$n.getUniformLocation(e,t)))return n}else yr.recordError(1281);var s;return-1},Dd:function(e,t,r){un(e,t,r,2)},Cd:function(e,t,r){un(e,t,r,0)},yc:function(e,t,r){un(e,t,r,0)},Ec:dn,Dc:fn,zd:function(e,t,r){r?R[r>>2]=$n.getVertexAttribOffset(e,t):yr.recordError(1281)},Bd:function(e,t,r){ln(e,t,r,2)},Ad:function(e,t,r){ln(e,t,r,5)},yd:function(e,t){$n.hint(e,t)},Fe:function(e,t,r){for(var n=Dr[t],o=0;o<t;o++)n[o]=R[r+4*o>>2];$n.invalidateFramebuffer(e,n)},He:function(e,t,r,n,o,i,a){for(var s=Dr[t],u=0;u<t;u++)s[u]=R[r+4*u>>2];$n.invalidateSubFramebuffer(e,s,n,o,i,a)},xd:function(e){var t=yr.buffers[e];return t?$n.isBuffer(t):0},wd:function(e){return $n.isEnabled(e)},vd:function(e){var t=yr.framebuffers[e];return t?$n.isFramebuffer(t):0},ud:function(e){return(e=yr.programs[e])?$n.isProgram(e):0},Zc:function(e){var t=yr.queries[e];return t?$n.isQuery(t):0},fe:function(e){var t=yr.queries[e];return t?$n.disjointTimerQueryExt.isQueryEXT(t):0},td:function(e){var t=yr.renderbuffers[e];return t?$n.isRenderbuffer(t):0},_b:function(e){var t=yr.samplers[e];return t?$n.isSampler(t):0},sd:function(e){var t=yr.shaders[e];return t?$n.isShader(t):0},Pe:function(e){return $n.isSync(yr.syncs[e])},Ng:function(e){var t=yr.textures[e];return t?$n.isTexture(t):0},Sb:function(e){return $n.isTransformFeedback(yr.transformFeedbacks[e])},Mc:hn,Xd:mn,Og:function(e){$n.lineWidth(e)},Pg:function(e){e=yr.programs[e],$n.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},kf:function(e,t,r,n,o,i){$n.mdibvbi.multiDrawArraysInstancedBaseInstanceWEBGL(e,R,t>>2,R,r>>2,R,n>>2,M,o>>2,i)},lf:function(e,t,r,n,o,i,a,s){$n.mdibvbi.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(e,R,t>>2,r,R,n>>2,R,o>>2,R,i>>2,M,a>>2,s)},Rb:function(){$n.pauseTransformFeedback()},Qg:function(e,t){3317==e&&(yr.unpackAlignment=t),$n.pixelStorei(e,t)},rd:function(e,t){$n.polygonOffset(e,t)},Nb:function(e,t,r,n){yr.recordError(1280)},Mb:function(e,t,r){yr.recordError(1280)},be:function(e,t){$n.disjointTimerQueryExt.queryCounterEXT(yr.queries[e],t)},nf:function(e){$n.readBuffer(e)},Rg:function(e,t,r,n,o,i,a){if(yr.currentContext.version>=2)if($n.currentPixelPackBufferBinding)$n.readPixels(e,t,r,n,o,i,a);else{var s=gn(i);$n.readPixels(e,t,r,n,o,i,s,a>>yn(s))}else{var u=vn(i,o,r,n,a);u?$n.readPixels(e,t,r,n,o,i,u):yr.recordError(1280)}},qd:function(){},Xe:function(e,t,r,n){$n.renderbufferStorage(e,t,r,n)},Te:function(e,t,r,n,o){$n.renderbufferStorageMultisample(e,t,r,n,o)},Qb:function(){$n.resumeTransformFeedback()},pd:function(e,t){$n.sampleCoverage(e,!!t)},Le:function(e,t,r){$n.samplerParameterf(yr.samplers[e],t,r)},Yb:function(e,t,r){var n=O[r>>2];$n.samplerParameterf(yr.samplers[e],t,n)},Me:function(e,t,r){$n.samplerParameteri(yr.samplers[e],t,r)},Ne:function(e,t,r){var n=R[r>>2];$n.samplerParameteri(yr.samplers[e],t,n)},Sg:function(e,t,r,n){$n.scissor(e,t,r,n)},od:function(e,t,r,n,o){yr.recordError(1280)},Tg:function(e,t,r,n){var o=yr.getSource(e,t,r,n);if(yr.currentContext.version>=2&&o.includes("#version 100")){var i="";(o=(o=o.replace(/#extension GL_OES_standard_derivatives : enable/g,"")).replace(/#extension GL_EXT_shader_texture_lod : enable/g,"")).includes("gl_FragColor")&&(i+="out mediump vec4 GL_FragColor;\n",o=o.replace(/gl_FragColor/g,"GL_FragColor")),o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=o.includes("attribute")?(o=o.replace(/attribute/g,"in")).replace(/varying/g,"out"):o.replace(/varying/g,"in")).replace(/textureCubeLodEXT/g,"textureCubeLod")).replace(/texture2DLodEXT/g,"texture2DLod")).replace(/texture2DProjLodEXT/g,"texture2DProjLod")).replace(/texture2DGradEXT/g,"texture2DGrad")).replace(/texture2DProjGradEXT/g,"texture2DProjGrad")).replace(/textureCubeGradEXT/g,"textureCubeGrad")).replace(/textureCube/g,"texture")).replace(/texture1D/g,"texture")).replace(/texture2D/g,"texture")).replace(/texture3D/g,"texture")).replace(/#version 100/g,"#version 300 es\n"+i)}$n.shaderSource(yr.shaders[e],o)},Ug:function(e,t,r){$n.stencilFunc(e,t,r)},Vg:function(e,t,r,n){$n.stencilFuncSeparate(e,t,r,n)},Wg:function(e){$n.stencilMask(e)},Xg:function(e,t){$n.stencilMaskSeparate(e,t)},Yg:function(e,t,r){$n.stencilOp(e,t,r)},Zg:function(e,t,r,n){$n.stencilOpSeparate(e,t,r,n)},_g:function(e,t,r,n,o,i,a,s,u){if(yr.currentContext.version>=2&&(6402==a&&6402==r&&5125==s&&(r=33190),36193==s&&(s=5131,6408==a&&6408==r&&(r=34842)),34041==r&&(r=35056)),yr.currentContext.version>=2)if($n.currentPixelUnpackBufferBinding)$n.texImage2D(e,t,r,n,o,i,a,s,u);else if(u){var l=gn(s);$n.texImage2D(e,t,r,n,o,i,a,s,l,u>>yn(l))}else $n.texImage2D(e,t,r,n,o,i,a,s,null);else $n.texImage2D(e,t,r,n,o,i,a,s,u?vn(s,a,n,o,u):null)},ed:function(e,t,r,n,o,i,a,s,u,l){if($n.currentPixelUnpackBufferBinding)$n.texImage3D(e,t,r,n,o,i,a,s,u,l);else if(l){var c=gn(u);$n.texImage3D(e,t,r,n,o,i,a,s,u,c,l>>yn(c))}else $n.texImage3D(e,t,r,n,o,i,a,s,u,null)},$g:function(e,t,r){$n.texParameterf(e,t,r)},ah:function(e,t,r){var n=O[r>>2];$n.texParameterf(e,t,n)},bh:function(e,t,r){$n.texParameteri(e,t,r)},ch:function(e,t,r){var n=R[r>>2];$n.texParameteri(e,t,n)},gf:function(e,t,r,n,o){$n.texStorage2D(e,t,r,n,o)},Lb:function(e,t,r,n,o,i){$n.texStorage3D(e,t,r,n,o,i)},dh:function(e,t,r,n,o,i,a,s,u){if(yr.currentContext.version>=2&&36193==s&&(s=5131),yr.currentContext.version>=2)if($n.currentPixelUnpackBufferBinding)$n.texSubImage2D(e,t,r,n,o,i,a,s,u);else if(u){var l=gn(s);$n.texSubImage2D(e,t,r,n,o,i,a,s,l,u>>yn(l))}else $n.texSubImage2D(e,t,r,n,o,i,a,s,null);else{var c=null;u&&(c=vn(s,a,o,i,u)),$n.texSubImage2D(e,t,r,n,o,i,a,s,c)}},dd:function(e,t,r,n,o,i,a,s,u,l,c){if($n.currentPixelUnpackBufferBinding)$n.texSubImage3D(e,t,r,n,o,i,a,s,u,l,c);else if(c){var d=gn(l);$n.texSubImage3D(e,t,r,n,o,i,a,s,u,l,d,c>>yn(d))}else $n.texSubImage3D(e,t,r,n,o,i,a,s,u,l,null)},Gc:function(e,t,r,n){e=yr.programs[e];for(var o=[],i=0;i<t;i++)o.push(Fe(R[r+4*i>>2]));$n.transformFeedbackVaryings(e,o,n)},eh:function(e,t){$n.uniform1f(sn(e),t)},fh:function(e,t,r){if(yr.currentContext.version>=2)t&&$n.uniform1fv(sn(e),O,r>>2,t);else{if(t<=288)for(var n=bn[t-1],o=0;o<t;++o)n[o]=O[r+4*o>>2];else n=O.subarray(r>>2,r+4*t>>2);$n.uniform1fv(sn(e),n)}},Sf:function(e,t){$n.uniform1i(sn(e),t)},Tf:function(e,t,r){if(yr.currentContext.version>=2)t&&$n.uniform1iv(sn(e),R,r>>2,t);else{if(t<=288)for(var n=wn[t-1],o=0;o<t;++o)n[o]=R[r+4*o>>2];else n=R.subarray(r>>2,r+4*t>>2);$n.uniform1iv(sn(e),n)}},wc:function(e,t){$n.uniform1ui(sn(e),t)},rc:function(e,t,r){t&&$n.uniform1uiv(sn(e),M,r>>2,t)},Uf:function(e,t,r){$n.uniform2f(sn(e),t,r)},Vf:function(e,t,r){if(yr.currentContext.version>=2)t&&$n.uniform2fv(sn(e),O,r>>2,2*t);else{if(t<=144)for(var n=bn[2*t-1],o=0;o<2*t;o+=2)n[o]=O[r+4*o>>2],n[o+1]=O[r+(4*o+4)>>2];else n=O.subarray(r>>2,r+8*t>>2);$n.uniform2fv(sn(e),n)}},Rf:function(e,t,r){$n.uniform2i(sn(e),t,r)},Qf:function(e,t,r){if(yr.currentContext.version>=2)t&&$n.uniform2iv(sn(e),R,r>>2,2*t);else{if(t<=144)for(var n=wn[2*t-1],o=0;o<2*t;o+=2)n[o]=R[r+4*o>>2],n[o+1]=R[r+(4*o+4)>>2];else n=R.subarray(r>>2,r+8*t>>2);$n.uniform2iv(sn(e),n)}},vc:function(e,t,r){$n.uniform2ui(sn(e),t,r)},qc:function(e,t,r){t&&$n.uniform2uiv(sn(e),M,r>>2,2*t)},Pf:function(e,t,r,n){$n.uniform3f(sn(e),t,r,n)},Of:function(e,t,r){if(yr.currentContext.version>=2)t&&$n.uniform3fv(sn(e),O,r>>2,3*t);else{if(t<=96)for(var n=bn[3*t-1],o=0;o<3*t;o+=3)n[o]=O[r+4*o>>2],n[o+1]=O[r+(4*o+4)>>2],n[o+2]=O[r+(4*o+8)>>2];else n=O.subarray(r>>2,r+12*t>>2);$n.uniform3fv(sn(e),n)}},Nf:function(e,t,r,n){$n.uniform3i(sn(e),t,r,n)},Mf:function(e,t,r){if(yr.currentContext.version>=2)t&&$n.uniform3iv(sn(e),R,r>>2,3*t);else{if(t<=96)for(var n=wn[3*t-1],o=0;o<3*t;o+=3)n[o]=R[r+4*o>>2],n[o+1]=R[r+(4*o+4)>>2],n[o+2]=R[r+(4*o+8)>>2];else n=R.subarray(r>>2,r+12*t>>2);$n.uniform3iv(sn(e),n)}},uc:function(e,t,r,n){$n.uniform3ui(sn(e),t,r,n)},pc:function(e,t,r){t&&$n.uniform3uiv(sn(e),M,r>>2,3*t)},Lf:function(e,t,r,n,o){$n.uniform4f(sn(e),t,r,n,o)},Kf:function(e,t,r){if(yr.currentContext.version>=2)t&&$n.uniform4fv(sn(e),O,r>>2,4*t);else{if(t<=72){var n=bn[4*t-1],o=O;r>>=2;for(var i=0;i<4*t;i+=4){var a=r+i;n[i]=o[a],n[i+1]=o[a+1],n[i+2]=o[a+2],n[i+3]=o[a+3]}}else n=O.subarray(r>>2,r+16*t>>2);$n.uniform4fv(sn(e),n)}},yf:function(e,t,r,n,o){$n.uniform4i(sn(e),t,r,n,o)},zf:function(e,t,r){if(yr.currentContext.version>=2)t&&$n.uniform4iv(sn(e),R,r>>2,4*t);else{if(t<=72)for(var n=wn[4*t-1],o=0;o<4*t;o+=4)n[o]=R[r+4*o>>2],n[o+1]=R[r+(4*o+4)>>2],n[o+2]=R[r+(4*o+8)>>2],n[o+3]=R[r+(4*o+12)>>2];else n=R.subarray(r>>2,r+16*t>>2);$n.uniform4iv(sn(e),n)}},sc:function(e,t,r,n,o){$n.uniform4ui(sn(e),t,r,n,o)},oc:function(e,t,r){t&&$n.uniform4uiv(sn(e),M,r>>2,4*t)},dc:function(e,t,r){e=yr.programs[e],$n.uniformBlockBinding(e,t,r)},Af:function(e,t,r,n){if(yr.currentContext.version>=2)t&&$n.uniformMatrix2fv(sn(e),!!r,O,n>>2,4*t);else{if(t<=72)for(var o=bn[4*t-1],i=0;i<4*t;i+=4)o[i]=O[n+4*i>>2],o[i+1]=O[n+(4*i+4)>>2],o[i+2]=O[n+(4*i+8)>>2],o[i+3]=O[n+(4*i+12)>>2];else o=O.subarray(n>>2,n+16*t>>2);$n.uniformMatrix2fv(sn(e),!!r,o)}},Uc:function(e,t,r,n){t&&$n.uniformMatrix2x3fv(sn(e),!!r,O,n>>2,6*t)},Sc:function(e,t,r,n){t&&$n.uniformMatrix2x4fv(sn(e),!!r,O,n>>2,8*t)},Bf:function(e,t,r,n){if(yr.currentContext.version>=2)t&&$n.uniformMatrix3fv(sn(e),!!r,O,n>>2,9*t);else{if(t<=32)for(var o=bn[9*t-1],i=0;i<9*t;i+=9)o[i]=O[n+4*i>>2],o[i+1]=O[n+(4*i+4)>>2],o[i+2]=O[n+(4*i+8)>>2],o[i+3]=O[n+(4*i+12)>>2],o[i+4]=O[n+(4*i+16)>>2],o[i+5]=O[n+(4*i+20)>>2],o[i+6]=O[n+(4*i+24)>>2],o[i+7]=O[n+(4*i+28)>>2],o[i+8]=O[n+(4*i+32)>>2];else o=O.subarray(n>>2,n+36*t>>2);$n.uniformMatrix3fv(sn(e),!!r,o)}},Tc:function(e,t,r,n){t&&$n.uniformMatrix3x2fv(sn(e),!!r,O,n>>2,6*t)},Qc:function(e,t,r,n){t&&$n.uniformMatrix3x4fv(sn(e),!!r,O,n>>2,12*t)},Cf:function(e,t,r,n){if(yr.currentContext.version>=2)t&&$n.uniformMatrix4fv(sn(e),!!r,O,n>>2,16*t);else{if(t<=18){var o=bn[16*t-1],i=O;n>>=2;for(var a=0;a<16*t;a+=16){var s=n+a;o[a]=i[s],o[a+1]=i[s+1],o[a+2]=i[s+2],o[a+3]=i[s+3],o[a+4]=i[s+4],o[a+5]=i[s+5],o[a+6]=i[s+6],o[a+7]=i[s+7],o[a+8]=i[s+8],o[a+9]=i[s+9],o[a+10]=i[s+10],o[a+11]=i[s+11],o[a+12]=i[s+12],o[a+13]=i[s+13],o[a+14]=i[s+14],o[a+15]=i[s+15]}}else o=O.subarray(n>>2,n+64*t>>2);$n.uniformMatrix4fv(sn(e),!!r,o)}},Rc:function(e,t,r,n){t&&$n.uniformMatrix4x2fv(sn(e),!!r,O,n>>2,8*t)},Pc:function(e,t,r,n){t&&$n.uniformMatrix4x3fv(sn(e),!!r,O,n>>2,12*t)},Df:function(e){e=yr.programs[e],$n.useProgram(e),$n.currentProgram=e},nd:function(e){$n.validateProgram(yr.programs[e])},Ef:function(e,t){$n.vertexAttrib1f(e,t)},md:function(e,t){$n.vertexAttrib1f(e,O[t>>2])},ld:function(e,t,r){$n.vertexAttrib2f(e,t,r)},Ff:function(e,t){$n.vertexAttrib2f(e,O[t>>2],O[t+4>>2])},kd:function(e,t,r,n){$n.vertexAttrib3f(e,t,r,n)},Gf:function(e,t){$n.vertexAttrib3f(e,O[t>>2],O[t+4>>2],O[t+8>>2])},jd:function(e,t,r,n,o){$n.vertexAttrib4f(e,t,r,n,o)},Hf:function(e,t){$n.vertexAttrib4f(e,O[t>>2],O[t+4>>2],O[t+8>>2],O[t+12>>2])},hf:_n,Td:Cn,Ib:Sn,id:kn,Jb:xn,Cc:function(e,t,r,n,o){$n.vertexAttribI4i(e,t,r,n,o)},Ac:function(e,t){$n.vertexAttribI4i(e,R[t>>2],R[t+4>>2],R[t+8>>2],R[t+12>>2])},Bc:function(e,t,r,n,o){$n.vertexAttribI4ui(e,t,r,n,o)},zc:function(e,t){$n.vertexAttribI4ui(e,M[t>>2],M[t+4>>2],M[t+8>>2],M[t+12>>2])},jf:function(e,t,r,n,o){$n.vertexAttribIPointer(e,t,r,n,o)},If:function(e,t,r,n,o,i){$n.vertexAttribPointer(e,t,r,!!n,o,i)},Jf:function(e,t,r,n){$n.viewport(e,t,r,n)},Ea:function(e,t,r){r=Number(r),$n.waitSync(yr.syncs[e],t,r)},Cb:(e,t,r)=>D.copyWithin(e,t,t+r),kb:e=>{var t=D.length,r=2147483648;if((e>>>=0)>r)return!1;for(var n,o=1;o<=4;o*=2){var i=t*(1+.2/o);i=Math.min(i,e+100663296);var a=Math.min(r,(n=Math.max(e,i))+(65536-n%65536)%65536);if(Pn(a))return!0}return!1},Va:function(e,t,r,n,o,i,a,u,l){const c=s.UTF8ToString(e,e+t),d=s.HEAPU8.subarray(o,o+i),f=s.emscripten_ubq_codec_audioDecoderNextHandle++,p={codec:c,sampleRate:r,numberOfChannels:n,description:d};try{const e=s.emscripten_ubq_codec_createAudioDecoder(a,u,l);AudioDecoder.isConfigSupported(p).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(p),s.emscripten_ubq_codec_audioDecoders.set(f,{audioDecoder:e,decoderConfig:p,leftBufferPtr:a,rightBufferPtr:u,bufferLength:l})}catch(e){return s.emscripten_ubq_codec_createNativeResult({error:e})}return s.emscripten_ubq_codec_createNativeResult({handle:f})},Ma:function(e,t,r,n,o,i){const a=s.UTF8ToString(e,e+t),u=s.emscripten_ubq_codec_audioEncoderNextHandle++,l={codec:a,sampleRate:r,numberOfChannels:n,bitrate:o};try{const e=new AudioEncoder({output:e=>{const t=s._malloc(e.byteLength),r=s.HEAPU8.subarray(t,t+e.byteLength);e.copyTo(r),s.emscripten_ubq_codec_onOutputEncodedAudioChunk(u,t,e.byteLength,i),s._free(t)},error:e=>console.error(e)});e.configure(l),s.emscripten_ubq_codec_audioEncoders.set(u,{audioEncoder:e,audioEncoderConfig:l,frameIndex:0})}catch(e){return e+=' Requested codec: "'+a+'"',e+="; sample rate: "+r,e+="; channels: "+n,e+="; bit rate: "+o,s.emscripten_ubq_codec_createNativeResult({error:e})}return s.emscripten_ubq_codec_createNativeResult({handle:u})},_a:function(e,t,r,n,o,i,a){const u=s.UTF8ToString(e,e+t),l=s.HEAPU8.subarray(o,o+i),c=s.emscripten_ubq_codec_videoDecoderNextHandle++,d={codec:u,codedWidth:r,codedHeight:n,description:l,optimizeForLatency:!0};try{const e=s.emscripten_ubq_codec_createVideoDecoder(c,a);VideoDecoder.isConfigSupported(d).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(d),s.emscripten_ubq_codec_videoDecoders.set(c,{videoDecoder:e,decoderConfig:d,codecServicePtr:a})}catch(e){return s.emscripten_ubq_codec_createNativeResult({error:e})}return s.emscripten_ubq_codec_createNativeResult({handle:c})},Qa:function(e,t,r,n,o,i){const a=s.UTF8ToString(e,e+t),u=s.emscripten_ubq_codec_videoEncoderNextHandle++,l=s.specialHTMLTargets["!canvas"];l.width=r,l.height=n;const c={codec:a,width:r,height:n,avc:{format:"annexb"},framerate:o};try{const e=new VideoEncoder({output:e=>{const t=s._malloc(e.byteLength),r=s.HEAPU8.subarray(t,t+e.byteLength);e.copyTo(r),s.emscripten_ubq_codec_onOutputEncodedVideoChunk(u,t,e.byteLength,i),s._free(t)},error:e=>console.error(e)});VideoEncoder.isConfigSupported(c).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(c),s.emscripten_ubq_codec_videoEncoders.set(u,{videoEncoder:e,encoderConfig:c,groupOfPictures:150,frameIndex:0})}catch(e){return e+=' Requested codec: "'+a+'"',e+="; resolution: "+r+"x"+n,s.emscripten_ubq_codec_createNativeResult({error:e})}return s.emscripten_ubq_codec_createNativeResult({handle:u})},Ra:function(e,t,r,n,o,i){const a=s.emscripten_ubq_codec_audioDecoders.get(e);if(a.audioDecoder.unexpectedError)return s.emscripten_ubq_codec_createNativeResult({code:2,error:a.audioDecoder.unexpectedError});"closed"===a.audioDecoder.state&&(a.audioDecoder=s.emscripten_ubq_codec_createAudioDecoder(a.leftBufferPtr,a.rightBufferPtr,a.bufferLength),a.audioDecoder.configure(a.decoderConfig));const u=a.audioDecoder,l=s.HEAPU8.subarray(o,o+i),c=new EncodedAudioChunk({type:t?"key":"delta",timestamp:r,duration:n,data:l});try{u.decode(c)}catch(e){return u.configUnsupported?s.emscripten_ubq_codec_createNativeResult({code:2,error:e}):s.emscripten_ubq_codec_createNativeResult({code:1,error:e})}return s.emscripten_ubq_codec_createNativeResult({code:0})},Ia:function(e,t,r,n,o,i){const a=s.emscripten_ubq_codec_videoDecoders.get(e);if(a.videoDecoder.unexpectedError)return s.emscripten_ubq_codec_createNativeResult({code:2,error:a.videoDecoder.unexpectedError});if("closed"===a.videoDecoder.state){const t=a.videoDecoder.textures;return a.videoDecoder=s.emscripten_ubq_codec_createVideoDecoder(e,a.codecServicePtr),a.videoDecoder.textures=t,a.videoDecoder.configure(a.decoderConfig),s.emscripten_ubq_codec_createNativeResult({code:1,error:"VideoDecoder was closed"})}const u=a.videoDecoder,l=s.HEAPU8.subarray(o,o+i),c=new EncodedVideoChunk({type:t?"key":"delta",timestamp:r,duration:n,data:l});try{u.decode(c)}catch(e){return u.configUnsupported?s.emscripten_ubq_codec_createNativeResult({code:2,error:e}):s.emscripten_ubq_codec_createNativeResult({code:1,error:e})}return s.emscripten_ubq_codec_createNativeResult({code:0})},Ua:function(e){if(s.emscripten_ubq_codec_audioDecoders.has(e)){const t=s.emscripten_ubq_codec_audioDecoders.get(e);"closed"!==t.audioDecoder.state&&t.audioDecoder.close(),s.emscripten_ubq_codec_audioDecoders.delete(e)}},La:function(e){const t=s.emscripten_ubq_codec_audioEncoders.get(e);"closed"!==t.audioEncoder.state&&t.audioEncoder.close(),s.emscripten_ubq_codec_audioEncoders.delete(e)},Ya:function(e){if(s.emscripten_ubq_codec_videoDecoders.has(e)){const t=s.emscripten_ubq_codec_videoDecoders.get(e);"closed"!==t.videoDecoder.state&&t.videoDecoder.close(),s.emscripten_ubq_codec_videoDecoders.delete(e)}},Pa:function(e){const t=s.emscripten_ubq_codec_videoEncoders.get(e);"closed"!==t.videoEncoder.state&&t.videoEncoder.close(),s.emscripten_ubq_codec_videoEncoders.delete(e)},Ka:function(e,t,r){const n=1e6,o=s.emscripten_ubq_codec_audioEncoders.get(e),i=o.audioEncoderConfig.sampleRate,a=o.audioEncoderConfig.numberOfChannels,u=r/a,l=Math.round(n*(o.frameIndex*u/i)),c=Math.round(n*(u/i)),d=s.HEAPF32.subarray(t/4,t/4+r),f=new AudioData({format:"f32",sampleRate:i,numberOfFrames:u,numberOfChannels:a,duration:c,timestamp:l,data:d});o.audioEncoder.encode(f),o.frameIndex++,f.close()},Oa:function(e,t,r){const n=1e6,o=s.emscripten_ubq_codec_videoEncoders.get(e),i=Math.round(n*(o.frameIndex/o.encoderConfig.framerate)),a=o.frameIndex%o.groupOfPictures==0,u=Math.round(n/o.encoderConfig.framerate),l=s.specialHTMLTargets["!canvas"],c=new VideoFrame(l,{timestamp:i,duration:u});o.videoEncoder.encode(c,{keyFrame:a}),c.close(),o.frameIndex++},Ja:async function(e,t){const r=s.emscripten_ubq_codec_audioEncoders.get(e);await r.audioEncoder.flush(),s.emscripten_ubq_codec_onFinalizedAudioEncoding(e,t)},Na:async function(e,t){const r=s.emscripten_ubq_codec_videoEncoders.get(e);await r.videoEncoder.flush(),s.emscripten_ubq_codec_onFinalizedVideoEncoding(e,t)},Ta:async function(e,t){const r=s.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder;r.flushing=!0;try{await r.flush()}catch{}r.flushing=!1,r.writtenFrames=t},Y:async function(e,t,r){const n=s.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder;n.shouldDropFrames=r,n.flushing=!0;try{await n.flush()}catch{}n.flushing=!1,n.shouldDropFrames=!1,n.decodedFrames=t},ka:function(e){return s.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.decodeQueueSize},la:function(e){return s.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.decodedFrames},$:function(e){return s.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.writtenFrames},Sa:function(e){return s.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.flushing},Xa:function(e){return s.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.flushing},Z:function(){return"undefined"!=typeof VideoFrame&&"undefined"!=typeof VideoDecoder&&"undefined"!=typeof VideoEncoder&&"undefined"!=typeof AudioDecoder&&"undefined"!=typeof AudioEncoder},Wa:function(e,t){s.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.requestedFrame=t},Za:function(e,t,r){const n=s.emscripten_ubq_codec_videoDecoders.get(e),o=s.HEAPU32.subarray(t/4,t/4+r);n.videoDecoder.textures=[];for(let e=0;e<r;e++)n.videoDecoder.textures[e]=yr.textures[o[e]]},qe:function(e){const t=s.emscripten_ubq_asyncFetchManager.getProcess(e);return!!(null==t?void 0:t.allocate())},fa:function(e,t,r,n){return s.emscripten_ubq_asyncFetchManager.createHeader(e,t,r,n)},ue:function(e){s.emscripten_ubq_asyncFetchManager.deleteHeader(e)},ve:function(e,t,r,n,o,i,a,u,l){return s.emscripten_ubq_asyncFetchManager.fetch(e,t,r,n,o,i,a,u,l).handle},ne:function(e){return s.emscripten_ubq_asyncFetchManager.deleteProcess(e)},te:function(e){var t,r;return null!==(r=null===(t=s.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.receivedLength)&&void 0!==r?r:0},pe:function(e){const t=s.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultAddress:-1},oe:function(e){const t=s.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultLength:-1},za:function(e){var t,r;return null!==(r=null===(t=s.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.state)&&void 0!==r?r:-1},re:function(e){var t,r;return null!==(r=null===(t=s.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.totalBytes)&&void 0!==r?r:0},bb:function(){return!!s.emscripten_ubq_settings_forceWebGL1},na:function(e,t){var r=t>>2,n=R[r+6],o={alpha:!!R[r+0],depth:!!R[r+1],stencil:!!R[r+2],antialias:!!R[r+3],premultipliedAlpha:!!R[r+4],preserveDrawingBuffer:!!R[r+5],powerPreference:An[n],failIfMajorPerformanceCaveat:!!R[r+7],majorVersion:R[r+8],minorVersion:R[r+9],enableExtensionsByDefault:R[r+10],explicitSwapControl:R[r+11],proxyContextToMainThread:R[r+12],renderViaOffscreenBackBuffer:R[r+13]},i=function(e){return function(e){var t;return e=(t=e)>2?Fe(t):t,Fn[e]||("undefined"!=typeof document?document.querySelector(e):void 0)}(e)}(e);return i?o.explicitSwapControl?0:yr.createContext(i,o):0},ma:function(e){yr.currentContext==e&&(yr.currentContext=0),yr.deleteContext(e)},cb:function(e,t){var r=yr.getContext(e),n=Fe(t);return n.startsWith("GL_")&&(n=n.substr(3)),"ANGLE_instanced_arrays"==n&&dr($n),"OES_vertex_array_object"==n&&fr($n),"WEBGL_draw_buffers"==n&&pr($n),"WEBGL_draw_instanced_base_vertex_base_instance"==n&&hr($n),"WEBGL_multi_draw_instanced_base_vertex_base_instance"==n&&mr($n),"WEBGL_multi_draw"==n&&gr($n),!!r.GLctx.getExtension(n)},ab:function(e){for(var t=e>>2,r=0;r<14;++r)R[t+r]=0;R[t+0]=R[t+1]=R[t+3]=R[t+4]=R[t+8]=R[t+10]=1},db:function(e){return yr.makeContextCurrent(e)?0:-5},tb:(e,t)=>{var r=0;return Rn().forEach((function(n,o){var i=t+r;M[e+4*o>>2]=i,((e,t)=>{for(var r=0;r<e.length;++r)F[t++>>0]=e.charCodeAt(r);F[t>>0]=0})(n,i),r+=n.length+1})),0},ub:(e,t)=>{var r=Rn();M[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),M[t>>2]=n,0},ye:ar,ba:function(e){try{var t=De.getStreamFromFD(e);return Ae.close(t),0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},lb:function(e,t,r,n,o){t=Qt(t),r=Qt(r),n=Qt(n),o=Qt(o);try{if(isNaN(n))return 61;var i=De.getStreamFromFD(e),a=Mn(i,t,r,n);return M[o>>2]=a,0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},sa:function(e,t,r,n){try{var o=De.getStreamFromFD(e),i=Mn(o,t,r);return M[n>>2]=i,0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},sb:function(e,t,r,n){t=Qt(t),n=Qt(n);try{if(isNaN(t))return 61;var o=De.getStreamFromFD(e);return Ae.llseek(o,t,r),I[n>>3]=BigInt(o.position),o.getdents&&0===t&&0===r&&(o.getdents=null),0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},ra:function(e,t,r,n){try{var o=((e,t,r,n)=>{for(var o=0,i=0;i<r;i++){var a=M[t>>2],s=M[t+4>>2];t+=8;var u=Ae.write(e,F,a,s,n);if(u<0)return-1;o+=u,void 0!==n&&(n+=u)}return o})(De.getStreamFromFD(e),t,r);return M[n>>2]=o,0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},le:function(){return"undefined"!=typeof window?nr(window.location.hostname):nr("")},fb:(e,t)=>(ge(D.subarray(e,e+t)),0),x:function(e,t,r){var n=no();try{return Et(e)(t,r)}catch(e){if(oo(n),e!==e+0)throw e;ro(1,0)}},O:function(e,t){var r=no();try{return Et(e)(t)}catch(e){if(oo(r),e!==e+0)throw e;ro(1,0)}},H:function(e,t,r){var n=no();try{return Et(e)(t,r)}catch(e){if(oo(n),e!==e+0)throw e;ro(1,0)}},l:function(e,t,r,n){var o=no();try{return Et(e)(t,r,n)}catch(e){if(oo(o),e!==e+0)throw e;ro(1,0)}},Fa:function(e){var t=no();try{return Et(e)()}catch(e){if(oo(t),e!==e+0)throw e;ro(1,0)}},ia:function(e,t,r){var n=no();try{return Et(e)(t,r)}catch(e){if(oo(n),e!==e+0)throw e;ro(1,0)}},r:function(e,t){var r=no();try{return Et(e)(t)}catch(e){if(oo(r),e!==e+0)throw e;ro(1,0)}},W:function(e,t,r,n,o,i,a,s,u,l,c,d,f,p,h,m){var g=no();try{return Et(e)(t,r,n,o,i,a,s,u,l,c,d,f,p,h,m)}catch(e){if(oo(g),e!==e+0)throw e;ro(1,0)}},q:function(e,t,r){var n=no();try{return Et(e)(t,r)}catch(e){if(oo(n),e!==e+0)throw e;ro(1,0)}},s:function(e,t,r,n){var o=no();try{return Et(e)(t,r,n)}catch(e){if(oo(o),e!==e+0)throw e;ro(1,0)}},U:function(e,t,r,n,o){var i=no();try{return Et(e)(t,r,n,o)}catch(e){if(oo(i),e!==e+0)throw e;ro(1,0)}},De:function(e,t,r,n,o,i){var a=no();try{return Et(e)(t,r,n,o,i)}catch(e){if(oo(a),e!==e+0)throw e;ro(1,0)}},Ba:function(e,t,r,n,o,i,a){var s=no();try{return Et(e)(t,r,n,o,i,a)}catch(e){if(oo(s),e!==e+0)throw e;ro(1,0)}},Aa:function(e,t,r,n,o,i,a,s,u,l){var c=no();try{return Et(e)(t,r,n,o,i,a,s,u,l)}catch(e){if(oo(c),e!==e+0)throw e;ro(1,0)}},S:function(e){var t=no();try{Et(e)()}catch(e){if(oo(t),e!==e+0)throw e;ro(1,0)}},t:function(e,t){var r=no();try{Et(e)(t)}catch(e){if(oo(r),e!==e+0)throw e;ro(1,0)}},B:function(e,t,r,n){var o=no();try{Et(e)(t,r,n)}catch(e){if(oo(o),e!==e+0)throw e;ro(1,0)}},F:function(e,t,r){var n=no();try{Et(e)(t,r)}catch(e){if(oo(n),e!==e+0)throw e;ro(1,0)}},p:function(e,t,r,n){var o=no();try{Et(e)(t,r,n)}catch(e){if(oo(o),e!==e+0)throw e;ro(1,0)}},E:function(e,t,r,n,o){var i=no();try{Et(e)(t,r,n,o)}catch(e){if(oo(i),e!==e+0)throw e;ro(1,0)}},Ce:function(e,t,r,n,o,i){var a=no();try{Et(e)(t,r,n,o,i)}catch(e){if(oo(a),e!==e+0)throw e;ro(1,0)}},Ae:function(e,t,r,n,o,i,a){var s=no();try{Et(e)(t,r,n,o,i,a)}catch(e){if(oo(s),e!==e+0)throw e;ro(1,0)}},ih:function(e,t,r,n,o,i,a,s){var u=no();try{Et(e)(t,r,n,o,i,a,s)}catch(e){if(oo(u),e!==e+0)throw e;ro(1,0)}},Be:function(e,t,r,n,o,i,a,s,u,l){var c=no();try{Et(e)(t,r,n,o,i,a,s,u,l)}catch(e){if(oo(c),e!==e+0)throw e;ro(1,0)}},ja:function(e,t){const r=Bt.toValue(t),n=s.ctx;n.bindTexture(n.TEXTURE_2D,yr.textures[e]),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r)},a:x,gb:(e,t,r,n,o)=>((e,t,r,n)=>{var o=R[n+40>>2],i={tm_sec:R[n>>2],tm_min:R[n+4>>2],tm_hour:R[n+8>>2],tm_mday:R[n+12>>2],tm_mon:R[n+16>>2],tm_year:R[n+20>>2],tm_wday:R[n+24>>2],tm_yday:R[n+28>>2],tm_isdst:R[n+32>>2],tm_gmtoff:R[n+36>>2],tm_zone:o?Fe(o):""},a=Fe(r),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)a=a.replace(new RegExp(u,"g"),s[u]);var l=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],c=["January","February","March","April","May","June","July","August","September","October","November","December"];function d(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length<t;)n=r[0]+n;return n}function f(e,t){return d(e,t,"0")}function p(e,t){function r(e){return e<0?-1:e>0?1:0}var n;return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.getDate())),n}function h(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function m(e){var t=((e,t)=>{for(var r=new Date(e.getTime());t>0;){var n=Jt(r.getFullYear()),o=r.getMonth(),i=(n?On:In)[o];if(!(t>i-r.getDate()))return r.setDate(r.getDate()+t),r;t-=i-r.getDate()+1,r.setDate(1),o<11?r.setMonth(o+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r})(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),o=h(r),i=h(n);return p(o,t)<=0?p(i,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var g={"%a":e=>l[e.tm_wday].substring(0,3),"%A":e=>l[e.tm_wday],"%b":e=>c[e.tm_mon].substring(0,3),"%B":e=>c[e.tm_mon],"%C":e=>f((e.tm_year+1900)/100|0,2),"%d":e=>f(e.tm_mday,2),"%e":e=>d(e.tm_mday,2," "),"%g":e=>m(e).toString().substring(2),"%G":e=>m(e),"%H":e=>f(e.tm_hour,2),"%I":e=>{var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),f(t,2)},"%j":e=>f(e.tm_mday+((e,t)=>{for(var r=0,n=0;n<=t;r+=e[n++]);return r})(Jt(e.tm_year+1900)?On:In,e.tm_mon-1),3),"%m":e=>f(e.tm_mon+1,2),"%M":e=>f(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>f(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var t=e.tm_yday+7-e.tm_wday;return f(Math.floor(t/7),2)},"%V":e=>{var t=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&t++,t){if(53==t){var r=(e.tm_wday+371-e.tm_yday)%7;4==r||3==r&&Jt(e.tm_year)||(t=1)}}else{t=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&Jt(e.tm_year%400-1))&&t++}return f(t,2)},"%w":e=>e.tm_wday,"%W":e=>{var t=e.tm_yday+7-(e.tm_wday+6)%7;return f(Math.floor(t/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var t=e.tm_gmtoff,r=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+String("0000"+t).slice(-4)},"%Z":e=>e.tm_zone,"%%":()=>"%"};for(var u in a=a.replace(/%%/g,"\0\0"),g)a.includes(u)&&(a=a.replace(new RegExp(u,"g"),g[u](i)));var y=Ce(a=a.replace(/\0\0/g,"%"),!1);return y.length>t?0:(Un(y,e),y.length-1)})(e,t,r,n)},Yn=(function(){var e,t,r,n,i={a:zn};function a(e,t){var r,n=e.exports;return q=(P=n).lh,r=P.jh,G.unshift(r),re(),n}if(te(),s.instantiateWasm)try{return s.instantiateWasm(i,a)}catch(e){k("Module.instantiateWasm callback failed with error: "+e),o(e)}(e=C,t=K,r=i,n=function(e){a(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||oe(t)||b||"function"!=typeof fetch?se(t,r,n):fetch(t,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,r).then(n,(function(e){return k("wasm streaming compile failed: "+e),k("falling back to ArrayBuffer instantiation"),se(t,r,n)}))))).catch(o)}(),s._malloc=e=>(Yn=s._malloc=P.kh)(e)),Xn=s._free=e=>(Xn=s._free=P.mh)(e),Kn=()=>(Kn=P.nh)(),Qn=(s._ma_malloc_emscripten=(e,t)=>(s._ma_malloc_emscripten=P.oh)(e,t),s._ma_free_emscripten=(e,t)=>(s._ma_free_emscripten=P.ph)(e,t),s._ma_device_process_pcm_frames_capture__webaudio=(e,t,r)=>(Qn=s._ma_device_process_pcm_frames_capture__webaudio=P.qh)(e,t,r)),Zn=s._ma_device_process_pcm_frames_playback__webaudio=(e,t,r)=>(Zn=s._ma_device_process_pcm_frames_playback__webaudio=P.rh)(e,t,r),Jn=e=>(Jn=P.sh)(e),eo=e=>(eo=P.th)(e),to=(s.__embind_initialize_bindings=()=>(s.__embind_initialize_bindings=P.uh)(),(e,t)=>(to=P.vh)(e,t)),ro=(e,t)=>(ro=P.wh)(e,t),no=()=>(no=P.xh)(),oo=e=>(oo=P.yh)(e),io=e=>(io=P.zh)(e),ao=e=>(ao=P.Ah)(e),so=e=>(so=P.Bh)(e),uo=(e,t,r)=>(uo=P.Ch)(e,t,r),lo=e=>(lo=P.Dh)(e);function co(){function e(){Gn||(Gn=!0,s.calledRun=!0,$||(s.noFSInit||Ae.init.initialized||Ae.init(),Ae.ignorePermissions=!1,Se.init(),ce(G),t(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),function(){if(s.postRun)for("function"==typeof s.postRun&&(s.postRun=[s.postRun]);s.postRun.length;)e=s.postRun.shift(),Y.unshift(e);var e;ce(Y)}()))}Z>0||(function(){if(s.preRun)for("function"==typeof s.preRun&&(s.preRun=[s.preRun]);s.preRun.length;)e=s.preRun.shift(),W.unshift(e);var e;ce(W)}(),Z>0||(s.setStatus?(s.setStatus("Running..."),setTimeout((function(){setTimeout((function(){s.setStatus("")}),1),e()}),1)):e()))}if(s.___start_em_js=2354075,s.___stop_em_js=2354439,s.addRunDependency=te,s.removeRunDependency=re,s.FS_createPath=Ae.createPath,s.FS_createDataFile=Ae.createDataFile,s.FS_createLazyFile=Ae.createLazyFile,s.FS_createDevice=Ae.createDevice,s.FS_unlink=Ae.unlink,s.ccall=function(e,t,r,n,o){var i={string:e=>{var t=0;return null!=e&&0!==e&&(t=(e=>{var t=Ee(e)+1,r=io(t);return Ot(e,r,t),r})(e)),t},array:e=>{var t=io(e.length);return Un(e,t),t}},a=function(e){return s["_"+e]}(e),u=[],l=0;if(n)for(var c=0;c<n.length;c++){var d=i[r[c]];d?(0===l&&(l=no()),u[c]=d(n[c])):u[c]=n[c]}var f=a.apply(null,u);return function(e){return 0!==l&&oo(l),function(e){return"string"===t?Fe(e):"boolean"===t?Boolean(e):e}(e)}(f)},s.getValue=function(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":case"i8":return F[e>>0];case"i16":return B[e>>1];case"i32":return R[e>>2];case"i64":return I[e>>3];case"float":return O[e>>2];case"double":return j[e>>3];case"*":return M[e>>2];default:ne(`invalid type for getValue: ${t}`)}},s.UTF8ToString=Fe,s.specialHTMLTargets=Fn,s.FS_createPreloadedFile=Ae.createPreloadedFile,ee=function e(){Gn||co(),Gn||(ee=e)},s.preInit)for("function"==typeof s.preInit&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return co(),e.ready});e.exports=o},809:e=>{"use strict";e.exports=require("node-fetch")},300:e=>{"use strict";e.exports=require("buffer")},113:e=>{"use strict";e.exports=require("crypto")},147:e=>{"use strict";e.exports=require("fs")},17:e=>{"use strict";e.exports=require("path")},310:e=>{"use strict";e.exports=require("url")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.p="";var n={};return(()=>{"use strict";r.d(n,{default:()=>Ke});const e=Symbol("PROXY");function t(t,r){Object.defineProperty(t[r],e,{value:{type:"getter"},writable:!1})}function o(t,r){Object.defineProperty(t[r],e,{value:{type:"setter"},writable:!1})}var i,a,s,u,l,c,d,f,p,h,m,g,y,v;Symbol("RESTORE"),function(e){let t;!function(e){e[e.sRGB=0]="sRGB",e[e.CMYK=1]="CMYK",e[e.SpotColor=2]="SpotColor"}(t=e.ColorSpace||(e.ColorSpace={})),e.toColor=function(e){switch(e.colorSpace){case t.sRGB:return{r:e.components.x,g:e.components.y,b:e.components.z,a:e.components.w};case t.SpotColor:return{name:e.spotColorName,tint:e.tint,externalReference:e.externalReference};case t.CMYK:return{c:e.components.x,m:e.components.y,y:e.components.z,k:e.components.w,tint:e.tint};default:throw new Error("Unknown color space!")}},e.fromColor=function(e){if(function(e){return"r"in e&&"a"in e&&void 0!==e.r&&void 0!==e.a}(e))return{colorSpace:t.sRGB,components:{x:e.r,y:e.g,z:e.b,w:e.a},spotColorName:"",tint:1,externalReference:""};if(function(e){return"c"in e&&"m"in e&&"y"in e&&"k"in e&&void 0!==e.c&&void 0!==e.m&&void 0!==e.y&&void 0!==e.k}(e))return{colorSpace:t.CMYK,components:{x:e.c,y:e.m,z:e.y,w:e.k},spotColorName:"",tint:e.tint,externalReference:""};if(function(e){return"name"in e&&void 0!==e.name}(e))return{colorSpace:t.SpotColor,components:{x:0,y:0,z:0,w:0},spotColorName:e.name,tint:e.tint,externalReference:e.externalReference};throw new Error("Unknown color space!")}}(i||(i={})),function(e){e[e.Pending=0]="Pending",e[e.Ready=1]="Ready",e[e.Error=2]="Error"}(a||(a={})),function(e){e.Added="DesignBlockAddedEvent",e.Updated="DesignBlockUpdatedEvent",e.Removed="DesignBlockRemovedEvent"}(s||(s={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Middle=2]="Middle",e[e.Unknown=255]="Unknown"}(u||(u={})),function(e){e[e.Pixel=0]="Pixel",e[e.Line=1]="Line",e[e.Page=2]="Page"}(l||(l={})),function(e){e[e.Up=0]="Up",e[e.Down=1]="Down"}(c||(c={})),function(e){e[e.Key0=0]="Key0",e[e.Key1=1]="Key1",e[e.Key2=2]="Key2",e[e.Key3=3]="Key3",e[e.Key4=4]="Key4",e[e.Key5=5]="Key5",e[e.Key6=6]="Key6",e[e.Key7=7]="Key7",e[e.Key8=8]="Key8",e[e.Key9=9]="Key9",e[e.A=10]="A",e[e.B=11]="B",e[e.C=12]="C",e[e.D=13]="D",e[e.E=14]="E",e[e.F=15]="F",e[e.G=16]="G",e[e.H=17]="H",e[e.I=18]="I",e[e.J=19]="J",e[e.K=20]="K",e[e.L=21]="L",e[e.M=22]="M",e[e.N=23]="N",e[e.O=24]="O",e[e.P=25]="P",e[e.Q=26]="Q",e[e.R=27]="R",e[e.S=28]="S",e[e.T=29]="T",e[e.U=30]="U",e[e.V=31]="V",e[e.W=32]="W",e[e.X=33]="X",e[e.Y=34]="Y",e[e.Z=35]="Z",e[e.ArrowLeft=36]="ArrowLeft",e[e.ArrowRight=37]="ArrowRight",e[e.ArrowUp=38]="ArrowUp",e[e.ArrowDown=39]="ArrowDown",e[e.Backspace=40]="Backspace",e[e.Enter=41]="Enter",e[e.Space=42]="Space",e[e.Escape=43]="Escape",e[e.Delete=44]="Delete",e[e.Control=45]="Control",e[e.Option=46]="Option",e[e.Shift=47]="Shift",e[e.Unknown=255]="Unknown"}(d||(d={})),function(e){e[e.Thin=100]="Thin",e[e.ExtraLight=200]="ExtraLight",e[e.Light=300]="Light",e[e.Normal=400]="Normal",e[e.Medium=500]="Medium",e[e.SemiBold=600]="SemiBold",e[e.Bold=700]="Bold",e[e.ExtraBold=800]="ExtraBold",e[e.Heavy=900]="Heavy"}(f||(f={})),function(e){e[e.Normal=0]="Normal",e[e.Italic=1]="Italic"}(p||(p={})),function(e){e.Bold="bold",e.Italic="italic"}(h||(h={})),function(e){e[e.Undefined=0]="Undefined",e[e.DesignUnit=1]="DesignUnit",e[e.Percent=2]="Percent",e[e.Auto=3]="Auto"}(m||(m={})),function(e){e[e.Free=0]="Free",e[e.VerticalStack=1]="VerticalStack",e[e.HorizontalStack=2]="HorizontalStack",e[e.DepthStack=3]="DepthStack"}(g||(g={})),function(e){e[e.Began=0]="Began",e[e.Changed=1]="Changed",e[e.Ended=2]="Ended"}(y||(y={})),function(e){e[e.Creator=0]="Creator",e[e.Adopter=1]="Adopter",e[e.Viewer=2]="Viewer",e[e.Presenter=3]="Presenter"}(v||(v={}));var b=function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a};class w{constructor(e){Object.defineProperty(this,"ubq",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.ubq=e}useInternalAPI(e){const t=this.ubq.getInternalAPI();try{return e(t)}finally{t.delete()}}setValue(e,t,r,n){return this.useInternalAPI((o=>E(o.setValue(e,t,r,n))))}getValue(e,t,r){return this.useInternalAPI((n=>E(n.getValue(e,t,r))))}async execute(e,t){return new Promise(((r,n)=>{this.useInternalAPI((o=>o.ubqExecute(e,t,(e=>{try{const t=E(e);r(t)}catch(e){n(e)}})))).delete()}))}}function E(e){if(e.isValid()){const t=e.value();return e.delete(),t}{const t=e.error(),r=t.publicMessage();throw t.delete(),e.delete(),new Error(r)}}function _(e){return new Promise(((t,r)=>{e((e=>{try{const r=E(e);t(r)}catch(e){r(e)}}))}))}b([o],w.prototype,"setValue",null),b([t],w.prototype,"getValue",null);const C=(e,t=!0)=>{const r=[];for(let t=0;t<e.size();t+=1)r.push(e.get(t));return t&&e.delete(),r};var S,k,x,P,T,A=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};const F=new WeakMap,D={assets:[],total:0,currentPage:0,nextPage:void 0};class B{constructor(e){S.add(this),k.set(this,void 0),Object.defineProperty(this,"onAssetSourceAdded",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=A(this,k,"f").subscribeToAssetSourceAdded(e);return()=>{A(this,k,"f").isDeleted()||E(A(this,k,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onAssetSourceRemoved",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=A(this,k,"f").subscribeToAssetSourceRemoved(e);return()=>{A(this,k,"f").isDeleted()||E(A(this,k,"f").unsubscribe(t))}}}),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,k,e,"f")}addSource(e){var t,r,n,o,i,a;const s=null===(t=e.getSupportedMimeTypes)||void 0===t?void 0:t.bind(e),u=null===(r=e.getGroups)||void 0===r?void 0:r.bind(e),l=null===(n=e.applyAsset)||void 0===n?void 0:n.bind(e),c=null===(o=e.applyAssetToBlock)||void 0===o?void 0:o.bind(e),d=null===(i=e.addAsset)||void 0===i?void 0:i.bind(e),f=null===(a=e.removeAsset)||void 0===a?void 0:a.bind(e),p=e.credits,h=e.license;E(A(this,k,"f").addAssetSource(e.id,(async(t,r)=>{var n;try{const n=Object.assign(Object.assign({},t),{tags:C(t.tags),groups:C(t.groups),excludeGroups:C(t.excludeGroups)}),o=await e.findAssets(n);if(o){const t=Object.assign(Object.assign({},o),{assets:o.assets.map((t=>L(t,e.id)))});r.invoke(t)}else r.invoke(D)}catch(e){r.invoke(null!==(n=e.message)&&void 0!==n?n:"Unknown error in user-defined `findAssets`")}}),u?async e=>{var t;try{const t=await u();e.invoke(t)}catch(r){e.invoke(null!==(t=r.message)&&void 0!==t?t:"Unknown error in user-defined `getGroups`")}}:null,p?()=>{var e;return{name:p.name,url:null!==(e=p.url)&&void 0!==e?e:""}}:null,h?()=>{var e;return{name:h.name,url:null!==(e=h.url)&&void 0!==e?e:""}}:null,s?()=>{var e;return null!==(e=s())&&void 0!==e?e:[]}:null,l?async(e,t)=>{var r;try{const r=await l(A(this,S,"m",x).call(this,e));t.invoke(r)}catch(e){t.invoke(null!==(r=e.message)&&void 0!==r?r:"Unknown error in user-defined `applyAsset`")}}:null,c?async(e,t,r)=>{var n;try{await c(A(this,S,"m",x).call(this,e),t),r.invoke({})}catch(e){r.invoke(null!==(n=e.message)&&void 0!==n?n:"Unknown error in user-defined `applyAssetToBlock`")}}:null,d?async e=>{d(e)}:null,f?async e=>{f(e)}:null)),A(this,S,"m",P).call(this,e.id,e)}addLocalSource(e,t,r,n){E(A(this,k,"f").addLocalAssetSource(e,null!=t?t:[],r?async(e,t)=>{var n;try{const n=await r(A(this,S,"m",x).call(this,e));t.invoke(n)}catch(e){t.invoke(null!==(n=e.message)&&void 0!==n?n:"Unknown error in user-defined `applyAsset`")}}:null,n?async(e,t,r)=>{var o;try{await n(A(this,S,"m",x).call(this,e),t),r.invoke({})}catch(e){r.invoke(null!==(o=e.message)&&void 0!==o?o:"Unknown error in user-defined `applyAssetToBlock`")}}:null))}removeSource(e){E(A(this,k,"f").removeAssetSource(e)),A(this,S,"m",T).call(this,e)}findAllSources(){return C(A(this,k,"f").findAllAssetSources())}findAssets(e,t){return new Promise(((r,n)=>{var o,i,a,s,u,l,c;let d=null!==(o=null==t?void 0:t.tags)&&void 0!==o?o:[];Array.isArray(d)||(d=[d]);const f={perPage:null!==(i=null==t?void 0:t.perPage)&&void 0!==i?i:0,page:null!==(a=null==t?void 0:t.page)&&void 0!==a?a:0,query:null!==(s=null==t?void 0:t.query)&&void 0!==s?s:"",tags:d,groups:null!==(u=null==t?void 0:t.groups)&&void 0!==u?u:[],excludeGroups:null!==(l=null==t?void 0:t.excludeGroups)&&void 0!==l?l:[],locale:null!==(c=null==t?void 0:t.locale)&&void 0!==c?c:""};A(this,k,"f").findAssetSourceAssets(e,f,(e=>{try{const t=E(e);r(Object.assign(Object.assign({},t),{nextPage:-1===t.nextPage?void 0:t.nextPage}))}catch(e){n(e)}}))}))}async getGroups(e){return _((t=>A(this,k,"f").getAssetSourceGroups(e,t))).then((e=>C(e)))}getSupportedMimeTypes(e){return C(E(A(this,k,"f").getAssetSourceSupportedMimeTypes(e)))}getCredits(e){const t=E(A(this,k,"f").getAssetSourceCredits(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}getLicense(e){const t=E(A(this,k,"f").getAssetSourceLicense(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}canManageAssets(e){var t,r;return!!(null===(r=null===(t=F.get(A(this,k,"f")))||void 0===t?void 0:t.get(e))||void 0===r?void 0:r.canManageAssets)}addAssetToSource(e,t){E(A(this,k,"f").addAssetToSource(e,t))}removeAssetFromSource(e,t){E(A(this,k,"f").removeAssetFromSource(e,t))}async apply(e,t){return new Promise(((r,n)=>{A(this,k,"f").applyAssetSourceAsset(e,L(t,e),(e=>{try{const t=E(e);A(this,k,"f").isValid(t)?r(t):r(void 0)}catch(e){n(e)}}))}))}async applyToBlock(e,t,r){return _((n=>A(this,k,"f").applyAssetSourceAssetToBlock(e,L(t,e),r,n)))}async defaultApplyAsset(e){return new Promise(((t,r)=>{A(this,k,"f").defaultApplyAsset(L(e,""),(e=>{try{const r=E(e);A(this,k,"f").isValid(r)?t(r):t(void 0)}catch(e){r(e)}}))}))}async defaultApplyAssetToBlock(e,t){return _((r=>A(this,k,"f").defaultApplyAssetToBlock(L(e,""),t,r)))}dispose(){F.delete(A(this,k,"f"))}}function L(e,t){return"context"in e&&e.context.sourceId===t?e:Object.assign(Object.assign({},e),{context:{sourceId:t}})}function R(e,t){const r=`[UBQ] ${e}`;switch(t){case"Warning":console.warn(r);break;case"Error":console.error(r);break;case"Info":console.info(r);break;default:console.log(r)}}k=new WeakMap,S=new WeakSet,x=function(e){var t,r,n,o,i,a,s,u;const l=Object.assign({},e);return 0===(null===(t=l.groups)||void 0===t?void 0:t.length)&&delete l.groups,l.locale||delete l.locale,l.label||delete l.label,0===(null===(r=l.tags)||void 0===r?void 0:r.length)&&delete l.tags,(null===(n=l.credits)||void 0===n?void 0:n.name)||(null===(o=l.credits)||void 0===o?void 0:o.url)?l.credits.url||delete l.credits.url:delete l.credits,(null===(i=l.license)||void 0===i?void 0:i.name)||(null===(a=l.license)||void 0===a?void 0:a.url)?l.license.url||delete l.license.url:delete l.license,(null===(s=l.utm)||void 0===s?void 0:s.source)||(null===(u=l.utm)||void 0===u?void 0:u.medium)?(l.utm.source||delete l.utm.source,l.utm.medium||delete l.utm.medium):delete l.utm,l},P=function(e,t){F.has(A(this,k,"f"))||F.set(A(this,k,"f"),new Map),t.canManageAssets&&console.warn(`\nDEPRECATION WARNING:\n\n'canManageAssets' flag was found for asset source with the id '${e}'.\n\nThis flag is deprecated and will be removed in the next version. If you have used it to control if an upload buttons is rendered in the asset library, use the 'canAdd' options on an asset library entry. See documentation here: https://img.ly/docs/cesdk/ui/guides/customize-asset-library/`),F.get(A(this,k,"f")).set(e,{canManageAssets:t.canManageAssets})},T=function(e){var t;null===(t=F.get(A(this,k,"f")))||void 0===t||t.delete(e)};const M={baseURL:"/extensions/",entries:["ly.img.cesdk.fonts"]};function O(e,t=("undefined"==typeof window?"":window.location.href)){return new URL(e,""===t?void 0:t).href}function I(e){return"/"!==e[e.length-1]?`${e}/`:e}const U=async function(e,t,r=fetch,n,o=new Set(n.findAllSources())){const i=e.map((async e=>{const i=function(e,t){const r=e.endsWith("/"),n=t.startsWith("/");return r&&n?`${e.substring(0,e.length-1)}${t}`:r||n?`${e}${t}`:`${e}/${t}`}(t,`/${e}/content.json`);return r(i).then((e=>{if(!e.ok)throw new Error(e.statusText);return e.json()})).then((r=>{if(void 0===r.assets)throw new Error(`Invalid content.json for assets: ${e}`);const i=r.assets;o.has(e)||n.addLocalSource(e),i.forEach((r=>{r.meta&&Object.entries(r.meta).forEach((([e,n])=>{const o=n.toString();if(o.includes("{{base_url}}")){const n=o.replace("{{base_url}}",t);r.meta&&(r.meta[e]=n)}})),n.addAssetToSource(e,r)}))}))}));await Promise.all(i)};class j extends TypeError{constructor(e,t){let r;const{message:n,...o}=e,{path:i}=e;super(0===i.length?n:"At path: "+i.join(".")+" -- "+n),this.value=void 0,this.key=void 0,this.type=void 0,this.refinement=void 0,this.path=void 0,this.branch=void 0,this.failures=void 0,Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>{var n;return null!=(n=r)?n:r=[e,...t()]}}}function $(e){return"object"==typeof e&&null!=e}function N(e){return"string"==typeof e?JSON.stringify(e):""+e}function H(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:o,branch:i}=t,{type:a}=r,{refinement:s,message:u="Expected a value of type `"+a+"`"+(s?" with refinement `"+s+"`":"")+", but received: `"+N(n)+"`"}=e;return{value:n,type:a,refinement:s,key:o[o.length-1],path:o,branch:i,...e,message:u}}function*q(e,t,r,n){var o;$(o=e)&&"function"==typeof o[Symbol.iterator]||(e=[e]);for(const o of e){const e=H(o,t,r,n);e&&(yield e)}}function*V(e,t,r={}){const{path:n=[],branch:o=[e],coerce:i=!1,mask:a=!1}=r,s={path:n,branch:o};if(i&&(e=t.coercer(e,s),a&&"type"!==t.type&&$(t.schema)&&$(e)&&!Array.isArray(e)))for(const r in e)void 0===t.schema[r]&&delete e[r];let u=!0;for(const r of t.validator(e,s))u=!1,yield[r,void 0];for(let[r,l,c]of t.entries(e,s)){const t=V(l,c,{path:void 0===r?n:[...n,r],branch:void 0===r?o:[...o,l],coerce:i,mask:a});for(const n of t)n[0]?(u=!1,yield[n[0],void 0]):i&&(l=n[1],void 0===r?e=l:e instanceof Map?e.set(r,l):e instanceof Set?e.add(l):$(e)&&(e[r]=l))}if(u)for(const r of t.refiner(e,s))u=!1,yield[r,void 0];u&&(yield[void 0,e])}class W{constructor(e){this.TYPE=void 0,this.type=void 0,this.schema=void 0,this.coercer=void 0,this.validator=void 0,this.refiner=void 0,this.entries=void 0;const{type:t,schema:r,validator:n,refiner:o,coercer:i=(e=>e),entries:a=function*(){}}=e;this.type=t,this.schema=r,this.entries=a,this.coercer=i,this.validator=n?(e,t)=>q(n(e,t),t,this,e):()=>[],this.refiner=o?(e,t)=>q(o(e,t),t,this,e):()=>[]}assert(e){return function(e,t){const r=G(e,t);if(r[0])throw r[0]}(e,this)}create(e){return function(e,t){const r=G(e,t,{coerce:!0});if(r[0])throw r[0];return r[1]}(e,this)}is(e){return function(e,t){return!G(e,t)[0]}(e,this)}mask(e){return function(e,t){const r=G(e,t,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}(e,this)}validate(e,t={}){return G(e,this,t)}}function G(e,t,r={}){const n=V(e,t,r),o=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);return o[0]?[new j(o[0],(function*(){for(const e of n)e[0]&&(yield e[0])})),void 0]:[void 0,o[1]]}function z(e,t){return new W({type:e,schema:null,validator:t})}function Y(e){return new W({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||"Expected an array value, but received: "+N(e)})}function X(){return z("boolean",(e=>"boolean"==typeof e))}function K(){return z("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||"Expected an integer, but received: "+N(e)))}function Q(){return z("number",(e=>"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+N(e)))}function Z(e){const t=e?Object.keys(e):[],r=z("never",(()=>!1));return new W({type:"object",schema:e||null,*entries(n){if(e&&$(n)){const o=new Set(Object.keys(n));for(const r of t)o.delete(r),yield[r,n[r],e[r]];for(const e of o)yield[e,n[e],r]}},validator:e=>$(e)||"Expected an object, but received: "+N(e),coercer:e=>$(e)?{...e}:e})}function J(){return z("string",(e=>"string"==typeof e||"Expected a string, but received: "+N(e)))}function ee(e,t,r={}){const{exclusive:n}=r;return ne(e,"max",(r=>n?r<t:r<=t||"Expected a "+e.type+" less than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function te(e,t,r={}){const{exclusive:n}=r;return ne(e,"min",(r=>n?r>t:r>=t||"Expected a "+e.type+" greater than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function re(e){return ne(e,"nonempty",(t=>function(e){return e instanceof Map||e instanceof Set?e.size:e.length}(t)>0||"Expected a nonempty "+e.type+" but received an empty one"))}function ne(e,t,r){return new W({...e,*refiner(n,o){yield*e.refiner(n,o);const i=q(r(n,o),o,e,n);for(const e of i)yield{...e,refinement:t}}})}function oe(e,t,r){const[n]=G(t,r);if(n)throw n.message=`Error in argument '${e}': ${n.message}`,n}function ie(){const e=/image\/(png|jpeg|webp|x-tga)|video\/(mp4|quicktime)|application\/octet-stream|application\/pdf/;return z("MimeType",(t=>!("string"!=typeof t||!e.test(t))||{message:`expected one of "image/png", "image/jpeg", "image/webp", "image/x-tga", "video/mp4", "video/quicktime", "application/pdf" or "application/octet-stream", but got "${t}"`}))}function ae(){const e=["Free","VerticalStack","HorizontalStack","DepthStack"];return z("SceneLayout",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}var se;!function(e){e.Png="image/png",e.Jpeg="image/jpeg",e.WebP="image/webp",e.Tga="image/x-tga",e.Mp4="video/mp4",e.QuickTime="video/quicktime",e.Binary="application/octet-stream",e.Pdf="application/pdf",e.Zip="application/zip"}(se||(se={}));const ue=se,le="undefined"!=typeof Blob?Blob:(()=>{try{return r(300).Blob}catch(e){return function(){throw new Error("Could not find Blob constructor and failed to require('buffer').Blob")}}})();var ce,de=function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},fe=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class pe{constructor(e){ce.set(this,void 0),Object.defineProperty(this,"onZoomLevelChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=fe(this,ce,"f").subscribeToZoomLevel(e);return()=>{fe(this,ce,"f").isDeleted()||E(fe(this,ce,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onActiveChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=fe(this,ce,"f").subscribeToActiveSceneChange(e);return()=>{fe(this,ce,"f").isDeleted()||E(fe(this,ce,"f").unsubscribe(t))}}}),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,ce,e,"f")}async loadFromString(e){return oe("sceneContent",e,J()),_((t=>fe(this,ce,"f").loadSceneFromString(e,t)))}async loadFromURL(e){return oe("url",e,J()),_((t=>fe(this,ce,"f").loadSceneFromURL(e,t)))}async saveToString(){const e=this.get();if(null==e)throw new Error("No scene available.");return _((t=>{fe(this,ce,"f").saveSceneToString(e,t)}))}async saveToArchive(){return new Promise(((e,t)=>{const r=this.get();null==r?t(new Error("No scene available.")):fe(this,ce,"f").saveSceneToArchive(r,(r=>{"error"in r?t(r.error):e(new le([r],{type:ue.Zip}))}))}))}create(e="Free"){return oe("sceneLayout",e,ae()),E(fe(this,ce,"f").createScene(e))}createVideo(){return E(fe(this,ce,"f").createVideoScene())}createFromImage(e,t=300,r=1,n="Free",o=0,i=!1){return oe("url",e,J()),oe("dpi",t,te(Q(),0)),oe("pixelScaleFactor",r,te(Q(),0)),oe("sceneLayout",n,ae()),_((a=>fe(this,ce,"f").createSceneFromImage(e,t,r,n,o,i,a)))}createFromVideo(e){return oe("url",e,J()),_((t=>fe(this,ce,"f").createSceneFromVideo(e,t)))}get(){const e=E(fe(this,ce,"f").findByType("scene")),t=C(e);return t.length>0?t[0]:null}async applyTemplateFromString(e){return oe("content",e,J()),_((t=>fe(this,ce,"f").applyTemplateFromString(e,t)))}async applyTemplateFromURL(e){return oe("url",e,J()),_((t=>fe(this,ce,"f").applyTemplateFromURL(e,t)))}getMode(){const e=this.get();return E(fe(this,ce,"f").getSceneMode(e))}setDesignUnit(e){oe("designUnit",e,function(){const e=["Pixel","Millimeter","Inch"];return z("DesignUnit",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}());const t=this.get();E(fe(this,ce,"f").setDesignUnit(t,e))}getDesignUnit(){const e=this.get();return E(fe(this,ce,"f").getDesignUnit(e))}getPages(){return C(E(fe(this,ce,"f").getPages()))}getCurrentPage(){const e=this.get();if(null==e)return null;const t=E(fe(this,ce,"f").findNearestToViewPortCenterByKind(e,"page")),r=C(t);return r.length>0?r[0]:null}findNearestToViewPortCenterByType(e){oe("type",e,J());const t=this.get();if(null==t)return[];const r=E(fe(this,ce,"f").findNearestToViewPortCenterByType(t,e));return C(r)}findNearestToViewPortCenterByKind(e){oe("kind",e,J());const t=this.get();if(null==t)return[];const r=E(fe(this,ce,"f").findNearestToViewPortCenterByKind(t,e));return C(r)}setZoomLevel(e=1){const t=this.get();oe("zoomLevel",e,te(Q(),0)),fe(this,ce,"f").setZoomLevel(t,e)}getZoomLevel(){const e=this.get();return E(fe(this,ce,"f").getZoomLevel(e))}async zoomToBlock(e,t=0,r=0,n=0,o=0){return oe("id",e,K()),_((i=>fe(this,ce,"f").zoomToBlock(e,t,r,n,o,i)))}enableZoomAutoFit(e,t,r=0,n=0,o=0,i=0){return oe("id",e,K()),oe("axis",t,function(){const e=["Horizontal","Vertical","Both"];return z("ZoomAutoFitAxis",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}()),"Horizontal"===t?(oe("paddingBefore",r,Q()),oe("paddingAfter",n,Q()),E(fe(this,ce,"f").enableZoomAutoFit(e,t,r,0,n,0))):"Vertical"===t?(oe("paddingBefore",r,Q()),oe("paddingAfter",n,Q()),E(fe(this,ce,"f").enableZoomAutoFit(e,t,0,r,0,n))):(oe("paddingLeft",r,Q()),oe("paddingTop",n,Q()),oe("paddingRight",o,Q()),oe("paddingBottom",i,Q()),E(fe(this,ce,"f").enableZoomAutoFit(e,t,r,n,o,i)))}disableZoomAutoFit(e){return oe("blockOrScene",e,K()),E(fe(this,ce,"f").disableZoomAutoFit(e))}isZoomAutoFitEnabled(e){return oe("blockOrScene",e,K()),E(fe(this,ce,"f").isZoomAutoFitEnabled(e))}unstable_enableCameraPositionClamping(e,t=0,r=0,n=0,o=0,i=0,a=0,s=0,u=0){return oe("ids",e,Y(Q())),oe("paddingLeft",t,Q()),oe("paddingTop",r,Q()),oe("paddingRight",n,Q()),oe("paddingBottom",o,Q()),oe("scaledPaddingLeft",t,Q()),oe("scaledPaddingTop",r,Q()),oe("scaledPaddingRight",n,Q()),oe("scaledPaddingBottom",o,Q()),E(fe(this,ce,"f").unstable_enableCameraPositionClamping(e,t,r,n,o,i,a,s,u))}unstable_disableCameraPositionClamping(e=this.get()){if(null==e)throw new Error("No scene available.");return E(fe(this,ce,"f").unstable_disableCameraPositionClamping(e))}unstable_isCameraPositionClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return E(fe(this,ce,"f").unstable_isCameraPositionClampingEnabled(e))}unstable_enableCameraZoomClamping(e,t=-1,r=-1,n=0,o=0,i=0,a=0){return oe("ids",e,Y(Q())),oe("minZoomLimit",t,Q()),oe("maxZoomLimit",r,Q()),oe("paddingLeft",n,Q()),oe("paddingTop",o,Q()),oe("paddingRight",i,Q()),oe("paddingBottom",a,Q()),E(fe(this,ce,"f").unstable_enableCameraZoomClamping(e,t,r,n,o,i,a))}unstable_disableCameraZoomClamping(e=this.get()){if(null==e)throw new Error("No scene available.");return E(fe(this,ce,"f").unstable_disableCameraZoomClamping(e))}unstable_isCameraZoomClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return E(fe(this,ce,"f").unstable_isCameraZoomClampingEnabled(e))}}ce=new WeakMap,de([o],pe.prototype,"loadFromString",null),de([o],pe.prototype,"loadFromURL",null),de([o],pe.prototype,"create",null),de([o],pe.prototype,"createVideo",null),de([o],pe.prototype,"createFromImage",null),de([o],pe.prototype,"createFromVideo",null),de([t],pe.prototype,"get",null),de([o],pe.prototype,"applyTemplateFromString",null),de([o],pe.prototype,"applyTemplateFromURL",null),de([t],pe.prototype,"getMode",null),de([o],pe.prototype,"setDesignUnit",null),de([t],pe.prototype,"getDesignUnit",null),de([t],pe.prototype,"getPages",null),de([t],pe.prototype,"getCurrentPage",null),de([t],pe.prototype,"findNearestToViewPortCenterByType",null),de([t],pe.prototype,"findNearestToViewPortCenterByKind",null),de([o],pe.prototype,"setZoomLevel",null),de([t],pe.prototype,"getZoomLevel",null),de([o],pe.prototype,"zoomToBlock",null),de([o],pe.prototype,"enableZoomAutoFit",null),de([o],pe.prototype,"disableZoomAutoFit",null),de([t],pe.prototype,"isZoomAutoFitEnabled",null);var he,me=function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},ge=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class ye{constructor(e){he.set(this,void 0),Object.defineProperty(this,"onSelectionChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=ge(this,he,"f").subscribeToSelectionChange(e);return()=>{ge(this,he,"f").isDeleted()||E(ge(this,he,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onClicked",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=ge(this,he,"f").subscribeToBlockClicked(e);return()=>{ge(this,he,"f").isDeleted()||E(ge(this,he,"f").unsubscribe(t))}}}),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,he,e,"f")}async export(e,t=ue.Png,r={}){var n,o,i;oe("handle",e,Q()),oe("mimeType",t,ie()),oe("options",r,Z());const a=null!=r.targetWidth&&null!=r.targetHeight,s=null!==(n=r.jpegQuality)&&void 0!==n?n:.9,u=null!==(o=r.webpQuality)&&void 0!==o?o:1,l=null!==(i=r.pngCompressionLevel)&&void 0!==i?i:5;return oe("jpegQuality",s,te(ee(Q(),1),0,{exclusive:!0})),oe("webpQuality",u,te(ee(Q(),1),0,{exclusive:!0})),oe("pngCompressionLevel",l,te(ee(K(),9),0)),null==r.targetWidth&&null==r.targetHeight||(oe("targetWidth",r.targetWidth,Q()),oe("targetHeight",r.targetHeight,Q())),new Promise(((n,o)=>{var i,c,d;ge(this,he,"f").exportToBuffer(e,t,(e=>{"error"in e?o(e.error):n(new le([e],{type:t}))}),{pngCompressionLevel:l,jpegQuality:s,webpQuality:u,useTargetSize:a,targetWidth:null!==(i=r.targetWidth)&&void 0!==i?i:0,targetHeight:null!==(c=r.targetHeight)&&void 0!==c?c:0,exportPdfWithHighCompatibility:null===(d=r.exportPdfWithHighCompatibility)||void 0===d||d})}))}async exportWithColorMask(e,t=ue.Png,r,n,o,i={}){var a,s,u;oe("handle",e,Q()),oe("mimeType",t,ie()),oe("options",i,Z());const l=null!=i.targetWidth&&null!=i.targetHeight,c=null!==(a=i.jpegQuality)&&void 0!==a?a:.9,d=null!==(s=i.webpQuality)&&void 0!==s?s:1,f=null!==(u=i.pngCompressionLevel)&&void 0!==u?u:5;return oe("jpegQuality",c,te(ee(Q(),1),0,{exclusive:!0})),oe("webpQuality",d,te(ee(Q(),1),0,{exclusive:!0})),oe("pngCompressionLevel",f,te(ee(K(),9),0)),null==i.targetWidth&&null==i.targetHeight||(oe("targetWidth",i.targetWidth,Q()),oe("targetHeight",i.targetHeight,Q())),new Promise(((a,s)=>{var u,p,h;ge(this,he,"f").exportWithColorMaskToBuffer(e,t,r,n,o,((e,r)=>{if("error"in e)s(e.error);else if("error"in r)s(r.error);else{const n=new le([e],{type:t}),o=new le([r],{type:t});a([n,o])}}),{pngCompressionLevel:f,jpegQuality:c,webpQuality:d,useTargetSize:l,targetWidth:null!==(u=i.targetWidth)&&void 0!==u?u:0,targetHeight:null!==(p=i.targetHeight)&&void 0!==p?p:0,exportPdfWithHighCompatibility:null===(h=i.exportPdfWithHighCompatibility)||void 0===h||h})}))}async exportVideo(e,t=ue.Mp4,r,n){throw new Error("Method not implemented. An implementation is available on the BlockAPI at engine.block or cesdk.engine.block")}async loadFromString(e){return oe("content",e,J()),_((t=>ge(this,he,"f").loadBlocksFromString(e,t))).then((e=>C(e)))}async saveToString(e){return oe("blocks",e,Y(Q())),_((t=>ge(this,he,"f").saveBlocksToString(e,t)))}create(e){return oe("type",e,J()),E(ge(this,he,"f").create(e))}createFill(e){return oe("type",e,J()),E(ge(this,he,"f").createFill(e))}getType(e){return oe("id",e,K()),E(ge(this,he,"f").getType(e))}getKind(e){return oe("id",e,K()),E(ge(this,he,"f").getKind(e))}setKind(e,t){oe("id",e,K()),E(ge(this,he,"f").setKind(e,t))}select(e){return oe("id",e,K()),E(ge(this,he,"f").select(e))}setSelected(e,t){return oe("id",e,K()),oe("selected",t,X()),E(ge(this,he,"f").setSelected(e,t))}isSelected(e){return oe("id",e,K()),E(ge(this,he,"f").isSelected(e))}findAllSelected(){return C(ge(this,he,"f").findAllSelected())}isGroupable(e){return oe("ids",e,Y(Q())),E(ge(this,he,"f").isGroupable(e))}group(e){return oe("ids",e,re(Y(Q()))),E(ge(this,he,"f").group(e))}ungroup(e){return oe("id",e,Q()),E(ge(this,he,"f").ungroup(e))}enterGroup(e){return oe("id",e,Q()),E(ge(this,he,"f").enterGroup(e))}exitGroup(e){return oe("id",e,Q()),E(ge(this,he,"f").exitGroup(e))}setName(e,t){return oe("id",e,K()),oe("name",t,J()),E(ge(this,he,"f").setName(e,t))}getName(e){return oe("id",e,K()),E(ge(this,he,"f").getName(e))}getUUID(e){return oe("id",e,K()),E(ge(this,he,"f").getUUID(e))}findByName(e){oe("name",e,J());const t=ge(this,he,"f").findByName(e);return C(t)}findByType(e){oe("type",e,J());const t=E(ge(this,he,"f").findByType(e));return C(t)}findByKind(e){oe("kind",e,J());const t=E(ge(this,he,"f").findByKind(e));return C(t)}findAll(){return C(ge(this,he,"f").findAll())}findAllPlaceholders(){return C(ge(this,he,"f").findAllPlaceholders())}createShape(e){return oe("type",e,J()),E(ge(this,he,"f").createShape(e))}hasShape(e){return oe("id",e,K()),E(ge(this,he,"f").hasShape(e))}getShape(e){return oe("id",e,K()),E(ge(this,he,"f").getShape(e))}setShape(e,t){return oe("id",e,K()),oe("shape",t,K()),E(ge(this,he,"f").setShape(e,t))}isVisible(e){return oe("id",e,K()),E(ge(this,he,"f").isVisible(e))}setVisible(e,t){return oe("id",e,K()),oe("visible",t,X()),E(ge(this,he,"f").setVisible(e,t))}isClipped(e){return oe("id",e,K()),E(ge(this,he,"f").isClipped(e))}setClipped(e,t){return oe("id",e,K()),oe("clipped",t,X()),E(ge(this,he,"f").setClipped(e,t))}isTransformLocked(e){return oe("id",e,K()),E(ge(this,he,"f").isTransformLocked(e))}setTransformLocked(e,t){return oe("id",e,K()),oe("locked",t,X()),E(ge(this,he,"f").setTransformLocked(e,t))}getPositionX(e){return oe("id",e,K()),E(ge(this,he,"f").getPositionX(e))}getPositionXMode(e){return oe("id",e,K()),E(ge(this,he,"f").getPositionXMode(e))}getPositionY(e){return oe("id",e,K()),E(ge(this,he,"f").getPositionY(e))}getPositionYMode(e){return oe("id",e,K()),E(ge(this,he,"f").getPositionYMode(e))}setPositionX(e,t){return oe("id",e,K()),oe("value",t,Q()),E(ge(this,he,"f").setPositionX(e,t))}setPositionXMode(e,t){return oe("id",e,K()),E(ge(this,he,"f").setPositionXMode(e,t))}setPositionY(e,t){return oe("id",e,K()),oe("value",t,Q()),E(ge(this,he,"f").setPositionY(e,t))}setPositionYMode(e,t){return oe("id",e,K()),E(ge(this,he,"f").setPositionYMode(e,t))}setAlwaysOnTop(e,t){return oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setAlwaysOnTop(e,t))}setAlwaysOnBottom(e,t){return oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setAlwaysOnBottom(e,t))}isAlwaysOnTop(e){return oe("id",e,K()),E(ge(this,he,"f").isAlwaysOnTop(e))}isAlwaysOnBottom(e){return oe("id",e,K()),E(ge(this,he,"f").isAlwaysOnBottom(e))}bringToFront(e){return oe("id",e,Q()),E(ge(this,he,"f").bringToFront(e))}sendToBack(e){return oe("id",e,Q()),E(ge(this,he,"f").sendToBack(e))}bringForward(e){return oe("id",e,Q()),E(ge(this,he,"f").bringForward(e))}sendBackward(e){return oe("id",e,Q()),E(ge(this,he,"f").sendBackward(e))}getRotation(e){return oe("id",e,K()),E(ge(this,he,"f").getRotation(e))}setRotation(e,t){return oe("id",e,K()),oe("radians",t,Q()),E(ge(this,he,"f").setRotation(e,t))}getFlipHorizontal(e){return oe("id",e,K()),E(ge(this,he,"f").getFlip(e)).horizontal}getFlipVertical(e){return oe("id",e,K()),E(ge(this,he,"f").getFlip(e)).vertical}setFlipHorizontal(e,t){return oe("id",e,K()),oe("flip",t,X()),E(ge(this,he,"f").setFlipHorizontal(e,t))}setFlipVertical(e,t){return oe("id",e,K()),oe("flip",t,X()),E(ge(this,he,"f").setFlipVertical(e,t))}hasContentFillMode(e){return oe("id",e,K()),E(ge(this,he,"f").hasContentFillMode(e))}getWidth(e){return oe("id",e,K()),E(ge(this,he,"f").getWidth(e))}getWidthMode(e){return oe("id",e,K()),E(ge(this,he,"f").getWidthMode(e))}getHeight(e){return oe("id",e,K()),E(ge(this,he,"f").getHeight(e))}getHeightMode(e){return oe("id",e,K()),E(ge(this,he,"f").getHeightMode(e))}setWidth(e,t){return oe("id",e,K()),oe("value",t,Q()),E(ge(this,he,"f").setWidth(e,t))}setWidthMode(e,t){return oe("id",e,K()),E(ge(this,he,"f").setWidthMode(e,t))}setHeight(e,t){return oe("id",e,K()),oe("value",t,Q()),E(ge(this,he,"f").setHeight(e,t))}setHeightMode(e,t){return oe("id",e,K()),E(ge(this,he,"f").setHeightMode(e,t))}getFrameX(e){return oe("id",e,K()),E(ge(this,he,"f").getLastFrameX(e))}getFrameY(e){return oe("id",e,K()),E(ge(this,he,"f").getLastFrameY(e))}getFrameWidth(e){return oe("id",e,K()),E(ge(this,he,"f").getLastFrameWidth(e))}getFrameHeight(e){return oe("id",e,K()),E(ge(this,he,"f").getLastFrameHeight(e))}setContentFillMode(e,t){return oe("id",e,K()),E(ge(this,he,"f").setContentFillMode(e,t))}getContentFillMode(e){return oe("id",e,K()),E(ge(this,he,"f").getContentFillMode(e))}duplicate(e){return oe("id",e,K()),E(ge(this,he,"f").duplicate(e))}destroy(e){return oe("id",e,K()),E(ge(this,he,"f").destroy(e))}isValid(e){return oe("id",e,K()),ge(this,he,"f").isValid(e)}getParent(e){return oe("id",e,K()),E(ge(this,he,"f").hasParent(e))?E(ge(this,he,"f").getParent(e)):null}getChildren(e){oe("id",e,K());const t=E(ge(this,he,"f").getChildren(e));return C(t)}insertChild(e,t,r){return oe("parent",e,Q()),oe("child",t,Q()),oe("index",r,te(Q(),0)),E(ge(this,he,"f").insertChild(e,t,r))}appendChild(e,t){return oe("parent",e,Q()),oe("child",t,Q()),E(ge(this,he,"f").appendChild(e,t))}referencesAnyVariables(e){return oe("id",e,K()),E(ge(this,he,"f").referencesAnyVariables(e))}getGlobalBoundingBoxX(e){return oe("id",e,K()),E(ge(this,he,"f").getGlobalBoundingBoxX(e))}getGlobalBoundingBoxY(e){return oe("id",e,K()),E(ge(this,he,"f").getGlobalBoundingBoxY(e))}getGlobalBoundingBoxWidth(e){return oe("id",e,K()),E(ge(this,he,"f").getGlobalBoundingBoxWidth(e))}getGlobalBoundingBoxHeight(e){return oe("id",e,K()),E(ge(this,he,"f").getGlobalBoundingBoxHeight(e))}getScreenSpaceBoundingBoxXYWH(e){return oe("ids",e,Y(Q())),E(ge(this,he,"f").getScreenSpaceBoundingBoxXYWH(e))}alignHorizontally(e,t){return oe("ids",e,re(Y(Q()))),E(ge(this,he,"f").alignHorizontally(e,t))}alignVertically(e,t){return oe("ids",e,re(Y(Q()))),E(ge(this,he,"f").alignVertically(e,t))}isAlignable(e){return oe("ids",e,Y(Q())),E(ge(this,he,"f").isAlignable(e))}distributeHorizontally(e){return oe("ids",e,re(Y(Q()))),E(ge(this,he,"f").distributeHorizontally(e))}distributeVertically(e){return oe("ids",e,re(Y(Q()))),E(ge(this,he,"f").distributeVertically(e))}isDistributable(e){return oe("ids",e,Y(Q())),E(ge(this,he,"f").isDistributable(e))}fillParent(e){return oe("id",e,K()),E(ge(this,he,"f").fillParent(e))}resizeContentAware(e,t,r){return oe("ids",e,Y(Q())),oe("width",t,Q()),oe("height",r,Q()),E(ge(this,he,"f").resizeContentAware(e,t,r))}scale(e,t,r=0,n=0){return oe("id",e,K()),E(ge(this,he,"f").scale(e,t,r,n))}findAllProperties(e){return oe("id",e,K()),C(E(ge(this,he,"f").findAllProperties(e)))}isPropertyReadable(e){return oe("property",e,J()),ge(this,he,"f").isPropertyReadable(e)}isPropertyWritable(e){return oe("property",e,J()),ge(this,he,"f").isPropertyWritable(e)}getPropertyType(e){return oe("property",e,J()),E(ge(this,he,"f").getPropertyType(e))}getEnumValues(e){return oe("enumProperty",e,J()),C(E(ge(this,he,"f").getEnumValues(e)))}setBool(e,t,r){return oe("id",e,K()),oe("property",t,J()),oe("value",r,X()),E(ge(this,he,"f").setBool(e,t,r))}getBool(e,t){return oe("id",e,K()),oe("property",t,J()),E(ge(this,he,"f").getBool(e,t))}setInt(e,t,r){return oe("id",e,K()),oe("property",t,J()),oe("value",r,K()),E(ge(this,he,"f").setInt(e,t,r))}getInt(e,t){return oe("id",e,K()),oe("property",t,J()),E(ge(this,he,"f").getInt(e,t))}setFloat(e,t,r){return oe("id",e,K()),oe("property",t,J()),oe("value",r,Q()),E(ge(this,he,"f").setFloat(e,t,r))}getFloat(e,t){return oe("id",e,K()),oe("property",t,J()),E(ge(this,he,"f").getFloat(e,t))}setDouble(e,t,r){return oe("id",e,K()),oe("property",t,J()),oe("value",r,Q()),E(ge(this,he,"f").setDouble(e,t,r))}getDouble(e,t){return oe("id",e,K()),oe("property",t,J()),E(ge(this,he,"f").getDouble(e,t))}setString(e,t,r){return oe("id",e,K()),oe("property",t,J()),oe("value",r,J()),E(ge(this,he,"f").setString(e,t,r))}getString(e,t){return oe("id",e,K()),oe("property",t,J()),E(ge(this,he,"f").getString(e,t))}setColor(e,t,r){return oe("id",e,K()),oe("property",t,J()),E(ge(this,he,"f").setColor(e,t,i.fromColor(r)))}getColor(e,t){return oe("id",e,K()),oe("property",t,J()),i.toColor(E(ge(this,he,"f").getColor(e,t)))}setColorRGBA(e,t,r,n,o,i=1){return oe("id",e,K()),oe("property",t,J()),oe("r",r,Q()),oe("g",n,Q()),oe("b",o,Q()),oe("a",i,Q()),E(ge(this,he,"f").setColorRGBA(e,t,r,n,o,i))}getColorRGBA(e,t){return oe("id",e,K()),oe("property",t,J()),E(ge(this,he,"f").getColorRGBA(e,t))}setColorSpot(e,t,r,n=1){return oe("id",e,K()),oe("property",t,J()),oe("name",r,J()),oe("tint",n,Q()),E(ge(this,he,"f").setColorSpot(e,t,r,n))}getColorSpotName(e,t){return oe("id",e,K()),oe("property",t,J()),E(ge(this,he,"f").getColorSpotName(e,t))}getColorSpotTint(e,t){return oe("id",e,K()),oe("property",t,J()),E(ge(this,he,"f").getColorSpotTint(e,t))}setGradientColorStops(e,t,r){oe("id",e,K()),oe("property",t,J());const n=r.map((e=>({color:i.fromColor(e.color),stop:e.stop})));return E(ge(this,he,"f").setGradientColorStops(e,t,n))}getGradientColorStops(e,t){oe("id",e,K()),oe("property",t,J());const r=E(ge(this,he,"f").getGradientColorStops(e,t));return C(r).map((e=>({color:i.toColor(e.color),stop:e.stop})))}setEnum(e,t,r){return oe("id",e,K()),oe("property",t,J()),oe("value",r,J()),E(ge(this,he,"f").setEnum(e,t,r))}getEnum(e,t){return oe("id",e,K()),oe("property",t,J()),E(ge(this,he,"f").getEnum(e,t))}hasCrop(e){return oe("id",e,K()),E(ge(this,he,"f").hasCrop(e))}setCropScaleX(e,t){return oe("id",e,K()),oe("scaleX",t,Q()),E(ge(this,he,"f").setCropScaleX(e,t))}setCropScaleY(e,t){return oe("id",e,K()),oe("scaleY",t,Q()),E(ge(this,he,"f").setCropScaleY(e,t))}setCropRotation(e,t){return oe("id",e,K()),oe("rotation",t,Q()),E(ge(this,he,"f").setCropRotation(e,t))}setCropScaleRatio(e,t){return oe("id",e,K()),oe("scaleRatio",t,Q()),E(ge(this,he,"f").setCropScaleRatio(e,t))}setCropTranslationX(e,t){return oe("id",e,K()),oe("translationX",t,Q()),E(ge(this,he,"f").setCropTranslationX(e,t))}setCropTranslationY(e,t){return oe("id",e,K()),oe("translationY",t,Q()),E(ge(this,he,"f").setCropTranslationY(e,t))}resetCrop(e){return oe("id",e,K()),E(ge(this,he,"f").resetCrop(e))}getCropScaleX(e){return oe("id",e,K()),E(ge(this,he,"f").getCropScaleX(e))}getCropScaleY(e){return oe("id",e,K()),E(ge(this,he,"f").getCropScaleY(e))}getCropRotation(e){return oe("id",e,K()),E(ge(this,he,"f").getCropRotation(e))}getCropScaleRatio(e){return oe("id",e,K()),E(ge(this,he,"f").getCropScaleRatio(e))}getCropTranslationX(e){return oe("id",e,K()),E(ge(this,he,"f").getCropTranslationX(e))}getCropTranslationY(e){return oe("id",e,K()),E(ge(this,he,"f").getCropTranslationY(e))}adjustCropToFillFrame(e,t){return oe("id",e,K()),oe("minScaleRatio",t,Q()),E(ge(this,he,"f").adjustCropToFillFrame(e,t))}flipCropHorizontal(e){return oe("id",e,K()),E(ge(this,he,"f").flipCropHorizontal(e))}flipCropVertical(e){return oe("id",e,K()),E(ge(this,he,"f").flipCropVertical(e))}hasOpacity(e){return oe("id",e,K()),E(ge(this,he,"f").hasOpacity(e))}setOpacity(e,t){return oe("id",e,K()),oe("opacity",t,Q()),E(ge(this,he,"f").setOpacity(e,t))}getOpacity(e){return oe("id",e,K()),E(ge(this,he,"f").getOpacity(e))}hasBlendMode(e){return oe("id",e,K()),E(ge(this,he,"f").hasBlendMode(e))}setBlendMode(e,t){return oe("id",e,K()),oe("blendMode",t,J()),E(ge(this,he,"f").setBlendMode(e,t))}getBlendMode(e){return oe("id",e,K()),E(ge(this,he,"f").getBlendMode(e))}hasFillColor(e){return oe("id",e,K()),E(ge(this,he,"f").hasFillColor(e))}isIncludedInExport(e){return oe("id",e,K()),E(ge(this,he,"f").isIncludedInExport(e))}setIncludedInExport(e,t){return oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setIncludedInExport(e,t))}setFillColorRGBA(e,t,r,n,o=1){return oe("id",e,K()),oe("r",t,Q()),oe("g",r,Q()),oe("b",n,Q()),oe("a",o,Q()),E(ge(this,he,"f").setFillColorRGBA(e,t,r,n,o))}getFillColorRGBA(e){return oe("id",e,K()),E(ge(this,he,"f").getFillColorRGBA(e))}setFillColorEnabled(e,t){return oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setFillColorEnabled(e,t))}isFillColorEnabled(e){return oe("id",e,K()),E(ge(this,he,"f").isFillColorEnabled(e))}createEffect(e){return oe("type",e,J()),E(ge(this,he,"f").createEffect(e))}hasEffects(e){return oe("id",e,K()),E(ge(this,he,"f").hasEffects(e))}getEffects(e){oe("id",e,K());const t=E(ge(this,he,"f").getEffects(e));return C(t)}insertEffect(e,t,r){oe("id",e,K()),oe("effectId",t,K()),oe("index",r,te(K(),0)),E(ge(this,he,"f").insertEffect(e,t,r))}appendEffect(e,t){oe("id",e,K()),oe("effectId",t,K()),E(ge(this,he,"f").appendEffect(e,t))}removeEffect(e,t){oe("id",e,K()),oe("index",t,te(K(),0)),E(ge(this,he,"f").removeEffect(e,t))}hasEffectEnabled(e){return oe("effectId",e,K()),E(ge(this,he,"f").hasEffectEnabled(e))}setEffectEnabled(e,t){oe("effectId",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setEffectEnabled(e,t))}isEffectEnabled(e){return oe("effectId",e,K()),E(ge(this,he,"f").isEffectEnabled(e))}createBlur(e){return oe("type",e,J()),E(ge(this,he,"f").createBlur(e))}hasBlur(e){return oe("id",e,K()),E(ge(this,he,"f").hasBlur(e))}setBlur(e,t){oe("id",e,K()),oe("blurId",t,K()),E(ge(this,he,"f").setBlur(e,t))}getBlur(e){return oe("id",e,K()),E(ge(this,he,"f").getBlur(e))}setBlurEnabled(e,t){oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setBlurEnabled(e,t))}isBlurEnabled(e){return oe("id",e,K()),E(ge(this,he,"f").isBlurEnabled(e))}hasBackgroundColor(e){return oe("id",e,K()),E(ge(this,he,"f").hasBackgroundColor(e))}setBackgroundColorRGBA(e,t,r,n,o=1){return oe("id",e,K()),oe("r",t,Q()),oe("g",r,Q()),oe("b",n,Q()),oe("a",o,Q()),E(ge(this,he,"f").setBackgroundColorRGBA(e,t,r,n,o))}getBackgroundColorRGBA(e){return oe("id",e,K()),E(ge(this,he,"f").getBackgroundColorRGBA(e))}setBackgroundColorEnabled(e,t){return oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setBackgroundColorEnabled(e,t))}isBackgroundColorEnabled(e){return oe("id",e,K()),E(ge(this,he,"f").isBackgroundColorEnabled(e))}hasStroke(e){return oe("id",e,K()),E(ge(this,he,"f").hasStroke(e))}setStrokeEnabled(e,t){return oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setStrokeEnabled(e,t))}isStrokeEnabled(e){return oe("id",e,K()),E(ge(this,he,"f").isStrokeEnabled(e))}setStrokeColorRGBA(e,t,r,n,o=1){return oe("id",e,K()),oe("r",t,Q()),oe("g",r,Q()),oe("b",n,Q()),oe("a",o,Q()),E(ge(this,he,"f").setStrokeColorRGBA(e,t,r,n,o))}setStrokeColor(e,t){return oe("id",e,K()),E(ge(this,he,"f").setStrokeColor(e,i.fromColor(t)))}getStrokeColorRGBA(e){return oe("id",e,K()),E(ge(this,he,"f").getStrokeColorRGBA(e))}getStrokeColor(e){return oe("id",e,K()),i.toColor(E(ge(this,he,"f").getStrokeColor(e)))}setStrokeWidth(e,t){return oe("id",e,K()),oe("width",t,Q()),E(ge(this,he,"f").setStrokeWidth(e,t))}getStrokeWidth(e){return oe("id",e,K()),E(ge(this,he,"f").getStrokeWidth(e))}setStrokeStyle(e,t){return oe("id",e,K()),E(ge(this,he,"f").setStrokeStyle(e,t))}getStrokeStyle(e){return oe("id",e,K()),E(ge(this,he,"f").getStrokeStyle(e))}setStrokePosition(e,t){return oe("id",e,K()),E(ge(this,he,"f").setStrokePosition(e,t))}getStrokePosition(e){return oe("id",e,K()),E(ge(this,he,"f").getStrokePosition(e))}setStrokeCornerGeometry(e,t){return oe("id",e,K()),E(ge(this,he,"f").setStrokeCornerGeometry(e,t))}getStrokeCornerGeometry(e){return oe("id",e,K()),E(ge(this,he,"f").getStrokeCornerGeometry(e))}hasDropShadow(e){return oe("id",e,K()),E(ge(this,he,"f").hasDropShadow(e))}setDropShadowEnabled(e,t){return oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setDropShadowEnabled(e,t))}isDropShadowEnabled(e){return oe("id",e,K()),E(ge(this,he,"f").isDropShadowEnabled(e))}setDropShadowColorRGBA(e,t,r,n,o=1){return oe("id",e,K()),oe("r",t,Q()),oe("g",r,Q()),oe("b",n,Q()),oe("a",o,Q()),E(ge(this,he,"f").setDropShadowColorRGBA(e,t,r,n,o))}setDropShadowColor(e,t){return oe("id",e,K()),E(ge(this,he,"f").setDropShadowColor(e,i.fromColor(t)))}getDropShadowColorRGBA(e){return oe("id",e,K()),E(ge(this,he,"f").getDropShadowColorRGBA(e))}getDropShadowColor(e){return oe("id",e,K()),i.toColor(E(ge(this,he,"f").getDropShadowColor(e)))}setDropShadowOffsetX(e,t){return oe("id",e,K()),oe("offsetX",t,Q()),E(ge(this,he,"f").setDropShadowOffsetX(e,t))}getDropShadowOffsetX(e){return oe("id",e,K()),E(ge(this,he,"f").getDropShadowOffsetX(e))}setDropShadowOffsetY(e,t){return oe("id",e,K()),oe("offsetY",t,Q()),E(ge(this,he,"f").setDropShadowOffsetY(e,t))}getDropShadowOffsetY(e){return oe("id",e,K()),E(ge(this,he,"f").getDropShadowOffsetY(e))}setDropShadowBlurRadiusX(e,t){return oe("id",e,K()),oe("blurRadiusX",t,Q()),E(ge(this,he,"f").setDropShadowBlurRadiusX(e,t))}getDropShadowBlurRadiusX(e){return oe("id",e,K()),E(ge(this,he,"f").getDropShadowBlurRadiusX(e))}setDropShadowBlurRadiusY(e,t){return oe("id",e,K()),oe("blurRadiusY",t,Q()),E(ge(this,he,"f").setDropShadowBlurRadiusY(e,t))}getDropShadowBlurRadiusY(e){return oe("id",e,K()),E(ge(this,he,"f").getDropShadowBlurRadiusY(e))}setDropShadowClip(e,t){return oe("id",e,K()),E(ge(this,he,"f").setDropShadowClip(e,t))}getDropShadowClip(e){return oe("id",e,K()),E(ge(this,he,"f").getDropShadowClip(e))}createCutoutFromBlocks(e,t=2,r=4){return oe("ids",e,Y(K())),oe("vectorizeDistanceThreshold",t,Q()),oe("maxSmoothingDistance",r,Q()),E(ge(this,he,"f").createCutoutFromBlocks(e,t,r))}createCutoutFromPath(e){return oe("path",e,J()),E(ge(this,he,"f").createCutoutFromPath(e))}createCutoutFromOperation(e,t){return oe("ids",e,Y(K())),oe("op",t,function(){const e=["Difference","Intersection","Union","XOR"];return z("CutoutOperation",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}()),E(ge(this,he,"f").createCutoutFromOperation(e,t))}replaceText(e,t,r=-1,n=-1){oe("id",e,K()),oe("text",t,J()),oe("from",r,K()),oe("to",n,K()),E(ge(this,he,"f").replaceText(e,t,r,n))}removeText(e,t=-1,r=-1){oe("id",e,K()),oe("from",t,K()),oe("to",r,K()),E(ge(this,he,"f").removeText(e,t,r))}setTextColor(e,t,r=-1,n=-1){oe("id",e,K()),oe("from",r,K()),oe("to",n,K()),E(ge(this,he,"f").setTextColor(e,i.fromColor(t),r,n))}getTextColors(e,t=-1,r=-1){oe("id",e,K()),oe("from",t,K()),oe("to",r,K());const n=ge(this,he,"f").getTextColors(e,t,r);return C(E(n)).map((e=>i.toColor(e)))}getTextFontWeights(e,t=-1,r=-1){return oe("id",e,K()),oe("from",t,K()),oe("to",r,K()),C(E(ge(this,he,"f").getTextFontWeights(e,t,r)))}getTextFontStyles(e,t=-1,r=-1){return oe("id",e,K()),oe("from",t,K()),oe("to",r,K()),C(E(ge(this,he,"f").getTextFontStyles(e,t,r)))}getTextCases(e,t=-1,r=-1){return oe("id",e,K()),oe("from",t,K()),oe("to",r,K()),C(E(ge(this,he,"f").getTextCases(e,t,r)))}setTextCase(e,t,r=-1,n=-1){oe("id",e,K()),oe("textCase",t,J()),oe("from",r,K()),oe("to",n,K()),E(ge(this,he,"f").setTextCase(e,t,r,n))}getTextCursorRange(){return E(ge(this,he,"f").getTextCursorRange())}hasFill(e){return oe("id",e,K()),E(ge(this,he,"f").hasFill(e))}isFillEnabled(e){return oe("id",e,K()),E(ge(this,he,"f").isFillEnabled(e))}setFillEnabled(e,t){return oe("id",e,K()),E(ge(this,he,"f").setFillEnabled(e,t))}getFill(e){return oe("id",e,K()),E(ge(this,he,"f").getFill(e))}setFill(e,t){return oe("id",e,K()),oe("fill",t,K()),E(ge(this,he,"f").setFill(e,t))}setFillSolidColor(e,t,r,n,o=1){oe("id",e,K()),E(ge(this,he,"f").setFillSolidColor(e,t,r,n,o))}getFillSolidColor(e){return oe("id",e,K()),E(ge(this,he,"f").getFillSolidColor(e))}setPlaceholderEnabled(e,t){oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setPlaceholderEnabled(e,t))}isPlaceholderEnabled(e){return oe("id",e,K()),E(ge(this,he,"f").isPlaceholderEnabled(e))}hasPlaceholderBehavior(e){return oe("id",e,K()),E(ge(this,he,"f").hasPlaceholderBehavior(e))}setPlaceholderBehaviorEnabled(e,t){oe("id",e,K()),E(ge(this,he,"f").setPlaceholderBehaviorEnabled(e,t))}isPlaceholderBehaviorEnabled(e){return oe("id",e,K()),E(ge(this,he,"f").isPlaceholderBehaviorEnabled(e))}hasPlaceholderControls(e){return oe("id",e,K()),E(ge(this,he,"f").hasPlaceholderControls(e))}setPlaceholderControlsOverlayEnabled(e,t){return oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setPlaceholderControlsOverlayEnabled(e,t))}isPlaceholderControlsOverlayEnabled(e){return oe("id",e,K()),E(ge(this,he,"f").isPlaceholderControlsOverlayEnabled(e))}setPlaceholderControlsButtonEnabled(e,t){return oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setPlaceholderControlsButtonEnabled(e,t))}isPlaceholderControlsButtonEnabled(e){return oe("id",e,K()),E(ge(this,he,"f").isPlaceholderControlsButtonEnabled(e))}setMetadata(e,t,r){oe("id",e,K()),oe("key",t,J()),oe("value",r,J()),E(ge(this,he,"f").setMetadata(e,t,r))}getMetadata(e,t){return oe("id",e,K()),oe("key",t,J()),E(ge(this,he,"f").getMetadata(e,t))}hasMetadata(e,t){return oe("id",e,K()),oe("key",t,J()),E(ge(this,he,"f").hasMetadata(e,t))}findAllMetadata(e){return oe("id",e,K()),C(E(ge(this,he,"f").findAllMetadata(e)))}removeMetadata(e,t){oe("id",e,K()),oe("key",t,J()),E(ge(this,he,"f").removeMetadata(e,t))}setScopeEnabled(e,t,r){oe("id",e,K()),oe("key",t,J()),oe("enabled",r,X()),E(ge(this,he,"f").setScopeEnabled(e,t,r))}isScopeEnabled(e,t){return oe("id",e,K()),oe("key",t,J()),E(ge(this,he,"f").isScopeEnabled(e,t))}isAllowedByScope(e,t){return oe("id",e,K()),oe("key",t,J()),E(ge(this,he,"f").isAllowedByScope(e,t))}hasDuration(e){return oe("id",e,K()),E(ge(this,he,"f").hasDuration(e))}setDuration(e,t){return oe("id",e,K()),oe("duration",t,Q()),E(ge(this,he,"f").setDuration(e,t))}getDuration(e){return oe("id",e,K()),E(ge(this,he,"f").getDuration(e))}hasTimeOffset(e){return oe("id",e,K()),E(ge(this,he,"f").hasTimeOffset(e))}setTimeOffset(e,t){return oe("id",e,K()),oe("offset",t,Q()),E(ge(this,he,"f").setTimeOffset(e,t))}getTimeOffset(e){return oe("id",e,K()),E(ge(this,he,"f").getTimeOffset(e))}hasTrim(e){return oe("id",e,K()),E(ge(this,he,"f").hasTrim(e))}setTrimOffset(e,t){return oe("id",e,K()),oe("offset",t,Q()),E(ge(this,he,"f").setTrimOffset(e,t))}getTrimOffset(e){return oe("id",e,K()),E(ge(this,he,"f").getTrimOffset(e))}setTrimLength(e,t){return oe("id",e,K()),oe("length",t,Q()),E(ge(this,he,"f").setTrimLength(e,t))}getTrimLength(e){return oe("id",e,K()),E(ge(this,he,"f").getTrimLength(e))}getTotalSceneDuration(e){return oe("scene",e,K()),E(ge(this,he,"f").getTotalSceneDuration(e))}setPlaying(e,t){return oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setPlaying(e,t))}isPlaying(e){return oe("id",e,K()),E(ge(this,he,"f").isPlaying(e))}hasPlaybackTime(e){return oe("id",e,K()),E(ge(this,he,"f").hasPlaybackTime(e))}setPlaybackTime(e,t){return oe("id",e,K()),oe("time",t,Q()),E(ge(this,he,"f").setPlaybackTime(e,t))}getPlaybackTime(e){return oe("id",e,K()),E(ge(this,he,"f").getPlaybackTime(e))}setSoloPlaybackEnabled(e,t){return oe("id",e,K()),oe("enabled",t,X()),E(ge(this,he,"f").setSoloPlaybackEnabled(e,t))}isSoloPlaybackEnabled(e){return oe("id",e,K()),E(ge(this,he,"f").isSoloPlaybackEnabled(e))}hasPlaybackControl(e){return oe("id",e,K()),E(ge(this,he,"f").hasPlaybackControl(e))}setLooping(e,t){oe("id",e,K()),oe("looping",t,X()),E(ge(this,he,"f").setLooping(e,t))}isLooping(e){return oe("id",e,K()),E(ge(this,he,"f").isLooping(e))}setMuted(e,t){oe("id",e,K()),oe("muted",t,X()),E(ge(this,he,"f").setMuted(e,t))}isMuted(e){return oe("id",e,K()),E(ge(this,he,"f").isMuted(e))}setVolume(e,t){oe("id",e,K()),oe("volume",t,Q()),E(ge(this,he,"f").setVolume(e,t))}getVolume(e){return oe("id",e,K()),E(ge(this,he,"f").getVolume(e))}async forceLoadAVResource(e){return oe("id",e,K()),_((t=>ge(this,he,"f").forceLoadAVResource(e,t)))}getAVResourceTotalDuration(e){return oe("id",e,K()),E(ge(this,he,"f").getAVResourceTotalDuration(e))}getVideoWidth(e){return oe("id",e,K()),E(ge(this,he,"f").getVideoWidth(e))}getVideoHeight(e){return oe("id",e,K()),E(ge(this,he,"f").getVideoHeight(e))}generateVideoThumbnailSequence(e,t,r,n,o,i){return oe("id",e,K()),oe("thumbnailHeight",t,K()),oe("timeBegin",r,Q()),oe("timeEnd",n,Q()),oe("numberOfFrames",o,K()),ge(this,he,"f").generateVideoThumbnailSequence(e,t,r,n,o,(e=>{"error"in e?i(0,new Error(e.error)):i(e.frameIndex,new ImageData(new Uint8ClampedArray(e.imageData),e.width,e.height))})),()=>{E(ge(this,he,"f").cancelVideoThumbnailSequenceGeneration(e))}}async getVideoFillThumbnail(e,t){return oe("id",e,K()),oe("thumbnailHeight",t,K()),new Promise(((r,n)=>{ge(this,he,"f").getVideoFillThumbnail(e,t,(e=>{"error"in e?n(e.error):r(new le([e],{type:"image/jpeg"}))}))}))}async getVideoFillThumbnailAtlas(e,t,r,n){return oe("id",e,K()),oe("numberOfColumns",t,K()),oe("numberOfRows",r,K()),oe("thumbnailHeight",n,K()),new Promise(((o,i)=>{ge(this,he,"f").getVideoFillThumbnailAtlas(e,t,r,n,(e=>{"error"in e?i(e.error):o(new le([e],{type:"image/jpeg"}))}))}))}async getPageThumbnailAtlas(e,t,r,n){return oe("id",e,K()),oe("numberOfColumns",t,K()),oe("numberOfRows",r,K()),new Promise(((o,i)=>{ge(this,he,"f").getPageThumbnailAtlas(e,t,r,n,(e=>{"error"in e?i(e.error):o(new le([e],{type:"image/jpeg"}))}))}))}setNativePixelBuffer(e,t){t instanceof HTMLVideoElement&&(t.width=t.videoWidth,t.height=t.videoHeight),E(ge(this,he,"f").setNativePixelBuffer(e,t))}}he=new WeakMap,me([o],ye.prototype,"loadFromString",null),me([o],ye.prototype,"create",null),me([o],ye.prototype,"createFill",null),me([t],ye.prototype,"getType",null),me([o],ye.prototype,"select",null),me([o],ye.prototype,"setSelected",null),me([t],ye.prototype,"isSelected",null),me([t],ye.prototype,"findAllSelected",null),me([t],ye.prototype,"isGroupable",null),me([o],ye.prototype,"group",null),me([o],ye.prototype,"ungroup",null),me([o],ye.prototype,"enterGroup",null),me([o],ye.prototype,"exitGroup",null),me([o],ye.prototype,"setName",null),me([t],ye.prototype,"getName",null),me([t],ye.prototype,"getUUID",null),me([t],ye.prototype,"findByName",null),me([t],ye.prototype,"findByType",null),me([t],ye.prototype,"findAll",null),me([t],ye.prototype,"findAllPlaceholders",null),me([o],ye.prototype,"createShape",null),me([t],ye.prototype,"hasShape",null),me([t],ye.prototype,"getShape",null),me([o],ye.prototype,"setShape",null),me([t],ye.prototype,"isVisible",null),me([o],ye.prototype,"setVisible",null),me([t],ye.prototype,"isClipped",null),me([o],ye.prototype,"setClipped",null),me([t],ye.prototype,"isTransformLocked",null),me([o],ye.prototype,"setTransformLocked",null),me([t],ye.prototype,"getPositionX",null),me([t],ye.prototype,"getPositionXMode",null),me([t],ye.prototype,"getPositionY",null),me([t],ye.prototype,"getPositionYMode",null),me([o],ye.prototype,"setPositionX",null),me([o],ye.prototype,"setPositionXMode",null),me([o],ye.prototype,"setPositionY",null),me([o],ye.prototype,"setPositionYMode",null),me([o],ye.prototype,"setAlwaysOnTop",null),me([o],ye.prototype,"setAlwaysOnBottom",null),me([t],ye.prototype,"isAlwaysOnTop",null),me([t],ye.prototype,"isAlwaysOnBottom",null),me([o],ye.prototype,"bringToFront",null),me([o],ye.prototype,"sendToBack",null),me([o],ye.prototype,"bringForward",null),me([o],ye.prototype,"sendBackward",null),me([t],ye.prototype,"getRotation",null),me([o],ye.prototype,"setRotation",null),me([t],ye.prototype,"getFlipHorizontal",null),me([t],ye.prototype,"getFlipVertical",null),me([o],ye.prototype,"setFlipHorizontal",null),me([o],ye.prototype,"setFlipVertical",null),me([t],ye.prototype,"hasContentFillMode",null),me([t],ye.prototype,"getWidth",null),me([t],ye.prototype,"getWidthMode",null),me([t],ye.prototype,"getHeight",null),me([t],ye.prototype,"getHeightMode",null),me([o],ye.prototype,"setWidth",null),me([o],ye.prototype,"setWidthMode",null),me([o],ye.prototype,"setHeight",null),me([o],ye.prototype,"setHeightMode",null),me([t],ye.prototype,"getFrameX",null),me([t],ye.prototype,"getFrameY",null),me([t],ye.prototype,"getFrameWidth",null),me([t],ye.prototype,"getFrameHeight",null),me([o],ye.prototype,"setContentFillMode",null),me([t],ye.prototype,"getContentFillMode",null),me([o],ye.prototype,"duplicate",null),me([o],ye.prototype,"destroy",null),me([t],ye.prototype,"isValid",null),me([t],ye.prototype,"getParent",null),me([t],ye.prototype,"getChildren",null),me([o],ye.prototype,"insertChild",null),me([o],ye.prototype,"appendChild",null),me([t],ye.prototype,"referencesAnyVariables",null),me([t],ye.prototype,"getGlobalBoundingBoxX",null),me([t],ye.prototype,"getGlobalBoundingBoxY",null),me([t],ye.prototype,"getGlobalBoundingBoxWidth",null),me([t],ye.prototype,"getGlobalBoundingBoxHeight",null),me([t],ye.prototype,"getScreenSpaceBoundingBoxXYWH",null),me([o],ye.prototype,"alignHorizontally",null),me([o],ye.prototype,"alignVertically",null),me([t],ye.prototype,"isAlignable",null),me([o],ye.prototype,"distributeHorizontally",null),me([o],ye.prototype,"distributeVertically",null),me([o],ye.prototype,"isDistributable",null),me([o],ye.prototype,"fillParent",null),me([o],ye.prototype,"resizeContentAware",null),me([o],ye.prototype,"scale",null),me([t],ye.prototype,"findAllProperties",null),me([t],ye.prototype,"isPropertyReadable",null),me([t],ye.prototype,"isPropertyWritable",null),me([t],ye.prototype,"getPropertyType",null),me([t],ye.prototype,"getEnumValues",null),me([o],ye.prototype,"setBool",null),me([t],ye.prototype,"getBool",null),me([o],ye.prototype,"setInt",null),me([t],ye.prototype,"getInt",null),me([o],ye.prototype,"setFloat",null),me([t],ye.prototype,"getFloat",null),me([o],ye.prototype,"setDouble",null),me([t],ye.prototype,"getDouble",null),me([o],ye.prototype,"setString",null),me([t],ye.prototype,"getString",null),me([o],ye.prototype,"setColor",null),me([t],ye.prototype,"getColor",null),me([o],ye.prototype,"setColorRGBA",null),me([t],ye.prototype,"getColorRGBA",null),me([o],ye.prototype,"setColorSpot",null),me([t],ye.prototype,"getColorSpotName",null),me([t],ye.prototype,"getColorSpotTint",null),me([o],ye.prototype,"setGradientColorStops",null),me([t],ye.prototype,"getGradientColorStops",null),me([o],ye.prototype,"setEnum",null),me([t],ye.prototype,"getEnum",null),me([t],ye.prototype,"hasCrop",null),me([o],ye.prototype,"setCropScaleX",null),me([o],ye.prototype,"setCropScaleY",null),me([o],ye.prototype,"setCropRotation",null),me([o],ye.prototype,"setCropScaleRatio",null),me([o],ye.prototype,"setCropTranslationX",null),me([o],ye.prototype,"setCropTranslationY",null),me([o],ye.prototype,"resetCrop",null),me([t],ye.prototype,"getCropScaleX",null),me([t],ye.prototype,"getCropScaleY",null),me([t],ye.prototype,"getCropRotation",null),me([t],ye.prototype,"getCropScaleRatio",null),me([t],ye.prototype,"getCropTranslationX",null),me([t],ye.prototype,"getCropTranslationY",null),me([o],ye.prototype,"adjustCropToFillFrame",null),me([o],ye.prototype,"flipCropHorizontal",null),me([o],ye.prototype,"flipCropVertical",null),me([t],ye.prototype,"hasOpacity",null),me([o],ye.prototype,"setOpacity",null),me([t],ye.prototype,"getOpacity",null),me([t],ye.prototype,"hasBlendMode",null),me([o],ye.prototype,"setBlendMode",null),me([t],ye.prototype,"getBlendMode",null),me([t],ye.prototype,"hasFillColor",null),me([t],ye.prototype,"isIncludedInExport",null),me([o],ye.prototype,"setIncludedInExport",null),me([o],ye.prototype,"setFillColorRGBA",null),me([t],ye.prototype,"getFillColorRGBA",null),me([o],ye.prototype,"setFillColorEnabled",null),me([t],ye.prototype,"isFillColorEnabled",null),me([o],ye.prototype,"createEffect",null),me([t],ye.prototype,"hasEffects",null),me([t],ye.prototype,"getEffects",null),me([o],ye.prototype,"insertEffect",null),me([o],ye.prototype,"appendEffect",null),me([o],ye.prototype,"removeEffect",null),me([t],ye.prototype,"hasEffectEnabled",null),me([o],ye.prototype,"setEffectEnabled",null),me([t],ye.prototype,"isEffectEnabled",null),me([o],ye.prototype,"createBlur",null),me([t],ye.prototype,"hasBlur",null),me([o],ye.prototype,"setBlur",null),me([t],ye.prototype,"getBlur",null),me([o],ye.prototype,"setBlurEnabled",null),me([t],ye.prototype,"isBlurEnabled",null),me([t],ye.prototype,"hasBackgroundColor",null),me([o],ye.prototype,"setBackgroundColorRGBA",null),me([t],ye.prototype,"getBackgroundColorRGBA",null),me([o],ye.prototype,"setBackgroundColorEnabled",null),me([t],ye.prototype,"isBackgroundColorEnabled",null),me([t],ye.prototype,"hasStroke",null),me([o],ye.prototype,"setStrokeEnabled",null),me([t],ye.prototype,"isStrokeEnabled",null),me([o],ye.prototype,"setStrokeColorRGBA",null),me([o],ye.prototype,"setStrokeColor",null),me([t],ye.prototype,"getStrokeColorRGBA",null),me([t],ye.prototype,"getStrokeColor",null),me([o],ye.prototype,"setStrokeWidth",null),me([t],ye.prototype,"getStrokeWidth",null),me([o],ye.prototype,"setStrokeStyle",null),me([t],ye.prototype,"getStrokeStyle",null),me([o],ye.prototype,"setStrokePosition",null),me([t],ye.prototype,"getStrokePosition",null),me([o],ye.prototype,"setStrokeCornerGeometry",null),me([t],ye.prototype,"getStrokeCornerGeometry",null),me([t],ye.prototype,"hasDropShadow",null),me([o],ye.prototype,"setDropShadowEnabled",null),me([t],ye.prototype,"isDropShadowEnabled",null),me([o],ye.prototype,"setDropShadowColorRGBA",null),me([o],ye.prototype,"setDropShadowColor",null),me([t],ye.prototype,"getDropShadowColorRGBA",null),me([t],ye.prototype,"getDropShadowColor",null),me([o],ye.prototype,"setDropShadowOffsetX",null),me([t],ye.prototype,"getDropShadowOffsetX",null),me([o],ye.prototype,"setDropShadowOffsetY",null),me([t],ye.prototype,"getDropShadowOffsetY",null),me([o],ye.prototype,"setDropShadowBlurRadiusX",null),me([t],ye.prototype,"getDropShadowBlurRadiusX",null),me([o],ye.prototype,"setDropShadowBlurRadiusY",null),me([t],ye.prototype,"getDropShadowBlurRadiusY",null),me([o],ye.prototype,"setDropShadowClip",null),me([t],ye.prototype,"getDropShadowClip",null),me([o],ye.prototype,"createCutoutFromBlocks",null),me([o],ye.prototype,"createCutoutFromPath",null),me([o],ye.prototype,"createCutoutFromOperation",null),me([o],ye.prototype,"replaceText",null),me([o],ye.prototype,"removeText",null),me([o],ye.prototype,"setTextColor",null),me([t],ye.prototype,"getTextColors",null),me([t],ye.prototype,"getTextFontWeights",null),me([t],ye.prototype,"getTextFontStyles",null),me([t],ye.prototype,"getTextCases",null),me([o],ye.prototype,"setTextCase",null),me([t],ye.prototype,"getTextCursorRange",null),me([t],ye.prototype,"hasFill",null),me([t],ye.prototype,"isFillEnabled",null),me([o],ye.prototype,"setFillEnabled",null),me([t],ye.prototype,"getFill",null),me([o],ye.prototype,"setFill",null),me([o],ye.prototype,"setFillSolidColor",null),me([t],ye.prototype,"getFillSolidColor",null),me([o],ye.prototype,"setPlaceholderEnabled",null),me([t],ye.prototype,"isPlaceholderEnabled",null),me([t],ye.prototype,"hasPlaceholderBehavior",null),me([o],ye.prototype,"setPlaceholderBehaviorEnabled",null),me([t],ye.prototype,"isPlaceholderBehaviorEnabled",null),me([t],ye.prototype,"hasPlaceholderControls",null),me([o],ye.prototype,"setPlaceholderControlsOverlayEnabled",null),me([t],ye.prototype,"isPlaceholderControlsOverlayEnabled",null),me([o],ye.prototype,"setPlaceholderControlsButtonEnabled",null),me([t],ye.prototype,"isPlaceholderControlsButtonEnabled",null),me([o],ye.prototype,"setMetadata",null),me([t],ye.prototype,"getMetadata",null),me([t],ye.prototype,"hasMetadata",null),me([t],ye.prototype,"findAllMetadata",null),me([o],ye.prototype,"removeMetadata",null),me([o],ye.prototype,"setScopeEnabled",null),me([t],ye.prototype,"isScopeEnabled",null),me([t],ye.prototype,"isAllowedByScope",null),me([t],ye.prototype,"hasDuration",null),me([o],ye.prototype,"setDuration",null),me([t],ye.prototype,"getDuration",null),me([t],ye.prototype,"hasTimeOffset",null),me([o],ye.prototype,"setTimeOffset",null),me([t],ye.prototype,"getTimeOffset",null),me([t],ye.prototype,"hasTrim",null),me([o],ye.prototype,"setTrimOffset",null),me([t],ye.prototype,"getTrimOffset",null),me([o],ye.prototype,"setTrimLength",null),me([t],ye.prototype,"getTrimLength",null),me([t],ye.prototype,"getTotalSceneDuration",null),me([o],ye.prototype,"setPlaying",null),me([t],ye.prototype,"isPlaying",null),me([t],ye.prototype,"hasPlaybackTime",null),me([o],ye.prototype,"setPlaybackTime",null),me([t],ye.prototype,"getPlaybackTime",null),me([o],ye.prototype,"setSoloPlaybackEnabled",null),me([t],ye.prototype,"isSoloPlaybackEnabled",null),me([t],ye.prototype,"hasPlaybackControl",null),me([o],ye.prototype,"setLooping",null),me([t],ye.prototype,"isLooping",null),me([o],ye.prototype,"setMuted",null),me([t],ye.prototype,"isMuted",null),me([o],ye.prototype,"setVolume",null),me([t],ye.prototype,"getVolume",null),me([o],ye.prototype,"forceLoadAVResource",null),me([t],ye.prototype,"getAVResourceTotalDuration",null),me([t],ye.prototype,"getVideoWidth",null),me([t],ye.prototype,"getVideoHeight",null),me([t],ye.prototype,"getVideoFillThumbnail",null),me([t],ye.prototype,"getVideoFillThumbnailAtlas",null),me([t],ye.prototype,"getPageThumbnailAtlas",null);var ve,be=function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},we=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class Ee{constructor(e){ve.set(this,void 0),Object.defineProperty(this,"onStateChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=we(this,ve,"f").subscribeToEditorState(e);return()=>{we(this,ve,"f").isDeleted()||E(we(this,ve,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onHistoryUpdated",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=we(this,ve,"f").subscribeToHistory(e);return()=>{we(this,ve,"f").isDeleted()||we(this,ve,"f").unsubscribe(t)}}}),Object.defineProperty(this,"onSettingsChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=we(this,ve,"f").subscribeToSettings(e);return()=>{we(this,ve,"f").isDeleted()||E(we(this,ve,"f").unsubscribe(t))}}}),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,ve,e,"f")}unlockWithLicense(e){E(we(this,ve,"f").unlockWithLicense(e))}getActiveLicense(){return E(we(this,ve,"f").getActiveLicense())}setEditMode(e){oe("keypath",e,J()),we(this,ve,"f").setEditMode(e)}getEditMode(){return we(this,ve,"f").getEditMode()}getCursorType(){return we(this,ve,"f").getCursorType()}getCursorRotation(){return we(this,ve,"f").getCursorRotation()}getTextCursorPositionInScreenSpaceX(){return we(this,ve,"f").getTextCursorPositionInScreenSpaceX()}getTextCursorPositionInScreenSpaceY(){return we(this,ve,"f").getTextCursorPositionInScreenSpaceY()}createHistory(){return we(this,ve,"f").createHistory()}destroyHistory(e){E(we(this,ve,"f").destroyHistory(e))}setActiveHistory(e){E(we(this,ve,"f").setActiveHistory(e))}getActiveHistory(){return we(this,ve,"f").getActiveHistory()}addUndoStep(){E(we(this,ve,"f").addUndoStep())}undo(){E(we(this,ve,"f").undo())}redo(){E(we(this,ve,"f").redo())}canUndo(){return E(we(this,ve,"f").canUndo())}canRedo(){return E(we(this,ve,"f").canRedo())}setSettingBool(e,t){return oe("keypath",e,J()),oe("value",t,X()),E(we(this,ve,"f").setSettingBool(e,t))}getSettingBool(e){return oe("keypath",e,J()),E(we(this,ve,"f").getSettingBool(e))}setSettingInt(e,t){return oe("keypath",e,J()),oe("value",t,K()),E(we(this,ve,"f").setSettingInt(e,t))}getSettingInt(e){return oe("keypath",e,J()),E(we(this,ve,"f").getSettingInt(e))}setSettingFloat(e,t){return oe("keypath",e,J()),oe("value",t,Q()),E(we(this,ve,"f").setSettingFloat(e,t))}getSettingFloat(e){return oe("keypath",e,J()),E(we(this,ve,"f").getSettingFloat(e))}setSettingString(e,t){return oe("keypath",e,J()),oe("value",t,J()),E(we(this,ve,"f").setSettingString(e,t))}getSettingString(e){return oe("keypath",e,J()),E(we(this,ve,"f").getSettingString(e))}setSettingColor(e,t){return oe("keypath",e,J()),E(we(this,ve,"f").setSettingColor(e,i.fromColor(t)))}getSettingColor(e){return oe("keypath",e,J()),i.toColor(E(we(this,ve,"f").getSettingColor(e)))}setSettingColorRGBA(e,t,r,n,o=1){return oe("keypath",e,J()),oe("r",t,Q()),oe("g",r,Q()),oe("b",n,Q()),oe("a",o,Q()),E(we(this,ve,"f").setSettingColorRGBA(e,t,r,n,o))}getSettingColorRGBA(e){return oe("keypath",e,J()),E(we(this,ve,"f").getSettingColorRGBA(e))}setSettingEnum(e,t){return oe("keypath",e,J()),oe("value",t,J()),E(we(this,ve,"f").setSettingEnum(e,t))}getSettingEnum(e){return oe("keypath",e,J()),E(we(this,ve,"f").getSettingEnum(e))}getSettingEnumOptions(e){return oe("keypath",e,J()),C(E(we(this,ve,"f").getSettingEnumOptions(e)))}findAllSettings(){return C(we(this,ve,"f").findAllSettings())}getSettingType(e){return oe("keypath",e,J()),E(we(this,ve,"f").getSettingType(e))}getAvailableMemory(){return E(we(this,ve,"f").getAvailableMemory())}getUsedMemory(){return E(we(this,ve,"f").getUsedMemory())}setURIResolver(e){return E(we(this,ve,"f").setURIResolver(e))}defaultURIResolver(e){return we(this,ve,"f").defaultURIResolver(e)}getAbsoluteURI(e){return E(we(this,ve,"f").getAbsoluteURI(e))}setGlobalScope(e,t){oe("key",e,J()),oe("value",t,J()),E(we(this,ve,"f").setGlobalScope(e,t))}getGlobalScope(e){return oe("key",e,J()),E(we(this,ve,"f").getGlobalScope(e))}findAllSpotColors(){return C(we(this,ve,"f").findAllSpotColors())}getSpotColorRGBA(e){return oe("name",e,J()),we(this,ve,"f").getSpotColorRGB(e)}getSpotColorCMYK(e){return oe("name",e,J()),we(this,ve,"f").getSpotColorCMYK(e)}setSpotColorRGB(e,t,r,n){return oe("name",e,J()),oe("r",t,Q()),oe("g",r,Q()),oe("b",n,Q()),we(this,ve,"f").setSpotColorRGB(e,t,r,n)}setSpotColorCMYK(e,t,r,n,o){return oe("name",e,J()),oe("c",t,Q()),oe("m",r,Q()),oe("y",n,Q()),oe("k",o,Q()),we(this,ve,"f").setSpotColorCMYK(e,t,r,n,o)}removeSpotColor(e){return oe("name",e,J()),E(we(this,ve,"f").removeSpotColor(e))}setSpotColorForCutoutType(e,t){return oe("type",e,J()),oe("color",t,J()),E(we(this,ve,"f").setSpotColorForCutoutType(e,t))}getSpotColorForCutoutType(e){return oe("type",e,J()),E(we(this,ve,"f").getSpotColorForCutoutType(e))}convertColorToColorSpace(e,t){return oe("colorSpace",t,J()),i.toColor(E(we(this,ve,"f").convertColorToColorSpace(i.fromColor(e),t)))}}ve=new WeakMap,be([o],Ee.prototype,"setEditMode",null),be([t],Ee.prototype,"getEditMode",null),be([t],Ee.prototype,"getCursorType",null),be([t],Ee.prototype,"getCursorRotation",null),be([t],Ee.prototype,"getTextCursorPositionInScreenSpaceX",null),be([t],Ee.prototype,"getTextCursorPositionInScreenSpaceY",null),be([o],Ee.prototype,"createHistory",null),be([o],Ee.prototype,"destroyHistory",null),be([o],Ee.prototype,"setActiveHistory",null),be([t],Ee.prototype,"getActiveHistory",null),be([o],Ee.prototype,"addUndoStep",null),be([o],Ee.prototype,"undo",null),be([o],Ee.prototype,"redo",null),be([t],Ee.prototype,"canUndo",null),be([t],Ee.prototype,"canRedo",null),be([o],Ee.prototype,"setSettingBool",null),be([t],Ee.prototype,"getSettingBool",null),be([o],Ee.prototype,"setSettingInt",null),be([t],Ee.prototype,"getSettingInt",null),be([o],Ee.prototype,"setSettingFloat",null),be([t],Ee.prototype,"getSettingFloat",null),be([o],Ee.prototype,"setSettingString",null),be([t],Ee.prototype,"getSettingString",null),be([o],Ee.prototype,"setSettingColor",null),be([t],Ee.prototype,"getSettingColor",null),be([o],Ee.prototype,"setSettingColorRGBA",null),be([t],Ee.prototype,"getSettingColorRGBA",null),be([o],Ee.prototype,"setSettingEnum",null),be([t],Ee.prototype,"getSettingEnum",null),be([t],Ee.prototype,"getAvailableMemory",null),be([t],Ee.prototype,"getUsedMemory",null),be([o],Ee.prototype,"setURIResolver",null),be([t],Ee.prototype,"defaultURIResolver",null),be([t],Ee.prototype,"getAbsoluteURI",null),be([o],Ee.prototype,"setGlobalScope",null),be([t],Ee.prototype,"getGlobalScope",null),be([t],Ee.prototype,"findAllSpotColors",null),be([t],Ee.prototype,"getSpotColorRGBA",null),be([t],Ee.prototype,"getSpotColorCMYK",null),be([o],Ee.prototype,"setSpotColorRGB",null),be([o],Ee.prototype,"setSpotColorCMYK",null),be([o],Ee.prototype,"removeSpotColor",null),be([o],Ee.prototype,"setSpotColorForCutoutType",null),be([o],Ee.prototype,"getSpotColorForCutoutType",null);var _e,Ce=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class Se{constructor(e){_e.set(this,void 0),Object.defineProperty(this,"subscribe",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>{oe("blocks",e,Y());const r=Ce(this,_e,"f").subscribe(e,(e=>{try{t(C(e,!0))}catch(e){console.error(e)}}));return()=>{Ce(this,_e,"f").isDeleted()||E(Ce(this,_e,"f").unsubscribe(r))}}}),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,_e,e,"f")}}_e=new WeakMap;var ke,xe=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class Pe{constructor(e){ke.set(this,void 0),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,ke,e,"f")}findAll(){return C(xe(this,ke,"f").findAllVariables())}setString(e,t){return oe("key",e,J()),oe("value",t,J()),E(xe(this,ke,"f").setVariableString(e,t))}getString(e){return oe("key",e,J()),E(xe(this,ke,"f").getVariableString(e))}remove(e){return oe("key",e,J()),E(xe(this,ke,"f").removeVariable(e))}}ke=new WeakMap;const Te=require("fs/promises");var Ae=r.n(Te),Fe=r(310);const De=function(){if("undefined"!=typeof fetch)return fetch;if("undefined"!=typeof window)throw new Error("Could not find `fetch` API");try{return r(809)}catch(e){throw new Error("Could not find a `fetch` implementation. Please make sure you're using Node.JS >= 18, or install the node-fetch@cjs package, or provide another polyfill.")}}();async function Be(e){if(!e.match(/^file:/))return De(e);try{const t=await Ae().readFile((0,Fe.fileURLToPath)(e),{encoding:"utf8"}),r=JSON.parse(t);return{ok:!0,json:async()=>r}}catch(e){return{ok:!1,statusText:e.message}}}const Le=De;var Re=r(502),Me=r.n(Re);const Oe=r.p+"assets/core/cesdk-v1.19.0-d92fadafda0b5129818d.data",Ie=r.p+"assets/core/cesdk-v1.19.0-2f81b16d51daa43c1ea7.wasm",Ue=Me();function je(e,t){const r=t.split("/").pop(),n=new URL(r,e.core.baseURL);return"file:"===n.protocol?(0,Fe.fileURLToPath)(n):new URL(r,e.core.baseURL).toString()}var $e,Ne,He,qe,Ve,We,Ge,ze=function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},Ye=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class Xe{constructor(e,t){$e.add(this),Object.defineProperty(this,"asset",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"block",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"editor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scene",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"variable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Ne.set(this,void 0),He.set(this,void 0),qe.set(this,void 0),ze(this,He,e,"f"),ze(this,Ne,new w(e),"f"),this.asset=new B(e),this.block=new ye(e),this.editor=new Ee(e),this.event=new Se(e),this.scene=new pe(e),this.variable=new Pe(e),this.block.exportVideo=()=>{throw new Error("Exporting video is currently not supported on Node.JS")},Ye(this,$e,"m",Ve).call(this),"undefined"!=typeof window&&window.Cypress&&(this.config=t,this.helper=Ye(this,Ne,"f"))}update(){Ye(this,He,"f").update()}dispose(){Ye(this,$e,"m",Ge).call(this),ze(this,Ne,null,"f"),this.block=null,this.scene=null,this.variable=null,Ye(this,He,"f").delete(),ze(this,He,null,"f")}static async init(e){console.log("[CreativeEngine] Revision 4c5762e14fc0b5a1c0a0e128c9258d3a23e48d33");const t=function(e){var t;return e&&"callbacks"in e&&(null===(t=e.callbacks)||void 0===t?void 0:t.log)&&!e.logger?Object.assign(Object.assign({},e),{logger:e.callbacks.log}):e}(e),r=function(e={},t="https://cdn.img.ly/packages/imgly/cesdk-engine/1.19.0/assets"){var r,n,o,i,a,s,u,l,c,d,f;const p=Object.assign(Object.assign({},e),{license:null!==(r=e.license)&&void 0!==r?r:"",featureFlags:null!==(n=e.featureFlags)&&void 0!==n?n:{},baseURL:null!==(o=e.baseURL)&&void 0!==o?o:t,core:null!==(i=e.core)&&void 0!==i?i:{baseURL:"core/"},extensions:null!==(a=e.extensions)&&void 0!==a?a:Object.assign({},M),logger:null!==(s=e.logger)&&void 0!==s?s:R,presets:null!==(u=e.presets)&&void 0!==u?u:{}});return null!==(l=(d=p.extensions).baseURL)&&void 0!==l||(d.baseURL=M.baseURL),null!==(c=(f=p.extensions).entries)&&void 0!==c||(f.entries=Object.assign({},M.entries)),p.baseURL=O(p.baseURL),p.baseURL=I(p.baseURL),p.core.baseURL=O(p.core.baseURL,p.baseURL),p.core.baseURL=I(p.core.baseURL),p.extensions.baseURL=I(p.extensions.baseURL),p.extensions.entries=p.extensions.entries.map((e=>I(e))),p}(t,`file://${__dirname}/assets/`);for(const t of function(e){var t;const r=[];return e?("callbacks"in e&&(null===(t=e.callbacks)||void 0===t?void 0:t.log)&&r.push("config.callbacks.log has been moved to config.logger"),e.scene&&r.push("config.scene options have been removed. You can set a scene's dpi and pixelScaleFactor via the BlockApi's setInt(sceneId, 'scene/dpi', dpi) and setInt(sceneId, 'scene/pixelScaleFactor', factor)."),e.page&&r.push("config.page options have been moved to the EditorAPI"),e.variables&&r.push("config.variables has been removed. Please use the VariableAPI instead"),r):r}(e))r.logger(t,"Warning");const n=new this(await async function(e){const t=e.logger,r=function(e,t=window.fetch){if(!e.license)throw new Error("Missing license key in config");return e.license.length<128?t("https://api.img.ly/activate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:e.license,userId:e.userId})}).then((e=>{if(e.ok)return e.json();throw new Error("Unfortunately we are experiencing a server down time and your License key cannot be validated. We're already working on a fix and will restore service soon. Should services not restore within the hour, kindly get in touch with our support team.")})).then((e=>{if("valid"===e.status)return e.license;throw"expired"===e.status?new Error("Thanks for using IMG.LY for creative editing. Please note that your license file or commercial use is expired. Please get in touch with our sales team to discuss extension of your commercial license."):new Error("The License Key (API Key) you are using to access the IMG.LY SDK is invalid. Please ensure that you are using the license key tied to your subscription and get in touch with our support team.")})):Promise.resolve(e.license)}(e,Le),{getPreloadedPackage:n,instantiateWasm:o}=await async function(e){if(!e.core.baseURL.startsWith("http"))return{};const t=je(e,Oe),r=je(e,Ie),n=Le(t).then((e=>{if(e.status>=400)throw new Error(`Failed to fetch DATA package: ${e.status} ${e.statusText}`);return e.arrayBuffer()})),o=await n;return{getPreloadedPackage:function(e,r){if(e===t){if(r!==o.byteLength)throw new Error(`Attempt to get preloaded data package of incorrect size. Expected: ${r} Actual: ${o.byteLength}`);return o}return null},instantiateWasm:function(e,t){const n=e,o=Le(r).then((e=>{if(e.status>=400)throw new Error(`Failed to fetch WASM package: ${e.status} ${e.statusText}`);return e}));return void 0!==WebAssembly.instantiateStreaming?o.then((e=>WebAssembly.instantiateStreaming(e,n))).then((({instance:e})=>t(e))):o.then((e=>e.arrayBuffer())).then((e=>WebAssembly.compile(e))).then((e=>WebAssembly.instantiate(e,n))).then(t),{}}}}(e),i={locateFile:t=>t.endsWith(".wasm")?je(e,Ie):t.endsWith(".data")?je(e,Oe):je(e,t),instantiateWasm:o,getPreloadedPackage:n,print:e=>{e&&t(e,"Info")},printErr:e=>{e&&t(e,"Error")},onRuntimeInitialized:()=>{t("Engine has been initialized.","Info")},logReadFiles:!1,printWithColors:!0},a=await Ue(i);a.emscripten_ubq_asyncFetchManager.setFetch(Le);const s=E(a.createEngine("","auto"));return function(e,t){if(!t)throw new Error("Missing license key");E(e.unlockWithLicense(t))}(s,await r),function(e,t){var r,n;const o=new w(e),i=new Ee(e),a=new B(e);i.setSettingEnum("role",null!==(r=t.role)&&void 0!==r?r:"Creator"),"Adopter"===t.role&&i.setSettingEnum("doubleClickSelectionMode","Direct"),i.setSettingString("basePath",t.baseURL),i.setSettingBool("showBuildVersion",!1),(null===(n=t.featureFlags)||void 0===n?void 0:n.preventScrolling)&&(i.setSettingBool("touch/singlePointPanning",!1),i.setSettingBool("touch/dragStartCanSelect",!1)),a.addLocalSource("ly.img.text"),Object.entries(t.presets.typefaces||{}).forEach((([e,t])=>{(t.fonts||[]).forEach((r=>{const n=`${e}_${r.weight}_${r.style}`;o.execute("ubq/assets/registerFont",[n,r.fontURL,t.family,r.weight,r.style])}))})),function(){var e;const r=!!(null===(e=t.featureFlags)||void 0===e?void 0:e.singlePageMode);i.setSettingBool("features/singlePageModeEnabled",r),i.setSettingBool("features/effectsEnabled",!0)}(),function(){var e;const r=null!==(e=t.extensions)&&void 0!==e?e:[];r.entries.forEach((e=>{o.execute("ubq/extension/register",`${r.baseURL+e}`)}))}(),function(){const t=new Pe(e);"undefined"!=typeof window&&window.Cypress&&(t.setString("company_name","img.ly"),t.setString("first_name","Charly"),t.setString("last_name","Williams"),t.setString("address","742 Evergreen Terrace"),t.setString("city","Springfield"))}()}(s,e),s}(r),r);return function(e,t){var r,n,o,i,a,s,u,l;if(e)try{const c=t.editor;if(null!=(null===(n=null===(r=e.page)||void 0===r?void 0:r.title)||void 0===n?void 0:n.show)&&c.setSettingBool("page/title/show",e.page.title.show),null!=(null===(i=null===(o=e.page)||void 0===o?void 0:o.title)||void 0===i?void 0:i.fontFileUri)&&c.setSettingString("page/title/fontFileUri",null===(s=null===(a=e.page)||void 0===a?void 0:a.title)||void 0===s?void 0:s.fontFileUri),null!=(null===(u=e.page)||void 0===u?void 0:u.dimOutOfPageAreas)&&c.setSettingBool("page/dimOutOfPageAreas",null===(l=e.page)||void 0===l?void 0:l.dimOutOfPageAreas),e.variables)for(const r in e.variables)if(Object.prototype.hasOwnProperty.call(e.variables,r)){const n=e.variables[r];t.variable.setString(r,String(n.value))}}catch(e){console.error(e)}}(e,n),n}async addDefaultAssetSources({baseURL:e="https://cdn.img.ly/assets/v2",excludeAssetSourceIds:t=[]}={}){return async function(e,t,r,n){const o=["ly.img.sticker","ly.img.vectorpath","ly.img.colors.defaultPalette","ly.img.filter.lut","ly.img.filter.duotone","ly.img.effect","ly.img.blur"].filter((e=>!r.includes(e)));await U(o,t,n,e)}(this.asset,e,t,Be)}async addDemoAssetSources({excludeAssetSourceIds:e=[],sceneMode:t="Design",withUploadAssetSources:r=!1}={}){return async function(e,t,r,n,o,i,a="https://cdn.img.ly/assets/demo/v2"){const s=new Set(e.findAllSources()),u="ly.img.image.upload";!o||r.includes(u)||s.has(u)||e.addLocalSource(u,["image/jpeg","image/png","image/webp","image/svg+xml","image/gif","image/bmp"]);const l="ly.img.video.upload";"Video"!==n||!o||r.includes(l)||s.has(l)||e.addLocalSource(l,["video/mp4","video/quicktime"]);const c="ly.img.audio.upload";"Video"!==n||!o||r.includes(c)||s.has(c)||e.addLocalSource(c,["audio/mpeg","audio/x-m4a","audio/m4a","audio/mp3"]);const d=["ly.img.image","ly.img.video","ly.img.audio"].filter((e=>!r.includes(e)));s.has("ly.img.template")||r.includes("ly.img.template")||(e.addLocalSource("ly.img.template",void 0,(async e=>{var r;const n=null===(r=e.meta)||void 0===r?void 0:r.uri;if(n)if(n.startsWith("UBQ1"))t.applyTemplateFromString(n);else{const e=new URL(n,window.location.href);t.applyTemplateFromURL(e.href)}})),d.push("ly.img.template")),await U(d,a,i,e)}(this.asset,this.scene,e,t,r,Be)}}Ne=new WeakMap,He=new WeakMap,qe=new WeakMap,$e=new WeakSet,Ve=function(){Ye(this,$e,"m",We).call(this)},We=function(){if(Ye(this,qe,"f"))return;const e=()=>{this.update(),ze(this,qe,setTimeout(e,16),"f")};ze(this,qe,setTimeout(e,16),"f")},Ge=function(){Ye(this,qe,"f")&&(clearTimeout(Ye(this,qe,"f")),ze(this,qe,null,"f"))};const Ke=Xe,Qe=Xe;Object.defineProperty(Qe,"__esModule",{value:!0}),Object.defineProperty(Qe,"default",{value:Xe}),Object.defineProperty(Qe,"LogLevel",{value:{Info:"Info",Warning:"Warning",Error:"Error"}}),Object.defineProperty(Qe,"MimeType",{value:ue})})(),n.default})()));