UNPKG

mdx-m3-viewer

Version:

A browser WebGL model viewer. Mainly focused on models of the games Warcraft 3 and Starcraft 2.

24 lines 951 kB
/*! * The MIT License (MIT) * * Copyright (c) 2013-2021 Chananya Freiman * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ var ModelViewer;(()=>{var e={187:e=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,a=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(n,a){function r(n){e.removeListener(t,i),a(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",r),n([].slice.call(arguments))}p(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&p(e,"error",t,n)}(e,r,{once:!0})}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function o(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function u(e,t,n,a){var r,i,s,u;if(l(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),s=i[t]),void 0===s)s=i[t]=n,++e._eventsCount;else if("function"==typeof s?s=i[t]=a?[n,s]:[s,n]:a?s.unshift(n):s.push(n),(r=o(e))>0&&s.length>r&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,u=c,console&&console.warn&&console.warn(u)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var a={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=c.bind(a);return r.listener=n,a.wrapFn=r,r}function h(e,t,n){var a=e._events;if(void 0===a)return[];var r=a[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(r):m(r,r.length)}function f(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function m(e,t){for(var n=new Array(t),a=0;a<t;++a)n[a]=e[a];return n}function p(e,t,n,a){if("function"==typeof e.on)a.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function r(i){a.once&&e.removeEventListener(t,r),n(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return o(this)},i.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var l=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw l.context=s,l}var o=i[e];if(void 0===o)return!1;if("function"==typeof o)a(o,this,t);else{var u=o.length,c=m(o,u);for(n=0;n<u;++n)a(c[n],this,t)}return!0},i.prototype.addListener=function(e,t){return u(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return u(this,e,t,!0)},i.prototype.once=function(e,t){return l(t),this.on(e,d(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,d(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,a,r,i,s;if(l(t),void 0===(a=this._events))return this;if(void 0===(n=a[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete a[e],a.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(r=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){s=n[i].listener,r=i;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,r),1===n.length&&(a[e]=n[0]),void 0!==a.removeListener&&this.emit("removeListener",e,s||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,a;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var r,i=Object.keys(n);for(a=0;a<i.length;++a)"removeListener"!==(r=i[a])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(a=t.length-1;a>=0;a--)this.removeListener(e,t[a]);return this},i.prototype.listeners=function(e){return h(this,e,!0)},i.prototype.rawListeners=function(e){return h(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},i.prototype.listenerCount=f,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},775:(e,t,n)=>{"use strict";let a,r,i;if(a="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):function(e){let t=0,n=e.length,a=new Uint8Array(n);for(;n>t;)a[t]=e[t++];return a},"function"==typeof(new Uint8Array).indexOf)r=function(e,t,n){return e.indexOf(t,n)};else{let e=[].indexOf;if(0!==e.call(new Uint8Array(1),0))throw Error("missing .indexOf");r=function(t,n,a){return e.call(t,n,a)}}i="function"==typeof Uint8Array.of?Uint8Array.of.bind(Uint8Array):function(){return a(arguments)};const s=function(e){return e instanceof Uint8Array},l="cannot convert invalid utf8 to javascript string",o=";,/?:@&=+$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,-_.!~*'()#".split("").reduce((function(e,t){return e[t.charCodeAt(0)]=!0,e}),{}),u={},c=function(e,t){if("string"!=typeof e)throw new TypeError("to_luastring expects a javascript string");if(t){let t=u[e];if(s(t))return t}let n=e.length,r=Array(n),i=0;for(let t=0;t<n;++t){let a=e.charCodeAt(t);if(a<=127)r[i++]=a;else if(a<=2047)r[i++]=192|a>>6,r[i++]=128|63&a;else{if(a>=55296&&a<=56319&&t+1<n){let n=e.charCodeAt(t+1);n>=56320&&n<=57343&&(t++,a=1024*(a-55296)+n+9216)}a<=65535?(r[i++]=224|a>>12,r[i++]=128|a>>6&63,r[i++]=128|63&a):(r[i++]=240|a>>18,r[i++]=128|a>>12&63,r[i++]=128|a>>6&63,r[i++]=128|63&a)}}return r=a(r),t&&(u[e]=r),r};e.exports.luastring_from=a,e.exports.luastring_indexOf=r,e.exports.luastring_of=i,e.exports.is_luastring=s,e.exports.luastring_eq=function(e,t){if(e!==t){let n=e.length;if(n!==t.length)return!1;for(let a=0;a<n;a++)if(e[a]!==t[a])return!1}return!0},e.exports.to_jsstring=function(e,t,n,a){if(!s(e))throw new TypeError("to_jsstring expects a Uint8Array");n=void 0===n?e.length:Math.min(e.length,n);let r="";for(let i=void 0!==t?t:0;i<n;){let t=e[i++];if(t<128)r+=String.fromCharCode(t);else if(t<194||t>244){if(!a)throw RangeError(l);r+="�"}else if(t<=223){if(i>=n){if(!a)throw RangeError(l);r+="�";continue}let s=e[i++];if(128!=(192&s)){if(!a)throw RangeError(l);r+="�";continue}r+=String.fromCharCode(((31&t)<<6)+(63&s))}else if(t<=239){if(i+1>=n){if(!a)throw RangeError(l);r+="�";continue}let s=e[i++];if(128!=(192&s)){if(!a)throw RangeError(l);r+="�";continue}let o=e[i++];if(128!=(192&o)){if(!a)throw RangeError(l);r+="�";continue}let u=((15&t)<<12)+((63&s)<<6)+(63&o);if(u<=65535)r+=String.fromCharCode(u);else{u-=65536;let e=55296+(u>>10),t=u%1024+56320;r+=String.fromCharCode(e,t)}}else{if(i+2>=n){if(!a)throw RangeError(l);r+="�";continue}let s=e[i++];if(128!=(192&s)){if(!a)throw RangeError(l);r+="�";continue}let o=e[i++];if(128!=(192&o)){if(!a)throw RangeError(l);r+="�";continue}let u=e[i++];if(128!=(192&u)){if(!a)throw RangeError(l);r+="�";continue}let c=((7&t)<<18)+((63&s)<<12)+((63&o)<<6)+(63&u);c-=65536;let d=55296+(c>>10),h=c%1024+56320;r+=String.fromCharCode(d,h)}}return r},e.exports.to_uristring=function(e){if(!s(e))throw new TypeError("to_uristring expects a Uint8Array");let t="";for(let n=0;n<e.length;n++){let a=e[n];o[a]?t+=String.fromCharCode(a):t+="%"+(a<16?"0":"")+a.toString(16)}return t},e.exports.to_luastring=c,e.exports.from_userstring=function(e){if(!s(e)){if("string"!=typeof e)throw new TypeError("expects an array of bytes or javascript string");e=c(e)}return e};const d=c("Lua"),h="Lua 5.3",f="Lua 5.3.4";e.exports.LUA_SIGNATURE=d,e.exports.LUA_VERSION_MAJOR="5",e.exports.LUA_VERSION_MINOR="3",e.exports.LUA_VERSION_NUM=503,e.exports.LUA_VERSION_RELEASE="4",e.exports.LUA_VERSION=h,e.exports.LUA_RELEASE=f,e.exports.LUA_COPYRIGHT="Lua 5.3.4 Copyright (C) 1994-2017 Lua.org, PUC-Rio",e.exports.LUA_AUTHORS="R. Ierusalimschy, L. H. de Figueiredo, W. Celes";const m={LUA_TNONE:-1,LUA_TNIL:0,LUA_TBOOLEAN:1,LUA_TLIGHTUSERDATA:2,LUA_TNUMBER:3,LUA_TSTRING:4,LUA_TTABLE:5,LUA_TFUNCTION:6,LUA_TUSERDATA:7,LUA_TTHREAD:8,LUA_NUMTAGS:9};m.LUA_TSHRSTR=0|m.LUA_TSTRING,m.LUA_TLNGSTR=16|m.LUA_TSTRING,m.LUA_TNUMFLT=0|m.LUA_TNUMBER,m.LUA_TNUMINT=16|m.LUA_TNUMBER,m.LUA_TLCL=0|m.LUA_TFUNCTION,m.LUA_TLCF=16|m.LUA_TFUNCTION,m.LUA_TCCL=32|m.LUA_TFUNCTION;const{LUAI_MAXSTACK:p}=n(947),_=-p-1e3;e.exports.LUA_HOOKCALL=0,e.exports.LUA_HOOKCOUNT=3,e.exports.LUA_HOOKLINE=2,e.exports.LUA_HOOKRET=1,e.exports.LUA_HOOKTAILCALL=4,e.exports.LUA_MASKCALL=1,e.exports.LUA_MASKCOUNT=8,e.exports.LUA_MASKLINE=4,e.exports.LUA_MASKRET=2,e.exports.LUA_MINSTACK=20,e.exports.LUA_MULTRET=-1,e.exports.LUA_OPADD=0,e.exports.LUA_OPBAND=7,e.exports.LUA_OPBNOT=13,e.exports.LUA_OPBOR=8,e.exports.LUA_OPBXOR=9,e.exports.LUA_OPDIV=5,e.exports.LUA_OPEQ=0,e.exports.LUA_OPIDIV=6,e.exports.LUA_OPLE=2,e.exports.LUA_OPLT=1,e.exports.LUA_OPMOD=3,e.exports.LUA_OPMUL=2,e.exports.LUA_OPPOW=4,e.exports.LUA_OPSHL=10,e.exports.LUA_OPSHR=11,e.exports.LUA_OPSUB=1,e.exports.LUA_OPUNM=12,e.exports.LUA_REGISTRYINDEX=_,e.exports.LUA_RIDX_GLOBALS=2,e.exports.LUA_RIDX_LAST=2,e.exports.LUA_RIDX_MAINTHREAD=1,e.exports.constant_types=m,e.exports.lua_Debug=class{constructor(){this.event=NaN,this.name=null,this.namewhat=null,this.what=null,this.source=null,this.currentline=NaN,this.linedefined=NaN,this.lastlinedefined=NaN,this.nups=NaN,this.nparams=NaN,this.isvararg=NaN,this.istailcall=NaN,this.short_src=null,this.i_ci=null}},e.exports.lua_upvalueindex=function(e){return _-e},e.exports.thread_status={LUA_OK:0,LUA_YIELD:1,LUA_ERRRUN:2,LUA_ERRSYNTAX:3,LUA_ERRMEM:4,LUA_ERRGCMM:5,LUA_ERRERR:6}},745:(e,t,n)=>{const a=n(775),r="Fengari 0.1",i="Fengari 0.1.4",s="B. Giannangeli, Daurnimator",l="Fengari 0.1.4 Copyright (C) 2017-2018 "+s+"\nBased on: "+a.LUA_COPYRIGHT;e.exports.FENGARI_AUTHORS=s,e.exports.FENGARI_COPYRIGHT=l,e.exports.FENGARI_RELEASE=i,e.exports.FENGARI_VERSION=r,e.exports.FENGARI_VERSION_MAJOR="0",e.exports.FENGARI_VERSION_MINOR="1",e.exports.FENGARI_VERSION_NUM=1,e.exports.FENGARI_VERSION_RELEASE="4",e.exports.is_luastring=a.is_luastring,e.exports.luastring_eq=a.luastring_eq,e.exports.luastring_from=a.luastring_from,e.exports.luastring_indexOf=a.luastring_indexOf,e.exports.luastring_of=a.luastring_of,e.exports.to_jsstring=a.to_jsstring,e.exports.to_luastring=a.to_luastring,e.exports.to_uristring=a.to_uristring,e.exports.from_userstring=a.from_userstring},973:(e,t,n)=>{"use strict";const{LUA_MULTRET:a,LUA_OPBNOT:r,LUA_OPEQ:i,LUA_OPLE:s,LUA_OPLT:l,LUA_OPUNM:o,LUA_REGISTRYINDEX:u,LUA_RIDX_GLOBALS:c,LUA_VERSION_NUM:d,constant_types:{LUA_NUMTAGS:h,LUA_TBOOLEAN:f,LUA_TCCL:m,LUA_TFUNCTION:p,LUA_TLCF:_,LUA_TLCL:g,LUA_TLIGHTUSERDATA:b,LUA_TLNGSTR:w,LUA_TNIL:v,LUA_TNONE:A,LUA_TNUMFLT:y,LUA_TNUMINT:S,LUA_TSHRSTR:T,LUA_TTABLE:x,LUA_TTHREAD:E,LUA_TUSERDATA:L},thread_status:{LUA_OK:I},from_userstring:U,to_luastring:R}=n(775),{api_check:C}=n(568),M=n(821),B=n(983),{luaU_dump:P}=n(957),k=n(897),O=n(435),D=n(137),{luaS_bless:F,luaS_new:G,luaS_newliteral:N}=n(878),V=n(964),{LUAI_MAXSTACK:H}=n(947),K=n(427),Y=n(718),{ZIO:z}=n(161),q=O.TValue,Z=O.CClosure,j=function(e){e.top++,C(e,e.top<=e.ci.top,"stack overflow")},X=function(e,t){C(e,t<e.top-e.ci.funcOff,"not enough elements in the stack")},$=function(e){if(!e)throw TypeError("invalid argument")},J=function(e){$("number"==typeof e&&(0|e)===e)},W=function(e){return e!==O.luaO_nilobject},Q=function(e,t){let n=e.ci;if(t>0){let a=n.funcOff+t;return C(e,t<=n.top-(n.funcOff+1),"unacceptable index"),a>=e.top?O.luaO_nilobject:e.stack[a]}return t>u?(C(e,0!==t&&-t<=e.top,"invalid index"),e.stack[e.top+t]):t===u?e.l_G.l_registry:(C(e,(t=u-t)<=k.MAXUPVAL+1,"upvalue index too large"),n.func.ttislcf()?O.luaO_nilobject:t<=n.func.value.nupvalues?n.func.value.upvalue[t-1]:O.luaO_nilobject)},ee=function(e,t){let n=e.ci;if(t>0){let a=n.funcOff+t;return C(e,t<=n.top-(n.funcOff+1),"unacceptable index"),a>=e.top?null:a}if(t>u)return C(e,0!==t&&-t<=e.top,"invalid index"),e.top+t;throw Error("attempt to use pseudo-index")},te=function(e,t){let n,a=e.ci.funcOff;t>=0?(C(e,t<=e.stack_last-(a+1),"new top too large"),n=a+1+t):(C(e,-(t+1)<=e.top-(a+1),"invalid new top"),n=e.top+t+1),B.adjust_top(e,n)},ne=function(e,t){te(e,-t-1)},ae=function(e,t,n){for(;t<n;t++,n--){let a=e.stack[t],r=new q(a.type,a.value);O.setobjs2s(e,t,n),O.setobj2s(e,n,r)}},re=function(e,t,n){let a=e.top-1,r=ee(e,t),i=e.stack[r];C(e,W(i)&&t>u,"index not in the stack"),C(e,(n>=0?n:-n)<=a-r+1,"invalid 'n'");let s=n>=0?a-n:r-n-1;ae(e,r,s),ae(e,s+1,e.top-1),ae(e,r,e.top-1)},ie=function(e,t,n){let a=Q(e,t);Q(e,n).setfrom(a)},se=function(e,t,n){if($("function"==typeof t),J(n),0===n)e.stack[e.top]=new q(_,t);else{X(e,n),C(e,n<=k.MAXUPVAL,"upvalue index too large");let a=new Z(e,t,n);for(let t=0;t<n;t++)a.upvalue[t].setfrom(e.stack[e.top-n+t]);for(let t=1;t<n;t++)delete e.stack[--e.top];n>0&&--e.top,e.stack[e.top].setclCvalue(a)}j(e)},le=se,oe=function(e,t){se(e,t,0)},ue=oe,ce=function(e,t,n){let a=G(e,U(n));X(e,1),O.pushsvalue2s(e,a),C(e,e.top<=e.ci.top,"stack overflow"),K.settable(e,t,e.stack[e.top-1],e.stack[e.top-2]),delete e.stack[--e.top],delete e.stack[--e.top]},de=function(e,t){ce(e,Y.luaH_getint(e.l_G.l_registry.value,c),t)},he=function(e,t,n){let a=G(e,U(n));return O.pushsvalue2s(e,a),C(e,e.top<=e.ci.top,"stack overflow"),K.luaV_gettable(e,t,e.stack[e.top-1],e.top-1),e.stack[e.top-1].ttnov()},fe=function(e,t,n){let a=Q(e,t);return J(n),C(e,a.ttistable(),"table expected"),O.pushobj2s(e,Y.luaH_getint(a.value,n)),C(e,e.top<=e.ci.top,"stack overflow"),e.stack[e.top-1].ttnov()},me=function(e,t,n){let a=new O.TValue(x,Y.luaH_new(e));e.stack[e.top]=a,j(e)},pe=function(e,t,n){switch(J(n),t.ttype()){case m:{let e=t.value;return 1<=n&&n<=e.nupvalues?{name:R("",!0),val:e.upvalue[n-1]}:null}case g:{let e=t.value,a=e.p;if(!(1<=n&&n<=a.upvalues.length))return null;let r=a.upvalues[n-1].name;return{name:r?r.getstr():R("(*no name)",!0),val:e.upvals[n-1]}}default:return null}},_e=function(e,t){let n=Q(e,t);if(!n.ttisstring()){if(!K.cvt2str(n))return null;O.luaO_tostring(e,n)}return n.svalue()},ge=_e,be=function(e,t){return K.tointeger(Q(e,t))},we=function(e,t){return K.tonumber(Q(e,t))},ve=new WeakMap,Ae=function(e,t){B.luaD_callnoyield(e,t.funcOff,t.nresults)},ye=function(e,t){let n=Q(e,t);return W(n)?n.ttnov():A},Se=R("?"),Te=function(e,t,n){C(e,n===a||e.ci.top-e.top>=n-t,"results from function overflow current stack size")},xe=function(e,t,n,r,i){C(e,null===i||!(e.ci.callstatus&D.CIST_LUA),"cannot use continuations inside hooks"),X(e,t+1),C(e,e.status===I,"cannot do calls on non-normal thread"),Te(e,t,n);let s=e.top-(t+1);null!==i&&0===e.nny?(e.ci.c_k=i,e.ci.c_ctx=r,B.luaD_call(e,s,n)):B.luaD_callnoyield(e,s,n),n===a&&e.ci.top<e.top&&(e.ci.top=e.top)},Ee=function(e,t,n,r,i,s){let l,o;C(e,null===s||!(e.ci.callstatus&D.CIST_LUA),"cannot use continuations inside hooks"),X(e,t+1),C(e,e.status===I,"cannot do calls on non-normal thread"),Te(e,t,n),o=0===r?0:ee(e,r);let u=e.top-(t+1);if(null===s||e.nny>0){let t={funcOff:u,nresults:n};l=B.luaD_pcall(e,Ae,t,u,o)}else{let t=e.ci;t.c_k=s,t.c_ctx=i,t.extra=u,t.c_old_errfunc=e.errfunc,e.errfunc=o,t.callstatus&=~D.CIST_OAH|e.allowhook,t.callstatus|=D.CIST_YPCALL,B.luaD_call(e,u,n),t.callstatus&=~D.CIST_YPCALL,e.errfunc=t.c_old_errfunc,l=I}return n===a&&e.ci.top<e.top&&(e.ci.top=e.top),l},Le=function(e,t,n){let a=Q(e,t);C(e,a.ttisLclosure(),"Lua function expected");let r=a.value;return J(n),C(e,1<=n&&n<=r.p.upvalues.length,"invalid upvalue index"),{f:r,i:n-1}};e.exports.api_incr_top=j,e.exports.api_checknelems=X,e.exports.lua_absindex=function(e,t){return t>0||t<=u?t:e.top-e.ci.funcOff+t},e.exports.lua_arith=function(e,t){t!==o&&t!==r?X(e,2):(X(e,1),O.pushobj2s(e,e.stack[e.top-1]),C(e,e.top<=e.ci.top,"stack overflow")),O.luaO_arith(e,t,e.stack[e.top-2],e.stack[e.top-1],e.stack[e.top-2]),delete e.stack[--e.top]},e.exports.lua_atpanic=function(e,t){let n=e.l_G.panic;return e.l_G.panic=t,n},e.exports.lua_atnativeerror=function(e,t){let n=e.l_G.atnativeerror;return e.l_G.atnativeerror=t,n},e.exports.lua_call=function(e,t,n){xe(e,t,n,0,null)},e.exports.lua_callk=xe,e.exports.lua_checkstack=function(e,t){let n,a=e.ci;if(C(e,t>=0,"negative 'n'"),e.stack_last-e.top>t)n=!0;else{e.top+D.EXTRA_STACK>H-t?n=!1:(B.luaD_growstack(e,t),n=!0)}return n&&a.top<e.top+t&&(a.top=e.top+t),n},e.exports.lua_compare=function(e,t,n,a){let r=Q(e,t),o=Q(e,n),u=0;if(W(r)&&W(o))switch(a){case i:u=K.luaV_equalobj(e,r,o);break;case l:u=K.luaV_lessthan(e,r,o);break;case s:u=K.luaV_lessequal(e,r,o);break;default:C(e,!1,"invalid option")}return u},e.exports.lua_concat=function(e,t){X(e,t),t>=2?K.luaV_concat(e,t):0===t&&(O.pushsvalue2s(e,F(e,R("",!0))),C(e,e.top<=e.ci.top,"stack overflow"))},e.exports.lua_copy=ie,e.exports.lua_createtable=me,e.exports.lua_dump=function(e,t,n,a){X(e,1);let r=e.stack[e.top-1];return r.ttisLclosure()?P(e,r.value.p,t,n,a):1},e.exports.lua_error=function(e){X(e,1),M.luaG_errormsg(e)},e.exports.lua_gc=function(){},e.exports.lua_getallocf=function(){return console.warn("lua_getallocf is not available"),0},e.exports.lua_getextraspace=function(){return console.warn("lua_getextraspace is not available"),0},e.exports.lua_getfield=function(e,t,n){return he(e,Q(e,t),n)},e.exports.lua_getglobal=function(e,t){return he(e,Y.luaH_getint(e.l_G.l_registry.value,c),t)},e.exports.lua_geti=function(e,t,n){let a=Q(e,t);return J(n),e.stack[e.top]=new q(S,n),j(e),K.luaV_gettable(e,a,e.stack[e.top-1],e.top-1),e.stack[e.top-1].ttnov()},e.exports.lua_getmetatable=function(e,t){let n,a=Q(e,t),r=!1;switch(a.ttnov()){case x:case L:n=a.value.metatable;break;default:n=e.l_G.mt[a.ttnov()]}return null!=n&&(e.stack[e.top]=new q(x,n),j(e),r=!0),r},e.exports.lua_gettable=function(e,t){let n=Q(e,t);return K.luaV_gettable(e,n,e.stack[e.top-1],e.top-1),e.stack[e.top-1].ttnov()},e.exports.lua_gettop=function(e){return e.top-(e.ci.funcOff+1)},e.exports.lua_getupvalue=function(e,t,n){let a=pe(0,Q(e,t),n);if(a){let t=a.name,n=a.val;return O.pushobj2s(e,n),C(e,e.top<=e.ci.top,"stack overflow"),t}return null},e.exports.lua_getuservalue=function(e,t){let n=Q(e,t);C(e,n.ttisfulluserdata(),"full userdata expected");let a=n.value.uservalue;return e.stack[e.top]=new q(a.type,a.value),j(e),e.stack[e.top-1].ttnov()},e.exports.lua_insert=function(e,t){re(e,t,1)},e.exports.lua_isboolean=function(e,t){return ye(e,t)===f},e.exports.lua_iscfunction=function(e,t){let n=Q(e,t);return n.ttislcf(n)||n.ttisCclosure()},e.exports.lua_isfunction=function(e,t){return ye(e,t)===p},e.exports.lua_isinteger=function(e,t){return Q(e,t).ttisinteger()},e.exports.lua_islightuserdata=function(e,t){return ye(e,t)===b},e.exports.lua_isnil=function(e,t){return ye(e,t)===v},e.exports.lua_isnone=function(e,t){return ye(e,t)===A},e.exports.lua_isnoneornil=function(e,t){return ye(e,t)<=0},e.exports.lua_isnumber=function(e,t){return!1!==K.tonumber(Q(e,t))},e.exports.lua_isproxy=function(e,t){let n=ve.get(e);return!!n&&(null===t||t.l_G===n)},e.exports.lua_isstring=function(e,t){let n=Q(e,t);return n.ttisstring()||K.cvt2str(n)},e.exports.lua_istable=function(e,t){return Q(e,t).ttistable()},e.exports.lua_isthread=function(e,t){return ye(e,t)===E},e.exports.lua_isuserdata=function(e,t){let n=Q(e,t);return n.ttisfulluserdata(n)||n.ttislightuserdata()},e.exports.lua_len=function(e,t){let n=Q(e,t),a=new q;K.luaV_objlen(e,a,n),e.stack[e.top]=a,j(e)},e.exports.lua_load=function(e,t,n,a,r){a=a?U(a):Se,null!==r&&(r=U(r));let i=new z(e,t,n),s=B.luaD_protectedparser(e,i,a,r);if(s===I){let t=e.stack[e.top-1].value;if(t.nupvalues>=1){let n=Y.luaH_getint(e.l_G.l_registry.value,c);t.upvals[0].setfrom(n)}}return s},e.exports.lua_newtable=function(e){me(e)},e.exports.lua_newuserdata=function(e,t){let n=function(e,t){return new O.Udata(e,t)}(e,t);return e.stack[e.top]=new O.TValue(L,n),j(e),n.data},e.exports.lua_next=function(e,t){let n=Q(e,t);return C(e,n.ttistable(),"table expected"),e.stack[e.top]=new q,Y.luaH_next(e,n.value,e.top-1)?(j(e),1):(delete e.stack[e.top],delete e.stack[--e.top],0)},e.exports.lua_pcall=function(e,t,n,a){return Ee(e,t,n,a,0,null)},e.exports.lua_pcallk=Ee,e.exports.lua_pop=ne,e.exports.lua_pushboolean=function(e,t){e.stack[e.top]=new q(f,!!t),j(e)},e.exports.lua_pushcclosure=se,e.exports.lua_pushcfunction=oe,e.exports.lua_pushfstring=function(e,t,...n){return t=U(t),O.luaO_pushvfstring(e,t,n)},e.exports.lua_pushglobaltable=function(e){fe(e,u,c)},e.exports.lua_pushinteger=function(e,t){J(t),e.stack[e.top]=new q(S,t),j(e)},e.exports.lua_pushjsclosure=le,e.exports.lua_pushjsfunction=ue,e.exports.lua_pushlightuserdata=function(e,t){e.stack[e.top]=new q(b,t),j(e)},e.exports.lua_pushliteral=function(e,t){if(null==t)e.stack[e.top]=new q(v,null),e.top++;else{$("string"==typeof t);let n=N(e,t);O.pushsvalue2s(e,n),t=n.getstr()}return C(e,e.top<=e.ci.top,"stack overflow"),t},e.exports.lua_pushlstring=function(e,t,n){let a;return J(n),0===n?(t=R("",!0),a=F(e,t)):(t=U(t),C(e,t.length>=n,"invalid length to lua_pushlstring"),a=G(e,t.subarray(0,n))),O.pushsvalue2s(e,a),C(e,e.top<=e.ci.top,"stack overflow"),a.value},e.exports.lua_pushnil=function(e){e.stack[e.top]=new q(v,null),j(e)},e.exports.lua_pushnumber=function(e,t){$("number"==typeof t),e.stack[e.top]=new q(y,t),j(e)},e.exports.lua_pushstring=function(e,t){if(null==t)e.stack[e.top]=new q(v,null),e.top++;else{let n=G(e,U(t));O.pushsvalue2s(e,n),t=n.getstr()}return C(e,e.top<=e.ci.top,"stack overflow"),t},e.exports.lua_pushthread=function(e){return e.stack[e.top]=new q(E,e),j(e),e.l_G.mainthread===e},e.exports.lua_pushvalue=function(e,t){O.pushobj2s(e,Q(e,t)),C(e,e.top<=e.ci.top,"stack overflow")},e.exports.lua_pushvfstring=function(e,t,n){return t=U(t),O.luaO_pushvfstring(e,t,n)},e.exports.lua_rawequal=function(e,t,n){let a=Q(e,t),r=Q(e,n);return W(a)&&W(r)?K.luaV_equalobj(null,a,r):0},e.exports.lua_rawget=function(e,t){let n=Q(e,t);return C(e,n.ttistable(n),"table expected"),O.setobj2s(e,e.top-1,Y.luaH_get(e,n.value,e.stack[e.top-1])),e.stack[e.top-1].ttnov()},e.exports.lua_rawgeti=fe,e.exports.lua_rawgetp=function(e,t,n){let a=Q(e,t);C(e,a.ttistable(),"table expected");let r=new q(b,n);return O.pushobj2s(e,Y.luaH_get(e,a.value,r)),C(e,e.top<=e.ci.top,"stack overflow"),e.stack[e.top-1].ttnov()},e.exports.lua_rawlen=function(e,t){let n=Q(e,t);switch(n.ttype()){case T:case w:return n.vslen();case L:return n.value.len;case x:return Y.luaH_getn(n.value);default:return 0}},e.exports.lua_rawset=function(e,t){X(e,2);let n=Q(e,t);C(e,n.ttistable(),"table expected");let a=e.stack[e.top-2],r=e.stack[e.top-1];Y.luaH_setfrom(e,n.value,a,r),Y.invalidateTMcache(n.value),delete e.stack[--e.top],delete e.stack[--e.top]},e.exports.lua_rawseti=function(e,t,n){J(n),X(e,1);let a=Q(e,t);C(e,a.ttistable(),"table expected"),Y.luaH_setint(a.value,n,e.stack[e.top-1]),delete e.stack[--e.top]},e.exports.lua_rawsetp=function(e,t,n){X(e,1);let a=Q(e,t);C(e,a.ttistable(),"table expected");let r=new q(b,n),i=e.stack[e.top-1];Y.luaH_setfrom(e,a.value,r,i),delete e.stack[--e.top]},e.exports.lua_register=function(e,t,n){oe(e,n),de(e,t)},e.exports.lua_remove=function(e,t){re(e,t,-1),ne(e,1)},e.exports.lua_replace=function(e,t){ie(e,-1,t),ne(e,1)},e.exports.lua_rotate=re,e.exports.lua_setallocf=function(){return console.warn("lua_setallocf is not available"),0},e.exports.lua_setfield=function(e,t,n){ce(e,Q(e,t),n)},e.exports.lua_setglobal=de,e.exports.lua_seti=function(e,t,n){J(n),X(e,1);let a=Q(e,t);e.stack[e.top]=new q(S,n),j(e),K.settable(e,a,e.stack[e.top-1],e.stack[e.top-2]),delete e.stack[--e.top],delete e.stack[--e.top]},e.exports.lua_setmetatable=function(e,t){let n;X(e,1);let a=Q(e,t);switch(e.stack[e.top-1].ttisnil()?n=null:(C(e,e.stack[e.top-1].ttistable(),"table expected"),n=e.stack[e.top-1].value),a.ttnov()){case L:case x:a.value.metatable=n;break;default:e.l_G.mt[a.ttnov()]=n}return delete e.stack[--e.top],!0},e.exports.lua_settable=function(e,t){X(e,2);let n=Q(e,t);K.settable(e,n,e.stack[e.top-2],e.stack[e.top-1]),delete e.stack[--e.top],delete e.stack[--e.top]},e.exports.lua_settop=te,e.exports.lua_setupvalue=function(e,t,n){let a=Q(e,t);X(e,1);let r=pe(0,a,n);if(r){let t=r.name;return r.val.setfrom(e.stack[e.top-1]),delete e.stack[--e.top],t}return null},e.exports.lua_setuservalue=function(e,t){X(e,1);let n=Q(e,t);C(e,n.ttisfulluserdata(),"full userdata expected"),n.value.uservalue.setfrom(e.stack[e.top-1]),delete e.stack[--e.top]},e.exports.lua_status=function(e){return e.status},e.exports.lua_stringtonumber=function(e,t){let n=new q,a=O.luaO_str2num(t,n);return 0!==a&&(e.stack[e.top]=n,j(e)),a},e.exports.lua_toboolean=function(e,t){return!Q(e,t).l_isfalse()},e.exports.lua_tocfunction=function(e,t){let n=Q(e,t);return n.ttislcf()||n.ttisCclosure()?n.value:null},e.exports.lua_todataview=function(e,t){let n=_e(e,t);return new DataView(n.buffer,n.byteOffset,n.byteLength)},e.exports.lua_tointeger=function(e,t){let n=be(e,t);return!1===n?0:n},e.exports.lua_tointegerx=be,e.exports.lua_tojsstring=function(e,t){let n=Q(e,t);if(!n.ttisstring()){if(!K.cvt2str(n))return null;O.luaO_tostring(e,n)}return n.jsstring()},e.exports.lua_tolstring=_e,e.exports.lua_tonumber=function(e,t){let n=we(e,t);return!1===n?0:n},e.exports.lua_tonumberx=we,e.exports.lua_topointer=function(e,t){let n=Q(e,t);switch(n.ttype()){case x:case g:case m:case _:case E:case L:case b:return n.value;default:return null}},e.exports.lua_toproxy=function(e,t){let n=Q(e,t);return function(e,t,n){let a=function(a){C(a,a instanceof D.lua_State&&e===a.l_G,"must be from same global state"),a.stack[a.top]=new q(t,n),j(a)};return ve.set(a,e),a}(e.l_G,n.type,n.value)},e.exports.lua_tostring=ge,e.exports.lua_tothread=function(e,t){let n=Q(e,t);return n.ttisthread()?n.value:null},e.exports.lua_touserdata=function(e,t){let n=Q(e,t);switch(n.ttnov()){case L:return n.value.data;case b:return n.value;default:return null}},e.exports.lua_type=ye,e.exports.lua_typename=function(e,t){return C(e,A<=t&&t<h,"invalid tag"),V.ttypename(t)},e.exports.lua_upvalueid=function(e,t,n){let a=Q(e,t);switch(a.ttype()){case g:{let a=Le(e,t,n);return a.f.upvals[a.i]}case m:{let t=a.value;return C(e,(0|n)===n&&n>0&&n<=t.nupvalues,"invalid upvalue index"),t.upvalue[n-1]}default:return C(e,!1,"closure expected"),null}},e.exports.lua_upvaluejoin=function(e,t,n,a,r){let i=Le(e,t,n),s=Le(e,a,r),l=s.f.upvals[s.i];i.f.upvals[i.i]=l},e.exports.lua_version=function(e){return null===e?d:e.l_G.version},e.exports.lua_xmove=function(e,t,n){if(e!==t){X(e,n),C(e,e.l_G===t.l_G,"moving among independent states"),C(e,t.ci.top-t.top>=n,"stack overflow"),e.top-=n;for(let a=0;a<n;a++)t.stack[t.top]=new O.TValue,O.setobj2s(t,t.top,e.stack[e.top+a]),delete e.stack[e.top+a],t.top++}}},670:(e,t,n)=>{"use strict";const{LUAL_BUFFERSIZE:a}=n(947),{LUA_ERRERR:r,LUA_MULTRET:i,LUA_REGISTRYINDEX:s,LUA_SIGNATURE:l,LUA_TBOOLEAN:o,LUA_TLIGHTUSERDATA:u,LUA_TNIL:c,LUA_TNONE:d,LUA_TNUMBER:h,LUA_TSTRING:f,LUA_TTABLE:m,LUA_VERSION_NUM:p,lua_Debug:_,lua_absindex:g,lua_atpanic:b,lua_call:w,lua_checkstack:v,lua_concat:A,lua_copy:y,lua_createtable:S,lua_error:T,lua_getfield:x,lua_getinfo:E,lua_getmetatable:L,lua_getstack:I,lua_gettop:U,lua_insert:R,lua_isinteger:C,lua_isnil:M,lua_isnumber:B,lua_isstring:P,lua_istable:k,lua_len:O,lua_load:D,lua_newstate:F,lua_newtable:G,lua_next:N,lua_pcall:V,lua_pop:H,lua_pushboolean:K,lua_pushcclosure:Y,lua_pushcfunction:z,lua_pushfstring:q,lua_pushinteger:Z,lua_pushliteral:j,lua_pushlstring:X,lua_pushnil:$,lua_pushstring:J,lua_pushvalue:W,lua_pushvfstring:Q,lua_rawequal:ee,lua_rawget:te,lua_rawgeti:ne,lua_rawlen:ae,lua_rawseti:re,lua_remove:ie,lua_setfield:se,lua_setglobal:le,lua_setmetatable:oe,lua_settop:ue,lua_toboolean:ce,lua_tointeger:de,lua_tointegerx:he,lua_tojsstring:fe,lua_tolstring:me,lua_tonumber:pe,lua_tonumberx:_e,lua_topointer:ge,lua_tostring:be,lua_touserdata:we,lua_type:ve,lua_typename:Ae,lua_version:ye}=n(870),{from_userstring:Se,luastring_eq:Te,to_luastring:xe,to_uristring:Ee}=n(745),Le=r+1,Ie=xe("_LOADED"),Ue=xe("_PRELOAD"),Re=xe("FILE*"),Ce=xe("__name"),Me=xe("__tostring"),Be=new Uint8Array(0);class Pe{constructor(){this.L=null,this.b=Be,this.n=0}}const ke=function(e,t,n){if(0===n||!k(e,-1))return 0;for($(e);N(e,-2);){if(ve(e,-2)===f){if(ee(e,t,-1))return H(e,1),1;if(ke(e,t,n-1))return ie(e,-2),j(e,"."),R(e,-2),A(e,3),1}H(e,1)}return 0},Oe=function(e,t){let n=U(e);if(E(e,xe("f"),t),x(e,s,Ie),ke(e,n+1,2)){let t=be(e,-1);return 95===t[0]&&71===t[1]&&46===t[2]&&(J(e,t.subarray(3)),ie(e,-2)),y(e,-1,n+1),H(e,2),1}return ue(e,n),0},De=function(e,t){Oe(e,t)?(q(e,xe("function '%s'"),be(e,-1)),ie(e,-2)):0!==t.namewhat.length?q(e,xe("%s '%s'"),t.namewhat,t.name):t.what&&109===t.what[0]?j(e,"main chunk"):t.what&&76===t.what[0]?q(e,xe("function <%s:%d>"),t.short_src,t.linedefined):j(e,"?")},Fe=function(e){let t="PANIC: unprotected error in call to Lua API ("+fe(e,-1)+")";throw new Error(t)},Ge=function(e,t,n){let a=new _;return I(e,0,a)?(E(e,xe("n"),a),Te(a.namewhat,xe("method"))&&0===--t?He(e,xe("calling '%s' on bad self (%s)"),a.name,n):(null===a.name&&(a.name=Oe(e,a)?be(e,-1):xe("?")),He(e,xe("bad argument #%d to '%s' (%s)"),t,a.name,n))):He(e,xe("bad argument #%d (%s)"),t,n)},Ne=function(e,t,n){let a;a=dt(e,t,Ce)===f?be(e,-1):ve(e,t)===u?xe("light userdata",!0):Ze(e,t);let r=q(e,xe("%s expected, got %s"),n,a);return Ge(e,t,r)},Ve=function(e,t){let n=new _;I(e,t,n)&&(E(e,xe("Sl",!0),n),n.currentline>0)?q(e,xe("%s:%d: "),n.short_src,n.currentline):J(e,xe(""))},He=function(e,t,...n){return Ve(e,1),Q(e,t,n),A(e,2),T(e)},Ke=function(e,t,n,a){if(t)return K(e,1),1;{let t,r;return $(e),a?(t=a.message,r=-a.errno):(t="Success",r=0),n?q(e,xe("%s: %s"),n,xe(t)):J(e,xe(t)),Z(e,r),3}},Ye=function(e,t){return x(e,s,t)},ze=function(e,t,n){let a=we(e,t);return null!==a&&L(e,t)?(Ye(e,n),ee(e,-1,-2)||(a=null),H(e,2),a):null},qe=function(e,t,n){Ne(e,t,Ae(e,n))},Ze=function(e,t){return Ae(e,ve(e,t))},je=function(e,t){let n=me(e,t);return null==n&&qe(e,t,f),n},Xe=je,$e=function(e,t,n){return ve(e,t)<=0?null===n?null:Se(n):je(e,t)},Je=$e,We=function(e,t){let n=_e(e,t);return!1===n&&qe(e,t,h),n},Qe=function(e,t){let n=he(e,t);return!1===n&&function(e,t){B(e,t)?Ge(e,t,xe("number has no integer representation",!0)):qe(e,t,h)}(e,t),n},et=function(e,t){let n=e.n+t;if(e.b.length<n){let t=Math.max(2*e.b.length,n),a=new Uint8Array(t);a.set(e.b),e.b=a}return e.b.subarray(e.n,n)},tt=function(e,t){t.L=e,t.b=Be},nt=function(e,t,n){if(n>0){t=Se(t),et(e,n).set(t.subarray(0,n)),it(e,n)}},at=function(e,t){t=Se(t),nt(e,t,t.length)},rt=function(e){X(e.L,e.b,e.n),e.n=0,e.b=Be},it=function(e,t){e.n+=t},st=function(e,t,n,a){return ve(e,n)<=0?a:t(e,n)},lt=function(e,t){let n=t.string;return t.string=null,n},ot=function(e,t,n,a,r){return D(e,lt,{string:t},a,r)},ut=function(e,t,n,a){return ot(e,t,0,a,null)},ct=function(e,t){return ut(e,t,t.length,t)},dt=function(e,t,n){if(L(e,t)){J(e,n);let t=te(e,-2);return t===c?H(e,2):ie(e,-2),t}return c},ht=function(e,t,n){return t=g(e,t),dt(e,t,n)!==c&&(W(e,t),w(e,1,1),!0)},ft=xe("%I"),mt=xe("%f"),pt=function(e,t,n){var a=n>>>0,r=t.length,i=e.length+1-r;e:for(;a<i;a++){for(let n=0;n<r;n++)if(e[a+n]!==t[n])continue e;return a}return-1},_t=function(e,t,n){return x(e,t,n)===m||(H(e,1),t=g(e,t),G(e),W(e,-1),se(e,t,n),!1)},gt=function(e,t,n){bt(e,n,xe("too many upvalues",!0));for(let a in t){for(let t=0;t<n;t++)W(e,-n);Y(e,t[a],n),se(e,-(n+2),xe(a))}H(e,n)},bt=function(e,t,n){v(e,t)||(n?He(e,xe("stack overflow (%s)"),n):He(e,xe("stack overflow",!0)))},wt=function(e,t,n,a){let r=a.message,i=be(e,n).subarray(1);return q(e,xe("cannot %s %s: %s"),xe(t),i,xe(r)),ie(e,n),Le};let vt;const At=[239,187,191],yt=function(e){let t=function(e){let t;e.n=0;let n=0;do{if(t=vt(e),null===t||t!==At[n])return t;n++,e.buff[e.n++]=t}while(n<At.length);return e.n=0,vt(e)}(e);if(35===t){do{t=vt(e)}while(t&&10!==t);return{skipped:!0,c:vt(e)}}return{skipped:!1,c:t}};let St;{class e{constructor(){this.n=NaN,this.f=null,this.buff=new Uint8Array(1024),this.pos=0,this.err=void 0}}const t=function(e,t){let n=t;if(null!==n.f&&n.n>0){let e=n.n;return n.n=0,n.f=n.f.subarray(n.pos),n.buff.subarray(0,e)}let a=n.f;return n.f=null,a};vt=function(e){return e.pos<e.f.length?e.f[e.pos++]:null},St=function(n,a,r){let i=new e,s=U(n)+1;if(null===a)throw new Error("Can't read stdin in the browser");{q(n,xe("@%s"),a);let e=Ee(a),t=new XMLHttpRequest;if(t.open("GET",e,!1),"undefined"==typeof window&&(t.responseType="arraybuffer"),t.send(),!(t.status>=200&&t.status<=299))return i.err=t.status,wt(n,"open",s,{message:`${t.status}: ${t.statusText}`});"string"==typeof t.response?i.f=xe(t.response):i.f=new Uint8Array(t.response)}let o=yt(i);o.c===l[0]&&a||o.skipped&&(i.buff[i.n++]=10),null!==o.c&&(i.buff[i.n++]=o.c);let u=D(n,t,i,be(n,-1),r),c=i.err;return c?(ue(n,s),wt(n,"read",s,c)):(ie(n,s),u)}}const Tt=function(e,t){return St(e,t,null)},xt=function(e,t,n){let a=ye(e);72!=n&&He(e,xe("core and library have incompatible numeric types")),a!=ye(null)?He(e,xe("multiple Lua VMs detected")):a!==t&&He(e,xe("version mismatch: app. needs %f, Lua core provides %f"),t,a)};e.exports.Ye=Qe,e.exports.qZ=We,e.exports.zH=Xe,e.exports.Tl=ct,e.exports.AH=function(){let e=F();return e&&b(e,Fe),e},e.exports.b6=function(e,t){let n;return M(e,-1)?(H(e,1),-1):(t=g(e,t),ne(e,t,0),n=de(e,-1),H(e,1),0!==n?(ne(e,t,n),re(e,t,0)):n=ae(e,t)+1,re(e,t,n),n)},e.exports.bm=function(e,t){if(ht(e,t,Me))P(e,-1)||He(e,xe("'__tostring' must return a string"));else{switch(ve(e,t)){case h:C(e,t)?q(e,ft,de(e,t)):q(e,mt,pe(e,t));break;case f:W(e,t);break;case o:j(e,ce(e,t)?"true":"false");break;case c:j(e,"nil");break;default:{let n=dt(e,t,Ce),a=n===f?be(e,-1):Ze(e,t);q(e,xe("%s: %p"),a,ge(e,t)),n!==c&&ie(e,-2);break}}}return me(e,-1)},e.exports.i$=function(e,t,n){n>=0&&(t=g(e,t),ne(e,t,0),re(e,t,n),Z(e,n),re(e,t,0))}},807:(e,t,n)=>{"use strict";const{LUA_MULTRET:a,LUA_OPADD:r,LUA_OPBAND:i,LUA_OPBNOT:s,LUA_OPBOR:l,LUA_OPBXOR:o,LUA_OPDIV:u,LUA_OPIDIV:c,LUA_OPMOD:d,LUA_OPSHL:h,LUA_OPSHR:f,LUA_OPUNM:m,constant_types:{LUA_TBOOLEAN:p,LUA_TLIGHTUSERDATA:_,LUA_TLNGSTR:g,LUA_TNIL:b,LUA_TNUMFLT:w,LUA_TNUMINT:v,LUA_TTABLE:A},to_luastring:y}=n(775),{lua_assert:S}=n(568),T=n(278),x=n(435),E=n(159),L=n(391),I=n(718),U=n(427),R=E.OpCodesI,C=x.TValue,M=-1,B={OPR_ADD:0,OPR_SUB:1,OPR_MUL:2,OPR_MOD:3,OPR_POW:4,OPR_DIV:5,OPR_IDIV:6,OPR_BAND:7,OPR_BOR:8,OPR_BXOR:9,OPR_SHL:10,OPR_SHR:11,OPR_CONCAT:12,OPR_EQ:13,OPR_LT:14,OPR_LE:15,OPR_NE:16,OPR_GT:17,OPR_GE:18,OPR_AND:19,OPR_OR:20,OPR_NOBINOPR:21},P={OPR_MINUS:0,OPR_BNOT:1,OPR_NOT:2,OPR_LEN:3,OPR_NOUNOPR:4},k=function(e){return e.t!==e.f},O=function(e,t){let n=L.expkind;if(k(e))return!1;switch(e.k){case n.VKINT:return!t||new C(v,e.u.ival);case n.VKFLT:return!t||new C(w,e.u.nval);default:return!1}},D=function(e,t,n){let a,r=t+n-1;if(e.pc>e.lasttarget&&(a=e.f.code[e.pc-1],a.opcode===R.OP_LOADNIL)){let e=a.A,n=e+a.B;if(e<=t&&t<=n+1||t<=e&&e<=r+1)return e<t&&(t=e),n>r&&(r=n),E.SETARG_A(a,t),void E.SETARG_B(a,r-t)}Q(e,R.OP_LOADNIL,t,n-1,0)},F=function(e,t){return e.f.code[t.u.info]},G=function(e,t){let n=e.f.code[t].sBx;return n===M?M:t+1+n},N=function(e,t,n){let a=e.f.code[t],r=n-(t+1);S(n!==M),Math.abs(r)>E.MAXARG_sBx&&T.luaX_syntaxerror(e.ls,y("control structure too long",!0)),E.SETARG_sBx(a,r)},V=function(e,t,n){if(n===M)return t;if(t===M)t=n;else{let a=t,r=G(e,a);for(;r!==M;)a=r,r=G(e,a);N(e,a,n)}return t},H=function(e){let t=e.jpc;e.jpc=M;let n=te(e,R.OP_JMP,0,M);return n=V(e,n,t),n},K=function(e,t,n,a,r){return Q(e,t,n,a,r),H(e)},Y=function(e){return e.lasttarget=e.pc,e.pc},z=function(e,t){return t>=1&&E.testTMode(e.f.code[t-1].opcode)?t-1:t},q=function(e,t){return e.f.code[z(e,t)]},Z=function(e,t,n){let a=z(e,t),r=e.f.code[a];return r.opcode===R.OP_TESTSET&&(n!==E.NO_REG&&n!==r.B?E.SETARG_A(r,n):e.f.code[a]=E.CREATE_ABC(R.OP_TEST,r.B,0,r.C),!0)},j=function(e,t){for(;t!==M;t=G(e,t))Z(e,t,E.NO_REG)},X=function(e,t,n,a,r){for(;t!==M;){let i=G(e,t);Z(e,t,a)?N(e,t,n):N(e,t,r),t=i}},$=function(e,t){Y(e),e.jpc=V(e,e.jpc,t)},J=function(e,t,n){n===e.pc?$(e,t):(S(n<e.pc),X(e,t,n,E.NO_REG,n))},W=function(e,t){let n=e.f;return function(e){X(e,e.jpc,e.pc,E.NO_REG,e.pc),e.jpc=M}(e),n.code[e.pc]=t,n.lineinfo[e.pc]=e.ls.lastline,e.pc++},Q=function(e,t,n,a,r){return S(E.getOpMode(t)===E.iABC),S(E.getBMode(t)!==E.OpArgN||0===a),S(E.getCMode(t)!==E.OpArgN||0===r),S(n<=E.MAXARG_A&&a<=E.MAXARG_B&&r<=E.MAXARG_C),W(e,E.CREATE_ABC(t,n,a,r))},ee=function(e,t,n,a){return S(E.getOpMode(t)===E.iABx||E.getOpMode(t)===E.iAsBx),S(E.getCMode(t)===E.OpArgN),S(n<=E.MAXARG_A&&a<=E.MAXARG_Bx),W(e,E.CREATE_ABx(t,n,a))},te=function(e,t,n,a){return ee(e,t,n,a+E.MAXARG_sBx)},ne=function(e,t){return S(t<=E.MAXARG_Ax),W(e,E.CREATE_Ax(R.OP_EXTRAARG,t))},ae=function(e,t,n){if(n<=E.MAXARG_Bx)return ee(e,R.OP_LOADK,t,n);{let a=ee(e,R.OP_LOADKX,t,0);return ne(e,n),a}},re=function(e,t){let n=e.freereg+t;n>e.f.maxstacksize&&(n>=255&&T.luaX_syntaxerror(e.ls,y("function or expression needs too many registers",!0)),e.f.maxstacksize=n)},ie=function(e,t){re(e,t),e.freereg+=t},se=function(e,t){!E.ISK(t)&&t>=e.nactvar&&(e.freereg--,S(t===e.freereg))},le=function(e,t){t.k===L.expkind.VNONRELOC&&se(e,t.u.info)},oe=function(e,t,n){let a=t.k===L.expkind.VNONRELOC?t.u.info:-1,r=n.k===L.expkind.VNONRELOC?n.u.info:-1;a>r?(se(e,a),se(e,r)):(se(e,r),se(e,a))},ue=function(e,t,n){let a=e.f,r=I.luaH_get(e.L,e.ls.h,t);if(r.ttisinteger()){let t=r.value;if(t<e.nk&&a.k[t].ttype()===n.ttype()&&a.k[t].value===n.value)return t}let i=e.nk;return I.luaH_setfrom(e.L,e.ls.h,t,new x.TValue(v,i)),a.k[i]=n,e.nk++,i},ce=function(e,t){let n=new C(_,t),a=new C(v,t);return ue(e,n,a)},de=function(e,t){let n=new C(w,t);return ue(e,n,n)},he=function(e,t){let n=new C(p,t);return ue(e,n,n)},fe=function(e,t,n){let r=L.expkind;if(t.k===r.VCALL)E.SETARG_C(F(e,t),n+1);else if(t.k===r.VVARARG){let a=F(e,t);E.SETARG_B(a,n+1),E.SETARG_A(a,e.freereg),ie(e,1)}else S(n===a)},me=function(e,t){let n=L.expkind;t.k===n.VCALL?(S(2===F(e,t).C),t.k=n.VNONRELOC,t.u.info=F(e,t).A):t.k===n.VVARARG&&(E.SETARG_B(F(e,t),2),t.k=n.VRELOCABLE)},pe=function(e,t){let n=L.expkind;switch(t.k){case n.VLOCAL:t.k=n.VNONRELOC;break;case n.VUPVAL:t.u.info=Q(e,R.OP_GETUPVAL,0,t.u.info,0),t.k=n.VRELOCABLE;break;case n.VINDEXED:{let a;se(e,t.u.ind.idx),t.u.ind.vt===n.VLOCAL?(se(e,t.u.ind.t),a=R.OP_GETTABLE):(S(t.u.ind.vt===n.VUPVAL),a=R.OP_GETTABUP),t.u.info=Q(e,a,0,t.u.ind.t,t.u.ind.idx),t.k=n.VRELOCABLE;break}case n.VVARARG:case n.VCALL:me(e,t)}},_e=function(e,t,n,a){return Y(e),Q(e,R.OP_LOADBOOL,t,n,a)},ge=function(e,t,n){let a=L.expkind;switch(pe(e,t),t.k){case a.VNIL:D(e,n,1);break;case a.VFALSE:case a.VTRUE:Q(e,R.OP_LOADBOOL,n,t.k===a.VTRUE,0);break;case a.VK:ae(e,n,t.u.info);break;case a.VKFLT:ae(e,n,de(e,t.u.nval));break;case a.VKINT:ae(e,n,ce(e,t.u.ival));break;case a.VRELOCABLE:{let a=F(e,t);E.SETARG_A(a,n);break}case a.VNONRELOC:n!==t.u.info&&Q(e,R.OP_MOVE,n,t.u.info,0);break;default:return void S(t.k===a.VJMP)}t.u.info=n,t.k=a.VNONRELOC},be=function(e,t){t.k!==L.expkind.VNONRELOC&&(ie(e,1),ge(e,t,e.freereg-1))},we=function(e,t){for(;t!==M;t=G(e,t)){if(q(e,t).opcode!==R.OP_TESTSET)return!0}return!1},ve=function(e,t,n){let a=L.expkind;if(ge(e,t,n),t.k===a.VJMP&&(t.t=V(e,t.t,t.u.info)),k(t)){let r,i=M,s=M;if(we(e,t.t)||we(e,t.f)){let r=t.k===a.VJMP?M:H(e);i=_e(e,n,0,1),s=_e(e,n,1,0),$(e,r)}r=Y(e),X(e,t.f,r,n,i),X(e,t.t,r,n,s)}t.f=t.t=M,t.u.info=n,t.k=a.VNONRELOC},Ae=function(e,t){pe(e,t),le(e,t),ie(e,1),ve(e,t,e.freereg-1)},ye=function(e,t){if(pe(e,t),t.k===L.expkind.VNONRELOC){if(!k(t))return t.u.info;if(t.u.info>=e.nactvar)return ve(e,t,t.u.info),t.u.info}return Ae(e,t),t.u.info},Se=function(e,t){k(t)?ye(e,t):pe(e,t)},Te=function(e,t){let n=L.expkind,a=!1;switch(Se(e,t),t.k){case n.VTRUE:t.u.info=he(e,!0),a=!0;break;case n.VFALSE:t.u.info=he(e,!1),a=!0;break;case n.VNIL:t.u.info=function(e){let t=new C(b,null),n=new C(A,e.ls.h);return ue(e,n,t)}(e),a=!0;break;case n.VKINT:t.u.info=ce(e,t.u.ival),a=!0;break;case n.VKFLT:t.u.info=de(e,t.u.nval),a=!0;break;case n.VK:a=!0}return a&&(t.k=n.VK,t.u.info<=E.MAXINDEXRK)?E.RKASK(t.u.info):ye(e,t)},xe=function(e,t){let n=q(e,t.u.info);S(E.testTMode(n.opcode)&&n.opcode!==R.OP_TESTSET&&n.opcode!==R.OP_TEST),E.SETARG_A(n,!n.A)},Ee=function(e,t,n){if(t.k===L.expkind.VRELOCABLE){let a=F(e,t);if(a.opcode===R.OP_NOT)return e.pc--,K(e,R.OP_TEST,a.B,0,!n)}return be(e,t),le(e,t),K(e,R.OP_TESTSET,E.NO_REG,t.u.info,n)},Le=function(e,t){let n,a=L.expkind;switch(pe(e,t),t.k){case a.VJMP:xe(e,t),n=t.u.info;break;case a.VK:case a.VKFLT:case a.VKINT:case a.VTRUE:n=M;break;default:n=Ee(e,t,0)}t.f=V(e,t.f,n),$(e,t.t),t.t=M},Ie=function(e,t){let n,a=L.expkind;switch(pe(e,t),t.k){case a.VJMP:n=t.u.info;break;case a.VNIL:case a.VFALSE:n=M;break;default:n=Ee(e,t,1)}t.t=V(e,t.t,n),$(e,t.f),t.f=M},Ue=function(e,t,n){let a,r,m=L.expkind;if(!(a=O(t,!0))||!(r=O(n,!0))||!function(e,t,n){switch(e){case i:case l:case o:case h:case f:case s:return!1!==U.tointeger(t)&&!1!==U.tointeger(n);case u:case c:case d:return 0!==n.value;default:return 1}}(e,a,r))return 0;let p=new C;if(x.luaO_arith(null,e,a,r,p),p.ttisinteger())t.k=m.VKINT,t.u.ival=p.value;else{let e=p.value;if(isNaN(e)||0===e)return!1;t.k=m.VKFLT,t.u.nval=e}return!0},Re=function(e,t,n,a,r){let i=Te(e,a),s=Te(e,n);oe(e,n,a),n.u.info=Q(e,t,0,s,i),n.k=L.expkind.VRELOCABLE,Ce(e,r)},Ce=function(e,t){e.f.lineinfo[e.pc-1]=t};e.exports.BinOpr=B,e.exports.NO_JUMP=M,e.exports.UnOpr=P,e.exports.getinstruction=F,e.exports.luaK_checkstack=re,e.exports.luaK_code=W,e.exports.luaK_codeABC=Q,e.exports.luaK_codeABx=ee,e.exports.luaK_codeAsBx=te,e.exports.luaK_codek=ae,e.exports.luaK_concat=V,e.exports.luaK_dischargevars=pe,e.exports.luaK_exp2RK=Te,e.exports.luaK_exp2anyreg=ye,e.exports.luaK_exp2anyregup=function(e,t){(t.k!==L.expkind.VUPVAL||k(t))&&ye(e,t)},e.exports.luaK_exp2nextreg=Ae,e.exports.luaK_exp2val=Se,e.exports.luaK_fixline=Ce,e.exports.luaK_getlabel=Y,e.exports.luaK_goiffalse=Ie,e.exports.luaK_goiftrue=Le,e.exports.luaK_indexed=function(e,t,n){let a=L.expkind;S(!k(t)&&(L.vkisinreg(t.k)||t.k===a.VUPVAL)),t.u.ind.t=t.u.info,t.u.ind.idx=Te(e,n),t.u.ind.vt=t.k===a.VUPVAL?a.VUPVAL:a.VLOCAL,t.k=a.VINDEXED},e.exports.luaK_infix=function(e,t,n){switch(t){case B.OPR_AND:Le(e,n);break;case B.OPR_OR:Ie(e,n);break;case B.OPR_CONCAT:Ae(e,n);break;case B.OPR_ADD:case B.OPR_SUB:case B.OPR_MUL:case B.OPR_DIV:case B.OPR_IDIV:case B.OPR_MOD:case B.OPR_POW:case B.OPR_BAND:case B.OPR_BOR:case B.OPR_BXOR:case B.OPR_SHL:case B.OPR_SHR:O(n,!1)||Te(e,n);break;default:Te(e,n)}},e.exports.luaK_intK=ce,e.exports.luaK_jump=H,e.exports.luaK_jumpto=function(e,t){return J(e,H(e),t)},e.exports.luaK_nil=D,e.exports.luaK_numberK=de,e.exports.luaK_patchclose=function(e,t,n){for(n++;t!==M;t=G(e,t)){let a=e.f.code[t];S(a.opcode===R.OP_JMP&&(0===a.A||a.A>=n)),E.SETARG_A(a,n)}},e.exports.luaK_patchlist=J,e.exports.luaK_patchtohere=$,e.exports.luaK_posfix=function(e,t,n,a,i){let s=L.expkind;switch(t){case B.OPR_AND:S(n.t===M),pe(e,a),a.f=V(e,a.f,n.f),n.to(a);break;case B.OPR_OR:S(n.f===M),pe(e,a),a.t=V(e,a.t,n.t),n.to(a);break;case B.OPR_CONCAT:{Se(e,a);let t=F(e,a);a.k===s.VRELOCABLE&&t.opcode===R.OP_CONCAT?(S(n.u.info===t.B-1),le(e,n),E.SETARG_B(t,n.u.info),n.k=s.VRELOCABLE,n.u.info=a.u.info):(Ae(e,a),Re(e,R.OP_CONCAT,n,a,i));break}case B.OPR_ADD:case B.OPR_SUB:case B.OPR_MUL:case B.OPR_DIV:case B.OPR_IDIV:case B.OPR_MOD:case B.OPR_POW:case B.OPR_BAND:case B.OPR_BOR:case B.OPR_BXOR:case B.OPR_SHL:case B.OPR_SHR:Ue(t+r,n,a)||Re(e,t+R.OP_ADD,n,a,i);break;case B.OPR_EQ:case B.OPR_LT:case B.OPR_LE:case B.OPR_NE:case B.OPR_GT:case B.OPR_GE:!function(e,t,n,a){let r,i=L.expkind;n.k===i.VK?r=E.RKASK(n.u.info):(S(n.k===i.VNONRELOC),r=n.u.info);let s=Te(e,a);switch(oe(e,n,a),t){case B.OPR_NE:n.u.info=K(e,R.OP_EQ,0,r,s);break;case B.OPR_GT:case B.OPR_GE:{let a=t-B.OPR_NE+R.OP_EQ;n.u.info=K(e,a,1,s,r);break}default:{let a=t-B.OPR_EQ+R.OP_EQ;n.u.info=K(e,a,1,r,s);break}}n.k=i.VJMP}(e,t,n,a)}return n},e.exports.luaK_prefix=function(e,t,n,a){let r=new L.expdesc;switch(r.k=L.expkind.VKINT,r.u.ival=r.u.nval=r.u.info=0,r.t=M,r.f=M,t){case P.OPR_MINUS:case P.OPR_BNOT:if(Ue(t+m,n,r))break;case P.OPR_LEN:!function(e,t,n,a){let r=ye(e,n);le(e,n),n.u.info=Q(e,t,0,r,0),n.k=L.expkind.VRELOCABLE,Ce(e,a)}(e,t+R.OP_UNM,n,a);break;case P.OPR_NOT:!function(e,t){let n=L.expkind;switch(pe(e,t),t.k){case n.VNIL:case n.VFALSE:t.k=n.VTRUE;break;case n.VK:case n.VKFLT:case n.VKINT:case n.VTRUE:t.k=n.VFALSE;break;case n.VJMP:xe(e,t);break;case n.VRELOCABLE:case n.VNONRELOC:be(e,t),le(e,t),t.u.info=Q(e,R.OP_NOT,0,t.u.info,0),t.k=n.VRELOCABLE}{let e=t.f;t.f=t.t,t.t=e}j(e,t.f),j(e,t.t)}(e,n)}},e.exports.luaK_reserveregs=ie,e.exports.luaK_ret=function(e,t,n){Q(e,R.OP_RETURN,t,n+1,0)},e.exports.luaK_self=function(e,t,n){ye(e,t);let a=t.u.info;le(e,t),t.u.info=e.freereg,t.k=L.expkind.VNONRELOC,ie(e,2),Q(e,R.OP_SELF,t.u.info,a,Te(e,n)),le(e,n)},e.exports.luaK_setlist=function(e,t,n,r){let i=(n-1)/E.LFIELDS_PER_FLUSH+1,s=r===a?0:r;S(0!==r&&r<=E.LFIELDS_PER_FLUSH),i<=E.MAXARG_C?Q(e,R.OP_SETLIST,t,s,i):i<=E.MAXARG_Ax?(Q(e,R.OP_SETLIST,t,s,0),ne(e,i)):T.luaX_syntaxerror(e.ls,y("constructor too long",!0)),e.freereg=t+1},e.exports.luaK_setmultret=function(e,t){fe(e,t,a)},e.exports.luaK_setoneret=me,e.exports.luaK_setreturns=fe,e.exports.luaK_storevar=function(e,t,n){let a=L.expkind;switch(t.k){case a.VLOCAL:return le(e,n),void ve(e,n,t.u.info);case a.VUPVAL:{let a=ye(e,n);Q(e,R.OP_SETUPVAL,a,t.u.info,0);break}case a.VINDEXED:{let r=t.u.ind.vt===a.VLOCAL?R.OP_SETTABLE:R.OP_SETTABUP,i=Te(e,n);Q(e,r,t.u.ind.t,t.u.ind.idx,i);break}}le(e,n)},e.exports.luaK_stringK=function(e,t){let n=new C(g,t);return ue(e,n,n)}},821:(e,t,n)=>{"use strict";const{LUA_HOOKCOUNT:a,LUA_HOOKLINE:r,LUA_MASKCOUNT:i,LUA_MASKLINE:s,constant_types:{LUA_TBOOLEAN:l,LUA_TNIL:o,LUA_TTABLE:u},thread_status:{LUA_ERRRUN:c,LUA_YIELD:d},from_userstring:h,luastring_eq:f,luastring_indexOf:m,to_luastring:p}=n(775),{api_check:_,lua_assert:g}=n(568),{LUA_IDSIZE:b}=n(947),w=n(973),v=n(983),A=n(897),y=n(278),S=n(435),T=n(159),x=n(137),E=n(718),L=n(964),I=n(427),U=function(e){return g(e.callstatus&x.CIST_LUA),e.l_savedpc-1},R=function(e){return 0!==e.func.value.p.lineinfo.length?e.func.value.p.lineinfo[U(e)]:-1},C=function(e){if(e.status===d){let t=e.ci,n=t.funcOff;t.func=e.stack[t.extra],t.funcOff=t.extra,t.extra=n}},M=function(e,t){g(t<e.upvalues.length);let n=e.upvalues[t].name;return null===n?p("?",!0):n.getstr()},B=function(e,t,n){let a,r=null;if(t.callstatus&x.CIST_LUA){if(n<0)return function(e,t){let n=e.func.value.p.numparams;return t>=e.l_base-e.funcOff-n?null:{pos:e.funcOff+n+t,name:p("(*vararg)",!0)}}(t,-n);a=t.l_base,r=A.luaF_getlocalname(t.func.value.p,n,U(t))}else a=t.funcOff+1;if(null===r){if(!((t===e.ci?e.top:t.next.funcOff)-a>=n&&n>0))return null;r=p("(*temporary)",!0)}return{pos:a+(n-1),name:r}},P=function(e,t){if(null===t||t instanceof S.CClosure)e.source=p("=[JS]",!0),e.linedefined=-1,e.lastlinedefined=-1,e.what=p("J",!0);else{let n=t.p;e.source=n.source?n.source.getstr():p("=?",!0),e.linedefined=n.linedefined,e.lastlinedefined=n.lastlinedefined,e.what=0===e.linedefined?p("main",!0):p("Lua",!0)}e.short_src=S.luaO_ch