trtc-sdk-v5 5.8.7-beta.15 → 5.8.7-beta.17

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.
Files changed (29) hide show
  1. package/index.d.ts +25 -39
  2. package/package.json +1 -1
  3. package/plugins/cdn-streaming/cdn-streaming.esm.js +1 -1
  4. package/plugins/cdn-streaming/cdn-streaming.iife.js +1 -1
  5. package/plugins/cdn-streaming/package.json +1 -1
  6. package/plugins/cross-room/cross-room.esm.js +1 -1
  7. package/plugins/cross-room/cross-room.iife.js +1 -1
  8. package/plugins/cross-room/package.json +1 -1
  9. package/plugins/device-detector/device-detector.esm.js +22 -22
  10. package/plugins/device-detector/device-detector.iife.js +21 -21
  11. package/plugins/device-detector/package.json +1 -1
  12. package/plugins/video-decoder/package.json +8 -0
  13. package/plugins/video-decoder/video-decoder.esm.d.ts +34 -0
  14. package/plugins/video-decoder/video-decoder.esm.js +43 -0
  15. package/plugins/video-decoder/video-decoder.iife.js +43 -0
  16. package/plugins/video-effect/basic-beauty/basic-beauty.esm.js +2 -2
  17. package/plugins/video-effect/basic-beauty/basic-beauty.iife.js +2 -2
  18. package/plugins/video-effect/basic-beauty/package.json +1 -1
  19. package/plugins/video-effect/beauty/beauty.esm.js +1 -1
  20. package/plugins/video-effect/beauty/beauty.iife.js +1 -1
  21. package/plugins/video-effect/beauty/package.json +1 -1
  22. package/plugins/video-effect/virtual-background/package.json +1 -1
  23. package/plugins/video-effect/virtual-background/virtual-background.esm.js +1 -1
  24. package/plugins/video-effect/virtual-background/virtual-background.iife.js +1 -1
  25. package/plugins/video-effect/watermark/package.json +1 -1
  26. package/plugins/video-effect/watermark/watermark.esm.js +1 -1
  27. package/plugins/video-effect/watermark/watermark.iife.js +1 -1
  28. package/trtc.esm.js +59 -30
  29. package/trtc.js +1 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/beauty",
3
- "version": "5.8.7-beta.15",
3
+ "version": "5.8.7-beta.17",
4
4
  "description": "TRTC Web SDK 5.x beauty plugin",
5
5
  "main": "./beauty.esm.js",
6
6
  "author": "longyuqi <longyuqi@tencent.com>",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/virtual-background",
3
- "version": "5.8.7-beta.15",
3
+ "version": "5.8.7-beta.17",
4
4
  "description": "TRTC Web SDK 5.x virtual background plugin",
5
5
  "main": "./virtual-background.esm.js",
6
6
  "author": "longyuqi <longyuqi@tencent.com>",
