@cesdk/engine 1.11.0-preview.2 → 1.11.0-rc.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,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
var e={2003:(e,t,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(e){var t,o,i,a,s=e||{},u=void 0!==s?s:{};if(void 0===globalThis.BigInt64Array){function c(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:function(e,n){return void 0===n&&(n=r.length),t(r.slice(2*e,2*n))},subarray:function(e,n){return 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:function(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=c(e[n]);r.set(o,2*(t+n))}}},{get:function(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:function(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=c(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}))}u.ready=new Promise((function(e,r){t=e,o=r})),u.expectedDataFileDownloads||(u.expectedDataFileDownloads=0),u.expectedDataFileDownloads++,u.ENVIRONMENT_IS_PTHREAD||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 u.locateFilePackage||u.locateFile||(u.locateFile=u.locateFilePackage,A("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)"));var n=u.locateFile?u.locateFile(t,""):t,o=e.remote_package_size,i=null,a=u.getPreloadedPackage?u.getPreloadedPackage(n,o):null;function s(){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}u.FS_createPath("/","ly.img.cesdk",!0,!0),u.FS_createPath("/ly.img.cesdk","fonts",!0,!0),u.FS_createPath("/ly.img.cesdk","icons",!0,!0),u.FS_createPath("/ly.img.cesdk","icu",!0,!0),u.FS_createPath("/ly.img.cesdk","images",!0,!0),u.FS_createPath("/ly.img.cesdk","presets",!0,!0),u.FS_createPath("/ly.img.cesdk","shaders",!0,!0),u.FS_createPath("/ly.img.cesdk/shaders","common",!0,!0),r.prototype={requests:{},open:function(e,t){this.name=t,this.requests[t]=this,u.addRunDependency("fp "+this.name)},send:function(){},onload:function(){var e=this.byteArray.subarray(this.start,this.end);this.finish(e)},finish:function(e){u.FS_createDataFile(this.name,null,e,!0,!0,!0),u.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 s(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();u.removeRunDependency("datafile_cesdk.data")}u.addRunDependency("datafile_cesdk.data"),u.preloadResults||(u.preloadResults={}),u.preloadResults["cesdk.data"]={fromCache:!1},a?(s(a),a=null):i=s}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?u.dataFileDownloads[n].loaded=r.loaded:(i.addedTotal=!0,u.dataFileDownloads||(u.dataFileDownloads={}),u.dataFileDownloads[n]={loaded:r.loaded,total:o});var a=0,s=0,c=0;for(var l in u.dataFileDownloads){var f=u.dataFileDownloads[l];a+=f.total,s+=f.loaded,c++}a=Math.ceil(a*u.expectedDataFileDownloads/c),u.setStatus&&u.setStatus("Downloading data... ("+s+"/"+a+")")}else u.dataFileDownloads||u.setStatus&&u.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(115).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})),u.calledRun?s():(u.preRun||(u.preRun=[]),u.preRun.push(s))}({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:288913},{filename:"/ly.img.cesdk/images/watermark.png",start:288913,end:379060},{filename:"/ly.img.cesdk/presets/.keep",start:379060,end:379060},{filename:"/ly.img.cesdk/shaders/adjustments.sksl",start:379060,end:382949},{filename:"/ly.img.cesdk/shaders/black_and_white_color_mixer.sksl",start:382949,end:389266},{filename:"/ly.img.cesdk/shaders/common/ubq_adjustments.sksl",start:389266,end:393829},{filename:"/ly.img.cesdk/shaders/common/ubq_color_conversions.sksl",start:393829,end:403814},{filename:"/ly.img.cesdk/shaders/common/ubq_constants.sksl",start:403814,end:404304},{filename:"/ly.img.cesdk/shaders/common/ubq_hue_constants.sksl",start:404304,end:407471},{filename:"/ly.img.cesdk/shaders/common/ubq_noise.sksl",start:407471,end:410109},{filename:"/ly.img.cesdk/shaders/cross_cut.sksl",start:410109,end:411056},{filename:"/ly.img.cesdk/shaders/dot_pattern.sksl",start:411056,end:411571},{filename:"/ly.img.cesdk/shaders/duotone_filter.sksl",start:411571,end:412535},{filename:"/ly.img.cesdk/shaders/extrude_blur.sksl",start:412535,end:414652},{filename:"/ly.img.cesdk/shaders/glow.sksl",start:414652,end:415619},{filename:"/ly.img.cesdk/shaders/half_tone.sksl",start:415619,end:416113},{filename:"/ly.img.cesdk/shaders/hsp_selective_adjustments.sksl",start:416113,end:429713},{filename:"/ly.img.cesdk/shaders/linocut.sksl",start:429713,end:430498},{filename:"/ly.img.cesdk/shaders/liquid.sksl",start:430498,end:430980},{filename:"/ly.img.cesdk/shaders/lut_filter.sksl",start:430980,end:433843},{filename:"/ly.img.cesdk/shaders/mask_color.sksl",start:433843,end:434345},{filename:"/ly.img.cesdk/shaders/mirror.sksl",start:434345,end:434799},{filename:"/ly.img.cesdk/shaders/outliner.sksl",start:434799,end:436436},{filename:"/ly.img.cesdk/shaders/pixelize.sksl",start:436436,end:436736},{filename:"/ly.img.cesdk/shaders/placeholder_overlay_lines.sksl",start:436736,end:437462},{filename:"/ly.img.cesdk/shaders/posterize.sksl",start:437462,end:437674},{filename:"/ly.img.cesdk/shaders/radial_pixel.sksl",start:437674,end:438237},{filename:"/ly.img.cesdk/shaders/sharpie.sksl",start:438237,end:440542},{filename:"/ly.img.cesdk/shaders/shifter.sksl",start:440542,end:441226},{filename:"/ly.img.cesdk/shaders/tiltshift.sksl",start:441226,end:441808},{filename:"/ly.img.cesdk/shaders/tv_glitch.sksl",start:441808,end:442526},{filename:"/ly.img.cesdk/shaders/vignette.sksl",start:442526,end:442898}],remote_package_size:442898}),"object"==typeof window&&"object"==typeof window.performance?u.performance=performance:"object"==typeof r.g&&"object"==typeof r.g.perf_hooks&&"object"==typeof r.g.perf_hooks.performance?u.performance=r.g.perf_hooks.performance:u.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 f{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=u._malloc(e);u.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)}}u.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,s,c){const l=u.UTF8ToString(t,r),d=this._nextHandle++,h=new f(d,l);return this._processes.set(d,h),l.match(/^file:/)?this._fetchFile(h).catch((e=>(h.fail(e),Promise.reject(e)))):this._fetchRemote(h,e,n,o,i,a,s,c).catch((e=>(h.fail(e),Promise.reject(e)))),h}async _fetchFile(e){if("undefined"!=typeof window)throw new Error("File URLs supported only in Node.JS");const t=r(115),{fileURLToPath:n}=r(2015),o=t.createReadStream(n(e.uri));return e.readChunks(o)}async _fetchRemote(e,t,r,n,o,i,s,c){const l=u.UTF8ToString(s,c),f=this.getHeaders(r,n),d=t===a.POST?new Uint8Array(u.HEAPU8.buffer,o,i):void 0,h=await this._fetch(e.uri,{method:a[t],headers:f,body:d,mode:"cors",credentials:l});if(h.status>=200&&h.status<=209){let t=0;return h.headers.has("Content-Length")&&(t=+h.headers.get("Content-Length")),e.totalBytes=t,e.readChunks(h.body)}return e.fail(h.statusText)}getHeaders(e,t){const r={};for(let n=0;n<t;n++){const t=u.getValue(e+4*n,"i32"),o=this._headers.get(t);r[o.key]=o.value}return r}createHeader(e,t,r,n){const o=u.UTF8ToString(e,t),i=u.UTF8ToString(r,n),a=this._nextHeaderHandle++;return this._headers.set(a,{key:o,value:i}),a}deleteHeader(e){return this._headers.delete(e)}},u.emscripten_ubq_codec_videoDecoders=new Map,u.emscripten_ubq_codec_audioDecoders=new Map,u.emscripten_ubq_codec_videoEncoders=new Map,u.emscripten_ubq_codec_audioEncoders=new Map,u.emscripten_ubq_codec_videoDecoderNextHandle=1,u.emscripten_ubq_codec_audioDecoderNextHandle=1,u.emscripten_ubq_codec_videoEncoderNextHandle=1,u.emscripten_ubq_codec_audioEncoderNextHandle=1,u.emscripten_ubq_codec_createNativeResult=function(e){const t=u._malloc(8),r=u.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=u._malloc(t.length+1),o=u.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},u.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=u.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++,u.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},u.emscripten_ubq_codec_createAudioDecoder=function(e,t,r){const n=new AudioDecoder({output:o=>{if(n.flushing)return void o.close();const i=u.HEAPF32.subarray(e/4,e/4+r),a=u.HEAPF32.subarray(t/4,t/4+r),s=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:s,frameCount:o.numberOfFrames});else{const t=r-e;o.copyTo(i.subarray(e),{planeIndex:0,frameCount:t}),o.copyTo(a.subarray(e),{planeIndex:s,frameCount:t}),o.copyTo(i,{planeIndex:0,frameOffset:t}),o.copyTo(a,{planeIndex:s,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=>console.error(e)});return n.writtenFrames=0,n},u.emscripten_ubq_settings_forceWebGL1=!1;var d,h,p,m=Object.assign({},u),g=[],v="./this.program",y=(e,t)=>{throw t},b="object"==typeof window,w="function"==typeof importScripts,E="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,_="";if(E){var x=r(115),k=r(3119);_=w?k.dirname(_)+"/":"//",d=(e,t)=>(e=pe(e)?new URL(e):k.normalize(e),x.readFileSync(e,t?void 0:"utf8")),p=e=>{var t=d(e,!0);return t.buffer||(t=new Uint8Array(t)),t},h=(e,t,r)=>{e=pe(e)?new URL(e):k.normalize(e),x.readFile(e,(function(e,n){e?r(e):t(n.buffer)}))},process.argv.length>1&&(v=process.argv[1].replace(/\\/g,"/")),g=process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof ve))throw e})),process.on("unhandledRejection",(function(e){throw e})),y=(e,t)=>{if(re())throw process.exitCode=e,t;var r;(r=t)instanceof ve||A("exiting due to exception: "+r),process.exit(e)},u.inspect=function(){return"[Emscripten Module object]"}}else(b||w)&&(w?_=self.location.href:"undefined"!=typeof document&&document.currentScript&&(_=document.currentScript.src),n&&(_=n),_=0!==_.indexOf("blob:")?_.substr(0,_.replace(/[?#].*/,"").lastIndexOf("/")+1):"",d=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},w&&(p=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),h=(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 S,C=u.print||console.log.bind(console),A=u.printErr||console.warn.bind(console);Object.assign(u,m),m=null,u.arguments&&(g=u.arguments),u.thisProgram&&(v=u.thisProgram),u.quit&&(y=u.quit),u.wasmBinary&&(S=u.wasmBinary);var P,T=u.noExitRuntime||!0;"object"!=typeof WebAssembly&&de("no native wasm support detected");var F,B=!1;function D(e,t){e||de(t)}var L,R,M,O,I,j,U,q,N,z,H="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function W(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&H)return H.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 c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function V(e,t){return e?W(R,e,t):""}function G(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 $(e,t,r){return G(e,R,t,r)}function Y(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}function X(){var e=P.buffer;u.HEAP8=L=new Int8Array(e),u.HEAP16=M=new Int16Array(e),u.HEAP32=I=new Int32Array(e),u.HEAPU8=R=new Uint8Array(e),u.HEAPU16=O=new Uint16Array(e),u.HEAPU32=j=new Uint32Array(e),u.HEAPF32=U=new Float32Array(e),u.HEAPF64=z=new Float64Array(e),u.HEAP64=q=new BigInt64Array(e),u.HEAPU64=N=new BigUint64Array(e)}u.INITIAL_MEMORY;var K,Q=[],Z=[],J=[],ee=[],te=[];function re(){return T}var ne,oe,ie,ae,se=0,ue=null,ce=null;function le(e){se++,u.monitorRunDependencies&&u.monitorRunDependencies(se)}function fe(e){if(se--,u.monitorRunDependencies&&u.monitorRunDependencies(se),0==se&&(null!==ue&&(clearInterval(ue),ue=null),ce)){var t=ce;ce=null,t()}}function de(e){u.onAbort&&u.onAbort(e),A(e="Aborted("+e+")"),B=!0,F=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}function he(e){return e.startsWith("data:application/octet-stream;base64,")}function pe(e){return e.startsWith("file://")}function me(e){try{if(e==ne&&S)return new Uint8Array(S);if(p)return p(e);throw"both async and sync fetching of the wasm failed"}catch(e){de(e)}}he(ne="cesdk.wasm")||(oe=ne,ne=u.locateFile?u.locateFile(oe,_):_+oe);var ge={2035556:()=>"undefined"==typeof window||void 0===(window.AudioContext||window.webkitAudioContext)?0:(void 0===window.miniaudio&&(window.miniaudio={referenceCount:0},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),2037255:()=>{void 0!==window.miniaudio&&(window.miniaudio.referenceCount--,0===window.miniaudio.referenceCount&&delete window.miniaudio)},2037416:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,2037520:()=>{try{var e=new(window.AudioContext||window.webkitAudioContext),t=e.sampleRate;return e.close(),t}catch(e){return 0}},2037691:(e,t,r,n,o)=>{var i=e,a=t,s=r,c=n,l=o;if(void 0===window.miniaudio)return-1;var f={};return f.webaudio=new(window.AudioContext||window.webkitAudioContext)({sampleRate:a}),f.webaudio.suspend(),f.state=1,f.intermediaryBufferSizeInBytes=i*s*4,f.intermediaryBuffer=u._malloc(f.intermediaryBufferSizeInBytes),f.intermediaryBufferView=new Float32Array(u.HEAPF32.buffer,f.intermediaryBuffer,f.intermediaryBufferSizeInBytes),f.scriptNode=f.webaudio.createScriptProcessor(s,c?i:0,c?0:i),c?(f.scriptNode.onaudioprocess=function(e){if(void 0!==f.intermediaryBuffer){0==f.intermediaryBufferView.length&&(f.intermediaryBufferView=new Float32Array(u.HEAPF32.buffer,f.intermediaryBuffer,f.intermediaryBufferSizeInBytes));for(var t=0;t<e.outputBuffer.numberOfChannels;++t)e.outputBuffer.getChannelData(t).fill(0);var r=!1;void 0===f.streamNode&&(r=!0),e.inputBuffer.numberOfChannels!=i&&(console.log("Capture: Channel count mismatch. "+e.inputBufer.numberOfChannels+" != "+i+". Sending silence."),r=!0);for(var n=0;n<e.inputBuffer.length;){var o=e.inputBuffer.length-n;if(o>f.intermediaryBufferSizeInBytes/i/4&&(o=f.intermediaryBufferSizeInBytes/i/4),r)f.intermediaryBufferView.fill(0);else for(var a=0;a<o;++a)for(t=0;t<e.inputBuffer.numberOfChannels;++t)f.intermediaryBufferView[a*i+t]=e.inputBuffer.getChannelData(t)[n+a];Yr("ma_device_process_pcm_frames_capture__webaudio","undefined",["number","number","number"],[l,o,f.intermediaryBuffer]),n+=o}}},navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(e){f.streamNode=f.webaudio.createMediaStreamSource(e),f.streamNode.connect(f.scriptNode),f.scriptNode.connect(f.webaudio.destination)})).catch((function(e){f.scriptNode.connect(f.webaudio.destination)}))):(f.scriptNode.onaudioprocess=function(e){if(void 0!==f.intermediaryBuffer){0==f.intermediaryBufferView.length&&(f.intermediaryBufferView=new Float32Array(u.HEAPF32.buffer,f.intermediaryBuffer,f.intermediaryBufferSizeInBytes));var t=!1;if(e.outputBuffer.numberOfChannels!=i)return console.log("Playback: Channel count mismatch. "+e.outputBufer.numberOfChannels+" != "+i+". Outputting silence."),void(t=!0);for(var r=0;r<e.outputBuffer.length;){var n=e.outputBuffer.length-r;if(n>f.intermediaryBufferSizeInBytes/i/4&&(n=f.intermediaryBufferSizeInBytes/i/4),Yr("ma_device_process_pcm_frames_playback__webaudio","undefined",["number","number","number"],[l,n,f.intermediaryBuffer]),t)for(var o=0;o<e.outputBuffer.numberOfChannels;++o)e.outputBuffer.getChannelData(o).fill(0);else for(o=0;o<e.outputBuffer.numberOfChannels;++o)for(var a=e.outputBuffer.getChannelData(o),s=f.intermediaryBufferView,c=0;c<n;++c)a[r+c]=s[c*i+o];r+=n}}},f.scriptNode.connect(f.webaudio.destination)),miniaudio.track_device(f)},2042091:e=>miniaudio.get_device_by_index(e).webaudio.sampleRate,2042157: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,void 0!==t.intermediaryBuffer&&(u._free(t.intermediaryBuffer),t.intermediaryBuffer=void 0,t.intermediaryBufferView=void 0,t.intermediaryBufferSizeInBytes=void 0),miniaudio.untrack_device_by_index(e)},2042783:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.resume(),t.state=2},2042879:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.resume(),t.state=2},2042975:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.suspend(),t.state=1},2043072:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.suspend(),t.state=1},2043169:()=>L.length};function ve(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function ye(e){for(;e.length>0;)e.shift()(u)}function be(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){j[this.ptr+4>>2]=e},this.get_type=function(){return j[this.ptr+4>>2]},this.set_destructor=function(e){j[this.ptr+8>>2]=e},this.get_destructor=function(){return j[this.ptr+8>>2]},this.set_refcount=function(e){I[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,L[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=L[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,L[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=L[this.ptr+13>>0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=I[this.ptr>>2];I[this.ptr>>2]=e+1},this.release_ref=function(){var e=I[this.ptr>>2];return I[this.ptr>>2]=e-1,1===e},this.set_adjusted_ptr=function(e){j[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return j[this.ptr+16>>2]},this.get_exception_ptr=function(){if(pn(this.get_type()))return j[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var we={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=we.isAbs(e),r="/"===e.substr(-1);return(e=we.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=we.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=we.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return we.normalize(e.join("/"))},join2:(e,t)=>we.normalize(e+"/"+t)};function Ee(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}if(E)try{var t=r(5240);return()=>t.randomBytes(1)[0]}catch(e){}return()=>de("randomDevice")}var _e={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=we.isAbs(n)}return(t?"/":"")+(e=we.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=_e.resolve(e).substr(1),t=_e.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("/")}};function xe(e,t,r){var n=r>0?r:Y(e)+1,o=new Array(n),i=G(e,o,0,o.length);return t&&(o.length=i),o}var ke={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){ke.ttys[e]={input:[],output:[],ops:t},Ae.registerDevice(e,ke.stream_ops)},stream_ops:{open:function(e){var t=ke.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){if(!e.input.length){var t=null;if(E){var r=Buffer.alloc(256),n=0;try{n=x.readSync(process.stdin.fd,r,0,256,-1)}catch(e){if(!e.toString().includes("EOF"))throw e;n=0}t=n>0?r.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=xe(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(C(W(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(C(W(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(A(W(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(A(W(e.output,0)),e.output=[])}}};function Se(e){e=function(e,t){return 65536*Math.ceil(e/65536)}(e);var t=cn(65536,e);return t?function(e,t){return R.fill(0,e,e+t),e}(t,e):0}var Ce={ops_table:null,mount:function(e){return Ce.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(Ae.isBlkdev(r)||Ae.isFIFO(r))throw new Ae.ErrnoError(63);Ce.ops_table||(Ce.ops_table={dir:{node:{getattr:Ce.node_ops.getattr,setattr:Ce.node_ops.setattr,lookup:Ce.node_ops.lookup,mknod:Ce.node_ops.mknod,rename:Ce.node_ops.rename,unlink:Ce.node_ops.unlink,rmdir:Ce.node_ops.rmdir,readdir:Ce.node_ops.readdir,symlink:Ce.node_ops.symlink},stream:{llseek:Ce.stream_ops.llseek}},file:{node:{getattr:Ce.node_ops.getattr,setattr:Ce.node_ops.setattr},stream:{llseek:Ce.stream_ops.llseek,read:Ce.stream_ops.read,write:Ce.stream_ops.write,allocate:Ce.stream_ops.allocate,mmap:Ce.stream_ops.mmap,msync:Ce.stream_ops.msync}},link:{node:{getattr:Ce.node_ops.getattr,setattr:Ce.node_ops.setattr,readlink:Ce.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Ce.node_ops.getattr,setattr:Ce.node_ops.setattr},stream:Ae.chrdev_stream_ops}});var o=Ae.createNode(e,t,r,n);return Ae.isDir(o.mode)?(o.node_ops=Ce.ops_table.dir.node,o.stream_ops=Ce.ops_table.dir.stream,o.contents={}):Ae.isFile(o.mode)?(o.node_ops=Ce.ops_table.file.node,o.stream_ops=Ce.ops_table.file.stream,o.usedBytes=0,o.contents=null):Ae.isLink(o.mode)?(o.node_ops=Ce.ops_table.link.node,o.stream_ops=Ce.ops_table.link.stream):Ae.isChrdev(o.mode)&&(o.node_ops=Ce.ops_table.chrdev.node,o.stream_ops=Ce.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(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:function(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:function(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:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&Ce.resizeFileStorage(e,t.size)},lookup:function(e,t){throw Ae.genericErrors[44]},mknod:function(e,t,r,n){return Ce.createNode(e,t,r,n)},rename:function(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:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(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:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var n=Ce.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!Ae.isLink(e.mode))throw new Ae.ErrnoError(28);return e.link}},stream_ops:{read:function(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:function(e,t,r,n,o,i){if(t.buffer===L.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(Ce.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:function(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:function(e,t,r){Ce.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(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!==L.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=Se(t)))throw new Ae.ErrnoError(48);L.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:function(e,t,r,n,o){return Ce.stream_ops.write(e,t,0,n,r,!1),0}}},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=_e.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=we.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=_e.resolve(we.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),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var t=Ae.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},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:(e=0,t=Ae.MAX_OPEN_FDS)=>{for(var r=e;r<=t;r++)if(!Ae.streams[r])return r;throw new Ae.ErrnoError(33)},getStream:e=>Ae.streams[e],createStream:(e,t,r)=>{Ae.FSStream||(Ae.FSStream=function(){this.shared={}},Ae.FSStream.prototype={},Object.defineProperties(Ae.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(e){this.shared.flags=e}},position:{get:function(){return this.shared.position},set:function(e){this.shared.position=e}}})),e=Object.assign(new Ae.FSStream,e);var n=Ae.nextfd(t,r);return e.fd=n,Ae.streams[n]=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&&A("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=we.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(!_e.resolve(e))throw new Ae.ErrnoError(44);var r=Ae.lookupPath(t,{parent:!0}).node;if(!r)throw new Ae.ErrnoError(44);var n=we.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=we.dirname(e),i=we.dirname(t),a=we.basename(e),s=we.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,c=Ae.lookupNode(r,a),l=_e.relative(e,i);if("."!==l.charAt(0))throw new Ae.ErrnoError(28);if("."!==(l=_e.relative(t,o)).charAt(0))throw new Ae.ErrnoError(55);try{u=Ae.lookupNode(n,s)}catch(e){}if(c!==u){var f=Ae.isDir(c.mode),d=Ae.mayDelete(r,a,f);if(d)throw new Ae.ErrnoError(d);if(d=u?Ae.mayDelete(n,s,f):Ae.mayCreate(n,s))throw new Ae.ErrnoError(d);if(!r.node_ops.rename)throw new Ae.ErrnoError(63);if(Ae.isMountpoint(c)||u&&Ae.isMountpoint(u))throw new Ae.ErrnoError(10);if(n!==r&&(d=Ae.nodePermissions(r,"w")))throw new Ae.ErrnoError(d);Ae.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(e){throw e}finally{Ae.hashAddNode(c)}}},rmdir:e=>{var t=Ae.lookupPath(e,{parent:!0}).node,r=we.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=we.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 _e.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.getStream(e);if(!r)throw new Ae.ErrnoError(8);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.getStream(e);if(!n)throw new Ae.ErrnoError(8);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.getStream(e);if(!r)throw new Ae.ErrnoError(8);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?Ae.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)n=e;else{e=we.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),!u.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=W(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(Y(t)+1),i=G(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)),ke.register(Ae.makedev(5,0),ke.default_tty_ops),ke.register(Ae.makedev(6,0),ke.default_tty1_ops),Ae.mkdev("/dev/tty",Ae.makedev(5,0)),Ae.mkdev("/dev/tty1",Ae.makedev(6,0));var e=Ee();Ae.createDevice("/dev","random",e),Ae.createDevice("/dev","urandom",e),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.getStream(r);if(!n)throw new Ae.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{u.stdin?Ae.createDevice("/dev","stdin",u.stdin):Ae.symlink("/dev/tty","/dev/stdin"),u.stdout?Ae.createDevice("/dev","stdout",null,u.stdout):Ae.symlink("/dev/tty","/dev/stdout"),u.stderr?Ae.createDevice("/dev","stderr",null,u.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.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(Ce,{},"/"),Ae.createDefaultDirectories(),Ae.createDefaultDevices(),Ae.createSpecialDirectories(),Ae.filesystems={MEMFS:Ce}},init:(e,t,r)=>{Ae.init.initialized=!0,Ae.ensureErrnoError(),u.stdin=e||u.stdin,u.stdout=t||u.stdout,u.stderr=r||u.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)}},getMode:(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},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=we.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=we.join2(e,i);try{Ae.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,r,n,o)=>{var i=we.join2("string"==typeof e?e:Ae.getPath(e),t),a=Ae.getMode(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?we.join2(e,t):e);var s=Ae.getMode(n,o),u=Ae.create(a,s);if(r){if("string"==typeof r){for(var c=new Array(r.length),l=0,f=r.length;l<f;++l)c[l]=r.charCodeAt(l);r=c}Ae.chmod(u,146|s);var d=Ae.open(u,577);Ae.write(d,r,0,r.length,0,i),Ae.close(d),Ae.chmod(u,s)}return u},createDevice:(e,t,r,n)=>{var o=we.join2("string"==typeof e?e:Ae.getPath(e),t),i=Ae.getMode(!!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=xe(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||[]):xe(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,C("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(!w)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 c={};function l(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];c[e]=function(){return Ae.forceLoadFile(u),t.apply(null,arguments)}})),c.read=(e,t,r,n,o)=>(Ae.forceLoadFile(u),l(e,t,r,n,o)),c.mmap=(e,t,r,n,o)=>{Ae.forceLoadFile(u);var i=Se(t);if(!i)throw new Ae.ErrnoError(48);return l(e,L,i,t,r),{ptr:i,allocated:!0}},u.stream_ops=c,u},createPreloadedFile:(e,t,r,n,o,i,a,s,u,c)=>{var l=t?_e.resolve(we.join2(e,t)):e;function f(r){function f(r){c&&c(),s||Ae.createDataFile(e,t,r,n,o,u),i&&i(),fe()}sr.handledByPreloadPlugin(r,l,f,(()=>{a&&a(),fe()}))||f(r)}le(),"string"==typeof r?function(e,t,r,n){var o="al "+e;h(e,(t=>{D(t,'Loading data file "'+e+'" failed (no arrayBuffer).'),f(new Uint8Array(t)),o&&fe()}),(t=>{if(!r)throw'Loading data file "'+e+'" failed.';r()})),o&&le()}(r,0,a):f(r)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=Ae.indexedDB();try{var o=n.open(Ae.DB_NAME(),Ae.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=()=>{C("creating db"),o.result.createObjectStore(Ae.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([Ae.DB_STORE_NAME],"readwrite"),i=n.objectStore(Ae.DB_STORE_NAME),a=0,s=0,u=e.length;function c(){0==s?t():r()}e.forEach((e=>{var t=i.put(Ae.analyzePath(e).object.contents,e);t.onsuccess=()=>{++a+s==u&&c()},t.onerror=()=>{s++,a+s==u&&c()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=Ae.indexedDB();try{var o=n.open(Ae.DB_NAME(),Ae.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([Ae.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var a=i.objectStore(Ae.DB_STORE_NAME),s=0,u=0,c=e.length;function l(){0==u?t():r()}e.forEach((e=>{var t=a.get(e);t.onsuccess=()=>{Ae.analyzePath(e).exists&&Ae.unlink(e),Ae.createDataFile(we.dirname(e),we.basename(e),t.result,!0,!0,!0),++s+u==c&&l()},t.onerror=()=>{u++,s+u==c&&l()}})),i.onerror=r},o.onerror=r}},Pe={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(we.isAbs(t))return t;var n;if(n=-100===e?Ae.cwd():Pe.getStreamFromFD(e).path,0==t.length){if(!r)throw new Ae.ErrnoError(44);return n}return we.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&we.normalize(t)!==we.normalize(Ae.getPath(e.node)))return-54;throw e}I[r>>2]=n.dev,I[r+8>>2]=n.ino,I[r+12>>2]=n.mode,j[r+16>>2]=n.nlink,I[r+20>>2]=n.uid,I[r+24>>2]=n.gid,I[r+28>>2]=n.rdev,ae=[n.size>>>0,(ie=n.size,+Math.abs(ie)>=1?ie>0?(0|Math.min(+Math.floor(ie/4294967296),4294967295))>>>0:~~+Math.ceil((ie-+(~~ie>>>0))/4294967296)>>>0:0)],I[r+40>>2]=ae[0],I[r+44>>2]=ae[1],I[r+48>>2]=4096,I[r+52>>2]=n.blocks;var o=n.atime.getTime(),i=n.mtime.getTime(),a=n.ctime.getTime();return ae=[Math.floor(o/1e3)>>>0,(ie=Math.floor(o/1e3),+Math.abs(ie)>=1?ie>0?(0|Math.min(+Math.floor(ie/4294967296),4294967295))>>>0:~~+Math.ceil((ie-+(~~ie>>>0))/4294967296)>>>0:0)],I[r+56>>2]=ae[0],I[r+60>>2]=ae[1],j[r+64>>2]=o%1e3*1e3,ae=[Math.floor(i/1e3)>>>0,(ie=Math.floor(i/1e3),+Math.abs(ie)>=1?ie>0?(0|Math.min(+Math.floor(ie/4294967296),4294967295))>>>0:~~+Math.ceil((ie-+(~~ie>>>0))/4294967296)>>>0:0)],I[r+72>>2]=ae[0],I[r+76>>2]=ae[1],j[r+80>>2]=i%1e3*1e3,ae=[Math.floor(a/1e3)>>>0,(ie=Math.floor(a/1e3),+Math.abs(ie)>=1?ie>0?(0|Math.min(+Math.floor(ie/4294967296),4294967295))>>>0:~~+Math.ceil((ie-+(~~ie>>>0))/4294967296)>>>0:0)],I[r+88>>2]=ae[0],I[r+92>>2]=ae[1],j[r+96>>2]=a%1e3*1e3,ae=[n.ino>>>0,(ie=n.ino,+Math.abs(ie)>=1?ie>0?(0|Math.min(+Math.floor(ie/4294967296),4294967295))>>>0:~~+Math.ceil((ie-+(~~ie>>>0))/4294967296)>>>0:0)],I[r+104>>2]=ae[0],I[r+108>>2]=ae[1],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=R.slice(e,e+r);Ae.msync(t,i,o,r,n)},varargs:void 0,get:function(){return Pe.varargs+=4,I[Pe.varargs-4>>2]},getStr:function(e){return V(e)},getStreamFromFD:function(e){var t=Ae.getStream(e);if(!t)throw new Ae.ErrnoError(8);return t}},Te="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking",Fe={};function Be(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function De(e){return this.fromWireType(I[e>>2])}var Le={},Re={},Me={};function Oe(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 Ie(e,t){return e=Oe(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(t)}function je(e,t){var r=Ie(t,(function(e){this.name=t,this.message=e;var r=new Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var Ue=void 0;function qe(e){throw new Ue(e)}function Ne(e,t,r){function n(t){var n=r(t);n.length!==e.length&&qe("Mismatched type converter count");for(var o=0;o<e.length;++o)Ye(e[o],n[o])}e.forEach((function(e){Me[e]=t}));var o=new Array(t.length),i=[],a=0;t.forEach(((e,t)=>{Re.hasOwnProperty(e)?o[t]=Re[e]:(i.push(e),Le.hasOwnProperty(e)||(Le[e]=[]),Le[e].push((()=>{o[t]=Re[e],++a===i.length&&n(o)})))})),0===i.length&&n(o)}var ze={};function He(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}var We=void 0;function Ve(e){for(var t="",r=e;R[r];)t+=We[R[r++]];return t}var Ge=void 0;function $e(e){throw new Ge(e)}function Ye(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=t.name;if(e||$e('type "'+n+'" must have a positive integer typeid pointer'),Re.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;$e("Cannot register type '"+n+"' twice")}if(Re[e]=t,delete Me[e],Le.hasOwnProperty(e)){var o=Le[e];delete Le[e],o.forEach((e=>e()))}}function Xe(e,t,r){switch(t){case 0:return r?function(e){return L[e]}:function(e){return R[e]};case 1:return r?function(e){return M[e>>1]}:function(e){return O[e>>1]};case 2:return r?function(e){return I[e>>2]}:function(e){return j[e>>2]};case 3:return r?function(e){return q[e>>3]}:function(e){return N[e>>3]};default:throw new TypeError("Unknown integer type: "+e)}}function Ke(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 Qe(e){$e(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Ze=!1;function Je(e){}function et(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 tt(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=tt(e,t,r.baseClass);return null===n?null:r.downcast(n)}var rt={};var nt=[];function ot(){for(;nt.length;){var e=nt.pop();e.$$.deleteScheduled=!1,e.delete()}}var it=void 0;var at={};function st(e,t){return t.ptrType&&t.ptr||qe("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&qe("Both smartPtrType and smartPtr must be specified"),t.count={value:1},ut(Object.create(e,{$$:{value:t}}))}function ut(e){return"undefined"==typeof FinalizationRegistry?(ut=e=>e,e):(Ze=new FinalizationRegistry((e=>{et(e.$$)})),ut=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};Ze.register(e,r,e)}return e},Je=e=>Ze.unregister(e),ut(e))}function ct(){}function lt(e,t,r){if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||$e("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){u.hasOwnProperty(e)?((void 0===r||void 0!==u[e].overloadTable&&void 0!==u[e].overloadTable[r])&&$e("Cannot register public name '"+e+"' twice"),lt(u,e,e),u.hasOwnProperty(r)&&$e("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),u[e].overloadTable[r]=t):(u[e]=t,void 0!==r&&(u[e].numArguments=r))}function dt(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||$e("Expected null or instance of "+r.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function pt(e,t){if(null===t)return this.isReference&&$e("null is not a valid "+this.name),0;t.$$||$e('Cannot pass "'+He(t)+'" as a '+this.name),t.$$.ptr||$e("Cannot pass deleted object as a pointer of type "+this.name);var r=t.$$.ptrType.registeredClass;return ht(t.$$.ptr,r,this.registeredClass)}function mt(e,t){var r;if(null===t)return this.isReference&&$e("null is not a valid "+this.name),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||$e('Cannot pass "'+He(t)+'" as a '+this.name),t.$$.ptr||$e("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&&$e("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&&$e("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:$e("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:$e("Unsupporting sharing policy")}return r}function gt(e,t){if(null===t)return this.isReference&&$e("null is not a valid "+this.name),0;t.$$||$e('Cannot pass "'+He(t)+'" as a '+this.name),t.$$.ptr||$e("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&&$e("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,c,l){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=c,this.rawDestructor=l,o||void 0!==t.baseClass?this.toWireType=mt:n?(this.toWireType=pt,this.destructorFunction=null):(this.toWireType=gt,this.destructorFunction=null)}function yt(e,t,r){u.hasOwnProperty(e)||qe("Replacing nonexistant public symbol"),void 0!==u[e].overloadTable&&void 0!==r?u[e].overloadTable[r]=t:(u[e]=t,u[e].argCount=r)}var bt=[];function wt(e){var t=bt[e];return t||(e>=bt.length&&(bt.length=e+1),bt[e]=t=K.get(e)),t}function Et(e,t){e=Ve(e);var r=wt(t);return"function"!=typeof r&&$e("unknown function pointer with signature "+e+": "+t),r}var _t=void 0;function xt(e){var t=un(e),r=Ve(t);return an(t),r}function kt(e,t){var r=[],n={};throw t.forEach((function e(t){n[t]||Re[t]||(Me[t]?Me[t].forEach(e):(r.push(t),n[t]=!0))})),new _t(e+": "+r.map(xt).join([", "]))}function St(e,t){for(var r=[],n=0;n<e;n++)r.push(j[t+4*n>>2]);return r}function Ct(e,t){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var r=Ie(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var n=new r,o=e.apply(n,t);return o instanceof Object?o:n}function At(e,t,r,n,o){var i=t.length;i<2&&$e("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==t[1]&&null!==r,s=!1,u=1;u<t.length;++u)if(null!==t[u]&&void 0===t[u].destructorFunction){s=!0;break}var c="void"!==t[0].name,l="",f="";for(u=0;u<i-2;++u)l+=(0!==u?", ":"")+"arg"+u,f+=(0!==u?", ":"")+"arg"+u+"Wired";var d="return function "+Oe(e)+"("+l+") {\nif (arguments.length !== "+(i-2)+") {\nthrowBindingError('function "+e+" called with ' + arguments.length + ' arguments, expected "+(i-2)+" args!');\n}\n";s&&(d+="var destructors = [];\n");var h=s?"destructors":"null",p=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],m=[$e,n,o,Be,t[0],t[1]];for(a&&(d+="var thisWired = classParam.toWireType("+h+", this);\n"),u=0;u<i-2;++u)d+="var arg"+u+"Wired = argType"+u+".toWireType("+h+", arg"+u+"); // "+t[u+2].name+"\n",p.push("argType"+u),m.push(t[u+2]);if(a&&(f="thisWired"+(f.length>0?", ":"")+f),d+=(c?"var rv = ":"")+"invoker(fn"+(f.length>0?", ":"")+f+");\n",s)d+="runDestructors(destructors);\n";else for(u=a?1:2;u<t.length;++u){var g=1===u?"thisWired":"arg"+(u-2)+"Wired";null!==t[u].destructorFunction&&(d+=g+"_dtor("+g+"); // "+t[u].name+"\n",p.push(g+"_dtor"),m.push(t[u].destructorFunction))}return c&&(d+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),d+="}\n",p.push(d),Ct(Function,p).apply(null,m)}var Pt=[],Tt=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Ft(e){e>4&&0==--Tt[e].refcount&&(Tt[e]=void 0,Pt.push(e))}var Bt={toValue:e=>(e||$e("Cannot use deleted val. handle = "+e),Tt[e].value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=Pt.length?Pt.pop():Tt.length;return Tt[t]={refcount:1,value:e},t}}};function Dt(e,t,r){switch(t){case 0:return function(e){var t=r?L:R;return this.fromWireType(t[e])};case 1:return function(e){var t=r?M:O;return this.fromWireType(t[e>>1])};case 2:return function(e){var t=r?I:j;return this.fromWireType(t[e>>2])};default:throw new TypeError("Unknown integer type: "+e)}}function Lt(e,t){var r=Re[e];return void 0===r&&$e(t+" has unknown type "+xt(e)),r}function Rt(e,t){switch(t){case 2:return function(e){return this.fromWireType(U[e>>2])};case 3:return function(e){return this.fromWireType(z[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}var Mt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function Ot(e,t){for(var r=e,n=r>>1,o=n+t/2;!(n>=o)&&O[n];)++n;if((r=n<<1)-e>32&&Mt)return Mt.decode(R.subarray(e,r));for(var i="",a=0;!(a>=t/2);++a){var s=M[e+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i}function It(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);M[t>>1]=a,t+=2}return M[t>>1]=0,t-n}function jt(e){return 2*e.length}function Ut(e,t){for(var r=0,n="";!(r>=t/4);){var o=I[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}function qt(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)),I[t>>2]=a,(t+=4)+4>o)break}return I[t>>2]=0,t-n}function Nt(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 zt(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=Lt(j[t+4*n>>2],"parameter "+n);return r}var Ht={};function Wt(e){var t=Ht[e];return void 0===t?Ve(e):t}var Vt=[];function Gt(){return"object"==typeof globalThis?globalThis:Function("return this")()}var $t=[],Yt={};function Xt(e){return j[e>>2]+4294967296*I[e+4>>2]}function Kt(e){return e%4==0&&(e%100!=0||e%400==0)}var Qt,Zt=[0,31,60,91,121,152,182,213,244,274,305,335],Jt=[0,31,59,90,120,151,181,212,243,273,304,334];function er(e){return(Kt(e.getFullYear())?Zt:Jt)[e.getMonth()]+e.getDate()-1}function tr(e){var t=Y(e)+1,r=on(t);return r&&G(e,L,r,t),r}function rr(e,t){if(sr.mainLoop.timingMode=e,sr.mainLoop.timingValue=t,!sr.mainLoop.func)return 1;if(sr.mainLoop.running||(sr.mainLoop.running=!0),0==e)sr.mainLoop.scheduler=function(){var e=0|Math.max(0,sr.mainLoop.tickStartTime+t-Qt());setTimeout(sr.mainLoop.runner,e)},sr.mainLoop.method="timeout";else if(1==e)sr.mainLoop.scheduler=function(){sr.requestAnimationFrame(sr.mainLoop.runner)},sr.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),w?(void 0===u.setImmediates&&(u.setImmediates=[]),u.setImmediates.push(e),postMessage({target:n})):postMessage(n,"*")}}sr.mainLoop.scheduler=function(){setImmediate(sr.mainLoop.runner)},sr.mainLoop.method="immediate"}return 0}function nr(e){if(e instanceof ve||"unwind"==e)return F;y(1,e)}function or(e){if(!B)try{e()}catch(e){nr(e)}}function ir(e,t){return setTimeout((function(){or(e)}),t)}function ar(e){ar.shown||(ar.shown={}),ar.shown[e]||(ar.shown[e]=1,E&&(e="warning: "+e),A(e))}Qt=E?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:()=>performance.now();var sr={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){sr.mainLoop.scheduler=null,sr.mainLoop.currentlyRunningMainloop++},resume:function(){sr.mainLoop.currentlyRunningMainloop++;var e=sr.mainLoop.timingMode,t=sr.mainLoop.timingValue,r=sr.mainLoop.func;sr.mainLoop.func=null,function(e,t,r,n,o){D(!sr.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."),sr.mainLoop.func=e,sr.mainLoop.arg=n;var i=sr.mainLoop.currentlyRunningMainloop;function a(){return!(i<sr.mainLoop.currentlyRunningMainloop)}sr.mainLoop.running=!1,sr.mainLoop.runner=function(){if(!B)if(sr.mainLoop.queue.length>0){var t=Date.now(),r=sr.mainLoop.queue.shift();if(r.func(r.arg),sr.mainLoop.remainingBlockers){var n=sr.mainLoop.remainingBlockers,o=n%1==0?n-1:Math.floor(n);r.counted?sr.mainLoop.remainingBlockers=o:(o+=.5,sr.mainLoop.remainingBlockers=(8*n+o)/9)}if(C('main loop blocker "'+r.name+'" took '+(Date.now()-t)+" ms"),sr.mainLoop.updateStatus(),!a())return;setTimeout(sr.mainLoop.runner,0)}else a()&&(sr.mainLoop.currentFrameNumber=sr.mainLoop.currentFrameNumber+1|0,1==sr.mainLoop.timingMode&&sr.mainLoop.timingValue>1&&sr.mainLoop.currentFrameNumber%sr.mainLoop.timingValue!=0?sr.mainLoop.scheduler():(0==sr.mainLoop.timingMode&&(sr.mainLoop.tickStartTime=Qt()),sr.mainLoop.runIter(e),a()&&("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),sr.mainLoop.scheduler())))}}(r,0,0,sr.mainLoop.arg),rr(e,t),sr.mainLoop.scheduler()},updateStatus:function(){if(u.setStatus){var e=u.statusMessage||"Please wait...",t=sr.mainLoop.remainingBlockers,r=sr.mainLoop.expectedBlockers;t?t<r?u.setStatus(e+" ("+(r-t)+"/"+r+")"):u.setStatus(e):u.setStatus("")}},runIter:function(e){if(!B){if(u.preMainLoop&&!1===u.preMainLoop())return;or(e),u.postMainLoop&&u.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(u.preloadPlugins||(u.preloadPlugins=[]),!sr.initted){sr.initted=!0;try{new Blob,sr.hasBlobConstructor=!0}catch(e){sr.hasBlobConstructor=!1,A("warning: no blob constructor, cannot create blobs with mimetypes")}sr.BlobBuilder="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:sr.hasBlobConstructor?null:A("warning: no BlobBuilder"),sr.URLObject="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,u.noImageDecoding||void 0!==sr.URLObject||(A("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),u.noImageDecoding=!0);var e={canHandle:function(e){return!u.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,t,r,n){var o=null;if(sr.hasBlobConstructor)try{(o=new Blob([e],{type:sr.getMimetype(t)})).size!==e.length&&(o=new Blob([new Uint8Array(e).buffer],{type:sr.getMimetype(t)}))}catch(e){ar("Blob constructor present but fails: "+e+"; falling back to blob builder")}if(!o){var i=new sr.BlobBuilder;i.append(new Uint8Array(e).buffer),o=i.getBlob()}var a=sr.URLObject.createObjectURL(o),s=new Image;s.onload=()=>{D(s.complete,"Image "+t+" could not be decoded");var n=document.createElement("canvas");n.width=s.width,n.height=s.height,n.getContext("2d").drawImage(s,0,0),Qr[t]=n,sr.URLObject.revokeObjectURL(a),r&&r(e)},s.onerror=e=>{C("Image "+a+" could not be decoded"),n&&n()},s.src=a}};u.preloadPlugins.push(e);var t={canHandle:function(e){return!u.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,Zr[t]=n,r&&r(e))}function a(){o||(o=!0,Zr[t]=new Audio,n&&n())}if(!sr.hasBlobConstructor)return a();try{var s=new Blob([e],{type:sr.getMimetype(t)})}catch(e){return a()}var u=sr.URLObject.createObjectURL(s),c=new Audio;c.addEventListener("canplaythrough",(()=>i(c)),!1),c.onerror=function(r){o||(A("warning: browser could not fully decode audio "+t+", trying slower base64 approach"),c.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(c))},c.src=u,ir((function(){i(c)}),1e4)}};u.preloadPlugins.push(t);var r=u.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),u.elementPointerLock&&r.addEventListener("click",(e=>{!sr.pointerLock&&u.canvas.requestPointerLock&&(u.canvas.requestPointerLock(),e.preventDefault())}),!1))}function n(){sr.pointerLock=document.pointerLockElement===u.canvas||document.mozPointerLockElement===u.canvas||document.webkitPointerLockElement===u.canvas||document.msPointerLockElement===u.canvas}},handledByPreloadPlugin:function(e,t,r,n){sr.init();var o=!1;return u.preloadPlugins.forEach((function(i){o||i.canHandle(t)&&(i.handle(e,t,r,n),o=!0)})),o},createContext:function(e,t,r,n){if(t&&u.ctx&&e==u.canvas)return u.ctx;var o,i;if(t){var a={antialias:!1,alpha:!1,majorVersion:"undefined"!=typeof WebGL2RenderingContext?2:1};if(n)for(var s in n)a[s]=n[s];void 0!==mr&&(i=mr.createContext(e,a))&&(o=mr.getContext(i).GLctx)}else o=e.getContext("2d");return o?(r&&(t||D(void 0===Kr,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),u.ctx=o,t&&mr.makeContextCurrent(i),u.useWebGL=t,sr.moduleContextCreatedCallbacks.forEach((function(e){e()})),sr.init()),o):null},destroyContext:function(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(e,t){sr.lockPointer=e,sr.resizeCanvas=t,void 0===sr.lockPointer&&(sr.lockPointer=!0),void 0===sr.resizeCanvas&&(sr.resizeCanvas=!1);var r=u.canvas;function n(){sr.isFullscreen=!1;var e=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(r.exitFullscreen=sr.exitFullscreen,sr.lockPointer&&r.requestPointerLock(),sr.isFullscreen=!0,sr.resizeCanvas?sr.setFullscreenCanvasSize():sr.updateCanvasDimensions(r)):(e.parentNode.insertBefore(r,e),e.parentNode.removeChild(e),sr.resizeCanvas?sr.setWindowedCanvasSize():sr.updateCanvasDimensions(r)),u.onFullScreen&&u.onFullScreen(sr.isFullscreen),u.onFullscreen&&u.onFullscreen(sr.isFullscreen)}sr.fullscreenHandlersInstalled||(sr.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!!sr.isFullscreen&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){}).apply(document,[]),!0)},nextRAF:0,fakeRequestAnimationFrame:function(e){var t=Date.now();if(0===sr.nextRAF)sr.nextRAF=t+1e3/60;else for(;t+2>=sr.nextRAF;)sr.nextRAF+=1e3/60;var r=Math.max(sr.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame:function(e){"function"!=typeof requestAnimationFrame?(0,sr.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeSetTimeout:function(e,t){return ir(e,t)},safeRequestAnimationFrame:function(e){return sr.requestAnimationFrame((function(){or(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(sr.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?sr.mouseMovementX=sr.mouseMovementY=0:(sr.mouseMovementX=sr.getMovementX(e),sr.mouseMovementY=sr.getMovementY(e)),"undefined"!=typeof SDL?(sr.mouseX=SDL.mouseX+sr.mouseMovementX,sr.mouseY=SDL.mouseY+sr.mouseMovementY):(sr.mouseX+=sr.mouseMovementX,sr.mouseY+=sr.mouseMovementY);else{var t=u.canvas.getBoundingClientRect(),r=u.canvas.width,n=u.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 s=a.pageX-(o+t.left),c=a.pageY-(i+t.top),l={x:s*=r/t.width,y:c*=n/t.height};if("touchstart"===e.type)sr.lastTouches[a.identifier]=l,sr.touches[a.identifier]=l;else if("touchend"===e.type||"touchmove"===e.type){var f=sr.touches[a.identifier];f||(f=l),sr.lastTouches[a.identifier]=f,sr.touches[a.identifier]=l}return}var d=e.pageX-(o+t.left),h=e.pageY-(i+t.top);d*=r/t.width,h*=n/t.height,sr.mouseMovementX=d-sr.mouseX,sr.mouseMovementY=h-sr.mouseY,sr.mouseX=d,sr.mouseY=h}},resizeListeners:[],updateResizeListeners:function(){var e=u.canvas;sr.resizeListeners.forEach((function(t){t(e.width,e.height)}))},setCanvasSize:function(e,t,r){var n=u.canvas;sr.updateCanvasDimensions(n,e,t),r||sr.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=j[SDL.screen>>2];e|=8388608,I[SDL.screen>>2]=e}sr.updateCanvasDimensions(u.canvas),sr.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=j[SDL.screen>>2];e&=-8388609,I[SDL.screen>>2]=e}sr.updateCanvasDimensions(u.canvas),sr.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(u.forcedAspectRatio&&u.forcedAspectRatio>0&&(n/o<u.forcedAspectRatio?n=Math.round(o*u.forcedAspectRatio):o=Math.round(n/u.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)}sr.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"))))}},ur={errorCode:12288,defaultDisplayInitialized:!1,currentContext:0,currentReadSurface:0,currentDrawSurface:0,contextAttributes:{alpha:!1,depth:!1,stencil:!1,antialias:!1},stringCache:{},setErrorCode:function(e){ur.errorCode=e},chooseConfig:function(e,t,r,n,o){if(62e3!=e)return ur.setErrorCode(12296),0;if(t)for(;;){var i=I[t>>2];if(12321==i){var a=I[t+4>>2];ur.contextAttributes.alpha=a>0}else if(12325==i){var s=I[t+4>>2];ur.contextAttributes.depth=s>0}else if(12326==i){var u=I[t+4>>2];ur.contextAttributes.stencil=u>0}else if(12337==i){var c=I[t+4>>2];ur.contextAttributes.antialias=c>0}else if(12338==i)c=I[t+4>>2],ur.contextAttributes.antialias=1==c;else if(12544==i){var l=I[t+4>>2];ur.contextAttributes.lowLatency=12547!=l}else if(12344==i)break;t+=8}return r&&n||o?(o&&(I[o>>2]=1),r&&n>0&&(I[r>>2]=62002),ur.setErrorCode(12288),1):(ur.setErrorCode(12300),0)}};function cr(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 lr(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 fr(e){var t=e.getExtension("WEBGL_draw_buffers");if(t)return e.drawBuffers=function(e,r){t.drawBuffersWEBGL(e,r)},1}function dr(e){return!!(e.dibvbi=e.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"))}function hr(e){return!!(e.mdibvbi=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"))}function pr(e){return!!(e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw"))}var mr={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){mr.lastError||(mr.lastError=e)},getNewId:function(e){for(var t=mr.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?I[n+4*i>>2]:-1;o+=V(I[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?mr.registerContext(r,t):0},registerContext:function(e,t){var r=mr.getNewId(mr.contexts),n={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),mr.contexts[r]=n,(void 0===t.enableExtensionsByDefault||t.enableExtensionsByDefault)&&mr.initExtensions(n),r},makeContextCurrent:function(e){return mr.currentContext=mr.contexts[e],u.ctx=Kr=mr.currentContext&&mr.currentContext.GLctx,!(e&&!Kr)},getContext:function(e){return mr.contexts[e]},deleteContext:function(e){mr.currentContext===mr.contexts[e]&&(mr.currentContext=null),"object"==typeof Or&&Or.removeAllHandlersOnTarget(mr.contexts[e].GLctx.canvas),mr.contexts[e]&&mr.contexts[e].GLctx.canvas&&(mr.contexts[e].GLctx.canvas.GLctxObject=void 0),mr.contexts[e]=null},initExtensions:function(e){if(e||(e=mr.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var t=e.GLctx;cr(t),lr(t),fr(t),dr(t),hr(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")),pr(t),(t.getSupportedExtensions()||[]).forEach((function(e){e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}}},gr=[];function vr(e,t){return(e>>>0)+4294967296*t}var yr=[];function br(e,t,r,n){for(var o=0;o<e;o++){var i=Kr[r](),a=i&&mr.getNewId(n);i?(i.name=a,n[a]=i):mr.recordError(1282),I[t+4*o>>2]=a}}function wr(e,t,r,n,o,i,a,s){t=mr.programs[t];var u=Kr[e](t,r);if(u){var c=s&&$(u.name,s,n);o&&(I[o>>2]=c),i&&(I[i>>2]=u.size),a&&(I[a>>2]=u.type)}}function Er(e,t){j[e>>2]=t,j[e+4>>2]=(t-j[e>>2])/4294967296}function _r(e,t,r){if(t){var n=void 0;switch(e){case 36346:n=1;break;case 36344:return void(0!=r&&1!=r&&mr.recordError(1280));case 34814:case 36345:n=0;break;case 34466:var o=Kr.getParameter(34467);n=o?o.length:0;break;case 33309:if(mr.currentContext.version<2)return void mr.recordError(1282);n=2*(Kr.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(mr.currentContext.version<2)return void mr.recordError(1280);n=33307==e?3:0}if(void 0===n){var i=Kr.getParameter(e);switch(typeof i){case"number":n=i;break;case"boolean":n=i?1:0;break;case"string":return void mr.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 mr.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:I[t+4*a>>2]=i[a];break;case 2:U[t+4*a>>2]=i[a];break;case 4:L[t+a>>0]=i[a]?1:0}return}try{n=0|i.name}catch(t){return mr.recordError(1280),void A("GL_INVALID_ENUM in glGet"+r+"v: Unknown object returned from WebGL getParameter("+e+")! (error: "+t+")")}}break;default:return mr.recordError(1280),void A("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:Er(t,n);break;case 0:I[t>>2]=n;break;case 2:U[t>>2]=n;break;case 4:L[t>>0]=n?1:0}}else mr.recordError(1281)}function xr(e,t,r,n){if(r){var o,i=Kr.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 mr.recordError(1280)}else{if(!(i instanceof WebGLBuffer))return void mr.recordError(1280);o=0|i.name}break;default:return void mr.recordError(1280)}switch(n){case 1:Er(r,o);break;case 0:I[r>>2]=o;break;case 2:U[r>>2]=o;break;case 4:L[r>>0]=o?1:0;break;default:throw"internal emscriptenWebGLGetIndexed() error, bad type: "+n}}else mr.recordError(1281)}function kr(e){var t=Y(e)+1,r=on(t);return $(e,r,t),r}function Sr(e){return"]"==e.slice(-1)&&e.lastIndexOf("[")}function Cr(e){var t,r,n=e.uniformLocsById,o=e.uniformSizeAndIdsByName;if(!n)for(e.uniformLocsById=n={},e.uniformArrayNamesById={},t=0;t<Kr.getProgramParameter(e,35718);++t){var i=Kr.getActiveUniform(e,t),a=i.name,s=i.size,u=Sr(a),c=u>0?a.slice(0,u):a,l=e.uniformIdCounter;for(e.uniformIdCounter+=s,o[c]=[s,l],r=0;r<s;++r)n[l]=r,e.uniformArrayNamesById[l++]=c}}function Ar(e){var t=Kr.currentProgram;if(t){var r=t.uniformLocsById[e];return"number"==typeof r&&(t.uniformLocsById[e]=r=Kr.getUniformLocation(t,t.uniformArrayNamesById[e]+(r>0?"["+r+"]":""))),r}mr.recordError(1282)}function Pr(e,t,r,n){if(r){Cr(e=mr.programs[e]);var o=Kr.getUniform(e,Ar(t));if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:I[r>>2]=o;break;case 2:U[r>>2]=o}else for(var i=0;i<o.length;i++)switch(n){case 0:I[r+4*i>>2]=o[i];break;case 2:U[r+4*i>>2]=o[i]}}else mr.recordError(1281)}function Tr(e,t,r,n){if(r){var o=Kr.getVertexAttrib(e,t);if(34975==t)I[r>>2]=o&&o.name;else if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:I[r>>2]=o;break;case 2:U[r>>2]=o;break;case 5:I[r>>2]=Math.fround(o)}else for(var i=0;i<o.length;i++)switch(n){case 0:I[r+4*i>>2]=o[i];break;case 2:U[r+4*i>>2]=o[i];break;case 5:I[r+4*i>>2]=Math.fround(o[i])}}else mr.recordError(1281)}function Fr(e){return 0==(e-=5120)?L:1==e?R:2==e?M:4==e?I:6==e?U:5==e||28922==e||28520==e||30779==e||30782==e?j:O}function Br(e){return 31-Math.clz32(e.BYTES_PER_ELEMENT)}function Dr(e,t,r,n,o,i){var a=Fr(e),s=Br(a),u=1<<s,c=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,l=function(e,t,r,n){var o;return t*(e*r+(o=n)-1&-o)}(r,n,c,mr.unpackAlignment);return a.subarray(o>>s,o+l>>s)}var Lr=[],Rr=[];function Mr(e){var t=P.buffer;try{return P.grow(e-t.byteLength+65535>>>16),X(),1}catch(e){}}var Or={inEventHandler:0,removeAllEventListeners:function(){for(var e=Or.eventHandlers.length-1;e>=0;--e)Or._removeHandler(e);Or.eventHandlers=[],Or.deferredCalls=[]},registerRemoveEventListeners:function(){Or.removeEventListenersRegistered||(ee.push(Or.removeAllEventListeners),Or.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 Or.deferredCalls){var i=Or.deferredCalls[o];if(i.targetFunction==e&&n(i.argsList,r))return}Or.deferredCalls.push({targetFunction:e,precedence:t,argsList:r}),Or.deferredCalls.sort((function(e,t){return e.precedence<t.precedence}))},removeDeferredCalls:function(e){for(var t=0;t<Or.deferredCalls.length;++t)Or.deferredCalls[t].targetFunction==e&&(Or.deferredCalls.splice(t,1),--t)},canPerformEventHandlerRequests:function(){return Or.inEventHandler&&Or.currentEventHandler.allowsDeferredCalls},runDeferredCalls:function(){if(Or.canPerformEventHandlerRequests())for(var e=0;e<Or.deferredCalls.length;++e){var t=Or.deferredCalls[e];Or.deferredCalls.splice(e,1),--e,t.targetFunction.apply(null,t.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:function(e,t){for(var r=0;r<Or.eventHandlers.length;++r)Or.eventHandlers[r].target!=e||t&&t!=Or.eventHandlers[r].eventTypeString||Or._removeHandler(r--)},_removeHandler:function(e){var t=Or.eventHandlers[e];t.target.removeEventListener(t.eventTypeString,t.eventListenerFunc,t.useCapture),Or.eventHandlers.splice(e,1)},registerOrRemoveHandler:function(e){var t=function(t){++Or.inEventHandler,Or.currentEventHandler=e,Or.runDeferredCalls(),e.handlerFunc(t),Or.runDeferredCalls(),--Or.inEventHandler};if(e.callbackfunc)e.eventListenerFunc=t,e.target.addEventListener(e.eventTypeString,t,e.useCapture),Or.eventHandlers.push(e),Or.registerRemoveEventListeners();else for(var r=0;r<Or.eventHandlers.length;++r)Or.eventHandlers[r].target==e.target&&Or.eventHandlers[r].eventTypeString==e.eventTypeString&&Or._removeHandler(r--)},getNodeNameForTarget:function(e){return e?e==window?"#window":e==screen?"#screen":e&&e.nodeName?e.nodeName:"":""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}},Ir=["default","low-power","high-performance"],jr=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0];var Ur={};function qr(){if(!qr.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",_:v||"./this.program"};for(var t in Ur)void 0===Ur[t]?delete e[t]:e[t]=Ur[t];var r=[];for(var t in e)r.push(t+"="+e[t]);qr.strings=r}return qr.strings}function Nr(e,t){var r;F=e,F=r=e,re()||(u.onExit&&u.onExit(r),B=!0),y(r,new ve(r))}var zr=Nr;function Hr(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=j[t>>2],s=j[t+4>>2];t+=8;var u=Ae.read(e,L,a,s,n);if(u<0)return-1;if(o+=u,u<s)break;void 0!==n&&(n+=u)}return o}function Wr(e){return e<-9007199254740992||e>9007199254740992?NaN:Number(e)}var Vr=[31,29,31,30,31,30,31,31,30,31,30,31],Gr=[31,28,31,30,31,30,31,31,30,31,30,31];function $r(e,t){L.set(e,t)}function Yr(e,t,r,n,o){var i={string:e=>{var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2);$(e,t=hn(r),r)}return t},array:e=>{var t=hn(e.length);return $r(e,t),t}},a=function(e){return u["_"+e]}(e),s=[],c=0;if(n)for(var l=0;l<n.length;l++){var f=i[r[l]];f?(0===c&&(c=fn()),s[l]=f(n[l])):s[l]=n[l]}var d=a.apply(null,s);return function(e){return 0!==c&&dn(c),function(e){return"string"===t?V(e):"boolean"===t?Boolean(e):e}(e)}(d)}var Xr=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(Xr.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=Xr,Ae.staticInit(),u.FS_createPath=Ae.createPath,u.FS_createDataFile=Ae.createDataFile,u.FS_createPreloadedFile=Ae.createPreloadedFile,u.FS_unlink=Ae.unlink,u.FS_createLazyFile=Ae.createLazyFile,u.FS_createDevice=Ae.createDevice,Ue=u.InternalError=je(Error,"InternalError"),function(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);We=e}(),Ge=u.BindingError=je(Error,"BindingError"),ct.prototype.isAliasOf=function(e){if(!(this instanceof ct))return!1;if(!(e instanceof ct))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},ct.prototype.clone=function(){if(this.$$.ptr||Qe(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=ut(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},ct.prototype.delete=function(){this.$$.ptr||Qe(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&$e("Object already scheduled for deletion"),Je(this),et(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},ct.prototype.isDeleted=function(){return!this.$$.ptr},ct.prototype.deleteLater=function(){return this.$$.ptr||Qe(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&$e("Object already scheduled for deletion"),nt.push(this),1===nt.length&&it&&it(ot),this.$$.deleteScheduled=!0,this},u.getInheritedInstanceCount=function(){return Object.keys(at).length},u.getLiveInheritedInstances=function(){var e=[];for(var t in at)at.hasOwnProperty(t)&&e.push(at[t]);return e},u.flushPendingDeletes=ot,u.setDelayFunction=function(e){it=e,nt.length&&it&&it(ot)},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=De,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&&$e("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),at[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?st(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):st(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,a=this.registeredClass.getActualType(t),s=rt[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=tt(t,this.registeredClass,i.registeredClass);return null===u?o.call(this):this.isSmartPointer?st(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:e}):st(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})},_t=u.UnboundTypeError=je(Error,"UnboundTypeError"),u.count_emval_handles=function(){for(var e=0,t=5;t<Tt.length;++t)void 0!==Tt[t]&&++e;return e},u.get_first_emval=function(){for(var e=5;e<Tt.length;++e)if(void 0!==Tt[e])return Tt[e];return null},u.requestFullscreen=function(e,t){sr.requestFullscreen(e,t)},u.requestAnimationFrame=function(e){sr.requestAnimationFrame(e)},u.setCanvasSize=function(e,t,r){sr.setCanvasSize(e,t,r)},u.pauseMainLoop=function(){sr.mainLoop.pause()},u.resumeMainLoop=function(){sr.mainLoop.resume()},u.getUserMedia=function(){sr.getUserMedia()},u.createContext=function(e,t,r,n){return sr.createContext(e,t,r,n)};for(var Kr,Qr={},Zr={},Jr=0;Jr<32;++Jr)yr.push(new Array(Jr));var en=new Float32Array(288);for(Jr=0;Jr<288;++Jr)Lr[Jr]=en.subarray(0,Jr+1);var tn=new Int32Array(288);for(Jr=0;Jr<288;++Jr)Rr[Jr]=tn.subarray(0,Jr+1);var rn,nn={h:function(e,t,r){throw new be(e).init(t,r),e},T:function(e,t,r){Pe.varargs=r;try{var n=Pe.getStreamFromFD(e);switch(t){case 0:return(o=Pe.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=Pe.get();return n.flags|=o,0;case 5:return o=Pe.get(),M[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return 28,I[sn()>>2]=28,-1}}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return-e.errno}},wb:function(e,t){try{var r=Pe.getStreamFromFD(e);return Pe.doStat(Ae.stat,r.path,t)}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return-e.errno}},Ib:function(e,t,r){Pe.varargs=r;try{var n=Pe.getStreamFromFD(e);switch(t){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=Pe.get();return I[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=Pe.get(),Ae.ioctl(n,t,o);default:return-28}}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return-e.errno}},tb:function(e,t){try{return e=Pe.getStr(e),Pe.doStat(Ae.lstat,e,t)}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return-e.errno}},ub:function(e,t,r,n){try{t=Pe.getStr(t);var o=256&n,i=4096&n;return n&=-6401,t=Pe.calculateAt(e,t,i),Pe.doStat(o?Ae.lstat:Ae.stat,t,r)}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return-e.errno}},ga:function(e,t,r,n){Pe.varargs=n;try{t=Pe.getStr(t),t=Pe.calculateAt(e,t);var o=n?Pe.get():0;return Ae.open(t,r,o).fd}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return-e.errno}},vb:function(e,t){try{return e=Pe.getStr(e),Pe.doStat(Ae.stat,e,t)}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return-e.errno}},Fb:function(e){},Hb:function(e,t){de(Te)},Gb:function(e,t){de(Te)},ka:function(e){var t=Fe[e];delete Fe[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;Ne([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,c=t.setterContext;t.read=e=>o.fromWireType(i(a,e)),t.write=(e,t)=>{var r=[];u(c,e,s.toWireType(r,t)),Be(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:De,destructorFunction:a}]}))},u:function(e){var t=ze[e];delete ze[e];var r=t.rawConstructor,n=t.rawDestructor,o=t.fields;Ne([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,c=e[r+o.length],l=t.setter,f=t.setterContext;i[n]={read:e=>a.fromWireType(s(u,e)),write:(e,t)=>{var r=[];l(f,e,c.toWireType(r,t)),Be(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:De,destructorFunction:n}]}))},oa:function(e,t,r,n,o){t=Ve(t);var i=Ke(r),a=-1!=t.indexOf("u");a&&(o=(1n<<64n)-1n),Ye(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:Xe(t,i,!a),destructorFunction:null})},oe:function(e,t,r,n,o){var i=Ke(r);Ye(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=L;else if(2===r)n=M;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+t);n=I}return this.fromWireType(n[e>>i])},destructorFunction:null})},p:function(e,t,r,n,o,i,a,s,u,c,l,f,d){l=Ve(l),i=Et(o,i),s&&(s=Et(a,s)),c&&(c=Et(u,c)),d=Et(f,d);var h=Oe(l);ft(h,(function(){kt("Cannot construct "+l+" due to unbound types",[n])})),Ne([e,t,r],n?[n]:[],(function(t){var r,o;t=t[0],o=n?(r=t.registeredClass).instancePrototype:ct.prototype;var a=Ie(h,(function(){if(Object.getPrototypeOf(this)!==u)throw new Ge("Use 'new' to construct "+l);if(void 0===f.constructor_body)throw new Ge(l+" has no accessible constructor");var e=f.constructor_body[arguments.length];if(void 0===e)throw new Ge("Tried to invoke ctor of "+l+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(f.constructor_body).toString()+") parameters instead!");return e.apply(this,arguments)})),u=Object.create(o,{constructor:{value:a}});a.prototype=u;var f=new dt(l,a,u,d,r,i,s,c),p=new vt(l,f,!0,!1,!1),m=new vt(l+"*",f,!1,!1,!1),g=new vt(l+" const*",f,!1,!0,!1);return rt[e]={pointerType:m,constPointerType:g},yt(h,a),[p,m,g]}))},q:function(e,t,r,n,o,i){D(t>0);var a=St(t,r);o=Et(n,o),Ne([],[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 Ge("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)},Ne([],a,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=At(r,n,null,o,i),[]})),[]}))},c:function(e,t,r,n,o,i,a,s){var u=St(r,n);t=Ve(t),i=Et(o,i),Ne([],[e],(function(e){var n=(e=e[0]).name+"."+t;function o(){kt("Cannot call "+n+" due to unbound types",u)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var c=e.registeredClass.instancePrototype,l=c[t];return void 0===l||void 0===l.overloadTable&&l.className!==e.name&&l.argCount===r-2?(o.argCount=r-2,o.className=e.name,c[t]=o):(lt(c,t,n),c[t].overloadTable[r-2]=o),Ne([],u,(function(o){var s=At(n,o,e,i,a);return void 0===c[t].overloadTable?(s.argCount=r-2,c[t]=s):c[t].overloadTable[r-2]=s,[]})),[]}))},ne:function(e,t){Ye(e,{name:t=Ve(t),fromWireType:function(e){var t=Bt.toValue(e);return Ft(e),t},toWireType:function(e,t){return Bt.toHandle(t)},argPackAdvance:8,readValueFromPointer:De,destructorFunction:null})},L:function(e,t,r,n){var o=Ke(r);function i(){}t=Ve(t),i.values={},Ye(e,{name:t,constructor:i,fromWireType:function(e){return this.constructor.values[e]},toWireType:function(e,t){return t.value},argPackAdvance:8,readValueFromPointer:Dt(t,o,n),destructorFunction:null}),ft(t,i)},w:function(e,t,r){var n=Lt(e,"enum");t=Ve(t);var o=n.constructor,i=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:Ie(n.name+"_"+t,(function(){}))}});o.values[r]=i,o[t]=i},na:function(e,t,r){var n=Ke(r);Ye(e,{name:t=Ve(t),fromWireType:function(e){return e},toWireType:function(e,t){return t},argPackAdvance:8,readValueFromPointer:Rt(t,n),destructorFunction:null})},D:function(e,t,r,n,o,i){var a=St(t,r);e=Ve(e),o=Et(n,o),ft(e,(function(){kt("Cannot call "+e+" due to unbound types",a)}),t-1),Ne([],a,(function(r){var n=[r[0],null].concat(r.slice(1));return yt(e,At(e,n,null,o,i),t-1),[]}))},H:function(e,t,r,n,o){t=Ve(t),-1===o&&(o=4294967295);var i=Ke(r),a=e=>e;if(0===n){var s=32-8*r;a=e=>e<<s>>>s}var u=t.includes("unsigned");Ye(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:Xe(t,i,0!==n),destructorFunction:null})},z:function(e,t,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];function o(e){var t=j,r=t[e>>=2],o=t[e+1];return new n(t.buffer,o,r)}Ye(e,{name:r=Ve(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Ae:function(e,t,r,n,o,i,a,s,u,c,l,f){r=Ve(r),i=Et(o,i),s=Et(a,s),c=Et(u,c),f=Et(l,f),Ne([e],[t],(function(e){return e=e[0],[new vt(r,e.registeredClass,!1,!1,!0,e,n,i,s,c,f)]}))},ma:function(e,t){var r="std::string"===(t=Ve(t));Ye(e,{name:t,fromWireType:function(e){var t,n=j[e>>2],o=e+4;if(r)for(var i=o,a=0;a<=n;++a){var s=o+a;if(a==n||0==R[s]){var u=V(i,s-i);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),i=s+1}}else{var c=new Array(n);for(a=0;a<n;++a)c[a]=String.fromCharCode(R[o+a]);t=c.join("")}return an(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||$e("Cannot pass non-string to std::string"),n=r&&o?Y(t):t.length;var i=on(4+n+1),a=i+4;if(j[i>>2]=n,r&&o)$(t,a,n+1);else if(o)for(var s=0;s<n;++s){var u=t.charCodeAt(s);u>255&&(an(a),$e("String has UTF-16 code units that do not fit in 8 bits")),R[a+s]=u}else for(s=0;s<n;++s)R[a+s]=t[s];return null!==e&&e.push(an,i),i},argPackAdvance:8,readValueFromPointer:De,destructorFunction:function(e){an(e)}})},V:function(e,t,r){var n,o,i,a,s;r=Ve(r),2===t?(n=Ot,o=It,a=jt,i=()=>O,s=1):4===t&&(n=Ut,o=qt,a=Nt,i=()=>j,s=2),Ye(e,{name:r,fromWireType:function(e){for(var r,o=j[e>>2],a=i(),u=e+4,c=0;c<=o;++c){var l=e+4+c*t;if(c==o||0==a[l>>s]){var f=n(u,l-u);void 0===r?r=f:(r+=String.fromCharCode(0),r+=f),u=l+t}}return an(e),r},toWireType:function(e,n){"string"!=typeof n&&$e("Cannot pass non-string to C++ string type "+r);var i=a(n),u=on(4+i+t);return j[u>>2]=i>>s,o(n,u+4,i+t),null!==e&&e.push(an,u),u},argPackAdvance:8,readValueFromPointer:De,destructorFunction:function(e){an(e)}})},la:function(e,t,r,n,o,i){Fe[e]={name:Ve(t),rawConstructor:Et(r,n),rawDestructor:Et(o,i),elements:[]}},G:function(e,t,r,n,o,i,a,s,u){Fe[e].elements.push({getterReturnType:t,getter:Et(r,n),getterContext:o,setterArgumentType:i,setter:Et(a,s),setterContext:u})},v:function(e,t,r,n,o,i){ze[e]={name:Ve(t),rawConstructor:Et(r,n),rawDestructor:Et(o,i),fields:[]}},j:function(e,t,r,n,o,i,a,s,u,c){ze[e].fields.push({fieldName:Ve(t),getterReturnType:r,getter:Et(n,o),getterContext:i,setterArgumentType:a,setter:Et(s,u),setterContext:c})},pe:function(e,t){Ye(e,{isVoid:!0,name:t=Ve(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})},zb:function(){return!0},jb:function(){throw 1/0},k:function(e,t,r){e=Bt.toValue(e),t=Lt(t,"emval::as");var n=[],o=Bt.toHandle(n);return j[r>>2]=o,t.toWireType(n,e)},o:function(e,t,r,n){e=Bt.toValue(e);for(var o=zt(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)},N:function(e,t,r,n,o){return(e=Vt[e])(t=Bt.toValue(t),r=Wt(r),function(e){var t=[];return j[e>>2]=Bt.toHandle(t),t}(n),o)},M:function(e,t,r,n){(e=Vt[e])(t=Bt.toValue(t),r=Wt(r),null,n)},b:Ft,Sd:function(e,t){return(e=Bt.toValue(e))==Bt.toValue(t)},A:function(e){return 0===e?Bt.toHandle(Gt()):(e=Wt(e),Bt.toHandle(Gt()[e]))},E:function(e,t){var r=zt(e,t),n=r[0],o=n.name+"_$"+r.slice(1).map((function(e){return e.name})).join("_")+"$",i=$t[o];if(void 0!==i)return i;for(var a=["retType"],s=[n],u="",c=0;c<e-1;++c)u+=(0!==c?", ":"")+"arg"+c,a.push("argType"+c),s.push(r[1+c]);var l,f,d="return function "+Oe("methodCaller_"+o)+"(handle, name, destructors, args) {\n",h=0;for(c=0;c<e-1;++c)d+=" var arg"+c+" = argType"+c+".readValueFromPointer(args"+(h?"+"+h:"")+");\n",h+=r[c+1].argPackAdvance;for(d+=" var rv = handle[name]("+u+");\n",c=0;c<e-1;++c)r[c+1].deleteObject&&(d+=" argType"+c+".deleteObject(arg"+c+");\n");return n.isVoid||(d+=" return retType.toWireType(destructors, rv);\n"),d+="};\n",a.push(d),l=Ct(Function,a).apply(null,s),f=Vt.length,Vt.push(l),i=f,$t[o]=i,i},g:function(e,t){return e=Bt.toValue(e),t=Bt.toValue(t),Bt.toHandle(e[t])},d:function(e){e>4&&(Tt[e].refcount+=1)},Lg:function(e,t){return(e=Bt.toValue(e))instanceof Bt.toValue(t)},U:function(e){return"number"==typeof(e=Bt.toValue(e))},F:function(e){return"string"==typeof(e=Bt.toValue(e))},qe:function(e,t,r,n){e=Bt.toValue(e);var o=Yt[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)(Lt,u,Bt.toHandle,(()=>j))}(t),Yt[t]=o),o(e,r,n)},I:function(){return Bt.toHandle([])},f:function(e){return Bt.toHandle(Wt(e))},C:function(){return Bt.toHandle({})},i:function(e){Be(Bt.toValue(e)),Ft(e)},s:function(e,t,r){e=Bt.toValue(e),t=Bt.toValue(t),r=Bt.toValue(r),e[t]=r},e:function(e,t){var r=(e=Lt(e,"_emval_take_value")).readValueFromPointer(t);return Bt.toHandle(r)},le:function(e){throw Bt.toValue(e)},Ab:function(e,t){var r=new Date(1e3*Xt(e));I[t>>2]=r.getUTCSeconds(),I[t+4>>2]=r.getUTCMinutes(),I[t+8>>2]=r.getUTCHours(),I[t+12>>2]=r.getUTCDate(),I[t+16>>2]=r.getUTCMonth(),I[t+20>>2]=r.getUTCFullYear()-1900,I[t+24>>2]=r.getUTCDay();var n=Date.UTC(r.getUTCFullYear(),0,1,0,0,0,0),o=(r.getTime()-n)/864e5|0;I[t+28>>2]=o},Bb:function(e,t){var r=new Date(1e3*Xt(e));I[t>>2]=r.getSeconds(),I[t+4>>2]=r.getMinutes(),I[t+8>>2]=r.getHours(),I[t+12>>2]=r.getDate(),I[t+16>>2]=r.getMonth(),I[t+20>>2]=r.getFullYear()-1900,I[t+24>>2]=r.getDay();var n=0|er(r);I[t+28>>2]=n,I[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));I[t+32>>2]=s},Cb:function(e){var t=new Date(I[e+20>>2]+1900,I[e+16>>2],I[e+12>>2],I[e+8>>2],I[e+4>>2],I[e>>2],0),r=I[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)I[e+32>>2]=Number(i!=a&&s==n);else if(r>0!=(s==n)){var u=Math.max(a,i),c=r>0?s:u;t.setTime(t.getTime()+6e4*(c-n))}I[e+24>>2]=t.getDay();var l=0|er(t);return I[e+28>>2]=l,I[e>>2]=t.getSeconds(),I[e+4>>2]=t.getMinutes(),I[e+8>>2]=t.getHours(),I[e+12>>2]=t.getDate(),I[e+16>>2]=t.getMonth(),I[e+20>>2]=t.getYear(),t.getTime()/1e3|0},ob:function(e,t,r,n,o,i,a){try{var s=Pe.getStreamFromFD(n),u=Ae.mmap(s,e,o,t,r),c=u.ptr;return I[i>>2]=u.allocated,j[a>>2]=c,0}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return-e.errno}},pb:function(e,t,r,n,o,i){try{var a=Pe.getStreamFromFD(o);2&r&&Pe.doMsync(e,a,t,n,i),Ae.munmap(a)}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return-e.errno}},Db:function(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 c(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}j[e>>2]=60*u,I[t>>2]=Number(a!=s);var l=c(o),f=c(i),d=tr(l),h=tr(f);s<a?(j[r>>2]=d,j[r+4>>2]=h):(j[r>>2]=h,j[r+4>>2]=d)},a:function(){de("")},ea:function(e,t,r,n,o){return ur.chooseConfig(e,t,r,n,o)},fa:function(e,t,r,n){if(62e3!=e)return ur.setErrorCode(12296),0;for(var o=1;;){var i=I[n>>2];if(12440!=i){if(12344==i)break;return ur.setErrorCode(12292),0}o=I[n+4>>2],n+=8}return o<2||o>3?(ur.setErrorCode(12293),0):(ur.contextAttributes.majorVersion=o-1,ur.contextAttributes.minorVersion=0,ur.context=mr.createContext(u.canvas,ur.contextAttributes),0!=ur.context?(ur.setErrorCode(12288),mr.makeContextCurrent(ur.context),u.useWebGL=!0,sr.moduleContextCreatedCallbacks.forEach((function(e){e()})),mr.makeContextCurrent(null),62004):(ur.setErrorCode(12297),0))},bb:function(e,t,r,n){return 62e3!=e?(ur.setErrorCode(12296),0):62002!=t?(ur.setErrorCode(12293),0):(ur.setErrorCode(12288),62006)},gc:function(e,t){return 62e3!=e?(ur.setErrorCode(12296),0):62004!=t?(ur.setErrorCode(12294),0):(mr.deleteContext(ur.context),ur.setErrorCode(12288),ur.currentContext==t&&(ur.currentContext=0),1)},Xb:function(e,t){return 62e3!=e?(ur.setErrorCode(12296),0):62006!=t?(ur.setErrorCode(12301),1):(ur.currentReadSurface==t&&(ur.currentReadSurface=0),ur.currentDrawSurface==t&&(ur.currentDrawSurface=0),ur.setErrorCode(12288),1)},J:function(e,t,r,n){if(62e3!=e)return ur.setErrorCode(12296),0;if(62002!=t)return ur.setErrorCode(12293),0;if(!n)return ur.setErrorCode(12300),0;switch(ur.setErrorCode(12288),r){case 12320:return I[n>>2]=ur.contextAttributes.alpha?32:24,1;case 12321:return I[n>>2]=ur.contextAttributes.alpha?8:0,1;case 12322:case 12323:case 12324:return I[n>>2]=8,1;case 12325:return I[n>>2]=ur.contextAttributes.depth?24:0,1;case 12326:return I[n>>2]=ur.contextAttributes.stencil?8:0,1;case 12327:case 12335:case 12340:return I[n>>2]=12344,1;case 12328:return I[n>>2]=62002,1;case 12329:case 12333:case 12334:case 12345:case 12346:case 12347:case 12349:case 12350:case 12354:return I[n>>2]=0,1;case 12330:case 12332:return I[n>>2]=4096,1;case 12331:return I[n>>2]=16777216,1;case 12337:return I[n>>2]=ur.contextAttributes.antialias?4:0,1;case 12338:return I[n>>2]=ur.contextAttributes.antialias?1:0,1;case 12339:case 12352:return I[n>>2]=4,1;case 12341:case 12342:case 12343:return I[n>>2]=-1,1;case 12348:return I[n>>2]=1,1;case 12351:return I[n>>2]=12430,1;default:return ur.setErrorCode(12292),0}},mb:function(e){return ur.setErrorCode(12288),62e3},ha:function(){return ur.errorCode},gb:function(e,t,r){return 62e3!=e?(ur.setErrorCode(12296),0):(t&&(I[t>>2]=1),r&&(I[r>>2]=4),ur.defaultDisplayInitialized=!0,ur.setErrorCode(12288),1)},xb:function(e,t,r,n){return 62e3!=e?(ur.setErrorCode(12296),0):0!=n&&62004!=n?(ur.setErrorCode(12294),0):0!=r&&62006!=r||0!=t&&62006!=t?(ur.setErrorCode(12301),0):(mr.makeContextCurrent(n?ur.context:null),ur.currentContext=n,ur.currentDrawSurface=t,ur.currentReadSurface=r,ur.setErrorCode(12288),1)},rc:function(){if(ur.defaultDisplayInitialized)if(u.ctx){if(!u.ctx.isContextLost())return ur.setErrorCode(12288),1;ur.setErrorCode(12302)}else ur.setErrorCode(12290);else ur.setErrorCode(12289);return 0},Mb:function(e){return 62e3!=e?(ur.setErrorCode(12296),0):(ur.currentContext=0,ur.currentReadSurface=0,ur.currentDrawSurface=0,ur.defaultDisplayInitialized=!1,ur.setErrorCode(12288),1)},y:function(e,t,r){return function(e,t,r){var n=function(e,t){var r;for(gr.length=0,t>>=2;r=R[e++];)t+=105!=r&t,gr.push(105==r?I[t]:(106==r?q:z)[t++>>1]),++t;return gr}(t,r);return ge[e].apply(null,n)}(e,t,r)},Be:function(e){console.error(V(e))},Ce:function(e){console.log(V(e))},X:function(e){console.warn(V(e))},R:function(){return Date.now()},re:function(){},lb:function(){return 2147483648},yb:Qt,Zf:function(e){Kr.activeTexture(e)},_f:function(e,t){Kr.attachShader(mr.programs[e],mr.shaders[t])},ad:function(e,t){Kr.beginQuery(e,mr.queries[t])},ie:function(e,t){Kr.disjointTimerQueryExt.beginQueryEXT(e,mr.queries[t])},Pc:function(e){Kr.beginTransformFeedback(e)},$f:function(e,t,r){Kr.bindAttribLocation(mr.programs[e],t,V(r))},ag:function(e,t){35051==e?Kr.currentPixelPackBufferBinding=t:35052==e&&(Kr.currentPixelUnpackBufferBinding=t),Kr.bindBuffer(e,mr.buffers[t])},Mc:function(e,t,r){Kr.bindBufferBase(e,t,mr.buffers[r])},Nc:function(e,t,r,n,o){Kr.bindBufferRange(e,t,mr.buffers[r],n,o)},$e:function(e,t){Kr.bindFramebuffer(e,mr.framebuffers[t])},af:function(e,t){Kr.bindRenderbuffer(e,mr.renderbuffers[t])},Le:function(e,t){Kr.bindSampler(e,mr.samplers[t])},bg:function(e,t){Kr.bindTexture(e,mr.textures[t])},$b:function(e,t){Kr.bindTransformFeedback(e,mr.transformFeedbacks[t])},vf:function(e){Kr.bindVertexArray(mr.vaos[e])},yf:function(e){Kr.bindVertexArray(mr.vaos[e])},cg:function(e,t,r,n){Kr.blendColor(e,t,r,n)},dg:function(e){Kr.blendEquation(e)},Xd:function(e,t){Kr.blendEquationSeparate(e,t)},eg:function(e,t){Kr.blendFunc(e,t)},Wd:function(e,t,r,n){Kr.blendFuncSeparate(e,t,r,n)},Ve:function(e,t,r,n,o,i,a,s,u,c){Kr.blitFramebuffer(e,t,r,n,o,i,a,s,u,c)},fg:function(e,t,r,n){mr.currentContext.version>=2?r&&t?Kr.bufferData(e,R,n,r,t):Kr.bufferData(e,t,n):Kr.bufferData(e,r?R.subarray(r,r+t):t,n)},gg:function(e,t,r,n){mr.currentContext.version>=2?r&&Kr.bufferSubData(e,t,R,n,r):Kr.bufferSubData(e,t,R.subarray(n,n+r))},bf:function(e){return Kr.checkFramebufferStatus(e)},hg:function(e){Kr.clear(e)},pc:function(e,t,r,n){Kr.clearBufferfi(e,t,r,n)},qc:function(e,t,r){Kr.clearBufferfv(e,t,U,r>>2)},tc:function(e,t,r){Kr.clearBufferiv(e,t,I,r>>2)},sc:function(e,t,r){Kr.clearBufferuiv(e,t,j,r>>2)},ig:function(e,t,r,n){Kr.clearColor(e,t,r,n)},Vd:function(e){Kr.clearDepth(e)},jg:function(e){Kr.clearStencil(e)},_:function(e,t,r,n){return Kr.clientWaitSync(mr.syncs[e],t,vr(r,n))},kg:function(e,t,r,n){Kr.colorMask(!!e,!!t,!!r,!!n)},lg:function(e){Kr.compileShader(mr.shaders[e])},mg:function(e,t,r,n,o,i,a,s){mr.currentContext.version>=2?Kr.currentPixelUnpackBufferBinding||!a?Kr.compressedTexImage2D(e,t,r,n,o,i,a,s):Kr.compressedTexImage2D(e,t,r,n,o,i,R,s,a):Kr.compressedTexImage2D(e,t,r,n,o,i,s?R.subarray(s,s+a):null)},fd:function(e,t,r,n,o,i,a,s,u){Kr.currentPixelUnpackBufferBinding?Kr.compressedTexImage3D(e,t,r,n,o,i,a,s,u):Kr.compressedTexImage3D(e,t,r,n,o,i,a,R,u,s)},ng:function(e,t,r,n,o,i,a,s,u){mr.currentContext.version>=2?Kr.currentPixelUnpackBufferBinding||!s?Kr.compressedTexSubImage2D(e,t,r,n,o,i,a,s,u):Kr.compressedTexSubImage2D(e,t,r,n,o,i,a,R,u,s):Kr.compressedTexSubImage2D(e,t,r,n,o,i,a,u?R.subarray(u,u+s):null)},ed:function(e,t,r,n,o,i,a,s,u,c,l){Kr.currentPixelUnpackBufferBinding?Kr.compressedTexSubImage3D(e,t,r,n,o,i,a,s,u,c,l):Kr.compressedTexSubImage3D(e,t,r,n,o,i,a,s,u,R,l,c)},Te:function(e,t,r,n,o){Kr.copyBufferSubData(e,t,r,n,o)},Ud:function(e,t,r,n,o,i,a,s){Kr.copyTexImage2D(e,t,r,n,o,i,a,s)},og:function(e,t,r,n,o,i,a,s){Kr.copyTexSubImage2D(e,t,r,n,o,i,a,s)},gd:function(e,t,r,n,o,i,a,s,u){Kr.copyTexSubImage3D(e,t,r,n,o,i,a,s,u)},pg:function(){var e=mr.getNewId(mr.programs),t=Kr.createProgram();return t.name=e,t.maxUniformLength=t.maxAttributeLength=t.maxUniformBlockNameLength=0,t.uniformIdCounter=1,mr.programs[e]=t,e},qg:function(e){var t=mr.getNewId(mr.shaders);return mr.shaders[t]=Kr.createShader(e),t},rg:function(e){Kr.cullFace(e)},sg:function(e,t){for(var r=0;r<e;r++){var n=I[t+4*r>>2],o=mr.buffers[n];o&&(Kr.deleteBuffer(o),o.name=0,mr.buffers[n]=null,n==Kr.currentPixelPackBufferBinding&&(Kr.currentPixelPackBufferBinding=0),n==Kr.currentPixelUnpackBufferBinding&&(Kr.currentPixelUnpackBufferBinding=0))}},cf:function(e,t){for(var r=0;r<e;++r){var n=I[t+4*r>>2],o=mr.framebuffers[n];o&&(Kr.deleteFramebuffer(o),o.name=0,mr.framebuffers[n]=null)}},tg:function(e){if(e){var t=mr.programs[e];t?(Kr.deleteProgram(t),t.name=0,mr.programs[e]=null):mr.recordError(1281)}},cd:function(e,t){for(var r=0;r<e;r++){var n=I[t+4*r>>2],o=mr.queries[n];o&&(Kr.deleteQuery(o),mr.queries[n]=null)}},ke:function(e,t){for(var r=0;r<e;r++){var n=I[t+4*r>>2],o=mr.queries[n];o&&(Kr.disjointTimerQueryExt.deleteQueryEXT(o),mr.queries[n]=null)}},df:function(e,t){for(var r=0;r<e;r++){var n=I[t+4*r>>2],o=mr.renderbuffers[n];o&&(Kr.deleteRenderbuffer(o),o.name=0,mr.renderbuffers[n]=null)}},Me:function(e,t){for(var r=0;r<e;r++){var n=I[t+4*r>>2],o=mr.samplers[n];o&&(Kr.deleteSampler(o),o.name=0,mr.samplers[n]=null)}},ug:function(e){if(e){var t=mr.shaders[e];t?(Kr.deleteShader(t),mr.shaders[e]=null):mr.recordError(1281)}},Ue:function(e){if(e){var t=mr.syncs[e];t?(Kr.deleteSync(t),t.name=0,mr.syncs[e]=null):mr.recordError(1281)}},vg:function(e,t){for(var r=0;r<e;r++){var n=I[t+4*r>>2],o=mr.textures[n];o&&(Kr.deleteTexture(o),o.name=0,mr.textures[n]=null)}},_b:function(e,t){for(var r=0;r<e;r++){var n=I[t+4*r>>2],o=mr.transformFeedbacks[n];o&&(Kr.deleteTransformFeedback(o),o.name=0,mr.transformFeedbacks[n]=null)}},wf:function(e,t){for(var r=0;r<e;r++){var n=I[t+4*r>>2];Kr.deleteVertexArray(mr.vaos[n]),mr.vaos[n]=null}},zf:function(e,t){for(var r=0;r<e;r++){var n=I[t+4*r>>2];Kr.deleteVertexArray(mr.vaos[n]),mr.vaos[n]=null}},Td:function(e){Kr.depthFunc(e)},wg:function(e){Kr.depthMask(!!e)},Rd:function(e,t){Kr.depthRange(e,t)},Qd:function(e,t){Kr.detachShader(mr.programs[e],mr.shaders[t])},xg:function(e){Kr.disable(e)},yg:function(e){Kr.disableVertexAttribArray(e)},zg:function(e,t,r){Kr.drawArrays(e,t,r)},tf:function(e,t,r,n){Kr.drawArraysInstanced(e,t,r,n)},_d:function(e,t,r,n){Kr.drawArraysInstanced(e,t,r,n)},Lb:function(e,t,r,n){Kr.drawArraysInstanced(e,t,r,n)},rf:function(e,t,r,n,o){Kr.dibvbi.drawArraysInstancedBaseInstanceWEBGL(e,t,r,n,o)},ld:function(e,t,r,n){Kr.drawArraysInstanced(e,t,r,n)},Nb:function(e,t,r,n){Kr.drawArraysInstanced(e,t,r,n)},pf:function(e,t){for(var r=yr[e],n=0;n<e;n++)r[n]=I[t+4*n>>2];Kr.drawBuffers(r)},jd:function(e,t){for(var r=yr[e],n=0;n<e;n++)r[n]=I[t+4*n>>2];Kr.drawBuffers(r)},$d:function(e,t){for(var r=yr[e],n=0;n<e;n++)r[n]=I[t+4*n>>2];Kr.drawBuffers(r)},Ag:function(e,t,r,n){Kr.drawElements(e,t,r,n)},uf:function(e,t,r,n,o){Kr.drawElementsInstanced(e,t,r,n,o)},Zd:function(e,t,r,n,o){Kr.drawElementsInstanced(e,t,r,n,o)},Jb:function(e,t,r,n,o){Kr.drawElementsInstanced(e,t,r,n,o)},sf:function(e,t,r,n,o,i,a){Kr.dibvbi.drawElementsInstancedBaseVertexBaseInstanceWEBGL(e,t,r,n,o,i,a)},Kb:function(e,t,r,n,o){Kr.drawElementsInstanced(e,t,r,n,o)},kd:function(e,t,r,n,o){Kr.drawElementsInstanced(e,t,r,n,o)},jf:function(e,t,r,n,o,i){!function(e,t,r,n){Kr.drawElements(e,t,r,n)}(e,n,o,i)},Bg:function(e){Kr.enable(e)},Cg:function(e){Kr.enableVertexAttribArray(e)},$c:function(e){Kr.endQuery(e)},he:function(e){Kr.disjointTimerQueryExt.endQueryEXT(e)},Oc:function(){Kr.endTransformFeedback()},Re:function(e,t){var r=Kr.fenceSync(e,t);if(r){var n=mr.getNewId(mr.syncs);return r.name=n,mr.syncs[n]=r,n}return 0},Dg:function(){Kr.finish()},Eg:function(){Kr.flush()},ef:function(e,t,r,n){Kr.framebufferRenderbuffer(e,t,r,mr.renderbuffers[n])},ff:function(e,t,r,n,o){Kr.framebufferTexture2D(e,t,r,mr.textures[n],o)},Sc:function(e,t,r,n,o){Kr.framebufferTextureLayer(e,t,mr.textures[r],n,o)},Fg:function(e){Kr.frontFace(e)},Gg:function(e,t){br(e,t,"createBuffer",mr.buffers)},gf:function(e,t){br(e,t,"createFramebuffer",mr.framebuffers)},dd:function(e,t){br(e,t,"createQuery",mr.queries)},me:function(e,t){for(var r=0;r<e;r++){var n=Kr.disjointTimerQueryExt.createQueryEXT();if(!n){for(mr.recordError(1282);r<e;)I[t+4*r++>>2]=0;return}var o=mr.getNewId(mr.queries);n.name=o,mr.queries[o]=n,I[t+4*r>>2]=o}},hf:function(e,t){br(e,t,"createRenderbuffer",mr.renderbuffers)},Ne:function(e,t){br(e,t,"createSampler",mr.samplers)},Hg:function(e,t){br(e,t,"createTexture",mr.textures)},Zb:function(e,t){br(e,t,"createTransformFeedback",mr.transformFeedbacks)},xf:function(e,t){br(e,t,"createVertexArray",mr.vaos)},Af:function(e,t){br(e,t,"createVertexArray",mr.vaos)},Xe:function(e){Kr.generateMipmap(e)},Pd:function(e,t,r,n,o,i,a){wr("getActiveAttrib",e,t,r,n,o,i,a)},Od:function(e,t,r,n,o,i,a){wr("getActiveUniform",e,t,r,n,o,i,a)},kc:function(e,t,r,n,o){e=mr.programs[e];var i=Kr.getActiveUniformBlockName(e,t);if(i)if(o&&r>0){var a=$(i,o,r);n&&(I[n>>2]=a)}else n&&(I[n>>2]=0)},lc:function(e,t,r,n){if(n)if(e=mr.programs[e],35393!=r){var o=Kr.getActiveUniformBlockParameter(e,t,r);if(null!==o)if(35395==r)for(var i=0;i<o.length;i++)I[n+4*i>>2]=o[i];else I[n>>2]=o}else{var a=Kr.getActiveUniformBlockName(e,t);I[n>>2]=a.length+1}else mr.recordError(1281)},nc:function(e,t,r,n,o){if(o)if(t>0&&0==r)mr.recordError(1281);else{e=mr.programs[e];for(var i=[],a=0;a<t;a++)i.push(I[r+4*a>>2]);var s=Kr.getActiveUniforms(e,i,n);if(s){var u=s.length;for(a=0;a<u;a++)I[o+4*a>>2]=s[a]}}else mr.recordError(1281)},Nd:function(e,t,r,n){var o=Kr.getAttachedShaders(mr.programs[e]),i=o.length;i>t&&(i=t),I[r>>2]=i;for(var a=0;a<i;++a){var s=mr.shaders.indexOf(o[a]);I[n+4*a>>2]=s}},Md:function(e,t){return Kr.getAttribLocation(mr.programs[e],V(t))},Ld:function(e,t){_r(e,t,4)},ec:function(e,t,r){r?Er(r,Kr.getBufferParameter(e,t)):mr.recordError(1281)},Ig:function(e,t,r){r?I[r>>2]=Kr.getBufferParameter(e,t):mr.recordError(1281)},Jg:function(){var e=Kr.getError()||mr.lastError;return mr.lastError=0,e},Kg:function(e,t){_r(e,t,2)},Cc:function(e,t){return Kr.getFragDataLocation(mr.programs[e],V(t))},Ye:function(e,t,r,n){var o=Kr.getFramebufferAttachmentParameter(e,t,r);(o instanceof WebGLRenderbuffer||o instanceof WebGLTexture)&&(o=0|o.name),I[n>>2]=o},fc:function(e,t,r){xr(e,t,r,1)},ic:function(e,t){_r(e,t,1)},Qc:function(e,t,r){xr(e,t,r,0)},Ia:function(e,t){_r(e,t,0)},Qb:function(e,t,r,n,o){if(n<0)mr.recordError(1281);else if(o){var i=Kr.getInternalformatParameter(e,t,r);if(null!==i)for(var a=0;a<i.length&&a<n;++a)I[o+4*a>>2]=i[a]}else mr.recordError(1281)},Ub:function(e,t,r,n,o){mr.recordError(1282)},Mg:function(e,t,r,n){var o=Kr.getProgramInfoLog(mr.programs[e]);null===o&&(o="(unknown error)");var i=t>0&&n?$(o,n,t):0;r&&(I[r>>2]=i)},Ng:function(e,t,r){if(r)if(e>=mr.counter)mr.recordError(1281);else if(e=mr.programs[e],35716==t){var n=Kr.getProgramInfoLog(e);null===n&&(n="(unknown error)"),I[r>>2]=n.length+1}else if(35719==t){if(!e.maxUniformLength)for(var o=0;o<Kr.getProgramParameter(e,35718);++o)e.maxUniformLength=Math.max(e.maxUniformLength,Kr.getActiveUniform(e,o).name.length+1);I[r>>2]=e.maxUniformLength}else if(35722==t){if(!e.maxAttributeLength)for(o=0;o<Kr.getProgramParameter(e,35721);++o)e.maxAttributeLength=Math.max(e.maxAttributeLength,Kr.getActiveAttrib(e,o).name.length+1);I[r>>2]=e.maxAttributeLength}else if(35381==t){if(!e.maxUniformBlockNameLength)for(o=0;o<Kr.getProgramParameter(e,35382);++o)e.maxUniformBlockNameLength=Math.max(e.maxUniformBlockNameLength,Kr.getActiveUniformBlockName(e,o).length+1);I[r>>2]=e.maxUniformBlockNameLength}else I[r>>2]=Kr.getProgramParameter(e,t);else mr.recordError(1281)},ce:function(e,t,r){if(r){var n,o=mr.queries[e];Er(r,"boolean"==typeof(n=mr.currentContext.version<2?Kr.disjointTimerQueryExt.getQueryObjectEXT(o,t):Kr.getQueryParameter(o,t))?n?1:0:n)}else mr.recordError(1281)},ee:function(e,t,r){if(r){var n,o=mr.queries[e],i=Kr.disjointTimerQueryExt.getQueryObjectEXT(o,t);n="boolean"==typeof i?i?1:0:i,I[r>>2]=n}else mr.recordError(1281)},be:function(e,t,r){if(r){var n,o=mr.queries[e];Er(r,"boolean"==typeof(n=mr.currentContext.version<2?Kr.disjointTimerQueryExt.getQueryObjectEXT(o,t):Kr.getQueryParameter(o,t))?n?1:0:n)}else mr.recordError(1281)},Zc:function(e,t,r){if(r){var n,o=mr.queries[e],i=Kr.getQueryParameter(o,t);n="boolean"==typeof i?i?1:0:i,I[r>>2]=n}else mr.recordError(1281)},de:function(e,t,r){if(r){var n,o=mr.queries[e],i=Kr.disjointTimerQueryExt.getQueryObjectEXT(o,t);n="boolean"==typeof i?i?1:0:i,I[r>>2]=n}else mr.recordError(1281)},_c:function(e,t,r){r?I[r>>2]=Kr.getQuery(e,t):mr.recordError(1281)},fe:function(e,t,r){r?I[r>>2]=Kr.disjointTimerQueryExt.getQueryEXT(e,t):mr.recordError(1281)},Ze:function(e,t,r){r?I[r>>2]=Kr.getRenderbufferParameter(e,t):mr.recordError(1281)},ac:function(e,t,r){r?U[r>>2]=Kr.getSamplerParameter(mr.samplers[e],t):mr.recordError(1281)},bc:function(e,t,r){r?I[r>>2]=Kr.getSamplerParameter(mr.samplers[e],t):mr.recordError(1281)},Og:function(e,t,r,n){var o=Kr.getShaderInfoLog(mr.shaders[e]);null===o&&(o="(unknown error)");var i=t>0&&n?$(o,n,t):0;r&&(I[r>>2]=i)},Ie:function(e,t,r,n){var o=Kr.getShaderPrecisionFormat(e,t);I[r>>2]=o.rangeMin,I[r+4>>2]=o.rangeMax,I[n>>2]=o.precision},Kd:function(e,t,r,n){var o=Kr.getShaderSource(mr.shaders[e]);if(o){var i=t>0&&n?$(o,n,t):0;r&&(I[r>>2]=i)}},Pg:function(e,t,r){if(r)if(35716==t){var n=Kr.getShaderInfoLog(mr.shaders[e]);null===n&&(n="(unknown error)");var o=n?n.length+1:0;I[r>>2]=o}else if(35720==t){var i=Kr.getShaderSource(mr.shaders[e]),a=i?i.length+1:0;I[r>>2]=a}else I[r>>2]=Kr.getShaderParameter(mr.shaders[e],t);else mr.recordError(1281)},Z:function(e){var t=mr.stringCache[e];if(!t){switch(e){case 7939:var r=Kr.getSupportedExtensions()||[];t=kr((r=r.concat(r.map((function(e){return"GL_"+e})))).join(" "));break;case 7936:case 7937:case 37445:case 37446:var n=Kr.getParameter(e);n||mr.recordError(1280),t=n&&kr(n);break;case 7938:var o=Kr.getParameter(7938);t=kr(o=mr.currentContext.version>=2?"OpenGL ES 3.0 ("+o+")":"OpenGL ES 2.0 ("+o+")");break;case 35724:var i=Kr.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=kr(i);break;default:mr.recordError(1280)}mr.stringCache[e]=t}return t},Ja:function(e,t){if(mr.currentContext.version<2)return mr.recordError(1282),0;var r=mr.stringiCache[e];if(r)return t<0||t>=r.length?(mr.recordError(1281),0):r[t];if(7939===e){var n=Kr.getSupportedExtensions()||[];return n=(n=n.concat(n.map((function(e){return"GL_"+e})))).map((function(e){return kr(e)})),r=mr.stringiCache[e]=n,t<0||t>=r.length?(mr.recordError(1281),0):r[t]}return mr.recordError(1280),0},hc:function(e,t,r,n,o){if(r<0)mr.recordError(1281);else if(o){var i=Kr.getSyncParameter(mr.syncs[e],t);null!==i&&(I[o>>2]=i,n&&(I[n>>2]=1))}else mr.recordError(1281)},Jd:function(e,t,r){r?U[r>>2]=Kr.getTexParameter(e,t):mr.recordError(1281)},Id:function(e,t,r){r?I[r>>2]=Kr.getTexParameter(e,t):mr.recordError(1281)},Kc:function(e,t,r,n,o,i,a){e=mr.programs[e];var s=Kr.getTransformFeedbackVarying(e,t);if(s){if(a&&r>0){var u=$(s.name,a,r);n&&(I[n>>2]=u)}else n&&(I[n>>2]=0);o&&(I[o>>2]=s.size),i&&(I[i>>2]=s.type)}},mc:function(e,t){return Kr.getUniformBlockIndex(mr.programs[e],V(t))},oc:function(e,t,r,n){if(n)if(t>0&&(0==r||0==n))mr.recordError(1281);else{e=mr.programs[e];for(var o=[],i=0;i<t;i++)o.push(V(I[r+4*i>>2]));var a=Kr.getUniformIndices(e,o);if(a){var s=a.length;for(i=0;i<s;i++)I[n+4*i>>2]=a[i]}}else mr.recordError(1281)},Qg:function(e,t){if(t=V(t),e=mr.programs[e]){Cr(e);var r=e.uniformLocsById,n=0,o=t,i=Sr(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]||Kr.getUniformLocation(e,t)))return n}else mr.recordError(1281);var s;return-1},Hd:function(e,t,r){Pr(e,t,r,2)},Gd:function(e,t,r){Pr(e,t,r,0)},Dc:function(e,t,r){Pr(e,t,r,0)},Jc:function(e,t,r){Tr(e,t,r,0)},Ic:function(e,t,r){Tr(e,t,r,0)},Dd:function(e,t,r){r?I[r>>2]=Kr.getVertexAttribOffset(e,t):mr.recordError(1281)},Fd:function(e,t,r){Tr(e,t,r,2)},Ed:function(e,t,r){Tr(e,t,r,5)},Cd:function(e,t){Kr.hint(e,t)},Je:function(e,t,r){for(var n=yr[t],o=0;o<t;o++)n[o]=I[r+4*o>>2];Kr.invalidateFramebuffer(e,n)},Ke:function(e,t,r,n,o,i,a){for(var s=yr[t],u=0;u<t;u++)s[u]=I[r+4*u>>2];Kr.invalidateSubFramebuffer(e,s,n,o,i,a)},Bd:function(e){var t=mr.buffers[e];return t?Kr.isBuffer(t):0},Ad:function(e){return Kr.isEnabled(e)},zd:function(e){var t=mr.framebuffers[e];return t?Kr.isFramebuffer(t):0},yd:function(e){return(e=mr.programs[e])?Kr.isProgram(e):0},bd:function(e){var t=mr.queries[e];return t?Kr.isQuery(t):0},je:function(e){var t=mr.queries[e];return t?Kr.disjointTimerQueryExt.isQueryEXT(t):0},xd:function(e){var t=mr.renderbuffers[e];return t?Kr.isRenderbuffer(t):0},dc:function(e){var t=mr.samplers[e];return t?Kr.isSampler(t):0},wd:function(e){var t=mr.shaders[e];return t?Kr.isShader(t):0},Se:function(e){return Kr.isSync(mr.syncs[e])},Rg:function(e){var t=mr.textures[e];return t?Kr.isTexture(t):0},Yb:function(e){return Kr.isTransformFeedback(mr.transformFeedbacks[e])},Rc:function(e){var t=mr.vaos[e];return t?Kr.isVertexArray(t):0},ae:function(e){var t=mr.vaos[e];return t?Kr.isVertexArray(t):0},Sg:function(e){Kr.lineWidth(e)},Tg:function(e){e=mr.programs[e],Kr.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},nf:function(e,t,r,n,o,i){Kr.mdibvbi.multiDrawArraysInstancedBaseInstanceWEBGL(e,I,t>>2,I,r>>2,I,n>>2,j,o>>2,i)},of:function(e,t,r,n,o,i,a,s){Kr.mdibvbi.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(e,I,t>>2,r,I,n>>2,I,o>>2,I,i>>2,j,a>>2,s)},Wb:function(){Kr.pauseTransformFeedback()},Ug:function(e,t){3317==e&&(mr.unpackAlignment=t),Kr.pixelStorei(e,t)},vd:function(e,t){Kr.polygonOffset(e,t)},Tb:function(e,t,r,n){mr.recordError(1280)},Sb:function(e,t,r){mr.recordError(1280)},ge:function(e,t){Kr.disjointTimerQueryExt.queryCounterEXT(mr.queries[e],t)},qf:function(e){Kr.readBuffer(e)},Vg:function(e,t,r,n,o,i,a){if(mr.currentContext.version>=2)if(Kr.currentPixelPackBufferBinding)Kr.readPixels(e,t,r,n,o,i,a);else{var s=Fr(i);Kr.readPixels(e,t,r,n,o,i,s,a>>Br(s))}else{var u=Dr(i,o,r,n,a);u?Kr.readPixels(e,t,r,n,o,i,u):mr.recordError(1280)}},ud:function(){},_e:function(e,t,r,n){Kr.renderbufferStorage(e,t,r,n)},We:function(e,t,r,n,o){Kr.renderbufferStorageMultisample(e,t,r,n,o)},Vb:function(){Kr.resumeTransformFeedback()},td:function(e,t){Kr.sampleCoverage(e,!!t)},Oe:function(e,t,r){Kr.samplerParameterf(mr.samplers[e],t,r)},cc:function(e,t,r){var n=U[r>>2];Kr.samplerParameterf(mr.samplers[e],t,n)},Pe:function(e,t,r){Kr.samplerParameteri(mr.samplers[e],t,r)},Qe:function(e,t,r){var n=I[r>>2];Kr.samplerParameteri(mr.samplers[e],t,n)},sa:function(e,t,r,n){Kr.scissor(e,t,r,n)},sd:function(){mr.recordError(1280)},ta:function(e,t,r,n){var o=mr.getSource(e,t,r,n);if(mr.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)}Kr.shaderSource(mr.shaders[e],o)},ua:function(e,t,r){Kr.stencilFunc(e,t,r)},va:function(e,t,r,n){Kr.stencilFuncSeparate(e,t,r,n)},wa:function(e){Kr.stencilMask(e)},xa:function(e,t){Kr.stencilMaskSeparate(e,t)},ya:function(e,t,r){Kr.stencilOp(e,t,r)},za:function(e,t,r,n){Kr.stencilOpSeparate(e,t,r,n)},Aa:function(e,t,r,n,o,i,a,s,u){if(mr.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)),mr.currentContext.version>=2)if(Kr.currentPixelUnpackBufferBinding)Kr.texImage2D(e,t,r,n,o,i,a,s,u);else if(u){var c=Fr(s);Kr.texImage2D(e,t,r,n,o,i,a,s,c,u>>Br(c))}else Kr.texImage2D(e,t,r,n,o,i,a,s,null);else Kr.texImage2D(e,t,r,n,o,i,a,s,u?Dr(s,a,n,o,u):null)},id:function(e,t,r,n,o,i,a,s,u,c){if(Kr.currentPixelUnpackBufferBinding)Kr.texImage3D(e,t,r,n,o,i,a,s,u,c);else if(c){var l=Fr(u);Kr.texImage3D(e,t,r,n,o,i,a,s,u,l,c>>Br(l))}else Kr.texImage3D(e,t,r,n,o,i,a,s,u,null)},Ba:function(e,t,r){Kr.texParameterf(e,t,r)},Ca:function(e,t,r){var n=U[r>>2];Kr.texParameterf(e,t,n)},Da:function(e,t,r){Kr.texParameteri(e,t,r)},Ea:function(e,t,r){var n=I[r>>2];Kr.texParameteri(e,t,n)},kf:function(e,t,r,n,o){Kr.texStorage2D(e,t,r,n,o)},Rb:function(e,t,r,n,o,i){Kr.texStorage3D(e,t,r,n,o,i)},Fa:function(e,t,r,n,o,i,a,s,u){if(mr.currentContext.version>=2&&36193==s&&(s=5131),mr.currentContext.version>=2)if(Kr.currentPixelUnpackBufferBinding)Kr.texSubImage2D(e,t,r,n,o,i,a,s,u);else if(u){var c=Fr(s);Kr.texSubImage2D(e,t,r,n,o,i,a,s,c,u>>Br(c))}else Kr.texSubImage2D(e,t,r,n,o,i,a,s,null);else{var l=null;u&&(l=Dr(s,a,o,i,u)),Kr.texSubImage2D(e,t,r,n,o,i,a,s,l)}},hd:function(e,t,r,n,o,i,a,s,u,c,l){if(Kr.currentPixelUnpackBufferBinding)Kr.texSubImage3D(e,t,r,n,o,i,a,s,u,c,l);else if(l){var f=Fr(c);Kr.texSubImage3D(e,t,r,n,o,i,a,s,u,c,f,l>>Br(f))}else Kr.texSubImage3D(e,t,r,n,o,i,a,s,u,c,null)},Lc:function(e,t,r,n){e=mr.programs[e];for(var o=[],i=0;i<t;i++)o.push(V(I[r+4*i>>2]));Kr.transformFeedbackVaryings(e,o,n)},Ga:function(e,t){Kr.uniform1f(Ar(e),t)},Ha:function(e,t,r){if(mr.currentContext.version>=2)t&&Kr.uniform1fv(Ar(e),U,r>>2,t);else{if(t<=288)for(var n=Lr[t-1],o=0;o<t;++o)n[o]=U[r+4*o>>2];else n=U.subarray(r>>2,r+4*t>>2);Kr.uniform1fv(Ar(e),n)}},Vf:function(e,t){Kr.uniform1i(Ar(e),t)},Wf:function(e,t,r){if(mr.currentContext.version>=2)t&&Kr.uniform1iv(Ar(e),I,r>>2,t);else{if(t<=288)for(var n=Rr[t-1],o=0;o<t;++o)n[o]=I[r+4*o>>2];else n=I.subarray(r>>2,r+4*t>>2);Kr.uniform1iv(Ar(e),n)}},Bc:function(e,t){Kr.uniform1ui(Ar(e),t)},xc:function(e,t,r){t&&Kr.uniform1uiv(Ar(e),j,r>>2,t)},Xf:function(e,t,r){Kr.uniform2f(Ar(e),t,r)},Yf:function(e,t,r){if(mr.currentContext.version>=2)t&&Kr.uniform2fv(Ar(e),U,r>>2,2*t);else{if(t<=144)for(var n=Lr[2*t-1],o=0;o<2*t;o+=2)n[o]=U[r+4*o>>2],n[o+1]=U[r+(4*o+4)>>2];else n=U.subarray(r>>2,r+8*t>>2);Kr.uniform2fv(Ar(e),n)}},Uf:function(e,t,r){Kr.uniform2i(Ar(e),t,r)},Tf:function(e,t,r){if(mr.currentContext.version>=2)t&&Kr.uniform2iv(Ar(e),I,r>>2,2*t);else{if(t<=144)for(var n=Rr[2*t-1],o=0;o<2*t;o+=2)n[o]=I[r+4*o>>2],n[o+1]=I[r+(4*o+4)>>2];else n=I.subarray(r>>2,r+8*t>>2);Kr.uniform2iv(Ar(e),n)}},Ac:function(e,t,r){Kr.uniform2ui(Ar(e),t,r)},wc:function(e,t,r){t&&Kr.uniform2uiv(Ar(e),j,r>>2,2*t)},Sf:function(e,t,r,n){Kr.uniform3f(Ar(e),t,r,n)},Rf:function(e,t,r){if(mr.currentContext.version>=2)t&&Kr.uniform3fv(Ar(e),U,r>>2,3*t);else{if(t<=96)for(var n=Lr[3*t-1],o=0;o<3*t;o+=3)n[o]=U[r+4*o>>2],n[o+1]=U[r+(4*o+4)>>2],n[o+2]=U[r+(4*o+8)>>2];else n=U.subarray(r>>2,r+12*t>>2);Kr.uniform3fv(Ar(e),n)}},Qf:function(e,t,r,n){Kr.uniform3i(Ar(e),t,r,n)},Pf:function(e,t,r){if(mr.currentContext.version>=2)t&&Kr.uniform3iv(Ar(e),I,r>>2,3*t);else{if(t<=96)for(var n=Rr[3*t-1],o=0;o<3*t;o+=3)n[o]=I[r+4*o>>2],n[o+1]=I[r+(4*o+4)>>2],n[o+2]=I[r+(4*o+8)>>2];else n=I.subarray(r>>2,r+12*t>>2);Kr.uniform3iv(Ar(e),n)}},zc:function(e,t,r,n){Kr.uniform3ui(Ar(e),t,r,n)},vc:function(e,t,r){t&&Kr.uniform3uiv(Ar(e),j,r>>2,3*t)},Of:function(e,t,r,n,o){Kr.uniform4f(Ar(e),t,r,n,o)},Nf:function(e,t,r){if(mr.currentContext.version>=2)t&&Kr.uniform4fv(Ar(e),U,r>>2,4*t);else{if(t<=72){var n=Lr[4*t-1],o=U;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=U.subarray(r>>2,r+16*t>>2);Kr.uniform4fv(Ar(e),n)}},Bf:function(e,t,r,n,o){Kr.uniform4i(Ar(e),t,r,n,o)},Cf:function(e,t,r){if(mr.currentContext.version>=2)t&&Kr.uniform4iv(Ar(e),I,r>>2,4*t);else{if(t<=72)for(var n=Rr[4*t-1],o=0;o<4*t;o+=4)n[o]=I[r+4*o>>2],n[o+1]=I[r+(4*o+4)>>2],n[o+2]=I[r+(4*o+8)>>2],n[o+3]=I[r+(4*o+12)>>2];else n=I.subarray(r>>2,r+16*t>>2);Kr.uniform4iv(Ar(e),n)}},yc:function(e,t,r,n,o){Kr.uniform4ui(Ar(e),t,r,n,o)},uc:function(e,t,r){t&&Kr.uniform4uiv(Ar(e),j,r>>2,4*t)},jc:function(e,t,r){e=mr.programs[e],Kr.uniformBlockBinding(e,t,r)},Df:function(e,t,r,n){if(mr.currentContext.version>=2)t&&Kr.uniformMatrix2fv(Ar(e),!!r,U,n>>2,4*t);else{if(t<=72)for(var o=Lr[4*t-1],i=0;i<4*t;i+=4)o[i]=U[n+4*i>>2],o[i+1]=U[n+(4*i+4)>>2],o[i+2]=U[n+(4*i+8)>>2],o[i+3]=U[n+(4*i+12)>>2];else o=U.subarray(n>>2,n+16*t>>2);Kr.uniformMatrix2fv(Ar(e),!!r,o)}},Yc:function(e,t,r,n){t&&Kr.uniformMatrix2x3fv(Ar(e),!!r,U,n>>2,6*t)},Wc:function(e,t,r,n){t&&Kr.uniformMatrix2x4fv(Ar(e),!!r,U,n>>2,8*t)},Ef:function(e,t,r,n){if(mr.currentContext.version>=2)t&&Kr.uniformMatrix3fv(Ar(e),!!r,U,n>>2,9*t);else{if(t<=32)for(var o=Lr[9*t-1],i=0;i<9*t;i+=9)o[i]=U[n+4*i>>2],o[i+1]=U[n+(4*i+4)>>2],o[i+2]=U[n+(4*i+8)>>2],o[i+3]=U[n+(4*i+12)>>2],o[i+4]=U[n+(4*i+16)>>2],o[i+5]=U[n+(4*i+20)>>2],o[i+6]=U[n+(4*i+24)>>2],o[i+7]=U[n+(4*i+28)>>2],o[i+8]=U[n+(4*i+32)>>2];else o=U.subarray(n>>2,n+36*t>>2);Kr.uniformMatrix3fv(Ar(e),!!r,o)}},Xc:function(e,t,r,n){t&&Kr.uniformMatrix3x2fv(Ar(e),!!r,U,n>>2,6*t)},Uc:function(e,t,r,n){t&&Kr.uniformMatrix3x4fv(Ar(e),!!r,U,n>>2,12*t)},Ff:function(e,t,r,n){if(mr.currentContext.version>=2)t&&Kr.uniformMatrix4fv(Ar(e),!!r,U,n>>2,16*t);else{if(t<=18){var o=Lr[16*t-1],i=U;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=U.subarray(n>>2,n+64*t>>2);Kr.uniformMatrix4fv(Ar(e),!!r,o)}},Vc:function(e,t,r,n){t&&Kr.uniformMatrix4x2fv(Ar(e),!!r,U,n>>2,8*t)},Tc:function(e,t,r,n){t&&Kr.uniformMatrix4x3fv(Ar(e),!!r,U,n>>2,12*t)},Gf:function(e){e=mr.programs[e],Kr.useProgram(e),Kr.currentProgram=e},rd:function(e){Kr.validateProgram(mr.programs[e])},Hf:function(e,t){Kr.vertexAttrib1f(e,t)},qd:function(e,t){Kr.vertexAttrib1f(e,U[t>>2])},pd:function(e,t,r){Kr.vertexAttrib2f(e,t,r)},If:function(e,t){Kr.vertexAttrib2f(e,U[t>>2],U[t+4>>2])},od:function(e,t,r,n){Kr.vertexAttrib3f(e,t,r,n)},Jf:function(e,t){Kr.vertexAttrib3f(e,U[t>>2],U[t+4>>2],U[t+8>>2])},nd:function(e,t,r,n,o){Kr.vertexAttrib4f(e,t,r,n,o)},Kf:function(e,t){Kr.vertexAttrib4f(e,U[t>>2],U[t+4>>2],U[t+8>>2],U[t+12>>2])},lf:function(e,t){Kr.vertexAttribDivisor(e,t)},Yd:function(e,t){Kr.vertexAttribDivisor(e,t)},Ob:function(e,t){Kr.vertexAttribDivisor(e,t)},md:function(e,t){Kr.vertexAttribDivisor(e,t)},Pb:function(e,t){Kr.vertexAttribDivisor(e,t)},Hc:function(e,t,r,n,o){Kr.vertexAttribI4i(e,t,r,n,o)},Fc:function(e,t){Kr.vertexAttribI4i(e,I[t>>2],I[t+4>>2],I[t+8>>2],I[t+12>>2])},Gc:function(e,t,r,n,o){Kr.vertexAttribI4ui(e,t,r,n,o)},Ec:function(e,t){Kr.vertexAttribI4ui(e,j[t>>2],j[t+4>>2],j[t+8>>2],j[t+12>>2])},mf:function(e,t,r,n,o){Kr.vertexAttribIPointer(e,t,r,n,o)},Lf:function(e,t,r,n,o,i){Kr.vertexAttribPointer(e,t,r,!!n,o,i)},Mf:function(e,t,r,n){Kr.viewport(e,t,r,n)},$:function(e,t,r,n){Kr.waitSync(mr.syncs[e],t,vr(r,n))},Eb:function(e,t,r){R.copyWithin(e,t,t+r)},kb:function(e){var t,r=R.length,n=2147483648;if((e>>>=0)>n)return!1;for(var o=1;o<=4;o*=2){var i=r*(1+.2/o);if(i=Math.min(i,e+100663296),Mr(Math.min(n,(t=Math.max(e,i))+(65536-t%65536)%65536)))return!0}return!1},Xa:function(e,t,r,n,o,i,a,s,c){const l=u.UTF8ToString(e,e+t),f=u.HEAPU8.subarray(o,o+i),d=u.emscripten_ubq_codec_audioDecoderNextHandle++,h={codec:l,sampleRate:r,numberOfChannels:n,description:f};try{const e=u.emscripten_ubq_codec_createAudioDecoder(a,s,c);AudioDecoder.isConfigSupported(h).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(h),u.emscripten_ubq_codec_audioDecoders.set(d,{audioDecoder:e,decoderConfig:h,leftBufferPtr:a,rightBufferPtr:s,bufferLength:c})}catch(e){return u.emscripten_ubq_codec_createNativeResult({error:e})}return u.emscripten_ubq_codec_createNativeResult({handle:d})},Oa:function(e,t,r,n,o,i){const a=u.UTF8ToString(e,e+t),s=u.emscripten_ubq_codec_audioEncoderNextHandle++,c={codec:a,sampleRate:r,numberOfChannels:n,bitrate:o};try{const e=new AudioEncoder({output:e=>{const t=u._malloc(e.byteLength),r=u.HEAPU8.subarray(t,t+e.byteLength);e.copyTo(r),u.emscripten_ubq_codec_onOutputEncodedAudioChunk(s,t,e.byteLength,i),u._free(t)},error:e=>console.error(e)});e.configure(c),u.emscripten_ubq_codec_audioEncoders.set(s,{audioEncoder:e,audioEncoderConfig:c,frameIndex:0})}catch(e){return e+=' Requested codec: "'+a+'"',e+="; sample rate: "+r,e+="; channels: "+n,e+="; bit rate: "+o,u.emscripten_ubq_codec_createNativeResult({error:e})}return u.emscripten_ubq_codec_createNativeResult({handle:s})},ab:function(e,t,r,n,o,i,a){const s=u.UTF8ToString(e,e+t),c=u.HEAPU8.subarray(o,o+i),l=u.emscripten_ubq_codec_videoDecoderNextHandle++,f={codec:s,codedWidth:r,codedHeight:n,description:c};try{const e=u.emscripten_ubq_codec_createVideoDecoder(l,a);VideoDecoder.isConfigSupported(f).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(f),u.emscripten_ubq_codec_videoDecoders.set(l,{videoDecoder:e,decoderConfig:f,codecServicePtr:a})}catch(e){return u.emscripten_ubq_codec_createNativeResult({error:e})}return u.emscripten_ubq_codec_createNativeResult({handle:l})},Sa:function(e,t,r,n,o,i){const a=u.UTF8ToString(e,e+t),s=u.emscripten_ubq_codec_videoEncoderNextHandle++,c=u.specialHTMLTargets["!canvas"];c.width=r,c.height=n;const l={codec:a,width:r,height:n,avc:{format:"annexb"},fps:o};try{const e=new VideoEncoder({output:e=>{const t=u._malloc(e.byteLength),r=u.HEAPU8.subarray(t,t+e.byteLength);e.copyTo(r),u.emscripten_ubq_codec_onOutputEncodedVideoChunk(s,t,e.byteLength,i),u._free(t)},error:e=>console.error(e)});VideoEncoder.isConfigSupported(l).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(l),u.emscripten_ubq_codec_videoEncoders.set(s,{videoEncoder:e,encoderConfig:l,groupOfPictures:150,frameIndex:0})}catch(e){return e+=' Requested codec: "'+a+'"',e+="; resolution: "+r+"x"+n,u.emscripten_ubq_codec_createNativeResult({error:e})}return u.emscripten_ubq_codec_createNativeResult({handle:s})},Ta:function(e,t,r,n,o,i){const a=u.emscripten_ubq_codec_audioDecoders.get(e);"closed"===a.audioDecoder.state&&(a.audioDecoder=u.emscripten_ubq_codec_createAudioDecoder(a.leftBufferPtr,a.rightBufferPtr,a.bufferLength),a.audioDecoder.configure(a.decoderConfig));const s=a.audioDecoder,c=u.HEAPU8.subarray(o,o+i),l=new EncodedAudioChunk({type:t?"key":"delta",timestamp:r,duration:n,data:c});try{s.decode(l)}catch(e){return s.configUnsupported?u.emscripten_ubq_codec_createNativeResult({code:2,error:e}):u.emscripten_ubq_codec_createNativeResult({code:1,error:e})}return u.emscripten_ubq_codec_createNativeResult({code:0})},Ka:function(e,t,r,n,o,i){const a=u.emscripten_ubq_codec_videoDecoders.get(e);if(a.videoDecoder.unexpectedError)return u.emscripten_ubq_codec_createNativeResult({code:2,error:a.videoDecoder.unexpectedError});if("closed"===a.videoDecoder.state){const t=a.videoDecoder.textures;return a.videoDecoder=u.emscripten_ubq_codec_createVideoDecoder(e,a.codecServicePtr),a.videoDecoder.textures=t,a.videoDecoder.configure(a.decoderConfig),u.emscripten_ubq_codec_createNativeResult({code:1,error:"VideoDecoder was closed"})}const s=a.videoDecoder,c=u.HEAPU8.subarray(o,o+i),l=new EncodedVideoChunk({type:t?"key":"delta",timestamp:r,duration:n,data:c});try{s.decode(l)}catch(e){return s.configUnsupported?u.emscripten_ubq_codec_createNativeResult({code:2,error:e}):u.emscripten_ubq_codec_createNativeResult({code:1,error:e})}return u.emscripten_ubq_codec_createNativeResult({code:0})},Wa:function(e){if(u.emscripten_ubq_codec_audioDecoders.has(e)){const t=u.emscripten_ubq_codec_audioDecoders.get(e);"closed"!==t.audioDecoder.state&&t.audioDecoder.close(),u.emscripten_ubq_codec_audioDecoders.delete(e)}},Na:function(e){const t=u.emscripten_ubq_codec_audioEncoders.get(e);"closed"!==t.audioEncoder.state&&t.audioEncoder.close(),u.emscripten_ubq_codec_audioEncoders.delete(e)},_a:function(e){if(u.emscripten_ubq_codec_videoDecoders.has(e)){const t=u.emscripten_ubq_codec_videoDecoders.get(e);"closed"!==t.videoDecoder.state&&t.videoDecoder.close(),u.emscripten_ubq_codec_videoDecoders.delete(e)}},Ra:function(e){const t=u.emscripten_ubq_codec_videoEncoders.get(e);"closed"!==t.videoEncoder.state&&t.videoEncoder.close(),u.emscripten_ubq_codec_videoEncoders.delete(e)},Ma:function(e,t,r){const n=u.emscripten_ubq_codec_audioEncoders.get(e),o=1e6*n.frameIndex/30,i=u.HEAPF32.subarray(t/4,t/4+r),a=new AudioData({format:"f32",sampleRate:n.audioEncoderConfig.sampleRate,numberOfFrames:r/n.audioEncoderConfig.numberOfChannels,numberOfChannels:n.audioEncoderConfig.numberOfChannels,timestamp:o,data:i});n.audioEncoder.encode(a),n.frameIndex++,a.close()},Qa:function(e,t,r){const n=u.emscripten_ubq_codec_videoEncoders.get(e),o=1e6*n.frameIndex/n.encoderConfig.fps,i=n.frameIndex%n.groupOfPictures==0,a=u.specialHTMLTargets["!canvas"],s=new VideoFrame(a,{timestamp:o});n.videoEncoder.encode(s,{keyFrame:i}),s.close(),n.frameIndex++},La:async function(e,t){const r=u.emscripten_ubq_codec_audioEncoders.get(e);await r.audioEncoder.flush(),u.emscripten_ubq_codec_onFinalizedAudioEncoding(e,t)},Pa:async function(e,t){const r=u.emscripten_ubq_codec_videoEncoders.get(e);await r.videoEncoder.flush(),u.emscripten_ubq_codec_onFinalizedVideoEncoding(e,t)},Va:async function(e,t){const r=u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder;r.flushing=!0;try{await r.flush()}catch{}r.flushing=!1,r.writtenFrames=t},O:async function(e,t,r){const n=u.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},aa:function(e){return u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.decodeQueueSize},ba:function(e){return u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.decodedFrames},Q:function(e){return u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.writtenFrames},Ua:function(e){return u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.flushing},Za:function(e){return u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.flushing},P:function(){return"undefined"!=typeof VideoFrame&&"undefined"!=typeof VideoDecoder&&"undefined"!=typeof VideoEncoder&&"undefined"!=typeof AudioDecoder&&"undefined"!=typeof AudioEncoder},Ya:function(e,t){u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.requestedFrame=t},$a:function(e,t,r){const n=u.emscripten_ubq_codec_videoDecoders.get(e),o=u.HEAPU32.subarray(t/4,t/4+r);n.videoDecoder.textures=[];for(let e=0;e<r;e++)n.videoDecoder.textures[e]=mr.textures[o[e]]},ve:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return!!(null==t?void 0:t.allocate())},W:function(e,t,r,n){return u.emscripten_ubq_asyncFetchManager.createHeader(e,t,r,n)},ye:function(e){u.emscripten_ubq_asyncFetchManager.deleteHeader(e)},ze:function(e,t,r,n,o,i,a,s,c){return u.emscripten_ubq_asyncFetchManager.fetch(e,t,r,n,o,i,a,s,c).handle},se:function(e){return u.emscripten_ubq_asyncFetchManager.deleteProcess(e)},xe:function(e){var t,r;return null!==(r=null===(t=u.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.receivedLength)&&void 0!==r?r:0},ue:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultAddress:-1},te:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultLength:-1},pa:function(e){var t,r;return null!==(r=null===(t=u.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.state)&&void 0!==r?r:-1},we:function(e){var t,r;return null!==(r=null===(t=u.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.totalBytes)&&void 0!==r?r:0},db:function(){return!!u.emscripten_ubq_settings_forceWebGL1},da:function(e,t){var r=t>>2,n=I[r+6],o={alpha:!!I[r+0],depth:!!I[r+1],stencil:!!I[r+2],antialias:!!I[r+3],premultipliedAlpha:!!I[r+4],preserveDrawingBuffer:!!I[r+5],powerPreference:Ir[n],failIfMajorPerformanceCaveat:!!I[r+7],majorVersion:I[r+8],minorVersion:I[r+9],enableExtensionsByDefault:I[r+10],explicitSwapControl:I[r+11],proxyContextToMainThread:I[r+12],renderViaOffscreenBackBuffer:I[r+13]},i=function(e){return function(e){var t;return e=(t=e)>2?V(t):t,jr[e]||("undefined"!=typeof document?document.querySelector(e):void 0)}(e)}(e);return i?o.explicitSwapControl?0:mr.createContext(i,o):0},ca:function(e){mr.currentContext==e&&(mr.currentContext=0),mr.deleteContext(e)},eb:function(e,t){var r=mr.getContext(e),n=V(t);return n.startsWith("GL_")&&(n=n.substr(3)),"ANGLE_instanced_arrays"==n&&cr(Kr),"OES_vertex_array_object"==n&&lr(Kr),"WEBGL_draw_buffers"==n&&fr(Kr),"WEBGL_draw_instanced_base_vertex_base_instance"==n&&dr(Kr),"WEBGL_multi_draw_instanced_base_vertex_base_instance"==n&&hr(Kr),"WEBGL_multi_draw"==n&&pr(Kr),!!r.GLctx.getExtension(n)},cb:function(e){for(var t=e>>2,r=0;r<14;++r)I[t+r]=0;I[t+0]=I[t+1]=I[t+3]=I[t+4]=I[t+8]=I[t+10]=1},fb:function(e){return mr.makeContextCurrent(e)?0:-5},rb:function(e,t){var r=0;return qr().forEach((function(n,o){var i=t+r;j[e+4*o>>2]=i,function(e,t,r){for(var n=0;n<e.length;++n)L[t++>>0]=e.charCodeAt(n);L[t>>0]=0}(n,i),r+=n.length+1})),0},sb:function(e,t){var r=qr();j[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),j[t>>2]=n,0},De:zr,S:function(e){try{var t=Pe.getStreamFromFD(e);return Ae.close(t),0}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return e.errno}},nb:function(e,t,r,n,o){try{if(n=Wr(n),isNaN(n))return 61;var i=Hr(Pe.getStreamFromFD(e),t,r,n);return j[o>>2]=i,0}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return e.errno}},ja:function(e,t,r,n){try{var o=Hr(Pe.getStreamFromFD(e),t,r);return j[n>>2]=o,0}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return e.errno}},qb:function(e,t,r,n){try{if(t=Wr(t),isNaN(t))return 61;var o=Pe.getStreamFromFD(e);return Ae.llseek(o,t,r),ae=[o.position>>>0,(ie=o.position,+Math.abs(ie)>=1?ie>0?(0|Math.min(+Math.floor(ie/4294967296),4294967295))>>>0:~~+Math.ceil((ie-+(~~ie>>>0))/4294967296)>>>0:0)],I[n>>2]=ae[0],I[n+4>>2]=ae[1],o.getdents&&0===t&&0===r&&(o.getdents=null),0}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return e.errno}},ia:function(e,t,r,n){try{var o=function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=j[t>>2],s=j[t+4>>2];t+=8;var u=Ae.write(e,L,a,s,n);if(u<0)return-1;o+=u,void 0!==n&&(n+=u)}return o}(Pe.getStreamFromFD(e),t,r);return j[n>>2]=o,0}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return e.errno}},hb:function e(t,r){e.randomDevice||(e.randomDevice=Ee());for(var n=0;n<r;n++)L[t+n>>0]=e.randomDevice();return 0},l:function(e,t){var r=fn();try{return wt(e)(t)}catch(e){if(dn(r),e!==e+0)throw e;ln(1,0)}},t:function(e,t,r){var n=fn();try{return wt(e)(t,r)}catch(e){if(dn(n),e!==e+0)throw e;ln(1,0)}},m:function(e,t,r,n){var o=fn();try{return wt(e)(t,r,n)}catch(e){if(dn(o),e!==e+0)throw e;ln(1,0)}},K:function(e,t,r,n,o){var i=fn();try{return wt(e)(t,r,n,o)}catch(e){if(dn(i),e!==e+0)throw e;ln(1,0)}},He:function(e,t,r,n,o,i){var a=fn();try{return wt(e)(t,r,n,o,i)}catch(e){if(dn(a),e!==e+0)throw e;ln(1,0)}},ra:function(e,t,r,n,o,i,a){var s=fn();try{return wt(e)(t,r,n,o,i,a)}catch(e){if(dn(s),e!==e+0)throw e;ln(1,0)}},qa:function(e,t,r,n,o,i,a,s,u,c){var l=fn();try{return wt(e)(t,r,n,o,i,a,s,u,c)}catch(e){if(dn(l),e!==e+0)throw e;ln(1,0)}},Y:function(e){var t=fn();try{wt(e)()}catch(e){if(dn(t),e!==e+0)throw e;ln(1,0)}},r:function(e,t){var r=fn();try{wt(e)(t)}catch(e){if(dn(r),e!==e+0)throw e;ln(1,0)}},B:function(e,t,r){var n=fn();try{wt(e)(t,r)}catch(e){if(dn(n),e!==e+0)throw e;ln(1,0)}},n:function(e,t,r,n){var o=fn();try{wt(e)(t,r,n)}catch(e){if(dn(o),e!==e+0)throw e;ln(1,0)}},x:function(e,t,r,n,o){var i=fn();try{wt(e)(t,r,n,o)}catch(e){if(dn(i),e!==e+0)throw e;ln(1,0)}},Ge:function(e,t,r,n,o,i){var a=fn();try{wt(e)(t,r,n,o,i)}catch(e){if(dn(a),e!==e+0)throw e;ln(1,0)}},Ee:function(e,t,r,n,o,i,a){var s=fn();try{wt(e)(t,r,n,o,i,a)}catch(e){if(dn(s),e!==e+0)throw e;ln(1,0)}},Fe:function(e,t,r,n,o,i,a,s,u,c){var l=fn();try{wt(e)(t,r,n,o,i,a,s,u,c)}catch(e){if(dn(l),e!==e+0)throw e;ln(1,0)}},ib:function(e,t,r,n,o){return function(e,t,r,n){var o=I[n+40>>2],i={tm_sec:I[n>>2],tm_min:I[n+4>>2],tm_hour:I[n+8>>2],tm_mday:I[n+12>>2],tm_mon:I[n+16>>2],tm_year:I[n+20>>2],tm_wday:I[n+24>>2],tm_yday:I[n+28>>2],tm_isdst:I[n+32>>2],tm_gmtoff:I[n+36>>2],tm_zone:o?V(o):""},a=V(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 c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=["January","February","March","April","May","June","July","August","September","October","November","December"];function f(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length<t;)n=r[0]+n;return n}function d(e,t){return f(e,t,"0")}function h(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 p(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=function(e,t){for(var r=new Date(e.getTime());t>0;){var n=Kt(r.getFullYear()),o=r.getMonth(),i=(n?Vr:Gr)[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=p(r),i=p(n);return h(o,t)<=0?h(i,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var g={"%a":function(e){return c[e.tm_wday].substring(0,3)},"%A":function(e){return c[e.tm_wday]},"%b":function(e){return l[e.tm_mon].substring(0,3)},"%B":function(e){return l[e.tm_mon]},"%C":function(e){return d((e.tm_year+1900)/100|0,2)},"%d":function(e){return d(e.tm_mday,2)},"%e":function(e){return f(e.tm_mday,2," ")},"%g":function(e){return m(e).toString().substring(2)},"%G":function(e){return m(e)},"%H":function(e){return d(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),d(t,2)},"%j":function(e){return d(e.tm_mday+function(e,t){for(var r=0,n=0;n<=t;r+=e[n++]);return r}(Kt(e.tm_year+1900)?Vr:Gr,e.tm_mon-1),3)},"%m":function(e){return d(e.tm_mon+1,2)},"%M":function(e){return d(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return d(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var t=e.tm_yday+7-e.tm_wday;return d(Math.floor(t/7),2)},"%V":function(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&&Kt(e.tm_year)||(t=1)}}else{t=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&Kt(e.tm_year%400-1))&&t++}return d(t,2)},"%w":function(e){return e.tm_wday},"%W":function(e){var t=e.tm_yday+7-(e.tm_wday+6)%7;return d(Math.floor(t/7),2)},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(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":function(e){return e.tm_zone},"%%":function(){return"%"}};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 v=xe(a=a.replace(/\0\0/g,"%"),!1);return v.length>t?0:($r(v,e),v.length-1)}(e,t,r,n)}},on=(function(){var e={a:nn};function t(e,t){var r,n=e.exports;u.asm=n,P=u.asm.Wg,X(),K=u.asm.Zg,r=u.asm.Xg,Z.unshift(r),fe()}function r(e){t(e.instance)}function n(t){return(S||!b&&!w||"function"!=typeof fetch?Promise.resolve().then((function(){return me(ne)})):fetch(ne,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+ne+"'";return e.arrayBuffer()})).catch((function(){return me(ne)}))).then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){A("failed to asynchronously prepare wasm: "+e),de(e)}))}if(le(),u.instantiateWasm)try{return u.instantiateWasm(e,t)}catch(e){A("Module.instantiateWasm callback failed with error: "+e),o(e)}(S||"function"!=typeof WebAssembly.instantiateStreaming||he(ne)||E||"function"!=typeof fetch?n(r):fetch(ne,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(r,(function(e){return A("wasm streaming compile failed: "+e),A("falling back to ArrayBuffer instantiation"),n(r)}))}))).catch(o)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.Xg).apply(null,arguments)},u._malloc=function(){return(on=u._malloc=u.asm.Yg).apply(null,arguments)}),an=(u._main=function(){return(u._main=u.asm._g).apply(null,arguments)},u._free=function(){return(an=u._free=u.asm.$g).apply(null,arguments)}),sn=u.___errno_location=function(){return(sn=u.___errno_location=u.asm.ah).apply(null,arguments)},un=(u._ma_device_process_pcm_frames_capture__webaudio=function(){return(u._ma_device_process_pcm_frames_capture__webaudio=u.asm.bh).apply(null,arguments)},u._ma_device_process_pcm_frames_playback__webaudio=function(){return(u._ma_device_process_pcm_frames_playback__webaudio=u.asm.ch).apply(null,arguments)},u.___getTypeName=function(){return(un=u.___getTypeName=u.asm.dh).apply(null,arguments)}),cn=(u.__embind_initialize_bindings=function(){return(u.__embind_initialize_bindings=u.asm.eh).apply(null,arguments)},u._emscripten_builtin_memalign=function(){return(cn=u._emscripten_builtin_memalign=u.asm.fh).apply(null,arguments)}),ln=u._setThrew=function(){return(ln=u._setThrew=u.asm.gh).apply(null,arguments)},fn=u.stackSave=function(){return(fn=u.stackSave=u.asm.hh).apply(null,arguments)},dn=u.stackRestore=function(){return(dn=u.stackRestore=u.asm.ih).apply(null,arguments)},hn=u.stackAlloc=function(){return(hn=u.stackAlloc=u.asm.jh).apply(null,arguments)},pn=u.___cxa_is_pointer_type=function(){return(pn=u.___cxa_is_pointer_type=u.asm.kh).apply(null,arguments)};function mn(e){function r(){rn||(rn=!0,u.calledRun=!0,B||(u.noFSInit||Ae.init.initialized||Ae.init(),Ae.ignorePermissions=!1,ke.init(),ye(Z),ye(J),t(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),gn&&function(e){var t=u._main;(e=e||[]).unshift(v);var r=e.length,n=hn(4*(r+1)),o=n>>2;e.forEach((e=>{I[o++]=function(e){var t=Y(e)+1,r=hn(t);return G(e,L,r,t),r}(e)})),I[o]=0;try{var i=t(r,n);Nr(i)}catch(e){return nr(e)}}(e),function(){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;)e=u.postRun.shift(),te.unshift(e);var e;ye(te)}()))}e=e||g,se>0||(function(){if(u.preRun)for("function"==typeof u.preRun&&(u.preRun=[u.preRun]);u.preRun.length;)e=u.preRun.shift(),Q.unshift(e);var e;ye(Q)}(),se>0||(u.setStatus?(u.setStatus("Running..."),setTimeout((function(){setTimeout((function(){u.setStatus("")}),1),r()}),1)):r()))}if(u.UTF8ToString=V,u.addRunDependency=le,u.removeRunDependency=fe,u.FS_createPath=Ae.createPath,u.FS_createDataFile=Ae.createDataFile,u.FS_createPreloadedFile=Ae.createPreloadedFile,u.FS_createLazyFile=Ae.createLazyFile,u.FS_createDevice=Ae.createDevice,u.FS_unlink=Ae.unlink,u.ccall=Yr,u.getValue=function(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":case"i8":return L[e>>0];case"i16":return M[e>>1];case"i32":return I[e>>2];case"i64":return q[e>>3];case"float":return U[e>>2];case"double":return z[e>>3];case"*":return j[e>>2];default:de("invalid type for getValue: "+t)}return null},u.specialHTMLTargets=jr,ce=function e(){rn||mn(),rn||(ce=e)},u.preInit)for("function"==typeof u.preInit&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();var gn=!0;return u.noInitialRun&&(gn=!1),mn(),s.ready});e.exports=o},881:(e,t)=>{t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=u(e),a=i[0],s=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),l=0,f=s>0?a-4:a;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,u=n-o;s<u;s+=a)i.push(c(e,s,s+a>u?u:s+a));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=i.length;a<s;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},1892:(e,t,r)=>{var n=r(881),o=r(8684),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.h2=50;var a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|m(e,t),n=s(r),o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(N(e,Uint8Array)){var t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(N(e,ArrayBuffer)||e&&N(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(N(e,SharedArrayBuffer)||e&&N(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);var o=function(e){if(u.isBuffer(e)){var t=0|p(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||z(e.length)?s(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),s(e<0?0:0|p(e))}function d(e){for(var t=e.length<0?0:0|p(e.length),r=s(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function p(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function m(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||N(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(e).length;default:if(o)return n?-1:j(e).length;t=(""+t).toLowerCase(),o=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return F(this,t,r);case"utf8":case"utf-8":return C(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),z(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,o){var i,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(i=r;i<s;i++)if(c(e,i)===c(t,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===u)return l*a}else-1!==l&&(i-=i-l),l=-1}else for(r+u>s&&(r=s-u),i=r;i>=0;i--){for(var f=!0,d=0;d<u;d++)if(c(e,i+d)!==c(t,d)){f=!1;break}if(f)return i}return-1}function w(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=t.length;n>i/2&&(n=i/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(z(s))return a;e[r+a]=s}return a}function E(e,t,r,n){return q(j(t,e.length-r),e,r,n)}function _(e,t,r,n){return q(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function x(e,t,r,n){return q(U(t),e,r,n)}function k(e,t,r,n){return q(function(e,t){for(var r,n,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function S(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function C(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var i,a,s,u,c=e[o],l=null,f=c>239?4:c>223?3:c>191?2:1;if(o+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(i=e[o+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(u=(15&c)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=f}return function(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=A));return r}(n)}u.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}(e,t,r)},u.allocUnsafe=function(e){return f(e)},u.allocUnsafeSlow=function(e){return f(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(N(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),N(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var i=e[r];if(N(i,Uint8Array))o+i.length>n.length?u.from(i).copy(n,o):Uint8Array.prototype.set.call(n,i,o);else{if(!u.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},u.byteLength=m,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},u.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?C(this,0,e):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.h2;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,o){if(N(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(i,a),c=this.slice(n,o),l=e.slice(t,r),f=0;f<s;++f)if(c[f]!==l[f]){i=c[f],a=l[f];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return _(this,e,t,r);case"base64":return x(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function P(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function T(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function F(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=t;i<r;++i)o+=H[e[i]];return o}function B(e,t,r){for(var n=e.slice(t,r),o="",i=0;i<n.length-1;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function D(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,r,n,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function R(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(e,t,r,n,i){return t=+t,r>>>=0,i||R(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function O(e,t,r,n,i){return t=+t,r>>>=0,i||R(e,0,r,8),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||D(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||D(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return e>>>=0,t||D(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||D(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||D(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||D(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||L(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||L(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);L(this,e,t,r,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<r&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);L(this,e,t,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeFloatLE=function(e,t,r){return M(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return M(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return O(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return O(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var a=u.isBuffer(e)?e:u.from(e,n),s=a.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=a[i%s]}return this};var I=/[^+/0-9A-Za-z-_]/g;function j(e,t){var r;t=t||1/0;for(var n=e.length,o=null,i=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function U(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(I,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function N(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function z(e){return e!=e}var H=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,o=0;o<16;++o)t[n+o]=e[r]+e[o];return t}()},8684:(e,t)=>{t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?o-1:0,d=r?-1:1,h=e[t+f];for(f+=d,i=h&(1<<-l)-1,h>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=d,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+e[t+f],f+=d,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=c}return(h?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,u,c=8*i-o-1,l=(1<<c)-1,f=l>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[r+h]=255&s,h+=p,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[r+h]=255&a,h+=p,a/=256,c-=8);e[r+h-p]|=128*m}},7278:(e,t,r)=>{var n=r(489)(r(4818),"DataView");e.exports=n},7643:(e,t,r)=>{var n=r(5557),o=r(4349),i=r(407),a=r(5134),s=r(9951);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,e.exports=u},3872:(e,t,r)=>{var n=r(2470),o=r(7289),i=r(7614),a=r(3067),s=r(9346);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,e.exports=u},5674:(e,t,r)=>{var n=r(489)(r(4818),"Map");e.exports=n},2462:(e,t,r)=>{var n=r(6290),o=r(4951),i=r(440),a=r(6180),s=r(7719);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,e.exports=u},2160:(e,t,r)=>{var n=r(489)(r(4818),"Promise");e.exports=n},4390:(e,t,r)=>{var n=r(489)(r(4818),"Set");e.exports=n},9264:(e,t,r)=>{var n=r(2462),o=r(236),i=r(1957);function a(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=o,a.prototype.has=i,e.exports=a},5135:(e,t,r)=>{var n=r(3872),o=r(1490),i=r(2594),a=r(5953),s=r(4667),u=r(4615);function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=o,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=s,c.prototype.set=u,e.exports=c},9652:(e,t,r)=>{var n=r(4818).Symbol;e.exports=n},4600:(e,t,r)=>{var n=r(4818).Uint8Array;e.exports=n},2403:(e,t,r)=>{var n=r(489)(r(4818),"WeakMap");e.exports=n},6562:e=>{e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},7554:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var a=e[r];t(a,r,e)&&(i[o++]=a)}return i}},1998:(e,t,r)=>{var n=r(1453),o=r(5664),i=r(5860),a=r(9571),s=r(8347),u=r(1859),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=i(e),l=!r&&o(e),f=!r&&!l&&a(e),d=!r&&!l&&!f&&u(e),h=r||l||f||d,p=h?n(e.length,String):[],m=p.length;for(var g in e)!t&&!c.call(e,g)||h&&("length"==g||f&&("offset"==g||"parent"==g)||d&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,m))||p.push(g);return p}},4656:e=>{e.exports=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}},8193:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}},1612:(e,t,r)=>{var n=r(6912),o=r(3355);e.exports=function(e,t,r){(void 0!==r&&!o(e[t],r)||void 0===r&&!(t in e))&&n(e,t,r)}},6258:(e,t,r)=>{var n=r(6912),o=r(3355),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var a=e[t];i.call(e,t)&&o(a,r)&&(void 0!==r||t in e)||n(e,t,r)}},8620:(e,t,r)=>{var n=r(3355);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},6912:(e,t,r)=>{var n=r(4698);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},8528:(e,t,r)=>{var n=r(4820),o=Object.create,i=function(){function e(){}return function(t){if(!n(t))return{};if(o)return o(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=i},3153:(e,t,r)=>{var n=r(7572)();e.exports=n},6367:(e,t,r)=>{var n=r(4656),o=r(5860);e.exports=function(e,t,r){var i=t(e);return o(e)?i:n(i,r(e))}},2759:(e,t,r)=>{var n=r(9652),o=r(9911),i=r(3744),a=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},6651:(e,t,r)=>{var n=r(2759),o=r(1408);e.exports=function(e){return o(e)&&"[object Arguments]"==n(e)}},2500:(e,t,r)=>{var n=r(5930),o=r(1408);e.exports=function e(t,r,i,a,s){return t===r||(null==t||null==r||!o(t)&&!o(r)?t!=t&&r!=r:n(t,r,i,a,e,s))}},5930:(e,t,r)=>{var n=r(5135),o=r(7557),i=r(2e3),a=r(2032),s=r(5006),u=r(5860),c=r(9571),l=r(1859),f="[object Arguments]",d="[object Array]",h="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,m,g,v){var y=u(e),b=u(t),w=y?d:s(e),E=b?d:s(t),_=(w=w==f?h:w)==h,x=(E=E==f?h:E)==h,k=w==E;if(k&&c(e)){if(!c(t))return!1;y=!0,_=!1}if(k&&!_)return v||(v=new n),y||l(e)?o(e,t,r,m,g,v):i(e,t,w,r,m,g,v);if(!(1&r)){var S=_&&p.call(e,"__wrapped__"),C=x&&p.call(t,"__wrapped__");if(S||C){var A=S?e.value():e,P=C?t.value():t;return v||(v=new n),g(A,P,r,m,v)}}return!!k&&(v||(v=new n),a(e,t,r,m,g,v))}},3216:(e,t,r)=>{var n=r(830),o=r(931),i=r(4820),a=r(1304),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,f=c.hasOwnProperty,d=RegExp("^"+l.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(n(e)?d:s).test(a(e))}},9920:(e,t,r)=>{var n=r(2759),o=r(7906),i=r(1408),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[n(e)]}},7588:(e,t,r)=>{var n=r(7839),o=r(2809),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return o(e);var t=[];for(var r in Object(e))i.call(e,r)&&"constructor"!=r&&t.push(r);return t}},3339:(e,t,r)=>{var n=r(4820),o=r(7839),i=r(3003),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=o(e),r=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&r.push(s);return r}},7604:(e,t,r)=>{var n=r(5135),o=r(1612),i=r(3153),a=r(480),s=r(4820),u=r(2551),c=r(7700);e.exports=function e(t,r,l,f,d){t!==r&&i(r,(function(i,u){if(d||(d=new n),s(i))a(t,r,u,l,e,f,d);else{var h=f?f(c(t,u),i,u+"",t,r,d):void 0;void 0===h&&(h=i),o(t,u,h)}}),u)}},480:(e,t,r)=>{var n=r(1612),o=r(8192),i=r(9947),a=r(6581),s=r(1172),u=r(5664),c=r(5860),l=r(5274),f=r(9571),d=r(830),h=r(4820),p=r(1969),m=r(1859),g=r(7700),v=r(2963);e.exports=function(e,t,r,y,b,w,E){var _=g(e,r),x=g(t,r),k=E.get(x);if(k)n(e,r,k);else{var S=w?w(_,x,r+"",e,t,E):void 0,C=void 0===S;if(C){var A=c(x),P=!A&&f(x),T=!A&&!P&&m(x);S=x,A||P||T?c(_)?S=_:l(_)?S=a(_):P?(C=!1,S=o(x,!0)):T?(C=!1,S=i(x,!0)):S=[]:p(x)||u(x)?(S=_,u(_)?S=v(_):h(_)&&!d(_)||(S=s(x))):C=!1}C&&(E.set(x,S),b(S,x,y,w,E),E.delete(x)),n(e,r,S)}}},5757:(e,t,r)=>{var n=r(1191),o=r(2549),i=r(6613);e.exports=function(e,t){return i(o(e,t,n),e+"")}},4274:(e,t,r)=>{var n=r(7477),o=r(4698),i=r(1191),a=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i;e.exports=a},1453:e=>{e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},7383:(e,t,r)=>{var n=r(5322),o=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(o,""):e}},8275:e=>{e.exports=function(e){return function(t){return e(t)}}},8094:e=>{e.exports=function(e,t){return e.has(t)}},1254:(e,t,r)=>{var n=r(4600);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},8192:(e,t,r)=>{e=r.nmd(e);var n=r(4818),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o?n.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=s?s(r):new e.constructor(r);return e.copy(n),n}},9947:(e,t,r)=>{var n=r(1254);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},6581:e=>{e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},7200:(e,t,r)=>{var n=r(6258),o=r(6912);e.exports=function(e,t,r,i){var a=!r;r||(r={});for(var s=-1,u=t.length;++s<u;){var c=t[s],l=i?i(r[c],e[c],c,r,e):void 0;void 0===l&&(l=e[c]),a?o(r,c,l):n(r,c,l)}return r}},8940:(e,t,r)=>{var n=r(4818)["__core-js_shared__"];e.exports=n},3102:(e,t,r)=>{var n=r(5757),o=r(7072);e.exports=function(e){return n((function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,s&&o(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var u=r[n];u&&e(t,u,n,a)}return t}))}},7572:e=>{e.exports=function(e){return function(t,r,n){for(var o=-1,i=Object(t),a=n(t),s=a.length;s--;){var u=a[e?s:++o];if(!1===r(i[u],u,i))break}return t}}},4698:(e,t,r)=>{var n=r(489),o=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},7557:(e,t,r)=>{var n=r(9264),o=r(8193),i=r(8094);e.exports=function(e,t,r,a,s,u){var c=1&r,l=e.length,f=t.length;if(l!=f&&!(c&&f>l))return!1;var d=u.get(e),h=u.get(t);if(d&&h)return d==t&&h==e;var p=-1,m=!0,g=2&r?new n:void 0;for(u.set(e,t),u.set(t,e);++p<l;){var v=e[p],y=t[p];if(a)var b=c?a(y,v,p,t,e,u):a(v,y,p,e,t,u);if(void 0!==b){if(b)continue;m=!1;break}if(g){if(!o(t,(function(e,t){if(!i(g,t)&&(v===e||s(v,e,r,a,u)))return g.push(t)}))){m=!1;break}}else if(v!==y&&!s(v,y,r,a,u)){m=!1;break}}return u.delete(e),u.delete(t),m}},2e3:(e,t,r)=>{var n=r(9652),o=r(4600),i=r(3355),a=r(7557),s=r(8759),u=r(1924),c=n?n.prototype:void 0,l=c?c.valueOf:void 0;e.exports=function(e,t,r,n,c,f,d){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!f(new o(e),new o(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var h=s;case"[object Set]":var p=1&n;if(h||(h=u),e.size!=t.size&&!p)return!1;var m=d.get(e);if(m)return m==t;n|=2,d.set(e,t);var g=a(h(e),h(t),n,c,f,d);return d.delete(e),g;case"[object Symbol]":if(l)return l.call(e)==l.call(t)}return!1}},2032:(e,t,r)=>{var n=r(1723),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,i,a,s){var u=1&r,c=n(e),l=c.length;if(l!=n(t).length&&!u)return!1;for(var f=l;f--;){var d=c[f];if(!(u?d in t:o.call(t,d)))return!1}var h=s.get(e),p=s.get(t);if(h&&p)return h==t&&p==e;var m=!0;s.set(e,t),s.set(t,e);for(var g=u;++f<l;){var v=e[d=c[f]],y=t[d];if(i)var b=u?i(y,v,d,t,e,s):i(v,y,d,e,t,s);if(!(void 0===b?v===y||a(v,y,r,i,s):b)){m=!1;break}g||(g="constructor"==d)}if(m&&!g){var w=e.constructor,E=t.constructor;w==E||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof E&&E instanceof E||(m=!1)}return s.delete(e),s.delete(t),m}},3566:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},1723:(e,t,r)=>{var n=r(6367),o=r(5253),i=r(8022);e.exports=function(e){return n(e,i,o)}},6330:(e,t,r)=>{var n=r(5513);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},489:(e,t,r)=>{var n=r(3216),o=r(3626);e.exports=function(e,t){var r=o(e,t);return n(r)?r:void 0}},4966:(e,t,r)=>{var n=r(6148)(Object.getPrototypeOf,Object);e.exports=n},9911:(e,t,r)=>{var n=r(9652),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var o=a.call(e);return n&&(t?e[s]=r:delete e[s]),o}},5253:(e,t,r)=>{var n=r(7554),o=r(3117),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),n(a(e),(function(t){return i.call(e,t)})))}:o;e.exports=s},5006:(e,t,r)=>{var n=r(7278),o=r(5674),i=r(2160),a=r(4390),s=r(2403),u=r(2759),c=r(1304),l="[object Map]",f="[object Promise]",d="[object Set]",h="[object WeakMap]",p="[object DataView]",m=c(n),g=c(o),v=c(i),y=c(a),b=c(s),w=u;(n&&w(new n(new ArrayBuffer(1)))!=p||o&&w(new o)!=l||i&&w(i.resolve())!=f||a&&w(new a)!=d||s&&w(new s)!=h)&&(w=function(e){var t=u(e),r="[object Object]"==t?e.constructor:void 0,n=r?c(r):"";if(n)switch(n){case m:return p;case g:return l;case v:return f;case y:return d;case b:return h}return t}),e.exports=w},3626:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},5557:(e,t,r)=>{var n=r(2037);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},4349:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},407:(e,t,r)=>{var n=r(2037),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return o.call(t,e)?t[e]:void 0}},5134:(e,t,r)=>{var n=r(2037),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:o.call(t,e)}},9951:(e,t,r)=>{var n=r(2037);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},1172:(e,t,r)=>{var n=r(8528),o=r(4966),i=r(7839);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:n(o(e))}},8347:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},7072:(e,t,r)=>{var n=r(3355),o=r(8809),i=r(8347),a=r(4820);e.exports=function(e,t,r){if(!a(r))return!1;var s=typeof t;return!!("number"==s?o(r)&&i(t,r.length):"string"==s&&t in r)&&n(r[t],e)}},5513:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},931:(e,t,r)=>{var n,o=r(8940),i=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!i&&i in e}},7839:e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},2470:e=>{e.exports=function(){this.__data__=[],this.size=0}},7289:(e,t,r)=>{var n=r(8620),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():o.call(t,r,1),--this.size,0))}},7614:(e,t,r)=>{var n=r(8620);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},3067:(e,t,r)=>{var n=r(8620);e.exports=function(e){return n(this.__data__,e)>-1}},9346:(e,t,r)=>{var n=r(8620);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},6290:(e,t,r)=>{var n=r(7643),o=r(3872),i=r(5674);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},4951:(e,t,r)=>{var n=r(6330);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},440:(e,t,r)=>{var n=r(6330);e.exports=function(e){return n(this,e).get(e)}},6180:(e,t,r)=>{var n=r(6330);e.exports=function(e){return n(this,e).has(e)}},7719:(e,t,r)=>{var n=r(6330);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},8759:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}},2037:(e,t,r)=>{var n=r(489)(Object,"create");e.exports=n},2809:(e,t,r)=>{var n=r(6148)(Object.keys,Object);e.exports=n},3003:e=>{e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},9693:(e,t,r)=>{e=r.nmd(e);var n=r(3566),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o&&n.process,s=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},3744:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},6148:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},2549:(e,t,r)=>{var n=r(6562),o=Math.max;e.exports=function(e,t,r){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,a=-1,s=o(i.length-t,0),u=Array(s);++a<s;)u[a]=i[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=i[a];return c[t]=r(u),n(e,this,c)}}},4818:(e,t,r)=>{var n=r(3566),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();e.exports=i},7700:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},236:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},1957:e=>{e.exports=function(e){return this.__data__.has(e)}},1924:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}},6613:(e,t,r)=>{var n=r(4274),o=r(3546)(n);e.exports=o},3546:e=>{var t=Date.now;e.exports=function(e){var r=0,n=0;return function(){var o=t(),i=16-(o-n);if(n=o,i>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},1490:(e,t,r)=>{var n=r(3872);e.exports=function(){this.__data__=new n,this.size=0}},2594:e=>{e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},5953:e=>{e.exports=function(e){return this.__data__.get(e)}},4667:e=>{e.exports=function(e){return this.__data__.has(e)}},4615:(e,t,r)=>{var n=r(3872),o=r(5674),i=r(2462);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new i(a)}return r.set(e,t),this.size=r.size,this}},1304:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},5322:e=>{var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},9878:(e,t,r)=>{var n=r(343);e.exports=function(e,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return e=n(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}},7477:e=>{e.exports=function(e){return function(){return e}}},3355:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},1191:e=>{e.exports=function(e){return e}},5664:(e,t,r)=>{var n=r(6651),o=r(1408),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(e){return o(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},5860:e=>{var t=Array.isArray;e.exports=t},8809:(e,t,r)=>{var n=r(830),o=r(7906);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},5274:(e,t,r)=>{var n=r(8809),o=r(1408);e.exports=function(e){return o(e)&&n(e)}},9571:(e,t,r)=>{e=r.nmd(e);var n=r(4818),o=r(8585),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,s=a&&a.exports===i?n.Buffer:void 0,u=(s?s.isBuffer:void 0)||o;e.exports=u},2822:(e,t,r)=>{var n=r(2500);e.exports=function(e,t){return n(e,t)}},830:(e,t,r)=>{var n=r(2759),o=r(4820);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},7906:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},4820:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},1408:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},1969:(e,t,r)=>{var n=r(2759),o=r(4966),i=r(1408),a=Function.prototype,s=Object.prototype,u=a.toString,c=s.hasOwnProperty,l=u.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=n(e))return!1;var t=o(e);if(null===t)return!0;var r=c.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&u.call(r)==l}},1918:(e,t,r)=>{var n=r(2759),o=r(1408);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==n(e)}},1859:(e,t,r)=>{var n=r(9920),o=r(8275),i=r(9693),a=i&&i.isTypedArray,s=a?o(a):n;e.exports=s},8022:(e,t,r)=>{var n=r(1998),o=r(7588),i=r(8809);e.exports=function(e){return i(e)?n(e):o(e)}},2551:(e,t,r)=>{var n=r(1998),o=r(3339),i=r(8809);e.exports=function(e){return i(e)?n(e,!0):o(e)}},7168:(e,t,r)=>{var n=r(7604),o=r(3102)((function(e,t,r){n(e,t,r)}));e.exports=o},4846:(e,t,r)=>{var n=r(9878);e.exports=function(e){return n(2,e)}},3117:e=>{e.exports=function(){return[]}},8585:e=>{e.exports=function(){return!1}},8322:(e,t,r)=>{var n=r(7017);e.exports=function(e){return e?Infinity===(e=n(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},343:(e,t,r)=>{var n=r(8322);e.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},7017:(e,t,r)=>{var n=r(7383),o=r(4820),i=r(1918),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=s.test(e);return r||u.test(e)?c(e.slice(2),r?2:8):a.test(e)?NaN:+e}},2963:(e,t,r)=>{var n=r(7200),o=r(2551);e.exports=function(e){return n(e,o(e))}},5240:()=>{},115:()=>{},3119:()=>{},2015:()=>{}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n](i,i.exports,r),i.loaded=!0,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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.p="";var n={};(()=>{r.d(n,{Il:()=>h,yQ:()=>e,Ju:()=>v,in:()=>O,HY:()=>Ee,F4:()=>Gt,ZP:()=>Vt,aY:()=>Xt,Qx:()=>Yt,Pf:()=>$t});var e={};r.r(e);var t,o,i,a,s,u,c,l,f,d,h,p,m=r(2822),g=r.n(m);!function(e){e[e.Pending=0]="Pending",e[e.Ready=1]="Ready",e[e.Error=2]="Error"}(t||(t={})),function(e){e.Added="DesignBlockAddedEvent",e.Updated="DesignBlockUpdatedEvent",e.Removed="DesignBlockRemovedEvent"}(o||(o={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Middle=2]="Middle",e[e.Unknown=255]="Unknown"}(i||(i={})),function(e){e[e.Up=0]="Up",e[e.Down=1]="Down"}(a||(a={})),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"}(s||(s={})),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"}(u||(u={})),function(e){e[e.Normal=0]="Normal",e[e.Italic=1]="Italic"}(c||(c={})),function(e){e.Bold="bold",e.Italic="italic"}(l||(l={})),function(e){e[e.Undefined=0]="Undefined",e[e.DesignUnit=1]="DesignUnit",e[e.Percent=2]="Percent",e[e.Auto=3]="Auto"}(f||(f={})),function(e){e[e.Free=0]="Free",e[e.VerticalStack=1]="VerticalStack",e[e.HorizontalStack=2]="HorizontalStack",e[e.DepthStack=3]="DepthStack"}(d||(d={})),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.fromRGBA=function(e){return{colorSpace:t.sRGB,components:{x:e.r,y:e.g,z:e.b,w:e.a},spotColorName:""}},e.toRGBA=function(e,r){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:{const t=r.getSpotColorRGBA(e.spotColorName);return{r:t[0],g:t[1],b:t[2],a:e.components.w}}case t.CMYK:throw new Error("CMYK to RGBA conversion not supported!");default:throw new Error("Unknown color space!")}},e.fromSpotColor=function(e){return{colorSpace:t.SpotColor,components:{x:0,y:0,z:0,w:1},spotColorName:e.name}},e.toSpotColor=function(e){return{name:e.spotColorName}},e.toRGBAOrSpotColor=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};default:throw new Error("Unknown color space!")}}}(h||(h={})),function(e){e.Scene="//ly.img.ubq/scene",e.Stack="//ly.img.ubq/stack",e.Camera="//ly.img.ubq/camera",e.Page="//ly.img.ubq/page",e.Image="//ly.img.ubq/image",e.Video="//ly.img.ubq/video",e.VideoFill="//ly.img.ubq/fill/video",e.Audio="//ly.img.ubq/audio",e.Text="//ly.img.ubq/text",e.Sticker="//ly.img.ubq/sticker",e.VectorPath="//ly.img.ubq/vector_path",e.RectShape="//ly.img.ubq/shapes/rect",e.LineShape="//ly.img.ubq/shapes/line",e.StarShape="//ly.img.ubq/shapes/star",e.PolygonShape="//ly.img.ubq/shapes/polygon",e.EllipseShape="//ly.img.ubq/shapes/ellipse",e.Group="//ly.img.ubq/group"}(p||(p={}));const v=p;var y,b,w,E;!function(e){e.Unknown="",e.Boolean="bool",e.Boolean2="ubq/math/bool2",e.Int="int",e.UInt8="uint8_t",e.Int32="int32_t",e.UInt32="uint32_t",e.Int2="ubq/math/ivec2",e.Size2="ubq/types/Size2",e.Color="ubq/types/Color",e.Double="double",e.Float="float",e.Float2="ubq/math/vec2",e.Float3="ubq/math/vec3",e.Float4="ubq/math/vec4",e.String="string",e.HorizontalTextAlignment="ubq/types/HorizontalTextAlignment",e.VerticalTextAlignment="ubq/types/VerticalTextAlignment",e.Margin2D="ubq/types/OuterMargin2D"}(y||(y={})),function(e){e.Transform="ubq/editMode/transform",e.Crop="ubq/editMode/crop",e.Text="ubq/editMode/text"}(b||(b={})),function(e){e[e.Arrow=0]="Arrow",e[e.Move=1]="Move",e[e.MoveNotPermitted=2]="MoveNotPermitted",e[e.Resize=3]="Resize",e[e.Rotate=4]="Rotate",e[e.Text=5]="Text"}(w||(w={})),function(e){e[e.Creator=0]="Creator",e[e.Adopter=1]="Adopter",e[e.Viewer=2]="Viewer",e[e.Presenter=3]="Presenter"}(E||(E={}));const _=(e,t)=>({x:e.x*t,y:e.y*t});function x(e,t,r=Number.EPSILON){return Math.abs(e-t)<r}class k{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()}}async createElement(e,t,r){const n=await this.execute("ubq/designblocks/create",e);this.execute("ubq/designblocks/addToParent",[n,t]);const o=S(this.ubq.getLastFrameWidth(t)),i=S(this.ubq.getLastFrameHeight(t)),{position:a,size:s}=function(e,t,r=8/13){const n=((e,t)=>{const r=e.x/e.y,n=t.x/t.y;return _(t,r>n?e.y/t.y:e.x/t.x)})(e,t),o=_(n,r);return{position:{x:.5*(e.x-o.x),y:.5*(e.y-o.y)},size:o}}({x:o,y:i},{x:r.width,y:r.height},8/13);s.x?this.ubq.setWidth(n,s.x):this.ubq.setWidthMode(n,"Auto"),s.y?this.ubq.setHeight(n,s.y):this.ubq.setHeightMode(n,"Auto");const u=function(e={x:50,y:50}){return{x:Math.random()*e.x,y:Math.random()*e.y}}({x:.08*o,y:.08*i});return this.ubq.setPositionX(n,a.x+u.x),this.ubq.setPositionY(n,a.y+u.y),n}setValue(e,t,r,n){return this.useInternalAPI((o=>S(o.setValue(e,t,r,n))))}getValue(e,t,r){return this.useInternalAPI((n=>S(n.getValue(e,t,r))))}async getEditorState(){return this.execute("ubq/editor/getEditorState")}async setEditorState(e){return void 0===e?Promise.reject():this.execute("ubq/editor/setEditorState",e)}async execute(e,t){return new Promise(((r,n)=>{this.useInternalAPI((o=>o.ubqExecute(e,t,(e=>{try{const t=S(e);r(t)}catch(e){n(e)}})))).delete()}))}}function S(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 C(e){return new Promise(((t,r)=>{e((e=>{try{const r=S(e);t(r)}catch(e){r(e)}}))}))}const A=(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 P,T,F,B,D,L=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 R=new WeakMap;class M{constructor(e){P.add(this),T.set(this,void 0),Object.defineProperty(this,"onAssetSourceAdded",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=L(this,T,"f").subscribeToAssetSourceAdded(e);return()=>{L(this,T,"f").isDeleted()||S(L(this,T,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onAssetSourceRemoved",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=L(this,T,"f").subscribeToAssetSourceRemoved(e);return()=>{L(this,T,"f").isDeleted()||S(L(this,T,"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,T,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),c=null===(n=e.applyAsset)||void 0===n?void 0:n.bind(e),l=null===(o=e.applyAssetToBlock)||void 0===o?void 0:o.bind(e),f=null===(i=e.addAsset)||void 0===i?void 0:i.bind(e),d=null===(a=e.removeAsset)||void 0===a?void 0:a.bind(e),h=e.credits,p=e.license;S(L(this,T,"f").addAssetSource(e.id,(async(t,r)=>{var n;try{const n=Object.assign(Object.assign({},t),{tags:A(t.tags),groups:A(t.groups),excludeGroups:A(t.excludeGroups)}),o=await e.findAssets(n);r.invoke(o)}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,h?()=>{var e;return{name:h.name,url:null!==(e=h.url)&&void 0!==e?e:""}}:null,p?()=>{var e;return{name:p.name,url:null!==(e=p.url)&&void 0!==e?e:""}}:null,s?()=>{var e;return null!==(e=s())&&void 0!==e?e:[]}:null,c?async(e,t)=>{var r;try{const r=await c(L(this,P,"m",F).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,l?async(e,t,r)=>{var n;try{await l(L(this,P,"m",F).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,f?async e=>{f(e)}:null,d?async e=>{d(e)}:null)),L(this,P,"m",B).call(this,e.id,e)}addLocalSource(e,t,r,n){S(L(this,T,"f").addLocalAssetSource(e,null!=t?t:[],r?async(e,t)=>{var n;try{const n=await r(L(this,P,"m",F).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(L(this,P,"m",F).call(this,e),t),r.invoke()}catch(e){r.invoke(null!==(o=e.message)&&void 0!==o?o:"Unknown error in user-defined `replaceAsset`")}}:null))}removeSource(e){S(L(this,T,"f").removeAssetSource(e)),L(this,P,"m",D).call(this,e)}findAllSources(){return A(L(this,T,"f").findAllAssetSources())}findAssets(e,t){return new Promise(((r,n)=>{var o,i,a,s,u,c,l;let f=null!==(o=null==t?void 0:t.tags)&&void 0!==o?o:[];Array.isArray(f)||(f=[f]);const d={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:f,groups:null!==(u=null==t?void 0:t.groups)&&void 0!==u?u:[],excludeGroups:null!==(c=null==t?void 0:t.excludeGroups)&&void 0!==c?c:[],locale:null!==(l=null==t?void 0:t.locale)&&void 0!==l?l:""};L(this,T,"f").findAssetSourceAssets(e,d,(e=>{try{const t=S(e),n=A(t.assets).map(L(this,P,"m",F));r({assets:n,currentPage:t.currentPage,nextPage:-1===t.nextPage?void 0:t.nextPage,total:t.total})}catch(e){n(e)}}))}))}async getGroups(e){return C((t=>L(this,T,"f").getAssetSourceGroups(e,t))).then((e=>A(e)))}getSupportedMimeTypes(e){return A(S(L(this,T,"f").getAssetSourceSupportedMimeTypes(e)))}getCredits(e){const t=S(L(this,T,"f").getAssetSourceCredits(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}getLicense(e){const t=S(L(this,T,"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=R.get(L(this,T,"f")))||void 0===t?void 0:t.get(e))||void 0===r?void 0:r.canManageAssets)}addAssetToSource(e,t){S(L(this,T,"f").addAssetToSource(e,t))}removeAssetFromSource(e,t){S(L(this,T,"f").removeAssetFromSource(e,t))}async apply(e,t){return new Promise(((r,n)=>{L(this,T,"f").applyAssetSourceAsset(e,t,(e=>{try{const t=S(e);L(this,T,"f").isValid(t)?r(t):r(void 0)}catch(e){n(e)}}))}))}async applyToBlock(e,t,r){return C((n=>L(this,T,"f").applyAssetSourceAssetToBlock(e,t,r,n)))}async defaultApplyAsset(e){return new Promise(((t,r)=>{L(this,T,"f").defaultApplyAsset(e,(e=>{try{const r=S(e);L(this,T,"f").isValid(r)?t(r):t(void 0)}catch(e){r(e)}}))}))}async defaultApplyAssetToBlock(e,t){return C((r=>L(this,T,"f").defaultApplyAssetToBlock(e,t,r)))}dispose(){R.delete(L(this,T,"f"))}}T=new WeakMap,P=new WeakSet,F=function(e){var t,r,n,o,i,a,s,u;const c=Object.assign(Object.assign({},e),{groups:A(e.groups),meta:void 0,tags:A(e.tags)});return e.meta.size()>0&&(c.meta={},A(e.meta.keys()).forEach((t=>{c.meta[t]="width"===t||"height"===t?parseFloat(e.meta.get(t)):e.meta.get(t)}))),0===(null===(t=c.groups)||void 0===t?void 0:t.length)&&delete c.groups,c.locale||delete c.locale,c.label||delete c.label,0===(null===(r=c.tags)||void 0===r?void 0:r.length)&&delete c.tags,(null===(n=c.credits)||void 0===n?void 0:n.name)||(null===(o=c.credits)||void 0===o?void 0:o.url)?c.credits.url||delete c.credits.url:delete c.credits,(null===(i=c.license)||void 0===i?void 0:i.name)||(null===(a=c.license)||void 0===a?void 0:a.url)?c.license.url||delete c.license.url:delete c.license,(null===(s=c.utm)||void 0===s?void 0:s.source)||(null===(u=c.utm)||void 0===u?void 0:u.medium)?(c.utm.source||delete c.utm.source,c.utm.medium||delete c.utm.medium):delete c.utm,c},B=function(e,t){R.has(L(this,T,"f"))||R.set(L(this,T,"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/`),R.get(L(this,T,"f")).set(e,{canManageAssets:t.canManageAssets})},D=function(e){var t;null===(t=R.get(L(this,T,"f")))||void 0===t||t.delete(e)};var O,I=r(7168),j=r.n(I);!function(e){e.Info="Info",e.Warning="Warning",e.Error="Error"}(O||(O={}));const U={baseURL:"/extensions/",entries:["ly.img.cesdk.fonts"]},q={company_name:{value:"img.ly"},first_name:{value:"Charly"},last_name:{value:"Williams"},address:{value:"742 Evergreen Terrace"},city:{value:"Springfield"}},N=(e,t)=>{const r=`[UBQ] ${e}`;switch(t){case O.Warning:console.warn(r);break;case O.Error:console.error(r);break;case O.Info:default:console.log(r)}},z={log:N},H={colorPalettes:{primary:{meta:{default:!0},entries:["#FFFFFF","#000000","#6686FF","#66CCFF","#54FFEA","#E75050","#F28855","#FFF763"]}},pageFormats:{"din-a0":{width:1189,height:841,unit:"mm"},"din-a1":{width:841,height:594,unit:"mm"},"din-a2":{width:594,height:420,unit:"mm"},"din-a3":{width:420,height:297,unit:"mm"},"din-a4":{width:297,height:210,unit:"mm"},"din-a5":{width:210,height:148,unit:"mm"},"din-a6":{meta:{default:!0},width:148,height:105,unit:"mm"},"din-a65":{width:210,height:105,unit:"mm"},"din-b5":{width:250,height:176,unit:"mm"},square:{width:105,height:105,unit:"mm"},"twitter-profile":{width:400,height:400,unit:"px"},"twitter-image":{width:1024,height:512,unit:"px",fixedOrientation:!0},"twitter-header":{width:1500,height:500,unit:"px",fixedOrientation:!0},"instagram-profile":{width:180,height:180,unit:"px"},"instagram-photo":{width:1080,height:1080,unit:"px"},"instagram-story":{width:1080,height:1920,unit:"px",fixedOrientation:!0},"american-letter":{width:8.5,height:11,unit:"in"},"american-legal":{width:8.5,height:14,unit:"in"},"16:10":{width:1600,height:1e3,unit:"px",fixedOrientation:!0},"16:9":{width:1600,height:900,unit:"px",fixedOrientation:!0},"16:10@2400p":{width:3840,height:2400,unit:"px",fixedOrientation:!0},"16:9@2160p":{width:3840,height:2160,unit:"px",fixedOrientation:!0},"business-card":{width:85,height:55,unit:"mm"}}},W={baseURL:"core/"};function V(e,t=("undefined"==typeof window?"":window.location.href)){return new URL(e,""===t?void 0:t).href}function G(e){return"/"!==e[e.length-1]?`${e}/`:e}const $=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)},Y={canManageAssets:!1,getGroups:()=>Promise.resolve([]),findAssets(){throw new Error("Implementation required")},getAsset(){throw new Error("Implementation required")},addAsset(){throw new Error("Implementation required")},removeAsset(){throw new Error("Implementation required")},getTypes(){throw new Error("Implementation required")},hasType(){throw new Error("Implementation required")}};class X 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 K(e){return"object"==typeof e&&null!=e}function Q(e){return"string"==typeof e?JSON.stringify(e):""+e}function Z(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: `"+Q(n)+"`"}=e;return{value:n,type:a,refinement:s,key:o[o.length-1],path:o,branch:i,...e,message:u}}function*J(e,t,r,n){var o;K(o=e)&&"function"==typeof o[Symbol.iterator]||(e=[e]);for(const o of e){const e=Z(o,t,r,n);e&&(yield e)}}function*ee(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&&K(t.schema)&&K(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,c,l]of t.entries(e,s)){const t=ee(c,l,{path:void 0===r?n:[...n,r],branch:void 0===r?o:[...o,c],coerce:i,mask:a});for(const n of t)n[0]?(u=!1,yield[n[0],void 0]):i&&(c=n[1],void 0===r?e=c:e instanceof Map?e.set(r,c):e instanceof Set?e.add(c):K(e)&&(e[r]=c))}if(u)for(const r of t.refiner(e,s))u=!1,yield[r,void 0];u&&(yield[void 0,e])}class te{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)=>J(n(e,t),t,this,e):()=>[],this.refiner=o?(e,t)=>J(o(e,t),t,this,e):()=>[]}assert(e){return function(e,t){const r=re(e,t);if(r[0])throw r[0]}(e,this)}create(e){return function(e,t){const r=re(e,t,{coerce:!0});if(r[0])throw r[0];return r[1]}(e,this)}is(e){return function(e,t){return!re(e,t)[0]}(e,this)}mask(e){return function(e,t){const r=re(e,t,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}(e,this)}validate(e,t={}){return re(e,this,t)}}function re(e,t,r={}){const n=ee(e,t,r),o=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);return o[0]?[new X(o[0],(function*(){for(const e of n)e[0]&&(yield e[0])})),void 0]:[void 0,o[1]]}function ne(e,t){return new te({type:e,schema:null,validator:t})}function oe(e){return new te({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: "+Q(e)})}function ie(){return ne("boolean",(e=>"boolean"==typeof e))}function ae(){return ne("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||"Expected an integer, but received: "+Q(e)))}function se(){return ne("number",(e=>"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+Q(e)))}function ue(e){const t=e?Object.keys(e):[],r=ne("never",(()=>!1));return new te({type:"object",schema:e||null,*entries(n){if(e&&K(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=>K(e)||"Expected an object, but received: "+Q(e),coercer:e=>K(e)?{...e}:e})}function ce(){return ne("string",(e=>"string"==typeof e||"Expected a string, but received: "+Q(e)))}function le(e,t,r={}){const{exclusive:n}=r;return he(e,"max",(r=>n?r<t:r<=t||"Expected a "+e.type+" less than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function fe(e,t,r={}){const{exclusive:n}=r;return he(e,"min",(r=>n?r>t:r>=t||"Expected a "+e.type+" greater than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function de(e){return he(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 he(e,t,r){return new te({...e,*refiner(n,o){yield*e.refiner(n,o);const i=J(r(n,o),o,e,n);for(const e of i)yield{...e,refinement:t}}})}function pe(e,t,r){const[n]=re(t,r);if(n)throw n.message=`Error in argument '${e}': ${n.message}`,n}function me(){const e=/image\/(png|jpeg|x-tga)|video\/(mp4|quicktime)|application\/octet-stream|application\/pdf/;return ne("MimeType",(t=>!("string"!=typeof t||!e.test(t))||{message:`expected one of "image/png", "image/jpeg", "image/x-tga", "video/mp4", "video/quicktime", "application/pdf" or "application/octet-stream", but got "${t}"`}))}function ge(){const e=["Free","VerticalStack","HorizontalStack","DepthStack"];return ne("SceneLayout",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}var ve,ye,be=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 we{constructor(e){ve.set(this,void 0),Object.defineProperty(this,"onStateChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=be(this,ve,"f").subscribeToEditorState(e);return()=>{be(this,ve,"f").isDeleted()||S(be(this,ve,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onHistoryUpdated",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=be(this,ve,"f").subscribeToHistory(e);return()=>{be(this,ve,"f").isDeleted()||be(this,ve,"f").unsubscribe(t)}}}),Object.defineProperty(this,"onSettingsChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=be(this,ve,"f").subscribeToSettings(e);return()=>{be(this,ve,"f").isDeleted()||S(be(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")}setEditMode(e){pe("keypath",e,ce()),be(this,ve,"f").setEditMode(e)}getEditMode(){return be(this,ve,"f").getEditMode()}getCursorType(){return be(this,ve,"f").getCursorType()}getCursorRotation(){return be(this,ve,"f").getCursorRotation()}getTextCursorPositionInScreenSpaceX(){return be(this,ve,"f").getTextCursorPositionInScreenSpaceX()}getTextCursorPositionInScreenSpaceY(){return be(this,ve,"f").getTextCursorPositionInScreenSpaceY()}createHistory(){return be(this,ve,"f").createHistory()}destroyHistory(e){S(be(this,ve,"f").destroyHistory(e))}setActiveHistory(e){S(be(this,ve,"f").setActiveHistory(e))}getActiveHistory(){return be(this,ve,"f").getActiveHistory()}addUndoStep(){S(be(this,ve,"f").addUndoStep())}undo(){S(be(this,ve,"f").undo())}redo(){S(be(this,ve,"f").redo())}canUndo(){return S(be(this,ve,"f").canUndo())}canRedo(){return S(be(this,ve,"f").canRedo())}setSettingBool(e,t){return pe("keypath",e,ce()),pe("value",t,ie()),S(be(this,ve,"f").setSettingBool(e,t))}getSettingBool(e){return pe("keypath",e,ce()),S(be(this,ve,"f").getSettingBool(e))}setSettingInt(e,t){return pe("keypath",e,ce()),pe("value",t,ae()),S(be(this,ve,"f").setSettingFloat(e,t))}getSettingInt(e){return pe("keypath",e,ce()),S(be(this,ve,"f").getSettingFloat(e))}setSettingFloat(e,t){return pe("keypath",e,ce()),pe("value",t,se()),S(be(this,ve,"f").setSettingFloat(e,t))}getSettingFloat(e){return pe("keypath",e,ce()),S(be(this,ve,"f").getSettingFloat(e))}setSettingString(e,t){return pe("keypath",e,ce()),pe("value",t,ce()),S(be(this,ve,"f").setSettingString(e,t))}getSettingString(e){return pe("keypath",e,ce()),S(be(this,ve,"f").getSettingString(e))}setSettingColorRGBA(e,t,r,n,o=1){return pe("keypath",e,ce()),pe("r",t,se()),pe("g",r,se()),pe("b",n,se()),pe("a",o,se()),S(be(this,ve,"f").setSettingColorRGBA(e,t,r,n,o))}getSettingColorRGBA(e){return pe("keypath",e,ce()),S(be(this,ve,"f").getSettingColorRGBA(e))}setSettingEnum(e,t){return pe("keypath",e,ce()),pe("value",t,ce()),S(be(this,ve,"f").setSettingEnum(e,t))}getSettingEnum(e){return pe("keypath",e,ce()),S(be(this,ve,"f").getSettingEnum(e))}getAvailableMemory(){return S(be(this,ve,"f").getAvailableMemory())}getUsedMemory(){return S(be(this,ve,"f").getUsedMemory())}setURIResolver(e){return S(be(this,ve,"f").setURIResolver(e))}defaultURIResolver(e){return be(this,ve,"f").defaultURIResolver(e)}getAbsoluteURI(e){return S(be(this,ve,"f").getAbsoluteURI(e))}setGlobalScope(e,t){pe("key",e,ce()),pe("value",t,ce()),S(be(this,ve,"f").setGlobalScope(e,t))}getGlobalScope(e){return pe("key",e,ce()),S(be(this,ve,"f").getGlobalScope(e))}findAllSpotColors(){return A(be(this,ve,"f").findAllSpotColors())}getSpotColorRGBA(e){return pe("name",e,ce()),be(this,ve,"f").getSpotColorRGB(e)}setSpotColorRGB(e,t,r,n){return pe("name",e,ce()),pe("r",t,se()),pe("g",r,se()),pe("b",n,se()),be(this,ve,"f").setSpotColorRGB(e,t,r,n)}removeSpotColor(e){return pe("name",e,ce()),S(be(this,ve,"f").removeSpotColor(e))}}ve=new WeakMap,function(e){e.Png="image/png",e.Jpeg="image/jpeg",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"}(ye||(ye={}));const Ee=ye,_e="undefined"!=typeof Blob?Blob:(()=>{try{return r(1892).Blob}catch(e){return function(){throw new Error("Could not find Blob constructor and failed to require('buffer').Blob")}}})();var xe,ke,Se,Ce=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},Ae=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){xe.set(this,void 0),ke.set(this,void 0),Se.set(this,void 0),Ce(this,xe,e,"f"),Ce(this,ke,new k(e),"f"),Ce(this,Se,new we(e),"f")}async export(e,t=Ee.Png,r={}){var n,o;pe("handle",e,se()),pe("mimeType",t,me()),pe("options",r,ue());const i=null!=r.targetWidth&&null!=r.targetHeight,a=null!==(n=r.jpegQuality)&&void 0!==n?n:.9,s=null!==(o=r.pngCompressionLevel)&&void 0!==o?o:5;return pe("jpegQuality",a,fe(le(se(),1),0,{exclusive:!0})),pe("pngCompressionLevel",s,fe(le(ae(),9),0)),null==r.targetWidth&&null==r.targetHeight||(pe("targetWidth",r.targetWidth,se()),pe("targetHeight",r.targetHeight,se())),new Promise(((n,o)=>{var u,c,l;Ae(this,xe,"f").exportToBuffer(e,t,(e=>{"error"in e?o(e.error):n(new _e([e],{type:t}))}),{pngCompressionLevel:s,jpegQuality:a,useTargetSize:i,targetWidth:null!==(u=r.targetWidth)&&void 0!==u?u:0,targetHeight:null!==(c=r.targetHeight)&&void 0!==c?c:0,exportPdfWithHighCompatibility:null===(l=r.exportPdfWithHighCompatibility)||void 0===l||l})}))}async exportWithColorMask(e,t=Ee.Mp4,r,n,o,i={}){var a,s;pe("handle",e,se()),pe("mimeType",t,me()),pe("options",i,ue());const u=null!=i.targetWidth&&null!=i.targetHeight,c=null!==(a=i.jpegQuality)&&void 0!==a?a:.9,l=null!==(s=i.pngCompressionLevel)&&void 0!==s?s:5;return pe("jpegQuality",c,fe(le(se(),1),0,{exclusive:!0})),pe("pngCompressionLevel",l,fe(le(ae(),9),0)),null==i.targetWidth&&null==i.targetHeight||(pe("targetWidth",i.targetWidth,se()),pe("targetHeight",i.targetHeight,se())),new Promise(((a,s)=>{var f,d,h;Ae(this,xe,"f").exportWithColorMaskToBuffer(e,t,r,n,o,((e,r)=>{"error"in e?s(e.error):"error"in r?s(r.error):a([new _e([e.buffer],{type:t}),new _e([r.buffer],{type:t})])}),{pngCompressionLevel:l,jpegQuality:c,useTargetSize:u,targetWidth:null!==(f=i.targetWidth)&&void 0!==f?f:0,targetHeight:null!==(d=i.targetHeight)&&void 0!==d?d:0,exportPdfWithHighCompatibility:null===(h=i.exportPdfWithHighCompatibility)||void 0===h||h})}))}async exportVideo(e,t=Ee.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 pe("content",e,ce()),C((t=>Ae(this,xe,"f").loadBlocksFromString(e,t))).then((e=>A(e)))}async saveToString(e){return pe("blocks",e,oe(se())),C((t=>Ae(this,xe,"f").saveBlocksToString(e,t)))}create(e){return pe("type",e,ce()),S(Ae(this,xe,"f").create(e))}createFill(e){return pe("type",e,ce()),S(Ae(this,xe,"f").createFill(e))}getType(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getType(e))}select(e){return pe("id",e,ae()),S(Ae(this,xe,"f").select(e))}setSelected(e,t){return pe("id",e,ae()),pe("selected",t,ie()),S(Ae(this,xe,"f").setSelected(e,t))}isSelected(e){return pe("id",e,ae()),S(Ae(this,xe,"f").isSelected(e))}findAllSelected(){return A(Ae(this,xe,"f").findAllSelected())}onSelectionChanged(e){const t=Ae(this,xe,"f").subscribeToSelectionChange(e);return()=>{Ae(this,xe,"f").isDeleted()||S(Ae(this,xe,"f").unsubscribe(t))}}isGroupable(e){return pe("ids",e,de(oe(se()))),S(Ae(this,xe,"f").isGroupable(e))}group(e){return pe("ids",e,de(oe(se()))),S(Ae(this,xe,"f").group(e))}ungroup(e){return pe("id",e,se()),S(Ae(this,xe,"f").ungroup(e))}enterGroup(e){return pe("id",e,se()),S(Ae(this,xe,"f").enterGroup(e))}exitGroup(e){return pe("id",e,se()),S(Ae(this,xe,"f").exitGroup(e))}setName(e,t){return pe("id",e,ae()),pe("name",t,ce()),S(Ae(this,xe,"f").setName(e,t))}getName(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getName(e))}getUUID(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getUUID(e))}findByName(e){pe("name",e,ce());const t=Ae(this,xe,"f").findByName(e);return A(t)}findByType(e){pe("type",e,ce());const t=S(Ae(this,xe,"f").findByType(e));return A(t)}findAll(){return A(Ae(this,xe,"f").findAll())}findAllPlaceholders(){return A(Ae(this,xe,"f").findAllPlaceholders())}isVisible(e){return pe("id",e,ae()),S(Ae(this,xe,"f").isVisible(e))}setVisible(e,t){return pe("id",e,ae()),pe("visible",t,ie()),S(Ae(this,xe,"f").setVisible(e,t))}isClipped(e){return pe("id",e,ae()),S(Ae(this,xe,"f").isClipped(e))}setClipped(e,t){return pe("id",e,ae()),pe("clipped",t,ie()),S(Ae(this,xe,"f").setClipped(e,t))}getPositionX(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getPositionX(e))}getPositionXMode(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getPositionXMode(e))}getPositionY(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getPositionY(e))}getPositionYMode(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getPositionYMode(e))}setPositionX(e,t){return pe("id",e,ae()),pe("value",t,se()),S(Ae(this,xe,"f").setPositionX(e,t))}setPositionXMode(e,t){return pe("id",e,ae()),S(Ae(this,xe,"f").setPositionXMode(e,t))}setPositionY(e,t){return pe("id",e,ae()),pe("value",t,se()),S(Ae(this,xe,"f").setPositionY(e,t))}setPositionYMode(e,t){return pe("id",e,ae()),S(Ae(this,xe,"f").setPositionYMode(e,t))}setAlwaysOnTop(e,t){return pe("id",e,ae()),pe("enabled",t,ie()),S(Ae(this,xe,"f").setAlwaysOnTop(e,t))}isAlwaysOnTop(e){return pe("id",e,ae()),S(Ae(this,xe,"f").isAlwaysOnTop(e))}bringToFront(e){return pe("id",e,se()),S(Ae(this,xe,"f").bringToFront(e))}sendToBack(e){return pe("id",e,se()),S(Ae(this,xe,"f").sendToBack(e))}bringForward(e){return pe("id",e,se()),S(Ae(this,xe,"f").bringForward(e))}sendBackward(e){return pe("id",e,se()),S(Ae(this,xe,"f").sendBackward(e))}getRotation(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getRotation(e))}setRotation(e,t){return pe("id",e,ae()),pe("radians",t,se()),S(Ae(this,xe,"f").setRotation(e,t))}getFlipHorizontal(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getFlip(e)).horizontal}getFlipVertical(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getFlip(e)).vertical}setFlipHorizontal(e,t){return pe("id",e,ae()),pe("flip",t,ie()),S(Ae(this,xe,"f").setFlipHorizontal(e,t))}setFlipVertical(e,t){return pe("id",e,ae()),pe("flip",t,ie()),S(Ae(this,xe,"f").setFlipVertical(e,t))}hasContentFillMode(e){return pe("id",e,ae()),S(Ae(this,xe,"f").hasContentFillMode(e))}getWidth(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getWidth(e))}getWidthMode(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getWidthMode(e))}getHeight(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getHeight(e))}getHeightMode(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getHeightMode(e))}setWidth(e,t){return pe("id",e,ae()),pe("value",t,se()),S(Ae(this,xe,"f").setWidth(e,t))}setWidthMode(e,t){return pe("id",e,ae()),S(Ae(this,xe,"f").setWidthMode(e,t))}setHeight(e,t){return pe("id",e,ae()),pe("value",t,se()),S(Ae(this,xe,"f").setHeight(e,t))}setHeightMode(e,t){return pe("id",e,ae()),S(Ae(this,xe,"f").setHeightMode(e,t))}getFrameX(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getLastFrameX(e))}getFrameY(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getLastFrameY(e))}getFrameWidth(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getLastFrameWidth(e))}getFrameHeight(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getLastFrameHeight(e))}setContentFillMode(e,t){return pe("id",e,ae()),S(Ae(this,xe,"f").setContentFillMode(e,t))}getContentFillMode(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getContentFillMode(e))}duplicate(e){return pe("id",e,ae()),S(Ae(this,xe,"f").duplicate(e))}destroy(e){return pe("id",e,ae()),S(Ae(this,xe,"f").destroy(e))}isValid(e){return pe("id",e,ae()),Ae(this,xe,"f").isValid(e)}getParent(e){return pe("id",e,ae()),S(Ae(this,xe,"f").hasParent(e))?S(Ae(this,xe,"f").getParent(e)):null}getChildren(e){pe("id",e,ae());const t=S(Ae(this,xe,"f").getChildren(e));return A(t)}insertChild(e,t,r){return pe("parent",e,se()),pe("child",t,se()),pe("index",r,fe(se(),0)),S(Ae(this,xe,"f").insertChild(e,t,r))}appendChild(e,t){return pe("parent",e,se()),pe("child",t,se()),S(Ae(this,xe,"f").appendChild(e,t))}referencesAnyVariables(e){return pe("id",e,ae()),S(Ae(this,xe,"f").referencesAnyVariables(e))}getGlobalBoundingBoxX(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getGlobalBoundingBoxX(e))}getGlobalBoundingBoxY(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getGlobalBoundingBoxY(e))}getGlobalBoundingBoxWidth(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getGlobalBoundingBoxWidth(e))}getGlobalBoundingBoxHeight(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getGlobalBoundingBoxHeight(e))}getScreenSpaceBoundingBoxXYWH(e){return pe("ids",e,oe(se())),S(Ae(this,xe,"f").getScreenSpaceBoundingBoxXYWH(e))}alignHorizontally(e,t){return pe("ids",e,de(oe(se()))),S(Ae(this,xe,"f").alignHorizontally(e,t))}alignVertically(e,t){return pe("ids",e,de(oe(se()))),S(Ae(this,xe,"f").alignVertically(e,t))}isAlignable(e){return pe("ids",e,de(oe(se()))),S(Ae(this,xe,"f").isAlignable(e))}scale(e,t,r=0,n=0){return pe("id",e,ae()),S(Ae(this,xe,"f").scale(e,t,r,n))}findAllProperties(e){return pe("id",e,ae()),A(S(Ae(this,xe,"f").findAllProperties(e)))}isPropertyReadable(e){return pe("property",e,ce()),Ae(this,xe,"f").isPropertyReadable(e)}isPropertyWritable(e){return pe("property",e,ce()),Ae(this,xe,"f").isPropertyWritable(e)}getPropertyType(e){return pe("property",e,ce()),S(Ae(this,xe,"f").getPropertyType(e))}getEnumValues(e){return pe("enumProperty",e,ce()),A(S(Ae(this,xe,"f").getEnumValues(e)))}setBool(e,t,r){return pe("id",e,ae()),pe("property",t,ce()),pe("value",r,ie()),S(Ae(this,xe,"f").setBool(e,t,r))}getBool(e,t){return pe("id",e,ae()),pe("property",t,ce()),S(Ae(this,xe,"f").getBool(e,t))}setInt(e,t,r){return pe("id",e,ae()),pe("property",t,ce()),pe("value",r,ae()),S(Ae(this,xe,"f").setInt(e,t,r))}getInt(e,t){return pe("id",e,ae()),pe("property",t,ce()),S(Ae(this,xe,"f").getInt(e,t))}setFloat(e,t,r){return pe("id",e,ae()),pe("property",t,ce()),pe("value",r,se()),S(Ae(this,xe,"f").setFloat(e,t,r))}getFloat(e,t){return pe("id",e,ae()),pe("property",t,ce()),S(Ae(this,xe,"f").getFloat(e,t))}setDouble(e,t,r){return pe("id",e,ae()),pe("property",t,ce()),pe("value",r,se()),S(Ae(this,xe,"f").setDouble(e,t,r))}getDouble(e,t){return pe("id",e,ae()),pe("property",t,ce()),S(Ae(this,xe,"f").getDouble(e,t))}setString(e,t,r){return pe("id",e,ae()),pe("property",t,ce()),pe("value",r,ce()),S(Ae(this,xe,"f").setString(e,t,r))}getString(e,t){return pe("id",e,ae()),pe("property",t,ce()),S(Ae(this,xe,"f").getString(e,t))}setColorRGBA(e,t,r,n,o,i=1){return pe("id",e,ae()),pe("property",t,ce()),pe("r",r,se()),pe("g",n,se()),pe("b",o,se()),pe("a",i,se()),S(Ae(this,xe,"f").setColorRGBA(e,t,r,n,o,i))}getColorRGBA(e,t){return pe("id",e,ae()),pe("property",t,ce()),S(Ae(this,xe,"f").getColorRGBA(e,t))}setColorSpot(e,t,r,n=1){return pe("id",e,ae()),pe("property",t,ce()),pe("name",r,ce()),pe("tint",n,se()),S(Ae(this,xe,"f").setColorSpot(e,t,r,n))}getColorSpotName(e,t){return pe("id",e,ae()),pe("property",t,ce()),S(Ae(this,xe,"f").getColorSpotName(e,t))}getColorSpotTint(e,t){return pe("id",e,ae()),pe("property",t,ce()),S(Ae(this,xe,"f").getColorSpotTint(e,t))}setEnum(e,t,r){return pe("id",e,ae()),pe("property",t,ce()),pe("value",r,ce()),S(Ae(this,xe,"f").setEnum(e,t,r))}getEnum(e,t){return pe("id",e,ae()),pe("property",t,ce()),S(Ae(this,xe,"f").getEnum(e,t))}hasCrop(e){return pe("id",e,ae()),S(Ae(this,xe,"f").hasCrop(e))}setCropScaleX(e,t){return pe("id",e,ae()),pe("scaleX",t,se()),S(Ae(this,xe,"f").setCropScaleX(e,t))}setCropScaleY(e,t){return pe("id",e,ae()),pe("scaleY",t,se()),S(Ae(this,xe,"f").setCropScaleY(e,t))}setCropRotation(e,t){return pe("id",e,ae()),pe("rotation",t,se()),S(Ae(this,xe,"f").setCropRotation(e,t))}setCropScaleRatio(e,t){return pe("id",e,ae()),pe("scaleRatio",t,se()),S(Ae(this,xe,"f").setCropScaleRatio(e,t))}setCropTranslationX(e,t){return pe("id",e,ae()),pe("translationX",t,se()),S(Ae(this,xe,"f").setCropTranslationX(e,t))}setCropTranslationY(e,t){return pe("id",e,ae()),pe("translationY",t,se()),S(Ae(this,xe,"f").setCropTranslationY(e,t))}resetCrop(e){return pe("id",e,ae()),S(Ae(this,xe,"f").resetCrop(e))}getCropScaleX(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getCropScaleX(e))}getCropScaleY(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getCropScaleY(e))}getCropRotation(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getCropRotation(e))}getCropScaleRatio(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getCropScaleRatio(e))}getCropTranslationX(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getCropTranslationX(e))}getCropTranslationY(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getCropTranslationY(e))}adjustCropToFillFrame(e,t){return pe("id",e,ae()),pe("minScaleRatio",t,se()),S(Ae(this,xe,"f").adjustCropToFillFrame(e,t))}flipCropHorizontal(e){return pe("id",e,ae()),S(Ae(this,xe,"f").flipCropHorizontal(e))}flipCropVertical(e){return pe("id",e,ae()),S(Ae(this,xe,"f").flipCropVertical(e))}hasOpacity(e){return pe("id",e,ae()),S(Ae(this,xe,"f").hasOpacity(e))}setOpacity(e,t){return pe("id",e,ae()),pe("opacity",t,se()),S(Ae(this,xe,"f").setOpacity(e,t))}getOpacity(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getOpacity(e))}hasBlendMode(e){return pe("id",e,ae()),S(Ae(this,xe,"f").hasBlendMode(e))}setBlendMode(e,t){return pe("id",e,ae()),pe("blendMode",t,ce()),S(Ae(this,xe,"f").setBlendMode(e,t))}getBlendMode(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getBlendMode(e))}hasFillColor(e){return pe("id",e,ae()),S(Ae(this,xe,"f").hasFillColor(e))}setFillColorRGBA(e,t,r,n,o=1){return pe("id",e,ae()),pe("r",t,se()),pe("g",r,se()),pe("b",n,se()),pe("a",o,se()),S(Ae(this,xe,"f").setFillColorRGBA(e,t,r,n,o))}getFillColorRGBA(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getFillColorRGBA(e))}setFillColorEnabled(e,t){return pe("id",e,ae()),pe("enabled",t,ie()),S(Ae(this,xe,"f").setFillColorEnabled(e,t))}isFillColorEnabled(e){return pe("id",e,ae()),S(Ae(this,xe,"f").isFillColorEnabled(e))}createEffect(e){return pe("type",e,ce()),S(Ae(this,xe,"f").createEffect(e))}hasEffects(e){return pe("id",e,ae()),S(Ae(this,xe,"f").hasEffects(e))}getEffects(e){pe("id",e,ae());const t=S(Ae(this,xe,"f").getEffects(e));return A(t)}insertEffect(e,t,r){pe("id",e,ae()),pe("effectId",t,ae()),pe("index",r,fe(ae(),0)),S(Ae(this,xe,"f").insertEffect(e,t,r))}appendEffect(e,t){pe("id",e,ae()),pe("effectId",t,ae()),S(Ae(this,xe,"f").appendEffect(e,t))}removeEffect(e,t){pe("id",e,ae()),pe("index",t,fe(ae(),0)),S(Ae(this,xe,"f").removeEffect(e,t))}hasEffectEnabled(e){return pe("effectId",e,ae()),S(Ae(this,xe,"f").hasEffectEnabled(e))}setEffectEnabled(e,t){pe("effectId",e,ae()),pe("enabled",t,ie()),S(Ae(this,xe,"f").setEffectEnabled(e,t))}isEffectEnabled(e){return pe("effectId",e,ae()),S(Ae(this,xe,"f").isEffectEnabled(e))}createBlur(e){return pe("type",e,ce()),S(Ae(this,xe,"f").createBlur(e))}hasBlur(e){return pe("id",e,ae()),S(Ae(this,xe,"f").hasBlur(e))}setBlur(e,t){pe("id",e,ae()),pe("blurId",t,ae()),S(Ae(this,xe,"f").setBlur(e,t))}getBlur(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getBlur(e))}setBlurEnabled(e,t){pe("id",e,ae()),pe("enabled",t,ie()),S(Ae(this,xe,"f").setBlurEnabled(e,t))}isBlurEnabled(e){return pe("id",e,ae()),S(Ae(this,xe,"f").isBlurEnabled(e))}hasBackgroundColor(e){return pe("id",e,ae()),S(Ae(this,xe,"f").hasBackgroundColor(e))}setBackgroundColorRGBA(e,t,r,n,o=1){return pe("id",e,ae()),pe("r",t,se()),pe("g",r,se()),pe("b",n,se()),pe("a",o,se()),S(Ae(this,xe,"f").setBackgroundColorRGBA(e,t,r,n,o))}getBackgroundColorRGBA(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getBackgroundColorRGBA(e))}setBackgroundColorEnabled(e,t){return pe("id",e,ae()),pe("enabled",t,ie()),S(Ae(this,xe,"f").setBackgroundColorEnabled(e,t))}isBackgroundColorEnabled(e){return pe("id",e,ae()),S(Ae(this,xe,"f").isBackgroundColorEnabled(e))}hasStroke(e){return pe("id",e,ae()),S(Ae(this,xe,"f").hasStroke(e))}setStrokeEnabled(e,t){return pe("id",e,ae()),pe("enabled",t,ie()),S(Ae(this,xe,"f").setStrokeEnabled(e,t))}isStrokeEnabled(e){return pe("id",e,ae()),S(Ae(this,xe,"f").isStrokeEnabled(e))}setStrokeColorRGBA(e,t,r,n,o=1){return pe("id",e,ae()),pe("r",t,se()),pe("g",r,se()),pe("b",n,se()),pe("a",o,se()),S(Ae(this,xe,"f").setStrokeColorRGBA(e,t,r,n,o))}getStrokeColorRGBA(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getStrokeColorRGBA(e))}setStrokeWidth(e,t){return pe("id",e,ae()),pe("width",t,se()),S(Ae(this,xe,"f").setStrokeWidth(e,t))}getStrokeWidth(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getStrokeWidth(e))}setStrokeStyle(e,t){return pe("id",e,ae()),S(Ae(this,xe,"f").setStrokeStyle(e,t))}getStrokeStyle(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getStrokeStyle(e))}setStrokePosition(e,t){return pe("id",e,ae()),S(Ae(this,xe,"f").setStrokePosition(e,t))}getStrokePosition(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getStrokePosition(e))}setStrokeCornerGeometry(e,t){return pe("id",e,ae()),S(Ae(this,xe,"f").setStrokeCornerGeometry(e,t))}getStrokeCornerGeometry(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getStrokeCornerGeometry(e))}hasOutline(e){return pe("id",e,ae()),this.hasStroke(e)}setOutlineColorRGBA(e,t,r,n,o=1){return pe("id",e,ae()),pe("r",t,se()),pe("g",r,se()),pe("b",n,se()),pe("a",o,se()),this.setStrokeColorRGBA(e,t,r,n,o)}getOutlineColorRGBA(e){return pe("id",e,ae()),this.getStrokeColorRGBA(e)}setOutlineEnabled(e,t){return pe("id",e,ae()),pe("enabled",t,ie()),this.setStrokeEnabled(e,t)}isOutlineEnabled(e){return pe("id",e,ae()),this.isStrokeEnabled(e)}setOutlineWidth(e,t){return pe("id",e,ae()),pe("width",t,se()),this.setStrokeWidth(e,t)}getOutlineWidth(e){return pe("id",e,ae()),this.getStrokeWidth(e)}hasDropShadow(e){return pe("id",e,ae()),S(Ae(this,xe,"f").hasDropShadow(e))}setDropShadowEnabled(e,t){return pe("id",e,ae()),pe("enabled",t,ie()),S(Ae(this,xe,"f").setDropShadowEnabled(e,t))}isDropShadowEnabled(e){return pe("id",e,ae()),S(Ae(this,xe,"f").isDropShadowEnabled(e))}setDropShadowColorRGBA(e,t,r,n,o=1){return pe("id",e,ae()),pe("r",t,se()),pe("g",r,se()),pe("b",n,se()),pe("a",o,se()),S(Ae(this,xe,"f").setDropShadowColorRGBA(e,t,r,n,o))}getDropShadowColorRGBA(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getDropShadowColorRGBA(e))}setDropShadowOffsetX(e,t){return pe("id",e,ae()),pe("offsetX",t,se()),S(Ae(this,xe,"f").setDropShadowOffsetX(e,t))}getDropShadowOffsetX(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getDropShadowOffsetX(e))}setDropShadowOffsetY(e,t){return pe("id",e,ae()),pe("offsetY",t,se()),S(Ae(this,xe,"f").setDropShadowOffsetY(e,t))}getDropShadowOffsetY(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getDropShadowOffsetY(e))}setDropShadowBlurRadiusX(e,t){return pe("id",e,ae()),pe("blurRadiusX",t,se()),S(Ae(this,xe,"f").setDropShadowBlurRadiusX(e,t))}getDropShadowBlurRadiusX(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getDropShadowBlurRadiusX(e))}setDropShadowBlurRadiusY(e,t){return pe("id",e,ae()),pe("blurRadiusY",t,se()),S(Ae(this,xe,"f").setDropShadowBlurRadiusY(e,t))}getDropShadowBlurRadiusY(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getDropShadowBlurRadiusY(e))}setDropShadowClip(e,t){return pe("id",e,ae()),S(Ae(this,xe,"f").setDropShadowClip(e,t))}getDropShadowClip(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getDropShadowClip(e))}replaceText(e,t,r=-1,n=-1){pe("id",e,ae()),pe("text",t,ce()),pe("from",r,ae()),pe("to",n,ae()),S(Ae(this,xe,"f").replaceText(e,t,r,n))}removeText(e,t=-1,r=-1){pe("id",e,ae()),pe("from",t,ae()),pe("to",r,ae()),S(Ae(this,xe,"f").removeText(e,t,r))}setTextColor(e,t,r=-1,n=-1){let o;pe("id",e,ae()),pe("from",r,ae()),pe("to",n,ae()),o=function(e){return"r"in e&&"a"in e&&void 0!==e.r&&void 0!==e.a}(t)?h.fromRGBA(t):h.fromSpotColor(t),S(Ae(this,xe,"f").setTextColor(e,o,r,n))}getTextColors(e,t=-1,r=-1){pe("id",e,ae()),pe("from",t,ae()),pe("to",r,ae());const n=Ae(this,xe,"f").getTextColors(e,t,r);return A(S(n)).map((e=>e.colorSpace===h.ColorSpace.SpotColor?h.toSpotColor(e):h.toRGBA(e,Ae(this,Se,"f"))))}getTextFontWeights(e,t=-1,r=-1){return pe("id",e,ae()),pe("from",t,ae()),pe("to",r,ae()),A(S(Ae(this,xe,"f").getTextFontWeights(e,t,r)))}getTextFontStyles(e,t=-1,r=-1){return pe("id",e,ae()),pe("from",t,ae()),pe("to",r,ae()),A(S(Ae(this,xe,"f").getTextFontStyles(e,t,r)))}hasFill(e){return pe("id",e,ae()),S(Ae(this,xe,"f").hasFill(e))}isFillEnabled(e){return pe("id",e,ae()),S(Ae(this,xe,"f").isFillEnabled(e))}setFillEnabled(e,t){return pe("id",e,ae()),S(Ae(this,xe,"f").setFillEnabled(e,t))}getFill(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getFill(e))}setFill(e,t){return pe("id",e,ae()),pe("fill",t,ae()),S(Ae(this,xe,"f").setFill(e,t))}setFillType(e,t){return pe("id",e,ae()),S(Ae(this,xe,"f").setFillType(e,t))}getFillType(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getFillType(e))}setFillSolidColor(e,t,r,n,o=1){pe("id",e,ae()),S(Ae(this,xe,"f").setFillSolidColor(e,t,r,n,o))}getFillSolidColor(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getFillSolidColor(e))}setFillGradientType(e,t){pe("id",e,ae()),S(Ae(this,xe,"f").setFillGradientType(e,t))}getFillGradientType(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getFillGradientType(e))}addFillGradientColorStop(e,t,r,n,o,i=1){pe("id",e,ae()),S(Ae(this,xe,"f").addFillGradientColorStop(e,t,r,n,o,i))}removeFillGradientColorStop(e,t){pe("id",e,ae()),S(Ae(this,xe,"f").removeFillGradientColorStop(e,t))}getFillGradientColorStops(e){return pe("id",e,ae()),A(Ae(this,xe,"f").getFillGradientColorStops(e))}setFillGradientColorStops(e,t){pe("id",e,ae()),S(Ae(this,xe,"f").setFillGradientColorStops(e,t))}setFillGradientControlPoint(e,t,r,n){return pe("id",e,ae()),S(Ae(this,xe,"f").setFillGradientControlPoint(e,t,r,n))}getFillGradientControlPointX(e,t){return pe("id",e,ae()),S(Ae(this,xe,"f").getFillGradientControlPointX(e,t))}getFillGradientControlPointY(e,t){return pe("id",e,ae()),S(Ae(this,xe,"f").getFillGradientControlPointY(e,t))}setFillGradientRadius(e,t){return pe("id",e,ae()),pe("radius",t,se()),S(Ae(this,xe,"f").setFillGradientRadius(e,t))}getFillGradientRadius(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getFillGradientRadius(e))}setPlaceholderEnabled(e,t){pe("id",e,ae()),pe("enabled",t,ie()),S(Ae(this,xe,"f").setPlaceholderEnabled(e,t))}isPlaceholderEnabled(e){return pe("id",e,ae()),S(Ae(this,xe,"f").isPlaceholderEnabled(e))}showsPlaceholderContent(e){return pe("id",e,ae()),S(Ae(this,xe,"f").showsPlaceholderContent(e))}hasPlaceholderControls(e){return pe("id",e,ae()),S(Ae(this,xe,"f").hasPlaceholderControls(e))}setPlaceholderControlsOverlayEnabled(e,t){return pe("id",e,ae()),pe("enabled",t,ie()),S(Ae(this,xe,"f").setPlaceholderControlsOverlayEnabled(e,t))}isPlaceholderControlsOverlayEnabled(e){return pe("id",e,ae()),S(Ae(this,xe,"f").isPlaceholderControlsOverlayEnabled(e))}setPlaceholderControlsButtonEnabled(e,t){return pe("id",e,ae()),pe("enabled",t,ie()),S(Ae(this,xe,"f").setPlaceholderControlsButtonEnabled(e,t))}isPlaceholderControlsButtonEnabled(e){return pe("id",e,ae()),S(Ae(this,xe,"f").isPlaceholderControlsButtonEnabled(e))}setMetadata(e,t,r){pe("id",e,ae()),pe("key",t,ce()),pe("value",r,ce()),S(Ae(this,xe,"f").setMetadata(e,t,r))}getMetadata(e,t){return pe("id",e,ae()),pe("key",t,ce()),S(Ae(this,xe,"f").getMetadata(e,t))}hasMetadata(e,t){return pe("id",e,ae()),pe("key",t,ce()),S(Ae(this,xe,"f").hasMetadata(e,t))}findAllMetadata(e){return pe("id",e,ae()),A(S(Ae(this,xe,"f").findAllMetadata(e)))}removeMetadata(e,t){pe("id",e,ae()),pe("key",t,ce()),S(Ae(this,xe,"f").removeMetadata(e,t))}setScopeEnabled(e,t,r){pe("id",e,ae()),pe("key",t,ce()),pe("enabled",r,ie()),S(Ae(this,xe,"f").setScopeEnabled(e,t,r))}isScopeEnabled(e,t){return pe("id",e,ae()),pe("key",t,ce()),S(Ae(this,xe,"f").isScopeEnabled(e,t))}isAllowedByScope(e,t){return pe("id",e,ae()),pe("key",t,ce()),S(Ae(this,xe,"f").isAllowedByScope(e,t))}hasDuration(e){return pe("id",e,ae()),S(Ae(this,xe,"f").hasDuration(e))}setDuration(e,t){return pe("id",e,ae()),pe("duration",t,se()),S(Ae(this,xe,"f").setDuration(e,t))}getDuration(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getDuration(e))}hasTimeOffset(e){return pe("id",e,ae()),S(Ae(this,xe,"f").hasTimeOffset(e))}setTimeOffset(e,t){return pe("id",e,ae()),pe("offset",t,se()),S(Ae(this,xe,"f").setTimeOffset(e,t))}getTimeOffset(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getTimeOffset(e))}hasTrim(e){return pe("id",e,ae()),S(Ae(this,xe,"f").hasTrim(e))}setTrimOffset(e,t){return pe("id",e,ae()),pe("offset",t,se()),S(Ae(this,xe,"f").setTrimOffset(e,t))}getTrimOffset(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getTrimOffset(e))}setTrimLength(e,t){return pe("id",e,ae()),pe("length",t,se()),S(Ae(this,xe,"f").setTrimLength(e,t))}getTrimLength(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getTrimLength(e))}getTotalSceneDuration(e){return pe("scene",e,ae()),S(Ae(this,xe,"f").getTotalSceneDuration(e))}setPlaying(e,t){return pe("id",e,ae()),pe("enabled",t,ie()),S(Ae(this,xe,"f").setPlaying(e,t))}isPlaying(e){return pe("id",e,ae()),S(Ae(this,xe,"f").isPlaying(e))}hasPlaybackTime(e){return pe("id",e,ae()),S(Ae(this,xe,"f").hasPlaybackTime(e))}setPlaybackTime(e,t){return pe("id",e,ae()),pe("time",t,se()),S(Ae(this,xe,"f").setPlaybackTime(e,t))}getPlaybackTime(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getPlaybackTime(e))}setSoloPlaybackEnabled(e,t){return pe("id",e,ae()),pe("enabled",t,ie()),S(Ae(this,xe,"f").setSoloPlaybackEnabled(e,t))}isSoloPlaybackEnabled(e){return pe("id",e,ae()),S(Ae(this,xe,"f").isSoloPlaybackEnabled(e))}hasPlaybackControl(e){return pe("id",e,ae()),S(Ae(this,xe,"f").hasPlaybackControl(e))}setLooping(e,t){pe("id",e,ae()),pe("looping",t,ie()),S(Ae(this,xe,"f").setLooping(e,t))}isLooping(e){return pe("id",e,ae()),S(Ae(this,xe,"f").isLooping(e))}setMuted(e,t){pe("id",e,ae()),pe("muted",t,ie()),S(Ae(this,xe,"f").setMuted(e,t))}isMuted(e){return pe("id",e,ae()),S(Ae(this,xe,"f").isMuted(e))}setVolume(e,t){pe("id",e,ae()),pe("volume",t,se()),S(Ae(this,xe,"f").setVolume(e,t))}getVolume(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getVolume(e))}async forceLoadAVResource(e){return pe("id",e,ae()),C((t=>Ae(this,xe,"f").forceLoadAVResource(e,t)))}getAVResourceTotalDuration(e){return pe("id",e,ae()),S(Ae(this,xe,"f").getAVResourceTotalDuration(e))}async getVideoFillThumbnail(e,t){return pe("id",e,ae()),pe("thumbnailHeight",t,ae()),new Promise(((r,n)=>{Ae(this,xe,"f").getVideoFillThumbnail(e,t,(e=>{"error"in e?n(e.error):r(new _e([e],{type:"image/jpeg"}))}))}))}async getVideoFillThumbnailAtlas(e,t,r,n){return pe("id",e,ae()),pe("numberOfColumns",t,ae()),pe("numberOfRows",r,ae()),pe("thumbnailHeight",n,ae()),new Promise(((o,i)=>{Ae(this,xe,"f").getVideoFillThumbnailAtlas(e,t,r,n,(e=>{"error"in e?i(e.error):o(new _e([e],{type:"image/jpeg"}))}))}))}async getPageThumbnailAtlas(e,t,r,n){return pe("id",e,ae()),pe("numberOfColumns",t,ae()),pe("numberOfRows",r,ae()),new Promise(((o,i)=>{Ae(this,xe,"f").getPageThumbnailAtlas(e,t,r,n,(e=>{"error"in e?i(e.error):o(new _e([e],{type:"image/jpeg"}))}))}))}}xe=new WeakMap,ke=new WeakMap,Se=new WeakMap;var Te,Fe=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},Be=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)},De=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 Le{constructor(e){Te.set(this,void 0),Object.defineProperty(this,"subscribe",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>{pe("blocks",e,oe());const r=De(this,Te,"f").subscribe(e,(e=>{try{t(A(e,!0))}catch(e){console.error(e)}}));return()=>{De(this,Te,"f").isDeleted()||S(De(this,Te,"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,Te,e,"f")}}Te=new WeakMap;var Re,Me,Oe=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},Ie=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 je{constructor(e){Re.set(this,void 0),Me.set(this,void 0),Object.defineProperty(this,"onZoomLevelChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=Ie(this,Re,"f").subscribeToZoomLevel(e);return()=>{Ie(this,Re,"f").isDeleted()||S(Ie(this,Re,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onActiveChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=Ie(this,Re,"f").subscribeToActiveSceneChange(e);return()=>{Ie(this,Re,"f").isDeleted()||S(Ie(this,Re,"f").unsubscribe(t))}}}),Oe(this,Re,e,"f"),Oe(this,Me,new k(e),"f")}async loadFromString(e){return pe("sceneContent",e,ce()),C((t=>Ie(this,Re,"f").loadSceneFromString(e,t)))}async loadFromURL(e){return pe("url",e,ce()),C((t=>Ie(this,Re,"f").loadSceneFromURL(e,t)))}async saveToString(){const e=this.get();if(null==e)throw new Error("No scene available.");return C((t=>{Ie(this,Re,"f").saveSceneToString(e,t)}))}async saveToArchive(){return new Promise(((e,t)=>{const r=this.get();null==r?t(new Error("No scene available.")):Ie(this,Re,"f").saveSceneToArchive(r,(r=>{"error"in r?t(r.error):e(new _e([r],{type:Ee.Zip}))}))}))}create(e="Free"){return pe("sceneLayout",e,ge()),S(Ie(this,Re,"f").createScene(e))}createVideo(){return S(Ie(this,Re,"f").createVideoScene())}createFromImage(e,t=300,r=1,n="Free",o=0,i=!1){return pe("url",e,ce()),pe("dpi",t,fe(se(),0)),pe("pixelScaleFactor",r,fe(se(),0)),pe("sceneLayout",n,ge()),C((a=>Ie(this,Re,"f").createSceneFromImage(e,t,r,n,o,i,a)))}createFromVideo(e){return pe("url",e,ce()),C((t=>Ie(this,Re,"f").createSceneFromVideo(e,t)))}get(){const e=S(Ie(this,Re,"f").findByType(v.Scene)),t=A(e);return t.length>0?t[0]:null}async applyTemplateFromString(e){return pe("content",e,ce()),C((t=>Ie(this,Re,"f").applyTemplateFromString(e,t)))}async applyTemplateFromURL(e){return pe("url",e,ce()),C((t=>Ie(this,Re,"f").applyTemplateFromURL(e,t)))}getMode(){const e=this.get();return S(Ie(this,Re,"f").getSceneMode(e))}setDesignUnit(e){pe("designUnit",e,function(){const e=["Pixel","Millimeter","Inch"];return ne("DesignUnit",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}());const t=this.get();S(Ie(this,Re,"f").setDesignUnit(t,e))}getDesignUnit(){const e=this.get();return S(Ie(this,Re,"f").getDesignUnit(e))}getPages(){return A(S(Ie(this,Re,"f").getPages()))}setZoomLevel(e=1){const t=this.get();pe("zoomLevel",e,fe(se(),0)),Ie(this,Re,"f").setZoomLevel(t,e)}getZoomLevel(){const e=this.get();return S(Ie(this,Re,"f").getZoomLevel(e))}async zoomToBlock(e,t=0,r=0,n=0,o=0){return pe("id",e,ae()),C((i=>Ie(this,Re,"f").zoomToBlock(e,t,r,n,o,i)))}enableZoomAutoFit(e,t,r=0,n=0,o=0,i=0){return pe("id",e,ae()),pe("axis",t,function(){const e=["Horizontal","Vertical","Both"];return ne("ZoomAutoFitAxis",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}()),"Horizontal"===t?(pe("paddingBefore",r,se()),pe("paddingAfter",n,se()),S(Ie(this,Re,"f").enableZoomAutoFit(e,t,r,0,n,0))):"Vertical"===t?(pe("paddingBefore",r,se()),pe("paddingAfter",n,se()),S(Ie(this,Re,"f").enableZoomAutoFit(e,t,0,r,0,n))):(pe("paddingLeft",r,se()),pe("paddingTop",n,se()),pe("paddingRight",o,se()),pe("paddingBottom",i,se()),S(Ie(this,Re,"f").enableZoomAutoFit(e,t,r,n,o,i)))}disableZoomAutoFit(e){return pe("blockOrScene",e,ae()),S(Ie(this,Re,"f").disableZoomAutoFit(e))}isZoomAutoFitEnabled(e){return pe("blockOrScene",e,ae()),S(Ie(this,Re,"f").isZoomAutoFitEnabled(e))}}function Ue(e,t){const r=new Set;function n(n){return r.add(n),null==e||e(((e,...t)=>{n(e);for(const e of t)n(e)})),()=>{r.delete(n),null==t||t()}}return n.emit=function(e,...t){for(const n of r){n(e);for(const e of t)n(e)}},n.handlers=r,n}Re=new WeakMap,Me=new WeakMap;const qe=e=>t=>r=>t((t=>{r(e(t))}));function Ne(e){return t=>r=>{let n=!1;const o=t((e=>{n=!0,r(e)}));return n||r(e instanceof Function?e():e),o}}const ze=(e=((e,t)=>e===t))=>t=>r=>{let n;return t((t=>{e(t,n)||(n=t,r(t))}))},He=e=>{const t=new Set;let r=null;return n=>(t.add(n),null===r&&(r=e((e=>{t.forEach((t=>t(e)))}))),()=>{t.delete(n),0===t.size&&(null==r||r(),r=null)})};function We(e,...t){return t.reduce(((e,t)=>t(e)),e)}const Ve=(...e)=>{const t=Array.from(e);return e=>{const r=t.map((t=>t(e)));return()=>{for(const e of r)e()}}};function Ge(e){return t=>{let r=null;const n=e((e=>{null==r||r(),r=e?e(t):e}));return()=>{n(),null==r||r(),r=null}}}function $e(...e){const t=Array.from(e);return e=>{const r=new Array(t.length),n=t.map(((t,n)=>t((t=>{r[n]=t,e(r)}))));return()=>{n.forEach((e=>e())),r.length=0}}}const Ye=Symbol("NO_VALUE");function Xe(e){let t=Ye;const r=()=>(t===Ye&&(t=e()),t),n=Ue();return{subscribe:n,value:r,update(e){t=e instanceof Function?e(r()):e,n.emit(t)}}}var Ke;!function(e){e.Scene="ubq/designblocks/SceneProps",e.Camera="ubq/designblocks/Camera",e.Common="ubq/designblocks/CommonDesignBlockProps",e.Page="ubq/designblocks/Page",e.Image="ubq/designblocks/Image",e.Video="ubq/designblocks/Video",e.Audio="ubq/designblocks/Audio",e.Sticker="ubq/designblocks/Sticker",e.Text="ubq/designblocks/Text",e.Crop="ubq/types/Crop",e.Scale="ubq/scene/Scale",e.Opacity="ubq/types/Opacity",e.FillColor="ubq/types/FillColor",e.Fill="ubq/designblocks/Fill",e.BackgroundColor="ubq/types/BackgroundColor",e.DropShadow="ubq/types/DropShadow",e.Stroke="ubq/types/Stroke",e.Group="ubq/designblocks/Group",e.VectorPath="ubq/designblocks/VectorPath",e.PendingState="ubq/designblocks/PendingState",e.ErrorState="ubq/designblocks/ErrorState",e.DesignBlockFrame="ubq/designblocks/DesignBlockFrame",e.Size="ubq/layout/Size",e.Position="ubq/layout/Position",e.EulerRotation="ubq/scene/EulerRotation",e.Children="ubq/scene/Children"}(Ke||(Ke={}));const Qe=Ke;var Ze=r(4846),Je=r.n(Ze);function et(e,t,r){return We((n=>{const o=Je()(r.subscribe([e],(r=>{!r.some((e=>"Destroyed"===e.type))||t.isValid(e)?n(r):o()})));return o}),He)}const tt=function(e,t,r,n){const o=function(e,t){if(!t)return e;let r;return(...n)=>{const o=e(...n);return t(o,r)||(r=o),r}}(t,null==n?void 0:n.equals),i=Ue();return{subscribe:We(Ve(e,i),qe(o),ze(),He),update:r,value:o,flush:()=>i.emit()}};var rt,nt=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 ot{constructor({scene:e,block:t,event:r},n){Object.defineProperty(this,"settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clampCamera",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"clampResult",{enumerable:!0,configurable:!0,writable:!0,value:Xe((()=>({sceneSize:{x:0,y:0},scrollPercentage:{x:NaN,y:NaN}})))}),Object.defineProperty(this,"zoomLevel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),rt.set(this,void 0),Object.defineProperty(this,"viewportPadding",{enumerable:!0,configurable:!0,writable:!0,value:Xe((()=>({x:40,y:48})))}),Object.defineProperty(this,"autoFit",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scrollPercentage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sceneSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scroll",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const o=We(e.onActiveChanged,Ne(),qe((()=>e.get()))),i=We(o,qe((e=>null!=e&&t.isValid(e)?We(et(e,t,r),Ne([]),qe((()=>t.getFloat(e,"scene/dpi")))):()=>()=>{})),Ge),a=We(o,qe((()=>{const e=t.findByType(v.Camera)[0];return null==e?()=>()=>{}:We(et(e,t,r),Ne([]),qe((()=>e)))})),Ge);this.settings={subscribe:We(a,qe((e=>({width:t.getFloat(e,"camera/resolution/width"),height:t.getFloat(e,"camera/resolution/height"),pixelRatio:t.getFloat(e,"camera/pixelRatio")}))),ze(g()),He),update({width:e,height:r,pixelRatio:n}){const o=t.findByType(v.Camera)[0];null!=o&&(t.setFloat(o,"camera/resolution/width",e),t.setFloat(o,"camera/resolution/height",r),t.setFloat(o,"camera/pixelRatio",n))},value(){const e=t.findByType(v.Camera)[0];return null==e?{width:0,height:0,pixelRatio:1}:{width:t.getFloat(e,"camera/resolution/width"),height:t.getFloat(e,"camera/resolution/height"),pixelRatio:t.getFloat(e,"camera/pixelRatio")}}},this.zoomLevel=tt(Ve(e.onZoomLevelChanged,i),(()=>{const r=e.get();return null!=r&&t.isValid(r)?e.getZoomLevel():1}),(r=>{const n=e.get();null!=n&&t.isValid(n)&&e.setZoomLevel(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,rt,{subscribe:We(a,qe((e=>new k(n).getValue(e,Qe.Camera,"zoomLevel"))),ze()),value(){const e=t.findByType(v.Camera)[0];return null==e?1:new k(n).getValue(e,Qe.Camera,"zoomLevel")}},"f"),this.autoFit=tt(e.onZoomLevelChanged,(()=>{const t=e.get();return null!=t&&e.isZoomAutoFitEnabled(t)})),this.scrollPercentage={subscribe:We(this.clampResult.subscribe,qe((e=>e.scrollPercentage)),ze(g())),value:()=>this.clampResult.value().scrollPercentage},this.sceneSize={subscribe:We($e(this.clampResult.subscribe,nt(this,rt,"f").subscribe,this.settings.subscribe),qe((([e,t,r])=>{var n,o,i,a,s;const u=null!==(o=null!==(n=null==e?void 0:e.sceneSize)&&void 0!==n?n:this.clampResult.value().sceneSize)&&void 0!==o?o:{x:0,y:0},c=null!==(i=null!=t?t:nt(this,rt,"f").value())&&void 0!==i?i:10,l=null!==(s=null!==(a=null==r?void 0:r.pixelRatio)&&void 0!==a?a:this.settings.value().pixelRatio)&&void 0!==s?s:1;return{x:u.x*c/l,y:u.y*c/l}})),ze(g())),value:()=>{var e,t,r;const n=null!==(e=this.clampResult.value().sceneSize)&&void 0!==e?e:{x:0,y:0},o=null!==(t=nt(this,rt,"f").value())&&void 0!==t?t:10,i=null!==(r=this.settings.value().pixelRatio)&&void 0!==r?r:1;return{x:n.x*o/i,y:n.y*o/i}}},this.scroll=e=>{const r=t.findByType(v.Camera)[0];if(null==r)return;const n=nt(this,rt,"f").value(),o=this.settings.value().pixelRatio,i=e.x*o/n,a=e.y*o/n,s={x:t.getPositionX(r)+i,y:t.getPositionY(r)+a};t.setPositionX(r,s.x),t.setPositionY(r,s.y)}}zoom(e,t=1){const r=Math.exp(.01*e*t),n=this.zoomLevel.value();this.zoomLevel.update(n*r)}}function it(e,t,r){const n=e=>{S(t.setContext("")),e.preventDefault()},o=e=>{S(t.setContext("!canvas")),r&&r(),e.preventDefault()};return e.addEventListener("webglcontextlost",n,!1),e.addEventListener("webglcontextrestored",o,!1),()=>{e.removeEventListener("webglcontextlost",n),e.removeEventListener("webglcontextrestored",o)}}rt=new WeakMap;var at=r(2003),st=r.n(at);const ut=r.p+"assets/core/cesdk-v1.11.0-preview.2.data",ct=r.p+"assets/core/cesdk-v1.11.0-preview.2.wasm",lt=st();let ft;const dt=(e,t)=>null!=t?[t,e.split("/").pop()].join(""):new URL(e,window.location.origin);function ht(e,t){const{core:r}=t,n=null!==(a=null===(i=null==(o=t)?void 0:o.callbacks)||void 0===i?void 0:i.log)&&void 0!==a?a:N;var o,i,a;const s=dt(ct,r.baseURL).toString(),u=dt(ut,r.baseURL).toString();return new Promise(((r,o)=>{lt({instantiateWasm:(e,t)=>{const r=e;return(ft?Promise.resolve(ft):fetch(s,{credentials:"same-origin"}).then((e=>void 0===WebAssembly.compileStreaming?e.arrayBuffer().then((e=>WebAssembly.compile(e))):WebAssembly.compileStreaming(e))).then((e=>(function(e,t){const r=WebAssembly.Module.customSections(e,"CESDK")[0];if(!r)throw new Error(`Couldn't validate WASM module version. Please make sure that config.baseURL points to a location that holds the matching assets. Expected version 1.11.0-preview.2, but found a WASM module without version information at ${t}`);const n=new TextDecoder("utf-8").decode(r).trim();if("1.11.0-preview.2"!==n)throw new Error(`Couldn't validate WASM module version. Please make sure that config.baseURL points to a location that holds the matching assets. Expected version 1.11.0-preview.2, but found WASM module for version ${n} at ${t}`)}(e,s),ft=e,e)))).then((e=>WebAssembly.instantiate(e,r))).catch((e=>{throw new Error(`Couldn't load WASM module. Please make sure that config.baseURL points to a location that holds the matching assets. Expected version 1.11.0-preview.2 at ${s}, but encountered the following error: ${e.message}`)})).then(t).catch(o),{}},locateFile:(e,t)=>e.endsWith(".wasm")?s:e.endsWith(".data")?u:t+e,print:e=>{e&&"undefined"!==e&&n(e,O.Info)},printErr:e=>{e&&"undefined"!==e&&n(e,O.Error)},onRuntimeInitialized:()=>{n("Engine has been initialized.",O.Info)},logReadFiles:!1,printWithColors:!0}).then((async n=>{var o;n.specialHTMLTargets["!canvas"]=e,n.emscripten_ubq_settings_forceWebGL1=!!(null==t?void 0:t.forceWebGL1);const i=S(n.createEngine("!canvas",null!==(o=t.audioOutput)&&void 0!==o?o:"auto"));!function(e,t){var r;const n=new k(e),o=new we(e),i=new M(e);o.setSettingString("license",t.license||""),o.setSettingEnum("role","Creator"),o.setSettingString("basePath",t.baseURL),o.setSettingBool("showBuildVersion",!1),(null===(r=t.featureFlags)||void 0===r?void 0:r.preventScrolling)&&(o.setSettingBool("touch/singlePointPanning",!1),o.setSettingBool("touch/dragStartCanSelect",!1)),i.addLocalSource("ly.img.text"),Object.entries(t.presets.typefaces||{}).forEach((([e,t])=>{(t.fonts||[]).forEach((r=>{const o=`${e}_${r.weight}_${r.style}`;n.execute("ubq/assets/registerFont",[o,r.fontURL,t.family,r.weight,r.style])}))})),function(){var e;const r=!!(null===(e=t.featureFlags)||void 0===e?void 0:e.singlePageMode);o.setSettingBool("features/singlePageModeEnabled",r),o.setSettingBool("trackActivePage",!r),o.setSettingBool("features/effectsEnabled",!0)}(),function(){var e;const r=null!==(e=t.extensions)&&void 0!==e?e:[];r.entries.forEach((e=>{n.execute("ubq/extension/register",`${r.baseURL+e}`)}))}(),function(){var r;const n=null!==(r=t.variables)&&void 0!==r?r:{};Object.entries(n).forEach((([t,r])=>{S(e.setVariableString(t,r.value.toString()))}))}()}(i,t),r(i)})).catch(o)}))}const pt=!("undefined"==typeof window||!window.document||!window.document.createElement)&&navigator&&navigator.userAgent||"",mt=-1!==pt.indexOf("Edge"),gt=!!pt.match(/msie|trident/i);function vt(e,t){let r;return t.onStateChanged((()=>{const n=function(e,t){switch(e){case"Arrow":return"default";case"Move":return"move";case"MoveNotPermitted":return"auto";case"Resize":{const e=180*t/Math.PI+45;if(!gt&&!mt)return`url("data:image/svg+xml,%3Csvg style='transform: rotate(${e}deg)' width ='22' height ='22' viewBox ='0 0 22 22' fill ='none' xmlns ='http://www.w3.org/2000/svg'%3E%3Cg filter ='url(%23filter0_d)'%3E%3Cpath d ='M13.7 11.1L9.7 15.2L12.5 18H4V9.5L6.9 12.3L10.9 8.3L12.3 6.9L9.5 4H18V12.5L15.2 9.7L13.7 11.1Z' fill ='white'/%3E%3C/g%3E%3Cpath d ='M12.7 10.7L8.3 15.2L10.1 17H5V11.9L6.9 13.8L11.3 9.3L13.8 6.9L11.9 5H17V10.1L15.2 8.3L12.7 10.7Z' fill ='black'/%3E%3Cdefs%3E%3Cfilter id ='filter0_d' x ='0' y ='0' width ='22' height ='22' filterUnits ='userSpaceOnUse' color-interpolation-filters ='sRGB'%3E%3CfeFlood flood-opacity ='0' result ='BackgroundImageFix'/%3E%3CfeColorMatrix in ='SourceAlpha' type ='matrix' values ='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0'/%3E%3CfeOffset/%3E%3CfeGaussianBlur stdDeviation ='2'/%3E%3CfeColorMatrix type ='matrix' values ='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0'/%3E%3CfeBlend mode ='normal' in2 ='BackgroundImageFix' result ='effect1_dropShadow'/%3E%3CfeBlend mode ='normal' in ='SourceGraphic' in2 ='effect1_dropShadow' result ='shape'/%3E%3C/filter%3E%3C/defs%3E%3C/svg%3E") 12 12, pointer`;switch(e){case 90:case 270:return"nwse-resize";case 135:case 315:return"ns-resize";case 180:case 360:return"nesw-resize";case 225:return"ew-resize";default:return"move"}}case"Rotate":return'url("data:image/svg+xml,%3Csvg width=%2722%27 height=%2725%27 viewBox=%270 0 22 25%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cg filter=%27url(%23filter0_d)%27%3E%3Cpath d=%27M18 11.1071C18 14.5637 15.5566 17.4515 12.3314 18.0846V20L7.20308 17.0145L12.3314 14.0289V15.7825C14.3292 15.1951 15.7946 13.3221 15.7946 11.107C15.7946 8.42285 13.6437 6.23908 11 6.23908C8.35629 6.23908 6.20542 8.42285 6.20542 11.107C6.20542 11.8299 6.35745 12.5252 6.65738 13.1736L4.66118 14.1255C4.22245 13.1771 4 12.1616 4 11.1071C4.00007 7.18825 7.1403 4 11.0001 4C14.8599 4 18 7.18825 18 11.1071Z%27 fill=%27black%27/%3E%3Cpath d=%27M12.8314 15.0559V14.0289V13.1593L12.0799 13.5968L6.95152 16.5824L6.20927 17.0145L6.95152 17.4466L12.0799 20.4321L12.8314 20.8696V20V18.4841C16.0889 17.6521 18.5 14.6573 18.5 11.1071C18.5 6.9193 15.1431 3.5 11.0001 3.5C6.85702 3.5 3.50008 6.91929 3.5 11.1071V11.1071C3.5 12.2334 3.73793 13.3206 4.20739 14.3354L4.41978 14.7946L4.8764 14.5768L6.8726 13.6249L7.31866 13.4122L7.11118 12.9637C6.84206 12.3819 6.70542 11.7584 6.70542 11.107C6.70542 8.69181 8.63956 6.73908 11 6.73908C13.3604 6.73908 15.2946 8.69181 15.2946 11.107C15.2946 12.8513 14.2837 14.3564 12.8314 15.0559Z%27 stroke=%27white%27/%3E%3C/g%3E%3Cdefs%3E%3Cfilter id=%27filter0_d%27 x=%270.0599999%27 y=%270.0599999%27 width=%2721.88%27 height=%2724.6193%27 filterUnits=%27userSpaceOnUse%27 color-interpolation-filters=%27sRGB%27%3E%3CfeFlood flood-opacity=%270%27 result=%27BackgroundImageFix%27/%3E%3CfeColorMatrix in=%27SourceAlpha%27 type=%27matrix%27 values=%270 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0%27/%3E%3CfeOffset/%3E%3CfeGaussianBlur stdDeviation=%271.47%27/%3E%3CfeColorMatrix type=%27matrix%27 values=%270 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0%27/%3E%3CfeBlend mode=%27normal%27 in2=%27BackgroundImageFix%27 result=%27effect1_dropShadow%27/%3E%3CfeBlend mode=%27normal%27 in=%27SourceGraphic%27 in2=%27effect1_dropShadow%27 result=%27shape%27/%3E%3C/filter%3E%3C/defs%3E%3C/svg%3E") 12 12, pointer';case"Text":return"text";default:return"auto"}}(t.getCursorType(),t.getCursorRotation());if(n!==r){r=n;const t=new CustomEvent("cesdk-cursor",{composed:!0,bubbles:!0,cancelable:!0,detail:n});e.dispatchEvent(t)&&e.style.setProperty("cursor",n)}}))}const yt=function(e,t,r){let n,o=null;const i=r.onStateChanged((()=>{n=r.getEditMode(),"Text"!==n||o?"Text"!==n&&o&&(o(),o=null):o=function(){let n=function o(){let i=!1,a="";if(null==e.parentElement)return console.warn('Could not attach hidden text input to the DOM: Canvas has no parentElement. This can happen if edit mode is switched to "Text", while the canvas is removed from the DOM.'),()=>{};const u=function(){const e=document.createElement("textarea");return e.id="ubq_internal-inline_text_editing_html_representation",e.setAttribute("data-cy","inline-text-editing-input"),e.autocapitalize="none",e.spellcheck=!1,e.cols=4096,e.style.contain="strict",e.style.opacity="0",e.style.pointerEvents="none",e.style.zIndex="-1",e.style.position="fixed",e.style.width="1px",e.style.height="1px",e.style.padding="0",e.style.margin="-1px",e.style.overflow="hidden",e.style.clip="rect(0, 0, 0, 0)",e.style.border="0",e}();l();const c=function(){const t=e.getRootNode();u.addEventListener("input",y),u.addEventListener("keydown",w),u.addEventListener("copy",m),u.addEventListener("cut",g),u.addEventListener("compositionstart",E),u.addEventListener("compositionend",_),u.addEventListener("beforeinput",A),u.addEventListener("focusout",P),t.addEventListener("touchend",C),t.addEventListener("mousedown",C),t.addEventListener("mouseup",k);const n=r.onStateChanged((()=>{l()}));return()=>{u.removeEventListener("input",y),u.removeEventListener("keydown",w),u.removeEventListener("copy",m),u.removeEventListener("cut",g),u.removeEventListener("compositionstart",E),u.removeEventListener("compositionend",_),u.removeEventListener("beforeinput",A),u.removeEventListener("focusout",P),t.removeEventListener("mousedown",C),t.removeEventListener("mouseup",k),t.removeEventListener("touchend",C),n()}}();return e.parentElement.appendChild(u),f(),()=>{c(),u.blur(),u.remove()};function l(){const t=r.getTextCursorPositionInScreenSpaceX(),n=r.getTextCursorPositionInScreenSpaceY(),{left:o,top:i}=e.getBoundingClientRect();u.style.left=`${o+t/window.devicePixelRatio}px`,u.style.top=`${i+n/window.devicePixelRatio}px`}function f(){null!==u.parentElement&&(u.focus(),u.getRootNode().activeElement===u||setTimeout((()=>u.focus()),0))}function d(){i=!1,n(),n=o()}function h(e){return[...e].length}function p(e){var t,r;const n=null!==(r=null!==(t=e.selectionEnd)&&void 0!==t?t:e.selectionStart)&&void 0!==r?r:0;return h(e.value.substring(0,n))}function m(e){try{t.useInternalAPI((t=>{const r=S(t.getSelectedText());""!==r&&e.clipboardData&&(e.clipboardData.setData("text/plain",r),e.preventDefault())}))}catch(e){console.error(e)}}function g(e){try{t.useInternalAPI((r=>{const n=S(r.getSelectedText());if(""!==n&&e.clipboardData){e.clipboardData.setData("text/plain",n),e.preventDefault();const r={key:s.Delete,characters:"",shiftIsHeld:!1,commandIsHeld:!1,optionIsHeld:!1,timestamp:Date.now()};t.execute("ubq/inputs/keyboardkey",r)}}))}catch(e){console.error(e)}}async function v(){return!(!i||t.ubq.unstable_isTextCursorInCompositionRange()||(await _(),0))}function y(e){const r=e.target,{value:n}=r;if(i){const e=p(u);t.execute("ubq/text/compositionUpdate",{value:n,cursorPosition:e})}else n.length>0&&(r.value="")}function b(e){const r={key:s.Unknown,characters:e,shiftIsHeld:!1,commandIsHeld:!1,optionIsHeld:!1,timestamp:Date.now()};t.execute("ubq/inputs/keyboardkey",r)}async function w(e){if(v(),1===e.key.length&&(a=e.key),"a"===e.key&&(e.metaKey||e.ctrlKey))return i&&_(),void await t.execute("ubq/text/selectAllText");if("Escape"===e.key)return void async function(){r.setEditMode("Transform")}();if("Backspace"!==e.key&&"Delete"!==e.key&&"ArrowLeft"!==e.key&&"ArrowRight"!==e.key&&"ArrowUp"!==e.key&&"ArrowDown"!==e.key&&"Enter"!==e.key)return;const n=function(e){const t={key:s.Unknown,characters:e.key,shiftIsHeld:e.shiftKey,commandIsHeld:e.metaKey||e.ctrlKey,optionIsHeld:e.altKey,timestamp:Date.now()};switch(e.key.toUpperCase()){case"0":t.key=s.Key0;break;case"1":t.key=s.Key1;break;case"2":t.key=s.Key2;break;case"3":t.key=s.Key3;break;case"4":t.key=s.Key4;break;case"5":t.key=s.Key5;break;case"6":t.key=s.Key6;break;case"7":t.key=s.Key7;break;case"8":t.key=s.Key8;break;case"9":t.key=s.Key9;break;case"A":t.key=s.A;break;case"B":t.key=s.B;break;case"C":t.key=s.C;break;case"D":t.key=s.D;break;case"E":t.key=s.E;break;case"F":t.key=s.F;break;case"G":t.key=s.G;break;case"H":t.key=s.H;break;case"I":t.key=s.I;break;case"J":t.key=s.J;break;case"K":t.key=s.K;break;case"L":t.key=s.L;break;case"M":t.key=s.M;break;case"N":t.key=s.N;break;case"O":t.key=s.O;break;case"P":t.key=s.P;break;case"Q":t.key=s.Q;break;case"R":t.key=s.R;break;case"S":t.key=s.S;break;case"T":t.key=s.T;break;case"U":t.key=s.U;break;case"V":t.key=s.V;break;case"W":t.key=s.W;break;case"X":t.key=s.X;break;case"Y":t.key=s.Y;break;case"Z":t.key=s.Z;break;case" ":t.key=s.Space;break;case"ESCAPE":t.key=s.Escape,t.characters="";break;case"BACKSPACE":t.key=s.Backspace,t.characters="";break;case"DELETE":t.key=s.Delete,t.characters="";break;case"ENTER":t.key=s.Enter,t.characters="\n";break;case"CONTROL":t.key=s.Control,t.characters="";break;case"ALT":t.key=s.Option,t.characters="";break;case"SHIFT":t.key=s.Shift,t.characters="";break;case"ARROWLEFT":t.key=s.ArrowLeft,t.characters="";break;case"ARROWRIGHT":t.key=s.ArrowRight,t.characters="";break;case"ARROWUP":t.key=s.ArrowUp,t.characters="";break;case"ARROWDOWN":t.key=s.ArrowDown,t.characters="";break;case"DEAD":t.key=s.Unknown,t.characters=""}return t}(e);await t.execute("ubq/inputs/keyboardkey",n),e.currentTarget&&(u.value="")}async function E(){i=!0,await t.execute("ubq/text/compositionStart")}async function _(){i?(i=!1,u.value="",d(),t.execute("ubq/text/compositionEnd")):u.value=""}async function x(){if(!i)return;if(t.ubq.update(),await v())return;const e=t.ubq.unstable_getCursorPosition(),r=t.ubq.unstable_getCompositionRange(),n=e.end-r.start,o=p(u);e.start>=r.start&&e.start<=1+r.end&&n!==o&&_()}async function k(){x()}async function C(t){x(),t.target===e&&"Text"===r.getEditMode()&&(f(),t.preventDefault())}async function A(e){if(i&&!e.isComposing&&_(),null===e.data)return;const r=e.target,n=e.data;if(await v())b(a);else if(i){const e=h(n);t.execute("ubq/text/compositionUpdate",{value:n,cursorPosition:e})}else n.length>0&&("\n"!==n[0]&&b(n),r.value="")}function P(t){var r;null!=(r=t.relatedTarget)&&r instanceof HTMLElement&&(r instanceof HTMLTextAreaElement||r instanceof HTMLInputElement&&r.type.match("^(text|number|url|email|search|tel)$")||r.isContentEditable)&&function(t){const r=new CustomEvent("cesdk-blur",{composed:!0,bubbles:!0,cancelable:!0,detail:t});return e.dispatchEvent(r)}(t.relatedTarget)||function(t){const r=new CustomEvent("cesdk-refocus",{composed:!0,bubbles:!0,cancelable:!0,detail:t.relatedTarget}),n=e.dispatchEvent(r);n&&f()}(t)}}();return()=>{null==n||n()}}()}));return()=>{null==o||o(),i()}};function bt(e,t){const r=[],n=t=>{var r,n;const o=e.getBoundingClientRect(),i=null!==(r=null==o?void 0:o.top)&&void 0!==r?r:0,a=null!==(n=null==o?void 0:o.left)&&void 0!==n?n:0;return{position:{x:(t.clientX-a)*window.devicePixelRatio,y:(t.clientY-i)*window.devicePixelRatio},isOverUIElement:t.target!==e,isTouch:"touch"===t.pointerType,timestamp:t.timeStamp}},o=e=>{const r=n(e);t.execute("ubq/inputs/mousemove",r)},i=e=>{const o=Object.assign(Object.assign({},n(e)),{button:wt(e.button),state:a.Up,shiftIsHeld:!!e.shiftKey});r[e.button]=!1,e.currentTarget.releasePointerCapture(e.pointerId),t.execute("ubq/inputs/mousebutton",o),t.ubq.update()},s=e=>{const o=Object.assign(Object.assign({},n(e)),{button:wt(e.button),state:a.Down,shiftIsHeld:!!e.shiftKey});r[e.button]=!0,e.currentTarget.setPointerCapture(e.pointerId),t.execute("ubq/inputs/mousebutton",o)},u=e=>{const o=Object.assign(Object.assign({},n(e)),{shiftIsHeld:!!e.shiftKey});r.forEach(((e,r)=>{if(e){const e=Object.assign(Object.assign({},o),{button:r,state:a.Up});t.execute("ubq/inputs/mousebutton",e)}})),r.length=0},c=e=>{e.cancelable&&e.preventDefault()};return e.addEventListener("pointerdown",s),e.addEventListener("pointerup",i),e.addEventListener("pointercancel",i),e.addEventListener("pointermove",o),e.addEventListener("lostpointercapture",u),e.addEventListener("touchmove",c,{passive:!1}),()=>{e.removeEventListener("pointerdown",s),e.removeEventListener("pointerup",i),e.removeEventListener("pointercancel",i),e.removeEventListener("pointermove",o),e.removeEventListener("lostpointercapture",u),e.removeEventListener("touchmove",c),e=null}}function wt(e){switch(e){case 0:return i.Left;case 1:return i.Middle;case 2:return i.Right;default:return i.Unknown}}var Et,_t=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 xt{constructor(e){Et.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,Et,e,"f")}findAll(){return A(_t(this,Et,"f").findAllVariables())}setString(e,t){return pe("key",e,ce()),pe("value",t,ce()),S(_t(this,Et,"f").setVariableString(e,t))}getString(e){return pe("key",e,ce()),S(_t(this,Et,"f").getVariableString(e))}remove(e){return pe("key",e,ce()),S(_t(this,Et,"f").removeVariable(e))}}async function kt(e,t,r,n){let o,i=0;function a(){clearTimeout(o)}try{const s=new OffscreenCanvas(64,64),u=await ht(s,Object.assign(Object.assign({},e),{audioOutput:"none"})),c=new je(u),l=new Pe(u);await c.loadFromString(t);const f=l.getTotalSceneDuration(c.get());!function e(){i<10&&u.update(),o=setTimeout(e,1)}();const d=await new Promise(((t,o)=>{var s,c,l,d,h,p,m,g;null===(s=e.abortSignal)||void 0===s||s.addEventListener("abort",(()=>{a(),o(new Error("AbortSignal received"))})),u.exportVideoToBuffer(r.block,null!==(c=r.timeOffset)&&void 0!==c?c:0,null!==(l=r.duration)&&void 0!==l?l:f,Ee.Mp4,((e,t,r)=>{var o;i=e-t,null===(o=null==n?void 0:n.onProgress)||void 0===o||o.call(n,e,t,r)}),(e=>{"error"in e?o(e.error):t(e)}),{h264Profile:null!==(d=r.h264Profile)&&void 0!==d?d:77,h264Level:null!==(h=r.h264Level)&&void 0!==h?h:52,framerate:null!==(p=r.framerate)&&void 0!==p?p:30,useTargetSize:void 0!==r.width&&void 0!==r.height,targetWidth:null!==(m=r.width)&&void 0!==m?m:0,targetHeight:null!==(g=r.height)&&void 0!==g?g:0})}));return a(),d}catch(e){throw a(),e}}Et=new WeakMap;var St,Ct,At,Pt,Tt,Ft,Bt,Dt,Lt,Rt,Mt,Ot,It,jt,Ut,qt,Nt,zt,Ht=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},Wt=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 Vt{constructor(e,t,r){St.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}),Ct.set(this,void 0),At.set(this,void 0),Pt.set(this,void 0),Tt.set(this,void 0),Ft.set(this,void 0),Lt.set(this,[]),Rt.set(this,void 0),jt.set(this,void 0),Ht(this,Ft,e,"f"),Ht(this,At,new k(e),"f"),this.asset=new M(e),this.block=new Pe(e),this.editor=new we(e),this.event=new Le(e),this.scene=new je(e),this.variable=new xt(e),this.block.exportVideo=function(e,t){return async(r,n,o,i)=>{const[a]=t.block.findByType(v.Scene);if(null==a)throw new Error("No scene available.");const s=await t.scene.saveToString();return kt(e,s,Object.assign({block:r,width:i.targetWidth,height:i.targetHeight},i),{onProgress:o}).then((e=>new Blob([e],{type:Ee.Mp4})))}}(r,this),"getInternalCanvas"in t?(Ht(this,Pt,t.getInternalCanvas(),"f"),Ht(this,Tt,t,"f")):Ht(this,Pt,t,"f"),function(e){const t={assets:[],total:0,currentPage:1,nextPage:void 0};return Object.entries(e).map((([e,r])=>{if(!r.findAssets)throw new Error("New asset source needs to define `findAssets` at least");return Object.assign(Object.assign(Object.assign({id:e},Y),r),{findAssets:async e=>await r.findAssets(e)||Promise.resolve(t)})}))}(r.assetSources).forEach((e=>this.asset.addSource(e))),Ht(this,Ct,new ot(this,this._ubq),"f"),Wt(this,At,"f").useInternalAPI((e=>{e.setPreUpdateCallback((()=>{Wt(this,St,"m",Bt).call(this),Wt(this,St,"m",Dt).call(this)}))})),Wt(this,St,"m",Mt).call(this),"undefined"!=typeof window&&window.Cypress&&(this.config=r,this.helper=Wt(this,At,"f"))}wrapUpdate(e){return Wt(this,Lt,"f").push(e),()=>{const t=Wt(this,Lt,"f").indexOf(e);-1!==t&&Wt(this,Lt,"f").splice(t,1)}}get element(){return Wt(this,Tt,"f")}dispose(){var e;Wt(this,St,"m",Ut).call(this),Wt(this,At,"f").useInternalAPI((e=>{e.setPreUpdateCallback(null)})),this.asset.dispose(),Ht(this,Pt,null,"f"),null===(e=Wt(this,Tt,"f"))||void 0===e||e.dispose(),Ht(this,Tt,void 0,"f"),Ht(this,At,null,"f"),this.block=null,this.scene=null,this.variable=null,this.asset=null,this.editor=null,this.event=null,Wt(this,Lt,"f").length=0,Wt(this,Ft,"f").delete(),Ht(this,Ft,null,"f")}static async init(e,t){let r=function(e,t){return r(null==t?void 0:t.canvas)?null==t?void 0:t.canvas:r(e)?(console.warn("Passing an existing HTMLCanvasElement as a second parameter to CreativeEngine.init() is deprecated. Use the element property on the CreativeEngine instance to access a fully managed canvas to append into the DOM instead. For more information, have a look into our documentation at https://img.ly/docs/cesdk/next/engine/quickstart/#initialization."),e):void 0;function r(e){return"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement}}(t,e);let n;var o,i;console.log("[CreativeEngine] Revision 18606a5244a807387f120df84784bd0bc52a4096"),r||(customElements.get("cesdk-canvas")||customElements.define("cesdk-canvas",(i=class extends HTMLElement{constructor(){super(),o.set(this,void 0),Fe(this,o,document.createElement("canvas"),"f");const e=document.createElement("style");e.textContent=":host {display: block; width: 100%; height: 100%; contain: content;} canvas {position: absolute; inset: 0; width: 100%; height:100%; display: block;}",this.attachShadow({mode:"closed"}).append(e,Be(this,o,"f"))}getInternalCanvas(){if(!Be(this,o,"f"))throw new Error("Internal canvas element is undefined");return Be(this,o,"f")}dispose(){var e;null===(e=Be(this,o,"f"))||void 0===e||e.remove(),Fe(this,o,void 0,"f")}clear(){if(!Be(this,o,"f"))return;const e=Be(this,o,"f").width;Be(this,o,"f").width=1,Be(this,o,"f").width=e}},o=new WeakMap,i)),n=document.createElement("cesdk-canvas"),r=n.getInternalCanvas());const a=function(e={},t="https://cdn.img.ly/packages/imgly/cesdk-engine/1.11.0-preview.2/assets"){var r,n,o,i,a,s,u,c,l,f,d,h;const p={license:e.license,featureFlags:null!==(r=e.featureFlags)&&void 0!==r?r:{},baseURL:null!==(n=e.baseURL)&&void 0!==n?n:t,core:null!==(o=e.core)&&void 0!==o?o:Object.assign({},W),extensions:null!==(i=e.extensions)&&void 0!==i?i:Object.assign({},U),callbacks:null!==(a=e.callbacks)&&void 0!==a?a:Object.assign({},z),variables:null!==(s=e.variables)&&void 0!==s?s:Object.assign({},q),presets:null!==(u=e.presets)&&void 0!==u?u:Object.assign({},H),assetSources:j()({},e.assetSources),defaultFont:null!==(c=e.defaultFont)&&void 0!==c?c:void 0};return null!==(l=(d=p.extensions).baseURL)&&void 0!==l||(d.baseURL=U.baseURL),null!==(f=(h=p.extensions).entries)&&void 0!==f||(h.entries=Object.assign({},U.entries)),Object.entries(H).forEach((([e,t])=>{var r;p.presets[e]=null!==(r=p.presets[e])&&void 0!==r?r:Object.assign({},t)})),p.baseURL=V(p.baseURL),p.baseURL=G(p.baseURL),p.core.baseURL=V(p.core.baseURL,p.baseURL),p.core.baseURL=G(p.core.baseURL),p.extensions.baseURL=G(p.extensions.baseURL),p.extensions.entries=p.extensions.entries.map((e=>G(e))),p}(e),s=new this(await ht(r,a),null!=n?n:r,a);return function(e,t,r){var n,o,i,a,s,u,c,l;if(!e)return!1;try{const t=r.editor;e.role&&(t.setSettingEnum("role",e.role),"Adopter"===e.role&&t.setSettingEnum("doubleClickSelectionMode","Direct")),e.scene,e.page&&(null!=(null===(o=null===(n=e.page)||void 0===n?void 0:n.title)||void 0===o?void 0:o.show)&&t.setSettingBool("page/title/show",e.page.title.show),null!=(null===(a=null===(i=e.page)||void 0===i?void 0:i.title)||void 0===a?void 0:a.fontFileUri)&&t.setSettingString("page/title/fontFileUri",null===(u=null===(s=e.page)||void 0===s?void 0:s.title)||void 0===u?void 0:u.fontFileUri),null!=(null===(c=e.page)||void 0===c?void 0:c.dimOutOfPageAreas)&&t.setSettingBool("page/dimOutOfPageAreas",null===(l=e.page)||void 0===l?void 0:l.dimOutOfPageAreas))}catch(e){console.error(e)}}(e,0,s),s}async addDefaultAssetSources({baseURL:e="https://cdn.img.ly/assets/v1",excludeAssetSourceIds:t=[]}={}){return async function(e,t,r,n){const o=["ly.img.sticker","ly.img.vectorpath","ly.img.filter.lut","ly.img.filter.duotone"].filter((e=>!r.includes(e)));await $(o,t,n,e)}(this.asset,e,t)}async addDemoAssetSources({excludeAssetSourceIds:e=[],sceneMode:t="Design",withUploadAssetSources:r=!1}={}){return async function(e,t,r,n,o){const i=new Set(e.findAllSources()),a="ly.img.image.upload";!n||t.includes(a)||i.has(a)||e.addLocalSource(a,["image/jpeg","image/png","image/svg+xml","image/gif","image/bmp"]);const s="ly.img.video.upload";"Video"!==r||!n||t.includes(s)||i.has(s)||e.addLocalSource(s,["video/mp4","video/quicktime"]);const u="ly.img.audio.upload";"Video"!==r||!n||t.includes(u)||i.has(u)||e.addLocalSource(u,["audio/mpeg","audio/x-m4a","audio/m4a","audio/mp3"]);const c=["ly.img.image","ly.img.video","ly.img.audio"].filter((e=>!t.includes(e)));await $(c,"https://cdn.img.ly/assets/demo/v1",o,e)}(this.asset,e,t,r)}get _ubq(){return Wt(this,Ft,"f")}get _camera(){return Wt(this,Ct,"f")}}Ct=new WeakMap,At=new WeakMap,Pt=new WeakMap,Tt=new WeakMap,Ft=new WeakMap,Lt=new WeakMap,Rt=new WeakMap,jt=new WeakMap,St=new WeakSet,Bt=function(){if(!Wt(this,Tt,"f"))return;const e=Wt(this,Tt,"f").getInternalCanvas(),t=e.getBoundingClientRect();if(0===t.width||0===t.height)return;const r="undefined"!=typeof window?window.devicePixelRatio:1,n=t.width*r,o=t.height*r;e.width!==n&&(e.width=n),e.height!==o&&(e.height=o)},Dt=function(){const{width:e,height:t}=Wt(this,Pt,"f"),r="undefined"!=typeof window?window.devicePixelRatio:1,{height:n,width:o,pixelRatio:i}=Wt(this,Ct,"f").settings.value();x(o,e,1e-4)&&x(n,t,1e-4)&&x(i,r,1e-4)||Wt(this,Ct,"f").settings.update({height:t,width:e,pixelRatio:window.devicePixelRatio})},Mt=function(e=!0){Wt(this,St,"m",Ot).call(this,e),Wt(this,St,"m",It).call(this)},Ot=function(e=!0){if(Wt(this,Rt,"f"))return;const t=()=>{Wt(this,Lt,"f").reduceRight(((e,t)=>function(){let r=!1;if(t((function(){r=!0,e()})),!r)throw new Error(`Wrapper did not call update: ${t.toString()}`)}),(()=>Wt(this,St,"m",qt).call(this,e)))(),Ht(this,Rt,requestAnimationFrame(t),"f")};Ht(this,Rt,requestAnimationFrame(t),"f")},It=function(){var e,t;if(t=Wt(this,Pt,"f"),!("undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement))return;const r=null!==(e=Wt(this,Tt,"f"))&&void 0!==e?e:Wt(this,Pt,"f"),n=[bt(r,Wt(this,At,"f")),yt(r,Wt(this,At,"f"),this.editor),vt(r,this.editor),it(Wt(this,Pt,"f"),Wt(this,Ft,"f"),(()=>{Wt(this,Pt,"f").width=Wt(this,Pt,"f").width}))];Ht(this,jt,(()=>{n.reverse().forEach((e=>e()))}),"f")},Ut=function(){var e;null===(e=Wt(this,jt,"f"))||void 0===e||e.call(this),Ht(this,jt,void 0,"f"),Wt(this,Rt,"f")&&(cancelAnimationFrame(Wt(this,Rt,"f")),Ht(this,Rt,0,"f"))},qt=function(e=!0){e&&1===this.block.findByType(v.Scene).length&&Wt(this,St,"m",Nt).call(this),Wt(this,Ft,"f").update()},Nt=function(){Wt(this,Ct,"f").clampCamera?Wt(this,At,"f").execute("cesdk/clampCameraAndRender",[{horizontalPaddingInPixels:this._camera.viewportPadding.value().x,verticalPaddingInPixels:this._camera.viewportPadding.value().y},{displayWidth:Wt(this,Pt,"f").width,displayHeight:Wt(this,Pt,"f").height}]).then((e=>{g()(Wt(this,Ct,"f").clampResult.value(),e)||Wt(this,Ct,"f").clampResult.update(e)})):Wt(this,At,"f").execute("ubq/render",{displayWidth:Wt(this,Pt,"f").width,displayHeight:Wt(this,Pt,"f").height})},function(e){e.start=function(e){return Object.assign(Object.assign({},e),{msg:"exportVideo"})},e.finished=function(e){return Object.assign(Object.assign({},e),{msg:"exportVideoFinished"})},e.error=function(e){return Object.assign(Object.assign({},e),{msg:"exportVideoError"})},e.progress=function(e){return Object.assign(Object.assign({},e),{msg:"exportVideoProgress"})}}(zt||(zt={}));class Gt{constructor(e,t){Object.defineProperty(this,"makeWorker",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"configuration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.configuration=t,this.makeWorker=e}exportVideo(e,t){const r=this.makeWorker(),n=Object.assign({},this.configuration);delete n.callbacks.log,n.assetSources={};const o=new Promise(((e,t)=>{r.onmessage=({data:n})=>{if("exportVideoFinished"===n.msg){const t=new Blob([n.data],{type:n.mimeType});r.terminate(),e(t)}else"exportVideoError"===n.msg?(r.terminate(),t(n.error)):"exportVideoProgress"===n.msg||console.error("Unknown message received ",n)}}));return r.postMessage(zt.start({sceneString:e,config:n,exportOptions:t})),o}}const $t=function(){try{if("object"==typeof WebAssembly&&"function"==typeof WebAssembly.instantiate){const e=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(e instanceof WebAssembly.Module)return new WebAssembly.Instance(e)instanceof WebAssembly.Instance}}catch(e){return console.error(e),!1}return!1},Yt=function(){return"undefined"!=typeof window&&"VideoFrame"in window&&"VideoDecoder"in window&&"VideoEncoder"in window&&"AudioDecoder"in window&&"AudioEncoder"in window},Xt=function(){var e;try{const t=!!(null===(e={testKey:"testValue"})||void 0===e?void 0:e.testKey),r=!0,n="globalThis"in window,o="BigInt"in window,i="allSettled"in Promise,a="matchAll"in String.prototype,s=CSS.supports("(display: flex) and (gap: 8px)"),u="MediaRecorder"in window&&"pause"in window.MediaRecorder.prototype,c=CSS.supports("selector(:not(a, .b))"),l=CSS.supports("selector(:is(a))");return $t()&&t&&r&&n&&o&&i&&a&&s&&u&&c&&l}catch(e){return!1}};"undefined"!=typeof WorkerGlobalScope&&(self.onmessage=async({data:e})=>{"exportVideo"===e.msg&&kt(e.config,e.sceneString,e.exportOptions,{onProgress:(e,t,r)=>{self.postMessage(zt.progress({renderedFrames:e,encodedFrames:t,totalFrames:r}))}}).then((e=>{self.postMessage(zt.finished({data:e,mimeType:Ee.Mp4}))}),(e=>{self.postMessage(zt.error({error:e}))}))})})();var o=n.Il,i=n.yQ,a=n.Ju,s=n.in,u=n.HY,c=n.F4,l=n.ZP,f=n.aY,d=n.Qx,h=n.Pf;export{o as Color,i as ConfigTypes,a as DesignBlockType,s as LogLevel,u as MimeType,c as WorkerClient,l as default,f as supportsBrowser,d as supportsVideo,h as supportsWasm};
|
|
2
|
+
var e={2003:(e,t,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(e){var t,o,i,a,s=e||{},u=void 0!==s?s:{};if(void 0===globalThis.BigInt64Array){function c(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:function(e,n){return void 0===n&&(n=r.length),t(r.slice(2*e,2*n))},subarray:function(e,n){return 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:function(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=c(e[n]);r.set(o,2*(t+n))}}},{get:function(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:function(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=c(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}))}u.ready=new Promise((function(e,r){t=e,o=r})),u.expectedDataFileDownloads||(u.expectedDataFileDownloads=0),u.expectedDataFileDownloads++,u.ENVIRONMENT_IS_PTHREAD||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 u.locateFilePackage||u.locateFile||(u.locateFile=u.locateFilePackage,A("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)"));var n=u.locateFile?u.locateFile(t,""):t,o=e.remote_package_size,i=null,a=u.getPreloadedPackage?u.getPreloadedPackage(n,o):null;function s(){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}u.FS_createPath("/","ly.img.cesdk",!0,!0),u.FS_createPath("/ly.img.cesdk","fonts",!0,!0),u.FS_createPath("/ly.img.cesdk","icons",!0,!0),u.FS_createPath("/ly.img.cesdk","icu",!0,!0),u.FS_createPath("/ly.img.cesdk","images",!0,!0),u.FS_createPath("/ly.img.cesdk","presets",!0,!0),u.FS_createPath("/ly.img.cesdk","shaders",!0,!0),u.FS_createPath("/ly.img.cesdk/shaders","common",!0,!0),r.prototype={requests:{},open:function(e,t){this.name=t,this.requests[t]=this,u.addRunDependency("fp "+this.name)},send:function(){},onload:function(){var e=this.byteArray.subarray(this.start,this.end);this.finish(e)},finish:function(e){u.FS_createDataFile(this.name,null,e,!0,!0,!0),u.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 s(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();u.removeRunDependency("datafile_cesdk.data")}u.addRunDependency("datafile_cesdk.data"),u.preloadResults||(u.preloadResults={}),u.preloadResults["cesdk.data"]={fromCache:!1},a?(s(a),a=null):i=s}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?u.dataFileDownloads[n].loaded=r.loaded:(i.addedTotal=!0,u.dataFileDownloads||(u.dataFileDownloads={}),u.dataFileDownloads[n]={loaded:r.loaded,total:o});var a=0,s=0,c=0;for(var l in u.dataFileDownloads){var f=u.dataFileDownloads[l];a+=f.total,s+=f.loaded,c++}a=Math.ceil(a*u.expectedDataFileDownloads/c),u.setStatus&&u.setStatus("Downloading data... ("+s+"/"+a+")")}else u.dataFileDownloads||u.setStatus&&u.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(115).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})),u.calledRun?s():(u.preRun||(u.preRun=[]),u.preRun.push(s))}({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/images/watermark.png",start:710017,end:800164},{filename:"/ly.img.cesdk/presets/.keep",start:800164,end:800164},{filename:"/ly.img.cesdk/shaders/adjustments.sksl",start:800164,end:804053},{filename:"/ly.img.cesdk/shaders/black_and_white_color_mixer.sksl",start:804053,end:810370},{filename:"/ly.img.cesdk/shaders/common/ubq_adjustments.sksl",start:810370,end:814933},{filename:"/ly.img.cesdk/shaders/common/ubq_color_conversions.sksl",start:814933,end:824918},{filename:"/ly.img.cesdk/shaders/common/ubq_constants.sksl",start:824918,end:825408},{filename:"/ly.img.cesdk/shaders/common/ubq_hue_constants.sksl",start:825408,end:828575},{filename:"/ly.img.cesdk/shaders/common/ubq_noise.sksl",start:828575,end:831213},{filename:"/ly.img.cesdk/shaders/cross_cut.sksl",start:831213,end:832160},{filename:"/ly.img.cesdk/shaders/dot_pattern.sksl",start:832160,end:832675},{filename:"/ly.img.cesdk/shaders/duotone_filter.sksl",start:832675,end:833639},{filename:"/ly.img.cesdk/shaders/extrude_blur.sksl",start:833639,end:835756},{filename:"/ly.img.cesdk/shaders/glow.sksl",start:835756,end:836723},{filename:"/ly.img.cesdk/shaders/half_tone.sksl",start:836723,end:837217},{filename:"/ly.img.cesdk/shaders/hsp_selective_adjustments.sksl",start:837217,end:850817},{filename:"/ly.img.cesdk/shaders/linocut.sksl",start:850817,end:851602},{filename:"/ly.img.cesdk/shaders/liquid.sksl",start:851602,end:852084},{filename:"/ly.img.cesdk/shaders/lut_filter.sksl",start:852084,end:854947},{filename:"/ly.img.cesdk/shaders/mask_color.sksl",start:854947,end:855449},{filename:"/ly.img.cesdk/shaders/mirror.sksl",start:855449,end:855903},{filename:"/ly.img.cesdk/shaders/outliner.sksl",start:855903,end:857540},{filename:"/ly.img.cesdk/shaders/pixelize.sksl",start:857540,end:857840},{filename:"/ly.img.cesdk/shaders/placeholder_overlay_lines.sksl",start:857840,end:858566},{filename:"/ly.img.cesdk/shaders/posterize.sksl",start:858566,end:858778},{filename:"/ly.img.cesdk/shaders/radial_pixel.sksl",start:858778,end:859341},{filename:"/ly.img.cesdk/shaders/sharpie.sksl",start:859341,end:861646},{filename:"/ly.img.cesdk/shaders/shifter.sksl",start:861646,end:862330},{filename:"/ly.img.cesdk/shaders/tiltshift.sksl",start:862330,end:862912},{filename:"/ly.img.cesdk/shaders/tv_glitch.sksl",start:862912,end:863630},{filename:"/ly.img.cesdk/shaders/vignette.sksl",start:863630,end:864002}],remote_package_size:864002}),"object"==typeof window&&"object"==typeof window.performance?u.performance=performance:"object"==typeof r.g&&"object"==typeof r.g.perf_hooks&&"object"==typeof r.g.perf_hooks.performance?u.performance=r.g.perf_hooks.performance:u.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 f{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=u._malloc(e);u.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)}}u.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,s,c){const l=u.UTF8ToString(t,r),d=this._nextHandle++,h=new f(d,l);return this._processes.set(d,h),l.match(/^file:/)?this._fetchFile(h).catch((e=>(h.fail(e),Promise.reject(e)))):this._fetchRemote(h,e,n,o,i,a,s,c).catch((e=>(h.fail(e),Promise.reject(e)))),h}async _fetchFile(e){if("undefined"!=typeof window)throw new Error("File URLs supported only in Node.JS");const t=r(115),{fileURLToPath:n}=r(2015),o=t.createReadStream(n(e.uri));return e.readChunks(o)}async _fetchRemote(e,t,r,n,o,i,s,c){const l=u.UTF8ToString(s,c),f=this.getHeaders(r,n),d=t===a.POST?new Uint8Array(u.HEAPU8.buffer,o,i):void 0,h=await this._fetch(e.uri,{method:a[t],headers:f,body:d,mode:"cors",credentials:l});if(h.status>=200&&h.status<=209){let t=0;return h.headers.has("Content-Length")&&(t=+h.headers.get("Content-Length")),e.totalBytes=t,e.readChunks(h.body)}return e.fail(h.statusText)}getHeaders(e,t){const r={};for(let n=0;n<t;n++){const t=u.getValue(e+4*n,"i32"),o=this._headers.get(t);r[o.key]=o.value}return r}createHeader(e,t,r,n){const o=u.UTF8ToString(e,t),i=u.UTF8ToString(r,n),a=this._nextHeaderHandle++;return this._headers.set(a,{key:o,value:i}),a}deleteHeader(e){return this._headers.delete(e)}},u.emscripten_ubq_codec_videoDecoders=new Map,u.emscripten_ubq_codec_audioDecoders=new Map,u.emscripten_ubq_codec_videoEncoders=new Map,u.emscripten_ubq_codec_audioEncoders=new Map,u.emscripten_ubq_codec_videoDecoderNextHandle=1,u.emscripten_ubq_codec_audioDecoderNextHandle=1,u.emscripten_ubq_codec_videoEncoderNextHandle=1,u.emscripten_ubq_codec_audioEncoderNextHandle=1,u.emscripten_ubq_codec_createNativeResult=function(e){const t=u._malloc(8),r=u.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=u._malloc(t.length+1),o=u.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},u.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=u.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++,u.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},u.emscripten_ubq_codec_createAudioDecoder=function(e,t,r){const n=new AudioDecoder({output:o=>{if(n.flushing)return void o.close();const i=u.HEAPF32.subarray(e/4,e/4+r),a=u.HEAPF32.subarray(t/4,t/4+r),s=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:s,frameCount:o.numberOfFrames});else{const t=r-e;o.copyTo(i.subarray(e),{planeIndex:0,frameCount:t}),o.copyTo(a.subarray(e),{planeIndex:s,frameCount:t}),o.copyTo(i,{planeIndex:0,frameOffset:t}),o.copyTo(a,{planeIndex:s,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=>console.error(e)});return n.writtenFrames=0,n},u.emscripten_ubq_settings_forceWebGL1=!1;var d,h,p,m=Object.assign({},u),g=[],v="./this.program",y=(e,t)=>{throw t},b="object"==typeof window,w="function"==typeof importScripts,E="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,_="";if(E){var x=r(115),k=r(3119);_=w?k.dirname(_)+"/":"//",d=(e,t)=>(e=pe(e)?new URL(e):k.normalize(e),x.readFileSync(e,t?void 0:"utf8")),p=e=>{var t=d(e,!0);return t.buffer||(t=new Uint8Array(t)),t},h=(e,t,r)=>{e=pe(e)?new URL(e):k.normalize(e),x.readFile(e,(function(e,n){e?r(e):t(n.buffer)}))},process.argv.length>1&&(v=process.argv[1].replace(/\\/g,"/")),g=process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof ve))throw e})),process.on("unhandledRejection",(function(e){throw e})),y=(e,t)=>{if(re())throw process.exitCode=e,t;var r;(r=t)instanceof ve||A("exiting due to exception: "+r),process.exit(e)},u.inspect=function(){return"[Emscripten Module object]"}}else(b||w)&&(w?_=self.location.href:"undefined"!=typeof document&&document.currentScript&&(_=document.currentScript.src),n&&(_=n),_=0!==_.indexOf("blob:")?_.substr(0,_.replace(/[?#].*/,"").lastIndexOf("/")+1):"",d=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},w&&(p=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),h=(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=u.print||console.log.bind(console),A=u.printErr||console.warn.bind(console);Object.assign(u,m),m=null,u.arguments&&(g=u.arguments),u.thisProgram&&(v=u.thisProgram),u.quit&&(y=u.quit),u.wasmBinary&&(C=u.wasmBinary);var P,T=u.noExitRuntime||!0;"object"!=typeof WebAssembly&&de("no native wasm support detected");var F,B=!1;function D(e,t){e||de(t)}var L,R,M,O,I,j,U,q,N,z,H="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function W(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&H)return H.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 c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function V(e,t){return e?W(R,e,t):""}function G(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 $(e,t,r){return G(e,R,t,r)}function Y(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}function X(){var e=P.buffer;u.HEAP8=L=new Int8Array(e),u.HEAP16=M=new Int16Array(e),u.HEAP32=I=new Int32Array(e),u.HEAPU8=R=new Uint8Array(e),u.HEAPU16=O=new Uint16Array(e),u.HEAPU32=j=new Uint32Array(e),u.HEAPF32=U=new Float32Array(e),u.HEAPF64=z=new Float64Array(e),u.HEAP64=q=new BigInt64Array(e),u.HEAPU64=N=new BigUint64Array(e)}u.INITIAL_MEMORY;var K,Q=[],Z=[],J=[],ee=[],te=[];function re(){return T}var ne,oe,ie,ae,se=0,ue=null,ce=null;function le(e){se++,u.monitorRunDependencies&&u.monitorRunDependencies(se)}function fe(e){if(se--,u.monitorRunDependencies&&u.monitorRunDependencies(se),0==se&&(null!==ue&&(clearInterval(ue),ue=null),ce)){var t=ce;ce=null,t()}}function de(e){u.onAbort&&u.onAbort(e),A(e="Aborted("+e+")"),B=!0,F=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}function he(e){return e.startsWith("data:application/octet-stream;base64,")}function pe(e){return e.startsWith("file://")}function me(e){try{if(e==ne&&C)return new Uint8Array(C);if(p)return p(e);throw"both async and sync fetching of the wasm failed"}catch(e){de(e)}}he(ne="cesdk.wasm")||(oe=ne,ne=u.locateFile?u.locateFile(oe,_):_+oe);var ge={2114260:()=>"undefined"==typeof window||void 0===(window.AudioContext||window.webkitAudioContext)?0:(void 0===window.miniaudio&&(window.miniaudio={referenceCount:0},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),2115959:()=>{void 0!==window.miniaudio&&(window.miniaudio.referenceCount--,0===window.miniaudio.referenceCount&&delete window.miniaudio)},2116120:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,2116224:()=>{try{var e=new(window.AudioContext||window.webkitAudioContext),t=e.sampleRate;return e.close(),t}catch(e){return 0}},2116395:(e,t,r,n,o)=>{var i=e,a=t,s=r,c=n,l=o;if(void 0===window.miniaudio)return-1;var f={};return f.webaudio=new(window.AudioContext||window.webkitAudioContext)({sampleRate:a}),f.webaudio.suspend(),f.state=1,f.intermediaryBufferSizeInBytes=i*s*4,f.intermediaryBuffer=u._malloc(f.intermediaryBufferSizeInBytes),f.intermediaryBufferView=new Float32Array(u.HEAPF32.buffer,f.intermediaryBuffer,f.intermediaryBufferSizeInBytes),f.scriptNode=f.webaudio.createScriptProcessor(s,c?i:0,c?0:i),c?(f.scriptNode.onaudioprocess=function(e){if(void 0!==f.intermediaryBuffer){0==f.intermediaryBufferView.length&&(f.intermediaryBufferView=new Float32Array(u.HEAPF32.buffer,f.intermediaryBuffer,f.intermediaryBufferSizeInBytes));for(var t=0;t<e.outputBuffer.numberOfChannels;++t)e.outputBuffer.getChannelData(t).fill(0);var r=!1;void 0===f.streamNode&&(r=!0),e.inputBuffer.numberOfChannels!=i&&(console.log("Capture: Channel count mismatch. "+e.inputBufer.numberOfChannels+" != "+i+". Sending silence."),r=!0);for(var n=0;n<e.inputBuffer.length;){var o=e.inputBuffer.length-n;if(o>f.intermediaryBufferSizeInBytes/i/4&&(o=f.intermediaryBufferSizeInBytes/i/4),r)f.intermediaryBufferView.fill(0);else for(var a=0;a<o;++a)for(t=0;t<e.inputBuffer.numberOfChannels;++t)f.intermediaryBufferView[a*i+t]=e.inputBuffer.getChannelData(t)[n+a];Yr("ma_device_process_pcm_frames_capture__webaudio","undefined",["number","number","number"],[l,o,f.intermediaryBuffer]),n+=o}}},navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(e){f.streamNode=f.webaudio.createMediaStreamSource(e),f.streamNode.connect(f.scriptNode),f.scriptNode.connect(f.webaudio.destination)})).catch((function(e){f.scriptNode.connect(f.webaudio.destination)}))):(f.scriptNode.onaudioprocess=function(e){if(void 0!==f.intermediaryBuffer){0==f.intermediaryBufferView.length&&(f.intermediaryBufferView=new Float32Array(u.HEAPF32.buffer,f.intermediaryBuffer,f.intermediaryBufferSizeInBytes));var t=!1;if(e.outputBuffer.numberOfChannels!=i)return console.log("Playback: Channel count mismatch. "+e.outputBufer.numberOfChannels+" != "+i+". Outputting silence."),void(t=!0);for(var r=0;r<e.outputBuffer.length;){var n=e.outputBuffer.length-r;if(n>f.intermediaryBufferSizeInBytes/i/4&&(n=f.intermediaryBufferSizeInBytes/i/4),Yr("ma_device_process_pcm_frames_playback__webaudio","undefined",["number","number","number"],[l,n,f.intermediaryBuffer]),t)for(var o=0;o<e.outputBuffer.numberOfChannels;++o)e.outputBuffer.getChannelData(o).fill(0);else for(o=0;o<e.outputBuffer.numberOfChannels;++o)for(var a=e.outputBuffer.getChannelData(o),s=f.intermediaryBufferView,c=0;c<n;++c)a[r+c]=s[c*i+o];r+=n}}},f.scriptNode.connect(f.webaudio.destination)),miniaudio.track_device(f)},2120795:e=>miniaudio.get_device_by_index(e).webaudio.sampleRate,2120861: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,void 0!==t.intermediaryBuffer&&(u._free(t.intermediaryBuffer),t.intermediaryBuffer=void 0,t.intermediaryBufferView=void 0,t.intermediaryBufferSizeInBytes=void 0),miniaudio.untrack_device_by_index(e)},2121487:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.resume(),t.state=2},2121583:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.resume(),t.state=2},2121679:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.suspend(),t.state=1},2121776:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.suspend(),t.state=1},2121873:()=>L.length};function ve(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function ye(e){for(;e.length>0;)e.shift()(u)}function be(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){j[this.ptr+4>>2]=e},this.get_type=function(){return j[this.ptr+4>>2]},this.set_destructor=function(e){j[this.ptr+8>>2]=e},this.get_destructor=function(){return j[this.ptr+8>>2]},this.set_refcount=function(e){I[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,L[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=L[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,L[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=L[this.ptr+13>>0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=I[this.ptr>>2];I[this.ptr>>2]=e+1},this.release_ref=function(){var e=I[this.ptr>>2];return I[this.ptr>>2]=e-1,1===e},this.set_adjusted_ptr=function(e){j[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return j[this.ptr+16>>2]},this.get_exception_ptr=function(){if(pn(this.get_type()))return j[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var we={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=we.isAbs(e),r="/"===e.substr(-1);return(e=we.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=we.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=we.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return we.normalize(e.join("/"))},join2:(e,t)=>we.normalize(e+"/"+t)};function Ee(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}if(E)try{var t=r(5240);return()=>t.randomBytes(1)[0]}catch(e){}return()=>de("randomDevice")}var _e={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=we.isAbs(n)}return(t?"/":"")+(e=we.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=_e.resolve(e).substr(1),t=_e.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("/")}};function xe(e,t,r){var n=r>0?r:Y(e)+1,o=new Array(n),i=G(e,o,0,o.length);return t&&(o.length=i),o}var ke={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){ke.ttys[e]={input:[],output:[],ops:t},Ae.registerDevice(e,ke.stream_ops)},stream_ops:{open:function(e){var t=ke.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){if(!e.input.length){var t=null;if(E){var r=Buffer.alloc(256),n=0;try{n=x.readSync(process.stdin.fd,r,0,256,-1)}catch(e){if(!e.toString().includes("EOF"))throw e;n=0}t=n>0?r.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=xe(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(S(W(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(S(W(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(A(W(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(A(W(e.output,0)),e.output=[])}}};function Ce(e){e=function(e,t){return 65536*Math.ceil(e/65536)}(e);var t=cn(65536,e);return t?function(e,t){return R.fill(0,e,e+t),e}(t,e):0}var Se={ops_table:null,mount:function(e){return Se.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(Ae.isBlkdev(r)||Ae.isFIFO(r))throw new Ae.ErrnoError(63);Se.ops_table||(Se.ops_table={dir:{node:{getattr:Se.node_ops.getattr,setattr:Se.node_ops.setattr,lookup:Se.node_ops.lookup,mknod:Se.node_ops.mknod,rename:Se.node_ops.rename,unlink:Se.node_ops.unlink,rmdir:Se.node_ops.rmdir,readdir:Se.node_ops.readdir,symlink:Se.node_ops.symlink},stream:{llseek:Se.stream_ops.llseek}},file:{node:{getattr:Se.node_ops.getattr,setattr:Se.node_ops.setattr},stream:{llseek:Se.stream_ops.llseek,read:Se.stream_ops.read,write:Se.stream_ops.write,allocate:Se.stream_ops.allocate,mmap:Se.stream_ops.mmap,msync:Se.stream_ops.msync}},link:{node:{getattr:Se.node_ops.getattr,setattr:Se.node_ops.setattr,readlink:Se.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Se.node_ops.getattr,setattr:Se.node_ops.setattr},stream:Ae.chrdev_stream_ops}});var o=Ae.createNode(e,t,r,n);return Ae.isDir(o.mode)?(o.node_ops=Se.ops_table.dir.node,o.stream_ops=Se.ops_table.dir.stream,o.contents={}):Ae.isFile(o.mode)?(o.node_ops=Se.ops_table.file.node,o.stream_ops=Se.ops_table.file.stream,o.usedBytes=0,o.contents=null):Ae.isLink(o.mode)?(o.node_ops=Se.ops_table.link.node,o.stream_ops=Se.ops_table.link.stream):Ae.isChrdev(o.mode)&&(o.node_ops=Se.ops_table.chrdev.node,o.stream_ops=Se.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(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:function(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:function(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:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&Se.resizeFileStorage(e,t.size)},lookup:function(e,t){throw Ae.genericErrors[44]},mknod:function(e,t,r,n){return Se.createNode(e,t,r,n)},rename:function(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:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(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:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var n=Se.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!Ae.isLink(e.mode))throw new Ae.ErrnoError(28);return e.link}},stream_ops:{read:function(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:function(e,t,r,n,o,i){if(t.buffer===L.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(Se.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:function(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:function(e,t,r){Se.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(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!==L.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=Ce(t)))throw new Ae.ErrnoError(48);L.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:function(e,t,r,n,o){return Se.stream_ops.write(e,t,0,n,r,!1),0}}},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=_e.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=we.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=_e.resolve(we.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),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var t=Ae.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},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:(e=0,t=Ae.MAX_OPEN_FDS)=>{for(var r=e;r<=t;r++)if(!Ae.streams[r])return r;throw new Ae.ErrnoError(33)},getStream:e=>Ae.streams[e],createStream:(e,t,r)=>{Ae.FSStream||(Ae.FSStream=function(){this.shared={}},Ae.FSStream.prototype={},Object.defineProperties(Ae.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(e){this.shared.flags=e}},position:{get:function(){return this.shared.position},set:function(e){this.shared.position=e}}})),e=Object.assign(new Ae.FSStream,e);var n=Ae.nextfd(t,r);return e.fd=n,Ae.streams[n]=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&&A("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=we.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(!_e.resolve(e))throw new Ae.ErrnoError(44);var r=Ae.lookupPath(t,{parent:!0}).node;if(!r)throw new Ae.ErrnoError(44);var n=we.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=we.dirname(e),i=we.dirname(t),a=we.basename(e),s=we.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,c=Ae.lookupNode(r,a),l=_e.relative(e,i);if("."!==l.charAt(0))throw new Ae.ErrnoError(28);if("."!==(l=_e.relative(t,o)).charAt(0))throw new Ae.ErrnoError(55);try{u=Ae.lookupNode(n,s)}catch(e){}if(c!==u){var f=Ae.isDir(c.mode),d=Ae.mayDelete(r,a,f);if(d)throw new Ae.ErrnoError(d);if(d=u?Ae.mayDelete(n,s,f):Ae.mayCreate(n,s))throw new Ae.ErrnoError(d);if(!r.node_ops.rename)throw new Ae.ErrnoError(63);if(Ae.isMountpoint(c)||u&&Ae.isMountpoint(u))throw new Ae.ErrnoError(10);if(n!==r&&(d=Ae.nodePermissions(r,"w")))throw new Ae.ErrnoError(d);Ae.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(e){throw e}finally{Ae.hashAddNode(c)}}},rmdir:e=>{var t=Ae.lookupPath(e,{parent:!0}).node,r=we.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=we.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 _e.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.getStream(e);if(!r)throw new Ae.ErrnoError(8);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.getStream(e);if(!n)throw new Ae.ErrnoError(8);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.getStream(e);if(!r)throw new Ae.ErrnoError(8);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?Ae.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)n=e;else{e=we.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),!u.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=W(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(Y(t)+1),i=G(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)),ke.register(Ae.makedev(5,0),ke.default_tty_ops),ke.register(Ae.makedev(6,0),ke.default_tty1_ops),Ae.mkdev("/dev/tty",Ae.makedev(5,0)),Ae.mkdev("/dev/tty1",Ae.makedev(6,0));var e=Ee();Ae.createDevice("/dev","random",e),Ae.createDevice("/dev","urandom",e),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.getStream(r);if(!n)throw new Ae.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{u.stdin?Ae.createDevice("/dev","stdin",u.stdin):Ae.symlink("/dev/tty","/dev/stdin"),u.stdout?Ae.createDevice("/dev","stdout",null,u.stdout):Ae.symlink("/dev/tty","/dev/stdout"),u.stderr?Ae.createDevice("/dev","stderr",null,u.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.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(Se,{},"/"),Ae.createDefaultDirectories(),Ae.createDefaultDevices(),Ae.createSpecialDirectories(),Ae.filesystems={MEMFS:Se}},init:(e,t,r)=>{Ae.init.initialized=!0,Ae.ensureErrnoError(),u.stdin=e||u.stdin,u.stdout=t||u.stdout,u.stderr=r||u.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)}},getMode:(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},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=we.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=we.join2(e,i);try{Ae.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,r,n,o)=>{var i=we.join2("string"==typeof e?e:Ae.getPath(e),t),a=Ae.getMode(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?we.join2(e,t):e);var s=Ae.getMode(n,o),u=Ae.create(a,s);if(r){if("string"==typeof r){for(var c=new Array(r.length),l=0,f=r.length;l<f;++l)c[l]=r.charCodeAt(l);r=c}Ae.chmod(u,146|s);var d=Ae.open(u,577);Ae.write(d,r,0,r.length,0,i),Ae.close(d),Ae.chmod(u,s)}return u},createDevice:(e,t,r,n)=>{var o=we.join2("string"==typeof e?e:Ae.getPath(e),t),i=Ae.getMode(!!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=xe(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||[]):xe(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(!w)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 c={};function l(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];c[e]=function(){return Ae.forceLoadFile(u),t.apply(null,arguments)}})),c.read=(e,t,r,n,o)=>(Ae.forceLoadFile(u),l(e,t,r,n,o)),c.mmap=(e,t,r,n,o)=>{Ae.forceLoadFile(u);var i=Ce(t);if(!i)throw new Ae.ErrnoError(48);return l(e,L,i,t,r),{ptr:i,allocated:!0}},u.stream_ops=c,u},createPreloadedFile:(e,t,r,n,o,i,a,s,u,c)=>{var l=t?_e.resolve(we.join2(e,t)):e;function f(r){function f(r){c&&c(),s||Ae.createDataFile(e,t,r,n,o,u),i&&i(),fe()}sr.handledByPreloadPlugin(r,l,f,(()=>{a&&a(),fe()}))||f(r)}le(),"string"==typeof r?function(e,t,r,n){var o="al "+e;h(e,(t=>{D(t,'Loading data file "'+e+'" failed (no arrayBuffer).'),f(new Uint8Array(t)),o&&fe()}),(t=>{if(!r)throw'Loading data file "'+e+'" failed.';r()})),o&&le()}(r,0,a):f(r)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=Ae.indexedDB();try{var o=n.open(Ae.DB_NAME(),Ae.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=()=>{S("creating db"),o.result.createObjectStore(Ae.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([Ae.DB_STORE_NAME],"readwrite"),i=n.objectStore(Ae.DB_STORE_NAME),a=0,s=0,u=e.length;function c(){0==s?t():r()}e.forEach((e=>{var t=i.put(Ae.analyzePath(e).object.contents,e);t.onsuccess=()=>{++a+s==u&&c()},t.onerror=()=>{s++,a+s==u&&c()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=Ae.indexedDB();try{var o=n.open(Ae.DB_NAME(),Ae.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([Ae.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var a=i.objectStore(Ae.DB_STORE_NAME),s=0,u=0,c=e.length;function l(){0==u?t():r()}e.forEach((e=>{var t=a.get(e);t.onsuccess=()=>{Ae.analyzePath(e).exists&&Ae.unlink(e),Ae.createDataFile(we.dirname(e),we.basename(e),t.result,!0,!0,!0),++s+u==c&&l()},t.onerror=()=>{u++,s+u==c&&l()}})),i.onerror=r},o.onerror=r}},Pe={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(we.isAbs(t))return t;var n;if(n=-100===e?Ae.cwd():Pe.getStreamFromFD(e).path,0==t.length){if(!r)throw new Ae.ErrnoError(44);return n}return we.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&we.normalize(t)!==we.normalize(Ae.getPath(e.node)))return-54;throw e}I[r>>2]=n.dev,I[r+8>>2]=n.ino,I[r+12>>2]=n.mode,j[r+16>>2]=n.nlink,I[r+20>>2]=n.uid,I[r+24>>2]=n.gid,I[r+28>>2]=n.rdev,ae=[n.size>>>0,(ie=n.size,+Math.abs(ie)>=1?ie>0?(0|Math.min(+Math.floor(ie/4294967296),4294967295))>>>0:~~+Math.ceil((ie-+(~~ie>>>0))/4294967296)>>>0:0)],I[r+40>>2]=ae[0],I[r+44>>2]=ae[1],I[r+48>>2]=4096,I[r+52>>2]=n.blocks;var o=n.atime.getTime(),i=n.mtime.getTime(),a=n.ctime.getTime();return ae=[Math.floor(o/1e3)>>>0,(ie=Math.floor(o/1e3),+Math.abs(ie)>=1?ie>0?(0|Math.min(+Math.floor(ie/4294967296),4294967295))>>>0:~~+Math.ceil((ie-+(~~ie>>>0))/4294967296)>>>0:0)],I[r+56>>2]=ae[0],I[r+60>>2]=ae[1],j[r+64>>2]=o%1e3*1e3,ae=[Math.floor(i/1e3)>>>0,(ie=Math.floor(i/1e3),+Math.abs(ie)>=1?ie>0?(0|Math.min(+Math.floor(ie/4294967296),4294967295))>>>0:~~+Math.ceil((ie-+(~~ie>>>0))/4294967296)>>>0:0)],I[r+72>>2]=ae[0],I[r+76>>2]=ae[1],j[r+80>>2]=i%1e3*1e3,ae=[Math.floor(a/1e3)>>>0,(ie=Math.floor(a/1e3),+Math.abs(ie)>=1?ie>0?(0|Math.min(+Math.floor(ie/4294967296),4294967295))>>>0:~~+Math.ceil((ie-+(~~ie>>>0))/4294967296)>>>0:0)],I[r+88>>2]=ae[0],I[r+92>>2]=ae[1],j[r+96>>2]=a%1e3*1e3,ae=[n.ino>>>0,(ie=n.ino,+Math.abs(ie)>=1?ie>0?(0|Math.min(+Math.floor(ie/4294967296),4294967295))>>>0:~~+Math.ceil((ie-+(~~ie>>>0))/4294967296)>>>0:0)],I[r+104>>2]=ae[0],I[r+108>>2]=ae[1],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=R.slice(e,e+r);Ae.msync(t,i,o,r,n)},varargs:void 0,get:function(){return Pe.varargs+=4,I[Pe.varargs-4>>2]},getStr:function(e){return V(e)},getStreamFromFD:function(e){var t=Ae.getStream(e);if(!t)throw new Ae.ErrnoError(8);return t}},Te="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking",Fe={};function Be(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function De(e){return this.fromWireType(I[e>>2])}var Le={},Re={},Me={};function Oe(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 Ie(e,t){return e=Oe(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(t)}function je(e,t){var r=Ie(t,(function(e){this.name=t,this.message=e;var r=new Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var Ue=void 0;function qe(e){throw new Ue(e)}function Ne(e,t,r){function n(t){var n=r(t);n.length!==e.length&&qe("Mismatched type converter count");for(var o=0;o<e.length;++o)Ye(e[o],n[o])}e.forEach((function(e){Me[e]=t}));var o=new Array(t.length),i=[],a=0;t.forEach(((e,t)=>{Re.hasOwnProperty(e)?o[t]=Re[e]:(i.push(e),Le.hasOwnProperty(e)||(Le[e]=[]),Le[e].push((()=>{o[t]=Re[e],++a===i.length&&n(o)})))})),0===i.length&&n(o)}var ze={};function He(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}var We=void 0;function Ve(e){for(var t="",r=e;R[r];)t+=We[R[r++]];return t}var Ge=void 0;function $e(e){throw new Ge(e)}function Ye(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=t.name;if(e||$e('type "'+n+'" must have a positive integer typeid pointer'),Re.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;$e("Cannot register type '"+n+"' twice")}if(Re[e]=t,delete Me[e],Le.hasOwnProperty(e)){var o=Le[e];delete Le[e],o.forEach((e=>e()))}}function Xe(e,t,r){switch(t){case 0:return r?function(e){return L[e]}:function(e){return R[e]};case 1:return r?function(e){return M[e>>1]}:function(e){return O[e>>1]};case 2:return r?function(e){return I[e>>2]}:function(e){return j[e>>2]};case 3:return r?function(e){return q[e>>3]}:function(e){return N[e>>3]};default:throw new TypeError("Unknown integer type: "+e)}}function Ke(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 Qe(e){$e(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Ze=!1;function Je(e){}function et(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 tt(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=tt(e,t,r.baseClass);return null===n?null:r.downcast(n)}var rt={};var nt=[];function ot(){for(;nt.length;){var e=nt.pop();e.$$.deleteScheduled=!1,e.delete()}}var it=void 0;var at={};function st(e,t){return t.ptrType&&t.ptr||qe("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&qe("Both smartPtrType and smartPtr must be specified"),t.count={value:1},ut(Object.create(e,{$$:{value:t}}))}function ut(e){return"undefined"==typeof FinalizationRegistry?(ut=e=>e,e):(Ze=new FinalizationRegistry((e=>{et(e.$$)})),ut=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};Ze.register(e,r,e)}return e},Je=e=>Ze.unregister(e),ut(e))}function ct(){}function lt(e,t,r){if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||$e("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){u.hasOwnProperty(e)?((void 0===r||void 0!==u[e].overloadTable&&void 0!==u[e].overloadTable[r])&&$e("Cannot register public name '"+e+"' twice"),lt(u,e,e),u.hasOwnProperty(r)&&$e("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),u[e].overloadTable[r]=t):(u[e]=t,void 0!==r&&(u[e].numArguments=r))}function dt(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||$e("Expected null or instance of "+r.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function pt(e,t){if(null===t)return this.isReference&&$e("null is not a valid "+this.name),0;t.$$||$e('Cannot pass "'+He(t)+'" as a '+this.name),t.$$.ptr||$e("Cannot pass deleted object as a pointer of type "+this.name);var r=t.$$.ptrType.registeredClass;return ht(t.$$.ptr,r,this.registeredClass)}function mt(e,t){var r;if(null===t)return this.isReference&&$e("null is not a valid "+this.name),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||$e('Cannot pass "'+He(t)+'" as a '+this.name),t.$$.ptr||$e("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&&$e("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&&$e("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:$e("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:$e("Unsupporting sharing policy")}return r}function gt(e,t){if(null===t)return this.isReference&&$e("null is not a valid "+this.name),0;t.$$||$e('Cannot pass "'+He(t)+'" as a '+this.name),t.$$.ptr||$e("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&&$e("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,c,l){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=c,this.rawDestructor=l,o||void 0!==t.baseClass?this.toWireType=mt:n?(this.toWireType=pt,this.destructorFunction=null):(this.toWireType=gt,this.destructorFunction=null)}function yt(e,t,r){u.hasOwnProperty(e)||qe("Replacing nonexistant public symbol"),void 0!==u[e].overloadTable&&void 0!==r?u[e].overloadTable[r]=t:(u[e]=t,u[e].argCount=r)}var bt=[];function wt(e){var t=bt[e];return t||(e>=bt.length&&(bt.length=e+1),bt[e]=t=K.get(e)),t}function Et(e,t){e=Ve(e);var r=wt(t);return"function"!=typeof r&&$e("unknown function pointer with signature "+e+": "+t),r}var _t=void 0;function xt(e){var t=un(e),r=Ve(t);return an(t),r}function kt(e,t){var r=[],n={};throw t.forEach((function e(t){n[t]||Re[t]||(Me[t]?Me[t].forEach(e):(r.push(t),n[t]=!0))})),new _t(e+": "+r.map(xt).join([", "]))}function Ct(e,t){for(var r=[],n=0;n<e;n++)r.push(j[t+4*n>>2]);return r}function St(e,t){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var r=Ie(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var n=new r,o=e.apply(n,t);return o instanceof Object?o:n}function At(e,t,r,n,o){var i=t.length;i<2&&$e("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==t[1]&&null!==r,s=!1,u=1;u<t.length;++u)if(null!==t[u]&&void 0===t[u].destructorFunction){s=!0;break}var c="void"!==t[0].name,l="",f="";for(u=0;u<i-2;++u)l+=(0!==u?", ":"")+"arg"+u,f+=(0!==u?", ":"")+"arg"+u+"Wired";var d="return function "+Oe(e)+"("+l+") {\nif (arguments.length !== "+(i-2)+") {\nthrowBindingError('function "+e+" called with ' + arguments.length + ' arguments, expected "+(i-2)+" args!');\n}\n";s&&(d+="var destructors = [];\n");var h=s?"destructors":"null",p=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],m=[$e,n,o,Be,t[0],t[1]];for(a&&(d+="var thisWired = classParam.toWireType("+h+", this);\n"),u=0;u<i-2;++u)d+="var arg"+u+"Wired = argType"+u+".toWireType("+h+", arg"+u+"); // "+t[u+2].name+"\n",p.push("argType"+u),m.push(t[u+2]);if(a&&(f="thisWired"+(f.length>0?", ":"")+f),d+=(c?"var rv = ":"")+"invoker(fn"+(f.length>0?", ":"")+f+");\n",s)d+="runDestructors(destructors);\n";else for(u=a?1:2;u<t.length;++u){var g=1===u?"thisWired":"arg"+(u-2)+"Wired";null!==t[u].destructorFunction&&(d+=g+"_dtor("+g+"); // "+t[u].name+"\n",p.push(g+"_dtor"),m.push(t[u].destructorFunction))}return c&&(d+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),d+="}\n",p.push(d),St(Function,p).apply(null,m)}var Pt=[],Tt=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Ft(e){e>4&&0==--Tt[e].refcount&&(Tt[e]=void 0,Pt.push(e))}var Bt={toValue:e=>(e||$e("Cannot use deleted val. handle = "+e),Tt[e].value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=Pt.length?Pt.pop():Tt.length;return Tt[t]={refcount:1,value:e},t}}};function Dt(e,t,r){switch(t){case 0:return function(e){var t=r?L:R;return this.fromWireType(t[e])};case 1:return function(e){var t=r?M:O;return this.fromWireType(t[e>>1])};case 2:return function(e){var t=r?I:j;return this.fromWireType(t[e>>2])};default:throw new TypeError("Unknown integer type: "+e)}}function Lt(e,t){var r=Re[e];return void 0===r&&$e(t+" has unknown type "+xt(e)),r}function Rt(e,t){switch(t){case 2:return function(e){return this.fromWireType(U[e>>2])};case 3:return function(e){return this.fromWireType(z[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}var Mt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function Ot(e,t){for(var r=e,n=r>>1,o=n+t/2;!(n>=o)&&O[n];)++n;if((r=n<<1)-e>32&&Mt)return Mt.decode(R.subarray(e,r));for(var i="",a=0;!(a>=t/2);++a){var s=M[e+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i}function It(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);M[t>>1]=a,t+=2}return M[t>>1]=0,t-n}function jt(e){return 2*e.length}function Ut(e,t){for(var r=0,n="";!(r>=t/4);){var o=I[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}function qt(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)),I[t>>2]=a,(t+=4)+4>o)break}return I[t>>2]=0,t-n}function Nt(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 zt(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=Lt(j[t+4*n>>2],"parameter "+n);return r}var Ht={};function Wt(e){var t=Ht[e];return void 0===t?Ve(e):t}var Vt=[];function Gt(){return"object"==typeof globalThis?globalThis:Function("return this")()}var $t=[],Yt={};function Xt(e){return j[e>>2]+4294967296*I[e+4>>2]}function Kt(e){return e%4==0&&(e%100!=0||e%400==0)}var Qt,Zt=[0,31,60,91,121,152,182,213,244,274,305,335],Jt=[0,31,59,90,120,151,181,212,243,273,304,334];function er(e){return(Kt(e.getFullYear())?Zt:Jt)[e.getMonth()]+e.getDate()-1}function tr(e){var t=Y(e)+1,r=on(t);return r&&G(e,L,r,t),r}function rr(e,t){if(sr.mainLoop.timingMode=e,sr.mainLoop.timingValue=t,!sr.mainLoop.func)return 1;if(sr.mainLoop.running||(sr.mainLoop.running=!0),0==e)sr.mainLoop.scheduler=function(){var e=0|Math.max(0,sr.mainLoop.tickStartTime+t-Qt());setTimeout(sr.mainLoop.runner,e)},sr.mainLoop.method="timeout";else if(1==e)sr.mainLoop.scheduler=function(){sr.requestAnimationFrame(sr.mainLoop.runner)},sr.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),w?(void 0===u.setImmediates&&(u.setImmediates=[]),u.setImmediates.push(e),postMessage({target:n})):postMessage(n,"*")}}sr.mainLoop.scheduler=function(){setImmediate(sr.mainLoop.runner)},sr.mainLoop.method="immediate"}return 0}function nr(e){if(e instanceof ve||"unwind"==e)return F;y(1,e)}function or(e){if(!B)try{e()}catch(e){nr(e)}}function ir(e,t){return setTimeout((function(){or(e)}),t)}function ar(e){ar.shown||(ar.shown={}),ar.shown[e]||(ar.shown[e]=1,E&&(e="warning: "+e),A(e))}Qt=E?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:()=>performance.now();var sr={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){sr.mainLoop.scheduler=null,sr.mainLoop.currentlyRunningMainloop++},resume:function(){sr.mainLoop.currentlyRunningMainloop++;var e=sr.mainLoop.timingMode,t=sr.mainLoop.timingValue,r=sr.mainLoop.func;sr.mainLoop.func=null,function(e,t,r,n,o){D(!sr.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."),sr.mainLoop.func=e,sr.mainLoop.arg=n;var i=sr.mainLoop.currentlyRunningMainloop;function a(){return!(i<sr.mainLoop.currentlyRunningMainloop)}sr.mainLoop.running=!1,sr.mainLoop.runner=function(){if(!B)if(sr.mainLoop.queue.length>0){var t=Date.now(),r=sr.mainLoop.queue.shift();if(r.func(r.arg),sr.mainLoop.remainingBlockers){var n=sr.mainLoop.remainingBlockers,o=n%1==0?n-1:Math.floor(n);r.counted?sr.mainLoop.remainingBlockers=o:(o+=.5,sr.mainLoop.remainingBlockers=(8*n+o)/9)}if(S('main loop blocker "'+r.name+'" took '+(Date.now()-t)+" ms"),sr.mainLoop.updateStatus(),!a())return;setTimeout(sr.mainLoop.runner,0)}else a()&&(sr.mainLoop.currentFrameNumber=sr.mainLoop.currentFrameNumber+1|0,1==sr.mainLoop.timingMode&&sr.mainLoop.timingValue>1&&sr.mainLoop.currentFrameNumber%sr.mainLoop.timingValue!=0?sr.mainLoop.scheduler():(0==sr.mainLoop.timingMode&&(sr.mainLoop.tickStartTime=Qt()),sr.mainLoop.runIter(e),a()&&("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),sr.mainLoop.scheduler())))}}(r,0,0,sr.mainLoop.arg),rr(e,t),sr.mainLoop.scheduler()},updateStatus:function(){if(u.setStatus){var e=u.statusMessage||"Please wait...",t=sr.mainLoop.remainingBlockers,r=sr.mainLoop.expectedBlockers;t?t<r?u.setStatus(e+" ("+(r-t)+"/"+r+")"):u.setStatus(e):u.setStatus("")}},runIter:function(e){if(!B){if(u.preMainLoop&&!1===u.preMainLoop())return;or(e),u.postMainLoop&&u.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(u.preloadPlugins||(u.preloadPlugins=[]),!sr.initted){sr.initted=!0;try{new Blob,sr.hasBlobConstructor=!0}catch(e){sr.hasBlobConstructor=!1,A("warning: no blob constructor, cannot create blobs with mimetypes")}sr.BlobBuilder="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:sr.hasBlobConstructor?null:A("warning: no BlobBuilder"),sr.URLObject="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,u.noImageDecoding||void 0!==sr.URLObject||(A("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),u.noImageDecoding=!0);var e={canHandle:function(e){return!u.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,t,r,n){var o=null;if(sr.hasBlobConstructor)try{(o=new Blob([e],{type:sr.getMimetype(t)})).size!==e.length&&(o=new Blob([new Uint8Array(e).buffer],{type:sr.getMimetype(t)}))}catch(e){ar("Blob constructor present but fails: "+e+"; falling back to blob builder")}if(!o){var i=new sr.BlobBuilder;i.append(new Uint8Array(e).buffer),o=i.getBlob()}var a=sr.URLObject.createObjectURL(o),s=new Image;s.onload=()=>{D(s.complete,"Image "+t+" could not be decoded");var n=document.createElement("canvas");n.width=s.width,n.height=s.height,n.getContext("2d").drawImage(s,0,0),Qr[t]=n,sr.URLObject.revokeObjectURL(a),r&&r(e)},s.onerror=e=>{S("Image "+a+" could not be decoded"),n&&n()},s.src=a}};u.preloadPlugins.push(e);var t={canHandle:function(e){return!u.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,Zr[t]=n,r&&r(e))}function a(){o||(o=!0,Zr[t]=new Audio,n&&n())}if(!sr.hasBlobConstructor)return a();try{var s=new Blob([e],{type:sr.getMimetype(t)})}catch(e){return a()}var u=sr.URLObject.createObjectURL(s),c=new Audio;c.addEventListener("canplaythrough",(()=>i(c)),!1),c.onerror=function(r){o||(A("warning: browser could not fully decode audio "+t+", trying slower base64 approach"),c.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(c))},c.src=u,ir((function(){i(c)}),1e4)}};u.preloadPlugins.push(t);var r=u.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),u.elementPointerLock&&r.addEventListener("click",(e=>{!sr.pointerLock&&u.canvas.requestPointerLock&&(u.canvas.requestPointerLock(),e.preventDefault())}),!1))}function n(){sr.pointerLock=document.pointerLockElement===u.canvas||document.mozPointerLockElement===u.canvas||document.webkitPointerLockElement===u.canvas||document.msPointerLockElement===u.canvas}},handledByPreloadPlugin:function(e,t,r,n){sr.init();var o=!1;return u.preloadPlugins.forEach((function(i){o||i.canHandle(t)&&(i.handle(e,t,r,n),o=!0)})),o},createContext:function(e,t,r,n){if(t&&u.ctx&&e==u.canvas)return u.ctx;var o,i;if(t){var a={antialias:!1,alpha:!1,majorVersion:"undefined"!=typeof WebGL2RenderingContext?2:1};if(n)for(var s in n)a[s]=n[s];void 0!==mr&&(i=mr.createContext(e,a))&&(o=mr.getContext(i).GLctx)}else o=e.getContext("2d");return o?(r&&(t||D(void 0===Kr,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),u.ctx=o,t&&mr.makeContextCurrent(i),u.useWebGL=t,sr.moduleContextCreatedCallbacks.forEach((function(e){e()})),sr.init()),o):null},destroyContext:function(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(e,t){sr.lockPointer=e,sr.resizeCanvas=t,void 0===sr.lockPointer&&(sr.lockPointer=!0),void 0===sr.resizeCanvas&&(sr.resizeCanvas=!1);var r=u.canvas;function n(){sr.isFullscreen=!1;var e=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(r.exitFullscreen=sr.exitFullscreen,sr.lockPointer&&r.requestPointerLock(),sr.isFullscreen=!0,sr.resizeCanvas?sr.setFullscreenCanvasSize():sr.updateCanvasDimensions(r)):(e.parentNode.insertBefore(r,e),e.parentNode.removeChild(e),sr.resizeCanvas?sr.setWindowedCanvasSize():sr.updateCanvasDimensions(r)),u.onFullScreen&&u.onFullScreen(sr.isFullscreen),u.onFullscreen&&u.onFullscreen(sr.isFullscreen)}sr.fullscreenHandlersInstalled||(sr.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!!sr.isFullscreen&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){}).apply(document,[]),!0)},nextRAF:0,fakeRequestAnimationFrame:function(e){var t=Date.now();if(0===sr.nextRAF)sr.nextRAF=t+1e3/60;else for(;t+2>=sr.nextRAF;)sr.nextRAF+=1e3/60;var r=Math.max(sr.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame:function(e){"function"!=typeof requestAnimationFrame?(0,sr.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeSetTimeout:function(e,t){return ir(e,t)},safeRequestAnimationFrame:function(e){return sr.requestAnimationFrame((function(){or(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(sr.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?sr.mouseMovementX=sr.mouseMovementY=0:(sr.mouseMovementX=sr.getMovementX(e),sr.mouseMovementY=sr.getMovementY(e)),"undefined"!=typeof SDL?(sr.mouseX=SDL.mouseX+sr.mouseMovementX,sr.mouseY=SDL.mouseY+sr.mouseMovementY):(sr.mouseX+=sr.mouseMovementX,sr.mouseY+=sr.mouseMovementY);else{var t=u.canvas.getBoundingClientRect(),r=u.canvas.width,n=u.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 s=a.pageX-(o+t.left),c=a.pageY-(i+t.top),l={x:s*=r/t.width,y:c*=n/t.height};if("touchstart"===e.type)sr.lastTouches[a.identifier]=l,sr.touches[a.identifier]=l;else if("touchend"===e.type||"touchmove"===e.type){var f=sr.touches[a.identifier];f||(f=l),sr.lastTouches[a.identifier]=f,sr.touches[a.identifier]=l}return}var d=e.pageX-(o+t.left),h=e.pageY-(i+t.top);d*=r/t.width,h*=n/t.height,sr.mouseMovementX=d-sr.mouseX,sr.mouseMovementY=h-sr.mouseY,sr.mouseX=d,sr.mouseY=h}},resizeListeners:[],updateResizeListeners:function(){var e=u.canvas;sr.resizeListeners.forEach((function(t){t(e.width,e.height)}))},setCanvasSize:function(e,t,r){var n=u.canvas;sr.updateCanvasDimensions(n,e,t),r||sr.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=j[SDL.screen>>2];e|=8388608,I[SDL.screen>>2]=e}sr.updateCanvasDimensions(u.canvas),sr.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=j[SDL.screen>>2];e&=-8388609,I[SDL.screen>>2]=e}sr.updateCanvasDimensions(u.canvas),sr.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(u.forcedAspectRatio&&u.forcedAspectRatio>0&&(n/o<u.forcedAspectRatio?n=Math.round(o*u.forcedAspectRatio):o=Math.round(n/u.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)}sr.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"))))}},ur={errorCode:12288,defaultDisplayInitialized:!1,currentContext:0,currentReadSurface:0,currentDrawSurface:0,contextAttributes:{alpha:!1,depth:!1,stencil:!1,antialias:!1},stringCache:{},setErrorCode:function(e){ur.errorCode=e},chooseConfig:function(e,t,r,n,o){if(62e3!=e)return ur.setErrorCode(12296),0;if(t)for(;;){var i=I[t>>2];if(12321==i){var a=I[t+4>>2];ur.contextAttributes.alpha=a>0}else if(12325==i){var s=I[t+4>>2];ur.contextAttributes.depth=s>0}else if(12326==i){var u=I[t+4>>2];ur.contextAttributes.stencil=u>0}else if(12337==i){var c=I[t+4>>2];ur.contextAttributes.antialias=c>0}else if(12338==i)c=I[t+4>>2],ur.contextAttributes.antialias=1==c;else if(12544==i){var l=I[t+4>>2];ur.contextAttributes.lowLatency=12547!=l}else if(12344==i)break;t+=8}return r&&n||o?(o&&(I[o>>2]=1),r&&n>0&&(I[r>>2]=62002),ur.setErrorCode(12288),1):(ur.setErrorCode(12300),0)}};function cr(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 lr(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 fr(e){var t=e.getExtension("WEBGL_draw_buffers");if(t)return e.drawBuffers=function(e,r){t.drawBuffersWEBGL(e,r)},1}function dr(e){return!!(e.dibvbi=e.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"))}function hr(e){return!!(e.mdibvbi=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"))}function pr(e){return!!(e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw"))}var mr={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){mr.lastError||(mr.lastError=e)},getNewId:function(e){for(var t=mr.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?I[n+4*i>>2]:-1;o+=V(I[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?mr.registerContext(r,t):0},registerContext:function(e,t){var r=mr.getNewId(mr.contexts),n={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),mr.contexts[r]=n,(void 0===t.enableExtensionsByDefault||t.enableExtensionsByDefault)&&mr.initExtensions(n),r},makeContextCurrent:function(e){return mr.currentContext=mr.contexts[e],u.ctx=Kr=mr.currentContext&&mr.currentContext.GLctx,!(e&&!Kr)},getContext:function(e){return mr.contexts[e]},deleteContext:function(e){mr.currentContext===mr.contexts[e]&&(mr.currentContext=null),"object"==typeof Or&&Or.removeAllHandlersOnTarget(mr.contexts[e].GLctx.canvas),mr.contexts[e]&&mr.contexts[e].GLctx.canvas&&(mr.contexts[e].GLctx.canvas.GLctxObject=void 0),mr.contexts[e]=null},initExtensions:function(e){if(e||(e=mr.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var t=e.GLctx;cr(t),lr(t),fr(t),dr(t),hr(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")),pr(t),(t.getSupportedExtensions()||[]).forEach((function(e){e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}}},gr=[];function vr(e,t){return(e>>>0)+4294967296*t}var yr=[];function br(e,t,r,n){for(var o=0;o<e;o++){var i=Kr[r](),a=i&&mr.getNewId(n);i?(i.name=a,n[a]=i):mr.recordError(1282),I[t+4*o>>2]=a}}function wr(e,t,r,n,o,i,a,s){t=mr.programs[t];var u=Kr[e](t,r);if(u){var c=s&&$(u.name,s,n);o&&(I[o>>2]=c),i&&(I[i>>2]=u.size),a&&(I[a>>2]=u.type)}}function Er(e,t){j[e>>2]=t,j[e+4>>2]=(t-j[e>>2])/4294967296}function _r(e,t,r){if(t){var n=void 0;switch(e){case 36346:n=1;break;case 36344:return void(0!=r&&1!=r&&mr.recordError(1280));case 34814:case 36345:n=0;break;case 34466:var o=Kr.getParameter(34467);n=o?o.length:0;break;case 33309:if(mr.currentContext.version<2)return void mr.recordError(1282);n=2*(Kr.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(mr.currentContext.version<2)return void mr.recordError(1280);n=33307==e?3:0}if(void 0===n){var i=Kr.getParameter(e);switch(typeof i){case"number":n=i;break;case"boolean":n=i?1:0;break;case"string":return void mr.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 mr.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:I[t+4*a>>2]=i[a];break;case 2:U[t+4*a>>2]=i[a];break;case 4:L[t+a>>0]=i[a]?1:0}return}try{n=0|i.name}catch(t){return mr.recordError(1280),void A("GL_INVALID_ENUM in glGet"+r+"v: Unknown object returned from WebGL getParameter("+e+")! (error: "+t+")")}}break;default:return mr.recordError(1280),void A("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:Er(t,n);break;case 0:I[t>>2]=n;break;case 2:U[t>>2]=n;break;case 4:L[t>>0]=n?1:0}}else mr.recordError(1281)}function xr(e,t,r,n){if(r){var o,i=Kr.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 mr.recordError(1280)}else{if(!(i instanceof WebGLBuffer))return void mr.recordError(1280);o=0|i.name}break;default:return void mr.recordError(1280)}switch(n){case 1:Er(r,o);break;case 0:I[r>>2]=o;break;case 2:U[r>>2]=o;break;case 4:L[r>>0]=o?1:0;break;default:throw"internal emscriptenWebGLGetIndexed() error, bad type: "+n}}else mr.recordError(1281)}function kr(e){var t=Y(e)+1,r=on(t);return $(e,r,t),r}function Cr(e){return"]"==e.slice(-1)&&e.lastIndexOf("[")}function Sr(e){var t,r,n=e.uniformLocsById,o=e.uniformSizeAndIdsByName;if(!n)for(e.uniformLocsById=n={},e.uniformArrayNamesById={},t=0;t<Kr.getProgramParameter(e,35718);++t){var i=Kr.getActiveUniform(e,t),a=i.name,s=i.size,u=Cr(a),c=u>0?a.slice(0,u):a,l=e.uniformIdCounter;for(e.uniformIdCounter+=s,o[c]=[s,l],r=0;r<s;++r)n[l]=r,e.uniformArrayNamesById[l++]=c}}function Ar(e){var t=Kr.currentProgram;if(t){var r=t.uniformLocsById[e];return"number"==typeof r&&(t.uniformLocsById[e]=r=Kr.getUniformLocation(t,t.uniformArrayNamesById[e]+(r>0?"["+r+"]":""))),r}mr.recordError(1282)}function Pr(e,t,r,n){if(r){Sr(e=mr.programs[e]);var o=Kr.getUniform(e,Ar(t));if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:I[r>>2]=o;break;case 2:U[r>>2]=o}else for(var i=0;i<o.length;i++)switch(n){case 0:I[r+4*i>>2]=o[i];break;case 2:U[r+4*i>>2]=o[i]}}else mr.recordError(1281)}function Tr(e,t,r,n){if(r){var o=Kr.getVertexAttrib(e,t);if(34975==t)I[r>>2]=o&&o.name;else if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:I[r>>2]=o;break;case 2:U[r>>2]=o;break;case 5:I[r>>2]=Math.fround(o)}else for(var i=0;i<o.length;i++)switch(n){case 0:I[r+4*i>>2]=o[i];break;case 2:U[r+4*i>>2]=o[i];break;case 5:I[r+4*i>>2]=Math.fround(o[i])}}else mr.recordError(1281)}function Fr(e){return 0==(e-=5120)?L:1==e?R:2==e?M:4==e?I:6==e?U:5==e||28922==e||28520==e||30779==e||30782==e?j:O}function Br(e){return 31-Math.clz32(e.BYTES_PER_ELEMENT)}function Dr(e,t,r,n,o,i){var a=Fr(e),s=Br(a),u=1<<s,c=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,l=function(e,t,r,n){var o;return t*(e*r+(o=n)-1&-o)}(r,n,c,mr.unpackAlignment);return a.subarray(o>>s,o+l>>s)}var Lr=[],Rr=[];function Mr(e){var t=P.buffer;try{return P.grow(e-t.byteLength+65535>>>16),X(),1}catch(e){}}var Or={inEventHandler:0,removeAllEventListeners:function(){for(var e=Or.eventHandlers.length-1;e>=0;--e)Or._removeHandler(e);Or.eventHandlers=[],Or.deferredCalls=[]},registerRemoveEventListeners:function(){Or.removeEventListenersRegistered||(ee.push(Or.removeAllEventListeners),Or.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 Or.deferredCalls){var i=Or.deferredCalls[o];if(i.targetFunction==e&&n(i.argsList,r))return}Or.deferredCalls.push({targetFunction:e,precedence:t,argsList:r}),Or.deferredCalls.sort((function(e,t){return e.precedence<t.precedence}))},removeDeferredCalls:function(e){for(var t=0;t<Or.deferredCalls.length;++t)Or.deferredCalls[t].targetFunction==e&&(Or.deferredCalls.splice(t,1),--t)},canPerformEventHandlerRequests:function(){return Or.inEventHandler&&Or.currentEventHandler.allowsDeferredCalls},runDeferredCalls:function(){if(Or.canPerformEventHandlerRequests())for(var e=0;e<Or.deferredCalls.length;++e){var t=Or.deferredCalls[e];Or.deferredCalls.splice(e,1),--e,t.targetFunction.apply(null,t.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:function(e,t){for(var r=0;r<Or.eventHandlers.length;++r)Or.eventHandlers[r].target!=e||t&&t!=Or.eventHandlers[r].eventTypeString||Or._removeHandler(r--)},_removeHandler:function(e){var t=Or.eventHandlers[e];t.target.removeEventListener(t.eventTypeString,t.eventListenerFunc,t.useCapture),Or.eventHandlers.splice(e,1)},registerOrRemoveHandler:function(e){var t=function(t){++Or.inEventHandler,Or.currentEventHandler=e,Or.runDeferredCalls(),e.handlerFunc(t),Or.runDeferredCalls(),--Or.inEventHandler};if(e.callbackfunc)e.eventListenerFunc=t,e.target.addEventListener(e.eventTypeString,t,e.useCapture),Or.eventHandlers.push(e),Or.registerRemoveEventListeners();else for(var r=0;r<Or.eventHandlers.length;++r)Or.eventHandlers[r].target==e.target&&Or.eventHandlers[r].eventTypeString==e.eventTypeString&&Or._removeHandler(r--)},getNodeNameForTarget:function(e){return e?e==window?"#window":e==screen?"#screen":e&&e.nodeName?e.nodeName:"":""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}},Ir=["default","low-power","high-performance"],jr=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0];var Ur={};function qr(){if(!qr.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",_:v||"./this.program"};for(var t in Ur)void 0===Ur[t]?delete e[t]:e[t]=Ur[t];var r=[];for(var t in e)r.push(t+"="+e[t]);qr.strings=r}return qr.strings}function Nr(e,t){var r;F=e,F=r=e,re()||(u.onExit&&u.onExit(r),B=!0),y(r,new ve(r))}var zr=Nr;function Hr(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=j[t>>2],s=j[t+4>>2];t+=8;var u=Ae.read(e,L,a,s,n);if(u<0)return-1;if(o+=u,u<s)break;void 0!==n&&(n+=u)}return o}function Wr(e){return e<-9007199254740992||e>9007199254740992?NaN:Number(e)}var Vr=[31,29,31,30,31,30,31,31,30,31,30,31],Gr=[31,28,31,30,31,30,31,31,30,31,30,31];function $r(e,t){L.set(e,t)}function Yr(e,t,r,n,o){var i={string:e=>{var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2);$(e,t=hn(r),r)}return t},array:e=>{var t=hn(e.length);return $r(e,t),t}},a=function(e){return u["_"+e]}(e),s=[],c=0;if(n)for(var l=0;l<n.length;l++){var f=i[r[l]];f?(0===c&&(c=fn()),s[l]=f(n[l])):s[l]=n[l]}var d=a.apply(null,s);return function(e){return 0!==c&&dn(c),function(e){return"string"===t?V(e):"boolean"===t?Boolean(e):e}(e)}(d)}var Xr=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(Xr.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=Xr,Ae.staticInit(),u.FS_createPath=Ae.createPath,u.FS_createDataFile=Ae.createDataFile,u.FS_createPreloadedFile=Ae.createPreloadedFile,u.FS_unlink=Ae.unlink,u.FS_createLazyFile=Ae.createLazyFile,u.FS_createDevice=Ae.createDevice,Ue=u.InternalError=je(Error,"InternalError"),function(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);We=e}(),Ge=u.BindingError=je(Error,"BindingError"),ct.prototype.isAliasOf=function(e){if(!(this instanceof ct))return!1;if(!(e instanceof ct))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},ct.prototype.clone=function(){if(this.$$.ptr||Qe(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=ut(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},ct.prototype.delete=function(){this.$$.ptr||Qe(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&$e("Object already scheduled for deletion"),Je(this),et(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},ct.prototype.isDeleted=function(){return!this.$$.ptr},ct.prototype.deleteLater=function(){return this.$$.ptr||Qe(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&$e("Object already scheduled for deletion"),nt.push(this),1===nt.length&&it&&it(ot),this.$$.deleteScheduled=!0,this},u.getInheritedInstanceCount=function(){return Object.keys(at).length},u.getLiveInheritedInstances=function(){var e=[];for(var t in at)at.hasOwnProperty(t)&&e.push(at[t]);return e},u.flushPendingDeletes=ot,u.setDelayFunction=function(e){it=e,nt.length&&it&&it(ot)},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=De,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&&$e("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),at[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?st(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):st(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,a=this.registeredClass.getActualType(t),s=rt[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=tt(t,this.registeredClass,i.registeredClass);return null===u?o.call(this):this.isSmartPointer?st(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:e}):st(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})},_t=u.UnboundTypeError=je(Error,"UnboundTypeError"),u.count_emval_handles=function(){for(var e=0,t=5;t<Tt.length;++t)void 0!==Tt[t]&&++e;return e},u.get_first_emval=function(){for(var e=5;e<Tt.length;++e)if(void 0!==Tt[e])return Tt[e];return null},u.requestFullscreen=function(e,t){sr.requestFullscreen(e,t)},u.requestAnimationFrame=function(e){sr.requestAnimationFrame(e)},u.setCanvasSize=function(e,t,r){sr.setCanvasSize(e,t,r)},u.pauseMainLoop=function(){sr.mainLoop.pause()},u.resumeMainLoop=function(){sr.mainLoop.resume()},u.getUserMedia=function(){sr.getUserMedia()},u.createContext=function(e,t,r,n){return sr.createContext(e,t,r,n)};for(var Kr,Qr={},Zr={},Jr=0;Jr<32;++Jr)yr.push(new Array(Jr));var en=new Float32Array(288);for(Jr=0;Jr<288;++Jr)Lr[Jr]=en.subarray(0,Jr+1);var tn=new Int32Array(288);for(Jr=0;Jr<288;++Jr)Rr[Jr]=tn.subarray(0,Jr+1);var rn,nn={h:function(e,t,r){throw new be(e).init(t,r),e},T:function(e,t,r){Pe.varargs=r;try{var n=Pe.getStreamFromFD(e);switch(t){case 0:return(o=Pe.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=Pe.get();return n.flags|=o,0;case 5:return o=Pe.get(),M[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return 28,I[sn()>>2]=28,-1}}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return-e.errno}},wb:function(e,t){try{var r=Pe.getStreamFromFD(e);return Pe.doStat(Ae.stat,r.path,t)}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return-e.errno}},Ib:function(e,t,r){Pe.varargs=r;try{var n=Pe.getStreamFromFD(e);switch(t){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=Pe.get();return I[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=Pe.get(),Ae.ioctl(n,t,o);default:return-28}}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return-e.errno}},tb:function(e,t){try{return e=Pe.getStr(e),Pe.doStat(Ae.lstat,e,t)}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return-e.errno}},ub:function(e,t,r,n){try{t=Pe.getStr(t);var o=256&n,i=4096&n;return n&=-6401,t=Pe.calculateAt(e,t,i),Pe.doStat(o?Ae.lstat:Ae.stat,t,r)}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return-e.errno}},ga:function(e,t,r,n){Pe.varargs=n;try{t=Pe.getStr(t),t=Pe.calculateAt(e,t);var o=n?Pe.get():0;return Ae.open(t,r,o).fd}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return-e.errno}},vb:function(e,t){try{return e=Pe.getStr(e),Pe.doStat(Ae.stat,e,t)}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return-e.errno}},Fb:function(e){},Hb:function(e,t){de(Te)},Gb:function(e,t){de(Te)},ka:function(e){var t=Fe[e];delete Fe[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;Ne([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,c=t.setterContext;t.read=e=>o.fromWireType(i(a,e)),t.write=(e,t)=>{var r=[];u(c,e,s.toWireType(r,t)),Be(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:De,destructorFunction:a}]}))},u:function(e){var t=ze[e];delete ze[e];var r=t.rawConstructor,n=t.rawDestructor,o=t.fields;Ne([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,c=e[r+o.length],l=t.setter,f=t.setterContext;i[n]={read:e=>a.fromWireType(s(u,e)),write:(e,t)=>{var r=[];l(f,e,c.toWireType(r,t)),Be(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:De,destructorFunction:n}]}))},oa:function(e,t,r,n,o){t=Ve(t);var i=Ke(r),a=-1!=t.indexOf("u");a&&(o=(1n<<64n)-1n),Ye(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:Xe(t,i,!a),destructorFunction:null})},oe:function(e,t,r,n,o){var i=Ke(r);Ye(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=L;else if(2===r)n=M;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+t);n=I}return this.fromWireType(n[e>>i])},destructorFunction:null})},p:function(e,t,r,n,o,i,a,s,u,c,l,f,d){l=Ve(l),i=Et(o,i),s&&(s=Et(a,s)),c&&(c=Et(u,c)),d=Et(f,d);var h=Oe(l);ft(h,(function(){kt("Cannot construct "+l+" due to unbound types",[n])})),Ne([e,t,r],n?[n]:[],(function(t){var r,o;t=t[0],o=n?(r=t.registeredClass).instancePrototype:ct.prototype;var a=Ie(h,(function(){if(Object.getPrototypeOf(this)!==u)throw new Ge("Use 'new' to construct "+l);if(void 0===f.constructor_body)throw new Ge(l+" has no accessible constructor");var e=f.constructor_body[arguments.length];if(void 0===e)throw new Ge("Tried to invoke ctor of "+l+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(f.constructor_body).toString()+") parameters instead!");return e.apply(this,arguments)})),u=Object.create(o,{constructor:{value:a}});a.prototype=u;var f=new dt(l,a,u,d,r,i,s,c),p=new vt(l,f,!0,!1,!1),m=new vt(l+"*",f,!1,!1,!1),g=new vt(l+" const*",f,!1,!0,!1);return rt[e]={pointerType:m,constPointerType:g},yt(h,a),[p,m,g]}))},q:function(e,t,r,n,o,i){D(t>0);var a=Ct(t,r);o=Et(n,o),Ne([],[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 Ge("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)},Ne([],a,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=At(r,n,null,o,i),[]})),[]}))},c:function(e,t,r,n,o,i,a,s){var u=Ct(r,n);t=Ve(t),i=Et(o,i),Ne([],[e],(function(e){var n=(e=e[0]).name+"."+t;function o(){kt("Cannot call "+n+" due to unbound types",u)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var c=e.registeredClass.instancePrototype,l=c[t];return void 0===l||void 0===l.overloadTable&&l.className!==e.name&&l.argCount===r-2?(o.argCount=r-2,o.className=e.name,c[t]=o):(lt(c,t,n),c[t].overloadTable[r-2]=o),Ne([],u,(function(o){var s=At(n,o,e,i,a);return void 0===c[t].overloadTable?(s.argCount=r-2,c[t]=s):c[t].overloadTable[r-2]=s,[]})),[]}))},ne:function(e,t){Ye(e,{name:t=Ve(t),fromWireType:function(e){var t=Bt.toValue(e);return Ft(e),t},toWireType:function(e,t){return Bt.toHandle(t)},argPackAdvance:8,readValueFromPointer:De,destructorFunction:null})},L:function(e,t,r,n){var o=Ke(r);function i(){}t=Ve(t),i.values={},Ye(e,{name:t,constructor:i,fromWireType:function(e){return this.constructor.values[e]},toWireType:function(e,t){return t.value},argPackAdvance:8,readValueFromPointer:Dt(t,o,n),destructorFunction:null}),ft(t,i)},w:function(e,t,r){var n=Lt(e,"enum");t=Ve(t);var o=n.constructor,i=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:Ie(n.name+"_"+t,(function(){}))}});o.values[r]=i,o[t]=i},na:function(e,t,r){var n=Ke(r);Ye(e,{name:t=Ve(t),fromWireType:function(e){return e},toWireType:function(e,t){return t},argPackAdvance:8,readValueFromPointer:Rt(t,n),destructorFunction:null})},D:function(e,t,r,n,o,i){var a=Ct(t,r);e=Ve(e),o=Et(n,o),ft(e,(function(){kt("Cannot call "+e+" due to unbound types",a)}),t-1),Ne([],a,(function(r){var n=[r[0],null].concat(r.slice(1));return yt(e,At(e,n,null,o,i),t-1),[]}))},H:function(e,t,r,n,o){t=Ve(t),-1===o&&(o=4294967295);var i=Ke(r),a=e=>e;if(0===n){var s=32-8*r;a=e=>e<<s>>>s}var u=t.includes("unsigned");Ye(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:Xe(t,i,0!==n),destructorFunction:null})},z:function(e,t,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];function o(e){var t=j,r=t[e>>=2],o=t[e+1];return new n(t.buffer,o,r)}Ye(e,{name:r=Ve(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Ae:function(e,t,r,n,o,i,a,s,u,c,l,f){r=Ve(r),i=Et(o,i),s=Et(a,s),c=Et(u,c),f=Et(l,f),Ne([e],[t],(function(e){return e=e[0],[new vt(r,e.registeredClass,!1,!1,!0,e,n,i,s,c,f)]}))},ma:function(e,t){var r="std::string"===(t=Ve(t));Ye(e,{name:t,fromWireType:function(e){var t,n=j[e>>2],o=e+4;if(r)for(var i=o,a=0;a<=n;++a){var s=o+a;if(a==n||0==R[s]){var u=V(i,s-i);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),i=s+1}}else{var c=new Array(n);for(a=0;a<n;++a)c[a]=String.fromCharCode(R[o+a]);t=c.join("")}return an(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||$e("Cannot pass non-string to std::string"),n=r&&o?Y(t):t.length;var i=on(4+n+1),a=i+4;if(j[i>>2]=n,r&&o)$(t,a,n+1);else if(o)for(var s=0;s<n;++s){var u=t.charCodeAt(s);u>255&&(an(a),$e("String has UTF-16 code units that do not fit in 8 bits")),R[a+s]=u}else for(s=0;s<n;++s)R[a+s]=t[s];return null!==e&&e.push(an,i),i},argPackAdvance:8,readValueFromPointer:De,destructorFunction:function(e){an(e)}})},V:function(e,t,r){var n,o,i,a,s;r=Ve(r),2===t?(n=Ot,o=It,a=jt,i=()=>O,s=1):4===t&&(n=Ut,o=qt,a=Nt,i=()=>j,s=2),Ye(e,{name:r,fromWireType:function(e){for(var r,o=j[e>>2],a=i(),u=e+4,c=0;c<=o;++c){var l=e+4+c*t;if(c==o||0==a[l>>s]){var f=n(u,l-u);void 0===r?r=f:(r+=String.fromCharCode(0),r+=f),u=l+t}}return an(e),r},toWireType:function(e,n){"string"!=typeof n&&$e("Cannot pass non-string to C++ string type "+r);var i=a(n),u=on(4+i+t);return j[u>>2]=i>>s,o(n,u+4,i+t),null!==e&&e.push(an,u),u},argPackAdvance:8,readValueFromPointer:De,destructorFunction:function(e){an(e)}})},la:function(e,t,r,n,o,i){Fe[e]={name:Ve(t),rawConstructor:Et(r,n),rawDestructor:Et(o,i),elements:[]}},G:function(e,t,r,n,o,i,a,s,u){Fe[e].elements.push({getterReturnType:t,getter:Et(r,n),getterContext:o,setterArgumentType:i,setter:Et(a,s),setterContext:u})},v:function(e,t,r,n,o,i){ze[e]={name:Ve(t),rawConstructor:Et(r,n),rawDestructor:Et(o,i),fields:[]}},j:function(e,t,r,n,o,i,a,s,u,c){ze[e].fields.push({fieldName:Ve(t),getterReturnType:r,getter:Et(n,o),getterContext:i,setterArgumentType:a,setter:Et(s,u),setterContext:c})},pe:function(e,t){Ye(e,{isVoid:!0,name:t=Ve(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})},zb:function(){return!0},jb:function(){throw 1/0},k:function(e,t,r){e=Bt.toValue(e),t=Lt(t,"emval::as");var n=[],o=Bt.toHandle(n);return j[r>>2]=o,t.toWireType(n,e)},o:function(e,t,r,n){e=Bt.toValue(e);for(var o=zt(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)},N:function(e,t,r,n,o){return(e=Vt[e])(t=Bt.toValue(t),r=Wt(r),function(e){var t=[];return j[e>>2]=Bt.toHandle(t),t}(n),o)},M:function(e,t,r,n){(e=Vt[e])(t=Bt.toValue(t),r=Wt(r),null,n)},b:Ft,Sd:function(e,t){return(e=Bt.toValue(e))==Bt.toValue(t)},A:function(e){return 0===e?Bt.toHandle(Gt()):(e=Wt(e),Bt.toHandle(Gt()[e]))},E:function(e,t){var r=zt(e,t),n=r[0],o=n.name+"_$"+r.slice(1).map((function(e){return e.name})).join("_")+"$",i=$t[o];if(void 0!==i)return i;for(var a=["retType"],s=[n],u="",c=0;c<e-1;++c)u+=(0!==c?", ":"")+"arg"+c,a.push("argType"+c),s.push(r[1+c]);var l,f,d="return function "+Oe("methodCaller_"+o)+"(handle, name, destructors, args) {\n",h=0;for(c=0;c<e-1;++c)d+=" var arg"+c+" = argType"+c+".readValueFromPointer(args"+(h?"+"+h:"")+");\n",h+=r[c+1].argPackAdvance;for(d+=" var rv = handle[name]("+u+");\n",c=0;c<e-1;++c)r[c+1].deleteObject&&(d+=" argType"+c+".deleteObject(arg"+c+");\n");return n.isVoid||(d+=" return retType.toWireType(destructors, rv);\n"),d+="};\n",a.push(d),l=St(Function,a).apply(null,s),f=Vt.length,Vt.push(l),i=f,$t[o]=i,i},g:function(e,t){return e=Bt.toValue(e),t=Bt.toValue(t),Bt.toHandle(e[t])},d:function(e){e>4&&(Tt[e].refcount+=1)},Lg:function(e,t){return(e=Bt.toValue(e))instanceof Bt.toValue(t)},U:function(e){return"number"==typeof(e=Bt.toValue(e))},F:function(e){return"string"==typeof(e=Bt.toValue(e))},qe:function(e,t,r,n){e=Bt.toValue(e);var o=Yt[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)(Lt,u,Bt.toHandle,(()=>j))}(t),Yt[t]=o),o(e,r,n)},I:function(){return Bt.toHandle([])},f:function(e){return Bt.toHandle(Wt(e))},C:function(){return Bt.toHandle({})},i:function(e){Be(Bt.toValue(e)),Ft(e)},s:function(e,t,r){e=Bt.toValue(e),t=Bt.toValue(t),r=Bt.toValue(r),e[t]=r},e:function(e,t){var r=(e=Lt(e,"_emval_take_value")).readValueFromPointer(t);return Bt.toHandle(r)},le:function(e){throw Bt.toValue(e)},Ab:function(e,t){var r=new Date(1e3*Xt(e));I[t>>2]=r.getUTCSeconds(),I[t+4>>2]=r.getUTCMinutes(),I[t+8>>2]=r.getUTCHours(),I[t+12>>2]=r.getUTCDate(),I[t+16>>2]=r.getUTCMonth(),I[t+20>>2]=r.getUTCFullYear()-1900,I[t+24>>2]=r.getUTCDay();var n=Date.UTC(r.getUTCFullYear(),0,1,0,0,0,0),o=(r.getTime()-n)/864e5|0;I[t+28>>2]=o},Bb:function(e,t){var r=new Date(1e3*Xt(e));I[t>>2]=r.getSeconds(),I[t+4>>2]=r.getMinutes(),I[t+8>>2]=r.getHours(),I[t+12>>2]=r.getDate(),I[t+16>>2]=r.getMonth(),I[t+20>>2]=r.getFullYear()-1900,I[t+24>>2]=r.getDay();var n=0|er(r);I[t+28>>2]=n,I[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));I[t+32>>2]=s},Cb:function(e){var t=new Date(I[e+20>>2]+1900,I[e+16>>2],I[e+12>>2],I[e+8>>2],I[e+4>>2],I[e>>2],0),r=I[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)I[e+32>>2]=Number(i!=a&&s==n);else if(r>0!=(s==n)){var u=Math.max(a,i),c=r>0?s:u;t.setTime(t.getTime()+6e4*(c-n))}I[e+24>>2]=t.getDay();var l=0|er(t);return I[e+28>>2]=l,I[e>>2]=t.getSeconds(),I[e+4>>2]=t.getMinutes(),I[e+8>>2]=t.getHours(),I[e+12>>2]=t.getDate(),I[e+16>>2]=t.getMonth(),I[e+20>>2]=t.getYear(),t.getTime()/1e3|0},ob:function(e,t,r,n,o,i,a){try{var s=Pe.getStreamFromFD(n),u=Ae.mmap(s,e,o,t,r),c=u.ptr;return I[i>>2]=u.allocated,j[a>>2]=c,0}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return-e.errno}},pb:function(e,t,r,n,o,i){try{var a=Pe.getStreamFromFD(o);2&r&&Pe.doMsync(e,a,t,n,i),Ae.munmap(a)}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return-e.errno}},Db:function(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 c(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}j[e>>2]=60*u,I[t>>2]=Number(a!=s);var l=c(o),f=c(i),d=tr(l),h=tr(f);s<a?(j[r>>2]=d,j[r+4>>2]=h):(j[r>>2]=h,j[r+4>>2]=d)},a:function(){de("")},ea:function(e,t,r,n,o){return ur.chooseConfig(e,t,r,n,o)},fa:function(e,t,r,n){if(62e3!=e)return ur.setErrorCode(12296),0;for(var o=1;;){var i=I[n>>2];if(12440!=i){if(12344==i)break;return ur.setErrorCode(12292),0}o=I[n+4>>2],n+=8}return o<2||o>3?(ur.setErrorCode(12293),0):(ur.contextAttributes.majorVersion=o-1,ur.contextAttributes.minorVersion=0,ur.context=mr.createContext(u.canvas,ur.contextAttributes),0!=ur.context?(ur.setErrorCode(12288),mr.makeContextCurrent(ur.context),u.useWebGL=!0,sr.moduleContextCreatedCallbacks.forEach((function(e){e()})),mr.makeContextCurrent(null),62004):(ur.setErrorCode(12297),0))},bb:function(e,t,r,n){return 62e3!=e?(ur.setErrorCode(12296),0):62002!=t?(ur.setErrorCode(12293),0):(ur.setErrorCode(12288),62006)},gc:function(e,t){return 62e3!=e?(ur.setErrorCode(12296),0):62004!=t?(ur.setErrorCode(12294),0):(mr.deleteContext(ur.context),ur.setErrorCode(12288),ur.currentContext==t&&(ur.currentContext=0),1)},Xb:function(e,t){return 62e3!=e?(ur.setErrorCode(12296),0):62006!=t?(ur.setErrorCode(12301),1):(ur.currentReadSurface==t&&(ur.currentReadSurface=0),ur.currentDrawSurface==t&&(ur.currentDrawSurface=0),ur.setErrorCode(12288),1)},J:function(e,t,r,n){if(62e3!=e)return ur.setErrorCode(12296),0;if(62002!=t)return ur.setErrorCode(12293),0;if(!n)return ur.setErrorCode(12300),0;switch(ur.setErrorCode(12288),r){case 12320:return I[n>>2]=ur.contextAttributes.alpha?32:24,1;case 12321:return I[n>>2]=ur.contextAttributes.alpha?8:0,1;case 12322:case 12323:case 12324:return I[n>>2]=8,1;case 12325:return I[n>>2]=ur.contextAttributes.depth?24:0,1;case 12326:return I[n>>2]=ur.contextAttributes.stencil?8:0,1;case 12327:case 12335:case 12340:return I[n>>2]=12344,1;case 12328:return I[n>>2]=62002,1;case 12329:case 12333:case 12334:case 12345:case 12346:case 12347:case 12349:case 12350:case 12354:return I[n>>2]=0,1;case 12330:case 12332:return I[n>>2]=4096,1;case 12331:return I[n>>2]=16777216,1;case 12337:return I[n>>2]=ur.contextAttributes.antialias?4:0,1;case 12338:return I[n>>2]=ur.contextAttributes.antialias?1:0,1;case 12339:case 12352:return I[n>>2]=4,1;case 12341:case 12342:case 12343:return I[n>>2]=-1,1;case 12348:return I[n>>2]=1,1;case 12351:return I[n>>2]=12430,1;default:return ur.setErrorCode(12292),0}},mb:function(e){return ur.setErrorCode(12288),62e3},ha:function(){return ur.errorCode},gb:function(e,t,r){return 62e3!=e?(ur.setErrorCode(12296),0):(t&&(I[t>>2]=1),r&&(I[r>>2]=4),ur.defaultDisplayInitialized=!0,ur.setErrorCode(12288),1)},xb:function(e,t,r,n){return 62e3!=e?(ur.setErrorCode(12296),0):0!=n&&62004!=n?(ur.setErrorCode(12294),0):0!=r&&62006!=r||0!=t&&62006!=t?(ur.setErrorCode(12301),0):(mr.makeContextCurrent(n?ur.context:null),ur.currentContext=n,ur.currentDrawSurface=t,ur.currentReadSurface=r,ur.setErrorCode(12288),1)},rc:function(){if(ur.defaultDisplayInitialized)if(u.ctx){if(!u.ctx.isContextLost())return ur.setErrorCode(12288),1;ur.setErrorCode(12302)}else ur.setErrorCode(12290);else ur.setErrorCode(12289);return 0},Mb:function(e){return 62e3!=e?(ur.setErrorCode(12296),0):(ur.currentContext=0,ur.currentReadSurface=0,ur.currentDrawSurface=0,ur.defaultDisplayInitialized=!1,ur.setErrorCode(12288),1)},y:function(e,t,r){return function(e,t,r){var n=function(e,t){var r;for(gr.length=0,t>>=2;r=R[e++];)t+=105!=r&t,gr.push(105==r?I[t]:(106==r?q:z)[t++>>1]),++t;return gr}(t,r);return ge[e].apply(null,n)}(e,t,r)},Be:function(e){console.error(V(e))},Ce:function(e){console.log(V(e))},X:function(e){console.warn(V(e))},R:function(){return Date.now()},re:function(){},lb:function(){return 2147483648},yb:Qt,Zf:function(e){Kr.activeTexture(e)},_f:function(e,t){Kr.attachShader(mr.programs[e],mr.shaders[t])},ad:function(e,t){Kr.beginQuery(e,mr.queries[t])},ie:function(e,t){Kr.disjointTimerQueryExt.beginQueryEXT(e,mr.queries[t])},Pc:function(e){Kr.beginTransformFeedback(e)},$f:function(e,t,r){Kr.bindAttribLocation(mr.programs[e],t,V(r))},ag:function(e,t){35051==e?Kr.currentPixelPackBufferBinding=t:35052==e&&(Kr.currentPixelUnpackBufferBinding=t),Kr.bindBuffer(e,mr.buffers[t])},Mc:function(e,t,r){Kr.bindBufferBase(e,t,mr.buffers[r])},Nc:function(e,t,r,n,o){Kr.bindBufferRange(e,t,mr.buffers[r],n,o)},$e:function(e,t){Kr.bindFramebuffer(e,mr.framebuffers[t])},af:function(e,t){Kr.bindRenderbuffer(e,mr.renderbuffers[t])},Le:function(e,t){Kr.bindSampler(e,mr.samplers[t])},bg:function(e,t){Kr.bindTexture(e,mr.textures[t])},$b:function(e,t){Kr.bindTransformFeedback(e,mr.transformFeedbacks[t])},vf:function(e){Kr.bindVertexArray(mr.vaos[e])},yf:function(e){Kr.bindVertexArray(mr.vaos[e])},cg:function(e,t,r,n){Kr.blendColor(e,t,r,n)},dg:function(e){Kr.blendEquation(e)},Xd:function(e,t){Kr.blendEquationSeparate(e,t)},eg:function(e,t){Kr.blendFunc(e,t)},Wd:function(e,t,r,n){Kr.blendFuncSeparate(e,t,r,n)},Ve:function(e,t,r,n,o,i,a,s,u,c){Kr.blitFramebuffer(e,t,r,n,o,i,a,s,u,c)},fg:function(e,t,r,n){mr.currentContext.version>=2?r&&t?Kr.bufferData(e,R,n,r,t):Kr.bufferData(e,t,n):Kr.bufferData(e,r?R.subarray(r,r+t):t,n)},gg:function(e,t,r,n){mr.currentContext.version>=2?r&&Kr.bufferSubData(e,t,R,n,r):Kr.bufferSubData(e,t,R.subarray(n,n+r))},bf:function(e){return Kr.checkFramebufferStatus(e)},hg:function(e){Kr.clear(e)},pc:function(e,t,r,n){Kr.clearBufferfi(e,t,r,n)},qc:function(e,t,r){Kr.clearBufferfv(e,t,U,r>>2)},tc:function(e,t,r){Kr.clearBufferiv(e,t,I,r>>2)},sc:function(e,t,r){Kr.clearBufferuiv(e,t,j,r>>2)},ig:function(e,t,r,n){Kr.clearColor(e,t,r,n)},Vd:function(e){Kr.clearDepth(e)},jg:function(e){Kr.clearStencil(e)},_:function(e,t,r,n){return Kr.clientWaitSync(mr.syncs[e],t,vr(r,n))},kg:function(e,t,r,n){Kr.colorMask(!!e,!!t,!!r,!!n)},lg:function(e){Kr.compileShader(mr.shaders[e])},mg:function(e,t,r,n,o,i,a,s){mr.currentContext.version>=2?Kr.currentPixelUnpackBufferBinding||!a?Kr.compressedTexImage2D(e,t,r,n,o,i,a,s):Kr.compressedTexImage2D(e,t,r,n,o,i,R,s,a):Kr.compressedTexImage2D(e,t,r,n,o,i,s?R.subarray(s,s+a):null)},fd:function(e,t,r,n,o,i,a,s,u){Kr.currentPixelUnpackBufferBinding?Kr.compressedTexImage3D(e,t,r,n,o,i,a,s,u):Kr.compressedTexImage3D(e,t,r,n,o,i,a,R,u,s)},ng:function(e,t,r,n,o,i,a,s,u){mr.currentContext.version>=2?Kr.currentPixelUnpackBufferBinding||!s?Kr.compressedTexSubImage2D(e,t,r,n,o,i,a,s,u):Kr.compressedTexSubImage2D(e,t,r,n,o,i,a,R,u,s):Kr.compressedTexSubImage2D(e,t,r,n,o,i,a,u?R.subarray(u,u+s):null)},ed:function(e,t,r,n,o,i,a,s,u,c,l){Kr.currentPixelUnpackBufferBinding?Kr.compressedTexSubImage3D(e,t,r,n,o,i,a,s,u,c,l):Kr.compressedTexSubImage3D(e,t,r,n,o,i,a,s,u,R,l,c)},Te:function(e,t,r,n,o){Kr.copyBufferSubData(e,t,r,n,o)},Ud:function(e,t,r,n,o,i,a,s){Kr.copyTexImage2D(e,t,r,n,o,i,a,s)},og:function(e,t,r,n,o,i,a,s){Kr.copyTexSubImage2D(e,t,r,n,o,i,a,s)},gd:function(e,t,r,n,o,i,a,s,u){Kr.copyTexSubImage3D(e,t,r,n,o,i,a,s,u)},pg:function(){var e=mr.getNewId(mr.programs),t=Kr.createProgram();return t.name=e,t.maxUniformLength=t.maxAttributeLength=t.maxUniformBlockNameLength=0,t.uniformIdCounter=1,mr.programs[e]=t,e},qg:function(e){var t=mr.getNewId(mr.shaders);return mr.shaders[t]=Kr.createShader(e),t},rg:function(e){Kr.cullFace(e)},sg:function(e,t){for(var r=0;r<e;r++){var n=I[t+4*r>>2],o=mr.buffers[n];o&&(Kr.deleteBuffer(o),o.name=0,mr.buffers[n]=null,n==Kr.currentPixelPackBufferBinding&&(Kr.currentPixelPackBufferBinding=0),n==Kr.currentPixelUnpackBufferBinding&&(Kr.currentPixelUnpackBufferBinding=0))}},cf:function(e,t){for(var r=0;r<e;++r){var n=I[t+4*r>>2],o=mr.framebuffers[n];o&&(Kr.deleteFramebuffer(o),o.name=0,mr.framebuffers[n]=null)}},tg:function(e){if(e){var t=mr.programs[e];t?(Kr.deleteProgram(t),t.name=0,mr.programs[e]=null):mr.recordError(1281)}},cd:function(e,t){for(var r=0;r<e;r++){var n=I[t+4*r>>2],o=mr.queries[n];o&&(Kr.deleteQuery(o),mr.queries[n]=null)}},ke:function(e,t){for(var r=0;r<e;r++){var n=I[t+4*r>>2],o=mr.queries[n];o&&(Kr.disjointTimerQueryExt.deleteQueryEXT(o),mr.queries[n]=null)}},df:function(e,t){for(var r=0;r<e;r++){var n=I[t+4*r>>2],o=mr.renderbuffers[n];o&&(Kr.deleteRenderbuffer(o),o.name=0,mr.renderbuffers[n]=null)}},Me:function(e,t){for(var r=0;r<e;r++){var n=I[t+4*r>>2],o=mr.samplers[n];o&&(Kr.deleteSampler(o),o.name=0,mr.samplers[n]=null)}},ug:function(e){if(e){var t=mr.shaders[e];t?(Kr.deleteShader(t),mr.shaders[e]=null):mr.recordError(1281)}},Ue:function(e){if(e){var t=mr.syncs[e];t?(Kr.deleteSync(t),t.name=0,mr.syncs[e]=null):mr.recordError(1281)}},vg:function(e,t){for(var r=0;r<e;r++){var n=I[t+4*r>>2],o=mr.textures[n];o&&(Kr.deleteTexture(o),o.name=0,mr.textures[n]=null)}},_b:function(e,t){for(var r=0;r<e;r++){var n=I[t+4*r>>2],o=mr.transformFeedbacks[n];o&&(Kr.deleteTransformFeedback(o),o.name=0,mr.transformFeedbacks[n]=null)}},wf:function(e,t){for(var r=0;r<e;r++){var n=I[t+4*r>>2];Kr.deleteVertexArray(mr.vaos[n]),mr.vaos[n]=null}},zf:function(e,t){for(var r=0;r<e;r++){var n=I[t+4*r>>2];Kr.deleteVertexArray(mr.vaos[n]),mr.vaos[n]=null}},Td:function(e){Kr.depthFunc(e)},wg:function(e){Kr.depthMask(!!e)},Rd:function(e,t){Kr.depthRange(e,t)},Qd:function(e,t){Kr.detachShader(mr.programs[e],mr.shaders[t])},xg:function(e){Kr.disable(e)},yg:function(e){Kr.disableVertexAttribArray(e)},zg:function(e,t,r){Kr.drawArrays(e,t,r)},tf:function(e,t,r,n){Kr.drawArraysInstanced(e,t,r,n)},_d:function(e,t,r,n){Kr.drawArraysInstanced(e,t,r,n)},Lb:function(e,t,r,n){Kr.drawArraysInstanced(e,t,r,n)},rf:function(e,t,r,n,o){Kr.dibvbi.drawArraysInstancedBaseInstanceWEBGL(e,t,r,n,o)},ld:function(e,t,r,n){Kr.drawArraysInstanced(e,t,r,n)},Nb:function(e,t,r,n){Kr.drawArraysInstanced(e,t,r,n)},pf:function(e,t){for(var r=yr[e],n=0;n<e;n++)r[n]=I[t+4*n>>2];Kr.drawBuffers(r)},jd:function(e,t){for(var r=yr[e],n=0;n<e;n++)r[n]=I[t+4*n>>2];Kr.drawBuffers(r)},$d:function(e,t){for(var r=yr[e],n=0;n<e;n++)r[n]=I[t+4*n>>2];Kr.drawBuffers(r)},Ag:function(e,t,r,n){Kr.drawElements(e,t,r,n)},uf:function(e,t,r,n,o){Kr.drawElementsInstanced(e,t,r,n,o)},Zd:function(e,t,r,n,o){Kr.drawElementsInstanced(e,t,r,n,o)},Jb:function(e,t,r,n,o){Kr.drawElementsInstanced(e,t,r,n,o)},sf:function(e,t,r,n,o,i,a){Kr.dibvbi.drawElementsInstancedBaseVertexBaseInstanceWEBGL(e,t,r,n,o,i,a)},Kb:function(e,t,r,n,o){Kr.drawElementsInstanced(e,t,r,n,o)},kd:function(e,t,r,n,o){Kr.drawElementsInstanced(e,t,r,n,o)},jf:function(e,t,r,n,o,i){!function(e,t,r,n){Kr.drawElements(e,t,r,n)}(e,n,o,i)},Bg:function(e){Kr.enable(e)},Cg:function(e){Kr.enableVertexAttribArray(e)},$c:function(e){Kr.endQuery(e)},he:function(e){Kr.disjointTimerQueryExt.endQueryEXT(e)},Oc:function(){Kr.endTransformFeedback()},Re:function(e,t){var r=Kr.fenceSync(e,t);if(r){var n=mr.getNewId(mr.syncs);return r.name=n,mr.syncs[n]=r,n}return 0},Dg:function(){Kr.finish()},Eg:function(){Kr.flush()},ef:function(e,t,r,n){Kr.framebufferRenderbuffer(e,t,r,mr.renderbuffers[n])},ff:function(e,t,r,n,o){Kr.framebufferTexture2D(e,t,r,mr.textures[n],o)},Sc:function(e,t,r,n,o){Kr.framebufferTextureLayer(e,t,mr.textures[r],n,o)},Fg:function(e){Kr.frontFace(e)},Gg:function(e,t){br(e,t,"createBuffer",mr.buffers)},gf:function(e,t){br(e,t,"createFramebuffer",mr.framebuffers)},dd:function(e,t){br(e,t,"createQuery",mr.queries)},me:function(e,t){for(var r=0;r<e;r++){var n=Kr.disjointTimerQueryExt.createQueryEXT();if(!n){for(mr.recordError(1282);r<e;)I[t+4*r++>>2]=0;return}var o=mr.getNewId(mr.queries);n.name=o,mr.queries[o]=n,I[t+4*r>>2]=o}},hf:function(e,t){br(e,t,"createRenderbuffer",mr.renderbuffers)},Ne:function(e,t){br(e,t,"createSampler",mr.samplers)},Hg:function(e,t){br(e,t,"createTexture",mr.textures)},Zb:function(e,t){br(e,t,"createTransformFeedback",mr.transformFeedbacks)},xf:function(e,t){br(e,t,"createVertexArray",mr.vaos)},Af:function(e,t){br(e,t,"createVertexArray",mr.vaos)},Xe:function(e){Kr.generateMipmap(e)},Pd:function(e,t,r,n,o,i,a){wr("getActiveAttrib",e,t,r,n,o,i,a)},Od:function(e,t,r,n,o,i,a){wr("getActiveUniform",e,t,r,n,o,i,a)},kc:function(e,t,r,n,o){e=mr.programs[e];var i=Kr.getActiveUniformBlockName(e,t);if(i)if(o&&r>0){var a=$(i,o,r);n&&(I[n>>2]=a)}else n&&(I[n>>2]=0)},lc:function(e,t,r,n){if(n)if(e=mr.programs[e],35393!=r){var o=Kr.getActiveUniformBlockParameter(e,t,r);if(null!==o)if(35395==r)for(var i=0;i<o.length;i++)I[n+4*i>>2]=o[i];else I[n>>2]=o}else{var a=Kr.getActiveUniformBlockName(e,t);I[n>>2]=a.length+1}else mr.recordError(1281)},nc:function(e,t,r,n,o){if(o)if(t>0&&0==r)mr.recordError(1281);else{e=mr.programs[e];for(var i=[],a=0;a<t;a++)i.push(I[r+4*a>>2]);var s=Kr.getActiveUniforms(e,i,n);if(s){var u=s.length;for(a=0;a<u;a++)I[o+4*a>>2]=s[a]}}else mr.recordError(1281)},Nd:function(e,t,r,n){var o=Kr.getAttachedShaders(mr.programs[e]),i=o.length;i>t&&(i=t),I[r>>2]=i;for(var a=0;a<i;++a){var s=mr.shaders.indexOf(o[a]);I[n+4*a>>2]=s}},Md:function(e,t){return Kr.getAttribLocation(mr.programs[e],V(t))},Ld:function(e,t){_r(e,t,4)},ec:function(e,t,r){r?Er(r,Kr.getBufferParameter(e,t)):mr.recordError(1281)},Ig:function(e,t,r){r?I[r>>2]=Kr.getBufferParameter(e,t):mr.recordError(1281)},Jg:function(){var e=Kr.getError()||mr.lastError;return mr.lastError=0,e},Kg:function(e,t){_r(e,t,2)},Cc:function(e,t){return Kr.getFragDataLocation(mr.programs[e],V(t))},Ye:function(e,t,r,n){var o=Kr.getFramebufferAttachmentParameter(e,t,r);(o instanceof WebGLRenderbuffer||o instanceof WebGLTexture)&&(o=0|o.name),I[n>>2]=o},fc:function(e,t,r){xr(e,t,r,1)},ic:function(e,t){_r(e,t,1)},Qc:function(e,t,r){xr(e,t,r,0)},Ia:function(e,t){_r(e,t,0)},Qb:function(e,t,r,n,o){if(n<0)mr.recordError(1281);else if(o){var i=Kr.getInternalformatParameter(e,t,r);if(null!==i)for(var a=0;a<i.length&&a<n;++a)I[o+4*a>>2]=i[a]}else mr.recordError(1281)},Ub:function(e,t,r,n,o){mr.recordError(1282)},Mg:function(e,t,r,n){var o=Kr.getProgramInfoLog(mr.programs[e]);null===o&&(o="(unknown error)");var i=t>0&&n?$(o,n,t):0;r&&(I[r>>2]=i)},Ng:function(e,t,r){if(r)if(e>=mr.counter)mr.recordError(1281);else if(e=mr.programs[e],35716==t){var n=Kr.getProgramInfoLog(e);null===n&&(n="(unknown error)"),I[r>>2]=n.length+1}else if(35719==t){if(!e.maxUniformLength)for(var o=0;o<Kr.getProgramParameter(e,35718);++o)e.maxUniformLength=Math.max(e.maxUniformLength,Kr.getActiveUniform(e,o).name.length+1);I[r>>2]=e.maxUniformLength}else if(35722==t){if(!e.maxAttributeLength)for(o=0;o<Kr.getProgramParameter(e,35721);++o)e.maxAttributeLength=Math.max(e.maxAttributeLength,Kr.getActiveAttrib(e,o).name.length+1);I[r>>2]=e.maxAttributeLength}else if(35381==t){if(!e.maxUniformBlockNameLength)for(o=0;o<Kr.getProgramParameter(e,35382);++o)e.maxUniformBlockNameLength=Math.max(e.maxUniformBlockNameLength,Kr.getActiveUniformBlockName(e,o).length+1);I[r>>2]=e.maxUniformBlockNameLength}else I[r>>2]=Kr.getProgramParameter(e,t);else mr.recordError(1281)},ce:function(e,t,r){if(r){var n,o=mr.queries[e];Er(r,"boolean"==typeof(n=mr.currentContext.version<2?Kr.disjointTimerQueryExt.getQueryObjectEXT(o,t):Kr.getQueryParameter(o,t))?n?1:0:n)}else mr.recordError(1281)},ee:function(e,t,r){if(r){var n,o=mr.queries[e],i=Kr.disjointTimerQueryExt.getQueryObjectEXT(o,t);n="boolean"==typeof i?i?1:0:i,I[r>>2]=n}else mr.recordError(1281)},be:function(e,t,r){if(r){var n,o=mr.queries[e];Er(r,"boolean"==typeof(n=mr.currentContext.version<2?Kr.disjointTimerQueryExt.getQueryObjectEXT(o,t):Kr.getQueryParameter(o,t))?n?1:0:n)}else mr.recordError(1281)},Zc:function(e,t,r){if(r){var n,o=mr.queries[e],i=Kr.getQueryParameter(o,t);n="boolean"==typeof i?i?1:0:i,I[r>>2]=n}else mr.recordError(1281)},de:function(e,t,r){if(r){var n,o=mr.queries[e],i=Kr.disjointTimerQueryExt.getQueryObjectEXT(o,t);n="boolean"==typeof i?i?1:0:i,I[r>>2]=n}else mr.recordError(1281)},_c:function(e,t,r){r?I[r>>2]=Kr.getQuery(e,t):mr.recordError(1281)},fe:function(e,t,r){r?I[r>>2]=Kr.disjointTimerQueryExt.getQueryEXT(e,t):mr.recordError(1281)},Ze:function(e,t,r){r?I[r>>2]=Kr.getRenderbufferParameter(e,t):mr.recordError(1281)},ac:function(e,t,r){r?U[r>>2]=Kr.getSamplerParameter(mr.samplers[e],t):mr.recordError(1281)},bc:function(e,t,r){r?I[r>>2]=Kr.getSamplerParameter(mr.samplers[e],t):mr.recordError(1281)},Og:function(e,t,r,n){var o=Kr.getShaderInfoLog(mr.shaders[e]);null===o&&(o="(unknown error)");var i=t>0&&n?$(o,n,t):0;r&&(I[r>>2]=i)},Ie:function(e,t,r,n){var o=Kr.getShaderPrecisionFormat(e,t);I[r>>2]=o.rangeMin,I[r+4>>2]=o.rangeMax,I[n>>2]=o.precision},Kd:function(e,t,r,n){var o=Kr.getShaderSource(mr.shaders[e]);if(o){var i=t>0&&n?$(o,n,t):0;r&&(I[r>>2]=i)}},Pg:function(e,t,r){if(r)if(35716==t){var n=Kr.getShaderInfoLog(mr.shaders[e]);null===n&&(n="(unknown error)");var o=n?n.length+1:0;I[r>>2]=o}else if(35720==t){var i=Kr.getShaderSource(mr.shaders[e]),a=i?i.length+1:0;I[r>>2]=a}else I[r>>2]=Kr.getShaderParameter(mr.shaders[e],t);else mr.recordError(1281)},Z:function(e){var t=mr.stringCache[e];if(!t){switch(e){case 7939:var r=Kr.getSupportedExtensions()||[];t=kr((r=r.concat(r.map((function(e){return"GL_"+e})))).join(" "));break;case 7936:case 7937:case 37445:case 37446:var n=Kr.getParameter(e);n||mr.recordError(1280),t=n&&kr(n);break;case 7938:var o=Kr.getParameter(7938);t=kr(o=mr.currentContext.version>=2?"OpenGL ES 3.0 ("+o+")":"OpenGL ES 2.0 ("+o+")");break;case 35724:var i=Kr.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=kr(i);break;default:mr.recordError(1280)}mr.stringCache[e]=t}return t},Ja:function(e,t){if(mr.currentContext.version<2)return mr.recordError(1282),0;var r=mr.stringiCache[e];if(r)return t<0||t>=r.length?(mr.recordError(1281),0):r[t];if(7939===e){var n=Kr.getSupportedExtensions()||[];return n=(n=n.concat(n.map((function(e){return"GL_"+e})))).map((function(e){return kr(e)})),r=mr.stringiCache[e]=n,t<0||t>=r.length?(mr.recordError(1281),0):r[t]}return mr.recordError(1280),0},hc:function(e,t,r,n,o){if(r<0)mr.recordError(1281);else if(o){var i=Kr.getSyncParameter(mr.syncs[e],t);null!==i&&(I[o>>2]=i,n&&(I[n>>2]=1))}else mr.recordError(1281)},Jd:function(e,t,r){r?U[r>>2]=Kr.getTexParameter(e,t):mr.recordError(1281)},Id:function(e,t,r){r?I[r>>2]=Kr.getTexParameter(e,t):mr.recordError(1281)},Kc:function(e,t,r,n,o,i,a){e=mr.programs[e];var s=Kr.getTransformFeedbackVarying(e,t);if(s){if(a&&r>0){var u=$(s.name,a,r);n&&(I[n>>2]=u)}else n&&(I[n>>2]=0);o&&(I[o>>2]=s.size),i&&(I[i>>2]=s.type)}},mc:function(e,t){return Kr.getUniformBlockIndex(mr.programs[e],V(t))},oc:function(e,t,r,n){if(n)if(t>0&&(0==r||0==n))mr.recordError(1281);else{e=mr.programs[e];for(var o=[],i=0;i<t;i++)o.push(V(I[r+4*i>>2]));var a=Kr.getUniformIndices(e,o);if(a){var s=a.length;for(i=0;i<s;i++)I[n+4*i>>2]=a[i]}}else mr.recordError(1281)},Qg:function(e,t){if(t=V(t),e=mr.programs[e]){Sr(e);var r=e.uniformLocsById,n=0,o=t,i=Cr(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]||Kr.getUniformLocation(e,t)))return n}else mr.recordError(1281);var s;return-1},Hd:function(e,t,r){Pr(e,t,r,2)},Gd:function(e,t,r){Pr(e,t,r,0)},Dc:function(e,t,r){Pr(e,t,r,0)},Jc:function(e,t,r){Tr(e,t,r,0)},Ic:function(e,t,r){Tr(e,t,r,0)},Dd:function(e,t,r){r?I[r>>2]=Kr.getVertexAttribOffset(e,t):mr.recordError(1281)},Fd:function(e,t,r){Tr(e,t,r,2)},Ed:function(e,t,r){Tr(e,t,r,5)},Cd:function(e,t){Kr.hint(e,t)},Je:function(e,t,r){for(var n=yr[t],o=0;o<t;o++)n[o]=I[r+4*o>>2];Kr.invalidateFramebuffer(e,n)},Ke:function(e,t,r,n,o,i,a){for(var s=yr[t],u=0;u<t;u++)s[u]=I[r+4*u>>2];Kr.invalidateSubFramebuffer(e,s,n,o,i,a)},Bd:function(e){var t=mr.buffers[e];return t?Kr.isBuffer(t):0},Ad:function(e){return Kr.isEnabled(e)},zd:function(e){var t=mr.framebuffers[e];return t?Kr.isFramebuffer(t):0},yd:function(e){return(e=mr.programs[e])?Kr.isProgram(e):0},bd:function(e){var t=mr.queries[e];return t?Kr.isQuery(t):0},je:function(e){var t=mr.queries[e];return t?Kr.disjointTimerQueryExt.isQueryEXT(t):0},xd:function(e){var t=mr.renderbuffers[e];return t?Kr.isRenderbuffer(t):0},dc:function(e){var t=mr.samplers[e];return t?Kr.isSampler(t):0},wd:function(e){var t=mr.shaders[e];return t?Kr.isShader(t):0},Se:function(e){return Kr.isSync(mr.syncs[e])},Rg:function(e){var t=mr.textures[e];return t?Kr.isTexture(t):0},Yb:function(e){return Kr.isTransformFeedback(mr.transformFeedbacks[e])},Rc:function(e){var t=mr.vaos[e];return t?Kr.isVertexArray(t):0},ae:function(e){var t=mr.vaos[e];return t?Kr.isVertexArray(t):0},Sg:function(e){Kr.lineWidth(e)},Tg:function(e){e=mr.programs[e],Kr.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},nf:function(e,t,r,n,o,i){Kr.mdibvbi.multiDrawArraysInstancedBaseInstanceWEBGL(e,I,t>>2,I,r>>2,I,n>>2,j,o>>2,i)},of:function(e,t,r,n,o,i,a,s){Kr.mdibvbi.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(e,I,t>>2,r,I,n>>2,I,o>>2,I,i>>2,j,a>>2,s)},Wb:function(){Kr.pauseTransformFeedback()},Ug:function(e,t){3317==e&&(mr.unpackAlignment=t),Kr.pixelStorei(e,t)},vd:function(e,t){Kr.polygonOffset(e,t)},Tb:function(e,t,r,n){mr.recordError(1280)},Sb:function(e,t,r){mr.recordError(1280)},ge:function(e,t){Kr.disjointTimerQueryExt.queryCounterEXT(mr.queries[e],t)},qf:function(e){Kr.readBuffer(e)},Vg:function(e,t,r,n,o,i,a){if(mr.currentContext.version>=2)if(Kr.currentPixelPackBufferBinding)Kr.readPixels(e,t,r,n,o,i,a);else{var s=Fr(i);Kr.readPixels(e,t,r,n,o,i,s,a>>Br(s))}else{var u=Dr(i,o,r,n,a);u?Kr.readPixels(e,t,r,n,o,i,u):mr.recordError(1280)}},ud:function(){},_e:function(e,t,r,n){Kr.renderbufferStorage(e,t,r,n)},We:function(e,t,r,n,o){Kr.renderbufferStorageMultisample(e,t,r,n,o)},Vb:function(){Kr.resumeTransformFeedback()},td:function(e,t){Kr.sampleCoverage(e,!!t)},Oe:function(e,t,r){Kr.samplerParameterf(mr.samplers[e],t,r)},cc:function(e,t,r){var n=U[r>>2];Kr.samplerParameterf(mr.samplers[e],t,n)},Pe:function(e,t,r){Kr.samplerParameteri(mr.samplers[e],t,r)},Qe:function(e,t,r){var n=I[r>>2];Kr.samplerParameteri(mr.samplers[e],t,n)},sa:function(e,t,r,n){Kr.scissor(e,t,r,n)},sd:function(){mr.recordError(1280)},ta:function(e,t,r,n){var o=mr.getSource(e,t,r,n);if(mr.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)}Kr.shaderSource(mr.shaders[e],o)},ua:function(e,t,r){Kr.stencilFunc(e,t,r)},va:function(e,t,r,n){Kr.stencilFuncSeparate(e,t,r,n)},wa:function(e){Kr.stencilMask(e)},xa:function(e,t){Kr.stencilMaskSeparate(e,t)},ya:function(e,t,r){Kr.stencilOp(e,t,r)},za:function(e,t,r,n){Kr.stencilOpSeparate(e,t,r,n)},Aa:function(e,t,r,n,o,i,a,s,u){if(mr.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)),mr.currentContext.version>=2)if(Kr.currentPixelUnpackBufferBinding)Kr.texImage2D(e,t,r,n,o,i,a,s,u);else if(u){var c=Fr(s);Kr.texImage2D(e,t,r,n,o,i,a,s,c,u>>Br(c))}else Kr.texImage2D(e,t,r,n,o,i,a,s,null);else Kr.texImage2D(e,t,r,n,o,i,a,s,u?Dr(s,a,n,o,u):null)},id:function(e,t,r,n,o,i,a,s,u,c){if(Kr.currentPixelUnpackBufferBinding)Kr.texImage3D(e,t,r,n,o,i,a,s,u,c);else if(c){var l=Fr(u);Kr.texImage3D(e,t,r,n,o,i,a,s,u,l,c>>Br(l))}else Kr.texImage3D(e,t,r,n,o,i,a,s,u,null)},Ba:function(e,t,r){Kr.texParameterf(e,t,r)},Ca:function(e,t,r){var n=U[r>>2];Kr.texParameterf(e,t,n)},Da:function(e,t,r){Kr.texParameteri(e,t,r)},Ea:function(e,t,r){var n=I[r>>2];Kr.texParameteri(e,t,n)},kf:function(e,t,r,n,o){Kr.texStorage2D(e,t,r,n,o)},Rb:function(e,t,r,n,o,i){Kr.texStorage3D(e,t,r,n,o,i)},Fa:function(e,t,r,n,o,i,a,s,u){if(mr.currentContext.version>=2&&36193==s&&(s=5131),mr.currentContext.version>=2)if(Kr.currentPixelUnpackBufferBinding)Kr.texSubImage2D(e,t,r,n,o,i,a,s,u);else if(u){var c=Fr(s);Kr.texSubImage2D(e,t,r,n,o,i,a,s,c,u>>Br(c))}else Kr.texSubImage2D(e,t,r,n,o,i,a,s,null);else{var l=null;u&&(l=Dr(s,a,o,i,u)),Kr.texSubImage2D(e,t,r,n,o,i,a,s,l)}},hd:function(e,t,r,n,o,i,a,s,u,c,l){if(Kr.currentPixelUnpackBufferBinding)Kr.texSubImage3D(e,t,r,n,o,i,a,s,u,c,l);else if(l){var f=Fr(c);Kr.texSubImage3D(e,t,r,n,o,i,a,s,u,c,f,l>>Br(f))}else Kr.texSubImage3D(e,t,r,n,o,i,a,s,u,c,null)},Lc:function(e,t,r,n){e=mr.programs[e];for(var o=[],i=0;i<t;i++)o.push(V(I[r+4*i>>2]));Kr.transformFeedbackVaryings(e,o,n)},Ga:function(e,t){Kr.uniform1f(Ar(e),t)},Ha:function(e,t,r){if(mr.currentContext.version>=2)t&&Kr.uniform1fv(Ar(e),U,r>>2,t);else{if(t<=288)for(var n=Lr[t-1],o=0;o<t;++o)n[o]=U[r+4*o>>2];else n=U.subarray(r>>2,r+4*t>>2);Kr.uniform1fv(Ar(e),n)}},Vf:function(e,t){Kr.uniform1i(Ar(e),t)},Wf:function(e,t,r){if(mr.currentContext.version>=2)t&&Kr.uniform1iv(Ar(e),I,r>>2,t);else{if(t<=288)for(var n=Rr[t-1],o=0;o<t;++o)n[o]=I[r+4*o>>2];else n=I.subarray(r>>2,r+4*t>>2);Kr.uniform1iv(Ar(e),n)}},Bc:function(e,t){Kr.uniform1ui(Ar(e),t)},xc:function(e,t,r){t&&Kr.uniform1uiv(Ar(e),j,r>>2,t)},Xf:function(e,t,r){Kr.uniform2f(Ar(e),t,r)},Yf:function(e,t,r){if(mr.currentContext.version>=2)t&&Kr.uniform2fv(Ar(e),U,r>>2,2*t);else{if(t<=144)for(var n=Lr[2*t-1],o=0;o<2*t;o+=2)n[o]=U[r+4*o>>2],n[o+1]=U[r+(4*o+4)>>2];else n=U.subarray(r>>2,r+8*t>>2);Kr.uniform2fv(Ar(e),n)}},Uf:function(e,t,r){Kr.uniform2i(Ar(e),t,r)},Tf:function(e,t,r){if(mr.currentContext.version>=2)t&&Kr.uniform2iv(Ar(e),I,r>>2,2*t);else{if(t<=144)for(var n=Rr[2*t-1],o=0;o<2*t;o+=2)n[o]=I[r+4*o>>2],n[o+1]=I[r+(4*o+4)>>2];else n=I.subarray(r>>2,r+8*t>>2);Kr.uniform2iv(Ar(e),n)}},Ac:function(e,t,r){Kr.uniform2ui(Ar(e),t,r)},wc:function(e,t,r){t&&Kr.uniform2uiv(Ar(e),j,r>>2,2*t)},Sf:function(e,t,r,n){Kr.uniform3f(Ar(e),t,r,n)},Rf:function(e,t,r){if(mr.currentContext.version>=2)t&&Kr.uniform3fv(Ar(e),U,r>>2,3*t);else{if(t<=96)for(var n=Lr[3*t-1],o=0;o<3*t;o+=3)n[o]=U[r+4*o>>2],n[o+1]=U[r+(4*o+4)>>2],n[o+2]=U[r+(4*o+8)>>2];else n=U.subarray(r>>2,r+12*t>>2);Kr.uniform3fv(Ar(e),n)}},Qf:function(e,t,r,n){Kr.uniform3i(Ar(e),t,r,n)},Pf:function(e,t,r){if(mr.currentContext.version>=2)t&&Kr.uniform3iv(Ar(e),I,r>>2,3*t);else{if(t<=96)for(var n=Rr[3*t-1],o=0;o<3*t;o+=3)n[o]=I[r+4*o>>2],n[o+1]=I[r+(4*o+4)>>2],n[o+2]=I[r+(4*o+8)>>2];else n=I.subarray(r>>2,r+12*t>>2);Kr.uniform3iv(Ar(e),n)}},zc:function(e,t,r,n){Kr.uniform3ui(Ar(e),t,r,n)},vc:function(e,t,r){t&&Kr.uniform3uiv(Ar(e),j,r>>2,3*t)},Of:function(e,t,r,n,o){Kr.uniform4f(Ar(e),t,r,n,o)},Nf:function(e,t,r){if(mr.currentContext.version>=2)t&&Kr.uniform4fv(Ar(e),U,r>>2,4*t);else{if(t<=72){var n=Lr[4*t-1],o=U;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=U.subarray(r>>2,r+16*t>>2);Kr.uniform4fv(Ar(e),n)}},Bf:function(e,t,r,n,o){Kr.uniform4i(Ar(e),t,r,n,o)},Cf:function(e,t,r){if(mr.currentContext.version>=2)t&&Kr.uniform4iv(Ar(e),I,r>>2,4*t);else{if(t<=72)for(var n=Rr[4*t-1],o=0;o<4*t;o+=4)n[o]=I[r+4*o>>2],n[o+1]=I[r+(4*o+4)>>2],n[o+2]=I[r+(4*o+8)>>2],n[o+3]=I[r+(4*o+12)>>2];else n=I.subarray(r>>2,r+16*t>>2);Kr.uniform4iv(Ar(e),n)}},yc:function(e,t,r,n,o){Kr.uniform4ui(Ar(e),t,r,n,o)},uc:function(e,t,r){t&&Kr.uniform4uiv(Ar(e),j,r>>2,4*t)},jc:function(e,t,r){e=mr.programs[e],Kr.uniformBlockBinding(e,t,r)},Df:function(e,t,r,n){if(mr.currentContext.version>=2)t&&Kr.uniformMatrix2fv(Ar(e),!!r,U,n>>2,4*t);else{if(t<=72)for(var o=Lr[4*t-1],i=0;i<4*t;i+=4)o[i]=U[n+4*i>>2],o[i+1]=U[n+(4*i+4)>>2],o[i+2]=U[n+(4*i+8)>>2],o[i+3]=U[n+(4*i+12)>>2];else o=U.subarray(n>>2,n+16*t>>2);Kr.uniformMatrix2fv(Ar(e),!!r,o)}},Yc:function(e,t,r,n){t&&Kr.uniformMatrix2x3fv(Ar(e),!!r,U,n>>2,6*t)},Wc:function(e,t,r,n){t&&Kr.uniformMatrix2x4fv(Ar(e),!!r,U,n>>2,8*t)},Ef:function(e,t,r,n){if(mr.currentContext.version>=2)t&&Kr.uniformMatrix3fv(Ar(e),!!r,U,n>>2,9*t);else{if(t<=32)for(var o=Lr[9*t-1],i=0;i<9*t;i+=9)o[i]=U[n+4*i>>2],o[i+1]=U[n+(4*i+4)>>2],o[i+2]=U[n+(4*i+8)>>2],o[i+3]=U[n+(4*i+12)>>2],o[i+4]=U[n+(4*i+16)>>2],o[i+5]=U[n+(4*i+20)>>2],o[i+6]=U[n+(4*i+24)>>2],o[i+7]=U[n+(4*i+28)>>2],o[i+8]=U[n+(4*i+32)>>2];else o=U.subarray(n>>2,n+36*t>>2);Kr.uniformMatrix3fv(Ar(e),!!r,o)}},Xc:function(e,t,r,n){t&&Kr.uniformMatrix3x2fv(Ar(e),!!r,U,n>>2,6*t)},Uc:function(e,t,r,n){t&&Kr.uniformMatrix3x4fv(Ar(e),!!r,U,n>>2,12*t)},Ff:function(e,t,r,n){if(mr.currentContext.version>=2)t&&Kr.uniformMatrix4fv(Ar(e),!!r,U,n>>2,16*t);else{if(t<=18){var o=Lr[16*t-1],i=U;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=U.subarray(n>>2,n+64*t>>2);Kr.uniformMatrix4fv(Ar(e),!!r,o)}},Vc:function(e,t,r,n){t&&Kr.uniformMatrix4x2fv(Ar(e),!!r,U,n>>2,8*t)},Tc:function(e,t,r,n){t&&Kr.uniformMatrix4x3fv(Ar(e),!!r,U,n>>2,12*t)},Gf:function(e){e=mr.programs[e],Kr.useProgram(e),Kr.currentProgram=e},rd:function(e){Kr.validateProgram(mr.programs[e])},Hf:function(e,t){Kr.vertexAttrib1f(e,t)},qd:function(e,t){Kr.vertexAttrib1f(e,U[t>>2])},pd:function(e,t,r){Kr.vertexAttrib2f(e,t,r)},If:function(e,t){Kr.vertexAttrib2f(e,U[t>>2],U[t+4>>2])},od:function(e,t,r,n){Kr.vertexAttrib3f(e,t,r,n)},Jf:function(e,t){Kr.vertexAttrib3f(e,U[t>>2],U[t+4>>2],U[t+8>>2])},nd:function(e,t,r,n,o){Kr.vertexAttrib4f(e,t,r,n,o)},Kf:function(e,t){Kr.vertexAttrib4f(e,U[t>>2],U[t+4>>2],U[t+8>>2],U[t+12>>2])},lf:function(e,t){Kr.vertexAttribDivisor(e,t)},Yd:function(e,t){Kr.vertexAttribDivisor(e,t)},Ob:function(e,t){Kr.vertexAttribDivisor(e,t)},md:function(e,t){Kr.vertexAttribDivisor(e,t)},Pb:function(e,t){Kr.vertexAttribDivisor(e,t)},Hc:function(e,t,r,n,o){Kr.vertexAttribI4i(e,t,r,n,o)},Fc:function(e,t){Kr.vertexAttribI4i(e,I[t>>2],I[t+4>>2],I[t+8>>2],I[t+12>>2])},Gc:function(e,t,r,n,o){Kr.vertexAttribI4ui(e,t,r,n,o)},Ec:function(e,t){Kr.vertexAttribI4ui(e,j[t>>2],j[t+4>>2],j[t+8>>2],j[t+12>>2])},mf:function(e,t,r,n,o){Kr.vertexAttribIPointer(e,t,r,n,o)},Lf:function(e,t,r,n,o,i){Kr.vertexAttribPointer(e,t,r,!!n,o,i)},Mf:function(e,t,r,n){Kr.viewport(e,t,r,n)},$:function(e,t,r,n){Kr.waitSync(mr.syncs[e],t,vr(r,n))},Eb:function(e,t,r){R.copyWithin(e,t,t+r)},kb:function(e){var t,r=R.length,n=2147483648;if((e>>>=0)>n)return!1;for(var o=1;o<=4;o*=2){var i=r*(1+.2/o);if(i=Math.min(i,e+100663296),Mr(Math.min(n,(t=Math.max(e,i))+(65536-t%65536)%65536)))return!0}return!1},Xa:function(e,t,r,n,o,i,a,s,c){const l=u.UTF8ToString(e,e+t),f=u.HEAPU8.subarray(o,o+i),d=u.emscripten_ubq_codec_audioDecoderNextHandle++,h={codec:l,sampleRate:r,numberOfChannels:n,description:f};try{const e=u.emscripten_ubq_codec_createAudioDecoder(a,s,c);AudioDecoder.isConfigSupported(h).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(h),u.emscripten_ubq_codec_audioDecoders.set(d,{audioDecoder:e,decoderConfig:h,leftBufferPtr:a,rightBufferPtr:s,bufferLength:c})}catch(e){return u.emscripten_ubq_codec_createNativeResult({error:e})}return u.emscripten_ubq_codec_createNativeResult({handle:d})},Oa:function(e,t,r,n,o,i){const a=u.UTF8ToString(e,e+t),s=u.emscripten_ubq_codec_audioEncoderNextHandle++,c={codec:a,sampleRate:r,numberOfChannels:n,bitrate:o};try{const e=new AudioEncoder({output:e=>{const t=u._malloc(e.byteLength),r=u.HEAPU8.subarray(t,t+e.byteLength);e.copyTo(r),u.emscripten_ubq_codec_onOutputEncodedAudioChunk(s,t,e.byteLength,i),u._free(t)},error:e=>console.error(e)});e.configure(c),u.emscripten_ubq_codec_audioEncoders.set(s,{audioEncoder:e,audioEncoderConfig:c,frameIndex:0})}catch(e){return e+=' Requested codec: "'+a+'"',e+="; sample rate: "+r,e+="; channels: "+n,e+="; bit rate: "+o,u.emscripten_ubq_codec_createNativeResult({error:e})}return u.emscripten_ubq_codec_createNativeResult({handle:s})},ab:function(e,t,r,n,o,i,a){const s=u.UTF8ToString(e,e+t),c=u.HEAPU8.subarray(o,o+i),l=u.emscripten_ubq_codec_videoDecoderNextHandle++,f={codec:s,codedWidth:r,codedHeight:n,description:c};try{const e=u.emscripten_ubq_codec_createVideoDecoder(l,a);VideoDecoder.isConfigSupported(f).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(f),u.emscripten_ubq_codec_videoDecoders.set(l,{videoDecoder:e,decoderConfig:f,codecServicePtr:a})}catch(e){return u.emscripten_ubq_codec_createNativeResult({error:e})}return u.emscripten_ubq_codec_createNativeResult({handle:l})},Sa:function(e,t,r,n,o,i){const a=u.UTF8ToString(e,e+t),s=u.emscripten_ubq_codec_videoEncoderNextHandle++,c=u.specialHTMLTargets["!canvas"];c.width=r,c.height=n;const l={codec:a,width:r,height:n,avc:{format:"annexb"},fps:o};try{const e=new VideoEncoder({output:e=>{const t=u._malloc(e.byteLength),r=u.HEAPU8.subarray(t,t+e.byteLength);e.copyTo(r),u.emscripten_ubq_codec_onOutputEncodedVideoChunk(s,t,e.byteLength,i),u._free(t)},error:e=>console.error(e)});VideoEncoder.isConfigSupported(l).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(l),u.emscripten_ubq_codec_videoEncoders.set(s,{videoEncoder:e,encoderConfig:l,groupOfPictures:150,frameIndex:0})}catch(e){return e+=' Requested codec: "'+a+'"',e+="; resolution: "+r+"x"+n,u.emscripten_ubq_codec_createNativeResult({error:e})}return u.emscripten_ubq_codec_createNativeResult({handle:s})},Ta:function(e,t,r,n,o,i){const a=u.emscripten_ubq_codec_audioDecoders.get(e);"closed"===a.audioDecoder.state&&(a.audioDecoder=u.emscripten_ubq_codec_createAudioDecoder(a.leftBufferPtr,a.rightBufferPtr,a.bufferLength),a.audioDecoder.configure(a.decoderConfig));const s=a.audioDecoder,c=u.HEAPU8.subarray(o,o+i),l=new EncodedAudioChunk({type:t?"key":"delta",timestamp:r,duration:n,data:c});try{s.decode(l)}catch(e){return s.configUnsupported?u.emscripten_ubq_codec_createNativeResult({code:2,error:e}):u.emscripten_ubq_codec_createNativeResult({code:1,error:e})}return u.emscripten_ubq_codec_createNativeResult({code:0})},Ka:function(e,t,r,n,o,i){const a=u.emscripten_ubq_codec_videoDecoders.get(e);if(a.videoDecoder.unexpectedError)return u.emscripten_ubq_codec_createNativeResult({code:2,error:a.videoDecoder.unexpectedError});if("closed"===a.videoDecoder.state){const t=a.videoDecoder.textures;return a.videoDecoder=u.emscripten_ubq_codec_createVideoDecoder(e,a.codecServicePtr),a.videoDecoder.textures=t,a.videoDecoder.configure(a.decoderConfig),u.emscripten_ubq_codec_createNativeResult({code:1,error:"VideoDecoder was closed"})}const s=a.videoDecoder,c=u.HEAPU8.subarray(o,o+i),l=new EncodedVideoChunk({type:t?"key":"delta",timestamp:r,duration:n,data:c});try{s.decode(l)}catch(e){return s.configUnsupported?u.emscripten_ubq_codec_createNativeResult({code:2,error:e}):u.emscripten_ubq_codec_createNativeResult({code:1,error:e})}return u.emscripten_ubq_codec_createNativeResult({code:0})},Wa:function(e){if(u.emscripten_ubq_codec_audioDecoders.has(e)){const t=u.emscripten_ubq_codec_audioDecoders.get(e);"closed"!==t.audioDecoder.state&&t.audioDecoder.close(),u.emscripten_ubq_codec_audioDecoders.delete(e)}},Na:function(e){const t=u.emscripten_ubq_codec_audioEncoders.get(e);"closed"!==t.audioEncoder.state&&t.audioEncoder.close(),u.emscripten_ubq_codec_audioEncoders.delete(e)},_a:function(e){if(u.emscripten_ubq_codec_videoDecoders.has(e)){const t=u.emscripten_ubq_codec_videoDecoders.get(e);"closed"!==t.videoDecoder.state&&t.videoDecoder.close(),u.emscripten_ubq_codec_videoDecoders.delete(e)}},Ra:function(e){const t=u.emscripten_ubq_codec_videoEncoders.get(e);"closed"!==t.videoEncoder.state&&t.videoEncoder.close(),u.emscripten_ubq_codec_videoEncoders.delete(e)},Ma:function(e,t,r){const n=u.emscripten_ubq_codec_audioEncoders.get(e),o=1e6*n.frameIndex/30,i=u.HEAPF32.subarray(t/4,t/4+r),a=new AudioData({format:"f32",sampleRate:n.audioEncoderConfig.sampleRate,numberOfFrames:r/n.audioEncoderConfig.numberOfChannels,numberOfChannels:n.audioEncoderConfig.numberOfChannels,timestamp:o,data:i});n.audioEncoder.encode(a),n.frameIndex++,a.close()},Qa:function(e,t,r){const n=u.emscripten_ubq_codec_videoEncoders.get(e),o=1e6*n.frameIndex/n.encoderConfig.fps,i=n.frameIndex%n.groupOfPictures==0,a=u.specialHTMLTargets["!canvas"],s=new VideoFrame(a,{timestamp:o});n.videoEncoder.encode(s,{keyFrame:i}),s.close(),n.frameIndex++},La:async function(e,t){const r=u.emscripten_ubq_codec_audioEncoders.get(e);await r.audioEncoder.flush(),u.emscripten_ubq_codec_onFinalizedAudioEncoding(e,t)},Pa:async function(e,t){const r=u.emscripten_ubq_codec_videoEncoders.get(e);await r.videoEncoder.flush(),u.emscripten_ubq_codec_onFinalizedVideoEncoding(e,t)},Va:async function(e,t){const r=u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder;r.flushing=!0;try{await r.flush()}catch{}r.flushing=!1,r.writtenFrames=t},O:async function(e,t,r){const n=u.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},aa:function(e){return u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.decodeQueueSize},ba:function(e){return u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.decodedFrames},Q:function(e){return u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.writtenFrames},Ua:function(e){return u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.flushing},Za:function(e){return u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.flushing},P:function(){return"undefined"!=typeof VideoFrame&&"undefined"!=typeof VideoDecoder&&"undefined"!=typeof VideoEncoder&&"undefined"!=typeof AudioDecoder&&"undefined"!=typeof AudioEncoder},Ya:function(e,t){u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.requestedFrame=t},$a:function(e,t,r){const n=u.emscripten_ubq_codec_videoDecoders.get(e),o=u.HEAPU32.subarray(t/4,t/4+r);n.videoDecoder.textures=[];for(let e=0;e<r;e++)n.videoDecoder.textures[e]=mr.textures[o[e]]},ve:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return!!(null==t?void 0:t.allocate())},W:function(e,t,r,n){return u.emscripten_ubq_asyncFetchManager.createHeader(e,t,r,n)},ye:function(e){u.emscripten_ubq_asyncFetchManager.deleteHeader(e)},ze:function(e,t,r,n,o,i,a,s,c){return u.emscripten_ubq_asyncFetchManager.fetch(e,t,r,n,o,i,a,s,c).handle},se:function(e){return u.emscripten_ubq_asyncFetchManager.deleteProcess(e)},xe:function(e){var t,r;return null!==(r=null===(t=u.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.receivedLength)&&void 0!==r?r:0},ue:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultAddress:-1},te:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultLength:-1},pa:function(e){var t,r;return null!==(r=null===(t=u.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.state)&&void 0!==r?r:-1},we:function(e){var t,r;return null!==(r=null===(t=u.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.totalBytes)&&void 0!==r?r:0},db:function(){return!!u.emscripten_ubq_settings_forceWebGL1},da:function(e,t){var r=t>>2,n=I[r+6],o={alpha:!!I[r+0],depth:!!I[r+1],stencil:!!I[r+2],antialias:!!I[r+3],premultipliedAlpha:!!I[r+4],preserveDrawingBuffer:!!I[r+5],powerPreference:Ir[n],failIfMajorPerformanceCaveat:!!I[r+7],majorVersion:I[r+8],minorVersion:I[r+9],enableExtensionsByDefault:I[r+10],explicitSwapControl:I[r+11],proxyContextToMainThread:I[r+12],renderViaOffscreenBackBuffer:I[r+13]},i=function(e){return function(e){var t;return e=(t=e)>2?V(t):t,jr[e]||("undefined"!=typeof document?document.querySelector(e):void 0)}(e)}(e);return i?o.explicitSwapControl?0:mr.createContext(i,o):0},ca:function(e){mr.currentContext==e&&(mr.currentContext=0),mr.deleteContext(e)},eb:function(e,t){var r=mr.getContext(e),n=V(t);return n.startsWith("GL_")&&(n=n.substr(3)),"ANGLE_instanced_arrays"==n&&cr(Kr),"OES_vertex_array_object"==n&&lr(Kr),"WEBGL_draw_buffers"==n&&fr(Kr),"WEBGL_draw_instanced_base_vertex_base_instance"==n&&dr(Kr),"WEBGL_multi_draw_instanced_base_vertex_base_instance"==n&&hr(Kr),"WEBGL_multi_draw"==n&&pr(Kr),!!r.GLctx.getExtension(n)},cb:function(e){for(var t=e>>2,r=0;r<14;++r)I[t+r]=0;I[t+0]=I[t+1]=I[t+3]=I[t+4]=I[t+8]=I[t+10]=1},fb:function(e){return mr.makeContextCurrent(e)?0:-5},rb:function(e,t){var r=0;return qr().forEach((function(n,o){var i=t+r;j[e+4*o>>2]=i,function(e,t,r){for(var n=0;n<e.length;++n)L[t++>>0]=e.charCodeAt(n);L[t>>0]=0}(n,i),r+=n.length+1})),0},sb:function(e,t){var r=qr();j[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),j[t>>2]=n,0},De:zr,S:function(e){try{var t=Pe.getStreamFromFD(e);return Ae.close(t),0}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return e.errno}},nb:function(e,t,r,n,o){try{if(n=Wr(n),isNaN(n))return 61;var i=Hr(Pe.getStreamFromFD(e),t,r,n);return j[o>>2]=i,0}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return e.errno}},ja:function(e,t,r,n){try{var o=Hr(Pe.getStreamFromFD(e),t,r);return j[n>>2]=o,0}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return e.errno}},qb:function(e,t,r,n){try{if(t=Wr(t),isNaN(t))return 61;var o=Pe.getStreamFromFD(e);return Ae.llseek(o,t,r),ae=[o.position>>>0,(ie=o.position,+Math.abs(ie)>=1?ie>0?(0|Math.min(+Math.floor(ie/4294967296),4294967295))>>>0:~~+Math.ceil((ie-+(~~ie>>>0))/4294967296)>>>0:0)],I[n>>2]=ae[0],I[n+4>>2]=ae[1],o.getdents&&0===t&&0===r&&(o.getdents=null),0}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return e.errno}},ia:function(e,t,r,n){try{var o=function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=j[t>>2],s=j[t+4>>2];t+=8;var u=Ae.write(e,L,a,s,n);if(u<0)return-1;o+=u,void 0!==n&&(n+=u)}return o}(Pe.getStreamFromFD(e),t,r);return j[n>>2]=o,0}catch(e){if(void 0===Ae||!(e instanceof Ae.ErrnoError))throw e;return e.errno}},hb:function e(t,r){e.randomDevice||(e.randomDevice=Ee());for(var n=0;n<r;n++)L[t+n>>0]=e.randomDevice();return 0},l:function(e,t){var r=fn();try{return wt(e)(t)}catch(e){if(dn(r),e!==e+0)throw e;ln(1,0)}},t:function(e,t,r){var n=fn();try{return wt(e)(t,r)}catch(e){if(dn(n),e!==e+0)throw e;ln(1,0)}},m:function(e,t,r,n){var o=fn();try{return wt(e)(t,r,n)}catch(e){if(dn(o),e!==e+0)throw e;ln(1,0)}},K:function(e,t,r,n,o){var i=fn();try{return wt(e)(t,r,n,o)}catch(e){if(dn(i),e!==e+0)throw e;ln(1,0)}},He:function(e,t,r,n,o,i){var a=fn();try{return wt(e)(t,r,n,o,i)}catch(e){if(dn(a),e!==e+0)throw e;ln(1,0)}},ra:function(e,t,r,n,o,i,a){var s=fn();try{return wt(e)(t,r,n,o,i,a)}catch(e){if(dn(s),e!==e+0)throw e;ln(1,0)}},qa:function(e,t,r,n,o,i,a,s,u,c){var l=fn();try{return wt(e)(t,r,n,o,i,a,s,u,c)}catch(e){if(dn(l),e!==e+0)throw e;ln(1,0)}},Y:function(e){var t=fn();try{wt(e)()}catch(e){if(dn(t),e!==e+0)throw e;ln(1,0)}},r:function(e,t){var r=fn();try{wt(e)(t)}catch(e){if(dn(r),e!==e+0)throw e;ln(1,0)}},B:function(e,t,r){var n=fn();try{wt(e)(t,r)}catch(e){if(dn(n),e!==e+0)throw e;ln(1,0)}},n:function(e,t,r,n){var o=fn();try{wt(e)(t,r,n)}catch(e){if(dn(o),e!==e+0)throw e;ln(1,0)}},x:function(e,t,r,n,o){var i=fn();try{wt(e)(t,r,n,o)}catch(e){if(dn(i),e!==e+0)throw e;ln(1,0)}},Ge:function(e,t,r,n,o,i){var a=fn();try{wt(e)(t,r,n,o,i)}catch(e){if(dn(a),e!==e+0)throw e;ln(1,0)}},Ee:function(e,t,r,n,o,i,a){var s=fn();try{wt(e)(t,r,n,o,i,a)}catch(e){if(dn(s),e!==e+0)throw e;ln(1,0)}},Fe:function(e,t,r,n,o,i,a,s,u,c){var l=fn();try{wt(e)(t,r,n,o,i,a,s,u,c)}catch(e){if(dn(l),e!==e+0)throw e;ln(1,0)}},ib:function(e,t,r,n,o){return function(e,t,r,n){var o=I[n+40>>2],i={tm_sec:I[n>>2],tm_min:I[n+4>>2],tm_hour:I[n+8>>2],tm_mday:I[n+12>>2],tm_mon:I[n+16>>2],tm_year:I[n+20>>2],tm_wday:I[n+24>>2],tm_yday:I[n+28>>2],tm_isdst:I[n+32>>2],tm_gmtoff:I[n+36>>2],tm_zone:o?V(o):""},a=V(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 c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=["January","February","March","April","May","June","July","August","September","October","November","December"];function f(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length<t;)n=r[0]+n;return n}function d(e,t){return f(e,t,"0")}function h(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 p(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=function(e,t){for(var r=new Date(e.getTime());t>0;){var n=Kt(r.getFullYear()),o=r.getMonth(),i=(n?Vr:Gr)[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=p(r),i=p(n);return h(o,t)<=0?h(i,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var g={"%a":function(e){return c[e.tm_wday].substring(0,3)},"%A":function(e){return c[e.tm_wday]},"%b":function(e){return l[e.tm_mon].substring(0,3)},"%B":function(e){return l[e.tm_mon]},"%C":function(e){return d((e.tm_year+1900)/100|0,2)},"%d":function(e){return d(e.tm_mday,2)},"%e":function(e){return f(e.tm_mday,2," ")},"%g":function(e){return m(e).toString().substring(2)},"%G":function(e){return m(e)},"%H":function(e){return d(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),d(t,2)},"%j":function(e){return d(e.tm_mday+function(e,t){for(var r=0,n=0;n<=t;r+=e[n++]);return r}(Kt(e.tm_year+1900)?Vr:Gr,e.tm_mon-1),3)},"%m":function(e){return d(e.tm_mon+1,2)},"%M":function(e){return d(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return d(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var t=e.tm_yday+7-e.tm_wday;return d(Math.floor(t/7),2)},"%V":function(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&&Kt(e.tm_year)||(t=1)}}else{t=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&Kt(e.tm_year%400-1))&&t++}return d(t,2)},"%w":function(e){return e.tm_wday},"%W":function(e){var t=e.tm_yday+7-(e.tm_wday+6)%7;return d(Math.floor(t/7),2)},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(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":function(e){return e.tm_zone},"%%":function(){return"%"}};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 v=xe(a=a.replace(/\0\0/g,"%"),!1);return v.length>t?0:($r(v,e),v.length-1)}(e,t,r,n)}},on=(function(){var e={a:nn};function t(e,t){var r,n=e.exports;u.asm=n,P=u.asm.Wg,X(),K=u.asm.Zg,r=u.asm.Xg,Z.unshift(r),fe()}function r(e){t(e.instance)}function n(t){return(C||!b&&!w||"function"!=typeof fetch?Promise.resolve().then((function(){return me(ne)})):fetch(ne,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+ne+"'";return e.arrayBuffer()})).catch((function(){return me(ne)}))).then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){A("failed to asynchronously prepare wasm: "+e),de(e)}))}if(le(),u.instantiateWasm)try{return u.instantiateWasm(e,t)}catch(e){A("Module.instantiateWasm callback failed with error: "+e),o(e)}(C||"function"!=typeof WebAssembly.instantiateStreaming||he(ne)||E||"function"!=typeof fetch?n(r):fetch(ne,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(r,(function(e){return A("wasm streaming compile failed: "+e),A("falling back to ArrayBuffer instantiation"),n(r)}))}))).catch(o)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.Xg).apply(null,arguments)},u._malloc=function(){return(on=u._malloc=u.asm.Yg).apply(null,arguments)}),an=(u._main=function(){return(u._main=u.asm._g).apply(null,arguments)},u._free=function(){return(an=u._free=u.asm.$g).apply(null,arguments)}),sn=u.___errno_location=function(){return(sn=u.___errno_location=u.asm.ah).apply(null,arguments)},un=(u._ma_device_process_pcm_frames_capture__webaudio=function(){return(u._ma_device_process_pcm_frames_capture__webaudio=u.asm.bh).apply(null,arguments)},u._ma_device_process_pcm_frames_playback__webaudio=function(){return(u._ma_device_process_pcm_frames_playback__webaudio=u.asm.ch).apply(null,arguments)},u.___getTypeName=function(){return(un=u.___getTypeName=u.asm.dh).apply(null,arguments)}),cn=(u.__embind_initialize_bindings=function(){return(u.__embind_initialize_bindings=u.asm.eh).apply(null,arguments)},u._emscripten_builtin_memalign=function(){return(cn=u._emscripten_builtin_memalign=u.asm.fh).apply(null,arguments)}),ln=u._setThrew=function(){return(ln=u._setThrew=u.asm.gh).apply(null,arguments)},fn=u.stackSave=function(){return(fn=u.stackSave=u.asm.hh).apply(null,arguments)},dn=u.stackRestore=function(){return(dn=u.stackRestore=u.asm.ih).apply(null,arguments)},hn=u.stackAlloc=function(){return(hn=u.stackAlloc=u.asm.jh).apply(null,arguments)},pn=u.___cxa_is_pointer_type=function(){return(pn=u.___cxa_is_pointer_type=u.asm.kh).apply(null,arguments)};function mn(e){function r(){rn||(rn=!0,u.calledRun=!0,B||(u.noFSInit||Ae.init.initialized||Ae.init(),Ae.ignorePermissions=!1,ke.init(),ye(Z),ye(J),t(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),gn&&function(e){var t=u._main;(e=e||[]).unshift(v);var r=e.length,n=hn(4*(r+1)),o=n>>2;e.forEach((e=>{I[o++]=function(e){var t=Y(e)+1,r=hn(t);return G(e,L,r,t),r}(e)})),I[o]=0;try{var i=t(r,n);Nr(i)}catch(e){return nr(e)}}(e),function(){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;)e=u.postRun.shift(),te.unshift(e);var e;ye(te)}()))}e=e||g,se>0||(function(){if(u.preRun)for("function"==typeof u.preRun&&(u.preRun=[u.preRun]);u.preRun.length;)e=u.preRun.shift(),Q.unshift(e);var e;ye(Q)}(),se>0||(u.setStatus?(u.setStatus("Running..."),setTimeout((function(){setTimeout((function(){u.setStatus("")}),1),r()}),1)):r()))}if(u.UTF8ToString=V,u.addRunDependency=le,u.removeRunDependency=fe,u.FS_createPath=Ae.createPath,u.FS_createDataFile=Ae.createDataFile,u.FS_createPreloadedFile=Ae.createPreloadedFile,u.FS_createLazyFile=Ae.createLazyFile,u.FS_createDevice=Ae.createDevice,u.FS_unlink=Ae.unlink,u.ccall=Yr,u.getValue=function(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":case"i8":return L[e>>0];case"i16":return M[e>>1];case"i32":return I[e>>2];case"i64":return q[e>>3];case"float":return U[e>>2];case"double":return z[e>>3];case"*":return j[e>>2];default:de("invalid type for getValue: "+t)}return null},u.specialHTMLTargets=jr,ce=function e(){rn||mn(),rn||(ce=e)},u.preInit)for("function"==typeof u.preInit&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();var gn=!0;return u.noInitialRun&&(gn=!1),mn(),s.ready});e.exports=o},881:(e,t)=>{t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=u(e),a=i[0],s=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),l=0,f=s>0?a-4:a;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,u=n-o;s<u;s+=a)i.push(c(e,s,s+a>u?u:s+a));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=i.length;a<s;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},1892:(e,t,r)=>{var n=r(881),o=r(8684),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.h2=50;var a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|m(e,t),n=s(r),o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(N(e,Uint8Array)){var t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(N(e,ArrayBuffer)||e&&N(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(N(e,SharedArrayBuffer)||e&&N(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);var o=function(e){if(u.isBuffer(e)){var t=0|p(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||z(e.length)?s(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),s(e<0?0:0|p(e))}function d(e){for(var t=e.length<0?0:0|p(e.length),r=s(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function p(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function m(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||N(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(e).length;default:if(o)return n?-1:j(e).length;t=(""+t).toLowerCase(),o=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return F(this,t,r);case"utf8":case"utf-8":return S(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return C(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),z(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,o){var i,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(i=r;i<s;i++)if(c(e,i)===c(t,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===u)return l*a}else-1!==l&&(i-=i-l),l=-1}else for(r+u>s&&(r=s-u),i=r;i>=0;i--){for(var f=!0,d=0;d<u;d++)if(c(e,i+d)!==c(t,d)){f=!1;break}if(f)return i}return-1}function w(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=t.length;n>i/2&&(n=i/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(z(s))return a;e[r+a]=s}return a}function E(e,t,r,n){return q(j(t,e.length-r),e,r,n)}function _(e,t,r,n){return q(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function x(e,t,r,n){return q(U(t),e,r,n)}function k(e,t,r,n){return q(function(e,t){for(var r,n,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function C(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function S(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var i,a,s,u,c=e[o],l=null,f=c>239?4:c>223?3:c>191?2:1;if(o+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(i=e[o+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(u=(15&c)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=f}return function(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=A));return r}(n)}u.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}(e,t,r)},u.allocUnsafe=function(e){return f(e)},u.allocUnsafeSlow=function(e){return f(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(N(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),N(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var i=e[r];if(N(i,Uint8Array))o+i.length>n.length?u.from(i).copy(n,o):Uint8Array.prototype.set.call(n,i,o);else{if(!u.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},u.byteLength=m,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},u.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?S(this,0,e):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.h2;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,o){if(N(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(i,a),c=this.slice(n,o),l=e.slice(t,r),f=0;f<s;++f)if(c[f]!==l[f]){i=c[f],a=l[f];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return _(this,e,t,r);case"base64":return x(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function P(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function T(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function F(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=t;i<r;++i)o+=H[e[i]];return o}function B(e,t,r){for(var n=e.slice(t,r),o="",i=0;i<n.length-1;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function D(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,r,n,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function R(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(e,t,r,n,i){return t=+t,r>>>=0,i||R(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function O(e,t,r,n,i){return t=+t,r>>>=0,i||R(e,0,r,8),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||D(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||D(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return e>>>=0,t||D(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||D(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||D(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||D(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||L(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||L(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);L(this,e,t,r,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<r&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);L(this,e,t,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeFloatLE=function(e,t,r){return M(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return M(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return O(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return O(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var a=u.isBuffer(e)?e:u.from(e,n),s=a.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=a[i%s]}return this};var I=/[^+/0-9A-Za-z-_]/g;function j(e,t){var r;t=t||1/0;for(var n=e.length,o=null,i=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function U(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(I,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function N(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function z(e){return e!=e}var H=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,o=0;o<16;++o)t[n+o]=e[r]+e[o];return t}()},8684:(e,t)=>{t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?o-1:0,d=r?-1:1,h=e[t+f];for(f+=d,i=h&(1<<-l)-1,h>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=d,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+e[t+f],f+=d,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=c}return(h?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,u,c=8*i-o-1,l=(1<<c)-1,f=l>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[r+h]=255&s,h+=p,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[r+h]=255&a,h+=p,a/=256,c-=8);e[r+h-p]|=128*m}},7278:(e,t,r)=>{var n=r(489)(r(4818),"DataView");e.exports=n},7643:(e,t,r)=>{var n=r(5557),o=r(4349),i=r(407),a=r(5134),s=r(9951);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,e.exports=u},3872:(e,t,r)=>{var n=r(2470),o=r(7289),i=r(7614),a=r(3067),s=r(9346);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,e.exports=u},5674:(e,t,r)=>{var n=r(489)(r(4818),"Map");e.exports=n},2462:(e,t,r)=>{var n=r(6290),o=r(4951),i=r(440),a=r(6180),s=r(7719);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,e.exports=u},2160:(e,t,r)=>{var n=r(489)(r(4818),"Promise");e.exports=n},4390:(e,t,r)=>{var n=r(489)(r(4818),"Set");e.exports=n},9264:(e,t,r)=>{var n=r(2462),o=r(236),i=r(1957);function a(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=o,a.prototype.has=i,e.exports=a},5135:(e,t,r)=>{var n=r(3872),o=r(1490),i=r(2594),a=r(5953),s=r(4667),u=r(4615);function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=o,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=s,c.prototype.set=u,e.exports=c},9652:(e,t,r)=>{var n=r(4818).Symbol;e.exports=n},4600:(e,t,r)=>{var n=r(4818).Uint8Array;e.exports=n},2403:(e,t,r)=>{var n=r(489)(r(4818),"WeakMap");e.exports=n},6562:e=>{e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},7554:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var a=e[r];t(a,r,e)&&(i[o++]=a)}return i}},1998:(e,t,r)=>{var n=r(1453),o=r(5664),i=r(5860),a=r(9571),s=r(8347),u=r(1859),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=i(e),l=!r&&o(e),f=!r&&!l&&a(e),d=!r&&!l&&!f&&u(e),h=r||l||f||d,p=h?n(e.length,String):[],m=p.length;for(var g in e)!t&&!c.call(e,g)||h&&("length"==g||f&&("offset"==g||"parent"==g)||d&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,m))||p.push(g);return p}},4656:e=>{e.exports=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}},8193:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}},1612:(e,t,r)=>{var n=r(6912),o=r(3355);e.exports=function(e,t,r){(void 0!==r&&!o(e[t],r)||void 0===r&&!(t in e))&&n(e,t,r)}},6258:(e,t,r)=>{var n=r(6912),o=r(3355),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var a=e[t];i.call(e,t)&&o(a,r)&&(void 0!==r||t in e)||n(e,t,r)}},8620:(e,t,r)=>{var n=r(3355);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},6912:(e,t,r)=>{var n=r(4698);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},8528:(e,t,r)=>{var n=r(4820),o=Object.create,i=function(){function e(){}return function(t){if(!n(t))return{};if(o)return o(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=i},3153:(e,t,r)=>{var n=r(7572)();e.exports=n},6367:(e,t,r)=>{var n=r(4656),o=r(5860);e.exports=function(e,t,r){var i=t(e);return o(e)?i:n(i,r(e))}},2759:(e,t,r)=>{var n=r(9652),o=r(9911),i=r(3744),a=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},6651:(e,t,r)=>{var n=r(2759),o=r(1408);e.exports=function(e){return o(e)&&"[object Arguments]"==n(e)}},2500:(e,t,r)=>{var n=r(5930),o=r(1408);e.exports=function e(t,r,i,a,s){return t===r||(null==t||null==r||!o(t)&&!o(r)?t!=t&&r!=r:n(t,r,i,a,e,s))}},5930:(e,t,r)=>{var n=r(5135),o=r(7557),i=r(2e3),a=r(2032),s=r(5006),u=r(5860),c=r(9571),l=r(1859),f="[object Arguments]",d="[object Array]",h="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,m,g,v){var y=u(e),b=u(t),w=y?d:s(e),E=b?d:s(t),_=(w=w==f?h:w)==h,x=(E=E==f?h:E)==h,k=w==E;if(k&&c(e)){if(!c(t))return!1;y=!0,_=!1}if(k&&!_)return v||(v=new n),y||l(e)?o(e,t,r,m,g,v):i(e,t,w,r,m,g,v);if(!(1&r)){var C=_&&p.call(e,"__wrapped__"),S=x&&p.call(t,"__wrapped__");if(C||S){var A=C?e.value():e,P=S?t.value():t;return v||(v=new n),g(A,P,r,m,v)}}return!!k&&(v||(v=new n),a(e,t,r,m,g,v))}},3216:(e,t,r)=>{var n=r(830),o=r(931),i=r(4820),a=r(1304),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,f=c.hasOwnProperty,d=RegExp("^"+l.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(n(e)?d:s).test(a(e))}},9920:(e,t,r)=>{var n=r(2759),o=r(7906),i=r(1408),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[n(e)]}},7588:(e,t,r)=>{var n=r(7839),o=r(2809),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return o(e);var t=[];for(var r in Object(e))i.call(e,r)&&"constructor"!=r&&t.push(r);return t}},3339:(e,t,r)=>{var n=r(4820),o=r(7839),i=r(3003),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=o(e),r=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&r.push(s);return r}},7604:(e,t,r)=>{var n=r(5135),o=r(1612),i=r(3153),a=r(480),s=r(4820),u=r(2551),c=r(7700);e.exports=function e(t,r,l,f,d){t!==r&&i(r,(function(i,u){if(d||(d=new n),s(i))a(t,r,u,l,e,f,d);else{var h=f?f(c(t,u),i,u+"",t,r,d):void 0;void 0===h&&(h=i),o(t,u,h)}}),u)}},480:(e,t,r)=>{var n=r(1612),o=r(8192),i=r(9947),a=r(6581),s=r(1172),u=r(5664),c=r(5860),l=r(5274),f=r(9571),d=r(830),h=r(4820),p=r(1969),m=r(1859),g=r(7700),v=r(2963);e.exports=function(e,t,r,y,b,w,E){var _=g(e,r),x=g(t,r),k=E.get(x);if(k)n(e,r,k);else{var C=w?w(_,x,r+"",e,t,E):void 0,S=void 0===C;if(S){var A=c(x),P=!A&&f(x),T=!A&&!P&&m(x);C=x,A||P||T?c(_)?C=_:l(_)?C=a(_):P?(S=!1,C=o(x,!0)):T?(S=!1,C=i(x,!0)):C=[]:p(x)||u(x)?(C=_,u(_)?C=v(_):h(_)&&!d(_)||(C=s(x))):S=!1}S&&(E.set(x,C),b(C,x,y,w,E),E.delete(x)),n(e,r,C)}}},5757:(e,t,r)=>{var n=r(1191),o=r(2549),i=r(6613);e.exports=function(e,t){return i(o(e,t,n),e+"")}},4274:(e,t,r)=>{var n=r(7477),o=r(4698),i=r(1191),a=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i;e.exports=a},1453:e=>{e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},7383:(e,t,r)=>{var n=r(5322),o=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(o,""):e}},8275:e=>{e.exports=function(e){return function(t){return e(t)}}},8094:e=>{e.exports=function(e,t){return e.has(t)}},1254:(e,t,r)=>{var n=r(4600);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},8192:(e,t,r)=>{e=r.nmd(e);var n=r(4818),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o?n.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=s?s(r):new e.constructor(r);return e.copy(n),n}},9947:(e,t,r)=>{var n=r(1254);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},6581:e=>{e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},7200:(e,t,r)=>{var n=r(6258),o=r(6912);e.exports=function(e,t,r,i){var a=!r;r||(r={});for(var s=-1,u=t.length;++s<u;){var c=t[s],l=i?i(r[c],e[c],c,r,e):void 0;void 0===l&&(l=e[c]),a?o(r,c,l):n(r,c,l)}return r}},8940:(e,t,r)=>{var n=r(4818)["__core-js_shared__"];e.exports=n},3102:(e,t,r)=>{var n=r(5757),o=r(7072);e.exports=function(e){return n((function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,s&&o(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var u=r[n];u&&e(t,u,n,a)}return t}))}},7572:e=>{e.exports=function(e){return function(t,r,n){for(var o=-1,i=Object(t),a=n(t),s=a.length;s--;){var u=a[e?s:++o];if(!1===r(i[u],u,i))break}return t}}},4698:(e,t,r)=>{var n=r(489),o=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},7557:(e,t,r)=>{var n=r(9264),o=r(8193),i=r(8094);e.exports=function(e,t,r,a,s,u){var c=1&r,l=e.length,f=t.length;if(l!=f&&!(c&&f>l))return!1;var d=u.get(e),h=u.get(t);if(d&&h)return d==t&&h==e;var p=-1,m=!0,g=2&r?new n:void 0;for(u.set(e,t),u.set(t,e);++p<l;){var v=e[p],y=t[p];if(a)var b=c?a(y,v,p,t,e,u):a(v,y,p,e,t,u);if(void 0!==b){if(b)continue;m=!1;break}if(g){if(!o(t,(function(e,t){if(!i(g,t)&&(v===e||s(v,e,r,a,u)))return g.push(t)}))){m=!1;break}}else if(v!==y&&!s(v,y,r,a,u)){m=!1;break}}return u.delete(e),u.delete(t),m}},2e3:(e,t,r)=>{var n=r(9652),o=r(4600),i=r(3355),a=r(7557),s=r(8759),u=r(1924),c=n?n.prototype:void 0,l=c?c.valueOf:void 0;e.exports=function(e,t,r,n,c,f,d){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!f(new o(e),new o(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var h=s;case"[object Set]":var p=1&n;if(h||(h=u),e.size!=t.size&&!p)return!1;var m=d.get(e);if(m)return m==t;n|=2,d.set(e,t);var g=a(h(e),h(t),n,c,f,d);return d.delete(e),g;case"[object Symbol]":if(l)return l.call(e)==l.call(t)}return!1}},2032:(e,t,r)=>{var n=r(1723),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,i,a,s){var u=1&r,c=n(e),l=c.length;if(l!=n(t).length&&!u)return!1;for(var f=l;f--;){var d=c[f];if(!(u?d in t:o.call(t,d)))return!1}var h=s.get(e),p=s.get(t);if(h&&p)return h==t&&p==e;var m=!0;s.set(e,t),s.set(t,e);for(var g=u;++f<l;){var v=e[d=c[f]],y=t[d];if(i)var b=u?i(y,v,d,t,e,s):i(v,y,d,e,t,s);if(!(void 0===b?v===y||a(v,y,r,i,s):b)){m=!1;break}g||(g="constructor"==d)}if(m&&!g){var w=e.constructor,E=t.constructor;w==E||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof E&&E instanceof E||(m=!1)}return s.delete(e),s.delete(t),m}},3566:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},1723:(e,t,r)=>{var n=r(6367),o=r(5253),i=r(8022);e.exports=function(e){return n(e,i,o)}},6330:(e,t,r)=>{var n=r(5513);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},489:(e,t,r)=>{var n=r(3216),o=r(3626);e.exports=function(e,t){var r=o(e,t);return n(r)?r:void 0}},4966:(e,t,r)=>{var n=r(6148)(Object.getPrototypeOf,Object);e.exports=n},9911:(e,t,r)=>{var n=r(9652),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var o=a.call(e);return n&&(t?e[s]=r:delete e[s]),o}},5253:(e,t,r)=>{var n=r(7554),o=r(3117),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),n(a(e),(function(t){return i.call(e,t)})))}:o;e.exports=s},5006:(e,t,r)=>{var n=r(7278),o=r(5674),i=r(2160),a=r(4390),s=r(2403),u=r(2759),c=r(1304),l="[object Map]",f="[object Promise]",d="[object Set]",h="[object WeakMap]",p="[object DataView]",m=c(n),g=c(o),v=c(i),y=c(a),b=c(s),w=u;(n&&w(new n(new ArrayBuffer(1)))!=p||o&&w(new o)!=l||i&&w(i.resolve())!=f||a&&w(new a)!=d||s&&w(new s)!=h)&&(w=function(e){var t=u(e),r="[object Object]"==t?e.constructor:void 0,n=r?c(r):"";if(n)switch(n){case m:return p;case g:return l;case v:return f;case y:return d;case b:return h}return t}),e.exports=w},3626:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},5557:(e,t,r)=>{var n=r(2037);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},4349:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},407:(e,t,r)=>{var n=r(2037),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return o.call(t,e)?t[e]:void 0}},5134:(e,t,r)=>{var n=r(2037),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:o.call(t,e)}},9951:(e,t,r)=>{var n=r(2037);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},1172:(e,t,r)=>{var n=r(8528),o=r(4966),i=r(7839);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:n(o(e))}},8347:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},7072:(e,t,r)=>{var n=r(3355),o=r(8809),i=r(8347),a=r(4820);e.exports=function(e,t,r){if(!a(r))return!1;var s=typeof t;return!!("number"==s?o(r)&&i(t,r.length):"string"==s&&t in r)&&n(r[t],e)}},5513:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},931:(e,t,r)=>{var n,o=r(8940),i=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!i&&i in e}},7839:e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},2470:e=>{e.exports=function(){this.__data__=[],this.size=0}},7289:(e,t,r)=>{var n=r(8620),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():o.call(t,r,1),--this.size,0))}},7614:(e,t,r)=>{var n=r(8620);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},3067:(e,t,r)=>{var n=r(8620);e.exports=function(e){return n(this.__data__,e)>-1}},9346:(e,t,r)=>{var n=r(8620);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},6290:(e,t,r)=>{var n=r(7643),o=r(3872),i=r(5674);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},4951:(e,t,r)=>{var n=r(6330);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},440:(e,t,r)=>{var n=r(6330);e.exports=function(e){return n(this,e).get(e)}},6180:(e,t,r)=>{var n=r(6330);e.exports=function(e){return n(this,e).has(e)}},7719:(e,t,r)=>{var n=r(6330);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},8759:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}},2037:(e,t,r)=>{var n=r(489)(Object,"create");e.exports=n},2809:(e,t,r)=>{var n=r(6148)(Object.keys,Object);e.exports=n},3003:e=>{e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},9693:(e,t,r)=>{e=r.nmd(e);var n=r(3566),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o&&n.process,s=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},3744:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},6148:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},2549:(e,t,r)=>{var n=r(6562),o=Math.max;e.exports=function(e,t,r){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,a=-1,s=o(i.length-t,0),u=Array(s);++a<s;)u[a]=i[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=i[a];return c[t]=r(u),n(e,this,c)}}},4818:(e,t,r)=>{var n=r(3566),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();e.exports=i},7700:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},236:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},1957:e=>{e.exports=function(e){return this.__data__.has(e)}},1924:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}},6613:(e,t,r)=>{var n=r(4274),o=r(3546)(n);e.exports=o},3546:e=>{var t=Date.now;e.exports=function(e){var r=0,n=0;return function(){var o=t(),i=16-(o-n);if(n=o,i>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},1490:(e,t,r)=>{var n=r(3872);e.exports=function(){this.__data__=new n,this.size=0}},2594:e=>{e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},5953:e=>{e.exports=function(e){return this.__data__.get(e)}},4667:e=>{e.exports=function(e){return this.__data__.has(e)}},4615:(e,t,r)=>{var n=r(3872),o=r(5674),i=r(2462);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new i(a)}return r.set(e,t),this.size=r.size,this}},1304:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},5322:e=>{var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},9878:(e,t,r)=>{var n=r(343);e.exports=function(e,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return e=n(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}},7477:e=>{e.exports=function(e){return function(){return e}}},3355:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},1191:e=>{e.exports=function(e){return e}},5664:(e,t,r)=>{var n=r(6651),o=r(1408),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(e){return o(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},5860:e=>{var t=Array.isArray;e.exports=t},8809:(e,t,r)=>{var n=r(830),o=r(7906);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},5274:(e,t,r)=>{var n=r(8809),o=r(1408);e.exports=function(e){return o(e)&&n(e)}},9571:(e,t,r)=>{e=r.nmd(e);var n=r(4818),o=r(8585),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,s=a&&a.exports===i?n.Buffer:void 0,u=(s?s.isBuffer:void 0)||o;e.exports=u},2822:(e,t,r)=>{var n=r(2500);e.exports=function(e,t){return n(e,t)}},830:(e,t,r)=>{var n=r(2759),o=r(4820);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},7906:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},4820:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},1408:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},1969:(e,t,r)=>{var n=r(2759),o=r(4966),i=r(1408),a=Function.prototype,s=Object.prototype,u=a.toString,c=s.hasOwnProperty,l=u.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=n(e))return!1;var t=o(e);if(null===t)return!0;var r=c.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&u.call(r)==l}},1918:(e,t,r)=>{var n=r(2759),o=r(1408);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==n(e)}},1859:(e,t,r)=>{var n=r(9920),o=r(8275),i=r(9693),a=i&&i.isTypedArray,s=a?o(a):n;e.exports=s},8022:(e,t,r)=>{var n=r(1998),o=r(7588),i=r(8809);e.exports=function(e){return i(e)?n(e):o(e)}},2551:(e,t,r)=>{var n=r(1998),o=r(3339),i=r(8809);e.exports=function(e){return i(e)?n(e,!0):o(e)}},7168:(e,t,r)=>{var n=r(7604),o=r(3102)((function(e,t,r){n(e,t,r)}));e.exports=o},4846:(e,t,r)=>{var n=r(9878);e.exports=function(e){return n(2,e)}},3117:e=>{e.exports=function(){return[]}},8585:e=>{e.exports=function(){return!1}},8322:(e,t,r)=>{var n=r(7017);e.exports=function(e){return e?Infinity===(e=n(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},343:(e,t,r)=>{var n=r(8322);e.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},7017:(e,t,r)=>{var n=r(7383),o=r(4820),i=r(1918),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=s.test(e);return r||u.test(e)?c(e.slice(2),r?2:8):a.test(e)?NaN:+e}},2963:(e,t,r)=>{var n=r(7200),o=r(2551);e.exports=function(e){return n(e,o(e))}},5240:()=>{},115:()=>{},3119:()=>{},2015:()=>{}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n](i,i.exports,r),i.loaded=!0,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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.p="";var n={};(()=>{r.d(n,{Il:()=>h,yQ:()=>e,Ju:()=>v,in:()=>O,HY:()=>we,F4:()=>Vt,ZP:()=>Wt,aY:()=>Yt,Qx:()=>$t,Pf:()=>Gt});var e={};r.r(e);var t,o,i,a,s,u,c,l,f,d,h,p,m=r(2822),g=r.n(m);!function(e){e[e.Pending=0]="Pending",e[e.Ready=1]="Ready",e[e.Error=2]="Error"}(t||(t={})),function(e){e.Added="DesignBlockAddedEvent",e.Updated="DesignBlockUpdatedEvent",e.Removed="DesignBlockRemovedEvent"}(o||(o={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Middle=2]="Middle",e[e.Unknown=255]="Unknown"}(i||(i={})),function(e){e[e.Up=0]="Up",e[e.Down=1]="Down"}(a||(a={})),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"}(s||(s={})),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"}(u||(u={})),function(e){e[e.Normal=0]="Normal",e[e.Italic=1]="Italic"}(c||(c={})),function(e){e.Bold="bold",e.Italic="italic"}(l||(l={})),function(e){e[e.Undefined=0]="Undefined",e[e.DesignUnit=1]="DesignUnit",e[e.Percent=2]="Percent",e[e.Auto=3]="Auto"}(f||(f={})),function(e){e[e.Free=0]="Free",e[e.VerticalStack=1]="VerticalStack",e[e.HorizontalStack=2]="HorizontalStack",e[e.DepthStack=3]="DepthStack"}(d||(d={})),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.fromRGBA=function(e){return{colorSpace:t.sRGB,components:{x:e.r,y:e.g,z:e.b,w:e.a},spotColorName:""}},e.toRGBA=function(e,r){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:{const t=r.getSpotColorRGBA(e.spotColorName);return{r:t[0],g:t[1],b:t[2],a:e.components.w}}case t.CMYK:throw new Error("CMYK to RGBA conversion not supported!");default:throw new Error("Unknown color space!")}},e.fromSpotColor=function(e){return{colorSpace:t.SpotColor,components:{x:0,y:0,z:0,w:1},spotColorName:e.name}},e.toSpotColor=function(e){return{name:e.spotColorName}},e.toRGBAOrSpotColor=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};default:throw new Error("Unknown color space!")}}}(h||(h={})),function(e){e.Scene="//ly.img.ubq/scene",e.Stack="//ly.img.ubq/stack",e.Camera="//ly.img.ubq/camera",e.Page="//ly.img.ubq/page",e.Image="//ly.img.ubq/image",e.Video="//ly.img.ubq/video",e.VideoFill="//ly.img.ubq/fill/video",e.ImageFill="//ly.img.ubq/fill/image",e.Audio="//ly.img.ubq/audio",e.Text="//ly.img.ubq/text",e.Sticker="//ly.img.ubq/sticker",e.VectorPath="//ly.img.ubq/vector_path",e.RectShape="//ly.img.ubq/shapes/rect",e.LineShape="//ly.img.ubq/shapes/line",e.StarShape="//ly.img.ubq/shapes/star",e.PolygonShape="//ly.img.ubq/shapes/polygon",e.EllipseShape="//ly.img.ubq/shapes/ellipse",e.Group="//ly.img.ubq/group",e.Cutout="//ly.img.ubq/cutout"}(p||(p={}));const v=p;var y,b,w,E;!function(e){e.Unknown="",e.Boolean="bool",e.Boolean2="ubq/math/bool2",e.Int="int",e.UInt8="uint8_t",e.Int32="int32_t",e.UInt32="uint32_t",e.Int2="ubq/math/ivec2",e.Size2="ubq/types/Size2",e.Color="ubq/types/Color",e.Double="double",e.Float="float",e.Float2="ubq/math/vec2",e.Float3="ubq/math/vec3",e.Float4="ubq/math/vec4",e.String="string",e.HorizontalTextAlignment="ubq/types/HorizontalTextAlignment",e.VerticalTextAlignment="ubq/types/VerticalTextAlignment",e.Margin2D="ubq/types/OuterMargin2D"}(y||(y={})),function(e){e.Transform="ubq/editMode/transform",e.Crop="ubq/editMode/crop",e.Text="ubq/editMode/text"}(b||(b={})),function(e){e[e.Arrow=0]="Arrow",e[e.Move=1]="Move",e[e.MoveNotPermitted=2]="MoveNotPermitted",e[e.Resize=3]="Resize",e[e.Rotate=4]="Rotate",e[e.Text=5]="Text"}(w||(w={})),function(e){e[e.Creator=0]="Creator",e[e.Adopter=1]="Adopter",e[e.Viewer=2]="Viewer",e[e.Presenter=3]="Presenter"}(E||(E={}));const _=(e,t)=>({x:e.x*t,y:e.y*t});function x(e,t,r=Number.EPSILON){return Math.abs(e-t)<r}class k{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()}}async createElement(e,t,r){const n=await this.execute("ubq/designblocks/create",e);this.execute("ubq/designblocks/addToParent",[n,t]);const o=C(this.ubq.getLastFrameWidth(t)),i=C(this.ubq.getLastFrameHeight(t)),{position:a,size:s}=function(e,t,r=8/13){const n=((e,t)=>{const r=e.x/e.y,n=t.x/t.y;return _(t,r>n?e.y/t.y:e.x/t.x)})(e,t),o=_(n,r);return{position:{x:.5*(e.x-o.x),y:.5*(e.y-o.y)},size:o}}({x:o,y:i},{x:r.width,y:r.height},8/13);s.x?this.ubq.setWidth(n,s.x):this.ubq.setWidthMode(n,"Auto"),s.y?this.ubq.setHeight(n,s.y):this.ubq.setHeightMode(n,"Auto");const u=function(e={x:50,y:50}){return{x:Math.random()*e.x,y:Math.random()*e.y}}({x:.08*o,y:.08*i});return this.ubq.setPositionX(n,a.x+u.x),this.ubq.setPositionY(n,a.y+u.y),n}setValue(e,t,r,n){return this.useInternalAPI((o=>C(o.setValue(e,t,r,n))))}getValue(e,t,r){return this.useInternalAPI((n=>C(n.getValue(e,t,r))))}async getEditorState(){return this.execute("ubq/editor/getEditorState")}async setEditorState(e){return void 0===e?Promise.reject():this.execute("ubq/editor/setEditorState",e)}async execute(e,t){return new Promise(((r,n)=>{this.useInternalAPI((o=>o.ubqExecute(e,t,(e=>{try{const t=C(e);r(t)}catch(e){n(e)}})))).delete()}))}}function C(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 S(e){return new Promise(((t,r)=>{e((e=>{try{const r=C(e);t(r)}catch(e){r(e)}}))}))}const A=(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 P,T,F,B,D,L=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 R=new WeakMap;class M{constructor(e){P.add(this),T.set(this,void 0),Object.defineProperty(this,"onAssetSourceAdded",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=L(this,T,"f").subscribeToAssetSourceAdded(e);return()=>{L(this,T,"f").isDeleted()||C(L(this,T,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onAssetSourceRemoved",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=L(this,T,"f").subscribeToAssetSourceRemoved(e);return()=>{L(this,T,"f").isDeleted()||C(L(this,T,"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,T,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),c=null===(n=e.applyAsset)||void 0===n?void 0:n.bind(e),l=null===(o=e.applyAssetToBlock)||void 0===o?void 0:o.bind(e),f=null===(i=e.addAsset)||void 0===i?void 0:i.bind(e),d=null===(a=e.removeAsset)||void 0===a?void 0:a.bind(e),h=e.credits,p=e.license;C(L(this,T,"f").addAssetSource(e.id,(async(t,r)=>{var n;try{const n=Object.assign(Object.assign({},t),{tags:A(t.tags),groups:A(t.groups),excludeGroups:A(t.excludeGroups)}),o=await e.findAssets(n);r.invoke(o)}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,h?()=>{var e;return{name:h.name,url:null!==(e=h.url)&&void 0!==e?e:""}}:null,p?()=>{var e;return{name:p.name,url:null!==(e=p.url)&&void 0!==e?e:""}}:null,s?()=>{var e;return null!==(e=s())&&void 0!==e?e:[]}:null,c?async(e,t)=>{var r;try{const r=await c(L(this,P,"m",F).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,l?async(e,t,r)=>{var n;try{await l(L(this,P,"m",F).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,f?async e=>{f(e)}:null,d?async e=>{d(e)}:null)),L(this,P,"m",B).call(this,e.id,e)}addLocalSource(e,t,r,n){C(L(this,T,"f").addLocalAssetSource(e,null!=t?t:[],r?async(e,t)=>{var n;try{const n=await r(L(this,P,"m",F).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(L(this,P,"m",F).call(this,e),t),r.invoke()}catch(e){r.invoke(null!==(o=e.message)&&void 0!==o?o:"Unknown error in user-defined `replaceAsset`")}}:null))}removeSource(e){C(L(this,T,"f").removeAssetSource(e)),L(this,P,"m",D).call(this,e)}findAllSources(){return A(L(this,T,"f").findAllAssetSources())}findAssets(e,t){return new Promise(((r,n)=>{var o,i,a,s,u,c,l;let f=null!==(o=null==t?void 0:t.tags)&&void 0!==o?o:[];Array.isArray(f)||(f=[f]);const d={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:f,groups:null!==(u=null==t?void 0:t.groups)&&void 0!==u?u:[],excludeGroups:null!==(c=null==t?void 0:t.excludeGroups)&&void 0!==c?c:[],locale:null!==(l=null==t?void 0:t.locale)&&void 0!==l?l:""};L(this,T,"f").findAssetSourceAssets(e,d,(e=>{try{const t=C(e),n=A(t.assets).map(L(this,P,"m",F));r({assets:n,currentPage:t.currentPage,nextPage:-1===t.nextPage?void 0:t.nextPage,total:t.total})}catch(e){n(e)}}))}))}async getGroups(e){return S((t=>L(this,T,"f").getAssetSourceGroups(e,t))).then((e=>A(e)))}getSupportedMimeTypes(e){return A(C(L(this,T,"f").getAssetSourceSupportedMimeTypes(e)))}getCredits(e){const t=C(L(this,T,"f").getAssetSourceCredits(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}getLicense(e){const t=C(L(this,T,"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=R.get(L(this,T,"f")))||void 0===t?void 0:t.get(e))||void 0===r?void 0:r.canManageAssets)}addAssetToSource(e,t){C(L(this,T,"f").addAssetToSource(e,t))}removeAssetFromSource(e,t){C(L(this,T,"f").removeAssetFromSource(e,t))}async apply(e,t){return new Promise(((r,n)=>{L(this,T,"f").applyAssetSourceAsset(e,t,(e=>{try{const t=C(e);L(this,T,"f").isValid(t)?r(t):r(void 0)}catch(e){n(e)}}))}))}async applyToBlock(e,t,r){return S((n=>L(this,T,"f").applyAssetSourceAssetToBlock(e,t,r,n)))}async defaultApplyAsset(e){return new Promise(((t,r)=>{L(this,T,"f").defaultApplyAsset(e,(e=>{try{const r=C(e);L(this,T,"f").isValid(r)?t(r):t(void 0)}catch(e){r(e)}}))}))}async defaultApplyAssetToBlock(e,t){return S((r=>L(this,T,"f").defaultApplyAssetToBlock(e,t,r)))}dispose(){R.delete(L(this,T,"f"))}}T=new WeakMap,P=new WeakSet,F=function(e){var t,r,n,o,i,a,s,u;const c=Object.assign(Object.assign({},e),{groups:A(e.groups),meta:void 0,tags:A(e.tags)});return e.meta.size()>0&&(c.meta={},A(e.meta.keys()).forEach((t=>{c.meta[t]="width"===t||"height"===t?parseFloat(e.meta.get(t)):e.meta.get(t)}))),0===(null===(t=c.groups)||void 0===t?void 0:t.length)&&delete c.groups,c.locale||delete c.locale,c.label||delete c.label,0===(null===(r=c.tags)||void 0===r?void 0:r.length)&&delete c.tags,(null===(n=c.credits)||void 0===n?void 0:n.name)||(null===(o=c.credits)||void 0===o?void 0:o.url)?c.credits.url||delete c.credits.url:delete c.credits,(null===(i=c.license)||void 0===i?void 0:i.name)||(null===(a=c.license)||void 0===a?void 0:a.url)?c.license.url||delete c.license.url:delete c.license,(null===(s=c.utm)||void 0===s?void 0:s.source)||(null===(u=c.utm)||void 0===u?void 0:u.medium)?(c.utm.source||delete c.utm.source,c.utm.medium||delete c.utm.medium):delete c.utm,c},B=function(e,t){R.has(L(this,T,"f"))||R.set(L(this,T,"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/`),R.get(L(this,T,"f")).set(e,{canManageAssets:t.canManageAssets})},D=function(e){var t;null===(t=R.get(L(this,T,"f")))||void 0===t||t.delete(e)};var O,I=r(7168),j=r.n(I);!function(e){e.Info="Info",e.Warning="Warning",e.Error="Error"}(O||(O={}));const U={baseURL:"/extensions/",entries:["ly.img.cesdk.fonts"]},q={company_name:{value:"img.ly"},first_name:{value:"Charly"},last_name:{value:"Williams"},address:{value:"742 Evergreen Terrace"},city:{value:"Springfield"}},N=(e,t)=>{const r=`[UBQ] ${e}`;switch(t){case O.Warning:console.warn(r);break;case O.Error:console.error(r);break;case O.Info:default:console.log(r)}},z={log:N},H={baseURL:"core/"};function W(e,t=("undefined"==typeof window?"":window.location.href)){return new URL(e,""===t?void 0:t).href}function V(e){return"/"!==e[e.length-1]?`${e}/`:e}const G=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)},$={canManageAssets:!1,getGroups:()=>Promise.resolve([]),findAssets(){throw new Error("Implementation required")},getAsset(){throw new Error("Implementation required")},addAsset(){throw new Error("Implementation required")},removeAsset(){throw new Error("Implementation required")},getTypes(){throw new Error("Implementation required")},hasType(){throw new Error("Implementation required")}};class Y 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 X(e){return"object"==typeof e&&null!=e}function K(e){return"string"==typeof e?JSON.stringify(e):""+e}function Q(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: `"+K(n)+"`"}=e;return{value:n,type:a,refinement:s,key:o[o.length-1],path:o,branch:i,...e,message:u}}function*Z(e,t,r,n){var o;X(o=e)&&"function"==typeof o[Symbol.iterator]||(e=[e]);for(const o of e){const e=Q(o,t,r,n);e&&(yield e)}}function*J(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&&X(t.schema)&&X(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,c,l]of t.entries(e,s)){const t=J(c,l,{path:void 0===r?n:[...n,r],branch:void 0===r?o:[...o,c],coerce:i,mask:a});for(const n of t)n[0]?(u=!1,yield[n[0],void 0]):i&&(c=n[1],void 0===r?e=c:e instanceof Map?e.set(r,c):e instanceof Set?e.add(c):X(e)&&(e[r]=c))}if(u)for(const r of t.refiner(e,s))u=!1,yield[r,void 0];u&&(yield[void 0,e])}class ee{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)=>Z(n(e,t),t,this,e):()=>[],this.refiner=o?(e,t)=>Z(o(e,t),t,this,e):()=>[]}assert(e){return function(e,t){const r=te(e,t);if(r[0])throw r[0]}(e,this)}create(e){return function(e,t){const r=te(e,t,{coerce:!0});if(r[0])throw r[0];return r[1]}(e,this)}is(e){return function(e,t){return!te(e,t)[0]}(e,this)}mask(e){return function(e,t){const r=te(e,t,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}(e,this)}validate(e,t={}){return te(e,this,t)}}function te(e,t,r={}){const n=J(e,t,r),o=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);return o[0]?[new Y(o[0],(function*(){for(const e of n)e[0]&&(yield e[0])})),void 0]:[void 0,o[1]]}function re(e,t){return new ee({type:e,schema:null,validator:t})}function ne(e){return new ee({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: "+K(e)})}function oe(){return re("boolean",(e=>"boolean"==typeof e))}function ie(){return re("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||"Expected an integer, but received: "+K(e)))}function ae(){return re("number",(e=>"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+K(e)))}function se(e){const t=e?Object.keys(e):[],r=re("never",(()=>!1));return new ee({type:"object",schema:e||null,*entries(n){if(e&&X(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=>X(e)||"Expected an object, but received: "+K(e),coercer:e=>X(e)?{...e}:e})}function ue(){return re("string",(e=>"string"==typeof e||"Expected a string, but received: "+K(e)))}function ce(e,t,r={}){const{exclusive:n}=r;return de(e,"max",(r=>n?r<t:r<=t||"Expected a "+e.type+" less than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function le(e,t,r={}){const{exclusive:n}=r;return de(e,"min",(r=>n?r>t:r>=t||"Expected a "+e.type+" greater than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function fe(e){return de(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 de(e,t,r){return new ee({...e,*refiner(n,o){yield*e.refiner(n,o);const i=Z(r(n,o),o,e,n);for(const e of i)yield{...e,refinement:t}}})}function he(e,t,r){const[n]=te(t,r);if(n)throw n.message=`Error in argument '${e}': ${n.message}`,n}function pe(){const e=/image\/(png|jpeg|x-tga)|video\/(mp4|quicktime)|application\/octet-stream|application\/pdf/;return re("MimeType",(t=>!("string"!=typeof t||!e.test(t))||{message:`expected one of "image/png", "image/jpeg", "image/x-tga", "video/mp4", "video/quicktime", "application/pdf" or "application/octet-stream", but got "${t}"`}))}function me(){const e=["Free","VerticalStack","HorizontalStack","DepthStack"];return re("SceneLayout",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}var ge,ve,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 be{constructor(e){ge.set(this,void 0),Object.defineProperty(this,"onStateChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=ye(this,ge,"f").subscribeToEditorState(e);return()=>{ye(this,ge,"f").isDeleted()||C(ye(this,ge,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onHistoryUpdated",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=ye(this,ge,"f").subscribeToHistory(e);return()=>{ye(this,ge,"f").isDeleted()||ye(this,ge,"f").unsubscribe(t)}}}),Object.defineProperty(this,"onSettingsChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=ye(this,ge,"f").subscribeToSettings(e);return()=>{ye(this,ge,"f").isDeleted()||C(ye(this,ge,"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,ge,e,"f")}setEditMode(e){he("keypath",e,ue()),ye(this,ge,"f").setEditMode(e)}getEditMode(){return ye(this,ge,"f").getEditMode()}getCursorType(){return ye(this,ge,"f").getCursorType()}getCursorRotation(){return ye(this,ge,"f").getCursorRotation()}getTextCursorPositionInScreenSpaceX(){return ye(this,ge,"f").getTextCursorPositionInScreenSpaceX()}getTextCursorPositionInScreenSpaceY(){return ye(this,ge,"f").getTextCursorPositionInScreenSpaceY()}createHistory(){return ye(this,ge,"f").createHistory()}destroyHistory(e){C(ye(this,ge,"f").destroyHistory(e))}setActiveHistory(e){C(ye(this,ge,"f").setActiveHistory(e))}getActiveHistory(){return ye(this,ge,"f").getActiveHistory()}addUndoStep(){C(ye(this,ge,"f").addUndoStep())}undo(){C(ye(this,ge,"f").undo())}redo(){C(ye(this,ge,"f").redo())}canUndo(){return C(ye(this,ge,"f").canUndo())}canRedo(){return C(ye(this,ge,"f").canRedo())}setSettingBool(e,t){return he("keypath",e,ue()),he("value",t,oe()),C(ye(this,ge,"f").setSettingBool(e,t))}getSettingBool(e){return he("keypath",e,ue()),C(ye(this,ge,"f").getSettingBool(e))}setSettingInt(e,t){return he("keypath",e,ue()),he("value",t,ie()),C(ye(this,ge,"f").setSettingFloat(e,t))}getSettingInt(e){return he("keypath",e,ue()),C(ye(this,ge,"f").getSettingFloat(e))}setSettingFloat(e,t){return he("keypath",e,ue()),he("value",t,ae()),C(ye(this,ge,"f").setSettingFloat(e,t))}getSettingFloat(e){return he("keypath",e,ue()),C(ye(this,ge,"f").getSettingFloat(e))}setSettingString(e,t){return he("keypath",e,ue()),he("value",t,ue()),C(ye(this,ge,"f").setSettingString(e,t))}getSettingString(e){return he("keypath",e,ue()),C(ye(this,ge,"f").getSettingString(e))}setSettingColorRGBA(e,t,r,n,o=1){return he("keypath",e,ue()),he("r",t,ae()),he("g",r,ae()),he("b",n,ae()),he("a",o,ae()),C(ye(this,ge,"f").setSettingColorRGBA(e,t,r,n,o))}getSettingColorRGBA(e){return he("keypath",e,ue()),C(ye(this,ge,"f").getSettingColorRGBA(e))}setSettingEnum(e,t){return he("keypath",e,ue()),he("value",t,ue()),C(ye(this,ge,"f").setSettingEnum(e,t))}getSettingEnum(e){return he("keypath",e,ue()),C(ye(this,ge,"f").getSettingEnum(e))}getAvailableMemory(){return C(ye(this,ge,"f").getAvailableMemory())}getUsedMemory(){return C(ye(this,ge,"f").getUsedMemory())}setURIResolver(e){return C(ye(this,ge,"f").setURIResolver(e))}defaultURIResolver(e){return ye(this,ge,"f").defaultURIResolver(e)}getAbsoluteURI(e){return C(ye(this,ge,"f").getAbsoluteURI(e))}setGlobalScope(e,t){he("key",e,ue()),he("value",t,ue()),C(ye(this,ge,"f").setGlobalScope(e,t))}getGlobalScope(e){return he("key",e,ue()),C(ye(this,ge,"f").getGlobalScope(e))}findAllSpotColors(){return A(ye(this,ge,"f").findAllSpotColors())}getSpotColorRGBA(e){return he("name",e,ue()),ye(this,ge,"f").getSpotColorRGB(e)}setSpotColorRGB(e,t,r,n){return he("name",e,ue()),he("r",t,ae()),he("g",r,ae()),he("b",n,ae()),ye(this,ge,"f").setSpotColorRGB(e,t,r,n)}removeSpotColor(e){return he("name",e,ue()),C(ye(this,ge,"f").removeSpotColor(e))}setSpotColorForCutoutType(e,t){return he("type",e,ue()),he("color",t,ue()),C(ye(this,ge,"f").setSpotColorForCutoutType(e,t))}getSpotColorForCutoutType(e){return he("type",e,ue()),C(ye(this,ge,"f").getSpotColorForCutoutType(e))}}ge=new WeakMap,function(e){e.Png="image/png",e.Jpeg="image/jpeg",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"}(ve||(ve={}));const we=ve,Ee="undefined"!=typeof Blob?Blob:(()=>{try{return r(1892).Blob}catch(e){return function(){throw new Error("Could not find Blob constructor and failed to require('buffer').Blob")}}})();var _e,xe,ke,Ce=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},Se=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 Ae{constructor(e){_e.set(this,void 0),xe.set(this,void 0),ke.set(this,void 0),Ce(this,_e,e,"f"),Ce(this,xe,new k(e),"f"),Ce(this,ke,new be(e),"f")}async export(e,t=we.Png,r={}){var n,o;he("handle",e,ae()),he("mimeType",t,pe()),he("options",r,se());const i=null!=r.targetWidth&&null!=r.targetHeight,a=null!==(n=r.jpegQuality)&&void 0!==n?n:.9,s=null!==(o=r.pngCompressionLevel)&&void 0!==o?o:5;return he("jpegQuality",a,le(ce(ae(),1),0,{exclusive:!0})),he("pngCompressionLevel",s,le(ce(ie(),9),0)),null==r.targetWidth&&null==r.targetHeight||(he("targetWidth",r.targetWidth,ae()),he("targetHeight",r.targetHeight,ae())),new Promise(((n,o)=>{var u,c,l;Se(this,_e,"f").exportToBuffer(e,t,(e=>{"error"in e?o(e.error):n(new Ee([e],{type:t}))}),{pngCompressionLevel:s,jpegQuality:a,useTargetSize:i,targetWidth:null!==(u=r.targetWidth)&&void 0!==u?u:0,targetHeight:null!==(c=r.targetHeight)&&void 0!==c?c:0,exportPdfWithHighCompatibility:null===(l=r.exportPdfWithHighCompatibility)||void 0===l||l})}))}async exportWithColorMask(e,t=we.Mp4,r,n,o,i={}){var a,s;he("handle",e,ae()),he("mimeType",t,pe()),he("options",i,se());const u=null!=i.targetWidth&&null!=i.targetHeight,c=null!==(a=i.jpegQuality)&&void 0!==a?a:.9,l=null!==(s=i.pngCompressionLevel)&&void 0!==s?s:5;return he("jpegQuality",c,le(ce(ae(),1),0,{exclusive:!0})),he("pngCompressionLevel",l,le(ce(ie(),9),0)),null==i.targetWidth&&null==i.targetHeight||(he("targetWidth",i.targetWidth,ae()),he("targetHeight",i.targetHeight,ae())),new Promise(((a,s)=>{var f,d,h;Se(this,_e,"f").exportWithColorMaskToBuffer(e,t,r,n,o,((e,r)=>{"error"in e?s(e.error):"error"in r?s(r.error):a([new Ee([e.buffer],{type:t}),new Ee([r.buffer],{type:t})])}),{pngCompressionLevel:l,jpegQuality:c,useTargetSize:u,targetWidth:null!==(f=i.targetWidth)&&void 0!==f?f:0,targetHeight:null!==(d=i.targetHeight)&&void 0!==d?d:0,exportPdfWithHighCompatibility:null===(h=i.exportPdfWithHighCompatibility)||void 0===h||h})}))}async exportVideo(e,t=we.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 he("content",e,ue()),S((t=>Se(this,_e,"f").loadBlocksFromString(e,t))).then((e=>A(e)))}async saveToString(e){return he("blocks",e,ne(ae())),S((t=>Se(this,_e,"f").saveBlocksToString(e,t)))}create(e){return he("type",e,ue()),C(Se(this,_e,"f").create(e))}createFill(e){return he("type",e,ue()),C(Se(this,_e,"f").createFill(e))}getType(e){return he("id",e,ie()),C(Se(this,_e,"f").getType(e))}select(e){return he("id",e,ie()),C(Se(this,_e,"f").select(e))}setSelected(e,t){return he("id",e,ie()),he("selected",t,oe()),C(Se(this,_e,"f").setSelected(e,t))}isSelected(e){return he("id",e,ie()),C(Se(this,_e,"f").isSelected(e))}findAllSelected(){return A(Se(this,_e,"f").findAllSelected())}onSelectionChanged(e){const t=Se(this,_e,"f").subscribeToSelectionChange(e);return()=>{Se(this,_e,"f").isDeleted()||C(Se(this,_e,"f").unsubscribe(t))}}isGroupable(e){return he("ids",e,fe(ne(ae()))),C(Se(this,_e,"f").isGroupable(e))}group(e){return he("ids",e,fe(ne(ae()))),C(Se(this,_e,"f").group(e))}ungroup(e){return he("id",e,ae()),C(Se(this,_e,"f").ungroup(e))}enterGroup(e){return he("id",e,ae()),C(Se(this,_e,"f").enterGroup(e))}exitGroup(e){return he("id",e,ae()),C(Se(this,_e,"f").exitGroup(e))}setName(e,t){return he("id",e,ie()),he("name",t,ue()),C(Se(this,_e,"f").setName(e,t))}getName(e){return he("id",e,ie()),C(Se(this,_e,"f").getName(e))}getUUID(e){return he("id",e,ie()),C(Se(this,_e,"f").getUUID(e))}findByName(e){he("name",e,ue());const t=Se(this,_e,"f").findByName(e);return A(t)}findByType(e){he("type",e,ue());const t=C(Se(this,_e,"f").findByType(e));return A(t)}findAll(){return A(Se(this,_e,"f").findAll())}findAllPlaceholders(){return A(Se(this,_e,"f").findAllPlaceholders())}isVisible(e){return he("id",e,ie()),C(Se(this,_e,"f").isVisible(e))}setVisible(e,t){return he("id",e,ie()),he("visible",t,oe()),C(Se(this,_e,"f").setVisible(e,t))}isClipped(e){return he("id",e,ie()),C(Se(this,_e,"f").isClipped(e))}setClipped(e,t){return he("id",e,ie()),he("clipped",t,oe()),C(Se(this,_e,"f").setClipped(e,t))}getPositionX(e){return he("id",e,ie()),C(Se(this,_e,"f").getPositionX(e))}getPositionXMode(e){return he("id",e,ie()),C(Se(this,_e,"f").getPositionXMode(e))}getPositionY(e){return he("id",e,ie()),C(Se(this,_e,"f").getPositionY(e))}getPositionYMode(e){return he("id",e,ie()),C(Se(this,_e,"f").getPositionYMode(e))}setPositionX(e,t){return he("id",e,ie()),he("value",t,ae()),C(Se(this,_e,"f").setPositionX(e,t))}setPositionXMode(e,t){return he("id",e,ie()),C(Se(this,_e,"f").setPositionXMode(e,t))}setPositionY(e,t){return he("id",e,ie()),he("value",t,ae()),C(Se(this,_e,"f").setPositionY(e,t))}setPositionYMode(e,t){return he("id",e,ie()),C(Se(this,_e,"f").setPositionYMode(e,t))}setAlwaysOnTop(e,t){return he("id",e,ie()),he("enabled",t,oe()),C(Se(this,_e,"f").setAlwaysOnTop(e,t))}isAlwaysOnTop(e){return he("id",e,ie()),C(Se(this,_e,"f").isAlwaysOnTop(e))}bringToFront(e){return he("id",e,ae()),C(Se(this,_e,"f").bringToFront(e))}sendToBack(e){return he("id",e,ae()),C(Se(this,_e,"f").sendToBack(e))}bringForward(e){return he("id",e,ae()),C(Se(this,_e,"f").bringForward(e))}sendBackward(e){return he("id",e,ae()),C(Se(this,_e,"f").sendBackward(e))}getRotation(e){return he("id",e,ie()),C(Se(this,_e,"f").getRotation(e))}setRotation(e,t){return he("id",e,ie()),he("radians",t,ae()),C(Se(this,_e,"f").setRotation(e,t))}getFlipHorizontal(e){return he("id",e,ie()),C(Se(this,_e,"f").getFlip(e)).horizontal}getFlipVertical(e){return he("id",e,ie()),C(Se(this,_e,"f").getFlip(e)).vertical}setFlipHorizontal(e,t){return he("id",e,ie()),he("flip",t,oe()),C(Se(this,_e,"f").setFlipHorizontal(e,t))}setFlipVertical(e,t){return he("id",e,ie()),he("flip",t,oe()),C(Se(this,_e,"f").setFlipVertical(e,t))}hasContentFillMode(e){return he("id",e,ie()),C(Se(this,_e,"f").hasContentFillMode(e))}getWidth(e){return he("id",e,ie()),C(Se(this,_e,"f").getWidth(e))}getWidthMode(e){return he("id",e,ie()),C(Se(this,_e,"f").getWidthMode(e))}getHeight(e){return he("id",e,ie()),C(Se(this,_e,"f").getHeight(e))}getHeightMode(e){return he("id",e,ie()),C(Se(this,_e,"f").getHeightMode(e))}setWidth(e,t){return he("id",e,ie()),he("value",t,ae()),C(Se(this,_e,"f").setWidth(e,t))}setWidthMode(e,t){return he("id",e,ie()),C(Se(this,_e,"f").setWidthMode(e,t))}setHeight(e,t){return he("id",e,ie()),he("value",t,ae()),C(Se(this,_e,"f").setHeight(e,t))}setHeightMode(e,t){return he("id",e,ie()),C(Se(this,_e,"f").setHeightMode(e,t))}getFrameX(e){return he("id",e,ie()),C(Se(this,_e,"f").getLastFrameX(e))}getFrameY(e){return he("id",e,ie()),C(Se(this,_e,"f").getLastFrameY(e))}getFrameWidth(e){return he("id",e,ie()),C(Se(this,_e,"f").getLastFrameWidth(e))}getFrameHeight(e){return he("id",e,ie()),C(Se(this,_e,"f").getLastFrameHeight(e))}setContentFillMode(e,t){return he("id",e,ie()),C(Se(this,_e,"f").setContentFillMode(e,t))}getContentFillMode(e){return he("id",e,ie()),C(Se(this,_e,"f").getContentFillMode(e))}duplicate(e){return he("id",e,ie()),C(Se(this,_e,"f").duplicate(e))}destroy(e){return he("id",e,ie()),C(Se(this,_e,"f").destroy(e))}isValid(e){return he("id",e,ie()),Se(this,_e,"f").isValid(e)}getParent(e){return he("id",e,ie()),C(Se(this,_e,"f").hasParent(e))?C(Se(this,_e,"f").getParent(e)):null}getChildren(e){he("id",e,ie());const t=C(Se(this,_e,"f").getChildren(e));return A(t)}insertChild(e,t,r){return he("parent",e,ae()),he("child",t,ae()),he("index",r,le(ae(),0)),C(Se(this,_e,"f").insertChild(e,t,r))}appendChild(e,t){return he("parent",e,ae()),he("child",t,ae()),C(Se(this,_e,"f").appendChild(e,t))}referencesAnyVariables(e){return he("id",e,ie()),C(Se(this,_e,"f").referencesAnyVariables(e))}getGlobalBoundingBoxX(e){return he("id",e,ie()),C(Se(this,_e,"f").getGlobalBoundingBoxX(e))}getGlobalBoundingBoxY(e){return he("id",e,ie()),C(Se(this,_e,"f").getGlobalBoundingBoxY(e))}getGlobalBoundingBoxWidth(e){return he("id",e,ie()),C(Se(this,_e,"f").getGlobalBoundingBoxWidth(e))}getGlobalBoundingBoxHeight(e){return he("id",e,ie()),C(Se(this,_e,"f").getGlobalBoundingBoxHeight(e))}getScreenSpaceBoundingBoxXYWH(e){return he("ids",e,ne(ae())),C(Se(this,_e,"f").getScreenSpaceBoundingBoxXYWH(e))}alignHorizontally(e,t){return he("ids",e,fe(ne(ae()))),C(Se(this,_e,"f").alignHorizontally(e,t))}alignVertically(e,t){return he("ids",e,fe(ne(ae()))),C(Se(this,_e,"f").alignVertically(e,t))}isAlignable(e){return he("ids",e,fe(ne(ae()))),C(Se(this,_e,"f").isAlignable(e))}scale(e,t,r=0,n=0){return he("id",e,ie()),C(Se(this,_e,"f").scale(e,t,r,n))}findAllProperties(e){return he("id",e,ie()),A(C(Se(this,_e,"f").findAllProperties(e)))}isPropertyReadable(e){return he("property",e,ue()),Se(this,_e,"f").isPropertyReadable(e)}isPropertyWritable(e){return he("property",e,ue()),Se(this,_e,"f").isPropertyWritable(e)}getPropertyType(e){return he("property",e,ue()),C(Se(this,_e,"f").getPropertyType(e))}getEnumValues(e){return he("enumProperty",e,ue()),A(C(Se(this,_e,"f").getEnumValues(e)))}setBool(e,t,r){return he("id",e,ie()),he("property",t,ue()),he("value",r,oe()),C(Se(this,_e,"f").setBool(e,t,r))}getBool(e,t){return he("id",e,ie()),he("property",t,ue()),C(Se(this,_e,"f").getBool(e,t))}setInt(e,t,r){return he("id",e,ie()),he("property",t,ue()),he("value",r,ie()),C(Se(this,_e,"f").setInt(e,t,r))}getInt(e,t){return he("id",e,ie()),he("property",t,ue()),C(Se(this,_e,"f").getInt(e,t))}setFloat(e,t,r){return he("id",e,ie()),he("property",t,ue()),he("value",r,ae()),C(Se(this,_e,"f").setFloat(e,t,r))}getFloat(e,t){return he("id",e,ie()),he("property",t,ue()),C(Se(this,_e,"f").getFloat(e,t))}setDouble(e,t,r){return he("id",e,ie()),he("property",t,ue()),he("value",r,ae()),C(Se(this,_e,"f").setDouble(e,t,r))}getDouble(e,t){return he("id",e,ie()),he("property",t,ue()),C(Se(this,_e,"f").getDouble(e,t))}setString(e,t,r){return he("id",e,ie()),he("property",t,ue()),he("value",r,ue()),C(Se(this,_e,"f").setString(e,t,r))}getString(e,t){return he("id",e,ie()),he("property",t,ue()),C(Se(this,_e,"f").getString(e,t))}setColorRGBA(e,t,r,n,o,i=1){return he("id",e,ie()),he("property",t,ue()),he("r",r,ae()),he("g",n,ae()),he("b",o,ae()),he("a",i,ae()),C(Se(this,_e,"f").setColorRGBA(e,t,r,n,o,i))}getColorRGBA(e,t){return he("id",e,ie()),he("property",t,ue()),C(Se(this,_e,"f").getColorRGBA(e,t))}setColorSpot(e,t,r,n=1){return he("id",e,ie()),he("property",t,ue()),he("name",r,ue()),he("tint",n,ae()),C(Se(this,_e,"f").setColorSpot(e,t,r,n))}getColorSpotName(e,t){return he("id",e,ie()),he("property",t,ue()),C(Se(this,_e,"f").getColorSpotName(e,t))}getColorSpotTint(e,t){return he("id",e,ie()),he("property",t,ue()),C(Se(this,_e,"f").getColorSpotTint(e,t))}setEnum(e,t,r){return he("id",e,ie()),he("property",t,ue()),he("value",r,ue()),C(Se(this,_e,"f").setEnum(e,t,r))}getEnum(e,t){return he("id",e,ie()),he("property",t,ue()),C(Se(this,_e,"f").getEnum(e,t))}hasCrop(e){return he("id",e,ie()),C(Se(this,_e,"f").hasCrop(e))}setCropScaleX(e,t){return he("id",e,ie()),he("scaleX",t,ae()),C(Se(this,_e,"f").setCropScaleX(e,t))}setCropScaleY(e,t){return he("id",e,ie()),he("scaleY",t,ae()),C(Se(this,_e,"f").setCropScaleY(e,t))}setCropRotation(e,t){return he("id",e,ie()),he("rotation",t,ae()),C(Se(this,_e,"f").setCropRotation(e,t))}setCropScaleRatio(e,t){return he("id",e,ie()),he("scaleRatio",t,ae()),C(Se(this,_e,"f").setCropScaleRatio(e,t))}setCropTranslationX(e,t){return he("id",e,ie()),he("translationX",t,ae()),C(Se(this,_e,"f").setCropTranslationX(e,t))}setCropTranslationY(e,t){return he("id",e,ie()),he("translationY",t,ae()),C(Se(this,_e,"f").setCropTranslationY(e,t))}resetCrop(e){return he("id",e,ie()),C(Se(this,_e,"f").resetCrop(e))}getCropScaleX(e){return he("id",e,ie()),C(Se(this,_e,"f").getCropScaleX(e))}getCropScaleY(e){return he("id",e,ie()),C(Se(this,_e,"f").getCropScaleY(e))}getCropRotation(e){return he("id",e,ie()),C(Se(this,_e,"f").getCropRotation(e))}getCropScaleRatio(e){return he("id",e,ie()),C(Se(this,_e,"f").getCropScaleRatio(e))}getCropTranslationX(e){return he("id",e,ie()),C(Se(this,_e,"f").getCropTranslationX(e))}getCropTranslationY(e){return he("id",e,ie()),C(Se(this,_e,"f").getCropTranslationY(e))}adjustCropToFillFrame(e,t){return he("id",e,ie()),he("minScaleRatio",t,ae()),C(Se(this,_e,"f").adjustCropToFillFrame(e,t))}flipCropHorizontal(e){return he("id",e,ie()),C(Se(this,_e,"f").flipCropHorizontal(e))}flipCropVertical(e){return he("id",e,ie()),C(Se(this,_e,"f").flipCropVertical(e))}hasOpacity(e){return he("id",e,ie()),C(Se(this,_e,"f").hasOpacity(e))}setOpacity(e,t){return he("id",e,ie()),he("opacity",t,ae()),C(Se(this,_e,"f").setOpacity(e,t))}getOpacity(e){return he("id",e,ie()),C(Se(this,_e,"f").getOpacity(e))}hasBlendMode(e){return he("id",e,ie()),C(Se(this,_e,"f").hasBlendMode(e))}setBlendMode(e,t){return he("id",e,ie()),he("blendMode",t,ue()),C(Se(this,_e,"f").setBlendMode(e,t))}getBlendMode(e){return he("id",e,ie()),C(Se(this,_e,"f").getBlendMode(e))}hasFillColor(e){return he("id",e,ie()),C(Se(this,_e,"f").hasFillColor(e))}setFillColorRGBA(e,t,r,n,o=1){return he("id",e,ie()),he("r",t,ae()),he("g",r,ae()),he("b",n,ae()),he("a",o,ae()),C(Se(this,_e,"f").setFillColorRGBA(e,t,r,n,o))}getFillColorRGBA(e){return he("id",e,ie()),C(Se(this,_e,"f").getFillColorRGBA(e))}setFillColorEnabled(e,t){return he("id",e,ie()),he("enabled",t,oe()),C(Se(this,_e,"f").setFillColorEnabled(e,t))}isFillColorEnabled(e){return he("id",e,ie()),C(Se(this,_e,"f").isFillColorEnabled(e))}createEffect(e){return he("type",e,ue()),C(Se(this,_e,"f").createEffect(e))}hasEffects(e){return he("id",e,ie()),C(Se(this,_e,"f").hasEffects(e))}getEffects(e){he("id",e,ie());const t=C(Se(this,_e,"f").getEffects(e));return A(t)}insertEffect(e,t,r){he("id",e,ie()),he("effectId",t,ie()),he("index",r,le(ie(),0)),C(Se(this,_e,"f").insertEffect(e,t,r))}appendEffect(e,t){he("id",e,ie()),he("effectId",t,ie()),C(Se(this,_e,"f").appendEffect(e,t))}removeEffect(e,t){he("id",e,ie()),he("index",t,le(ie(),0)),C(Se(this,_e,"f").removeEffect(e,t))}hasEffectEnabled(e){return he("effectId",e,ie()),C(Se(this,_e,"f").hasEffectEnabled(e))}setEffectEnabled(e,t){he("effectId",e,ie()),he("enabled",t,oe()),C(Se(this,_e,"f").setEffectEnabled(e,t))}isEffectEnabled(e){return he("effectId",e,ie()),C(Se(this,_e,"f").isEffectEnabled(e))}createBlur(e){return he("type",e,ue()),C(Se(this,_e,"f").createBlur(e))}hasBlur(e){return he("id",e,ie()),C(Se(this,_e,"f").hasBlur(e))}setBlur(e,t){he("id",e,ie()),he("blurId",t,ie()),C(Se(this,_e,"f").setBlur(e,t))}getBlur(e){return he("id",e,ie()),C(Se(this,_e,"f").getBlur(e))}setBlurEnabled(e,t){he("id",e,ie()),he("enabled",t,oe()),C(Se(this,_e,"f").setBlurEnabled(e,t))}isBlurEnabled(e){return he("id",e,ie()),C(Se(this,_e,"f").isBlurEnabled(e))}hasBackgroundColor(e){return he("id",e,ie()),C(Se(this,_e,"f").hasBackgroundColor(e))}setBackgroundColorRGBA(e,t,r,n,o=1){return he("id",e,ie()),he("r",t,ae()),he("g",r,ae()),he("b",n,ae()),he("a",o,ae()),C(Se(this,_e,"f").setBackgroundColorRGBA(e,t,r,n,o))}getBackgroundColorRGBA(e){return he("id",e,ie()),C(Se(this,_e,"f").getBackgroundColorRGBA(e))}setBackgroundColorEnabled(e,t){return he("id",e,ie()),he("enabled",t,oe()),C(Se(this,_e,"f").setBackgroundColorEnabled(e,t))}isBackgroundColorEnabled(e){return he("id",e,ie()),C(Se(this,_e,"f").isBackgroundColorEnabled(e))}hasStroke(e){return he("id",e,ie()),C(Se(this,_e,"f").hasStroke(e))}setStrokeEnabled(e,t){return he("id",e,ie()),he("enabled",t,oe()),C(Se(this,_e,"f").setStrokeEnabled(e,t))}isStrokeEnabled(e){return he("id",e,ie()),C(Se(this,_e,"f").isStrokeEnabled(e))}setStrokeColorRGBA(e,t,r,n,o=1){return he("id",e,ie()),he("r",t,ae()),he("g",r,ae()),he("b",n,ae()),he("a",o,ae()),C(Se(this,_e,"f").setStrokeColorRGBA(e,t,r,n,o))}getStrokeColorRGBA(e){return he("id",e,ie()),C(Se(this,_e,"f").getStrokeColorRGBA(e))}setStrokeWidth(e,t){return he("id",e,ie()),he("width",t,ae()),C(Se(this,_e,"f").setStrokeWidth(e,t))}getStrokeWidth(e){return he("id",e,ie()),C(Se(this,_e,"f").getStrokeWidth(e))}setStrokeStyle(e,t){return he("id",e,ie()),C(Se(this,_e,"f").setStrokeStyle(e,t))}getStrokeStyle(e){return he("id",e,ie()),C(Se(this,_e,"f").getStrokeStyle(e))}setStrokePosition(e,t){return he("id",e,ie()),C(Se(this,_e,"f").setStrokePosition(e,t))}getStrokePosition(e){return he("id",e,ie()),C(Se(this,_e,"f").getStrokePosition(e))}setStrokeCornerGeometry(e,t){return he("id",e,ie()),C(Se(this,_e,"f").setStrokeCornerGeometry(e,t))}getStrokeCornerGeometry(e){return he("id",e,ie()),C(Se(this,_e,"f").getStrokeCornerGeometry(e))}hasOutline(e){return he("id",e,ie()),this.hasStroke(e)}setOutlineColorRGBA(e,t,r,n,o=1){return he("id",e,ie()),he("r",t,ae()),he("g",r,ae()),he("b",n,ae()),he("a",o,ae()),this.setStrokeColorRGBA(e,t,r,n,o)}getOutlineColorRGBA(e){return he("id",e,ie()),this.getStrokeColorRGBA(e)}setOutlineEnabled(e,t){return he("id",e,ie()),he("enabled",t,oe()),this.setStrokeEnabled(e,t)}isOutlineEnabled(e){return he("id",e,ie()),this.isStrokeEnabled(e)}setOutlineWidth(e,t){return he("id",e,ie()),he("width",t,ae()),this.setStrokeWidth(e,t)}getOutlineWidth(e){return he("id",e,ie()),this.getStrokeWidth(e)}hasDropShadow(e){return he("id",e,ie()),C(Se(this,_e,"f").hasDropShadow(e))}setDropShadowEnabled(e,t){return he("id",e,ie()),he("enabled",t,oe()),C(Se(this,_e,"f").setDropShadowEnabled(e,t))}isDropShadowEnabled(e){return he("id",e,ie()),C(Se(this,_e,"f").isDropShadowEnabled(e))}setDropShadowColorRGBA(e,t,r,n,o=1){return he("id",e,ie()),he("r",t,ae()),he("g",r,ae()),he("b",n,ae()),he("a",o,ae()),C(Se(this,_e,"f").setDropShadowColorRGBA(e,t,r,n,o))}getDropShadowColorRGBA(e){return he("id",e,ie()),C(Se(this,_e,"f").getDropShadowColorRGBA(e))}setDropShadowOffsetX(e,t){return he("id",e,ie()),he("offsetX",t,ae()),C(Se(this,_e,"f").setDropShadowOffsetX(e,t))}getDropShadowOffsetX(e){return he("id",e,ie()),C(Se(this,_e,"f").getDropShadowOffsetX(e))}setDropShadowOffsetY(e,t){return he("id",e,ie()),he("offsetY",t,ae()),C(Se(this,_e,"f").setDropShadowOffsetY(e,t))}getDropShadowOffsetY(e){return he("id",e,ie()),C(Se(this,_e,"f").getDropShadowOffsetY(e))}setDropShadowBlurRadiusX(e,t){return he("id",e,ie()),he("blurRadiusX",t,ae()),C(Se(this,_e,"f").setDropShadowBlurRadiusX(e,t))}getDropShadowBlurRadiusX(e){return he("id",e,ie()),C(Se(this,_e,"f").getDropShadowBlurRadiusX(e))}setDropShadowBlurRadiusY(e,t){return he("id",e,ie()),he("blurRadiusY",t,ae()),C(Se(this,_e,"f").setDropShadowBlurRadiusY(e,t))}getDropShadowBlurRadiusY(e){return he("id",e,ie()),C(Se(this,_e,"f").getDropShadowBlurRadiusY(e))}setDropShadowClip(e,t){return he("id",e,ie()),C(Se(this,_e,"f").setDropShadowClip(e,t))}getDropShadowClip(e){return he("id",e,ie()),C(Se(this,_e,"f").getDropShadowClip(e))}createCutoutFromBlocks(e){return he("ids",e,ne(ie())),C(Se(this,_e,"f").createCutoutFromBlocks(e))}createCutoutFromPath(e){return he("path",e,ue()),C(Se(this,_e,"f").createCutoutFromPath(e))}setCutoutOffset(e,t){return he("id",e,ie()),he("offset",t,ae()),C(Se(this,_e,"f").setCutoutOffset(e,t))}getCutoutOffset(e){return he("id",e,ie()),C(Se(this,_e,"f").getCutoutOffset(e))}setCutoutType(e,t){return he("id",e,ie()),C(Se(this,_e,"f").setCutoutType(e,t))}getCutoutType(e){return he("id",e,ie()),C(Se(this,_e,"f").getCutoutType(e))}createCutoutFromOperation(e,t){return he("ids",e,ne(ie())),C(Se(this,_e,"f").createCutoutFromOperation(e,t))}replaceText(e,t,r=-1,n=-1){he("id",e,ie()),he("text",t,ue()),he("from",r,ie()),he("to",n,ie()),C(Se(this,_e,"f").replaceText(e,t,r,n))}removeText(e,t=-1,r=-1){he("id",e,ie()),he("from",t,ie()),he("to",r,ie()),C(Se(this,_e,"f").removeText(e,t,r))}setTextColor(e,t,r=-1,n=-1){let o;he("id",e,ie()),he("from",r,ie()),he("to",n,ie()),o=function(e){return"r"in e&&"a"in e&&void 0!==e.r&&void 0!==e.a}(t)?h.fromRGBA(t):h.fromSpotColor(t),C(Se(this,_e,"f").setTextColor(e,o,r,n))}getTextColors(e,t=-1,r=-1){he("id",e,ie()),he("from",t,ie()),he("to",r,ie());const n=Se(this,_e,"f").getTextColors(e,t,r);return A(C(n)).map((e=>e.colorSpace===h.ColorSpace.SpotColor?h.toSpotColor(e):h.toRGBA(e,Se(this,ke,"f"))))}getTextFontWeights(e,t=-1,r=-1){return he("id",e,ie()),he("from",t,ie()),he("to",r,ie()),A(C(Se(this,_e,"f").getTextFontWeights(e,t,r)))}getTextFontStyles(e,t=-1,r=-1){return he("id",e,ie()),he("from",t,ie()),he("to",r,ie()),A(C(Se(this,_e,"f").getTextFontStyles(e,t,r)))}getTextCases(e,t=-1,r=-1){return he("id",e,ie()),he("from",t,ie()),he("to",r,ie()),A(C(Se(this,_e,"f").getTextCases(e,t,r)))}setTextCase(e,t,r=-1,n=-1){he("id",e,ie()),he("textCase",t,ue()),he("from",r,ie()),he("to",n,ie()),C(Se(this,_e,"f").setTextCase(e,t,r,n))}hasFill(e){return he("id",e,ie()),C(Se(this,_e,"f").hasFill(e))}isFillEnabled(e){return he("id",e,ie()),C(Se(this,_e,"f").isFillEnabled(e))}setFillEnabled(e,t){return he("id",e,ie()),C(Se(this,_e,"f").setFillEnabled(e,t))}getFill(e){return he("id",e,ie()),C(Se(this,_e,"f").getFill(e))}setFill(e,t){return he("id",e,ie()),he("fill",t,ie()),C(Se(this,_e,"f").setFill(e,t))}setFillType(e,t){return he("id",e,ie()),C(Se(this,_e,"f").setFillType(e,t))}getFillType(e){return he("id",e,ie()),C(Se(this,_e,"f").getFillType(e))}setFillSolidColor(e,t,r,n,o=1){he("id",e,ie()),C(Se(this,_e,"f").setFillSolidColor(e,t,r,n,o))}getFillSolidColor(e){return he("id",e,ie()),C(Se(this,_e,"f").getFillSolidColor(e))}setFillGradientType(e,t){he("id",e,ie()),C(Se(this,_e,"f").setFillGradientType(e,t))}getFillGradientType(e){return he("id",e,ie()),C(Se(this,_e,"f").getFillGradientType(e))}addFillGradientColorStop(e,t,r,n,o,i=1){he("id",e,ie()),C(Se(this,_e,"f").addFillGradientColorStop(e,t,r,n,o,i))}removeFillGradientColorStop(e,t){he("id",e,ie()),C(Se(this,_e,"f").removeFillGradientColorStop(e,t))}getFillGradientColorStops(e){return he("id",e,ie()),A(Se(this,_e,"f").getFillGradientColorStops(e))}setFillGradientColorStops(e,t){he("id",e,ie()),C(Se(this,_e,"f").setFillGradientColorStops(e,t))}setFillGradientControlPoint(e,t,r,n){return he("id",e,ie()),C(Se(this,_e,"f").setFillGradientControlPoint(e,t,r,n))}getFillGradientControlPointX(e,t){return he("id",e,ie()),C(Se(this,_e,"f").getFillGradientControlPointX(e,t))}getFillGradientControlPointY(e,t){return he("id",e,ie()),C(Se(this,_e,"f").getFillGradientControlPointY(e,t))}setFillGradientRadius(e,t){return he("id",e,ie()),he("radius",t,ae()),C(Se(this,_e,"f").setFillGradientRadius(e,t))}getFillGradientRadius(e){return he("id",e,ie()),C(Se(this,_e,"f").getFillGradientRadius(e))}setPlaceholderEnabled(e,t){he("id",e,ie()),he("enabled",t,oe()),C(Se(this,_e,"f").setPlaceholderEnabled(e,t))}isPlaceholderEnabled(e){return he("id",e,ie()),C(Se(this,_e,"f").isPlaceholderEnabled(e))}showsPlaceholderContent(e){return he("id",e,ie()),C(Se(this,_e,"f").showsPlaceholderContent(e))}hasPlaceholderControls(e){return he("id",e,ie()),C(Se(this,_e,"f").hasPlaceholderControls(e))}setPlaceholderControlsOverlayEnabled(e,t){return he("id",e,ie()),he("enabled",t,oe()),C(Se(this,_e,"f").setPlaceholderControlsOverlayEnabled(e,t))}isPlaceholderControlsOverlayEnabled(e){return he("id",e,ie()),C(Se(this,_e,"f").isPlaceholderControlsOverlayEnabled(e))}setPlaceholderControlsButtonEnabled(e,t){return he("id",e,ie()),he("enabled",t,oe()),C(Se(this,_e,"f").setPlaceholderControlsButtonEnabled(e,t))}isPlaceholderControlsButtonEnabled(e){return he("id",e,ie()),C(Se(this,_e,"f").isPlaceholderControlsButtonEnabled(e))}setMetadata(e,t,r){he("id",e,ie()),he("key",t,ue()),he("value",r,ue()),C(Se(this,_e,"f").setMetadata(e,t,r))}getMetadata(e,t){return he("id",e,ie()),he("key",t,ue()),C(Se(this,_e,"f").getMetadata(e,t))}hasMetadata(e,t){return he("id",e,ie()),he("key",t,ue()),C(Se(this,_e,"f").hasMetadata(e,t))}findAllMetadata(e){return he("id",e,ie()),A(C(Se(this,_e,"f").findAllMetadata(e)))}removeMetadata(e,t){he("id",e,ie()),he("key",t,ue()),C(Se(this,_e,"f").removeMetadata(e,t))}setScopeEnabled(e,t,r){he("id",e,ie()),he("key",t,ue()),he("enabled",r,oe()),C(Se(this,_e,"f").setScopeEnabled(e,t,r))}isScopeEnabled(e,t){return he("id",e,ie()),he("key",t,ue()),C(Se(this,_e,"f").isScopeEnabled(e,t))}isAllowedByScope(e,t){return he("id",e,ie()),he("key",t,ue()),C(Se(this,_e,"f").isAllowedByScope(e,t))}hasDuration(e){return he("id",e,ie()),C(Se(this,_e,"f").hasDuration(e))}setDuration(e,t){return he("id",e,ie()),he("duration",t,ae()),C(Se(this,_e,"f").setDuration(e,t))}getDuration(e){return he("id",e,ie()),C(Se(this,_e,"f").getDuration(e))}hasTimeOffset(e){return he("id",e,ie()),C(Se(this,_e,"f").hasTimeOffset(e))}setTimeOffset(e,t){return he("id",e,ie()),he("offset",t,ae()),C(Se(this,_e,"f").setTimeOffset(e,t))}getTimeOffset(e){return he("id",e,ie()),C(Se(this,_e,"f").getTimeOffset(e))}hasTrim(e){return he("id",e,ie()),C(Se(this,_e,"f").hasTrim(e))}setTrimOffset(e,t){return he("id",e,ie()),he("offset",t,ae()),C(Se(this,_e,"f").setTrimOffset(e,t))}getTrimOffset(e){return he("id",e,ie()),C(Se(this,_e,"f").getTrimOffset(e))}setTrimLength(e,t){return he("id",e,ie()),he("length",t,ae()),C(Se(this,_e,"f").setTrimLength(e,t))}getTrimLength(e){return he("id",e,ie()),C(Se(this,_e,"f").getTrimLength(e))}getTotalSceneDuration(e){return he("scene",e,ie()),C(Se(this,_e,"f").getTotalSceneDuration(e))}setPlaying(e,t){return he("id",e,ie()),he("enabled",t,oe()),C(Se(this,_e,"f").setPlaying(e,t))}isPlaying(e){return he("id",e,ie()),C(Se(this,_e,"f").isPlaying(e))}hasPlaybackTime(e){return he("id",e,ie()),C(Se(this,_e,"f").hasPlaybackTime(e))}setPlaybackTime(e,t){return he("id",e,ie()),he("time",t,ae()),C(Se(this,_e,"f").setPlaybackTime(e,t))}getPlaybackTime(e){return he("id",e,ie()),C(Se(this,_e,"f").getPlaybackTime(e))}setSoloPlaybackEnabled(e,t){return he("id",e,ie()),he("enabled",t,oe()),C(Se(this,_e,"f").setSoloPlaybackEnabled(e,t))}isSoloPlaybackEnabled(e){return he("id",e,ie()),C(Se(this,_e,"f").isSoloPlaybackEnabled(e))}hasPlaybackControl(e){return he("id",e,ie()),C(Se(this,_e,"f").hasPlaybackControl(e))}setLooping(e,t){he("id",e,ie()),he("looping",t,oe()),C(Se(this,_e,"f").setLooping(e,t))}isLooping(e){return he("id",e,ie()),C(Se(this,_e,"f").isLooping(e))}setMuted(e,t){he("id",e,ie()),he("muted",t,oe()),C(Se(this,_e,"f").setMuted(e,t))}isMuted(e){return he("id",e,ie()),C(Se(this,_e,"f").isMuted(e))}setVolume(e,t){he("id",e,ie()),he("volume",t,ae()),C(Se(this,_e,"f").setVolume(e,t))}getVolume(e){return he("id",e,ie()),C(Se(this,_e,"f").getVolume(e))}async forceLoadAVResource(e){return he("id",e,ie()),S((t=>Se(this,_e,"f").forceLoadAVResource(e,t)))}getAVResourceTotalDuration(e){return he("id",e,ie()),C(Se(this,_e,"f").getAVResourceTotalDuration(e))}async getVideoFillThumbnail(e,t){return he("id",e,ie()),he("thumbnailHeight",t,ie()),new Promise(((r,n)=>{Se(this,_e,"f").getVideoFillThumbnail(e,t,(e=>{"error"in e?n(e.error):r(new Ee([e],{type:"image/jpeg"}))}))}))}async getVideoFillThumbnailAtlas(e,t,r,n){return he("id",e,ie()),he("numberOfColumns",t,ie()),he("numberOfRows",r,ie()),he("thumbnailHeight",n,ie()),new Promise(((o,i)=>{Se(this,_e,"f").getVideoFillThumbnailAtlas(e,t,r,n,(e=>{"error"in e?i(e.error):o(new Ee([e],{type:"image/jpeg"}))}))}))}async getPageThumbnailAtlas(e,t,r,n){return he("id",e,ie()),he("numberOfColumns",t,ie()),he("numberOfRows",r,ie()),new Promise(((o,i)=>{Se(this,_e,"f").getPageThumbnailAtlas(e,t,r,n,(e=>{"error"in e?i(e.error):o(new Ee([e],{type:"image/jpeg"}))}))}))}}_e=new WeakMap,xe=new WeakMap,ke=new WeakMap;var Pe,Te=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},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)},Be=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 De{constructor(e){Pe.set(this,void 0),Object.defineProperty(this,"subscribe",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>{he("blocks",e,ne());const r=Be(this,Pe,"f").subscribe(e,(e=>{try{t(A(e,!0))}catch(e){console.error(e)}}));return()=>{Be(this,Pe,"f").isDeleted()||C(Be(this,Pe,"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,Pe,e,"f")}}Pe=new WeakMap;var Le,Re,Me=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},Oe=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 Ie{constructor(e){Le.set(this,void 0),Re.set(this,void 0),Object.defineProperty(this,"onZoomLevelChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=Oe(this,Le,"f").subscribeToZoomLevel(e);return()=>{Oe(this,Le,"f").isDeleted()||C(Oe(this,Le,"f").unsubscribe(t))}}}),Object.defineProperty(this,"onActiveChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=Oe(this,Le,"f").subscribeToActiveSceneChange(e);return()=>{Oe(this,Le,"f").isDeleted()||C(Oe(this,Le,"f").unsubscribe(t))}}}),Me(this,Le,e,"f"),Me(this,Re,new k(e),"f")}async loadFromString(e){return he("sceneContent",e,ue()),S((t=>Oe(this,Le,"f").loadSceneFromString(e,t)))}async loadFromURL(e){return he("url",e,ue()),S((t=>Oe(this,Le,"f").loadSceneFromURL(e,t)))}async saveToString(){const e=this.get();if(null==e)throw new Error("No scene available.");return S((t=>{Oe(this,Le,"f").saveSceneToString(e,t)}))}async saveToArchive(){return new Promise(((e,t)=>{const r=this.get();null==r?t(new Error("No scene available.")):Oe(this,Le,"f").saveSceneToArchive(r,(r=>{"error"in r?t(r.error):e(new Ee([r],{type:we.Zip}))}))}))}create(e="Free"){return he("sceneLayout",e,me()),C(Oe(this,Le,"f").createScene(e))}createVideo(){return C(Oe(this,Le,"f").createVideoScene())}createFromImage(e,t=300,r=1,n="Free",o=0,i=!1){return he("url",e,ue()),he("dpi",t,le(ae(),0)),he("pixelScaleFactor",r,le(ae(),0)),he("sceneLayout",n,me()),S((a=>Oe(this,Le,"f").createSceneFromImage(e,t,r,n,o,i,a)))}createFromVideo(e){return he("url",e,ue()),S((t=>Oe(this,Le,"f").createSceneFromVideo(e,t)))}get(){const e=C(Oe(this,Le,"f").findByType(v.Scene)),t=A(e);return t.length>0?t[0]:null}async applyTemplateFromString(e){return he("content",e,ue()),S((t=>Oe(this,Le,"f").applyTemplateFromString(e,t)))}async applyTemplateFromURL(e){return he("url",e,ue()),S((t=>Oe(this,Le,"f").applyTemplateFromURL(e,t)))}getMode(){const e=this.get();return C(Oe(this,Le,"f").getSceneMode(e))}setDesignUnit(e){he("designUnit",e,function(){const e=["Pixel","Millimeter","Inch"];return re("DesignUnit",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}());const t=this.get();C(Oe(this,Le,"f").setDesignUnit(t,e))}getDesignUnit(){const e=this.get();return C(Oe(this,Le,"f").getDesignUnit(e))}getPages(){return A(C(Oe(this,Le,"f").getPages()))}setZoomLevel(e=1){const t=this.get();he("zoomLevel",e,le(ae(),0)),Oe(this,Le,"f").setZoomLevel(t,e)}getZoomLevel(){const e=this.get();return C(Oe(this,Le,"f").getZoomLevel(e))}async zoomToBlock(e,t=0,r=0,n=0,o=0){return he("id",e,ie()),S((i=>Oe(this,Le,"f").zoomToBlock(e,t,r,n,o,i)))}enableZoomAutoFit(e,t,r=0,n=0,o=0,i=0){return he("id",e,ie()),he("axis",t,function(){const e=["Horizontal","Vertical","Both"];return re("ZoomAutoFitAxis",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}()),"Horizontal"===t?(he("paddingBefore",r,ae()),he("paddingAfter",n,ae()),C(Oe(this,Le,"f").enableZoomAutoFit(e,t,r,0,n,0))):"Vertical"===t?(he("paddingBefore",r,ae()),he("paddingAfter",n,ae()),C(Oe(this,Le,"f").enableZoomAutoFit(e,t,0,r,0,n))):(he("paddingLeft",r,ae()),he("paddingTop",n,ae()),he("paddingRight",o,ae()),he("paddingBottom",i,ae()),C(Oe(this,Le,"f").enableZoomAutoFit(e,t,r,n,o,i)))}disableZoomAutoFit(e){return he("blockOrScene",e,ie()),C(Oe(this,Le,"f").disableZoomAutoFit(e))}isZoomAutoFitEnabled(e){return he("blockOrScene",e,ie()),C(Oe(this,Le,"f").isZoomAutoFitEnabled(e))}}function je(e,t){const r=new Set;function n(n){return r.add(n),null==e||e(((e,...t)=>{n(e);for(const e of t)n(e)})),()=>{r.delete(n),null==t||t()}}return n.emit=function(e,...t){for(const n of r){n(e);for(const e of t)n(e)}},n.handlers=r,n}Le=new WeakMap,Re=new WeakMap;const Ue=e=>t=>r=>t((t=>{r(e(t))}));function qe(e){return t=>r=>{let n=!1;const o=t((e=>{n=!0,r(e)}));return n||r(e instanceof Function?e():e),o}}const Ne=(e=((e,t)=>e===t))=>t=>r=>{let n;return t((t=>{e(t,n)||(n=t,r(t))}))},ze=e=>{const t=new Set;let r=null;return n=>(t.add(n),null===r&&(r=e((e=>{t.forEach((t=>t(e)))}))),()=>{t.delete(n),0===t.size&&(null==r||r(),r=null)})};function He(e,...t){return t.reduce(((e,t)=>t(e)),e)}const We=(...e)=>{const t=Array.from(e);return e=>{const r=t.map((t=>t(e)));return()=>{for(const e of r)e()}}};function Ve(e){return t=>{let r=null;const n=e((e=>{null==r||r(),r=e?e(t):e}));return()=>{n(),null==r||r(),r=null}}}function Ge(...e){const t=Array.from(e);return e=>{const r=new Array(t.length),n=t.map(((t,n)=>t((t=>{r[n]=t,e(r)}))));return()=>{n.forEach((e=>e())),r.length=0}}}const $e=Symbol("NO_VALUE");function Ye(e){let t=$e;const r=()=>(t===$e&&(t=e()),t),n=je();return{subscribe:n,value:r,update(e){t=e instanceof Function?e(r()):e,n.emit(t)}}}var Xe;!function(e){e.Scene="ubq/designblocks/SceneProps",e.Camera="ubq/designblocks/Camera",e.Common="ubq/designblocks/CommonDesignBlockProps",e.Page="ubq/designblocks/Page",e.Image="ubq/designblocks/Image",e.Video="ubq/designblocks/Video",e.Audio="ubq/designblocks/Audio",e.Sticker="ubq/designblocks/Sticker",e.Text="ubq/designblocks/Text",e.Crop="ubq/types/Crop",e.Scale="ubq/scene/Scale",e.Opacity="ubq/types/Opacity",e.FillColor="ubq/types/FillColor",e.Fill="ubq/designblocks/Fill",e.BackgroundColor="ubq/types/BackgroundColor",e.DropShadow="ubq/types/DropShadow",e.Stroke="ubq/types/Stroke",e.Group="ubq/designblocks/Group",e.VectorPath="ubq/designblocks/VectorPath",e.PendingState="ubq/designblocks/PendingState",e.ErrorState="ubq/designblocks/ErrorState",e.DesignBlockFrame="ubq/designblocks/DesignBlockFrame",e.Size="ubq/layout/Size",e.Position="ubq/layout/Position",e.EulerRotation="ubq/scene/EulerRotation",e.Children="ubq/scene/Children"}(Xe||(Xe={}));const Ke=Xe;var Qe=r(4846),Ze=r.n(Qe);function Je(e,t,r){return He((n=>{const o=t.getType(e),i=Ze()(r.subscribe([e],(r=>{r.some((e=>"Destroyed"===e.type))&&!t.isValid(e)||t.getType(e)!==o?i():n(r)})));return i}),ze)}const et=function(e,t,r,n){const o=function(e,t){if(!t)return e;let r;return(...n)=>{const o=e(...n);return t(o,r)||(r=o),r}}(t,null==n?void 0:n.equals),i=je();return{subscribe:He(We(e,i),Ue(o),Ne(),ze),update:r,value:o,flush:()=>i.emit()}};var tt,rt=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 nt{constructor({scene:e,block:t,event:r},n){Object.defineProperty(this,"settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clampCamera",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"clampResult",{enumerable:!0,configurable:!0,writable:!0,value:Ye((()=>({sceneSize:{x:0,y:0},scrollPercentage:{x:NaN,y:NaN}})))}),Object.defineProperty(this,"zoomLevel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),tt.set(this,void 0),Object.defineProperty(this,"viewportPadding",{enumerable:!0,configurable:!0,writable:!0,value:Ye((()=>({x:40,y:48})))}),Object.defineProperty(this,"autoFit",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scrollPercentage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sceneSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scroll",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const o=He(e.onActiveChanged,qe(),Ue((()=>e.get()))),i=He(o,Ue((e=>null!=e&&t.isValid(e)?He(Je(e,t,r),qe([]),Ue((()=>t.getFloat(e,"scene/dpi")))):()=>()=>{})),Ve),a=He(o,Ue((()=>{const e=t.findByType(v.Camera)[0];return null==e?()=>()=>{}:He(Je(e,t,r),qe([]),Ue((()=>e)))})),Ve);this.settings={subscribe:He(a,Ue((e=>({width:t.getFloat(e,"camera/resolution/width"),height:t.getFloat(e,"camera/resolution/height"),pixelRatio:t.getFloat(e,"camera/pixelRatio")}))),Ne(g()),ze),update({width:e,height:r,pixelRatio:n}){const o=t.findByType(v.Camera)[0];null!=o&&(t.setFloat(o,"camera/resolution/width",e),t.setFloat(o,"camera/resolution/height",r),t.setFloat(o,"camera/pixelRatio",n))},value(){const e=t.findByType(v.Camera)[0];return null==e?{width:0,height:0,pixelRatio:1}:{width:t.getFloat(e,"camera/resolution/width"),height:t.getFloat(e,"camera/resolution/height"),pixelRatio:t.getFloat(e,"camera/pixelRatio")}}},this.zoomLevel=et(We(e.onZoomLevelChanged,i),(()=>{const r=e.get();return null!=r&&t.isValid(r)?e.getZoomLevel():1}),(r=>{const n=e.get();null!=n&&t.isValid(n)&&e.setZoomLevel(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,tt,{subscribe:He(a,Ue((e=>new k(n).getValue(e,Ke.Camera,"zoomLevel"))),Ne()),value(){const e=t.findByType(v.Camera)[0];return null==e?1:new k(n).getValue(e,Ke.Camera,"zoomLevel")}},"f"),this.autoFit=et(e.onZoomLevelChanged,(()=>{const t=e.get();return null!=t&&e.isZoomAutoFitEnabled(t)})),this.scrollPercentage={subscribe:He(this.clampResult.subscribe,Ue((e=>e.scrollPercentage)),Ne(g())),value:()=>this.clampResult.value().scrollPercentage},this.sceneSize={subscribe:He(Ge(this.clampResult.subscribe,rt(this,tt,"f").subscribe,this.settings.subscribe),Ue((([e,t,r])=>{var n,o,i,a,s;const u=null!==(o=null!==(n=null==e?void 0:e.sceneSize)&&void 0!==n?n:this.clampResult.value().sceneSize)&&void 0!==o?o:{x:0,y:0},c=null!==(i=null!=t?t:rt(this,tt,"f").value())&&void 0!==i?i:10,l=null!==(s=null!==(a=null==r?void 0:r.pixelRatio)&&void 0!==a?a:this.settings.value().pixelRatio)&&void 0!==s?s:1;return{x:u.x*c/l,y:u.y*c/l}})),Ne(g())),value:()=>{var e,t,r;const n=null!==(e=this.clampResult.value().sceneSize)&&void 0!==e?e:{x:0,y:0},o=null!==(t=rt(this,tt,"f").value())&&void 0!==t?t:10,i=null!==(r=this.settings.value().pixelRatio)&&void 0!==r?r:1;return{x:n.x*o/i,y:n.y*o/i}}},this.scroll=e=>{const r=t.findByType(v.Camera)[0];if(null==r)return;const n=rt(this,tt,"f").value(),o=this.settings.value().pixelRatio,i=e.x*o/n,a=e.y*o/n,s={x:t.getPositionX(r)+i,y:t.getPositionY(r)+a};t.setPositionX(r,s.x),t.setPositionY(r,s.y)}}zoom(e,t=1){const r=Math.exp(.01*e*t),n=this.zoomLevel.value();this.zoomLevel.update(n*r)}}function ot(e,t,r){const n=e=>{C(t.setContext("")),e.preventDefault()},o=e=>{C(t.setContext("!canvas")),r&&r(),e.preventDefault()};return e.addEventListener("webglcontextlost",n,!1),e.addEventListener("webglcontextrestored",o,!1),()=>{e.removeEventListener("webglcontextlost",n),e.removeEventListener("webglcontextrestored",o)}}tt=new WeakMap;var it=r(2003),at=r.n(it);const st=r.p+"assets/core/cesdk-v1.11.0-rc.0.data",ut=r.p+"assets/core/cesdk-v1.11.0-rc.0.wasm",ct=at();let lt;const ft=(e,t)=>null!=t?[t,e.split("/").pop()].join(""):new URL(e,window.location.origin);function dt(e,t){const{core:r}=t,n=null!==(a=null===(i=null==(o=t)?void 0:o.callbacks)||void 0===i?void 0:i.log)&&void 0!==a?a:N;var o,i,a;const s=ft(ut,r.baseURL).toString(),u=ft(st,r.baseURL).toString();return new Promise(((r,o)=>{ct({instantiateWasm:(e,t)=>{const r=e;return(lt?Promise.resolve(lt):fetch(s,{credentials:"same-origin"}).then((e=>void 0===WebAssembly.compileStreaming?e.arrayBuffer().then((e=>WebAssembly.compile(e))):WebAssembly.compileStreaming(e))).then((e=>(function(e,t){const r=WebAssembly.Module.customSections(e,"CESDK")[0];if(!r)throw new Error(`Couldn't validate WASM module version. Please make sure that config.baseURL points to a location that holds the matching assets. Expected version 1.11.0-rc.0, but found a WASM module without version information at ${t}`);const n=new TextDecoder("utf-8").decode(r).trim();if("1.11.0-rc.0"!==n)throw new Error(`Couldn't validate WASM module version. Please make sure that config.baseURL points to a location that holds the matching assets. Expected version 1.11.0-rc.0, but found WASM module for version ${n} at ${t}`)}(e,s),lt=e,e)))).then((e=>WebAssembly.instantiate(e,r))).catch((e=>{throw new Error(`Couldn't load WASM module. Please make sure that config.baseURL points to a location that holds the matching assets. Expected version 1.11.0-rc.0 at ${s}, but encountered the following error: ${e.message}`)})).then(t).catch(o),{}},locateFile:(e,t)=>e.endsWith(".wasm")?s:e.endsWith(".data")?u:t+e,print:e=>{e&&"undefined"!==e&&n(e,O.Info)},printErr:e=>{e&&"undefined"!==e&&n(e,O.Error)},onRuntimeInitialized:()=>{n("Engine has been initialized.",O.Info)},logReadFiles:!1,printWithColors:!0}).then((async n=>{var o;n.specialHTMLTargets["!canvas"]=e,n.emscripten_ubq_settings_forceWebGL1=!!(null==t?void 0:t.forceWebGL1);const i=C(n.createEngine("!canvas",null!==(o=t.audioOutput)&&void 0!==o?o:"auto"));!function(e,t){var r;const n=new k(e),o=new be(e),i=new M(e);o.setSettingString("license",t.license||""),o.setSettingEnum("role","Creator"),o.setSettingString("basePath",t.baseURL),o.setSettingBool("showBuildVersion",!1),(null===(r=t.featureFlags)||void 0===r?void 0:r.preventScrolling)&&(o.setSettingBool("touch/singlePointPanning",!1),o.setSettingBool("touch/dragStartCanSelect",!1)),i.addLocalSource("ly.img.text"),Object.entries(t.presets.typefaces||{}).forEach((([e,t])=>{(t.fonts||[]).forEach((r=>{const o=`${e}_${r.weight}_${r.style}`;n.execute("ubq/assets/registerFont",[o,r.fontURL,t.family,r.weight,r.style])}))})),function(){var e;const r=!!(null===(e=t.featureFlags)||void 0===e?void 0:e.singlePageMode);o.setSettingBool("features/singlePageModeEnabled",r),o.setSettingBool("trackActivePage",!r),o.setSettingBool("features/effectsEnabled",!0)}(),function(){var e;const r=null!==(e=t.extensions)&&void 0!==e?e:[];r.entries.forEach((e=>{n.execute("ubq/extension/register",`${r.baseURL+e}`)}))}(),function(){var r;const n=null!==(r=t.variables)&&void 0!==r?r:{};Object.entries(n).forEach((([t,r])=>{C(e.setVariableString(t,r.value.toString()))}))}()}(i,t),r(i)})).catch(o)}))}const ht=!("undefined"==typeof window||!window.document||!window.document.createElement)&&navigator&&navigator.userAgent||"",pt=-1!==ht.indexOf("Edge"),mt=!!ht.match(/msie|trident/i);function gt(e,t){let r;return t.onStateChanged((()=>{const n=function(e,t){switch(e){case"Arrow":return"default";case"Move":return"move";case"MoveNotPermitted":return"auto";case"Resize":{const e=180*t/Math.PI+45;if(!mt&&!pt)return`url("data:image/svg+xml,%3Csvg style='transform: rotate(${e}deg)' width ='22' height ='22' viewBox ='0 0 22 22' fill ='none' xmlns ='http://www.w3.org/2000/svg'%3E%3Cg filter ='url(%23filter0_d)'%3E%3Cpath d ='M13.7 11.1L9.7 15.2L12.5 18H4V9.5L6.9 12.3L10.9 8.3L12.3 6.9L9.5 4H18V12.5L15.2 9.7L13.7 11.1Z' fill ='white'/%3E%3C/g%3E%3Cpath d ='M12.7 10.7L8.3 15.2L10.1 17H5V11.9L6.9 13.8L11.3 9.3L13.8 6.9L11.9 5H17V10.1L15.2 8.3L12.7 10.7Z' fill ='black'/%3E%3Cdefs%3E%3Cfilter id ='filter0_d' x ='0' y ='0' width ='22' height ='22' filterUnits ='userSpaceOnUse' color-interpolation-filters ='sRGB'%3E%3CfeFlood flood-opacity ='0' result ='BackgroundImageFix'/%3E%3CfeColorMatrix in ='SourceAlpha' type ='matrix' values ='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0'/%3E%3CfeOffset/%3E%3CfeGaussianBlur stdDeviation ='2'/%3E%3CfeColorMatrix type ='matrix' values ='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0'/%3E%3CfeBlend mode ='normal' in2 ='BackgroundImageFix' result ='effect1_dropShadow'/%3E%3CfeBlend mode ='normal' in ='SourceGraphic' in2 ='effect1_dropShadow' result ='shape'/%3E%3C/filter%3E%3C/defs%3E%3C/svg%3E") 12 12, pointer`;switch(e){case 90:case 270:return"nwse-resize";case 135:case 315:return"ns-resize";case 180:case 360:return"nesw-resize";case 225:return"ew-resize";default:return"move"}}case"Rotate":return'url("data:image/svg+xml,%3Csvg width=%2722%27 height=%2725%27 viewBox=%270 0 22 25%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cg filter=%27url(%23filter0_d)%27%3E%3Cpath d=%27M18 11.1071C18 14.5637 15.5566 17.4515 12.3314 18.0846V20L7.20308 17.0145L12.3314 14.0289V15.7825C14.3292 15.1951 15.7946 13.3221 15.7946 11.107C15.7946 8.42285 13.6437 6.23908 11 6.23908C8.35629 6.23908 6.20542 8.42285 6.20542 11.107C6.20542 11.8299 6.35745 12.5252 6.65738 13.1736L4.66118 14.1255C4.22245 13.1771 4 12.1616 4 11.1071C4.00007 7.18825 7.1403 4 11.0001 4C14.8599 4 18 7.18825 18 11.1071Z%27 fill=%27black%27/%3E%3Cpath d=%27M12.8314 15.0559V14.0289V13.1593L12.0799 13.5968L6.95152 16.5824L6.20927 17.0145L6.95152 17.4466L12.0799 20.4321L12.8314 20.8696V20V18.4841C16.0889 17.6521 18.5 14.6573 18.5 11.1071C18.5 6.9193 15.1431 3.5 11.0001 3.5C6.85702 3.5 3.50008 6.91929 3.5 11.1071V11.1071C3.5 12.2334 3.73793 13.3206 4.20739 14.3354L4.41978 14.7946L4.8764 14.5768L6.8726 13.6249L7.31866 13.4122L7.11118 12.9637C6.84206 12.3819 6.70542 11.7584 6.70542 11.107C6.70542 8.69181 8.63956 6.73908 11 6.73908C13.3604 6.73908 15.2946 8.69181 15.2946 11.107C15.2946 12.8513 14.2837 14.3564 12.8314 15.0559Z%27 stroke=%27white%27/%3E%3C/g%3E%3Cdefs%3E%3Cfilter id=%27filter0_d%27 x=%270.0599999%27 y=%270.0599999%27 width=%2721.88%27 height=%2724.6193%27 filterUnits=%27userSpaceOnUse%27 color-interpolation-filters=%27sRGB%27%3E%3CfeFlood flood-opacity=%270%27 result=%27BackgroundImageFix%27/%3E%3CfeColorMatrix in=%27SourceAlpha%27 type=%27matrix%27 values=%270 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0%27/%3E%3CfeOffset/%3E%3CfeGaussianBlur stdDeviation=%271.47%27/%3E%3CfeColorMatrix type=%27matrix%27 values=%270 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0%27/%3E%3CfeBlend mode=%27normal%27 in2=%27BackgroundImageFix%27 result=%27effect1_dropShadow%27/%3E%3CfeBlend mode=%27normal%27 in=%27SourceGraphic%27 in2=%27effect1_dropShadow%27 result=%27shape%27/%3E%3C/filter%3E%3C/defs%3E%3C/svg%3E") 12 12, pointer';case"Text":return"text";default:return"auto"}}(t.getCursorType(),t.getCursorRotation());if(n!==r){r=n;const t=new CustomEvent("cesdk-cursor",{composed:!0,bubbles:!0,cancelable:!0,detail:n});e.dispatchEvent(t)&&e.style.setProperty("cursor",n)}}))}const vt=function(e,t,r){let n,o=null;const i=r.onStateChanged((()=>{n=r.getEditMode(),"Text"!==n||o?"Text"!==n&&o&&(o(),o=null):o=function(){let n=function o(){let i=!1,a="";if(null==e.parentElement)return console.warn('Could not attach hidden text input to the DOM: Canvas has no parentElement. This can happen if edit mode is switched to "Text", while the canvas is removed from the DOM.'),()=>{};const u=function(){const e=document.createElement("textarea");return e.id="ubq_internal-inline_text_editing_html_representation",e.setAttribute("data-cy","inline-text-editing-input"),e.autocapitalize="none",e.spellcheck=!1,e.cols=4096,e.style.contain="strict",e.style.opacity="0",e.style.pointerEvents="none",e.style.zIndex="-1",e.style.position="fixed",e.style.width="1px",e.style.height="1px",e.style.padding="0",e.style.margin="-1px",e.style.overflow="hidden",e.style.clip="rect(0, 0, 0, 0)",e.style.border="0",e}();l();const c=function(){const t=e.getRootNode();u.addEventListener("input",y),u.addEventListener("keydown",w),u.addEventListener("copy",m),u.addEventListener("cut",g),u.addEventListener("compositionstart",E),u.addEventListener("compositionend",_),u.addEventListener("beforeinput",A),u.addEventListener("focusout",P),t.addEventListener("touchend",S),t.addEventListener("mousedown",S),t.addEventListener("mouseup",k);const n=r.onStateChanged((()=>{l()}));return()=>{u.removeEventListener("input",y),u.removeEventListener("keydown",w),u.removeEventListener("copy",m),u.removeEventListener("cut",g),u.removeEventListener("compositionstart",E),u.removeEventListener("compositionend",_),u.removeEventListener("beforeinput",A),u.removeEventListener("focusout",P),t.removeEventListener("mousedown",S),t.removeEventListener("mouseup",k),t.removeEventListener("touchend",S),n()}}();return e.parentElement.appendChild(u),f(),()=>{c(),u.blur(),u.remove()};function l(){const t=r.getTextCursorPositionInScreenSpaceX(),n=r.getTextCursorPositionInScreenSpaceY(),{left:o,top:i}=e.getBoundingClientRect();u.style.left=`${o+t/window.devicePixelRatio}px`,u.style.top=`${i+n/window.devicePixelRatio}px`}function f(){null!==u.parentElement&&(u.focus(),u.getRootNode().activeElement===u||setTimeout((()=>u.focus()),0))}function d(){i=!1,n(),n=o()}function h(e){return[...e].length}function p(e){var t,r;const n=null!==(r=null!==(t=e.selectionEnd)&&void 0!==t?t:e.selectionStart)&&void 0!==r?r:0;return h(e.value.substring(0,n))}function m(e){try{t.useInternalAPI((t=>{const r=C(t.getSelectedText());""!==r&&e.clipboardData&&(e.clipboardData.setData("text/plain",r),e.preventDefault())}))}catch(e){console.error(e)}}function g(e){try{t.useInternalAPI((r=>{const n=C(r.getSelectedText());if(""!==n&&e.clipboardData){e.clipboardData.setData("text/plain",n),e.preventDefault();const r={key:s.Delete,characters:"",shiftIsHeld:!1,commandIsHeld:!1,optionIsHeld:!1,timestamp:Date.now()};t.execute("ubq/inputs/keyboardkey",r)}}))}catch(e){console.error(e)}}async function v(){return!(!i||t.ubq.unstable_isTextCursorInCompositionRange()||(await _(),0))}function y(e){const r=e.target,{value:n}=r;if(i){const e=p(u);t.execute("ubq/text/compositionUpdate",{value:n,cursorPosition:e})}else n.length>0&&(r.value="")}function b(e){const r={key:s.Unknown,characters:e,shiftIsHeld:!1,commandIsHeld:!1,optionIsHeld:!1,timestamp:Date.now()};t.execute("ubq/inputs/keyboardkey",r)}async function w(e){if(v(),1===e.key.length&&(a=e.key),"a"===e.key&&(e.metaKey||e.ctrlKey))return i&&_(),void await t.execute("ubq/text/selectAllText");if("Escape"===e.key)return void async function(){r.setEditMode("Transform")}();if("Backspace"!==e.key&&"Delete"!==e.key&&"ArrowLeft"!==e.key&&"ArrowRight"!==e.key&&"ArrowUp"!==e.key&&"ArrowDown"!==e.key&&"Enter"!==e.key)return;const n=function(e){const t={key:s.Unknown,characters:e.key,shiftIsHeld:e.shiftKey,commandIsHeld:e.metaKey||e.ctrlKey,optionIsHeld:e.altKey,timestamp:Date.now()};switch(e.key.toUpperCase()){case"0":t.key=s.Key0;break;case"1":t.key=s.Key1;break;case"2":t.key=s.Key2;break;case"3":t.key=s.Key3;break;case"4":t.key=s.Key4;break;case"5":t.key=s.Key5;break;case"6":t.key=s.Key6;break;case"7":t.key=s.Key7;break;case"8":t.key=s.Key8;break;case"9":t.key=s.Key9;break;case"A":t.key=s.A;break;case"B":t.key=s.B;break;case"C":t.key=s.C;break;case"D":t.key=s.D;break;case"E":t.key=s.E;break;case"F":t.key=s.F;break;case"G":t.key=s.G;break;case"H":t.key=s.H;break;case"I":t.key=s.I;break;case"J":t.key=s.J;break;case"K":t.key=s.K;break;case"L":t.key=s.L;break;case"M":t.key=s.M;break;case"N":t.key=s.N;break;case"O":t.key=s.O;break;case"P":t.key=s.P;break;case"Q":t.key=s.Q;break;case"R":t.key=s.R;break;case"S":t.key=s.S;break;case"T":t.key=s.T;break;case"U":t.key=s.U;break;case"V":t.key=s.V;break;case"W":t.key=s.W;break;case"X":t.key=s.X;break;case"Y":t.key=s.Y;break;case"Z":t.key=s.Z;break;case" ":t.key=s.Space;break;case"ESCAPE":t.key=s.Escape,t.characters="";break;case"BACKSPACE":t.key=s.Backspace,t.characters="";break;case"DELETE":t.key=s.Delete,t.characters="";break;case"ENTER":t.key=s.Enter,t.characters="\n";break;case"CONTROL":t.key=s.Control,t.characters="";break;case"ALT":t.key=s.Option,t.characters="";break;case"SHIFT":t.key=s.Shift,t.characters="";break;case"ARROWLEFT":t.key=s.ArrowLeft,t.characters="";break;case"ARROWRIGHT":t.key=s.ArrowRight,t.characters="";break;case"ARROWUP":t.key=s.ArrowUp,t.characters="";break;case"ARROWDOWN":t.key=s.ArrowDown,t.characters="";break;case"DEAD":t.key=s.Unknown,t.characters=""}return t}(e);await t.execute("ubq/inputs/keyboardkey",n),e.currentTarget&&(u.value="")}async function E(){i=!0,await t.execute("ubq/text/compositionStart")}async function _(){i?(i=!1,u.value="",d(),t.execute("ubq/text/compositionEnd")):u.value=""}async function x(){if(!i)return;if(t.ubq.update(),await v())return;const e=t.ubq.unstable_getCursorPosition(),r=t.ubq.unstable_getCompositionRange(),n=e.end-r.start,o=p(u);e.start>=r.start&&e.start<=1+r.end&&n!==o&&_()}async function k(){x()}async function S(t){x(),t.target===e&&"Text"===r.getEditMode()&&(f(),t.preventDefault())}async function A(e){if(i&&!e.isComposing&&_(),null===e.data)return;const r=e.target,n=e.data;if(await v())b(a);else if(i){const e=h(n);t.execute("ubq/text/compositionUpdate",{value:n,cursorPosition:e})}else n.length>0&&("\n"!==n[0]&&b(n),r.value="")}function P(t){var r;null!=(r=t.relatedTarget)&&r instanceof HTMLElement&&(r instanceof HTMLTextAreaElement||r instanceof HTMLInputElement&&r.type.match("^(text|number|url|email|search|tel)$")||r.isContentEditable)&&function(t){const r=new CustomEvent("cesdk-blur",{composed:!0,bubbles:!0,cancelable:!0,detail:t});return e.dispatchEvent(r)}(t.relatedTarget)||function(t){const r=new CustomEvent("cesdk-refocus",{composed:!0,bubbles:!0,cancelable:!0,detail:t.relatedTarget}),n=e.dispatchEvent(r);n&&f()}(t)}}();return()=>{null==n||n()}}()}));return()=>{null==o||o(),i()}};function yt(e,t){const r=[],n=t=>{var r,n;const o=e.getBoundingClientRect(),i=null!==(r=null==o?void 0:o.top)&&void 0!==r?r:0,a=null!==(n=null==o?void 0:o.left)&&void 0!==n?n:0;return{position:{x:(t.clientX-a)*window.devicePixelRatio,y:(t.clientY-i)*window.devicePixelRatio},isOverUIElement:t.target!==e,isTouch:"touch"===t.pointerType,timestamp:t.timeStamp}},o=e=>{const r=n(e);t.execute("ubq/inputs/mousemove",r)},i=e=>{const o=Object.assign(Object.assign({},n(e)),{button:bt(e.button),state:a.Up,shiftIsHeld:!!e.shiftKey});r[e.button]=!1,e.currentTarget.releasePointerCapture(e.pointerId),t.execute("ubq/inputs/mousebutton",o),t.ubq.update()},s=e=>{const o=Object.assign(Object.assign({},n(e)),{button:bt(e.button),state:a.Down,shiftIsHeld:!!e.shiftKey});r[e.button]=!0,e.currentTarget.setPointerCapture(e.pointerId),t.execute("ubq/inputs/mousebutton",o)},u=e=>{const o=Object.assign(Object.assign({},n(e)),{shiftIsHeld:!!e.shiftKey});r.forEach(((e,r)=>{if(e){const e=Object.assign(Object.assign({},o),{button:r,state:a.Up});t.execute("ubq/inputs/mousebutton",e)}})),r.length=0},c=e=>{e.cancelable&&e.preventDefault()};return e.addEventListener("pointerdown",s),e.addEventListener("pointerup",i),e.addEventListener("pointercancel",i),e.addEventListener("pointermove",o),e.addEventListener("lostpointercapture",u),e.addEventListener("touchmove",c,{passive:!1}),()=>{e.removeEventListener("pointerdown",s),e.removeEventListener("pointerup",i),e.removeEventListener("pointercancel",i),e.removeEventListener("pointermove",o),e.removeEventListener("lostpointercapture",u),e.removeEventListener("touchmove",c),e=null}}function bt(e){switch(e){case 0:return i.Left;case 1:return i.Middle;case 2:return i.Right;default:return i.Unknown}}var wt,Et=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 _t{constructor(e){wt.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,wt,e,"f")}findAll(){return A(Et(this,wt,"f").findAllVariables())}setString(e,t){return he("key",e,ue()),he("value",t,ue()),C(Et(this,wt,"f").setVariableString(e,t))}getString(e){return he("key",e,ue()),C(Et(this,wt,"f").getVariableString(e))}remove(e){return he("key",e,ue()),C(Et(this,wt,"f").removeVariable(e))}}async function xt(e,t,r,n){let o,i=0;function a(){clearTimeout(o)}try{const s=new OffscreenCanvas(64,64),u=await dt(s,Object.assign(Object.assign({},e),{audioOutput:"none"})),c=new Ie(u),l=new Ae(u);await c.loadFromString(t);const f=l.getTotalSceneDuration(c.get());!function e(){i<10&&u.update(),o=setTimeout(e,1)}();const d=await new Promise(((t,o)=>{var s,c,l,d,h,p,m,g;null===(s=e.abortSignal)||void 0===s||s.addEventListener("abort",(()=>{a(),o(new Error("AbortSignal received"))})),u.exportVideoToBuffer(r.block,null!==(c=r.timeOffset)&&void 0!==c?c:0,null!==(l=r.duration)&&void 0!==l?l:f,we.Mp4,((e,t,r)=>{var o;i=e-t,null===(o=null==n?void 0:n.onProgress)||void 0===o||o.call(n,e,t,r)}),(e=>{"error"in e?o(e.error):t(e)}),{h264Profile:null!==(d=r.h264Profile)&&void 0!==d?d:77,h264Level:null!==(h=r.h264Level)&&void 0!==h?h:52,framerate:null!==(p=r.framerate)&&void 0!==p?p:30,useTargetSize:void 0!==r.width&&void 0!==r.height,targetWidth:null!==(m=r.width)&&void 0!==m?m:0,targetHeight:null!==(g=r.height)&&void 0!==g?g:0})}));return a(),d}catch(e){throw a(),e}}wt=new WeakMap;var kt,Ct,St,At,Pt,Tt,Ft,Bt,Dt,Lt,Rt,Mt,Ot,It,jt,Ut,qt,Nt,zt=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},Ht=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 Wt{constructor(e,t,r){kt.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}),Ct.set(this,void 0),St.set(this,void 0),At.set(this,void 0),Pt.set(this,void 0),Tt.set(this,void 0),Dt.set(this,[]),Lt.set(this,void 0),It.set(this,void 0),zt(this,Tt,e,"f"),zt(this,St,new k(e),"f"),this.asset=new M(e),this.block=new Ae(e),this.editor=new be(e),this.event=new De(e),this.scene=new Ie(e),this.variable=new _t(e),this.block.exportVideo=function(e,t){return async(r,n,o,i)=>{const[a]=t.block.findByType(v.Scene);if(null==a)throw new Error("No scene available.");const s=await t.scene.saveToString();return xt(e,s,Object.assign({block:r,width:i.targetWidth,height:i.targetHeight},i),{onProgress:o}).then((e=>new Blob([e],{type:we.Mp4})))}}(r,this),"getInternalCanvas"in t?(zt(this,At,t.getInternalCanvas(),"f"),zt(this,Pt,t,"f")):zt(this,At,t,"f"),function(e){const t={assets:[],total:0,currentPage:1,nextPage:void 0};return Object.entries(e).map((([e,r])=>{if(!r.findAssets)throw new Error("New asset source needs to define `findAssets` at least");return Object.assign(Object.assign(Object.assign({id:e},$),r),{findAssets:async e=>await r.findAssets(e)||Promise.resolve(t)})}))}(r.assetSources).forEach((e=>this.asset.addSource(e))),zt(this,Ct,new nt(this,this._ubq),"f"),Ht(this,St,"f").useInternalAPI((e=>{e.setPreUpdateCallback((()=>{Ht(this,kt,"m",Ft).call(this),Ht(this,kt,"m",Bt).call(this)}))})),Ht(this,kt,"m",Rt).call(this),"undefined"!=typeof window&&window.Cypress&&(this.config=r,this.helper=Ht(this,St,"f"))}wrapUpdate(e){return Ht(this,Dt,"f").push(e),()=>{const t=Ht(this,Dt,"f").indexOf(e);-1!==t&&Ht(this,Dt,"f").splice(t,1)}}get element(){return Ht(this,Pt,"f")}dispose(){var e;Ht(this,kt,"m",jt).call(this),Ht(this,St,"f").useInternalAPI((e=>{e.setPreUpdateCallback(null)})),this.asset.dispose(),zt(this,At,null,"f"),null===(e=Ht(this,Pt,"f"))||void 0===e||e.dispose(),zt(this,Pt,void 0,"f"),zt(this,St,null,"f"),this.block=null,this.scene=null,this.variable=null,this.asset=null,this.editor=null,this.event=null,Ht(this,Dt,"f").length=0,Ht(this,Tt,"f").delete(),zt(this,Tt,null,"f")}static async init(e,t){let r=function(e,t){return r(null==t?void 0:t.canvas)?null==t?void 0:t.canvas:r(e)?(console.warn("Passing an existing HTMLCanvasElement as a second parameter to CreativeEngine.init() is deprecated. Use the element property on the CreativeEngine instance to access a fully managed canvas to append into the DOM instead. For more information, have a look into our documentation at https://img.ly/docs/cesdk/next/engine/quickstart/#initialization."),e):void 0;function r(e){return"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement}}(t,e);let n;var o,i;console.log("[CreativeEngine] Revision 7bb13b6fddaddc61e144abe16a0d99297d6c644e"),r||(customElements.get("cesdk-canvas")||customElements.define("cesdk-canvas",(i=class extends HTMLElement{constructor(){super(),o.set(this,void 0),Te(this,o,document.createElement("canvas"),"f");const e=document.createElement("style");e.textContent=":host {display: block; width: 100%; height: 100%; contain: content;} canvas {position: absolute; inset: 0; width: 100%; height:100%; display: block;}",this.attachShadow({mode:"closed"}).append(e,Fe(this,o,"f"))}getInternalCanvas(){if(!Fe(this,o,"f"))throw new Error("Internal canvas element is undefined");return Fe(this,o,"f")}dispose(){var e;null===(e=Fe(this,o,"f"))||void 0===e||e.remove(),Te(this,o,void 0,"f")}clear(){if(!Fe(this,o,"f"))return;const e=Fe(this,o,"f").width;Fe(this,o,"f").width=1,Fe(this,o,"f").width=e}},o=new WeakMap,i)),n=document.createElement("cesdk-canvas"),r=n.getInternalCanvas());const a=function(e={},t="https://cdn.img.ly/packages/imgly/cesdk-engine/1.11.0-rc.0/assets"){var r,n,o,i,a,s,u,c,l,f,d,h;const p=Object.assign(Object.assign({},e),{license:e.license,featureFlags:null!==(r=e.featureFlags)&&void 0!==r?r:{},baseURL:null!==(n=e.baseURL)&&void 0!==n?n:t,core:null!==(o=e.core)&&void 0!==o?o:Object.assign({},H),extensions:null!==(i=e.extensions)&&void 0!==i?i:Object.assign({},U),callbacks:null!==(a=e.callbacks)&&void 0!==a?a:Object.assign({},z),variables:null!==(s=e.variables)&&void 0!==s?s:Object.assign({},q),presets:null!==(u=e.presets)&&void 0!==u?u:{},assetSources:j()({},e.assetSources),defaultFont:null!==(c=e.defaultFont)&&void 0!==c?c:void 0});return null!==(l=(d=p.extensions).baseURL)&&void 0!==l||(d.baseURL=U.baseURL),null!==(f=(h=p.extensions).entries)&&void 0!==f||(h.entries=Object.assign({},U.entries)),p.baseURL=W(p.baseURL),p.baseURL=V(p.baseURL),p.core.baseURL=W(p.core.baseURL,p.baseURL),p.core.baseURL=V(p.core.baseURL),p.extensions.baseURL=V(p.extensions.baseURL),p.extensions.entries=p.extensions.entries.map((e=>V(e))),p}(e),s=new this(await dt(r,a),null!=n?n:r,a);return function(e,t,r){var n,o,i,a,s,u,c,l;if(!e)return!1;try{const t=r.editor;e.role&&(t.setSettingEnum("role",e.role),"Adopter"===e.role&&t.setSettingEnum("doubleClickSelectionMode","Direct")),e.scene,e.page&&(null!=(null===(o=null===(n=e.page)||void 0===n?void 0:n.title)||void 0===o?void 0:o.show)&&t.setSettingBool("page/title/show",e.page.title.show),null!=(null===(a=null===(i=e.page)||void 0===i?void 0:i.title)||void 0===a?void 0:a.fontFileUri)&&t.setSettingString("page/title/fontFileUri",null===(u=null===(s=e.page)||void 0===s?void 0:s.title)||void 0===u?void 0:u.fontFileUri),null!=(null===(c=e.page)||void 0===c?void 0:c.dimOutOfPageAreas)&&t.setSettingBool("page/dimOutOfPageAreas",null===(l=e.page)||void 0===l?void 0:l.dimOutOfPageAreas))}catch(e){console.error(e)}}(e,0,s),s}async addDefaultAssetSources({baseURL:e="https://cdn.img.ly/assets/v1",excludeAssetSourceIds:t=[]}={}){return async function(e,t,r,n){const o=["ly.img.sticker","ly.img.vectorpath","ly.img.filter.lut","ly.img.filter.duotone"].filter((e=>!r.includes(e)));await G(o,t,n,e)}(this.asset,e,t)}async addDemoAssetSources({excludeAssetSourceIds:e=[],sceneMode:t="Design",withUploadAssetSources:r=!1}={}){return async function(e,t,r,n,o){const i=new Set(e.findAllSources()),a="ly.img.image.upload";!n||t.includes(a)||i.has(a)||e.addLocalSource(a,["image/jpeg","image/png","image/svg+xml","image/gif","image/bmp"]);const s="ly.img.video.upload";"Video"!==r||!n||t.includes(s)||i.has(s)||e.addLocalSource(s,["video/mp4","video/quicktime"]);const u="ly.img.audio.upload";"Video"!==r||!n||t.includes(u)||i.has(u)||e.addLocalSource(u,["audio/mpeg","audio/x-m4a","audio/m4a","audio/mp3"]);const c=["ly.img.image","ly.img.video","ly.img.audio"].filter((e=>!t.includes(e)));await G(c,"https://cdn.img.ly/assets/demo/v1",o,e)}(this.asset,e,t,r)}get _ubq(){return Ht(this,Tt,"f")}get _camera(){return Ht(this,Ct,"f")}}Ct=new WeakMap,St=new WeakMap,At=new WeakMap,Pt=new WeakMap,Tt=new WeakMap,Dt=new WeakMap,Lt=new WeakMap,It=new WeakMap,kt=new WeakSet,Ft=function(){if(!Ht(this,Pt,"f"))return;const e=Ht(this,Pt,"f").getInternalCanvas(),t=e.getBoundingClientRect();if(0===t.width||0===t.height)return;const r="undefined"!=typeof window?window.devicePixelRatio:1,n=t.width*r,o=t.height*r;e.width!==n&&(e.width=n),e.height!==o&&(e.height=o)},Bt=function(){const{width:e,height:t}=Ht(this,At,"f"),r="undefined"!=typeof window?window.devicePixelRatio:1,{height:n,width:o,pixelRatio:i}=Ht(this,Ct,"f").settings.value();x(o,e,1e-4)&&x(n,t,1e-4)&&x(i,r,1e-4)||Ht(this,Ct,"f").settings.update({height:t,width:e,pixelRatio:window.devicePixelRatio})},Rt=function(e=!0){Ht(this,kt,"m",Mt).call(this,e),Ht(this,kt,"m",Ot).call(this)},Mt=function(e=!0){if(Ht(this,Lt,"f"))return;const t=()=>{Ht(this,Dt,"f").reduceRight(((e,t)=>function(){let r=!1;if(t((function(){r=!0,e()})),!r)throw new Error(`Wrapper did not call update: ${t.toString()}`)}),(()=>Ht(this,kt,"m",Ut).call(this,e)))(),zt(this,Lt,requestAnimationFrame(t),"f")};zt(this,Lt,requestAnimationFrame(t),"f")},Ot=function(){var e,t;if(t=Ht(this,At,"f"),!("undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement))return;const r=null!==(e=Ht(this,Pt,"f"))&&void 0!==e?e:Ht(this,At,"f"),n=[yt(r,Ht(this,St,"f")),vt(r,Ht(this,St,"f"),this.editor),gt(r,this.editor),ot(Ht(this,At,"f"),Ht(this,Tt,"f"),(()=>{Ht(this,At,"f").width=Ht(this,At,"f").width}))];zt(this,It,(()=>{n.reverse().forEach((e=>e()))}),"f")},jt=function(){var e;null===(e=Ht(this,It,"f"))||void 0===e||e.call(this),zt(this,It,void 0,"f"),Ht(this,Lt,"f")&&(cancelAnimationFrame(Ht(this,Lt,"f")),zt(this,Lt,0,"f"))},Ut=function(e=!0){e&&1===this.block.findByType(v.Scene).length&&Ht(this,kt,"m",qt).call(this),Ht(this,Tt,"f").update()},qt=function(){Ht(this,Ct,"f").clampCamera?Ht(this,St,"f").execute("cesdk/clampCameraAndRender",[{horizontalPaddingInPixels:this._camera.viewportPadding.value().x,verticalPaddingInPixels:this._camera.viewportPadding.value().y},{displayWidth:Ht(this,At,"f").width,displayHeight:Ht(this,At,"f").height}]).then((e=>{g()(Ht(this,Ct,"f").clampResult.value(),e)||Ht(this,Ct,"f").clampResult.update(e)})):Ht(this,St,"f").execute("ubq/render",{displayWidth:Ht(this,At,"f").width,displayHeight:Ht(this,At,"f").height})},function(e){e.start=function(e){return Object.assign(Object.assign({},e),{msg:"exportVideo"})},e.finished=function(e){return Object.assign(Object.assign({},e),{msg:"exportVideoFinished"})},e.error=function(e){return Object.assign(Object.assign({},e),{msg:"exportVideoError"})},e.progress=function(e){return Object.assign(Object.assign({},e),{msg:"exportVideoProgress"})}}(Nt||(Nt={}));class Vt{constructor(e,t){Object.defineProperty(this,"makeWorker",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"configuration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.configuration=t,this.makeWorker=e}exportVideo(e,t){const r=this.makeWorker(),n=Object.assign({},this.configuration);delete n.callbacks.log,n.assetSources={};const o=new Promise(((e,t)=>{r.onmessage=({data:n})=>{if("exportVideoFinished"===n.msg){const t=new Blob([n.data],{type:n.mimeType});r.terminate(),e(t)}else"exportVideoError"===n.msg?(r.terminate(),t(n.error)):"exportVideoProgress"===n.msg||console.error("Unknown message received ",n)}}));return r.postMessage(Nt.start({sceneString:e,config:n,exportOptions:t})),o}}const Gt=function(){try{if("object"==typeof WebAssembly&&"function"==typeof WebAssembly.instantiate){const e=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(e instanceof WebAssembly.Module)return new WebAssembly.Instance(e)instanceof WebAssembly.Instance}}catch(e){return console.error(e),!1}return!1},$t=function(){return"undefined"!=typeof window&&"VideoFrame"in window&&"VideoDecoder"in window&&"VideoEncoder"in window&&"AudioDecoder"in window&&"AudioEncoder"in window},Yt=function(){var e;try{const t=!!(null===(e={testKey:"testValue"})||void 0===e?void 0:e.testKey),r=!0,n="globalThis"in window,o="BigInt"in window,i="allSettled"in Promise,a="matchAll"in String.prototype,s=CSS.supports("(display: flex) and (gap: 8px)"),u="MediaRecorder"in window&&"pause"in window.MediaRecorder.prototype,c=CSS.supports("selector(:not(a, .b))"),l=CSS.supports("selector(:is(a))");return Gt()&&t&&r&&n&&o&&i&&a&&s&&u&&c&&l}catch(e){return!1}};"undefined"!=typeof WorkerGlobalScope&&(self.onmessage=async({data:e})=>{"exportVideo"===e.msg&&xt(e.config,e.sceneString,e.exportOptions,{onProgress:(e,t,r)=>{self.postMessage(Nt.progress({renderedFrames:e,encodedFrames:t,totalFrames:r}))}}).then((e=>{self.postMessage(Nt.finished({data:e,mimeType:we.Mp4}))}),(e=>{self.postMessage(Nt.error({error:e}))}))})})();var o=n.Il,i=n.yQ,a=n.Ju,s=n.in,u=n.HY,c=n.F4,l=n.ZP,f=n.aY,d=n.Qx,h=n.Pf;export{o as Color,i as ConfigTypes,a as DesignBlockType,s as LogLevel,u as MimeType,c as WorkerClient,l as default,f as supportsBrowser,d as supportsVideo,h as supportsWasm};
|