define(["./when-cbf8cd21","./createTaskProcessorWorker","./CompressedTextureBuffer-8e373b49"],function(e,r,$){"use strict";var Wr,A,n,t=(Wr="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,"undefined"!=typeof __filename&&(Wr=Wr||__filename),function(e){var r,a=e=e||{},n={};for(r in a)a.hasOwnProperty(r)&&(n[r]=a[r]);var t,i,o=!1,u=!1;o="object"==typeof window,u="function"==typeof importScripts,t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,i=!o&&!t&&!u;var s,c,l,f,p="";t?(p=u?require("path").dirname(p)+"/":__dirname+"/",s=function(e,r){return l=l||require("fs"),e=(f=f||require("path")).normalize(e),l.readFileSync(e,r?null:"utf8")},c=function(e){var r=s(e,!0);return r.buffer||(r=new Uint8Array(r)),T(r.buffer),r},1>10,56320|1023&c)}}else o+=String.fromCharCode((31&a)<<6|u)}else o+=String.fromCharCode(a)}return o}function b(e,r){return e?w($,e,r):""}var _,P,$,A,F,R,E,S,B,W="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function I(e){for(var r=e,n=r>>1;A[n];)++n;if(32<(r=n<<1)-e&&W)return W.decode($.subarray(e,r));for(var t=0,i="";;){var o=A[e+2*t>>1];if(0==o)return i;++t,i+=String.fromCharCode(o)}}function O(e,r,n){if(void 0===n&&(n=2147483647),n<2)return 0;for(var t=r,i=(n-=2)<2*e.length?n/2:e.length,o=0;o>1]=a,r+=2}return A[r>>1]=0,r-t}function k(e){return 2*e.length}function j(e){for(var r=0,n="";;){var t=R[e+4*r>>2];if(0==t)return n;if(++r,65536<=t){var i=t-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(t)}}function x(e,r,n){if(void 0===n&&(n=2147483647),n<4)return 0;for(var t=r,i=t+n-4,o=0;o>2]=a,i<(r+=4)+4)break}return R[r>>2]=0,r-t}function D(e){for(var r=0,n=0;n>2])}function Me(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function He(e){this.rawDestructor&&this.rawDestructor(e)}function qe(e){null!==e&&e.delete()}function ze(){return Object.keys(Xe).length}function Le(){var e=[];for(var r in Xe)Xe.hasOwnProperty(r)&&e.push(Xe[r]);return e}function Ne(e){Re=e,Ee.length&&Re&&Re(Se)}var Xe={};function Je(e,r){return r=function(e,r){for(void 0===r&&he("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r}(e,r),Xe[r]}function Ye(e,r){return r.ptrType&&r.ptr||ve("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!=!!r.smartPtr&&ve("Both smartPtrType and smartPtr must be specified"),r.count={value:1},Pe(Object.create(e,{$$:{value:r}}))}function Ze(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var n=Je(this.registeredClass,r);if(void 0!==n){if(0===n.$$.count.value)return n.$$.ptr=r,n.$$.smartPtr=e,n.clone();var t=n.clone();return this.destructor(e),t}function i(){return this.isSmartPointer?Ye(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):Ye(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o,a=this.registeredClass.getActualType(r),u=Ie[a];if(!u)return i.call(this);o=this.isConst?u.constPointerType:u.pointerType;var s=function e(r,n,t){if(n===t)return r;if(void 0===t.baseClass)return null;var i=e(r,n,t.baseClass);return null===i?null:t.downcast(i)}(r,this.registeredClass,o.registeredClass);return null===s?i.call(this):this.isSmartPointer?Ye(o.registeredClass.instancePrototype,{ptrType:o,ptr:s,smartPtrType:this,smartPtr:e}):Ye(o.registeredClass.instancePrototype,{ptrType:o,ptr:s})}function Ke(e,r,n,t,i,o,a,u,s,c,l){this.name=e,this.registeredClass=r,this.isReference=n,this.isConst=t,this.isSmartPointer=i,this.pointeeType=o,this.sharingPolicy=a,this.rawGetPointee=u,this.rawConstructor=s,this.rawShare=c,this.rawDestructor=l,i||void 0!==r.baseClass?this.toWireType=Ue:(this.toWireType=t?De:Ve,this.destructorFunction=null)}function Qe(e,r,n){a.hasOwnProperty(e)||ve("Replacing nonexistant public symbol"),void 0!==a[e].overloadTable&&void 0!==n?a[e].overloadTable[n]=r:(a[e]=r,a[e].argCount=n)}function er(i,o){i=ie(i);var e=function(e){for(var r=[],n=1;n>2)+t]);return n}function or(e){for(;e.length;){var r=e.pop();e.pop()(r)}}function ar(e,r){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var n=fe(e.name||"unknownFunctionName",function(){});n.prototype=e.prototype;var t=new n,i=e.apply(t,r);return i instanceof Object?i:t}function ur(e,r,n,t,i){var o=r.length;o<2&&he("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==r[1]&&null!==n,u=!1,s=1;s>16),U(h.buffer),1}catch(e){}}var _r={mappings:{},buffers:[null,[],[]],printChar:function(e,r){var n=_r.buffers[e];0===r||10===r?((1===e?y:v)(w(n,0)),n.length=0):n.push(r)},varargs:void 0,get:function(){return _r.varargs+=4,R[_r.varargs-4>>2]},getStr:function(e){return b(e)},get64:function(e,r){return e}};!function(){for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);te=e}(),de=a.BindingError=pe(Error,"BindingError"),ye=a.InternalError=pe(Error,"InternalError"),We.prototype.isAliasOf=Te,We.prototype.clone=$e,We.prototype.delete=Ae,We.prototype.isDeleted=Fe,We.prototype.deleteLater=Be,Ke.prototype.getPointee=Me,Ke.prototype.destructor=He,Ke.prototype.argPackAdvance=8,Ke.prototype.readValueFromPointer=Ge,Ke.prototype.deleteObject=qe,Ke.prototype.fromWireType=Ze,a.getInheritedInstanceCount=ze,a.getLiveInheritedInstances=Le,a.flushPendingDeletes=Se,a.setDelayFunction=Ne,rr=a.UnboundTypeError=pe(Error,"UnboundTypeError"),a.count_emval_handles=fr,a.get_first_emval=pr;var Pr={G:function(e){return Rr(e)},D:function(e,r,n){throw e},A:function(e,n,t,i,o){var a=ne(t);ge(e,{name:n=ie(n),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?i:o},argPackAdvance:8,readValueFromPointer:function(e){var r;if(1===t)r=P;else if(2===t)r=A;else{if(4!==t)throw new TypeError("Unknown boolean type size: "+n);r=R}return this.fromWireType(r[e>>a])},destructorFunction:null})},t:function(c,e,r,l,n,f,t,p,i,d,h,o,y){h=ie(h),f=er(n,f),p=p&&er(t,p),d=d&&er(i,d),y=er(o,y);var v=le(h);ke(v,function(){tr("Cannot construct "+h+" due to unbound types",[l])}),me([c,e,r],l?[l]:[],function(e){var r,n;e=e[0],n=l?(r=e.registeredClass).instancePrototype:We.prototype;var t=fe(v,function(){if(Object.getPrototypeOf(this)!==i)throw new de("Use 'new' to construct "+h);if(void 0===o.constructor_body)throw new de(h+" has no accessible constructor");var e=o.constructor_body[arguments.length];if(void 0===e)throw new de("Tried to invoke ctor of "+h+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(o.constructor_body).toString()+") parameters instead!");return e.apply(this,arguments)}),i=Object.create(n,{constructor:{value:t}});t.prototype=i;var o=new je(h,t,i,y,r,f,p,d),a=new Ke(h,o,!0,!1,!1),u=new Ke(h+"*",o,!1,!1,!1),s=new Ke(h+" const*",o,!1,!0,!1);return Ie[c]={pointerType:u,constPointerType:s},Qe(v,t),[a,u,s]})},s:function(e,i,r,n,o,t){T(0>2])};case 3:return function(e){return this.fromWireType(B[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}(r,t),destructorFunction:null})},x:function(n,t,e,r,i,o){var a=ir(t,e);n=ie(n),i=er(r,i),ke(n,function(){tr("Cannot call "+n+" due to unbound types",a)},t-1),me([],a,function(e){var r=[e[0],null].concat(e.slice(1));return Qe(n,ur(n,r,null,i,o),t-1),[]})},d:function(e,n,r,t,i){n=ie(n),-1===i&&(i=4294967295);var o=ne(r),a=function(e){return e};if(0===t){var u=32-8*r;a=function(e){return e<>>u}}var s=-1!=n.indexOf("unsigned");ge(e,{name:n,fromWireType:a,toWireType:function(e,r){if("number"!=typeof r&&"boolean"!=typeof r)throw new TypeError('Cannot convert "'+hr(r)+'" to '+this.name);if(r>>0:0|r},argPackAdvance:8,readValueFromPointer:function(e,r,n){switch(r){case 0:return n?function(e){return P[e]}:function(e){return $[e]};case 1:return n?function(e){return A[e>>1]}:function(e){return F[e>>1]};case 2:return n?function(e){return R[e>>2]}:function(e){return E[e>>2]};default:throw new TypeError("Unknown integer type: "+e)}}(n,o,0!==t),destructorFunction:null})},b:function(e,r,n){var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function t(e){var r=E,n=r[e>>=2],t=r[e+1];return new i(_,t,n)}ge(e,{name:n=ie(n),fromWireType:t,argPackAdvance:8,readValueFromPointer:t},{ignoreDuplicateRegistrations:!0})},k:function(e,r){var l="std::string"===(r=ie(r));ge(e,{name:r,fromWireType:function(e){var r,n=E[e>>2];if(l){var t=$[e+4+n],i=0;0!=t&&(i=t,$[e+4+n]=0);for(var o=e+4,a=0;a<=n;++a){var u=e+4+a;if(0==$[u]){var s=b(o);void 0===r?r=s:(r+=String.fromCharCode(0),r+=s),o=u+1}}0!=i&&($[e+4+n]=i)}else{var c=new Array(n);for(a=0;a>2]=t,l&&n)!function(e,r,n){!function(e,r,n,t){if(0>6,r[n++]=128|63&a}else if(a<=65535){if(i<=n+2)break;r[n++]=224|a>>12,r[n++]=128|a>>6&63,r[n++]=128|63&a}else{if(i<=n+3)break;r[n++]=240|a>>18,r[n++]=128|a>>12&63,r[n++]=128|a>>6&63,r[n++]=128|63&a}}r[n]=0}}(e,$,r,n)}(r,i+4,t+1);else if(n)for(var o=0;o>2],t=p(),i=t[e+4+n*l>>d],o=0;0!=i&&(o=i,t[e+4+n*l>>d]=0);for(var a=e+4,u=0;u<=n;++u){var s=e+4+u*l;if(0==t[s>>d]){var c=f(a);void 0===r?r=c:(r+=String.fromCharCode(0),r+=c),a=s+l}}return 0!=o&&(t[e+4+n*l>>d]=o),Er(e),r},toWireType:function(e,r){"string"!=typeof r&&he("Cannot pass non-string to C++ string type "+i);var n=a(r),t=Rr(4+n+l);return E[t>>2]=n>>d,o(r,t+4,n+l),null!==e&&e.push(Er,t),t},argPackAdvance:8,readValueFromPointer:Ge,destructorFunction:function(e){Er(e)}})},B:function(e,r){ge(e,{isVoid:!0,name:r=ie(r),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,r){}})},r:function(e,r,n){e=yr(e),r=vr(r,"emval::as");var t=[],i=dr(t);return R[n>>2]=i,r.toWireType(t,e)},m:function(e,r,n,t){(e=Tr[e])(r=yr(r),n=gr(n),null,t)},a:lr,F:function(e){return 0===e?dr(Cr()):(e=gr(e),dr(Cr()[e]))},n:function(e,r){for(var n=function(e,r){for(var n=new Array(e),t=0;t>2)+t],"parameter "+t);return n}(e,r),t=n[0],i=t.name+"_$"+n.slice(1).map(function(e){return e.name}).join("_")+"$",o=["retType"],a=[t],u="",s=0;s> 2) + "+n+'], "parameter '+n+'");\nvar arg'+n+" = argType"+n+".readValueFromPointer(args);\nargs += argType"+n+"['argPackAdvance'];\n";return t+="var obj = new constructor("+r+");\nreturn __emval_register(obj);\n}\n",new Function("requireRegisteredType","Module","__emval_register",t)(vr,a,dr)}(r),wr[r]=i),i(e,n,t)},g:function(e){return dr(gr(e))},q:function(e){or(cr[e].value),lr(e)},E:function(){Y()},w:function(e,r,n){$.copyWithin(e,r,r+n)},y:function(e){var r=$.length,n=2147418112;if(n>2],u=R[r+(8*o+4)>>2],s=0;s>2]=i,0},memory:h,e:function(e){return 0<=(e=+e)?+N(e+.5):+L(e-.5)},v:function(e){},table:m},$r=function(){var r={a:Pr};function n(e,r){var n=e.exports;a.asm=n,function(){if(X--,a.monitorRunDependencies&&a.monitorRunDependencies(X),0==X&&J){var e=J;J=null,e()}}()}function t(e){n(e.instance)}function i(e){return(d||!o&&!u||"function"!=typeof fetch?new Promise(function(e,r){e(re())}):fetch(ee,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+ee+"'";return e.arrayBuffer()}).catch(function(){return re()})).then(function(e){return WebAssembly.instantiate(e,r)}).then(e,function(e){v("failed to asynchronously prepare wasm: "+e),Y(e)})}if(X++,a.monitorRunDependencies&&a.monitorRunDependencies(X),a.instantiateWasm)try{return a.instantiateWasm(r,n)}catch(e){return v("Module.instantiateWasm callback failed with error: "+e),!1}return function(){if(d||"function"!=typeof WebAssembly.instantiateStreaming||K(ee)||"function"!=typeof fetch)return i(t);fetch(ee,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,r).then(t,function(e){v("wasm streaming compile failed: "+e),v("falling back to ArrayBuffer instantiation"),i(t)})})}(),{}}();a.asm=$r;var Ar,Fr=a.___wasm_call_ctors=function(){return(Fr=a.___wasm_call_ctors=a.asm.H).apply(null,arguments)},Rr=a._malloc=function(){return(Rr=a._malloc=a.asm.I).apply(null,arguments)},Er=a._free=function(){return(Er=a._free=a.asm.J).apply(null,arguments)},Sr=a.___getTypeName=function(){return(Sr=a.___getTypeName=a.asm.K).apply(null,arguments)};function Br(e){function r(){Ar||(Ar=!0,a.calledRun=!0,g||(G(H),G(q),a.onRuntimeInitialized&&a.onRuntimeInitialized(),function(){if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;)e=a.postRun.shift(),z.unshift(e);var e;G(z)}()))}0