@@ -1,4 +1,4 @@
1
- var Iu=Object.defineProperty,mu=Object.defineProperties;var Cu=Object.getOwnPropertyDescriptors;var pc=Object.getOwnPropertySymbols;var yu=Object.prototype.hasOwnProperty,wu=Object.prototype.propertyIsEnumerable;var nc=(K,x,n)=>x in K?Iu(K,x,{enumerable:!0,configurable:!0,writable:!0,value:n}):K[x]=n,_c=(K,x)=>{for(var n in x||(x={}))yu.call(x,n)&&nc(K,n,x[n]);if(pc)for(var n of pc(x))wu.call(x,n)&&nc(K,n,x[n]);return K},hc=(K,x)=>mu(K,Cu(x));var Ic=(K=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(K,{get:(x,n)=>(typeof require!="undefined"?require:x)[n]}):K)(function(K){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+K+'" is not supported')});var Le=(K,x,n)=>(nc(K,typeof x!="symbol"?x+"":x,n),n);async function mc({sdkAppId:K,userId:x,userSig:n,core:Ee}){var ot;let N=Ee.utils.getAbilityConfigUrl(K),Ue=Math.round(new Date().getTime()/1e3),we=`${N}?sdkAppId=${K}&userId=${x}&userSig=${n}&timestamp=${Ue}`;try{let $e=await(await fetch(we)).json();Ee.log.info(`virtual background send ${we}, response: ${JSON.stringify($e)}`);let{data:Ye}=$e;return(ot=Ye==null?void 0:Ye.trtcAutoConf)!=null&&ot.web_ar?{auth:!0,timestamp:Ue}:{auth:!1}}catch(ht){return Ee.log.error("virtual background fetch error",ht),{auth:!1}}}var Du={sdkAppId:{required:!0,type:"number"},userId:{required:!0,type:"string"},userSig:{required:!0,type:"string"}};function Cc(K){return{name:"VirtualBackgroundOptions",type:"object",required:!0,allowEmpty:!1,properties:hc(_c({},Du),{type:{required:!1,type:"string",values:["image","blur"]},src:{required:!1,type:"string"},blurLevel:{required:!1,type:"number",min:1,max:10},onAbort:{required:!1}}),validate(x,n,Ee,N){var Ve;let{RtcError:Ue,ErrorCode:we,ErrorCodeDictionary:ot}=K.errorModule;if(!x)return;let{type:ht,src:$e,onAbort:Ye}=x;if(ht==="image"&&!$e)throw new Ue({code:we.INVALID_PARAMETER,extraCode:ot.INVALID_PARAMETER_REQUIRED,fnName:Ee,messageParams:{key:"src"}});if(Ye&&!K.utils.isFunction(Ye))throw new Ue({code:we.INVALID_PARAMETER,extraCode:ot.INVALID_PARAMETER_TYPE,fnName:Ee,messageParams:{key:"onAbort",value:typeof Ye,rule:{type:"Function"}}});if(!((Ve=K.room.videoManager.cameraTrack)!=null&&Ve.mediaTrack))throw new Ue({code:we.INVALID_OPERATION,extraCode:ot.INVALID_OPERATION_NEED_VIDEO,fnName:Ee})}}}function yc(K){return{name:"UpdateVirtualBackgroundOptions",type:"object",required:!0,allowEmpty:!1,properties:{type:{required:!0,type:"string",values:["image","blur"]},src:{required:!1,type:"string"},blurLevel:{required:!1,type:"number",min:1,max:10}},validate(x,n,Ee,N){if(!x)return;let{RtcError:Ue,ErrorCode:we,ErrorCodeDictionary:ot}=K.errorModule,{type:ht,src:$e}=x;if(ht==="image"&&!$e)throw new Ue({code:we.INVALID_PARAMETER,extraCode:ot.INVALID_PARAMETER_REQUIRED,fnName:Ee,messageParams:{key:"src"}})}}}function wc(K){return{name:"StopVirtualBackgroundOptions",required:!1}}var bu=function(){let K=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(K=K||__filename),function(x){x=x||{};let n=typeof x!="undefined"?x:{},Ee,N;n.ready=new Promise((e,t)=>{Ee=e,N=t}),Object.getOwnPropertyDescriptor(n.ready,"_main")||(Object.defineProperty(n.ready,"_main",{configurable:!0,get(){p("You are getting _main on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_main",{configurable:!0,set(){p("You are setting _main on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_emscripten_stack_get_end")||(Object.defineProperty(n.ready,"_emscripten_stack_get_end",{configurable:!0,get(){p("You are getting _emscripten_stack_get_end on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_emscripten_stack_get_end",{configurable:!0,set(){p("You are setting _emscripten_stack_get_end on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_emscripten_stack_get_free")||(Object.defineProperty(n.ready,"_emscripten_stack_get_free",{configurable:!0,get(){p("You are getting _emscripten_stack_get_free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_emscripten_stack_get_free",{configurable:!0,set(){p("You are setting _emscripten_stack_get_free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_emscripten_stack_init")||(Object.defineProperty(n.ready,"_emscripten_stack_init",{configurable:!0,get(){p("You are getting _emscripten_stack_init on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_emscripten_stack_init",{configurable:!0,set(){p("You are setting _emscripten_stack_init on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_stackSave")||(Object.defineProperty(n.ready,"_stackSave",{configurable:!0,get(){p("You are getting _stackSave on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_stackSave",{configurable:!0,set(){p("You are setting _stackSave on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_stackRestore")||(Object.defineProperty(n.ready,"_stackRestore",{configurable:!0,get(){p("You are getting _stackRestore on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_stackRestore",{configurable:!0,set(){p("You are setting _stackRestore on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_stackAlloc")||(Object.defineProperty(n.ready,"_stackAlloc",{configurable:!0,get(){p("You are getting _stackAlloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_stackAlloc",{configurable:!0,set(){p("You are setting _stackAlloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"___wasm_call_ctors")||(Object.defineProperty(n.ready,"___wasm_call_ctors",{configurable:!0,get(){p("You are getting ___wasm_call_ctors on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"___wasm_call_ctors",{configurable:!0,set(){p("You are setting ___wasm_call_ctors on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_fflush")||(Object.defineProperty(n.ready,"_fflush",{configurable:!0,get(){p("You are getting _fflush on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_fflush",{configurable:!0,set(){p("You are setting _fflush on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"___errno_location")||(Object.defineProperty(n.ready,"___errno_location",{configurable:!0,get(){p("You are getting ___errno_location on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"___errno_location",{configurable:!0,set(){p("You are setting ___errno_location on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_malloc")||(Object.defineProperty(n.ready,"_malloc",{configurable:!0,get(){p("You are getting _malloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_malloc",{configurable:!0,set(){p("You are setting _malloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_free")||(Object.defineProperty(n.ready,"_free",{configurable:!0,get(){p("You are getting _free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_free",{configurable:!0,set(){p("You are setting _free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_setThrew")||(Object.defineProperty(n.ready,"_setThrew",{configurable:!0,get(){p("You are getting _setThrew on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_setThrew",{configurable:!0,set(){p("You are setting _setThrew on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"___cxa_is_pointer_type")||(Object.defineProperty(n.ready,"___cxa_is_pointer_type",{configurable:!0,get(){p("You are getting ___cxa_is_pointer_type on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"___cxa_is_pointer_type",{configurable:!0,set(){p("You are setting ___cxa_is_pointer_type on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"___cxa_can_catch")||(Object.defineProperty(n.ready,"___cxa_can_catch",{configurable:!0,get(){p("You are getting ___cxa_can_catch on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"___cxa_can_catch",{configurable:!0,set(){p("You are setting ___cxa_can_catch on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_saveSetjmp")||(Object.defineProperty(n.ready,"_saveSetjmp",{configurable:!0,get(){p("You are getting _saveSetjmp on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_saveSetjmp",{configurable:!0,set(){p("You are setting _saveSetjmp on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_memalign")||(Object.defineProperty(n.ready,"_memalign",{configurable:!0,get(){p("You are getting _memalign on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_memalign",{configurable:!0,set(){p("You are setting _memalign on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_emscripten_main_thread_process_queued_calls")||(Object.defineProperty(n.ready,"_emscripten_main_thread_process_queued_calls",{configurable:!0,get(){p("You are getting _emscripten_main_thread_process_queued_calls on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_emscripten_main_thread_process_queued_calls",{configurable:!0,set(){p("You are setting _emscripten_main_thread_process_queued_calls on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_emscripten_webgl_make_context_current")||(Object.defineProperty(n.ready,"_emscripten_webgl_make_context_current",{configurable:!0,get(){p("You are getting _emscripten_webgl_make_context_current on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_emscripten_webgl_make_context_current",{configurable:!0,set(){p("You are setting _emscripten_webgl_make_context_current on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_emscripten_webgl_get_current_context")||(Object.defineProperty(n.ready,"_emscripten_webgl_get_current_context",{configurable:!0,get(){p("You are getting _emscripten_webgl_get_current_context on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_emscripten_webgl_get_current_context",{configurable:!0,set(){p("You are setting _emscripten_webgl_get_current_context on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"__get_tzname")||(Object.defineProperty(n.ready,"__get_tzname",{configurable:!0,get(){p("You are getting __get_tzname on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"__get_tzname",{configurable:!0,set(){p("You are setting __get_tzname on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"__get_daylight")||(Object.defineProperty(n.ready,"__get_daylight",{configurable:!0,get(){p("You are getting __get_daylight on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"__get_daylight",{configurable:!0,set(){p("You are setting __get_daylight on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"__get_timezone")||(Object.defineProperty(n.ready,"__get_timezone",{configurable:!0,get(){p("You are getting __get_timezone on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"__get_timezone",{configurable:!0,set(){p("You are setting __get_timezone on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_emscripten_builtin_malloc")||(Object.defineProperty(n.ready,"_emscripten_builtin_malloc",{configurable:!0,get(){p("You are getting _emscripten_builtin_malloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_emscripten_builtin_malloc",{configurable:!0,set(){p("You are setting _emscripten_builtin_malloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_emscripten_builtin_free")||(Object.defineProperty(n.ready,"_emscripten_builtin_free",{configurable:!0,get(){p("You are getting _emscripten_builtin_free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_emscripten_builtin_free",{configurable:!0,set(){p("You are setting _emscripten_builtin_free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_emscripten_builtin_memalign")||(Object.defineProperty(n.ready,"_emscripten_builtin_memalign",{configurable:!0,get(){p("You are getting _emscripten_builtin_memalign on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_emscripten_builtin_memalign",{configurable:!0,set(){p("You are setting _emscripten_builtin_memalign on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"___getTypeName")||(Object.defineProperty(n.ready,"___getTypeName",{configurable:!0,get(){p("You are getting ___getTypeName on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"___getTypeName",{configurable:!0,set(){p("You are setting ___getTypeName on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"___embind_register_native_and_builtin_types")||(Object.defineProperty(n.ready,"___embind_register_native_and_builtin_types",{configurable:!0,get(){p("You are getting ___embind_register_native_and_builtin_types on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"___embind_register_native_and_builtin_types",{configurable:!0,set(){p("You are setting ___embind_register_native_and_builtin_types on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"onRuntimeInitialized")||(Object.defineProperty(n.ready,"onRuntimeInitialized",{configurable:!0,get(){p("You are getting onRuntimeInitialized on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"onRuntimeInitialized",{configurable:!0,set(){p("You are setting onRuntimeInitialized on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}));let Ue={},we;for(we in n)n.hasOwnProperty(we)&&(Ue[we]=n[we]);let ot=[],ht="./this.program",$e=function(e,t){throw t},Ye=typeof window=="object",Ve=typeof importScripts=="function",It=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",bi=!Ye&&!It&&!Ve;if(n.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)");let Te="";function Oi(e){return n.locateFile?n.locateFile(e,Te):Te+e}let Rr,er,nn,In,Ke,ge;if(Ye||Ve){if(Ve?Te=self.location.href:typeof document!="undefined"&&document.currentScript&&(Te=document.currentScript.src),K&&(Te=K),Te.indexOf("blob:")!==0?Te=Te.substr(0,Te.lastIndexOf("/")+1):Te="",!(typeof window=="object"||typeof importScripts=="function"))throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");Rr=function(e){let t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},Ve&&(nn=function(e){let t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),er=function(e,t,r){let o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="arraybuffer",o.onload=function(){if(o.status==200||o.status==0&&o.response){t(o.response);return}r()},o.onerror=r,o.send(null)},In=function(e){document.title=e}}else throw new Error("environment detection error");let Re=n.print||console.log.bind(console),pe=n.printErr||console.warn.bind(console);for(we in Ue)Ue.hasOwnProperty(we)&&(n[we]=Ue[we]);Ue=null,n.arguments&&(ot=n.arguments),Object.getOwnPropertyDescriptor(n,"arguments")||Object.defineProperty(n,"arguments",{configurable:!0,get(){p("Module.arguments has been replaced with plain arguments_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),n.thisProgram&&(ht=n.thisProgram),Object.getOwnPropertyDescriptor(n,"thisProgram")||Object.defineProperty(n,"thisProgram",{configurable:!0,get(){p("Module.thisProgram has been replaced with plain thisProgram (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),n.quit&&($e=n.quit),Object.getOwnPropertyDescriptor(n,"quit")||Object.defineProperty(n,"quit",{configurable:!0,get(){p("Module.quit has been replaced with plain quit_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),z(typeof n.memoryInitializerPrefixURL=="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),z(typeof n.pthreadMainPrefixURL=="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),z(typeof n.cdInitializerPrefixURL=="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),z(typeof n.filePackagePrefixURL=="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),z(typeof n.read=="undefined","Module.read option was removed (modify read_ in JS)"),z(typeof n.readAsync=="undefined","Module.readAsync option was removed (modify readAsync in JS)"),z(typeof n.readBinary=="undefined","Module.readBinary option was removed (modify readBinary in JS)"),z(typeof n.setWindowTitle=="undefined","Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),z(typeof n.TOTAL_MEMORY=="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),Object.getOwnPropertyDescriptor(n,"read")||Object.defineProperty(n,"read",{configurable:!0,get(){p("Module.read has been replaced with plain read_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(n,"readAsync")||Object.defineProperty(n,"readAsync",{configurable:!0,get(){p("Module.readAsync has been replaced with plain readAsync (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(n,"readBinary")||Object.defineProperty(n,"readBinary",{configurable:!0,get(){p("Module.readBinary has been replaced with plain readBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(n,"setWindowTitle")||Object.defineProperty(n,"setWindowTitle",{configurable:!0,get(){p("Module.setWindowTitle has been replaced with plain setWindowTitle (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),z(!bi,"shell environment detected but not enabled at build time. Add 'shell' to `-s ENVIRONMENT` to enable.");function tt(e){tt.shown||(tt.shown={}),tt.shown[e]||(tt.shown[e]=1,pe(e))}function Ir(e,t){if(typeof WebAssembly.Function=="function"){let I={i:"i32",j:"i64",f:"f32",d:"f64"},m={parameters:[],results:t[0]=="v"?[]:[I[t[0]]]};for(var r=1;r<t.length;++r)m.parameters.push(I[t[r]]);return new WebAssembly.Function(m,e)}let o=[1,0,1,96],a=t.slice(0,1),s=t.slice(1),A={i:127,j:126,f:125,d:124};o.push(s.length);for(var r=0;r<s.length;++r)o.push(A[s[r]]);a=="v"?o.push(0):o=o.concat([1,A[a]]),o[1]=o.length-2;let c=new Uint8Array([0,97,115,109,1,0,0,0].concat(o,[2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0])),u=new WebAssembly.Module(c);return new WebAssembly.Instance(u,{e:{f:e}}).exports.f}let Ut=[],Xe;function mr(){if(Ut.length)return Ut.pop();try{V.grow(1)}catch(e){throw e instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":e}return V.length-1}function mt(e,t){if(!Xe){Xe=new WeakMap;for(let o=0;o<V.length;o++){let a=V.get(o);a&&Xe.set(a,o)}}if(Xe.has(e))return Xe.get(e);let r=mr();try{V.set(r,e)}catch(o){if(!(o instanceof TypeError))throw o;z(typeof t!="undefined",`Missing signature argument to addFunction: ${e}`);let a=Ir(e,t);V.set(r,a)}return Xe.set(e,r),r}let Cr=0,he=function(e){Cr=e},Hn=function(){return Cr},xt;n.wasmBinary&&(xt=n.wasmBinary),Object.getOwnPropertyDescriptor(n,"wasmBinary")||Object.defineProperty(n,"wasmBinary",{configurable:!0,get(){p("Module.wasmBinary has been replaced with plain wasmBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}});let jt=n.noExitRuntime||!0;Object.getOwnPropertyDescriptor(n,"noExitRuntime")||Object.defineProperty(n,"noExitRuntime",{configurable:!0,get(){p("Module.noExitRuntime has been replaced with plain noExitRuntime (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),typeof WebAssembly!="object"&&p("no native wasm support detected");let Pt,W=!1,Sr;function z(e,t){e||p(`Assertion failed: ${t}`)}function lo(e){let t=n[`_${e}`];return z(t,`Cannot call unknown function ${e}, make sure it is exported`),t}function Bi(e,t,r,o,a){let s={string(m){let y=0;if(m!=null&&m!==0){let v=(m.length<<2)+1;y=so(v),tr(m,y,v)}return y},array(m){let y=so(m.length);return Xn(m,y),y}};function A(m){return t==="string"?Je(m):t==="boolean"?!!m:m}let c=lo(e),u=[],d=0;if(z(t!=="array",'Return type should not be "array".'),o)for(let m=0;m<o.length;m++){let y=s[r[m]];y?(d===0&&(d=j()),u[m]=y(o[m])):u[m]=o[m]}let h=c.apply(null,u);function I(m){return d!==0&&te(d),A(m)}return h=I(h),h}let Mr=1,at=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;function Rt(e,t,r){let o=t+r,a=t;for(;e[a]&&!(a>=o);)++a;if(a-t>16&&e.subarray&&at)return at.decode(e.subarray(t,a));let s="";for(;t<a;){let A=e[t++];if(!(A&128)){s+=String.fromCharCode(A);continue}let c=e[t++]&63;if((A&224)==192){s+=String.fromCharCode((A&31)<<6|c);continue}let u=e[t++]&63;if((A&240)==224?A=(A&15)<<12|c<<6|u:((A&248)!=240&&tt(`Invalid UTF-8 leading byte 0x${A.toString(16)} encountered when deserializing a UTF-8 string in wasm memory to a JS string!`),A=(A&7)<<18|c<<12|u<<6|e[t++]&63),A<65536)s+=String.fromCharCode(A);else{let d=A-65536;s+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return s}function Je(e,t){return e?Rt(ve,e,t):""}function Ze(e,t,r,o){if(!(o>0))return 0;let a=r,s=r+o-1;for(let A=0;A<e.length;++A){let c=e.charCodeAt(A);if(c>=55296&&c<=57343){let u=e.charCodeAt(++A);c=65536+((c&1023)<<10)|u&1023}if(c<=127){if(r>=s)break;t[r++]=c}else if(c<=2047){if(r+1>=s)break;t[r++]=192|c>>6,t[r++]=128|c&63}else if(c<=65535){if(r+2>=s)break;t[r++]=224|c>>12,t[r++]=128|c>>6&63,t[r++]=128|c&63}else{if(r+3>=s)break;c>=2097152&&tt(`Invalid Unicode code point 0x${c.toString(16)} encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x1FFFFF).`),t[r++]=240|c>>18,t[r++]=128|c>>12&63,t[r++]=128|c>>6&63,t[r++]=128|c&63}}return t[r]=0,r-a}function tr(e,t,r){return z(typeof r=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),Ze(e,ve,t,r)}function bt(e){let t=0;for(let r=0;r<e.length;++r){let o=e.charCodeAt(r);o>=55296&&o<=57343&&(o=65536+((o&1023)<<10)|e.charCodeAt(++r)&1023),o<=127?++t:o<=2047?t+=2:o<=65535?t+=3:t+=4}return t}let Gn=typeof TextDecoder!="undefined"?new TextDecoder("utf-16le"):void 0;function Ti(e,t){z(e%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");let r=e,o=r>>1,a=o+t/2;for(;!(o>=a)&&Oe[o];)++o;if(r=o<<1,r-e>32&&Gn)return Gn.decode(ve.subarray(e,r));let s="";for(let A=0;!(A>=t/2);++A){let c=T[e+A*2>>1];if(c==0)break;s+=String.fromCharCode(c)}return s}function mn(e,t,r){if(z(t%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),z(typeof r=="number","stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),r===void 0&&(r=2147483647),r<2)return 0;r-=2;let o=t,a=r<e.length*2?r/2:e.length;for(let s=0;s<a;++s){let A=e.charCodeAt(s);T[t>>1]=A,t+=2}return T[t>>1]=0,t-o}function Yn(e){return e.length*2}function vi(e,t){z(e%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");let r=0,o="";for(;!(r>=t/4);){let a=b[e+r*4>>2];if(a==0)break;if(++r,a>=65536){let s=a-65536;o+=String.fromCharCode(55296|s>>10,56320|s&1023)}else o+=String.fromCharCode(a)}return o}function Cn(e,t,r){if(z(t%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),z(typeof r=="number","stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),r===void 0&&(r=2147483647),r<4)return 0;let o=t,a=o+r-4;for(let s=0;s<e.length;++s){let A=e.charCodeAt(s);if(A>=55296&&A<=57343){let c=e.charCodeAt(++s);A=65536+((A&1023)<<10)|c&1023}if(b[t>>2]=A,t+=4,t+4>a)break}return b[t>>2]=0,t-o}function Fr(e){let t=0;for(let r=0;r<e.length;++r){let o=e.charCodeAt(r);o>=55296&&o<=57343&&++r,t+=4}return t}function yn(e){let t=bt(e)+1,r=tn(t);return r&&Ze(e,be,r,t),r}function Xn(e,t){z(e.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),be.set(e,t)}function kr(e,t,r){for(let o=0;o<e.length;++o)z(e.charCodeAt(o)===e.charCodeAt(o)&255),be[t++>>0]=e.charCodeAt(o);r||(be[t>>0]=0)}function xe(e,t){return e%t>0&&(e+=t-e%t),e}let Se,be,ve,T,Oe,b,Qe,ze,Nr;function on(e){Se=e,n.HEAP8=be=new Int8Array(e),n.HEAP16=T=new Int16Array(e),n.HEAP32=b=new Int32Array(e),n.HEAPU8=ve=new Uint8Array(e),n.HEAPU16=Oe=new Uint16Array(e),n.HEAPU32=Qe=new Uint32Array(e),n.HEAPF32=ze=new Float32Array(e),n.HEAPF64=Nr=new Float64Array(e)}let J=5242880;n.TOTAL_STACK&&z(J===n.TOTAL_STACK,"the stack size can no longer be determined at runtime");let Ur=n.INITIAL_MEMORY||16777216;Object.getOwnPropertyDescriptor(n,"INITIAL_MEMORY")||Object.defineProperty(n,"INITIAL_MEMORY",{configurable:!0,get(){p("Module.INITIAL_MEMORY has been replaced with plain INITIAL_MEMORY (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),z(Ur>=J,`INITIAL_MEMORY should be larger than TOTAL_STACK, was ${Ur}! (TOTAL_STACK=${J})`),z(typeof Int32Array!="undefined"&&typeof Float64Array!="undefined"&&Int32Array.prototype.subarray!==void 0&&Int32Array.prototype.set!==void 0,"JS engine does not provide full typed array support"),z(!n.wasmMemory,"Use of `wasmMemory` detected. Use -s IMPORTED_MEMORY to define wasmMemory externally"),z(Ur==16777216,"Detected runtime INITIAL_MEMORY setting. Use -s IMPORTED_MEMORY to define wasmMemory dynamically");let V;function Lt(){let e=rn();z((e&3)==0),Qe[(e>>2)+1]=34821223,Qe[(e>>2)+2]=2310721022,b[0]=1668509029}function st(){if(W)return;let e=rn(),t=Qe[(e>>2)+1],r=Qe[(e>>2)+2];(t!=34821223||r!=2310721022)&&p(`Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x${r.toString(16)} ${t.toString(16)}`),b[0]!==1668509029&&p("Runtime error: The application has corrupted its heap memory area (address zero)!")}(function(){let e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,t[0]!==115||t[1]!==99)throw"Runtime error: expected the system to be little-endian! (Run with -s SUPPORT_BIG_ENDIAN=1 to bypass)"})();let xr=[],Ht=[],de=[],an=[],yr=!1,Ot=!1,Qi=0;function Ct(){return jt||Qi>0}function Gt(){if(n.preRun)for(typeof n.preRun=="function"&&(n.preRun=[n.preRun]);n.preRun.length;)Dn(n.preRun.shift());Tn(xr)}function Pi(){st(),z(!yr),yr=!0,!n.noFSInit&&!l.init.initialized&&l.init(),l.ignorePermissions=!1,yt.init(),Tn(Ht)}function Ri(){st(),Ot=!0}function wn(){if(st(),n.postRun)for(typeof n.postRun=="function"&&(n.postRun=[n.postRun]);n.postRun.length;)rr(n.postRun.shift());Tn(an)}function Dn(e){xr.unshift(e)}function Yt(e){Ht.unshift(e)}function rr(e){an.unshift(e)}z(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),z(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),z(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),z(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");let lt=0,At=null,nr=null,St={};function wr(e){let t=e;for(;;){if(!St[e])return e;e=t+Math.random()}}function E(e){lt++,n.monitorRunDependencies&&n.monitorRunDependencies(lt),e?(z(!St[e]),St[e]=1,At===null&&typeof setInterval!="undefined"&&(At=setInterval(()=>{if(W){clearInterval(At),At=null;return}let t=!1;for(let r in St)t||(t=!0,pe("still waiting on run dependencies:")),pe(`dependency: ${r}`);t&&pe("(end of list)")},1e4))):pe("warning: run dependency added without ID")}function ir(e){if(lt--,n.monitorRunDependencies&&n.monitorRunDependencies(lt),e?(z(St[e]),delete St[e]):pe("warning: run dependency removed without ID"),lt==0&&(At!==null&&(clearInterval(At),At=null),nr)){let t=nr;nr=null,t()}}n.preloadedImages={},n.preloadedAudios={};function p(e){n.onAbort&&n.onAbort(e),e+="",pe(e),W=!0,Sr=1,e=`abort(${e}) at ${Fi()}`;let r=new WebAssembly.RuntimeError(e);throw N(r),r}let bn="data:application/octet-stream;base64,";function le(e){return e.startsWith(bn)}function He(e){return e.startsWith("file://")}function ce(e,t){return function(){let r=e,o=t;return t||(o=n.asm),z(yr,`native function \`${r}\` called before runtime initialization`),z(!Ot,`native function \`${r}\` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)`),o[e]||z(o[e],`exported native function \`${r}\` not found`),o[e].apply(null,arguments)}}let Dr;Dr="selfie_segmentation_solution_simd_wasm_bin.wasm",le(Dr)||(Dr=Oi(Dr));function On(e){try{if(e==Dr&&xt)return new Uint8Array(xt);if(nn)return nn(e);throw"both async and sync fetching of the wasm failed"}catch(t){p(t)}}function We(){let e={env:rA,wasi_snapshot_preview1:rA};function t(a,s){let{exports:A}=a;n.asm=A,Pt=n.asm.memory,z(Pt,"memory not found in wasm exports"),on(Pt.buffer),V=n.asm.__indirect_function_table,z(V,"table not found in wasm exports"),Yt(n.asm.__wasm_call_ctors),ir("wasm-instantiate")}E("wasm-instantiate");let r=n;function o(a){z(n===r,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),r=null,t(a)}if(n.instantiateWasm)try{return n.instantiateWasm(e,t)}catch(a){return pe(`Module.instantiateWasm callback failed with error: ${a}`),!1}return n.loadWasm(Dr,e).then(o).catch(N),{}}let ye,Bt,jr={460656(){let e=!0;if(e){let t=to;if(typeof t!="function"){typeof console!="undefined"&&console.error('Expected Emscripten global function "findCanvasEventTarget" not found. WebGL context creation may fail.');return}to=function(r){if(r==0){if(n&&n.canvas)return n.canvas;if(n&&n.canvasCssSelector)return t(n.canvasCssSelector);typeof console!="undefined"&&console.warn("Module properties canvas and canvasCssSelector not found during WebGL context creation.")}return t(r)},e=!1}},461441(){return typeof wasmOffsetConverter!="undefined"}};function br(){return typeof wasmOffsetConverter!="undefined"}function Tt(e,t){if(Q.mainLoop.timingMode=e,Q.mainLoop.timingValue=t,!Q.mainLoop.func)return pe("emscripten_set_main_loop_timing: Cannot set timing mode for main loop since a main loop does not exist! Call emscripten_set_main_loop first to set one up."),1;if(Q.mainLoop.running||(Q.mainLoop.running=!0),e==0)Q.mainLoop.scheduler=function(){let o=Math.max(0,Q.mainLoop.tickStartTime+t-Or())|0;setTimeout(Q.mainLoop.runner,o)},Q.mainLoop.method="timeout";else if(e==1)Q.mainLoop.scheduler=function(){Q.requestAnimationFrame(Q.mainLoop.runner)},Q.mainLoop.method="rAF";else if(e==2){if(typeof setImmediate=="undefined"){let r=[],o="setimmediate",a=function(s){(s.data===o||s.data.target===o)&&(s.stopPropagation(),r.shift()())};addEventListener("message",a,!0),setImmediate=function(A){r.push(A),Ve?(n.setImmediates===void 0&&(n.setImmediates=[]),n.setImmediates.push(A),postMessage({target:o})):postMessage(o,"*")}}Q.mainLoop.scheduler=function(){setImmediate(Q.mainLoop.runner)},Q.mainLoop.method="immediate"}return 0}let Or;It?Or=function(){let e=process.hrtime();return e[0]*1e3+e[1]/1e6}:Or=function(){return performance.now()};function Si(){return!w.currentContext||!w.currentContext.GLctx?-3:w.currentContext.defaultFbo?(w.blitOffscreenFramebuffer(w.currentContext),0):w.currentContext.attributes.explicitSwapControl?0:-3}function Wn(e){No(e)}function Mi(){if(!Ct())try{Wn(Sr)}catch(e){if(e instanceof Ao)return;throw e}}function Bn(e,t,r,o,a){z(!Q.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."),Q.mainLoop.func=e,Q.mainLoop.arg=o;let s=Q.mainLoop.currentlyRunningMainloop;function A(){return s<Q.mainLoop.currentlyRunningMainloop?(Mi(),!1):!0}if(Q.mainLoop.running=!1,Q.mainLoop.runner=function(){if(!W){if(Q.mainLoop.queue.length>0){let u=Date.now(),d=Q.mainLoop.queue.shift();if(d.func(d.arg),Q.mainLoop.remainingBlockers){let h=Q.mainLoop.remainingBlockers,I=h%1==0?h-1:Math.floor(h);d.counted?Q.mainLoop.remainingBlockers=I:(I=I+.5,Q.mainLoop.remainingBlockers=(8*h+I)/9)}if(Re(`main loop blocker "${d.name}" took ${Date.now()-u} ms`),Q.mainLoop.updateStatus(),!A())return;setTimeout(Q.mainLoop.runner,0);return}if(A()){if(Q.mainLoop.currentFrameNumber=Q.mainLoop.currentFrameNumber+1|0,Q.mainLoop.timingMode==1&&Q.mainLoop.timingValue>1&&Q.mainLoop.currentFrameNumber%Q.mainLoop.timingValue!=0){Q.mainLoop.scheduler();return}Q.mainLoop.timingMode==0&&(Q.mainLoop.tickStartTime=Or()),w.newRenderingFrameStarted(),typeof w!="undefined"&&w.currentContext&&!w.currentContextIsProxied&&!w.currentContext.attributes.explicitSwapControl&&w.currentContext.GLctx.commit&&w.currentContext.GLctx.commit(),Q.mainLoop.method==="timeout"&&n.ctx&&(tt("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),Q.mainLoop.method=""),Q.mainLoop.runIter(e),st(),A()&&(typeof SDL=="object"&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),Q.mainLoop.scheduler())}}},a||(t&&t>0?Tt(0,1e3/t):Tt(1,1),Q.mainLoop.scheduler()),r)throw"unwind"}function or(e,t){if(W){pe("user callback triggered after application aborted. Ignoring.");return}if(t){e();return}try{e()}catch(r){if(r instanceof Ao)return;if(r!=="unwind")throw r&&typeof r=="object"&&r.stack&&pe(`exception thrown: ${[r,r.stack]}`),r}}function P(e,t){return setTimeout(()=>{or(e)},t)}var Q={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause(){Q.mainLoop.scheduler=null,Q.mainLoop.currentlyRunningMainloop++},resume(){Q.mainLoop.currentlyRunningMainloop++;let{timingMode:e}=Q.mainLoop,{timingValue:t}=Q.mainLoop,{func:r}=Q.mainLoop;Q.mainLoop.func=null,Bn(r,0,!1,Q.mainLoop.arg,!0),Tt(e,t),Q.mainLoop.scheduler()},updateStatus(){if(n.setStatus){let e=n.statusMessage||"Please wait...",t=Q.mainLoop.remainingBlockers,r=Q.mainLoop.expectedBlockers;t?t<r?n.setStatus(`${e} (${r-t}/${r})`):n.setStatus(e):n.setStatus("")}},runIter(e){W||n.preMainLoop&&n.preMainLoop()===!1||(or(e),n.postMainLoop&&n.postMainLoop())}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init(){if(n.preloadPlugins||(n.preloadPlugins=[]),Q.initted)return;Q.initted=!0;try{new Blob,Q.hasBlobConstructor=!0}catch(a){Q.hasBlobConstructor=!1,Re("warning: no blob constructor, cannot create blobs with mimetypes")}Q.BlobBuilder=typeof MozBlobBuilder!="undefined"?MozBlobBuilder:typeof WebKitBlobBuilder!="undefined"?WebKitBlobBuilder:Q.hasBlobConstructor?null:Re("warning: no BlobBuilder"),Q.URLObject=typeof window!="undefined"?window.URL?window.URL:window.webkitURL:void 0,!n.noImageDecoding&&typeof Q.URLObject=="undefined"&&(Re("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),n.noImageDecoding=!0);let e={};e.canHandle=function(s){return!n.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(s)},e.handle=function(s,A,c,u){let d=null;if(Q.hasBlobConstructor)try{d=new Blob([s],{type:Q.getMimetype(A)}),d.size!==s.length&&(d=new Blob([new Uint8Array(s).buffer],{type:Q.getMimetype(A)}))}catch(m){tt(`Blob constructor present but fails: ${m}; falling back to blob builder`)}if(!d){let m=new Q.BlobBuilder;m.append(new Uint8Array(s).buffer),d=m.getBlob()}let h=Q.URLObject.createObjectURL(d);z(typeof h=="string","createObjectURL must return a url as a string");let I=new Image;I.onload=function(){z(I.complete,`Image ${A} could not be decoded`);let y=document.createElement("canvas");y.width=I.width,y.height=I.height,y.getContext("2d").drawImage(I,0,0),n.preloadedImages[A]=y,Q.URLObject.revokeObjectURL(h),c&&c(s)},I.onerror=function(y){Re(`Image ${h} could not be decoded`),u&&u()},I.src=h},n.preloadPlugins.push(e);let t={};t.canHandle=function(s){return!n.noAudioDecoding&&s.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},t.handle=function(s,A,c,u){let d=!1;function h(y){d||(d=!0,n.preloadedAudios[A]=y,c&&c(s))}function I(){d||(d=!0,n.preloadedAudios[A]=new Audio,u&&u())}if(Q.hasBlobConstructor){try{var m=new Blob([s],{type:Q.getMimetype(A)})}catch(U){return I()}let y=Q.URLObject.createObjectURL(m);z(typeof y=="string","createObjectURL must return a url as a string");let v=new Audio;v.addEventListener("canplaythrough",()=>{h(v)},!1),v.onerror=function(G){if(d)return;Re(`warning: browser could not fully decode audio ${A}, trying slower base64 approach`);function R(D){let k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$="=",Y="",Ce=0,Ne=0;for(let hr=0;hr<D.length;hr++)for(Ce=Ce<<8|D[hr],Ne+=8;Ne>=6;){let hu=Ce>>Ne-6&63;Ne-=6,Y+=k[hu]}return Ne==2?(Y+=k[(Ce&3)<<4],Y+=$+$):Ne==4&&(Y+=k[(Ce&15)<<2],Y+=$),Y}v.src=`data:audio/x-${A.substr(-3)};base64,${R(s)}`,h(v)},v.src=y,P(()=>{h(v)},1e4)}else return I()},n.preloadPlugins.push(t);function r(){Q.pointerLock=document.pointerLockElement===n.canvas||document.mozPointerLockElement===n.canvas||document.webkitPointerLockElement===n.canvas||document.msPointerLockElement===n.canvas}let{canvas:o}=n},createContext(e,t,r,o){if(t&&n.ctx&&e==n.canvas)return n.ctx;let a,s;if(t){let A={antialias:!1,alpha:!1,majorVersion:typeof WebGL2RenderingContext!="undefined"?2:1};if(o)for(let c in o)A[c]=o[c];typeof w!="undefined"&&(s=w.createContext(e,A),s&&(a=w.getContext(s).GLctx))}else a=e.getContext("2d");return a?(r&&(t||z(typeof S=="undefined","cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),n.ctx=a,t&&w.makeContextCurrent(s),n.useWebGL=t,Q.moduleContextCreatedCallbacks.forEach(A=>{A()}),Q.init()),a):null},destroyContext(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen(e,t){Q.lockPointer=e,Q.resizeCanvas=t,typeof Q.lockPointer=="undefined"&&(Q.lockPointer=!0),typeof Q.resizeCanvas=="undefined"&&(Q.resizeCanvas=!1);let{canvas:r}=n;function o(){Q.isFullscreen=!1;let s=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===s?(r.exitFullscreen=Q.exitFullscreen,Q.lockPointer&&r.requestPointerLock(),Q.isFullscreen=!0,Q.resizeCanvas?Q.setFullscreenCanvasSize():Q.updateCanvasDimensions(r)):(s.parentNode.insertBefore(r,s),s.parentNode.removeChild(s),Q.resizeCanvas?Q.setWindowedCanvasSize():Q.updateCanvasDimensions(r)),n.onFullScreen&&n.onFullScreen(Q.isFullscreen),n.onFullscreen&&n.onFullscreen(Q.isFullscreen)}Q.fullscreenHandlersInstalled||(Q.fullscreenHandlersInstalled=!0);let a=document.createElement("div");r.parentNode.insertBefore(a,r),a.appendChild(r),a.requestFullscreen=a.requestFullscreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullscreen?function(){a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(a.webkitRequestFullScreen?function(){a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),a.requestFullscreen()},requestFullScreen(){p("Module.requestFullScreen has been replaced by Module.requestFullscreen (without a capital S)")},exitFullscreen(){return Q.isFullscreen?((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){}).apply(document,[]),!0):!1},nextRAF:0,fakeRequestAnimationFrame(e){let t=Date.now();if(Q.nextRAF===0)Q.nextRAF=t+1e3/60;else for(;t+2>=Q.nextRAF;)Q.nextRAF+=1e3/60;let r=Math.max(Q.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame(e){if(typeof requestAnimationFrame=="function"){requestAnimationFrame(e);return}let t=Q.fakeRequestAnimationFrame;t(e)},safeSetTimeout(e){return P(e)},safeRequestAnimationFrame(e){return Q.requestAnimationFrame(()=>{or(e)})},getMimetype(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(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta(e){let 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(e){if(Q.pointerLock)e.type!="mousemove"&&"mozMovementX"in e?Q.mouseMovementX=Q.mouseMovementY=0:(Q.mouseMovementX=Q.getMovementX(e),Q.mouseMovementY=Q.getMovementY(e)),typeof SDL!="undefined"?(Q.mouseX=SDL.mouseX+Q.mouseMovementX,Q.mouseY=SDL.mouseY+Q.mouseMovementY):(Q.mouseX+=Q.mouseMovementX,Q.mouseY+=Q.mouseMovementY);else{let t=n.canvas.getBoundingClientRect(),r=n.canvas.width,o=n.canvas.height,a=typeof window.scrollX!="undefined"?window.scrollX:window.pageXOffset,s=typeof window.scrollY!="undefined"?window.scrollY:window.pageYOffset;if(z(typeof a!="undefined"&&typeof s!="undefined","Unable to retrieve scroll position, mouse positions likely broken."),e.type==="touchstart"||e.type==="touchend"||e.type==="touchmove"){let{touch:u}=e;if(u===void 0)return;let d=u.pageX-(a+t.left),h=u.pageY-(s+t.top);d=d*(r/t.width),h=h*(o/t.height);let I={x:d,y:h};if(e.type==="touchstart")Q.lastTouches[u.identifier]=I,Q.touches[u.identifier]=I;else if(e.type==="touchend"||e.type==="touchmove"){let m=Q.touches[u.identifier];m||(m=I),Q.lastTouches[u.identifier]=m,Q.touches[u.identifier]=I}return}let A=e.pageX-(a+t.left),c=e.pageY-(s+t.top);A=A*(r/t.width),c=c*(o/t.height),Q.mouseMovementX=A-Q.mouseX,Q.mouseMovementY=c-Q.mouseY,Q.mouseX=A,Q.mouseY=c}},resizeListeners:[],updateResizeListeners(){let{canvas:e}=n;Q.resizeListeners.forEach(t=>{t(e.width,e.height)})},setCanvasSize(e,t,r){let{canvas:o}=n;Q.updateCanvasDimensions(o,e,t),r||Q.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize(){if(typeof SDL!="undefined"){let e=Qe[SDL.screen>>2];e=e|8388608,b[SDL.screen>>2]=e}Q.updateCanvasDimensions(n.canvas),Q.updateResizeListeners()},setWindowedCanvasSize(){if(typeof SDL!="undefined"){let e=Qe[SDL.screen>>2];e=e&-8388609,b[SDL.screen>>2]=e}Q.updateCanvasDimensions(n.canvas),Q.updateResizeListeners()},updateCanvasDimensions(e,t,r){t&&r?(e.widthNative=t,e.heightNative=r):(t=e.widthNative,r=e.heightNative);let o=t,a=r;if(n.forcedAspectRatio&&n.forcedAspectRatio>0&&(o/a<n.forcedAspectRatio?o=Math.round(a*n.forcedAspectRatio):a=Math.round(o/n.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&typeof screen!="undefined"){let s=Math.min(screen.width/o,screen.height/a);o=Math.round(o*s),a=Math.round(a*s)}Q.resizeCanvas?(e.width!=o&&(e.width=o),e.height!=a&&(e.height=a),typeof e.style!="undefined"&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=t&&(e.width=t),e.height!=r&&(e.height=r),typeof e.style!="undefined"&&(o!=t||a!=r?(e.style.setProperty("width",`${o}px`,"important"),e.style.setProperty("height",`${a}px`,"important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))}};function Tn(e){for(;e.length>0;){let t=e.shift();if(typeof t=="function"){t(n);continue}let{func:r}=t;typeof r=="number"?t.arg===void 0?V.get(r)():V.get(r)(t.arg):r(t.arg===void 0?null:t.arg)}}function Lr(e){return tt("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),e}function Vn(e){let t=/\b_Z[\w\d_]+/g;return e.replace(t,r=>{let o=Lr(r);return r===o?r:`${o} [${r}]`})}function sn(){let e=new Error;if(!e.stack){try{throw new Error}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function Fi(){let e=sn();return n.extraStackTrace&&(e+=`
1
+ var Iu=Object.defineProperty,mu=Object.defineProperties;var Cu=Object.getOwnPropertyDescriptors;var pc=Object.getOwnPropertySymbols;var yu=Object.prototype.hasOwnProperty,wu=Object.prototype.propertyIsEnumerable;var nc=(K,x,n)=>x in K?Iu(K,x,{enumerable:!0,configurable:!0,writable:!0,value:n}):K[x]=n,_c=(K,x)=>{for(var n in x||(x={}))yu.call(x,n)&&nc(K,n,x[n]);if(pc)for(var n of pc(x))wu.call(x,n)&&nc(K,n,x[n]);return K},hc=(K,x)=>mu(K,Cu(x));var Ic=(K=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(K,{get:(x,n)=>(typeof require!="undefined"?require:x)[n]}):K)(function(K){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+K+'" is not supported')});var Le=(K,x,n)=>(nc(K,typeof x!="symbol"?x+"":x,n),n);async function mc({sdkAppId:K,userId:x,userSig:n,core:Ee}){var ot;let N=Ee.schedule.getAbilityConfigUrl(K),Ue=Math.round(new Date().getTime()/1e3),we=`${N}?sdkAppId=${K}&userId=${x}&userSig=${n}&timestamp=${Ue}`;try{let $e=await(await fetch(we)).json();Ee.log.info(`virtual background send ${we}, response: ${JSON.stringify($e)}`);let{data:Ye}=$e;return(ot=Ye==null?void 0:Ye.trtcAutoConf)!=null&&ot.web_ar?{auth:!0,timestamp:Ue}:{auth:!1}}catch(ht){return Ee.log.error("virtual background fetch error",ht),{auth:!1}}}var Du={sdkAppId:{required:!0,type:"number"},userId:{required:!0,type:"string"},userSig:{required:!0,type:"string"}};function Cc(K){return{name:"VirtualBackgroundOptions",type:"object",required:!0,allowEmpty:!1,properties:hc(_c({},Du),{type:{required:!1,type:"string",values:["image","blur"]},src:{required:!1,type:"string"},blurLevel:{required:!1,type:"number",min:1,max:10},onAbort:{required:!1}}),validate(x,n,Ee,N){var Ve;let{RtcError:Ue,ErrorCode:we,ErrorCodeDictionary:ot}=K.errorModule;if(!x)return;let{type:ht,src:$e,onAbort:Ye}=x;if(ht==="image"&&!$e)throw new Ue({code:we.INVALID_PARAMETER,extraCode:ot.INVALID_PARAMETER_REQUIRED,fnName:Ee,messageParams:{key:"src"}});if(Ye&&!K.utils.isFunction(Ye))throw new Ue({code:we.INVALID_PARAMETER,extraCode:ot.INVALID_PARAMETER_TYPE,fnName:Ee,messageParams:{key:"onAbort",value:typeof Ye,rule:{type:"Function"}}});if(!((Ve=K.room.videoManager.cameraTrack)!=null&&Ve.mediaTrack))throw new Ue({code:we.INVALID_OPERATION,extraCode:ot.INVALID_OPERATION_NEED_VIDEO,fnName:Ee})}}}function yc(K){return{name:"UpdateVirtualBackgroundOptions",type:"object",required:!0,allowEmpty:!1,properties:{type:{required:!0,type:"string",values:["image","blur"]},src:{required:!1,type:"string"},blurLevel:{required:!1,type:"number",min:1,max:10}},validate(x,n,Ee,N){if(!x)return;let{RtcError:Ue,ErrorCode:we,ErrorCodeDictionary:ot}=K.errorModule,{type:ht,src:$e}=x;if(ht==="image"&&!$e)throw new Ue({code:we.INVALID_PARAMETER,extraCode:ot.INVALID_PARAMETER_REQUIRED,fnName:Ee,messageParams:{key:"src"}})}}}function wc(K){return{name:"StopVirtualBackgroundOptions",required:!1}}var bu=function(){let K=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(K=K||__filename),function(x){x=x||{};let n=typeof x!="undefined"?x:{},Ee,N;n.ready=new Promise((e,t)=>{Ee=e,N=t}),Object.getOwnPropertyDescriptor(n.ready,"_main")||(Object.defineProperty(n.ready,"_main",{configurable:!0,get(){p("You are getting _main on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_main",{configurable:!0,set(){p("You are setting _main on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_emscripten_stack_get_end")||(Object.defineProperty(n.ready,"_emscripten_stack_get_end",{configurable:!0,get(){p("You are getting _emscripten_stack_get_end on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_emscripten_stack_get_end",{configurable:!0,set(){p("You are setting _emscripten_stack_get_end on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_emscripten_stack_get_free")||(Object.defineProperty(n.ready,"_emscripten_stack_get_free",{configurable:!0,get(){p("You are getting _emscripten_stack_get_free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_emscripten_stack_get_free",{configurable:!0,set(){p("You are setting _emscripten_stack_get_free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_emscripten_stack_init")||(Object.defineProperty(n.ready,"_emscripten_stack_init",{configurable:!0,get(){p("You are getting _emscripten_stack_init on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_emscripten_stack_init",{configurable:!0,set(){p("You are setting _emscripten_stack_init on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_stackSave")||(Object.defineProperty(n.ready,"_stackSave",{configurable:!0,get(){p("You are getting _stackSave on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_stackSave",{configurable:!0,set(){p("You are setting _stackSave on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_stackRestore")||(Object.defineProperty(n.ready,"_stackRestore",{configurable:!0,get(){p("You are getting _stackRestore on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_stackRestore",{configurable:!0,set(){p("You are setting _stackRestore on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_stackAlloc")||(Object.defineProperty(n.ready,"_stackAlloc",{configurable:!0,get(){p("You are getting _stackAlloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_stackAlloc",{configurable:!0,set(){p("You are setting _stackAlloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"___wasm_call_ctors")||(Object.defineProperty(n.ready,"___wasm_call_ctors",{configurable:!0,get(){p("You are getting ___wasm_call_ctors on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"___wasm_call_ctors",{configurable:!0,set(){p("You are setting ___wasm_call_ctors on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_fflush")||(Object.defineProperty(n.ready,"_fflush",{configurable:!0,get(){p("You are getting _fflush on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_fflush",{configurable:!0,set(){p("You are setting _fflush on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"___errno_location")||(Object.defineProperty(n.ready,"___errno_location",{configurable:!0,get(){p("You are getting ___errno_location on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"___errno_location",{configurable:!0,set(){p("You are setting ___errno_location on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_malloc")||(Object.defineProperty(n.ready,"_malloc",{configurable:!0,get(){p("You are getting _malloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_malloc",{configurable:!0,set(){p("You are setting _malloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_free")||(Object.defineProperty(n.ready,"_free",{configurable:!0,get(){p("You are getting _free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_free",{configurable:!0,set(){p("You are setting _free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_setThrew")||(Object.defineProperty(n.ready,"_setThrew",{configurable:!0,get(){p("You are getting _setThrew on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_setThrew",{configurable:!0,set(){p("You are setting _setThrew on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"___cxa_is_pointer_type")||(Object.defineProperty(n.ready,"___cxa_is_pointer_type",{configurable:!0,get(){p("You are getting ___cxa_is_pointer_type on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"___cxa_is_pointer_type",{configurable:!0,set(){p("You are setting ___cxa_is_pointer_type on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"___cxa_can_catch")||(Object.defineProperty(n.ready,"___cxa_can_catch",{configurable:!0,get(){p("You are getting ___cxa_can_catch on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"___cxa_can_catch",{configurable:!0,set(){p("You are setting ___cxa_can_catch on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_saveSetjmp")||(Object.defineProperty(n.ready,"_saveSetjmp",{configurable:!0,get(){p("You are getting _saveSetjmp on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_saveSetjmp",{configurable:!0,set(){p("You are setting _saveSetjmp on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_memalign")||(Object.defineProperty(n.ready,"_memalign",{configurable:!0,get(){p("You are getting _memalign on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_memalign",{configurable:!0,set(){p("You are setting _memalign on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_emscripten_main_thread_process_queued_calls")||(Object.defineProperty(n.ready,"_emscripten_main_thread_process_queued_calls",{configurable:!0,get(){p("You are getting _emscripten_main_thread_process_queued_calls on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_emscripten_main_thread_process_queued_calls",{configurable:!0,set(){p("You are setting _emscripten_main_thread_process_queued_calls on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_emscripten_webgl_make_context_current")||(Object.defineProperty(n.ready,"_emscripten_webgl_make_context_current",{configurable:!0,get(){p("You are getting _emscripten_webgl_make_context_current on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_emscripten_webgl_make_context_current",{configurable:!0,set(){p("You are setting _emscripten_webgl_make_context_current on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_emscripten_webgl_get_current_context")||(Object.defineProperty(n.ready,"_emscripten_webgl_get_current_context",{configurable:!0,get(){p("You are getting _emscripten_webgl_get_current_context on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_emscripten_webgl_get_current_context",{configurable:!0,set(){p("You are setting _emscripten_webgl_get_current_context on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"__get_tzname")||(Object.defineProperty(n.ready,"__get_tzname",{configurable:!0,get(){p("You are getting __get_tzname on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"__get_tzname",{configurable:!0,set(){p("You are setting __get_tzname on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"__get_daylight")||(Object.defineProperty(n.ready,"__get_daylight",{configurable:!0,get(){p("You are getting __get_daylight on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"__get_daylight",{configurable:!0,set(){p("You are setting __get_daylight on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"__get_timezone")||(Object.defineProperty(n.ready,"__get_timezone",{configurable:!0,get(){p("You are getting __get_timezone on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"__get_timezone",{configurable:!0,set(){p("You are setting __get_timezone on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_emscripten_builtin_malloc")||(Object.defineProperty(n.ready,"_emscripten_builtin_malloc",{configurable:!0,get(){p("You are getting _emscripten_builtin_malloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_emscripten_builtin_malloc",{configurable:!0,set(){p("You are setting _emscripten_builtin_malloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_emscripten_builtin_free")||(Object.defineProperty(n.ready,"_emscripten_builtin_free",{configurable:!0,get(){p("You are getting _emscripten_builtin_free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_emscripten_builtin_free",{configurable:!0,set(){p("You are setting _emscripten_builtin_free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"_emscripten_builtin_memalign")||(Object.defineProperty(n.ready,"_emscripten_builtin_memalign",{configurable:!0,get(){p("You are getting _emscripten_builtin_memalign on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"_emscripten_builtin_memalign",{configurable:!0,set(){p("You are setting _emscripten_builtin_memalign on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"___getTypeName")||(Object.defineProperty(n.ready,"___getTypeName",{configurable:!0,get(){p("You are getting ___getTypeName on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"___getTypeName",{configurable:!0,set(){p("You are setting ___getTypeName on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"___embind_register_native_and_builtin_types")||(Object.defineProperty(n.ready,"___embind_register_native_and_builtin_types",{configurable:!0,get(){p("You are getting ___embind_register_native_and_builtin_types on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"___embind_register_native_and_builtin_types",{configurable:!0,set(){p("You are setting ___embind_register_native_and_builtin_types on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(n.ready,"onRuntimeInitialized")||(Object.defineProperty(n.ready,"onRuntimeInitialized",{configurable:!0,get(){p("You are getting onRuntimeInitialized on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(n.ready,"onRuntimeInitialized",{configurable:!0,set(){p("You are setting onRuntimeInitialized on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}));let Ue={},we;for(we in n)n.hasOwnProperty(we)&&(Ue[we]=n[we]);let ot=[],ht="./this.program",$e=function(e,t){throw t},Ye=typeof window=="object",Ve=typeof importScripts=="function",It=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",bi=!Ye&&!It&&!Ve;if(n.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)");let Te="";function Oi(e){return n.locateFile?n.locateFile(e,Te):Te+e}let Rr,er,nn,In,Ke,ge;if(Ye||Ve){if(Ve?Te=self.location.href:typeof document!="undefined"&&document.currentScript&&(Te=document.currentScript.src),K&&(Te=K),Te.indexOf("blob:")!==0?Te=Te.substr(0,Te.lastIndexOf("/")+1):Te="",!(typeof window=="object"||typeof importScripts=="function"))throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");Rr=function(e){let t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},Ve&&(nn=function(e){let t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),er=function(e,t,r){let o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="arraybuffer",o.onload=function(){if(o.status==200||o.status==0&&o.response){t(o.response);return}r()},o.onerror=r,o.send(null)},In=function(e){document.title=e}}else throw new Error("environment detection error");let Re=n.print||console.log.bind(console),pe=n.printErr||console.warn.bind(console);for(we in Ue)Ue.hasOwnProperty(we)&&(n[we]=Ue[we]);Ue=null,n.arguments&&(ot=n.arguments),Object.getOwnPropertyDescriptor(n,"arguments")||Object.defineProperty(n,"arguments",{configurable:!0,get(){p("Module.arguments has been replaced with plain arguments_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),n.thisProgram&&(ht=n.thisProgram),Object.getOwnPropertyDescriptor(n,"thisProgram")||Object.defineProperty(n,"thisProgram",{configurable:!0,get(){p("Module.thisProgram has been replaced with plain thisProgram (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),n.quit&&($e=n.quit),Object.getOwnPropertyDescriptor(n,"quit")||Object.defineProperty(n,"quit",{configurable:!0,get(){p("Module.quit has been replaced with plain quit_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),z(typeof n.memoryInitializerPrefixURL=="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),z(typeof n.pthreadMainPrefixURL=="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),z(typeof n.cdInitializerPrefixURL=="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),z(typeof n.filePackagePrefixURL=="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),z(typeof n.read=="undefined","Module.read option was removed (modify read_ in JS)"),z(typeof n.readAsync=="undefined","Module.readAsync option was removed (modify readAsync in JS)"),z(typeof n.readBinary=="undefined","Module.readBinary option was removed (modify readBinary in JS)"),z(typeof n.setWindowTitle=="undefined","Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),z(typeof n.TOTAL_MEMORY=="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),Object.getOwnPropertyDescriptor(n,"read")||Object.defineProperty(n,"read",{configurable:!0,get(){p("Module.read has been replaced with plain read_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(n,"readAsync")||Object.defineProperty(n,"readAsync",{configurable:!0,get(){p("Module.readAsync has been replaced with plain readAsync (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(n,"readBinary")||Object.defineProperty(n,"readBinary",{configurable:!0,get(){p("Module.readBinary has been replaced with plain readBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(n,"setWindowTitle")||Object.defineProperty(n,"setWindowTitle",{configurable:!0,get(){p("Module.setWindowTitle has been replaced with plain setWindowTitle (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),z(!bi,"shell environment detected but not enabled at build time. Add 'shell' to `-s ENVIRONMENT` to enable.");function tt(e){tt.shown||(tt.shown={}),tt.shown[e]||(tt.shown[e]=1,pe(e))}function Ir(e,t){if(typeof WebAssembly.Function=="function"){let I={i:"i32",j:"i64",f:"f32",d:"f64"},m={parameters:[],results:t[0]=="v"?[]:[I[t[0]]]};for(var r=1;r<t.length;++r)m.parameters.push(I[t[r]]);return new WebAssembly.Function(m,e)}let o=[1,0,1,96],a=t.slice(0,1),s=t.slice(1),A={i:127,j:126,f:125,d:124};o.push(s.length);for(var r=0;r<s.length;++r)o.push(A[s[r]]);a=="v"?o.push(0):o=o.concat([1,A[a]]),o[1]=o.length-2;let c=new Uint8Array([0,97,115,109,1,0,0,0].concat(o,[2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0])),u=new WebAssembly.Module(c);return new WebAssembly.Instance(u,{e:{f:e}}).exports.f}let Ut=[],Xe;function mr(){if(Ut.length)return Ut.pop();try{V.grow(1)}catch(e){throw e instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":e}return V.length-1}function mt(e,t){if(!Xe){Xe=new WeakMap;for(let o=0;o<V.length;o++){let a=V.get(o);a&&Xe.set(a,o)}}if(Xe.has(e))return Xe.get(e);let r=mr();try{V.set(r,e)}catch(o){if(!(o instanceof TypeError))throw o;z(typeof t!="undefined",`Missing signature argument to addFunction: ${e}`);let a=Ir(e,t);V.set(r,a)}return Xe.set(e,r),r}let Cr=0,he=function(e){Cr=e},Hn=function(){return Cr},xt;n.wasmBinary&&(xt=n.wasmBinary),Object.getOwnPropertyDescriptor(n,"wasmBinary")||Object.defineProperty(n,"wasmBinary",{configurable:!0,get(){p("Module.wasmBinary has been replaced with plain wasmBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}});let jt=n.noExitRuntime||!0;Object.getOwnPropertyDescriptor(n,"noExitRuntime")||Object.defineProperty(n,"noExitRuntime",{configurable:!0,get(){p("Module.noExitRuntime has been replaced with plain noExitRuntime (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),typeof WebAssembly!="object"&&p("no native wasm support detected");let Pt,W=!1,Sr;function z(e,t){e||p(`Assertion failed: ${t}`)}function lo(e){let t=n[`_${e}`];return z(t,`Cannot call unknown function ${e}, make sure it is exported`),t}function Bi(e,t,r,o,a){let s={string(m){let y=0;if(m!=null&&m!==0){let v=(m.length<<2)+1;y=so(v),tr(m,y,v)}return y},array(m){let y=so(m.length);return Xn(m,y),y}};function A(m){return t==="string"?Je(m):t==="boolean"?!!m:m}let c=lo(e),u=[],d=0;if(z(t!=="array",'Return type should not be "array".'),o)for(let m=0;m<o.length;m++){let y=s[r[m]];y?(d===0&&(d=j()),u[m]=y(o[m])):u[m]=o[m]}let h=c.apply(null,u);function I(m){return d!==0&&te(d),A(m)}return h=I(h),h}let Mr=1,at=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;function Rt(e,t,r){let o=t+r,a=t;for(;e[a]&&!(a>=o);)++a;if(a-t>16&&e.subarray&&at)return at.decode(e.subarray(t,a));let s="";for(;t<a;){let A=e[t++];if(!(A&128)){s+=String.fromCharCode(A);continue}let c=e[t++]&63;if((A&224)==192){s+=String.fromCharCode((A&31)<<6|c);continue}let u=e[t++]&63;if((A&240)==224?A=(A&15)<<12|c<<6|u:((A&248)!=240&&tt(`Invalid UTF-8 leading byte 0x${A.toString(16)} encountered when deserializing a UTF-8 string in wasm memory to a JS string!`),A=(A&7)<<18|c<<12|u<<6|e[t++]&63),A<65536)s+=String.fromCharCode(A);else{let d=A-65536;s+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return s}function Je(e,t){return e?Rt(ve,e,t):""}function Ze(e,t,r,o){if(!(o>0))return 0;let a=r,s=r+o-1;for(let A=0;A<e.length;++A){let c=e.charCodeAt(A);if(c>=55296&&c<=57343){let u=e.charCodeAt(++A);c=65536+((c&1023)<<10)|u&1023}if(c<=127){if(r>=s)break;t[r++]=c}else if(c<=2047){if(r+1>=s)break;t[r++]=192|c>>6,t[r++]=128|c&63}else if(c<=65535){if(r+2>=s)break;t[r++]=224|c>>12,t[r++]=128|c>>6&63,t[r++]=128|c&63}else{if(r+3>=s)break;c>=2097152&&tt(`Invalid Unicode code point 0x${c.toString(16)} encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x1FFFFF).`),t[r++]=240|c>>18,t[r++]=128|c>>12&63,t[r++]=128|c>>6&63,t[r++]=128|c&63}}return t[r]=0,r-a}function tr(e,t,r){return z(typeof r=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),Ze(e,ve,t,r)}function bt(e){let t=0;for(let r=0;r<e.length;++r){let o=e.charCodeAt(r);o>=55296&&o<=57343&&(o=65536+((o&1023)<<10)|e.charCodeAt(++r)&1023),o<=127?++t:o<=2047?t+=2:o<=65535?t+=3:t+=4}return t}let Gn=typeof TextDecoder!="undefined"?new TextDecoder("utf-16le"):void 0;function Ti(e,t){z(e%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");let r=e,o=r>>1,a=o+t/2;for(;!(o>=a)&&Oe[o];)++o;if(r=o<<1,r-e>32&&Gn)return Gn.decode(ve.subarray(e,r));let s="";for(let A=0;!(A>=t/2);++A){let c=T[e+A*2>>1];if(c==0)break;s+=String.fromCharCode(c)}return s}function mn(e,t,r){if(z(t%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),z(typeof r=="number","stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),r===void 0&&(r=2147483647),r<2)return 0;r-=2;let o=t,a=r<e.length*2?r/2:e.length;for(let s=0;s<a;++s){let A=e.charCodeAt(s);T[t>>1]=A,t+=2}return T[t>>1]=0,t-o}function Yn(e){return e.length*2}function vi(e,t){z(e%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");let r=0,o="";for(;!(r>=t/4);){let a=b[e+r*4>>2];if(a==0)break;if(++r,a>=65536){let s=a-65536;o+=String.fromCharCode(55296|s>>10,56320|s&1023)}else o+=String.fromCharCode(a)}return o}function Cn(e,t,r){if(z(t%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),z(typeof r=="number","stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),r===void 0&&(r=2147483647),r<4)return 0;let o=t,a=o+r-4;for(let s=0;s<e.length;++s){let A=e.charCodeAt(s);if(A>=55296&&A<=57343){let c=e.charCodeAt(++s);A=65536+((A&1023)<<10)|c&1023}if(b[t>>2]=A,t+=4,t+4>a)break}return b[t>>2]=0,t-o}function Fr(e){let t=0;for(let r=0;r<e.length;++r){let o=e.charCodeAt(r);o>=55296&&o<=57343&&++r,t+=4}return t}function yn(e){let t=bt(e)+1,r=tn(t);return r&&Ze(e,be,r,t),r}function Xn(e,t){z(e.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),be.set(e,t)}function kr(e,t,r){for(let o=0;o<e.length;++o)z(e.charCodeAt(o)===e.charCodeAt(o)&255),be[t++>>0]=e.charCodeAt(o);r||(be[t>>0]=0)}function xe(e,t){return e%t>0&&(e+=t-e%t),e}let Se,be,ve,T,Oe,b,Qe,ze,Nr;function on(e){Se=e,n.HEAP8=be=new Int8Array(e),n.HEAP16=T=new Int16Array(e),n.HEAP32=b=new Int32Array(e),n.HEAPU8=ve=new Uint8Array(e),n.HEAPU16=Oe=new Uint16Array(e),n.HEAPU32=Qe=new Uint32Array(e),n.HEAPF32=ze=new Float32Array(e),n.HEAPF64=Nr=new Float64Array(e)}let J=5242880;n.TOTAL_STACK&&z(J===n.TOTAL_STACK,"the stack size can no longer be determined at runtime");let Ur=n.INITIAL_MEMORY||16777216;Object.getOwnPropertyDescriptor(n,"INITIAL_MEMORY")||Object.defineProperty(n,"INITIAL_MEMORY",{configurable:!0,get(){p("Module.INITIAL_MEMORY has been replaced with plain INITIAL_MEMORY (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),z(Ur>=J,`INITIAL_MEMORY should be larger than TOTAL_STACK, was ${Ur}! (TOTAL_STACK=${J})`),z(typeof Int32Array!="undefined"&&typeof Float64Array!="undefined"&&Int32Array.prototype.subarray!==void 0&&Int32Array.prototype.set!==void 0,"JS engine does not provide full typed array support"),z(!n.wasmMemory,"Use of `wasmMemory` detected. Use -s IMPORTED_MEMORY to define wasmMemory externally"),z(Ur==16777216,"Detected runtime INITIAL_MEMORY setting. Use -s IMPORTED_MEMORY to define wasmMemory dynamically");let V;function Lt(){let e=rn();z((e&3)==0),Qe[(e>>2)+1]=34821223,Qe[(e>>2)+2]=2310721022,b[0]=1668509029}function st(){if(W)return;let e=rn(),t=Qe[(e>>2)+1],r=Qe[(e>>2)+2];(t!=34821223||r!=2310721022)&&p(`Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x${r.toString(16)} ${t.toString(16)}`),b[0]!==1668509029&&p("Runtime error: The application has corrupted its heap memory area (address zero)!")}(function(){let e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,t[0]!==115||t[1]!==99)throw"Runtime error: expected the system to be little-endian! (Run with -s SUPPORT_BIG_ENDIAN=1 to bypass)"})();let xr=[],Ht=[],de=[],an=[],yr=!1,Ot=!1,Qi=0;function Ct(){return jt||Qi>0}function Gt(){if(n.preRun)for(typeof n.preRun=="function"&&(n.preRun=[n.preRun]);n.preRun.length;)Dn(n.preRun.shift());Tn(xr)}function Pi(){st(),z(!yr),yr=!0,!n.noFSInit&&!l.init.initialized&&l.init(),l.ignorePermissions=!1,yt.init(),Tn(Ht)}function Ri(){st(),Ot=!0}function wn(){if(st(),n.postRun)for(typeof n.postRun=="function"&&(n.postRun=[n.postRun]);n.postRun.length;)rr(n.postRun.shift());Tn(an)}function Dn(e){xr.unshift(e)}function Yt(e){Ht.unshift(e)}function rr(e){an.unshift(e)}z(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),z(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),z(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),z(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");let lt=0,At=null,nr=null,St={};function wr(e){let t=e;for(;;){if(!St[e])return e;e=t+Math.random()}}function E(e){lt++,n.monitorRunDependencies&&n.monitorRunDependencies(lt),e?(z(!St[e]),St[e]=1,At===null&&typeof setInterval!="undefined"&&(At=setInterval(()=>{if(W){clearInterval(At),At=null;return}let t=!1;for(let r in St)t||(t=!0,pe("still waiting on run dependencies:")),pe(`dependency: ${r}`);t&&pe("(end of list)")},1e4))):pe("warning: run dependency added without ID")}function ir(e){if(lt--,n.monitorRunDependencies&&n.monitorRunDependencies(lt),e?(z(St[e]),delete St[e]):pe("warning: run dependency removed without ID"),lt==0&&(At!==null&&(clearInterval(At),At=null),nr)){let t=nr;nr=null,t()}}n.preloadedImages={},n.preloadedAudios={};function p(e){n.onAbort&&n.onAbort(e),e+="",pe(e),W=!0,Sr=1,e=`abort(${e}) at ${Fi()}`;let r=new WebAssembly.RuntimeError(e);throw N(r),r}let bn="data:application/octet-stream;base64,";function le(e){return e.startsWith(bn)}function He(e){return e.startsWith("file://")}function ce(e,t){return function(){let r=e,o=t;return t||(o=n.asm),z(yr,`native function \`${r}\` called before runtime initialization`),z(!Ot,`native function \`${r}\` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)`),o[e]||z(o[e],`exported native function \`${r}\` not found`),o[e].apply(null,arguments)}}let Dr;Dr="selfie_segmentation_solution_simd_wasm_bin.wasm",le(Dr)||(Dr=Oi(Dr));function On(e){try{if(e==Dr&&xt)return new Uint8Array(xt);if(nn)return nn(e);throw"both async and sync fetching of the wasm failed"}catch(t){p(t)}}function We(){let e={env:rA,wasi_snapshot_preview1:rA};function t(a,s){let{exports:A}=a;n.asm=A,Pt=n.asm.memory,z(Pt,"memory not found in wasm exports"),on(Pt.buffer),V=n.asm.__indirect_function_table,z(V,"table not found in wasm exports"),Yt(n.asm.__wasm_call_ctors),ir("wasm-instantiate")}E("wasm-instantiate");let r=n;function o(a){z(n===r,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),r=null,t(a)}if(n.instantiateWasm)try{return n.instantiateWasm(e,t)}catch(a){return pe(`Module.instantiateWasm callback failed with error: ${a}`),!1}return n.loadWasm(Dr,e).then(o).catch(N),{}}let ye,Bt,jr={460656(){let e=!0;if(e){let t=to;if(typeof t!="function"){typeof console!="undefined"&&console.error('Expected Emscripten global function "findCanvasEventTarget" not found. WebGL context creation may fail.');return}to=function(r){if(r==0){if(n&&n.canvas)return n.canvas;if(n&&n.canvasCssSelector)return t(n.canvasCssSelector);typeof console!="undefined"&&console.warn("Module properties canvas and canvasCssSelector not found during WebGL context creation.")}return t(r)},e=!1}},461441(){return typeof wasmOffsetConverter!="undefined"}};function br(){return typeof wasmOffsetConverter!="undefined"}function Tt(e,t){if(Q.mainLoop.timingMode=e,Q.mainLoop.timingValue=t,!Q.mainLoop.func)return pe("emscripten_set_main_loop_timing: Cannot set timing mode for main loop since a main loop does not exist! Call emscripten_set_main_loop first to set one up."),1;if(Q.mainLoop.running||(Q.mainLoop.running=!0),e==0)Q.mainLoop.scheduler=function(){let o=Math.max(0,Q.mainLoop.tickStartTime+t-Or())|0;setTimeout(Q.mainLoop.runner,o)},Q.mainLoop.method="timeout";else if(e==1)Q.mainLoop.scheduler=function(){Q.requestAnimationFrame(Q.mainLoop.runner)},Q.mainLoop.method="rAF";else if(e==2){if(typeof setImmediate=="undefined"){let r=[],o="setimmediate",a=function(s){(s.data===o||s.data.target===o)&&(s.stopPropagation(),r.shift()())};addEventListener("message",a,!0),setImmediate=function(A){r.push(A),Ve?(n.setImmediates===void 0&&(n.setImmediates=[]),n.setImmediates.push(A),postMessage({target:o})):postMessage(o,"*")}}Q.mainLoop.scheduler=function(){setImmediate(Q.mainLoop.runner)},Q.mainLoop.method="immediate"}return 0}let Or;It?Or=function(){let e=process.hrtime();return e[0]*1e3+e[1]/1e6}:Or=function(){return performance.now()};function Si(){return!w.currentContext||!w.currentContext.GLctx?-3:w.currentContext.defaultFbo?(w.blitOffscreenFramebuffer(w.currentContext),0):w.currentContext.attributes.explicitSwapControl?0:-3}function Wn(e){No(e)}function Mi(){if(!Ct())try{Wn(Sr)}catch(e){if(e instanceof Ao)return;throw e}}function Bn(e,t,r,o,a){z(!Q.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."),Q.mainLoop.func=e,Q.mainLoop.arg=o;let s=Q.mainLoop.currentlyRunningMainloop;function A(){return s<Q.mainLoop.currentlyRunningMainloop?(Mi(),!1):!0}if(Q.mainLoop.running=!1,Q.mainLoop.runner=function(){if(!W){if(Q.mainLoop.queue.length>0){let u=Date.now(),d=Q.mainLoop.queue.shift();if(d.func(d.arg),Q.mainLoop.remainingBlockers){let h=Q.mainLoop.remainingBlockers,I=h%1==0?h-1:Math.floor(h);d.counted?Q.mainLoop.remainingBlockers=I:(I=I+.5,Q.mainLoop.remainingBlockers=(8*h+I)/9)}if(Re(`main loop blocker "${d.name}" took ${Date.now()-u} ms`),Q.mainLoop.updateStatus(),!A())return;setTimeout(Q.mainLoop.runner,0);return}if(A()){if(Q.mainLoop.currentFrameNumber=Q.mainLoop.currentFrameNumber+1|0,Q.mainLoop.timingMode==1&&Q.mainLoop.timingValue>1&&Q.mainLoop.currentFrameNumber%Q.mainLoop.timingValue!=0){Q.mainLoop.scheduler();return}Q.mainLoop.timingMode==0&&(Q.mainLoop.tickStartTime=Or()),w.newRenderingFrameStarted(),typeof w!="undefined"&&w.currentContext&&!w.currentContextIsProxied&&!w.currentContext.attributes.explicitSwapControl&&w.currentContext.GLctx.commit&&w.currentContext.GLctx.commit(),Q.mainLoop.method==="timeout"&&n.ctx&&(tt("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),Q.mainLoop.method=""),Q.mainLoop.runIter(e),st(),A()&&(typeof SDL=="object"&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),Q.mainLoop.scheduler())}}},a||(t&&t>0?Tt(0,1e3/t):Tt(1,1),Q.mainLoop.scheduler()),r)throw"unwind"}function or(e,t){if(W){pe("user callback triggered after application aborted. Ignoring.");return}if(t){e();return}try{e()}catch(r){if(r instanceof Ao)return;if(r!=="unwind")throw r&&typeof r=="object"&&r.stack&&pe(`exception thrown: ${[r,r.stack]}`),r}}function P(e,t){return setTimeout(()=>{or(e)},t)}var Q={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause(){Q.mainLoop.scheduler=null,Q.mainLoop.currentlyRunningMainloop++},resume(){Q.mainLoop.currentlyRunningMainloop++;let{timingMode:e}=Q.mainLoop,{timingValue:t}=Q.mainLoop,{func:r}=Q.mainLoop;Q.mainLoop.func=null,Bn(r,0,!1,Q.mainLoop.arg,!0),Tt(e,t),Q.mainLoop.scheduler()},updateStatus(){if(n.setStatus){let e=n.statusMessage||"Please wait...",t=Q.mainLoop.remainingBlockers,r=Q.mainLoop.expectedBlockers;t?t<r?n.setStatus(`${e} (${r-t}/${r})`):n.setStatus(e):n.setStatus("")}},runIter(e){W||n.preMainLoop&&n.preMainLoop()===!1||(or(e),n.postMainLoop&&n.postMainLoop())}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init(){if(n.preloadPlugins||(n.preloadPlugins=[]),Q.initted)return;Q.initted=!0;try{new Blob,Q.hasBlobConstructor=!0}catch(a){Q.hasBlobConstructor=!1,Re("warning: no blob constructor, cannot create blobs with mimetypes")}Q.BlobBuilder=typeof MozBlobBuilder!="undefined"?MozBlobBuilder:typeof WebKitBlobBuilder!="undefined"?WebKitBlobBuilder:Q.hasBlobConstructor?null:Re("warning: no BlobBuilder"),Q.URLObject=typeof window!="undefined"?window.URL?window.URL:window.webkitURL:void 0,!n.noImageDecoding&&typeof Q.URLObject=="undefined"&&(Re("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),n.noImageDecoding=!0);let e={};e.canHandle=function(s){return!n.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(s)},e.handle=function(s,A,c,u){let d=null;if(Q.hasBlobConstructor)try{d=new Blob([s],{type:Q.getMimetype(A)}),d.size!==s.length&&(d=new Blob([new Uint8Array(s).buffer],{type:Q.getMimetype(A)}))}catch(m){tt(`Blob constructor present but fails: ${m}; falling back to blob builder`)}if(!d){let m=new Q.BlobBuilder;m.append(new Uint8Array(s).buffer),d=m.getBlob()}let h=Q.URLObject.createObjectURL(d);z(typeof h=="string","createObjectURL must return a url as a string");let I=new Image;I.onload=function(){z(I.complete,`Image ${A} could not be decoded`);let y=document.createElement("canvas");y.width=I.width,y.height=I.height,y.getContext("2d").drawImage(I,0,0),n.preloadedImages[A]=y,Q.URLObject.revokeObjectURL(h),c&&c(s)},I.onerror=function(y){Re(`Image ${h} could not be decoded`),u&&u()},I.src=h},n.preloadPlugins.push(e);let t={};t.canHandle=function(s){return!n.noAudioDecoding&&s.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},t.handle=function(s,A,c,u){let d=!1;function h(y){d||(d=!0,n.preloadedAudios[A]=y,c&&c(s))}function I(){d||(d=!0,n.preloadedAudios[A]=new Audio,u&&u())}if(Q.hasBlobConstructor){try{var m=new Blob([s],{type:Q.getMimetype(A)})}catch(U){return I()}let y=Q.URLObject.createObjectURL(m);z(typeof y=="string","createObjectURL must return a url as a string");let v=new Audio;v.addEventListener("canplaythrough",()=>{h(v)},!1),v.onerror=function(G){if(d)return;Re(`warning: browser could not fully decode audio ${A}, trying slower base64 approach`);function R(D){let k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$="=",Y="",Ce=0,Ne=0;for(let hr=0;hr<D.length;hr++)for(Ce=Ce<<8|D[hr],Ne+=8;Ne>=6;){let hu=Ce>>Ne-6&63;Ne-=6,Y+=k[hu]}return Ne==2?(Y+=k[(Ce&3)<<4],Y+=$+$):Ne==4&&(Y+=k[(Ce&15)<<2],Y+=$),Y}v.src=`data:audio/x-${A.substr(-3)};base64,${R(s)}`,h(v)},v.src=y,P(()=>{h(v)},1e4)}else return I()},n.preloadPlugins.push(t);function r(){Q.pointerLock=document.pointerLockElement===n.canvas||document.mozPointerLockElement===n.canvas||document.webkitPointerLockElement===n.canvas||document.msPointerLockElement===n.canvas}let{canvas:o}=n},createContext(e,t,r,o){if(t&&n.ctx&&e==n.canvas)return n.ctx;let a,s;if(t){let A={antialias:!1,alpha:!1,majorVersion:typeof WebGL2RenderingContext!="undefined"?2:1};if(o)for(let c in o)A[c]=o[c];typeof w!="undefined"&&(s=w.createContext(e,A),s&&(a=w.getContext(s).GLctx))}else a=e.getContext("2d");return a?(r&&(t||z(typeof S=="undefined","cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),n.ctx=a,t&&w.makeContextCurrent(s),n.useWebGL=t,Q.moduleContextCreatedCallbacks.forEach(A=>{A()}),Q.init()),a):null},destroyContext(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen(e,t){Q.lockPointer=e,Q.resizeCanvas=t,typeof Q.lockPointer=="undefined"&&(Q.lockPointer=!0),typeof Q.resizeCanvas=="undefined"&&(Q.resizeCanvas=!1);let{canvas:r}=n;function o(){Q.isFullscreen=!1;let s=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===s?(r.exitFullscreen=Q.exitFullscreen,Q.lockPointer&&r.requestPointerLock(),Q.isFullscreen=!0,Q.resizeCanvas?Q.setFullscreenCanvasSize():Q.updateCanvasDimensions(r)):(s.parentNode.insertBefore(r,s),s.parentNode.removeChild(s),Q.resizeCanvas?Q.setWindowedCanvasSize():Q.updateCanvasDimensions(r)),n.onFullScreen&&n.onFullScreen(Q.isFullscreen),n.onFullscreen&&n.onFullscreen(Q.isFullscreen)}Q.fullscreenHandlersInstalled||(Q.fullscreenHandlersInstalled=!0);let a=document.createElement("div");r.parentNode.insertBefore(a,r),a.appendChild(r),a.requestFullscreen=a.requestFullscreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullscreen?function(){a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(a.webkitRequestFullScreen?function(){a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),a.requestFullscreen()},requestFullScreen(){p("Module.requestFullScreen has been replaced by Module.requestFullscreen (without a capital S)")},exitFullscreen(){return Q.isFullscreen?((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){}).apply(document,[]),!0):!1},nextRAF:0,fakeRequestAnimationFrame(e){let t=Date.now();if(Q.nextRAF===0)Q.nextRAF=t+1e3/60;else for(;t+2>=Q.nextRAF;)Q.nextRAF+=1e3/60;let r=Math.max(Q.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame(e){if(typeof requestAnimationFrame=="function"){requestAnimationFrame(e);return}let t=Q.fakeRequestAnimationFrame;t(e)},safeSetTimeout(e){return P(e)},safeRequestAnimationFrame(e){return Q.requestAnimationFrame(()=>{or(e)})},getMimetype(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(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta(e){let 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(e){if(Q.pointerLock)e.type!="mousemove"&&"mozMovementX"in e?Q.mouseMovementX=Q.mouseMovementY=0:(Q.mouseMovementX=Q.getMovementX(e),Q.mouseMovementY=Q.getMovementY(e)),typeof SDL!="undefined"?(Q.mouseX=SDL.mouseX+Q.mouseMovementX,Q.mouseY=SDL.mouseY+Q.mouseMovementY):(Q.mouseX+=Q.mouseMovementX,Q.mouseY+=Q.mouseMovementY);else{let t=n.canvas.getBoundingClientRect(),r=n.canvas.width,o=n.canvas.height,a=typeof window.scrollX!="undefined"?window.scrollX:window.pageXOffset,s=typeof window.scrollY!="undefined"?window.scrollY:window.pageYOffset;if(z(typeof a!="undefined"&&typeof s!="undefined","Unable to retrieve scroll position, mouse positions likely broken."),e.type==="touchstart"||e.type==="touchend"||e.type==="touchmove"){let{touch:u}=e;if(u===void 0)return;let d=u.pageX-(a+t.left),h=u.pageY-(s+t.top);d=d*(r/t.width),h=h*(o/t.height);let I={x:d,y:h};if(e.type==="touchstart")Q.lastTouches[u.identifier]=I,Q.touches[u.identifier]=I;else if(e.type==="touchend"||e.type==="touchmove"){let m=Q.touches[u.identifier];m||(m=I),Q.lastTouches[u.identifier]=m,Q.touches[u.identifier]=I}return}let A=e.pageX-(a+t.left),c=e.pageY-(s+t.top);A=A*(r/t.width),c=c*(o/t.height),Q.mouseMovementX=A-Q.mouseX,Q.mouseMovementY=c-Q.mouseY,Q.mouseX=A,Q.mouseY=c}},resizeListeners:[],updateResizeListeners(){let{canvas:e}=n;Q.resizeListeners.forEach(t=>{t(e.width,e.height)})},setCanvasSize(e,t,r){let{canvas:o}=n;Q.updateCanvasDimensions(o,e,t),r||Q.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize(){if(typeof SDL!="undefined"){let e=Qe[SDL.screen>>2];e=e|8388608,b[SDL.screen>>2]=e}Q.updateCanvasDimensions(n.canvas),Q.updateResizeListeners()},setWindowedCanvasSize(){if(typeof SDL!="undefined"){let e=Qe[SDL.screen>>2];e=e&-8388609,b[SDL.screen>>2]=e}Q.updateCanvasDimensions(n.canvas),Q.updateResizeListeners()},updateCanvasDimensions(e,t,r){t&&r?(e.widthNative=t,e.heightNative=r):(t=e.widthNative,r=e.heightNative);let o=t,a=r;if(n.forcedAspectRatio&&n.forcedAspectRatio>0&&(o/a<n.forcedAspectRatio?o=Math.round(a*n.forcedAspectRatio):a=Math.round(o/n.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&typeof screen!="undefined"){let s=Math.min(screen.width/o,screen.height/a);o=Math.round(o*s),a=Math.round(a*s)}Q.resizeCanvas?(e.width!=o&&(e.width=o),e.height!=a&&(e.height=a),typeof e.style!="undefined"&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=t&&(e.width=t),e.height!=r&&(e.height=r),typeof e.style!="undefined"&&(o!=t||a!=r?(e.style.setProperty("width",`${o}px`,"important"),e.style.setProperty("height",`${a}px`,"important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))}};function Tn(e){for(;e.length>0;){let t=e.shift();if(typeof t=="function"){t(n);continue}let{func:r}=t;typeof r=="number"?t.arg===void 0?V.get(r)():V.get(r)(t.arg):r(t.arg===void 0?null:t.arg)}}function Lr(e){return tt("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),e}function Vn(e){let t=/\b_Z[\w\d_]+/g;return e.replace(t,r=>{let o=Lr(r);return r===o?r:`${o} [${r}]`})}function sn(){let e=new Error;if(!e.stack){try{throw new Error}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function Fi(){let e=sn();return n.extraStackTrace&&(e+=`
2
2
  ${n.extraStackTrace()}`),Vn(e)}function fo(e){return tn(e+16)+16}function vn(e,t){}function Br(e,t){return void 0}function Mt(e){this.excPtr=e,this.ptr=e-16,this.set_type=function(t){b[this.ptr+4>>2]=t},this.get_type=function(){return b[this.ptr+4>>2]},this.set_destructor=function(t){b[this.ptr+8>>2]=t},this.get_destructor=function(){return b[this.ptr+8>>2]},this.set_refcount=function(t){b[this.ptr>>2]=t},this.set_caught=function(t){t=t?1:0,be[this.ptr+12>>0]=t},this.get_caught=function(){return be[this.ptr+12>>0]!=0},this.set_rethrown=function(t){t=t?1:0,be[this.ptr+13>>0]=t},this.get_rethrown=function(){return be[this.ptr+13>>0]!=0},this.init=function(t,r){this.set_type(t),this.set_destructor(r),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){let t=b[this.ptr>>2];b[this.ptr>>2]=t+1},this.release_ref=function(){let t=b[this.ptr>>2];return b[this.ptr>>2]=t-1,z(t>0),t===1}}function Xt(e){this.free=function(){it(this.ptr),this.ptr=0},this.set_base_ptr=function(t){b[this.ptr>>2]=t},this.get_base_ptr=function(){return b[this.ptr>>2]},this.set_adjusted_ptr=function(t){b[this.ptr+4>>2]=t},this.get_adjusted_ptr_addr=function(){return this.ptr+4},this.get_adjusted_ptr=function(){return b[this.ptr+4>>2]},this.get_exception_ptr=function(){if(iA(this.get_exception_info().get_type()))return b[this.get_base_ptr()>>2];let r=this.get_adjusted_ptr();return r!==0?r:this.get_base_ptr()},this.get_exception_info=function(){return new Mt(this.get_base_ptr())},e===void 0?(this.ptr=tn(8),this.set_adjusted_ptr(0)):this.ptr=e}let Hr=[];function vt(e){e.add_ref()}let Qn=0;function Wt(e){let t=new Xt(e),r=t.get_exception_info();return r.get_caught()||(r.set_caught(!0),Qn--),r.set_rethrown(!1),Hr.push(t),vt(r),t.get_exception_ptr()}let Ft=0;function Tr(e){try{return it(new Mt(e).ptr)}catch(t){pe(`exception during cxa_free_exception: ${t}`)}}function ki(e){if(e.release_ref()&&!e.get_rethrown()){let t=e.get_destructor();t&&V.get(t)(e.excPtr),Tr(e.excPtr)}}function zn(){re(0),z(Hr.length>0);let e=Hr.pop();ki(e.get_exception_info()),e.free(),Ft=0}function Pn(e){let t=new Xt(e),r=t.get_base_ptr();throw Ft||(Ft=r),t.free(),`${r} - Exception catching is disabled, this exception cannot be caught. Compile with -s NO_DISABLE_EXCEPTION_CATCHING or -s EXCEPTION_CATCHING_ALLOWED=[..] to catch.`}function Ni(){let e=Ft;if(!e)return he(0),0;let r=new Mt(e).get_type(),o=new Xt;if(o.set_base_ptr(e),o.set_adjusted_ptr(e),!r)return he(0),o.ptr|0;let a=Array.prototype.slice.call(arguments);for(let s=0;s<a.length;s++){let A=a[s];if(A===0||A===r)break;if(ko(A,r,o.get_adjusted_ptr_addr()))return he(A),o.ptr|0}return he(r),o.ptr|0}function $n(){let e=Ft;if(!e)return he(0),0;let r=new Mt(e).get_type(),o=new Xt;if(o.set_base_ptr(e),o.set_adjusted_ptr(e),!r)return he(0),o.ptr|0;let a=Array.prototype.slice.call(arguments);for(let s=0;s<a.length;s++){let A=a[s];if(A===0||A===r)break;if(ko(A,r,o.get_adjusted_ptr_addr()))return he(A),o.ptr|0}return he(r),o.ptr|0}function Ui(){let e=Hr.pop();e||p("no exception to throw");let t=e.get_exception_info(),r=e.get_base_ptr();throw t.get_rethrown()?e.free():(Hr.push(e),t.set_rethrown(!0),t.set_caught(!1),Qn++),Ft=r,`${r} - Exception catching is disabled, this exception cannot be caught. Compile with -s NO_DISABLE_EXCEPTION_CATCHING or -s EXCEPTION_CATCHING_ALLOWED=[..] to catch.`}function xi(e,t){return void 0}function Kn(e,t,r){throw new Mt(e).init(t,r),Ft=e,Qn++,`${e} - Exception catching is disabled, this exception cannot be caught. Compile with -s NO_DISABLE_EXCEPTION_CATCHING or -s EXCEPTION_CATCHING_ALLOWED=[..] to catch.`}function _e(e){return b[uc()>>2]=e,e}var Ie={splitPath(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray(e,t){let r=0;for(let o=e.length-1;o>=0;o--){let a=e[o];a==="."?e.splice(o,1):a===".."?(e.splice(o,1),r++):r&&(e.splice(o,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize(e){let t=e.charAt(0)==="/",r=e.substr(-1)==="/";return e=Ie.normalizeArray(e.split("/").filter(o=>!!o),!t).join("/"),!e&&!t&&(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname(e){let t=Ie.splitPath(e),r=t[0],o=t[1];return!r&&!o?".":(o&&(o=o.substr(0,o.length-1)),r+o)},basename(e){if(e==="/")return"/";e=Ie.normalize(e),e=e.replace(/\/$/,"");let t=e.lastIndexOf("/");return t===-1?e:e.substr(t+1)},extname(e){return Ie.splitPath(e)[3]},join(){let e=Array.prototype.slice.call(arguments,0);return Ie.normalize(e.join("/"))},join2(e,t){return Ie.normalize(`${e}/${t}`)}};function dt(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){let e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}if(It)try{let e=Ic("crypto");return function(){return e.randomBytes(1)[0]}}catch(e){}return function(){p("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")}}var Pe={resolve(){let e="",t=!1;for(let r=arguments.length-1;r>=-1&&!t;r--){let o=r>=0?arguments[r]:l.cwd();if(typeof o!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";e=`${o}/${e}`,t=o.charAt(0)==="/"}return e=Ie.normalizeArray(e.split("/").filter(r=>!!r),!t).join("/"),(t?"/":"")+e||"."},relative(e,t){e=Pe.resolve(e).substr(1),t=Pe.resolve(t).substr(1);function r(d){let h=0;for(;h<d.length&&d[h]==="";h++);let I=d.length-1;for(;I>=0&&d[I]==="";I--);return h>I?[]:d.slice(h,I-h+1)}let o=r(e.split("/")),a=r(t.split("/")),s=Math.min(o.length,a.length),A=s;for(var c=0;c<s;c++)if(o[c]!==a[c]){A=c;break}let u=[];for(var c=A;c<o.length;c++)u.push("..");return u=u.concat(a.slice(A)),u.join("/")}},yt={ttys:[],init(){},shutdown(){},register(e,t){yt.ttys[e]={input:[],output:[],ops:t},l.registerDevice(e,yt.stream_ops)},stream_ops:{open(e){let t=yt.ttys[e.node.rdev];if(!t)throw new l.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.flush(e.tty)},flush(e){e.tty.ops.flush(e.tty)},read(e,t,r,o,a){if(!e.tty||!e.tty.ops.get_char)throw new l.ErrnoError(60);let s=0;for(let c=0;c<o;c++){var A;try{A=e.tty.ops.get_char(e.tty)}catch(u){throw new l.ErrnoError(29)}if(A===void 0&&s===0)throw new l.ErrnoError(6);if(A==null)break;s++,t[r+c]=A}return s&&(e.node.timestamp=Date.now()),s},write(e,t,r,o,a){if(!e.tty||!e.tty.ops.put_char)throw new l.ErrnoError(60);try{for(var s=0;s<o;s++)e.tty.ops.put_char(e.tty,t[r+s])}catch(A){throw new l.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),s}},default_tty_ops:{get_char(e){if(!e.input.length){let t=null;if(It){let o=Buffer.alloc(256),a=0;try{a=Ke.readSync(process.stdin.fd,o,0,256,null)}catch(s){if(s.toString().includes("EOF"))a=0;else throw s}a>0?t=o.slice(0,a).toString("utf-8"):t=null}else typeof window!="undefined"&&typeof window.prompt=="function"?(t=window.prompt("Input: "),t!==null&&(t+=`
3
3
  `)):typeof readline=="function"&&(t=readline(),t!==null&&(t+=`
4
4
  `));if(!t)return null;e.input=yi(t,!0)}return e.input.shift()},put_char(e,t){t===null||t===10?(Re(Rt(e.output,0)),e.output=[]):t!=0&&e.output.push(t)},flush(e){e.output&&e.output.length>0&&(Re(Rt(e.output,0)),e.output=[])}},default_tty1_ops:{put_char(e,t){t===null||t===10?(pe(Rt(e.output,0)),e.output=[]):t!=0&&e.output.push(t)},flush(e){e.output&&e.output.length>0&&(pe(Rt(e.output,0)),e.output=[])}}};function ji(e,t){ve.fill(0,e,e+t)}function Jn(e,t){return z(t,"alignment argument is required"),Math.ceil(e/t)*t}function ie(e){e=Jn(e,65536);let t=gc(65536,e);return t?(ji(t,e),t):0}var se={ops_table:null,mount(e){return se.createNode(null,"/",16895,0)},createNode(e,t,r,o){if(l.isBlkdev(r)||l.isFIFO(r))throw new l.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:l.chrdev_stream_ops}});let a=l.createNode(e,t,r,o);return l.isDir(a.mode)?(a.node_ops=se.ops_table.dir.node,a.stream_ops=se.ops_table.dir.stream,a.contents={}):l.isFile(a.mode)?(a.node_ops=se.ops_table.file.node,a.stream_ops=se.ops_table.file.stream,a.usedBytes=0,a.contents=null):l.isLink(a.mode)?(a.node_ops=se.ops_table.link.node,a.stream_ops=se.ops_table.link.stream):l.isChrdev(a.mode)&&(a.node_ops=se.ops_table.chrdev.node,a.stream_ops=se.ops_table.chrdev.stream),a.timestamp=Date.now(),e&&(e.contents[t]=a,e.timestamp=a.timestamp),a},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage(e,t){let r=e.contents?e.contents.length:0;if(r>=t)return;let o=1024*1024;t=Math.max(t,r*(r<o?2:1.125)>>>0),r!=0&&(t=Math.max(t,256));let a=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(a.subarray(0,e.usedBytes),0)},resizeFileStorage(e,t){if(e.usedBytes!=t)if(t==0)e.contents=null,e.usedBytes=0;else{let r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){let t={};return t.dev=l.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,l.isDir(e.mode)?t.size=4096:l.isFile(e.mode)?t.size=e.usedBytes:l.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){t.mode!==void 0&&(e.mode=t.mode),t.timestamp!==void 0&&(e.timestamp=t.timestamp),t.size!==void 0&&se.resizeFileStorage(e,t.size)},lookup(e,t){throw l.genericErrors[44]},mknod(e,t,r,o){return se.createNode(e,t,r,o)},rename(e,t,r){if(l.isDir(e.mode)){let o;try{o=l.lookupNode(t,r)}catch(a){}if(o)for(let a in o.contents)throw new l.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){let r=l.lookupNode(e,t);for(let o in r.contents)throw new l.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){let t=[".",".."];for(let r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink(e,t,r){let o=se.createNode(e,t,41471,0);return o.link=r,o},readlink(e){if(!l.isLink(e.mode))throw new l.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,o,a){let{contents:s}=e.node;if(a>=e.node.usedBytes)return 0;let A=Math.min(e.node.usedBytes-a,o);if(z(A>=0),A>8&&s.subarray)t.set(s.subarray(a,a+A),r);else for(let c=0;c<A;c++)t[r+c]=s[a+c];return A},write(e,t,r,o,a,s){if(z(!(t instanceof ArrayBuffer)),t.buffer===be.buffer&&(s=!1),!o)return 0;let{node:A}=e;if(A.timestamp=Date.now(),t.subarray&&(!A.contents||A.contents.subarray)){if(s)return z(a===0,"canOwn must imply no weird position inside the file"),A.contents=t.subarray(r,r+o),A.usedBytes=o,o;if(A.usedBytes===0&&a===0)return A.contents=t.slice(r,r+o),A.usedBytes=o,o;if(a+o<=A.usedBytes)return A.contents.set(t.subarray(r,r+o),a),o}if(se.expandFileStorage(A,a+o),A.contents.subarray&&t.subarray)A.contents.set(t.subarray(r,r+o),a);else for(let c=0;c<o;c++)A.contents[a+c]=t[r+c];return A.usedBytes=Math.max(A.usedBytes,a+o),o},llseek(e,t,r){let o=t;if(r===1?o+=e.position:r===2&&l.isFile(e.node.mode)&&(o+=e.node.usedBytes),o<0)throw new l.ErrnoError(28);return o},allocate(e,t,r){se.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap(e,t,r,o,a,s){if(t!==0)throw new l.ErrnoError(28);if(!l.isFile(e.node.mode))throw new l.ErrnoError(43);let A,c,{contents:u}=e.node;if(!(s&2)&&u.buffer===Se)c=!1,A=u.byteOffset;else{if((o>0||o+r<u.length)&&(u.subarray?u=u.subarray(o,o+r):u=Array.prototype.slice.call(u,o,o+r)),c=!0,A=ie(r),!A)throw new l.ErrnoError(48);be.set(u,A)}return{ptr:A,allocated:c}},msync(e,t,r,o,a){if(!l.isFile(e.node.mode))throw new l.ErrnoError(43);if(a&2)return 0;let s=se.stream_ops.write(e,t,0,o,r,!1);return 0}}};function Li(e,t,r,o){let a=o?"":wr(`al ${e}`);er(e,s=>{z(s,`Loading data file "${e}" failed (no arrayBuffer).`),t(new Uint8Array(s)),a&&ir(a)},s=>{if(r)r();else throw`Loading data file "${e}" failed.`}),a&&E(a)}let An={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"},f={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var l={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,t){if(e=Pe.resolve(l.cwd(),e),t=t||{},!e)return{path:"",node:null};let r={follow_mount:!0,recurse_count:0};for(let A in r)t[A]===void 0&&(t[A]=r[A]);if(t.recurse_count>8)throw new l.ErrnoError(32);let o=Ie.normalizeArray(e.split("/").filter(A=>!!A),!1),a=l.root,s="/";for(let A=0;A<o.length;A++){let c=A===o.length-1;if(c&&t.parent)break;if(a=l.lookupNode(a,o[A]),s=Ie.join2(s,o[A]),l.isMountpoint(a)&&(!c||c&&t.follow_mount)&&(a=a.mounted.root),!c||t.follow){let u=0;for(;l.isLink(a.mode);){let d=l.readlink(s);if(s=Pe.resolve(Ie.dirname(s),d),a=l.lookupPath(s,{recurse_count:t.recurse_count}).node,u++>40)throw new l.ErrnoError(32)}}}return{path:s,node:a}},getPath(e){let t;for(;;){if(l.isRoot(e)){let 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){let r=0;for(let o=0;o<t.length;o++)r=(r<<5)-r+t.charCodeAt(o)|0;return(e+r>>>0)%l.nameTable.length},hashAddNode(e){let t=l.hashName(e.parent.id,e.name);e.name_next=l.nameTable[t],l.nameTable[t]=e},hashRemoveNode(e){let t=l.hashName(e.parent.id,e.name);if(l.nameTable[t]===e)l.nameTable[t]=e.name_next;else{let r=l.nameTable[t];for(;r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}}},lookupNode(e,t){let r=l.mayLookup(e);if(r)throw new l.ErrnoError(r,e);let o=l.hashName(e.id,t);for(let a=l.nameTable[o];a;a=a.name_next){let s=a.name;if(a.parent.id===e.id&&s===t)return a}return l.lookup(e,t)},createNode(e,t,r,o){z(typeof e=="object");let a=new l.FSNode(e,t,r,o);return l.hashAddNode(a),a},destroyNode(e){l.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags(e){let t=l.flagModes[e];if(typeof t=="undefined")throw new Error(`Unknown file open mode: ${e}`);return t},flagsToPermissionString(e){let t=["r","w","rw"][e&3];return e&512&&(t+="w"),t},nodePermissions(e,t){return l.ignorePermissions?0:t.includes("r")&&!(e.mode&292)||t.includes("w")&&!(e.mode&146)||t.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){let t=l.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{let r=l.lookupNode(e,t);return 20}catch(r){}return l.nodePermissions(e,"wx")},mayDelete(e,t,r){let o;try{o=l.lookupNode(e,t)}catch(s){return s.errno}let a=l.nodePermissions(e,"wx");if(a)return a;if(r){if(!l.isDir(o.mode))return 54;if(l.isRoot(o)||l.getPath(o)===l.cwd())return 10}else if(l.isDir(o.mode))return 31;return 0},mayOpen(e,t){return e?l.isLink(e.mode)?32:l.isDir(e.mode)&&(l.flagsToPermissionString(t)!=="r"||t&512)?31:l.nodePermissions(e,l.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd(e,t){e=e||0,t=t||l.MAX_OPEN_FDS;for(let r=e;r<=t;r++)if(!l.streams[r])return r;throw new l.ErrnoError(33)},getStream(e){return l.streams[e]},createStream(e,t,r){l.FSStream||(l.FSStream=function(){},l.FSStream.prototype={object:{get(){return this.node},set(s){this.node=s}},isRead:{get(){return(this.flags&2097155)!==1}},isWrite:{get(){return(this.flags&2097155)!==0}},isAppend:{get(){return this.flags&1024}}});let o=new l.FSStream;for(let s in e)o[s]=e[s];e=o;let a=l.nextfd(t,r);return e.fd=a,l.streams[a]=e,e},closeStream(e){l.streams[e]=null},chrdev_stream_ops:{open(e){let t=l.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new l.ErrnoError(70)}},major(e){return e>>8},minor(e){return e&255},makedev(e,t){return e<<8|t},registerDevice(e,t){l.devices[e]={stream_ops:t}},getDevice(e){return l.devices[e]},getMounts(e){let t=[],r=[e];for(;r.length;){let o=r.pop();t.push(o),r.push.apply(r,o.mounts)}return t},syncfs(e,t){typeof e=="function"&&(t=e,e=!1),l.syncFSRequests++,l.syncFSRequests>1&&pe(`warning: ${l.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);let r=l.getMounts(l.root.mount),o=0;function a(A){return z(l.syncFSRequests>0),l.syncFSRequests--,t(A)}function s(A){if(A)return s.errored?void 0:(s.errored=!0,a(A));++o>=r.length&&a(null)}r.forEach(A=>{if(!A.type.syncfs)return s(null);A.type.syncfs(A,e,s)})},mount(e,t,r){if(typeof e=="string")throw e;let o=r==="/",a=!r,s;if(o&&l.root)throw new l.ErrnoError(10);if(!o&&!a){let u=l.lookupPath(r,{follow_mount:!1});if(r=u.path,s=u.node,l.isMountpoint(s))throw new l.ErrnoError(10);if(!l.isDir(s.mode))throw new l.ErrnoError(54)}let A={type:e,opts:t,mountpoint:r,mounts:[]},c=e.mount(A);return c.mount=A,A.root=c,o?l.root=c:s&&(s.mounted=A,s.mount&&s.mount.mounts.push(A)),c},unmount(e){let t=l.lookupPath(e,{follow_mount:!1});if(!l.isMountpoint(t.node))throw new l.ErrnoError(28);let{node:r}=t,o=r.mounted,a=l.getMounts(o);Object.keys(l.nameTable).forEach(A=>{let c=l.nameTable[A];for(;c;){let u=c.name_next;a.includes(c.mount)&&l.destroyNode(c),c=u}}),r.mounted=null;let s=r.mount.mounts.indexOf(o);z(s!==-1),r.mount.mounts.splice(s,1)},lookup(e,t){return e.node_ops.lookup(e,t)},mknod(e,t,r){let a=l.lookupPath(e,{parent:!0}).node,s=Ie.basename(e);if(!s||s==="."||s==="..")throw new l.ErrnoError(28);let A=l.mayCreate(a,s);if(A)throw new l.ErrnoError(A);if(!a.node_ops.mknod)throw new l.ErrnoError(63);return a.node_ops.mknod(a,s,t,r)},create(e,t){return t=t!==void 0?t:438,t&=4095,t|=32768,l.mknod(e,t,0)},mkdir(e,t){return t=t!==void 0?t:511,t&=1023,t|=16384,l.mknod(e,t,0)},mkdirTree(e,t){let r=e.split("/"),o="";for(let a=0;a<r.length;++a)if(r[a]){o+=`/${r[a]}`;try{l.mkdir(o,t)}catch(s){if(s.errno!=20)throw s}}},mkdev(e,t,r){return typeof r=="undefined"&&(r=t,t=438),t|=8192,l.mknod(e,t,r)},symlink(e,t){if(!Pe.resolve(e))throw new l.ErrnoError(44);let o=l.lookupPath(t,{parent:!0}).node;if(!o)throw new l.ErrnoError(44);let a=Ie.basename(t),s=l.mayCreate(o,a);if(s)throw new l.ErrnoError(s);if(!o.node_ops.symlink)throw new l.ErrnoError(63);return o.node_ops.symlink(o,a,e)},rename(e,t){let r=Ie.dirname(e),o=Ie.dirname(t),a=Ie.basename(e),s=Ie.basename(t),A,c,u;if(A=l.lookupPath(e,{parent:!0}),c=A.node,A=l.lookupPath(t,{parent:!0}),u=A.node,!c||!u)throw new l.ErrnoError(44);if(c.mount!==u.mount)throw new l.ErrnoError(75);let d=l.lookupNode(c,a),h=Pe.relative(e,o);if(h.charAt(0)!==".")throw new l.ErrnoError(28);if(h=Pe.relative(t,r),h.charAt(0)!==".")throw new l.ErrnoError(55);let I;try{I=l.lookupNode(u,s)}catch(v){}if(d===I)return;let m=l.isDir(d.mode),y=l.mayDelete(c,a,m);if(y)throw new l.ErrnoError(y);if(y=I?l.mayDelete(u,s,m):l.mayCreate(u,s),y)throw new l.ErrnoError(y);if(!c.node_ops.rename)throw new l.ErrnoError(63);if(l.isMountpoint(d)||I&&l.isMountpoint(I))throw new l.ErrnoError(10);if(u!==c&&(y=l.nodePermissions(c,"w"),y))throw new l.ErrnoError(y);try{l.trackingDelegate.willMovePath&&l.trackingDelegate.willMovePath(e,t)}catch(v){pe(`FS.trackingDelegate['willMovePath']('${e}', '${t}') threw an exception: ${v.message}`)}l.hashRemoveNode(d);try{c.node_ops.rename(d,u,s)}catch(v){throw v}finally{l.hashAddNode(d)}try{l.trackingDelegate.onMovePath&&l.trackingDelegate.onMovePath(e,t)}catch(v){pe(`FS.trackingDelegate['onMovePath']('${e}', '${t}') threw an exception: ${v.message}`)}},rmdir(e){let r=l.lookupPath(e,{parent:!0}).node,o=Ie.basename(e),a=l.lookupNode(r,o),s=l.mayDelete(r,o,!0);if(s)throw new l.ErrnoError(s);if(!r.node_ops.rmdir)throw new l.ErrnoError(63);if(l.isMountpoint(a))throw new l.ErrnoError(10);try{l.trackingDelegate.willDeletePath&&l.trackingDelegate.willDeletePath(e)}catch(A){pe(`FS.trackingDelegate['willDeletePath']('${e}') threw an exception: ${A.message}`)}r.node_ops.rmdir(r,o),l.destroyNode(a);try{l.trackingDelegate.onDeletePath&&l.trackingDelegate.onDeletePath(e)}catch(A){pe(`FS.trackingDelegate['onDeletePath']('${e}') threw an exception: ${A.message}`)}},readdir(e){let t=l.lookupPath(e,{follow:!0}),{node:r}=t;if(!r.node_ops.readdir)throw new l.ErrnoError(54);return r.node_ops.readdir(r)},unlink(e){let r=l.lookupPath(e,{parent:!0}).node,o=Ie.basename(e),a=l.lookupNode(r,o),s=l.mayDelete(r,o,!1);if(s)throw new l.ErrnoError(s);if(!r.node_ops.unlink)throw new l.ErrnoError(63);if(l.isMountpoint(a))throw new l.ErrnoError(10);try{l.trackingDelegate.willDeletePath&&l.trackingDelegate.willDeletePath(e)}catch(A){pe(`FS.trackingDelegate['willDeletePath']('${e}') threw an exception: ${A.message}`)}r.node_ops.unlink(r,o),l.destroyNode(a);try{l.trackingDelegate.onDeletePath&&l.trackingDelegate.onDeletePath(e)}catch(A){pe(`FS.trackingDelegate['onDeletePath']('${e}') threw an exception: ${A.message}`)}},readlink(e){let r=l.lookupPath(e).node;if(!r)throw new l.ErrnoError(44);if(!r.node_ops.readlink)throw new l.ErrnoError(28);return Pe.resolve(l.getPath(r.parent),r.node_ops.readlink(r))},stat(e,t){let r=l.lookupPath(e,{follow:!t}),{node:o}=r;if(!o)throw new l.ErrnoError(44);if(!o.node_ops.getattr)throw new l.ErrnoError(63);return o.node_ops.getattr(o)},lstat(e){return l.stat(e,!0)},chmod(e,t,r){let o;if(typeof e=="string"?o=l.lookupPath(e,{follow:!r}).node:o=e,!o.node_ops.setattr)throw new l.ErrnoError(63);o.node_ops.setattr(o,{mode:t&4095|o.mode&-4096,timestamp:Date.now()})},lchmod(e,t){l.chmod(e,t,!0)},fchmod(e,t){let r=l.getStream(e);if(!r)throw new l.ErrnoError(8);l.chmod(r.node,t)},chown(e,t,r,o){let a;if(typeof e=="string"?a=l.lookupPath(e,{follow:!o}).node:a=e,!a.node_ops.setattr)throw new l.ErrnoError(63);a.node_ops.setattr(a,{timestamp:Date.now()})},lchown(e,t,r){l.chown(e,t,r,!0)},fchown(e,t,r){let o=l.getStream(e);if(!o)throw new l.ErrnoError(8);l.chown(o.node,t,r)},truncate(e,t){if(t<0)throw new l.ErrnoError(28);let r;if(typeof e=="string"?r=l.lookupPath(e,{follow:!0}).node:r=e,!r.node_ops.setattr)throw new l.ErrnoError(63);if(l.isDir(r.mode))throw new l.ErrnoError(31);if(!l.isFile(r.mode))throw new l.ErrnoError(28);let o=l.nodePermissions(r,"w");if(o)throw new l.ErrnoError(o);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate(e,t){let r=l.getStream(e);if(!r)throw new l.ErrnoError(8);if(!(r.flags&2097155))throw new l.ErrnoError(28);l.truncate(r.node,t)},utime(e,t,r){let o=l.lookupPath(e,{follow:!0}),{node:a}=o;a.node_ops.setattr(a,{timestamp:Math.max(t,r)})},open(e,t,r,o,a){if(e==="")throw new l.ErrnoError(44);t=typeof t=="string"?l.modeStringToFlags(t):t,r=typeof r=="undefined"?438:r,t&64?r=r&4095|32768:r=0;let s;if(typeof e=="object")s=e;else{e=Ie.normalize(e);try{s=l.lookupPath(e,{follow:!(t&131072)}).node}catch(u){}}let A=!1;if(t&64)if(s){if(t&128)throw new l.ErrnoError(20)}else s=l.mknod(e,r,0),A=!0;if(!s)throw new l.ErrnoError(44);if(l.isChrdev(s.mode)&&(t&=-513),t&65536&&!l.isDir(s.mode))throw new l.ErrnoError(54);if(!A){let u=l.mayOpen(s,t);if(u)throw new l.ErrnoError(u)}t&512&&l.truncate(s,0),t&=-131713;let c=l.createStream({node:s,path:l.getPath(s),flags:t,seekable:!0,position:0,stream_ops:s.stream_ops,ungotten:[],error:!1},o,a);c.stream_ops.open&&c.stream_ops.open(c),n.logReadFiles&&!(t&1)&&(l.readFiles||(l.readFiles={}),e in l.readFiles||(l.readFiles[e]=1,pe(`FS.trackingDelegate error on read file: ${e}`)));try{if(l.trackingDelegate.onOpenFile){let u=0;(t&2097155)!==1&&(u|=l.tracking.openFlags.READ),t&2097155&&(u|=l.tracking.openFlags.WRITE),l.trackingDelegate.onOpenFile(e,u)}}catch(u){pe(`FS.trackingDelegate['onOpenFile']('${e}', flags) threw an exception: ${u.message}`)}return c},close(e){if(l.isClosed(e))throw new l.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(t){throw t}finally{l.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,t,r){if(l.isClosed(e))throw new l.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new l.ErrnoError(70);if(r!=0&&r!=1&&r!=2)throw new l.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read(e,t,r,o,a){if(o<0||a<0)throw new l.ErrnoError(28);if(l.isClosed(e))throw new l.ErrnoError(8);if((e.flags&2097155)===1)throw new l.ErrnoError(8);if(l.isDir(e.node.mode))throw new l.ErrnoError(31);if(!e.stream_ops.read)throw new l.ErrnoError(28);let s=typeof a!="undefined";if(!s)a=e.position;else if(!e.seekable)throw new l.ErrnoError(70);let A=e.stream_ops.read(e,t,r,o,a);return s||(e.position+=A),A},write(e,t,r,o,a,s){if(o<0||a<0)throw new l.ErrnoError(28);if(l.isClosed(e))throw new l.ErrnoError(8);if(!(e.flags&2097155))throw new l.ErrnoError(8);if(l.isDir(e.node.mode))throw new l.ErrnoError(31);if(!e.stream_ops.write)throw new l.ErrnoError(28);e.seekable&&e.flags&1024&&l.llseek(e,0,2);let A=typeof a!="undefined";if(!A)a=e.position;else if(!e.seekable)throw new l.ErrnoError(70);let c=e.stream_ops.write(e,t,r,o,a,s);A||(e.position+=c);try{e.path&&l.trackingDelegate.onWriteToFile&&l.trackingDelegate.onWriteToFile(e.path)}catch(u){pe(`FS.trackingDelegate['onWriteToFile']('${e.path}') threw an exception: ${u.message}`)}return c},allocate(e,t,r){if(l.isClosed(e))throw new l.ErrnoError(8);if(t<0||r<=0)throw new l.ErrnoError(28);if(!(e.flags&2097155))throw new l.ErrnoError(8);if(!l.isFile(e.node.mode)&&!l.isDir(e.node.mode))throw new l.ErrnoError(43);if(!e.stream_ops.allocate)throw new l.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap(e,t,r,o,a,s){if(a&2&&!(s&2)&&(e.flags&2097155)!==2)throw new l.ErrnoError(2);if((e.flags&2097155)===1)throw new l.ErrnoError(2);if(!e.stream_ops.mmap)throw new l.ErrnoError(43);return e.stream_ops.mmap(e,t,r,o,a,s)},msync(e,t,r,o,a){return!e||!e.stream_ops.msync?0:e.stream_ops.msync(e,t,r,o,a)},munmap(e){return 0},ioctl(e,t,r){if(!e.stream_ops.ioctl)throw new l.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile(e,t){if(t=t||{},t.flags=t.flags||0,t.encoding=t.encoding||"binary",t.encoding!=="utf8"&&t.encoding!=="binary")throw new Error(`Invalid encoding type "${t.encoding}"`);let r,o=l.open(e,t.flags),s=l.stat(e).size,A=new Uint8Array(s);return l.read(o,A,0,s,0),t.encoding==="utf8"?r=Rt(A,0):t.encoding==="binary"&&(r=A),l.close(o),r},writeFile(e,t,r){r=r||{},r.flags=r.flags||577;let o=l.open(e,r.flags,r.mode);if(typeof t=="string"){let a=new Uint8Array(bt(t)+1),s=Ze(t,a,0,a.length);l.write(o,a,0,s,void 0,r.canOwn)}else if(ArrayBuffer.isView(t))l.write(o,t,0,t.byteLength,void 0,r.canOwn);else throw new Error("Unsupported data type");l.close(o)},cwd(){return l.currentPath},chdir(e){let t=l.lookupPath(e,{follow:!0});if(t.node===null)throw new l.ErrnoError(44);if(!l.isDir(t.node.mode))throw new l.ErrnoError(54);let r=l.nodePermissions(t.node,"x");if(r)throw new l.ErrnoError(r);l.currentPath=t.path},createDefaultDirectories(){l.mkdir("/tmp"),l.mkdir("/home"),l.mkdir("/home/web_user")},createDefaultDevices(){l.mkdir("/dev"),l.registerDevice(l.makedev(1,3),{read(){return 0},write(t,r,o,a,s){return a}}),l.mkdev("/dev/null",l.makedev(1,3)),yt.register(l.makedev(5,0),yt.default_tty_ops),yt.register(l.makedev(6,0),yt.default_tty1_ops),l.mkdev("/dev/tty",l.makedev(5,0)),l.mkdev("/dev/tty1",l.makedev(6,0));let e=dt();l.createDevice("/dev","random",e),l.createDevice("/dev","urandom",e),l.mkdir("/dev/shm"),l.mkdir("/dev/shm/tmp")},createSpecialDirectories(){l.mkdir("/proc");let e=l.mkdir("/proc/self");l.mkdir("/proc/self/fd"),l.mount({mount(){let t=l.createNode(e,"fd",16895,73);return t.node_ops={lookup(r,o){let a=+o,s=l.getStream(a);if(!s)throw new l.ErrnoError(8);let A={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink(){return s.path}}};return A.parent=A,A}},t}},{},"/proc/self/fd")},createStandardStreams(){n.stdin?l.createDevice("/dev","stdin",n.stdin):l.symlink("/dev/tty","/dev/stdin"),n.stdout?l.createDevice("/dev","stdout",null,n.stdout):l.symlink("/dev/tty","/dev/stdout"),n.stderr?l.createDevice("/dev","stderr",null,n.stderr):l.symlink("/dev/tty1","/dev/stderr");let e=l.open("/dev/stdin",0),t=l.open("/dev/stdout",1),r=l.open("/dev/stderr",1);z(e.fd===0,`invalid handle for stdin (${e.fd})`),z(t.fd===1,`invalid handle for stdout (${t.fd})`),z(r.fd===2,`invalid handle for stderr (${r.fd})`)},ensureErrnoError(){l.ErrnoError||(l.ErrnoError=function(t,r){this.node=r,this.setErrno=function(o){this.errno=o;for(let a in f)if(f[a]===o){this.code=a;break}},this.setErrno(t),this.message=An[t],this.stack&&(Object.defineProperty(this,"stack",{value:new Error().stack,writable:!0}),this.stack=Vn(this.stack))},l.ErrnoError.prototype=new Error,l.ErrnoError.prototype.constructor=l.ErrnoError,[44].forEach(e=>{l.genericErrors[e]=new l.ErrnoError(e),l.genericErrors[e].stack="<generic error, no stack>"}))},staticInit(){l.ensureErrnoError(),l.nameTable=new Array(4096),l.mount(se,{},"/"),l.createDefaultDirectories(),l.createDefaultDevices(),l.createSpecialDirectories(),l.filesystems={MEMFS:se}},init(e,t,r){z(!l.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),l.init.initialized=!0,l.ensureErrnoError(),n.stdin=e||n.stdin,n.stdout=t||n.stdout,n.stderr=r||n.stderr,l.createStandardStreams()},quit(){l.init.initialized=!1;let e=n._fflush;e&&e(0);for(let t=0;t<l.streams.length;t++){let r=l.streams[t];r&&l.close(r)}},getMode(e,t){let r=0;return e&&(r|=365),t&&(r|=146),r},findObject(e,t){let r=l.analyzePath(e,t);return r.exists?r.object:null},analyzePath(e,t){try{var r=l.lookupPath(e,{follow:!t});e=r.path}catch(a){}let o={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var r=l.lookupPath(e,{parent:!0});o.parentExists=!0,o.parentPath=r.path,o.parentObject=r.node,o.name=Ie.basename(e),r=l.lookupPath(e,{follow:!t}),o.exists=!0,o.path=r.path,o.object=r.node,o.name=r.node.name,o.isRoot=r.path==="/"}catch(a){o.error=a.errno}return o},createPath(e,t,r,o){e=typeof e=="string"?e:l.getPath(e);let a=t.split("/").reverse();for(;a.length;){let A=a.pop();if(A){var s=Ie.join2(e,A);try{l.mkdir(s)}catch(c){}e=s}}return s},createFile(e,t,r,o,a){let s=Ie.join2(typeof e=="string"?e:l.getPath(e),t),A=l.getMode(o,a);return l.create(s,A)},createDataFile(e,t,r,o,a,s){let A=t?Ie.join2(typeof e=="string"?e:l.getPath(e),t):e,c=l.getMode(o,a),u=l.create(A,c);if(r){if(typeof r=="string"){let h=new Array(r.length);for(let I=0,m=r.length;I<m;++I)h[I]=r.charCodeAt(I);r=h}l.chmod(u,c|146);let d=l.open(u,577);l.write(d,r,0,r.length,0,s),l.close(d),l.chmod(u,c)}return u},createDevice(e,t,r,o){let a=Ie.join2(typeof e=="string"?e:l.getPath(e),t),s=l.getMode(!!r,!!o);l.createDevice.major||(l.createDevice.major=64);let A=l.makedev(l.createDevice.major++,0);return l.registerDevice(A,{open(c){c.seekable=!1},close(c){o&&o.buffer&&o.buffer.length&&o(10)},read(c,u,d,h,I){let m=0;for(let v=0;v<h;v++){var y;try{y=r()}catch(U){throw new l.ErrnoError(29)}if(y===void 0&&m===0)throw new l.ErrnoError(6);if(y==null)break;m++,u[d+v]=y}return m&&(c.node.timestamp=Date.now()),m},write(c,u,d,h,I){for(var m=0;m<h;m++)try{o(u[d+m])}catch(y){throw new l.ErrnoError(29)}return h&&(c.node.timestamp=Date.now()),m}}),l.mkdev(a,s,A)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(typeof XMLHttpRequest!="undefined")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(Rr)try{e.contents=yi(Rr(e.url),!0),e.usedBytes=e.contents.length}catch(t){throw new l.ErrnoError(29)}else throw new Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile(e,t,r,o,a){function s(){this.lengthKnown=!1,this.chunks=[]}if(s.prototype.get=function(I){if(I>this.length-1||I<0)return;let m=I%this.chunkSize,y=I/this.chunkSize|0;return this.getter(y)[m]},s.prototype.setDataGetter=function(I){this.getter=I},s.prototype.cacheLength=function(){let I=new XMLHttpRequest;if(I.open("HEAD",r,!1),I.send(null),!(I.status>=200&&I.status<300||I.status===304))throw new Error(`Couldn't load ${r}. Status: ${I.status}`);let m=Number(I.getResponseHeader("Content-length")),y,v=(y=I.getResponseHeader("Accept-Ranges"))&&y==="bytes",U=(y=I.getResponseHeader("Content-Encoding"))&&y==="gzip",G=1024*1024;v||(G=m);let R=function(k,$){if(k>$)throw new Error(`invalid range (${k}, ${$}) or no bytes requested!`);if($>m-1)throw new Error(`only ${m} bytes available! programmer error!`);let Y=new XMLHttpRequest;if(Y.open("GET",r,!1),m!==G&&Y.setRequestHeader("Range",`bytes=${k}-${$}`),typeof Uint8Array!="undefined"&&(Y.responseType="arraybuffer"),Y.overrideMimeType&&Y.overrideMimeType("text/plain; charset=x-user-defined"),Y.send(null),!(Y.status>=200&&Y.status<300||Y.status===304))throw new Error(`Couldn't load ${r}. Status: ${Y.status}`);return Y.response!==void 0?new Uint8Array(Y.response||[]):yi(Y.responseText||"",!0)},D=this;D.setDataGetter(k=>{let $=k*G,Y=(k+1)*G-1;if(Y=Math.min(Y,m-1),typeof D.chunks[k]=="undefined"&&(D.chunks[k]=R($,Y)),typeof D.chunks[k]=="undefined")throw new Error("doXHR failed!");return D.chunks[k]}),(U||!m)&&(G=m=1,m=this.getter(0).length,G=m,Re("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=m,this._chunkSize=G,this.lengthKnown=!0},typeof XMLHttpRequest!="undefined"){if(!Ve)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";let h=new s;Object.defineProperties(h,{length:{get(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var A={isDevice:!1,contents:h}}else var A={isDevice:!1,url:r};let c=l.createFile(e,t,A,o,a);A.contents?c.contents=A.contents:A.url&&(c.contents=null,c.url=A.url),Object.defineProperties(c,{usedBytes:{get(){return this.contents.length}}});let u={};return Object.keys(c.stream_ops).forEach(h=>{let I=c.stream_ops[h];u[h]=function(){return l.forceLoadFile(c),I.apply(null,arguments)}}),u.read=function(I,m,y,v,U){l.forceLoadFile(c);let{contents:G}=I.node;if(U>=G.length)return 0;let R=Math.min(G.length-U,v);if(z(R>=0),G.slice)for(var D=0;D<R;D++)m[y+D]=G[U+D];else for(var D=0;D<R;D++)m[y+D]=G.get(U+D);return R},c.stream_ops=u,c},createPreloadedFile(e,t,r,o,a,s,A,c,u,d){Q.init();let h=t?Pe.resolve(Ie.join2(e,t)):e,I=wr(`cp ${h}`);function m(y){function v(G){d&&d(),c||l.createDataFile(e,t,G,o,a,u),s&&s(),ir(I)}let U=!1;n.preloadPlugins.forEach(G=>{U||G.canHandle(h)&&(G.handle(y,h,v,()=>{A&&A(),ir(I)}),U=!0)}),U||v(y)}E(I),typeof r=="string"?Li(r,y=>{m(y)},A):m(r)},indexedDB(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME(){return`EM_FS_${window.location.pathname}`},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB(e,t,r){t=t||function(){},r=r||function(){};let o=l.indexedDB();try{var a=o.open(l.DB_NAME(),l.DB_VERSION)}catch(s){return r(s)}a.onupgradeneeded=function(){Re("creating db"),a.result.createObjectStore(l.DB_STORE_NAME)},a.onsuccess=function(){let c=a.result.transaction([l.DB_STORE_NAME],"readwrite"),u=c.objectStore(l.DB_STORE_NAME),d=0,h=0,I=e.length;function m(){h==0?t():r()}e.forEach(y=>{let v=u.put(l.analyzePath(y).object.contents,y);v.onsuccess=function(){d++,d+h==I&&m()},v.onerror=function(){h++,d+h==I&&m()}}),c.onerror=r},a.onerror=r},loadFilesFromDB(e,t,r){t=t||function(){},r=r||function(){};let o=l.indexedDB();try{var a=o.open(l.DB_NAME(),l.DB_VERSION)}catch(s){return r(s)}a.onupgradeneeded=r,a.onsuccess=function(){let A=a.result;try{var c=A.transaction([l.DB_STORE_NAME],"readonly")}catch(y){r(y);return}let u=c.objectStore(l.DB_STORE_NAME),d=0,h=0,I=e.length;function m(){h==0?t():r()}e.forEach(y=>{let v=u.get(y);v.onsuccess=function(){l.analyzePath(y).exists&&l.unlink(y),l.createDataFile(Ie.dirname(y),Ie.basename(y),v.result,!0,!0,!0),d++,d+h==I&&m()},v.onerror=function(){h++,d+h==I&&m()}}),c.onerror=r},a.onerror=r},absolutePath(){p("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder(){p("FS.createFolder has been removed; use FS.mkdir instead")},createLink(){p("FS.createLink has been removed; use FS.symlink instead")},joinPath(){p("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc(){p("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath(){p("FS.standardizePath has been removed; use PATH.normalize instead")}},Me={mappings:{},DEFAULT_POLLMASK:5,umask:511,calculateAt(e,t,r){if(t[0]==="/")return t;let o;if(e===-100)o=l.cwd();else{let a=l.getStream(e);if(!a)throw new l.ErrnoError(8);o=a.path}if(t.length==0){if(!r)throw new l.ErrnoError(44);return o}return Ie.join2(o,t)},doStat(e,t,r){try{var o=e(t)}catch(a){if(a&&a.node&&Ie.normalize(t)!==Ie.normalize(l.getPath(a.node)))return-54;throw a}return b[r>>2]=o.dev,b[r+4>>2]=0,b[r+8>>2]=o.ino,b[r+12>>2]=o.mode,b[r+16>>2]=o.nlink,b[r+20>>2]=o.uid,b[r+24>>2]=o.gid,b[r+28>>2]=o.rdev,b[r+32>>2]=0,Bt=[o.size>>>0,(ye=o.size,+Math.abs(ye)>=1?ye>0?(Math.min(+Math.floor(ye/4294967296),4294967295)|0)>>>0:~~+Math.ceil((ye-+(~~ye>>>0))/4294967296)>>>0:0)],b[r+40>>2]=Bt[0],b[r+44>>2]=Bt[1],b[r+48>>2]=4096,b[r+52>>2]=o.blocks,b[r+56>>2]=o.atime.getTime()/1e3|0,b[r+60>>2]=0,b[r+64>>2]=o.mtime.getTime()/1e3|0,b[r+68>>2]=0,b[r+72>>2]=o.ctime.getTime()/1e3|0,b[r+76>>2]=0,Bt=[o.ino>>>0,(ye=o.ino,+Math.abs(ye)>=1?ye>0?(Math.min(+Math.floor(ye/4294967296),4294967295)|0)>>>0:~~+Math.ceil((ye-+(~~ye>>>0))/4294967296)>>>0:0)],b[r+80>>2]=Bt[0],b[r+84>>2]=Bt[1],0},doMsync(e,t,r,o,a){let s=ve.slice(e,e+r);l.msync(t,s,a,r,o)},doMkdir(e,t){return e=Ie.normalize(e),e[e.length-1]==="/"&&(e=e.substr(0,e.length-1)),l.mkdir(e,t,0),0},doMknod(e,t,r){switch(t&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return l.mknod(e,t,r),0},doReadlink(e,t,r){if(r<=0)return-28;let o=l.readlink(e),a=Math.min(r,bt(o)),s=be[t+a];return tr(o,t,r+1),be[t+a]=s,a},doAccess(e,t){if(t&-8)return-28;let r;if(r=l.lookupPath(e,{follow:!0}).node,!r)return-44;let a="";return t&4&&(a+="r"),t&2&&(a+="w"),t&1&&(a+="x"),a&&l.nodePermissions(r,a)?-2:0},doDup(e,t,r){let o=l.getStream(r);return o&&l.close(o),l.open(e,t,0,r,r).fd},doReadv(e,t,r,o){let a=0;for(let s=0;s<r;s++){let A=b[t+s*8>>2],c=b[t+(s*8+4)>>2],u=l.read(e,be,A,c,o);if(u<0)return-1;if(a+=u,u<c)break}return a},doWritev(e,t,r,o){let a=0;for(let s=0;s<r;s++){let A=b[t+s*8>>2],c=b[t+(s*8+4)>>2],u=l.write(e,be,A,c,o);if(u<0)return-1;a+=u}return a},varargs:void 0,get(){return z(Me.varargs!=null),Me.varargs+=4,b[Me.varargs-4>>2]},getStr(e){return Je(e)},getStreamFromFD(e){let t=l.getStream(e);if(!t)throw new l.ErrnoError(8);return t},get64(e,t){return e>=0?z(t===0):z(t===-1),e}};function Hi(e,t,r){Me.varargs=r;try{let a=Me.getStreamFromFD(e);switch(t){case 0:{var o=Me.get();if(o<0)return-28;let s;return s=l.open(a.path,a.flags,0,o),s.fd}case 1:case 2:return 0;case 3:return a.flags;case 4:{var o=Me.get();return a.flags|=o,0}case 12:{var o=Me.get();let A=0;return T[o+A>>1]=2,0}case 13:case 14:return 0;case 16:case 8:return-28;case 9:return _e(28),-1;default:return-28}}catch(a){return(typeof l=="undefined"||!(a instanceof l.ErrnoError))&&p(a),-a.errno}}function Gi(e,t,r){Me.varargs=r;try{let a=Me.getStreamFromFD(e);switch(t){case 21509:case 21505:return a.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return a.tty?0:-59;case 21519:{if(!a.tty)return-59;var o=Me.get();return b[o>>2]=0,0}case 21520:return a.tty?-28:-59;case 21531:{var o=Me.get();return l.ioctl(a,t,o)}case 21523:return a.tty?0:-59;case 21524:return a.tty?0:-59;default:p(`bad ioctl syscall ${t}`)}}catch(a){return(typeof l=="undefined"||!(a instanceof l.ErrnoError))&&p(a),-a.errno}}function Yi(e,t,r,o,a,s){s<<=12;let A,c=!1;if(o&16&&e%65536!==0)return-28;if(o&32){if(A=ie(t),!A)return-48;c=!0}else{let u=l.getStream(a);if(!u)return-8;let d=l.mmap(u,e,t,s,r,o);A=d.ptr,c=d.allocated}return Me.mappings[A]={malloc:A,len:t,allocated:c,fd:a,prot:r,flags:o,offset:s},A}function Xi(e,t,r,o,a,s){try{return Yi(e,t,r,o,a,s)}catch(A){return(typeof l=="undefined"||!(A instanceof l.ErrnoError))&&p(A),-A.errno}}function Wi(e,t,r){Me.varargs=r;try{let o=Me.getStr(e),a=r?Me.get():0;return l.open(o,t,a).fd}catch(o){return(typeof l=="undefined"||!(o instanceof l.ErrnoError))&&p(o),-o.errno}}function Zn(e,t){try{return e=Me.getStr(e),Me.doStat(l.stat,e,t)}catch(r){return(typeof l=="undefined"||!(r instanceof l.ErrnoError))&&p(r),-r.errno}}let Vi=48,cn=57;function ar(e){if(e===void 0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");let t=e.charCodeAt(0);return t>=Vi&&t<=cn?`_${e}`:e}function sr(e,t){return e=ar(e),new Function("body",`return function ${e}() {