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