var imagequant = (function() { var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; return ( function(imagequant) { imagequant = imagequant || {}; var e;e||(e=typeof imagequant !== 'undefined' ? imagequant : {});var m={},r;for(r in e)e.hasOwnProperty(r)&&(m[r]=e[r]);var u=!1,v=!1,aa=!1,ba=!1,ca=!1;u="object"===typeof window;v="function"===typeof importScripts;aa=(ba="object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)&&!u&&!v;ca=!u&&!aa&&!v;var w="",da,x,ea,fa; if(aa)w=__dirname+"/",da=function(a,b){ea||(ea=require("fs"));fa||(fa=require("path"));a=fa.normalize(a);return ea.readFileSync(a,b?null:"utf8")},x=function(a){a=da(a,!0);a.buffer||(a=new Uint8Array(a));a.buffer||y("Assertion failed: undefined");return a},1=d);)++c;if(16f?d+=String.fromCharCode(f):(f-=65536,d+=String.fromCharCode(55296|f>>10,56320|f&1023))}}else d+=String.fromCharCode(f)}return d}function na(a){return a?ma(C,a,void 0):""} function oa(a,b,c){var d=C;if(0=h){var g=a.charCodeAt(++f);h=65536+((h&1023)<<10)|g&1023}if(127>=h){if(b>=c)break;d[b++]=h}else{if(2047>=h){if(b+1>=c)break;d[b++]=192|h>>6}else{if(65535>=h){if(b+2>=c)break;d[b++]=224|h>>12}else{if(b+3>=c)break;d[b++]=240|h>>18;d[b++]=128|h>>12&63}d[b++]=128|h>>6&63}d[b++]=128|h&63}}d[b]=0}}"undefined"!==typeof TextDecoder&&new TextDecoder("utf-16le"); function pa(a){0>2],k=D[b+(8*h+4)>>2],p=0;p>2]=f;return 0}catch(t){return"undefined"!==typeof FS&&t instanceof FS.Ia||y(t),t.Ja}}function Oa(a){switch(a){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+a);}}var Pa=void 0; function J(a){for(var b="";C[a];)b+=Pa[C[a++]];return b}var K={},L={},Qa={};function Ra(a){if(void 0===a)return"_unknown";a=a.replace(/[^a-zA-Z0-9_]/g,"$");var b=a.charCodeAt(0);return 48<=b&&57>=b?"_"+a:a}function Sa(a,b){a=Ra(a);return(new Function("body","return function "+a+'() {\n "use strict"; return body.apply(this, arguments);\n};\n'))(b)} function Ta(a){var b=Error,c=Sa(a,function(b){this.name=a;this.message=b;b=Error(b).stack;void 0!==b&&(this.stack=this.toString()+"\n"+b.replace(/^Error(:[^\n]*)?\n/,""))});c.prototype=Object.create(b.prototype);c.prototype.constructor=c;c.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message};return c}var M=void 0;function N(a){throw new M(a);}var Ua=void 0;function Va(a){throw new Ua(a);} function Wa(a,b,c){function d(b){b=c(b);b.length!==a.length&&Va("Mismatched type converter count");for(var d=0;d>2])}function qb(a,b,c){if(b===c)return a;if(void 0===c.ga)return null;a=qb(a,b,c.ga);return null===a?null:c.za(a)}var rb={}; function sb(a,b){for(void 0===b&&N("ptr should not be undefined");a.ga;)b=a.oa(b),a=a.ga;return rb[b]}function tb(a,b){b.da&&b.aa||Va("makeClassHandle requires ptr and ptrType");!!b.fa!==!!b.ea&&Va("Both smartPtrType and smartPtr must be specified");b.count={value:1};return R(Object.create(a,{$:{value:b}}))} function V(a,b,c,d){this.name=a;this.ba=b;this.sa=c;this.pa=d;this.qa=!1;this.ka=this.Ga=this.Fa=this.wa=this.Ha=this.Ea=void 0;void 0!==b.ga?this.toWireType=kb:(this.toWireType=d?jb:ob,this.ia=null)}function ub(a,b,c){e.hasOwnProperty(a)||Va("Replacing nonexistant public symbol");void 0!==e[a].ha&&void 0!==c?e[a].ha[c]=b:(e[a]=b,e[a].xa=c)} function W(a,b){a=J(a);if(void 0!==e["FUNCTION_TABLE_"+a])var c=e["FUNCTION_TABLE_"+a][b];else if("undefined"!==typeof FUNCTION_TABLE)c=FUNCTION_TABLE[b];else{c=e["dynCall_"+a];void 0===c&&(c=e["dynCall_"+a.replace(/f/g,"d")],void 0===c&&N("No dynCall invoker for signature: "+a));for(var d=[],f=1;f>2])};case 3:return function(a){return this.fromWireType(ua[a>>3])};default:throw new TypeError("Unknown float type: "+a);}} function Eb(a){var b=Function;if(!(b instanceof Function))throw new TypeError("new_ called with constructor type "+typeof b+" which is not a function");var c=Sa(b.name||"unknownFunctionName",function(){});c.prototype=b.prototype;c=new c;a=b.apply(c,a);return a instanceof Object?a:c}function Fb(a,b){for(var c=[],d=0;d>2)+d]);return c} function Gb(a,b,c){switch(b){case 0:return c?function(a){return qa[a]}:function(a){return C[a]};case 1:return c?function(a){return ra[a>>1]}:function(a){return sa[a>>1]};case 2:return c?function(a){return D[a>>2]}:function(a){return E[a>>2]};default:throw new TypeError("Unknown integer type: "+a);}}function Hb(){return qa.length}function Z(){Z.ma||(Z.ma=[]);Z.ma.push(Ib());return Z.ma.length-1}for(var Jb=Array(256),Kb=0;256>Kb;++Kb)Jb[Kb]=String.fromCharCode(Kb);Pa=Jb;M=e.BindingError=Ta("BindingError"); Ua=e.InternalError=Ta("InternalError");T.prototype.isAliasOf=function(a){if(!(this instanceof T&&a instanceof T))return!1;var b=this.$.da.ba,c=this.$.aa,d=a.$.da.ba;for(a=a.$.aa;b.ga;)c=b.oa(c),b=b.ga;for(;d.ga;)a=d.oa(a),d=d.ga;return b===d&&c===a};T.prototype.clone=function(){this.$.aa||Ya(this);if(this.$.na)return this.$.count.value+=1,this;var a=R(Object.create(Object.getPrototypeOf(this),{$:{value:Xa(this.$)}}));a.$.count.value+=1;a.$.la=!1;return a}; T.prototype["delete"]=function(){this.$.aa||Ya(this);this.$.la&&!this.$.na&&N("Object already scheduled for deletion");$a(this);ab(this.$);this.$.na||(this.$.ea=void 0,this.$.aa=void 0)};T.prototype.isDeleted=function(){return!this.$.aa};T.prototype.deleteLater=function(){this.$.aa||Ya(this);this.$.la&&!this.$.na&&N("Object already scheduled for deletion");cb.push(this);1===cb.length&&bb&&bb(db);this.$.la=!0;return this};V.prototype.Ca=function(a){this.wa&&(a=this.wa(a));return a}; V.prototype.va=function(a){this.ka&&this.ka(a)};V.prototype.argPackAdvance=8;V.prototype.readValueFromPointer=pb;V.prototype.deleteObject=function(a){if(null!==a)a["delete"]()}; V.prototype.fromWireType=function(a){function b(){return this.qa?tb(this.ba.ja,{da:this.Ea,aa:c,fa:this,ea:a}):tb(this.ba.ja,{da:this,aa:a})}var c=this.Ca(a);if(!c)return this.va(a),null;var d=sb(this.ba,c);if(void 0!==d){if(0===d.$.count.value)return d.$.aa=c,d.$.ea=a,d.clone();d=d.clone();this.va(a);return d}d=this.ba.Ba(c);d=eb[d];if(!d)return b.call(this);d=this.pa?d.ya:d.pointerType;var f=qb(c,this.ba,d.ba);return null===f?b.call(this):this.qa?tb(d.ba.ja,{da:d,aa:f,fa:this,ea:a}):tb(d.ba.ja, {da:d,aa:f})};e.getInheritedInstanceCount=function(){return Object.keys(rb).length};e.getLiveInheritedInstances=function(){var a=[],b;for(b in rb)rb.hasOwnProperty(b)&&a.push(rb[b]);return a};e.flushPendingDeletes=db;e.setDelayFunction=function(a){bb=a;cb.length&&bb&&bb(db)};vb=e.UnboundTypeError=Ta("UnboundTypeError");e.count_emval_handles=function(){for(var a=0,b=5;b>h])},ia:null})},o:function(a,b,c,d,f,h,g,k,p,q,l,t,O){l=J(l);h=W(f,h);k&&(k=W(g,k));q&&(q=W(p,q));O=W(t,O);var F=Ra(l);gb(F,function(){yb("Cannot construct "+l+" due to unbound types",[d])});Wa([a,b,c],d?[d]:[],function(b){b=b[0];if(d){var c=b.ba;var f=c.ja}else f=T.prototype;b=Sa(F,function(){if(Object.getPrototypeOf(this)!==p)throw new M("Use 'new' to construct "+l);if(void 0===g.ua)throw new M(l+" has no accessible constructor");var a=g.ua[arguments.length];if(void 0=== a)throw new M("Tried to invoke ctor of "+l+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(g.ua).toString()+") parameters instead!");return a.apply(this,arguments)});var p=Object.create(f,{constructor:{value:b}});b.prototype=p;var g=new hb(l,b,p,O,c,h,k,q);c=new V(l,g,!0,!1);f=new V(l+"*",g,!1,!1);var t=new V(l+" const*",g,!1,!0);eb[a]={pointerType:f,ya:t};ub(F,b);return[c,f,t]})},h:function(a,b,c,d,f,h,g,k,p,q){b=J(b);f=W(d,f);Wa([],[a],function(a){a=a[0];var d= a.name+"."+b,l={get:function(){yb("Cannot access "+d+" due to unbound types",[c,g])},enumerable:!0,configurable:!0};p?l.set=function(){yb("Cannot access "+d+" due to unbound types",[c,g])}:l.set=function(){N(d+" is a read-only property")};Object.defineProperty(a.ba.ja,b,l);Wa([],p?[c,g]:[c],function(c){var g=c[0],l={get:function(){var b=Ab(this,a,d+" getter");return g.fromWireType(f(h,b))},enumerable:!0};if(p){p=W(k,p);var t=c[1];l.set=function(b){var c=Ab(this,a,d+" setter"),f=[];p(q,c,t.toWireType(f, b));zb(f)}}Object.defineProperty(a.ba.ja,b,l);return[]});return[]})},n:function(a,b){b=J(b);Q(a,{name:b,fromWireType:function(a){var b=Y[a].value;Cb(a);return b},toWireType:function(a,b){return lb(b)},argPackAdvance:8,readValueFromPointer:pb,ia:null})},j:function(a,b,c){c=Oa(c);b=J(b);Q(a,{name:b,fromWireType:function(a){return a},toWireType:function(a,b){if("number"!==typeof b&&"boolean"!==typeof b)throw new TypeError('Cannot convert "'+U(b)+'" to '+this.name);return b},argPackAdvance:8,readValueFromPointer:Db(b, c),ia:null})},e:function(a,b,c,d,f,h){var g=Fb(b,c);a=J(a);f=W(d,f);gb(a,function(){yb("Cannot call "+a+" due to unbound types",g)},b-1);Wa([],g,function(c){var d=[c[0],null].concat(c.slice(1)),g=c=a,l=f,k=d.length;2>k&&N("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var O=null!==d[1]&&!1,F=!1,n=1;n>>k}}var p=-1!=b.indexOf("unsigned");Q(a,{name:b,fromWireType:h,toWireType:function(a,c){if("number"!==typeof c&&"boolean"!==typeof c)throw new TypeError('Cannot convert "'+U(c)+'" to '+this.name);if(cf)throw new TypeError('Passing a number "'+U(c)+'" from JS side to C/C++ side to an argument of type "'+b+'", which is outside the valid range ['+d+", "+f+"]!"); return p?c>>>0:c|0},argPackAdvance:8,readValueFromPointer:Gb(b,g,0!==d),ia:null})},b:function(a,b,c){function d(a){a>>=2;var b=E;return new f(b.buffer,b[a+1],b[a])}var f=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][b];c=J(c);Q(a,{name:c,fromWireType:d,argPackAdvance:8,readValueFromPointer:d},{Da:!0})},m:function(a,b){b=J(b);var c="std::string"===b;Q(a,{name:b,fromWireType:function(a){var b=E[a>>2];if(c){var d=C[a+4+b],g=0;0!=d&&(g=d,C[a+4+b]=0);var k= a+4;for(d=0;d<=b;++d){var p=a+4+d;if(0==C[p]){k=na(k);if(void 0===q)var q=k;else q+=String.fromCharCode(0),q+=k;k=p+1}}0!=g&&(C[a+4+b]=g)}else{q=Array(b);for(d=0;d=d&&(d=65536+((d&1023)<<10)|b.charCodeAt(++c)&1023);127>=d?++a:a=2047>=d?a+2:65535>=d?a+3:a+4}return a}:function(){return b.length})(),k=Lb(4+f+1);E[k>>2]=f;if(c&&d)oa(b,k+4,f+1);else if(d)for(d=0;d>2],h=Array(c),q=a+4>>f,l=0;l>2]=h;for(var l=g+4>>f,t=0;t=b?b=pa(2*b):b=Math.min(pa((3*b+2147483648)/4),2147418112);a:{try{B.grow(b-buffer.byteLength+ 65535>>16);va(B.buffer);var c=1;break a}catch(d){}c=void 0}return c?!0:!1},g:function(a){var b=Z.ma[a];Z.ma.splice(a,1);Mb(b)},f:Z,a:y,memory:B,s:function(){},table:ja},Nb=e.asm({},Ia,buffer);e.asm=Nb;e.___embind_register_native_and_builtin_types=function(){return e.asm.A.apply(null,arguments)}; var xb=e.___getTypeName=function(){return e.asm.B.apply(null,arguments)},X=e._free=function(){return e.asm.C.apply(null,arguments)},Lb=e._malloc=function(){return e.asm.D.apply(null,arguments)},Ja=e.globalCtors=function(){return e.asm.X.apply(null,arguments)},Mb=e.stackRestore=function(){return e.asm.Y.apply(null,arguments)},Ib=e.stackSave=function(){return e.asm.Z.apply(null,arguments)};e.dynCall_i=function(){return e.asm.E.apply(null,arguments)}; e.dynCall_ifi=function(){return e.asm.F.apply(null,arguments)};e.dynCall_ii=function(){return e.asm.G.apply(null,arguments)};e.dynCall_iidiiii=function(){return e.asm.H.apply(null,arguments)};e.dynCall_iii=function(){return e.asm.I.apply(null,arguments)};e.dynCall_iiii=function(){return e.asm.J.apply(null,arguments)};e.dynCall_iiiiif=function(){return e.asm.K.apply(null,arguments)};e.dynCall_iiiiiif=function(){return e.asm.L.apply(null,arguments)}; e.dynCall_jiji=function(){return e.asm.M.apply(null,arguments)};e.dynCall_v=function(){return e.asm.N.apply(null,arguments)};e.dynCall_vi=function(){return e.asm.O.apply(null,arguments)};e.dynCall_vif=function(){return e.asm.P.apply(null,arguments)};e.dynCall_vii=function(){return e.asm.Q.apply(null,arguments)};e.dynCall_viii=function(){return e.asm.R.apply(null,arguments)};e.dynCall_viiii=function(){return e.asm.S.apply(null,arguments)};e.dynCall_viiiif=function(){return e.asm.T.apply(null,arguments)}; e.dynCall_viiiii=function(){return e.asm.U.apply(null,arguments)};e.dynCall_viiiiif=function(){return e.asm.V.apply(null,arguments)};e.dynCall_viiiiii=function(){return e.asm.W.apply(null,arguments)};e.asm=Nb;var Ob;e.then=function(a){if(Ob)a(e);else{var b=e.onRuntimeInitialized;e.onRuntimeInitialized=function(){b&&b();a(e)}}return e};H=function Pb(){Ob||Qb();Ob||(H=Pb)}; function Qb(){function a(){if(!Ob&&(Ob=!0,!ka)){xa(za);xa(Aa);if(e.onRuntimeInitialized)e.onRuntimeInitialized();if(e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var a=e.postRun.shift();Ba.unshift(a)}xa(Ba)}}if(!(0