kiwi-webpack-plugin
Version:
Test Runner for Webpack and the Kakoune editor
11 lines • 482 kB
JavaScript
module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=96)}([function(e,t){e.exports=require("fs")},function(e,t){e.exports=require("path")},function(e,t){e.exports=require("util")},function(e,t){e.exports=require("child_process")},function(e,t){e.exports=require("events")},function(e,t,n){"use strict";e.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),EMPTY_BUFFER:Buffer.alloc(0),NOOP:()=>{}}},function(e,t){e.exports=require("net")},function(e,t){e.exports=require("crypto")},,function(e,t){e.exports=require("http")},function(e,t,n){"use strict";const r=n(77),i=n(11),o=n(80),{kStatusCode:a,NOOP:s}=n(5),c=Buffer.from([0,0,255,255]),p=Symbol("permessage-deflate"),d=Symbol("total-length"),l=Symbol("callback"),m=Symbol("buffers"),u=Symbol("error");let h;function f(e){this[m].push(e),this[d]+=e.length}function g(e){this[d]+=e.length,this[p]._maxPayload<1||this[d]<=this[p]._maxPayload?this[m].push(e):(this[u]=new RangeError("Max payload size exceeded"),this[u].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[u][a]=1009,this.removeListener("data",g),this.reset())}function y(e){this[p]._inflate=null,e[a]=1007,this[l](e)}e.exports=class{constructor(e,t,n){if(this._maxPayload=0|n,this._options=e||{},this._threshold=void 0!==this._options.threshold?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!h){const e=void 0!==this._options.concurrencyLimit?this._options.concurrencyLimit:10;h=new o(e)}}static get extensionName(){return"permessage-deflate"}offer(){const e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:null==this._options.clientMaxWindowBits&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){const e=this._deflate[l];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){const t=this._options,n=e.find(e=>!(!1===t.serverNoContextTakeover&&e.server_no_context_takeover||e.server_max_window_bits&&(!1===t.serverMaxWindowBits||"number"==typeof t.serverMaxWindowBits&&t.serverMaxWindowBits>e.server_max_window_bits)||"number"==typeof t.clientMaxWindowBits&&!e.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),"number"==typeof t.serverMaxWindowBits&&(n.server_max_window_bits=t.serverMaxWindowBits),"number"==typeof t.clientMaxWindowBits?n.client_max_window_bits=t.clientMaxWindowBits:!0!==n.client_max_window_bits&&!1!==t.clientMaxWindowBits||delete n.client_max_window_bits,n}acceptAsClient(e){const t=e[0];if(!1===this._options.clientNoContextTakeover&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(t.client_max_window_bits){if(!1===this._options.clientMaxWindowBits||"number"==typeof this._options.clientMaxWindowBits&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"')}else"number"==typeof this._options.clientMaxWindowBits&&(t.client_max_window_bits=this._options.clientMaxWindowBits);return t}normalizeParams(e){return e.forEach(e=>{Object.keys(e).forEach(t=>{let n=e[t];if(n.length>1)throw new Error(`Parameter "${t}" must have only a single value`);if(n=n[0],"client_max_window_bits"===t){if(!0!==n){const e=+n;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${t}": ${n}`)}else if("server_max_window_bits"===t){const e=+n;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else{if("client_no_context_takeover"!==t&&"server_no_context_takeover"!==t)throw new Error(`Unknown parameter "${t}"`);if(!0!==n)throw new TypeError(`Invalid value for parameter "${t}": ${n}`)}e[t]=n})}),e}decompress(e,t,n){h.add(r=>{this._decompress(e,t,(e,t)=>{r(),n(e,t)})})}compress(e,t,n){h.add(r=>{this._compress(e,t,(e,t)=>{r(),n(e,t)})})}_decompress(e,t,n){const o=this._isServer?"client":"server";if(!this._inflate){const e=o+"_max_window_bits",t="number"!=typeof this.params[e]?r.Z_DEFAULT_WINDOWBITS:this.params[e];this._inflate=r.createInflateRaw({...this._options.zlibInflateOptions,windowBits:t}),this._inflate[p]=this,this._inflate[d]=0,this._inflate[m]=[],this._inflate.on("error",y),this._inflate.on("data",g)}this._inflate[l]=n,this._inflate.write(e),t&&this._inflate.write(c),this._inflate.flush(()=>{const e=this._inflate[u];if(e)return this._inflate.close(),this._inflate=null,void n(e);const r=i.concat(this._inflate[m],this._inflate[d]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[d]=0,this._inflate[m]=[],t&&this.params[o+"_no_context_takeover"]&&this._inflate.reset()),n(null,r)})}_compress(e,t,n){const o=this._isServer?"server":"client";if(!this._deflate){const e=o+"_max_window_bits",t="number"!=typeof this.params[e]?r.Z_DEFAULT_WINDOWBITS:this.params[e];this._deflate=r.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:t}),this._deflate[d]=0,this._deflate[m]=[],this._deflate.on("error",s),this._deflate.on("data",f)}this._deflate[l]=n,this._deflate.write(e),this._deflate.flush(r.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let e=i.concat(this._deflate[m],this._deflate[d]);t&&(e=e.slice(0,e.length-4)),this._deflate[l]=null,this._deflate[d]=0,this._deflate[m]=[],t&&this.params[o+"_no_context_takeover"]&&this._deflate.reset(),n(null,e)})}}},function(e,t,n){"use strict";const{EMPTY_BUFFER:r}=n(5);function i(e,t){if(0===e.length)return r;if(1===e.length)return e[0];const n=Buffer.allocUnsafe(t);let i=0;for(let t=0;t<e.length;t++){const r=e[t];n.set(r,i),i+=r.length}return i<t?n.slice(0,i):n}function o(e,t,n,r,i){for(let o=0;o<i;o++)n[r+o]=e[o]^t[3&o]}function a(e,t){const n=e.length;for(let r=0;r<n;r++)e[r]^=t[3&r]}function s(e){return e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function c(e){if(c.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=Buffer.from(e):ArrayBuffer.isView(e)?t=Buffer.from(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),c.readOnly=!1),t}try{const t=n(78),r=t.BufferUtil||t;e.exports={concat:i,mask(e,t,n,i,a){a<48?o(e,t,n,i,a):r.mask(e,t,n,i,a)},toArrayBuffer:s,toBuffer:c,unmask(e,t){e.length<32?a(e,t):r.unmask(e,t)}}}catch(t){e.exports={concat:i,mask:o,toArrayBuffer:s,toBuffer:c,unmask:a}}},function(e,t){e.exports=require("assert")},function(e,t,n){e.exports=d,d.Minimatch=l;var r={sep:"/"};try{r=n(1)}catch(e){}var i=d.GLOBSTAR=l.GLOBSTAR={},o=n(51),a={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},s="().*{}+?[]^$\\!".split("").reduce((function(e,t){return e[t]=!0,e}),{});var c=/\/+/;function p(e,t){e=e||{},t=t||{};var n={};return Object.keys(t).forEach((function(e){n[e]=t[e]})),Object.keys(e).forEach((function(t){n[t]=e[t]})),n}function d(e,t,n){if("string"!=typeof t)throw new TypeError("glob pattern string required");return n||(n={}),!(!n.nocomment&&"#"===t.charAt(0))&&(""===t.trim()?""===e:new l(t,n).match(e))}function l(e,t){if(!(this instanceof l))return new l(e,t);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),"/"!==r.sep&&(e=e.split(r.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function m(e,t){if(t||(t=this instanceof l?this.options:{}),void 0===(e=void 0===e?this.pattern:e))throw new TypeError("undefined pattern");return t.nobrace||!e.match(/\{.*\}/)?[e]:o(e)}d.filter=function(e,t){return t=t||{},function(n,r,i){return d(n,e,t)}},d.defaults=function(e){if(!e||!Object.keys(e).length)return d;var t=d,n=function(n,r,i){return t.minimatch(n,r,p(e,i))};return n.Minimatch=function(n,r){return new t.Minimatch(n,p(e,r))},n},l.defaults=function(e){return e&&Object.keys(e).length?d.defaults(e).Minimatch:l},l.prototype.debug=function(){},l.prototype.make=function(){if(this._made)return;var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var n=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error);this.debug(this.pattern,n),n=this.globParts=n.map((function(e){return e.split(c)})),this.debug(this.pattern,n),n=n.map((function(e,t,n){return e.map(this.parse,this)}),this),this.debug(this.pattern,n),n=n.filter((function(e){return-1===e.indexOf(!1)})),this.debug(this.pattern,n),this.set=n},l.prototype.parseNegate=function(){var e=this.pattern,t=!1,n=this.options,r=0;if(n.nonegate)return;for(var i=0,o=e.length;i<o&&"!"===e.charAt(i);i++)t=!t,r++;r&&(this.pattern=e.substr(r));this.negate=t},d.braceExpand=function(e,t){return m(e,t)},l.prototype.braceExpand=m,l.prototype.parse=function(e,t){if(e.length>65536)throw new TypeError("pattern is too long");var n=this.options;if(!n.noglobstar&&"**"===e)return i;if(""===e)return"";var r,o="",c=!!n.nocase,p=!1,d=[],l=[],m=!1,h=-1,f=-1,g="."===e.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",y=this;function b(){if(r){switch(r){case"*":o+="[^/]*?",c=!0;break;case"?":o+="[^/]",c=!0;break;default:o+="\\"+r}y.debug("clearStateChar %j %j",r,o),r=!1}}for(var v,w=0,S=e.length;w<S&&(v=e.charAt(w));w++)if(this.debug("%s\t%s %s %j",e,w,o,v),p&&s[v])o+="\\"+v,p=!1;else switch(v){case"/":return!1;case"\\":b(),p=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",e,w,o,v),m){this.debug(" in class"),"!"===v&&w===f+1&&(v="^"),o+=v;continue}y.debug("call clearStateChar %j",r),b(),r=v,n.noext&&b();continue;case"(":if(m){o+="(";continue}if(!r){o+="\\(";continue}d.push({type:r,start:w-1,reStart:o.length,open:a[r].open,close:a[r].close}),o+="!"===r?"(?:(?!(?:":"(?:",this.debug("plType %j %j",r,o),r=!1;continue;case")":if(m||!d.length){o+="\\)";continue}b(),c=!0;var x=d.pop();o+=x.close,"!"===x.type&&l.push(x),x.reEnd=o.length;continue;case"|":if(m||!d.length||p){o+="\\|",p=!1;continue}b(),o+="|";continue;case"[":if(b(),m){o+="\\"+v;continue}m=!0,f=w,h=o.length,o+=v;continue;case"]":if(w===f+1||!m){o+="\\"+v,p=!1;continue}if(m){var I=e.substring(f+1,w);try{RegExp("["+I+"]")}catch(e){var k=this.parse(I,u);o=o.substr(0,h)+"\\["+k[0]+"\\]",c=c||k[1],m=!1;continue}}c=!0,m=!1,o+=v;continue;default:b(),p?p=!1:!s[v]||"^"===v&&m||(o+="\\"),o+=v}m&&(I=e.substr(f+1),k=this.parse(I,u),o=o.substr(0,h)+"\\["+k[0],c=c||k[1]);for(x=d.pop();x;x=d.pop()){var T=o.slice(x.reStart+x.open.length);this.debug("setting tail",o,x),T=T.replace(/((?:\\{2}){0,64})(\\?)\|/g,(function(e,t,n){return n||(n="\\"),t+t+n+"|"})),this.debug("tail=%j\n %s",T,T,x,o);var R="*"===x.type?"[^/]*?":"?"===x.type?"[^/]":"\\"+x.type;c=!0,o=o.slice(0,x.reStart)+R+"\\("+T}b(),p&&(o+="\\\\");var _=!1;switch(o.charAt(0)){case".":case"[":case"(":_=!0}for(var C=l.length-1;C>-1;C--){var $=l[C],E=o.slice(0,$.reStart),O=o.slice($.reStart,$.reEnd-8),D=o.slice($.reEnd-8,$.reEnd),N=o.slice($.reEnd);D+=N;var P=E.split("(").length-1,j=N;for(w=0;w<P;w++)j=j.replace(/\)[+*?]?/,"");var A="";""===(N=j)&&t!==u&&(A="$"),o=E+O+N+A+D}""!==o&&c&&(o="(?=.)"+o);_&&(o=g+o);if(t===u)return[o,c];if(!c)return function(e){return e.replace(/\\(.)/g,"$1")}(e);var L=n.nocase?"i":"";try{var M=new RegExp("^"+o+"$",L)}catch(e){return new RegExp("$.")}return M._glob=e,M._src=o,M};var u={};d.makeRe=function(e,t){return new l(e,t||{}).makeRe()},l.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,n=t.noglobstar?"[^/]*?":t.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",r=t.nocase?"i":"",o=e.map((function(e){return e.map((function(e){return e===i?n:"string"==typeof e?function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}(e):e._src})).join("\\/")})).join("|");o="^(?:"+o+")$",this.negate&&(o="^(?!"+o+").*$");try{this.regexp=new RegExp(o,r)}catch(e){this.regexp=!1}return this.regexp},d.match=function(e,t,n){var r=new l(t,n=n||{});return e=e.filter((function(e){return r.match(e)})),r.options.nonull&&!e.length&&e.push(t),e},l.prototype.match=function(e,t){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return""===e;if("/"===e&&t)return!0;var n=this.options;"/"!==r.sep&&(e=e.split(r.sep).join("/"));e=e.split(c),this.debug(this.pattern,"split",e);var i,o,a=this.set;for(this.debug(this.pattern,"set",a),o=e.length-1;o>=0&&!(i=e[o]);o--);for(o=0;o<a.length;o++){var s=a[o],p=e;if(n.matchBase&&1===s.length&&(p=[i]),this.matchOne(p,s,t))return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate},l.prototype.matchOne=function(e,t,n){var r=this.options;this.debug("matchOne",{this:this,file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var o=0,a=0,s=e.length,c=t.length;o<s&&a<c;o++,a++){this.debug("matchOne loop");var p,d=t[a],l=e[o];if(this.debug(t,d,l),!1===d)return!1;if(d===i){this.debug("GLOBSTAR",[t,d,l]);var m=o,u=a+1;if(u===c){for(this.debug("** at the end");o<s;o++)if("."===e[o]||".."===e[o]||!r.dot&&"."===e[o].charAt(0))return!1;return!0}for(;m<s;){var h=e[m];if(this.debug("\nglobstar while",e,m,t,u,h),this.matchOne(e.slice(m),t.slice(u),n))return this.debug("globstar found match!",m,s,h),!0;if("."===h||".."===h||!r.dot&&"."===h.charAt(0)){this.debug("dot detected!",e,m,t,u);break}this.debug("globstar swallow a segment, and continue"),m++}return!(!n||(this.debug("\n>>> no match, partial?",e,m,t,u),m!==s))}if("string"==typeof d?(p=r.nocase?l.toLowerCase()===d.toLowerCase():l===d,this.debug("string match",d,l,p)):(p=l.match(d),this.debug("pattern match",d,l,p)),!p)return!1}if(o===s&&a===c)return!0;if(o===s)return n;if(a===c)return o===s-1&&""===e[o];throw new Error("wtf?")}},function(e,t,n){"use strict";function r(e){return"/"===e.charAt(0)}function i(e){var t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/.exec(e),n=t[1]||"",r=Boolean(n&&":"!==n.charAt(1));return Boolean(t[2]||r)}e.exports="win32"===process.platform?i:r,e.exports.posix=r,e.exports.win32=i},function(e,t){e.exports=require("os")},function(e,t){e.exports=require("https")},function(e,t){e.exports=require("url")},function(e,t){e.exports=require("tls")},function(e,t){e.exports=require("stream")},,,,function(e,t,n){e.exports=v;var r=n(0),i=n(24),o=n(13),a=(o.Minimatch,n(54)),s=n(4).EventEmitter,c=n(1),p=n(12),d=n(14),l=n(56),m=n(25),u=(m.alphasort,m.alphasorti,m.setopts),h=m.ownProp,f=n(57),g=(n(2),m.childrenIgnored),y=m.isIgnored,b=n(27);function v(e,t,n){if("function"==typeof t&&(n=t,t={}),t||(t={}),t.sync){if(n)throw new TypeError("callback provided to sync glob");return l(e,t)}return new S(e,t,n)}v.sync=l;var w=v.GlobSync=l.GlobSync;function S(e,t,n){if("function"==typeof t&&(n=t,t=null),t&&t.sync){if(n)throw new TypeError("callback provided to sync glob");return new w(e,t)}if(!(this instanceof S))return new S(e,t,n);u(this,e,t),this._didRealPath=!1;var r=this.minimatch.set.length;this.matches=new Array(r),"function"==typeof n&&(n=b(n),this.on("error",n),this.on("end",(function(e){n(null,e)})));var i=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(0===r)return a();for(var o=0;o<r;o++)this._process(this.minimatch.set[o],o,!1,a);function a(){--i._processing,i._processing<=0&&i._finish()}}v.glob=v,v.hasMagic=function(e,t){var n=function(e,t){if(null===t||"object"!=typeof t)return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}({},t);n.noprocess=!0;var r=new S(e,n).minimatch.set;if(!e)return!1;if(r.length>1)return!0;for(var i=0;i<r[0].length;i++)if("string"!=typeof r[0][i])return!0;return!1},v.Glob=S,a(S,s),S.prototype._finish=function(){if(p(this instanceof S),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();m.finish(this),this.emit("end",this.found)}},S.prototype._realpath=function(){if(!this._didRealpath){this._didRealpath=!0;var e=this.matches.length;if(0===e)return this._finish();for(var t=this,n=0;n<this.matches.length;n++)this._realpathSet(n,r)}function r(){0==--e&&t._finish()}},S.prototype._realpathSet=function(e,t){var n=this.matches[e];if(!n)return t();var r=Object.keys(n),o=this,a=r.length;if(0===a)return t();var s=this.matches[e]=Object.create(null);r.forEach((function(n,r){n=o._makeAbs(n),i.realpath(n,o.realpathCache,(function(r,i){r?"stat"===r.syscall?s[n]=!0:o.emit("error",r):s[i]=!0,0==--a&&(o.matches[e]=s,t())}))}))},S.prototype._mark=function(e){return m.mark(this,e)},S.prototype._makeAbs=function(e){return m.makeAbs(this,e)},S.prototype.abort=function(){this.aborted=!0,this.emit("abort")},S.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))},S.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 n=e[t];this._emitMatch(n[0],n[1])}}if(this._processQueue.length){var r=this._processQueue.slice(0);this._processQueue.length=0;for(t=0;t<r.length;t++){var i=r[t];this._processing--,this._process(i[0],i[1],i[2],i[3])}}}},S.prototype._process=function(e,t,n,r){if(p(this instanceof S),p("function"==typeof r),!this.aborted)if(this._processing++,this.paused)this._processQueue.push([e,t,n,r]);else{for(var i,a=0;"string"==typeof e[a];)a++;switch(a){case e.length:return void this._processSimple(e.join("/"),t,r);case 0:i=null;break;default:i=e.slice(0,a).join("/")}var s,c=e.slice(a);null===i?s=".":d(i)||d(e.join("/"))?(i&&d(i)||(i="/"+i),s=i):s=i;var l=this._makeAbs(s);if(g(this,s))return r();c[0]===o.GLOBSTAR?this._processGlobStar(i,s,l,c,t,n,r):this._processReaddir(i,s,l,c,t,n,r)}},S.prototype._processReaddir=function(e,t,n,r,i,o,a){var s=this;this._readdir(n,o,(function(c,p){return s._processReaddir2(e,t,n,r,i,o,p,a)}))},S.prototype._processReaddir2=function(e,t,n,r,i,o,a,s){if(!a)return s();for(var p=r[0],d=!!this.minimatch.negate,l=p._glob,m=this.dot||"."===l.charAt(0),u=[],h=0;h<a.length;h++){if("."!==(g=a[h]).charAt(0)||m)(d&&!e?!g.match(p):g.match(p))&&u.push(g)}var f=u.length;if(0===f)return s();if(1===r.length&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(h=0;h<f;h++){var g=u[h];e&&(g="/"!==e?e+"/"+g:e+g),"/"!==g.charAt(0)||this.nomount||(g=c.join(this.root,g)),this._emitMatch(i,g)}return s()}r.shift();for(h=0;h<f;h++){g=u[h];e&&(g="/"!==e?e+"/"+g:e+g),this._process([g].concat(r),i,o,s)}s()},S.prototype._emitMatch=function(e,t){if(!this.aborted&&!y(this,t))if(this.paused)this._emitQueue.push([e,t]);else{var n=d(t)?t:this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=n),!this.matches[e][t]){if(this.nodir){var r=this.cache[n];if("DIR"===r||Array.isArray(r))return}this.matches[e][t]=!0;var i=this.statCache[n];i&&this.emit("stat",t,i),this.emit("match",t)}}},S.prototype._readdirInGlobStar=function(e,t){if(!this.aborted){if(this.follow)return this._readdir(e,!1,t);var n=this,i=f("lstat\0"+e,(function(r,i){if(r&&"ENOENT"===r.code)return t();var o=i&&i.isSymbolicLink();n.symlinks[e]=o,o||!i||i.isDirectory()?n._readdir(e,!1,t):(n.cache[e]="FILE",t())}));i&&r.lstat(e,i)}},S.prototype._readdir=function(e,t,n){if(!this.aborted&&(n=f("readdir\0"+e+"\0"+t,n))){if(t&&!h(this.symlinks,e))return this._readdirInGlobStar(e,n);if(h(this.cache,e)){var i=this.cache[e];if(!i||"FILE"===i)return n();if(Array.isArray(i))return n(null,i)}r.readdir(e,function(e,t,n){return function(r,i){r?e._readdirError(t,r,n):e._readdirEntries(t,i,n)}}(this,e,n))}},S.prototype._readdirEntries=function(e,t,n){if(!this.aborted){if(!this.mark&&!this.stat)for(var r=0;r<t.length;r++){var i=t[r];i="/"===e?e+i:e+"/"+i,this.cache[i]=!0}return this.cache[e]=t,n(null,t)}},S.prototype._readdirError=function(e,t,n){if(!this.aborted){switch(t.code){case"ENOTSUP":case"ENOTDIR":var r=this._makeAbs(e);if(this.cache[r]="FILE",r===this.cwdAbs){var i=new Error(t.code+" invalid cwd "+this.cwd);i.path=this.cwd,i.code=t.code,this.emit("error",i),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 n()}},S.prototype._processGlobStar=function(e,t,n,r,i,o,a){var s=this;this._readdir(n,o,(function(c,p){s._processGlobStar2(e,t,n,r,i,o,p,a)}))},S.prototype._processGlobStar2=function(e,t,n,r,i,o,a,s){if(!a)return s();var c=r.slice(1),p=e?[e]:[],d=p.concat(c);this._process(d,i,!1,s);var l=this.symlinks[n],m=a.length;if(l&&o)return s();for(var u=0;u<m;u++){if("."!==a[u].charAt(0)||this.dot){var h=p.concat(a[u],c);this._process(h,i,!0,s);var f=p.concat(a[u],r);this._process(f,i,!0,s)}}s()},S.prototype._processSimple=function(e,t,n){var r=this;this._stat(e,(function(i,o){r._processSimple2(e,t,i,o,n)}))},S.prototype._processSimple2=function(e,t,n,r,i){if(this.matches[t]||(this.matches[t]=Object.create(null)),!r)return i();if(e&&d(e)&&!this.nomount){var o=/[\/\\]$/.test(e);"/"===e.charAt(0)?e=c.join(this.root,e):(e=c.resolve(this.root,e),o&&(e+="/"))}"win32"===process.platform&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e),i()},S.prototype._stat=function(e,t){var n=this._makeAbs(e),i="/"===e.slice(-1);if(e.length>this.maxLength)return t();if(!this.stat&&h(this.cache,n)){var o=this.cache[n];if(Array.isArray(o)&&(o="DIR"),!i||"DIR"===o)return t(null,o);if(i&&"FILE"===o)return t()}var a=this.statCache[n];if(void 0!==a){if(!1===a)return t(null,a);var s=a.isDirectory()?"DIR":"FILE";return i&&"FILE"===s?t():t(null,s,a)}var c=this,p=f("stat\0"+n,(function(i,o){if(o&&o.isSymbolicLink())return r.stat(n,(function(r,i){r?c._stat2(e,n,null,o,t):c._stat2(e,n,r,i,t)}));c._stat2(e,n,i,o,t)}));p&&r.lstat(n,p)},S.prototype._stat2=function(e,t,n,r,i){if(n&&("ENOENT"===n.code||"ENOTDIR"===n.code))return this.statCache[t]=!1,i();var o="/"===e.slice(-1);if(this.statCache[t]=r,"/"===t.slice(-1)&&r&&!r.isDirectory())return i(null,!1,r);var a=!0;return r&&(a=r.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||a,o&&"FILE"===a?i():i(null,a,r)}},function(e,t,n){e.exports=d,d.realpath=d,d.sync=l,d.realpathSync=l,d.monkeypatch=function(){r.realpath=d,r.realpathSync=l},d.unmonkeypatch=function(){r.realpath=i,r.realpathSync=o};var r=n(0),i=r.realpath,o=r.realpathSync,a=process.version,s=/^v[0-5]\./.test(a),c=n(50);function p(e){return e&&"realpath"===e.syscall&&("ELOOP"===e.code||"ENOMEM"===e.code||"ENAMETOOLONG"===e.code)}function d(e,t,n){if(s)return i(e,t,n);"function"==typeof t&&(n=t,t=null),i(e,t,(function(r,i){p(r)?c.realpath(e,t,n):n(r,i)}))}function l(e,t){if(s)return o(e,t);try{return o(e,t)}catch(n){if(p(n))return c.realpathSync(e,t);throw n}}},function(e,t,n){function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.alphasort=p,t.alphasorti=c,t.setopts=function(e,t,n){n||(n={});if(n.matchBase&&-1===t.indexOf("/")){if(n.noglobstar)throw new Error("base matching requires globstar");t="**/"+t}e.silent=!!n.silent,e.pattern=t,e.strict=!1!==n.strict,e.realpath=!!n.realpath,e.realpathCache=n.realpathCache||Object.create(null),e.follow=!!n.follow,e.dot=!!n.dot,e.mark=!!n.mark,e.nodir=!!n.nodir,e.nodir&&(e.mark=!0);e.sync=!!n.sync,e.nounique=!!n.nounique,e.nonull=!!n.nonull,e.nosort=!!n.nosort,e.nocase=!!n.nocase,e.stat=!!n.stat,e.noprocess=!!n.noprocess,e.absolute=!!n.absolute,e.maxLength=n.maxLength||1/0,e.cache=n.cache||Object.create(null),e.statCache=n.statCache||Object.create(null),e.symlinks=n.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(d))}(e,n),e.changedCwd=!1;var o=process.cwd();r(n,"cwd")?(e.cwd=i.resolve(n.cwd),e.changedCwd=e.cwd!==o):e.cwd=o;e.root=n.root||i.resolve(e.cwd,"/"),e.root=i.resolve(e.root),"win32"===process.platform&&(e.root=e.root.replace(/\\/g,"/"));e.cwdAbs=a(e.cwd)?e.cwd:l(e,e.cwd),"win32"===process.platform&&(e.cwdAbs=e.cwdAbs.replace(/\\/g,"/"));e.nomount=!!n.nomount,n.nonegate=!0,n.nocomment=!0,e.minimatch=new s(t,n),e.options=e.minimatch.options},t.ownProp=r,t.makeAbs=l,t.finish=function(e){for(var t=e.nounique,n=t?[]:Object.create(null),r=0,i=e.matches.length;r<i;r++){var o=e.matches[r];if(o&&0!==Object.keys(o).length){var a=Object.keys(o);t?n.push.apply(n,a):a.forEach((function(e){n[e]=!0}))}else if(e.nonull){var s=e.minimatch.globSet[r];t?n.push(s):n[s]=!0}}t||(n=Object.keys(n));e.nosort||(n=n.sort(e.nocase?c:p));if(e.mark){for(r=0;r<n.length;r++)n[r]=e._mark(n[r]);e.nodir&&(n=n.filter((function(t){var n=!/\/$/.test(t),r=e.cache[t]||e.cache[l(e,t)];return n&&r&&(n="DIR"!==r&&!Array.isArray(r)),n})))}e.ignore.length&&(n=n.filter((function(t){return!m(e,t)})));e.found=n},t.mark=function(e,t){var n=l(e,t),r=e.cache[n],i=t;if(r){var o="DIR"===r||Array.isArray(r),a="/"===t.slice(-1);if(o&&!a?i+="/":!o&&a&&(i=i.slice(0,-1)),i!==t){var s=l(e,i);e.statCache[s]=e.statCache[n],e.cache[s]=e.cache[n]}}return i},t.isIgnored=m,t.childrenIgnored=function(e,t){return!!e.ignore.length&&e.ignore.some((function(e){return!(!e.gmatcher||!e.gmatcher.match(t))}))};var i=n(1),o=n(13),a=n(14),s=o.Minimatch;function c(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())}function p(e,t){return e.localeCompare(t)}function d(e){var t=null;if("/**"===e.slice(-3)){var n=e.replace(/(\/\*\*)+$/,"");t=new s(n,{dot:!0})}return{matcher:new s(e,{dot:!0}),gmatcher:t}}function l(e,t){var n=t;return n="/"===t.charAt(0)?i.join(e.root,t):a(t)||""===t?t:e.changedCwd?i.resolve(e.cwd,t):i.resolve(t),"win32"===process.platform&&(n=n.replace(/\\/g,"/")),n}function m(e,t){return!!e.ignore.length&&e.ignore.some((function(e){return e.matcher.match(t)||!(!e.gmatcher||!e.gmatcher.match(t))}))}},function(e,t){e.exports=function e(t,n){if(t&&n)return e(t)(n);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((function(e){r[e]=t[e]})),r;function r(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];var r=t.apply(this,e),i=e[e.length-1];return"function"==typeof r&&r!==i&&Object.keys(i).forEach((function(e){r[e]=i[e]})),r}}},function(e,t,n){var r=n(26);function i(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function o(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},n=e.name||"Function wrapped with `once`";return t.onceError=n+" shouldn't be called more than once",t.called=!1,t}e.exports=r(i),e.exports.strict=r(o),i.proto=i((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return i(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return o(this)},configurable:!0})}))},function(e,t,n){"use strict";
/**
* @license Copyright 2016 The Lighthouse Authors. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/const r=n(60),i=n(65),o=n(4).EventEmitter,a="win32"===process.platform,s=process.browser,c={red:s?"crimson":1,yellow:s?"gold":3,cyan:s?"darkturquoise":6,green:s?"forestgreen":2,blue:s?"steelblue":4,magenta:s?"palevioletred":5};r.colors=[c.cyan,c.green,c.blue,c.magenta];const p={};let d;class l{static _logToStdErr(e,t){l.loggerfn(e)(...t)}static loggerfn(e){let t=p[e="LH:"+e];return t||(t=r(e),p[e]=t,e.endsWith("error")?t.color=c.red:e.endsWith("warn")&&(t.color=c.yellow)),t}static setLevel(e){switch(d=e,e){case"silent":r.enable("-LH:*");break;case"verbose":r.enable("LH:*");break;case"error":r.enable("-LH:*, LH:*:error");break;default:r.enable("LH:*, -LH:*:verbose")}}static formatProtocol(e,t,n){const r=!process||process.browser?1/0:process.stdout.columns,i=t.method||"?????",o=r-i.length-e.length-25,a=t.params&&"IO.read"!==i?JSON.stringify(t.params).substr(0,o):"";l._logToStdErr(`${e}:${n||""}`,[i,a])}static isVerbose(){return"verbose"===d}static time({msg:e,id:t,args:n=[]},r="log"){i.mark(t),l[r]("status",e,...n)}static timeEnd({msg:e,id:t,args:n=[]},r="verbose"){l[r]("statusEnd",e,...n),i.stop(t)}static log(e,...t){return l.events.issueStatus(e,t),l._logToStdErr(e,t)}static warn(e,...t){return l.events.issueWarning(e,t),l._logToStdErr(e+":warn",t)}static error(e,...t){return l._logToStdErr(e+":error",t)}static verbose(e,...t){return l.events.issueStatus(e,t),l._logToStdErr(e+":verbose",t)}static greenify(e){return`${l.green}${e}${l.reset}`}static redify(e){return`${l.red}${e}${l.reset}`}static get green(){return"[32m"}static get red(){return"[31m"}static get yellow(){return"[33m"}static get purple(){return"[95m"}static get reset(){return"[0m"}static get bold(){return"[1m"}static get dim(){return"[2m"}static get tick(){return a?"√":"✓"}static get cross(){return a?"×":"✘"}static get whiteSmallSquare(){return a?"·":"▫"}static get heavyHorizontal(){return a?"─":"━"}static get heavyVertical(){return a?"│ ":"┃ "}static get heavyUpAndRight(){return a?"└":"┗"}static get heavyVerticalAndRight(){return a?"├":"┣"}static get heavyDownAndHorizontal(){return a?"┬":"┳"}static get doubleLightHorizontal(){return"──"}}l.events=new class extends o{issueStatus(e,t){"status"!==e&&"statusEnd"!==e||this.emit(e,[e,...t])}issueWarning(e,t){this.emit("warning",[e,...t])}},l.takeTimeEntries=()=>{const e=i.getEntries();return i.clear(),e},l.getTimeEntries=()=>i.getEntries(),e.exports=l},function(e,t,n){var r;function i(e){function n(){if(n.enabled){var e=n,i=+new Date,o=i-(r||i);e.diff=o,e.prev=r,e.curr=i,r=i;for(var a=new Array(arguments.length),s=0;s<a.length;s++)a[s]=arguments[s];a[0]=t.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");var c=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,(function(n,r){if("%%"===n)return n;c++;var i=t.formatters[r];if("function"==typeof i){var o=a[c];n=i.call(e,o),a.splice(c,1),c--}return n})),t.formatArgs.call(e,a);var p=n.log||t.log||console.log.bind(console);p.apply(e,a)}}return n.namespace=e,n.enabled=t.enabled(e),n.useColors=t.useColors(),n.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),"function"==typeof t.init&&t.init(n),n}(t=e.exports=i.debug=i.default=i).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length,i=0;i<r;i++)n[i]&&("-"===(e=n[i].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(62),t.names=[],t.skips=[],t.formatters={}},function(e,t,n){"use strict";
/**
* @license Copyright 2017 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalAppDataPath=t.toWinDirFormat=t.makeTmpDir=t.getPlatform=t.ChromeNotInstalledError=t.UnsupportedPlatformError=t.InvalidUserDataDirectoryError=t.ChromePathNotSetError=t.LauncherError=t.delay=t.defaults=void 0;const i=n(1),o=n(3),a=n(66),s=n(67);t.defaults=function(e,t){return void 0===e?t:e},t.delay=function(e){return r(this,void 0,void 0,(function*(){return new Promise(t=>setTimeout(t,e))}))};class c extends Error{constructor(e="Unexpected error",t){return super(),this.message=e,this.code=t,this.stack=(new Error).stack,this}}t.LauncherError=c;t.ChromePathNotSetError=class extends c{constructor(){super(...arguments),this.message="The environment variable CHROME_PATH must be set to executable of a build of Chromium version 54.0 or later.",this.code="ERR_LAUNCHER_PATH_NOT_SET"}};t.InvalidUserDataDirectoryError=class extends c{constructor(){super(...arguments),this.message="userDataDir must be false or a path.",this.code="ERR_LAUNCHER_INVALID_USER_DATA_DIRECTORY"}};class p extends c{constructor(){super(...arguments),this.message=`Platform ${d()} is not supported.`,this.code="ERR_LAUNCHER_UNSUPPORTED_PLATFORM"}}t.UnsupportedPlatformError=p;function d(){return s?"wsl":process.platform}function l(e){const t=/\/mnt\/([a-z])\/Users\/([^\/:]+)\/AppData\//.exec(e)||[];return`/mnt/${t[1]}/Users/${t[2]}/AppData/Local`}t.ChromeNotInstalledError=class extends c{constructor(){super(...arguments),this.message="No Chrome installations found.",this.code="ERR_LAUNCHER_NOT_INSTALLED"}},t.getPlatform=d,t.makeTmpDir=function(){switch(d()){case"darwin":case"linux":return o.execSync("mktemp -d -t lighthouse.XXXXXXX").toString().trim();case"wsl":process.env.TEMP=l(""+process.env.PATH);case"win32":return function(){const e=process.env.TEMP||process.env.TMP||(process.env.SystemRoot||process.env.windir)+"\\temp",t=Math.floor(9e7*Math.random()+1e7),n=i.join(e,"lighthouse."+t);return a.sync(n),n}();default:throw new p}},t.toWinDirFormat=function(e=""){const t=/\/mnt\/([a-z])\//.exec(e);if(!t)return e;const n=t[1];return e.replace(`/mnt/${n}/`,n.toUpperCase()+":\\").replace(/\//g,"\\")},t.getLocalAppDataPath=l},function(e,t,n){"use strict";const r=n(9),i=n(16),o=n(32),a=n(72);function s(e,t){e.host=e.host||o.HOST,e.port=e.port||o.PORT,e.secure=!!e.secure,e.useHostName=!!e.useHostName,e.alterPath=e.alterPath||(e=>e);const n={...e};n.path=e.alterPath(e.path),a(e.secure?i:r,n,t)}function c(e){return(t,n)=>("function"==typeof t&&(n=t,t=void 0),t=t||{},"function"==typeof n?void e(t,n):new Promise((n,r)=>{e(t,(e,t)=>{e?r(e):n(t)})}))}e.exports.Protocol=c((function(e,t){if(e.local){const e=n(74);t(null,e)}else e.path="/json/protocol",s(e,(e,n)=>{e?t(e):t(null,JSON.parse(n))})})),e.exports.List=c((function(e,t){e.path="/json/list",s(e,(e,n)=>{e?t(e):t(null,JSON.parse(n))})})),e.exports.New=c((function(e,t){e.path="/json/new",Object.prototype.hasOwnProperty.call(e,"url")&&(e.path+="?"+e.url),s(e,(e,n)=>{e?t(e):t(null,JSON.parse(n))})})),e.exports.Activate=c((function(e,t){e.path="/json/activate/"+e.id,s(e,e=>{t(e||null)})})),e.exports.Close=c((function(e,t){e.path="/json/close/"+e.id,s(e,e=>{t(e||null)})})),e.exports.Version=c((function(e,t){e.path="/json/version",s(e,(e,n)=>{e?t(e):t(null,JSON.parse(n))})}))},function(e,t,n){"use strict";e.exports.HOST="localhost",e.exports.PORT=9222},function(e,t,n){"use strict";const r=n(4),i=n(16),o=n(9),a=n(6),s=n(18),{randomBytes:c,createHash:p}=n(7),{Readable:d}=n(19),{URL:l}=n(17),m=n(10),u=n(35),h=n(37),{BINARY_TYPES:f,EMPTY_BUFFER:g,GUID:y,kStatusCode:b,kWebSocket:v,NOOP:w}=n(5),{addEventListener:S,removeEventListener:x}=n(83),{format:I,parse:k}=n(38),{toBuffer:T}=n(11),R=["CONNECTING","OPEN","CLOSING","CLOSED"],_=[8,13];class C extends r{constructor(e,t,n){super(),this._binaryType=f[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage="",this._closeTimer=null,this._extensions={},this._protocol="",this._readyState=C.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,null!==e?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,Array.isArray(t)?t=t.join(", "):"object"==typeof t&&null!==t&&(n=t,t=void 0),function e(t,n,r,a){const s={protocolVersion:_[1],maxPayload:104857600,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...a,createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:void 0,host:void 0,path:void 0,port:void 0};if(!_.includes(s.protocolVersion))throw new RangeError(`Unsupported protocol version: ${s.protocolVersion} (supported versions: ${_.join(", ")})`);let d;n instanceof l?(d=n,t._url=n.href):(d=new l(n),t._url=n);const u="ws+unix:"===d.protocol;if(!(d.host||u&&d.pathname))throw new Error("Invalid URL: "+t.url);const h="wss:"===d.protocol||"https:"===d.protocol,f=h?443:80,g=c(16).toString("base64"),b=h?i.get:o.get;let v;s.createConnection=h?E:$,s.defaultPort=s.defaultPort||f,s.port=d.port||f,s.host=d.hostname.startsWith("[")?d.hostname.slice(1,-1):d.hostname,s.headers={"Sec-WebSocket-Version":s.protocolVersion,"Sec-WebSocket-Key":g,Connection:"Upgrade",Upgrade:"websocket",...s.headers},s.path=d.pathname+d.search,s.timeout=s.handshakeTimeout,s.perMessageDeflate&&(v=new m(!0!==s.perMessageDeflate?s.perMessageDeflate:{},!1,s.maxPayload),s.headers["Sec-WebSocket-Extensions"]=I({[m.extensionName]:v.offer()}));r&&(s.headers["Sec-WebSocket-Protocol"]=r);s.origin&&(s.protocolVersion<13?s.headers["Sec-WebSocket-Origin"]=s.origin:s.headers.Origin=s.origin);(d.username||d.password)&&(s.auth=`${d.username}:${d.password}`);if(u){const e=s.path.split(":");s.socketPath=e[0],s.path=e[1]}let w=t._req=b(s);s.timeout&&w.on("timeout",()=>{O(t,w,"Opening handshake has timed out")});w.on("error",e=>{null===w||w.aborted||(w=t._req=null,t._readyState=C.CLOSING,t.emit("error",e),t.emitClose())}),w.on("response",i=>{const o=i.headers.location,c=i.statusCode;if(o&&s.followRedirects&&c>=300&&c<400){if(++t._redirects>s.maxRedirects)return void O(t,w,"Maximum redirects exceeded");w.abort();const i=new l(o,n);e(t,i,r,a)}else t.emit("unexpected-response",w,i)||O(t,w,"Unexpected server response: "+i.statusCode)}),w.on("upgrade",(e,n,i)=>{if(t.emit("upgrade",e),t.readyState!==C.CONNECTING)return;w=t._req=null;const o=p("sha1").update(g+y).digest("base64");if(e.headers["sec-websocket-accept"]!==o)return void O(t,n,"Invalid Sec-WebSocket-Accept header");const a=e.headers["sec-websocket-protocol"],c=(r||"").split(/, */);let d;if(!r&&a?d="Server sent a subprotocol but none was requested":r&&!a?d="Server sent no subprotocol":a&&!c.includes(a)&&(d="Server sent an invalid subprotocol"),d)return void O(t,n,d);a&&(t._protocol=a);const l=e.headers["sec-websocket-extensions"];if(void 0!==l){if(!v){return void O(t,n,"Server sent a Sec-WebSocket-Extensions header but no extension was requested")}let e;try{e=k(l)}catch(e){return void O(t,n,"Invalid Sec-WebSocket-Extensions header")}const r=Object.keys(e);if(r.length){if(1!==r.length||r[0]!==m.extensionName){return void O(t,n,"Server indicated an extension that was not requested")}try{v.accept(e[m.extensionName])}catch(e){return void O(t,n,"Invalid Sec-WebSocket-Extensions header")}t._extensions[m.extensionName]=v}}t.setSocket(n,i,s.maxPayload)})}(this,e,t,n)):this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(e){f.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get onclose(){}set onclose(e){}get onerror(){}set onerror(e){}get onopen(){}set onopen(e){}get onmessage(){}set onmessage(e){}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,n){const r=new u(this.binaryType,this._extensions,this._isServer,n);this._sender=new h(e,this._extensions),this._receiver=r,this._socket=e,r[v]=this,e[v]=this,r.on("conclude",N),r.on("drain",P),r.on("error",j),r.on("message",L),r.on("ping",M),r.on("pong",q),e.setTimeout(0),e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",U),e.on("data",B),e.on("end",W),e.on("error",H),this._readyState=C.OPEN,this.emit("open")}emitClose(){if(!this._socket)return this._readyState=C.CLOSED,void this.emit("close",this._closeCode,this._closeMessage);this._extensions[m.extensionName]&&this._extensions[m.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=C.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==C.CLOSED){if(this.readyState===C.CONNECTING){const e="WebSocket was closed before the connection was established";return O(this,this._req,e)}this.readyState!==C.CLOSING?(this._readyState=C.CLOSING,this._sender.close(e,t,!this._isServer,e=>{e||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),3e4)):this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end()}}ping(e,t,n){if(this.readyState===C.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof e?(n=e,e=t=void 0):"function"==typeof t&&(n=t,t=void 0),"number"==typeof e&&(e=e.toString()),this.readyState===C.OPEN?(void 0===t&&(t=!this._isServer),this._sender.ping(e||g,t,n)):D(this,e,n)}pong(e,t,n){if(this.readyState===C.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof e?(n=e,e=t=void 0):"function"==typeof t&&(n=t,t=void 0),"number"==typeof e&&(e=e.toString()),this.readyState===C.OPEN?(void 0===t&&(t=!this._isServer),this._sender.pong(e||g,t,n)):D(this,e,n)}send(e,t,n){if(this.readyState===C.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if("function"==typeof t&&(n=t,t={}),"number"==typeof e&&(e=e.toString()),this.readyState!==C.OPEN)return void D(this,e,n);const r={binary:"string"!=typeof e,mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[m.extensionName]||(r.compress=!1),this._sender.send(e||g,r,n)}terminate(){if(this.readyState!==C.CLOSED){if(this.readyState===C.CONNECTING){const e="WebSocket was closed before the connection was established";return O(this,this._req,e)}this._socket&&(this._readyState=C.CLOSING,this._socket.destroy())}}}function $(e){return e.path=e.socketPath,a.connect(e)}function E(e){return e.path=void 0,e.servername||""===e.servername||(e.servername=a.isIP(e.host)?"":e.host),s.connect(e)}function O(e,t,n){e._readyState=C.CLOSING;const r=new Error(n);Error.captureStackTrace(r,O),t.setHeader?(t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),t.once("abort",e.emitClose.bind(e)),e.emit("error",r)):(t.destroy(r),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function D(e,t,n){if(t){const n=T(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(n){n(new Error(`WebSocket is not open: readyState ${e.readyState} (${R[e.readyState]})`))}}function N(e,t){const n=this[v];n._closeFrameReceived=!0,n._closeMessage=t,n._closeCode=e,void 0!==n._socket[v]&&(n._socket.removeListener("data",B),process.nextTick(F,n._socket),1005===e?n.close():n.close(e,t))}function P(){this[v]._socket.resume()}function j(e){const t=this[v];void 0!==t._socket[v]&&(t._socket.removeListener("data",B),process.nextTick(F,t._socket),t.close(e[b])),t.emit("error",e)}function A(){this[v].emitClose()}function L(e){this[v].emit("message",e)}function M(e){const t=this[v];t.pong(e,!t._isServer,w),t.emit("ping",e)}function q(e){this[v].emit("pong",e)}function F(e){e.resume()}function U(){const e=this[v];let t;this.removeListener("close",U),this.removeListener("data",B),this.removeListener("end",W),e._readyState=C.CLOSING,this._readableState.endEmitted||e._closeFrameReceived||e._receiver._writableState.errorEmitted||null===(t=e._socket.read())||e._receiver.write(t),e._receiver.end(),this[v]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",A),e._receiver.on("finish",A))}function B(e){this[v]._receiver.write(e)||this.pause()}function W(){const e=this[v];e._readyState=C.CLOSING,e._receiver.end(),this.end()}function H(){const e=this[v];this.removeListener("error",H),this.on("error",w),e&&(e._readyState=C.CLOSING,this.destroy())}Object.defineProperty(C,"CONNECTING",{enumerable:!0,value:R.indexOf("CONNECTING")}),Object.defineProperty(C.prototype,"CONNECTING",{enumerable:!0,value:R.indexOf("CONNECTING")}),Object.defineProperty(C,"OPEN",{enumerable:!0,value:R.indexOf("OPEN")}),Object.defineProperty(C.prototype,"OPEN",{enumerable:!0,value:R.indexOf("OPEN")}),Object.defineProperty(C,"CLOSING",{enumerable:!0,value:R.indexOf("CLOSING")}),Object.defineProperty(C.prototype,"CLOSING",{enumerable:!0,value:R.indexOf("CLOSING")}),Object.defineProperty(C,"CLOSED",{enumerable:!0,value:R.indexOf("CLOSED")}),Object.defineProperty(C.prototype,"CLOSED",{enumerable:!0,value:R.indexOf("CLOSED")}),["binaryType","bufferedAmount","extensions","protocol","readyState","url"].forEach(e=>{Object.defineProperty(C.prototype,e,{enumerable:!0})}),["open","error","close","message"].forEach(e=>{Object.defineProperty(C.prototype,"on"+e,{enumerable:!0,get(){const t=this.listeners(e);for(let e=0;e<t.length;e++)if(t[e]._listener)return t[e]._listener},set(t){const n=this.listeners(e);for(let t=0;t<n.length;t++)n[t]._listener&&this.removeListener(e,n[t]);this.addEventListener(e,t)}})}),C.prototype.addEventListener=S,C.prototype.removeEventListener=x,e.exports=C},function(e,t,n){var r=n(0),i=n(1),o=n(15),a=require,s=process.config&&process.config.variables||{},c=!!process.env.PREBUILDS_ONLY,p=process.versions.modules,d=!(!process.versions||!process.versions.electron)||!!process.env.ELECTRON_RUN_AS_NODE||"undefined"!=typeof window&&window.process&&"renderer"===window.process.type?"electron":"node",l=o.arch(),m=o.platform(),u=process.env.LIBC||(function(e){return"linux"===e&&r.existsSync("/etc/alpine-release")}(m)?"musl":"glibc"),h=process.env.ARM_VERSION||("arm64"===l?"8":s.arm_version)||"",f=(process.versions.uv||"").split(".")[0];function g(e){return a(g.path(e))}function y(e){try{return r.readdirSync(e)}catch(e){return[]}}function b(e,t){var n=y(e).filter(t);return n[0]&&i.join(e,n[0])}function v(e){return/\.node$/.test(e)}function w(e){var t=e.split("-");if(2===t.length){var n=t[0],r=t[1].split("+");if(n&&r.length&&r.every(Boolean))return{name:e,platform:n,architectures:r}}}function S(e,t){return function(n){return null!=n&&(n.platform===e&&n.architectures.includes(t))}}function x(e,t){return e.architectures.length-t.architectures.length}function I(e){var t=e.split("."),n={file:e,specificity:0};if("node"===t.pop()){for(var r=0;r<t.length;r++){var i=t[r];if("node"===i||"electron"===i||"node-webkit"===i)n.runtime=i;else if("napi"===i)n.napi=!0;else if("abi"===i.slice(0,3))n.abi=i.slice(3);else if("uv"===i.slice(0,2))n.uv=i.slice(2);else if("armv"===i.slice(0,4))n.armv=i.slice(4);else{if("glibc"!==i&&"musl"!==i)continue;n.libc=i}n.specificity++}return n}}function k(e,t){return function(n){return null!=n&&(!(n.runtime!==e&&!function(e){return"node"===e.runtime&&e.napi}(n))&&(!(n.abi!==t&&!n.napi)&&((!n.uv||n.uv===f)&&((!n.armv||n.armv===h)&&(!n.libc||n.libc===u)))))}}function T(e){return function(t,n){return t.runtime!==n.runtime?t.runtime===e?-1:1:t.abi!==n.abi?t.abi?-1:1:t.specificity!==n.specificity?t.specificity>n.specificity?-1:1:0}}e.exports=g,g.path=function(e){e=i.resolve(e||".");try{var t=a(i.join(e,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[t+"_PREBUILD"]&&(e=process.env[t+"_PREBUILD"])}catch(e){}if(!c){var n=b(i.join(e,"build/Release"),v);if(n)return n;var r=b(i.join(e,"build/Debug"),v);if(r)return r}var o=R(e);if(o)return o;var s=R(i.dirname(process.execPath));if(s)return s;var g=["platform="+m,"arch="+l,"runtime="+d,"abi="+p,"uv="+f,h?"armv="+h:"","libc=