@evitcastudio/kit
Version:
A single-player/multiplayer framework for the Vylocity Game Engine.
1 lines • 612 kB
JavaScript
(()=>{var __webpack_modules__={8505:e=>{"use strict";function t(e,t,n){e instanceof RegExp&&(e=_(e,n)),t instanceof RegExp&&(t=_(t,n));var s=i(e,t,n);return s&&{start:s[0],end:s[1],pre:n.slice(0,s[0]),body:n.slice(s[0]+e.length,s[1]),post:n.slice(s[1]+t.length)}}function _(e,t){var _=t.match(e);return _?_[0]:null}function i(e,t,_){var i,n,s,r,o,a=_.indexOf(e),E=_.indexOf(t,a+1),c=a;if(a>=0&&E>0){if(e===t)return[a,E];for(i=[],s=_.length;c>=0&&!o;)c==a?(i.push(c),a=_.indexOf(e,c+1)):1==i.length?o=[i.pop(),E]:((n=i.pop())<s&&(s=n,r=E),E=_.indexOf(t,c+1)),c=a<E&&a>=0?a:E;i.length&&(o=[s,r])}return o}e.exports=t,t.range=i},8928:(e,t,_)=>{var i=_(9818),n=_(8505);e.exports=function(e){return e?("{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2)),f(function(e){return e.split("\\\\").join(s).split("\\{").join(r).split("\\}").join(o).split("\\,").join(a).split("\\.").join(E)}(e),!0).map(l)):[]};var s="\0SLASH"+Math.random()+"\0",r="\0OPEN"+Math.random()+"\0",o="\0CLOSE"+Math.random()+"\0",a="\0COMMA"+Math.random()+"\0",E="\0PERIOD"+Math.random()+"\0";function c(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function l(e){return e.split(s).join("\\").split(r).join("{").split(o).join("}").split(a).join(",").split(E).join(".")}function h(e){if(!e)return[""];var t=[],_=n("{","}",e);if(!_)return e.split(",");var i=_.pre,s=_.body,r=_.post,o=i.split(",");o[o.length-1]+="{"+s+"}";var a=h(r);return r.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),t.push.apply(t,o),t}function u(e){return"{"+e+"}"}function R(e){return/^-?0\d/.test(e)}function y(e,t){return e<=t}function A(e,t){return e>=t}function f(e,t){var _=[],s=n("{","}",e);if(!s||/\$$/.test(s.pre))return[e];var r,a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),E=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),l=a||E,v=s.body.indexOf(",")>=0;if(!l&&!v)return s.post.match(/,.*\}/)?f(e=s.pre+"{"+s.body+o+s.post):[e];if(l)r=s.body.split(/\.\./);else if(1===(r=h(s.body)).length&&1===(r=f(r[0],!1).map(u)).length)return(T=s.post.length?f(s.post,!1):[""]).map(function(e){return s.pre+r[0]+e});var O,d=s.pre,T=s.post.length?f(s.post,!1):[""];if(l){var N=c(r[0]),p=c(r[1]),I=Math.max(r[0].length,r[1].length),C=3==r.length?Math.abs(c(r[2])):1,g=y;p<N&&(C*=-1,g=A);var S=r.some(R);O=[];for(var D=N;g(D,p);D+=C){var M;if(E)"\\"===(M=String.fromCharCode(D))&&(M="");else if(M=String(D),S){var m=I-M.length;if(m>0){var L=new Array(m+1).join("0");M=D<0?"-"+L+M.slice(1):L+M}}O.push(M)}}else O=i(r,function(e){return f(e,!1)});for(var P=0;P<O.length;P++)for(var U=0;U<T.length;U++){var B=d+O[P]+T[U];(!t||l||B)&&_.push(B)}return _}},6489:e=>{"use strict";e.exports={mask:(e,t,_,i,n)=>{for(var s=0;s<n;s++)_[i+s]=e[s]^t[3&s]},unmask:(e,t)=>{const _=e.length;for(var i=0;i<_;i++)e[i]^=t[3&i]}}},2627:(e,t,_)=>{"use strict";try{e.exports=_(8169)(__dirname)}catch(t){e.exports=_(6489)}},9818:e=>{e.exports=function(e,_){for(var i=[],n=0;n<e.length;n++){var s=_(e[n],n);t(s)?i.push.apply(i,s):i.push(s)}return i};var t=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},5622:(e,t,_)=>{function i(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===i(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===i(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===i(e)},t.isError=function(e){return"[object Error]"===i(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=_(181).Buffer.isBuffer},1455:(e,t,_)=>{e.exports=c,c.realpath=c,c.sync=l,c.realpathSync=l,c.monkeypatch=function(){i.realpath=c,i.realpathSync=l},c.unmonkeypatch=function(){i.realpath=n,i.realpathSync=s};var i=_(9896),n=i.realpath,s=i.realpathSync,r=process.version,o=/^v[0-5]\./.test(r),a=_(6674);function E(e){return e&&"realpath"===e.syscall&&("ELOOP"===e.code||"ENOMEM"===e.code||"ENAMETOOLONG"===e.code)}function c(e,t,_){if(o)return n(e,t,_);"function"==typeof t&&(_=t,t=null),n(e,t,function(i,n){E(i)?a.realpath(e,t,_):_(i,n)})}function l(e,t){if(o)return s(e,t);try{return s(e,t)}catch(_){if(E(_))return a.realpathSync(e,t);throw _}}},6674:(e,t,_)=>{var i=_(6928),n="win32"===process.platform,s=_(9896),r=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function o(e){return"function"==typeof e?e:function(){var e;if(r){var t=new Error;e=function(e){e&&(t.message=e.message,_(e=t))}}else e=_;return e;function _(e){if(e){if(process.throwDeprecation)throw e;if(!process.noDeprecation){var t="fs: missing callback "+(e.stack||e.message);process.traceDeprecation?console.trace(t):console.error(t)}}}}()}if(i.normalize,n)var a=/(.*?)(?:[\/\\]+|$)/g;else a=/(.*?)(?:[\/]+|$)/g;if(n)var E=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;else E=/^[\/]*/;t.realpathSync=function(e,t){if(e=i.resolve(e),t&&Object.prototype.hasOwnProperty.call(t,e))return t[e];var _,r,o,c,l=e,h={},u={};function R(){var t=E.exec(e);_=t[0].length,r=t[0],o=t[0],c="",n&&!u[o]&&(s.lstatSync(o),u[o]=!0)}for(R();_<e.length;){a.lastIndex=_;var y=a.exec(e);if(c=r,r+=y[0],o=c+y[1],_=a.lastIndex,!(u[o]||t&&t[o]===o)){var A;if(t&&Object.prototype.hasOwnProperty.call(t,o))A=t[o];else{var f=s.lstatSync(o);if(!f.isSymbolicLink()){u[o]=!0,t&&(t[o]=o);continue}var v=null;if(!n){var O=f.dev.toString(32)+":"+f.ino.toString(32);h.hasOwnProperty(O)&&(v=h[O])}null===v&&(s.statSync(o),v=s.readlinkSync(o)),A=i.resolve(c,v),t&&(t[o]=A),n||(h[O]=v)}e=i.resolve(A,e.slice(_)),R()}}return t&&(t[l]=e),e},t.realpath=function(e,t,_){if("function"!=typeof _&&(_=o(t),t=null),e=i.resolve(e),t&&Object.prototype.hasOwnProperty.call(t,e))return process.nextTick(_.bind(null,null,t[e]));var r,c,l,h,u=e,R={},y={};function A(){var t=E.exec(e);r=t[0].length,c=t[0],l=t[0],h="",n&&!y[l]?s.lstat(l,function(e){if(e)return _(e);y[l]=!0,f()}):process.nextTick(f)}function f(){if(r>=e.length)return t&&(t[u]=e),_(null,e);a.lastIndex=r;var i=a.exec(e);return h=c,c+=i[0],l=h+i[1],r=a.lastIndex,y[l]||t&&t[l]===l?process.nextTick(f):t&&Object.prototype.hasOwnProperty.call(t,l)?d(t[l]):s.lstat(l,v)}function v(e,i){if(e)return _(e);if(!i.isSymbolicLink())return y[l]=!0,t&&(t[l]=l),process.nextTick(f);if(!n){var r=i.dev.toString(32)+":"+i.ino.toString(32);if(R.hasOwnProperty(r))return O(null,R[r],l)}s.stat(l,function(e){if(e)return _(e);s.readlink(l,function(e,t){n||(R[r]=t),O(e,t)})})}function O(e,n,s){if(e)return _(e);var r=i.resolve(h,n);t&&(t[s]=r),d(r)}function d(t){e=i.resolve(t,e.slice(r)),A()}A()}},1198:(e,t,_)=>{function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.setopts=function(e,t,_){if(_||(_={}),_.matchBase&&-1===t.indexOf("/")){if(_.noglobstar)throw new Error("base matching requires globstar");t="**/"+t}e.silent=!!_.silent,e.pattern=t,e.strict=!1!==_.strict,e.realpath=!!_.realpath,e.realpathCache=_.realpathCache||Object.create(null),e.follow=!!_.follow,e.dot=!!_.dot,e.mark=!!_.mark,e.nodir=!!_.nodir,e.nodir&&(e.mark=!0),e.sync=!!_.sync,e.nounique=!!_.nounique,e.nonull=!!_.nonull,e.nosort=!!_.nosort,e.nocase=!!_.nocase,e.stat=!!_.stat,e.noprocess=!!_.noprocess,e.absolute=!!_.absolute,e.fs=_.fs||n,e.maxLength=_.maxLength||1/0,e.cache=_.cache||Object.create(null),e.statCache=_.statCache||Object.create(null),e.symlinks=_.symlinks||Object.create(null),function(e,t){e.ignore=t.ignore||[],Array.isArray(e.ignore)||(e.ignore=[e.ignore]),e.ignore.length&&(e.ignore=e.ignore.map(c))}(e,_),e.changedCwd=!1;var r=process.cwd();i(_,"cwd")?(e.cwd=s.resolve(_.cwd),e.changedCwd=e.cwd!==r):e.cwd=r,e.root=_.root||s.resolve(e.cwd,"/"),e.root=s.resolve(e.root),"win32"===process.platform&&(e.root=e.root.replace(/\\/g,"/")),e.cwdAbs=o(e.cwd)?e.cwd:l(e,e.cwd),"win32"===process.platform&&(e.cwdAbs=e.cwdAbs.replace(/\\/g,"/")),e.nomount=!!_.nomount,_.nonegate=!0,_.nocomment=!0,_.allowWindowsEscape=!1,e.minimatch=new a(t,_),e.options=e.minimatch.options},t.ownProp=i,t.makeAbs=l,t.finish=function(e){for(var t=e.nounique,_=t?[]:Object.create(null),i=0,n=e.matches.length;i<n;i++){var s=e.matches[i];if(s&&0!==Object.keys(s).length){var r=Object.keys(s);t?_.push.apply(_,r):r.forEach(function(e){_[e]=!0})}else if(e.nonull){var o=e.minimatch.globSet[i];t?_.push(o):_[o]=!0}}if(t||(_=Object.keys(_)),e.nosort||(_=_.sort(E)),e.mark){for(i=0;i<_.length;i++)_[i]=e._mark(_[i]);e.nodir&&(_=_.filter(function(t){var _=!/\/$/.test(t),i=e.cache[t]||e.cache[l(e,t)];return _&&i&&(_="DIR"!==i&&!Array.isArray(i)),_}))}e.ignore.length&&(_=_.filter(function(t){return!h(e,t)})),e.found=_},t.mark=function(e,t){var _=l(e,t),i=e.cache[_],n=t;if(i){var s="DIR"===i||Array.isArray(i),r="/"===t.slice(-1);if(s&&!r?n+="/":!s&&r&&(n=n.slice(0,-1)),n!==t){var o=l(e,n);e.statCache[o]=e.statCache[_],e.cache[o]=e.cache[_]}}return n},t.isIgnored=h,t.childrenIgnored=function(e,t){return!!e.ignore.length&&e.ignore.some(function(e){return!(!e.gmatcher||!e.gmatcher.match(t))})};var n=_(9896),s=_(6928),r=_(4027),o=_(2641),a=r.Minimatch;function E(e,t){return e.localeCompare(t,"en")}function c(e){var t=null;if("/**"===e.slice(-3)){var _=e.replace(/(\/\*\*)+$/,"");t=new a(_,{dot:!0})}return{matcher:new a(e,{dot:!0}),gmatcher:t}}function l(e,t){var _=t;return _="/"===t.charAt(0)?s.join(e.root,t):o(t)||""===t?t:e.changedCwd?s.resolve(e.cwd,t):s.resolve(t),"win32"===process.platform&&(_=_.replace(/\\/g,"/")),_}function h(e,t){return!!e.ignore.length&&e.ignore.some(function(e){return e.matcher.match(t)||!(!e.gmatcher||!e.gmatcher.match(t))})}},3577:(e,t,_)=>{e.exports=v;var i=_(1455),n=_(4027),s=(n.Minimatch,_(2017)),r=_(4434).EventEmitter,o=_(6928),a=_(2613),E=_(2641),c=_(4700),l=_(1198),h=l.setopts,u=l.ownProp,R=_(3423),y=(_(9023),l.childrenIgnored),A=l.isIgnored,f=_(3519);function v(e,t,_){if("function"==typeof t&&(_=t,t={}),t||(t={}),t.sync){if(_)throw new TypeError("callback provided to sync glob");return c(e,t)}return new d(e,t,_)}v.sync=c;var O=v.GlobSync=c.GlobSync;function d(e,t,_){if("function"==typeof t&&(_=t,t=null),t&&t.sync){if(_)throw new TypeError("callback provided to sync glob");return new O(e,t)}if(!(this instanceof d))return new d(e,t,_);h(this,e,t),this._didRealPath=!1;var i=this.minimatch.set.length;this.matches=new Array(i),"function"==typeof _&&(_=f(_),this.on("error",_),this.on("end",function(e){_(null,e)}));var n=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(0===i)return o();for(var s=!0,r=0;r<i;r++)this._process(this.minimatch.set[r],r,!1,o);function o(){--n._processing,n._processing<=0&&(s?process.nextTick(function(){n._finish()}):n._finish())}s=!1}v.glob=v,v.hasMagic=function(e,t){var _=function(e,t){if(null===t||"object"!=typeof t)return e;for(var _=Object.keys(t),i=_.length;i--;)e[_[i]]=t[_[i]];return e}({},t);_.noprocess=!0;var i=new d(e,_).minimatch.set;if(!e)return!1;if(i.length>1)return!0;for(var n=0;n<i[0].length;n++)if("string"!=typeof i[0][n])return!0;return!1},v.Glob=d,s(d,r),d.prototype._finish=function(){if(a(this instanceof d),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();l.finish(this),this.emit("end",this.found)}},d.prototype._realpath=function(){if(!this._didRealpath){this._didRealpath=!0;var e=this.matches.length;if(0===e)return this._finish();for(var t=this,_=0;_<this.matches.length;_++)this._realpathSet(_,i)}function i(){0==--e&&t._finish()}},d.prototype._realpathSet=function(e,t){var _=this.matches[e];if(!_)return t();var n=Object.keys(_),s=this,r=n.length;if(0===r)return t();var o=this.matches[e]=Object.create(null);n.forEach(function(_,n){_=s._makeAbs(_),i.realpath(_,s.realpathCache,function(i,n){i?"stat"===i.syscall?o[_]=!0:s.emit("error",i):o[n]=!0,0==--r&&(s.matches[e]=o,t())})})},d.prototype._mark=function(e){return l.mark(this,e)},d.prototype._makeAbs=function(e){return l.makeAbs(this,e)},d.prototype.abort=function(){this.aborted=!0,this.emit("abort")},d.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))},d.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var e=this._emitQueue.slice(0);this._emitQueue.length=0;for(var t=0;t<e.length;t++){var _=e[t];this._emitMatch(_[0],_[1])}}if(this._processQueue.length){var i=this._processQueue.slice(0);for(this._processQueue.length=0,t=0;t<i.length;t++){var n=i[t];this._processing--,this._process(n[0],n[1],n[2],n[3])}}}},d.prototype._process=function(e,t,_,i){if(a(this instanceof d),a("function"==typeof i),!this.aborted)if(this._processing++,this.paused)this._processQueue.push([e,t,_,i]);else{for(var s,r=0;"string"==typeof e[r];)r++;switch(r){case e.length:return void this._processSimple(e.join("/"),t,i);case 0:s=null;break;default:s=e.slice(0,r).join("/")}var o,c=e.slice(r);null===s?o=".":E(s)||E(e.map(function(e){return"string"==typeof e?e:"[*]"}).join("/"))?(s&&E(s)||(s="/"+s),o=s):o=s;var l=this._makeAbs(o);if(y(this,o))return i();c[0]===n.GLOBSTAR?this._processGlobStar(s,o,l,c,t,_,i):this._processReaddir(s,o,l,c,t,_,i)}},d.prototype._processReaddir=function(e,t,_,i,n,s,r){var o=this;this._readdir(_,s,function(a,E){return o._processReaddir2(e,t,_,i,n,s,E,r)})},d.prototype._processReaddir2=function(e,t,_,i,n,s,r,a){if(!r)return a();for(var E=i[0],c=!!this.minimatch.negate,l=E._glob,h=this.dot||"."===l.charAt(0),u=[],R=0;R<r.length;R++)("."!==(A=r[R]).charAt(0)||h)&&(c&&!e?!A.match(E):A.match(E))&&u.push(A);var y=u.length;if(0===y)return a();if(1===i.length&&!this.mark&&!this.stat){for(this.matches[n]||(this.matches[n]=Object.create(null)),R=0;R<y;R++){var A=u[R];e&&(A="/"!==e?e+"/"+A:e+A),"/"!==A.charAt(0)||this.nomount||(A=o.join(this.root,A)),this._emitMatch(n,A)}return a()}for(i.shift(),R=0;R<y;R++)A=u[R],e&&(A="/"!==e?e+"/"+A:e+A),this._process([A].concat(i),n,s,a);a()},d.prototype._emitMatch=function(e,t){if(!this.aborted&&!A(this,t))if(this.paused)this._emitQueue.push([e,t]);else{var _=E(t)?t:this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=_),!this.matches[e][t]){if(this.nodir){var i=this.cache[_];if("DIR"===i||Array.isArray(i))return}this.matches[e][t]=!0;var n=this.statCache[_];n&&this.emit("stat",t,n),this.emit("match",t)}}},d.prototype._readdirInGlobStar=function(e,t){if(!this.aborted){if(this.follow)return this._readdir(e,!1,t);var _=this,i=R("lstat\0"+e,function(i,n){if(i&&"ENOENT"===i.code)return t();var s=n&&n.isSymbolicLink();_.symlinks[e]=s,s||!n||n.isDirectory()?_._readdir(e,!1,t):(_.cache[e]="FILE",t())});i&&_.fs.lstat(e,i)}},d.prototype._readdir=function(e,t,_){if(!this.aborted&&(_=R("readdir\0"+e+"\0"+t,_))){if(t&&!u(this.symlinks,e))return this._readdirInGlobStar(e,_);if(u(this.cache,e)){var i=this.cache[e];if(!i||"FILE"===i)return _();if(Array.isArray(i))return _(null,i)}this.fs.readdir(e,function(e,t,_){return function(i,n){i?e._readdirError(t,i,_):e._readdirEntries(t,n,_)}}(this,e,_))}},d.prototype._readdirEntries=function(e,t,_){if(!this.aborted){if(!this.mark&&!this.stat)for(var i=0;i<t.length;i++){var n=t[i];n="/"===e?e+n:e+"/"+n,this.cache[n]=!0}return this.cache[e]=t,_(null,t)}},d.prototype._readdirError=function(e,t,_){if(!this.aborted){switch(t.code){case"ENOTSUP":case"ENOTDIR":var i=this._makeAbs(e);if(this.cache[i]="FILE",i===this.cwdAbs){var n=new Error(t.code+" invalid cwd "+this.cwd);n.path=this.cwd,n.code=t.code,this.emit("error",n),this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:this.cache[this._makeAbs(e)]=!1,this.strict&&(this.emit("error",t),this.abort()),this.silent||console.error("glob error",t)}return _()}},d.prototype._processGlobStar=function(e,t,_,i,n,s,r){var o=this;this._readdir(_,s,function(a,E){o._processGlobStar2(e,t,_,i,n,s,E,r)})},d.prototype._processGlobStar2=function(e,t,_,i,n,s,r,o){if(!r)return o();var a=i.slice(1),E=e?[e]:[],c=E.concat(a);this._process(c,n,!1,o);var l=this.symlinks[_],h=r.length;if(l&&s)return o();for(var u=0;u<h;u++)if("."!==r[u].charAt(0)||this.dot){var R=E.concat(r[u],a);this._process(R,n,!0,o);var y=E.concat(r[u],i);this._process(y,n,!0,o)}o()},d.prototype._processSimple=function(e,t,_){var i=this;this._stat(e,function(n,s){i._processSimple2(e,t,n,s,_)})},d.prototype._processSimple2=function(e,t,_,i,n){if(this.matches[t]||(this.matches[t]=Object.create(null)),!i)return n();if(e&&E(e)&&!this.nomount){var s=/[\/\\]$/.test(e);"/"===e.charAt(0)?e=o.join(this.root,e):(e=o.resolve(this.root,e),s&&(e+="/"))}"win32"===process.platform&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e),n()},d.prototype._stat=function(e,t){var _=this._makeAbs(e),i="/"===e.slice(-1);if(e.length>this.maxLength)return t();if(!this.stat&&u(this.cache,_)){var n=this.cache[_];if(Array.isArray(n)&&(n="DIR"),!i||"DIR"===n)return t(null,n);if(i&&"FILE"===n)return t()}var s=this.statCache[_];if(void 0!==s){if(!1===s)return t(null,s);var r=s.isDirectory()?"DIR":"FILE";return i&&"FILE"===r?t():t(null,r,s)}var o=this,a=R("stat\0"+_,function(i,n){if(n&&n.isSymbolicLink())return o.fs.stat(_,function(i,s){i?o._stat2(e,_,null,n,t):o._stat2(e,_,i,s,t)});o._stat2(e,_,i,n,t)});a&&o.fs.lstat(_,a)},d.prototype._stat2=function(e,t,_,i,n){if(_&&("ENOENT"===_.code||"ENOTDIR"===_.code))return this.statCache[t]=!1,n();var s="/"===e.slice(-1);if(this.statCache[t]=i,"/"===t.slice(-1)&&i&&!i.isDirectory())return n(null,!1,i);var r=!0;return i&&(r=i.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||r,s&&"FILE"===r?n():n(null,r,i)}},4700:(e,t,_)=>{e.exports=u,u.GlobSync=R;var i=_(1455),n=_(4027),s=(n.Minimatch,_(3577).Glob,_(9023),_(6928)),r=_(2613),o=_(2641),a=_(1198),E=a.setopts,c=a.ownProp,l=a.childrenIgnored,h=a.isIgnored;function u(e,t){if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new R(e,t).found}function R(e,t){if(!e)throw new Error("must provide pattern");if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof R))return new R(e,t);if(E(this,e,t),this.noprocess)return this;var _=this.minimatch.set.length;this.matches=new Array(_);for(var i=0;i<_;i++)this._process(this.minimatch.set[i],i,!1);this._finish()}R.prototype._finish=function(){if(r.ok(this instanceof R),this.realpath){var e=this;this.matches.forEach(function(t,_){var n=e.matches[_]=Object.create(null);for(var s in t)try{s=e._makeAbs(s),n[i.realpathSync(s,e.realpathCache)]=!0}catch(t){if("stat"!==t.syscall)throw t;n[e._makeAbs(s)]=!0}})}a.finish(this)},R.prototype._process=function(e,t,_){r.ok(this instanceof R);for(var i,s=0;"string"==typeof e[s];)s++;switch(s){case e.length:return void this._processSimple(e.join("/"),t);case 0:i=null;break;default:i=e.slice(0,s).join("/")}var a,E=e.slice(s);null===i?a=".":o(i)||o(e.map(function(e){return"string"==typeof e?e:"[*]"}).join("/"))?(i&&o(i)||(i="/"+i),a=i):a=i;var c=this._makeAbs(a);l(this,a)||(E[0]===n.GLOBSTAR?this._processGlobStar(i,a,c,E,t,_):this._processReaddir(i,a,c,E,t,_))},R.prototype._processReaddir=function(e,t,_,i,n,r){var o=this._readdir(_,r);if(o){for(var a=i[0],E=!!this.minimatch.negate,c=a._glob,l=this.dot||"."===c.charAt(0),h=[],u=0;u<o.length;u++)("."!==(A=o[u]).charAt(0)||l)&&(E&&!e?!A.match(a):A.match(a))&&h.push(A);var R=h.length;if(0!==R)if(1!==i.length||this.mark||this.stat)for(i.shift(),u=0;u<R;u++){var y;A=h[u],y=e?[e,A]:[A],this._process(y.concat(i),n,r)}else{this.matches[n]||(this.matches[n]=Object.create(null));for(u=0;u<R;u++){var A=h[u];e&&(A="/"!==e.slice(-1)?e+"/"+A:e+A),"/"!==A.charAt(0)||this.nomount||(A=s.join(this.root,A)),this._emitMatch(n,A)}}}},R.prototype._emitMatch=function(e,t){if(!h(this,t)){var _=this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=_),!this.matches[e][t]){if(this.nodir){var i=this.cache[_];if("DIR"===i||Array.isArray(i))return}this.matches[e][t]=!0,this.stat&&this._stat(t)}}},R.prototype._readdirInGlobStar=function(e){if(this.follow)return this._readdir(e,!1);var t,_;try{_=this.fs.lstatSync(e)}catch(e){if("ENOENT"===e.code)return null}var i=_&&_.isSymbolicLink();return this.symlinks[e]=i,i||!_||_.isDirectory()?t=this._readdir(e,!1):this.cache[e]="FILE",t},R.prototype._readdir=function(e,t){if(t&&!c(this.symlinks,e))return this._readdirInGlobStar(e);if(c(this.cache,e)){var _=this.cache[e];if(!_||"FILE"===_)return null;if(Array.isArray(_))return _}try{return this._readdirEntries(e,this.fs.readdirSync(e))}catch(t){return this._readdirError(e,t),null}},R.prototype._readdirEntries=function(e,t){if(!this.mark&&!this.stat)for(var _=0;_<t.length;_++){var i=t[_];i="/"===e?e+i:e+"/"+i,this.cache[i]=!0}return this.cache[e]=t,t},R.prototype._readdirError=function(e,t){switch(t.code){case"ENOTSUP":case"ENOTDIR":var _=this._makeAbs(e);if(this.cache[_]="FILE",_===this.cwdAbs){var i=new Error(t.code+" invalid cwd "+this.cwd);throw i.path=this.cwd,i.code=t.code,i}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:if(this.cache[this._makeAbs(e)]=!1,this.strict)throw t;this.silent||console.error("glob error",t)}},R.prototype._processGlobStar=function(e,t,_,i,n,s){var r=this._readdir(_,s);if(r){var o=i.slice(1),a=e?[e]:[],E=a.concat(o);this._process(E,n,!1);var c=r.length;if(!this.symlinks[_]||!s)for(var l=0;l<c;l++)if("."!==r[l].charAt(0)||this.dot){var h=a.concat(r[l],o);this._process(h,n,!0);var u=a.concat(r[l],i);this._process(u,n,!0)}}},R.prototype._processSimple=function(e,t){var _=this._stat(e);if(this.matches[t]||(this.matches[t]=Object.create(null)),_){if(e&&o(e)&&!this.nomount){var i=/[\/\\]$/.test(e);"/"===e.charAt(0)?e=s.join(this.root,e):(e=s.resolve(this.root,e),i&&(e+="/"))}"win32"===process.platform&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e)}},R.prototype._stat=function(e){var t=this._makeAbs(e),_="/"===e.slice(-1);if(e.length>this.maxLength)return!1;if(!this.stat&&c(this.cache,t)){var i=this.cache[t];if(Array.isArray(i)&&(i="DIR"),!_||"DIR"===i)return i;if(_&&"FILE"===i)return!1}var n=this.statCache[t];if(!n){var s;try{s=this.fs.lstatSync(t)}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return this.statCache[t]=!1,!1}if(s&&s.isSymbolicLink())try{n=this.fs.statSync(t)}catch(e){n=s}else n=s}return this.statCache[t]=n,i=!0,n&&(i=n.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||i,(!_||"FILE"!==i)&&i},R.prototype._mark=function(e){return a.mark(this,e)},R.prototype._makeAbs=function(e){return a.makeAbs(this,e)}},3423:(e,t,_)=>{var i=_(6587),n=Object.create(null),s=_(3519);e.exports=i(function(e,t){return n[e]?(n[e].push(t),null):(n[e]=[t],function(e){return s(function t(){var _=n[e],i=_.length,s=function(e){for(var t=e.length,_=[],i=0;i<t;i++)_[i]=e[i];return _}(arguments);try{for(var r=0;r<i;r++)_[r].apply(null,s)}finally{_.length>i?(_.splice(0,i),process.nextTick(function(){t.apply(null,s)})):delete n[e]}})}(e))})},2017:(e,t,_)=>{try{var i=_(9023);if("function"!=typeof i.inherits)throw"";e.exports=i.inherits}catch(t){e.exports=_(6698)}},6698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var _=function(){};_.prototype=t.prototype,e.prototype=new _,e.prototype.constructor=e}}},4634:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},4027:(e,t,_)=>{e.exports=h,h.Minimatch=u;var i=function(){try{return _(6928)}catch(e){}}()||{sep:"/"};h.sep=i.sep;var n=h.GLOBSTAR=u.GLOBSTAR={},s=_(8928),r={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},o="[^/]",a=o+"*?",E="().*{}+?[]^$\\!".split("").reduce(function(e,t){return e[t]=!0,e},{}),c=/\/+/;function l(e,t){t=t||{};var _={};return Object.keys(e).forEach(function(t){_[t]=e[t]}),Object.keys(t).forEach(function(e){_[e]=t[e]}),_}function h(e,t,_){return y(t),_||(_={}),!(!_.nocomment&&"#"===t.charAt(0))&&new u(t,_).match(e)}function u(e,t){if(!(this instanceof u))return new u(e,t);y(e),t||(t={}),e=e.trim(),t.allowWindowsEscape||"/"===i.sep||(e=e.split(i.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.make()}function R(e,t){return t||(t=this instanceof u?this.options:{}),e=void 0===e?this.pattern:e,y(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:s(e)}h.filter=function(e,t){return t=t||{},function(_,i,n){return h(_,e,t)}},h.defaults=function(e){if(!e||"object"!=typeof e||!Object.keys(e).length)return h;var t=h,_=function(_,i,n){return t(_,i,l(e,n))};return(_.Minimatch=function(_,i){return new t.Minimatch(_,l(e,i))}).defaults=function(_){return t.defaults(l(e,_)).Minimatch},_.filter=function(_,i){return t.filter(_,l(e,i))},_.defaults=function(_){return t.defaults(l(e,_))},_.makeRe=function(_,i){return t.makeRe(_,l(e,i))},_.braceExpand=function(_,i){return t.braceExpand(_,l(e,i))},_.match=function(_,i,n){return t.match(_,i,l(e,n))},_},u.defaults=function(e){return h.defaults(e).Minimatch},u.prototype.debug=function(){},u.prototype.make=function(){var e=this.pattern,t=this.options;if(t.nocomment||"#"!==e.charAt(0))if(e){this.parseNegate();var _=this.globSet=this.braceExpand();t.debug&&(this.debug=function(){console.error.apply(console,arguments)}),this.debug(this.pattern,_),_=this.globParts=_.map(function(e){return e.split(c)}),this.debug(this.pattern,_),_=_.map(function(e,t,_){return e.map(this.parse,this)},this),this.debug(this.pattern,_),_=_.filter(function(e){return-1===e.indexOf(!1)}),this.debug(this.pattern,_),this.set=_}else this.empty=!0;else this.comment=!0},u.prototype.parseNegate=function(){var e=this.pattern,t=!1,_=0;if(!this.options.nonegate){for(var i=0,n=e.length;i<n&&"!"===e.charAt(i);i++)t=!t,_++;_&&(this.pattern=e.substr(_)),this.negate=t}},h.braceExpand=function(e,t){return R(e,t)},u.prototype.braceExpand=R;var y=function(e){if("string"!=typeof e)throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")};u.prototype.parse=function(e,t){y(e);var _=this.options;if("**"===e){if(!_.noglobstar)return n;e="*"}if(""===e)return"";var i,s="",c=!!_.nocase,l=!1,h=[],u=[],R=!1,f=-1,v=-1,O="."===e.charAt(0)?"":_.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",d=this;function T(){if(i){switch(i){case"*":s+=a,c=!0;break;case"?":s+=o,c=!0;break;default:s+="\\"+i}d.debug("clearStateChar %j %j",i,s),i=!1}}for(var N,p=0,I=e.length;p<I&&(N=e.charAt(p));p++)if(this.debug("%s\t%s %s %j",e,p,s,N),l&&E[N])s+="\\"+N,l=!1;else switch(N){case"/":return!1;case"\\":T(),l=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",e,p,s,N),R){this.debug(" in class"),"!"===N&&p===v+1&&(N="^"),s+=N;continue}d.debug("call clearStateChar %j",i),T(),i=N,_.noext&&T();continue;case"(":if(R){s+="(";continue}if(!i){s+="\\(";continue}h.push({type:i,start:p-1,reStart:s.length,open:r[i].open,close:r[i].close}),s+="!"===i?"(?:(?!(?:":"(?:",this.debug("plType %j %j",i,s),i=!1;continue;case")":if(R||!h.length){s+="\\)";continue}T(),c=!0;var C=h.pop();s+=C.close,"!"===C.type&&u.push(C),C.reEnd=s.length;continue;case"|":if(R||!h.length||l){s+="\\|",l=!1;continue}T(),s+="|";continue;case"[":if(T(),R){s+="\\"+N;continue}R=!0,v=p,f=s.length,s+=N;continue;case"]":if(p===v+1||!R){s+="\\"+N,l=!1;continue}var g=e.substring(v+1,p);try{RegExp("["+g+"]")}catch(e){var S=this.parse(g,A);s=s.substr(0,f)+"\\["+S[0]+"\\]",c=c||S[1],R=!1;continue}c=!0,R=!1,s+=N;continue;default:T(),l?l=!1:!E[N]||"^"===N&&R||(s+="\\"),s+=N}for(R&&(g=e.substr(v+1),S=this.parse(g,A),s=s.substr(0,f)+"\\["+S[0],c=c||S[1]),C=h.pop();C;C=h.pop()){var D=s.slice(C.reStart+C.open.length);this.debug("setting tail",s,C),D=D.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(e,t,_){return _||(_="\\"),t+t+_+"|"}),this.debug("tail=%j\n %s",D,D,C,s);var M="*"===C.type?a:"?"===C.type?o:"\\"+C.type;c=!0,s=s.slice(0,C.reStart)+M+"\\("+D}T(),l&&(s+="\\\\");var m=!1;switch(s.charAt(0)){case"[":case".":case"(":m=!0}for(var L=u.length-1;L>-1;L--){var P=u[L],U=s.slice(0,P.reStart),B=s.slice(P.reStart,P.reEnd-8),w=s.slice(P.reEnd-8,P.reEnd),b=s.slice(P.reEnd);w+=b;var G=U.split("(").length-1,F=b;for(p=0;p<G;p++)F=F.replace(/\)[+*?]?/,"");var k="";""===(b=F)&&t!==A&&(k="$"),s=U+B+b+k+w}if(""!==s&&c&&(s="(?=.)"+s),m&&(s=O+s),t===A)return[s,c];if(!c)return function(e){return e.replace(/\\(.)/g,"$1")}(e);var x=_.nocase?"i":"";try{var W=new RegExp("^"+s+"$",x)}catch(e){return new RegExp("$.")}return W._glob=e,W._src=s,W};var A={};h.makeRe=function(e,t){return new u(e,t||{}).makeRe()},u.prototype.makeRe=function(){if(this.regexp||!1===this.regexp)return this.regexp;var e=this.set;if(!e.length)return this.regexp=!1,this.regexp;var t=this.options,_=t.noglobstar?a:t.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",i=t.nocase?"i":"",s=e.map(function(e){return e.map(function(e){return e===n?_:"string"==typeof e?function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}(e):e._src}).join("\\/")}).join("|");s="^(?:"+s+")$",this.negate&&(s="^(?!"+s+").*$");try{this.regexp=new RegExp(s,i)}catch(e){this.regexp=!1}return this.regexp},h.match=function(e,t,_){var i=new u(t,_=_||{});return e=e.filter(function(e){return i.match(e)}),i.options.nonull&&!e.length&&e.push(t),e},u.prototype.match=function(e,t){if(void 0===t&&(t=this.partial),this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return""===e;if("/"===e&&t)return!0;var _=this.options;"/"!==i.sep&&(e=e.split(i.sep).join("/")),e=e.split(c),this.debug(this.pattern,"split",e);var n,s,r=this.set;for(this.debug(this.pattern,"set",r),s=e.length-1;s>=0&&!(n=e[s]);s--);for(s=0;s<r.length;s++){var o=r[s],a=e;if(_.matchBase&&1===o.length&&(a=[n]),this.matchOne(a,o,t))return!!_.flipNegate||!this.negate}return!_.flipNegate&&this.negate},u.prototype.matchOne=function(e,t,_){var i=this.options;this.debug("matchOne",{this:this,file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var s=0,r=0,o=e.length,a=t.length;s<o&&r<a;s++,r++){this.debug("matchOne loop");var E,c=t[r],l=e[s];if(this.debug(t,c,l),!1===c)return!1;if(c===n){this.debug("GLOBSTAR",[t,c,l]);var h=s,u=r+1;if(u===a){for(this.debug("** at the end");s<o;s++)if("."===e[s]||".."===e[s]||!i.dot&&"."===e[s].charAt(0))return!1;return!0}for(;h<o;){var R=e[h];if(this.debug("\nglobstar while",e,h,t,u,R),this.matchOne(e.slice(h),t.slice(u),_))return this.debug("globstar found match!",h,o,R),!0;if("."===R||".."===R||!i.dot&&"."===R.charAt(0)){this.debug("dot detected!",e,h,t,u);break}this.debug("globstar swallow a segment, and continue"),h++}return!(!_||(this.debug("\n>>> no match, partial?",e,h,t,u),h!==o))}if("string"==typeof c?(E=l===c,this.debug("string match",c,l,E)):(E=l.match(c),this.debug("pattern match",c,l,E)),!E)return!1}if(s===o&&r===a)return!0;if(s===o)return _;if(r===a)return s===o-1&&""===e[s];throw new Error("wtf?")}},2125:(e,t,_)=>{var i=Object.create(null);function n(e){var t=i[e];if(void 0!==t)return t;switch(e){case"Connection":t=_(3589);break;case"ConnectionConfig":t=_(7363);break;case"Pool":t=_(6563);break;case"PoolCluster":t=_(5145);break;case"PoolConfig":t=_(9421);break;case"SqlString":t=_(5047);break;case"Types":t=_(3833);break;default:throw new Error("Cannot find class '"+e+"'")}return i[e]=t,t}t.createConnection=function(e){return new(n("Connection"))({config:new(n("ConnectionConfig"))(e)})},t.createPool=function(e){return new(n("Pool"))({config:new(n("PoolConfig"))(e)})},t.createPoolCluster=function(e){return new(n("PoolCluster"))(e)},t.createQuery=function(e,t,_){return n("Connection").createQuery(e,t,_)},t.escape=function(e,t,_){return n("SqlString").escape(e,t,_)},t.escapeId=function(e,t){return n("SqlString").escapeId(e,t)},t.format=function(e,t,_,i){return n("SqlString").format(e,t,_,i)},t.raw=function(e){return n("SqlString").raw(e)},Object.defineProperty(t,"Types",{get:n.bind(null,"Types")})},3589:(e,t,_)=>{var i=_(6982),n=_(4434),s=_(9278),r=_(4756),o=_(7363),a=_(2828),E=_(5047),c=_(3799),l=_(9023);function h(e){n.EventEmitter.call(this),this.config=e.config,this._socket=e.socket,this._protocol=new a({config:this.config,connection:this}),this._connectCalled=!1,this.state="disconnected",this.threadId=null}function u(e,t){if("function"==typeof t){if(t.domain)return t;var _=process.domain;return _?_.bind(t):e?function(e){return function(){for(var t,_=[];process.domain;)_.shift(process.domain),process.domain.exit();try{t=e.apply(this,arguments)}finally{for(var i=0;i<_.length;i++)_[i].enter()}return t}}(R(e,t)):t}}function R(e,t){return function(){n.usingDomains&&e.domain?(e.domain.enter(),t.apply(this,arguments),e.domain.exit()):t.apply(this,arguments)}}e.exports=h,l.inherits(h,n.EventEmitter),h.createQuery=function(e,t,_){if(e instanceof c)return e;var i=_,n={};if("function"==typeof e?i=e:"object"==typeof e?(n=Object.create(e),"function"==typeof t?i=t:void 0!==t&&Object.defineProperty(n,"values",{value:t})):(n.sql=e,"function"==typeof t?i=t:void 0!==t&&(n.values=t)),void 0!==i&&void 0===(i=u(null,i)))throw new TypeError("argument callback must be a function when provided");return new c(n,i)},h.prototype.connect=function(e,t){if(t||"function"!=typeof e||(t=e,e={}),!this._connectCalled){this._connectCalled=!0,this._socket=this.config.socketPath?s.createConnection(this.config.socketPath):s.createConnection(this.config.port,this.config.host),n.usingDomains&&(this._socket.domain=this.domain);var _=this;if(this._protocol.on("data",function(e){_._socket.write(e)}),this._socket.on("data",R(_,function(e){_._protocol.write(e)})),this._protocol.on("end",function(){_._socket.end()}),this._socket.on("end",R(_,function(){_._protocol.end()})),this._socket.on("error",this._handleNetworkError.bind(this)),this._socket.on("connect",this._handleProtocolConnect.bind(this)),this._protocol.on("handshake",this._handleProtocolHandshake.bind(this)),this._protocol.on("initialize",this._handleProtocolInitialize.bind(this)),this._protocol.on("unhandledError",this._handleProtocolError.bind(this)),this._protocol.on("drain",this._handleProtocolDrain.bind(this)),this._protocol.on("end",this._handleProtocolEnd.bind(this)),this._protocol.on("enqueue",this._handleProtocolEnqueue.bind(this)),this.config.connectTimeout){var i=this._handleConnectTimeout.bind(this);this._socket.setTimeout(this.config.connectTimeout,i),this._socket.once("connect",function(){this.setTimeout(0,i)})}}this._protocol.handshake(e,u(this,t))},h.prototype.changeUser=function(e,t){t||"function"!=typeof e||(t=e,e={}),this._implyConnect();var _=e.charset?o.getCharsetNumber(e.charset):this.config.charsetNumber;return this._protocol.changeUser({user:e.user||this.config.user,password:e.password||this.config.password,database:e.database||this.config.database,timeout:e.timeout,charsetNumber:_,currentConfig:this.config},u(this,t))},h.prototype.beginTransaction=function(e,t){return t||"function"!=typeof e||(t=e,e={}),(e=e||{}).sql="START TRANSACTION",e.values=null,this.query(e,t)},h.prototype.commit=function(e,t){return t||"function"!=typeof e||(t=e,e={}),(e=e||{}).sql="COMMIT",e.values=null,this.query(e,t)},h.prototype.rollback=function(e,t){return t||"function"!=typeof e||(t=e,e={}),(e=e||{}).sql="ROLLBACK",e.values=null,this.query(e,t)},h.prototype.query=function(e,t,_){var i=h.createQuery(e,t,_);return i._connection=this,"object"==typeof e&&"typeCast"in e||(i.typeCast=this.config.typeCast),i.sql&&(i.sql=this.format(i.sql,i.values)),i._callback&&(i._callback=u(this,i._callback)),this._implyConnect(),this._protocol._enqueue(i)},h.prototype.ping=function(e,t){t||"function"!=typeof e||(t=e,e={}),this._implyConnect(),this._protocol.ping(e,u(this,t))},h.prototype.statistics=function(e,t){t||"function"!=typeof e||(t=e,e={}),this._implyConnect(),this._protocol.stats(e,u(this,t))},h.prototype.end=function(e,t){var _=t,i=e;t||"function"!=typeof e||(_=e,i=null),void 0===(i=Object.create(i||null)).timeout&&(i.timeout=3e4),this._implyConnect(),this._protocol.quit(i,u(this,_))},h.prototype.destroy=function(){this.state="disconnected",this._implyConnect(),this._socket.destroy(),this._protocol.destroy()},h.prototype.pause=function(){this._socket.pause(),this._protocol.pause()},h.prototype.resume=function(){this._socket.resume(),this._protocol.resume()},h.prototype.escape=function(e){return E.escape(e,!1,this.config.timezone)},h.prototype.escapeId=function(e){return E.escapeId(e,!1)},h.prototype.format=function(e,t){return"function"==typeof this.config.queryFormat?this.config.queryFormat.call(this,e,t,this.config.timezone):E.format(e,t,this.config.stringifyObjects,this.config.timezone)},r.TLSSocket?h.prototype._startTLS=function(e){var t=this;!function(e,t){var _=null,i=null;try{_=r.createSecureContext({ca:e.ssl.ca,cert:e.ssl.cert,ciphers:e.ssl.ciphers,key:e.ssl.key,passphrase:e.ssl.passphrase})}catch(e){i=e}t(i,_)}(this.config,function(_,i){if(_)e(_);else{t._socket.removeAllListeners("data"),t._protocol.removeAllListeners("data");var n=t.config.ssl.rejectUnauthorized,s=!1,o=new r.TLSSocket(t._socket,{rejectUnauthorized:n,requestCert:!0,secureContext:i,isServer:!1});o.on("_tlsError",function(_){s?t._handleNetworkError(_):e(_)}),o.pipe(t._protocol),t._protocol.on("data",function(e){o.write(e)}),o.on("secure",function(){s=!0,e(n?this.ssl.verifyError():null)}),o._start()}})}:h.prototype._startTLS=function(e){var t=this,_=i.createCredentials({ca:this.config.ssl.ca,cert:this.config.ssl.cert,ciphers:this.config.ssl.ciphers,key:this.config.ssl.key,passphrase:this.config.ssl.passphrase}),n=this.config.ssl.rejectUnauthorized,s=!1,o=r.createSecurePair(_,!1,!0,n);o.on("error",function(_){s?t._handleNetworkError(_):e(_)}),this._socket.removeAllListeners("data"),this._protocol.removeAllListeners("data"),o.encrypted.pipe(this._socket),this._socket.on("data",function(e){o.encrypted.write(e)}),o.cleartext.pipe(this._protocol),this._protocol.on("data",function(e){o.cleartext.write(e)}),o.on("secure",function(){if(s=!0,n){var t=this.ssl.verifyError(),_=t;"string"==typeof _&&((_=new Error(t)).code=t),e(_)}else e()}),o._cycle=o.cycle,o.cycle=function(){return this.ssl&&this.ssl.error&&this.error(),this._cycle.apply(this,arguments)}},h.prototype._handleConnectTimeout=function(){this._socket&&(this._socket.setTimeout(0),this._socket.destroy());var e=new Error("connect ETIMEDOUT");e.errorno="ETIMEDOUT",e.code="ETIMEDOUT",e.syscall="connect",this._handleNetworkError(e)},h.prototype._handleNetworkError=function(e){this._protocol.handleNetworkError(e)},h.prototype._handleProtocolError=function(e){this.state="protocol_error",this.emit("error",e)},h.prototype._handleProtocolDrain=function(){this.emit("drain")},h.prototype._handleProtocolConnect=function(){this.state="connected",this.emit("connect")},h.prototype._handleProtocolHandshake=function(){this.state="authenticated"},h.prototype._handleProtocolInitialize=function(e){this.threadId=e.threadId},h.prototype._handleProtocolEnd=function(e){this.state="disconnected",this.emit("end",e)},h.prototype._handleProtocolEnqueue=function(e){this.emit("enqueue",e)},h.prototype._implyConnect=function(){this._connectCalled||this.connect()}},7363:(e,t,_)=>{var i=_(7016).parse,n=_(8565),s=_(4771),r=null;function o(e){"string"==typeof e&&(e=o.parseUrl(e)),this.host=e.host||"localhost",this.port=e.port||3306,this.localAddress=e.localAddress,this.socketPath=e.socketPath,this.user=e.user||void 0,this.password=e.password||void 0,this.database=e.database,this.connectTimeout=void 0===e.connectTimeout?1e4:e.connectTimeout,this.insecureAuth=e.insecureAuth||!1,this.supportBigNumbers=e.supportBigNumbers||!1,this.bigNumberStrings=e.bigNumberStrings||!1,this.dateStrings=e.dateStrings||!1,this.debug=e.debug,this.trace=!1!==e.trace,this.stringifyObjects=e.stringifyObjects||!1,this.timezone=e.timezone||"local",this.flags=e.flags||"",this.queryFormat=e.queryFormat,this.pool=e.pool||void 0,this.ssl="string"==typeof e.ssl?o.getSSLProfile(e.ssl):e.ssl||!1,this.localInfile=void 0===e.localInfile||e.localInfile,this.multipleStatements=e.multipleStatements||!1,this.typeCast=void 0===e.typeCast||e.typeCast," "===this.timezone[0]&&(this.timezone="+"+this.timezone.substr(1)),this.ssl&&(this.ssl.rejectUnauthorized=!1!==this.ssl.rejectUnauthorized),this.maxPacketSize=0,this.charsetNumber=e.charset?o.getCharsetNumber(e.charset):e.charsetNumber||s.UTF8_GENERAL_CI;var t=o.getDefaultFlags(e);this.clientFlags=o.mergeFlags(t,e.flags)}e.exports=o,o.mergeFlags=function(e,t){var _=o.parseFlagList(e),i=o.parseFlagList(t);for(var s in i)!1!==_[s]&&(_[s]=i[s]);var r=0;for(var s in _)_[s]&&(r|=n["CLIENT_"+s]||0);return r},o.getCharsetNumber=function(e){var t=s[e.toUpperCase()];if(void 0===t)throw new TypeError("Unknown charset '"+e+"'");return t},o.getDefaultFlags=function(e){var t=["-COMPRESS","-CONNECT_ATTRS","+CONNECT_WITH_DB","+FOUND_ROWS","+IGNORE_SIGPIPE","+IGNORE_SPACE","+LOCAL_FILES","+LONG_FLAG","+LONG_PASSWORD","+MULTI_RESULTS","+ODBC","-PLUGIN_AUTH","+PROTOCOL_41","+PS_MULTI_RESULTS","+RESERVED","+SECURE_CONNECTION","+TRANSACTIONS"];return e&&void 0!==e.localInfile&&!e.localInfile&&t.push("-LOCAL_FILES"),e&&e.multipleStatements&&t.push("+MULTI_STATEMENTS"),t},o.getSSLProfile=function(e){r||(r=_(3859));var t=r[e];if(void 0===t)throw new TypeError("Unknown SSL profile '"+e+"'");return t},o.parseFlagList=function(e){var t=Object.create(null);if(!e)return t;for(var _=Array.isArray(e)?e:String(e||"").toUpperCase().split(/\s*,+\s*/),i=0;i<_.length;i++){var n=_[i],s=1,r=n[0];void 0!==r&&("-"!==r&&"+"!==r&&(s=0,r="+"),t[n.substr(s)]="+"===r)}return t},o.parseUrl=function(e){var t={host:(e=i(e,!0)).hostname,port:e.port,database:e.pathname.substr(1)};if(e.auth){var _=e.auth.split(":");t.user=_.shift(),t.password=_.join(":")}if(e.query)for(var n in e.query){var s=e.query[n];try{t[n]=JSON.parse(s)}catch(e){t[n]=s}}return t}},6563:(e,t,_)=>{var i=_(2125),n=_(3589),s=_(4434).EventEmitter,r=_(9023),o=_(7915);function a(e){s.call(this),this.config=e.config,this.config.connectionConfig.pool=this,this._acquiringConnections=[],this._allConnections=[],this._freeConnections=[],this._connectionQueue=[],this._closed=!1}function E(e,t){var _;-1!==(_=e.indexOf(t))&&e.splice(_,1)}e.exports=a,r.inherits(a,s),a.prototype.getConnection=function(e){if(this._closed){var t=new Error("Pool is closed.");return t.code="POOL_CLOSED",void process.nextTick(function(){e(t)})}var _,i=this;return this._freeConnections.length>0?(_=this._freeConnections.shift(),void this.acquireConnection(_,e)):0===this.config.connectionLimit||this._allConnections.length<this.config.connectionLimit?(_=new o(this,{config:this.config.newConnectionConfig()}),this._acquiringConnections.push(_),this._allConnections.push(_),void _.connect({timeout:this.config.acquireTimeout},function(t){if(E(i._acquiringConnections,_),i._closed&&((t=new Error("Pool is closed.")).code="POOL_CLOSED"),t)return i._purgeConnection(_),void e(t);i.emit("connection",_),i.emit("acquire",_),e(null,_)})):void(this.config.waitForConnections?this._enqueueCallback(e):process.nextTick(function(){var t=new Error("No connections available.");t.code="POOL_CONNLIMIT",e(t)}))},a.prototype.acquireConnection=function(e,t){if(e._pool!==this)throw new Error("Connection acquired from wrong pool.");var _=this._needsChangeUser(e),i=this;function n(n){if(E(i._acquiringConnections,e),i._closed&&((n=new Error("Pool is closed.")).code="POOL_CLOSED"),n)return i._connectionQueue.unshift(t),void i._purgeConnection(e);_&&i.emit("connection",e),i.emit("acquire",e),t(null,e)}this._acquiringConnections.push(e),_?(e.config=this.config.newConnectionConfig(),e.changeUser({timeout:this.config.acquireTimeout},n)):e.ping({timeout:this.config.acquireTimeout},n)},a.prototype.releaseConnection=function(e){if(-1===this._acquiringConnections.indexOf(e)){if(e._pool){if(e._pool!==this)throw new Error("Connection released to wrong pool");if(-1!==this._freeConnections.indexOf(e))throw new Error("Connection already released");this._freeConnections.push(e),this.emit("release",e)}this._closed?this._connectionQueue.splice(0).forEach(function(e){var t=new Error("Pool is closed.");t.code="POOL_CLOSED",process.nextTick(function(){e(t)})}):this._connectionQueue.length&&this.getConnection(this._connectionQueue.shift())}},a.prototype.end=function(e){this._closed=!0,"function"!=typeof e&&(e=function(e){if(e)throw e});var t=!1,_=0;function i(i){!t&&(i||--_<=0)&&(t=!0,e(i))}for(;0!==this._allConnections.length;)_++,this._purgeConnection(this._allConnections[0],i);0===_&&process.nextTick(i)},a.prototype.query=function(e,t,_){var i=n.createQuery(e,t,_);return"object"==typeof e&&"typeCast"in e||(i.typeCast=this.config.connectionConfig.typeCast),this.config.connectionConfig.trace&&(i._callSite=new Error),this.getConnection(function(e,t){if(e)return i.on("error",function(){}),void i.end(e);i.once("end",function(){t.release()}),t.query(i)}),i},a.prototype._enqueueCallback=function(e){if(this.config.queueLimit&&this._connectionQueue.length>=this.config.queueLimit)process.nextTick(function(){var t=new Error("Queue limit reached.");t.code="POOL_ENQUEUELIMIT",e(t)});else{var t=process.domain?process.domain.bind(e):e;this._connectionQueue.push(t),this.emit("enqueue")}},a.prototype._needsChangeUser=function(e){var t=e.config,_=this.config.connectionConfig;return t.user!==_.user||t.database!==_.database||t.password!==_.password||t.charsetNumber!==_.charsetNumber},a.prototype._purgeConnection=function(e,t){var _=t||function(){};"disconnected"===e.state&&e.destroy(),this._removeConnection(e),"disconnected"===e.state||e._protocol._quitSequence?process.nextTick(_):e._realEnd(_)},a.prototype._removeConnection=function(e){e._pool=null,E(this._allConnections,e),E(this._freeConnections,e),this.releaseConnection(e)},a.prototype.escape=function(e){return i.escape(e,this.config.connectionConfig.stringifyObjects,this.config.connectionConfig.timezone)},a.prototype.escapeId=function(e){return i.escapeId(e,!1)}},5145:(e,t,_)=>{var i=_(6563),n=_(9421),s=_(1808),r=_(7002),o=_(9023),a=_(4434).EventEmitter;function E(e){a.call(this),e=e||{},this._canRetry=void 0===e.canRetry||e.canRetry,this._defaultSelector=e.defaultSelector||"RR",this._removeNodeErrorCount=e.removeNodeErrorCount||5,this._restoreNodeTimeout=e.restoreNodeTimeout||0,this._closed=!1,this._findCaches=Object.create(null),this._lastId=0,this._namespaces=Object.create(null),this._nodes=Object.create(null)}function c(){var e;return e="function"==typeof process.hrtime?1e3*(e=process.hrtime())[0]+1e-6*e[1]:1e3*process.uptime(),Math.floor(e)}function l(e){if(e)throw e}function h(){}e.exports=E,o.inherits(E,a),E.prototype.add=function(e,t){if(this._closed)throw new Error("PoolCluster is closed.");var _="object"==typeof e?"CLUSTER::"+ ++this._lastId:String(e);if(void 0!==this._nodes[_])throw new Error('Node ID "'+_+'" is already defined in PoolCluster.');var s=new n("object"!=typeof e?t:e);this._nodes[_]={id:_,errorCount:0,pool:new i({config:s}),_offlineUntil:0},this._clearFindCaches()},E.prototype.end=function(e){var t=void 0!==e?e:l;if("function"!=typeof t)throw TypeError("callback argument must be a function");if(this._closed)process.nextTick(t);else{this._closed=!0;for(var _=!1,i=Object.keys(this._nodes),n=0,s=0;s<i.length;s++){var r=i[s],o=this._nodes[r];n++,o.pool.end(a)}0===n&&process.nextTick(a)}function a(e){!_&&(e||--n<=0)&&(_=!0,t(e))}},E.prototype.of=function(e,t){e=e||"*",t=(t=t||this._defaultSelector).toUpperCase(),void 0===r[t]&&(t=this._defaultSelector);var _=e+t;return void 0===this._namespaces[_]&&(this._namespaces[_]=new s(this,e,t)),this._namespaces[_]},E.prototype.remove=function(e){for(var t=this._findNodeIds(e,!0),_=0;_<t.length;_++){var i=this._getNode(t[_]);i&&this._removeNode(i)}},E.prototype.getConnection=function(e,t,_){var i;"function"==typeof e?(_=e,i=this.of()):("function"==typeof t&&(_=t,t=this._defaultSelector),i=this.of(e,t)),i.getConnection(_)},E.prototype._clearFindCaches=function(){this._findCaches=Object.create(null)},E.prototype._decreaseErrorCount=function(e){var t=e.errorCount;t>this._removeNodeErrorCount&&(t=this._removeNodeErrorCount),t<1&&(t=1),e.errorCount=t-1,e._offlineUntil&&(e._offlineUntil=0,this.emit("online",e.id))},E.prototype._findNodeIds=function(e,t){var _=0,i=this._findCaches[e];if(void 0===i){var n=function(e){if("object"==typeof(t=e)&&"[object RegExp]"===Object.prototype.toString.call(t))return e;var t,_=e.replace(/([.+?^=!:${}()|\[\]\/\\])/g,"\\$1").replace(/\*/g,".*");return new RegExp("^"+_+"$")}(e);i=Object.keys(this._nodes).filter(function(e){return e.match(n)}),this._findCaches[e]=i}return t?i:i.filter(function(e){var t=this._getNode(e);return!t._offlineUntil||(_||(_=c()),t._offlineUntil<=_)},this)},E.prototype._getNode=function(e){return this._nodes[e]||null},E.prototype._increaseErrorCount=function(e){var t=++e.errorCount;if(!(this._removeNodeErrorCount>t)){if(this._restoreNodeTimeout>0)return e._offlineUntil=c()+this._restoreNodeTimeout,void this.emit("offline",e.id);this._removeNode(e),this.emit("remove",e.id)}},E.prototype._getConnection=function(e,t){var _=this;e.pool.getConnection(function(i,n){if(i)return _._increaseErrorCount(e),void t(i);_._decreaseErrorCount(e),n._clusterId=e.id,t(null,n)})},E.prototype._removeNode=function(e){delete this._nodes[e.id],this._clearFindCaches(),e.pool.end(h)}},9421:(e,t,_)=>{var i=_(7363);function n(e){"string"==typeof e&&(e=i.parseUrl(e)),this.acquireTimeout=void 0===e.acquireTimeout?1e4:Number(e.