KaraokeTestudaiBackend/lyrics/static/jass/jassub-worker.js

16 lines
38 KiB
JavaScript
Raw Normal View History

2024-12-18 20:57:06 +10:30
"use strict";var Module=function(f={}){var f=f,h;f.ready=new Promise(function(t,r){h=t});var C=function(t){return console.log(t)},y=function(t){return console.error(t)};function _(){h(f)}function A(t,r){if(!t)throw r}var w=null;C=function(t){t==="JASSUB: No usable fontconfig configuration file found, using fallback."?console.debug(t):console.log(t)},y=function(t){t==="Fontconfig error: Cannot load default config file: No such file: (null)"?console.debug(t):console.error(t)},Y=function(t){return function(){t(),self.wasmMemory=B,self.HEAPU8C=new Uint8ClampedArray(B.buffer),self.HEAPU8=new Uint8Array(B.buffer)}}(Y);function F(t){throw t}var j,E,M,O,J,k,fe,le,B,ue;function Y(){var t=B.buffer;j=new Int8Array(t),E=new Int16Array(t),M=new Int32Array(t),O=new Uint8Array(t),J=new Uint16Array(t),k=new Uint32Array(t),fe=new Float32Array(t),le=new Float64Array(t)}if(B=new WebAssembly.Memory({initial:256,maximum:32768}),Y(),(!Math.imul||Math.imul(4294967295,5)!==-5)&&(Math.imul=function(t,r){var n=t>>>16,i=t&65535,o=r>>>16,u=r&65535;return i*u+(n*u+i*o<<16)|0}),!Math.fround){var ce=new Float32Array(1);Math.fround=function(t){return ce[0]=t,ce[0]}}Math.clz32||(Math.clz32=function(t){var r=32,n=t>>16;return n&&(r-=16,t=n),n=t>>8,n&&(r-=8,t=n),n=t>>4,n&&(r-=4,t=n),n=t>>2,n&&(r-=2,t=n),n=t>>1,n?r-2:r-t}),Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)});var de=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function pe(t,r,n){for(var i=r+n,o=r;t[o]&&!(o>=i);)++o;if(o-r>16&&t.buffer&&de)return de.decode(t.subarray(r,o));for(var u="";r<o;){var p=t[r++];if(!(p&128)){u+=String.fromCharCode(p);continue}var l=t[r++]&63;if((p&224)==192){u+=String.fromCharCode((p&31)<<6|l);continue}var v=t[r++]&63;if((p&240)==224?p=(p&15)<<12|l<<6|v:p=(p&7)<<18|l<<12|v<<6|t[r++]&63,p<65536)u+=String.fromCharCode(p);else{var g=p-65536;u+=String.fromCharCode(55296|g>>10,56320|g&1023)}}return u}function X(t,r){return t?pe(O,t,r):""}function Te(t,r,n,i){F("Assertion failed: "+X(t)+", at: "+[r?X(r):"unknown filename",n,i?X(i):"unknown function"])}function Pe(t,r,n){return 0}function Ae(t,r){}function Fe(t,r,n,i){if(!(i>0))return 0;for(var o=n,u=n+i-1,p=0;p<t.length;++p){var l=t.charCodeAt(p);if(l>=55296&&l<=57343){var v=t.charCodeAt(++p);l=65536+((l&1023)<<10)|v&1023}if(l<=127){if(n>=u)break;r[n++]=l}else if(l<=2047){if(n+1>=u)break;r[n++]=192|l>>6,r[n++]=128|l&63}else if(l<=65535){if(n+2>=u)break;r[n++]=224|l>>12,r[n++]=128|l>>6&63,r[n++]=128|l&63}else{if(n+3>=u)break;r[n++]=240|l>>18,r[n++]=128|l>>12&63,r[n++]=128|l>>6&63,r[n++]=128|l&63}}return r[n]=0,n-o}function at(t,r,n){return Fe(t,O,r,n)}function st(t,r,n){}function ot(t,r,n){return 0}function ft(t,r,n,i){}function lt(t,r,n,i){}function ut(t,r){}function ct(t,r,n,i,o){}function $e(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}function dt(){for(var t=new Array(256),r=0;r<256;++r)t[r]=String.fromCharCode(r);Le=t}var Le=void 0;function D(t){for(var r="",n=t;O[n];)r+=Le[O[n++]];return r}var Q={},Z={},ge={},pt=48,gt=57;function Se(t){if(t===void 0)return"_unknown";t=t.replace(/[^a-zA-Z0-9_]/g,"$");var r=t.charCodeAt(0);return r>=pt&&r<=gt?"_"+t:t}function je(t,r){t=Se(t);var n={};return(n[t]=function(){return r.apply(this,arguments)},n)[t]}function Oe(t,r){var n=je(r,function(i){this.name=r,this.message=i;var o=new Error(i).stack;o!==void 0&&(this.stack=this.toString()+`
`+o.replace(/^Error(:[^\n]*)?\n/,""))});return n.prototype=Object.create(t.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},n}var N=void 0;function T(t){throw new N(t)}var He=void 0;function he(t){throw new He(t)}function K(t,r,n){t.forEach(function(l){ge[l]=r});function i(l){var v=n(l);v.length!==t.length&&he("Mismatched type converter count");for(var g=0;g<t.length;++g)x(t[g],v[g])}var o=new Array(r.length),u=[],p=0;r.forEach(function(l,v){Z.hasOwnProperty(l)?o[v]=Z[l]:(u.push(l),Q.hasOwnProperty(l)||(Q[l]=[]),Q[l].push(function(){o[v]=Z[l],++p,p===u.length&&i(o)}))}),u.length===0&&i(o)}function x(t,r,n){if(n=n===void 0?{}:n,!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");var i=r.name;if(t||T('type "'+i+'" must have a positive integer typeid pointer'),Z.hasOwnProperty(t)){if(n.ignoreDuplicateRegistrations)return;T("Cannot register type '"+i+"' twice")}if(Z[t]=r,delete ge[t],Q.hasOwnProperty(t)){var o=Q[t];delete Q[t],o.forEach(function(u){return u()})}}function ht(t,r,n,i,o){var u=$e(n);r=D(r),x(t,{name:r,fromWireType:function(p){return!!p},toWireType:function(p,l){return l?i:o},argPackAdvance:8,readValueFromPointer:function(p){var l;if(n===1)l=j;else if(n===2)l=E;else if(n===4)l=M;else throw new TypeError("Unknown boolean type size: "+r);return this.fromWireType(l[p>>u])},destructorFunction:null})}function vt(t){if(!(this instanceof G)||!(t instanceof G))return!1;for(var r=this.$$.ptrType.registeredClass,n=this.$$.ptr,i=t.$$.ptrType.registeredClass,o=t.$$.ptr;r.baseClass;)n=r.upcast(n),r=r.baseClass;for(;i.baseClass;)o=i.upcast(o),i=i.baseClass;return r===i&&n===o}function yt(t){return{count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}}function Ee(t){function r(n){return n.$$.ptrType.registeredClass.name}T(r(t)+" instance already deleted")}var Me=!1;function Be(t){}function bt(t){t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)}function xe(t){t.count.value-=1;var r=t.count.value===0;r&&bt(t)}function Ve(t,r,n){if(r===n)return t;if(n.baseClass===void 0)return null;var i=Ve(t,r,n.baseClass);return i===null?null:n.downcast(i)}var ze={};function mt(){return Object.keys(re).length}function wt(){var t=[];for(var r in re)re.hasOwnProperty(r)&&t.push(re[r]);return t}var ee=[];function ke(){for(;ee.length;){var t=ee.pop();t.$$.deleteScheduled=!1,t.delete()}}var te=void 0;function Ct(t){te=t,ee.length&&te&&te(ke)}function _t(){f.getInheritedInstanceCount=mt,f.getLiveInheritedInstances=wt,f.flushPendingDeletes=ke,f.setDelayFunction=Ct}var re={};function Tt(t,r){for(r===void 0&&T("ptr should not be undefined");t.baseClass;)r=t.upcast(r),t=t.baseClass;return r}function Pt(t,r){return r=Tt(t,r),re[r]}function ve(t,r){(!r.ptrType||!r.ptr)&&he("makeClassHandle requires ptr and ptrType");var n=!!r.smartPtrType,i=!!r.smartPtr;return n!==i&&he("Both smartPtrType and smartPtr must be specified"),r.count={value:1},ne(Object.create(t,{$$:{value:r}}))}function At(t){var r=this.getPointee(t);if(!r)return this.destructor(t),null;var n=Pt(this.registeredClass,r);if(n!==void 0){if(n.$$.count.value===0)return n.$$.ptr=r,n.$$.smartPtr=t,n.clone();var i=n.clone();return this.destructor(t),i}function o(){return this.isSmartPointer?ve(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:t}):ve(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var u=this.registeredClass.getActualType(r),p=ze[u];if(!p)return o.call(this);var l;this.isConst?l=p.constPointerType:l=p.pointerType;var v=Ve(r,this.registeredClass,l.registeredClass);return v===null?o.call(this):this.isSmartPointer?ve(l.registeredClass.instancePrototype,{ptrType:l,ptr:v,smartPtrType:this,smartPtr:t}):ve(l.registeredClass.instancePrototype,{ptrType:l,ptr:v})}function ne(t){return typeof FinalizationRegistry>"u"?(ne=function(r)
return function `+Se(t)+"("+P+`) {
if (arguments.length !== `+(p-2)+`) {
throwBindingError('function `+t+" called with "+arguments.length+" arguments, expected "+(p-2)+` args!');
}`;v&&(S+=`var destructors = [];
`);var U=v?"destructors":"null",W=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],R=[T,i,o,Ke,r[0],r[1]];l&&(S+="var thisWired = classParam.toWireType("+U+`, this);
`);for(var g=0;g<p-2;++g)S+="var arg"+g+"Wired = argType"+g+".toWireType("+U+", arg"+g+"); // "+r[g+2].name+`
`,W.push("argType"+g),R.push(r[g+2]);if(l&&($="thisWired"+($.length>0?", ":"")+$),S+=(m||u?"var rv = ":"")+"invoker(fn"+($.length>0?", ":"")+$+`);
`,v)S+=`runDestructors(destructors);
`;else for(var g=l?1:2;g<r.length;++g){var L=g===1?"thisWired":"arg"+(g-2)+"Wired";r[g].destructorFunction!==null&&(S+=L+"_dtor("+L+"); // "+r[g].name+`
`,W.push(L+"_dtor"),R.push(r[g].destructorFunction))}return m&&(S+=`var ret = retType.fromWireType(rv);
return ret;
`),S+=`}
`,W.push(S),Gt(Function,W).apply(null,R)}function qt(t,r,n,i,o,u){A(r>0);var p=qe(r,n);o=q(i,o),K([],[t],function(l){l=l[0];var v="constructor "+l.name;if(l.registeredClass.constructor_body===void 0&&(l.registeredClass.constructor_body=[]),l.registeredClass.constructor_body[r-1]!==void 0)throw new N("Cannot register multiple constructors with identical number of parameters ("+(r-1)+") for class '"+l.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return l.registeredClass.constructor_body[r-1]=function(){ae("Cannot construct "+l.name+" due to unbound types",p)},K([],p,function(g){return g.splice(1,0,null),l.registeredClass.constructor_body[r-1]=Ye(v,g,null,o,u),[]}),[]})}function Kt(t,r,n,i,o,u,p,l,v){var g=qe(n,i);r=D(r),u=q(o,u),K([],[t],function(m){m=m[0];var P=m.name+"."+r;r.startsWith("@@")&&(r=Symbol[r.substring(2)]),l&&m.registeredClass.pureVirtualFunctions.push(r);function $(){ae("Cannot call "+P+" due to unbound types",g)}var S=m.registeredClass.instancePrototype,U=S[r];return U===void 0||U.overloadTable===void 0&&U.className!==m.name&&U.argCount===n-2?($.argCount=n-2,$.className=m.name,S[r]=$):(Je(S,r,P),S[r].overloadTable[n-2]=$),K([],g,function(W){var R=Ye(P,W,m,u,p,v);return S[r].overloadTable===void 0?(R.argCount=n-2,S[r]=R):S[r].overloadTable[n-2]=R,[]}),[]})}function Xe(t,r,n){return t instanceof Object||T(n+' with invalid "this": '+t),t instanceof r.registeredClass.constructor||T(n+' incompatible with "this" of type '+t.constructor.name),t.$$.ptr||T("cannot call emscripten binding method "+n+" on deleted object"),ye(t.$$.ptr,t.$$.ptrType.registeredClass,r.registeredClass)}function Yt(t,r,n,i,o,u,p,l,v,g){r=D(r),o=q(i,o),K([],[t],function(m){m=m[0];var P=m.name+"."+r,$={get:function(){ae("Cannot access "+P+" due to unbound types",[n,p])},enumerable:!0,configurable:!0};return v?$.set=function(){ae("Cannot access "+P+" due to unbound types",[n,p])}:$.set=function(S){T(P+" is a read-only property")},Object.defineProperty(m.registeredClass.instancePrototype,r,$),K([],v?[n,p]:[n],function(S){var U=S[0],W={get:function(){var L=Xe(this,m,P+" getter");return U.fromWireType(o(u,L))},enumerable:!0};if(v){v=q(l,v);var R=S[1];W.set=function(L){var oe=Xe(this,m,P+" setter"),I=[];v(g,oe,R.toWireType(I,L)),Ke(I)}}return Object.defineProperty(m.registeredClass.instancePrototype,r,W),[]}),[]})}function Xt(){this.allocated=[void 0],this.freelist=[],this.get=function(t){return this.allocated[t]},this.has=function(t){return this.allocated[t]!==void 0},this.allocate=function(t){var r=this.freelist.pop()||this.allocated.length;return this.allocated[r]=t,r},this.free=function(t){this.allocated[t]=void 0,this.freelist.push(t)}}var H=new Xt;function Qt(t){t>=H.reserved&&--H.get(t).refcount===0&&H.free(t)}function Zt(){for(var t=0,r=H.reserved;r<H.allocated.length;++r)H.allocated[r]!==void 0&&++t;return t}function Nt(){H.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),H.reserved=H.allocated.length,f.count_emval_handles=Zt}var Ue={toValue:function(t){return t||T("Cannot use deleted val. handle = "+t),H.get(t).value},toHandle:function(t){switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return H.allocate({refcount:1,value:t})}}};function er(t,r){r=D(r),x(t,{name:r,fromWireType:function(n){var i=Ue.toValue(n);return Qt(n),i},toWireType:function(n,i){return Ue.toHandle(i)},argPackAdvance:8,readValueFromPointer:be,destructorFunction:null})}function Re(t){if(t===null)return"null";var r=typeof t;return r==="object"||r==="array"||r==="function"?t.toString():""+t}function tr(t,r){switch(r){case 2:return function(n){return this.fromWireType(fe[n>>2])};case 3:return function(n){return this.fromWireType(le[n>>3])};default:throw new TypeError("Unknown float type: "+t)}}function rr(t,r,n){var i=$e(n);r=D(r),x(t,{name:r,fromWireType:function(o){return o},toWireType:function(o,u){return u},argPackAdvance:8,readValueFromPointer:tr(r,i),destructorFunction:null})}function nr(t,r,n){switch(r){case 0:return n?function(o){return j[o]}:f